target
stringlengths
5
300
feat_repo_name
stringlengths
6
76
text
stringlengths
26
1.05M
client/index.js
zmiftah/freecodecamp
import Rx from 'rx'; import React from 'react'; import Fetchr from 'fetchr'; import debugFactory from 'debug'; import { Router } from 'react-router'; import { history } from 'react-router/lib/BrowserHistory'; import { hydrate } from 'thundercats'; import { Render } from 'thundercats-react'; import { app$ } from '../common/app'; const debug = debugFactory('fcc:client'); const DOMContianer = document.getElementById('fcc'); const catState = window.__fcc__.data || {}; const services = new Fetchr({ xhrPath: '/services' }); Rx.longStackSupport = !!debug.enabled; // returns an observable app$(history) .flatMap( ({ AppCat }) => { const appCat = AppCat(null, services); return hydrate(appCat, catState) .map(() => appCat); }, ({ initialState }, appCat) => ({ initialState, appCat }) ) .flatMap(({ initialState, appCat }) => { return Render( appCat, React.createElement(Router, initialState), DOMContianer ); }) .subscribe( () => { debug('react rendered'); }, err => { debug('an error has occured', err.stack); }, () => { debug('react closed subscription'); } );
ajax/libs/webshim/1.15.0/dev/shims/moxie/js/moxie-swf.js
maxklenk/cdnjs
/** * mOxie - multi-runtime File API & XMLHttpRequest L2 Polyfill * v1.2.1 * * Copyright 2013, Moxiecode Systems AB * Released under GPL License. * * License: http://www.plupload.com/license * Contributing: http://www.plupload.com/contributing * * Date: 2014-05-14 */ /** * Compiled inline version. (Library mode) */ /*jshint smarttabs:true, undef:true, latedef:true, curly:true, bitwise:true, camelcase:true */ /*globals $code */ (function(exports, undefined) { "use strict"; var modules = {}; function require(ids, callback) { var module, defs = []; for (var i = 0; i < ids.length; ++i) { module = modules[ids[i]] || resolve(ids[i]); if (!module) { throw 'module definition dependecy not found: ' + ids[i]; } defs.push(module); } callback.apply(null, defs); } function define(id, dependencies, definition) { if (typeof id !== 'string') { throw 'invalid module definition, module id must be defined and be a string'; } if (dependencies === undefined) { throw 'invalid module definition, dependencies must be specified'; } if (definition === undefined) { throw 'invalid module definition, definition function must be specified'; } require(dependencies, function() { modules[id] = definition.apply(null, arguments); }); } function defined(id) { return !!modules[id]; } function resolve(id) { var target = exports; var fragments = id.split(/[.\/]/); for (var fi = 0; fi < fragments.length; ++fi) { if (!target[fragments[fi]]) { return; } target = target[fragments[fi]]; } return target; } function expose(ids) { for (var i = 0; i < ids.length; i++) { var target = exports; var id = ids[i]; var fragments = id.split(/[.\/]/); for (var fi = 0; fi < fragments.length - 1; ++fi) { if (target[fragments[fi]] === undefined) { target[fragments[fi]] = {}; } target = target[fragments[fi]]; } target[fragments[fragments.length - 1]] = modules[id]; } } // Included from: src/javascript/core/utils/Basic.js /** * Basic.js * * Copyright 2013, Moxiecode Systems AB * Released under GPL License. * * License: http://www.plupload.com/license * Contributing: http://www.plupload.com/contributing */ define('moxie/core/utils/Basic', [], function() { /** Gets the true type of the built-in object (better version of typeof). @author Angus Croll (http://javascriptweblog.wordpress.com/) @method typeOf @for Utils @static @param {Object} o Object to check. @return {String} Object [[Class]] */ var typeOf = function(o) { var undef; if (o === undef) { return 'undefined'; } else if (o === null) { return 'null'; } else if (o.nodeType) { return 'node'; } // the snippet below is awesome, however it fails to detect null, undefined and arguments types in IE lte 8 return ({}).toString.call(o).match(/\s([a-z|A-Z]+)/)[1].toLowerCase(); }; /** Extends the specified object with another object. @method extend @static @param {Object} target Object to extend. @param {Object} [obj]* Multiple objects to extend with. @return {Object} Same as target, the extended object. */ var extend = function(target) { var undef; each(arguments, function(arg, i) { if (i > 0) { each(arg, function(value, key) { if (value !== undef) { if (typeOf(target[key]) === typeOf(value) && !!~inArray(typeOf(value), ['array', 'object'])) { extend(target[key], value); } else { target[key] = value; } } }); } }); return target; }; /** Executes the callback function for each item in array/object. If you return false in the callback it will break the loop. @method each @static @param {Object} obj Object to iterate. @param {function} callback Callback function to execute for each item. */ var each = function(obj, callback) { var length, key, i, undef; if (obj) { try { length = obj.length; } catch(ex) { length = undef; } if (length === undef) { // Loop object items for (key in obj) { if (obj.hasOwnProperty(key)) { if (callback(obj[key], key) === false) { return; } } } } else { // Loop array items for (i = 0; i < length; i++) { if (callback(obj[i], i) === false) { return; } } } } }; /** Checks if object is empty. @method isEmptyObj @static @param {Object} o Object to check. @return {Boolean} */ var isEmptyObj = function(obj) { var prop; if (!obj || typeOf(obj) !== 'object') { return true; } for (prop in obj) { return false; } return true; }; /** Recieve an array of functions (usually async) to call in sequence, each function receives a callback as first argument that it should call, when it completes. Finally, after everything is complete, main callback is called. Passing truthy value to the callback as a first argument will interrupt the sequence and invoke main callback immediately. @method inSeries @static @param {Array} queue Array of functions to call in sequence @param {Function} cb Main callback that is called in the end, or in case of error */ var inSeries = function(queue, cb) { var i = 0, length = queue.length; if (typeOf(cb) !== 'function') { cb = function() {}; } if (!queue || !queue.length) { cb(); } function callNext(i) { if (typeOf(queue[i]) === 'function') { queue[i](function(error) { /*jshint expr:true */ ++i < length && !error ? callNext(i) : cb(error); }); } } callNext(i); }; /** Recieve an array of functions (usually async) to call in parallel, each function receives a callback as first argument that it should call, when it completes. After everything is complete, main callback is called. Passing truthy value to the callback as a first argument will interrupt the process and invoke main callback immediately. @method inParallel @static @param {Array} queue Array of functions to call in sequence @param {Function} cb Main callback that is called in the end, or in case of erro */ var inParallel = function(queue, cb) { var count = 0, num = queue.length, cbArgs = new Array(num); each(queue, function(fn, i) { fn(function(error) { if (error) { return cb(error); } var args = [].slice.call(arguments); args.shift(); // strip error - undefined or not cbArgs[i] = args; count++; if (count === num) { cbArgs.unshift(null); cb.apply(this, cbArgs); } }); }); }; /** Find an element in array and return it's index if present, otherwise return -1. @method inArray @static @param {Mixed} needle Element to find @param {Array} array @return {Int} Index of the element, or -1 if not found */ var inArray = function(needle, array) { if (array) { if (Array.prototype.indexOf) { return Array.prototype.indexOf.call(array, needle); } for (var i = 0, length = array.length; i < length; i++) { if (array[i] === needle) { return i; } } } return -1; }; /** Returns elements of first array if they are not present in second. And false - otherwise. @private @method arrayDiff @param {Array} needles @param {Array} array @return {Array|Boolean} */ var arrayDiff = function(needles, array) { var diff = []; if (typeOf(needles) !== 'array') { needles = [needles]; } if (typeOf(array) !== 'array') { array = [array]; } for (var i in needles) { if (inArray(needles[i], array) === -1) { diff.push(needles[i]); } } return diff.length ? diff : false; }; /** Find intersection of two arrays. @private @method arrayIntersect @param {Array} array1 @param {Array} array2 @return {Array} Intersection of two arrays or null if there is none */ var arrayIntersect = function(array1, array2) { var result = []; each(array1, function(item) { if (inArray(item, array2) !== -1) { result.push(item); } }); return result.length ? result : null; }; /** Forces anything into an array. @method toArray @static @param {Object} obj Object with length field. @return {Array} Array object containing all items. */ var toArray = function(obj) { var i, arr = []; for (i = 0; i < obj.length; i++) { arr[i] = obj[i]; } return arr; }; /** Generates an unique ID. This is 99.99% unique since it takes the current time and 5 random numbers. The only way a user would be able to get the same ID is if the two persons at the same exact milisecond manages to get 5 the same random numbers between 0-65535 it also uses a counter so each call will be guaranteed to be page unique. It's more probable for the earth to be hit with an ansteriod. Y @method guid @static @param {String} prefix to prepend (by default 'o' will be prepended). @method guid @return {String} Virtually unique id. */ var guid = (function() { var counter = 0; return function(prefix) { var guid = new Date().getTime().toString(32), i; for (i = 0; i < 5; i++) { guid += Math.floor(Math.random() * 65535).toString(32); } return (prefix || 'o_') + guid + (counter++).toString(32); }; }()); /** Trims white spaces around the string @method trim @static @param {String} str @return {String} */ var trim = function(str) { if (!str) { return str; } return String.prototype.trim ? String.prototype.trim.call(str) : str.toString().replace(/^\s*/, '').replace(/\s*$/, ''); }; /** Parses the specified size string into a byte value. For example 10kb becomes 10240. @method parseSizeStr @static @param {String/Number} size String to parse or number to just pass through. @return {Number} Size in bytes. */ var parseSizeStr = function(size) { if (typeof(size) !== 'string') { return size; } var muls = { t: 1099511627776, g: 1073741824, m: 1048576, k: 1024 }, mul; size = /^([0-9]+)([mgk]?)$/.exec(size.toLowerCase().replace(/[^0-9mkg]/g, '')); mul = size[2]; size = +size[1]; if (muls.hasOwnProperty(mul)) { size *= muls[mul]; } return size; }; return { guid: guid, typeOf: typeOf, extend: extend, each: each, isEmptyObj: isEmptyObj, inSeries: inSeries, inParallel: inParallel, inArray: inArray, arrayDiff: arrayDiff, arrayIntersect: arrayIntersect, toArray: toArray, trim: trim, parseSizeStr: parseSizeStr }; }); // Included from: src/javascript/core/I18n.js /** * I18n.js * * Copyright 2013, Moxiecode Systems AB * Released under GPL License. * * License: http://www.plupload.com/license * Contributing: http://www.plupload.com/contributing */ define("moxie/core/I18n", [ "moxie/core/utils/Basic" ], function(Basic) { var i18n = {}; return { /** * Extends the language pack object with new items. * * @param {Object} pack Language pack items to add. * @return {Object} Extended language pack object. */ addI18n: function(pack) { return Basic.extend(i18n, pack); }, /** * Translates the specified string by checking for the english string in the language pack lookup. * * @param {String} str String to look for. * @return {String} Translated string or the input string if it wasn't found. */ translate: function(str) { return i18n[str] || str; }, /** * Shortcut for translate function * * @param {String} str String to look for. * @return {String} Translated string or the input string if it wasn't found. */ _: function(str) { return this.translate(str); }, /** * Pseudo sprintf implementation - simple way to replace tokens with specified values. * * @param {String} str String with tokens * @return {String} String with replaced tokens */ sprintf: function(str) { var args = [].slice.call(arguments, 1); return str.replace(/%[a-z]/g, function() { var value = args.shift(); return Basic.typeOf(value) !== 'undefined' ? value : ''; }); } }; }); // Included from: src/javascript/core/utils/Mime.js /** * Mime.js * * Copyright 2013, Moxiecode Systems AB * Released under GPL License. * * License: http://www.plupload.com/license * Contributing: http://www.plupload.com/contributing */ define("moxie/core/utils/Mime", [ "moxie/core/utils/Basic", "moxie/core/I18n" ], function(Basic, I18n) { var mimeData = "" + "application/msword,doc dot," + "application/pdf,pdf," + "application/pgp-signature,pgp," + "application/postscript,ps ai eps," + "application/rtf,rtf," + "application/vnd.ms-excel,xls xlb," + "application/vnd.ms-powerpoint,ppt pps pot," + "application/zip,zip," + "application/x-shockwave-flash,swf swfl," + "application/vnd.openxmlformats-officedocument.wordprocessingml.document,docx," + "application/vnd.openxmlformats-officedocument.wordprocessingml.template,dotx," + "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet,xlsx," + "application/vnd.openxmlformats-officedocument.presentationml.presentation,pptx," + "application/vnd.openxmlformats-officedocument.presentationml.template,potx," + "application/vnd.openxmlformats-officedocument.presentationml.slideshow,ppsx," + "application/x-javascript,js," + "application/json,json," + "audio/mpeg,mp3 mpga mpega mp2," + "audio/x-wav,wav," + "audio/x-m4a,m4a," + "audio/ogg,oga ogg," + "audio/aiff,aiff aif," + "audio/flac,flac," + "audio/aac,aac," + "audio/ac3,ac3," + "audio/x-ms-wma,wma," + "image/bmp,bmp," + "image/gif,gif," + "image/jpeg,jpg jpeg jpe," + "image/photoshop,psd," + "image/png,png," + "image/svg+xml,svg svgz," + "image/tiff,tiff tif," + "text/plain,asc txt text diff log," + "text/html,htm html xhtml," + "text/css,css," + "text/csv,csv," + "text/rtf,rtf," + "video/mpeg,mpeg mpg mpe m2v," + "video/quicktime,qt mov," + "video/mp4,mp4," + "video/x-m4v,m4v," + "video/x-flv,flv," + "video/x-ms-wmv,wmv," + "video/avi,avi," + "video/webm,webm," + "video/3gpp,3gpp 3gp," + "video/3gpp2,3g2," + "video/vnd.rn-realvideo,rv," + "video/ogg,ogv," + "video/x-matroska,mkv," + "application/vnd.oasis.opendocument.formula-template,otf," + "application/octet-stream,exe"; var Mime = { mimes: {}, extensions: {}, // Parses the default mime types string into a mimes and extensions lookup maps addMimeType: function (mimeData) { var items = mimeData.split(/,/), i, ii, ext; for (i = 0; i < items.length; i += 2) { ext = items[i + 1].split(/ /); // extension to mime lookup for (ii = 0; ii < ext.length; ii++) { this.mimes[ext[ii]] = items[i]; } // mime to extension lookup this.extensions[items[i]] = ext; } }, extList2mimes: function (filters, addMissingExtensions) { var self = this, ext, i, ii, type, mimes = []; // convert extensions to mime types list for (i = 0; i < filters.length; i++) { ext = filters[i].extensions.split(/\s*,\s*/); for (ii = 0; ii < ext.length; ii++) { // if there's an asterisk in the list, then accept attribute is not required if (ext[ii] === '*') { return []; } type = self.mimes[ext[ii]]; if (!type) { if (addMissingExtensions && /^\w+$/.test(ext[ii])) { mimes.push('.' + ext[ii]); } else { return []; // accept all } } else if (Basic.inArray(type, mimes) === -1) { mimes.push(type); } } } return mimes; }, mimes2exts: function(mimes) { var self = this, exts = []; Basic.each(mimes, function(mime) { if (mime === '*') { exts = []; return false; } // check if this thing looks like mime type var m = mime.match(/^(\w+)\/(\*|\w+)$/); if (m) { if (m[2] === '*') { // wildcard mime type detected Basic.each(self.extensions, function(arr, mime) { if ((new RegExp('^' + m[1] + '/')).test(mime)) { [].push.apply(exts, self.extensions[mime]); } }); } else if (self.extensions[mime]) { [].push.apply(exts, self.extensions[mime]); } } }); return exts; }, mimes2extList: function(mimes) { var accept = [], exts = []; if (Basic.typeOf(mimes) === 'string') { mimes = Basic.trim(mimes).split(/\s*,\s*/); } exts = this.mimes2exts(mimes); accept.push({ title: I18n.translate('Files'), extensions: exts.length ? exts.join(',') : '*' }); // save original mimes string accept.mimes = mimes; return accept; }, getFileExtension: function(fileName) { var matches = fileName && fileName.match(/\.([^.]+)$/); if (matches) { return matches[1].toLowerCase(); } return ''; }, getFileMime: function(fileName) { return this.mimes[this.getFileExtension(fileName)] || ''; } }; Mime.addMimeType(mimeData); return Mime; }); // Included from: src/javascript/core/utils/Env.js /** * Env.js * * Copyright 2013, Moxiecode Systems AB * Released under GPL License. * * License: http://www.plupload.com/license * Contributing: http://www.plupload.com/contributing */ define("moxie/core/utils/Env", [ "moxie/core/utils/Basic" ], function(Basic) { // UAParser.js v0.6.2 // Lightweight JavaScript-based User-Agent string parser // https://github.com/faisalman/ua-parser-js // // Copyright © 2012-2013 Faisalman <fyzlman@gmail.com> // Dual licensed under GPLv2 & MIT var UAParser = (function (undefined) { ////////////// // Constants ///////////// var EMPTY = '', UNKNOWN = '?', FUNC_TYPE = 'function', UNDEF_TYPE = 'undefined', OBJ_TYPE = 'object', MAJOR = 'major', MODEL = 'model', NAME = 'name', TYPE = 'type', VENDOR = 'vendor', VERSION = 'version', ARCHITECTURE= 'architecture', CONSOLE = 'console', MOBILE = 'mobile', TABLET = 'tablet'; /////////// // Helper ////////// var util = { has : function (str1, str2) { return str2.toLowerCase().indexOf(str1.toLowerCase()) !== -1; }, lowerize : function (str) { return str.toLowerCase(); } }; /////////////// // Map helper ////////////// var mapper = { rgx : function () { // loop through all regexes maps for (var result, i = 0, j, k, p, q, matches, match, args = arguments; i < args.length; i += 2) { var regex = args[i], // even sequence (0,2,4,..) props = args[i + 1]; // odd sequence (1,3,5,..) // construct object barebones if (typeof(result) === UNDEF_TYPE) { result = {}; for (p in props) { q = props[p]; if (typeof(q) === OBJ_TYPE) { result[q[0]] = undefined; } else { result[q] = undefined; } } } // try matching uastring with regexes for (j = k = 0; j < regex.length; j++) { matches = regex[j].exec(this.getUA()); if (!!matches) { for (p = 0; p < props.length; p++) { match = matches[++k]; q = props[p]; // check if given property is actually array if (typeof(q) === OBJ_TYPE && q.length > 0) { if (q.length == 2) { if (typeof(q[1]) == FUNC_TYPE) { // assign modified match result[q[0]] = q[1].call(this, match); } else { // assign given value, ignore regex match result[q[0]] = q[1]; } } else if (q.length == 3) { // check whether function or regex if (typeof(q[1]) === FUNC_TYPE && !(q[1].exec && q[1].test)) { // call function (usually string mapper) result[q[0]] = match ? q[1].call(this, match, q[2]) : undefined; } else { // sanitize match using given regex result[q[0]] = match ? match.replace(q[1], q[2]) : undefined; } } else if (q.length == 4) { result[q[0]] = match ? q[3].call(this, match.replace(q[1], q[2])) : undefined; } } else { result[q] = match ? match : undefined; } } break; } } if(!!matches) break; // break the loop immediately if match found } return result; }, str : function (str, map) { for (var i in map) { // check if array if (typeof(map[i]) === OBJ_TYPE && map[i].length > 0) { for (var j = 0; j < map[i].length; j++) { if (util.has(map[i][j], str)) { return (i === UNKNOWN) ? undefined : i; } } } else if (util.has(map[i], str)) { return (i === UNKNOWN) ? undefined : i; } } return str; } }; /////////////// // String map ////////////// var maps = { browser : { oldsafari : { major : { '1' : ['/8', '/1', '/3'], '2' : '/4', '?' : '/' }, version : { '1.0' : '/8', '1.2' : '/1', '1.3' : '/3', '2.0' : '/412', '2.0.2' : '/416', '2.0.3' : '/417', '2.0.4' : '/419', '?' : '/' } } }, device : { sprint : { model : { 'Evo Shift 4G' : '7373KT' }, vendor : { 'HTC' : 'APA', 'Sprint' : 'Sprint' } } }, os : { windows : { version : { 'ME' : '4.90', 'NT 3.11' : 'NT3.51', 'NT 4.0' : 'NT4.0', '2000' : 'NT 5.0', 'XP' : ['NT 5.1', 'NT 5.2'], 'Vista' : 'NT 6.0', '7' : 'NT 6.1', '8' : 'NT 6.2', '8.1' : 'NT 6.3', 'RT' : 'ARM' } } } }; ////////////// // Regex map ///////////// var regexes = { browser : [[ // Presto based /(opera\smini)\/((\d+)?[\w\.-]+)/i, // Opera Mini /(opera\s[mobiletab]+).+version\/((\d+)?[\w\.-]+)/i, // Opera Mobi/Tablet /(opera).+version\/((\d+)?[\w\.]+)/i, // Opera > 9.80 /(opera)[\/\s]+((\d+)?[\w\.]+)/i // Opera < 9.80 ], [NAME, VERSION, MAJOR], [ /\s(opr)\/((\d+)?[\w\.]+)/i // Opera Webkit ], [[NAME, 'Opera'], VERSION, MAJOR], [ // Mixed /(kindle)\/((\d+)?[\w\.]+)/i, // Kindle /(lunascape|maxthon|netfront|jasmine|blazer)[\/\s]?((\d+)?[\w\.]+)*/i, // Lunascape/Maxthon/Netfront/Jasmine/Blazer // Trident based /(avant\s|iemobile|slim|baidu)(?:browser)?[\/\s]?((\d+)?[\w\.]*)/i, // Avant/IEMobile/SlimBrowser/Baidu /(?:ms|\()(ie)\s((\d+)?[\w\.]+)/i, // Internet Explorer // Webkit/KHTML based /(rekonq)((?:\/)[\w\.]+)*/i, // Rekonq /(chromium|flock|rockmelt|midori|epiphany|silk|skyfire|ovibrowser|bolt|iron)\/((\d+)?[\w\.-]+)/i // Chromium/Flock/RockMelt/Midori/Epiphany/Silk/Skyfire/Bolt/Iron ], [NAME, VERSION, MAJOR], [ /(trident).+rv[:\s]((\d+)?[\w\.]+).+like\sgecko/i // IE11 ], [[NAME, 'IE'], VERSION, MAJOR], [ /(yabrowser)\/((\d+)?[\w\.]+)/i // Yandex ], [[NAME, 'Yandex'], VERSION, MAJOR], [ /(comodo_dragon)\/((\d+)?[\w\.]+)/i // Comodo Dragon ], [[NAME, /_/g, ' '], VERSION, MAJOR], [ /(chrome|omniweb|arora|[tizenoka]{5}\s?browser)\/v?((\d+)?[\w\.]+)/i // Chrome/OmniWeb/Arora/Tizen/Nokia ], [NAME, VERSION, MAJOR], [ /(dolfin)\/((\d+)?[\w\.]+)/i // Dolphin ], [[NAME, 'Dolphin'], VERSION, MAJOR], [ /((?:android.+)crmo|crios)\/((\d+)?[\w\.]+)/i // Chrome for Android/iOS ], [[NAME, 'Chrome'], VERSION, MAJOR], [ /((?:android.+))version\/((\d+)?[\w\.]+)\smobile\ssafari/i // Android Browser ], [[NAME, 'Android Browser'], VERSION, MAJOR], [ /version\/((\d+)?[\w\.]+).+?mobile\/\w+\s(safari)/i // Mobile Safari ], [VERSION, MAJOR, [NAME, 'Mobile Safari']], [ /version\/((\d+)?[\w\.]+).+?(mobile\s?safari|safari)/i // Safari & Safari Mobile ], [VERSION, MAJOR, NAME], [ /webkit.+?(mobile\s?safari|safari)((\/[\w\.]+))/i // Safari < 3.0 ], [NAME, [MAJOR, mapper.str, maps.browser.oldsafari.major], [VERSION, mapper.str, maps.browser.oldsafari.version]], [ /(konqueror)\/((\d+)?[\w\.]+)/i, // Konqueror /(webkit|khtml)\/((\d+)?[\w\.]+)/i ], [NAME, VERSION, MAJOR], [ // Gecko based /(navigator|netscape)\/((\d+)?[\w\.-]+)/i // Netscape ], [[NAME, 'Netscape'], VERSION, MAJOR], [ /(swiftfox)/i, // Swiftfox /(icedragon|iceweasel|camino|chimera|fennec|maemo\sbrowser|minimo|conkeror)[\/\s]?((\d+)?[\w\.\+]+)/i, // IceDragon/Iceweasel/Camino/Chimera/Fennec/Maemo/Minimo/Conkeror /(firefox|seamonkey|k-meleon|icecat|iceape|firebird|phoenix)\/((\d+)?[\w\.-]+)/i, // Firefox/SeaMonkey/K-Meleon/IceCat/IceApe/Firebird/Phoenix /(mozilla)\/((\d+)?[\w\.]+).+rv\:.+gecko\/\d+/i, // Mozilla // Other /(uc\s?browser|polaris|lynx|dillo|icab|doris|amaya|w3m|netsurf|qqbrowser)[\/\s]?((\d+)?[\w\.]+)/i, // UCBrowser/Polaris/Lynx/Dillo/iCab/Doris/Amaya/w3m/NetSurf/QQBrowser /(links)\s\(((\d+)?[\w\.]+)/i, // Links /(gobrowser)\/?((\d+)?[\w\.]+)*/i, // GoBrowser /(ice\s?browser)\/v?((\d+)?[\w\._]+)/i, // ICE Browser /(mosaic)[\/\s]((\d+)?[\w\.]+)/i // Mosaic ], [NAME, VERSION, MAJOR] ], engine : [[ /(presto)\/([\w\.]+)/i, // Presto /(webkit|trident|netfront|netsurf|amaya|lynx|w3m)\/([\w\.]+)/i, // WebKit/Trident/NetFront/NetSurf/Amaya/Lynx/w3m /(khtml|tasman|links)[\/\s]\(?([\w\.]+)/i, // KHTML/Tasman/Links /(icab)[\/\s]([23]\.[\d\.]+)/i // iCab ], [NAME, VERSION], [ /rv\:([\w\.]+).*(gecko)/i // Gecko ], [VERSION, NAME] ], os : [[ // Windows based /(windows)\snt\s6\.2;\s(arm)/i, // Windows RT /(windows\sphone(?:\sos)*|windows\smobile|windows)[\s\/]?([ntce\d\.\s]+\w)/i ], [NAME, [VERSION, mapper.str, maps.os.windows.version]], [ /(win(?=3|9|n)|win\s9x\s)([nt\d\.]+)/i ], [[NAME, 'Windows'], [VERSION, mapper.str, maps.os.windows.version]], [ // Mobile/Embedded OS /\((bb)(10);/i // BlackBerry 10 ], [[NAME, 'BlackBerry'], VERSION], [ /(blackberry)\w*\/?([\w\.]+)*/i, // Blackberry /(tizen)\/([\w\.]+)/i, // Tizen /(android|webos|palm\os|qnx|bada|rim\stablet\sos|meego)[\/\s-]?([\w\.]+)*/i // Android/WebOS/Palm/QNX/Bada/RIM/MeeGo ], [NAME, VERSION], [ /(symbian\s?os|symbos|s60(?=;))[\/\s-]?([\w\.]+)*/i // Symbian ], [[NAME, 'Symbian'], VERSION],[ /mozilla.+\(mobile;.+gecko.+firefox/i // Firefox OS ], [[NAME, 'Firefox OS'], VERSION], [ // Console /(nintendo|playstation)\s([wids3portablevu]+)/i, // Nintendo/Playstation // GNU/Linux based /(mint)[\/\s\(]?(\w+)*/i, // Mint /(joli|[kxln]?ubuntu|debian|[open]*suse|gentoo|arch|slackware|fedora|mandriva|centos|pclinuxos|redhat|zenwalk)[\/\s-]?([\w\.-]+)*/i, // Joli/Ubuntu/Debian/SUSE/Gentoo/Arch/Slackware // Fedora/Mandriva/CentOS/PCLinuxOS/RedHat/Zenwalk /(hurd|linux)\s?([\w\.]+)*/i, // Hurd/Linux /(gnu)\s?([\w\.]+)*/i // GNU ], [NAME, VERSION], [ /(cros)\s[\w]+\s([\w\.]+\w)/i // Chromium OS ], [[NAME, 'Chromium OS'], VERSION],[ // Solaris /(sunos)\s?([\w\.]+\d)*/i // Solaris ], [[NAME, 'Solaris'], VERSION], [ // BSD based /\s([frentopc-]{0,4}bsd|dragonfly)\s?([\w\.]+)*/i // FreeBSD/NetBSD/OpenBSD/PC-BSD/DragonFly ], [NAME, VERSION],[ /(ip[honead]+)(?:.*os\s*([\w]+)*\slike\smac|;\sopera)/i // iOS ], [[NAME, 'iOS'], [VERSION, /_/g, '.']], [ /(mac\sos\sx)\s?([\w\s\.]+\w)*/i // Mac OS ], [NAME, [VERSION, /_/g, '.']], [ // Other /(haiku)\s(\w+)/i, // Haiku /(aix)\s((\d)(?=\.|\)|\s)[\w\.]*)*/i, // AIX /(macintosh|mac(?=_powerpc)|plan\s9|minix|beos|os\/2|amigaos|morphos|risc\sos)/i, // Plan9/Minix/BeOS/OS2/AmigaOS/MorphOS/RISCOS /(unix)\s?([\w\.]+)*/i // UNIX ], [NAME, VERSION] ] }; ///////////////// // Constructor //////////////// var UAParser = function (uastring) { var ua = uastring || ((window && window.navigator && window.navigator.userAgent) ? window.navigator.userAgent : EMPTY); this.getBrowser = function () { return mapper.rgx.apply(this, regexes.browser); }; this.getEngine = function () { return mapper.rgx.apply(this, regexes.engine); }; this.getOS = function () { return mapper.rgx.apply(this, regexes.os); }; this.getResult = function() { return { ua : this.getUA(), browser : this.getBrowser(), engine : this.getEngine(), os : this.getOS() }; }; this.getUA = function () { return ua; }; this.setUA = function (uastring) { ua = uastring; return this; }; this.setUA(ua); }; return new UAParser().getResult(); })(); function version_compare(v1, v2, operator) { // From: http://phpjs.org/functions // + original by: Philippe Jausions (http://pear.php.net/user/jausions) // + original by: Aidan Lister (http://aidanlister.com/) // + reimplemented by: Kankrelune (http://www.webfaktory.info/) // + improved by: Brett Zamir (http://brett-zamir.me) // + improved by: Scott Baker // + improved by: Theriault // * example 1: version_compare('8.2.5rc', '8.2.5a'); // * returns 1: 1 // * example 2: version_compare('8.2.50', '8.2.52', '<'); // * returns 2: true // * example 3: version_compare('5.3.0-dev', '5.3.0'); // * returns 3: -1 // * example 4: version_compare('4.1.0.52','4.01.0.51'); // * returns 4: 1 // Important: compare must be initialized at 0. var i = 0, x = 0, compare = 0, // vm maps textual PHP versions to negatives so they're less than 0. // PHP currently defines these as CASE-SENSITIVE. It is important to // leave these as negatives so that they can come before numerical versions // and as if no letters were there to begin with. // (1alpha is < 1 and < 1.1 but > 1dev1) // If a non-numerical value can't be mapped to this table, it receives // -7 as its value. vm = { 'dev': -6, 'alpha': -5, 'a': -5, 'beta': -4, 'b': -4, 'RC': -3, 'rc': -3, '#': -2, 'p': 1, 'pl': 1 }, // This function will be called to prepare each version argument. // It replaces every _, -, and + with a dot. // It surrounds any nonsequence of numbers/dots with dots. // It replaces sequences of dots with a single dot. // version_compare('4..0', '4.0') == 0 // Important: A string of 0 length needs to be converted into a value // even less than an unexisting value in vm (-7), hence [-8]. // It's also important to not strip spaces because of this. // version_compare('', ' ') == 1 prepVersion = function (v) { v = ('' + v).replace(/[_\-+]/g, '.'); v = v.replace(/([^.\d]+)/g, '.$1.').replace(/\.{2,}/g, '.'); return (!v.length ? [-8] : v.split('.')); }, // This converts a version component to a number. // Empty component becomes 0. // Non-numerical component becomes a negative number. // Numerical component becomes itself as an integer. numVersion = function (v) { return !v ? 0 : (isNaN(v) ? vm[v] || -7 : parseInt(v, 10)); }; v1 = prepVersion(v1); v2 = prepVersion(v2); x = Math.max(v1.length, v2.length); for (i = 0; i < x; i++) { if (v1[i] == v2[i]) { continue; } v1[i] = numVersion(v1[i]); v2[i] = numVersion(v2[i]); if (v1[i] < v2[i]) { compare = -1; break; } else if (v1[i] > v2[i]) { compare = 1; break; } } if (!operator) { return compare; } // Important: operator is CASE-SENSITIVE. // "No operator" seems to be treated as "<." // Any other values seem to make the function return null. switch (operator) { case '>': case 'gt': return (compare > 0); case '>=': case 'ge': return (compare >= 0); case '<=': case 'le': return (compare <= 0); case '==': case '=': case 'eq': return (compare === 0); case '<>': case '!=': case 'ne': return (compare !== 0); case '': case '<': case 'lt': return (compare < 0); default: return null; } } var can = (function() { var caps = { define_property: (function() { /* // currently too much extra code required, not exactly worth it try { // as of IE8, getters/setters are supported only on DOM elements var obj = {}; if (Object.defineProperty) { Object.defineProperty(obj, 'prop', { enumerable: true, configurable: true }); return true; } } catch(ex) {} if (Object.prototype.__defineGetter__ && Object.prototype.__defineSetter__) { return true; }*/ return false; }()), create_canvas: (function() { // On the S60 and BB Storm, getContext exists, but always returns undefined // so we actually have to call getContext() to verify // github.com/Modernizr/Modernizr/issues/issue/97/ var el = document.createElement('canvas'); return !!(el.getContext && el.getContext('2d')); }()), return_response_type: function(responseType) { try { if (Basic.inArray(responseType, ['', 'text', 'document']) !== -1) { return true; } else if (window.XMLHttpRequest) { var xhr = new XMLHttpRequest(); xhr.open('get', '/'); // otherwise Gecko throws an exception if ('responseType' in xhr) { xhr.responseType = responseType; // as of 23.0.1271.64, Chrome switched from throwing exception to merely logging it to the console (why? o why?) if (xhr.responseType !== responseType) { return false; } return true; } } } catch (ex) {} return false; }, // ideas for this heavily come from Modernizr (http://modernizr.com/) use_data_uri: (function() { var du = new Image(); du.onload = function() { caps.use_data_uri = (du.width === 1 && du.height === 1); }; setTimeout(function() { du.src = "data:image/gif;base64,R0lGODlhAQABAIAAAP8AAAAAACH5BAAAAAAALAAAAAABAAEAAAICRAEAOw=="; }, 1); return false; }()), use_data_uri_over32kb: function() { // IE8 return caps.use_data_uri && (Env.browser !== 'IE' || Env.version >= 9); }, use_data_uri_of: function(bytes) { return (caps.use_data_uri && bytes < 33000 || caps.use_data_uri_over32kb()); }, use_fileinput: function() { var el = document.createElement('input'); el.setAttribute('type', 'file'); return !el.disabled; } }; return function(cap) { var args = [].slice.call(arguments); args.shift(); // shift of cap return Basic.typeOf(caps[cap]) === 'function' ? caps[cap].apply(this, args) : !!caps[cap]; }; }()); var Env = { can: can, browser: UAParser.browser.name, version: parseFloat(UAParser.browser.major), os: UAParser.os.name, // everybody intuitively types it in a lowercase for some reason osVersion: UAParser.os.version, verComp: version_compare, swf_url: "../flash/Moxie.swf", xap_url: "../silverlight/Moxie.xap", global_event_dispatcher: "moxie.core.EventTarget.instance.dispatchEvent" }; // for backward compatibility // @deprecated Use `Env.os` instead Env.OS = Env.os; return Env; }); // Included from: src/javascript/core/utils/Dom.js /** * Dom.js * * Copyright 2013, Moxiecode Systems AB * Released under GPL License. * * License: http://www.plupload.com/license * Contributing: http://www.plupload.com/contributing */ define('moxie/core/utils/Dom', ['moxie/core/utils/Env'], function(Env) { /** Get DOM Element by it's id. @method get @for Utils @param {String} id Identifier of the DOM Element @return {DOMElement} */ var get = function(id) { if (typeof id !== 'string') { return id; } return document.getElementById(id); }; /** Checks if specified DOM element has specified class. @method hasClass @static @param {Object} obj DOM element like object to add handler to. @param {String} name Class name */ var hasClass = function(obj, name) { if (!obj.className) { return false; } var regExp = new RegExp("(^|\\s+)"+name+"(\\s+|$)"); return regExp.test(obj.className); }; /** Adds specified className to specified DOM element. @method addClass @static @param {Object} obj DOM element like object to add handler to. @param {String} name Class name */ var addClass = function(obj, name) { if (!hasClass(obj, name)) { obj.className = !obj.className ? name : obj.className.replace(/\s+$/, '') + ' ' + name; } }; /** Removes specified className from specified DOM element. @method removeClass @static @param {Object} obj DOM element like object to add handler to. @param {String} name Class name */ var removeClass = function(obj, name) { if (obj.className) { var regExp = new RegExp("(^|\\s+)"+name+"(\\s+|$)"); obj.className = obj.className.replace(regExp, function($0, $1, $2) { return $1 === ' ' && $2 === ' ' ? ' ' : ''; }); } }; /** Returns a given computed style of a DOM element. @method getStyle @static @param {Object} obj DOM element like object. @param {String} name Style you want to get from the DOM element */ var getStyle = function(obj, name) { if (obj.currentStyle) { return obj.currentStyle[name]; } else if (window.getComputedStyle) { return window.getComputedStyle(obj, null)[name]; } }; /** Returns the absolute x, y position of an Element. The position will be returned in a object with x, y fields. @method getPos @static @param {Element} node HTML element or element id to get x, y position from. @param {Element} root Optional root element to stop calculations at. @return {object} Absolute position of the specified element object with x, y fields. */ var getPos = function(node, root) { var x = 0, y = 0, parent, doc = document, nodeRect, rootRect; node = node; root = root || doc.body; // Returns the x, y cordinate for an element on IE 6 and IE 7 function getIEPos(node) { var bodyElm, rect, x = 0, y = 0; if (node) { rect = node.getBoundingClientRect(); bodyElm = doc.compatMode === "CSS1Compat" ? doc.documentElement : doc.body; x = rect.left + bodyElm.scrollLeft; y = rect.top + bodyElm.scrollTop; } return { x : x, y : y }; } // Use getBoundingClientRect on IE 6 and IE 7 but not on IE 8 in standards mode if (node && node.getBoundingClientRect && Env.browser === 'IE' && (!doc.documentMode || doc.documentMode < 8)) { nodeRect = getIEPos(node); rootRect = getIEPos(root); return { x : nodeRect.x - rootRect.x, y : nodeRect.y - rootRect.y }; } parent = node; while (parent && parent != root && parent.nodeType) { x += parent.offsetLeft || 0; y += parent.offsetTop || 0; parent = parent.offsetParent; } parent = node.parentNode; while (parent && parent != root && parent.nodeType) { x -= parent.scrollLeft || 0; y -= parent.scrollTop || 0; parent = parent.parentNode; } return { x : x, y : y }; }; /** Returns the size of the specified node in pixels. @method getSize @static @param {Node} node Node to get the size of. @return {Object} Object with a w and h property. */ var getSize = function(node) { return { w : node.offsetWidth || node.clientWidth, h : node.offsetHeight || node.clientHeight }; }; return { get: get, hasClass: hasClass, addClass: addClass, removeClass: removeClass, getStyle: getStyle, getPos: getPos, getSize: getSize }; }); // Included from: src/javascript/core/Exceptions.js /** * Exceptions.js * * Copyright 2013, Moxiecode Systems AB * Released under GPL License. * * License: http://www.plupload.com/license * Contributing: http://www.plupload.com/contributing */ define('moxie/core/Exceptions', [ 'moxie/core/utils/Basic' ], function(Basic) { function _findKey(obj, value) { var key; for (key in obj) { if (obj[key] === value) { return key; } } return null; } return { RuntimeError: (function() { var namecodes = { NOT_INIT_ERR: 1, NOT_SUPPORTED_ERR: 9, JS_ERR: 4 }; function RuntimeError(code) { this.code = code; this.name = _findKey(namecodes, code); this.message = this.name + ": RuntimeError " + this.code; } Basic.extend(RuntimeError, namecodes); RuntimeError.prototype = Error.prototype; return RuntimeError; }()), OperationNotAllowedException: (function() { function OperationNotAllowedException(code) { this.code = code; this.name = 'OperationNotAllowedException'; } Basic.extend(OperationNotAllowedException, { NOT_ALLOWED_ERR: 1 }); OperationNotAllowedException.prototype = Error.prototype; return OperationNotAllowedException; }()), ImageError: (function() { var namecodes = { WRONG_FORMAT: 1, MAX_RESOLUTION_ERR: 2 }; function ImageError(code) { this.code = code; this.name = _findKey(namecodes, code); this.message = this.name + ": ImageError " + this.code; } Basic.extend(ImageError, namecodes); ImageError.prototype = Error.prototype; return ImageError; }()), FileException: (function() { var namecodes = { NOT_FOUND_ERR: 1, SECURITY_ERR: 2, ABORT_ERR: 3, NOT_READABLE_ERR: 4, ENCODING_ERR: 5, NO_MODIFICATION_ALLOWED_ERR: 6, INVALID_STATE_ERR: 7, SYNTAX_ERR: 8 }; function FileException(code) { this.code = code; this.name = _findKey(namecodes, code); this.message = this.name + ": FileException " + this.code; } Basic.extend(FileException, namecodes); FileException.prototype = Error.prototype; return FileException; }()), DOMException: (function() { var namecodes = { INDEX_SIZE_ERR: 1, DOMSTRING_SIZE_ERR: 2, HIERARCHY_REQUEST_ERR: 3, WRONG_DOCUMENT_ERR: 4, INVALID_CHARACTER_ERR: 5, NO_DATA_ALLOWED_ERR: 6, NO_MODIFICATION_ALLOWED_ERR: 7, NOT_FOUND_ERR: 8, NOT_SUPPORTED_ERR: 9, INUSE_ATTRIBUTE_ERR: 10, INVALID_STATE_ERR: 11, SYNTAX_ERR: 12, INVALID_MODIFICATION_ERR: 13, NAMESPACE_ERR: 14, INVALID_ACCESS_ERR: 15, VALIDATION_ERR: 16, TYPE_MISMATCH_ERR: 17, SECURITY_ERR: 18, NETWORK_ERR: 19, ABORT_ERR: 20, URL_MISMATCH_ERR: 21, QUOTA_EXCEEDED_ERR: 22, TIMEOUT_ERR: 23, INVALID_NODE_TYPE_ERR: 24, DATA_CLONE_ERR: 25 }; function DOMException(code) { this.code = code; this.name = _findKey(namecodes, code); this.message = this.name + ": DOMException " + this.code; } Basic.extend(DOMException, namecodes); DOMException.prototype = Error.prototype; return DOMException; }()), EventException: (function() { function EventException(code) { this.code = code; this.name = 'EventException'; } Basic.extend(EventException, { UNSPECIFIED_EVENT_TYPE_ERR: 0 }); EventException.prototype = Error.prototype; return EventException; }()) }; }); // Included from: src/javascript/core/EventTarget.js /** * EventTarget.js * * Copyright 2013, Moxiecode Systems AB * Released under GPL License. * * License: http://www.plupload.com/license * Contributing: http://www.plupload.com/contributing */ define('moxie/core/EventTarget', [ 'moxie/core/Exceptions', 'moxie/core/utils/Basic' ], function(x, Basic) { /** Parent object for all event dispatching components and objects @class EventTarget @constructor EventTarget */ function EventTarget() { // hash of event listeners by object uid var eventpool = {}; Basic.extend(this, { /** Unique id of the event dispatcher, usually overriden by children @property uid @type String */ uid: null, /** Can be called from within a child in order to acquire uniqie id in automated manner @method init */ init: function() { if (!this.uid) { this.uid = Basic.guid('uid_'); } }, /** Register a handler to a specific event dispatched by the object @method addEventListener @param {String} type Type or basically a name of the event to subscribe to @param {Function} fn Callback function that will be called when event happens @param {Number} [priority=0] Priority of the event handler - handlers with higher priorities will be called first @param {Object} [scope=this] A scope to invoke event handler in */ addEventListener: function(type, fn, priority, scope) { var self = this, list; type = Basic.trim(type); if (/\s/.test(type)) { // multiple event types were passed for one handler Basic.each(type.split(/\s+/), function(type) { self.addEventListener(type, fn, priority, scope); }); return; } type = type.toLowerCase(); priority = parseInt(priority, 10) || 0; list = eventpool[this.uid] && eventpool[this.uid][type] || []; list.push({fn : fn, priority : priority, scope : scope || this}); if (!eventpool[this.uid]) { eventpool[this.uid] = {}; } eventpool[this.uid][type] = list; }, /** Check if any handlers were registered to the specified event @method hasEventListener @param {String} type Type or basically a name of the event to check @return {Mixed} Returns a handler if it was found and false, if - not */ hasEventListener: function(type) { return type ? !!(eventpool[this.uid] && eventpool[this.uid][type]) : !!eventpool[this.uid]; }, /** Unregister the handler from the event, or if former was not specified - unregister all handlers @method removeEventListener @param {String} type Type or basically a name of the event @param {Function} [fn] Handler to unregister */ removeEventListener: function(type, fn) { type = type.toLowerCase(); var list = eventpool[this.uid] && eventpool[this.uid][type], i; if (list) { if (fn) { for (i = list.length - 1; i >= 0; i--) { if (list[i].fn === fn) { list.splice(i, 1); break; } } } else { list = []; } // delete event list if it has become empty if (!list.length) { delete eventpool[this.uid][type]; // and object specific entry in a hash if it has no more listeners attached if (Basic.isEmptyObj(eventpool[this.uid])) { delete eventpool[this.uid]; } } } }, /** Remove all event handlers from the object @method removeAllEventListeners */ removeAllEventListeners: function() { if (eventpool[this.uid]) { delete eventpool[this.uid]; } }, /** Dispatch the event @method dispatchEvent @param {String/Object} Type of event or event object to dispatch @param {Mixed} [...] Variable number of arguments to be passed to a handlers @return {Boolean} true by default and false if any handler returned false */ dispatchEvent: function(type) { var uid, list, args, tmpEvt, evt = {}, result = true, undef; if (Basic.typeOf(type) !== 'string') { // we can't use original object directly (because of Silverlight) tmpEvt = type; if (Basic.typeOf(tmpEvt.type) === 'string') { type = tmpEvt.type; if (tmpEvt.total !== undef && tmpEvt.loaded !== undef) { // progress event evt.total = tmpEvt.total; evt.loaded = tmpEvt.loaded; } evt.async = tmpEvt.async || false; } else { throw new x.EventException(x.EventException.UNSPECIFIED_EVENT_TYPE_ERR); } } // check if event is meant to be dispatched on an object having specific uid if (type.indexOf('::') !== -1) { (function(arr) { uid = arr[0]; type = arr[1]; }(type.split('::'))); } else { uid = this.uid; } type = type.toLowerCase(); list = eventpool[uid] && eventpool[uid][type]; if (list) { // sort event list by prority list.sort(function(a, b) { return b.priority - a.priority; }); args = [].slice.call(arguments); // first argument will be pseudo-event object args.shift(); evt.type = type; args.unshift(evt); // Dispatch event to all listeners var queue = []; Basic.each(list, function(handler) { // explicitly set the target, otherwise events fired from shims do not get it args[0].target = handler.scope; // if event is marked as async, detach the handler if (evt.async) { queue.push(function(cb) { setTimeout(function() { cb(handler.fn.apply(handler.scope, args) === false); }, 1); }); } else { queue.push(function(cb) { cb(handler.fn.apply(handler.scope, args) === false); // if handler returns false stop propagation }); } }); if (queue.length) { Basic.inSeries(queue, function(err) { result = !err; }); } } return result; }, /** Alias for addEventListener @method bind @protected */ bind: function() { this.addEventListener.apply(this, arguments); }, /** Alias for removeEventListener @method unbind @protected */ unbind: function() { this.removeEventListener.apply(this, arguments); }, /** Alias for removeAllEventListeners @method unbindAll @protected */ unbindAll: function() { this.removeAllEventListeners.apply(this, arguments); }, /** Alias for dispatchEvent @method trigger @protected */ trigger: function() { return this.dispatchEvent.apply(this, arguments); }, /** Converts properties of on[event] type to corresponding event handlers, is used to avoid extra hassle around the process of calling them back @method convertEventPropsToHandlers @private */ convertEventPropsToHandlers: function(handlers) { var h; if (Basic.typeOf(handlers) !== 'array') { handlers = [handlers]; } for (var i = 0; i < handlers.length; i++) { h = 'on' + handlers[i]; if (Basic.typeOf(this[h]) === 'function') { this.addEventListener(handlers[i], this[h]); } else if (Basic.typeOf(this[h]) === 'undefined') { this[h] = null; // object must have defined event properties, even if it doesn't make use of them } } } }); } EventTarget.instance = new EventTarget(); return EventTarget; }); // Included from: src/javascript/core/utils/Encode.js /** * Encode.js * * Copyright 2013, Moxiecode Systems AB * Released under GPL License. * * License: http://www.plupload.com/license * Contributing: http://www.plupload.com/contributing */ define('moxie/core/utils/Encode', [], function() { /** Encode string with UTF-8 @method utf8_encode @for Utils @static @param {String} str String to encode @return {String} UTF-8 encoded string */ var utf8_encode = function(str) { return unescape(encodeURIComponent(str)); }; /** Decode UTF-8 encoded string @method utf8_decode @static @param {String} str String to decode @return {String} Decoded string */ var utf8_decode = function(str_data) { return decodeURIComponent(escape(str_data)); }; /** Decode Base64 encoded string (uses browser's default method if available), from: https://raw.github.com/kvz/phpjs/master/functions/url/base64_decode.js @method atob @static @param {String} data String to decode @return {String} Decoded string */ var atob = function(data, utf8) { if (typeof(window.atob) === 'function') { return utf8 ? utf8_decode(window.atob(data)) : window.atob(data); } // http://kevin.vanzonneveld.net // + original by: Tyler Akins (http://rumkin.com) // + improved by: Thunder.m // + input by: Aman Gupta // + improved by: Kevin van Zonneveld (http://kevin.vanzonneveld.net) // + bugfixed by: Onno Marsman // + bugfixed by: Pellentesque Malesuada // + improved by: Kevin van Zonneveld (http://kevin.vanzonneveld.net) // + input by: Brett Zamir (http://brett-zamir.me) // + bugfixed by: Kevin van Zonneveld (http://kevin.vanzonneveld.net) // * example 1: base64_decode('S2V2aW4gdmFuIFpvbm5ldmVsZA=='); // * returns 1: 'Kevin van Zonneveld' // mozilla has this native // - but breaks in 2.0.0.12! //if (typeof this.window.atob == 'function') { // return atob(data); //} var b64 = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="; var o1, o2, o3, h1, h2, h3, h4, bits, i = 0, ac = 0, dec = "", tmp_arr = []; if (!data) { return data; } data += ''; do { // unpack four hexets into three octets using index points in b64 h1 = b64.indexOf(data.charAt(i++)); h2 = b64.indexOf(data.charAt(i++)); h3 = b64.indexOf(data.charAt(i++)); h4 = b64.indexOf(data.charAt(i++)); bits = h1 << 18 | h2 << 12 | h3 << 6 | h4; o1 = bits >> 16 & 0xff; o2 = bits >> 8 & 0xff; o3 = bits & 0xff; if (h3 == 64) { tmp_arr[ac++] = String.fromCharCode(o1); } else if (h4 == 64) { tmp_arr[ac++] = String.fromCharCode(o1, o2); } else { tmp_arr[ac++] = String.fromCharCode(o1, o2, o3); } } while (i < data.length); dec = tmp_arr.join(''); return utf8 ? utf8_decode(dec) : dec; }; /** Base64 encode string (uses browser's default method if available), from: https://raw.github.com/kvz/phpjs/master/functions/url/base64_encode.js @method btoa @static @param {String} data String to encode @return {String} Base64 encoded string */ var btoa = function(data, utf8) { if (utf8) { utf8_encode(data); } if (typeof(window.btoa) === 'function') { return window.btoa(data); } // http://kevin.vanzonneveld.net // + original by: Tyler Akins (http://rumkin.com) // + improved by: Bayron Guevara // + improved by: Thunder.m // + improved by: Kevin van Zonneveld (http://kevin.vanzonneveld.net) // + bugfixed by: Pellentesque Malesuada // + improved by: Kevin van Zonneveld (http://kevin.vanzonneveld.net) // + improved by: Rafał Kukawski (http://kukawski.pl) // * example 1: base64_encode('Kevin van Zonneveld'); // * returns 1: 'S2V2aW4gdmFuIFpvbm5ldmVsZA==' // mozilla has this native // - but breaks in 2.0.0.12! var b64 = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="; var o1, o2, o3, h1, h2, h3, h4, bits, i = 0, ac = 0, enc = "", tmp_arr = []; if (!data) { return data; } do { // pack three octets into four hexets o1 = data.charCodeAt(i++); o2 = data.charCodeAt(i++); o3 = data.charCodeAt(i++); bits = o1 << 16 | o2 << 8 | o3; h1 = bits >> 18 & 0x3f; h2 = bits >> 12 & 0x3f; h3 = bits >> 6 & 0x3f; h4 = bits & 0x3f; // use hexets to index into b64, and append result to encoded string tmp_arr[ac++] = b64.charAt(h1) + b64.charAt(h2) + b64.charAt(h3) + b64.charAt(h4); } while (i < data.length); enc = tmp_arr.join(''); var r = data.length % 3; return (r ? enc.slice(0, r - 3) : enc) + '==='.slice(r || 3); }; return { utf8_encode: utf8_encode, utf8_decode: utf8_decode, atob: atob, btoa: btoa }; }); // Included from: src/javascript/runtime/Runtime.js /** * Runtime.js * * Copyright 2013, Moxiecode Systems AB * Released under GPL License. * * License: http://www.plupload.com/license * Contributing: http://www.plupload.com/contributing */ define('moxie/runtime/Runtime', [ "moxie/core/utils/Basic", "moxie/core/utils/Dom", "moxie/core/EventTarget" ], function(Basic, Dom, EventTarget) { var runtimeConstructors = {}, runtimes = {}; /** Common set of methods and properties for every runtime instance @class Runtime @param {Object} options @param {String} type Sanitized name of the runtime @param {Object} [caps] Set of capabilities that differentiate specified runtime @param {Object} [modeCaps] Set of capabilities that do require specific operational mode @param {String} [preferredMode='browser'] Preferred operational mode to choose if no required capabilities were requested */ function Runtime(options, type, caps, modeCaps, preferredMode) { /** Dispatched when runtime is initialized and ready. Results in RuntimeInit on a connected component. @event Init */ /** Dispatched when runtime fails to initialize. Results in RuntimeError on a connected component. @event Error */ var self = this , _shim , _uid = Basic.guid(type + '_') , defaultMode = preferredMode || 'browser' ; options = options || {}; // register runtime in private hash runtimes[_uid] = this; /** Default set of capabilities, which can be redifined later by specific runtime @private @property caps @type Object */ caps = Basic.extend({ // Runtime can: // provide access to raw binary data of the file access_binary: false, // provide access to raw binary data of the image (image extension is optional) access_image_binary: false, // display binary data as thumbs for example display_media: false, // make cross-domain requests do_cors: false, // accept files dragged and dropped from the desktop drag_and_drop: false, // filter files in selection dialog by their extensions filter_by_extension: true, // resize image (and manipulate it raw data of any file in general) resize_image: false, // periodically report how many bytes of total in the file were uploaded (loaded) report_upload_progress: false, // provide access to the headers of http response return_response_headers: false, // support response of specific type, which should be passed as an argument // e.g. runtime.can('return_response_type', 'blob') return_response_type: false, // return http status code of the response return_status_code: true, // send custom http header with the request send_custom_headers: false, // pick up the files from a dialog select_file: false, // select whole folder in file browse dialog select_folder: false, // select multiple files at once in file browse dialog select_multiple: true, // send raw binary data, that is generated after image resizing or manipulation of other kind send_binary_string: false, // send cookies with http request and therefore retain session send_browser_cookies: true, // send data formatted as multipart/form-data send_multipart: true, // slice the file or blob to smaller parts slice_blob: false, // upload file without preloading it to memory, stream it out directly from disk stream_upload: false, // programmatically trigger file browse dialog summon_file_dialog: false, // upload file of specific size, size should be passed as argument // e.g. runtime.can('upload_filesize', '500mb') upload_filesize: true, // initiate http request with specific http method, method should be passed as argument // e.g. runtime.can('use_http_method', 'put') use_http_method: true }, caps); // default to the mode that is compatible with preferred caps if (options.preferred_caps) { defaultMode = Runtime.getMode(modeCaps, options.preferred_caps, defaultMode); } // small extension factory here (is meant to be extended with actual extensions constructors) _shim = (function() { var objpool = {}; return { exec: function(uid, comp, fn, args) { if (_shim[comp]) { if (!objpool[uid]) { objpool[uid] = { context: this, instance: new _shim[comp]() }; } if (objpool[uid].instance[fn]) { return objpool[uid].instance[fn].apply(this, args); } } }, removeInstance: function(uid) { delete objpool[uid]; }, removeAllInstances: function() { var self = this; Basic.each(objpool, function(obj, uid) { if (Basic.typeOf(obj.instance.destroy) === 'function') { obj.instance.destroy.call(obj.context); } self.removeInstance(uid); }); } }; }()); // public methods Basic.extend(this, { /** Specifies whether runtime instance was initialized or not @property initialized @type {Boolean} @default false */ initialized: false, // shims require this flag to stop initialization retries /** Unique ID of the runtime @property uid @type {String} */ uid: _uid, /** Runtime type (e.g. flash, html5, etc) @property type @type {String} */ type: type, /** Runtime (not native one) may operate in browser or client mode. @property mode @private @type {String|Boolean} current mode or false, if none possible */ mode: Runtime.getMode(modeCaps, (options.required_caps), defaultMode), /** id of the DOM container for the runtime (if available) @property shimid @type {String} */ shimid: _uid + '_container', /** Number of connected clients. If equal to zero, runtime can be destroyed @property clients @type {Number} */ clients: 0, /** Runtime initialization options @property options @type {Object} */ options: options, /** Checks if the runtime has specific capability @method can @param {String} cap Name of capability to check @param {Mixed} [value] If passed, capability should somehow correlate to the value @param {Object} [refCaps] Set of capabilities to check the specified cap against (defaults to internal set) @return {Boolean} true if runtime has such capability and false, if - not */ can: function(cap, value) { var refCaps = arguments[2] || caps; // if cap var is a comma-separated list of caps, convert it to object (key/value) if (Basic.typeOf(cap) === 'string' && Basic.typeOf(value) === 'undefined') { cap = Runtime.parseCaps(cap); } if (Basic.typeOf(cap) === 'object') { for (var key in cap) { if (!this.can(key, cap[key], refCaps)) { return false; } } return true; } // check the individual cap if (Basic.typeOf(refCaps[cap]) === 'function') { return refCaps[cap].call(this, value); } else { return (value === refCaps[cap]); } }, /** Returns container for the runtime as DOM element @method getShimContainer @return {DOMElement} */ getShimContainer: function() { var container, shimContainer = Dom.get(this.shimid); // if no container for shim, create one if (!shimContainer) { container = this.options.container ? Dom.get(this.options.container) : document.body; // create shim container and insert it at an absolute position into the outer container shimContainer = document.createElement('div'); shimContainer.id = this.shimid; shimContainer.className = 'moxie-shim moxie-shim-' + this.type; Basic.extend(shimContainer.style, { position: 'absolute', top: '0px', left: '0px', width: '1px', height: '1px', overflow: 'hidden' }); container.appendChild(shimContainer); container = null; } return shimContainer; }, /** Returns runtime as DOM element (if appropriate) @method getShim @return {DOMElement} */ getShim: function() { return _shim; }, /** Invokes a method within the runtime itself (might differ across the runtimes) @method shimExec @param {Mixed} [] @protected @return {Mixed} Depends on the action and component */ shimExec: function(component, action) { var args = [].slice.call(arguments, 2); return self.getShim().exec.call(this, this.uid, component, action, args); }, /** Operaional interface that is used by components to invoke specific actions on the runtime (is invoked in the scope of component) @method exec @param {Mixed} []* @protected @return {Mixed} Depends on the action and component */ exec: function(component, action) { // this is called in the context of component, not runtime var args = [].slice.call(arguments, 2); if (self[component] && self[component][action]) { return self[component][action].apply(this, args); } return self.shimExec.apply(this, arguments); }, /** Destroys the runtime (removes all events and deletes DOM structures) @method destroy */ destroy: function() { if (!self) { return; // obviously already destroyed } var shimContainer = Dom.get(this.shimid); if (shimContainer) { shimContainer.parentNode.removeChild(shimContainer); } if (_shim) { _shim.removeAllInstances(); } this.unbindAll(); delete runtimes[this.uid]; this.uid = null; // mark this runtime as destroyed _uid = self = _shim = shimContainer = null; } }); // once we got the mode, test against all caps if (this.mode && options.required_caps && !this.can(options.required_caps)) { this.mode = false; } } /** Default order to try different runtime types @property order @type String @static */ Runtime.order = 'html5,flash,silverlight,html4'; /** Retrieves runtime from private hash by it's uid @method getRuntime @private @static @param {String} uid Unique identifier of the runtime @return {Runtime|Boolean} Returns runtime, if it exists and false, if - not */ Runtime.getRuntime = function(uid) { return runtimes[uid] ? runtimes[uid] : false; }; /** Register constructor for the Runtime of new (or perhaps modified) type @method addConstructor @static @param {String} type Runtime type (e.g. flash, html5, etc) @param {Function} construct Constructor for the Runtime type */ Runtime.addConstructor = function(type, constructor) { constructor.prototype = EventTarget.instance; runtimeConstructors[type] = constructor; }; /** Get the constructor for the specified type. method getConstructor @static @param {String} type Runtime type (e.g. flash, html5, etc) @return {Function} Constructor for the Runtime type */ Runtime.getConstructor = function(type) { return runtimeConstructors[type] || null; }; /** Get info about the runtime (uid, type, capabilities) @method getInfo @static @param {String} uid Unique identifier of the runtime @return {Mixed} Info object or null if runtime doesn't exist */ Runtime.getInfo = function(uid) { var runtime = Runtime.getRuntime(uid); if (runtime) { return { uid: runtime.uid, type: runtime.type, mode: runtime.mode, can: function() { return runtime.can.apply(runtime, arguments); } }; } return null; }; /** Convert caps represented by a comma-separated string to the object representation. @method parseCaps @static @param {String} capStr Comma-separated list of capabilities @return {Object} */ Runtime.parseCaps = function(capStr) { var capObj = {}; if (Basic.typeOf(capStr) !== 'string') { return capStr || {}; } Basic.each(capStr.split(','), function(key) { capObj[key] = true; // we assume it to be - true }); return capObj; }; /** Test the specified runtime for specific capabilities. @method can @static @param {String} type Runtime type (e.g. flash, html5, etc) @param {String|Object} caps Set of capabilities to check @return {Boolean} Result of the test */ Runtime.can = function(type, caps) { var runtime , constructor = Runtime.getConstructor(type) , mode ; if (constructor) { runtime = new constructor({ required_caps: caps }); mode = runtime.mode; runtime.destroy(); return !!mode; } return false; }; /** Figure out a runtime that supports specified capabilities. @method thatCan @static @param {String|Object} caps Set of capabilities to check @param {String} [runtimeOrder] Comma-separated list of runtimes to check against @return {String} Usable runtime identifier or null */ Runtime.thatCan = function(caps, runtimeOrder) { var types = (runtimeOrder || Runtime.order).split(/\s*,\s*/); for (var i in types) { if (Runtime.can(types[i], caps)) { return types[i]; } } return null; }; /** Figure out an operational mode for the specified set of capabilities. @method getMode @static @param {Object} modeCaps Set of capabilities that depend on particular runtime mode @param {Object} [requiredCaps] Supplied set of capabilities to find operational mode for @param {String|Boolean} [defaultMode='browser'] Default mode to use @return {String|Boolean} Compatible operational mode */ Runtime.getMode = function(modeCaps, requiredCaps, defaultMode) { var mode = null; if (Basic.typeOf(defaultMode) === 'undefined') { // only if not specified defaultMode = 'browser'; } if (requiredCaps && !Basic.isEmptyObj(modeCaps)) { // loop over required caps and check if they do require the same mode Basic.each(requiredCaps, function(value, cap) { if (modeCaps.hasOwnProperty(cap)) { var capMode = modeCaps[cap](value); // make sure we always have an array if (typeof(capMode) === 'string') { capMode = [capMode]; } if (!mode) { mode = capMode; } else if (!(mode = Basic.arrayIntersect(mode, capMode))) { // if cap requires conflicting mode - runtime cannot fulfill required caps return (mode = false); } } }); if (mode) { return Basic.inArray(defaultMode, mode) !== -1 ? defaultMode : mode[0]; } else if (mode === false) { return false; } } return defaultMode; }; /** Capability check that always returns true @private @static @return {True} */ Runtime.capTrue = function() { return true; }; /** Capability check that always returns false @private @static @return {False} */ Runtime.capFalse = function() { return false; }; /** Evaluate the expression to boolean value and create a function that always returns it. @private @static @param {Mixed} expr Expression to evaluate @return {Function} Function returning the result of evaluation */ Runtime.capTest = function(expr) { return function() { return !!expr; }; }; return Runtime; }); // Included from: src/javascript/runtime/RuntimeClient.js /** * RuntimeClient.js * * Copyright 2013, Moxiecode Systems AB * Released under GPL License. * * License: http://www.plupload.com/license * Contributing: http://www.plupload.com/contributing */ define('moxie/runtime/RuntimeClient', [ 'moxie/core/Exceptions', 'moxie/core/utils/Basic', 'moxie/runtime/Runtime' ], function(x, Basic, Runtime) { /** Set of methods and properties, required by a component to acquire ability to connect to a runtime @class RuntimeClient */ return function RuntimeClient() { var runtime; Basic.extend(this, { /** Connects to the runtime specified by the options. Will either connect to existing runtime or create a new one. Increments number of clients connected to the specified runtime. @method connectRuntime @param {Mixed} options Can be a runtme uid or a set of key-value pairs defining requirements and pre-requisites */ connectRuntime: function(options) { var comp = this, ruid; function initialize(items) { var type, constructor; // if we ran out of runtimes if (!items.length) { comp.trigger('RuntimeError', new x.RuntimeError(x.RuntimeError.NOT_INIT_ERR)); runtime = null; return; } type = items.shift(); constructor = Runtime.getConstructor(type); if (!constructor) { initialize(items); return; } // try initializing the runtime runtime = new constructor(options); runtime.bind('Init', function() { // mark runtime as initialized runtime.initialized = true; // jailbreak ... setTimeout(function() { runtime.clients++; // this will be triggered on component comp.trigger('RuntimeInit', runtime); }, 1); }); runtime.bind('Error', function() { runtime.destroy(); // runtime cannot destroy itself from inside at a right moment, thus we do it here initialize(items); }); /*runtime.bind('Exception', function() { });*/ // check if runtime managed to pick-up operational mode if (!runtime.mode) { runtime.trigger('Error'); return; } runtime.init(); } // check if a particular runtime was requested if (Basic.typeOf(options) === 'string') { ruid = options; } else if (Basic.typeOf(options.ruid) === 'string') { ruid = options.ruid; } if (ruid) { runtime = Runtime.getRuntime(ruid); if (runtime) { runtime.clients++; return runtime; } else { // there should be a runtime and there's none - weird case throw new x.RuntimeError(x.RuntimeError.NOT_INIT_ERR); } } // initialize a fresh one, that fits runtime list and required features best initialize((options.runtime_order || Runtime.order).split(/\s*,\s*/)); }, /** Returns the runtime to which the client is currently connected. @method getRuntime @return {Runtime} Runtime or null if client is not connected */ getRuntime: function() { if (runtime && runtime.uid) { return runtime; } runtime = null; // make sure we do not leave zombies rambling around return null; }, /** Disconnects from the runtime. Decrements number of clients connected to the specified runtime. @method disconnectRuntime */ disconnectRuntime: function() { if (runtime && --runtime.clients <= 0) { runtime.destroy(); runtime = null; } } }); }; }); // Included from: src/javascript/file/Blob.js /** * Blob.js * * Copyright 2013, Moxiecode Systems AB * Released under GPL License. * * License: http://www.plupload.com/license * Contributing: http://www.plupload.com/contributing */ define('moxie/file/Blob', [ 'moxie/core/utils/Basic', 'moxie/core/utils/Encode', 'moxie/runtime/RuntimeClient' ], function(Basic, Encode, RuntimeClient) { var blobpool = {}; /** @class Blob @constructor @param {String} ruid Unique id of the runtime, to which this blob belongs to @param {Object} blob Object "Native" blob object, as it is represented in the runtime */ function Blob(ruid, blob) { function _sliceDetached(start, end, type) { var blob, data = blobpool[this.uid]; if (Basic.typeOf(data) !== 'string' || !data.length) { return null; // or throw exception } blob = new Blob(null, { type: type, size: end - start }); blob.detach(data.substr(start, blob.size)); return blob; } RuntimeClient.call(this); if (ruid) { this.connectRuntime(ruid); } if (!blob) { blob = {}; } else if (Basic.typeOf(blob) === 'string') { // dataUrl or binary string blob = { data: blob }; } Basic.extend(this, { /** Unique id of the component @property uid @type {String} */ uid: blob.uid || Basic.guid('uid_'), /** Unique id of the connected runtime, if falsy, then runtime will have to be initialized before this Blob can be used, modified or sent @property ruid @type {String} */ ruid: ruid, /** Size of blob @property size @type {Number} @default 0 */ size: blob.size || 0, /** Mime type of blob @property type @type {String} @default '' */ type: blob.type || '', /** @method slice @param {Number} [start=0] */ slice: function(start, end, type) { if (this.isDetached()) { return _sliceDetached.apply(this, arguments); } return this.getRuntime().exec.call(this, 'Blob', 'slice', this.getSource(), start, end, type); }, /** Returns "native" blob object (as it is represented in connected runtime) or null if not found @method getSource @return {Blob} Returns "native" blob object or null if not found */ getSource: function() { if (!blobpool[this.uid]) { return null; } return blobpool[this.uid]; }, /** Detaches blob from any runtime that it depends on and initialize with standalone value @method detach @protected @param {DOMString} [data=''] Standalone value */ detach: function(data) { if (this.ruid) { this.getRuntime().exec.call(this, 'Blob', 'destroy'); this.disconnectRuntime(); this.ruid = null; } data = data || ''; // if dataUrl, convert to binary string var matches = data.match(/^data:([^;]*);base64,/); if (matches) { this.type = matches[1]; data = Encode.atob(data.substring(data.indexOf('base64,') + 7)); } this.size = data.length; blobpool[this.uid] = data; }, /** Checks if blob is standalone (detached of any runtime) @method isDetached @protected @return {Boolean} */ isDetached: function() { return !this.ruid && Basic.typeOf(blobpool[this.uid]) === 'string'; }, /** Destroy Blob and free any resources it was using @method destroy */ destroy: function() { this.detach(); delete blobpool[this.uid]; } }); if (blob.data) { this.detach(blob.data); // auto-detach if payload has been passed } else { blobpool[this.uid] = blob; } } return Blob; }); // Included from: src/javascript/file/File.js /** * File.js * * Copyright 2013, Moxiecode Systems AB * Released under GPL License. * * License: http://www.plupload.com/license * Contributing: http://www.plupload.com/contributing */ define('moxie/file/File', [ 'moxie/core/utils/Basic', 'moxie/core/utils/Mime', 'moxie/file/Blob' ], function(Basic, Mime, Blob) { /** @class File @extends Blob @constructor @param {String} ruid Unique id of the runtime, to which this blob belongs to @param {Object} file Object "Native" file object, as it is represented in the runtime */ function File(ruid, file) { var name, type; if (!file) { // avoid extra errors in case we overlooked something file = {}; } // figure out the type if (file.type && file.type !== '') { type = file.type; } else { type = Mime.getFileMime(file.name); } // sanitize file name or generate new one if (file.name) { name = file.name.replace(/\\/g, '/'); name = name.substr(name.lastIndexOf('/') + 1); } else { var prefix = type.split('/')[0]; name = Basic.guid((prefix !== '' ? prefix : 'file') + '_'); if (Mime.extensions[type]) { name += '.' + Mime.extensions[type][0]; // append proper extension if possible } } Blob.apply(this, arguments); Basic.extend(this, { /** File mime type @property type @type {String} @default '' */ type: type || '', /** File name @property name @type {String} @default UID */ name: name || Basic.guid('file_'), /** Relative path to the file inside a directory @property relativePath @type {String} @default '' */ relativePath: '', /** Date of last modification @property lastModifiedDate @type {String} @default now */ lastModifiedDate: file.lastModifiedDate || (new Date()).toLocaleString() // Thu Aug 23 2012 19:40:00 GMT+0400 (GET) }); } File.prototype = Blob.prototype; return File; }); // Included from: src/javascript/file/FileInput.js /** * FileInput.js * * Copyright 2013, Moxiecode Systems AB * Released under GPL License. * * License: http://www.plupload.com/license * Contributing: http://www.plupload.com/contributing */ define('moxie/file/FileInput', [ 'moxie/core/utils/Basic', 'moxie/core/utils/Mime', 'moxie/core/utils/Dom', 'moxie/core/Exceptions', 'moxie/core/EventTarget', 'moxie/core/I18n', 'moxie/file/File', 'moxie/runtime/Runtime', 'moxie/runtime/RuntimeClient' ], function(Basic, Mime, Dom, x, EventTarget, I18n, File, Runtime, RuntimeClient) { /** Provides a convenient way to create cross-browser file-picker. Generates file selection dialog on click, converts selected files to _File_ objects, to be used in conjunction with _Image_, preloaded in memory with _FileReader_ or uploaded to a server through _XMLHttpRequest_. @class FileInput @constructor @extends EventTarget @uses RuntimeClient @param {Object|String|DOMElement} options If options is string or node, argument is considered as _browse\_button_. @param {String|DOMElement} options.browse_button DOM Element to turn into file picker. @param {Array} [options.accept] Array of mime types to accept. By default accepts all. @param {String} [options.file='file'] Name of the file field (not the filename). @param {Boolean} [options.multiple=false] Enable selection of multiple files. @param {Boolean} [options.directory=false] Turn file input into the folder input (cannot be both at the same time). @param {String|DOMElement} [options.container] DOM Element to use as a container for file-picker. Defaults to parentNode for _browse\_button_. @param {Object|String} [options.required_caps] Set of required capabilities, that chosen runtime must support. @example <div id="container"> <a id="file-picker" href="javascript:;">Browse...</a> </div> <script> var fileInput = new mOxie.FileInput({ browse_button: 'file-picker', // or document.getElementById('file-picker') container: 'container', accept: [ {title: "Image files", extensions: "jpg,gif,png"} // accept only images ], multiple: true // allow multiple file selection }); fileInput.onchange = function(e) { // do something to files array console.info(e.target.files); // or this.files or fileInput.files }; fileInput.init(); // initialize </script> */ var dispatches = [ /** Dispatched when runtime is connected and file-picker is ready to be used. @event ready @param {Object} event */ 'ready', /** Dispatched right after [ready](#event_ready) event, and whenever [refresh()](#method_refresh) is invoked. Check [corresponding documentation entry](#method_refresh) for more info. @event refresh @param {Object} event */ /** Dispatched when selection of files in the dialog is complete. @event change @param {Object} event */ 'change', 'cancel', // TODO: might be useful /** Dispatched when mouse cursor enters file-picker area. Can be used to style element accordingly. @event mouseenter @param {Object} event */ 'mouseenter', /** Dispatched when mouse cursor leaves file-picker area. Can be used to style element accordingly. @event mouseleave @param {Object} event */ 'mouseleave', /** Dispatched when functional mouse button is pressed on top of file-picker area. @event mousedown @param {Object} event */ 'mousedown', /** Dispatched when functional mouse button is released on top of file-picker area. @event mouseup @param {Object} event */ 'mouseup' ]; function FileInput(options) { var self = this, container, browseButton, defaults; // if flat argument passed it should be browse_button id if (Basic.inArray(Basic.typeOf(options), ['string', 'node']) !== -1) { options = { browse_button : options }; } // this will help us to find proper default container browseButton = Dom.get(options.browse_button); if (!browseButton) { // browse button is required throw new x.DOMException(x.DOMException.NOT_FOUND_ERR); } // figure out the options defaults = { accept: [{ title: I18n.translate('All Files'), extensions: '*' }], name: 'file', multiple: false, required_caps: false, container: browseButton.parentNode || document.body }; options = Basic.extend({}, defaults, options); // convert to object representation if (typeof(options.required_caps) === 'string') { options.required_caps = Runtime.parseCaps(options.required_caps); } // normalize accept option (could be list of mime types or array of title/extensions pairs) if (typeof(options.accept) === 'string') { options.accept = Mime.mimes2extList(options.accept); } container = Dom.get(options.container); // make sure we have container if (!container) { container = document.body; } // make container relative, if it's not if (Dom.getStyle(container, 'position') === 'static') { container.style.position = 'relative'; } container = browseButton = null; // IE RuntimeClient.call(self); Basic.extend(self, { /** Unique id of the component @property uid @protected @readOnly @type {String} @default UID */ uid: Basic.guid('uid_'), /** Unique id of the connected runtime, if any. @property ruid @protected @type {String} */ ruid: null, /** Unique id of the runtime container. Useful to get hold of it for various manipulations. @property shimid @protected @type {String} */ shimid: null, /** Array of selected mOxie.File objects @property files @type {Array} @default null */ files: null, /** Initializes the file-picker, connects it to runtime and dispatches event ready when done. @method init */ init: function() { self.convertEventPropsToHandlers(dispatches); self.bind('RuntimeInit', function(e, runtime) { self.ruid = runtime.uid; self.shimid = runtime.shimid; self.bind("Ready", function() { self.trigger("Refresh"); }, 999); self.bind("Change", function() { var files = runtime.exec.call(self, 'FileInput', 'getFiles'); self.files = []; Basic.each(files, function(file) { // ignore empty files (IE10 for example hangs if you try to send them via XHR) if (file.size === 0) { return true; } self.files.push(new File(self.ruid, file)); }); }, 999); // re-position and resize shim container self.bind('Refresh', function() { var pos, size, browseButton, shimContainer; browseButton = Dom.get(options.browse_button); shimContainer = Dom.get(runtime.shimid); // do not use runtime.getShimContainer(), since it will create container if it doesn't exist if (browseButton) { pos = Dom.getPos(browseButton, Dom.get(options.container)); size = Dom.getSize(browseButton); if (shimContainer) { Basic.extend(shimContainer.style, { top : pos.y + 'px', left : pos.x + 'px', width : size.w + 'px', height : size.h + 'px' }); } } shimContainer = browseButton = null; }); runtime.exec.call(self, 'FileInput', 'init', options); }); // runtime needs: options.required_features, options.runtime_order and options.container self.connectRuntime(Basic.extend({}, options, { required_caps: { select_file: true } })); }, /** Disables file-picker element, so that it doesn't react to mouse clicks. @method disable @param {Boolean} [state=true] Disable component if - true, enable if - false */ disable: function(state) { var runtime = this.getRuntime(); if (runtime) { runtime.exec.call(this, 'FileInput', 'disable', Basic.typeOf(state) === 'undefined' ? true : state); } }, /** Reposition and resize dialog trigger to match the position and size of browse_button element. @method refresh */ refresh: function() { self.trigger("Refresh"); }, /** Destroy component. @method destroy */ destroy: function() { var runtime = this.getRuntime(); if (runtime) { runtime.exec.call(this, 'FileInput', 'destroy'); this.disconnectRuntime(); } if (Basic.typeOf(this.files) === 'array') { // no sense in leaving associated files behind Basic.each(this.files, function(file) { file.destroy(); }); } this.files = null; } }); } FileInput.prototype = EventTarget.instance; return FileInput; }); // Included from: src/javascript/runtime/RuntimeTarget.js /** * RuntimeTarget.js * * Copyright 2013, Moxiecode Systems AB * Released under GPL License. * * License: http://www.plupload.com/license * Contributing: http://www.plupload.com/contributing */ define('moxie/runtime/RuntimeTarget', [ 'moxie/core/utils/Basic', 'moxie/runtime/RuntimeClient', "moxie/core/EventTarget" ], function(Basic, RuntimeClient, EventTarget) { /** Instance of this class can be used as a target for the events dispatched by shims, when allowing them onto components is for either reason inappropriate @class RuntimeTarget @constructor @protected @extends EventTarget */ function RuntimeTarget() { this.uid = Basic.guid('uid_'); RuntimeClient.call(this); this.destroy = function() { this.disconnectRuntime(); this.unbindAll(); }; } RuntimeTarget.prototype = EventTarget.instance; return RuntimeTarget; }); // Included from: src/javascript/file/FileReader.js /** * FileReader.js * * Copyright 2013, Moxiecode Systems AB * Released under GPL License. * * License: http://www.plupload.com/license * Contributing: http://www.plupload.com/contributing */ define('moxie/file/FileReader', [ 'moxie/core/utils/Basic', 'moxie/core/utils/Encode', 'moxie/core/Exceptions', 'moxie/core/EventTarget', 'moxie/file/Blob', 'moxie/file/File', 'moxie/runtime/RuntimeTarget' ], function(Basic, Encode, x, EventTarget, Blob, File, RuntimeTarget) { /** Utility for preloading o.Blob/o.File objects in memory. By design closely follows [W3C FileReader](http://www.w3.org/TR/FileAPI/#dfn-filereader) interface. Where possible uses native FileReader, where - not falls back to shims. @class FileReader @constructor FileReader @extends EventTarget @uses RuntimeClient */ var dispatches = [ /** Dispatched when the read starts. @event loadstart @param {Object} event */ 'loadstart', /** Dispatched while reading (and decoding) blob, and reporting partial Blob data (progess.loaded/progress.total). @event progress @param {Object} event */ 'progress', /** Dispatched when the read has successfully completed. @event load @param {Object} event */ 'load', /** Dispatched when the read has been aborted. For instance, by invoking the abort() method. @event abort @param {Object} event */ 'abort', /** Dispatched when the read has failed. @event error @param {Object} event */ 'error', /** Dispatched when the request has completed (either in success or failure). @event loadend @param {Object} event */ 'loadend' ]; function FileReader() { var self = this, _fr; Basic.extend(this, { /** UID of the component instance. @property uid @type {String} */ uid: Basic.guid('uid_'), /** Contains current state of FileReader object. Can take values of FileReader.EMPTY, FileReader.LOADING and FileReader.DONE. @property readyState @type {Number} @default FileReader.EMPTY */ readyState: FileReader.EMPTY, /** Result of the successful read operation. @property result @type {String} */ result: null, /** Stores the error of failed asynchronous read operation. @property error @type {DOMError} */ error: null, /** Initiates reading of File/Blob object contents to binary string. @method readAsBinaryString @param {Blob|File} blob Object to preload */ readAsBinaryString: function(blob) { _read.call(this, 'readAsBinaryString', blob); }, /** Initiates reading of File/Blob object contents to dataURL string. @method readAsDataURL @param {Blob|File} blob Object to preload */ readAsDataURL: function(blob) { _read.call(this, 'readAsDataURL', blob); }, /** Initiates reading of File/Blob object contents to string. @method readAsText @param {Blob|File} blob Object to preload */ readAsText: function(blob) { _read.call(this, 'readAsText', blob); }, /** Aborts preloading process. @method abort */ abort: function() { this.result = null; if (Basic.inArray(this.readyState, [FileReader.EMPTY, FileReader.DONE]) !== -1) { return; } else if (this.readyState === FileReader.LOADING) { this.readyState = FileReader.DONE; } if (_fr) { _fr.getRuntime().exec.call(this, 'FileReader', 'abort'); } this.trigger('abort'); this.trigger('loadend'); }, /** Destroy component and release resources. @method destroy */ destroy: function() { this.abort(); if (_fr) { _fr.getRuntime().exec.call(this, 'FileReader', 'destroy'); _fr.disconnectRuntime(); } self = _fr = null; } }); function _read(op, blob) { _fr = new RuntimeTarget(); function error(err) { self.readyState = FileReader.DONE; self.error = err; self.trigger('error'); loadEnd(); } function loadEnd() { _fr.destroy(); _fr = null; self.trigger('loadend'); } function exec(runtime) { _fr.bind('Error', function(e, err) { error(err); }); _fr.bind('Progress', function(e) { self.result = runtime.exec.call(_fr, 'FileReader', 'getResult'); self.trigger(e); }); _fr.bind('Load', function(e) { self.readyState = FileReader.DONE; self.result = runtime.exec.call(_fr, 'FileReader', 'getResult'); self.trigger(e); loadEnd(); }); runtime.exec.call(_fr, 'FileReader', 'read', op, blob); } this.convertEventPropsToHandlers(dispatches); if (this.readyState === FileReader.LOADING) { return error(new x.DOMException(x.DOMException.INVALID_STATE_ERR)); } this.readyState = FileReader.LOADING; this.trigger('loadstart'); // if source is o.Blob/o.File if (blob instanceof Blob) { if (blob.isDetached()) { var src = blob.getSource(); switch (op) { case 'readAsText': case 'readAsBinaryString': this.result = src; break; case 'readAsDataURL': this.result = 'data:' + blob.type + ';base64,' + Encode.btoa(src); break; } this.readyState = FileReader.DONE; this.trigger('load'); loadEnd(); } else { exec(_fr.connectRuntime(blob.ruid)); } } else { error(new x.DOMException(x.DOMException.NOT_FOUND_ERR)); } } } /** Initial FileReader state @property EMPTY @type {Number} @final @static @default 0 */ FileReader.EMPTY = 0; /** FileReader switches to this state when it is preloading the source @property LOADING @type {Number} @final @static @default 1 */ FileReader.LOADING = 1; /** Preloading is complete, this is a final state @property DONE @type {Number} @final @static @default 2 */ FileReader.DONE = 2; FileReader.prototype = EventTarget.instance; return FileReader; }); // Included from: src/javascript/core/utils/Url.js /** * Url.js * * Copyright 2013, Moxiecode Systems AB * Released under GPL License. * * License: http://www.plupload.com/license * Contributing: http://www.plupload.com/contributing */ define('moxie/core/utils/Url', [], function() { /** Parse url into separate components and fill in absent parts with parts from current url, based on https://raw.github.com/kvz/phpjs/master/functions/url/parse_url.js @method parseUrl @for Utils @static @param {String} url Url to parse (defaults to empty string if undefined) @return {Object} Hash containing extracted uri components */ var parseUrl = function(url, currentUrl) { var key = ['source', 'scheme', 'authority', 'userInfo', 'user', 'pass', 'host', 'port', 'relative', 'path', 'directory', 'file', 'query', 'fragment'] , i = key.length , ports = { http: 80, https: 443 } , uri = {} , regex = /^(?:([^:\/?#]+):)?(?:\/\/()(?:(?:()(?:([^:@]*):?([^:@]*))?@)?([^:\/?#]*)(?::(\d*))?))?()(?:(()(?:(?:[^?#\/]*\/)*)()(?:[^?#]*))(?:\\?([^#]*))?(?:#(.*))?)/ , m = regex.exec(url || '') ; while (i--) { if (m[i]) { uri[key[i]] = m[i]; } } // when url is relative, we set the origin and the path ourselves if (!uri.scheme) { // come up with defaults if (!currentUrl || typeof(currentUrl) === 'string') { currentUrl = parseUrl(currentUrl || document.location.href); } uri.scheme = currentUrl.scheme; uri.host = currentUrl.host; uri.port = currentUrl.port; var path = ''; // for urls without trailing slash we need to figure out the path if (/^[^\/]/.test(uri.path)) { path = currentUrl.path; // if path ends with a filename, strip it if (!/(\/|\/[^\.]+)$/.test(path)) { path = path.replace(/\/[^\/]+$/, '/'); } else { path += '/'; } } uri.path = path + (uri.path || ''); // site may reside at domain.com or domain.com/subdir } if (!uri.port) { uri.port = ports[uri.scheme] || 80; } uri.port = parseInt(uri.port, 10); if (!uri.path) { uri.path = "/"; } delete uri.source; return uri; }; /** Resolve url - among other things will turn relative url to absolute @method resolveUrl @static @param {String} url Either absolute or relative @return {String} Resolved, absolute url */ var resolveUrl = function(url) { var ports = { // we ignore default ports http: 80, https: 443 } , urlp = parseUrl(url) ; return urlp.scheme + '://' + urlp.host + (urlp.port !== ports[urlp.scheme] ? ':' + urlp.port : '') + urlp.path + (urlp.query ? urlp.query : ''); }; /** Check if specified url has the same origin as the current document @method hasSameOrigin @param {String|Object} url @return {Boolean} */ var hasSameOrigin = function(url) { function origin(url) { return [url.scheme, url.host, url.port].join('/'); } if (typeof url === 'string') { url = parseUrl(url); } return origin(parseUrl()) === origin(url); }; return { parseUrl: parseUrl, resolveUrl: resolveUrl, hasSameOrigin: hasSameOrigin }; }); // Included from: src/javascript/file/FileReaderSync.js /** * FileReaderSync.js * * Copyright 2013, Moxiecode Systems AB * Released under GPL License. * * License: http://www.plupload.com/license * Contributing: http://www.plupload.com/contributing */ define('moxie/file/FileReaderSync', [ 'moxie/core/utils/Basic', 'moxie/runtime/RuntimeClient', 'moxie/core/utils/Encode' ], function(Basic, RuntimeClient, Encode) { /** Synchronous FileReader implementation. Something like this is available in WebWorkers environment, here it can be used to read only preloaded blobs/files and only below certain size (not yet sure what that'd be, but probably < 1mb). Not meant to be used directly by user. @class FileReaderSync @private @constructor */ return function() { RuntimeClient.call(this); Basic.extend(this, { uid: Basic.guid('uid_'), readAsBinaryString: function(blob) { return _read.call(this, 'readAsBinaryString', blob); }, readAsDataURL: function(blob) { return _read.call(this, 'readAsDataURL', blob); }, /*readAsArrayBuffer: function(blob) { return _read.call(this, 'readAsArrayBuffer', blob); },*/ readAsText: function(blob) { return _read.call(this, 'readAsText', blob); } }); function _read(op, blob) { if (blob.isDetached()) { var src = blob.getSource(); switch (op) { case 'readAsBinaryString': return src; case 'readAsDataURL': return 'data:' + blob.type + ';base64,' + Encode.btoa(src); case 'readAsText': var txt = ''; for (var i = 0, length = src.length; i < length; i++) { txt += String.fromCharCode(src[i]); } return txt; } } else { var result = this.connectRuntime(blob.ruid).exec.call(this, 'FileReaderSync', 'read', op, blob); this.disconnectRuntime(); return result; } } }; }); // Included from: src/javascript/xhr/FormData.js /** * FormData.js * * Copyright 2013, Moxiecode Systems AB * Released under GPL License. * * License: http://www.plupload.com/license * Contributing: http://www.plupload.com/contributing */ define("moxie/xhr/FormData", [ "moxie/core/Exceptions", "moxie/core/utils/Basic", "moxie/file/Blob" ], function(x, Basic, Blob) { /** FormData @class FormData @constructor */ function FormData() { var _blob, _fields = []; Basic.extend(this, { /** Append another key-value pair to the FormData object @method append @param {String} name Name for the new field @param {String|Blob|Array|Object} value Value for the field */ append: function(name, value) { var self = this, valueType = Basic.typeOf(value); // according to specs value might be either Blob or String if (value instanceof Blob) { _blob = { name: name, value: value // unfortunately we can only send single Blob in one FormData }; } else if ('array' === valueType) { name += '[]'; Basic.each(value, function(value) { self.append(name, value); }); } else if ('object' === valueType) { Basic.each(value, function(value, key) { self.append(name + '[' + key + ']', value); }); } else if ('null' === valueType || 'undefined' === valueType || 'number' === valueType && isNaN(value)) { self.append(name, "false"); } else { _fields.push({ name: name, value: value.toString() }); } }, /** Checks if FormData contains Blob. @method hasBlob @return {Boolean} */ hasBlob: function() { return !!this.getBlob(); }, /** Retrieves blob. @method getBlob @return {Object} Either Blob if found or null */ getBlob: function() { return _blob && _blob.value || null; }, /** Retrieves blob field name. @method getBlobName @return {String} Either Blob field name or null */ getBlobName: function() { return _blob && _blob.name || null; }, /** Loop over the fields in FormData and invoke the callback for each of them. @method each @param {Function} cb Callback to call for each field */ each: function(cb) { Basic.each(_fields, function(field) { cb(field.value, field.name); }); if (_blob) { cb(_blob.value, _blob.name); } }, destroy: function() { _blob = null; _fields = []; } }); } return FormData; }); // Included from: src/javascript/xhr/XMLHttpRequest.js /** * XMLHttpRequest.js * * Copyright 2013, Moxiecode Systems AB * Released under GPL License. * * License: http://www.plupload.com/license * Contributing: http://www.plupload.com/contributing */ define("moxie/xhr/XMLHttpRequest", [ "moxie/core/utils/Basic", "moxie/core/Exceptions", "moxie/core/EventTarget", "moxie/core/utils/Encode", "moxie/core/utils/Url", "moxie/runtime/Runtime", "moxie/runtime/RuntimeTarget", "moxie/file/Blob", "moxie/file/FileReaderSync", "moxie/xhr/FormData", "moxie/core/utils/Env", "moxie/core/utils/Mime" ], function(Basic, x, EventTarget, Encode, Url, Runtime, RuntimeTarget, Blob, FileReaderSync, FormData, Env, Mime) { var httpCode = { 100: 'Continue', 101: 'Switching Protocols', 102: 'Processing', 200: 'OK', 201: 'Created', 202: 'Accepted', 203: 'Non-Authoritative Information', 204: 'No Content', 205: 'Reset Content', 206: 'Partial Content', 207: 'Multi-Status', 226: 'IM Used', 300: 'Multiple Choices', 301: 'Moved Permanently', 302: 'Found', 303: 'See Other', 304: 'Not Modified', 305: 'Use Proxy', 306: 'Reserved', 307: 'Temporary Redirect', 400: 'Bad Request', 401: 'Unauthorized', 402: 'Payment Required', 403: 'Forbidden', 404: 'Not Found', 405: 'Method Not Allowed', 406: 'Not Acceptable', 407: 'Proxy Authentication Required', 408: 'Request Timeout', 409: 'Conflict', 410: 'Gone', 411: 'Length Required', 412: 'Precondition Failed', 413: 'Request Entity Too Large', 414: 'Request-URI Too Long', 415: 'Unsupported Media Type', 416: 'Requested Range Not Satisfiable', 417: 'Expectation Failed', 422: 'Unprocessable Entity', 423: 'Locked', 424: 'Failed Dependency', 426: 'Upgrade Required', 500: 'Internal Server Error', 501: 'Not Implemented', 502: 'Bad Gateway', 503: 'Service Unavailable', 504: 'Gateway Timeout', 505: 'HTTP Version Not Supported', 506: 'Variant Also Negotiates', 507: 'Insufficient Storage', 510: 'Not Extended' }; function XMLHttpRequestUpload() { this.uid = Basic.guid('uid_'); } XMLHttpRequestUpload.prototype = EventTarget.instance; /** Implementation of XMLHttpRequest @class XMLHttpRequest @constructor @uses RuntimeClient @extends EventTarget */ var dispatches = ['loadstart', 'progress', 'abort', 'error', 'load', 'timeout', 'loadend']; // & readystatechange (for historical reasons) var NATIVE = 1, RUNTIME = 2; function XMLHttpRequest() { var self = this, // this (together with _p() @see below) is here to gracefully upgrade to setter/getter syntax where possible props = { /** The amount of milliseconds a request can take before being terminated. Initially zero. Zero means there is no timeout. @property timeout @type Number @default 0 */ timeout: 0, /** Current state, can take following values: UNSENT (numeric value 0) The object has been constructed. OPENED (numeric value 1) The open() method has been successfully invoked. During this state request headers can be set using setRequestHeader() and the request can be made using the send() method. HEADERS_RECEIVED (numeric value 2) All redirects (if any) have been followed and all HTTP headers of the final response have been received. Several response members of the object are now available. LOADING (numeric value 3) The response entity body is being received. DONE (numeric value 4) @property readyState @type Number @default 0 (UNSENT) */ readyState: XMLHttpRequest.UNSENT, /** True when user credentials are to be included in a cross-origin request. False when they are to be excluded in a cross-origin request and when cookies are to be ignored in its response. Initially false. @property withCredentials @type Boolean @default false */ withCredentials: false, /** Returns the HTTP status code. @property status @type Number @default 0 */ status: 0, /** Returns the HTTP status text. @property statusText @type String */ statusText: "", /** Returns the response type. Can be set to change the response type. Values are: the empty string (default), "arraybuffer", "blob", "document", "json", and "text". @property responseType @type String */ responseType: "", /** Returns the document response entity body. Throws an "InvalidStateError" exception if responseType is not the empty string or "document". @property responseXML @type Document */ responseXML: null, /** Returns the text response entity body. Throws an "InvalidStateError" exception if responseType is not the empty string or "text". @property responseText @type String */ responseText: null, /** Returns the response entity body (http://www.w3.org/TR/XMLHttpRequest/#response-entity-body). Can become: ArrayBuffer, Blob, Document, JSON, Text @property response @type Mixed */ response: null }, _async = true, _url, _method, _headers = {}, _user, _password, _encoding = null, _mimeType = null, // flags _sync_flag = false, _send_flag = false, _upload_events_flag = false, _upload_complete_flag = false, _error_flag = false, _same_origin_flag = false, // times _start_time, _timeoutset_time, _finalMime = null, _finalCharset = null, _options = {}, _xhr, _responseHeaders = '', _responseHeadersBag ; Basic.extend(this, props, { /** Unique id of the component @property uid @type String */ uid: Basic.guid('uid_'), /** Target for Upload events @property upload @type XMLHttpRequestUpload */ upload: new XMLHttpRequestUpload(), /** Sets the request method, request URL, synchronous flag, request username, and request password. Throws a "SyntaxError" exception if one of the following is true: method is not a valid HTTP method. url cannot be resolved. url contains the "user:password" format in the userinfo production. Throws a "SecurityError" exception if method is a case-insensitive match for CONNECT, TRACE or TRACK. Throws an "InvalidAccessError" exception if one of the following is true: Either user or password is passed as argument and the origin of url does not match the XMLHttpRequest origin. There is an associated XMLHttpRequest document and either the timeout attribute is not zero, the withCredentials attribute is true, or the responseType attribute is not the empty string. @method open @param {String} method HTTP method to use on request @param {String} url URL to request @param {Boolean} [async=true] If false request will be done in synchronous manner. Asynchronous by default. @param {String} [user] Username to use in HTTP authentication process on server-side @param {String} [password] Password to use in HTTP authentication process on server-side */ open: function(method, url, async, user, password) { var urlp; // first two arguments are required if (!method || !url) { throw new x.DOMException(x.DOMException.SYNTAX_ERR); } // 2 - check if any code point in method is higher than U+00FF or after deflating method it does not match the method if (/[\u0100-\uffff]/.test(method) || Encode.utf8_encode(method) !== method) { throw new x.DOMException(x.DOMException.SYNTAX_ERR); } // 3 if (!!~Basic.inArray(method.toUpperCase(), ['CONNECT', 'DELETE', 'GET', 'HEAD', 'OPTIONS', 'POST', 'PUT', 'TRACE', 'TRACK'])) { _method = method.toUpperCase(); } // 4 - allowing these methods poses a security risk if (!!~Basic.inArray(_method, ['CONNECT', 'TRACE', 'TRACK'])) { throw new x.DOMException(x.DOMException.SECURITY_ERR); } // 5 url = Encode.utf8_encode(url); // 6 - Resolve url relative to the XMLHttpRequest base URL. If the algorithm returns an error, throw a "SyntaxError". urlp = Url.parseUrl(url); _same_origin_flag = Url.hasSameOrigin(urlp); // 7 - manually build up absolute url _url = Url.resolveUrl(url); // 9-10, 12-13 if ((user || password) && !_same_origin_flag) { throw new x.DOMException(x.DOMException.INVALID_ACCESS_ERR); } _user = user || urlp.user; _password = password || urlp.pass; // 11 _async = async || true; if (_async === false && (_p('timeout') || _p('withCredentials') || _p('responseType') !== "")) { throw new x.DOMException(x.DOMException.INVALID_ACCESS_ERR); } // 14 - terminate abort() // 15 - terminate send() // 18 _sync_flag = !_async; _send_flag = false; _headers = {}; _reset.call(this); // 19 _p('readyState', XMLHttpRequest.OPENED); // 20 this.convertEventPropsToHandlers(['readystatechange']); // unify event handlers this.dispatchEvent('readystatechange'); }, /** Appends an header to the list of author request headers, or if header is already in the list of author request headers, combines its value with value. Throws an "InvalidStateError" exception if the state is not OPENED or if the send() flag is set. Throws a "SyntaxError" exception if header is not a valid HTTP header field name or if value is not a valid HTTP header field value. @method setRequestHeader @param {String} header @param {String|Number} value */ setRequestHeader: function(header, value) { var uaHeaders = [ // these headers are controlled by the user agent "accept-charset", "accept-encoding", "access-control-request-headers", "access-control-request-method", "connection", "content-length", "cookie", "cookie2", "content-transfer-encoding", "date", "expect", "host", "keep-alive", "origin", "referer", "te", "trailer", "transfer-encoding", "upgrade", "user-agent", "via" ]; // 1-2 if (_p('readyState') !== XMLHttpRequest.OPENED || _send_flag) { throw new x.DOMException(x.DOMException.INVALID_STATE_ERR); } // 3 if (/[\u0100-\uffff]/.test(header) || Encode.utf8_encode(header) !== header) { throw new x.DOMException(x.DOMException.SYNTAX_ERR); } // 4 /* this step is seemingly bypassed in browsers, probably to allow various unicode characters in header values if (/[\u0100-\uffff]/.test(value) || Encode.utf8_encode(value) !== value) { throw new x.DOMException(x.DOMException.SYNTAX_ERR); }*/ header = Basic.trim(header).toLowerCase(); // setting of proxy-* and sec-* headers is prohibited by spec if (!!~Basic.inArray(header, uaHeaders) || /^(proxy\-|sec\-)/.test(header)) { return false; } // camelize // browsers lowercase header names (at least for custom ones) // header = header.replace(/\b\w/g, function($1) { return $1.toUpperCase(); }); if (!_headers[header]) { _headers[header] = value; } else { // http://tools.ietf.org/html/rfc2616#section-4.2 (last paragraph) _headers[header] += ', ' + value; } return true; }, /** Returns all headers from the response, with the exception of those whose field name is Set-Cookie or Set-Cookie2. @method getAllResponseHeaders @return {String} reponse headers or empty string */ getAllResponseHeaders: function() { return _responseHeaders || ''; }, /** Returns the header field value from the response of which the field name matches header, unless the field name is Set-Cookie or Set-Cookie2. @method getResponseHeader @param {String} header @return {String} value(s) for the specified header or null */ getResponseHeader: function(header) { header = header.toLowerCase(); if (_error_flag || !!~Basic.inArray(header, ['set-cookie', 'set-cookie2'])) { return null; } if (_responseHeaders && _responseHeaders !== '') { // if we didn't parse response headers until now, do it and keep for later if (!_responseHeadersBag) { _responseHeadersBag = {}; Basic.each(_responseHeaders.split(/\r\n/), function(line) { var pair = line.split(/:\s+/); if (pair.length === 2) { // last line might be empty, omit pair[0] = Basic.trim(pair[0]); // just in case _responseHeadersBag[pair[0].toLowerCase()] = { // simply to retain header name in original form header: pair[0], value: Basic.trim(pair[1]) }; } }); } if (_responseHeadersBag.hasOwnProperty(header)) { return _responseHeadersBag[header].header + ': ' + _responseHeadersBag[header].value; } } return null; }, /** Sets the Content-Type header for the response to mime. Throws an "InvalidStateError" exception if the state is LOADING or DONE. Throws a "SyntaxError" exception if mime is not a valid media type. @method overrideMimeType @param String mime Mime type to set */ overrideMimeType: function(mime) { var matches, charset; // 1 if (!!~Basic.inArray(_p('readyState'), [XMLHttpRequest.LOADING, XMLHttpRequest.DONE])) { throw new x.DOMException(x.DOMException.INVALID_STATE_ERR); } // 2 mime = Basic.trim(mime.toLowerCase()); if (/;/.test(mime) && (matches = mime.match(/^([^;]+)(?:;\scharset\=)?(.*)$/))) { mime = matches[1]; if (matches[2]) { charset = matches[2]; } } if (!Mime.mimes[mime]) { throw new x.DOMException(x.DOMException.SYNTAX_ERR); } // 3-4 _finalMime = mime; _finalCharset = charset; }, /** Initiates the request. The optional argument provides the request entity body. The argument is ignored if request method is GET or HEAD. Throws an "InvalidStateError" exception if the state is not OPENED or if the send() flag is set. @method send @param {Blob|Document|String|FormData} [data] Request entity body @param {Object} [options] Set of requirements and pre-requisities for runtime initialization */ send: function(data, options) { if (Basic.typeOf(options) === 'string') { _options = { ruid: options }; } else if (!options) { _options = {}; } else { _options = options; } this.convertEventPropsToHandlers(dispatches); this.upload.convertEventPropsToHandlers(dispatches); // 1-2 if (this.readyState !== XMLHttpRequest.OPENED || _send_flag) { throw new x.DOMException(x.DOMException.INVALID_STATE_ERR); } // 3 // sending Blob if (data instanceof Blob) { _options.ruid = data.ruid; _mimeType = data.type || 'application/octet-stream'; } // FormData else if (data instanceof FormData) { if (data.hasBlob()) { var blob = data.getBlob(); _options.ruid = blob.ruid; _mimeType = blob.type || 'application/octet-stream'; } } // DOMString else if (typeof data === 'string') { _encoding = 'UTF-8'; _mimeType = 'text/plain;charset=UTF-8'; // data should be converted to Unicode and encoded as UTF-8 data = Encode.utf8_encode(data); } // if withCredentials not set, but requested, set it automatically if (!this.withCredentials) { this.withCredentials = (_options.required_caps && _options.required_caps.send_browser_cookies) && !_same_origin_flag; } // 4 - storage mutex // 5 _upload_events_flag = (!_sync_flag && this.upload.hasEventListener()); // DSAP // 6 _error_flag = false; // 7 _upload_complete_flag = !data; // 8 - Asynchronous steps if (!_sync_flag) { // 8.1 _send_flag = true; // 8.2 // this.dispatchEvent('loadstart'); // will be dispatched either by native or runtime xhr // 8.3 //if (!_upload_complete_flag) { // this.upload.dispatchEvent('loadstart'); // will be dispatched either by native or runtime xhr //} } // 8.5 - Return the send() method call, but continue running the steps in this algorithm. _doXHR.call(this, data); }, /** Cancels any network activity. @method abort */ abort: function() { _error_flag = true; _sync_flag = false; if (!~Basic.inArray(_p('readyState'), [XMLHttpRequest.UNSENT, XMLHttpRequest.OPENED, XMLHttpRequest.DONE])) { _p('readyState', XMLHttpRequest.DONE); _send_flag = false; if (_xhr) { _xhr.getRuntime().exec.call(_xhr, 'XMLHttpRequest', 'abort', _upload_complete_flag); } else { throw new x.DOMException(x.DOMException.INVALID_STATE_ERR); } _upload_complete_flag = true; } else { _p('readyState', XMLHttpRequest.UNSENT); } }, destroy: function() { if (_xhr) { if (Basic.typeOf(_xhr.destroy) === 'function') { _xhr.destroy(); } _xhr = null; } this.unbindAll(); if (this.upload) { this.upload.unbindAll(); this.upload = null; } } }); /* this is nice, but maybe too lengthy // if supported by JS version, set getters/setters for specific properties o.defineProperty(this, 'readyState', { configurable: false, get: function() { return _p('readyState'); } }); o.defineProperty(this, 'timeout', { configurable: false, get: function() { return _p('timeout'); }, set: function(value) { if (_sync_flag) { throw new x.DOMException(x.DOMException.INVALID_ACCESS_ERR); } // timeout still should be measured relative to the start time of request _timeoutset_time = (new Date).getTime(); _p('timeout', value); } }); // the withCredentials attribute has no effect when fetching same-origin resources o.defineProperty(this, 'withCredentials', { configurable: false, get: function() { return _p('withCredentials'); }, set: function(value) { // 1-2 if (!~o.inArray(_p('readyState'), [XMLHttpRequest.UNSENT, XMLHttpRequest.OPENED]) || _send_flag) { throw new x.DOMException(x.DOMException.INVALID_STATE_ERR); } // 3-4 if (_anonymous_flag || _sync_flag) { throw new x.DOMException(x.DOMException.INVALID_ACCESS_ERR); } // 5 _p('withCredentials', value); } }); o.defineProperty(this, 'status', { configurable: false, get: function() { return _p('status'); } }); o.defineProperty(this, 'statusText', { configurable: false, get: function() { return _p('statusText'); } }); o.defineProperty(this, 'responseType', { configurable: false, get: function() { return _p('responseType'); }, set: function(value) { // 1 if (!!~o.inArray(_p('readyState'), [XMLHttpRequest.LOADING, XMLHttpRequest.DONE])) { throw new x.DOMException(x.DOMException.INVALID_STATE_ERR); } // 2 if (_sync_flag) { throw new x.DOMException(x.DOMException.INVALID_ACCESS_ERR); } // 3 _p('responseType', value.toLowerCase()); } }); o.defineProperty(this, 'responseText', { configurable: false, get: function() { // 1 if (!~o.inArray(_p('responseType'), ['', 'text'])) { throw new x.DOMException(x.DOMException.INVALID_STATE_ERR); } // 2-3 if (_p('readyState') !== XMLHttpRequest.DONE && _p('readyState') !== XMLHttpRequest.LOADING || _error_flag) { throw new x.DOMException(x.DOMException.INVALID_STATE_ERR); } return _p('responseText'); } }); o.defineProperty(this, 'responseXML', { configurable: false, get: function() { // 1 if (!~o.inArray(_p('responseType'), ['', 'document'])) { throw new x.DOMException(x.DOMException.INVALID_STATE_ERR); } // 2-3 if (_p('readyState') !== XMLHttpRequest.DONE || _error_flag) { throw new x.DOMException(x.DOMException.INVALID_STATE_ERR); } return _p('responseXML'); } }); o.defineProperty(this, 'response', { configurable: false, get: function() { if (!!~o.inArray(_p('responseType'), ['', 'text'])) { if (_p('readyState') !== XMLHttpRequest.DONE && _p('readyState') !== XMLHttpRequest.LOADING || _error_flag) { return ''; } } if (_p('readyState') !== XMLHttpRequest.DONE || _error_flag) { return null; } return _p('response'); } }); */ function _p(prop, value) { if (!props.hasOwnProperty(prop)) { return; } if (arguments.length === 1) { // get return Env.can('define_property') ? props[prop] : self[prop]; } else { // set if (Env.can('define_property')) { props[prop] = value; } else { self[prop] = value; } } } /* function _toASCII(str, AllowUnassigned, UseSTD3ASCIIRules) { // TODO: http://tools.ietf.org/html/rfc3490#section-4.1 return str.toLowerCase(); } */ function _doXHR(data) { var self = this; _start_time = new Date().getTime(); _xhr = new RuntimeTarget(); function loadEnd() { if (_xhr) { // it could have been destroyed by now _xhr.destroy(); _xhr = null; } self.dispatchEvent('loadend'); self = null; } function exec(runtime) { _xhr.bind('LoadStart', function(e) { _p('readyState', XMLHttpRequest.LOADING); self.dispatchEvent('readystatechange'); self.dispatchEvent(e); if (_upload_events_flag) { self.upload.dispatchEvent(e); } }); _xhr.bind('Progress', function(e) { if (_p('readyState') !== XMLHttpRequest.LOADING) { _p('readyState', XMLHttpRequest.LOADING); // LoadStart unreliable (in Flash for example) self.dispatchEvent('readystatechange'); } self.dispatchEvent(e); }); _xhr.bind('UploadProgress', function(e) { if (_upload_events_flag) { self.upload.dispatchEvent({ type: 'progress', lengthComputable: false, total: e.total, loaded: e.loaded }); } }); _xhr.bind('Load', function(e) { _p('readyState', XMLHttpRequest.DONE); _p('status', Number(runtime.exec.call(_xhr, 'XMLHttpRequest', 'getStatus') || 0)); _p('statusText', httpCode[_p('status')] || ""); _p('response', runtime.exec.call(_xhr, 'XMLHttpRequest', 'getResponse', _p('responseType'))); if (!!~Basic.inArray(_p('responseType'), ['text', ''])) { _p('responseText', _p('response')); } else if (_p('responseType') === 'document') { _p('responseXML', _p('response')); } _responseHeaders = runtime.exec.call(_xhr, 'XMLHttpRequest', 'getAllResponseHeaders'); self.dispatchEvent('readystatechange'); if (_p('status') > 0) { // status 0 usually means that server is unreachable if (_upload_events_flag) { self.upload.dispatchEvent(e); } self.dispatchEvent(e); } else { _error_flag = true; self.dispatchEvent('error'); } loadEnd(); }); _xhr.bind('Abort', function(e) { self.dispatchEvent(e); loadEnd(); }); _xhr.bind('Error', function(e) { _error_flag = true; _p('readyState', XMLHttpRequest.DONE); self.dispatchEvent('readystatechange'); _upload_complete_flag = true; self.dispatchEvent(e); loadEnd(); }); runtime.exec.call(_xhr, 'XMLHttpRequest', 'send', { url: _url, method: _method, async: _async, user: _user, password: _password, headers: _headers, mimeType: _mimeType, encoding: _encoding, responseType: self.responseType, withCredentials: self.withCredentials, options: _options }, data); } // clarify our requirements if (typeof(_options.required_caps) === 'string') { _options.required_caps = Runtime.parseCaps(_options.required_caps); } _options.required_caps = Basic.extend({}, _options.required_caps, { return_response_type: self.responseType }); if (data instanceof FormData) { _options.required_caps.send_multipart = true; } if (!_same_origin_flag) { _options.required_caps.do_cors = true; } if (_options.ruid) { // we do not need to wait if we can connect directly exec(_xhr.connectRuntime(_options)); } else { _xhr.bind('RuntimeInit', function(e, runtime) { exec(runtime); }); _xhr.bind('RuntimeError', function(e, err) { self.dispatchEvent('RuntimeError', err); }); _xhr.connectRuntime(_options); } } function _reset() { _p('responseText', ""); _p('responseXML', null); _p('response', null); _p('status', 0); _p('statusText', ""); _start_time = _timeoutset_time = null; } } XMLHttpRequest.UNSENT = 0; XMLHttpRequest.OPENED = 1; XMLHttpRequest.HEADERS_RECEIVED = 2; XMLHttpRequest.LOADING = 3; XMLHttpRequest.DONE = 4; XMLHttpRequest.prototype = EventTarget.instance; return XMLHttpRequest; }); // Included from: src/javascript/runtime/Transporter.js /** * Transporter.js * * Copyright 2013, Moxiecode Systems AB * Released under GPL License. * * License: http://www.plupload.com/license * Contributing: http://www.plupload.com/contributing */ define("moxie/runtime/Transporter", [ "moxie/core/utils/Basic", "moxie/core/utils/Encode", "moxie/runtime/RuntimeClient", "moxie/core/EventTarget" ], function(Basic, Encode, RuntimeClient, EventTarget) { function Transporter() { var mod, _runtime, _data, _size, _pos, _chunk_size; RuntimeClient.call(this); Basic.extend(this, { uid: Basic.guid('uid_'), state: Transporter.IDLE, result: null, transport: function(data, type, options) { var self = this; options = Basic.extend({ chunk_size: 204798 }, options); // should divide by three, base64 requires this if ((mod = options.chunk_size % 3)) { options.chunk_size += 3 - mod; } _chunk_size = options.chunk_size; _reset.call(this); _data = data; _size = data.length; if (Basic.typeOf(options) === 'string' || options.ruid) { _run.call(self, type, this.connectRuntime(options)); } else { // we require this to run only once var cb = function(e, runtime) { self.unbind("RuntimeInit", cb); _run.call(self, type, runtime); }; this.bind("RuntimeInit", cb); this.connectRuntime(options); } }, abort: function() { var self = this; self.state = Transporter.IDLE; if (_runtime) { _runtime.exec.call(self, 'Transporter', 'clear'); self.trigger("TransportingAborted"); } _reset.call(self); }, destroy: function() { this.unbindAll(); _runtime = null; this.disconnectRuntime(); _reset.call(this); } }); function _reset() { _size = _pos = 0; _data = this.result = null; } function _run(type, runtime) { var self = this; _runtime = runtime; //self.unbind("RuntimeInit"); self.bind("TransportingProgress", function(e) { _pos = e.loaded; if (_pos < _size && Basic.inArray(self.state, [Transporter.IDLE, Transporter.DONE]) === -1) { _transport.call(self); } }, 999); self.bind("TransportingComplete", function() { _pos = _size; self.state = Transporter.DONE; _data = null; // clean a bit self.result = _runtime.exec.call(self, 'Transporter', 'getAsBlob', type || ''); }, 999); self.state = Transporter.BUSY; self.trigger("TransportingStarted"); _transport.call(self); } function _transport() { var self = this, chunk, bytesLeft = _size - _pos; if (_chunk_size > bytesLeft) { _chunk_size = bytesLeft; } chunk = Encode.btoa(_data.substr(_pos, _chunk_size)); _runtime.exec.call(self, 'Transporter', 'receive', chunk, _size); } } Transporter.IDLE = 0; Transporter.BUSY = 1; Transporter.DONE = 2; Transporter.prototype = EventTarget.instance; return Transporter; }); // Included from: src/javascript/image/Image.js /** * Image.js * * Copyright 2013, Moxiecode Systems AB * Released under GPL License. * * License: http://www.plupload.com/license * Contributing: http://www.plupload.com/contributing */ define("moxie/image/Image", [ "moxie/core/utils/Basic", "moxie/core/utils/Dom", "moxie/core/Exceptions", "moxie/file/FileReaderSync", "moxie/xhr/XMLHttpRequest", "moxie/runtime/Runtime", "moxie/runtime/RuntimeClient", "moxie/runtime/Transporter", "moxie/core/utils/Env", "moxie/core/EventTarget", "moxie/file/Blob", "moxie/file/File", "moxie/core/utils/Encode" ], function(Basic, Dom, x, FileReaderSync, XMLHttpRequest, Runtime, RuntimeClient, Transporter, Env, EventTarget, Blob, File, Encode) { /** Image preloading and manipulation utility. Additionally it provides access to image meta info (Exif, GPS) and raw binary data. @class Image @constructor @extends EventTarget */ var dispatches = [ 'progress', /** Dispatched when loading is complete. @event load @param {Object} event */ 'load', 'error', /** Dispatched when resize operation is complete. @event resize @param {Object} event */ 'resize', /** Dispatched when visual representation of the image is successfully embedded into the corresponsing container. @event embedded @param {Object} event */ 'embedded' ]; function Image() { RuntimeClient.call(this); Basic.extend(this, { /** Unique id of the component @property uid @type {String} */ uid: Basic.guid('uid_'), /** Unique id of the connected runtime, if any. @property ruid @type {String} */ ruid: null, /** Name of the file, that was used to create an image, if available. If not equals to empty string. @property name @type {String} @default "" */ name: "", /** Size of the image in bytes. Actual value is set only after image is preloaded. @property size @type {Number} @default 0 */ size: 0, /** Width of the image. Actual value is set only after image is preloaded. @property width @type {Number} @default 0 */ width: 0, /** Height of the image. Actual value is set only after image is preloaded. @property height @type {Number} @default 0 */ height: 0, /** Mime type of the image. Currently only image/jpeg and image/png are supported. Actual value is set only after image is preloaded. @property type @type {String} @default "" */ type: "", /** Holds meta info (Exif, GPS). Is populated only for image/jpeg. Actual value is set only after image is preloaded. @property meta @type {Object} @default {} */ meta: {}, /** Alias for load method, that takes another mOxie.Image object as a source (see load). @method clone @param {Image} src Source for the image @param {Boolean} [exact=false] Whether to activate in-depth clone mode */ clone: function() { this.load.apply(this, arguments); }, /** Loads image from various sources. Currently the source for new image can be: mOxie.Image, mOxie.Blob/mOxie.File, native Blob/File, dataUrl or URL. Depending on the type of the source, arguments - differ. When source is URL, Image will be downloaded from remote destination and loaded in memory. @example var img = new mOxie.Image(); img.onload = function() { var blob = img.getAsBlob(); var formData = new mOxie.FormData(); formData.append('file', blob); var xhr = new mOxie.XMLHttpRequest(); xhr.onload = function() { // upload complete }; xhr.open('post', 'upload.php'); xhr.send(formData); }; img.load("http://www.moxiecode.com/images/mox-logo.jpg"); // notice file extension (.jpg) @method load @param {Image|Blob|File|String} src Source for the image @param {Boolean|Object} [mixed] */ load: function() { // this is here because to bind properly we need an uid first, which is created above this.bind('Load Resize', function() { _updateInfo.call(this); }, 999); this.convertEventPropsToHandlers(dispatches); _load.apply(this, arguments); }, /** Downsizes the image to fit the specified width/height. If crop is supplied, image will be cropped to exact dimensions. @method downsize @param {Number} width Resulting width @param {Number} [height=width] Resulting height (optional, if not supplied will default to width) @param {Boolean} [crop=false] Whether to crop the image to exact dimensions @param {Boolean} [preserveHeaders=true] Whether to preserve meta headers (on JPEGs after resize) */ downsize: function(opts) { var defaults = { width: this.width, height: this.height, crop: false, preserveHeaders: true }; if (typeof(opts) === 'object') { opts = Basic.extend(defaults, opts); } else { opts = Basic.extend(defaults, { width: arguments[0], height: arguments[1], crop: arguments[2], preserveHeaders: arguments[3] }); } try { if (!this.size) { // only preloaded image objects can be used as source throw new x.DOMException(x.DOMException.INVALID_STATE_ERR); } // no way to reliably intercept the crash due to high resolution, so we simply avoid it if (this.width > Image.MAX_RESIZE_WIDTH || this.height > Image.MAX_RESIZE_HEIGHT) { throw new x.ImageError(x.ImageError.MAX_RESOLUTION_ERR); } this.getRuntime().exec.call(this, 'Image', 'downsize', opts.width, opts.height, opts.crop, opts.preserveHeaders); } catch(ex) { // for now simply trigger error event this.trigger('error', ex.code); } }, /** Alias for downsize(width, height, true). (see downsize) @method crop @param {Number} width Resulting width @param {Number} [height=width] Resulting height (optional, if not supplied will default to width) @param {Boolean} [preserveHeaders=true] Whether to preserve meta headers (on JPEGs after resize) */ crop: function(width, height, preserveHeaders) { this.downsize(width, height, true, preserveHeaders); }, getAsCanvas: function() { if (!Env.can('create_canvas')) { throw new x.RuntimeError(x.RuntimeError.NOT_SUPPORTED_ERR); } var runtime = this.connectRuntime(this.ruid); return runtime.exec.call(this, 'Image', 'getAsCanvas'); }, /** Retrieves image in it's current state as mOxie.Blob object. Cannot be run on empty or image in progress (throws DOMException.INVALID_STATE_ERR). @method getAsBlob @param {String} [type="image/jpeg"] Mime type of resulting blob. Can either be image/jpeg or image/png @param {Number} [quality=90] Applicable only together with mime type image/jpeg @return {Blob} Image as Blob */ getAsBlob: function(type, quality) { if (!this.size) { throw new x.DOMException(x.DOMException.INVALID_STATE_ERR); } if (!type) { type = 'image/jpeg'; } if (type === 'image/jpeg' && !quality) { quality = 90; } return this.getRuntime().exec.call(this, 'Image', 'getAsBlob', type, quality); }, /** Retrieves image in it's current state as dataURL string. Cannot be run on empty or image in progress (throws DOMException.INVALID_STATE_ERR). @method getAsDataURL @param {String} [type="image/jpeg"] Mime type of resulting blob. Can either be image/jpeg or image/png @param {Number} [quality=90] Applicable only together with mime type image/jpeg @return {String} Image as dataURL string */ getAsDataURL: function(type, quality) { if (!this.size) { throw new x.DOMException(x.DOMException.INVALID_STATE_ERR); } return this.getRuntime().exec.call(this, 'Image', 'getAsDataURL', type, quality); }, /** Retrieves image in it's current state as binary string. Cannot be run on empty or image in progress (throws DOMException.INVALID_STATE_ERR). @method getAsBinaryString @param {String} [type="image/jpeg"] Mime type of resulting blob. Can either be image/jpeg or image/png @param {Number} [quality=90] Applicable only together with mime type image/jpeg @return {String} Image as binary string */ getAsBinaryString: function(type, quality) { var dataUrl = this.getAsDataURL(type, quality); return Encode.atob(dataUrl.substring(dataUrl.indexOf('base64,') + 7)); }, /** Embeds a visual representation of the image into the specified node. Depending on the runtime, it might be a canvas, an img node or a thrid party shim object (Flash or SilverLight - very rare, can be used in legacy browsers that do not have canvas or proper dataURI support). @method embed @param {DOMElement} el DOM element to insert the image object into @param {Object} [options] @param {Number} [options.width] The width of an embed (defaults to the image width) @param {Number} [options.height] The height of an embed (defaults to the image height) @param {String} [type="image/jpeg"] Mime type @param {Number} [quality=90] Quality of an embed, if mime type is image/jpeg @param {Boolean} [crop=false] Whether to crop an embed to the specified dimensions */ embed: function(el) { var self = this , imgCopy , type, quality, crop , options = arguments[1] || {} , width = this.width , height = this.height , runtime // this has to be outside of all the closures to contain proper runtime ; function onResize() { // if possible, embed a canvas element directly if (Env.can('create_canvas')) { var canvas = imgCopy.getAsCanvas(); if (canvas) { el.appendChild(canvas); canvas = null; imgCopy.destroy(); self.trigger('embedded'); return; } } var dataUrl = imgCopy.getAsDataURL(type, quality); if (!dataUrl) { throw new x.ImageError(x.ImageError.WRONG_FORMAT); } if (Env.can('use_data_uri_of', dataUrl.length)) { el.innerHTML = '<img src="' + dataUrl + '" width="' + imgCopy.width + '" height="' + imgCopy.height + '" />'; imgCopy.destroy(); self.trigger('embedded'); } else { var tr = new Transporter(); tr.bind("TransportingComplete", function() { runtime = self.connectRuntime(this.result.ruid); self.bind("Embedded", function() { // position and size properly Basic.extend(runtime.getShimContainer().style, { //position: 'relative', top: '0px', left: '0px', width: imgCopy.width + 'px', height: imgCopy.height + 'px' }); // some shims (Flash/SilverLight) reinitialize, if parent element is hidden, reordered or it's // position type changes (in Gecko), but since we basically need this only in IEs 6/7 and // sometimes 8 and they do not have this problem, we can comment this for now /*tr.bind("RuntimeInit", function(e, runtime) { tr.destroy(); runtime.destroy(); onResize.call(self); // re-feed our image data });*/ runtime = null; }, 999); runtime.exec.call(self, "ImageView", "display", this.result.uid, width, height); imgCopy.destroy(); }); tr.transport(Encode.atob(dataUrl.substring(dataUrl.indexOf('base64,') + 7)), type, Basic.extend({}, options, { required_caps: { display_media: true }, runtime_order: 'flash,silverlight', container: el })); } } try { if (!(el = Dom.get(el))) { throw new x.DOMException(x.DOMException.INVALID_NODE_TYPE_ERR); } if (!this.size) { // only preloaded image objects can be used as source throw new x.DOMException(x.DOMException.INVALID_STATE_ERR); } if (this.width > Image.MAX_RESIZE_WIDTH || this.height > Image.MAX_RESIZE_HEIGHT) { throw new x.ImageError(x.ImageError.MAX_RESOLUTION_ERR); } type = options.type || this.type || 'image/jpeg'; quality = options.quality || 90; crop = Basic.typeOf(options.crop) !== 'undefined' ? options.crop : false; // figure out dimensions for the thumb if (options.width) { width = options.width; height = options.height || width; } else { // if container element has measurable dimensions, use them var dimensions = Dom.getSize(el); if (dimensions.w && dimensions.h) { // both should be > 0 width = dimensions.w; height = dimensions.h; } } imgCopy = new Image(); imgCopy.bind("Resize", function() { onResize.call(self); }); imgCopy.bind("Load", function() { imgCopy.downsize(width, height, crop, false); }); imgCopy.clone(this, false); return imgCopy; } catch(ex) { // for now simply trigger error event this.trigger('error', ex.code); } }, /** Properly destroys the image and frees resources in use. If any. Recommended way to dispose mOxie.Image object. @method destroy */ destroy: function() { if (this.ruid) { this.getRuntime().exec.call(this, 'Image', 'destroy'); this.disconnectRuntime(); } this.unbindAll(); } }); function _updateInfo(info) { if (!info) { info = this.getRuntime().exec.call(this, 'Image', 'getInfo'); } this.size = info.size; this.width = info.width; this.height = info.height; this.type = info.type; this.meta = info.meta; // update file name, only if empty if (this.name === '') { this.name = info.name; } } function _load(src) { var srcType = Basic.typeOf(src); try { // if source is Image if (src instanceof Image) { if (!src.size) { // only preloaded image objects can be used as source throw new x.DOMException(x.DOMException.INVALID_STATE_ERR); } _loadFromImage.apply(this, arguments); } // if source is o.Blob/o.File else if (src instanceof Blob) { if (!~Basic.inArray(src.type, ['image/jpeg', 'image/png'])) { throw new x.ImageError(x.ImageError.WRONG_FORMAT); } _loadFromBlob.apply(this, arguments); } // if native blob/file else if (Basic.inArray(srcType, ['blob', 'file']) !== -1) { _load.call(this, new File(null, src), arguments[1]); } // if String else if (srcType === 'string') { // if dataUrl String if (/^data:[^;]*;base64,/.test(src)) { _load.call(this, new Blob(null, { data: src }), arguments[1]); } // else assume Url, either relative or absolute else { _loadFromUrl.apply(this, arguments); } } // if source seems to be an img node else if (srcType === 'node' && src.nodeName.toLowerCase() === 'img') { _load.call(this, src.src, arguments[1]); } else { throw new x.DOMException(x.DOMException.TYPE_MISMATCH_ERR); } } catch(ex) { // for now simply trigger error event this.trigger('error', ex.code); } } function _loadFromImage(img, exact) { var runtime = this.connectRuntime(img.ruid); this.ruid = runtime.uid; runtime.exec.call(this, 'Image', 'loadFromImage', img, (Basic.typeOf(exact) === 'undefined' ? true : exact)); } function _loadFromBlob(blob, options) { var self = this; self.name = blob.name || ''; function exec(runtime) { self.ruid = runtime.uid; runtime.exec.call(self, 'Image', 'loadFromBlob', blob); } if (blob.isDetached()) { this.bind('RuntimeInit', function(e, runtime) { exec(runtime); }); // convert to object representation if (options && typeof(options.required_caps) === 'string') { options.required_caps = Runtime.parseCaps(options.required_caps); } this.connectRuntime(Basic.extend({ required_caps: { access_image_binary: true, resize_image: true } }, options)); } else { exec(this.connectRuntime(blob.ruid)); } } function _loadFromUrl(url, options) { var self = this, xhr; xhr = new XMLHttpRequest(); xhr.open('get', url); xhr.responseType = 'blob'; xhr.onprogress = function(e) { self.trigger(e); }; xhr.onload = function() { _loadFromBlob.call(self, xhr.response, true); }; xhr.onerror = function(e) { self.trigger(e); }; xhr.onloadend = function() { xhr.destroy(); }; xhr.bind('RuntimeError', function(e, err) { self.trigger('RuntimeError', err); }); xhr.send(null, options); } } // virtual world will crash on you if image has a resolution higher than this: Image.MAX_RESIZE_WIDTH = 6500; Image.MAX_RESIZE_HEIGHT = 6500; Image.prototype = EventTarget.instance; return Image; }); // Included from: src/javascript/runtime/flash/Runtime.js /** * Runtime.js * * Copyright 2013, Moxiecode Systems AB * Released under GPL License. * * License: http://www.plupload.com/license * Contributing: http://www.plupload.com/contributing */ /*global ActiveXObject:true */ /** Defines constructor for Flash runtime. @class moxie/runtime/flash/Runtime @private */ define("moxie/runtime/flash/Runtime", [ "moxie/core/utils/Basic", "moxie/core/utils/Env", "moxie/core/utils/Dom", "moxie/core/Exceptions", "moxie/runtime/Runtime" ], function(Basic, Env, Dom, x, Runtime) { var type = 'flash', extensions = {}; /** Get the version of the Flash Player @method getShimVersion @private @return {Number} Flash Player version */ function getShimVersion() { var version; try { version = navigator.plugins['Shockwave Flash']; version = version.description; } catch (e1) { try { version = new ActiveXObject('ShockwaveFlash.ShockwaveFlash').GetVariable('$version'); } catch (e2) { version = '0.0'; } } version = version.match(/\d+/g); return parseFloat(version[0] + '.' + version[1]); } /** Constructor for the Flash Runtime @class FlashRuntime @extends Runtime */ function FlashRuntime(options) { var I = this, initTimer; options = Basic.extend({ swf_url: Env.swf_url }, options); Runtime.call(this, options, type, { access_binary: function(value) { return value && I.mode === 'browser'; }, access_image_binary: function(value) { return value && I.mode === 'browser'; }, display_media: Runtime.capTrue, do_cors: Runtime.capTrue, drag_and_drop: false, report_upload_progress: function() { return I.mode === 'client'; }, resize_image: Runtime.capTrue, return_response_headers: false, return_response_type: function(responseType) { if (responseType === 'json' && !!window.JSON) { return true; } return !Basic.arrayDiff(responseType, ['', 'text', 'document']) || I.mode === 'browser'; }, return_status_code: function(code) { return I.mode === 'browser' || !Basic.arrayDiff(code, [200, 404]); }, select_file: Runtime.capTrue, select_multiple: Runtime.capTrue, send_binary_string: function(value) { return value && I.mode === 'browser'; }, send_browser_cookies: function(value) { return value && I.mode === 'browser'; }, send_custom_headers: function(value) { return value && I.mode === 'browser'; }, send_multipart: Runtime.capTrue, slice_blob: function(value) { return value && I.mode === 'browser'; }, stream_upload: function(value) { return value && I.mode === 'browser'; }, summon_file_dialog: false, upload_filesize: function(size) { return Basic.parseSizeStr(size) <= 2097152 || I.mode === 'client'; }, use_http_method: function(methods) { return !Basic.arrayDiff(methods, ['GET', 'POST']); } }, { // capabilities that require specific mode access_binary: function(value) { return value ? 'browser' : 'client'; }, access_image_binary: function(value) { return value ? 'browser' : 'client'; }, report_upload_progress: function(value) { return value ? 'browser' : 'client'; }, return_response_type: function(responseType) { return Basic.arrayDiff(responseType, ['', 'text', 'json', 'document']) ? 'browser' : ['client', 'browser']; }, return_status_code: function(code) { return Basic.arrayDiff(code, [200, 404]) ? 'browser' : ['client', 'browser']; }, send_binary_string: function(value) { return value ? 'browser' : 'client'; }, send_browser_cookies: function(value) { return value ? 'browser' : 'client'; }, send_custom_headers: function(value) { return value ? 'browser' : 'client'; }, stream_upload: function(value) { return value ? 'client' : 'browser'; }, upload_filesize: function(size) { return Basic.parseSizeStr(size) >= 2097152 ? 'client' : 'browser'; } }, 'client'); // minimal requirement for Flash Player version if (getShimVersion() < 10) { this.mode = false; // with falsy mode, runtime won't operable, no matter what the mode was before } Basic.extend(this, { getShim: function() { return Dom.get(this.uid); }, shimExec: function(component, action) { var args = [].slice.call(arguments, 2); return I.getShim().exec(this.uid, component, action, args); }, init: function() { var html, el, container; container = this.getShimContainer(); // if not the minimal height, shims are not initialized in older browsers (e.g FF3.6, IE6,7,8, Safari 4.0,5.0, etc) Basic.extend(container.style, { position: 'absolute', top: '-8px', left: '-8px', width: '9px', height: '9px', overflow: 'hidden' }); // insert flash object html = '<object id="' + this.uid + '" type="application/x-shockwave-flash" data="' + options.swf_url + '" '; if (Env.browser === 'IE') { html += 'classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" '; } html += 'width="100%" height="100%" style="outline:0">' + '<param name="movie" value="' + options.swf_url + '" />' + '<param name="flashvars" value="uid=' + escape(this.uid) + '&target=' + Env.global_event_dispatcher + '" />' + '<param name="wmode" value="transparent" />' + '<param name="allowscriptaccess" value="always" />' + '</object>'; if (Env.browser === 'IE') { el = document.createElement('div'); container.appendChild(el); el.outerHTML = html; el = container = null; // just in case } else { container.innerHTML = html; } // Init is dispatched by the shim initTimer = setTimeout(function() { if (I && !I.initialized) { // runtime might be already destroyed by this moment I.trigger("Error", new x.RuntimeError(x.RuntimeError.NOT_INIT_ERR)); } }, 5000); }, destroy: (function(destroy) { // extend default destroy method return function() { destroy.call(I); clearTimeout(initTimer); // initialization check might be still onwait options = initTimer = destroy = I = null; }; }(this.destroy)) }, extensions); } Runtime.addConstructor(type, FlashRuntime); return extensions; }); // Included from: src/javascript/runtime/flash/file/Blob.js /** * Blob.js * * Copyright 2013, Moxiecode Systems AB * Released under GPL License. * * License: http://www.plupload.com/license * Contributing: http://www.plupload.com/contributing */ /** @class moxie/runtime/flash/file/Blob @private */ define("moxie/runtime/flash/file/Blob", [ "moxie/runtime/flash/Runtime", "moxie/file/Blob" ], function(extensions, Blob) { var FlashBlob = { slice: function(blob, start, end, type) { var self = this.getRuntime(); if (start < 0) { start = Math.max(blob.size + start, 0); } else if (start > 0) { start = Math.min(start, blob.size); } if (end < 0) { end = Math.max(blob.size + end, 0); } else if (end > 0) { end = Math.min(end, blob.size); } blob = self.shimExec.call(this, 'Blob', 'slice', start, end, type || ''); if (blob) { blob = new Blob(self.uid, blob); } return blob; } }; return (extensions.Blob = FlashBlob); }); // Included from: src/javascript/runtime/flash/file/FileInput.js /** * FileInput.js * * Copyright 2013, Moxiecode Systems AB * Released under GPL License. * * License: http://www.plupload.com/license * Contributing: http://www.plupload.com/contributing */ /** @class moxie/runtime/flash/file/FileInput @private */ define("moxie/runtime/flash/file/FileInput", [ "moxie/runtime/flash/Runtime" ], function(extensions) { var FileInput = { init: function(options) { this.getRuntime().shimExec.call(this, 'FileInput', 'init', { name: options.name, accept: options.accept, multiple: options.multiple }); this.trigger('ready'); } }; return (extensions.FileInput = FileInput); }); // Included from: src/javascript/runtime/flash/file/FileReader.js /** * FileReader.js * * Copyright 2013, Moxiecode Systems AB * Released under GPL License. * * License: http://www.plupload.com/license * Contributing: http://www.plupload.com/contributing */ /** @class moxie/runtime/flash/file/FileReader @private */ define("moxie/runtime/flash/file/FileReader", [ "moxie/runtime/flash/Runtime", "moxie/core/utils/Encode" ], function(extensions, Encode) { var _result = ''; function _formatData(data, op) { switch (op) { case 'readAsText': return Encode.atob(data, 'utf8'); case 'readAsBinaryString': return Encode.atob(data); case 'readAsDataURL': return data; } return null; } var FileReader = { read: function(op, blob) { var target = this, self = target.getRuntime(); // special prefix for DataURL read mode if (op === 'readAsDataURL') { _result = 'data:' + (blob.type || '') + ';base64,'; } target.bind('Progress', function(e, data) { if (data) { _result += _formatData(data, op); } }); return self.shimExec.call(this, 'FileReader', 'readAsBase64', blob.uid); }, getResult: function() { return _result; }, destroy: function() { _result = null; } }; return (extensions.FileReader = FileReader); }); // Included from: src/javascript/runtime/flash/file/FileReaderSync.js /** * FileReaderSync.js * * Copyright 2013, Moxiecode Systems AB * Released under GPL License. * * License: http://www.plupload.com/license * Contributing: http://www.plupload.com/contributing */ /** @class moxie/runtime/flash/file/FileReaderSync @private */ define("moxie/runtime/flash/file/FileReaderSync", [ "moxie/runtime/flash/Runtime", "moxie/core/utils/Encode" ], function(extensions, Encode) { function _formatData(data, op) { switch (op) { case 'readAsText': return Encode.atob(data, 'utf8'); case 'readAsBinaryString': return Encode.atob(data); case 'readAsDataURL': return data; } return null; } var FileReaderSync = { read: function(op, blob) { var result, self = this.getRuntime(); result = self.shimExec.call(this, 'FileReaderSync', 'readAsBase64', blob.uid); if (!result) { return null; // or throw ex } // special prefix for DataURL read mode if (op === 'readAsDataURL') { result = 'data:' + (blob.type || '') + ';base64,' + result; } return _formatData(result, op, blob.type); } }; return (extensions.FileReaderSync = FileReaderSync); }); // Included from: src/javascript/runtime/flash/xhr/XMLHttpRequest.js /** * XMLHttpRequest.js * * Copyright 2013, Moxiecode Systems AB * Released under GPL License. * * License: http://www.plupload.com/license * Contributing: http://www.plupload.com/contributing */ /** @class moxie/runtime/flash/xhr/XMLHttpRequest @private */ define("moxie/runtime/flash/xhr/XMLHttpRequest", [ "moxie/runtime/flash/Runtime", "moxie/core/utils/Basic", "moxie/file/Blob", "moxie/file/File", "moxie/file/FileReaderSync", "moxie/xhr/FormData", "moxie/runtime/Transporter" ], function(extensions, Basic, Blob, File, FileReaderSync, FormData, Transporter) { var XMLHttpRequest = { send: function(meta, data) { var target = this, self = target.getRuntime(); function send() { meta.transport = self.mode; self.shimExec.call(target, 'XMLHttpRequest', 'send', meta, data); } function appendBlob(name, blob) { self.shimExec.call(target, 'XMLHttpRequest', 'appendBlob', name, blob.uid); data = null; send(); } function attachBlob(blob, cb) { var tr = new Transporter(); tr.bind("TransportingComplete", function() { cb(this.result); }); tr.transport(blob.getSource(), blob.type, { ruid: self.uid }); } // copy over the headers if any if (!Basic.isEmptyObj(meta.headers)) { Basic.each(meta.headers, function(value, header) { self.shimExec.call(target, 'XMLHttpRequest', 'setRequestHeader', header, value.toString()); // Silverlight doesn't accept integers into the arguments of type object }); } // transfer over multipart params and blob itself if (data instanceof FormData) { var blobField; data.each(function(value, name) { if (value instanceof Blob) { blobField = name; } else { self.shimExec.call(target, 'XMLHttpRequest', 'append', name, value); } }); if (!data.hasBlob()) { data = null; send(); } else { var blob = data.getBlob(); if (blob.isDetached()) { attachBlob(blob, function(attachedBlob) { blob.destroy(); appendBlob(blobField, attachedBlob); }); } else { appendBlob(blobField, blob); } } } else if (data instanceof Blob) { if (data.isDetached()) { attachBlob(data, function(attachedBlob) { data.destroy(); data = attachedBlob.uid; send(); }); } else { data = data.uid; send(); } } else { send(); } }, getResponse: function(responseType) { var frs, blob, self = this.getRuntime(); blob = self.shimExec.call(this, 'XMLHttpRequest', 'getResponseAsBlob'); if (blob) { blob = new File(self.uid, blob); if ('blob' === responseType) { return blob; } try { frs = new FileReaderSync(); if (!!~Basic.inArray(responseType, ["", "text"])) { return frs.readAsText(blob); } else if ('json' === responseType && !!window.JSON) { return JSON.parse(frs.readAsText(blob)); } } finally { blob.destroy(); } } return null; }, abort: function(upload_complete_flag) { var self = this.getRuntime(); self.shimExec.call(this, 'XMLHttpRequest', 'abort'); this.dispatchEvent('readystatechange'); // this.dispatchEvent('progress'); this.dispatchEvent('abort'); //if (!upload_complete_flag) { // this.dispatchEvent('uploadprogress'); //} } }; return (extensions.XMLHttpRequest = XMLHttpRequest); }); // Included from: src/javascript/runtime/flash/runtime/Transporter.js /** * Transporter.js * * Copyright 2013, Moxiecode Systems AB * Released under GPL License. * * License: http://www.plupload.com/license * Contributing: http://www.plupload.com/contributing */ /** @class moxie/runtime/flash/runtime/Transporter @private */ define("moxie/runtime/flash/runtime/Transporter", [ "moxie/runtime/flash/Runtime", "moxie/file/Blob" ], function(extensions, Blob) { var Transporter = { getAsBlob: function(type) { var self = this.getRuntime() , blob = self.shimExec.call(this, 'Transporter', 'getAsBlob', type) ; if (blob) { return new Blob(self.uid, blob); } return null; } }; return (extensions.Transporter = Transporter); }); // Included from: src/javascript/runtime/flash/image/Image.js /** * Image.js * * Copyright 2013, Moxiecode Systems AB * Released under GPL License. * * License: http://www.plupload.com/license * Contributing: http://www.plupload.com/contributing */ /** @class moxie/runtime/flash/image/Image @private */ define("moxie/runtime/flash/image/Image", [ "moxie/runtime/flash/Runtime", "moxie/core/utils/Basic", "moxie/runtime/Transporter", "moxie/file/Blob", "moxie/file/FileReaderSync" ], function(extensions, Basic, Transporter, Blob, FileReaderSync) { var Image = { loadFromBlob: function(blob) { var comp = this, self = comp.getRuntime(); function exec(srcBlob) { self.shimExec.call(comp, 'Image', 'loadFromBlob', srcBlob.uid); comp = self = null; } if (blob.isDetached()) { // binary string var tr = new Transporter(); tr.bind("TransportingComplete", function() { exec(tr.result.getSource()); }); tr.transport(blob.getSource(), blob.type, { ruid: self.uid }); } else { exec(blob.getSource()); } }, loadFromImage: function(img) { var self = this.getRuntime(); return self.shimExec.call(this, 'Image', 'loadFromImage', img.uid); }, getAsBlob: function(type, quality) { var self = this.getRuntime() , blob = self.shimExec.call(this, 'Image', 'getAsBlob', type, quality) ; if (blob) { return new Blob(self.uid, blob); } return null; }, getAsDataURL: function() { var self = this.getRuntime() , blob = self.Image.getAsBlob.apply(this, arguments) , frs ; if (!blob) { return null; } frs = new FileReaderSync(); return frs.readAsDataURL(blob); } }; return (extensions.Image = Image); }); expose(["moxie/core/utils/Basic","moxie/core/I18n","moxie/core/utils/Mime","moxie/core/utils/Env","moxie/core/utils/Dom","moxie/core/Exceptions","moxie/core/EventTarget","moxie/core/utils/Encode","moxie/runtime/Runtime","moxie/runtime/RuntimeClient","moxie/file/Blob","moxie/file/File","moxie/file/FileInput","moxie/runtime/RuntimeTarget","moxie/file/FileReader","moxie/core/utils/Url","moxie/file/FileReaderSync","moxie/xhr/FormData","moxie/xhr/XMLHttpRequest","moxie/runtime/Transporter","moxie/image/Image"]); })(this);/** * o.js * * Copyright 2013, Moxiecode Systems AB * Released under GPL License. * * License: http://www.plupload.com/license * Contributing: http://www.plupload.com/contributing */ /*global moxie:true */ /** Globally exposed namespace with the most frequently used public classes and handy methods. @class o @static @private */ (function(exports) { "use strict"; var o = {}, inArray = exports.moxie.core.utils.Basic.inArray; // directly add some public classes // (we do it dynamically here, since for custom builds we cannot know beforehand what modules were included) (function addAlias(ns) { var name, itemType; for (name in ns) { itemType = typeof(ns[name]); if (itemType === 'object' && !~inArray(name, ['Exceptions', 'Env', 'Mime'])) { addAlias(ns[name]); } else if (itemType === 'function') { o[name] = ns[name]; } } })(exports.moxie); // add some manually o.Env = exports.moxie.core.utils.Env; o.Mime = exports.moxie.core.utils.Mime; o.Exceptions = exports.moxie.core.Exceptions; // expose globally exports.mOxie = o; if (!exports.o) { exports.o = o; } return o; })(this);
ajax/libs/yui/3.8.0/event-custom-base/event-custom-base-debug.js
codfish/cdnjs
YUI.add('event-custom-base', function (Y, NAME) { /** * Custom event engine, DOM event listener abstraction layer, synthetic DOM * events. * @module event-custom */ Y.Env.evt = { handles: {}, plugins: {} }; /** * Custom event engine, DOM event listener abstraction layer, synthetic DOM * events. * @module event-custom * @submodule event-custom-base */ /** * Allows for the insertion of methods that are executed before or after * a specified method * @class Do * @static */ var DO_BEFORE = 0, DO_AFTER = 1, DO = { /** * Cache of objects touched by the utility * @property objs * @static * @deprecated Since 3.6.0. The `_yuiaop` property on the AOP'd object * replaces the role of this property, but is considered to be private, and * is only mentioned to provide a migration path. * * If you have a use case which warrants migration to the _yuiaop property, * please file a ticket to let us know what it's used for and we can see if * we need to expose hooks for that functionality more formally. */ objs: null, /** * <p>Execute the supplied method before the specified function. Wrapping * function may optionally return an instance of the following classes to * further alter runtime behavior:</p> * <dl> * <dt></code>Y.Do.Halt(message, returnValue)</code></dt> * <dd>Immediatly stop execution and return * <code>returnValue</code>. No other wrapping functions will be * executed.</dd> * <dt></code>Y.Do.AlterArgs(message, newArgArray)</code></dt> * <dd>Replace the arguments that the original function will be * called with.</dd> * <dt></code>Y.Do.Prevent(message)</code></dt> * <dd>Don't execute the wrapped function. Other before phase * wrappers will be executed.</dd> * </dl> * * @method before * @param fn {Function} the function to execute * @param obj the object hosting the method to displace * @param sFn {string} the name of the method to displace * @param c The execution context for fn * @param arg* {mixed} 0..n additional arguments to supply to the subscriber * when the event fires. * @return {string} handle for the subscription * @static */ before: function(fn, obj, sFn, c) { // Y.log('Do before: ' + sFn, 'info', 'event'); var f = fn, a; if (c) { a = [fn, c].concat(Y.Array(arguments, 4, true)); f = Y.rbind.apply(Y, a); } return this._inject(DO_BEFORE, f, obj, sFn); }, /** * <p>Execute the supplied method after the specified function. Wrapping * function may optionally return an instance of the following classes to * further alter runtime behavior:</p> * <dl> * <dt></code>Y.Do.Halt(message, returnValue)</code></dt> * <dd>Immediatly stop execution and return * <code>returnValue</code>. No other wrapping functions will be * executed.</dd> * <dt></code>Y.Do.AlterReturn(message, returnValue)</code></dt> * <dd>Return <code>returnValue</code> instead of the wrapped * method's original return value. This can be further altered by * other after phase wrappers.</dd> * </dl> * * <p>The static properties <code>Y.Do.originalRetVal</code> and * <code>Y.Do.currentRetVal</code> will be populated for reference.</p> * * @method after * @param fn {Function} the function to execute * @param obj the object hosting the method to displace * @param sFn {string} the name of the method to displace * @param c The execution context for fn * @param arg* {mixed} 0..n additional arguments to supply to the subscriber * @return {string} handle for the subscription * @static */ after: function(fn, obj, sFn, c) { var f = fn, a; if (c) { a = [fn, c].concat(Y.Array(arguments, 4, true)); f = Y.rbind.apply(Y, a); } return this._inject(DO_AFTER, f, obj, sFn); }, /** * Execute the supplied method before or after the specified function. * Used by <code>before</code> and <code>after</code>. * * @method _inject * @param when {string} before or after * @param fn {Function} the function to execute * @param obj the object hosting the method to displace * @param sFn {string} the name of the method to displace * @param c The execution context for fn * @return {string} handle for the subscription * @private * @static */ _inject: function(when, fn, obj, sFn) { // object id var id = Y.stamp(obj), o, sid; if (!obj._yuiaop) { // create a map entry for the obj if it doesn't exist, to hold overridden methods obj._yuiaop = {}; } o = obj._yuiaop; if (!o[sFn]) { // create a map entry for the method if it doesn't exist o[sFn] = new Y.Do.Method(obj, sFn); // re-route the method to our wrapper obj[sFn] = function() { return o[sFn].exec.apply(o[sFn], arguments); }; } // subscriber id sid = id + Y.stamp(fn) + sFn; // register the callback o[sFn].register(sid, fn, when); return new Y.EventHandle(o[sFn], sid); }, /** * Detach a before or after subscription. * * @method detach * @param handle {string} the subscription handle * @static */ detach: function(handle) { if (handle.detach) { handle.detach(); } }, _unload: function(e, me) { } }; Y.Do = DO; ////////////////////////////////////////////////////////////////////////// /** * Contains the return value from the wrapped method, accessible * by 'after' event listeners. * * @property originalRetVal * @static * @since 3.2.0 */ /** * Contains the current state of the return value, consumable by * 'after' event listeners, and updated if an after subscriber * changes the return value generated by the wrapped function. * * @property currentRetVal * @static * @since 3.2.0 */ ////////////////////////////////////////////////////////////////////////// /** * Wrapper for a displaced method with aop enabled * @class Do.Method * @constructor * @param obj The object to operate on * @param sFn The name of the method to displace */ DO.Method = function(obj, sFn) { this.obj = obj; this.methodName = sFn; this.method = obj[sFn]; this.before = {}; this.after = {}; }; /** * Register a aop subscriber * @method register * @param sid {string} the subscriber id * @param fn {Function} the function to execute * @param when {string} when to execute the function */ DO.Method.prototype.register = function (sid, fn, when) { if (when) { this.after[sid] = fn; } else { this.before[sid] = fn; } }; /** * Unregister a aop subscriber * @method delete * @param sid {string} the subscriber id * @param fn {Function} the function to execute * @param when {string} when to execute the function */ DO.Method.prototype._delete = function (sid) { // Y.log('Y.Do._delete: ' + sid, 'info', 'Event'); delete this.before[sid]; delete this.after[sid]; }; /** * <p>Execute the wrapped method. All arguments are passed into the wrapping * functions. If any of the before wrappers return an instance of * <code>Y.Do.Halt</code> or <code>Y.Do.Prevent</code>, neither the wrapped * function nor any after phase subscribers will be executed.</p> * * <p>The return value will be the return value of the wrapped function or one * provided by a wrapper function via an instance of <code>Y.Do.Halt</code> or * <code>Y.Do.AlterReturn</code>. * * @method exec * @param arg* {any} Arguments are passed to the wrapping and wrapped functions * @return {any} Return value of wrapped function unless overwritten (see above) */ DO.Method.prototype.exec = function () { var args = Y.Array(arguments, 0, true), i, ret, newRet, bf = this.before, af = this.after, prevented = false; // execute before for (i in bf) { if (bf.hasOwnProperty(i)) { ret = bf[i].apply(this.obj, args); if (ret) { switch (ret.constructor) { case DO.Halt: return ret.retVal; case DO.AlterArgs: args = ret.newArgs; break; case DO.Prevent: prevented = true; break; default: } } } } // execute method if (!prevented) { ret = this.method.apply(this.obj, args); } DO.originalRetVal = ret; DO.currentRetVal = ret; // execute after methods. for (i in af) { if (af.hasOwnProperty(i)) { newRet = af[i].apply(this.obj, args); // Stop processing if a Halt object is returned if (newRet && newRet.constructor == DO.Halt) { return newRet.retVal; // Check for a new return value } else if (newRet && newRet.constructor == DO.AlterReturn) { ret = newRet.newRetVal; // Update the static retval state DO.currentRetVal = ret; } } } return ret; }; ////////////////////////////////////////////////////////////////////////// /** * Return an AlterArgs object when you want to change the arguments that * were passed into the function. Useful for Do.before subscribers. An * example would be a service that scrubs out illegal characters prior to * executing the core business logic. * @class Do.AlterArgs * @constructor * @param msg {String} (optional) Explanation of the altered return value * @param newArgs {Array} Call parameters to be used for the original method * instead of the arguments originally passed in. */ DO.AlterArgs = function(msg, newArgs) { this.msg = msg; this.newArgs = newArgs; }; /** * Return an AlterReturn object when you want to change the result returned * from the core method to the caller. Useful for Do.after subscribers. * @class Do.AlterReturn * @constructor * @param msg {String} (optional) Explanation of the altered return value * @param newRetVal {any} Return value passed to code that invoked the wrapped * function. */ DO.AlterReturn = function(msg, newRetVal) { this.msg = msg; this.newRetVal = newRetVal; }; /** * Return a Halt object when you want to terminate the execution * of all subsequent subscribers as well as the wrapped method * if it has not exectued yet. Useful for Do.before subscribers. * @class Do.Halt * @constructor * @param msg {String} (optional) Explanation of why the termination was done * @param retVal {any} Return value passed to code that invoked the wrapped * function. */ DO.Halt = function(msg, retVal) { this.msg = msg; this.retVal = retVal; }; /** * Return a Prevent object when you want to prevent the wrapped function * from executing, but want the remaining listeners to execute. Useful * for Do.before subscribers. * @class Do.Prevent * @constructor * @param msg {String} (optional) Explanation of why the termination was done */ DO.Prevent = function(msg) { this.msg = msg; }; /** * Return an Error object when you want to terminate the execution * of all subsequent method calls. * @class Do.Error * @constructor * @param msg {String} (optional) Explanation of the altered return value * @param retVal {any} Return value passed to code that invoked the wrapped * function. * @deprecated use Y.Do.Halt or Y.Do.Prevent */ DO.Error = DO.Halt; ////////////////////////////////////////////////////////////////////////// // Y["Event"] && Y.Event.addListener(window, "unload", Y.Do._unload, Y.Do); /** * Custom event engine, DOM event listener abstraction layer, synthetic DOM * events. * @module event-custom * @submodule event-custom-base */ // var onsubscribeType = "_event:onsub", var YArray = Y.Array, AFTER = 'after', CONFIGS = [ 'broadcast', 'monitored', 'bubbles', 'context', 'contextFn', 'currentTarget', 'defaultFn', 'defaultTargetOnly', 'details', 'emitFacade', 'fireOnce', 'async', 'host', 'preventable', 'preventedFn', 'queuable', 'silent', 'stoppedFn', 'target', 'type' ], CONFIGS_HASH = YArray.hash(CONFIGS), nativeSlice = Array.prototype.slice, YUI3_SIGNATURE = 9, YUI_LOG = 'yui:log', mixConfigs = function(r, s, ov) { var p; for (p in s) { if (CONFIGS_HASH[p] && (ov || !(p in r))) { r[p] = s[p]; } } return r; }; /** * The CustomEvent class lets you define events for your application * that can be subscribed to by one or more independent component. * * @param {String} type The type of event, which is passed to the callback * when the event fires. * @param {object} o configuration object. * @class CustomEvent * @constructor */ Y.CustomEvent = function(type, o) { this._kds = Y.CustomEvent.keepDeprecatedSubs; o = o || {}; this.id = Y.stamp(this); /** * The type of event, returned to subscribers when the event fires * @property type * @type string */ this.type = type; /** * The context the the event will fire from by default. Defaults to the YUI * instance. * @property context * @type object */ this.context = Y; /** * Monitor when an event is attached or detached. * * @property monitored * @type boolean */ // this.monitored = false; this.logSystem = (type == YUI_LOG); /** * If 0, this event does not broadcast. If 1, the YUI instance is notified * every time this event fires. If 2, the YUI instance and the YUI global * (if event is enabled on the global) are notified every time this event * fires. * @property broadcast * @type int */ // this.broadcast = 0; /** * By default all custom events are logged in the debug build, set silent * to true to disable debug outpu for this event. * @property silent * @type boolean */ this.silent = this.logSystem; /** * Specifies whether this event should be queued when the host is actively * processing an event. This will effect exectution order of the callbacks * for the various events. * @property queuable * @type boolean * @default false */ // this.queuable = false; /** * The subscribers to this event * @property subscribers * @type Subscriber {} * @deprecated */ if (this._kds) { this.subscribers = {}; } /** * The subscribers to this event * @property _subscribers * @type Subscriber [] * @private */ this._subscribers = []; /** * 'After' subscribers * @property afters * @type Subscriber {} */ if (this._kds) { this.afters = {}; } /** * 'After' subscribers * @property _afters * @type Subscriber [] * @private */ this._afters = []; /** * This event has fired if true * * @property fired * @type boolean * @default false; */ // this.fired = false; /** * An array containing the arguments the custom event * was last fired with. * @property firedWith * @type Array */ // this.firedWith; /** * This event should only fire one time if true, and if * it has fired, any new subscribers should be notified * immediately. * * @property fireOnce * @type boolean * @default false; */ // this.fireOnce = false; /** * fireOnce listeners will fire syncronously unless async * is set to true * @property async * @type boolean * @default false */ //this.async = false; /** * Flag for stopPropagation that is modified during fire() * 1 means to stop propagation to bubble targets. 2 means * to also stop additional subscribers on this target. * @property stopped * @type int */ // this.stopped = 0; /** * Flag for preventDefault that is modified during fire(). * if it is not 0, the default behavior for this event * @property prevented * @type int */ // this.prevented = 0; /** * Specifies the host for this custom event. This is used * to enable event bubbling * @property host * @type EventTarget */ // this.host = null; /** * The default function to execute after event listeners * have fire, but only if the default action was not * prevented. * @property defaultFn * @type Function */ // this.defaultFn = null; /** * The function to execute if a subscriber calls * stopPropagation or stopImmediatePropagation * @property stoppedFn * @type Function */ // this.stoppedFn = null; /** * The function to execute if a subscriber calls * preventDefault * @property preventedFn * @type Function */ // this.preventedFn = null; /** * Specifies whether or not this event's default function * can be cancelled by a subscriber by executing preventDefault() * on the event facade * @property preventable * @type boolean * @default true */ this.preventable = true; /** * Specifies whether or not a subscriber can stop the event propagation * via stopPropagation(), stopImmediatePropagation(), or halt() * * Events can only bubble if emitFacade is true. * * @property bubbles * @type boolean * @default true */ this.bubbles = true; /** * Supports multiple options for listener signatures in order to * port YUI 2 apps. * @property signature * @type int * @default 9 */ this.signature = YUI3_SIGNATURE; // this.subCount = 0; // this.afterCount = 0; // this.hasSubscribers = false; // this.hasAfters = false; /** * If set to true, the custom event will deliver an EventFacade object * that is similar to a DOM event object. * @property emitFacade * @type boolean * @default false */ // this.emitFacade = false; this.applyConfig(o, true); // this.log("Creating " + this.type); }; /** * Static flag to enable population of the <a href="#property_subscribers">`subscribers`</a> * and <a href="#property_subscribers">`afters`</a> properties held on a `CustomEvent` instance. * * These properties were changed to private properties (`_subscribers` and `_afters`), and * converted from objects to arrays for performance reasons. * * Setting this property to true will populate the deprecated `subscribers` and `afters` * properties for people who may be using them (which is expected to be rare). There will * be a performance hit, compared to the new array based implementation. * * If you are using these deprecated properties for a use case which the public API * does not support, please file an enhancement request, and we can provide an alternate * public implementation which doesn't have the performance cost required to maintiain the * properties as objects. * * @property keepDeprecatedSubs * @static * @for CustomEvent * @type boolean * @default false * @deprecated */ Y.CustomEvent.keepDeprecatedSubs = false; Y.CustomEvent.mixConfigs = mixConfigs; Y.CustomEvent.prototype = { constructor: Y.CustomEvent, /** * Returns the number of subscribers for this event as the sum of the on() * subscribers and after() subscribers. * * @method hasSubs * @return Number */ hasSubs: function(when) { var s = this._subscribers.length, a = this._afters.length, sib = this.sibling; if (sib) { s += sib._subscribers.length; a += sib._afters.length; } if (when) { return (when == 'after') ? a : s; } return (s + a); }, /** * Monitor the event state for the subscribed event. The first parameter * is what should be monitored, the rest are the normal parameters when * subscribing to an event. * @method monitor * @param what {string} what to monitor ('detach', 'attach', 'publish'). * @return {EventHandle} return value from the monitor event subscription. */ monitor: function(what) { this.monitored = true; var type = this.id + '|' + this.type + '_' + what, args = nativeSlice.call(arguments, 0); args[0] = type; return this.host.on.apply(this.host, args); }, /** * Get all of the subscribers to this event and any sibling event * @method getSubs * @return {Array} first item is the on subscribers, second the after. */ getSubs: function() { var s = this._subscribers, a = this._afters, sib = this.sibling; s = (sib) ? s.concat(sib._subscribers) : s.concat(); a = (sib) ? a.concat(sib._afters) : a.concat(); return [s, a]; }, /** * Apply configuration properties. Only applies the CONFIG whitelist * @method applyConfig * @param o hash of properties to apply. * @param force {boolean} if true, properties that exist on the event * will be overwritten. */ applyConfig: function(o, force) { mixConfigs(this, o, force); }, /** * Create the Subscription for subscribing function, context, and bound * arguments. If this is a fireOnce event, the subscriber is immediately * notified. * * @method _on * @param fn {Function} Subscription callback * @param [context] {Object} Override `this` in the callback * @param [args] {Array} bound arguments that will be passed to the callback after the arguments generated by fire() * @param [when] {String} "after" to slot into after subscribers * @return {EventHandle} * @protected */ _on: function(fn, context, args, when) { if (!fn) { this.log('Invalid callback for CE: ' + this.type); } var s = new Y.Subscriber(fn, context, args, when); if (this.fireOnce && this.fired) { if (this.async) { setTimeout(Y.bind(this._notify, this, s, this.firedWith), 0); } else { this._notify(s, this.firedWith); } } if (when == AFTER) { this._afters.push(s); } else { this._subscribers.push(s); } if (this._kds) { if (when == AFTER) { this.afters[s.id] = s; } else { this.subscribers[s.id] = s; } } return new Y.EventHandle(this, s); }, /** * Listen for this event * @method subscribe * @param {Function} fn The function to execute. * @return {EventHandle} Unsubscribe handle. * @deprecated use on. */ subscribe: function(fn, context) { Y.log('ce.subscribe deprecated, use "on"', 'warn', 'deprecated'); var a = (arguments.length > 2) ? nativeSlice.call(arguments, 2) : null; return this._on(fn, context, a, true); }, /** * Listen for this event * @method on * @param {Function} fn The function to execute. * @param {object} context optional execution context. * @param {mixed} arg* 0..n additional arguments to supply to the subscriber * when the event fires. * @return {EventHandle} An object with a detach method to detch the handler(s). */ on: function(fn, context) { var a = (arguments.length > 2) ? nativeSlice.call(arguments, 2) : null; if (this.monitored && this.host) { this.host._monitor('attach', this, { args: arguments }); } return this._on(fn, context, a, true); }, /** * Listen for this event after the normal subscribers have been notified and * the default behavior has been applied. If a normal subscriber prevents the * default behavior, it also prevents after listeners from firing. * @method after * @param {Function} fn The function to execute. * @param {object} context optional execution context. * @param {mixed} arg* 0..n additional arguments to supply to the subscriber * when the event fires. * @return {EventHandle} handle Unsubscribe handle. */ after: function(fn, context) { var a = (arguments.length > 2) ? nativeSlice.call(arguments, 2) : null; return this._on(fn, context, a, AFTER); }, /** * Detach listeners. * @method detach * @param {Function} fn The subscribed function to remove, if not supplied * all will be removed. * @param {Object} context The context object passed to subscribe. * @return {int} returns the number of subscribers unsubscribed. */ detach: function(fn, context) { // unsubscribe handle if (fn && fn.detach) { return fn.detach(); } var i, s, found = 0, subs = this._subscribers, afters = this._afters; for (i = subs.length; i >= 0; i--) { s = subs[i]; if (s && (!fn || fn === s.fn)) { this._delete(s, subs, i); found++; } } for (i = afters.length; i >= 0; i--) { s = afters[i]; if (s && (!fn || fn === s.fn)) { this._delete(s, afters, i); found++; } } return found; }, /** * Detach listeners. * @method unsubscribe * @param {Function} fn The subscribed function to remove, if not supplied * all will be removed. * @param {Object} context The context object passed to subscribe. * @return {int|undefined} returns the number of subscribers unsubscribed. * @deprecated use detach. */ unsubscribe: function() { return this.detach.apply(this, arguments); }, /** * Notify a single subscriber * @method _notify * @param {Subscriber} s the subscriber. * @param {Array} args the arguments array to apply to the listener. * @protected */ _notify: function(s, args, ef) { this.log(this.type + '->' + 'sub: ' + s.id); var ret; ret = s.notify(args, this); if (false === ret || this.stopped > 1) { this.log(this.type + ' cancelled by subscriber'); return false; } return true; }, /** * Logger abstraction to centralize the application of the silent flag * @method log * @param {string} msg message to log. * @param {string} cat log category. */ log: function(msg, cat) { if (!this.silent) { Y.log(this.id + ': ' + msg, cat || 'info', 'event'); } }, /** * Notifies the subscribers. The callback functions will be executed * from the context specified when the event was created, and with the * following parameters: * <ul> * <li>The type of event</li> * <li>All of the arguments fire() was executed with as an array</li> * <li>The custom object (if any) that was passed into the subscribe() * method</li> * </ul> * @method fire * @param {Object*} arguments an arbitrary set of parameters to pass to * the handler. * @return {boolean} false if one of the subscribers returned false, * true otherwise. * */ fire: function() { if (this.fireOnce && this.fired) { this.log('fireOnce event: ' + this.type + ' already fired'); return true; } else { var args = nativeSlice.call(arguments, 0); // this doesn't happen if the event isn't published // this.host._monitor('fire', this.type, args); this.fired = true; if (this.fireOnce) { this.firedWith = args; } if (this.emitFacade) { return this.fireComplex(args); } else { return this.fireSimple(args); } } }, /** * Set up for notifying subscribers of non-emitFacade events. * * @method fireSimple * @param args {Array} Arguments passed to fire() * @return Boolean false if a subscriber returned false * @protected */ fireSimple: function(args) { this.stopped = 0; this.prevented = 0; if (this.hasSubs()) { var subs = this.getSubs(); this._procSubs(subs[0], args); this._procSubs(subs[1], args); } this._broadcast(args); return this.stopped ? false : true; }, // Requires the event-custom-complex module for full funcitonality. fireComplex: function(args) { this.log('Missing event-custom-complex needed to emit a facade for: ' + this.type); args[0] = args[0] || {}; return this.fireSimple(args); }, /** * Notifies a list of subscribers. * * @method _procSubs * @param subs {Array} List of subscribers * @param args {Array} Arguments passed to fire() * @param ef {} * @return Boolean false if a subscriber returns false or stops the event * propagation via e.stopPropagation(), * e.stopImmediatePropagation(), or e.halt() * @private */ _procSubs: function(subs, args, ef) { var s, i, l; for (i = 0, l = subs.length; i < l; i++) { s = subs[i]; if (s && s.fn) { if (false === this._notify(s, args, ef)) { this.stopped = 2; } if (this.stopped == 2) { return false; } } } return true; }, /** * Notifies the YUI instance if the event is configured with broadcast = 1, * and both the YUI instance and Y.Global if configured with broadcast = 2. * * @method _broadcast * @param args {Array} Arguments sent to fire() * @private */ _broadcast: function(args) { if (!this.stopped && this.broadcast) { var a = args.concat(); a.unshift(this.type); if (this.host !== Y) { Y.fire.apply(Y, a); } if (this.broadcast == 2) { Y.Global.fire.apply(Y.Global, a); } } }, /** * Removes all listeners * @method unsubscribeAll * @return {int} The number of listeners unsubscribed. * @deprecated use detachAll. */ unsubscribeAll: function() { return this.detachAll.apply(this, arguments); }, /** * Removes all listeners * @method detachAll * @return {int} The number of listeners unsubscribed. */ detachAll: function() { return this.detach(); }, /** * Deletes the subscriber from the internal store of on() and after() * subscribers. * * @method _delete * @param s subscriber object. * @param subs (optional) on or after subscriber array * @param index (optional) The index found. * @private */ _delete: function(s, subs, i) { var when = s._when; if (!subs) { subs = (when === AFTER) ? this._afters : this._subscribers; i = YArray.indexOf(subs, s, 0); } if (s && subs[i] === s) { subs.splice(i, 1); } if (this._kds) { if (when === AFTER) { delete this.afters[s.id]; } else { delete this.subscribers[s.id]; } } if (this.monitored && this.host) { this.host._monitor('detach', this, { ce: this, sub: s }); } if (s) { s.deleted = true; } } }; /** * Stores the subscriber information to be used when the event fires. * @param {Function} fn The wrapped function to execute. * @param {Object} context The value of the keyword 'this' in the listener. * @param {Array} args* 0..n additional arguments to supply the listener. * * @class Subscriber * @constructor */ Y.Subscriber = function(fn, context, args, when) { /** * The callback that will be execute when the event fires * This is wrapped by Y.rbind if obj was supplied. * @property fn * @type Function */ this.fn = fn; /** * Optional 'this' keyword for the listener * @property context * @type Object */ this.context = context; /** * Unique subscriber id * @property id * @type String */ this.id = Y.stamp(this); /** * Additional arguments to propagate to the subscriber * @property args * @type Array */ this.args = args; this._when = when; /** * Custom events for a given fire transaction. * @property events * @type {EventTarget} */ // this.events = null; /** * This listener only reacts to the event once * @property once */ // this.once = false; }; Y.Subscriber.prototype = { constructor: Y.Subscriber, _notify: function(c, args, ce) { if (this.deleted && !this.postponed) { if (this.postponed) { delete this.fn; delete this.context; } else { delete this.postponed; return null; } } var a = this.args, ret; switch (ce.signature) { case 0: ret = this.fn.call(c, ce.type, args, c); break; case 1: ret = this.fn.call(c, args[0] || null, c); break; default: if (a || args) { args = args || []; a = (a) ? args.concat(a) : args; ret = this.fn.apply(c, a); } else { ret = this.fn.call(c); } } if (this.once) { ce._delete(this); } return ret; }, /** * Executes the subscriber. * @method notify * @param args {Array} Arguments array for the subscriber. * @param ce {CustomEvent} The custom event that sent the notification. */ notify: function(args, ce) { var c = this.context, ret = true; if (!c) { c = (ce.contextFn) ? ce.contextFn() : ce.context; } // only catch errors if we will not re-throw them. if (Y.config && Y.config.throwFail) { ret = this._notify(c, args, ce); } else { try { ret = this._notify(c, args, ce); } catch (e) { Y.error(this + ' failed: ' + e.message, e); } } return ret; }, /** * Returns true if the fn and obj match this objects properties. * Used by the unsubscribe method to match the right subscriber. * * @method contains * @param {Function} fn the function to execute. * @param {Object} context optional 'this' keyword for the listener. * @return {boolean} true if the supplied arguments match this * subscriber's signature. */ contains: function(fn, context) { if (context) { return ((this.fn == fn) && this.context == context); } else { return (this.fn == fn); } }, valueOf : function() { return this.id; } }; /** * Return value from all subscribe operations * @class EventHandle * @constructor * @param {CustomEvent} evt the custom event. * @param {Subscriber} sub the subscriber. */ Y.EventHandle = function(evt, sub) { /** * The custom event * * @property evt * @type CustomEvent */ this.evt = evt; /** * The subscriber object * * @property sub * @type Subscriber */ this.sub = sub; }; Y.EventHandle.prototype = { batch: function(f, c) { f.call(c || this, this); if (Y.Lang.isArray(this.evt)) { Y.Array.each(this.evt, function(h) { h.batch.call(c || h, f); }); } }, /** * Detaches this subscriber * @method detach * @return {int} the number of detached listeners */ detach: function() { var evt = this.evt, detached = 0, i; if (evt) { // Y.log('EventHandle.detach: ' + this.sub, 'info', 'Event'); if (Y.Lang.isArray(evt)) { for (i = 0; i < evt.length; i++) { detached += evt[i].detach(); } } else { evt._delete(this.sub); detached = 1; } } return detached; }, /** * Monitor the event state for the subscribed event. The first parameter * is what should be monitored, the rest are the normal parameters when * subscribing to an event. * @method monitor * @param what {string} what to monitor ('attach', 'detach', 'publish'). * @return {EventHandle} return value from the monitor event subscription. */ monitor: function(what) { return this.evt.monitor.apply(this.evt, arguments); } }; /** * Custom event engine, DOM event listener abstraction layer, synthetic DOM * events. * @module event-custom * @submodule event-custom-base */ /** * EventTarget provides the implementation for any object to * publish, subscribe and fire to custom events, and also * alows other EventTargets to target the object with events * sourced from the other object. * EventTarget is designed to be used with Y.augment to wrap * EventCustom in an interface that allows events to be listened to * and fired by name. This makes it possible for implementing code to * subscribe to an event that either has not been created yet, or will * not be created at all. * @class EventTarget * @param opts a configuration object * @config emitFacade {boolean} if true, all events will emit event * facade payloads by default (default false) * @config prefix {String} the prefix to apply to non-prefixed event names */ var L = Y.Lang, PREFIX_DELIMITER = ':', CATEGORY_DELIMITER = '|', AFTER_PREFIX = '~AFTER~', WILD_TYPE_RE = /(.*?)(:)(.*?)/, _wildType = Y.cached(function(type) { return type.replace(WILD_TYPE_RE, "*$2$3"); }), /** * If the instance has a prefix attribute and the * event type is not prefixed, the instance prefix is * applied to the supplied type. * @method _getType * @private */ _getType = Y.cached(function(type, pre) { if (!pre || (typeof type !== "string") || type.indexOf(PREFIX_DELIMITER) > -1) { return type; } return pre + PREFIX_DELIMITER + type; }), /** * Returns an array with the detach key (if provided), * and the prefixed event name from _getType * Y.on('detachcategory| menu:click', fn) * @method _parseType * @private */ _parseType = Y.cached(function(type, pre) { var t = type, detachcategory, after, i; if (!L.isString(t)) { return t; } i = t.indexOf(AFTER_PREFIX); if (i > -1) { after = true; t = t.substr(AFTER_PREFIX.length); // Y.log(t); } i = t.indexOf(CATEGORY_DELIMITER); if (i > -1) { detachcategory = t.substr(0, (i)); t = t.substr(i+1); if (t == '*') { t = null; } } // detach category, full type with instance prefix, is this an after listener, short type return [detachcategory, (pre) ? _getType(t, pre) : t, after, t]; }), ET = function(opts) { // Y.log('EventTarget constructor executed: ' + this._yuid); var o = (L.isObject(opts)) ? opts : {}; this._yuievt = this._yuievt || { id: Y.guid(), events: {}, targets: {}, config: o, chain: ('chain' in o) ? o.chain : Y.config.chain, bubbling: false, defaults: { context: o.context || this, host: this, emitFacade: o.emitFacade, fireOnce: o.fireOnce, queuable: o.queuable, monitored: o.monitored, broadcast: o.broadcast, defaultTargetOnly: o.defaultTargetOnly, bubbles: ('bubbles' in o) ? o.bubbles : true } }; }; ET.prototype = { constructor: ET, /** * Listen to a custom event hosted by this object one time. * This is the equivalent to <code>on</code> except the * listener is immediatelly detached when it is executed. * @method once * @param {String} type The name of the event * @param {Function} fn The callback to execute in response to the event * @param {Object} [context] Override `this` object in callback * @param {Any} [arg*] 0..n additional arguments to supply to the subscriber * @return {EventHandle} A subscription handle capable of detaching the * subscription */ once: function() { var handle = this.on.apply(this, arguments); handle.batch(function(hand) { if (hand.sub) { hand.sub.once = true; } }); return handle; }, /** * Listen to a custom event hosted by this object one time. * This is the equivalent to <code>after</code> except the * listener is immediatelly detached when it is executed. * @method onceAfter * @param {String} type The name of the event * @param {Function} fn The callback to execute in response to the event * @param {Object} [context] Override `this` object in callback * @param {Any} [arg*] 0..n additional arguments to supply to the subscriber * @return {EventHandle} A subscription handle capable of detaching that * subscription */ onceAfter: function() { var handle = this.after.apply(this, arguments); handle.batch(function(hand) { if (hand.sub) { hand.sub.once = true; } }); return handle; }, /** * Takes the type parameter passed to 'on' and parses out the * various pieces that could be included in the type. If the * event type is passed without a prefix, it will be expanded * to include the prefix one is supplied or the event target * is configured with a default prefix. * @method parseType * @param {String} type the type * @param {String} [pre=this._yuievt.config.prefix] the prefix * @since 3.3.0 * @return {Array} an array containing: * * the detach category, if supplied, * * the prefixed event type, * * whether or not this is an after listener, * * the supplied event type */ parseType: function(type, pre) { return _parseType(type, pre || this._yuievt.config.prefix); }, /** * Subscribe a callback function to a custom event fired by this object or * from an object that bubbles its events to this object. * * Callback functions for events published with `emitFacade = true` will * receive an `EventFacade` as the first argument (typically named "e"). * These callbacks can then call `e.preventDefault()` to disable the * behavior published to that event's `defaultFn`. See the `EventFacade` * API for all available properties and methods. Subscribers to * non-`emitFacade` events will receive the arguments passed to `fire()` * after the event name. * * To subscribe to multiple events at once, pass an object as the first * argument, where the key:value pairs correspond to the eventName:callback, * or pass an array of event names as the first argument to subscribe to * all listed events with the same callback. * * Returning `false` from a callback is supported as an alternative to * calling `e.preventDefault(); e.stopPropagation();`. However, it is * recommended to use the event methods whenever possible. * * @method on * @param {String} type The name of the event * @param {Function} fn The callback to execute in response to the event * @param {Object} [context] Override `this` object in callback * @param {Any} [arg*] 0..n additional arguments to supply to the subscriber * @return {EventHandle} A subscription handle capable of detaching that * subscription */ on: function(type, fn, context) { var yuievt = this._yuievt, parts = _parseType(type, yuievt.config.prefix), f, c, args, ret, ce, detachcategory, handle, store = Y.Env.evt.handles, after, adapt, shorttype, Node = Y.Node, n, domevent, isArr; // full name, args, detachcategory, after this._monitor('attach', parts[1], { args: arguments, category: parts[0], after: parts[2] }); if (L.isObject(type)) { if (L.isFunction(type)) { return Y.Do.before.apply(Y.Do, arguments); } f = fn; c = context; args = nativeSlice.call(arguments, 0); ret = []; if (L.isArray(type)) { isArr = true; } after = type._after; delete type._after; Y.each(type, function(v, k) { if (L.isObject(v)) { f = v.fn || ((L.isFunction(v)) ? v : f); c = v.context || c; } var nv = (after) ? AFTER_PREFIX : ''; args[0] = nv + ((isArr) ? v : k); args[1] = f; args[2] = c; ret.push(this.on.apply(this, args)); }, this); return (yuievt.chain) ? this : new Y.EventHandle(ret); } detachcategory = parts[0]; after = parts[2]; shorttype = parts[3]; // extra redirection so we catch adaptor events too. take a look at this. if (Node && Y.instanceOf(this, Node) && (shorttype in Node.DOM_EVENTS)) { args = nativeSlice.call(arguments, 0); args.splice(2, 0, Node.getDOMNode(this)); // Y.log("Node detected, redirecting with these args: " + args); return Y.on.apply(Y, args); } type = parts[1]; if (Y.instanceOf(this, YUI)) { adapt = Y.Env.evt.plugins[type]; args = nativeSlice.call(arguments, 0); args[0] = shorttype; if (Node) { n = args[2]; if (Y.instanceOf(n, Y.NodeList)) { n = Y.NodeList.getDOMNodes(n); } else if (Y.instanceOf(n, Node)) { n = Node.getDOMNode(n); } domevent = (shorttype in Node.DOM_EVENTS); // Captures both DOM events and event plugins. if (domevent) { args[2] = n; } } // check for the existance of an event adaptor if (adapt) { Y.log('Using adaptor for ' + shorttype + ', ' + n, 'info', 'event'); handle = adapt.on.apply(Y, args); } else if ((!type) || domevent) { handle = Y.Event._attach(args); } } if (!handle) { ce = yuievt.events[type] || this.publish(type); handle = ce._on(fn, context, (arguments.length > 3) ? nativeSlice.call(arguments, 3) : null, (after) ? 'after' : true); } if (detachcategory) { store[detachcategory] = store[detachcategory] || {}; store[detachcategory][type] = store[detachcategory][type] || []; store[detachcategory][type].push(handle); } return (yuievt.chain) ? this : handle; }, /** * subscribe to an event * @method subscribe * @deprecated use on */ subscribe: function() { Y.log('EventTarget subscribe() is deprecated, use on()', 'warn', 'deprecated'); return this.on.apply(this, arguments); }, /** * Detach one or more listeners the from the specified event * @method detach * @param type {string|Object} Either the handle to the subscriber or the * type of event. If the type * is not specified, it will attempt to remove * the listener from all hosted events. * @param fn {Function} The subscribed function to unsubscribe, if not * supplied, all subscribers will be removed. * @param context {Object} The custom object passed to subscribe. This is * optional, but if supplied will be used to * disambiguate multiple listeners that are the same * (e.g., you subscribe many object using a function * that lives on the prototype) * @return {EventTarget} the host */ detach: function(type, fn, context) { var evts = this._yuievt.events, i, Node = Y.Node, isNode = Node && (Y.instanceOf(this, Node)); // detachAll disabled on the Y instance. if (!type && (this !== Y)) { for (i in evts) { if (evts.hasOwnProperty(i)) { evts[i].detach(fn, context); } } if (isNode) { Y.Event.purgeElement(Node.getDOMNode(this)); } return this; } var parts = _parseType(type, this._yuievt.config.prefix), detachcategory = L.isArray(parts) ? parts[0] : null, shorttype = (parts) ? parts[3] : null, adapt, store = Y.Env.evt.handles, detachhost, cat, args, ce, keyDetacher = function(lcat, ltype, host) { var handles = lcat[ltype], ce, i; if (handles) { for (i = handles.length - 1; i >= 0; --i) { ce = handles[i].evt; if (ce.host === host || ce.el === host) { handles[i].detach(); } } } }; if (detachcategory) { cat = store[detachcategory]; type = parts[1]; detachhost = (isNode) ? Y.Node.getDOMNode(this) : this; if (cat) { if (type) { keyDetacher(cat, type, detachhost); } else { for (i in cat) { if (cat.hasOwnProperty(i)) { keyDetacher(cat, i, detachhost); } } } return this; } // If this is an event handle, use it to detach } else if (L.isObject(type) && type.detach) { type.detach(); return this; // extra redirection so we catch adaptor events too. take a look at this. } else if (isNode && ((!shorttype) || (shorttype in Node.DOM_EVENTS))) { args = nativeSlice.call(arguments, 0); args[2] = Node.getDOMNode(this); Y.detach.apply(Y, args); return this; } adapt = Y.Env.evt.plugins[shorttype]; // The YUI instance handles DOM events and adaptors if (Y.instanceOf(this, YUI)) { args = nativeSlice.call(arguments, 0); // use the adaptor specific detach code if if (adapt && adapt.detach) { adapt.detach.apply(Y, args); return this; // DOM event fork } else if (!type || (!adapt && Node && (type in Node.DOM_EVENTS))) { args[0] = type; Y.Event.detach.apply(Y.Event, args); return this; } } // ce = evts[type]; ce = evts[parts[1]]; if (ce) { ce.detach(fn, context); } return this; }, /** * detach a listener * @method unsubscribe * @deprecated use detach */ unsubscribe: function() { Y.log('EventTarget unsubscribe() is deprecated, use detach()', 'warn', 'deprecated'); return this.detach.apply(this, arguments); }, /** * Removes all listeners from the specified event. If the event type * is not specified, all listeners from all hosted custom events will * be removed. * @method detachAll * @param type {String} The type, or name of the event */ detachAll: function(type) { return this.detach(type); }, /** * Removes all listeners from the specified event. If the event type * is not specified, all listeners from all hosted custom events will * be removed. * @method unsubscribeAll * @param type {String} The type, or name of the event * @deprecated use detachAll */ unsubscribeAll: function() { Y.log('EventTarget unsubscribeAll() is deprecated, use detachAll()', 'warn', 'deprecated'); return this.detachAll.apply(this, arguments); }, /** * Creates a new custom event of the specified type. If a custom event * by that name already exists, it will not be re-created. In either * case the custom event is returned. * * @method publish * * @param type {String} the type, or name of the event * @param opts {object} optional config params. Valid properties are: * * <ul> * <li> * 'broadcast': whether or not the YUI instance and YUI global are notified when the event is fired (false) * </li> * <li> * 'bubbles': whether or not this event bubbles (true) * Events can only bubble if emitFacade is true. * </li> * <li> * 'context': the default execution context for the listeners (this) * </li> * <li> * 'defaultFn': the default function to execute when this event fires if preventDefault was not called * </li> * <li> * 'emitFacade': whether or not this event emits a facade (false) * </li> * <li> * 'prefix': the prefix for this targets events, e.g., 'menu' in 'menu:click' * </li> * <li> * 'fireOnce': if an event is configured to fire once, new subscribers after * the fire will be notified immediately. * </li> * <li> * 'async': fireOnce event listeners will fire synchronously if the event has already * fired unless async is true. * </li> * <li> * 'preventable': whether or not preventDefault() has an effect (true) * </li> * <li> * 'preventedFn': a function that is executed when preventDefault is called * </li> * <li> * 'queuable': whether or not this event can be queued during bubbling (false) * </li> * <li> * 'silent': if silent is true, debug messages are not provided for this event. * </li> * <li> * 'stoppedFn': a function that is executed when stopPropagation is called * </li> * * <li> * 'monitored': specifies whether or not this event should send notifications about * when the event has been attached, detached, or published. * </li> * <li> * 'type': the event type (valid option if not provided as the first parameter to publish) * </li> * </ul> * * @return {CustomEvent} the custom event * */ publish: function(type, opts) { var events, ce, ret, defaults, edata = this._yuievt, pre = edata.config.prefix; if (L.isObject(type)) { ret = {}; Y.each(type, function(v, k) { ret[k] = this.publish(k, v || opts); }, this); return ret; } type = (pre) ? _getType(type, pre) : type; events = edata.events; ce = events[type]; this._monitor('publish', type, { args: arguments }); if (ce) { // ce.log("publish applying new config to published event: '"+type+"' exists", 'info', 'event'); if (opts) { ce.applyConfig(opts, true); } } else { // TODO: Lazy publish goes here. defaults = edata.defaults; // apply defaults ce = new Y.CustomEvent(type, defaults); if (opts) { ce.applyConfig(opts, true); } events[type] = ce; } // make sure we turn the broadcast flag off if this // event was published as a result of bubbling // if (opts instanceof Y.CustomEvent) { // events[type].broadcast = false; // } return events[type]; }, /** * This is the entry point for the event monitoring system. * You can monitor 'attach', 'detach', 'fire', and 'publish'. * When configured, these events generate an event. click -> * click_attach, click_detach, click_publish -- these can * be subscribed to like other events to monitor the event * system. Inividual published events can have monitoring * turned on or off (publish can't be turned off before it * it published) by setting the events 'monitor' config. * * @method _monitor * @param what {String} 'attach', 'detach', 'fire', or 'publish' * @param eventType {String|CustomEvent} The prefixed name of the event being monitored, or the CustomEvent object. * @param o {Object} Information about the event interaction, such as * fire() args, subscription category, publish config * @private */ _monitor: function(what, eventType, o) { var monitorevt, ce, type; if (eventType) { if (typeof eventType === "string") { type = eventType; ce = this.getEvent(eventType, true); } else { ce = eventType; type = eventType.type; } if ((this._yuievt.config.monitored && (!ce || ce.monitored)) || (ce && ce.monitored)) { monitorevt = type + '_' + what; o.monitored = what; this.fire.call(this, monitorevt, o); } } }, /** * Fire a custom event by name. The callback functions will be executed * from the context specified when the event was created, and with the * following parameters. * * If the custom event object hasn't been created, then the event hasn't * been published and it has no subscribers. For performance sake, we * immediate exit in this case. This means the event won't bubble, so * if the intention is that a bubble target be notified, the event must * be published on this object first. * * The first argument is the event type, and any additional arguments are * passed to the listeners as parameters. If the first of these is an * object literal, and the event is configured to emit an event facade, * that object is mixed into the event facade and the facade is provided * in place of the original object. * * @method fire * @param type {String|Object} The type of the event, or an object that contains * a 'type' property. * @param arguments {Object*} an arbitrary set of parameters to pass to * the handler. If the first of these is an object literal and the event is * configured to emit an event facade, the event facade will replace that * parameter after the properties the object literal contains are copied to * the event facade. * @return {EventTarget} the event host */ fire: function(type) { var typeIncluded = L.isString(type), t = (typeIncluded) ? type : (type && type.type), yuievt = this._yuievt, pre = yuievt.config.prefix, ce, ret, ce2, args = (typeIncluded) ? nativeSlice.call(arguments, 1) : arguments; t = (pre) ? _getType(t, pre) : t; ce = this.getEvent(t, true); ce2 = this.getSibling(t, ce); if (ce2 && !ce) { ce = this.publish(t); } this._monitor('fire', (ce || t), { args: args }); // this event has not been published or subscribed to if (!ce) { if (yuievt.hasTargets) { return this.bubble({ type: t }, args, this); } // otherwise there is nothing to be done ret = true; } else { ce.sibling = ce2; ret = ce.fire.apply(ce, args); } return (yuievt.chain) ? this : ret; }, getSibling: function(type, ce) { var ce2; // delegate to *:type events if there are subscribers if (type.indexOf(PREFIX_DELIMITER) > -1) { type = _wildType(type); // console.log(type); ce2 = this.getEvent(type, true); if (ce2) { // console.log("GOT ONE: " + type); ce2.applyConfig(ce); ce2.bubbles = false; ce2.broadcast = 0; // ret = ce2.fire.apply(ce2, a); } } return ce2; }, /** * Returns the custom event of the provided type has been created, a * falsy value otherwise * @method getEvent * @param type {String} the type, or name of the event * @param prefixed {String} if true, the type is prefixed already * @return {CustomEvent} the custom event or null */ getEvent: function(type, prefixed) { var pre, e; if (!prefixed) { pre = this._yuievt.config.prefix; type = (pre) ? _getType(type, pre) : type; } e = this._yuievt.events; return e[type] || null; }, /** * Subscribe to a custom event hosted by this object. The * supplied callback will execute after any listeners add * via the subscribe method, and after the default function, * if configured for the event, has executed. * * @method after * @param {String} type The name of the event * @param {Function} fn The callback to execute in response to the event * @param {Object} [context] Override `this` object in callback * @param {Any} [arg*] 0..n additional arguments to supply to the subscriber * @return {EventHandle} A subscription handle capable of detaching the * subscription */ after: function(type, fn) { var a = nativeSlice.call(arguments, 0); switch (L.type(type)) { case 'function': return Y.Do.after.apply(Y.Do, arguments); case 'array': // YArray.each(a[0], function(v) { // v = AFTER_PREFIX + v; // }); // break; case 'object': a[0]._after = true; break; default: a[0] = AFTER_PREFIX + type; } return this.on.apply(this, a); }, /** * Executes the callback before a DOM event, custom event * or method. If the first argument is a function, it * is assumed the target is a method. For DOM and custom * events, this is an alias for Y.on. * * For DOM and custom events: * type, callback, context, 0-n arguments * * For methods: * callback, object (method host), methodName, context, 0-n arguments * * @method before * @return detach handle */ before: function() { return this.on.apply(this, arguments); } }; Y.EventTarget = ET; // make Y an event target Y.mix(Y, ET.prototype); ET.call(Y, { bubbles: false }); YUI.Env.globalEvents = YUI.Env.globalEvents || new ET(); /** * Hosts YUI page level events. This is where events bubble to * when the broadcast config is set to 2. This property is * only available if the custom event module is loaded. * @property Global * @type EventTarget * @for YUI */ Y.Global = YUI.Env.globalEvents; // @TODO implement a global namespace function on Y.Global? /** `Y.on()` can do many things: <ul> <li>Subscribe to custom events `publish`ed and `fire`d from Y</li> <li>Subscribe to custom events `publish`ed with `broadcast` 1 or 2 and `fire`d from any object in the YUI instance sandbox</li> <li>Subscribe to DOM events</li> <li>Subscribe to the execution of a method on any object, effectively treating that method as an event</li> </ul> For custom event subscriptions, pass the custom event name as the first argument and callback as the second. The `this` object in the callback will be `Y` unless an override is passed as the third argument. Y.on('io:complete', function () { Y.MyApp.updateStatus('Transaction complete'); }); To subscribe to DOM events, pass the name of a DOM event as the first argument and a CSS selector string as the third argument after the callback function. Alternately, the third argument can be a `Node`, `NodeList`, `HTMLElement`, array, or simply omitted (the default is the `window` object). Y.on('click', function (e) { e.preventDefault(); // proceed with ajax form submission var url = this.get('action'); ... }, '#my-form'); The `this` object in DOM event callbacks will be the `Node` targeted by the CSS selector or other identifier. `on()` subscribers for DOM events or custom events `publish`ed with a `defaultFn` can prevent the default behavior with `e.preventDefault()` from the event object passed as the first parameter to the subscription callback. To subscribe to the execution of an object method, pass arguments corresponding to the call signature for <a href="../classes/Do.html#methods_before">`Y.Do.before(...)`</a>. NOTE: The formal parameter list below is for events, not for function injection. See `Y.Do.before` for that signature. @method on @param {String} type DOM or custom event name @param {Function} fn The callback to execute in response to the event @param {Object} [context] Override `this` object in callback @param {Any} [arg*] 0..n additional arguments to supply to the subscriber @return {EventHandle} A subscription handle capable of detaching the subscription @see Do.before @for YUI **/ /** Listen for an event one time. Equivalent to `on()`, except that the listener is immediately detached when executed. See the <a href="#methods_on">`on()` method</a> for additional subscription options. @see on @method once @param {String} type DOM or custom event name @param {Function} fn The callback to execute in response to the event @param {Object} [context] Override `this` object in callback @param {Any} [arg*] 0..n additional arguments to supply to the subscriber @return {EventHandle} A subscription handle capable of detaching the subscription @for YUI **/ /** Listen for an event one time. Equivalent to `once()`, except, like `after()`, the subscription callback executes after all `on()` subscribers and the event's `defaultFn` (if configured) have executed. Like `after()` if any `on()` phase subscriber calls `e.preventDefault()`, neither the `defaultFn` nor the `after()` subscribers will execute. The listener is immediately detached when executed. See the <a href="#methods_on">`on()` method</a> for additional subscription options. @see once @method onceAfter @param {String} type The custom event name @param {Function} fn The callback to execute in response to the event @param {Object} [context] Override `this` object in callback @param {Any} [arg*] 0..n additional arguments to supply to the subscriber @return {EventHandle} A subscription handle capable of detaching the subscription @for YUI **/ /** Like `on()`, this method creates a subscription to a custom event or to the execution of a method on an object. For events, `after()` subscribers are executed after the event's `defaultFn` unless `e.preventDefault()` was called from an `on()` subscriber. See the <a href="#methods_on">`on()` method</a> for additional subscription options. NOTE: The subscription signature shown is for events, not for function injection. See <a href="../classes/Do.html#methods_after">`Y.Do.after`</a> for that signature. @see on @see Do.after @method after @param {String} type The custom event name @param {Function} fn The callback to execute in response to the event @param {Object} [context] Override `this` object in callback @param {Any} [args*] 0..n additional arguments to supply to the subscriber @return {EventHandle} A subscription handle capable of detaching the subscription @for YUI **/ }, '@VERSION@', {"requires": ["oop"]});
ajax/libs/material-ui/5.0.0-alpha.13/modern/OutlinedInput/OutlinedInput.js
cdnjs/cdnjs
import _extends from "@babel/runtime/helpers/esm/extends"; import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose"; import * as React from 'react'; import PropTypes from 'prop-types'; import clsx from 'clsx'; import { refType } from '@material-ui/utils'; import InputBase from '../InputBase'; import NotchedOutline from './NotchedOutline'; import withStyles from '../styles/withStyles'; export const styles = theme => { const borderColor = theme.palette.mode === 'light' ? 'rgba(0, 0, 0, 0.23)' : 'rgba(255, 255, 255, 0.23)'; return { /* Styles applied to the root element. */ root: { position: 'relative', borderRadius: theme.shape.borderRadius, '&:hover $notchedOutline': { borderColor: theme.palette.text.primary }, // Reset on touch devices, it doesn't add specificity '@media (hover: none)': { '&:hover $notchedOutline': { borderColor } }, '&$focused $notchedOutline': { borderColor: theme.palette.primary.main, borderWidth: 2 }, '&$error $notchedOutline': { borderColor: theme.palette.error.main }, '&$disabled $notchedOutline': { borderColor: theme.palette.action.disabled } }, /* Styles applied to the root element if the color is secondary. */ colorSecondary: { '&$focused $notchedOutline': { borderColor: theme.palette.secondary.main } }, /* Styles applied to the root element if the component is focused. */ focused: {}, /* Styles applied to the root element if `disabled={true}`. */ disabled: {}, /* Styles applied to the root element if `startAdornment` is provided. */ adornedStart: { paddingLeft: 14 }, /* Styles applied to the root element if `endAdornment` is provided. */ adornedEnd: { paddingRight: 14 }, /* Pseudo-class applied to the root element if `error={true}`. */ error: {}, /* Styles applied to the `input` element if `margin="dense"`. */ marginDense: {}, /* Styles applied to the root element if `multiline={true}`. */ multiline: { padding: '16.5px 14px', '&$marginDense': { paddingTop: 10.5, paddingBottom: 10.5 } }, /* Styles applied to the `NotchedOutline` element. */ notchedOutline: { borderColor }, /* Styles applied to the `input` element. */ input: { padding: '16.5px 14px', '&:-webkit-autofill': { WebkitBoxShadow: theme.palette.mode === 'light' ? null : '0 0 0 100px #266798 inset', WebkitTextFillColor: theme.palette.mode === 'light' ? null : '#fff', caretColor: theme.palette.mode === 'light' ? null : '#fff', borderRadius: 'inherit' } }, /* Styles applied to the `input` element if `margin="dense"`. */ inputMarginDense: { paddingTop: 8.5, paddingBottom: 8.5 }, /* Styles applied to the `input` element if `multiline={true}`. */ inputMultiline: { padding: 0 }, /* Styles applied to the `input` element if `startAdornment` is provided. */ inputAdornedStart: { paddingLeft: 0 }, /* Styles applied to the `input` element if `endAdornment` is provided. */ inputAdornedEnd: { paddingRight: 0 } }; }; const OutlinedInput = /*#__PURE__*/React.forwardRef(function OutlinedInput(props, ref) { const { classes, fullWidth = false, inputComponent = 'input', label, labelWidth = 0, multiline = false, notched, type = 'text' } = props, other = _objectWithoutPropertiesLoose(props, ["classes", "fullWidth", "inputComponent", "label", "labelWidth", "multiline", "notched", "type"]); return /*#__PURE__*/React.createElement(InputBase, _extends({ renderSuffix: state => /*#__PURE__*/React.createElement(NotchedOutline, { className: classes.notchedOutline, label: label, labelWidth: labelWidth, notched: typeof notched !== 'undefined' ? notched : Boolean(state.startAdornment || state.filled || state.focused) }), classes: _extends({}, classes, { root: clsx(classes.root, classes.underline), notchedOutline: null }), fullWidth: fullWidth, inputComponent: inputComponent, multiline: multiline, ref: ref, type: type }, other)); }); process.env.NODE_ENV !== "production" ? OutlinedInput.propTypes = { // ----------------------------- Warning -------------------------------- // | These PropTypes are generated from the TypeScript type definitions | // | To update them edit the d.ts file and run "yarn proptypes" | // ---------------------------------------------------------------------- /** * This prop helps users to fill forms faster, especially on mobile devices. * The name can be confusing, as it's more like an autofill. * You can learn more about it [following the specification](https://html.spec.whatwg.org/multipage/form-control-infrastructure.html#autofill). */ autoComplete: PropTypes.string, /** * If `true`, the `input` element will be focused during the first mount. */ autoFocus: PropTypes.bool, /** * Override or extend the styles applied to the component. */ classes: PropTypes.object, /** * The color of the component. It supports those theme colors that make sense for this component. * The prop defaults to the value (`'primary'`) inherited from the parent FormControl component. */ color: PropTypes.oneOf(['primary', 'secondary']), /** * The default `input` element value. Use when the component is not controlled. */ defaultValue: PropTypes.any, /** * If `true`, the `input` element will be disabled. * The prop defaults to the value (`false`) inherited from the parent FormControl component. */ disabled: PropTypes.bool, /** * End `InputAdornment` for this component. */ endAdornment: PropTypes.node, /** * If `true`, the input will indicate an error. * The prop defaults to the value (`false`) inherited from the parent FormControl component. */ error: PropTypes.bool, /** * If `true`, the input will take up the full width of its container. * @default false */ fullWidth: PropTypes.bool, /** * The id of the `input` element. */ id: PropTypes.string, /** * The component used for the `input` element. * Either a string to use a HTML element or a component. * @default 'input' */ inputComponent: PropTypes.elementType, /** * [Attributes](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#Attributes) applied to the `input` element. * @default {} */ inputProps: PropTypes.object, /** * Pass a ref to the `input` element. */ inputRef: refType, /** * The label of the input. It is only used for layout. The actual labelling * is handled by `InputLabel`. If specified `labelWidth` is ignored. */ label: PropTypes.node, /** * The width of the label. Is ignored if `label` is provided. Prefer `label` * if the input label appears with a strike through. * @default 0 */ labelWidth: PropTypes.number, /** * If `dense`, will adjust vertical spacing. This is normally obtained via context from * FormControl. * The prop defaults to the value (`'none'`) inherited from the parent FormControl component. */ margin: PropTypes.oneOf(['dense', 'none']), /** * Maximum number of rows to display when multiline option is set to true. */ maxRows: PropTypes.oneOfType([PropTypes.number, PropTypes.string]), /** * Minimum number of rows to display when multiline option is set to true. */ minRows: PropTypes.oneOfType([PropTypes.number, PropTypes.string]), /** * If `true`, a textarea element will be rendered. * @default false */ multiline: PropTypes.bool, /** * Name attribute of the `input` element. */ name: PropTypes.string, /** * If `true`, the outline is notched to accommodate the label. */ notched: PropTypes.bool, /** * Callback fired when the value is changed. * * @param {object} event The event source of the callback. * You can pull out the new value by accessing `event.target.value` (string). */ onChange: PropTypes.func, /** * The short hint displayed in the input before the user enters a value. */ placeholder: PropTypes.string, /** * It prevents the user from changing the value of the field * (not from interacting with the field). */ readOnly: PropTypes.bool, /** * If `true`, the `input` element will be required. * The prop defaults to the value (`false`) inherited from the parent FormControl component. */ required: PropTypes.bool, /** * Number of rows to display when multiline option is set to true. */ rows: PropTypes.oneOfType([PropTypes.number, PropTypes.string]), /** * Start `InputAdornment` for this component. */ startAdornment: PropTypes.node, /** * Type of the `input` element. It should be [a valid HTML5 input type](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#Form_%3Cinput%3E_types). * @default 'text' */ type: PropTypes.string, /** * The value of the `input` element, required for a controlled component. */ value: PropTypes.any } : void 0; OutlinedInput.muiName = 'Input'; export default withStyles(styles, { name: 'MuiOutlinedInput' })(OutlinedInput);
views/huge-app/components/GlobalNav.js
FeifeiyuM/koa2-boilerplate-yu
import React, { Component } from 'react' import { Link } from 'react-router' const dark = 'hsl(200, 20%, 20%)' const light = '#fff' const styles = {} styles.wrapper = { padding: '10px 20px', overflow: 'hidden', background: dark, color: light } styles.link = { padding: 11, color: light, fontWeight: 200 } styles.activeLink = { // ...styles.link, background: light, color: dark } class GlobalNav extends Component { constructor(props, context) { super(props, context) this.logOut = this.logOut.bind(this) } logOut() { alert('log out') } render() { const { user } = this.props return ( <div style={styles.wrapper}> <div style={{ float: 'left' }}> <Link to="/" style={styles.link}>Home</Link>{' '} <Link to="/calendar" style={styles.link} activeStyle={styles.activeLink}>Calendar</Link>{' '} <Link to="/grades" style={styles.link} activeStyle={styles.activeLink}>Grades</Link>{' '} <Link to="/messages" style={styles.link} activeStyle={styles.activeLink}>Messages</Link>{' '} </div> <div style={{ float: 'right' }}> <Link style={styles.link} to="/profile">{user.name}</Link> <button onClick={this.logOut}>log out</button> </div> </div> ) } } GlobalNav.defaultProps = { user: { id: 1, name: 'Ryan Florence' } } export default GlobalNav
frontend/Props.js
Jonekee/react-devtools
/** * Copyright (c) 2015-present, Facebook, Inc. * All rights reserved. * * This source code is licensed under the BSD-style license found in the * LICENSE file in the root directory of this source tree. An additional grant * of patent rights can be found in the PATENTS file in the same directory. * * @flow */ 'use strict'; var React = require('react'); var PropVal = require('./PropVal'); class Props extends React.Component { props: Object; shouldComponentUpdate(nextProps: Object): boolean { if (nextProps === this.props) { return false; } return true; } render(): ReactElement { var props = this.props.props; if (!props || typeof props !== 'object') { return <span/>; } var names = Object.keys(props).filter(name => { return name[0] !== '_' && name !== 'children'; }); var items = []; names.slice(0, 3).forEach(name => { items.push( <span key={name} style={styles.prop}> <span style={styles.propName}>{name}</span> = <PropVal val={props[name]}/> </span> ); }); if (names.length > 3) { items.push('…'); } return <span>{items}</span>; } } var styles = { prop: { paddingLeft: 5, }, propName: { color: 'rgb(165, 103, 42)', }, }; module.exports = Props;
webpack/scenes/Subscriptions/Details/SubscriptionDetailProductContent.js
mccun934/katello
import React from 'react'; import PropTypes from 'prop-types'; import { Col, ListView } from 'patternfly-react'; import { translate as __ } from 'foremanReact/common/I18n'; import SubscriptionDetailProduct from './SubscriptionDetailProduct'; const SubscriptionDetailProductContent = ({ productContent }) => { const listItems = productContent.results.map(product => ({ index: product.id, title: product.name, availableContent: ( product.available_content.map(c => ( { enabled: c.enabled, ...c.content, } )) ), })); if (listItems.length > 0) { return ( <ListView> {listItems.map(({ index, title, availableContent, }) => ( <ListView.Item key={index} heading={title} hideCloseIcon > <Col sm={12}> {availableContent.map(content => ( <SubscriptionDetailProduct key={content.id} content={content} /> ))} </Col> </ListView.Item> ))} </ListView> ); } return ( <div>{ __('No products are enabled.') }</div> ); }; SubscriptionDetailProductContent.propTypes = { productContent: PropTypes.shape({ results: PropTypes.array, }).isRequired, }; export default SubscriptionDetailProductContent;
ajax/libs/can.js/5.18.2/can.all.min.js
sufuf3/cdnjs
console.warn("This build is deprecated. Please update your URLs to the version of CanJS you intend to use, such as https://unpkg.com/can@4/dist/global/can.all.js"),function(e,t){"undefined"==typeof process&&(e.process={argv:[],cwd:function(){return""},browser:!0,env:{NODE_ENV:"development"},version:"",platform:e.navigator&&e.navigator.userAgent&&/Windows/.test(e.navigator.userAgent)?"win":""})}("object"==typeof self&&self.Object==Object?self:"object"==typeof process&&"[object process]"===Object.prototype.toString.call(process)?global:window),function(u,l,t){var f=l.define,d=function(e){var t,n=e.split("."),r=l;for(t=0;t<n.length&&r;t++)r=r[n[t]];return r},p=l.define&&l.define.modules||l._define&&l._define.modules||{},h=l.define=function(e,t,n){var r;"function"==typeof t&&(n=t,t=[]);var a,i,o=[];for(a=0;a<t.length;a++)o.push(u[t[a]]?d(u[t[a]]):p[t[a]]||d(t[a]));"require"===(i=t)[0]&&"exports"===i[1]&&"module"===i[2]||!t.length&&n.length?(r={exports:{}},o[0]=function(e){return u[e]?d(u[e]):p[e]},o[1]=r.exports,o[2]=r):o[0]||"exports"!==t[0]?o[0]||"module"!==t[0]||(o[0]={id:e}):(r={exports:{}},o[0]=r.exports,"module"===t[1]&&(o[1]=r)),l.define=f;var s=n?n.apply(null,o):void 0;l.define=h,s=r&&r.exports?r.exports:s,p[e]=s;var c=u[e];c&&!d(c)&&(function(e){if(!e||!e.__esModule)return!1;var t={__esModule:!0,default:!0};for(var n in e)if(!t[n])return!1;return!0}(s)&&(s=s.default),function(e,t){var n,r,a,i=e.split("."),o=l;for(n=0;n<i.length-1;n++)(a=o[r=i[n]])||(a=o[r]={}),o=a;o[r=i[i.length-1]]=t}(c,s))};l.define.orig=f,l.define.modules=p,l.define.amd=!0,h("@loader",[],function(){var e=function(){};return{get:function(){return{prepareGlobal:e,retrieveGlobal:e}},global:l,__exec:function(e){t(e.source,l)}}})}({jquery:"jQuery","can-namespace":"can",kefir:"Kefir","validate.js":"validate",react:"React"},"object"==typeof self&&self.Object==Object?self:"object"==typeof process&&"[object process]"===Object.prototype.toString.call(process)?global:window,function(__$source__,__$global__){eval("(function() { "+__$source__+" \n }).call(__$global__);")}),define("can-namespace",function(e,t,n){n.exports={}}),define("can-symbol",["require","exports","module","can-namespace"],function(u,e,t){!function(e,t,n,r){"use strict";var a,i=u("can-namespace");if("undefined"!=typeof Symbol&&"function"==typeof Symbol.for)a=Symbol;else{var o=0,s={},c={};(a=function(e){var t="@@symbol"+o+++e,n={};return Object.defineProperties(n,{toString:{value:function(){return t}}}),n}).for=function(e){var t=s[e];return t||(t=s[e]=a(e),c[t]=e),t},a.keyFor=function(e){return c[e]},["hasInstance","isConcatSpreadable","iterator","match","prototype","replace","search","species","split","toPrimitive","toStringTag","unscopables"].forEach(function(e){a[e]=a("Symbol."+e)})}["isMapLike","isListLike","isValueLike","isFunctionLike","getOwnKeys","getOwnKeyDescriptor","proto","getOwnEnumerableKeys","hasOwnKey","hasKey","size","getName","getIdentity","assignDeep","updateDeep","getValue","setValue","getKeyValue","setKeyValue","updateValues","addValue","removeValues","apply","new","onValue","offValue","onKeyValue","offKeyValue","getKeyDependencies","getValueDependencies","keyHasDependencies","valueHasDependencies","onKeys","onKeysAdded","onKeysRemoved","onPatches"].forEach(function(e){a.for("can."+e)}),r.exports=i.Symbol=a}(0,0,0,t)}),define("can-reflect/reflections/helpers",["require","exports","module","can-symbol"],function(e,t,n){"use strict";var a=e("can-symbol");n.exports={makeGetFirstSymbolValue:function(e){var n=e.map(function(e){return a.for(e)}),r=n.length;return function(e){for(var t=-1;++t<r;)if(void 0!==e[n[t]])return e[n[t]]}},hasLength:function(e){var t=typeof e;if("string"===t||Array.isArray(e))return!0;var n=e&&"boolean"!==t&&"number"!==t&&"length"in e&&e.length;return"function"!=typeof e&&(0===n||"number"==typeof n&&0<n&&n-1 in e)}}}),define("can-reflect/reflections/type/type",["require","exports","module","can-symbol","can-reflect/reflections/helpers"],function(e,t,n){"use strict";var o=e("can-symbol"),r=e("can-reflect/reflections/helpers"),s=Object.getOwnPropertyNames(function(){}.prototype),c=Object.getPrototypeOf(function(){}.prototype);var a=r.makeGetFirstSymbolValue(["can.new","can.apply"]);function i(e){var t=typeof e;return null==e||"function"!==t&&"object"!==t}var u=Object.prototype.hasOwnProperty,l=Function.prototype.toString,f=l.call(Object);function d(e){if(!e||"object"!=typeof e)return!1;var t=Object.getPrototypeOf(e);if(t===Object.prototype||null===t)return!0;var n=u.call(t,"constructor")&&t.constructor;return"function"==typeof n&&n instanceof n&&l.call(n)===f}var p,h=o.for("can.onValue"),v=o.for("can.onKeyValue"),g=o.for("can.onPatches");if("undefined"!=typeof Symbol&&"function"==typeof Symbol.for)p=function(e){return"symbol"==typeof e};else{var y="@@symbol";p=function(e){return"object"==typeof e&&!Array.isArray(e)&&e.toString().substr(0,y.length)===y}}n.exports={isConstructorLike:function(e){var t=e[o.for("can.new")];if(void 0!==t)return t;if("function"!=typeof e)return!1;var n=e.prototype;if(!n)return!1;if(c!==Object.getPrototypeOf(n))return!0;var r=Object.getOwnPropertyNames(n);if(r.length!==s.length)return!0;for(var a=0,i=r.length;a<i;a++)if(r[a]!==s[a])return!0;return!1},isFunctionLike:function(e){var t,n=!!e&&e[o.for("can.isFunctionLike")];return void 0!==n?n:void 0!==(t=a(e))?!!t:"function"==typeof e},isListLike:function(e){var t;if("string"==typeof e)return!0;if(i(e))return!1;if(void 0!==(t=e[o.for("can.isListLike")]))return t;var n=e[o.iterator];return void 0!==n?!!n:!!Array.isArray(e)||r.hasLength(e)},isMapLike:function(e){if(i(e))return!1;var t=e[o.for("can.isMapLike")];if(void 0!==t)return!!t;var n=e[o.for("can.getKeyValue")];return void 0===n||!!n},isObservableLike:function(e){return!i(e)&&Boolean(e[h]||e[v]||e[g])},isPrimitive:i,isBuiltIn:function(e){return!!(i(e)||Array.isArray(e)||d(e)||"[object Object]"!==Object.prototype.toString.call(e)&&-1!==Object.prototype.toString.call(e).indexOf("[object "))},isValueLike:function(e){var t;if(i(e))return!0;if(void 0!==(t=e[o.for("can.isValueLike")]))return t;var n=e[o.for("can.getValue")];return void 0!==n?!!n:void 0},isSymbolLike:p,isMoreListLikeThanMapLike:function(e){if(Array.isArray(e))return!0;if(e instanceof Array)return!0;if(null==e)return!1;var t=e[o.for("can.isMoreListLikeThanMapLike")];if(void 0!==t)return t;var n=this.isListLike(e),r=this.isMapLike(e);return!(!n||r)||!(!n&&r)&&void 0},isIteratorLike:function(e){return e&&"object"==typeof e&&"function"==typeof e.next&&0===e.next.length},isPromise:function(e){return e instanceof Promise||"[object Promise]"===Object.prototype.toString.call(e)},isPlainObject:d}}),define("can-reflect/reflections/call/call",["require","exports","module","can-symbol","can-reflect/reflections/type/type"],function(e,t,n){"use strict";var i=e("can-symbol"),o=e("can-reflect/reflections/type/type");n.exports={call:function(e,t){var n=[].slice.call(arguments,2),r=e[i.for("can.apply")];return r?r.call(e,t,n):e.apply(t,n)},apply:function(e,t,n){var r=e[i.for("can.apply")];return r?r.call(e,t,n):e.apply(t,n)},new:function(e){var t=[].slice.call(arguments,1),n=e[i.for("can.new")];if(n)return n.apply(e,t);var r=Object.create(e.prototype),a=e.apply(r,t);return o.isPrimitive(a)?r:a}}}),define("can-reflect/reflections/get-set/get-set",["require","exports","module","can-symbol","can-reflect/reflections/type/type"],function(e,t,n){"use strict";var s=e("can-symbol"),a=e("can-reflect/reflections/type/type"),i=s.for("can.setKeyValue"),r=s.for("can.getKeyValue"),o=s.for("can.getValue"),c=s.for("can.setValue"),u={setKeyValue:function(e,t,n){if(a.isSymbolLike(t))"symbol"==typeof t?e[t]=n:Object.defineProperty(e,t,{enumerable:!1,configurable:!0,value:n,writable:!0});else{var r=e[i];if(void 0!==r)return r.call(e,t,n);e[t]=n}},getKeyValue:function(e,t){var n=e[r];return n?n.call(e,t):e[t]},deleteKeyValue:function(e,t){var n=e[s.for("can.deleteKeyValue")];if(n)return n.call(e,t);delete e[t]},getValue:function(e){if(a.isPrimitive(e))return e;var t=e[o];return t?t.call(e):e},setValue:function(e,t){var n=e&&e[c];if(n)return n.call(e,t);throw new Error("can-reflect.setValue - Can not set value.")},splice:function(e,t,n,r){var a;if("number"!=typeof n){var i=e[s.for("can.updateValues")];if(i)return i.call(e,t,n,r);a=n.length}else a=n;arguments.length<=3&&(r=[]);var o=e[s.for("can.splice")];return o?o.call(e,t,a,r):[].splice.apply(e,[t,a].concat(r))},addValues:function(e,t,n){var r=e[s.for("can.addValues")];return r?r.call(e,t,n):Array.isArray(e)&&void 0===n?e.push.apply(e,t):u.splice(e,n,[],t)},removeValues:function(n,e,t){var r=n[s.for("can.removeValues")];return r?r.call(n,e,t):Array.isArray(n)&&void 0===t?void e.forEach(function(e){var t=n.indexOf(e);0<=t&&n.splice(t,1)}):u.splice(n,t,e,[])}};u.get=u.getKeyValue,u.set=u.setKeyValue,u.delete=u.deleteKeyValue,n.exports=u}),define("can-reflect/reflections/observe/observe",["require","exports","module","can-symbol"],function(e,t,n){"use strict";var s=e("can-symbol"),i=[].slice;function r(i,o){return function(e,t,n,r){var a=e[s.for(i)];return void 0!==a?a.call(e,t,n,r):this[o].apply(this,arguments)}}function a(r,a){return function(e){var t=e[s.for(r)];if(void 0===t)throw new Error(a);var n=i.call(arguments,1);return t.apply(e,n)}}n.exports={onKeyValue:r("can.onKeyValue","onEvent"),offKeyValue:r("can.offKeyValue","offEvent"),onKeys:a("can.onKeys","can-reflect: can not observe an onKeys event"),onKeysAdded:a("can.onKeysAdded","can-reflect: can not observe an onKeysAdded event"),onKeysRemoved:a("can.onKeysRemoved","can-reflect: can not unobserve an onKeysRemoved event"),getKeyDependencies:a("can.getKeyDependencies","can-reflect: can not determine dependencies"),getWhatIChange:a("can.getWhatIChange","can-reflect: can not determine dependencies"),getChangesDependencyRecord:function(e){var t=e[s.for("can.getChangesDependencyRecord")];if("function"==typeof t)return t()},keyHasDependencies:a("can.keyHasDependencies","can-reflect: can not determine if this has key dependencies"),onValue:a("can.onValue","can-reflect: can not observe value change"),offValue:a("can.offValue","can-reflect: can not unobserve value change"),getValueDependencies:a("can.getValueDependencies","can-reflect: can not determine dependencies"),valueHasDependencies:a("can.valueHasDependencies","can-reflect: can not determine if value has dependencies"),onPatches:a("can.onPatches","can-reflect: can not observe patches on object"),offPatches:a("can.offPatches","can-reflect: can not unobserve patches on object"),onInstancePatches:a("can.onInstancePatches","can-reflect: can not observe onInstancePatches on Type"),offInstancePatches:a("can.offInstancePatches","can-reflect: can not unobserve onInstancePatches on Type"),onInstanceBoundChange:a("can.onInstanceBoundChange","can-reflect: can not observe bound state change in instances."),offInstanceBoundChange:a("can.offInstanceBoundChange","can-reflect: can not unobserve bound state change"),isBound:a("can.isBound","can-reflect: cannot determine if object is bound"),onEvent:function(e,t,n,r){if(e){var a=e[s.for("can.onEvent")];if(void 0!==a)return a.call(e,t,n,r);e.addEventListener&&e.addEventListener(t,n,r)}},offEvent:function(e,t,n,r){if(e){var a=e[s.for("can.offEvent")];if(void 0!==a)return a.call(e,t,n,r);e.removeEventListener&&e.removeEventListener(t,n,r)}},setPriority:function(e,t){if(e){var n=e[s.for("can.setPriority")];if(void 0!==n)return n.call(e,t),!0}return!1},getPriority:function(e){if(e){var t=e[s.for("can.getPriority")];if(void 0!==t)return t.call(e)}}}}),define("can-reflect/reflections/shape/shape",["require","exports","module","can-symbol","can-reflect/reflections/get-set/get-set","can-reflect/reflections/type/type","can-reflect/reflections/helpers"],function(e,t,n){"use strict";var r,s=e("can-symbol"),f=e("can-reflect/reflections/get-set/get-set"),d=e("can-reflect/reflections/type/type"),a=e("can-reflect/reflections/helpers"),i=!0;try{Object.getPrototypeOf(1)}catch(e){i=!1}if("function"==typeof Map)r=Map;else{(r=function(){this.contents=[]}).prototype={_getIndex:function(e){for(var t;-1!==(t=this.contents.indexOf(e,t))&&t%2!=0;);return t},has:function(e){return-1!==this._getIndex(e)},get:function(e){var t=this._getIndex(e);if(-1!==t)return this.contents[t+1]},set:function(e,t){var n=this._getIndex(e);-1!==n?this.contents[n+1]=t:(this.contents.push(e),this.contents.push(t))},delete:function(e){var t=this._getIndex(e);-1!==t&&this.contents.splice(t,2)}}}var c,o,u,l=Object.prototype.hasOwnProperty,p=function(t){return function(){var e=[this];return e.push.apply(e,arguments),t.apply(null,e)}},h=s.for("can.getKeyValue"),v=p(f.getKeyValue),g=s.for("can.setKeyValue"),y=p(f.setKeyValue),m=s.for("can.size"),b=a.makeGetFirstSymbolValue(["can.updateDeep","can.assignDeep","can.setKeyValue"]),w=function(e){return d.isPlainObject(e)||Array.isArray(e)||!!b(e)};function _(e){return!!d.isPrimitive(e)||!b(e)&&(d.isBuiltIn(e)&&!d.isPlainObject(e)&&!Array.isArray(e))}try{Object.keys(1),o=Object.keys}catch(e){o=function(e){return d.isPrimitive(e)?[]:Object.keys(e)}}function x(c,u){var n=null;function l(e){var t;this.first=!n,this.first&&(n={unwrap:new(t=e||r),serialize:new t,isSerializing:{unwrap:new t,serialize:new t},circularReferenceIsSerializing:{unwrap:new t,serialize:new t}}),this.map=n,this.result=null}return l.prototype.end=function(){return this.first&&(n=null),this.result},function(e,t){if(_(e))return e;var n=new l(t);if(d.isValueLike(e))n.result=this[c](f.getValue(e));else{var r=d.isIteratorLike(e)||d.isMoreListLikeThanMapLike(e);if(n.result=r?[]:{},n.map[c].has(e))return n.map.isSerializing[c].has(e)&&n.map.circularReferenceIsSerializing[c].set(e,!0),n.map[c].get(e);n.map[c].set(e,n.result);for(var a=0,i=u.length;a<i;a++){var o=e[u[a]];if(o){n.map.isSerializing[c].set(e,!0);var s=n.result;if(n.result=o.call(e,s),n.map.isSerializing[c].delete(e),n.result!==s){if(n.map.circularReferenceIsSerializing[c].has(e))throw n.end(),new Error("Cannot serialize cirular reference!");n.map[c].set(e,n.result)}return n.end()}}"function"==typeof obj?(n.map[c].set(e,e),n.result=e):r?this.eachIndex(e,function(e,t){n.result[t]=this[c](e)},this):this.eachKey(e,function(e,t){n.result[t]=this[c](e)},this)}return n.end()}}u="undefined"!=typeof Map?function(e){var t=new Map;return c.eachIndex(e,function(e){t.set(e,!0)}),t}:function(e){var n={};return e.forEach(function(e){n[e]=!0}),{get:function(e){return n[e]},set:function(e,t){n[e]=t},keys:function(){return e}}};var E=function(e){var t=e[s.for("can.hasOwnKey")];if(t)return t.bind(e);var n=u(c.getOwnEnumerableKeys(e));return function(e){return n.get(e)}};function k(e,t){var n=e[e.length-1];if(n&&n.deleteCount===n.insert.length&&t.index-n.index===n.deleteCount)return n.insert.push.apply(n.insert,t.insert),void(n.deleteCount+=t.deleteCount);e.push(t)}function O(r,e,a){var i=this.toArray(e),o=[],s=-1;this.eachIndex(r,function(e,t){if((s=t)>=i.length)return a||k(o,{index:t,deleteCount:r.length-t+1,insert:[]}),!1;var n=i[t];d.isPrimitive(e)||d.isPrimitive(n)||!1===w(e)?k(o,{index:t,deleteCount:1,insert:[n]}):!0===a?this.assignDeep(e,n):this.updateDeep(e,n)},this),i.length>s&&k(o,{index:s+1,deleteCount:0,insert:i.slice(s+1)});for(var t=0,n=o.length;t<n;t++){var c=o[t];f.splice(r,c.index,c.deleteCount,c.insert)}return r}(c={each:function(e,t,n){return d.isIteratorLike(e)||d.isMoreListLikeThanMapLike(e)?c.eachIndex(e,t,n):c.eachKey(e,t,n)},eachIndex:function(e,t,n){if(Array.isArray(e))return c.eachListLike(e,t,n);var r,a=e[s.iterator];if(d.isIteratorLike(e)?r=e:a&&(r=a.call(e)),r)for(var i,o=0;!(i=r.next()).done&&!1!==t.call(n||e,i.value,o++,e););else c.eachListLike(e,t,n);return e},eachListLike:function(e,t,n){var r=-1,a=e.length;if(void 0===a){var i=e[m];if(!i)throw new Error("can-reflect: unable to iterate.");a=i.call(e)}for(;++r<a;){var o=e[r];if(!1===t.call(n||o,o,r,e))break}return e},toArray:function(e){var t=[];return c.each(e,function(e){t.push(e)}),t},eachKey:function(n,r,a){if(n){var e=c.getOwnEnumerableKeys(n),i=n[h]||v;return c.eachIndex(e,function(e){var t=i.call(n,e);return r.call(a||n,t,e,n)})}return n},hasOwnKey:function(e,t){var n=e[s.for("can.hasOwnKey")];if(n)return n.call(e,t);var r=e[s.for("can.getOwnKeys")];if(r){var a=!1;return c.eachIndex(r.call(e),function(e){if(e===t)return!(a=!0)}),a}return l.call(e,t)},getOwnEnumerableKeys:function(t){var e=t[s.for("can.getOwnEnumerableKeys")];if(e)return e.call(t);if(t[s.for("can.getOwnKeys")]&&t[s.for("can.getOwnKeyDescriptor")]){var n=[];return c.eachIndex(c.getOwnKeys(t),function(e){c.getOwnKeyDescriptor(t,e).enumerable&&n.push(e)},this),n}return o(t)},getOwnKeys:function(e){var t=e[s.for("can.getOwnKeys")];return t?t.call(e):Object.getOwnPropertyNames(e)},getOwnKeyDescriptor:function(e,t){var n=e[s.for("can.getOwnKeyDescriptor")];return n?n.call(e,t):Object.getOwnPropertyDescriptor(e,t)},unwrap:x("unwrap",[s.for("can.unwrap")]),serialize:x("serialize",[s.for("can.serialize"),s.for("can.unwrap")]),assignMap:function(n,e){var r=E(n),a=n[h]||v,i=n[g]||y;return c.eachKey(e,function(e,t){r(t)&&a.call(n,t)===e||i.call(n,t,e)}),n},assignList:function(e,t){var n=c.toArray(t);return f.splice(e,0,n,n),e},assign:function(e,t){return d.isIteratorLike(t)||d.isMoreListLikeThanMapLike(t)?c.assignList(e,t):c.assignMap(e,t),e},assignDeepMap:function(r,e){var a=E(r),i=r[h]||v,o=r[g]||y;return c.eachKey(e,function(e,t){if(a(t)){var n=i.call(r,t);e===n||(d.isPrimitive(n)||d.isPrimitive(e)||!1===w(n)?o.call(r,t,e):c.assignDeep(n,e))}else f.setKeyValue(r,t,e)},this),r},assignDeepList:function(e,t){return O.call(this,e,t,!0)},assignDeep:function(e,t){var n=e[s.for("can.assignDeep")];return n?n.call(e,t):d.isMoreListLikeThanMapLike(t)?c.assignDeepList(e,t):c.assignDeepMap(e,t),e},updateMap:function(r,a){var i=u(c.getOwnEnumerableKeys(a)),o=a[h]||v,s=r[g]||y;return c.eachKey(r,function(e,t){if(i.get(t)){i.set(t,!1);var n=o.call(a,t);n!==e&&s.call(r,t,n)}else f.deleteKeyValue(r,t)},this),c.eachIndex(i.keys(),function(e){i.get(e)&&s.call(r,e,o.call(a,e))}),r},updateList:function(e,t){var n=c.toArray(t);return f.splice(e,0,e,n),e},update:function(e,t){return d.isIteratorLike(t)||d.isMoreListLikeThanMapLike(t)?c.updateList(e,t):c.updateMap(e,t),e},updateDeepMap:function(r,a){var i=u(c.getOwnEnumerableKeys(a)),o=a[h]||v,s=r[g]||y;return c.eachKey(r,function(e,t){if(i.get(t)){i.set(t,!1);var n=o.call(a,t);d.isPrimitive(e)||d.isPrimitive(n)||!1===w(e)?s.call(r,t,n):c.updateDeep(e,n)}else f.deleteKeyValue(r,t)},this),c.eachIndex(i.keys(),function(e){i.get(e)&&s.call(r,e,o.call(a,e))}),r},updateDeepList:function(e,t){return O.call(this,e,t)},updateDeep:function(e,t){var n=e[s.for("can.updateDeep")];return n?n.call(e,t):d.isMoreListLikeThanMapLike(t)?c.updateDeepList(e,t):c.updateDeepMap(e,t),e},hasKey:function(e,t){if(null==e)return!1;var n;if(d.isPrimitive(e))return!!l.call(e,t)||(void 0!==(n=i?Object.getPrototypeOf(e):e.__proto__)?t in n:void 0!==e[t]);var r=e[s.for("can.hasKey")];return r?r.call(e,t):c.hasOwnKey(e,t)||t in e},getAllEnumerableKeys:function(){},getAllKeys:function(){},assignSymbols:function(r,e){return c.eachKey(e,function(e,t){var n=d.isSymbolLike(s[t])?s[t]:s.for(t);f.setKeyValue(r,n,e)}),r},isSerialized:_,size:function(e){if(null==e)return 0;var t=e[m],n=0;return t?t.call(e):a.hasLength(e)?e.length:d.isListLike(e)?(c.eachIndex(e,function(){n++}),n):e?c.getOwnEnumerableKeys(e).length:void 0},defineInstanceKey:function(e,t,n){var r=e[s.for("can.defineInstanceKey")];if(r)return r.call(e,t,n);var a=e.prototype;(r=a[s.for("can.defineInstanceKey")])?r.call(a,t,n):Object.defineProperty(a,t,c.assign({configurable:!0,enumerable:!d.isSymbolLike(t),writable:!0},n))}}).isSerializable=c.isSerialized,c.keys=c.getOwnEnumerableKeys,n.exports=c}),define("can-reflect/reflections/shape/schema/schema",["require","exports","module","can-symbol","can-reflect/reflections/type/type","can-reflect/reflections/get-set/get-set","can-reflect/reflections/shape/shape"],function(e,t,n){"use strict";var r=e("can-symbol"),s=e("can-reflect/reflections/type/type"),a=e("can-reflect/reflections/get-set/get-set"),i=e("can-reflect/reflections/shape/shape"),o=r.for("can.getSchema"),c=r.for("can.isMember"),u=r.for("can.new");function l(e,t){return e.localeCompare(t)}var f={getSchema:function(e){if(void 0!==e){var t=e[o];return void 0===t&&(t=(e=e.constructor)&&e[o]),void 0!==t?t.call(e):void 0}},getIdentity:function(t,e){if(void 0===(e=e||f.getSchema(t)))throw new Error("can-reflect.getIdentity - Unable to find a schema for the given value.");var n=e.identity;if(n&&0!==n.length){if(1===n.length)return a.getKeyValue(t,n[0]);var r={};return n.forEach(function(e){r[e]=a.getKeyValue(t,e)}),JSON.stringify(f.cloneKeySort(r))}throw new Error("can-reflect.getIdentity - Provided schema lacks an identity property.")},cloneKeySort:function(e){return function t(n){return s.isPrimitive(n)?n:s.isListLike(n)?(r=[],i.eachKey(n,function(e){r.push(t(e))}),r):s.isMapLike(n)?(r={},i.getOwnKeys(n).sort(l).forEach(function(e){r[e]=t(a.getKeyValue(n,e))}),r):n;var r}(e)},convert:function(e,t){if((n=t)===Number||n===String||n===Boolean)return t(e);var n,r=t[c],a=!1,i=typeof t,o=t[u];if(void 0!==r?a=r.call(t,e):"function"===i&&s.isConstructorLike(t)&&(a=e instanceof t),a)return e;if(void 0!==o)return o.call(t,e);if("function"===i)return s.isConstructorLike(t)?new t(e):t(e);throw new Error("can-reflect: Can not convert values into type. Type must provide `can.new` symbol.")}};n.exports=f}),define("can-reflect/reflections/get-name/get-name",["require","exports","module","can-symbol","can-reflect/reflections/type/type"],function(e,t,n){"use strict";var r=e("can-symbol"),i=e("can-reflect/reflections/type/type"),o=r.for("can.getName");var s=0;n.exports={setName:function(e,t){if("function"!=typeof t){var n=t;t=function(){return n}}Object.defineProperty(e,o,{value:t})},getName:function e(t){var n=typeof t;if(null===t||"object"!==n&&"function"!==n)return""+t;var r=t[o];if(r)return r.call(t);if("function"===n)return"name"in t||(t.name="functionIE"+s++),t.name;if(t.constructor&&t!==t.constructor){var a=e(t.constructor);if(a){if(i.isValueLike(t))return a+"<>";if(i.isMoreListLikeThanMapLike(t))return a+"[]";if(i.isMapLike(t))return a+"{}"}}}}}),define("can-reflect/types/map",["require","exports","module","can-reflect/reflections/shape/shape","can-symbol"],function(e,t,n){"use strict";var r=e("can-reflect/reflections/shape/shape"),a=e("can-symbol");"undefined"!=typeof Map&&(r.assignSymbols(Map.prototype,{"can.getOwnEnumerableKeys":Map.prototype.keys,"can.setKeyValue":Map.prototype.set,"can.getKeyValue":Map.prototype.get,"can.deleteKeyValue":Map.prototype.delete,"can.hasOwnKey":Map.prototype.has}),"function"!=typeof Map.prototype.keys&&(Map.prototype.keys=Map.prototype[a.for("can.getOwnEnumerableKeys")]=function(){var n=[],e=0;return this.forEach(function(e,t){n.push(t)}),{next:function(){return{value:n[e],done:e++===n.length}}}})),"undefined"!=typeof WeakMap&&r.assignSymbols(WeakMap.prototype,{"can.getOwnEnumerableKeys":function(){throw new Error("can-reflect: WeakMaps do not have enumerable keys.")},"can.setKeyValue":WeakMap.prototype.set,"can.getKeyValue":WeakMap.prototype.get,"can.deleteKeyValue":WeakMap.prototype.delete,"can.hasOwnKey":WeakMap.prototype.has})}),define("can-reflect/types/set",["require","exports","module","can-reflect/reflections/shape/shape","can-symbol"],function(e,t,n){"use strict";var r=e("can-reflect/reflections/shape/shape"),a=e("can-symbol");"undefined"!=typeof Set&&(r.assignSymbols(Set.prototype,{"can.isMoreListLikeThanMapLike":!0,"can.updateValues":function(e,t,n){t!==n&&r.each(t,function(e){this.delete(e)},this),r.each(n,function(e){this.add(e)},this)},"can.size":function(){return this.size}}),"function"!=typeof Set.prototype[a.iterator]&&(Set.prototype[a.iterator]=function(){var t=[],e=0;return this.forEach(function(e){t.push(e)}),{next:function(){return{value:t[e],done:e++===t.length}}}})),"undefined"!=typeof WeakSet&&r.assignSymbols(WeakSet.prototype,{"can.isListLike":!0,"can.isMoreListLikeThanMapLike":!0,"can.updateValues":function(e,t,n){t!==n&&r.each(t,function(e){this.delete(e)},this),r.each(n,function(e){this.add(e)},this)},"can.size":function(){throw new Error("can-reflect: WeakSets do not have enumerable keys.")}})}),define("can-reflect",["require","exports","module","can-reflect/reflections/call/call","can-reflect/reflections/get-set/get-set","can-reflect/reflections/observe/observe","can-reflect/reflections/shape/shape","can-reflect/reflections/shape/schema/schema","can-reflect/reflections/type/type","can-reflect/reflections/get-name/get-name","can-namespace","can-reflect/types/map","can-reflect/types/set"],function(e,t,n){"use strict";var r=e("can-reflect/reflections/call/call"),a=e("can-reflect/reflections/get-set/get-set"),i=e("can-reflect/reflections/observe/observe"),o=e("can-reflect/reflections/shape/shape"),s=e("can-reflect/reflections/shape/schema/schema"),c=e("can-reflect/reflections/type/type"),u=e("can-reflect/reflections/get-name/get-name"),l=e("can-namespace"),f={};[r,a,i,o,c,u,s].forEach(function(e){for(var t in e)if(f[t]=e[t],"production"!==process.env.NODE_ENV&&"function"==typeof e[t]){var n=Object.getOwnPropertyDescriptor(e[t],"name");(!n||n.writable&&n.configurable)&&Object.defineProperty(e[t],"name",{value:"canReflect."+t})}}),e("can-reflect/types/map"),e("can-reflect/types/set"),n.exports=l.Reflect=f}),define("can-globals/can-globals-proto",["require","exports","module","can-reflect"],function(s,e,t){!function(e,t,n,r){"use strict";var a=s("can-reflect");function i(e){var t=this.eventHandlers[e];if(t)for(var n=t.slice(),r=this.getKeyValue(e),a=0;a<n.length;a++)n[a](r)}function o(){this.eventHandlers={},this.properties={}}o.prototype.define=function(e,t,n){return void 0===n&&(n=!0),this.properties[e]||(this.properties[e]={default:t,value:t,enableCache:n}),this},o.prototype.getKeyValue=function(e){var t=this.properties[e];if(t)return"function"==typeof t.value?t.cachedValue?t.cachedValue:t.enableCache?(t.cachedValue=t.value(),t.cachedValue):t.value():t.value},o.prototype.makeExport=function(t){return function(e){return 0===arguments.length?this.getKeyValue(t):null!=e?("function"==typeof e?this.setKeyValue(t,function(){return e}):this.setKeyValue(t,e),e):void this.deleteKeyValue(t)}.bind(this)},o.prototype.offKeyValue=function(e,t){if(this.properties[e]){var n=this.eventHandlers[e];if(n){var r=n.indexOf(t);n.splice(r,1)}}return this},o.prototype.onKeyValue=function(e,t){return this.properties[e]&&(this.eventHandlers[e]||(this.eventHandlers[e]=[]),this.eventHandlers[e].push(t)),this},o.prototype.deleteKeyValue=function(e){var t=this.properties[e];return void 0!==t&&(t.value=t.default,t.cachedValue=void 0,i.call(this,e)),this},o.prototype.setKeyValue=function(e,t){if(!this.properties[e])return this.define(e,t);var n=this.properties[e];return n.value=t,n.cachedValue=void 0,i.call(this,e),this},o.prototype.reset=function(){for(var e in this.properties)this.properties.hasOwnProperty(e)&&(this.properties[e].value=this.properties[e].default,this.properties[e].cachedValue=void 0,i.call(this,e));return this},a.assignSymbols(o.prototype,{"can.getKeyValue":o.prototype.getKeyValue,"can.setKeyValue":o.prototype.setKeyValue,"can.deleteKeyValue":o.prototype.deleteKeyValue,"can.onKeyValue":o.prototype.onKeyValue,"can.offKeyValue":o.prototype.offKeyValue}),r.exports=o}(0,0,0,t)}),define("can-globals/can-globals-instance",["require","exports","module","can-namespace","can-globals/can-globals-proto"],function(e,t,n){!function(e,t,n,r){"use strict";var a=t("can-namespace"),i=new(t("can-globals/can-globals-proto"));if(a.globals)throw new Error("You can't have two versions of can-globals, check your dependencies");r.exports=a.globals=i}(0,e,0,n)}),define("can-globals/global/global",["require","exports","module","can-globals/can-globals-instance"],function(i,e,t){!function(e,t,n,r){"use strict";var a=i("can-globals/can-globals-instance");a.define("global",function(){return"undefined"!=typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope?self:"object"==typeof process&&"[object process]"==={}.toString.call(process)?e:window}),r.exports=a.makeExport("global")}(function(){return this}(),0,0,t)}),define("can-globals/document/document",["require","exports","module","can-globals/global/global","can-globals/can-globals-instance"],function(e,t,n){!function(e,t,n,r){"use strict";t("can-globals/global/global");var a=t("can-globals/can-globals-instance");a.define("document",function(){return a.getKeyValue("global").document}),r.exports=a.makeExport("document")}(0,e,0,n)}),define("can-globals/location/location",["require","exports","module","can-globals/global/global","can-globals/can-globals-instance"],function(e,t,n){!function(e,t,n,r){"use strict";t("can-globals/global/global");var a=t("can-globals/can-globals-instance");a.define("location",function(){return a.getKeyValue("global").location}),r.exports=a.makeExport("location")}(0,e,0,n)}),define("can-globals/mutation-observer/mutation-observer",["require","exports","module","can-globals/global/global","can-globals/can-globals-instance"],function(e,t,n){!function(e,t,n,r){"use strict";t("can-globals/global/global");var a=t("can-globals/can-globals-instance");a.define("MutationObserver",function(){var e=a.getKeyValue("global");return e.MutationObserver||e.WebKitMutationObserver||e.MozMutationObserver}),r.exports=a.makeExport("MutationObserver")}(0,e,0,n)}),define("can-globals/is-node/is-node",["require","exports","module","can-globals/can-globals-instance"],function(i,e,t){!function(e,t,n,r){"use strict";var a=i("can-globals/can-globals-instance");a.define("isNode",function(){return"object"==typeof process&&"[object process]"==={}.toString.call(process)}),r.exports=a.makeExport("isNode")}(0,0,0,t)}),define("can-globals/is-browser-window/is-browser-window",["require","exports","module","can-globals/can-globals-instance","can-globals/is-node/is-node"],function(e,t,n){!function(e,t,n,r){"use strict";var a=t("can-globals/can-globals-instance");t("can-globals/is-node/is-node"),a.define("isBrowserWindow",function(){var e=a.getKeyValue("isNode");return"undefined"!=typeof window&&"undefined"!=typeof document&&!1===e}),r.exports=a.makeExport("isBrowserWindow")}(0,e,0,n)}),define("can-globals/custom-elements/custom-elements",["require","exports","module","can-globals/global/global","can-globals/can-globals-instance"],function(e,t,n){!function(e,t,n,r){"use strict";t("can-globals/global/global");var a=t("can-globals/can-globals-instance");a.define("customElements",function(){return a.getKeyValue("global").customElements}),r.exports=a.makeExport("customElements")}(0,e,0,n)}),define("can-globals",["require","exports","module","can-globals/can-globals-instance","can-globals/global/global","can-globals/document/document","can-globals/location/location","can-globals/mutation-observer/mutation-observer","can-globals/is-browser-window/is-browser-window","can-globals/is-node/is-node","can-globals/custom-elements/custom-elements"],function(e,t,n){!function(e,t,n,r){"use strict";var a=t("can-globals/can-globals-instance");t("can-globals/global/global"),t("can-globals/document/document"),t("can-globals/location/location"),t("can-globals/mutation-observer/mutation-observer"),t("can-globals/is-browser-window/is-browser-window"),t("can-globals/is-node/is-node"),t("can-globals/custom-elements/custom-elements"),r.exports=a}(0,e,0,n)}),define("can-debug/src/proxy-namespace",function(e,t,i){!function(e,t,n,r){"use strict";var a=!1;i.exports=function(e){return new Proxy(e,{get:function(e,t){return a||(console.warn("Warning: use of 'can' global should be for debugging purposes only."),a=!0),e[t]}})}}()}),define("can-debug/src/temporarily-bind",["require","exports","module","can-symbol","can-reflect"],function(e,t,n){"use strict";var r=e("can-symbol"),l=e("can-reflect"),f=r.for("can.onValue"),d=r.for("can.offValue"),p=r.for("can.onKeyValue"),h=r.for("can.offKeyValue"),v=function(){};function g(e){return"function"==typeof e}n.exports=function(u){return function(e,t){var n,r,a,i,o,s,c;return 2===arguments.length?(o=t,s=u,g((i=e)[p])&&l.onKeyValue(i,o,v),c=s(i,o),g(i[h])&&l.offKeyValue(i,o,v),c):(r=u,g((n=e)[f])&&l.onValue(n,v),a=r(n),g(n[d])&&l.offValue(n,v),a)}}}),define("can-assign",["require","exports","module","can-namespace"],function(e,t,n){var r=e("can-namespace");n.exports=r.assign=function(e,t){for(var n in t){var r=Object.getOwnPropertyDescriptor(e,n);r&&!1===r.writable||(e[n]=t[n])}return e}}),define("can-debug/src/graph/graph",["require","exports","module","can-assign"],function(e,t,n){"use strict";var o=e("can-assign");function i(){this.nodes=[],this.arrows=new Map,this.arrowsMeta=new Map}function r(e,t,n,r){var a=e.arrowsMeta.get(t);if(a){var i=a.get(n);i||(i={}),a.set(n,o(i,r))}else(a=new Map).set(n,r),e.arrowsMeta.set(t,a)}i.prototype.addNode=function(e){this.nodes.push(e),this.arrows.set(e,new Set)},i.prototype.addArrow=function(e,t,n){this.arrows.get(e).add(t),n&&r(this,e,t,n)},i.prototype.hasArrow=function(e,t){return this.getNeighbors(e).has(t)},i.prototype.getArrowMeta=function(e,t){return this.arrowsMeta.get(e)&&this.arrowsMeta.get(e).get(t)},i.prototype.setArrowMeta=function(e,t,n){r(this,e,t,n)},i.prototype.getNeighbors=function(e){return this.arrows.get(e)},i.prototype.findNode=function(e){var t,n,r=null;for(t=0;t<this.nodes.length;t++)if(e(n=this.nodes[t])){r=n;break}return r},i.prototype.bfs=function(e){var t=this.nodes[0],n=[t],r=new Map;for(r.set(t,!0);n.length;)e(t=n.shift()),this.arrows.get(t).forEach(function(e){r.has(e)||(n.push(e),r.set(e,!0))})},i.prototype.dfs=function(e){for(var t=this.nodes[0],n=[t],r=new Map;n.length;)e(t=n.pop()),r.has(t)||(r.set(t,!0),this.arrows.get(t).forEach(function(e){n.push(e)}))},i.prototype.reverse=function(){var r=this,a=new i;return r.nodes.forEach(a.addNode.bind(a)),r.nodes.forEach(function(n){r.getNeighbors(n).forEach(function(e){var t=r.getArrowMeta(n,e);a.addArrow(e,n,t)})}),a},n.exports=i}),define("can-debug/src/get-graph/make-node",["require","exports","module","can-reflect"],function(e,t,n){"use strict";var a=e("can-reflect");n.exports=function(e,t){var n=2===arguments.length,r={obj:e,name:a.getName(e),value:n?a.getKeyValue(e,t):a.getValue(e)};return n&&(r.key=t),r}}),define("can-reflect-dependencies/src/add-mutated-by",["require","exports","module","can-reflect"],function(e,t,n){"use strict";var c=e("can-reflect"),u=function(){return{keyDependencies:new Map,valueDependencies:new Set}};n.exports=function(s){return function(e,t,n){var r=3===arguments.length;if(2===arguments.length&&(n=t,t=void 0),!n.keyDependencies&&!n.valueDependencies){var a=new Set;a.add(n),n={valueDependencies:a}}var i=s.get(e);i||(i={mutateDependenciesForKey:new Map,mutateDependenciesForValue:u()},s.set(e,i)),r&&!i.mutateDependenciesForKey.get(t)&&i.mutateDependenciesForKey.set(t,u());var o=r?i.mutateDependenciesForKey.get(t):i.mutateDependenciesForValue;n.valueDependencies&&c.addValues(o.valueDependencies,n.valueDependencies),n.keyDependencies&&c.each(n.keyDependencies,function(e,t){var n=o.keyDependencies.get(t);n||(n=new Set,o.keyDependencies.set(t,n)),c.addValues(n,e)})}}}),define("can-reflect-dependencies/src/delete-mutated-by",["require","exports","module","can-reflect"],function(e,t,n){"use strict";var c=e("can-reflect");n.exports=function(s){return function(e,t,n){var r=3===arguments.length,a=s.get(e);if(2===arguments.length&&(n=t,t=void 0),!n.keyDependencies&&!n.valueDependencies){var i=new Set;i.add(n),n={valueDependencies:i}}var o=r?a.mutateDependenciesForKey.get(t):a.mutateDependenciesForValue;n.valueDependencies&&c.removeValues(o.valueDependencies,n.valueDependencies),n.keyDependencies&&c.each(n.keyDependencies,function(e,t){var n=o.keyDependencies.get(t);n&&(c.removeValues(n,e),n.size||o.keyDependencies.delete(t))})}}}),define("can-reflect-dependencies/src/is-function",function(e,t,n){"use strict";n.exports=function(e){return"function"==typeof e}}),define("can-reflect-dependencies/src/get-dependency-data-of",["require","exports","module","can-symbol","can-reflect","can-reflect-dependencies/src/is-function","can-assign"],function(e,t,n){"use strict";var r=e("can-symbol"),l=e("can-reflect"),f=e("can-reflect-dependencies/src/is-function"),d=e("can-assign"),a=r.for("can.getWhatIChange"),p=r.for("can.getKeyDependencies"),h=r.for("can.getValueDependencies"),o=function(e,t){if(f(e[a]))return 2===arguments.length?l.getWhatIChange(e,t):l.getWhatIChange(e)},v=function(e){return null==e||!Object.keys(e).length||e.keyDependencies&&!e.keyDependencies.size&&e.valueDependencies&&!e.valueDependencies.size},s=function(e,t,n){var r,a,i,o,s=3===arguments.length,c=s?(r=t,a=n,(o=e.get(r))&&o.mutateDependenciesForKey.has(a)&&(i=o.mutateDependenciesForKey.get(a)),i):function(e,t){var n,r=e.get(t);if(r){var a=r.mutateDependenciesForValue;a.keyDependencies.size&&((n=n||{}).keyDependencies=a.keyDependencies),a.valueDependencies.size&&((n=n||{}).valueDependencies=a.valueDependencies)}return n}(e,t),u=s?function(e,t){if(f(e[p]))return l.getKeyDependencies(e,t)}(t,n):function(e){if(f(e[h]))return l.getValueDependencies(e)}(t);if(!v(c)||!v(u))return d(d({},c?{mutate:c}:null),u?{derive:u}:null)};n.exports=function(i){return function(e,t){var n=2===arguments.length,r=n?s(i,e,t):s(i,e),a=n?o(e,t):o(e);if(r||a)return d(d({},a?{whatIChange:a}:null),r?{whatChangesMe:r}:null)}}}),define("can-reflect-dependencies",["require","exports","module","can-reflect-dependencies/src/add-mutated-by","can-reflect-dependencies/src/delete-mutated-by","can-reflect-dependencies/src/get-dependency-data-of"],function(e,t,n){"use strict";var r=e("can-reflect-dependencies/src/add-mutated-by"),a=e("can-reflect-dependencies/src/delete-mutated-by"),i=e("can-reflect-dependencies/src/get-dependency-data-of"),o=new WeakMap;n.exports={addMutatedBy:r(o),deleteMutatedBy:a(o),getDependencyDataOf:i(o)}}),define("can-debug/src/get-graph/get-graph",["require","exports","module","can-debug/src/graph/graph","can-debug/src/get-graph/make-node","can-reflect","can-reflect-dependencies"],function(e,t,n){"use strict";var a=e("can-debug/src/graph/graph"),p=e("can-debug/src/get-graph/make-node"),h=e("can-reflect"),v=e("can-reflect-dependencies");n.exports=function(e,t){var c=0,u=new a,n=2===arguments.length,l=function(e,t,n,r){switch(e){case"whatIChange":u.addArrow(t,n,r);break;case"whatChangesMe":u.addArrow(n,t,r);break;default:throw new Error("Unknown direction value: ",r.direction)}},f=function(e,n,r){h.eachKey(e.keyDependencies||{},function(e,t){h.each(e,function(e){r(t,n,e)})})},d=function(e,t,n){h.eachIndex(e.valueDependencies||[],function(e){n(e,t)})},r=function n(t,e,r){var a,i=3===arguments.length,o=u.findNode(function(e){return i?e.obj===t&&e.key===r:e.obj===t});if(o)return e.parent&&l(e.direction,e.parent,o,{kind:e.kind,direction:e.direction}),u;c+=1,(o=i?p(t,r):p(t)).order=c,u.addNode(o),e.parent&&l(e.direction,e.parent,o,{kind:e.kind,direction:e.direction});var s=i?v.getDependencyDataOf(t,r):v.getDependencyDataOf(t);return s&&s.whatIChange&&(a={direction:"whatIChange",parent:o},h.eachKey(s.whatIChange,function(e,t){a.kind=t,f(e,a,n),d(e,a,n)})),s&&s.whatChangesMe&&(a={direction:"whatChangesMe",parent:o},h.eachKey(s.whatChangesMe,function(e,t){a.kind=t,f(e,a,n),d(e,a,n)})),u};return n?r(e,{},t):r(e,{})}}),define("can-debug/src/format-graph/format-graph",["require","exports","module","can-reflect","can-assign"],function(e,t,n){"use strict";var r=e("can-reflect"),u=e("can-assign");n.exports=function(o){var s=new Map;o.nodes.forEach(function(e,t){s.set(e,t+1)});var e=o.nodes.map(function(e){return{shape:"box",id:s.get(e),label:r.getName(e.obj)+(e.key?"."+e.key:"")}}),t=new Map,c=[];return o.nodes.forEach(function(e){var i=function(r){if(!t.has(r)){t.set(r,!0);var e=o.arrows.get(r),a=s.get(r);e.forEach(function(e){var t=s.get(e),n=o.arrowsMeta.get(r).get(e);c.push(u({from:a,to:t},{derive:{arrows:"to"},mutate:{arrows:"to",dashes:!0}}[n.kind])),i(e)})}};i(e)}),{nodes:e,edges:c}}}),define("can-debug/src/log-data/log-data",["require","exports","module","can-reflect"],function(e,t,n){"use strict";var i=e("can-reflect");n.exports=function e(t){var n,r=t.node,a=[r.name,"key"in r?"."+r.key:""];console.group(a.join("")),console.log("value ","string"==typeof(n=r.value)?JSON.stringify(n):n),console.log("object ",r.obj),t.derive.length&&(console.group("DERIVED FROM"),i.eachIndex(t.derive,e),console.groupEnd()),t.mutations.length&&(console.group("MUTATED BY"),i.eachIndex(t.mutations,e),console.groupEnd()),t.twoWay.length&&(console.group("TWO WAY"),i.eachIndex(t.twoWay,e),console.groupEnd()),console.groupEnd()}}),define("can-debug/src/label-cycles/label-cycles",["require","exports","module","can-debug/src/graph/graph"],function(e,t,n){"use strict";var o=e("can-debug/src/graph/graph");n.exports=function(r){var a=new Map,i=new o;r.nodes.forEach(function(e){i.addNode(e)});return function t(n){a.set(n,!0),r.getNeighbors(n).forEach(function(e){a.has(e)?r.hasArrow(n,e)&&i.addArrow(e,n,{kind:"twoWay"}):(i.addArrow(n,e,r.getArrowMeta(n,e)),t(e))})}(r.nodes[0]),i}}),define("can-debug/src/get-data/get-data",["require","exports","module","can-debug/src/label-cycles/label-cycles"],function(e,t,n){"use strict";var a=e("can-debug/src/label-cycles/label-cycles");n.exports=function(e,t){var n,i=new Map,o=a("whatChangesMe"===t?e.reverse():e),r=function n(r){var a={node:r,derive:[],mutations:[],twoWay:[]};return i.set(r,!0),o.getNeighbors(r).forEach(function(e){var t=o.getArrowMeta(r,e);if(!i.has(e))switch(t.kind){case"twoWay":a.twoWay.push(n(e));break;case"derive":a.derive.push(n(e));break;case"mutate":a.mutations.push(n(e));break;default:throw new Error("Unknow meta.kind value: ",t.kind)}}),a}(o.nodes[0]);return(n=r).derive.length||n.mutations.length||n.twoWay.length?r:null}}),define("can-debug/src/what-i-change/what-i-change",["require","exports","module","can-debug/src/log-data/log-data","can-debug/src/get-data/get-data","can-debug/src/get-graph/get-graph"],function(e,t,n){"use strict";var a=e("can-debug/src/log-data/log-data"),i=e("can-debug/src/get-data/get-data"),o=e("can-debug/src/get-graph/get-graph");n.exports=function(e,t){var n=2===arguments.length,r=i(n?o(e,t):o(e),"whatIChange");r&&a(r)}}),define("can-debug/src/what-changes-me/what-changes-me",["require","exports","module","can-debug/src/log-data/log-data","can-debug/src/get-data/get-data","can-debug/src/get-graph/get-graph"],function(e,t,n){"use strict";var a=e("can-debug/src/log-data/log-data"),i=e("can-debug/src/get-data/get-data"),o=e("can-debug/src/get-graph/get-graph");n.exports=function(e,t){var n=2===arguments.length,r=i(n?o(e,t):o(e),"whatChangesMe");r&&a(r)}}),define("can-debug/src/get-what-i-change/get-what-i-change",["require","exports","module","can-debug/src/get-data/get-data","can-debug/src/get-graph/get-graph"],function(e,t,n){"use strict";var r=e("can-debug/src/get-data/get-data"),a=e("can-debug/src/get-graph/get-graph");n.exports=function(e,t){var n=2===arguments.length;return r(n?a(e,t):a(e),"whatIChange")}}),define("can-debug/src/get-what-changes-me/get-what-changes-me",["require","exports","module","can-debug/src/get-data/get-data","can-debug/src/get-graph/get-graph"],function(e,t,n){"use strict";var r=e("can-debug/src/get-data/get-data"),a=e("can-debug/src/get-graph/get-graph");n.exports=function(e,t){var n=2===arguments.length;return r(n?a(e,t):a(e),"whatChangesMe")}}),define("can-log",function(e,t,n){"use strict";t.warnTimeout=5e3,t.logLevel=0,t.warn=function(){this.logLevel<2&&("undefined"!=typeof console&&console.warn?this._logger("warn",Array.prototype.slice.call(arguments)):"undefined"!=typeof console&&console.log&&this._logger("log",Array.prototype.slice.call(arguments)))},t.log=function(){this.logLevel<1&&"undefined"!=typeof console&&console.log&&this._logger("log",Array.prototype.slice.call(arguments))},t.error=function(){this.logLevel<1&&"undefined"!=typeof console&&console.error&&this._logger("error",Array.prototype.slice.call(arguments))},t._logger=function(t,n){try{console[t].apply(console,n)}catch(e){console[t](n)}}}),define("can-log/dev/dev",["require","exports","module","can-log"],function(e,t,n){"use strict";var r=e("can-log");n.exports={warnTimeout:5e3,logLevel:0,stringify:function(e){return JSON.stringify(e,function(e,t){return void 0===t?"/* void(undefined) */":t}," ").replace(/"\/\* void\(undefined\) \*\/"/g,"undefined")},warn:function(){r.warn.apply(this,arguments)},log:function(){r.log.apply(this,arguments)},error:function(){r.error.apply(this,arguments)},_logger:r._logger}}),define("can-queues/queue-state",function(e,t,n){"use strict";n.exports={lastTask:null}}),define("can-queues/queue",["require","exports","module","can-queues/queue-state","can-log/dev/dev","can-assign"],function(e,t,n){"use strict";var r=e("can-queues/queue-state"),a=e("can-log/dev/dev"),i=e("can-assign");function o(){}var s=function(e,t){this.callbacks=i({onFirstTask:o,onComplete:function(){r.lastTask=null}},t||{}),this.name=e,this.index=0,this.tasks=[],this._log=!1};(s.prototype.constructor=s).noop=o,s.prototype.enqueue=function(e,t,n,r){var a=this.tasks.push({fn:e,context:t,args:n,meta:r||{}});"production"!==process.env.NODE_ENV&&this._logEnqueue(this.tasks[a-1]),1===a&&this.callbacks.onFirstTask(this)},s.prototype.flush=function(){for(;this.index<this.tasks.length;){var e=this.tasks[this.index++];"production"!==process.env.NODE_ENV&&this._logFlush(e),e.fn.apply(e.context,e.args)}this.index=0,this.tasks=[],this.callbacks.onComplete(this)},s.prototype.log=function(){this._log=!arguments.length||arguments[0]},"production"!==process.env.NODE_ENV&&(s.prototype._logEnqueue=function(e){if(e.meta.parentTask=r.lastTask,!0===(e.meta.stack=this)._log||"enqueue"===this._log){var t=e.meta.log?e.meta.log.concat(e):[e.fn.name,e];a.log.apply(a,[this.name+" enqueuing:"].concat(t))}},s.prototype._logFlush=function(e){if(!0===this._log||"flush"===this._log){var t=e.meta.log?e.meta.log.concat(e):[e.fn.name,e];a.log.apply(a,[this.name+" running :"].concat(t))}r.lastTask=e}),n.exports=s}),define("can-queues/priority-queue",["require","exports","module","can-queues/queue"],function(e,t,n){"use strict";var r=e("can-queues/queue"),a=function(){r.apply(this,arguments),this.taskMap=new Map,this.taskContainersByPriority=[],this.curPriorityIndex=1/0,this.curPriorityMax=0,this.isFlushing=!1,this.tasksRemaining=0};((a.prototype=Object.create(r.prototype)).constructor=a).prototype.enqueue=function(e,t,n,r){if(!this.taskMap.has(e)){this.tasksRemaining++;var a=0===this.taskContainersByPriority.length,i={fn:e,context:t,args:n,meta:r||{}};this.getTaskContainerAndUpdateRange(i).tasks.push(i),this.taskMap.set(e,i),"production"!==process.env.NODE_ENV&&this._logEnqueue(i),a&&this.callbacks.onFirstTask(this)}},a.prototype.getTaskContainerAndUpdateRange=function(e){var t=e.meta.priority||0;t<this.curPriorityIndex&&(this.curPriorityIndex=t),t>this.curPriorityMax&&(this.curPriorityMax=t);var n=this.taskContainersByPriority,r=n[t];return r||(r=n[t]={tasks:[],index:0}),r},a.prototype.flush=function(){if(!this.isFlushing)for(this.isFlushing=!0;;){if(!(this.curPriorityIndex<=this.curPriorityMax))return this.taskMap=new Map,this.curPriorityIndex=1/0,this.curPriorityMax=0,this.taskContainersByPriority=[],this.isFlushing=!1,void this.callbacks.onComplete(this);var e=this.taskContainersByPriority[this.curPriorityIndex];if(e&&e.tasks.length>e.index){var t=e.tasks[e.index++];"production"!==process.env.NODE_ENV&&this._logFlush(t),this.tasksRemaining--,this.taskMap.delete(t.fn),t.fn.apply(t.context,t.args)}else this.curPriorityIndex++}},a.prototype.isEnqueued=function(e){return this.taskMap.has(e)},a.prototype.flushQueuedTask=function(e){var t=this.dequeue(e);t&&("production"!==process.env.NODE_ENV&&this._logFlush(t),t.fn.apply(t.context,t.args))},a.prototype.dequeue=function(e){var t=this.taskMap.get(e);if(t){var n=t.meta.priority||0,r=this.taskContainersByPriority[n],a=r.tasks.indexOf(t,r.index);if(0<=a)return r.tasks.splice(a,1),this.tasksRemaining--,this.taskMap.delete(t.fn),t;console.warn("Task",e,"has already run")}},a.prototype.tasksRemainingCount=function(){return this.tasksRemaining},n.exports=a}),define("can-queues/completion-queue",["require","exports","module","can-queues/queue"],function(e,t,n){"use strict";var r=e("can-queues/queue"),a=function(){r.apply(this,arguments),this.flushCount=0};((a.prototype=Object.create(r.prototype)).constructor=a).prototype.flush=function(){if(0===this.flushCount){for(this.flushCount++;this.index<this.tasks.length;){var e=this.tasks[this.index++];"production"!==process.env.NODE_ENV&&this._logFlush(e),e.fn.apply(e.context,e.args)}this.index=0,this.tasks=[],this.flushCount--,this.callbacks.onComplete(this)}},n.exports=a}),define("can-queues",["require","exports","module","can-log/dev/dev","can-queues/queue","can-queues/priority-queue","can-queues/queue-state","can-queues/completion-queue","can-namespace"],function(e,t,n){"use strict";var r,a,i,o,s,c=e("can-log/dev/dev"),u=e("can-queues/queue"),l=e("can-queues/priority-queue"),f=e("can-queues/queue-state"),d=e("can-queues/completion-queue"),p=e("can-namespace"),h=0,v=!1,g=0,y=["notify","derive","domUI","mutate"];a=new u("NOTIFY",{onComplete:function(){i.flush()},onFirstTask:function(){h?v=!0:a.flush()}}),i=new l("DERIVE",{onComplete:function(){o.flush()},onFirstTask:function(){v=!0}}),o=new d("DOM_UI",{onComplete:function(){s.flush()},onFirstTask:function(){v=!0}}),s=new u("MUTATE",{onComplete:function(){f.lastTask=null,!1},onFirstTask:function(){v=!0}});var m={Queue:u,PriorityQueue:l,CompletionQueue:d,notifyQueue:a,deriveQueue:i,domUIQueue:o,mutateQueue:s,batch:{start:function(){1===++h&&(r={number:++g})},stop:function(){0===--h&&v&&(!(v=!1),a.flush())},isCollecting:function(){return 0<h},number:function(){return g},data:function(){return r}},runAsTask:function(t,n){return"production"!==process.env.NODE_ENV?function(){f.lastTask={fn:t,context:this,args:arguments,meta:{reasonLog:"function"==typeof n?n.apply(this,arguments):n,parentTask:f.lastTask,stack:{name:"RUN_AS"}}};var e=t.apply(this,arguments);return f.lastTask=f.lastTask&&f.lastTask.meta.parentTask,e}:t},enqueueByQueue:function(r,a,i,o,s){r&&(m.batch.start(),y.forEach(function(e){var n=m[e+"Queue"],t=r[e];void 0!==t&&t.forEach(function(e){var t=null!=o?o(e,a,i):{};t.reasonLog=s,n.enqueue(e,a,i,t)})}),m.batch.stop())},lastTask:function(){return f.lastTask},stack:function(e){for(var t=e||f.lastTask,n=[];t;)n.unshift(t),t=t.meta.parentTask;return n},logStack:function(e){this.stack(e).forEach(function(e,t){var n=e.meta;0===t&&n&&n.reasonLog&&c.log.apply(c,n.reasonLog);var r=n&&n.log?n.log:[e.fn.name,e];c.log.apply(c,[e.meta.stack.name+" ran task:"].concat(r))})},taskCount:function(){return a.tasks.length+i.tasks.length+o.tasks.length+s.tasks.length},flush:function(){a.flush()},log:function(){a.log.apply(a,arguments),i.log.apply(i,arguments),o.log.apply(o,arguments),s.log.apply(s,arguments)}};if(p.queues)throw new Error("You can't have two versions of can-queues, check your dependencies");n.exports=p.queues=m}),define("can-diff/list/list",["require","exports","module","can-reflect"],function(e,t,n){"use strict";var d=e("can-reflect"),p=[].slice;function h(e,t){return e===t}function v(n){return n.identity&&n.identity.length?function(e,t){return d.getIdentity(e,n)===d.getIdentity(t,n)}:h}function g(e,t,n,r,a){for(var i=n.length-1,o=r.length-1;e<i&&t<o;){if(!a(n[i],r[o],i))return[{type:"splice",index:t,deleteCount:i-e+1,insert:p.call(r,t,o+1)}];i--,o--}return[{type:"splice",index:t,deleteCount:i-e+1,insert:p.call(r,t,o+1)}]}n.exports=function(e,t,n){var r,a,i=0,o=0,s=d.size(e),c=d.size(t),u=[];for(r="function"===typeof n?n:null!=n?"map"===n.type?v(n):null!=(a=n).values?v(d.getSchema(a.values)):h:function(e,t){var n,r=d.getSchema(e);if(null!=r){if(null==r.values)return h;n=d.getSchema(r.values)}return null==n&&0<t&&(n=d.getSchema(d.getKeyValue(e,0))),n?v(n):h}(e,s);i<s&&o<c;){var l=e[i],f=t[o];if(r(l,f,i))i++,o++;else if(o+1<c&&r(l,t[o+1],i))u.push({index:o,deleteCount:0,insert:[t[o]],type:"splice"}),i++,o+=2;else{if(!(i+1<s&&r(e[i+1],f,i+1)))return u.push.apply(u,g(i,o,e,t,r)),u;u.push({index:o,deleteCount:1,insert:[],type:"splice"}),i+=2,o++}}return o===c&&i===s||u.push({type:"splice",index:o,deleteCount:s-i,insert:p.call(t,o)}),u}}),define("can-diff/merge-deep/merge-deep",["require","exports","module","can-reflect","can-diff/list/list"],function(e,t,n){"use strict";var u=e("can-reflect"),c=e("can-diff/list/list");function r(e,t){return t=u.serialize(t),u.isMoreListLikeThanMapLike(e)?f(e,t):l(e,t),e}function l(s,c){u.eachKey(s,function(e,t){if(u.hasKey(c,t)){var n=u.getKeyValue(c,t);if(u.deleteKeyValue(c,t),u.isPrimitive(e))u.setKeyValue(s,t,n);else{var r=Array.isArray(n),a=u.isMoreListLikeThanMapLike(e);if(a&&r)f(e,n);else if(!r&&!a&&u.isMapLike(e)&&u.isPlainObject(n)){var i=u.getSchema(e);if(i&&i.identity&&i.identity.length){var o=u.getIdentity(e,i);if(null!=o&&o===u.getIdentity(n,i))return void l(e,n)}u.setKeyValue(s,t,u.new(e.constructor,n))}else u.setKeyValue(s,t,n)}}else u.deleteKeyValue(s,t)}),u.eachKey(c,function(e,t){u.setKeyValue(s,t,e)})}function f(t,e){var n,r,a,i=u.getSchema(t);i&&(n=i.values),n&&(r=u.getSchema(n)),!r&&0<u.size(t)&&(r=u.getSchema(u.getKeyValue(t,0))),a=r&&r.identity&&r.identity.length?function(e,t){var n=u.getIdentity(e,r)===u.getIdentity(t,r);return n&&l(e,t),n}:function(e,t){var n=e===t;return n&&(u.isPrimitive(e)||l(e,t)),n};var o=c(t,e,a),s=n?u.new.bind(u,n):function(e){return e};if(!o.length)return t;o.forEach(function(e){d(t,e,s)})}function d(e,t,n){var r=n&&t.insert.map(function(e){return n(e)})||t.insert,a=[t.index,t.deleteCount].concat(r);return e.splice.apply(e,a),e}r.applyPatch=d,n.exports=r}),define("can-debug",["require","exports","module","can-namespace","can-globals","can-debug/src/proxy-namespace","can-debug/src/temporarily-bind","can-debug/src/get-graph/get-graph","can-debug/src/format-graph/format-graph","can-debug/src/what-i-change/what-i-change","can-debug/src/what-changes-me/what-changes-me","can-debug/src/get-what-i-change/get-what-i-change","can-debug/src/get-what-changes-me/get-what-changes-me","can-symbol","can-reflect","can-queues","can-diff/merge-deep/merge-deep"],function(e,t,n){!function(r,e,t,n){"use strict";var a=e("can-namespace"),i=e("can-globals"),o=e("can-debug/src/proxy-namespace"),s=e("can-debug/src/temporarily-bind"),c=e("can-debug/src/get-graph/get-graph"),u=e("can-debug/src/format-graph/format-graph"),l=e("can-debug/src/what-i-change/what-i-change"),f=e("can-debug/src/what-changes-me/what-changes-me"),d=e("can-debug/src/get-what-i-change/get-what-i-change"),p=e("can-debug/src/get-what-changes-me/get-what-changes-me"),h=e("can-symbol"),v=e("can-reflect"),g=e("can-queues"),y=e("can-diff/merge-deep/merge-deep"),m=(r=i.getKeyValue("global"),!1);n.exports=function(){return a.debug={getGraph:s(c),formatGraph:s(u),getWhatIChange:s(d),getWhatChangesMe:s(p),logWhatIChange:s(l),logWhatChangesMe:s(f)},function(){if(!m){var t="__CANJS_DEVTOOLS__",n={Symbol:h,Reflect:v,queues:g,getGraph:a.debug.getGraph,formatGraph:a.debug.formatGraph,mergeDeep:y};r[t]?r[t].register(n):Object.defineProperty(r,t,{set:function(e){Object.defineProperty(r,t,{value:e}),e.register(n)},configurable:!0}),m=!0}}(),r.can="undefined"!=typeof Proxy?o(a):a,a.debug}}(function(){return this}(),e,0,n)}),define("can/es/can-debug",["exports","can-debug"],function(e,t){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"default",{enumerable:!0,get:function(){return(e=t,e&&e.__esModule?e:{default:e}).default;var e}})}),define("can/enable-can-debug",["can/es/can-debug"],function(e){"use strict";var t,n=(t=e)&&t.__esModule?t:{default:t};"production"!==process.env.NODE_ENV&&(0,n.default)()}),define("can-observation-recorder",["require","exports","module","can-namespace","can-symbol"],function(e,t,n){"use strict";var r=e("can-namespace"),a=e("can-symbol"),i=[],o=a.for("can.addParent"),s=a.for("can.getValue"),c={stack:i,start:function(e){var t={keyDependencies:new Map,valueDependencies:new Set,childDependencies:new Set,traps:null,ignore:0,name:e};return i.push(t),t},stop:function(){return i.pop()},add:function(e,t){var n=i[i.length-1];if(n&&0===n.ignore)if(n.traps)n.traps.push([e,t]);else if(void 0===t)n.valueDependencies.add(e);else{var r=n.keyDependencies.get(e);r||(r=new Set,n.keyDependencies.set(e,r)),r.add(t)}},addMany:function(e){var t=i[i.length-1];if(t)if(t.traps)t.traps.push.apply(t.traps,e);else for(var n=0,r=e.length;n<r;n++)this.add(e[n][0],e[n][1])},created:function(e){var t=i[i.length-1];t&&(t.childDependencies.add(e),e[o]&&e[o](t))},ignore:function(n){return function(){if(i.length){var e=i[i.length-1];e.ignore++;var t=n.apply(this,arguments);return e.ignore--,t}return n.apply(this,arguments)}},peekValue:function(e){if(!e||!e[s])return e;if(i.length){var t=i[i.length-1];t.ignore++;var n=e[s]();return t.ignore--,n}return e[s]()},isRecording:function(){var e=i.length,t=e&&i[e-1];return t&&0===t.ignore&&t},makeDependenciesRecord:function(e){return{traps:null,keyDependencies:new Map,valueDependencies:new Set,ignore:0,name:e}},makeDependenciesRecorder:function(){return c.makeDependenciesRecord()},trap:function(){if(i.length){var e=i[i.length-1],t=e.traps,n=e.traps=[];return function(){return e.traps=t,n}}return function(){return[]}},trapsCount:function(){return i.length?i[i.length-1].traps.length:0}};if(r.ObservationRecorder)throw new Error("You can't have two versions of can-observation-recorder, check your dependencies");n.exports=r.ObservationRecorder=c}),define("can-key-tree",["require","exports","module","can-reflect"],function(e,t,n){"use strict";var u=e("can-reflect");function s(e){if(e===Object.prototype)return!0;var t=Object.prototype.toString.call(e),n="[object Object]"!==t,r=-1!==t.indexOf("[object ");return n&&r}function l(n,r,a,i){if(a===r.length){if(!u.isMoreListLikeThanMapLike(n))throw new Error("can-key-tree: Map-type leaf containers are not supported yet.");var e=u.toArray(n);i&&e.forEach(function(e){i.apply(null,r.concat(e))}),u.removeValues(n,e)}else u.each(n,function(e,t){l(e,r.concat(t),a,i),u.deleteKeyValue(n,t)})}var r=function(e,t){var n=e[0];u.isConstructorLike(n)?this.root=new n:this.root=n,this.callbacks=t||{},this.treeStructure=e,this.empty=!0};u.assign(r.prototype,{add:function(e){if(e.length>this.treeStructure.length)throw new Error("can-key-tree: Can not add path deeper than tree.");for(var t=this.root,n=!0===this.empty,r=0;r<e.length-1;r++){var a=e[r],i=u.getKeyValue(t,a);if(!i){var o=this.treeStructure[r+1];i=s(o.prototype)?new o:new o(a),u.setKeyValue(t,a,i)}t=i}if(!u.isMoreListLikeThanMapLike(t))throw new Error("can-key-tree: Map types are not supported yet.");return u.addValues(t,[e[e.length-1]]),n&&(this.empty=!1,this.callbacks.onFirst&&this.callbacks.onFirst.call(this)),this},getNode:function(e){for(var t=this.root,n=0;n<e.length;n++){var r=e[n];if(!(t=u.getKeyValue(t,r)))return}return t},get:function(e){var t=this.getNode(e);if(this.treeStructure.length===e.length)return t;var n=new this.treeStructure[this.treeStructure.length-1];return function t(e,n,r,a){if(e)if(a===r){if(!u.isMoreListLikeThanMapLike(e))throw new Error("can-key-tree: Map-type leaf containers are not supported yet.");u.addValues(n,u.toArray(e))}else u.each(e,function(e){t(e,n,r+1,a)})}(t,n,e.length,this.treeStructure.length-1),n},delete:function(e,t){for(var n=this.root,r=[this.root],a=e[e.length-1],i=0;i<e.length-1;i++){var o=e[i],s=u.getKeyValue(n,o);if(void 0===s)return!1;r.push(s),n=s}if(e.length)if(e.length===this.treeStructure.length){if(!u.isMoreListLikeThanMapLike(n))throw new Error("can-key-tree: Map types are not supported yet.");t&&t.apply(null,e.concat(a)),u.removeValues(n,[a])}else{var c=u.getKeyValue(n,a);if(void 0===c)return!1;l(c,e,this.treeStructure.length-1,t),u.deleteKeyValue(n,a)}else l(n,[],this.treeStructure.length-1,t);for(i=r.length-2;0<=i&&0===u.size(n);i--)n=r[i],u.deleteKeyValue(n,e[i]);return 0===u.size(this.root)&&(this.empty=!0,this.callbacks.onEmpty&&this.callbacks.onEmpty.call(this)),!0},size:function(){return function t(e,n){if(0===n)return u.size(e);if(0===u.size(e))return 0;var r=0;return u.each(e,function(e){r+=t(e,n-1)}),r}(this.root,this.treeStructure.length-1)},isEmpty:function(){return this.empty}}),n.exports=r}),define("can-define-lazy-value",function(e,t,n){"use strict";n.exports=function(t,n,r,a){Object.defineProperty(t,n,{configurable:!0,get:function(){Object.defineProperty(this,n,{value:void 0,writable:!0});var e=r.call(this,t,n);return Object.defineProperty(this,n,{value:e,writable:!!a}),e},set:function(e){return Object.defineProperty(this,n,{value:e,writable:!!a}),e}})}}),define("can-event-queue/dependency-record/merge",["require","exports","module","can-reflect"],function(e,t,n){"use strict";var a=e("can-reflect");n.exports=function(e,t){return function(e,t){var n=t.keyDependencies;if(n){var r=e.keyDependencies;r||(r=new Map,e.keyDependencies=r),a.eachKey(n,function(e,t){var n=r.get(t);n||(n=new Set,r.set(t,n)),a.eachIndex(e,function(e){n.add(e)})})}}(e,t),function(e,t){var n=t.valueDependencies;if(n){var r=e.valueDependencies;r||(r=new Set,e.valueDependencies=r),a.eachIndex(n,function(e){r.add(e)})}}(e,t),e}}),define("can-event-queue/value/value",["require","exports","module","can-queues","can-key-tree","can-reflect","can-define-lazy-value","can-event-queue/dependency-record/merge"],function(e,t,n){"use strict";var r=e("can-queues"),a=e("can-key-tree"),i=e("can-reflect"),o=e("can-define-lazy-value"),s=e("can-event-queue/dependency-record/merge"),c={on:function(e,t){this.handlers.add([t||"mutate",e])},off:function(e,t){void 0===e?void 0===t?this.handlers.delete([]):this.handlers.delete([t]):this.handlers.delete([t||"mutate",e])}},u={"can.onValue":c.on,"can.offValue":c.off,"can.dispatch":function(e,t){var n=[];n=[this.handlers.getNode([]),this,[e,t]],"production"!==process.env.NODE_ENV&&(n=[this.handlers.getNode([]),this,[e,t],null,[i.getName(this),"changed to",e,"from",t]]),r.enqueueByQueue.apply(r,n),"production"!==process.env.NODE_ENV&&"function"==typeof this._log&&this._log(t,e)},"can.getWhatIChange":function(){if("production"!==process.env.NODE_ENV){var r={},e=this.handlers.get(["notify"]),t=[].concat(this.handlers.get(["mutate"]),this.handlers.get(["domUI"]));return e.length&&e.forEach(function(e){var t=i.getChangesDependencyRecord(e);if(t){var n=r.derive;n||(n=r.derive={}),s(n,t)}}),t.length&&t.forEach(function(e){var t=i.getChangesDependencyRecord(e);if(t){var n=r.mutate;n||(n=r.mutate={}),s(n,t)}}),Object.keys(r).length?r:void 0}},"can.isBound":function(){return!this.handlers.isEmpty()}};function l(){return new a([Object,Array],{onFirst:void 0!==this.onBound&&this.onBound.bind(this),onEmpty:void 0!==this.onUnbound&&this.onUnbound.bind(this)})}var f=function(e){return i.assign(e,c),i.assignSymbols(e,u),o(e,"handlers",l,!0),e};f.addHandlers=function(e,t){return console.warn("can-event-queue/value: Avoid using addHandlers. Add onBound and onUnbound methods instead."),e.handlers=new a([Object,Array],t),e},n.exports=f}),define("can-observation/recorder-dependency-helpers",["require","exports","module","can-reflect"],function(e,t,n){"use strict";var r=e("can-reflect");function a(e){void 0!==this.oldEventSet&&!1!==this.oldEventSet.delete(e)||r.onKeyValue(this.observable,e,this.onDependencyChange,"notify")}function i(e,t){e.forEach(a,{onDependencyChange:this.onDependencyChange,observable:t,oldEventSet:this.oldDependencies.keyDependencies.get(t)})}function o(e){r.offKeyValue(this.observable,e,this.onDependencyChange,"notify")}function s(e,t){e.forEach(o,{onDependencyChange:this.onDependencyChange,observable:t})}function c(e){!1===this.oldDependencies.valueDependencies.delete(e)&&r.onValue(e,this.onDependencyChange,"notify")}function u(e){r.offValue(e,this.onDependencyChange,"notify")}n.exports={updateObservations:function(e){e.newDependencies.keyDependencies.forEach(i,e),e.oldDependencies.keyDependencies.forEach(s,e),e.newDependencies.valueDependencies.forEach(c,e),e.oldDependencies.valueDependencies.forEach(u,e)},stopObserving:function(e,t){e.keyDependencies.forEach(s,{onDependencyChange:t}),e.valueDependencies.forEach(u,{onDependencyChange:t})}}}),define("can-observation/temporarily-bind",["require","exports","module","can-reflect"],function(e,t,n){"use strict";var r,a=e("can-reflect"),i=function(){},o=function(){for(var e=0,t=r.length;e<t;e++)a.offValue(r[e],i);r=null};n.exports=function(e){var t=e.computeInstance||e;a.onValue(t,i),r||(r=[],setTimeout(o,10)),r.push(t)}}),define("can-observation",["require","exports","module","can-namespace","can-reflect","can-queues","can-observation-recorder","can-symbol","can-log/dev/dev","can-event-queue/value/value","can-observation/recorder-dependency-helpers","can-observation/temporarily-bind"],function(e,t,n){!function(e,t,n,r){"use strict";var a=t("can-namespace"),i=t("can-reflect"),o=t("can-queues"),s=t("can-observation-recorder"),c=t("can-symbol"),u=t("can-log/dev/dev"),l=t("can-event-queue/value/value"),f=t("can-observation/recorder-dependency-helpers"),d=t("can-observation/temporarily-bind"),p=c.for("can.dispatch"),h=c.for("can.getChangesDependencyRecord"),v=c.for("can.getValueDependencies");function g(e,t,n){this.func=e,this.context=t,this.options=n||{priority:0,isObservable:!0},this.bound=!1,this._value=void 0,this.newDependencies=s.makeDependenciesRecord(),this.oldDependencies=null;var r=this;this.onDependencyChange=function(e){r.dependencyChange(this,e)},this.update=this.update.bind(this),"production"!==process.env.NODE_ENV&&(this.onDependencyChange[h]=function(){var e=new Set;return e.add(r),{valueDependencies:e}},Object.defineProperty(this.onDependencyChange,"name",{value:i.getName(this)+".onDependencyChange"}),Object.defineProperty(this.update,"name",{value:i.getName(this)+".update"}))}l(g.prototype),i.assign(g.prototype,{onBound:function(){this.bound=!0,this.oldDependencies=this.newDependencies,s.start(),this._value=this.func.call(this.context),this.newDependencies=s.stop(),f.updateObservations(this)},dependencyChange:function(e,t){if(!0===this.bound){var n=[];n=[this.update,this,[],{priority:this.options.priority}],"production"!==process.env.NODE_ENV&&(n=[this.update,this,[],{priority:this.options.priority,log:[i.getName(this.update)]},[i.getName(e),"changed"]]),o.deriveQueue.enqueue.apply(o.deriveQueue,n)}},update:function(){if(!0===this.bound){var e=this._value;this.oldValue=null,this.onBound(),e!==this._value&&this[p](this._value,e)}},onUnbound:function(){this.bound=!1,f.stopObserving(this.newDependencies,this.onDependencyChange),this.newDependencies=s.makeDependenciesRecorder()},get:function(){return this.options.isObservable&&s.isRecording()&&(s.add(this),this.bound||g.temporarilyBind(this)),!0===this.bound?(0<o.deriveQueue.tasksRemainingCount()&&g.updateChildrenAndSelf(this),this._value):this.func.call(this.context)},hasDependencies:function(){var e=this.newDependencies;return this.bound?0<e.valueDependencies.size+e.keyDependencies.size:void 0},log:function(){if("production"!==process.env.NODE_ENV){var n=function(e){return"string"==typeof e?JSON.stringify(e):e};this._log=function(e,t){u.log(i.getName(this),"\n is ",n(t),"\n was ",n(e))}}}}),Object.defineProperty(g.prototype,"value",{get:function(){return this.get()}});var y={"can.getValue":g.prototype.get,"can.isValueLike":!0,"can.isMapLike":!1,"can.isListLike":!1,"can.valueHasDependencies":g.prototype.hasDependencies,"can.getValueDependencies":function(){if(!0===this.bound){var e=this.newDependencies,t={};return e.keyDependencies.size&&(t.keyDependencies=e.keyDependencies),e.valueDependencies.size&&(t.valueDependencies=e.valueDependencies),t}},"can.getPriority":function(){return this.options.priority},"can.setPriority":function(e){this.options.priority=e}};"production"!==process.env.NODE_ENV&&(y["can.getName"]=function(){return i.getName(this.constructor)+"<"+i.getName(this.func)+">"}),i.assignSymbols(g.prototype,y),g.updateChildrenAndSelf=function(e){if(void 0!==e.update&&!0===o.deriveQueue.isEnqueued(e.update))return o.deriveQueue.flushQueuedTask(e.update),!0;if(e[v]){var t=!1;return(e[v]().valueDependencies||[]).forEach(function(e){!0===g.updateChildrenAndSelf(e)&&(t=!0)}),t}return!1};var m={addAll:"addMany"};["add","addAll","ignore","trap","trapsCount","isRecording"].forEach(function(t){g[t]=function(){var e=m[t]?m[t]:t;return console.warn("can-observation: Call "+e+"() on can-observation-recorder."),s[e].apply(this,arguments)}}),g.prototype.start=function(){return console.warn("can-observation: Use .on and .off to bind."),this.onBound()},g.prototype.stop=function(){return console.warn("can-observation: Use .on and .off to bind."),this.onUnbound()},g.temporarilyBind=d,r.exports=a.Observation=g}(0,e,0,n)}),define("can-simple-observable/log",["require","exports","module","can-log/dev/dev","can-reflect"],function(e,t,n){"use strict";var r=e("can-log/dev/dev"),a=e("can-reflect");function i(e){return"string"==typeof e?JSON.stringify(e):e}n.exports=function(){"production"!==process.env.NODE_ENV&&(this._log=function(e,t){r.log(a.getName(this),"\n is ",i(t),"\n was ",i(e))})}}),define("can-simple-observable",["require","exports","module","can-simple-observable/log","can-namespace","can-symbol","can-reflect","can-observation-recorder","can-event-queue/value/value"],function(e,t,n){"use strict";var r=e("can-simple-observable/log"),a=e("can-namespace"),i=e("can-symbol"),o=e("can-reflect"),s=e("can-observation-recorder"),c=e("can-event-queue/value/value"),u=i.for("can.dispatch");function l(e){this._value=e}c(l.prototype),o.assignMap(l.prototype,{log:r,get:function(){return s.add(this),this._value},set:function(e){var t=this._value;this._value=e,this[u](e,t)}}),Object.defineProperty(l.prototype,"value",{set:function(e){return this.set(e)},get:function(){return this.get()}});var f={"can.getValue":l.prototype.get,"can.setValue":l.prototype.set,"can.isMapLike":!1,"can.valueHasDependencies":function(){return!0}};"production"!==process.env.NODE_ENV&&(f["can.getName"]=function(){var e=this._value;return e="object"!=typeof e||null===e?JSON.stringify(e):"",o.getName(this.constructor)+"<"+e+">"}),o.assignSymbols(l.prototype,f),n.exports=a.SimpleObservable=l}),define("can-simple-observable/settable/settable",["require","exports","module","can-reflect","can-observation-recorder","can-simple-observable","can-observation","can-queues","can-simple-observable/log","can-event-queue/value/value"],function(e,t,n){"use strict";var a=e("can-reflect"),r=e("can-observation-recorder"),i=e("can-simple-observable"),o=e("can-observation"),s=e("can-queues"),c=e("can-simple-observable/log"),u=e("can-event-queue/value/value"),l=r.ignore(a.getValue.bind(a));function f(e,t,n){function r(){return e.call(t,this.lastSetValue.get())}this.lastSetValue=new i(n),this.handler=this.handler.bind(this),"production"!==process.env.NODE_ENV&&(a.assignSymbols(this,{"can.getName":function(){return a.getName(this.constructor)+"<"+a.getName(e)+">"}}),Object.defineProperty(this.handler,"name",{value:a.getName(this)+".handler"}),Object.defineProperty(r,"name",{value:a.getName(e)+"::"+a.getName(this.constructor)})),this.observation=new o(r,this)}u(f.prototype),a.assignMap(f.prototype,{log:c,constructor:f,handler:function(e){var t,n=this._value;this._value=e,"production"!==process.env.NODE_ENV&&("function"==typeof this._log&&this._log(n,e),t=[a.getName(this),"set to",e,"from",n]),s.enqueueByQueue(this.handlers.getNode([]),this,[e,n],null,t)},onBound:function(){this.bound||(this.bound=!0,this.activate())},activate:function(){a.onValue(this.observation,this.handler,"notify"),this._value=l(this.observation)},onUnbound:function(){this.bound=!1,a.offValue(this.observation,this.handler,"notify")},set:function(e){var t=this.lastSetValue.get();a.isObservableLike(t)&&a.isValueLike(t)&&!a.isObservableLike(e)?a.setValue(t,e):e!==t&&this.lastSetValue.set(e)},get:function(){return r.isRecording()&&(r.add(this),this.bound||this.onBound()),!0===this.bound?this._value:this.observation.get()},hasDependencies:function(){return a.valueHasDependencies(this.observation)},getValueDependencies:function(){return a.getValueDependencies(this.observation)}}),Object.defineProperty(f.prototype,"value",{set:function(e){return this.set(e)},get:function(){return this.get()}}),a.assignSymbols(f.prototype,{"can.getValue":f.prototype.get,"can.setValue":f.prototype.set,"can.isMapLike":!1,"can.getPriority":function(){return a.getPriority(this.observation)},"can.setPriority":function(e){a.setPriority(this.observation,e)},"can.valueHasDependencies":f.prototype.hasDependencies,"can.getValueDependencies":f.prototype.getValueDependencies}),n.exports=f}),define("can-simple-observable/async/async",["require","exports","module","can-simple-observable","can-observation","can-queues","can-simple-observable/settable/settable","can-reflect","can-observation-recorder","can-event-queue/value/value"],function(e,t,n){"use strict";var a=e("can-simple-observable"),i=e("can-observation"),r=e("can-queues"),o=e("can-simple-observable/settable/settable"),s=e("can-reflect"),c=e("can-observation-recorder");e("can-event-queue/value/value");function u(t,n,e){function r(){this.resolveCalled=!1,this.inGetter=!0;var e=t.call(n,this.lastSetValue.get(),!0===this.bound?this.resolve:void 0);if(this.inGetter=!1,void 0!==e?this.resolve(e):this.resolveCalled&&this.resolve(this._value),!0!==this.bound)return e}this.resolve=this.resolve.bind(this),this.lastSetValue=new a(e),this.handler=this.handler.bind(this),"production"!==process.env.NODE_ENV&&(s.assignSymbols(this,{"can.getName":function(){return s.getName(this.constructor)+"<"+s.getName(t)+">"}}),Object.defineProperty(this.handler,"name",{value:s.getName(this)+".handler"}),Object.defineProperty(r,"name",{value:s.getName(t)+"::"+s.getName(this.constructor)})),this.observation=new i(r,this)}((u.prototype=Object.create(o.prototype)).constructor=u).prototype.handler=function(e){void 0!==e&&o.prototype.handler.apply(this,arguments)};var l=c.ignore(s.getValue.bind(s));u.prototype.activate=function(){s.onValue(this.observation,this.handler,"notify"),this.resolveCalled||(this._value=l(this.observation))},u.prototype.resolve=function(e){this.resolveCalled=!0;var t=this._value;if(this._value=e,"production"!==process.env.NODE_ENV&&"function"==typeof this._log&&this._log(t,e),!this.inGetter){var n=[this.handlers.getNode([]),this,[e,t],null];"production"!==process.env.NODE_ENV&&(n=[this.handlers.getNode([]),this,[e,t],null,[s.getName(this),"resolved with",e]]),r.enqueueByQueue.apply(r,n)}},n.exports=u}),define("can-dom-events/helpers/util",["require","exports","module","can-globals/document/document","can-globals/is-browser-window/is-browser-window"],function(e,t,n){!function(e,t,n,r){"use strict";var a=t("can-globals/document/document"),i=t("can-globals/is-browser-window/is-browser-window");function s(e){return e.ownerDocument||a()}function o(e){if(!e||!e.nodeName)return e===window;var t=e.nodeType;return 1===t||9===t||11===t}var c=!1;!function(){if(i()){var t="fix_synthetic_events_on_disabled_test",n=document.createElement("input");n.disabled=!0;var r=setTimeout(function(){c=!0},50),a=function e(){clearTimeout(r),n.removeEventListener(t,e)};n.addEventListener(t,a);try{var e=document.create("HTMLEvents");e.initEvent(t,!1),n.dispatchEvent(e)}catch(e){a(),c=!0}}}(),r.exports={createEvent:function(e,t,n,r){var a,i=s(e).createEvent("HTMLEvents");if("string"==typeof t)a=t;else for(var o in a=t.type,t)void 0===i[o]&&(i[o]=t[o]);return void 0===n&&(n=!0),i.initEvent(a,n,r),i},addDomContext:function(e,t){return o(e)&&(t=Array.prototype.slice.call(t,0)).unshift(e),t},removeDomContext:function(e,t){return o(e)||(e=(t=Array.prototype.slice.call(t,0)).shift()),{context:e,args:t}},isDomEventTarget:o,getTargetDocument:s,forceEnabledForDispatch:function(e,t){return c&&(n=e,r=t.type,a="inserted"===r||"removed"===r,i=!!n.disabled,a&&i);var n,r,a,i}}}(0,e,0,n)}),define("can-dom-events/helpers/make-event-registry",function(e,t,n){"use strict";function r(){this._registry={}}n.exports=function(){return new r},r.prototype.has=function(e){return!!this._registry[e]},r.prototype.get=function(e){return this._registry[e]},r.prototype.add=function(e,t){if(!e)throw new Error("An EventDefinition must be provided");if("function"!=typeof e.addEventListener)throw new TypeError("EventDefinition addEventListener must be a function");if("function"!=typeof e.removeEventListener)throw new TypeError("EventDefinition removeEventListener must be a function");if("string"!=typeof(t=t||e.defaultEventType))throw new TypeError("Event type must be a string, not "+t);if(this.has(t))throw new Error('Event "'+t+'" is already registered');this._registry[t]=e;var n=this;return function(){n._registry[t]=void 0}}}),define("can-dom-events/helpers/-make-delegate-event-tree",["require","exports","module","can-key-tree","can-reflect"],function(e,t,n){"use strict";var a=e("can-key-tree"),o=e("can-reflect"),i=function(e){return"focus"===e||"blur"===e};n.exports=function(e){var r,t,n=(r=e,t=function(e){this.element=e,this.events={},this.delegated={}},o.assignSymbols(t.prototype,{"can.setKeyValue":function(e,t){var n=this.delegated[e]=function(i){o.each(t,function(e,t){var n=i.target;do{var r=n===document?document.documentElement:n,a=r.matches||r.msMatchesSelector;a&&a.call(r,t)&&e.forEach(function(e){e.call(r,i)}),n=n.parentNode}while(n&&n!==i.currentTarget)})};this.events[e]=t,r.addEventListener(this.element,e,n,i(e))},"can.getKeyValue":function(e){return this.events[e]},"can.deleteKeyValue":function(e){r.removeEventListener(this.element,e,this.delegated[e],i(e)),delete this.delegated[e],delete this.events[e]},"can.getOwnEnumerableKeys":function(){return Object.keys(this.events)}}),t);return new a([Map,n,Object,Array])}}),define("can-dom-events",["require","exports","module","can-namespace","can-dom-events/helpers/util","can-dom-events/helpers/make-event-registry","can-dom-events/helpers/-make-delegate-event-tree"],function(e,t,n){!function(e,t,n,r){"use strict";var a=t("can-namespace"),s=t("can-dom-events/helpers/util"),i=t("can-dom-events/helpers/make-event-registry"),o=t("can-dom-events/helpers/-make-delegate-event-tree"),c={_eventRegistry:i(),addEvent:function(e,t){return this._eventRegistry.add(e,t)},addEventListener:function(e,t){if(c._eventRegistry.has(t))return c._eventRegistry.get(t).addEventListener.apply(c,arguments);var n=Array.prototype.slice.call(arguments,1);return e.addEventListener.apply(e,n)},removeEventListener:function(e,t){if(c._eventRegistry.has(t))return c._eventRegistry.get(t).removeEventListener.apply(c,arguments);var n=Array.prototype.slice.call(arguments,1);return e.removeEventListener.apply(e,n)},addDelegateListener:function(e,t,n,r){c._eventTree.add([e,t,n,r])},removeDelegateListener:function(e,t,n,r){c._eventTree.delete([e,t,n,r])},dispatch:function(e,t,n,r){var a=s.createEvent(e,t,n,r),i=s.forceEnabledForDispatch(e,a);i&&(e.disabled=!1);var o=e.dispatchEvent(a);return i&&(e.disabled=!0),o}};c._eventTree=o(c),r.exports=a.domEvents=c}(0,e,0,n)}),define("can-event-queue/map/map",["require","exports","module","can-log/dev/dev","can-queues","can-reflect","can-symbol","can-key-tree","can-dom-events","can-dom-events/helpers/util","can-event-queue/dependency-record/merge"],function(e,t,n){"use strict";var a,l=e("can-log/dev/dev"),f=e("can-queues"),d=e("can-reflect"),r=e("can-symbol"),i=e("can-key-tree"),o=e("can-dom-events"),s=e("can-dom-events/helpers/util").isDomEventTarget,c=e("can-event-queue/dependency-record/merge"),u=r.for("can.meta"),p=r.for("can.dispatchInstanceBoundChange"),h=r.for("can.dispatchInstanceOnPatches"),v=r.for("can.onKeyValue"),g=r.for("can.offKeyValue"),y=r.for("can.onEvent"),m=r.for("can.offEvent"),b=r.for("can.onValue"),w=r.for("can.offValue");function _(t,e){e.handlers||(e.handlers=new i([Object,Object,Object,Array],{onFirst:function(){void 0!==t._eventSetup&&t._eventSetup();var e=t.constructor;void 0!==e[p]&&t instanceof e&&e[p](t,!0)},onEmpty:function(){void 0!==t._eventTeardown&&t._eventTeardown();var e=t.constructor;void 0!==e[p]&&t instanceof e&&e[p](t,!1)}})),e.listenHandlers||(e.listenHandlers=new i([Map,Map,Object,Array]))}var x=function(e){var t=e[u];return t||(t={},d.setKeyValue(e,u,t)),_(e,t),t};function E(e,t,n,r){arguments.length&&d.isPrimitive(e)&&(r=n,n=t,t=e,e=this.context),"function"==typeof t&&(r=n,n=t,t=void 0),"string"==typeof n&&(r=n,n=void 0);var a=[];return e&&(a.push(e),(t||n||r)&&(a.push(t),(r||n)&&(a.push(r||this.defaultQueue),n&&a.push(n)))),a}var k={dispatch:function(e,t){if("production"!==process.env.NODE_ENV&&(4<arguments.length&&(l.warn("Arguments to dispatch should be an array, not multiple arguments."),t=Array.prototype.slice.call(arguments,1)),t&&!Array.isArray(t)&&(l.warn("Arguments to dispatch should be an array."),t=[t])),!this.__inSetup){"string"==typeof e&&(e={type:e});var n=x(this);"production"!==process.env.NODE_ENV&&(e.reasonLog||(e.reasonLog=[d.getName(this),"dispatched",'"'+e.type+'"',"with"].concat(t))),"function"==typeof n._log&&n._log.call(this,e,t);var r=n.handlers,a=void 0!==e.type&&r.getNode([e.type]),i=e.patches&&this.constructor[h],o=void 0!==e.patches&&r.getNode(["can.patches","onKeyValue"]),s=void 0!==e.keyChanged&&r.getNode(["can.keys","onKeyValue"]),c=i||a||o||s;if(c&&f.batch.start(),a&&(a.onKeyValue&&f.enqueueByQueue(a.onKeyValue,this,t,e.makeMeta,e.reasonLog),a.event)){e.batchNum=f.batch.number();var u=[e].concat(t);f.enqueueByQueue(a.event,this,u,e.makeMeta,e.reasonLog)}s&&f.enqueueByQueue(s,this,[e.keyChanged],e.makeMeta,e.reasonLog),o&&f.enqueueByQueue(o,this,[e.patches],e.makeMeta,e.reasonLog),i&&this.constructor[h](this,e.patches),c&&f.batch.stop()}return e},addEventListener:function(e,t,n){return x(this).handlers.add([e,"event",n||"mutate",t]),this},removeEventListener:function(e,t,n){if(void 0===e){var r=x(this).handlers,a=r.getNode([]);Object.keys(a).forEach(function(e){r.delete([e,"event"])})}else t||n?t?x(this).handlers.delete([e,"event",n||"mutate",t]):x(this).handlers.delete([e,"event",n||"mutate"]):x(this).handlers.delete([e,"event"]);return this},one:function(e,t){var n=function(){return a.off.call(this,e,n),t.apply(this,arguments)};return a.on.call(this,e,n),this},listenTo:function(e,t,n,r){return d.isPrimitive(e)&&(r=n,n=t,t=e,e=this),"function"==typeof t&&(r=n,n=t,t=void 0),x(this).listenHandlers.add([e,t,r||"mutate",n]),a.on.call(e,t,n,r||"mutate"),this},stopListening:function(){var e=E.apply({context:this,defaultQueue:"mutate"},arguments);return x(this).listenHandlers.delete(e,function(e,t,n,r){a.off.call(e,t,r,n)}),this},on:function(e,t,n){if(s(this))"string"==typeof t?o.addDelegateListener(this,e,t,n):o.addEventListener(this,e,t,n);else if(this[y])this[y](e,t,n);else if("addEventListener"in this)this.addEventListener(e,t,n);else if(this[v])d.onKeyValue(this,e,t,n);else{if(e||!this[b])throw new Error("can-event-queue: Unable to bind "+e);d.onValue(this,t,n)}return this},off:function(e,t,n){if(s(this))"string"==typeof t?o.removeDelegateListener(this,e,t,n):o.removeEventListener(this,e,t,n);else if(this[m])this[m](e,t,n);else if("removeEventListener"in this)this.removeEventListener(e,t,n);else if(this[g])d.offKeyValue(this,e,t,n);else{if(e||!this[w])throw new Error("can-event-queue: Unable to unbind "+e);d.offValue(this,t,n)}return this}},O={"can.onKeyValue":function(e,t,n){x(this).handlers.add([e,"onKeyValue",n||"mutate",t])},"can.offKeyValue":function(e,t,n){x(this).handlers.delete([e,"onKeyValue",n||"mutate",t])},"can.isBound":function(){return!x(this).handlers.isEmpty()},"can.getWhatIChange":function(e){if("production"!==process.env.NODE_ENV){var r={},t=x(this),n=[].concat(t.handlers.get([e,"event","notify"]),t.handlers.get([e,"onKeyValue","notify"])),a=[].concat(t.handlers.get([e,"event","mutate"]),t.handlers.get([e,"event","domUI"]),t.handlers.get([e,"onKeyValue","mutate"]),t.handlers.get([e,"onKeyValue","domUI"]));return n.length&&n.forEach(function(e){var t=d.getChangesDependencyRecord(e);if(t){var n=r.derive;n||(n=r.derive={}),c(n,t)}}),a.length&&a.forEach(function(e){var t=d.getChangesDependencyRecord(e);if(t){var n=r.mutate;n||(n=r.mutate={}),c(n,t)}}),Object.keys(r).length?r:void 0}},"can.onPatches":function(e,t){x(this).handlers.add(["can.patches","onKeyValue",t||"notify",e])},"can.offPatches":function(e,t){x(this).handlers.delete(["can.patches","onKeyValue",t||"notify",e])}};function N(e,t,n){Object.defineProperty(e,t,{enumerable:!1,value:n})}N(a=function(e){return d.assignMap(e,k),d.assignSymbols(e,O)},"addHandlers",_),N(a,"stopListeningArgumentsToKeys",E),k.bind=k.addEventListener,k.unbind=k.removeEventListener,d.assignMap(a,k),d.assignSymbols(a,O),N(a,"start",function(){console.warn("use can-queues.batch.start()"),f.batch.start()}),N(a,"stop",function(){console.warn("use can-queues.batch.stop()"),f.batch.stop()}),N(a,"flush",function(){console.warn("use can-queues.flush()"),f.flush()}),N(a,"afterPreviousEvents",function(e){console.warn("don't use afterPreviousEvents"),f.mutateQueue.enqueue(function(){f.mutateQueue.enqueue(e)}),f.flush()}),N(a,"after",function(e){console.warn("don't use after"),f.mutateQueue.enqueue(e),f.flush()}),n.exports=a}),define("can-simple-observable/resolver/resolver",["require","exports","module","can-reflect","can-symbol","can-observation-recorder","can-observation","can-queues","can-event-queue/map/map","can-simple-observable/settable/settable","can-simple-observable"],function(e,t,n){"use strict";var o=e("can-reflect"),r=e("can-symbol"),a=e("can-observation-recorder"),i=(e("can-observation"),e("can-queues")),s=e("can-event-queue/map/map"),c=e("can-simple-observable/settable/settable"),u=e("can-simple-observable"),l=r.for("can.getChangesDependencyRecord");function f(e,t,n){this.resolver=a.ignore(e),this.context=t,this._valueOptions={resolve:this.resolve.bind(this),listenTo:this.listenTo.bind(this),stopListening:this.stopListening.bind(this),lastSet:new u(n)},this.update=this.update.bind(this),this.contextHandlers=new WeakMap,this.teardown=null,this.binder={},"production"!==process.env.NODE_ENV&&(o.assignSymbols(this,{"can.getName":function(){return o.getName(this.constructor)+"<"+o.getName(e)+">"}}),Object.defineProperty(this.update,"name",{value:o.getName(this)+".update"}),o.assignSymbols(this._valueOptions.lastSet,{"can.getName":function(){return o.getName(this.constructor)+"::lastSet<"+o.getName(e)+">"}}))}function d(e,t,n,r){s.off.call(e,t,r,n)}f.prototype=Object.create(c.prototype),o.assignMap(f.prototype,{constructor:f,listenTo:function(e,t,n,r){o.isPrimitive(e)&&(n=t,t=e,e=this.context),"function"==typeof t&&(n=t,t=void 0);var a=this;"production"!==process.env.NODE_ENV&&(n.name||Object.defineProperty(n,"name",{value:(e?o.getName(e):"")+(t?".on('"+t+"',handler)":".on(handler)")+"::"+o.getName(this)}));var i=n.bind(this.context);i[l]=function(){var e=new Set;return e.add(a),{valueDependencies:e}},this.contextHandlers.set(n,i),s.listenTo.call(this.binder,e,t,i,r||"notify")},stopListening:function(){var e=this.binder[r.for("can.meta")],t=e&&e.listenHandlers;if(t){var n=s.stopListeningArgumentsToKeys.call({context:this.context,defaultQueue:"notify"});t.delete(n,d)}return this},resolve:function(e){if(this._value=e,this.isBinding)return this.lastValue=this._value,e;if(this._value!==this.lastValue){var t={};"production"!==process.env.NODE_ENV&&(t={log:[o.getName(this.update)],reasonLog:[o.getName(this),"resolved with",e]}),i.batch.start(),i.deriveQueue.enqueue(this.update,this,[],t),i.batch.stop()}return e},update:function(){if(this.lastValue!==this._value){var e=this.lastValue;this.lastValue=this._value,"production"!==process.env.NODE_ENV&&"function"==typeof this._log&&this._log(e,this._value),i.enqueueByQueue(this.handlers.getNode([]),this,[this._value,e])}},activate:function(){this.isBinding=!0,this.teardown=this.resolver.call(this.context,this._valueOptions),this.isBinding=!1},onUnbound:function(){this.bound=!1,s.stopListening.call(this.binder),null!=this.teardown&&(this.teardown(),this.teardown=null)},set:function(e){this._valueOptions.lastSet.set(e)},get:function(){if(a.isRecording()&&(a.add(this),this.bound||this.onBound()),!0===this.bound)return this._value;var e=function(){};this.on(e);var t=this._value;return this.off(e),t},hasDependencies:function(){var e=!1;if(this.bound){var t=this.binder[r.for("can.meta")];e=!!(t&&t.listenHandlers).size()}return e},getValueDependencies:function(){if(this.bound){var e=this.binder[r.for("can.meta")],t=e&&e.listenHandlers,a=new Map,i=new Set;if(t&&(o.each(t.root,function(e,r){o.each(e,function(e,t){if(void 0===t)i.add(r);else{var n=a.get(r);n||(n=new Set,a.set(r,n)),n.add(t)}})}),i.size||a.size)){var n={};return a.size&&(n.keyDependencies=a),i.size&&(n.valueDependencies=i),n}}}}),o.assignSymbols(f.prototype,{"can.getValue":f.prototype.get,"can.setValue":f.prototype.set,"can.isMapLike":!1,"can.getPriority":function(){return this.priority||0},"can.setPriority":function(e){this.priority=e},"can.valueHasDependencies":f.prototype.hasDependencies,"can.getValueDependencies":f.prototype.getValueDependencies}),n.exports=f}),define("can-event-queue/type/type",["require","exports","module","can-reflect","can-symbol","can-key-tree","can-queues"],function(e,t,n){"use strict";var r=e("can-reflect"),a=e("can-symbol"),i=e("can-key-tree"),o=e("can-queues"),s=a.for("can.meta");function c(e,t){t.lifecycleHandlers||(t.lifecycleHandlers=new i([Object,Array])),t.instancePatchesHandlers||(t.instancePatchesHandlers=new i([Object,Array]))}function u(e){var t=e[s];return t||(t={},r.setKeyValue(e,s,t)),c(0,t),t}var l={};function f(e,t,n){l["can.on"+e]=function(e,t){u(this)[n].add([t||"mutate",e])},l["can.off"+e]=function(e,t){u(this)[n].delete([t||"mutate",e])},l["can."+t]=function(e,t){o.enqueueByQueue(u(this)[n].getNode([]),this,[e,t])}}function d(e){return r.assignSymbols(e,l)}f("InstancePatches","dispatchInstanceOnPatches","instancePatchesHandlers"),f("InstanceBoundChange","dispatchInstanceBoundChange","lifecycleHandlers"),Object.defineProperty(d,"addHandlers",{enumerable:!1,value:c}),n.exports=d}),define("can-string-to-any",function(e,t,n){"use strict";n.exports=function(e){switch(e){case"NaN":case"Infinity":return+e;case"null":return null;case"undefined":return;case"true":case"false":return"true"===e;default:var t=+e;return isNaN(t)?e:t}}}),define("can-data-types/maybe-boolean/maybe-boolean",["require","exports","module","can-reflect"],function(e,t,n){"use strict";var r=e("can-reflect");function a(e){return null==e?e:!("false"===e||"0"===e||!e)}n.exports=r.assignSymbols(a,{"can.new":a,"can.getSchema":function(){return{type:"Or",values:[!0,!1,void 0,null]}},"can.getName":function(){return"MaybeBoolean"},"can.isMember":function(e){return null==e||"boolean"==typeof e}})}),define("can-data-types/maybe-date/maybe-date",["require","exports","module","can-reflect"],function(e,t,n){"use strict";var r=e("can-reflect");function a(e){var t=typeof e;return"string"===t?(e=Date.parse(e),isNaN(e)?null:new Date(e)):"number"===t?new Date(e):e}function i(e){var t=a(this.setValue=e);this.value=null==t?t:t.getTime()}i.prototype.valueOf=function(){return this.value},r.assignSymbols(i.prototype,{"can.serialize":function(){return this.setValue}}),n.exports=r.assignSymbols(a,{"can.new":a,"can.getSchema":function(){return{type:"Or",values:[Date,void 0,null]}},"can.ComparisonSetType":i,"can.getName":function(){return"MaybeDate"},"can.isMember":function(e){return null==e||e instanceof Date}})}),define("can-data-types/maybe-number/maybe-number",["require","exports","module","can-reflect"],function(e,t,n){"use strict";var r=e("can-reflect");function a(e){return null==e?e:+e}n.exports=r.assignSymbols(a,{"can.new":a,"can.getSchema":function(){return{type:"Or",values:[Number,void 0,null]}},"can.getName":function(){return"MaybeNumber"},"can.isMember":function(e){return null==e||"number"==typeof e}})}),define("can-data-types/maybe-string/maybe-string",["require","exports","module","can-reflect"],function(e,t,n){"use strict";var r=e("can-reflect");function a(e){return null==e?e:""+e}n.exports=r.assignSymbols(a,{"can.new":a,"can.getSchema":function(){return{type:"Or",values:[String,void 0,null]}},"can.getName":function(){return"MaybeString"},"can.isMember":function(e){return null==e||"string"==typeof e}})}),define("can-define",["require","exports","module","can-namespace","can-symbol","can-reflect","can-observation","can-observation-recorder","can-simple-observable/async/async","can-simple-observable/settable/settable","can-simple-observable/resolver/resolver","can-event-queue/map/map","can-event-queue/type/type","can-queues","can-assign","can-log/dev/dev","can-string-to-any","can-define-lazy-value","can-data-types/maybe-boolean/maybe-boolean","can-data-types/maybe-date/maybe-date","can-data-types/maybe-number/maybe-number","can-data-types/maybe-string/maybe-string"],function(e,t,n){"use strict";var f,v,g,y,d,c,r=e("can-namespace"),p=e("can-symbol"),m=e("can-reflect"),o=e("can-observation"),b=e("can-observation-recorder"),s=e("can-simple-observable/async/async"),u=e("can-simple-observable/settable/settable"),i=e("can-simple-observable/resolver/resolver"),a=e("can-event-queue/map/map"),l=e("can-event-queue/type/type"),h=e("can-queues"),w=e("can-assign"),_=e("can-log/dev/dev"),x=e("can-string-to-any"),E=e("can-define-lazy-value"),k=e("can-data-types/maybe-boolean/maybe-boolean"),O=e("can-data-types/maybe-date/maybe-date"),N=e("can-data-types/maybe-number/maybe-number"),L=e("can-data-types/maybe-string/maybe-string"),V=p.for("can.new"),D=p.for("can.serialize");function S(e){return e&&(!0===e.canDefineType||e[V])}var P=b.ignore(m.getValue.bind(m)),M=Object.defineProperty;function q(e,t,n){Object.defineProperty(e,t,{configurable:!0,enumerable:!1,writable:!0,value:n})}function C(e,t,n,r){void 0===t.value||"function"==typeof t.value&&0!==t.value.length||("production"!==process.env.NODE_ENV&&n&&_.warn("can-define: Change the 'value' definition for "+m.getName(r)+"."+e+" to 'default'."),t.default=t.value,delete t.value),void 0!==t.Value&&("production"!==process.env.NODE_ENV&&n&&_.warn("can-define: Change the 'Value' definition for "+m.getName(r)+"."+e+" to 'Default'."),t.Default=t.Value,delete t.Value)}function j(e){return"function"==typeof e.value&&e.value.length}"production"!==process.env.NODE_ENV&&(M=function(e,t,n){return n.get&&Object.defineProperty(n.get,"name",{value:"get "+m.getName(e)+"."+t,writable:!0,configurable:!0}),n.set&&Object.defineProperty(n.set,"name",{value:"set "+m.getName(e)+"."+t,configurable:!0}),Object.defineProperty(e,t,n)}),n.exports=v=r.define=function(n,e,t){var r,a,i,o,s=Object.create(t?t.dataInitializers:null),c=Object.create(t?t.computedInitializers:null),u=d(e,t,n);if(u.dataInitializers=s,u.computedInitializers=c,m.eachKey(u.definitions,function(e,t){v.property(n,t,e,s,c,u.defaultDefinition)}),n.hasOwnProperty("_data"))for(r in s)E(n._data,r,s[r].bind(n),!0);else E(n,"_data",function(){var e={};for(var t in s)E(e,t,s[t].bind(this),!0);return e});if(n.hasOwnProperty("_computed"))for(r in c)E(n._computed,r,c[r].bind(n));else E(n,"_computed",function(){var e=Object.create(null);for(var t in c)E(e,t,c[t].bind(this));return e});(a=f,i=Object.getOwnPropertyNames(a),o="getOwnPropertySymbols"in Object?Object.getOwnPropertySymbols(a):[],i.concat(o)).forEach(function(e){Object.defineProperty(n,e,{enumerable:!1,value:f[e],configurable:!0,writable:!0})}),Object.defineProperty(n,"_define",{enumerable:!1,value:u,configurable:!0,writable:!0});var l=p.iterator||p.for("iterator");return n[l]||q(n,l,function(){return new v.Iterator(this)}),u};v.extensions=function(){},v.property=function(e,t,n,r,a,i){var o=v.extensions.apply(this,arguments);o&&(n=y(t,o,i||{},e));var s=n.type;if("production"!==process.env.NODE_ENV&&s&&m.isConstructorLike(s)&&!S(s)&&_.warn("can-define: the definition for "+m.getName(e)+"."+t+' uses a constructor for "type". Did you mean "Type"?'),s&&function(e){for(var t in e)if("type"!==t)return!1;return!0}(n)&&s===v.types["*"])M(e,t,{get:g.get.data(t),set:g.set.events(t,g.get.data(t),g.set.data(t),g.eventType.data(t)),enumerable:!0,configurable:!0});else{n.type=s;var c,u=n.get||j(n)?"computed":"data",l=g.read[u](t),f=g.get[u](t),d=g.set[u](t);"production"!==process.env.NODE_ENV&&(n.get&&Object.defineProperty(n.get,"name",{value:m.getName(e)+"'s "+t+" getter",configurable:!0}),n.set&&Object.defineProperty(n.set,"name",{value:m.getName(e)+"'s "+t+" setter",configurable:!0}),j(n)&&Object.defineProperty(n.value,"name",{value:m.getName(e)+"'s "+t+" value",configurable:!0}));var p=function(e){return e};n.Type&&(p=g.set.Type(t,n.Type,p)),s&&(p=g.set.type(t,s,p));var h=g.set.events(t,l,d,g.eventType[u](t));j(n)?a[t]=g.valueResolver(t,n,p):void 0===n.default&&void 0===n.Default||("production"!==process.env.NODE_ENV&&(null!==n.default&&"object"==typeof n.default&&_.warn("can-define: The default value for "+m.getName(e)+"."+t+" is set to an object. This will be shared by all instances of the DefineMap. Use a function that returns the object instead."),n.default&&m.isConstructorLike(n.default)&&_.warn('can-define: The "default" for '+m.getName(e)+"."+t+' is set to a constructor. Did you mean "Default" instead?')),c=b.ignore(g.get.defaultValue(t,n,p,h))),n.get?a[t]=g.compute(t,n.get,c):c&&(r[t]=c),n.get&&n.set?d=g.set.setter(t,n.set,g.read.lastSet(t),d,!0):n.set?d=g.set.setter(t,n.set,l,h,!1):"data"===u?d=h:n.get&&n.get.length<1&&(d=function(){"production"!==process.env.NODE_ENV&&_.warn("can-define: Set value for property "+m.getName(e)+"."+t+" ignored, as its definition has a zero-argument getter and no setter")}),s&&(d=g.set.type(t,s,d)),n.Type&&(d=g.set.Type(t,n.Type,d)),M(e,t,{get:f,set:d,enumerable:"serialize"in n?!!n.serialize:!n.get,configurable:!0})}},v.makeDefineInstanceKey=function(a){a[p.for("can.defineInstanceKey")]=function(e,t){var n=this.prototype._define;"object"==typeof t&&C(e,t,!1,this);var r=c(e,t,n.defaultDefinition,this);r&&"object"==typeof r?(v.property(a.prototype,e,r,n.dataInitializers,n.computedInitializers,n.defaultDefinition),n.definitions[e]=r):n.methods[e]=r,this.prototype.dispatch({type:"can.keys",target:this.prototype})}},v.Constructor=function(e,t){var n=function(e){Object.defineProperty(this,"__inSetup",{configurable:!0,enumerable:!1,value:!0,writable:!0}),v.setup.call(this,e,t),this.__inSetup=!1},r=v(n.prototype,e);return l(n),v.makeDefineInstanceKey(n,r),n},g={computeObj:function(n,r,e){var a={oldValue:void 0,compute:e,count:0,handler:function(e){var t=a.oldValue;a.oldValue=e,n.dispatch({type:r,target:n},[e,t])}};return a},valueResolver:function(n,r,e){var a=g.get.defaultValue(n,r,e);return function(){var e=a.call(this),t=g.computeObj(this,n,new i(r.value,this,e));return"production"!==process.env.NODE_ENV&&Object.defineProperty(t.handler,"name",{value:m.getName(r.value).replace("value","event emitter")}),t}},compute:function(r,a,i){return function(){var e,t,n=i&&i.call(this);return e=0===a.length?new o(a,this):1===a.length?new u(a,this,n):new s(a,this,n),t=g.computeObj(this,r,e),"production"!==process.env.NODE_ENV&&Object.defineProperty(t.handler,"name",{value:m.getName(a).replace("getter","event emitter")}),t}},set:{data:function(t){return function(e){this._data[t]=e}},computed:function(t){return function(e){m.setValue(this._computed[t].compute,e)}},events:function(r,a,i,e){return function(e){if(this.__inSetup)i.call(this,e);else{var t,n=a.call(this);if(e!==n)i.call(this,e),t={patches:[{type:"set",key:r,value:e}],type:r,target:this},"production"!==process.env.NODE_ENV&&(t.reasonLog=[m.getName(this)+"'s",r,"changed to",e,"from",n]),this.dispatch(t,[e,n])}}},setter:function(o,s,c,u,l){return function(e){var t,n=this;h.batch.start();var r=!1,a=c.call(this),i=s.call(this,e,function(e){u.call(n,e),r=!0,"production"!==process.env.NODE_ENV&&clearTimeout(t)},a);if(r)h.batch.stop();else if(l)if(void 0!==i)a!==i&&u.call(this,i),h.batch.stop();else{if(0===s.length)return u.call(this,e),void h.batch.stop();if(1!==s.length)return"production"!==process.env.NODE_ENV&&(t=setTimeout(function(){_.warn('can-define: Setter "'+m.getName(n)+"."+o+'" did not return a value or call the setter callback.')},_.warnTimeout)),void h.batch.stop();h.batch.stop()}else if(void 0!==i)u.call(this,i),h.batch.stop();else{if(0===s.length)return u.call(this,e),void h.batch.stop();if(1!==s.length)return"production"!==process.env.NODE_ENV&&(t=setTimeout(function(){_.warn('can/map/setter.js: Setter "'+m.getName(n)+"."+o+'" did not return a value or call the setter callback.')},_.warnTimeout)),void h.batch.stop();u.call(this,void 0),h.batch.stop()}}},type:function(t,n,r){function e(e){return r.call(this,n.call(this,e,t))}return S(n)?n.canDefineType?e:function(e){return r.call(this,m.convert(e,n))}:"object"==typeof n?g.set.Type(t,n,r):e},Type:function(e,t,n){return Array.isArray(t)&&v.DefineList?t=v.DefineList.extend({"#":t[0]}):"object"==typeof t&&(t=v.DefineMap?v.DefineMap.extend(t):v.Constructor(t)),function(e){return e instanceof t||null==e?n.call(this,e):n.call(this,new t(e))}}},eventType:{data:function(n){return function(e,t){return void 0!==t||this._data.hasOwnProperty(n)?"set":"add"}},computed:function(){return function(){return"set"}}},read:{data:function(e){return function(){return this._data[e]}},computed:function(e){return function(){return m.getValue(this._computed[e].compute)}},lastSet:function(t){return function(){var e=this._computed[t].compute;if(e.lastSetValue)return m.getValue(e.lastSetValue)}}},get:{defaultValue:function(a,i,o,s){return function(){var e=i.default;if(void 0!==e)"function"==typeof e&&(e=e.call(this)),e=o.call(this,e);else{var t=i.Default;t&&(e=o.call(this,new t))}if(i.set){var n,r=!0;return g.set.setter(a,i.set,function(){},function(e){r?n=e:s.call(this,e)},i.get).call(this,e),r=!1,n}return e}},data:function(e){return function(){return this.__inSetup||b.add(this,e),this._data[e]}},computed:function(n){return function(e){var t=this._computed[n].compute;return b.isRecording()&&(b.add(this,n),m.isBound(t)||o.temporarilyBind(t)),P(t)}}}},v.behaviors=["get","set","value","Value","type","Type","serialize"];function T(e,t){var n=e._computed&&e._computed[t];n&&n.compute&&(n.count?n.count++:(n.count=1,m.onValue(n.compute,n.handler,"notify"),n.oldValue=P(n.compute)))}function I(e,t){var n=e._computed&&e._computed[t];n&&(1===n.count?(n.count=0,m.offValue(n.compute,n.handler,"notify")):n.count--)}y=function(e,t,n,r){var a={};if(m.eachKey(t,function(e,t){!function(e,t,n){if("enumerable"===t)e.serialize=!!n;else if("type"===t){var r=n;"string"==typeof r&&("object"!=typeof(r=v.types[r])||S(r)||(w(e,r),r=r[t])),void 0!==r&&(e[t]=r)}else e[t]=n}(a,t,e)}),m.eachKey(n,function(e,t){void 0===a[t]&&"type"!==t&&"Type"!==t&&(a[t]=e)}),t.Type){var i=t.Type,o=i[D];o&&(a.serialize=function(e){return o.call(e)}),i[V]&&(a.type=i,delete a.Type)}if("string"!=typeof t.type){if(!a.type&&!a.Type){var s=m.assignMap({},n);a=m.assignMap(s,a)}0===m.size(a)&&(a.type=v.types["*"])}return C(e,a,!0,r),a},c=function(e,t,n,r){var a;return"string"==typeof t?a={type:t}:t&&(t[D]||t[V])?a={Type:t}:"function"==typeof t?m.isConstructorLike(t)&&(a={Type:t}):Array.isArray(t)?a={Type:t}:m.isPlainObject(t)&&(a=t),a?y(e,a,n,r):t},d=function(e,t,a){var i,o=Object.create(t?t.definitions:null),s={},n=e["*"];return i=n?(delete e["*"],c("*",n,{})):Object.create(null),function(e,t){for(var n in e)e.hasOwnProperty(n)&&t.call(e,n,Object.getOwnPropertyDescriptor(e,n))}(e,function(e,t){var n;if(n=t.get||t.set?{get:t.get,set:t.set}:t.value,"constructor"!==e){var r=c(e,n,i,a);r&&"object"==typeof r&&0<m.size(r)?o[e]=r:"function"==typeof r?s[e]=r:void 0!==r&&"production"!==process.env.NODE_ENV&&_.error(m.getName(a)+"."+e+" does not match a supported propDefinition. See: https://canjs.com/doc/can-define.types.propDefinition.html")}else s[e]=n}),n&&q(e,"*",n),{definitions:o,methods:s,defaultDefinition:i}},f=a({});var A=p.for("can.meta");w(f,{_eventSetup:function(){},_eventTeardown:function(){},addEventListener:function(e,t,n){return T(this,e),a.addEventListener.apply(this,arguments)},removeEventListener:function(e,t){return I(this,e),a.removeEventListener.apply(this,arguments)}}),f.on=f.bind=f.addEventListener,f.off=f.unbind=f.removeEventListener;var K=p.for("can.onKeyValue"),R=p.for("can.offKeyValue");m.assignSymbols(f,{"can.onKeyValue":function(e){return T(this,e),a[K].apply(this,arguments)},"can.offKeyValue":function(e){return I(this,e),a[R].apply(this,arguments)}}),delete f.one,v.setup=function(e,t){Object.defineProperty(this,"constructor",{value:this.constructor,enumerable:!1,writable:!1}),Object.defineProperty(this,A,{value:Object.create(null),enumerable:!1,writable:!1});var n=this._define.definitions,r=Object.create(null),a=this;m.eachKey(e,function(e,t){void 0!==n[t]?a[t]=e:v.expando(a,t,e)}),0<m.size(r)&&q(this,"_instanceDefinitions",r),"production"!==process.env.NODE_ENV&&(this._data,this._computed,!1!==t&&Object.seal(this))};var B=function(e){return e};v.expando=function(e,t,n){if(v._specialKeys[t])return!0;var r=e._define.definitions;if(!r||!r[t]){var a=e._instanceDefinitions;if(!a){if(Object.isSealed(e))return;Object.defineProperty(e,"_instanceDefinitions",{configurable:!0,enumerable:!1,writable:!0,value:{}}),a=e._instanceDefinitions}if(!a[t]){var i=e._define.defaultDefinition||{type:v.types.observable};return v.property(e,t,i,{},{}),i.type?e._data[t]=v.make.set.type(t,i.type,B).call(e,n):e._data[t]=v.types.observable(n),a[t]=i,e.__inSetup||(h.batch.start(),e.dispatch({type:"can.keys",target:e}),void 0!==e._data[t]&&e.dispatch({type:t,target:e,patches:[{type:"add",key:t,value:e._data[t]}]},[e._data[t],void 0]),h.batch.stop()),!0}}},v.replaceWith=E,v.eventsProto=f,v.defineConfigurableAndNotEnumerable=q,v.make=g,v.getDefinitionOrMethod=c,v._specialKeys={_data:!0,_computed:!0};var F={};function H(e){return m.isValueLike(e)&&m.isObservableLike(e)}v.makeSimpleGetterSetter=function(e){if(void 0===F[e]){var t=g.set.events(e,g.get.data(e),g.set.data(e),g.eventType.data(e));F[e]={get:g.get.data(e),set:function(e){return t.call(this,v.types.observable(e))},enumerable:!0,configurable:!0}}return F[e]},v.Iterator=function(e){this.obj=e,this.definitions=Object.keys(e._define.definitions),this.instanceDefinitions=e._instanceDefinitions?Object.keys(e._instanceDefinitions):Object.keys(e),this.hasGet="function"==typeof e.get},v.Iterator.prototype.next=function(){var e;if(this.definitions.length){if(e=this.definitions.shift(),this.obj._define.definitions[e].get)return this.next()}else{if(!this.instanceDefinitions.length)return{value:void 0,done:!0};e=this.instanceDefinitions.shift()}return{value:[e,this.hasGet?this.obj.get(e):this.obj[e]],done:!1}},v.types={date:O,number:N,boolean:k,observable:function(e){return Array.isArray(e)&&v.DefineList?e=new v.DefineList(e):m.isPlainObject(e)&&v.DefineMap&&(e=new v.DefineMap(e)),e},stringOrObservable:function(e){return Array.isArray(e)?new v.DefaultList(e):m.isPlainObject(e)?new v.DefaultMap(e):m.convert(e,v.types.string)},htmlbool:function(e){return""===e||!!x(e)},"*":function(e){return e},any:function(e){return e},string:L,compute:{set:function(e,t,n,r){return H(e)?e:H(r)?(m.setValue(r,e),r):e},get:function(e){return H(e)?m.getValue(e):e}}},v.updateSchemaKeys=function(e,t){for(var n in t){var r=t[n];!1!==r.serialize&&(r.Type?e.keys[n]=r.Type:r.type?e.keys[n]=r.type:e.keys[n]=function(e){return e},!0===t[n].identity&&e.identity.push(n))}return e}}),define("can-string",function(e,t,n){"use strict";var r=/\=\=/,a=/([A-Z]+)([A-Z][a-z])/g,i=/([a-z\d])([A-Z])/g,o=/([a-z\d])([A-Z])/g,s=/"/g,c=/'/g,u=/-+(.)?/g,l=/[a-z][A-Z]/g,f=function(e){return""+(null==e||isNaN(e)&&""+e=="NaN"?"":e)},d={esc:function(e){return f(e).replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(s,"&#34;").replace(c,"&#39;")},capitalize:function(e){return e.charAt(0).toUpperCase()+e.slice(1)},camelize:function(e){return f(e).replace(u,function(e,t){return t?t.toUpperCase():""})},hyphenate:function(e){return f(e).replace(l,function(e){return e.charAt(0)+"-"+e.charAt(1).toLowerCase()})},underscore:function(e){return e.replace(r,"/").replace(a,"$1_$2").replace(i,"$1_$2").replace(o,"_").toLowerCase()},undHash:/_|-/};n.exports=d}),define("can-construct",["require","exports","module","can-reflect","can-log/dev/dev","can-namespace","can-string"],function(e,t,n){"use strict";var g=e("can-reflect"),y=e("can-log/dev/dev"),r=e("can-namespace");if("production"!==process.env.NODE_ENV)var m=e("can-string"),b={abstract:!0,boolean:!0,break:!0,byte:!0,case:!0,catch:!0,char:!0,class:!0,const:!0,continue:!0,debugger:!0,default:!0,delete:!0,do:!0,double:!0,else:!0,enum:!0,export:!0,extends:!0,false:!0,final:!0,finally:!0,float:!0,for:!0,function:!0,goto:!0,if:!0,implements:!0,import:!0,in:!0,instanceof:!0,int:!0,interface:!0,let:!0,long:!0,native:!0,new:!0,null:!0,package:!0,private:!0,protected:!0,public:!0,return:!0,short:!0,static:!0,super:!0,switch:!0,synchronized:!0,this:!0,throw:!0,throws:!0,transient:!0,true:!0,try:!0,typeof:!0,var:!0,void:!0,volatile:!0,while:!0,with:!0},w=/[^A-Z0-9_]/gi;var a,_=0;if("production"!==process.env.NODE_ENV)var x=(a={},function(e,t){return(e in a?a[e]:a[e]=new Function("__","function "+e+"(){return __.apply(this,arguments)};return "+e))(t)});var i,E=function(){if(arguments.length)return E.extend.apply(E,arguments)};try{Object.getOwnPropertyDescriptor({}),i=!0}catch(e){i=!1}var k=function(e,t,n){Object.defineProperty(e,t,{configurable:!0,writable:!0,enumerable:!1,value:n})};g.assignMap(E,{constructorExtends:!0,newInstance:function(){var e,t=this.instance();if(t.setup){if(Object.defineProperty(t,"__inSetup",{configurable:!0,enumerable:!1,value:!0,writable:!0}),(e=t.setup.apply(t,arguments))instanceof E.ReturnValue)return e.value;t.__inSetup=!1}return t.init&&t.init.apply(t,e||arguments),t},_inherit:i?function(e,t,n){var r,a,i,o;for(var s in n=n||e,e)a=e,i=s,(r=(o=Object.getOwnPropertyDescriptor(a,i))&&(o.get||o.set)?o:null)?this._defineProperty(n,t,s,r):E._overwrite(n,t,s,e[s])}:function(e,t,n){for(var r in n=n||e,e)E._overwrite(n,t,r,e[r])},_defineProperty:function(e,t,n,r){Object.defineProperty(e,n,r)},_overwrite:function(e,t,n,r){Object.defineProperty(e,n,{value:r,configurable:!0,enumerable:!0,writable:!0})},setup:function(e){var t=g.assignDeepMap({},e.defaults);this.defaults=g.assignDeepMap(t,this.defaults)},instance:function(){_=1;var e=new this;return _=0,e},extend:function(e,t,n){var r=e,a=t,i=n;"string"!=typeof r&&(i=a,a=r,r=null),i||(i=a,a=null),i=i||{};var o,s,c=this,u=this.prototype;s=this.instance(),E._inherit(i,u,s),r||(a&&a.shortName?r=a.shortName:this.shortName&&(r=this.shortName));var l=r?r.replace(w,"_"):"Constructor";function f(){if(!_)return"production"!==process.env.NODE_ENV&&(!this||this.constructor!==o&&arguments.length&&o.constructorExtends)&&y.warn("can/construct/construct.js: extending a Construct without calling extend"),this&&this.constructor===o||!arguments.length||!o.constructorExtends?o.newInstance.apply(o,arguments):o.extend.apply(o,arguments)}for(var d in"production"!==process.env.NODE_ENV&&b[l]&&(l=m.capitalize(l)),o="function"==typeof x?x(l,f):function(){return f.apply(this,arguments)},c)c.hasOwnProperty(d)&&(o[d]=c[d]);if(E._inherit(a,c,o),g.assignMap(o,{constructor:o,prototype:s}),void 0!==r){if(Object.getOwnPropertyDescriptor){var p=Object.getOwnPropertyDescriptor(o,"name");p&&!p.configurable||Object.defineProperty(o,"name",{writable:!0,value:r,configurable:!0})}o.shortName=r}k(o.prototype,"constructor",o);var h=[c].concat(Array.prototype.slice.call(arguments)),v=o.setup.apply(o,h);return o.init&&o.init.apply(o,v||h),o},ReturnValue:function(e){this.value=e}}),k(E.prototype,"setup",function(){}),k(E.prototype,"init",function(){}),n.exports=r.Construct=E}),define("can-define/ensure-meta",["require","exports","module","can-symbol","can-reflect"],function(e,t,n){"use strict";var r=e("can-symbol"),a=e("can-reflect");n.exports=function(e){var t=r.for("can.meta"),n=e[t];return n||(n={},a.setKeyValue(e,t,n)),n}}),define("can-define/define-helpers/define-helpers",["require","exports","module","can-define","can-reflect","can-queues","can-log/dev/dev","can-define/ensure-meta"],function(e,t,n){"use strict";var r=e("can-define"),s=e("can-reflect"),a=e("can-queues"),c=e("can-log/dev/dev"),u=e("can-define/ensure-meta"),i={defineExpando:r.expando,reflectSerialize:function(r){var a=this._define.definitions,i=this._define.defaultDefinition;return this.forEach(function(e,t){var n=a[t];void 0!==(e=n&&"function"==typeof n.serialize?n.serialize.call(this,e,t):i&&"function"==typeof i.serialize?i.serialize.call(this,e,t):s.serialize(e))&&(r[t]=e)},this),r},reflectUnwrap:function(n){return this.forEach(function(e,t){void 0!==e&&(n[t]=s.unwrap(e))}),n},log:function(r){var a=this,i=function(e){return"string"==typeof e?JSON.stringify(e):e},e=u(a),o=e.allowedLogKeysSet||new Set;e.allowedLogKeysSet=o,r&&o.add(r),e._log=function(e,t){var n=e.type;"can.onPatches"===n||r&&!o.has(n)||"can.keys"===n||r&&!o.has(n)||("add"===n||"remove"===n?c.log(s.getName(a),"\n how ",i(n),"\n what ",i(t[0]),"\n index ",i(t[1])):c.log(s.getName(a),"\n key ",i(n),"\n is ",i(t[0]),"\n was ",i(t[1])))}},deleteKey:function(e){var t=this._instanceDefinitions;if(t&&Object.prototype.hasOwnProperty.call(t,e)&&!Object.isSealed(this)){delete t[e],a.batch.start(),this.dispatch({type:"can.keys",target:this});var n=this._data[e];void 0!==n&&(delete this._data[e],this.dispatch({type:e,target:this,patches:[{type:"delete",key:e}]},[void 0,n])),a.batch.stop()}else this.set(e,void 0);return this}};n.exports=i}),define("can-define/map/map",["require","exports","module","can-construct","can-define","can-define/define-helpers/define-helpers","can-observation-recorder","can-namespace","can-log","can-log/dev/dev","can-reflect","can-symbol","can-queues","can-event-queue/type/type"],function(e,t,n){"use strict";var r=e("can-construct"),i=e("can-define"),a=e("can-define/define-helpers/define-helpers"),o=e("can-observation-recorder"),s=e("can-namespace"),c=e("can-log"),u=e("can-log/dev/dev"),l=e("can-reflect"),f=e("can-symbol"),d=e("can-queues"),p=e("can-event-queue/type/type"),h=function(e){var t=[];for(var n in e){var r=e[n];"object"==typeof r&&("serialize"in r?!r.serialize:r.get)||t.push(n)}return t};function v(e){d.batch.start(),l.assignDeepMap(this,e||{}),d.batch.stop()}function g(e){d.batch.start(),l.updateDeepMap(this,e||{}),d.batch.stop()}function y(e,t){a.defineExpando(this,e,t)||(this[e]=t)}function m(e){var t=this[e];return void 0!==t||e in this||Object.isSealed(this)?t:(o.add(this,e),this[e])}var b=f.for("can.getSchema");function w(){var e=this.prototype._define,t=e?e.definitions:{};return i.updateSchemaKeys({type:"map",identity:[],keys:{}},t)}var _,x,E,k=function(e){i.setup.call(this,e||{},this.constructor.seal)},O=r.extend("DefineMap",{setup:function(e){var t,n=this.prototype;if(O){var r=i(n,n,e.prototype._define);for(t in i.makeDefineInstanceKey(this,r),p(this),O.prototype)i.defineConfigurableAndNotEnumerable(n,t,n[t]);n.setup===O.prototype.setup&&i.defineConfigurableAndNotEnumerable(n,"setup",k);var a=Object.getOwnPropertyDescriptor(n,"_computed").get;Object.defineProperty(n,"_computed",{configurable:!0,enumerable:!1,get:function(){if(this!==n)return a.call(this,arguments)}})}else for(t in n)i.defineConfigurableAndNotEnumerable(n,t,n[t]);i.defineConfigurableAndNotEnumerable(n,"constructor",this),this[b]=w}},{setup:function(e,t){this._define||(Object.defineProperty(this,"_define",{enumerable:!1,value:{definitions:{}}}),Object.defineProperty(this,"_data",{enumerable:!1,value:{}})),i.setup.call(this,e||{},!0===t)},get:function(e){return e?m.call(this,e):l.unwrap(this,Map)},set:function(e,t){return"object"==typeof e?("production"!==process.env.NODE_ENV&&u.warn("can-define/map/map.prototype.set is deprecated; please use can-define/map/map.prototype.assign or can-define/map/map.prototype.update instead"),!0===t?g.call(this,e):v.call(this,e)):y.call(this,e,t),this},assignDeep:function(e){return v.call(this,e),this},updateDeep:function(e){return g.call(this,e),this},assign:function(e){return function(e){d.batch.start(),l.assignMap(this,e||{}),d.batch.stop()}.call(this,e),this},update:function(e){return function(e){d.batch.start(),l.updateMap(this,e||{}),d.batch.stop()}.call(this,e),this},serialize:function(){return l.serialize(this,Map)},deleteKey:a.deleteKey,forEach:(_=function(e,t,n){return l.eachKey(e,t,n)},x=o.ignore(_),function(e,t,n){return!1===n?x(this,e,t):_(this,e,t)}),"*":{type:i.types.observable}}),N={"can.isMapLike":!0,"can.isListLike":!1,"can.isValueLike":!1,"can.getKeyValue":m,"can.setKeyValue":y,"can.deleteKeyValue":a.deleteKey,"can.getOwnKeys":function(){var e=l.getOwnEnumerableKeys(this);if(this._computed)for(var t,n=l.getOwnKeys(this._computed),r=0;r<n.length;r++)t=n[r],e.indexOf(t)<0&&e.push(t);return e},"can.getOwnEnumerableKeys":function(){return o.add(this,"can.keys"),o.add(Object.getPrototypeOf(this),"can.keys"),h(this._define.definitions).concat(h(this._instanceDefinitions))},"can.hasOwnKey":function(e){return Object.hasOwnProperty.call(this._define.definitions,e)||void 0!==this._instanceDefinitions&&Object.hasOwnProperty.call(this._instanceDefinitions,e)},"can.hasKey":function(e){return e in this._define.definitions||void 0!==this._instanceDefinitions&&e in this._instanceDefinitions},"can.assignDeep":v,"can.updateDeep":g,"can.unwrap":a.reflectUnwrap,"can.serialize":a.reflectSerialize,"can.keyHasDependencies":function(e){return!!(this._computed&&this._computed[e]&&this._computed[e].compute)},"can.getKeyDependencies":function(e){var t;return this._computed&&this._computed[e]&&this._computed[e].compute&&((t={}).valueDependencies=new Set,t.valueDependencies.add(this._computed[e].compute)),t}};for(var L in"production"!==process.env.NODE_ENV&&(N["can.getName"]=function(){return l.getName(this.constructor)+"{}"}),l.assignSymbols(O.prototype,N),l.setKeyValue(O.prototype,f.iterator,function(){return new i.Iterator(this)}),i.eventsProto)O[L]=i.eventsProto[L],Object.defineProperty(O.prototype,L,{enumerable:!1,value:i.eventsProto[L],writable:!0});("getOwnPropertySymbols"in Object?Object.getOwnPropertySymbols(i.eventsProto):(E=i.eventsProto,Object.getOwnPropertyNames(E).filter(function(e){return 0===e.indexOf("@@symbol")}))).forEach(function(e){Object.defineProperty(O.prototype,e,{configurable:!0,enumerable:!1,value:i.eventsProto[e],writable:!0})}),"production"!==process.env.NODE_ENV&&i.defineConfigurableAndNotEnumerable(O.prototype,"log",a.log),i.DefineMap=O,Object.defineProperty(O.prototype,"toObject",{enumerable:!1,writable:!0,value:function(){return c.warn("Use DefineMap::get instead of DefineMap::toObject"),this.get()}}),n.exports=s.DefineMap=O}),define("can-cid",["require","exports","module","can-namespace"],function(e,t,n){"use strict";var r=e("can-namespace"),a=0,i="can"+new Date,o=function(e,t){var n=e.nodeName?i:"_cid";return e[n]||(a++,e[n]=(t||"")+a),e[n]};if(o.domExpando=i,o.get=function(e){var t=typeof e;return null!==t&&("object"===t||"function"===t)?o(e):t+":"+e},r.cid)throw new Error("You can't have two versions of can-cid, check your dependencies");n.exports=r.cid=o}),define("can-single-reference",["require","exports","module","can-cid"],function(s,e,t){!function(e,t,n,r){"use strict";var a,i=s("can-cid");function o(e,t){return(t?i(e)+":"+t:i(e))||e}a={set:function(e,t,n,r){e[o(t,r)]=n},getAndDelete:function(e,t,n){var r=o(t,n),a=e[r];return delete e[r],a}},r.exports=a}(0,0,0,t)}),define("can-define/list/list",["require","exports","module","can-construct","can-define","can-queues","can-event-queue/type/type","can-observation-recorder","can-log","can-log/dev/dev","can-define/define-helpers/define-helpers","can-assign","can-diff/list/list","can-namespace","can-reflect","can-symbol","can-single-reference"],function(e,t,n){"use strict";var r=e("can-construct"),a=e("can-define"),i=a.make,l=e("can-queues"),o=e("can-event-queue/type/type"),s=e("can-observation-recorder"),c=e("can-log"),u=e("can-log/dev/dev"),f=e("can-define/define-helpers/define-helpers"),d=e("can-assign"),p=e("can-diff/list/list"),h=e("can-namespace"),v=e("can-reflect"),g=e("can-symbol"),y=e("can-single-reference"),m=[].splice,b=!1,w=function(e){return e},_="can.patches",x=a.eventsProto[g.for("can.onKeyValue")],E=a.eventsProto[g.for("can.offKeyValue")],k=g.for("can.getSchema");function O(){var e=this.prototype._define.definitions,t={type:"list",keys:{}};return(t=a.updateSchemaKeys(t,e)).keys["#"]&&(t.values=e["#"].Type,delete t.keys["#"]),t}var N=r.extend("DefineList",{setup:function(e){if(N){o(this);var t=this.prototype,n=a(t,t,e.prototype._define);a.makeDefineInstanceKey(this,n);var r=n.definitions["#"]||n.defaultDefinition;r&&(r.Type?this.prototype.__type=i.set.Type("*",r.Type,w):r.type&&(this.prototype.__type=i.set.type("*",r.type,w))),this[k]=O}}},{setup:function(e){this._define||(Object.defineProperty(this,"_define",{enumerable:!1,value:{definitions:{length:{type:"number"},_length:{type:"number"}}}}),Object.defineProperty(this,"_data",{enumerable:!1,value:{}})),a.setup.call(this,{},!1),Object.defineProperty(this,"_length",{enumerable:!1,configurable:!0,writable:!0,value:0}),e&&this.splice.apply(this,[0,0].concat(v.toArray(e)))},__type:a.types.observable,_triggerChange:function(e,t,n,r){var a=+e;if(isNaN(a))this.dispatch({type:""+e,target:this},[n,r]);else{var i,o=this._define.definitions["#"];"add"===t?(o&&"function"==typeof o.added&&s.ignore(o.added).call(this,n,a),i={type:t,patches:[{type:"splice",insert:n,index:a,deleteCount:0}]},"production"!==process.env.NODE_ENV&&(i.reasonLog=[v.getName(this),"added",n,"at",a]),this.dispatch(i,[n,a])):"remove"===t?(o&&"function"==typeof o.removed&&s.ignore(o.removed).call(this,r,a),i={type:t,patches:[{type:"splice",index:a,deleteCount:r.length}]},"production"!==process.env.NODE_ENV&&(i.reasonLog=[v.getName(this),"remove",r,"at",a]),this.dispatch(i,[r,a])):this.dispatch(t,[n,a])}},get:function(e){return arguments.length?(isNaN(e)?s.add(this,e):s.add(this,"length"),this[e]):v.unwrap(this,Map)},set:function(e,t){if("object"!=typeof e)if("number"==typeof(e=isNaN(+e)||e%1?e:+e)){if("number"==typeof e&&e>this._length-1){var n=new Array(e+1-this._length);return n[n.length-1]=t,this.push.apply(this,n),n}this.splice(e,1,t)}else{f.defineExpando(this,e,t)||(this[e]=t)}else"production"!==process.env.NODE_ENV&&u.warn("can-define/list/list.prototype.set is deprecated; please use can-define/list/list.prototype.assign or can-define/list/list.prototype.update instead"),v.isListLike(e)?t?this.replace(e):v.assignList(this,e):v.assignMap(this,e);return this},assign:function(e){return v.isListLike(e)?v.assignList(this,e):v.assignMap(this,e),this},update:function(e){return v.isListLike(e)?v.updateList(this,e):v.updateMap(this,e),this},assignDeep:function(e){return v.isListLike(e)?v.assignDeepList(this,e):v.assignDeepMap(this,e),this},updateDeep:function(e){return v.isListLike(e)?v.updateDeepList(this,e):v.updateDeepMap(this,e),this},_items:function(){var t=[];return this._each(function(e){t.push(e)}),t},_each:function(e){for(var t=0,n=this._length;t<n;t++)e(this[t],t)},splice:function(e,t){var n,r,a,i=v.toArray(arguments),o=[],s=2<i.length,c=this._length;for(e=e||0,n=0,r=i.length-2;n<r;n++)i[a=n+2]=this.__type(i[a],a),o.push(i[a]),this[n+e]!==i[a]&&(s=!1);if(s&&this._length<=o.length)return o;void 0===t&&(t=i[1]=this._length-e),b=!0;var u=m.apply(this,i);return b=!1,l.batch.start(),0<t&&this._triggerChange(""+e,"remove",void 0,u),2<i.length&&this._triggerChange(""+e,"add",o,u),this.dispatch("length",[this._length,c]),l.batch.stop(),u},serialize:function(){return v.serialize(this,Map)}});for(var L in a.eventsProto)Object.defineProperty(N.prototype,L,{enumerable:!1,value:a.eventsProto[L],writable:!0});("getOwnPropertySymbols"in Object?Object.getOwnPropertySymbols(a.eventsProto):[g.for("can.onKeyValue"),g.for("can.offKeyValue")]).forEach(function(e){Object.defineProperty(N.prototype,e,{configurable:!0,enumerable:!1,value:a.eventsProto[e],writable:!0})});for(var L in v.eachKey({push:"length",unshift:0},function(i,e){var o=[][e];N.prototype[e]=function(){for(var e,t,n=[],r=i?this._length:0,a=arguments.length;a--;)t=arguments[a],n[a]=this.__type(t,a);return b=!0,e=o.apply(this,n),b=!1,this.comparator&&!n.length||(l.batch.start(),this._triggerChange(""+r,"add",n,void 0),this.dispatch("length",[this._length,r]),l.batch.stop()),e}}),v.eachKey({pop:"length",shift:0},function(i,e){var o=[][e];N.prototype[e]=function(){if(this._length){var e,t,n=(t=arguments)[0]&&Array.isArray(t[0])?t[0]:v.toArray(t),r=i&&this._length?this._length-1:0,a=this._length?this._length:0;return b=!0,e=o.apply(this,n),b=!1,l.batch.start(),this._triggerChange(""+r,"remove",void 0,[e]),this.dispatch("length",[this._length,a]),l.batch.stop(),e}}}),v.eachKey({map:3,filter:3,reduce:4,reduceRight:4,every:3,some:3},function(o,s){N.prototype[s]=function(){var n,t=this,e=[].slice.call(arguments,0),r=e[0],a=e[o-1]||t;"object"==typeof r&&(n=r,r=function(e){for(var t in n)if(e[t]!==n[t])return!1;return!0}),e[0]=function(){var e=[].slice.call(arguments,0);return e[o-3]=t.get(e[o-2]),r.apply(a,e)};var i=Array.prototype[s].apply(this,e);return"map"===s?new N(i):"filter"===s?new t.constructor(i):i}}),d(N.prototype,{indexOf:function(e,t){for(var n=t||0,r=this.length;n<r;n++)if(this.get(n)===e)return n;return-1},lastIndexOf:function(e,t){for(var n=t=void 0===t?this.length-1:t;0<=n;n--)if(this.get(n)===e)return n;return-1},join:function(){return s.add(this,"length"),[].join.apply(this,arguments)},reverse:function(){var e=[].reverse.call(this._items());return this.replace(e)},slice:function(){s.add(this,"length");var e=Array.prototype.slice.apply(this,arguments);return new this.constructor(e)},concat:function(){var t=[];return v.eachIndex(arguments,function(e){v.isListLike(e)?(Array.isArray(e)?e:v.toArray(e)).forEach(function(e){t.push(this.__type(e))},this):t.push(this.__type(e))},this),new this.constructor(Array.prototype.concat.apply(v.toArray(this),t))},forEach:function(e,t){for(var n,r=0,a=this.length;r<a&&(n=this.get(r),!1!==e.call(t||n,n,r,this));r++);return this},replace:function(e){var t=p(this,e);l.batch.start();for(var n=0,r=t.length;n<r;n++)this.splice.apply(this,[t[n].index,t[n].deleteCount].concat(t[n].insert));return l.batch.stop(),this},sort:function(e){var t=Array.prototype.slice.call(this);return Array.prototype.sort.call(t,e),this.splice.apply(this,[0,t.length].concat(t)),this}}),a.eventsProto)N[L]=a.eventsProto[L],Object.defineProperty(N.prototype,L,{enumerable:!1,value:a.eventsProto[L],writable:!0});Object.defineProperty(N.prototype,"length",{get:function(){return this.__inSetup||s.add(this,"length"),this._length},set:function(e){if(b)this._length=e;else if(null!=e&&!isNaN(+e)&&e!==this._length)if(e>this._length-1){var t=new Array(e-this._length);this.push.apply(this,t)}else this.splice(e)},enumerable:!0}),N.prototype.attr=function(e,t){return c.warn("DefineMap::attr shouldn't be called"),0===arguments.length?this.get():e&&"object"==typeof e?this.set.apply(this,arguments):1===arguments.length?this.get(e):this.set(e,t)},N.prototype.item=function(e,t){return 1===arguments.length?this.get(e):this.set(e,t)};var V={"can.isMoreListLikeThanMapLike":!0,"can.isMapLike":!0,"can.isListLike":!0,"can.isValueLike":!(N.prototype.items=function(){return c.warn("DefineList::get should should be used instead of DefineList::items"),this.get()}),"can.getKeyValue":N.prototype.get,"can.setKeyValue":N.prototype.set,"can.onKeyValue":function(e,t,n){var r;return isNaN(e)?x.apply(this,arguments):(r=function(){t(this[e])},"production"!==process.env.NODE_ENV&&Object.defineProperty(r,"name",{value:"translationHandler("+e+")::"+v.getName(this)+".onKeyValue('length',"+v.getName(t)+")"}),y.set(t,this,r,e),x.call(this,"length",r,n))},"can.offKeyValue":function(e,t,n){var r;return isNaN(e)?E.apply(this,arguments):(r=y.getAndDelete(t,this,e),E.call(this,"length",r,n))},"can.deleteKeyValue":function(e){if("number"==typeof(e=isNaN(+e)||e%1?e:+e))this.splice(e,1);else{if("length"===e||"_length"===e)return;this.set(e,void 0)}return this},"can.assignDeep":function(e){l.batch.start(),v.assignList(this,e),l.batch.stop()},"can.updateDeep":function(e){l.batch.start(),this.replace(e),l.batch.stop()},"can.keyHasDependencies":function(e){return!!(this._computed&&this._computed[e]&&this._computed[e].compute)},"can.getKeyDependencies":function(e){var t;return this._computed&&this._computed[e]&&this._computed[e].compute&&((t={}).valueDependencies=new Set,t.valueDependencies.add(this._computed[e].compute)),t},"can.splice":function(e,t,n){this.splice.apply(this,[e,t].concat(n))},"can.onPatches":function(e,t){this[g.for("can.onKeyValue")](_,e,t)},"can.offPatches":function(e,t){this[g.for("can.offKeyValue")](_,e,t)}};"production"!==process.env.NODE_ENV&&(V["can.getName"]=function(){return v.getName(this.constructor)+"[]"}),v.assignSymbols(N.prototype,V),v.setKeyValue(N.prototype,g.iterator,function(){var e=-1;return"number"!=typeof this.length&&(this.length=0),{next:function(){return{value:this[++e],done:e>=this.length}}.bind(this)}}),"production"!==process.env.NODE_ENV&&(N.prototype.log=f.log),a.DefineList=N,n.exports=h.DefineList=N}),define("can/es/can-define",["exports","can-define","can-define/map/map","can-define/list/list"],function(e,t,n,r){"use strict";function a(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"define",{enumerable:!0,get:function(){return a(t).default}}),Object.defineProperty(e,"DefineMap",{enumerable:!0,get:function(){return a(n).default}}),Object.defineProperty(e,"DefineList",{enumerable:!0,get:function(){return a(r).default}})}),define("can-key/utils",function(e,t,n){"use strict";var r={isContainer:function(e){var t=typeof e;return e&&("object"===t||"function"===t)},strReplacer:/\{([^\}]+)\}/g,parts:function(e){return Array.isArray(e)?e:void 0!==e?(e+"").replace(/\[/g,".").replace(/]/g,"").split("."):[]}};n.exports=r}),define("can-key/delete/delete",["require","exports","module","can-reflect","can-key/utils"],function(e,t,n){"use strict";var i=e("can-reflect"),o=e("can-key/utils");n.exports=function(e,t){for(var n=o.parts(t),r=e,a=0;a<n.length-1;a++)r&&(r=i.getKeyValue(r,n[a]));r&&i.deleteKeyValue(r,n[n.length-1])}}),define("can-key/get/get",["require","exports","module","can-reflect","can-key/utils"],function(e,t,n){"use strict";var s=e("can-reflect"),c=e("can-key/utils");n.exports=function(e,t){var n,r,a,i=c.parts(t),o=i.length;if(!o)return e;for(n=e,r=0;r<o&&c.isContainer(n)&&null!==n;r++)a=n,n=s.getKeyValue(a,i[r]);return n}}),define("can-key/replace-with/replace-with",["require","exports","module","can-key/utils","can-key/get/get","can-key/delete/delete"],function(e,t,n){"use strict";var o=e("can-key/utils"),s=e("can-key/get/get"),c=e("can-key/delete/delete");n.exports=function(e,r,a,i){return e.replace(o.strReplacer,function(e,t){var n=s(r,t);return i&&c(r,t),a?a(t,n):n})}}),define("can-key/set/set",["require","exports","module","can-reflect","can-symbol","can-key/utils"],function(e,t,n){"use strict";var s=e("can-reflect"),r=e("can-symbol"),c=e("can-key/utils");r.for("can.setValue");n.exports=function(e,t,n){for(var r=c.parts(t),a=e,i=r.length,o=0;o<i-1&&c.isContainer(a);o++)a=s.getKeyValue(a,r[o]);if(!a)throw new TypeError("Cannot set value at key path '"+t+"'");return s.setKeyValue(a,r[o],n),e}}),define("can-key/walk/walk",["require","exports","module","can-reflect","can-key/utils"],function(e,t,n){"use strict";var l=e("can-reflect"),f=e("can-key/utils");n.exports=function(e,t,n){var r,a,i,o,s=f.parts(t),c=s.length;if(c)for(r=e,a=0;a<c;a++){var u=n({parent:i=r,key:o=s[a],value:r=f.isContainer(i)&&l.getKeyValue(i,o)},a);void 0!==u&&(r=u)}}}),define("can-key/transform/transform",["require","exports","module","can-key/walk/walk","can-key/utils","can-reflect"],function(e,t,n){"use strict";var s=e("can-key/walk/walk"),c=e("can-key/utils"),u=e("can-reflect");n.exports=function(e,t){var o=u.serialize(e);return u.eachKey(t,function(e,t){var n=c.parts(t),r=c.parts(e),a=[];s(o,n,function(e){a.push(e)});var i=a[a.length-1].value;void 0!==i&&(s(o,r,function(e,t){if(t<r.length-1&&!e.value)return e.parent[e.key]={};t===r.length-1&&(e.parent[e.key]=i)}),function(e){for(var t=e.length-1;0<=t;t--){var n=e[t];if(delete n.parent[n.key],0!==u.size(n.parent))return}}(a))}),o}}),define("can-key",["require","exports","module","can-key/delete/delete","can-key/get/get","can-key/replace-with/replace-with","can-key/set/set","can-key/transform/transform","can-key/walk/walk","can-namespace"],function(e,t,n){"use strict";var r=e("can-key/delete/delete"),a=e("can-key/get/get"),i=e("can-key/replace-with/replace-with"),o=e("can-key/set/set"),s=e("can-key/transform/transform"),c=e("can-key/walk/walk"),u=e("can-namespace");n.exports=u.key={deleteKey:r,get:a,replaceWith:i,set:o,transform:s,walk:c}}),define("can-simple-observable/key/key",["require","exports","module","can-key","can-key/utils","can-reflect","can-observation","can-reflect-dependencies"],function(e,t,n){var u=e("can-key"),l=e("can-key/utils"),f=e("can-reflect"),d=e("can-observation");if("production"!==process.env.NODE_ENV)var p=e("can-reflect-dependencies");n.exports=function(t,e){var r=l.parts(e),a=r.length-1;if("production"!==process.env.NODE_ENV)var i,o;var s=new d(function(){var n;return u.walk(t,r,function(e,t){t===a&&("production"!==process.env.NODE_ENV&&(!o||e.key===i&&e.parent===o||p.deleteMutatedBy(o,i,s),i=e.key,o=e.parent,p.addMutatedBy(o,i,s)),n=e.value)}),n}),n=function(e){u.set(t,r,e)};Object.defineProperty(s,"value",{get:s.get,set:n});var c={"can.setValue":n};return"production"!==process.env.NODE_ENV&&(c["can.getName"]=function(){return"keyObservable<"+f.getName(t)+"."+e+">"},c["can.getWhatIChange"]=function(){var e=new Map,t=new Set;return t.add(i),e.set(o,t),{mutate:{keyDependencies:e}}}),f.assignSymbols(s,c)}}),define("can-value",["require","exports","module","can-key","can-reflect","can-simple-observable/key/key","can-namespace","can-observation","can-simple-observable","can-simple-observable/settable/settable"],function(e,t,n){"use strict";var a=e("can-key"),i=e("can-reflect"),o=e("can-simple-observable/key/key"),r=e("can-namespace"),s=e("can-observation"),c=e("can-simple-observable"),u=e("can-simple-observable/settable/settable");n.exports=r.value={bind:function(e,t){return o(e,t)},from:function(e,t){var n=function(){return a.get(e,t)};if("production"!==process.env.NODE_ENV){var r=i.getName(e);Object.defineProperty(n,"name",{value:"ValueFrom<"+r+"."+t+">"})}return new s(n)},returnedBy:function(e,t,n){return 1===e.length?new u(e,t,n):new s(e,t)},to:function(e,t){var n=o(e,t);"production"!==process.env.NODE_ENV&&i.assignSymbols(n.onDependencyChange,{"can.getChangesDependencyRecord":function(){}});var r={"can.getValue":null};return"production"!==process.env.NODE_ENV&&(r["can.getValueDependencies"]=function(){}),i.assignSymbols(n,r)},with:function(e){return new c(e)}}}),define("can/es/can-value",["exports","can-value"],function(e,t){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"default",{enumerable:!0,get:function(){return(e=t,e&&e.__esModule?e:{default:e}).default;var e}})}),define("can/es/can-observation",["exports","can-observation"],function(e,t){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"default",{enumerable:!0,get:function(){return(e=t,e&&e.__esModule?e:{default:e}).default;var e}})}),define("can/es/can-observation-recorder",["exports","can-observation-recorder"],function(e,t){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"default",{enumerable:!0,get:function(){return(e=t,e&&e.__esModule?e:{default:e}).default;var e}})}),define("can-simple-map",["require","exports","module","can-construct","can-event-queue/map/map","can-queues","can-observation-recorder","can-reflect","can-log/dev/dev","can-symbol"],function(e,t,n){"use strict";var r=e("can-construct"),a=e("can-event-queue/map/map"),s=e("can-queues"),c=e("can-observation-recorder"),u=e("can-reflect"),l=e("can-log/dev/dev"),f=e("can-symbol"),i=r.extend("SimpleMap",{setup:function(e){this._data={},e&&"object"==typeof e&&this.attr(e)},attr:function(e,t){var n=this;if(0===arguments.length){c.add(this,"can.keys");var r={};return u.eachKey(this._data,function(e,t){c.add(this,t),r[t]=e},this),r}if(1<arguments.length){var a=this._data.hasOwnProperty(e),i=this._data[e];if(i!==(this._data[e]=t)){"production"!==process.env.NODE_ENV&&"function"==typeof this._log&&this._log(e,t,i);var o={keyChanged:a?void 0:e,type:e};"production"!==process.env.NODE_ENV&&(o={keyChanged:a?void 0:e,type:e,reasonLog:[u.getName(this)+"'s",e,"changed to",t,"from",i]}),this.dispatch(o,[t,i])}}else{if("object"!=typeof e)return"constructor"!==e?(c.add(this,e),this._data[e]):this.constructor;s.batch.start(),u.eachKey(e,function(e,t){n.attr(t,e)}),s.batch.stop()}},serialize:function(){return u.serialize(this,Map)},get:function(){return this.attr.apply(this,arguments)},set:function(){return this.attr.apply(this,arguments)},log:function(a){if("production"!==process.env.NODE_ENV)var i=function(e){return"string"==typeof e?JSON.stringify(e):e};var e,t,n,o=(e=this,t=f.for("can.meta"),(n=e[t])||(n={},u.setKeyValue(e,t,n)),n);o.allowedLogKeysSet=o.allowedLogKeysSet||new Set,a&&o.allowedLogKeysSet.add(a),this._log=function(e,t,n,r){a&&!o.allowedLogKeysSet.has(e)||l.log(u.getName(this),"\n key ",i(e),"\n is ",i(t),"\n was ",i(n))}}});a(i.prototype);var o={"can.isMapLike":!0,"can.isListLike":!1,"can.isValueLike":!1,"can.getKeyValue":i.prototype.get,"can.setKeyValue":i.prototype.set,"can.deleteKeyValue":function(e){var t;if(this._data.hasOwnProperty(e)){var n=this._data[e];delete this._data[e],"production"!==process.env.NODE_ENV&&"function"==typeof this._log&&this._log(e,void 0,n),t={keyChanged:e,type:e},"production"!==process.env.NODE_ENV&&(t={keyChanged:e,type:e,reasonLog:[u.getName(this)+"'s",e,"deleted",n]}),this.dispatch(t,[void 0,n])}},"can.getOwnEnumerableKeys":function(){return c.add(this,"can.keys"),Object.keys(this._data)},"can.assignDeep":function(e){s.batch.start(),u.assignMap(this,e),s.batch.stop()},"can.updateDeep":function(e){s.batch.start(),u.updateMap(this,e),s.batch.stop()},"can.keyHasDependencies":function(e){return!1},"can.getKeyDependencies":function(e){},"can.hasOwnKey":function(e){return this._data.hasOwnProperty(e)}};"production"!==process.env.NODE_ENV&&(o["can.getName"]=function(){return u.getName(this.constructor)+"{}"}),u.assignSymbols(i.prototype,o),n.exports=i}),define("can/es/can-simple-map",["exports","can-simple-map"],function(e,t){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"default",{enumerable:!0,get:function(){return(e=t,e&&e.__esModule?e:{default:e}).default;var e}})}),define("can-bind",["require","exports","module","can-reflect","can-symbol","can-namespace","can-queues","can-assign","can-log/dev/dev","can-reflect-dependencies"],function(e,t,n){"use strict";var u=e("can-reflect"),r=e("can-symbol"),a=e("can-namespace"),l=e("can-queues"),i=e("can-assign");if("production"!==process.env.NODE_ENV)var f=e("can-log/dev/dev"),o=e("can-reflect-dependencies");var s=r.for("can.getChangesDependencyRecord"),c=r.for("can.getValue"),d=r.for("can.onValue"),p=r.for("can.onEmit"),h=r.for("can.offEmit"),v=r.for("can.setValue");function g(e,t){u.setValue(t,e)}function y(e,t,n){return e[p](t,n)}function m(e,t,n){return e[h](t,n)}function b(e,t,n,r){var a;e[d]?a=u.offValue:e[p]&&(a=m),a&&(a(e,n,r),"production"!==process.env.NODE_ENV&&(o.deleteMutatedBy(t,e),n[s]=function(){}))}function w(e,t,n,r){var a;e[d]?a=u.onValue:e[p]&&(a=y),a&&(a(e,n,r),"production"!==process.env.NODE_ENV&&(o.addMutatedBy(t,e),n[s]=function(){var e=new Set;return e.add(t),{valueDependencies:e}}))}function _(e,t){this.value=0,this._binding=e,this._type=t}function x(t){if(this._options=t,"production"!==process.env.NODE_ENV){if(void 0===t.child)throw new TypeError("You must supply a child");if(void 0===t.parent)throw new TypeError("You must supply a parent");if(t.queue&&-1===["notify","derive","domUI"].indexOf(t.queue))throw new RangeError("Invalid queue; must be one of notify, derive, or domUI")}void 0===t.queue&&(t.queue="domUI"),0<t.cycles==!1&&(t.cycles=0),t.onInitDoNotUpdateChild="boolean"==typeof t.onInitDoNotUpdateChild&&t.onInitDoNotUpdateChild,t.onInitDoNotUpdateParent="boolean"==typeof t.onInitDoNotUpdateParent&&t.onInitDoNotUpdateParent,t.onInitSetUndefinedParentIfChildIsDefined="boolean"!=typeof t.onInitSetUndefinedParentIfChildIsDefined||t.onInitSetUndefinedParentIfChildIsDefined;var n=new _(this,"child"),r=new _(this,"parent"),e=!0;"boolean"==typeof t.childToParent?e=t.childToParent:null==t.child[c]?e=!1:void 0===t.setParent&&null==t.parent[v]&&(e=!1);var a=!0;if("boolean"==typeof t.parentToChild?a=t.parentToChild:null==t.parent[c]?a=!1:void 0===t.setChild&&null==t.child[v]&&(a=!1),!1===e&&!1===a)throw new Error("Neither the child nor parent will be updated; this is a no-way binding");this._childToParent=e,this._parentToChild=a,void 0===t.setChild&&(t.setChild=g),void 0===t.setParent&&(t.setParent=g),void 0!==t.priority&&(u.setPriority(t.child,t.priority),u.setPriority(t.parent,t.priority));var i=2*t.cycles,o=i+("childSticksToParent"===t.sticky?1:0),s=i+("parentSticksToChild"===t.sticky?1:0);this._bindingState={child:!1,parent:!1},this._updateChild=function(e){E.call(this,{bindingState:this._bindingState,newValue:e,debugObservableName:"child",debugPartnerName:"parent",observable:t.child,setValue:t.setChild,semaphore:n,allowedUpdates:o,sticky:"parentSticksToChild"===t.sticky,partner:t.parent,setPartner:t.setParent,partnerSemaphore:r})}.bind(this),this._updateParent=function(e){E.call(this,{bindingState:this._bindingState,newValue:e,debugObservableName:"parent",debugPartnerName:"child",observable:t.parent,setValue:t.setParent,semaphore:r,allowedUpdates:s,sticky:"childSticksToParent"===t.sticky,partner:t.child,setPartner:t.setChild,partnerSemaphore:n})}.bind(this),"production"!==process.env.NODE_ENV&&(Object.defineProperty(this._updateChild,"name",{value:t.updateChildName?t.updateChildName:"update "+u.getName(t.child),configurable:!0}),Object.defineProperty(this._updateParent,"name",{value:t.updateParentName?t.updateParentName:"update "+u.getName(t.parent),configurable:!0}))}function E(e){var t=e.bindingState;if(!1!==t.child||!1!==t.parent){var n=e.semaphore;if(n.value+e.partnerSemaphore.value<=e.allowedUpdates){if(l.batch.start(),n.increment(e),e.setValue(e.newValue,e.observable),l.mutateQueue.enqueue(n.decrement,n,[]),l.batch.stop(),e.sticky){var r=u.getValue(e.observable);r!==u.getValue(e.partner)&&e.setPartner(r,e.partner)}}else if("production"!==process.env.NODE_ENV){var a=u.getValue(e.observable);if(a!==e.newValue){var i=["can-bind: attempting to update "+e.debugObservableName+" "+u.getName(e.observable)+" to new value: %o","…but the "+e.debugObservableName+" semaphore is at "+n.value+" and the "+e.debugPartnerName+" semaphore is at "+e.partnerSemaphore.value+". The number of allowed updates is "+e.allowedUpdates+".","The "+e.debugObservableName+" value will remain unchanged; it’s currently: %o. ","Read https://canjs.com/doc/can-bind.html#Warnings for more information. Printing mutation history:"];if(f.warn(i.join("\n"),e.newValue,a),console.groupCollapsed){var o=[],s=function(e){if(o.length)for(var t=o.length-1;0<=t;t--){if(-1!==e.indexOf(o[t]))return e.slice(t+1)}return e};this._debugSemaphores.forEach(function(e){if("increment"===e.action){console.groupCollapsed(e.type+" "+u.getName(e.observable)+" set.");var t=l.stack(e.lastTask),n=s(t);o=t,l.logStack.call({stack:function(){return n}}),console.log(e.type+" semaphore incremented to "+e.value+"."),console.log(u.getName(e.observable),e.observable,"set to ",e.newValue),console.groupEnd()}}),console.groupCollapsed(e.debugObservableName+" "+u.getName(e.observable)+" NOT set.");var c=s(l.stack());l.logStack.call({stack:function(){return c}}),console.log(e.debugObservableName+" semaphore ("+n.value+") + "+e.debugPartnerName+" semaphore ("+e.partnerSemaphore.value+") IS NOT <= allowed updates ("+e.allowedUpdates+")"),console.log("Prevented from setting "+u.getName(e.observable),e.observable,"to",e.newValue),console.groupEnd()}}}}}i(_.prototype,{decrement:function(){this.value-=1},increment:function(e){if(this._incremented=!0,this.value+=1,"production"!==process.env.NODE_ENV){1===this.value&&(this._binding._debugSemaphores=[]);var t={type:this._type,action:"increment",observable:e.observable,newValue:e.newValue,value:this.value,lastTask:l.lastTask()};this._binding._debugSemaphores.push(t)}}}),Object.defineProperty(x.prototype,"parentValue",{get:function(){return u.getValue(this._options.parent)}}),i(x.prototype,{start:function(){var e,t,n=this._options;this.startParent(),this.startChild(),!0===this._childToParent&&!0===this._parentToChild?void 0===(t=u.getValue(n.parent))?void 0===(e=u.getValue(n.child))?!1===n.onInitDoNotUpdateChild&&this._updateChild(t):!1===n.onInitDoNotUpdateParent&&!0===n.onInitSetUndefinedParentIfChildIsDefined&&this._updateParent(e):!1===n.onInitDoNotUpdateChild&&this._updateChild(t):!0===this._childToParent?!1===n.onInitDoNotUpdateParent&&(e=u.getValue(n.child),this._updateParent(e)):!0===this._parentToChild&&!1===n.onInitDoNotUpdateChild&&(t=u.getValue(n.parent),this._updateChild(t))},startChild:function(){if(!1===this._bindingState.child&&!0===this._childToParent){var e=this._options;this._bindingState.child=!0,w(e.child,e.parent,this._updateParent,e.queue)}},startParent:function(){if(!1===this._bindingState.parent&&!0===this._parentToChild){var e=this._options;this._bindingState.parent=!0,w(e.parent,e.child,this._updateChild,e.queue)}},stop:function(){var e=this._bindingState,t=this._options;!0===e.parent&&!0===this._parentToChild&&(e.parent=!1,b(t.parent,t.child,this._updateChild,t.queue)),!0===e.child&&!0===this._childToParent&&(e.child=!1,b(t.child,t.parent,this._updateParent,t.queue))}}),n.exports=a.Bind=x}),define("can/es/can-bind",["exports","can-bind"],function(e,t){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"default",{enumerable:!0,get:function(){return(e=t,e&&e.__esModule?e:{default:e}).default;var e}})}),define("can/es/can-event-queue",["exports","can-event-queue/map/map","can-event-queue/value/value"],function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"mapEventBindings",{enumerable:!0,get:function(){return r(t).default}}),Object.defineProperty(e,"valueEventBindings",{enumerable:!0,get:function(){return r(n).default}})}),define("can/es/can-simple-observable",["exports","can-simple-observable"],function(e,t){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"default",{enumerable:!0,get:function(){return(e=t,e&&e.__esModule?e:{default:e}).default;var e}})}),define("can-reflect-promise",["require","exports","module","can-reflect","can-symbol","can-observation-recorder","can-queues","can-key-tree","can-log/dev/dev"],function(e,t,n){"use strict";var a=e("can-reflect"),r=e("can-symbol"),i=e("can-observation-recorder"),o=e("can-queues"),s=e("can-key-tree"),c=e("can-log/dev/dev"),u=r.for("can.getKeyValue"),l=r.for("can.meta"),f={isPending:!0,state:"pending",isResolved:!1,isRejected:!1,value:void 0,reason:void 0};function d(e,t,n){var r=e[l],a=r[t];r[t]=n,o.enqueueByQueue(r.handlers.getNode([t]),e,[n,a],function(){return{}},["Promise",e,"resolved with value",n,"and changed virtual property: "+t])}function p(t){var e=t[l];e||(Object.defineProperty(t,l,{enumerable:!1,configurable:!1,writable:!1,value:Object.create(f)}),(e=t[l]).handlers=new s([Object,Object,Array])),t.then(function(e){o.batch.start(),d(t,"isPending",!1),d(t,"isResolved",!0),d(t,"value",e),d(t,"state","resolved"),o.batch.stop()},function(e){o.batch.start(),d(t,"isPending",!1),d(t,"isRejected",!0),d(t,"reason",e),d(t,"state","rejected"),o.batch.stop(),"production"!==process.env.NODE_ENV&&c.error("Failed promise:",e)})}n.exports=function t(e){var n,r="getPrototypeOf"in Object?Object.getPrototypeOf(e):e.__proto__;e[u]&&e[l]||(null!==r&&r!==Object.prototype||"function"==typeof(r=e).promise&&(n=r.promise,r.promise=function(){var e=n.call(r);return t(e),e}),a.assignSymbols(r,{"can.getKeyValue":function(e){switch(this[l]||p(this),i.add(this,e),e){case"state":case"isPending":case"isResolved":case"isRejected":case"value":case"reason":return this[l][e];default:return this[e]}},"can.getValue":function(){return this[u]("value")},"can.isValueLike":!1,"can.onKeyValue":function(e,t,n){this[l]||p(this),this[l].handlers.add([e,n||"mutate",t])},"can.offKeyValue":function(e,t,n){this[l]||p(this),this[l].handlers.delete([e,n||"mutate",t])},"can.hasOwnKey":function(e){return this[l]||p(this),e in this[l]}}))}}),define("can-stache-key",["require","exports","module","can-observation-recorder","can-log/dev/dev","can-symbol","can-reflect","can-reflect-promise"],function(e,t,n){"use strict";var p,h=e("can-observation-recorder"),o=e("can-log/dev/dev"),r=e("can-symbol"),s=e("can-reflect"),a=e("can-reflect-promise"),c=r.for("can.getValue"),i=r.for("can.setValue"),u=r.for("can.isValueLike"),l=h.ignore(s.getKeyValue.bind(s)),f=Function.prototype.bind;"production"!==process.env.NODE_ENV&&(f=function(e){var t=Function.prototype.bind.call(this,e);return Object.defineProperty(t,"name",{value:s.getName(e)+"."+s.getName(this)}),t});var v=function(e,t,n,r,a,i){for(var o=0,s=p.valueReaders.length;o<s;o++)p.valueReaders[o].test(e,t,n,r)&&(e=p.valueReaders[o].read(e,t,n,r,a,i));return e},d={index:!0,key:!0,event:!0,element:!0,viewModel:!0},g=function(e,t,n,r,a){e.foundObservable&&!t.foundObservable&&h.trapsCount()&&(h.addMany(n()),e.foundObservable(r,a),t.foundObservable=!0)},y=function(e,t,n){return!!(t&&t.length&&s.hasKey(e,t[n].key))};(p={read:function(e,t,n){var r,a={foundObservable:!1};(n=n||{}).foundObservable&&(r=h.trap());var i,o,s=v(e,0,t,n,a),c=t.length,u=0;for(g(n,a,r,e,0);u<c;){i=s;for(var l=0,f=p.propertyReaders.length;l<f;l++){var d=p.propertyReaders[l];if(d.test(s)){s=d.read(s,t[u],u,n,a);break}}if(g(n,a,r,i,u),s=v(s,u+=1,t,n,a,i),g(n,a,r,i,u-1),typeof s,u<t.length&&null==s)return o=y(i,t,u-1),n.earlyExit&&!o&&n.earlyExit(i,u-1,s),{value:void 0,parent:i,parentHasKey:o,foundLastParent:!1}}return o=y(i,t,t.length-1),void 0!==s||o||n.earlyExit&&n.earlyExit(i,u-1),{value:s,parent:i,parentHasKey:o,foundLastParent:!0}},get:function(e,t,n){return p.read(e,p.reads(t),n||{}).value},valueReadersMap:{},valueReaders:[{name:"function",test:function(e){return e&&s.isFunctionLike(e)&&!s.isConstructorLike(e)},read:function(e,t,n,r,a,i){return r.callMethodsOnObservables&&s.isObservableLike(i)&&s.isMapLike(i)?(o.warn("can-stache-key: read() called with `callMethodsOnObservables: true`."),e.apply(i,r.args||[])):!1!==r.proxyMethods?f.call(e,i):e}},{name:"isValueLike",test:function(e,t,n,r){return e&&e[c]&&!1!==e[u]&&(r.foundAt||!((a=n[t-1])&&a.at));var a},read:function(e,t,n,r){return!1===r.readCompute&&t===n.length?e:s.getValue(e)},write:function(e,t){e[i]?e[i](t):e.set?e.set(t):e(t)}}],propertyReadersMap:{},propertyReaders:[{name:"map",test:function(e){return(s.isPromise(e)||"object"==typeof e&&e&&"function"==typeof e.then)&&a(e),s.isObservableLike(e)&&s.isMapLike(e)},read:function(e,t){var n=s.getKeyValue(e,t.key);return void 0!==n?n:e[t.key]},write:s.setKeyValue},{name:"object",test:function(){return!0},read:function(e,t,n,r){if(null!=e)return"object"!=typeof e?e[t.key]:t.key in e?e[t.key]:"production"!==process.env.NODE_ENV&&t.at&&d[t.key]&&"@"+t.key in e?(r.foundAt=!0,void o.warn("Use %"+t.key+" in place of @"+t.key+".")):void 0},write:function(e,t,n){var r=e[t];null!=n&&"object"==typeof n&&s.isMapLike(r)?(o.warn('can-stache-key: Merging data into "'+t+'" because its parent is non-observable'),s.update(r,n)):null!=r&&void 0!==r[i]?s.setValue(r,n):e[t]=n}}],reads:function(e){var t=""+e,n=[],r=0,a=!1;"@"===t.charAt(0)&&(r=1,a=!0);for(var i="",o=r;o<t.length;o++){var s=t.charAt(o);"."===s||"@"===s?i="\\"!==t.charAt(o-1)?(n.push({key:i,at:a}),a="@"===s,""):i.substr(0,i.length-1)+".":i+=s}return n.push({key:i,at:a}),n},write:function(e,t,n,r){var a,i="string"==typeof t?p.reads(t):t;if(r=r||{},1<i.length?(a=i.pop(),e=p.read(e,i,r).value,i.push(a)):a=i[0],e){var o=l(e,a.key);p.valueReadersMap.isValueLike.test(o,i.length-1,i,r)?p.valueReadersMap.isValueLike.write(o,n,r):(p.valueReadersMap.isValueLike.test(e,i.length-1,i,r)&&(e=e[c]()),p.propertyReadersMap.map.test(e)?p.propertyReadersMap.map.write(e,a.key,n,r):p.propertyReadersMap.object.test(e)&&(p.propertyReadersMap.object.write(e,a.key,n,r),r.observation&&r.observation.update()))}}}).propertyReaders.forEach(function(e){p.propertyReadersMap[e.name]=e}),p.valueReaders.forEach(function(e){p.valueReadersMap[e.name]=e}),p.set=p.write,n.exports=p}),define("can-dom-mutate/-util",["require","exports","module","can-globals/document/document"],function(u,e,t){!function(e,t,n,r){"use strict";var i=u("can-globals/document/document");function o(e){return!(!e||11!==e.nodeType)}function a(e){for(var t=[],n=e.firstChild;n;)t.push(n),n=n.nextSibling;return t}function s(){return NodeFilter.FILTER_ACCEPT}var c=s;c.acceptNode=s,r.exports={eliminate:function(e,t){var n=e.indexOf(t);0<=n&&e.splice(n,1)},isInDocument:function(e){var t=i();return t===e||function e(t,n){return t.contains?t.contains(n):t.nodeType===Node.DOCUMENT_NODE&&t.documentElement?e(t.documentElement,n):(n=n.parentNode)===t}(t,e)},getDocument:i,isDocumentElement:function(e){return i().documentElement===e},isFragment:o,getParents:function(e){return o(e)?a(e):[e]},getAllNodes:function(e){return void 0!==i().createTreeWalker?function(e){for(var t,n,r=o(e)?[]:[e],a=!(!(t=e)||1!==t.nodeType)&&i().createTreeWalker(e,NodeFilter.SHOW_TEXT|NodeFilter.SHOW_ELEMENT,c,!1);n=a&&a.nextNode();)r.push(n);return r}(e):function(e){var t,n,r=0,a=o(e)?[]:[e];if(null==e.firstChild)return a;for(;!t&&(n=e.firstChild)?(r++,a.push(n)):(n=e.nextSibling)?(t=!1,a.push(n)):(n=e.parentNode,r--,t=!0),e=n,0<r;);return a}(e)},getChildren:a,subscription:function(r){return function(){var t=r.apply(this,arguments),n=!1;return function(){if(n){var e=r.name||r.displayName||"an anonymous function";throw new Error("Disposal function returned by "+e+" called more than once.")}t.apply(this,arguments),n=!0}}},addToSet:function(e,t){for(var n=0,r=e.length;n<r;n++)t.add(e[n])}}}(0,0,0,t)}),define("can-dom-mutate",["require","exports","module","can-globals","can-globals/global/global","can-globals/mutation-observer/mutation-observer","can-namespace","can-globals/document/document","can-reflect","can-dom-mutate/-util"],function(e,t,n){!function(e,t,n,r){"use strict";var s,l,f,c=t("can-globals"),u=t("can-globals/global/global"),d=t("can-globals/mutation-observer/mutation-observer"),a=t("can-namespace"),p=t("can-globals/document/document"),h=t("can-reflect"),v=t("can-dom-mutate/-util"),g=v.eliminate,y=v.subscription,m=v.isDocumentElement,b=v.getAllNodes,i=Array.prototype.slice,o=new WeakMap;function w(e,t){var n=o.get(e);if(n)return n[t]}function _(e,t,n){var r=o.get(e);r||(r={},o.set(e,r)),r[t]=n}function x(e,t){return delete o.get(e)[t]}function E(e){for(var t=[],n=0;n<e.length;n++)t.push({target:e[n]});return t}function k(n){return function(e,t){n(e),t&&t()}}function O(e,t){var n=w(p(),t);if(n)return n.listeners}function N(e,t){var n=w(p(),t);if(n)return n.get(e)}function L(e,t){for(var n=i.call(e,0),r=n.length,a=0;a<r;a++)n[a](t)}function V(o,s){return function(e){for(var t=0;t<e.length;t++){var n=e[t],r=n.target,a=N(r,o);if(a&&L(a,n),s){var i=O(0,s);i&&L(i,n)}}}}var D=0;function S(r,t,a,i){var o=w(r,t);o||_(r,t,o={observingCount:0});var n=function(){o.observer&&(o.observer.disconnect(),o.observer=null);var e=d();if(e){var t=u().Node;if(!!(t&&r instanceof t)){var n=new e(i);n.id=D++,n.observe(r,a),o.observer=n}}};return 0===o.observingCount&&(c.onKeyValue("MutationObserver",n),n()),o.observingCount++,function(){var e=w(r,t);e&&(e.observingCount--,e.observingCount<=0&&(e.observer&&e.observer.disconnect(),x(r,t),c.offKeyValue("MutationObserver",n)))}}function P(e){if("undefined"!=typeof Set){for(var t=e.length,n=new Set,r=new Set,a=0;a<t;a++){for(var i=e[a],o=i.addedNodes.length,s=0;s<o;s++)v.addToSet(b(i.addedNodes[s]),n);for(var c=i.removedNodes.length,u=0;u<c;u++)v.addToSet(b(i.removedNodes[u]),r)}f(E(h.toArray(r))),l(E(h.toArray(n)))}}function M(e){for(var t=e.length,n=0;n<t;n++){var r=e[n];if("attributes"===r.type){var a=r.target,i=r.attributeName,o=r.oldValue;s.dispatchNodeAttributeChange(a,i,o)}}}var q={subtree:!0,childList:!0},C={attributes:!0,attributeOldValue:!0};function j(r,a,i){return y(function(e,t){return 11===e.nodeType?Function.prototype:(n=i?S(e,a,C,M):S(p(),a,q,P),function(e,t,n){var r=p(),a=w(r,t);a||_(r,t,a=new Map);var i=a.get(e);i||(i=[],a.set(e,i)),i.push(n)}(e,r,t),function(){n(),function(e,t,n){var r=p(),a=w(r,t);if(a){var i=a.get(e);i&&(g(i,n),0===i.length&&(a.delete(e),0===a.size&&x(r,t)))}}(e,r,t)});var n})}function T(i,o){return y(function(e,n){if(!m(e))throw new Error("Global mutation listeners must pass a documentElement");var r=p(),t=w(r,i);t||_(r,i,t={listeners:[]});var a=t.listeners;return 0===a.length&&(t.removeListener=o(r,function(){})),a.push(n),function(){var e=w(r,i);if(e){var t=e.listeners;g(t,n),0===t.length&&(e.removeListener(),x(r,i))}}})}var I="domMutation",A=I+"InsertionData",K=I+"RemovalData",R=I+"AttributeChangeData",B=I+"DocumentInsertionData",F=I+"DocumentRemovalData",H=I+"DocumentAttributeChangeData",U=I+"TreeData";l=k(V(A,B)),f=k(V(K,F));var z=k(V(R,H)),G=j(A,U),W=j(K,U),Y=j(R,"domMutationAttributeData",!0),$=T(B,G),Q=T(F,W),J=T(H,Y);s={dispatchNodeInsertion:function(e,t){var n=new Set;v.addToSet(b(e),n);var r=E(h.toArray(n));l(r,t)},dispatchNodeRemoval:function(e,t){var n=new Set;v.addToSet(b(e),n);var r=E(h.toArray(n));f(r,t)},dispatchNodeAttributeChange:function(e,t,n,r){z([{target:e,attributeName:t,oldValue:n}],r)},onNodeInsertion:G,onNodeRemoval:W,onNodeAttributeChange:Y,onRemoval:Q,onInsertion:$,onAttributeChange:J},r.exports=a.domMutate=s}(0,e,0,n)}),define("can-control",["require","exports","module","can-construct","can-namespace","can-assign","can-stache-key","can-reflect","can-observation","can-event-queue/map/map","can-log/dev/dev","can-string","can-key/get/get","can-dom-mutate","can-symbol"],function(e,t,n){"use strict";var r,s,a=e("can-construct"),i=e("can-namespace"),o=e("can-assign"),c=e("can-stache-key"),u=e("can-reflect"),l=e("can-observation"),d=e("can-event-queue/map/map"),f=e("can-log/dev/dev"),p=e("can-string"),h=e("can-key/get/get"),v=e("can-dom-mutate"),g=e("can-symbol").for("can.controls"),y=[].slice,m=/\{([^\}]+)\}/g,b=function(e,t,n,r){return r?(c=e,u=r.trim(),l=t,f=n,d.on.call(c,l,u,f),function(){d.off.call(c,l,u,f)}):(a=e,i=t,o=n,d.on.call(a,i,o,s),function(){d.off.call(a,i,o,s)});var a,i,o,s,c,u,l,f},w=a.extend("Control",{setup:function(){if(a.setup.apply(this,arguments),w){var e,t=this;for(e in t.actions={},t.prototype)t._isAction(e)&&(t.actions[e]=t._action(e))}},_shifter:function(t,n){var r="string"==typeof n?t[n]:n;"function"!=typeof r&&(r=t[r]);var a=this;function e(){var e=a.wrapElement(this);return t.called=n,r.apply(t,[e].concat(y.call(arguments,0)))}return"production"!==process.env.NODE_ENV&&Object.defineProperty(e,"name",{value:u.getName(this)+"["+n+"]"}),e},_isAction:function(e){var t=this.prototype[e],n=typeof t;return"constructor"!==e&&("function"===n||"string"===n&&"function"==typeof this.prototype[t])&&!!(w.isSpecial(e)||r[e]||/[^\w]/.test(e))},_action:function(r,i,t){var e,o;if(m.lastIndex=0,i||!m.test(r)){var n=function(){var a,e=r.replace(m,function(e,t){var n,r;return this._isDelegate(i,t)?(a=this._getDelegate(i,t),""):(t=this._removeDelegateFromKey(t),r=this._lookup(i)[0],void 0===(n=c.read(r,c.reads(t),{readCompute:!1}).value)&&"undefined"!=typeof window&&(n=h(window,t)),r&&(u.isObservableLike(r)&&u.isMapLike(r)||n)?"string"==typeof n?n:(a=n,""):(o=!0,null))}.bind(this)),t=(e=e.trim()).split(/\s+/g),n=t.pop();return{processor:this.processors[n]||s,parts:[e,t.join(" "),n],delegate:a||void 0}};if("production"!==process.env.NODE_ENV&&Object.defineProperty(n,"name",{value:u.getName(t||this.prototype)+"["+r+"].actionData"}),e=new l(n,this),t){var a=function(e){t._bindings.control[r](t.element),t._bindings.control[r]=e.processor(e.delegate||t.element,e.parts[2],e.parts[1],r,t)};"production"!==process.env.NODE_ENV&&Object.defineProperty(a,"name",{value:u.getName(t)+"["+r+"].handler"}),u.onValue(e,a,"mutate"),"production"!==process.env.NODE_ENV&&o&&f.log("can-control: No property found for handling "+r),t._bindings.readyComputes[r]={compute:e,handler:a}}return e.get()}},_lookup:function(e){return[e,window]},_removeDelegateFromKey:function(e){return e},_isDelegate:function(e,t){return"element"===t},_getDelegate:function(e,t){},processors:{},defaults:{},convertElement:function(e){return e="string"==typeof e?document.querySelector(e):e,this.wrapElement(e)},wrapElement:function(e){return e},unwrapElement:function(e){return e},isSpecial:function(e){return"inserted"===e||"removed"===e}},{setup:function(e,t){var n,r=this.constructor,a=r.pluginName||r.shortName;if(!e)throw new Error("Creating an instance of a named control without passing an element");if(this.element=r.convertElement(e),a&&"Control"!==a&&this.element.classList&&this.element.classList.add(a),(n=this.element[g])||(n=[],this.element[g]=n),n.push(this),u.isObservableLike(t)&&u.isMapLike(t)){for(var i in r.defaults)t.hasOwnProperty(i)||c.set(t,i,r.defaults[i]);this.options=t}else this.options=o(o({},r.defaults),t);return this.on(),[this.element,this.options]},on:function(e,t,n,r){if(e)return"string"==typeof e&&(r=n,n=t,t=e,e=this.element),void 0===r&&(r=n,n=t,t=null),"string"==typeof r&&(r=w._shifter(this,r)),this._bindings.user.push(b(e,n,r,t)),this._bindings.user.length;this.off();var a,i,o=this.constructor,s=this._bindings,c=o.actions,u=this.constructor.unwrapElement(this.element),l=w._shifter(this,"destroy");for(a in c)c.hasOwnProperty(a)&&(i=c[a]||o._action(a,this.options,this))&&(s.control[a]=i.processor(i.delegate||u,i.parts[2],i.parts[1],a,this));var f=v.onNodeRemoval(u,function(){var e=u.ownerDocument,t=e.contains?e:e.documentElement;t&&!1!==t.contains(u)||l()});return s.user.push(function(){f&&(f(),f=void 0)}),s.user.length},off:function(){var t=this.constructor.unwrapElement(this.element),e=this._bindings;e&&((e.user||[]).forEach(function(e){e(t)}),u.eachKey(e.control||{},function(e){e(t)}),u.eachKey(e.readyComputes||{},function(e){u.offValue(e.compute,e.handler,"mutate")})),this._bindings={user:[],control:{},readyComputes:{}}},destroy:function(){if(null!==this.element){var e,t=this.constructor,n=t.pluginName||t.shortName&&p.underscore(t.shortName);this.off(),n&&"can_control"!==n&&this.element.classList&&this.element.classList.remove(n),(e=this.element[g])&&e.splice(e.indexOf(this),1),this.element=null}else"production"!==process.env.NODE_ENV&&f.warn("can-control: Control already destroyed")}});r=w.processors,s=function(e,t,n,r,a){return b(e,t,w._shifter(a,r),n)},["beforeremove","change","click","contextmenu","dblclick","keydown","keyup","keypress","mousedown","mousemove","mouseout","mouseover","mouseup","reset","resize","scroll","select","submit","focusin","focusout","mouseenter","mouseleave","touchstart","touchmove","touchcancel","touchend","touchleave","inserted","removed","dragstart","dragenter","dragover","dragleave","drag","drop","dragend"].forEach(function(e){r[e]=s}),n.exports=i.Control=w}),define("can-component/control/control",["require","exports","module","can-control","can-reflect"],function(e,t,n){"use strict";var a=e("can-control"),r=e("can-reflect"),i=/\{([^\}]+)\}/g,o=a.extend({_lookup:function(e){return[e.scope,e,window]},_removeDelegateFromKey:function(e){return e.replace(/^(scope|^viewModel)\./,"")},_isDelegate:function(e,t){return"scope"===t||"viewModel"===t},_getDelegate:function(e,t){return e[t]},_action:function(e,t,n){var r;return i.lastIndex=0,r=i.test(e),!n&&r?void 0:a._action.apply(this,arguments)}},{setup:function(e,t){return this.scope=t.scope,this.viewModel=t.viewModel,a.prototype.setup.call(this,e,t)},off:function(){this._bindings&&r.eachKey(this._bindings.readyComputes||{},function(e){r.offValue(e.compute,e.handler)}),a.prototype.off.apply(this,arguments),this._bindings.readyComputes={}},destroy:function(){a.prototype.destroy.apply(this,arguments),"function"==typeof this.options.destroy&&this.options.destroy.apply(this,arguments)}});n.exports=o}),define("can-attribute-encoder",["require","exports","module","can-namespace","can-log/dev/dev"],function(e,t,n){"use strict";var r=e("can-namespace"),a=e("can-log/dev/dev");var i,o=(i={},function(e,t){for(var n=0;n<e.length;n++)t(e[n],n)}("allowReorder,attributeName,attributeType,autoReverse,baseFrequency,baseProfile,calcMode,clipPathUnits,contentScriptType,contentStyleType,diffuseConstant,edgeMode,externalResourcesRequired,filterRes,filterUnits,glyphRef,gradientTransform,gradientUnits,kernelMatrix,kernelUnitLength,keyPoints,keySplines,keyTimes,lengthAdjust,limitingConeAngle,markerHeight,markerUnits,markerWidth,maskContentUnits,maskUnits,patternContentUnits,patternTransform,patternUnits,pointsAtX,pointsAtY,pointsAtZ,preserveAlpha,preserveAspectRatio,primitiveUnits,repeatCount,repeatDur,requiredExtensions,requiredFeatures,specularConstant,specularExponent,spreadMethod,startOffset,stdDeviation,stitchTiles,surfaceScale,systemLanguage,tableValues,textLength,viewBox,viewTarget,xChannelSelector,yChannelSelector".split(","),function(e){i[e]=!0}),i);function s(e,t,n){return t+"-"+n.toLowerCase()}function c(e,t){return 0===e.indexOf(t)}function u(e,t){return e.length-e.lastIndexOf(t)===t.length}var l={leftParens:/\(/g,rightParens:/\)/g,leftBrace:/\{/g,rightBrace:/\}/g,camelCase:/([a-z]|[0-9]|^)([A-Z])/g,forwardSlash:/\//g,space:/\s/g,uppercase:/[A-Z]/g,uppercaseDelimiterThenChar:/:u:([a-z])/g,caret:/\^/g,dollar:/\$/g,at:/@/g},f=":u:",d=":s:",p=":f:",h=":lp:",v=":rp:",g=":lb:",y=":rb:",m=":c:",b=":d:",w=":at:",_={encode:function(e){var t=e;return!o[t]&&t.match(l.camelCase)&&(c(t,"on:")||u(t,":to")||u(t,":from")||u(t,":bind")||u(t,":raw")?t=t.replace(l.uppercase,function(e){return f+e.toLowerCase()}):(c(t,"(")||c(t,"{"))&&(t=t.replace(l.camelCase,s),"production"!==process.env.NODE_ENV&&a.warn("can-attribute-encoder: Found attribute with name: "+e+". Converting to: "+t+"."))),t=t.replace(l.space,d).replace(l.forwardSlash,p).replace(l.leftParens,h).replace(l.rightParens,v).replace(l.leftBrace,g).replace(l.rightBrace,y).replace(l.caret,m).replace(l.dollar,b).replace(l.at,w)},decode:function(e){var t=e;return!o[t]&&l.uppercaseDelimiterThenChar.test(t)&&(c(t,"on:")||u(t,":to")||u(t,":from")||u(t,":bind")||u(t,":raw"))&&(t=t.replace(l.uppercaseDelimiterThenChar,function(e,t){return t.toUpperCase()})),t=t.replace(h,"(").replace(v,")").replace(g,"{").replace(y,"}").replace(p,"/").replace(d," ").replace(m,"^").replace(b,"$").replace(w,"@")}};if(r.encoder)throw new Error("You can't have two versions of can-attribute-encoder, check your dependencies");n.exports=r.encoder=_}),define("can-view-parser",["require","exports","module","can-namespace","can-log/dev/dev","can-attribute-encoder"],function(e,t,n){"use strict";var r=e("can-namespace"),m=e("can-log/dev/dev"),s=e("can-attribute-encoder");function b(e,t){for(var n=0;n<e.length;n++)t(e[n],n)}function a(e){var t={};return b(e.split(","),function(e){t[e]=!0}),t}if("production"!==process.env.NODE_ENV)var w=function(e){return e.split("\n").length-1};var i="A-Za-z0-9",o="-:_"+i,_="{{",x=new RegExp("^<\\/(["+o+"]+)[^>]*>"),E=new RegExp("\\{\\{(![\\s\\S]*?!|[\\s\\S]*?)\\}\\}\\}?","g"),f=/\s/,d=new RegExp("["+i+"]"),p=new RegExp("["+o+"]+s*=s*(\"[^\"]*\"|'[^']*')"),k=a("area,base,basefont,br,col,frame,hr,img,input,isindex,link,meta,param,embed"),O=a("altGlyph,altGlyphDef,altGlyphItem,animateColor,animateMotion,animateTransform,clipPath,feBlend,feColorMatrix,feComponentTransfer,feComposite,feConvolveMatrix,feDiffuseLighting,feDisplacementMap,feDistantLight,feFlood,feFuncA,feFuncB,feFuncG,feFuncR,feGaussianBlur,feImage,feMerge,feMergeNode,feMorphology,feOffset,fePointLight,feSpecularLighting,feSpotLight,feTile,feTurbulence,foreignObject,glyphRef,linearGradient,radialGradient,textPath"),N=a("colgroup,dd,dt,li,options,p,td,tfoot,th,thead,tr"),L=a("script"),V="start,end,close,attrStart,attrEnd,attrValue,chars,comment,special,done".split(","),l={"{":"}","(":")"},D=function(){},S=function(e,a,t){if("object"==typeof e)return function(e,t){for(var n=0,r=e.length;n<r;n++){var a=e[n];t[a.tokenType].apply(t,a.args)}return e}(e,a);var r=[];function n(e,t,n,r){t=O[t]?t:t.toLowerCase(),N[t]&&p.last()===t&&i("",t),r=k[t]||!!r,a.start(t,r,f),r||p.push(t),S.parseAttrs(n,a,f),"production"!==process.env.NODE_ENV&&(f+=w(e)),a.end(t,r,f),"html"===t&&(u=!0)}function i(e,t){var n;if(t)for(t=O[t]?t:t.toLowerCase(),n=p.length-1;0<=n&&p[n]!==t;n--);else n=0;if("production"!==process.env.NODE_ENV&&(void 0===e?0<p.length&&(a.filename?m.warn(a.filename+": expected closing tag </"+p[n]+">"):m.warn("expected closing tag </"+p[n]+">")):(n<0||n!==p.length-1)&&(0<p.length?a.filename?m.warn(a.filename+":"+f+": unexpected closing tag "+e+" expected </"+p[p.length-1]+">"):m.warn(f+": unexpected closing tag "+e+" expected </"+p[p.length-1]+">"):a.filename?m.warn(a.filename+":"+f+": unexpected closing tag "+e):m.warn(f+": unexpected closing tag "+e))),0<=n){for(var r=p.length-1;n<=r;r--)a.close&&a.close(p[r],f);p.length=n,"body"===t&&(u=!0)}}function o(e,t){a.special&&a.special(t,f)}a=a||{},t&&b(V,function(t){var n=a[t]||D;a[t]=function(){if(!1!==n.apply(this,arguments)){var e=arguments.length;void 0===arguments[e-1]&&(e=arguments.length-1),"production"!==process.env.NODE_ENV&&(e=arguments.length),r.push({tokenType:t,args:[].slice.call(arguments,0,e)})}}});var s,c,u,l,f,d=function(){v&&!u&&(a.chars&&a.chars(v,f),"production"!==process.env.NODE_ENV&&(f+=w(v))),u=!1,v=""},p=[],h=e,v="";for("production"!==process.env.NODE_ENV&&(f=1),p.last=function(){return this[this.length-1]};e;){if(c=!0,p.last()&&L[p.last()])e=e.replace(new RegExp("([\\s\\S]*?)</"+p.last()+"[^>]*>"),function(e,t){return t=t.replace(/<!--([\s\S]*?)-->|<!\[CDATA\[([\s\S]*?)]]>/g,"$1$2"),a.chars&&a.chars(t,f),"production"!==process.env.NODE_ENV&&(f+=w(t)),""}),i("",p.last());else{if(0===e.indexOf("\x3c!--"))0<=(s=e.indexOf("--\x3e"))&&(d(),a.comment&&a.comment(e.substring(4,s),f),"production"!==process.env.NODE_ENV&&(f+=w(e.substring(0,s+3))),e=e.substring(s+3),c=!1);else if(0===e.indexOf("</"))(l=e.match(x))&&(d(),l[0].replace(x,i),"production"!==process.env.NODE_ENV&&(f+=w(e.substring(0,l[0].length))),e=e.substring(l[0].length),c=!1);else if(0===e.indexOf("<")){var g=S.searchStartTag(e);g&&(d(),n.apply(null,g.match),e=g.html,c=!1)}else 0===e.indexOf(_)&&(l=e.match(E))&&(d(),l[0].replace(E,o),"production"!==process.env.NODE_ENV&&(f+=w(e.substring(0,l[0].length))),e=e.substring(l[0].length));if(c){0===(s=P(e,_))&&e===h&&(v+=e.charAt(0),e=e.substr(1),s=P(e,_));var y=s<0?e:e.substring(0,s);e=s<0?"":e.substring(s),y&&(v+=y)}}if(e===h)throw new Error("Parse Error: "+e);h=e}return d(),i(),a.done(f),r},h=function(e,t,n,r,a){var i=r.substring("number"==typeof e.nameStart?e.nameStart:t,t),o=s.encode(i);e.attrStart=o,n.attrStart(e.attrStart,a),e.inName=!1},v=function(e,t,n,r,a){if(void 0!==e.valueStart&&e.valueStart<t){var i,o,s=r.substring(e.valueStart,t);if("production"!==process.env.NODE_ENV)o=(i=(i=r.substring(e.valueStart-1,t+1)).trim()).charAt(i.length-1),e.inQuote!==o&&(n.filename?m.warn(n.filename+":"+a+": End quote is missing for "+s):m.warn(a+": End quote is missing for "+s));n.attrValue(s,a)}n.attrEnd(e.attrStart,a),e.attrStart=void 0,e.valueStart=void 0,e.inValue=!1,e.inName=!1,e.lookingForEq=!1,e.inQuote=!1,e.lookingForName=!0},P=function(e,t){for(var n=t.length,r=0,a=e.length;r<a;r++)if("<"===e[r]||e.substr(r,n)===t)return r;return-1};S.parseAttrs=function(e,t,n){if(e){for(var r,a=0,i={inName:!1,nameStart:void 0,inValue:!1,valueStart:void 0,inQuote:!1,attrStart:void 0,lookingForName:!0,lookingForValue:!1,lookingForEq:!1};a<e.length;){r=a;var o=e.charAt(a);if(a++,_===e.substr(r,_.length)){i.inValue&&r>i.valueStart?t.attrValue(e.substring(i.valueStart,r),n):i.inName&&i.nameStart<r?(h(i,r,t,e,n),v(i,r,t,e,n)):i.lookingForValue?i.inValue=!0:i.lookingForEq&&i.attrStart&&v(i,r,t,e,n),E.lastIndex=r;var s=E.exec(e);s&&(t.special(s[1],n),a=r+s[0].length,i.inValue&&(i.valueStart=r+s[0].length))}else if(i.inValue)i.inQuote?o===i.inQuote&&v(i,r,t,e,n):f.test(o)&&v(i,r,t,e,n);else if("="===o&&(i.lookingForEq||i.lookingForName||i.inName))i.attrStart||h(i,r,t,e,n),i.lookingForValue=!0,i.lookingForEq=!1,i.lookingForName=!1;else if(i.inName){var c,u=e[i.nameStart];l[u]===o?(c=l["{"===u?"(":"{"],e[r+1]===c?(h(i,r+2,t,e,n),a++):h(i,r+1,t,e,n),i.lookingForEq=!0):f.test(o)&&"{"!==u&&"("!==u&&(h(i,r,t,e,n),i.lookingForEq=!0)}else i.lookingForName?f.test(o)||(i.attrStart&&v(i,r,t,e,n),i.nameStart=r,i.inName=!0):i.lookingForValue&&(f.test(o)?a===e.length&&v(i,r,t,e,n):(i.lookingForValue=!1,i.inValue=!0,i.valueStart="'"===o||'"'===o?(i.inQuote=o,r+1):r))}i.inName?(h(i,r+1,t,e,n),v(i,r+1,t,e,n)):(i.lookingForEq||i.lookingForValue||i.inValue)&&v(i,r+1,t,e,n),E.lastIndex=0}},S.searchStartTag=function(e){for(var t=e.indexOf(">"),n=p.exec(e.substring(1)),r=1;n&&t>=r+n.index;){for(r+=n.index+n[0].length;t<r;)t+=e.substring(t+1).indexOf(">")+1;n=p.exec(e.substring(r))}if(-1===t||!d.test(e[1]))return null;var a,i,o="",s="",c=e.substring(0,t+1),u="/"===c[c.length-2],l=c.search(f);return i=u?(s="/",c.substring(1,c.length-2).trim()):c.substring(1,c.length-1).trim(),-1===l?a=i:(l--,a=i.substring(0,l),o=i.substring(l)),{match:[c,a,o,s],html:e.substring(c.length)}},n.exports=r.HTMLParser=S}),define("can-dom-mutate/node/node",["require","exports","module","can-globals","can-namespace","can-dom-mutate","can-dom-mutate/-util"],function(e,t,n){!function(e,t,n,r){"use strict";var a=t("can-globals"),i=t("can-namespace"),o=t("can-dom-mutate"),s=t("can-dom-mutate/-util"),c=s.isInDocument,u=s.getParents,l={dispatchNodeInsertion:function(e,t){c(t)&&o.dispatchNodeInsertion(t)},dispatchNodeRemoval:function(e,t){c(e)&&!c(t)&&o.dispatchNodeRemoval(t)}},f={replaceChild:function(e,t){var n=u(e),r=this.replaceChild(e,t);l.dispatchNodeRemoval(this,t);for(var a=0;a<n.length;a++)l.dispatchNodeInsertion(this,n[a]);return r},setAttribute:function(e,t){var n=this.getAttribute(e),r=this.setAttribute(e,t);return n!==this.getAttribute(e)&&o.dispatchNodeAttributeChange(this,e,n),r},removeAttribute:function(e){var t=this.getAttribute(e),n=this.removeAttribute(e);return t&&o.dispatchNodeAttributeChange(this,e,t),n}};[["appendChild","Insertion"],["insertBefore","Insertion"],["removeChild","Removal"]].forEach(function(e){var a=e[0],i="dispatchNode"+e[1];f[a]=function(e){for(var t=u(e),n=this[a].apply(this,arguments),r=0;r<t.length;r++)l[i](this,t[r]);return n}});var d={};["appendChild","insertBefore","removeChild","replaceChild","setAttribute","removeAttribute"].forEach(function(e){d[e]=function(){return this[e].apply(this,arguments)}});var p={};function h(e){var t=e?d:f;for(var n in t)p[n]=t[n]}var v="MutationObserver";h(a.getKeyValue(v)),a.onKeyValue(v,h),r.exports=i.domMutateNode=o.node=p}(0,e,0,n)}),define("can-dom-mutate/node",["require","exports","module","can-namespace","can-dom-mutate/node/node"],function(e,t,n){"use strict";var r=e("can-namespace"),a=e("can-dom-mutate/node/node");n.exports=r.node=a}),define("can-view-nodelist",["require","exports","module","can-namespace","can-dom-mutate/node"],function(e,t,n){"use strict";var r=e("can-namespace"),a=e("can-dom-mutate/node"),o=new Map,s=[].splice,c=[].push,u=function(e){for(var t=0,n=0,r=e.length;n<r;n++){var a=e[n];a.nodeType?t++:t+=u(a)}return t},l={update:function(e,t,n){n||(n=l.unregisterChildren(e));for(var r=[],a=0,i=r.length=t.length;a<i;a++)r[a]=t[a];t=r;var o=e.length;return s.apply(e,[0,o].concat(t)),e.replacements?(l.nestReplacements(e),e.deepChildren=e.newDeepChildren,e.newDeepChildren=[]):l.nestList(e),n},nestReplacements:function(e){for(var t,n=0,r=function(e){for(var t=new Map,n=0,r=e.length;n<r;n++){var a=l.first(e[n]);t.set(a,e[n])}return t}(e.replacements),a=e.replacements.length;n<e.length&&a;){var i=e[n],o=r.get(i);o&&(r.delete(i),e.splice(n,u(o),o),a--),n++}a&&(t=e,r.forEach(function(e){t.newDeepChildren.push(e)})),e.replacements=[]},nestList:function(e){for(var t=0;t<e.length;){var n=e[t],r=o.get(n);r?r!==e&&e.splice(t,u(r),r):o.set(n,e),t++}},last:function(e){var t=e[e.length-1];return t.nodeType?t:l.last(t)},first:function(e){var t=e[0];return t.nodeType?t:l.first(t)},flatten:function(e){for(var t=[],n=0;n<e.length;n++){var r=e[n];r.nodeType?t.push(r):t.push.apply(t,l.flatten(r))}return t},register:function(e,t,n,r){return e.unregistered=t,e.parentList=n,e.nesting=n&&void 0!==n.nesting?n.nesting+1:0,n?(e.deepChildren=[],e.newDeepChildren=[],e.replacements=[],!0!==n&&(r?n.replacements.push(e):n.newDeepChildren.push(e))):l.nestList(e),e},unregisterChildren:function(e){for(var t=[],n=0;n<e.length;n++){var r=e[n];r.nodeType?(e.replacements||o.delete(r),t.push(r)):c.apply(t,l.unregister(r,!0))}var a=e.deepChildren;if(a)for(var i=0;i<a.length;i++)l.unregister(a[i],!0);return t},unregister:function(e,t){var n=l.unregisterChildren(e,!0);if(e.isUnregistered=!0,e.unregistered){var r=e.unregistered;if(e.replacements=e.unregistered=null,!t){var a=e.parentList&&e.parentList.deepChildren;if(a){var i=a.indexOf(e);-1!==i&&a.splice(i,1)}}r()}return n},after:function(e,t){var n=e[e.length-1];n.nextSibling?a.insertBefore.call(n.parentNode,t,n.nextSibling):a.appendChild.call(n.parentNode,t)},replace:function(e,t){var n,r=e[0].parentNode;"SELECT"===r.nodeName.toUpperCase()&&0<=r.selectedIndex&&(n=r.value),1===e.length?a.replaceChild.call(r,t,e[0]):(l.after(e,t),l.remove(e)),void 0!==n&&(r.value=n)},remove:function(e){for(var t=e[0]&&e[0].parentNode,n=0;n<e.length;n++)a.removeChild.call(t,e[n])},nodeMap:o};n.exports=r.nodeLists=l}),define("can-child-nodes",["require","exports","module","can-namespace"],function(e,t,n){"use strict";var r=e("can-namespace");n.exports=r.childNodes=function(e){var t=e.childNodes;if("length"in t)return t;for(var n=e.firstChild,r=[];n;)r.push(n),n=n.nextSibling;return r}}),define("can-fragment",["require","exports","module","can-globals/document/document","can-namespace","can-reflect","can-child-nodes","can-symbol"],function(e,t,n){!function(e,t,n,r){"use strict";var o=t("can-globals/document/document"),a=t("can-namespace"),i=t("can-reflect"),s=t("can-child-nodes"),c=t("can-symbol"),u=/^\s*<(\w+)[^>]*>/,l={}.toString,f=c.for("can.toDOM");function d(e,t){if(e&&11===e.nodeType)return e;t?t.length&&(t=t[0]):t=o();for(var n=function(e,t,n){void 0===t&&(t=u.test(e)&&RegExp.$1),e&&"[object Function]"===l.call(e.replace)&&(e=e.replace(/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/gi,"<$1></$2>"));var r=n.createElement("div"),a=n.createElement("div");return"tbody"===t||"tfoot"===t||"thead"===t||"colgroup"===t?(a.innerHTML="<table>"+e+"</table>",r=3===a.firstChild.nodeType?a.lastChild:a.firstChild):"col"===t?(a.innerHTML="<table><colgroup>"+e+"</colgroup></table>",r=3===a.firstChild.nodeType?a.lastChild:a.firstChild.firstChild):"tr"===t?(a.innerHTML="<table><tbody>"+e+"</tbody></table>",r=3===a.firstChild.nodeType?a.lastChild:a.firstChild.firstChild):"td"===t||"th"===t?(a.innerHTML="<table><tbody><tr>"+e+"</tr></tbody></table>",r=3===a.firstChild.nodeType?a.lastChild:a.firstChild.firstChild.firstChild):"option"===t?(a.innerHTML="<select>"+e+"</select>",r=3===a.firstChild.nodeType?a.lastChild:a.firstChild):r.innerHTML=""+e,[].slice.call(s(r))}(e,void 0,t),r=(t||document).createDocumentFragment(),a=0,i=n.length;a<i;a++)r.appendChild(n[a]);return r}var p=function(e,t){var n,r=t||o();if(e&&"string"!=typeof e){if("function"==typeof e[f])return p(e[f]());if(11===e.nodeType)return e;if("number"==typeof e.nodeType)return(n=r.createDocumentFragment()).appendChild(e),n;i.isListLike(e)?(n=r.createDocumentFragment(),i.eachIndex(e,function(e){n.appendChild(p(e))})):n=d(""+e,r)}else n=d(null==e?"":""+e,r);return s(n).length||n.appendChild(r.createTextNode("")),n};r.exports=a.fragment=a.frag=p}(0,e,0,n)}),define("can-view-callbacks",["require","exports","module","can-observation-recorder","can-log/dev/dev","can-globals/global/global","can-dom-mutate/node","can-namespace","can-view-nodelist","can-fragment","can-globals","can-symbol","can-reflect"],function(e,t,n){!function(e,t,n,r){"use strict";var f=t("can-observation-recorder"),d=t("can-log/dev/dev"),p=t("can-globals/global/global"),h=t("can-dom-mutate/node"),a=t("can-namespace"),v=t("can-view-nodelist"),g=t("can-fragment"),l=t("can-globals"),i=t("can-symbol"),o=t("can-reflect"),s=i.for("can.callbackMap");if("production"!==process.env.NODE_ENV)var c={};var y,m={},b=new WeakMap,w=function(e){var t=e.tagName&&e.tagName.toLowerCase();m[t]&&V.tagHandler(e,t,{})},_=function(e){var t;if(w(e),e.getElementsByTagName){t=e.getElementsByTagName("*");for(var n,r=0;void 0!==(n=t[r]);r++)_(n)}},x=!1,u=function(t,e){if(!e){var n=E[t];if(!n)for(var r=0,a=k.length;r<a;r++){var i=k[r];if(i.match.test(t))return i.handler}return"production"!==process.env.NODE_ENV&&(c[t]=!0),n}"string"==typeof t?(E[t]=e,"production"!==process.env.NODE_ENV&&c[t]&&d.warn("can-view-callbacks: "+t+" custom attribute behavior requested before it was defined. Make sure "+t+" is defined before it is needed.")):(k.push({match:t,handler:e}),"production"!==process.env.NODE_ENV&&Object.keys(c).forEach(function(e){t.test(e)&&d.warn("can-view-callbacks: "+e+" custom attribute behavior requested before it was defined. Make sure "+e+" is defined before it is needed.")}))},E={},k=[],O=new WeakMap,N=/[-\:]/,L=function(){},V={_tags:m,_attributes:E,_regExpAttributes:k,defaultCallback:L,tag:function(e,t){var n;if(!t)return null===t?delete m[e.toLowerCase()]:n=m[e.toLowerCase()],!n&&N.test(e)&&(n=L),n;var r,a,i=p(),o=N.test(e),s=void 0!==m[e.toLowerCase()];if("production"!==process.env.NODE_ENV&&(s&&d.warn("Custom tag: "+e.toLowerCase()+" is already defined"),o||"content"===e||d.warn("Custom tag: "+e.toLowerCase()+" hyphen missed")),i.html5&&(i.html5.elements+=" "+e,i.html5.shivDocument()),m[e.toLowerCase()]=t,null!=(a=l.getKeyValue("document"))&&null!=a.documentElement&&"false"!==a.documentElement.getAttribute("data-can-automount")){var c=l.getKeyValue("customElements");if(c){if(r=c.get(e.toLowerCase()),o&&!r){var u=function(){return Reflect.construct(HTMLElement,[],u)};u.prototype=Object.create(HTMLElement.prototype),u.prototype.connectedCallback=function(){V.tagHandler(this,e.toLowerCase(),{})},c.define(e,u)}}else!function(){if(!x){var e=l.getKeyValue("MutationObserver");e&&((y=new e(function(e){for(var t,n,r=0;void 0!==(n=e[r]);r++)if("childList"===n.type){t=n.addedNodes;for(var a,i=0;void 0!==(a=t[i]);i++)_(a)}})).observe(p().document.documentElement,{childList:!0,subtree:!0}),x=!0)}}(),function(e){for(var t,n=p().document.getElementsByTagName(e),r=0;void 0!==(t=n[r]);r++)w(t)}(e)}else x&&y.disconnect()},attr:u,attrs:function(e){var t=o.getKeyValue(e,s)||e;O.has(t)||(O.set(t,!0),o.eachKey(t,function(e,t){u(t,e)}))},tagHandler:function(e,t,n){if(!b.has(e)){var r,a=n.scope,i=a&&a.templateContext.tags.get(t)||m[t];if(i?(r=f.ignore(i)(e,n),b.set(e,!0)):r=a,"production"!==process.env.NODE_ENV&&!i){var o=p(),s=o.document.createElement(t).constructor;s!==o.HTMLElement&&s!==o.HTMLUnknownElement||d.warn("can-view-callbacks: No custom element found for "+t)}if(r&&n.subtemplate){a!==r&&(a=a.add(r));var c=v.register([],void 0,n.parentNodeList||!0,!1);c.expression="<"+e.tagName+">";var u=n.subtemplate(a,n.options,c),l="string"==typeof u?g(u):u;h.appendChild.call(e,l)}}}};if(a.view=a.view||{},a.view.callbacks)throw new Error("You can't have two versions of can-view-callbacks, check your dependencies");r.exports=a.view.callbacks=V}(0,e,0,n)}),define("can-view-target",["require","exports","module","can-globals/document/document","can-dom-mutate/node","can-namespace","can-globals/mutation-observer/mutation-observer"],function(e,t,n){!function(e,t,n,r){"use strict";var a,i,s=t("can-globals/document/document"),h=t("can-dom-mutate/node"),o=t("can-namespace"),c=t("can-globals/mutation-observer/mutation-observer"),v=function(e,t,n,r){for(var a=r.createDocumentFragment(),i=0,o=e.length;i<o;i++){var s=e[i];a.appendChild(f(s,t,n.concat(i),r))}return a},g="undefined"!=typeof document&&(a=document.createDocumentFragment(),(i=document.createElement("div")).appendChild(document.createTextNode("")),i.appendChild(document.createTextNode("")),a.appendChild(i),2===a.cloneNode(!0).firstChild.childNodes.length),u="undefined"!=typeof document&&function(){var e=document.createElement("a");e.innerHTML="<xyz></xyz>";var t,n,r=e.cloneNode(!0),a="<xyz></xyz>"===r.innerHTML;return a?((e=document.createDocumentFragment()).appendChild(document.createTextNode("foo-bar")),(t=c())?((n=new t(function(){})).observe(document.documentElement,{childList:!0,subtree:!0}),r=e.cloneNode(!0),n.disconnect()):r=e.cloneNode(!0),1===r.childNodes.length):a}(),y="undefined"!=typeof document&&!!document.createElementNS,l=u?function(e){return e.cloneNode(!0)}:function(e){var t,n=e.ownerDocument;if(1===e.nodeType?t="http://www.w3.org/1999/xhtml"!==e.namespaceURI&&y&&n.createElementNS?n.createElementNS(e.namespaceURI,e.nodeName):n.createElement(e.nodeName):3===e.nodeType?t=n.createTextNode(e.nodeValue):8===e.nodeType?t=n.createComment(e.nodeValue):11===e.nodeType&&(t=n.createDocumentFragment()),e.attributes)for(var r=e.attributes,a=0;a<r.length;a++){var i=r[a];i&&i.specified&&(i.namespaceURI?t.setAttributeNS(i.namespaceURI,i.nodeName||i.name,i.nodeValue||i.value):t.setAttribute(i.nodeName||i.name,i.nodeValue||i.value))}if(e&&e.firstChild)for(var o=e.firstChild;o;)t.appendChild(l(o)),o=o.nextSibling;return t};function f(t,e,n,r){var a,i,o,s,c,u=n,l=typeof t,f=function(){return a||(a={path:n,callbacks:[]},e.push(a),u=[]),a};if("object"===l){if(t.tag){if(i=y&&t.namespace?r.createElementNS(t.namespace,t.tag):r.createElement(t.tag),t.attrs)for(var d in t.attrs){var p=t.attrs[d];"function"==typeof p?f().callbacks.push({callback:p}):null!==p&&"object"==typeof p&&p.namespaceURI?i.setAttributeNS(p.namespaceURI,d,p.value):h.setAttribute.call(i,d,p)}if(t.attributes)for(s=0,c=t.attributes.length;s<c;s++)f().callbacks.push({callback:t.attributes[s]});t.children&&t.children.length&&(o=a?a.paths=[]:e,i.appendChild(v(t.children,o,u,r)))}else if(t.comment&&(i=r.createComment(t.comment),t.callbacks))for(s=0,c=t.attributes.length;s<c;s++)f().callbacks.push({callback:t.callbacks[s]})}else"string"===l?i=r.createTextNode(t):"function"===l&&(g?(i=r.createTextNode(""),f().callbacks.push({callback:t})):(i=r.createComment("~"),f().callbacks.push({callback:function(){var e=r.createTextNode("");return h.replaceChild.call(this.parentNode,e,this),t.apply(e,arguments)}})));return i}function d(e,t,n){for(var r=t.path,a=t.callbacks,i=t.paths,o=e,s=r?r.length:0,c=i?i.length:0,u=0;u<s;u++)o=o.childNodes.item(r[u]);for(u=0;u<c;u++)d(o,i[u],n);n.push({element:o,callbacks:a})}function p(e,t){var o=[],n=v(e,o,[],t||s());return{paths:o,clone:n,hydrate:function(){for(var e=l(this.clone),t=[],n=0,r=t.length=arguments.length;n<r;n++)t[n]=arguments[n];for(var a=[],i=0;i<o.length;i++)d(e,o[i],a);return function(e,t){for(var n,r,a,i=e.length,o=0;o<i;o++){n=(a=e[o]).callbacks.length,r=a.element;for(var s=0;s<n;s++)a.callbacks[s].callback.apply(r,t)}}(a,t),e}}}p.keepsTextNodes=g,p.cloneNode=l,o.view=o.view||{},r.exports=o.view.target=p}(0,e,0,n)}),define("can-view-scope/template-context",["require","exports","module","can-simple-map"],function(e,t,n){"use strict";var r=e("can-simple-map");n.exports=function(e){e=e||{},this.vars=new r(e.vars||{}),this.helpers=new r(e.helpers||{}),this.partials=new r(e.partials||{}),this.tags=new r(e.tags||{})}}),define("can-view-scope/make-compute-like",["require","exports","module","can-single-reference","can-reflect"],function(e,t,n){"use strict";var i=e("can-single-reference"),o=e("can-reflect");n.exports=function(r){var a=function(e){return arguments.length?o.setValue(this,e):o.getValue(this)}.bind(r);return"production"!==process.env.NODE_ENV&&Object.defineProperty(a,"name",{value:"Compute<"+o.getName(r)+">"}),a.on=a.bind=a.addEventListener=function(e,n){var t=function(e,t){n.call(a,{type:"change"},e,t)};i.set(n,this,t),r.on(t)},a.off=a.unbind=a.removeEventListener=function(e,t){r.off(i.getAndDelete(t,this))},o.assignSymbols(a,{"can.getValue":function(){return o.getValue(r)},"can.setValue":function(e){return o.setValue(r,e)},"can.onValue":function(e,t){return o.onValue(r,e,t)},"can.offValue":function(e,t){return o.offValue(r,e,t)},"can.valueHasDependencies":function(){return o.valueHasDependencies(r)},"can.getPriority":function(){return o.getPriority(r)},"can.setPriority":function(e){o.setPriority(r,e)},"can.isValueLike":!0,"can.isFunctionLike":!1}),a.isComputed=!0,a}}),define("can-stache-helpers",["require","exports","module","can-namespace"],function(e,t,n){"use strict";var r=e("can-namespace");if(r.stacheHelpers)throw new Error("You can't have two versions of can-stache-helpers, check your dependencies");n.exports=r.stacheHelpers={}}),define("can-view-scope/scope-key-data",["require","exports","module","can-observation","can-stache-key","can-assign","can-reflect","can-symbol","can-observation-recorder","can-view-scope/make-compute-like","can-reflect-dependencies","can-event-queue/value/value","can-stache-helpers","can-simple-observable","can-log/dev/dev"],function(e,t,n){"use strict";var r,i=e("can-observation"),l=e("can-stache-key"),o=e("can-assign"),s=e("can-reflect"),a=e("can-symbol"),c=e("can-observation-recorder"),u=e("can-view-scope/make-compute-like"),f=e("can-reflect-dependencies"),d=e("can-event-queue/value/value"),p=e("can-stache-helpers"),h=e("can-simple-observable"),v=e("can-log/dev/dev"),g=a.for("can.dispatch"),y=c.ignore(function(e){if(e.reads&&1===e.reads.length){var t=e.root;return t&&t[a.for("can.getValue")]&&(t=s.getValue(t)),t&&s.isObservableLike(t)&&s.isMapLike(t)&&"function"!=typeof t[e.reads[0].key]&&t}});function m(e){var t=c.peekValue(e._thisArg);return s.isPrimitive(t)?e.root:t}function b(e,t,n,r){n.length?e.call(f,t,n[n.length-1].key,r):e.call(f,t,r)}"production"!==process.env.NODE_ENV&&(r=function(e){if("debugger"!==e.key&&!e.parentHasKey){var t=e.scope.peek("scope.filename"),n=e.scope.peek("scope.lineNumber"),r=l.reads(e.key),a=r[0].key,i=r.map(function(e){return e.key+(e.at?"()":"")}).join("."),o=e.scope.getPathsForKey(a),s=Object.keys(o),c=s.length&&s.indexOf(a)<0,u=[(t?t+":":"")+(n?n+": ":"")+'Unable to find key "'+i+'".'+(c?" Did you mean"+(1<s.length?" one of these":"")+"?\n":"\n")];c&&s.forEach(function(e){u.push('\t"'+e+'" which will read from'),u.push(o[e]),u.push("\n")}),u.push("\n"),v.warn.apply(v,u)}});var w=function(t,e,n){this.startingScope=t,this.key=e,this.read=this.read.bind(this),this.dispatch=this.dispatch.bind(this),"debugger"===e&&(this.startingScope={_context:p},this.read=function(){var e={scope:t};return(0,p.debugger)(e)}),"production"!==process.env.NODE_ENV&&(Object.defineProperty(this.read,"name",{value:s.getName(this)+".read"}),Object.defineProperty(this.dispatch,"name",{value:s.getName(this)+".dispatch"}));var r=this.observation=new i(this.read,this);this.options=o({observation:this.observation},n),this.fastPath=void 0,this.root=void 0,this.reads=void 0,this.setRoot=void 0,this._thisArg=new h,this.parentHasKey=void 0;var a=new Set;a.add(r),this.dependencies={valueDependencies:a},this._latestValue=void 0};function _(){this._value=this.newVal}function x(){this.value=this.newVal}d(w.prototype),o(w.prototype,{constructor:w,dispatch:function(e){var t=this.value;this._latestValue=this.value=e,this[g].call(this,this.value,t)},onBound:function(){this.bound=!0,s.onValue(this.observation,this.dispatch,"notify");var e=y(this);e&&this.toFastPath(e),this._latestValue=this.value=c.peekValue(this.observation)},onUnbound:function(){this.bound=!1,s.offValue(this.observation,this.dispatch,"notify"),this.toSlowPath()},set:function(e){var t=this.root||this.setRoot;t?this.reads.length?l.write(t,this.reads,e,this.options):s.setValue(t,e):this.startingScope.set(this.key,e,this.options)},get:function(){return c.isRecording()&&(c.add(this),this.bound||i.temporarilyBind(this)),!0===this.bound&&!0===this.fastPath?this._latestValue:c.peekValue(this.observation)},toFastPath:function(r){var a=this,e=this.observation;this.fastPath=!0,e.dependencyChange=function(e,t){if((n=t)&&"number"==typeof n.batchNum&&"string"==typeof n.type)throw"no event objects!";var n;return e===r&&"function"!=typeof t?(a._latestValue=t,this.newVal=t):a.toSlowPath(),i.prototype.dependencyChange.apply(this,arguments)},e.hasOwnProperty("_value")?e.onBound=_:e.onBound=x},toSlowPath:function(){this.observation.dependencyChange=i.prototype.dependencyChange,this.observation.onBound=i.prototype.onBound,this.fastPath=!1},read:function(){var e;if(this.root){if(e=l.read(this.root,this.reads,this.options),"production"!==process.env.NODE_ENV&&this.reads.length&&b(f.deleteMutatedBy,m(this),this.reads,this),this.thisArg=e.parent,"production"!==process.env.NODE_ENV){var t=new Set;t.add(this),b(f.addMutatedBy,e.parent||this.root,this.reads,{valueDependencies:t})}return e.value}if(e=this.startingScope.read(this.key,this.options),this.scope=e.scope,this.reads=e.reads,this.root=e.rootObserve,this.setRoot=e.setRoot,this.thisArg=e.thisArg,this.parentHasKey=e.parentHasKey,"production"!==process.env.NODE_ENV){if(e.rootObserve){var n=new Set;n.add(this),b(f.addMutatedBy,m(this),e.reads,{valueDependencies:n})}void 0===e.value&&!0===this.options.warnOnMissingKey&&r({scope:this.startingScope,key:this.key,parentHasKey:e.parentHasKey})}return e.value},hasDependencies:function(){return this.bound||i.temporarilyBind(this),s.valueHasDependencies(this.observation)}}),Object.defineProperty(w.prototype,"thisArg",{get:function(){return this._thisArg.get()},set:function(e){this._thisArg.set(e)}});var E={"can.getValue":w.prototype.get,"can.setValue":w.prototype.set,"can.valueHasDependencies":w.prototype.hasDependencies,"can.getValueDependencies":function(){return this.dependencies},"can.getPriority":function(){return s.getPriority(this.observation)},"can.setPriority":function(e){s.setPriority(this.observation,e)}};"production"!==process.env.NODE_ENV&&(E["can.getName"]=function(){return s.getName(this.constructor)+"{{"+this.key+"}}"}),s.assignSymbols(w.prototype,E),Object.defineProperty(w.prototype,"compute",{get:function(){var e=u(this);return Object.defineProperty(this,"compute",{value:e,writable:!1,configurable:!1}),e},configurable:!0}),Object.defineProperty(w.prototype,"initialValue",{get:function(){return this.bound||i.temporarilyBind(this),c.peekValue(this)},set:function(){throw new Error("initialValue should not be set")},configurable:!0}),n.exports=w}),define("can-view-scope/compute_data",["require","exports","module","can-view-scope/scope-key-data"],function(e,t,n){"use strict";var r=e("can-view-scope/scope-key-data");n.exports=function(e,t,n){return new r(e,t,n||{args:[]})}}),define("can-view-scope",["require","exports","module","can-stache-key","can-observation-recorder","can-view-scope/template-context","can-view-scope/compute_data","can-assign","can-namespace","can-reflect","can-log/dev/dev","can-define-lazy-value","can-stache-helpers","can-simple-map"],function(e,t,n){!function(e,t,n,r){"use strict";var f=t("can-stache-key"),m=t("can-observation-recorder"),a=t("can-view-scope/template-context"),i=t("can-view-scope/compute_data"),b=t("can-assign"),o=t("can-namespace"),w=t("can-reflect"),s=t("can-log/dev/dev"),c=t("can-define-lazy-value"),u=t("can-stache-helpers");function l(){return!1}var d=t("can-simple-map").extend("LetContext",{});function p(e,t,n){this._context=e,this._parent=t,this._meta=n||{},this.__cache={}}var h=/(\.\.\/)|(\.\/)|(this[\.@])/g;b(p,{read:f.read,TemplateContext:a,keyInfo:function(e){"./"===e&&(e="this");var i={remainingKey:e};if(i.isScope="scope"===e,i.isScope)return i;var t=e.substr(0,6);return i.isInScope="scope."===t||"scope@"===t,i.isInScope?i.remainingKey=e.substr(6):"scope/"===t?(i.walkScope=!0,i.remainingKey=e.substr(6)):"@scope/"===e.substr(0,7)?(i.walkScope=!0,i.remainingKey=e.substr(7)):(i.parentContextWalkCount=0,i.remainingKey=e.replace(h,function(e,t,n,r,a){return i.isContextBased=!0,void 0!==t&&i.parentContextWalkCount++,""}),".."===i.remainingKey?(i.parentContextWalkCount++,i.remainingKey="this"):"."!==i.remainingKey&&""!==i.remainingKey||(i.remainingKey="this"),"this"===i.remainingKey&&(i.isContextBased=!0)),i},isTemplateContextOrCanNotHaveProperties:function(e){var t=e._context;return t instanceof a||null==t},shouldSkipIfSpecial:function(e){return!0===(!0===e._meta.special)||!!p.isTemplateContextOrCanNotHaveProperties(e)},shouldSkipEverythingButSpecial:function(e){return!1===(!0===e._meta.special)||!!p.isTemplateContextOrCanNotHaveProperties(e)},makeShouldExitOnSecondNormalContext:function(){var r=!1;return function(e){var t=!e.isSpecial(),n=t&&r;return t&&(r=!0),n}},makeShouldExitAfterFirstNormalContext:function(){var t=!1;return function(e){return!!t||(!e.isSpecial()&&(t=!0),!1)}},makeShouldSkipSpecialContexts:function(e){var t=e||0;return function(e){return!(t<0&&e._meta.notContext)&&(!!e.isSpecial()||!(--t<0))}}}),b(p.prototype,{add:function(e,t){return e!==this._context?new this.constructor(e,this,t):this},find:function(e,t){var n=f.reads(e),r={shouldExit:l,shouldSkip:p.shouldSkipIfSpecial,shouldLookForHelper:!0,read:f.read};return this._walk(n,t,r).value},readFromSpecialContext:function(e){return this._walk([{key:e,at:!1}],{special:!0},{shouldExit:l,shouldSkip:p.shouldSkipEverythingButSpecial,shouldLookForHelper:!1,read:f.read})},readFromTemplateContext:function(e,t){var n=f.reads(e);return f.read(this.templateContext,n,t)},read:function(e,t){return t=t||{},this.readKeyInfo(p.keyInfo(e),t||{})},readKeyInfo:function(e,t){var n,r,a={read:t.read||f.read};if(e.isScope)return{value:this};if(e.isInScope)return r=f.reads(e.remainingKey),void 0!==(n=f.read(this,r,t)).value||n.parentHasKey||(n=this.readFromTemplateContext(e.remainingKey,t)),b(n,{thisArg:0<r.length?n.parent:void 0});if(e.isContextBased)return r="this"!==e.remainingKey?f.reads(e.remainingKey):[],a.shouldExit=p.makeShouldExitOnSecondNormalContext(),a.shouldSkip=p.makeShouldSkipSpecialContexts(e.parentContextWalkCount),a.shouldLookForHelper=!0,this._walk(r,t,a);if(e.walkScope)return a.shouldExit=l,a.shouldSkip=p.shouldSkipIfSpecial,a.shouldLookForHelper=!0,r=f.reads(e.remainingKey),this._walk(r,t,a);r=f.reads(e.remainingKey);var i=t&&!0===t.special;return a.shouldExit=p.makeShouldExitOnSecondNormalContext(),a.shouldSkip=i?p.shouldSkipEverythingButSpecial:p.shouldSkipIfSpecial,a.shouldLookForHelper=!i,this._walk(r,t,a)},_walk:function(n,e,t){for(var r,a,i,o,s,c=this,u=[],l=-1,f=b({foundObservable:function(e,t){a=e,i=n.slice(t)},earlyExit:function(e,t){(!0===(!0===c._meta.variable)&&0===t?w.hasKey(e,n[t].key):l<t||t===l&&"object"==typeof e&&w.hasOwnKey(e,n[t].key))&&(s=a,o=i,l=t)}},e),d=m.isRecording(),p=!1;c;)if(!0!==t.shouldSkip(c)){if(!0===t.shouldExit(c))break;p=!0,r=c._context;var h=m.trap(),v=t.read(r,n,f),g=h();if(void 0!==v.value||v.parentHasKey)return!g.length&&d?(a=v.parent,i=n.slice(n.length-1)):m.addMany(g),{scope:c,rootObserve:a,value:v.value,reads:i,thisArg:v.parent,parentHasKey:v.parentHasKey};u.push.apply(u,g),c=c._parent}else c=c._parent;if(t.shouldLookForHelper){var y=this.getHelperOrPartial(n);if(y&&y.value)return{value:y.value}}return m.addMany(u),{setRoot:s,reads:o,value:void 0,noContextAvailable:!p}},getDataForScopeSet:function(e,a){var i,t,n=p.keyInfo(e),r=b({read:function(e,t){if(void 0!==i||e instanceof d||(i=e),1<t.length){var n=t.slice(0,t.length-1),r=f.read(e,n,a).value;return null!=r&&w.hasKey(r,t[t.length-1].key)?{parent:r,parentHasKey:!0,value:void 0}:{}}return 1===t.length?w.hasKey(e,t[0].key)?{parent:e,parentHasKey:!0,value:void 0}:{}:{value:e}}},a),o=this.readKeyInfo(n,r);if("this"===n.remainingKey)return{parent:o.value,how:"setValue"};var s=n.remainingKey.split(".").pop();return o.thisArg?t=o.thisArg:i&&(t=i),void 0===t?{error:"Attempting to set a value at "+e+" where the context is undefined."}:!w.isObservableLike(t)&&w.isObservableLike(t[s])?w.isMapLike(t[s])?{parent:t,key:s,how:"updateDeep",warn:'can-view-scope: Merging data into "'+s+'" because its parent is non-observable'}:w.isValueLike(t[s])?{parent:t,key:s,how:"setValue"}:{parent:t,how:"write",key:s,passOptions:!0}:{parent:t,how:"write",key:s,passOptions:!0}},getHelper:function(e){return console.warn(".getHelper is deprecated, use .getHelperOrPartial"),this.getHelperOrPartial(e)},getHelperOrPartial:function(e){for(var t,n,r=this;r;){if((t=r._context)instanceof a){if(void 0!==(n=f.read(t.helpers,e,{proxyMethods:!1})).value)return n;if(void 0!==(n=f.read(t.partials,e,{proxyMethods:!1})).value)return n}r=r._parent}return f.read(u,e,{proxyMethods:!1})},get:function(e,t){return t=b({isArgument:!0},t),this.read(e,t).value},peek:m.ignore(function(e,t){return this.get(e,t)}),peak:m.ignore(function(e,t){return"production"!==process.env.NODE_ENV&&s.warn("peak is deprecated, please use peek instead"),this.peek(e,t)}),getScope:function(e){for(var t=this;t;){if(e(t))return t;t=t._parent}},getContext:function(e){var t=this.getScope(e);return t&&t._context},getTemplateContext:function(){var t,e=this.getScope(function(e){return(t=e)._context instanceof a});return e||(e=new p(new a),t._parent=e),e},addTemplateContext:function(){return this.add(new a)},addLetContext:function(e){return this.add(new d(e||{}),{variable:!0})},getRoot:function(){for(var e=this,t=this;e._parent;)e=(t=e)._parent;return e._context instanceof a&&(e=t),e._context},getViewModel:function(){var e=this.getScope(function(e){return e._meta.viewModel});return e&&e._context},getTop:function(){var t;return this.getScope(function(e){return e._meta.viewModel&&(t=e),!1}),t&&t._context},getPathsForKey:function(e){if("production"!==process.env.NODE_ENV){var n={},r=function(e,t){if(!e||"object"!=typeof e)return{};var n=t in e,r=w.hasKey(e,t);return{isDefined:n||r,isFunction:n&&"function"==typeof e[t]}},t=f.reads(e).map(function(e){return e.key}),a=t.indexOf("scope");-1<a&&t.splice(a,2);var i=t.join("."),o=this.getViewModel(),s=r(o,i);s.isDefined&&(n["scope.vm."+i+(s.isFunction?"()":"")]=o);var c=this.getTop(),u=r(c,i);u.isDefined&&(n["scope.top."+i+(u.isFunction?"()":"")]=c);var l="";return this.getScope(function(e){if(!e.isSpecial()){var t=r(e._context,i);t.isDefined&&(n[l+i+(t.isFunction?"()":"")]=e._context),l+="../"}return!1}),n}},hasKey:function(e){var t,n=f.reads(e);return(t="scope"===n[0].key?f.read(this,n.slice(1),e):f.read(this._context,n,e)).foundLastParent&&t.parentHasKey},set:function(e,t,n){n=n||{};var r=this.getDataForScopeSet(e,n),a=r.parent;if("production"!==process.env.NODE_ENV&&r.error)return s.error(r.error);switch(r.warn&&s.warn(r.warn),r.how){case"set":a.set(r.key,t,r.passOptions?n:void 0);break;case"write":f.write(a,r.key,t,n);break;case"setValue":w.setValue("key"in r?a[r.key]:a,t);break;case"setKeyValue":w.setKeyValue(a,r.key,t);break;case"updateDeep":w.updateDeep(a[r.key],t)}},attr:m.ignore(function(e,t,n){return s.warn("can-view-scope::attr is deprecated, please use peek, get or set"),n=b({isArgument:!0},n),2===arguments.length?this.set(e,t,n):this.get(e,n)}),computeData:function(e,t){return i(this,e,t)},compute:function(e,t){return this.computeData(e,t).compute},cloneFromRef:function(){for(var t,e=[],n=this;n;){if(n._context instanceof a){t=n._parent;break}e.unshift(n),n=n._parent}return t?(e.forEach(function(e){t=t.add(e._context,e._meta)}),t):this},isSpecial:function(){return this._meta.notContext||this._meta.special||this._context instanceof a||this._meta.variable}}),p.prototype._read=p.prototype._walk,w.assignSymbols(p.prototype,{"can.hasKey":p.prototype.hasKey});["filename","lineNumber"].forEach(function(t){Object.defineProperty(p.prototype,t,{get:function(){return this.readFromTemplateContext(t).value},set:function(e){this.templateContext[t]=e}})}),c(p.prototype,"templateContext",function(){return this.getTemplateContext()._context}),c(p.prototype,"root",function(){return s.warn("`scope.root` is deprecated. Use either `scope.top` or `scope.vm` instead."),this.getRoot()}),c(p.prototype,"vm",function(){return this.getViewModel()}),c(p.prototype,"top",function(){return this.getTop()}),c(p.prototype,"helpers",function(){return u});["index","key","element","event","viewModel","arguments","helperOptions","args"].forEach(function(e){Object.defineProperty(p.prototype,e,{get:function(){return this.readFromSpecialContext(e).value}})}),"production"!==process.env.NODE_ENV&&(p.prototype.log=function(){for(var e=this,t="",n="";e;)n=e._meta.notContext?" (notContext)":e._meta.special?" (special)":"",console.log(t,w.getName(e._context)+n,e._context),e=e._parent,t+=" "}),o.view=o.view||{},r.exports=o.view.Scope=p}(0,e,0,n)}),define("can-stache/src/key-observable",["require","exports","module","can-simple-observable/settable/settable","can-stache-key"],function(e,t,n){"use strict";var r=e("can-simple-observable/settable/settable"),a=e("can-stache-key");function i(e,t){t=""+t,this.key=t,this.root=e,r.call(this,function(){return a.get(this,t)},e)}(i.prototype=Object.create(r.prototype)).set=function(e){a.set(this.root,this.key,e)},n.exports=i}),define("can-stache/src/utils",["require","exports","module","can-view-scope","can-observation-recorder","can-stache-key","can-reflect","can-stache/src/key-observable","can-symbol"],function(e,t,n){"use strict";var s=e("can-view-scope"),c=e("can-observation-recorder"),f=e("can-stache-key"),d=e("can-reflect"),p=e("can-stache/src/key-observable"),r=e("can-symbol").for("can.isView"),o=function(e){return function(){e&&(e.rendered=!0)}};n.exports={last:function(e){return null!=e&&e[e.length-1]},emptyHandler:function(){},jsonParse:function(e){return"'"===e[0]?e.substr(1,e.length-2):"undefined"===e?void 0:JSON.parse(e)},mixins:{last:function(){return this.stack[this.stack.length-1]},add:function(e){this.last().add(e)},subSectionDepth:function(){return this.stack.length-1}},createRenderers:function(e,t,n,r,a,i){e.fn=r?this.makeRendererConvertScopes(r,t,n,i,e.metadata):o(e.metadata),e.inverse=a?this.makeRendererConvertScopes(a,t,n,i,e.metadata):o(e.metadata),e.isSection=!(!r&&!a)},makeRendererConvertScopes:function(r,a,i,e,o){var t=function(e,t,n){return void 0===e||e instanceof s||(e=a?a.add(e):new s(e||{})),o&&(o.rendered=!0),r(e||a,n||i)};return e?t:c.ignore(t)},makeView:function(n){var e=c.ignore(function(e,t){return e instanceof s||(e=new s(e)),n(e,t)});return e[r]=!0,e},getItemsStringContent:function(e,t,n){for(var r="",a=f.get(e,"length"),i=d.isObservableLike(e),o=0;o<a;o++){var s=i?new p(e,o):e[o];r+=n.fn(s)}return r},getItemsFragContent:function(e,t,n){var r,a=[],i=f.get(e,"length"),o=d.isObservableLike(e),s=t.exprData&&t.exprData.hashExprs;0<d.size(s)&&(r={},d.eachKey(s,function(e,t){r[e.key]=t}));for(var c=0;c<i;c++){var u={},l=o?new p(e,c):e[c];0<d.size(r)&&(r.value&&(u[r.value]=l),r.index&&(u[r.index]=c)),a.push(t.fn(n.add(u,{notContext:!0}).add({index:c},{special:!0}).add(l)))}return a}}}),define("can-stache/src/html_section",["require","exports","module","can-view-target","can-stache/src/utils","can-globals/document/document","can-assign"],function(e,t,n){!function(e,t,n,r){"use strict";var a,i=t("can-view-target"),o=t("can-stache/src/utils"),s=t("can-globals/document/document"),c=t("can-assign"),u=o.last,l="undefined"!=typeof document&&(a=s().createElement("div"),function(e){return-1===e.indexOf("&")?e.replace(/\r\n/g,"\n"):(a.innerHTML=e,0===a.childNodes.length?"":a.childNodes.item(0).nodeValue)}),f=function(e){e&&(this.filename=e),this.stack=[new d]};c(f.prototype,o.mixins),c(f.prototype,{startSubSection:function(e){var t=new d(e);return this.stack.push(t),t},endSubSectionAndReturnRenderer:function(){if(this.last().isEmpty())return this.stack.pop(),null;var e=this.endSection();return o.makeView(e.compiled.hydrate.bind(e.compiled))},startSection:function(e){var t=new d(e);this.last().add(t.targetCallback),this.stack.push(t)},endSection:function(){return this.last().compile(),this.stack.pop()},inverse:function(){this.last().inverse()},compile:function(){var e=this.stack.pop().compile();return o.makeView(e.hydrate.bind(e))},push:function(e){this.last().push(e)},pop:function(){return this.last().pop()},removeCurrentNode:function(){this.last().removeCurrentNode()}});var d=function(n){this.data="targetData",this.targetData=[],this.targetStack=[];var r=this;this.targetCallback=function(e,t){n.call(this,e,t,r.compiled.hydrate.bind(r.compiled),r.inverseCompiled&&r.inverseCompiled.hydrate.bind(r.inverseCompiled))}};c(d.prototype,{inverse:function(){this.inverseData=[],this.data="inverseData"},push:function(e){this.add(e),this.targetStack.push(e)},pop:function(){return this.targetStack.pop()},add:function(e){"string"==typeof e&&(e=l(e)),this.targetStack.length?u(this.targetStack).children.push(e):this[this.data].push(e)},compile:function(){return this.compiled=i(this.targetData,s()),this.inverseData&&(this.inverseCompiled=i(this.inverseData,s()),delete this.inverseData),this.targetStack=this.targetData=null,this.compiled},removeCurrentNode:function(){return this.children().pop()},children:function(){return this.targetStack.length?u(this.targetStack).children:this[this.data]},isEmpty:function(){return!this.targetData.length}}),f.HTMLSection=d,r.exports=f}(0,e,0,n)}),define("can-view-live/lib/core",["require","exports","module","can-view-parser","can-dom-mutate","can-view-nodelist","can-fragment","can-child-nodes","can-reflect","can-reflect-dependencies"],function(e,t,n){"use strict";var r=e("can-view-parser"),s=e("can-dom-mutate"),i=e("can-view-nodelist"),o=e("can-fragment"),c=e("can-child-nodes"),u=e("can-reflect"),l=e("can-reflect-dependencies");var f={setup:function(e,t,n){var r,a,i=!1,o=function(){return i||(i=!0,n(a),r&&(r(),r=void 0)),!0};return a={teardownCheck:function(e){return!e&&o()}},r=s.onNodeRemoval(e,function(){(function e(t,n){return t.contains?t.contains(n):t.nodeType===Node.DOCUMENT_NODE&&t.documentElement?e(t.documentElement,n):(n=n.parentNode)===t})(e.ownerDocument,e)||o()}),t(a),a},listen:function(t,n,r,a){return f.setup(t,function(){u.onValue(n,r,a||"notify"),"production"!==process.env.NODE_ENV&&l.addMutatedBy(t,n)},function(e){u.offValue(n,r,a||"notify"),"production"!==process.env.NODE_ENV&&l.deleteMutatedBy(t,n),e.nodeList&&i.unregister(e.nodeList)})},getAttributeParts:function(e){var t,n={};return r.parseAttrs(e,{attrStart:function(e){n[e]="",t=e},attrValue:function(e){n[t]+=e},attrEnd:function(){}}),n},isNode:function(e){return e&&e.nodeType},addTextNodeIfNoChildren:function(e){e.firstChild||e.appendChild(e.ownerDocument.createTextNode(""))},replace:function(e,t,n){var r=e.slice(0),a=o(t);return i.register(e,n),i.update(e,c(a)),i.replace(r,a),e},getParentNode:function(e,t){return t&&11===e.parentNode.nodeType?t:e.parentNode},makeString:function(e){return null==e?"":""+e}};n.exports=f}),define("can-dom-data-state",["require","exports","module","can-namespace","can-dom-mutate","can-cid"],function(e,t,n){"use strict";var r=e("can-namespace"),i=e("can-dom-mutate"),o=e("can-cid"),s={},c={},u=function(){var e=o.get(this),t=!1;return e&&s[e]&&(t=!0,delete s[e]),c[e]&&(c[e](),delete c[e]),t},a={_data:s,_removalDisposalMap:c,getCid:function(){return o.get(this)},cid:function(){return o(this)},expando:o.domExpando,get:function(e){var t=o.get(this),n=t&&s[t];return void 0===e?n:n&&n[e]},set:function(e,t){var n=o(this),r=s[n]||(s[n]={});if(void 0!==e&&(r[e]=t,this&&"number"==typeof this.nodeType&&!c[n])){var a=this;c[n]=i.onNodeRemoval(a,function(){var e=a.ownerDocument,t=e.contains?e:e.documentElement;t&&t.contains(a)||setTimeout(function(){u.call(a)},13)})}return r},clean:function(e){var t=o.get(this),n=s[t];n&&n[e]&&delete n[e],function(e){for(var t in e)return!1;return!0}(n)&&u.call(this)},delete:u};if(r.domDataState)throw new Error("You can't have two versions of can-dom-data-state, check your dependencies");n.exports=r.domDataState=a}),define("can-attribute-observable/behaviors",["require","exports","module","can-globals/document/document","can-globals/global/global","can-dom-data-state","can-dom-events","can-dom-mutate","can-dom-mutate/node","can-globals/mutation-observer/mutation-observer","can-diff/list/list","can-queues"],function(e,t,n){!function(e,t,n,r){"use strict";var a,i=t("can-globals/document/document"),f=(e=t("can-globals/global/global")(),t("can-dom-data-state")),d=t("can-dom-events"),o=t("can-dom-mutate"),s=t("can-dom-mutate/node"),c=t("can-globals/mutation-observer/mutation-observer"),u=t("can-diff/list/list"),l=t("can-queues"),p={INPUT:!0,TEXTAREA:!0,SELECT:!0,BUTTON:!0},h=function(e){return"http://www.w3.org/2000/svg"===e.namespaceURI},v=function(){return!0},g=function(t,e){return(e=e||{}).get=function(){return this[t]},e.set=function(e){this[t]!==e&&(this[t]=e)},e},y=function(t){return{isBoolean:!0,set:function(e){t in this?this[t]=e:s.setAttribute.call(this,t,"")},remove:function(){this[t]=!1}}},m=function(e,t){if(!f.get.call(e,"attrMO")){var n=function(){t.call(e)},r=c();if(r){var a=new r(n);a.observe(e,{childList:!0,subtree:!0}),f.set.call(e,"attrMO",a)}else f.set.call(e,"attrMO",!0),f.set.call(e,"canBindingCallback",{onMutation:n})}},b=function(e,t){for(var n=e.firstChild;n;){if("OPTION"===n.nodeName&&t===n.value)return n;if("OPTGROUP"===n.nodeName){var r=b(n,t);if(r)return r}n=n.nextSibling}},w=function(e,t){var n;null!=t&&(n=b(e,t)),n?n.selected=!0:e.selectedIndex=-1},_=function(e,t){for(var n=e.firstChild;n;)"OPTION"===n.nodeName&&t(n),"OPTGROUP"===n.nodeName&&_(n,t),n=n.nextSibling},x=new Map,E=function(e,t){var n=Object.getOwnPropertyDescriptor(e,t);if(n)return n.writable||n.set;var r=Object.getPrototypeOf(e);return!!r&&E(r,t)},k={checked:{get:function(){return this.checked},set:function(e){var t=!!e||""===e||0===arguments.length;(this.checked=t)&&"radio"===this.type&&(this.defaultChecked=!0)},remove:function(){this.checked=!1},test:function(){return"INPUT"===this.nodeName}},class:{get:function(){return h(this)?this.getAttribute("class"):this.className},set:function(e){e=e||"",h(this)?s.setAttribute.call(this,"class",""+e):this.className=e}},disabled:y("disabled"),focused:{get:function(){return this===document.activeElement},set:function(e){var t=O.get(this,"focused"),n=this.ownerDocument.documentElement,r=this;function a(){e?r.focus():r.blur()}if(t!==e)if(n.contains(r))l.enqueueByQueue({mutate:[a]},null,[]);else var i=o.onNodeInsertion(r,function(){i(),a()});return!0},addEventListener:function(e,t,n){return n.call(this,"focus",t),n.call(this,"blur",t),function(e){e.call(this,"focus",t),e.call(this,"blur",t)}},test:function(){return"INPUT"===this.nodeName}},for:g("htmlFor"),innertext:g("innerText"),innerhtml:g("innerHTML"),innerHTML:g("innerHTML",{addEventListener:function(e,n,t){var r=[],a=this;return["change","blur"].forEach(function(e){var t=function(){n.apply(this,arguments)};d.addEventListener(a,e,t),r.push([e,t])}),function(t){r.forEach(function(e){t.call(a,e[0],e[1])})}}}),required:y("required"),readonly:y("readOnly"),selected:{get:function(){return this.selected},set:function(e){e=!!e,f.set.call(this,"lastSetValue",e),this.selected=e},addEventListener:function(n,t,e){var r,a,i,o=this,s=this.parentNode,c=o.selected,u=function(e){var t=o.selected;t!==(c=f.get.call(o,"lastSetValue")||c)&&(c=t,d.dispatch(o,n))},l=(r=s,a=e,(i=f.get.call(r,"attrSetChildOptions"))?Function.prototype:(i=function(){w(r,r.value)},f.set.call(r,"attrSetChildOptions",i),a.call(r,"change",i),function(e){f.clean.call(r,"attrSetChildOptions"),e.call(r,"change",i)}));return d.addEventListener(s,"change",u),e.call(o,n,t),function(e){l(e),d.removeEventListener(s,"change",u),e.call(o,n,t)}},test:function(){return"OPTION"===this.nodeName&&this.parentNode&&"SELECT"===this.parentNode.nodeName}},style:{set:(a=e.document&&i().createElement("div"),a&&a.style&&"cssText"in a.style?function(e){this.style.cssText=e||""}:function(e){s.setAttribute.call(this,"style",e)})},textcontent:g("textContent"),value:{get:function(){var e=this.value;return"SELECT"===this.nodeName&&"selectedIndex"in this&&-1===this.selectedIndex&&(e=void 0),e},set:function(e){var t,n=this.nodeName.toLowerCase();if("input"===n&&(e=null==(t=e)?"":""+t),this.value===e&&"option"!==n||(this.value=e),"input"!==n&&"textarea"!==n||(this.defaultValue=e),"select"===n){if(f.set.call(this,"attrValueLastVal",e),w(this,null===e?e:this.value),!this.ownerDocument.documentElement.contains(this))var r=this,a=o.onNodeInsertion(r,function(){a(),w(r,null===e?e:r.value)});m(this,function(){var e=f.get.call(this,"attrValueLastVal");O.set(this,"value",e),d.dispatch(this,"change")})}},test:function(){return p[this.nodeName]}},values:{get:function(){return t=[],_(this,function(e){e.selected&&t.push(e.value)}),t;var t},set:function(e){var t;t=e=e||[],_(this,function(e){e.selected=-1!==t.indexOf(e.value)}),f.set.call(this,"stickyValues",O.get(this,"values")),m(this,function(){var e=f.get.call(this,"stickyValues");O.set(this,"values",e);var t=f.get.call(this,"stickyValues");u(e.slice().sort(),t.slice().sort()).length&&d.dispatch(this,"values")})},addEventListener:function(t,n,e){var r=function(){d.dispatch(this,"values")};return d.addEventListener(this,"change",r),e.call(this,t,n),function(e){d.removeEventListener(this,"change",r),e.call(this,t,n)}}}},O={rules:x,specialAttributes:k,getRule:function(e,t){var n=k[t];if(n)return n;var r=x.get(e.constructor),a=r&&r[t];if(a)return a;if(!(t in e))return this.attribute(t);var i,o,s,c,u=E(e,t)?this.property(t):this.attribute(t);return i=e,o=t,s=u,(c=x.get(i.prototype))||(c={},x.set(i.constructor,c)),c[o]=s},attribute:function(t){return{get:function(){return this.getAttribute(t)},set:function(e){s.setAttribute.call(this,t,e)}}},property:function(t){return{get:function(){return this[t]},set:function(e){this[t]=e}}},findSpecialListener:function(e){return k[e]&&k[e].addEventListener},setAttrOrProp:function(e,t,n){return this.set(e,t,n)},set:function(e,t,n){var r=this.getRule(e,t),a=r&&r.set;if(a)return a.call(e,n)},get:function(e,t){var n=this.getRule(e,t),r=n&&n.get;if(r)return n.test?n.test.call(e)&&r.call(e):r.call(e)},remove:function(e,t){t=t.toLowerCase();var n,r=k[t],a=r&&r.set,i=r&&r.remove,o=(n=r)&&n.test||v;"function"==typeof i&&o.call(e)?i.call(e):"function"==typeof a&&o.call(e)?a.call(e,void 0):s.removeAttribute.call(e,t)}};r.exports=O}(function(){return this}(),e,0,n)}),define("can-view-live/lib/attr",["require","exports","module","can-view-live/lib/core","can-reflect","can-queues","can-attribute-observable/behaviors"],function(e,t,n){"use strict";var a=e("can-view-live/lib/core"),i=e("can-reflect"),o=e("can-queues"),s=e("can-attribute-observable/behaviors");a.attr=function(t,n,e){function r(e){o.domUIQueue.enqueue(s.set,s,[t,n,e])}"production"!==process.env.NODE_ENV&&(i.assignSymbols(r,{"can.getChangesDependencyRecord":function(){var e=new Set;return e.add(t),{valueDependencies:e}}}),Object.defineProperty(r,"name",{value:"live.attr update::"+i.getName(e)})),a.listen(t,e,r),s.set(t,n,i.getValue(e))}}),define("can-view-live/lib/attrs",["require","exports","module","can-view-live/lib/core","can-view-callbacks","can-dom-mutate","can-dom-mutate/node","can-reflect","can-reflect-dependencies"],function(e,t,n){"use strict";var u=e("can-view-live/lib/core"),l=e("can-view-callbacks"),f=e("can-dom-mutate"),d=e("can-dom-mutate/node"),p=e("can-reflect"),h=e("can-reflect-dependencies");u.attrs=function(i,t,o,s){if(p.isObservableLike(t)){var n,c={};"production"!==process.env.NODE_ENV&&(p.assignSymbols(a,{"can.getChangesDependencyRecord":function(){var e=new Set;return e.add(i),{valueDependencies:e}}}),Object.defineProperty(a,"name",{value:"live.attrs update::"+p.getName(t)}),h.addMutatedBy(i,t)),p.onValue(t,a,"domUI");n=f.onNodeRemoval(i,function(){var e=i.ownerDocument;(e.contains?e:e.documentElement).contains(i)||(p.offValue(t,a,"domUI"),n&&(n(),n=void 0),"production"!==process.env.NODE_ENV&&h.deleteMutatedBy(i,t))}),a(p.getValue(t))}else{var e=u.getAttributeParts(t);for(var r in e)d.setAttribute.call(i,r,e[r])}function a(e){var t,n=u.getAttributeParts(e);for(t in n){var r=n[t];if(r!==c[t]){d.setAttribute.call(i,t,r);var a=l.attr(t);a&&a(i,{attributeName:t,scope:o,options:s})}delete c[t]}for(t in c)d.removeAttribute.call(i,t);c=n}}}),define("can-view-live/lib/html",["require","exports","module","can-view-live/lib/core","can-view-nodelist","can-fragment","can-child-nodes","can-reflect","can-symbol","can-queues"],function(e,t,n){"use strict";var f=e("can-view-live/lib/core"),d=e("can-view-nodelist"),p=e("can-fragment"),h=e("can-child-nodes"),v=e("can-reflect"),r=e("can-symbol"),g=e("can-queues"),y=r.for("can.viewInsert");function m(e,t,n){if(!0!==e.nodeList.isUnregistered){var r=v.toArray(h(t));n||d.update(e.nodeList,r,e.oldNodes);var a=e.oldNodes;e.oldNodes=r,d.replace(a,t)}}f.html=function(e,t,n,r){var i,a,o,s,c;void 0!==r&&(Array.isArray(r)?o=r:(o=r.nodeList,c=r));var u={reasonLog:"live.html replace::"+v.getName(t)};function l(e){d.first(s).parentNode&&a(e,!0);var t=d.first(s).parentNode;i.teardownCheck(t)}n=f.getParentNode(e,n),"production"!==process.env.NODE_ENV&&(v.assignSymbols(l,{"can.getChangesDependencyRecord":function(){var e=new Set;return e.add(n),{valueDependencies:e}}}),Object.defineProperty(l,"name",{value:"live.html update::"+v.getName(t)})),i=f.listen(n,t,l),s=o||[e],a=function(e,t){e&&"function"==typeof e[y]&&(e=e[y](c));var n="function"==typeof e,r=p(n?"":e);if(f.addTextNodeIfNoChildren(r),!0===t){i.oldNodes=d.unregisterChildren(s,!0);var a=!1;n&&(e(r.firstChild),a=d.first(s)===r.firstChild),g.domUIQueue.enqueue(m,null,[i,r,a],u)}else i.oldNodes=d.update(s,h(r)),n&&e(r.firstChild),d.replace(i.oldNodes,r)},i.nodeList=s,o?o.unregistered=i.teardownCheck:d.register(s,i.teardownCheck),a(v.getValue(t))}}),define("can-view-live/lib/set-observable",["require","exports","module","can-simple-observable","can-reflect"],function(e,t,n){"use strict";var r=e("can-simple-observable"),a=e("can-reflect");function i(e,t){this.setter=t,r.call(this,e)}((i.prototype=Object.create(r.prototype)).constructor=i).prototype.set=function(e){this.setter(e)},a.assignSymbols(i.prototype,{"can.setValue":i.prototype.set}),n.exports=i}),define("can-diff/patcher/patcher",["require","exports","module","can-reflect","can-key-tree","can-symbol","can-diff/list/list","can-queues","can-symbol"],function(e,t,n){"use strict";var r=e("can-reflect"),a=e("can-key-tree"),i=e("can-symbol"),o=e("can-diff/list/list"),s=e("can-queues"),c=(i=e("can-symbol")).for("can.onValue"),u=i.for("can.offValue"),l=i.for("can.onPatches"),f=i.for("can.offPatches"),d=function(e,t){this.handlers=new a([Object,Array],{onFirst:this.setup.bind(this),onEmpty:this.teardown.bind(this)}),this.observableOrList=e,this.isObservableValue=r.isValueLike(this.observableOrList)||r.isObservableLike(this.observableOrList),this.isObservableValue?this.priority=r.getPriority(e):this.priority=t||0,this.onList=this.onList.bind(this),this.onPatchesNotify=this.onPatchesNotify.bind(this),this.onPatchesDerive=this.onPatchesDerive.bind(this),this.patches=[],"production"!==process.env.NODE_ENV&&(Object.defineProperty(this.onList,"name",{value:"live.list new list::"+r.getName(e)}),Object.defineProperty(this.onPatchesNotify,"name",{value:"live.list notify::"+r.getName(e)}),Object.defineProperty(this.onPatchesDerive,"name",{value:"live.list derive::"+r.getName(e)}))};d.prototype={constructor:d,setup:function(){this.observableOrList[c]?(r.onValue(this.observableOrList,this.onList,"notify"),this.setupList(r.getValue(this.observableOrList))):this.setupList(this.observableOrList)},teardown:function(){this.observableOrList[u]&&r.offValue(this.observableOrList,this.onList,"notify"),this.currentList&&this.currentList[f]&&this.currentList[f](this.onPatchesNotify,"notify")},setupList:function(e){(this.currentList=e)&&e[l]&&e[l](this.onPatchesNotify,"notify")},onList:function(e){var t=this.currentList||[];e=e||[],t[f]&&t[f](this.onPatchesNotify,"notify");var n=o(t,e);this.currentList=e,this.onPatchesNotify(n),e[l]&&e[l](this.onPatchesNotify,"notify")},onPatchesNotify:function(e){this.patches.push.apply(this.patches,e),s.deriveQueue.enqueue(this.onPatchesDerive,this,[],{priority:this.priority})},onPatchesDerive:function(){var e=this.patches;this.patches=[],s.enqueueByQueue(this.handlers.getNode([]),this.currentList,[e,this.currentList],null,["Apply patches",e])}},r.assignSymbols(d.prototype,{"can.onPatches":function(e,t){this.handlers.add([t||"mutate",e])},"can.offPatches":function(e,t){this.handlers.delete([t||"mutate",e])}}),n.exports=d}),define("can-view-live/lib/list",["require","exports","module","can-view-live/lib/core","can-view-nodelist","can-fragment","can-child-nodes","can-dom-mutate/node","can-reflect","can-symbol","can-reflect-dependencies","can-simple-observable","can-view-live/lib/set-observable","can-diff/patcher/patcher"],function(e,t,n){"use strict";var c=e("can-view-live/lib/core"),p=e("can-view-nodelist"),f=e("can-fragment"),u=e("can-child-nodes"),h=e("can-dom-mutate/node"),v=e("can-reflect"),r=e("can-symbol"),a=e("can-reflect-dependencies"),g=e("can-simple-observable"),y=e("can-view-live/lib/set-observable"),l=e("can-diff/patcher/patcher"),m=[].splice,b=function(e,t,n,r,a){var i=[];t&&(p.register(i,null,!0,!0),i.parentList=t,i.expression="#each SUBEXPRESSION");var o=n.apply(r,a.concat([i])),s=f(o),c=v.toArray(u(s));return t?(p.update(i,c),e.push(i)):e.push(p.register(c)),s},w=function(e,t,n){var r=e.splice(t+1,n),a=[];return r.forEach(function(e){var t=p.unregister(e);[].push.apply(a,t)}),a},i=r.for("can.onPatches"),o=r.for("can.offPatches");function d(e,t,n,r,a,i,o){this.patcher=new l(t),a=c.getParentNode(e,a),this.value=t,this.render=n,this.context=r,this.parentNode=a,this.falseyRender=o,this.masterNodeList=i||p.register([e],null,!0),this.placeholder=e,this.indexMap=[],this.isValueLike=v.isValueLike(this.value),this.isObservableLike=v.isObservableLike(this.value),this.onPatches=this.onPatches.bind(this);var s=this.data=c.setup(a,this.setupValueBinding.bind(this),this.teardownValueBinding.bind(this));this.masterNodeList.unregistered=function(){s.teardownCheck()},"production"!==process.env.NODE_ENV&&Object.defineProperty(this.onPatches,"name",{value:"live.list update::"+v.getName(t)})}i=r.for("can.onPatches"),o=r.for("can.offPatches");d.prototype={setupValueBinding:function(){this.patcher[i](this.onPatches,"domUI"),this.patcher.currentList&&this.patcher.currentList.length?this.onPatches([{insert:this.patcher.currentList,index:0,deleteCount:0}]):this.addFalseyIfEmpty(),"production"!==process.env.NODE_ENV&&a.addMutatedBy(this.parentNode,this.patcher.observableOrList)},teardownValueBinding:function(){this.patcher[o](this.onPatches,"domUI"),this.exit=!0,this.remove({length:this.patcher.currentList?this.patcher.currentList.length:0},0,!0),"production"!==process.env.NODE_ENV&&a.deleteMutatedBy(this.parentNode,this.patcher.observableOrList)},onPatches:function(e){if(!this.exit)for(var t=0,n=e.length;t<n;t++){var r=e[t];"move"===r.type?this.move(r.toIndex,r.fromIndex):(r.deleteCount&&this.remove({length:r.deleteCount},r.index,!0),r.insert&&r.insert.length&&this.add(r.insert,r.index))}},add:function(e,i){var o=this.placeholder.ownerDocument.createDocumentFragment(),s=[],c=[],u=this.masterNodeList,l=this.render,f=this.context;e.forEach(function(e,t){var n=new g(t+i),r=new y(e,function(e){v.setKeyValue(this.patcher.currentList,n.get(),e)}.bind(this)),a=b(s,u,l,f,[r,n]);o.appendChild(a),c.push(n)},this);var t=i+1;if(!this.indexMap.length){var n=w(u,0,u.length-1);p.remove(n)}if(u[t]){var r=p.first(u[t]);h.insertBefore.call(r.parentNode,o,r)}else p.after(1===t?[this.placeholder]:[p.last(this.masterNodeList[t-1])],o);m.apply(this.masterNodeList,[t,0].concat(s)),m.apply(this.indexMap,[i,0].concat(c));for(var a=i+c.length,d=this.indexMap.length;a<d;a++)this.indexMap[a].set(a)},remove:function(e,t){t<0&&(t=this.indexMap.length+t);var n=w(this.masterNodeList,t,e.length),r=this.indexMap;r.splice(t,e.length);for(var a=t,i=r.length;a<i;a++)r[a].set(a);this.exit?p.unregister(this.masterNodeList):(this.addFalseyIfEmpty(),p.remove(n))},addFalseyIfEmpty:function(){if(this.falseyRender&&0===this.indexMap.length){var e=[],t=b(e,this.masterNodeList,this.falseyRender,this.currentList,[this.currentList]);p.after([this.masterNodeList[0]],t),this.masterNodeList.push(e[0])}},move:function(e,t){e+=1,t+=1;var n,r=this.masterNodeList,a=this.indexMap,i=r[e],o=f(p.flatten(r[t]));n=t<e?p.last(i).nextSibling:p.first(i),r[0].parentNode.insertBefore(o,n);var s=r[t];[].splice.apply(r,[t,1]),[].splice.apply(r,[e,0,s]),e-=1;var c=a[t-=1];[].splice.apply(a,[t,1]),[].splice.apply(a,[e,0,c]);for(var u=Math.min(t,e),l=a.length;u<l;u++)a[u].set(u)},set:function(e,t){this.remove({length:1},t,!0),this.add([e],t)}},c.list=function(e,t,n,r,a,i,o){var s;e.nodeType!==Node.TEXT_NODE&&(e=(i?(s=document.createTextNode(""),p.replace(i,s),p.update(i,[s])):(s=document.createTextNode(""),e.parentNode.replaceChild(s,e)),s));new d(e,t,n,r,a,i,o)}}),define("can-view-live/lib/text",["require","exports","module","can-view-live/lib/core","can-view-nodelist","can-reflect"],function(e,t,n){"use strict";var c=e("can-view-live/lib/core"),u=e("can-view-nodelist"),l=e("can-reflect");c.text=function(t,e,n,r){var a;t.nodeType!==Node.TEXT_NODE&&(t=(r?(a=document.createTextNode(""),u.replace(r,a),u.update(r,[a])):(a=document.createTextNode(""),t.parentNode.replaceChild(a,t)),a));var i=c.getParentNode(t,n);function o(e){t.nodeValue=c.makeString(e)}t.nodeValue=c.makeString(l.getValue(e)),"production"!==process.env.NODE_ENV&&(l.assignSymbols(o,{"can.getChangesDependencyRecord":function(){var e=new Set;return e.add(i),{valueDependencies:e}}}),Object.defineProperty(o,"name",{value:"live.text update::"+l.getName(e)}));var s=c.listen(i,e,o,"domUI");r||(r=u.register([t],null,!0)),r.unregistered=s.teardownCheck,s.nodeList=r}}),define("can-view-live",["require","exports","module","can-view-live/lib/core","can-view-live/lib/attr","can-view-live/lib/attrs","can-view-live/lib/html","can-view-live/lib/list","can-view-live/lib/text"],function(e,t,n){"use strict";var r=e("can-view-live/lib/core");e("can-view-live/lib/attr"),e("can-view-live/lib/attrs"),e("can-view-live/lib/html"),e("can-view-live/lib/list"),e("can-view-live/lib/text"),n.exports=r}),define("can-stache/src/text_section",["require","exports","module","can-view-live","can-stache/src/utils","can-dom-mutate/node","can-assign","can-reflect","can-observation"],function(e,t,n){"use strict";var o=e("can-view-live"),r=e("can-stache/src/utils"),s=e("can-dom-mutate/node"),a=e("can-assign"),c=e("can-reflect"),u=e("can-observation"),l=function(){},i=function(e){e&&(this.filename=e),this.stack=[new d]};a(i.prototype,r.mixins),a(i.prototype,{startSection:function(e){var t=new d;this.last().add({process:e,truthy:t}),this.stack.push(t)},endSection:function(){this.stack.pop()},inverse:function(){this.stack.pop();var e=new d;this.last().last().falsey=e,this.stack.push(e)},compile:function(a){var i=this.stack[0].compile();return"production"!==process.env.NODE_ENV&&Object.defineProperty(i,"name",{value:"textSectionRenderer<"+a.tag+"."+a.attr+">"}),function(e){function t(){return i(e)}"production"!==process.env.NODE_ENV&&Object.defineProperty(t,"name",{value:"textSectionRender<"+a.tag+"."+a.attr+">"});var n=new u(t,null,{isObservable:!1});c.onValue(n,l);var r=c.getValue(n);c.valueHasDependencies(n)?(a.textContentOnly?o.text(this,n):a.attr?o.attr(this,a.attr,n):o.attrs(this,n,e),c.offValue(n,l)):a.textContentOnly?this.nodeValue=r:a.attr?s.setAttribute.call(this,a.attr,r):o.attrs(this,r)}}});var f=function(t,n,r){return function(e){return t.call(this,e,n,r)}},d=function(){this.values=[]};a(d.prototype,{add:function(e){this.values.push(e)},last:function(){return this.values[this.values.length-1]},compile:function(){for(var a=this.values,i=a.length,e=0;e<i;e++){var t=this.values[e];"object"==typeof t&&(a[e]=f(t.process,t.truthy&&t.truthy.compile(),t.falsey&&t.falsey.compile()))}return function(e){for(var t,n="",r=0;r<i;r++)n+="string"==typeof(t=a[r])?t:t.call(this,e);return n}}}),n.exports=i}),define("can-stache/expressions/arg",function(e,t,n){"use strict";var r=function(e,t){this.expr=e,this.modifiers=t||{},this.isCompute=!1};r.prototype.value=function(){return this.expr.value.apply(this.expr,arguments)},"production"!==process.env.NODE_ENV&&(r.prototype.sourceText=function(){return(this.modifiers.compute?"~":"")+this.expr.sourceText()}),n.exports=r}),define("can-stache/expressions/literal",function(e,t,n){"use strict";var r=function(e){this._value=e};r.prototype.value=function(){return this._value},"production"!==process.env.NODE_ENV&&(r.prototype.sourceText=function(){return JSON.stringify(this._value)}),n.exports=r}),define("can-simple-observable/setter/setter",["require","exports","module","can-reflect","can-observation","can-simple-observable/settable/settable","can-event-queue/value/value"],function(e,t,n){"use strict";var r=e("can-reflect"),a=e("can-observation"),i=e("can-simple-observable/settable/settable");e("can-event-queue/value/value");function o(e,t){this.setter=t,this.observation=new a(e),this.handler=this.handler.bind(this),"production"!==process.env.NODE_ENV&&(r.assignSymbols(this,{"can.getName":function(){return r.getName(this.constructor)+"<"+r.getName(e)+">"}}),Object.defineProperty(this.handler,"name",{value:r.getName(this)+".handler"}))}((o.prototype=Object.create(i.prototype)).constructor=o).prototype.set=function(e){this.setter(e)},o.prototype.hasDependencies=function(){return r.valueHasDependencies(this.observation)},r.assignSymbols(o.prototype,{"can.setValue":o.prototype.set,"can.valueHasDependencies":o.prototype.hasDependencies}),n.exports=o}),define("can-stache/src/expression-helpers",["require","exports","module","can-stache/expressions/arg","can-stache/expressions/literal","can-reflect","can-stache-key","can-observation","can-view-scope/make-compute-like","can-simple-observable/setter/setter"],function(e,t,n){"use strict";var r=e("can-stache/expressions/arg"),a=e("can-stache/expressions/literal"),s=e("can-reflect"),c=e("can-stache-key"),u=e("can-observation"),i=e("can-view-scope/make-compute-like"),l=e("can-simple-observable/setter/setter");n.exports={getObservableValue_fromDynamicKey_fromObservable:function(e,t,n,r){var a,i=function(){return c.reads((""+s.getValue(e)).replace(/\./g,"\\."))},o=new l(function(){var e=c.read(s.getValue(t),i());return a=e.parentHasKey,e.value},function(e){c.write(s.getValue(t),i(),e)});return u.temporarilyBind(o),o.initialValue=s.getValue(o),o.parentHasKey=a,o},convertToArgExpression:function(e){return e instanceof r||e instanceof a?e:new r(e)},toComputeOrValue:function(e){return s.isObservableLike(e)?s.isValueLike(e)&&!1===s.valueHasDependencies(e)?s.getValue(e):e.compute?e.compute:i(e):e},toCompute:function(e){return e?e.isComputed?e:e.compute?e.compute:i(e):e}}}),define("can-stache/expressions/hashes",["require","exports","module","can-reflect","can-observation","can-stache/src/expression-helpers"],function(e,t,n){"use strict";var o=e("can-reflect"),s=e("can-observation"),c=e("can-stache/src/expression-helpers"),r=function(e){this.hashExprs=e};r.prototype.value=function(e,t){var n={};for(var r in this.hashExprs){var a=c.convertToArgExpression(this.hashExprs[r]),i=a.value.apply(a,arguments);n[r]={call:!a.modifiers||!a.modifiers.compute,value:i}}return new s(function(){var e={};for(var t in n)e[t]=n[t].call?o.getValue(n[t].value):c.toComputeOrValue(n[t].value);return e})},"production"!==process.env.NODE_ENV&&(r.prototype.sourceText=function(){var n=[];return o.eachKey(this.hashExprs,function(e,t){n.push(t+"="+e.sourceText())}),n.join(" ")}),n.exports=r}),define("can-stache/expressions/bracket",["require","exports","module","can-symbol","can-stache/src/expression-helpers"],function(e,t,n){"use strict";if("production"!==process.env.NODE_ENV)var r=e("can-symbol");var a=e("can-stache/src/expression-helpers"),i=function(e,t,n){this.root=t,this.key=e,"production"!==process.env.NODE_ENV&&(this[r.for("can-stache.originalKey")]=n)};i.prototype.value=function(e,t){var n=this.root?this.root.value(e,t):e.peek("this");return a.getObservableValue_fromDynamicKey_fromObservable(this.key.value(e,t),n,e,t,{})},"production"!==process.env.NODE_ENV&&(i.prototype.sourceText=function(){return this.rootExpr?this.rootExpr.sourceText()+"["+this.key+"]":"["+this.key+"]"}),i.prototype.closingTag=function(){if("production"!==process.env.NODE_ENV)return this[r.for("can-stache.originalKey")]||""},n.exports=i}),define("can-stache/src/set-identifier",function(e,t,n){"use strict";n.exports=function(e){this.value=e}}),define("can-stache/expressions/call",["require","exports","module","can-stache/expressions/hashes","can-stache/src/set-identifier","can-symbol","can-simple-observable/setter/setter","can-stache/src/expression-helpers","can-reflect","can-assign","can-view-scope","can-observation"],function(e,t,n){"use strict";var u=e("can-stache/expressions/hashes"),s=e("can-stache/src/set-identifier"),r=e("can-symbol"),c=e("can-simple-observable/setter/setter"),l=e("can-stache/src/expression-helpers"),f=e("can-reflect"),d=e("can-assign"),a=r.for("can-stache.sourceText"),p=r.for("can.isView"),h=e("can-view-scope"),v=e("can-observation"),i=function(e,t){this.methodExpr=e,this.argExprs=t.map(l.convertToArgExpression)};i.prototype.args=function(e,t){for(var a={},i=[],n="function"==typeof t,r=0,o=this.argExprs.length;r<o;r++){var s=this.argExprs[r];if(s.expr instanceof u&&d(a,s.expr.hashExprs),!n||!t(r)){var c=s.value.apply(s,arguments);i.push({call:!s.modifiers||!s.modifiers.compute,value:c})}}return function(e){var t=[];0<f.size(a)&&(t.hashExprs=a);for(var n=0,r=i.length;n<r;n++)t[n]=e?i[n].value:i[n].call?f.getValue(i[n].value):l.toCompute(i[n].value);return t}},i.prototype.value=function(r,a){var i=this.methodExpr.value(r,{proxyMethods:!1});v.temporarilyBind(i);var e=f.getValue(i),o=this.args(r,e&&e.ignoreArgLookup),t=function(e){var t=f.getValue(i);if("function"==typeof t){var n=o(t.isLiveBound);return t.requiresOptionsArgument&&(n.hashExprs&&a&&a.exprData&&(a.exprData.hashExprs=n.hashExprs),void 0!==a&&n.push(a)),!0===t[p]&&(n[0]instanceof h||(n[0]=r.getTemplateContext().add(n[0])),n.push(a.nodeList)),arguments.length&&n.unshift(new s(e)),t.apply(i.thisArg||r.peek("this"),n)}};return"production"!==process.env.NODE_ENV&&Object.defineProperty(t,"name",{value:"{{"+this.sourceText()+"}}"}),a&&a.doNotWrapInObservation?t():new c(t,t)},"production"!==process.env.NODE_ENV&&(i.prototype.sourceText=function(){var e=this.argExprs.map(function(e){return e.sourceText()});return this.methodExpr.sourceText()+"("+e.join(",")+")"}),i.prototype.closingTag=function(){return"production"!==process.env.NODE_ENV&&this.methodExpr[a]?this.methodExpr[a]:this.methodExpr.key},n.exports=i}),define("can-stache/expressions/helper",["require","exports","module","can-stache/expressions/literal","can-stache/expressions/hashes","can-assign","can-log/dev/dev","can-stache/src/expression-helpers","can-reflect"],function(e,t,n){"use strict";var u=e("can-stache/expressions/literal"),r=e("can-stache/expressions/hashes"),l=e("can-assign"),f=e("can-log/dev/dev"),i=e("can-stache/src/expression-helpers"),d=e("can-reflect"),a=function(e,t,n){this.methodExpr=e,this.argExprs=t,this.hashExprs=n,this.mode=null};a.prototype.args=function(e){for(var t=[],n=0,r=this.argExprs.length;n<r;n++){var a=this.argExprs[n];t.push(i.toComputeOrValue(a.value.apply(a,arguments)))}return t},a.prototype.hash=function(e){var t={};for(var n in this.hashExprs){var r=this.hashExprs[n];t[n]=i.toComputeOrValue(r.value.apply(r,arguments))}return t},a.prototype.value=function(n,r){var e=this.methodExpr instanceof u?""+this.methodExpr._value:this.methodExpr.key,a=this,t=n.computeData(e,{proxyMethods:!1}),i=t&&t.initialValue,o=t&&t.thisArg;if("function"==typeof i)t=function(){var e=a.args(n),t=l(l({},r),{hash:a.hash(n),exprData:a});return e.push(t),i.apply(o||n.peek("this"),e)},"production"!==process.env.NODE_ENV&&Object.defineProperty(t,"name",{configurable:!0,value:d.getName(this)});else if("production"!==process.env.NODE_ENV){var s=n.peek("scope.filename"),c=n.peek("scope.lineNumber");f.warn((s?s+":":"")+(c?c+": ":"")+'Unable to find helper "'+e+'".')}return t},a.prototype.closingTag=function(){return this.methodExpr.key},"production"!==process.env.NODE_ENV&&(a.prototype.sourceText=function(){var e=[this.methodExpr.sourceText()];return this.argExprs.length&&e.push(this.argExprs.map(function(e){return e.sourceText()}).join(" ")),0<d.size(this.hashExprs)&&e.push(r.prototype.sourceText.call(this)),e.join(" ")}),"production"!==process.env.NODE_ENV&&d.assignSymbols(a.prototype,{"can.getName":function(){return d.getName(this.constructor)+"{{"+this.sourceText()+"}}"}}),n.exports=a}),define("can-stache/expressions/lookup",["require","exports","module","can-stache/src/expression-helpers","can-reflect","can-symbol","can-assign"],function(e,t,n){"use strict";var r=e("can-stache/src/expression-helpers"),a=e("can-reflect"),i=e("can-symbol").for("can-stache.sourceText"),o=e("can-assign"),s=function(e,t,n){this.key=e,this.rootExpr=t,a.setKeyValue(this,i,n)};s.prototype.value=function(e,t){return this.rootExpr?r.getObservableValue_fromDynamicKey_fromObservable(this.key,this.rootExpr.value(e),e,{},{}):e.computeData(this.key,o({warnOnMissingKey:!0},t))},"production"!==process.env.NODE_ENV&&(s.prototype.sourceText=function(){return this[i]?this[i]:this.rootExpr?this.rootExpr.sourceText()+"."+this.key:this.key}),n.exports=s}),define("can-stache/src/expression",["require","exports","module","can-stache/expressions/arg","can-stache/expressions/literal","can-stache/expressions/hashes","can-stache/expressions/bracket","can-stache/expressions/call","can-stache/expressions/helper","can-stache/expressions/lookup","can-stache/src/set-identifier","can-stache/src/expression-helpers","can-stache/src/utils","can-assign","can-reflect","can-symbol"],function(e,t,n){"use strict";var f=e("can-stache/expressions/arg"),d=e("can-stache/expressions/literal"),p=e("can-stache/expressions/hashes"),h=e("can-stache/expressions/bracket"),v=e("can-stache/expressions/call"),r=e("can-stache/expressions/helper"),a=e("can-stache/expressions/lookup"),i=e("can-stache/src/set-identifier"),o=e("can-stache/src/expression-helpers"),g=e("can-stache/src/utils"),s=e("can-assign"),y=g.last,m=e("can-reflect"),b=e("can-symbol"),w=b.for("can-stache.sourceText"),_=/[\w\.\\\-_@\/\&%]+/,c=/('.*?'|".*?"|=|[\w\.\\\-_@\/*%\$]+|[\(\)]|,|\~|\[|\]\s*|\s*(?=\[))/g,u=/\]\s+/,x=/^('.*?'|".*?"|-?[0-9]+\.?[0-9]*|true|false|null|undefined)$/,l=/^[\.@]\w/,E=function(e){return t=e,_.test(t)&&l.test(e);var t},k=function(e){return e.children||(e.children=[]),e},O=function(){this.root={children:[],type:"Root"},this.current=this.root,this.stack=[this.root]};s(O.prototype,{top:function(){return y(this.stack)},isRootTop:function(){return this.top()===this.root},popTo:function(e){this.popUntil(e),this.pop()},pop:function(){this.isRootTop()||this.stack.pop()},first:function(e){for(var t=this.stack.length-1;0<t&&-1===e.indexOf(this.stack[t].type);)t--;return this.stack[t]},firstParent:function(e){for(var t=this.stack.length-2;0<t&&-1===e.indexOf(this.stack[t].type);)t--;return this.stack[t]},popUntil:function(e){for(;-1===e.indexOf(this.top().type)&&!this.isRootTop();)this.stack.pop();return this.top()},addTo:function(e,t){var n=this.popUntil(e);k(n).children.push(t)},addToAndPush:function(e,t){this.addTo(e,t),this.stack.push(t)},push:function(e){this.stack.push(e)},topLastChild:function(){return y(this.top().children)},replaceTopLastChild:function(e){var t=k(this.top()).children;return t.pop(),t.push(e),e},replaceTopLastChildAndPush:function(e){this.replaceTopLastChild(e),this.stack.push(e)},replaceTopAndPush:function(e){var t;return(t=(this.top()===this.root||this.stack.pop(),k(this.top()).children)).pop(),t.push(e),this.stack.push(e),e}});var N=function(e){var t=e.lastIndexOf("./"),n=e.lastIndexOf(".");if(t<n)return e.substr(0,n)+"@"+e.substr(n+1);var r=-1===t?0:t+2,a=e.charAt(r);return"."===a||"@"===a?e.substr(0,r)+"@"+e.substr(r+1):e.substr(0,r)+"@"+e.substr(r)},L=function(e){var t=e.top();if(t&&"Lookup"===t.type){var n=e.stack[e.stack.length-2];"Helper"!==n.type&&n&&e.replaceTopAndPush({type:"Helper",method:t})}},V={toComputeOrValue:o.toComputeOrValue,convertKeyToLookup:N,Literal:d,Lookup:a,Arg:f,Hash:function(){},Hashes:p,Call:v,Helper:r,Bracket:h,SetIdentifier:i,tokenize:function(e){var n=[];return(e.trim()+" ").replace(c,function(e,t){u.test(t)?(n.push(t[0]),n.push(t.slice(1))):n.push(t)}),n},lookupRules:{default:function(e,t,n){return"Helper"===e.type?r:a},method:function(e,t,n){return a}},methodRules:{default:function(e){return"Call"===e.type?v:r},call:function(e){return v}},parse:function(e,t){t=t||{};var n=this.ast(e);return t.lookupRule||(t.lookupRule="default"),"string"==typeof t.lookupRule&&(t.lookupRule=V.lookupRules[t.lookupRule]),t.methodRule||(t.methodRule="default"),"string"==typeof t.methodRule&&(t.methodRule=V.methodRules[t.methodRule]),this.hydrateAst(n,t,t.baseMethodType||"Helper")},hydrateAst:function(t,n,r,e){var a,i;if("Lookup"===t.type)return new(n.lookupRule(t,r,e))(t.key,t.root&&this.hydrateAst(t.root,n,r),t[w]);if("Literal"===t.type)return new d(t.value);if("Arg"===t.type)return new f(this.hydrateAst(t.children[0],n,r,e),{compute:!0});if("Hash"===t.type)throw new Error("");if("Hashes"===t.type)return a={},t.children.forEach(function(e){a[e.prop]=this.hydrateAst(e.children[0],n,r,!0)},this),new p(a);if("Call"!==t.type&&"Helper"!==t.type)return"Bracket"===t.type?("production"!==process.env.NODE_ENV&&(i=t[b.for("can-stache.originalKey")]),new h(this.hydrateAst(t.children[0],n),t.root?this.hydrateAst(t.root,n):void 0,i)):void 0;a={};var o=[],s=t.children,c=n.methodRule(t);if(s)for(var u=0;u<s.length;u++){var l=s[u];"Hashes"===l.type&&"Helper"===t.type&&c!==v?l.children.forEach(function(e){a[e.prop]=this.hydrateAst(e.children[0],n,t.type,!0)},this):o.push(this.hydrateAst(l,n,t.type,!0))}return new c(this.hydrateAst(t.method,n,t.type),o,a)},ast:function(e){var t=this.tokenize(e);return this.parseAst(t,{index:0})},parseAst:function(e,t){for(var n,r,a,i,o=new O;t.index<e.length;){var s=e[t.index],c=e[t.index+1];if(t.index++,"="===c){(n=o.top())&&"Lookup"===n.type&&("Call"!==(r=o.firstParent(["Call","Helper","Hash"])).type&&"Root"!==r.type||(o.popUntil(["Call"]),n=o.top(),o.replaceTopAndPush({type:"Helper",method:"Root"===n.type?y(n.children):n})));var u={type:"Hash",prop:s};"Hashes"===(r=o.first(["Call","Helper","Hashes","Root"])).type?o.addToAndPush(["Hashes"],u):(o.addToAndPush(["Helper","Call","Root"],{type:"Hashes",children:[u]}),o.push(u)),t.index++}else if(x.test(s))L(o),"Hash"===(r=o.first(["Helper","Call","Hash","Bracket"])).type&&r.children&&0<r.children.length?o.addTo(["Helper","Call","Bracket"],{type:"Literal",value:g.jsonParse(s)}):"Bracket"===r.type&&r.children&&0<r.children.length?o.addTo(["Helper","Call","Hash"],{type:"Literal",value:g.jsonParse(s)}):o.addTo(["Helper","Call","Hash","Bracket"],{type:"Literal",value:g.jsonParse(s)});else if(_.test(s))a=o.topLastChild(),r=o.first(["Helper","Call","Hash","Bracket"]),a&&("Call"===a.type||"Bracket"===a.type)&&E(s)?o.replaceTopLastChildAndPush({type:"Lookup",root:a,key:s.slice(1)}):"Bracket"===r.type?r.children&&0<r.children.length?"Helper"===o.first(["Helper","Call","Hash","Arg"]).type&&"."!==s[0]?o.addToAndPush(["Helper"],{type:"Lookup",key:s}):o.replaceTopAndPush({type:"Lookup",key:s.slice(1),root:r}):o.addToAndPush(["Bracket"],{type:"Lookup",key:s}):(L(o),o.addToAndPush(["Helper","Call","Hash","Arg","Bracket"],{type:"Lookup",key:s}));else if("~"===s)L(o),o.addToAndPush(["Helper","Call","Hash"],{type:"Arg",key:s});else if("("===s){if("Lookup"!==(n=o.top()).type)throw new Error("Unable to understand expression "+e.join(""));o.replaceTopAndPush({type:"Call",method:(i=n,"Lookup"===i.type&&(m.setKeyValue(i,w,i.key),i.key=N(i.key)),i)})}else if(")"===s)o.popTo(["Call"]);else if(","===s){"Call"!==o.first(["Call"]).type?o.popUntil(["Hash"]):o.popUntil(["Call"])}else if("["===s)if(n=o.top(),!(a=o.topLastChild())||"Call"!==a.type&&"Bracket"!==a.type)if("Lookup"===n.type||"Bracket"===n.type){var l={type:"Bracket",root:n};"production"!==process.env.NODE_ENV&&m.setKeyValue(l,b.for("can-stache.originalKey"),n.key),o.replaceTopAndPush(l)}else"Call"===n.type?o.addToAndPush(["Call"],{type:"Bracket"}):" "===n?(o.popUntil(["Lookup","Call"]),L(o),o.addToAndPush(["Helper","Call","Hash"],{type:"Bracket"})):o.replaceTopAndPush({type:"Bracket"});else o.replaceTopLastChildAndPush({type:"Bracket",root:a});else"]"===s?o.pop():" "===s&&o.push(s)}return o.root.children[0]}};n.exports=V}),define("can-stache/src/mustache_core",["require","exports","module","can-view-live","can-view-nodelist","can-observation","can-observation-recorder","can-stache/src/utils","can-stache/src/expression","can-fragment","can-dom-mutate","can-symbol","can-reflect","can-log/dev/dev","can-globals/document/document","can-define-lazy-value"],function(e,t,n){!function(e,t,n,r){"use strict";var v=t("can-view-live"),g=t("can-view-nodelist"),y=t("can-observation"),m=t("can-observation-recorder"),l=t("can-stache/src/utils"),b=t("can-stache/src/expression"),w=t("can-fragment"),_=t("can-dom-mutate"),x=t("can-symbol"),E=t("can-reflect"),k=t("can-log/dev/dev"),f=t("can-globals/document/document"),a=t("can-define-lazy-value"),i=x.for("can.toDOM");function d(e,t,n,r){this.metadata={rendered:!1},this.stringOnly=r,this.scope=e,this.nodeList=t,this.exprData=n}a(d.prototype,"context",function(){return this.scope.peek("this")});var o=/(?:(^|\r?\n)(\s*)(\{\{([\s\S]*)\}\}\}?)([^\S\n\r]*)($|\r?\n))|(\{\{([\s\S]*)\}\}\}?)/g,s=/(\s*)(\{\{\{?)(-?)([\s\S]*?)(-?)(\}\}\}?)(\s*)/g,O=function(){},N=x.for("can.viewInsert");function L(e){return null!==e&&"object"==typeof e&&("function"==typeof e[i]||"function"==typeof e[N]||"number"==typeof e.nodeType)}var V={expression:b,makeEvaluator:function(r,e,t,n,a,i,o){if("^"===t){var s=a;a=i,i=s}var c,u=new d(r,e,n,o);if(l.createRenderers(u,r,e,a,i,o),n instanceof b.Call)c=n.value(r,u);else if(n instanceof b.Bracket)c=n.value(r);else if(n instanceof b.Lookup)c=n.value(r);else if(n instanceof b.Helper&&n.methodExpr instanceof b.Bracket)c=n.methodExpr.value(r,u);else if("function"==typeof(c=n.value(r,u)))return c;return!t||u.metadata.rendered?c:"#"===t||"^"===t?function(){var e,t=E.getValue(c);if(u.metadata.rendered)e=t;else if("string"!=typeof t&&E.isListLike(t)){var n=E.isObservableLike(t)&&E.isListLike(t);e=E.getKeyValue(t,"length")?o?l.getItemsStringContent(t,n,u):w(l.getItemsFragContent(t,u,r)):u.inverse(r)}else e=t?u.fn(t||r):u.inverse(r);return u.metadata.rendered=!1,e}:void 0},makeLiveBindingPartialRenderer:function(e,n){var u,l=(e=e.trim()).split(/\s+/).shift();return l!==e&&(u=V.expression.parse(e)),function(s,e){"production"!==process.env.NODE_ENV&&(s.set("scope.filename",n.filename),s.set("scope.lineNumber",n.lineNo));var c=[this];c.expression=">"+l,g.register(c,null,e||!0,n.directlyNested);var t=new y(function(){var t=l,n=s;if(u&&1===u.argExprs.length){var e=E.getValue(u.argExprs[0].value(s));void 0===e?"production"!==process.env.NODE_ENV&&k.warn("The context ("+u.argExprs[0].key+") you passed into thepartial ("+l+") is not defined in the scope!"):n=s.add(e)}var r,a=E.getKeyValue(n.templateContext.partials,t);if(a)r=function(){return a.render?a.render(n,c):a(n)};else{var i=n.read(t,{isArgument:!0}).value;if(null===i||!i&&"*"===t[0])return w("");i&&(t=i),r=function(){if("function"==typeof t)return t(n,{},c);var e=V.getTemplateById(t);return e?e(n,{},c):f().createDocumentFragment()}}var o=m.ignore(r)();return w(o)});E.setPriority(t,c.nesting),v.html(this,t,this.parentNode,c)}},makeStringBranchRenderer:function(i,e,o){var s=V.expression.parse(e),c=i+e,t=function(e,t,n){"production"!==process.env.NODE_ENV&&(e.set("scope.filename",o.filename),e.set("scope.lineNumber",o.lineNo));var r,a=e.__cache[c];return!i&&a||(a=D(e,null,i,s,t,n,!0),i||(e.__cache[c]=a)),null==(r=a[x.for("can.onValue")]?E.getValue(a):a())?"":""+r};return t.exprData=s,t},makeLiveBindingBranchRenderer:function(f,d,p){var h=V.expression.parse(d);h instanceof b.Helper||h instanceof b.Call||h instanceof b.Bracket||h instanceof b.Lookup||(h=new b.Helper(h,[],{}));var e=function(e,t,n,r){var a=p.tag;"production"!==process.env.NODE_ENV&&(e.set("scope.filename",p.filename),e.set("scope.lineNumber",p.lineNo));var i=[this];i.expression=d,g.register(i,null,t||!0,p.directlyNested);var o,s=D(e,i,f,h,n,r,a);if(o=s[x.for("can.onValue")]?s:("production"!==process.env.NODE_ENV&&Object.defineProperty(s,"name",{value:"{{"+(f||"")+d+"}}"}),new y(s,null,{isObservable:!1})),!1===E.setPriority(o,i.nesting))throw new Error("can-stache unable to set priority on observable");E.onValue(o,O);var c=E.getValue(o);if("function"!=typeof c||h instanceof b.Lookup){if(E.valueHasDependencies(o))p.attr?v.attr(this,p.attr,o):p.tag?v.attrs(this,o):p.text&&!L(c)?("production"!==process.env.NODE_ENV&&null!==c&&"object"==typeof c&&k.warn("Previously, the result of "+d+" in "+p.filename+":"+p.lineNo+", was being inserted as HTML instead of TEXT. Please use stache.safeString(obj) if you would like the object to be treated as HTML."),v.text(this,o,this.parentNode,i)):v.html(this,o,this.parentNode,{nodeList:i});else if(p.attr)_.setAttribute(this,p.attr,c);else if(p.tag)v.attrs(this,c);else if(p.text&&!L(c))this.nodeValue=v.makeString(c);else if(null!=c)if("function"==typeof c[N]){var u=c[N]({nodeList:i}),l=g.update(i,[u]);g.replace(l,u)}else g.replace([this],w(c,this.ownerDocument))}else m.ignore(c)(this);E.offValue(o,O)};return e.exprData=h,e},splitModeFromExpression:function(e,t){var n=(e=e.trim()).charAt(0);return 0<="#/{&^>!<".indexOf(n)?e=e.substr(1).trim():n=null,"{"===n&&t.node&&(n=null),{mode:n,expression:e}},cleanLineEndings:function(e){return e.replace(o,function(e,t,n,r,a,i,o,s,c,u){i=i||"",t=t||"",n=n||"";var l=p(a||c,{});return s||0<=">{".indexOf(l.mode)?e:0<="^#!/".indexOf(l.mode)?(n=t+n&&" ")+r+(0!==u&&o.length?t+"\n":""):n+r+i+(n.length||0!==u?t+"\n":"")})},cleanWhitespaceControl:function(e){return e.replace(s,function(e,t,n,r,a,i,o,s,c){return"-"===r&&(t=""),"-"===i&&(s=""),t+n+a+o+s})},getTemplateById:function(){}},D=V.makeEvaluator,p=V.splitModeFromExpression;r.exports=V}(0,e,0,n)}),define("can-globals/base-url/base-url",["require","exports","module","can-globals/can-globals-instance","can-globals/global/global","can-globals/document/document"],function(e,t,n){!function(e,t,n,r){"use strict";var a=t("can-globals/can-globals-instance");t("can-globals/global/global"),t("can-globals/document/document"),a.define("base-url",function(){var e=a.getKeyValue("global"),t=a.getKeyValue("document");if(t&&"baseURI"in t)return t.baseURI;if(e.location){var n=e.location.href,r=n.lastIndexOf("/");return-1!==r?n.substr(0,r):n}return"undefined"!=typeof process?process.cwd():void 0}),r.exports=a.makeExport("base-url")}(0,e,0,n)}),define("can-parse-uri",["require","exports","module","can-namespace"],function(e,t,n){"use strict";var r=e("can-namespace");n.exports=r.parseURI=function(e){var t=String(e).replace(/^\s+|\s+$/g,"").match(/^([^:\/?#]+:)?(\/\/(?:[^:@]*(?::[^:@]*)?@)?(([^:\/?#]*)(?::(\d*))?))?([^?#]*)(\?[^#]*)?(#[\s\S]*)?/);return t?{href:t[0]||"",protocol:t[1]||"",authority:t[2]||"",host:t[3]||"",hostname:t[4]||"",port:t[5]||"",pathname:t[6]||"",search:t[7]||"",hash:t[8]||""}:null}}),define("can-join-uris",["require","exports","module","can-namespace","can-parse-uri"],function(e,t,n){"use strict";var r=e("can-namespace"),a=e("can-parse-uri");n.exports=r.joinURIs=function(e,t){return t=a(t||""),e=a(e||""),t&&e?(t.protocol||e.protocol)+(t.protocol||t.authority?t.authority:e.authority)+(n=t.protocol||t.authority||"/"===t.pathname.charAt(0)?t.pathname:t.pathname?(e.authority&&!e.pathname?"/":"")+e.pathname.slice(0,e.pathname.lastIndexOf("/")+1)+t.pathname:e.pathname,r=[],n.replace(/^(\.\.?(\/|$))+/,"").replace(/\/(\.(\/|$))+/g,"/").replace(/\/\.\.$/,"/../").replace(/\/?[^\/]*/g,function(e){"/.."===e?r.pop():r.push(e)}),r.join("").replace(/^\//,"/"===n.charAt(0)?"/":""))+(t.protocol||t.authority||t.pathname?t.search:t.search||e.search)+t.hash:null;var n,r}}),define("can-stache/helpers/-debugger",["require","exports","module","can-log","can-reflect","can-symbol"],function(e,t,n){"use strict";var a=e("can-log");function r(){}var i=r,o=r,s={};if("production"!==process.env.NODE_ENV){var c=e("can-reflect"),u=e("can-symbol");s={allowDebugger:!0},i=function(e){return e&&e[u.for("can.getValue")]?c.getValue(e):e},o=function(e,t){switch(arguments.length){case 0:return!0;case 1:return!!i(e);case 2:return i(e)===i(t);default:throw a.log(["Usage:"," {{debugger}}: break any time this helper is evaluated"," {{debugger condition}}: break when `condition` is truthy"," {{debugger left right}}: break when `left` === `right`"].join("\n")),new Error("{{debugger}} must have less than three arguments")}}}function l(e,t){if("production"!==process.env.NODE_ENV){if(!o.apply(null,Array.prototype.slice.call(arguments,0,-1)))return;var n=arguments[arguments.length-1],r=n&&n.scope;if(l._lastGet=function(e){return r.get(e)},a.log("Use `get(<path>)` to debug this template"),s.allowDebugger)return}a.warn("Forgotten {{debugger}} helper")}l.requiresOptionsArgument=!0,n.exports={helper:l,evaluateArgs:o,resolveValue:i,__testing:s}}),define("can-stache/src/truthy-observable",["require","exports","module","can-observation","can-reflect"],function(e,t,n){"use strict";var r=e("can-observation"),a=e("can-reflect");n.exports=function(e){return new r(function(){return!!a.getValue(e)})}}),define("can-stache/helpers/converter",["require","exports","module","can-stache/src/set-identifier","can-reflect"],function(e,t,n){"use strict";var a=e("can-stache/src/set-identifier"),i=e("can-reflect");n.exports=function(r){return r=r||{},function(e,t){var n=i.toArray(arguments);return e instanceof a?"function"==typeof r.set?r.set.apply(this,[e.value].concat(n.slice(1))):t(e.value):"function"==typeof r.get?r.get.apply(this,n):n[0]}}}),define("can-dom-data",["require","exports","module","can-namespace"],function(e,t,n){"use strict";var r=e("can-namespace"),a=new WeakMap,i=function(e){var t=!1;return a.has(e)&&(t=!0,a.delete(e)),t},o={_data:a,get:function(e,t){var n=a.get(e);return void 0===t?n:n&&n[t]},set:function(e,t,n){var r=a.get(e);return void 0===r&&(r={},a.set(e,r)),void 0!==t&&(r[t]=n),r},clean:function(e,t){var n=a.get(e);n&&n[t]&&delete n[t],function(e){for(var t in e)return!1;return!0}(n)&&i(e)},delete:i};if(r.domData)throw new Error("You can't have two versions of can-dom-data, check your dependencies");n.exports=r.domData=o}),define("can-stache/helpers/-for-of",["require","exports","module","can-reflect","can-observation","can-view-live","can-view-nodelist","can-stache/src/expression","can-stache/src/key-observable"],function(e,t,n){var p=e("can-reflect"),h=e("can-observation"),v=e("can-view-live"),g=e("can-view-nodelist"),y=e("can-stache/src/expression"),m=e("can-stache/src/key-observable");var r=function(r){if(1!==r.exprData.argExprs.length)throw new Error("for(of) broken syntax");var a,e,t=r.exprData.argExprs[0].expr;if(t instanceof y.Lookup)e=t.value(r.scope);else if(t instanceof y.Helper){if("of"!==t.argExprs[0].key)throw new Error("for(of) broken syntax");a=t.methodExpr.key,e=t.argExprs[1].value(r.scope)}var n,i,o,s,c,u=e,l=[].slice.call(arguments).pop(),f=(n=u)&&p.isValueLike(n)?(h.temporarilyBind(n),p.getValue(n)):n;if(f&&!p.isListLike(f))return i=f,o=a,s=r,c=[],p.each(i,function(e,t){var n=new m(i,t),r={};void 0!==o&&(r[o]=n),c.push(s.fn(s.scope.add({key:t},{special:!0}).addLetContext(r)))}),s.stringOnly?c.join(""):c;if(l.stringOnly){var d=[];return p.eachIndex(f,function(e,t){var n={};void 0!==a&&(n[a]=e),d.push(r.fn(l.scope.add({index:t},{special:!0}).addLetContext(n)))}),d.join("")}return l.metadata.rendered=!0,function(e){var t=[e];t.expression="live.list",g.register(t,null,l.nodeList,!0),g.update(l.nodeList,[e]);v.list(e,u,function(e,t,n){var r={};return void 0!==a&&(r[a]=e),l.fn(l.scope.add({index:t},{special:!0}).addLetContext(r),l.options,n)},l.context,e.parentNode,t,function(e,t){return l.inverse(l.scope,l.options,t)})}};r.isLiveBound=!0,r.requiresOptionsArgument=!0,r.ignoreArgLookup=function(e){return 0===e},n.exports=r}),define("can-stache/helpers/-let",["require","exports","module","can-reflect"],function(e,t,n){var r=e("can-reflect");function a(e){return!0===e._meta.variable}n.exports=function(e){var t=e.scope.getScope(a);if(!t)throw new Error("There is no variable scope!");return r.assignMap(t._context,e.hash),document.createTextNode("")}}),define("can-stache/helpers/core",["require","exports","module","can-view-live","can-view-nodelist","can-stache/src/utils","can-globals/base-url/base-url","can-join-uris","can-assign","can-log/dev/dev","can-reflect","can-stache/helpers/-debugger","can-stache/src/key-observable","can-observation","can-stache/src/truthy-observable","can-stache-helpers","can-stache/helpers/converter","can-dom-data","can-dom-data-state","can-stache/helpers/-for-of","can-stache/helpers/-let"],function(e,t,n){!function(e,t,n,r){"use strict";var c=t("can-view-live"),u=t("can-view-nodelist"),l=t("can-stache/src/utils"),s=t("can-globals/base-url/base-url"),f=t("can-join-uris"),o=t("can-assign"),a=t("can-log/dev/dev"),d=t("can-reflect"),i=t("can-stache/helpers/-debugger").helper,p=t("can-stache/src/key-observable"),h=t("can-observation"),v=t("can-stache/src/truthy-observable"),g=t("can-stache-helpers"),y=t("can-stache/helpers/converter"),m=t("can-dom-data"),b=t("can-dom-data-state"),w=t("can-stache/helpers/-for-of"),_=t("can-stache/helpers/-let"),x={},E={},k=new WeakMap,O={looksLikeOptions:function(e){return e&&"function"==typeof e.fn&&"function"==typeof e.inverse},resolve:function(e){return e&&d.isValueLike(e)?d.getValue(e):e},resolveHash:function(e){var t={};for(var n in e)t[n]=O.resolve(e[n]);return t},bindAndRead:function(e){return e&&d.isValueLike(e)?(h.temporarilyBind(e),d.getValue(e)):e},registerHelper:function(e,t){"production"!==process.env.NODE_ENV&&g[e]&&a.warn("The helper "+e+" has already been registered."),t.requiresOptionsArgument=!0,g[e]=t},registerHelpers:function(e){var t,n;for(t in e)n=e[t],O.registerHelper(t,O.makeSimpleHelper(n))},registerConverter:function(e,t){O.registerHelper(e,y(t))},makeSimpleHelper:function(e){return function(){var t=[];return d.eachIndex(arguments,function(e){t.push(O.resolve(e))}),e.apply(this,t)}},addHelper:function(e,t){return"object"==typeof e?O.registerHelpers(e):O.registerHelper(e,O.makeSimpleHelper(t))},addConverter:function(e,t){if("object"!=typeof e){var n=y(t);n.isLiveBound=!0,O.registerHelper(e,n)}else k.has(e)||(k.set(e,!0),d.eachKey(e,function(e,t){O.addConverter(t,e)}))},addLiveHelper:function(e,t){return t.isLiveBound=!0,O.registerHelper(e,t)},getHelper:function(e,t){var n=t&&t.getHelper(e);return n||(n=g[e]),n},__resetHelpers:function(){for(var e in g)delete g[e];k.delete(E),O.addBuiltInHelpers(),O.addBuiltInConverters()},addBuiltInHelpers:function(){d.each(x,function(e,t){g[t]=e})},addBuiltInConverters:function(){O.addConverter(E)},_makeLogicHelper:function(a,i){var e=o(function(){var e,t=Array.prototype.slice.call(arguments,0);function n(){return e?!!i(t):i(t)}O.looksLikeOptions(t[t.length-1])&&(e=t.pop()),"production"!==process.env.NODE_ENV&&Object.defineProperty(n,"name",{value:a+"("+t.map(function(e){return d.getName(e)}).join(",")+")",configurable:!0});var r=new h(n);return e?r.get()?e.fn():e.inverse():r.get()},{requiresOptionsArgument:!0,isLiveBound:!0});return"production"!==process.env.NODE_ENV&&Object.defineProperty(e,"name",{value:a,configurable:!0}),e}},N=o(function(e,t){return(e&&d.isValueLike(e)?d.getValue(new v(e)):!!O.resolve(e))?t.fn(t.scope||this):t.inverse(t.scope||this)},{requiresOptionsArgument:!0,isLiveBound:!0}),L=O._makeLogicHelper("eq",function(e){for(var t,n,r=0;r<e.length;r++){if(t="function"==typeof(t=O.resolve(e[r]))?t():t,0<r&&t!==n)return!1;n=t}return!0}),V=O._makeLogicHelper("and",function(e){if(0===e.length)return!1;for(var t,n=0,r=e.length;n<r;n++)if(!(t=O.resolve(e[n])))return t;return t}),D=O._makeLogicHelper("or",function(e){if(0===e.length)return!1;for(var t,n=0,r=e.length;n<r;n++)if(t=O.resolve(e[n]))return t;return t}),S=function(n,e){O.resolve(n);var r=!1,t=function(e,t){if(!r&&O.resolve(n)===O.resolve(e))return r=!0,t.fn(t.scope)},a=function(e){if(!r)return!e||e.scope.peek("this")};a.requiresOptionsArgument=t.requiresOptionsArgument=!0,d.assignSymbols(a,{"can.isValueLike":!0,"can.isFunctionLike":!1,"can.getValue":function(){return this(e)}});var i=e.scope.add({case:t,default:a},{notContext:!0});return e.fn(i,e)},P=function(e){var t=[].slice.call(arguments),n=t.pop(),r=t.map(function(e){var t=O.resolve(e);return"function"==typeof t?t():t}).join(""),a=d.getKeyValue(n.scope.templateContext.helpers,"module"),i=a?a.uri:void 0;if("."===r[0]&&i)return f(i,r);var o="undefined"!=typeof System&&(System.renderingBaseURL||System.baseURL)||s();return"/"!==r[0]&&"/"!==o[o.length-1]&&(o+="/"),f(o,r)},M=function(n){var a,r,i=[].slice.call(arguments).pop(),e=i.exprData.hashExprs,t=O.bindAndRead(n);if(0<d.size(e)&&(a={},d.eachKey(e,function(e,t){a[e.key]=t})),(d.isObservableLike(t)&&d.isListLike(t)||d.isListLike(t)&&d.isValueLike(n))&&!i.stringOnly)return i.metadata.rendered=!0,function(e){var t=[e];t.expression="live.list",u.register(t,null,i.nodeList,!0),u.update(i.nodeList,[e]);c.list(e,n,function(e,t,n){var r={};return 0<d.size(a)&&(a.value&&(r[a.value]=e),a.index&&(r[a.index]=t)),i.fn(i.scope.add(r,{notContext:!0}).add({index:t},{special:!0}).add(e),i.options,n)},i.context,e.parentNode,t,function(e,t){return i.inverse(i.scope.add(e),i.options,t)})};var o,s=O.resolve(n);return s&&d.isListLike(s)?(o=l.getItemsFragContent(s,i,i.scope),i.stringOnly?o.join(""):o):d.isObservableLike(s)&&d.isMapLike(s)||s instanceof Object?(o=[],d.each(s,function(e,t){var n=new p(s,t);r={},0<d.size(a)&&(a.value&&(r[a.value]=n),a.key&&(r[a.key]=t)),o.push(i.fn(i.scope.add(r,{notContext:!0}).add({key:t},{special:!0}).add(n)))}),i.stringOnly?o.join(""):o):void 0};M.isLiveBound=P.requiresOptionsArgument=S.requiresOptionsArgument=!0,M.requiresOptionsArgument=!0,M.ignoreArgLookup=function(e){return 1===e};var q=o(function(e,t){t||(t=e,e=0);var n=t.scope.peek("scope.index");return""+(("function"==typeof n?n():n)+e)},{requiresOptionsArgument:!0}),C=function(e,t){var n=e;return t?(e=O.resolve(e),t.hash&&0<d.size(t.hash)&&(n=t.scope.add(t.hash,{notContext:!0}).add(n))):(t=e,e=!0,n=t.hash),t.fn(n||{})},j=function(e,t){return N.apply(this,[e,o(o({},t),{fn:t.inverse,inverse:t.fn})])};j.requiresOptionsArgument=C.requiresOptionsArgument=!0,j.isLiveBound=!0;var T={get:function(e,t){return O.looksLikeOptions(t)?d.getValue(e)?t.inverse():t.fn():!d.getValue(e)},set:function(e,t){d.setValue(t,!e)}};o(x,{debugger:i,each:M,eachOf:M,index:q,if:N,is:L,eq:L,unless:j,with:C,console:console,data:function(t,e){var n=(O.looksLikeOptions(e)?e.context:e)||this;return function(e){"production"!==process.env.NODE_ENV&&a.warn("The {{data}} helper has been deprecated; use {{domData}} instead: https://canjs.com/doc/can-stache.helpers.domData.html"),b.set.call(e,t,n)}},domData:function(t,e){var n=(O.looksLikeOptions(e)?e.context:e)||this;return function(e){m.set(e,t,n)}},switch:S,joinBase:P,and:V,or:D,let:_,for:w}),o(E,{not:T}),O.addBuiltInHelpers(),O.addBuiltInConverters(),r.exports=O}(0,e,0,n)}),define("can-stache-ast/controls",function(e,t,n){"use strict";var r=/(?:(^|\r?\n)(\s*)(\{\{([\s\S]*)\}\}\}?)([^\S\n\r]*)($|\r?\n))|(\{\{([\s\S]*)\}\}\}?)/g,a=/(\s*)(\{\{\{?)(-?)([\s\S]*?)(-?)(\}\}\}?)(\s*)/g;function i(e,t,n,r,a,i,o,s){return"-"===r&&(t=""),"-"===i&&(s=""),t+n+a+o+s}t.cleanLineEndings=function(e){return e.replace(r,function(e,t,n,r,a,i,o,s,c,u){i=i||"",t=t||"",n=n||"";var l,f,d,p=(f={},d=(l=(l=a||c).trim()).charAt(0),0<="#/{&^>!<".indexOf(d)?l=l.substr(1).trim():d=null,"{"===d&&f.node&&(d=null),{mode:d,expression:l});return s||0<=">{".indexOf(p.mode)?e:0<="^#!/".indexOf(p.mode)?(n=t+n&&" ")+r+(0!==u&&o.length?t+"\n":""):n+r+i+(n.length||0!==u?t+"\n":"")})},t.cleanWhitespaceControl=function(e){return e.replace(a,i)}}),define("can-stache-ast",["require","exports","module","can-stache-ast/controls","can-view-parser"],function(e,t,n){"use strict";var m=e("can-stache-ast/controls"),b=e("can-view-parser");t.parse=function(e,t){1===arguments.length&&(t=arguments[0],e=void 0);var n=t;n=m.cleanWhitespaceControl(n),n=m.cleanLineEndings(n);var r=[],a=[],i=[],o={},s=new Map,c=!1,u=!1,l=!1,f=!1,d=!1,p="",h="",v=null;function g(e){p&&(o[p]=h,p=""),d?a.push(h):r.push(h),i.push({specifier:h,loc:{line:e},attributes:s}),s=new Map}var y=b(n,{filename:e,start:function(e,t){"can-import"===e?(f=t,c=!(d=!1)):"can-dynamic-import"===e?(f=t,c=d=!0):c&&(c=!(d=!0))},attrStart:function(e){v=e,s.set(v,!0),"from"===e?u=!0:"as"!==e&&"export-as"!==e||(l=!0)},attrEnd:function(e){"from"===e?u=!1:"as"!==e&&"export-as"!==e||(l=!1)},attrValue:function(e){c&&s.set(v,e),u&&c?h=e:l&&c&&(p=e)},end:function(e,t,n){"can-import"!==e&&"can-dynamic-import"!==e||!f||g(n)},close:function(e,t,n){"can-import"!==e&&"can-dynamic-import"!==e||g(n)},chars:function(e){0<e.trim().length&&(d=!0)},special:function(){d=!0}},!0);return{intermediate:y,program:y,imports:r,dynamicImports:a,importDeclarations:i,ases:o,exports:o}}}),define("can-import-module",["require","exports","module","can-globals/global/global","can-namespace"],function(e,t,n){!function(e,t,n,r){"use strict";var i=t("can-globals/global/global"),a=t("can-namespace");r.exports=a.import=function(r,a){return new Promise(function(t,n){try{var e=i();"object"==typeof e.System&&"function"==typeof e.System.import?e.System.import(r,{name:a}).then(t,n):e.define&&e.define.amd?e.require([r],function(e){t(e)}):e.require?t(e.require(r)):"undefined"!=typeof stealRequire?steal.import(r,{name:a}).then(t,n):t()}catch(e){n(e)}})}}(0,e,0,n)}),define("can-stache",["require","exports","module","can-view-parser","can-view-callbacks","can-stache/src/html_section","can-stache/src/text_section","can-stache/src/mustache_core","can-stache/helpers/core","can-stache-ast","can-stache/src/utils","can-attribute-encoder","can-log/dev/dev","can-namespace","can-globals/document/document","can-assign","can-import-module","can-reflect","can-view-scope","can-view-scope/template-context","can-observation-recorder","can-symbol","can-view-target","can-view-nodelist"],function(e,t,n){!function(e,t,n,r){"use strict";var a=t("can-view-parser"),v=t("can-view-callbacks"),g=t("can-stache/src/html_section"),y=t("can-stache/src/text_section"),m=t("can-stache/src/mustache_core"),i=t("can-stache/helpers/core"),o=t("can-stache-ast").parse,s=t("can-stache/src/utils"),b=s.makeRendererConvertScopes,w=s.last,_=t("can-attribute-encoder"),x=t("can-log/dev/dev"),c=t("can-namespace"),u=t("can-globals/document/document"),E=t("can-assign"),l=t("can-import-module"),k=t("can-reflect"),O=t("can-view-scope"),N=t("can-view-scope/template-context"),L=t("can-observation-recorder"),f=t("can-symbol");t("can-view-target"),t("can-view-nodelist"),v.tag("content")||v.tag("content",function(e,t){return t.scope});var V=f.for("can.isView"),D=/[{(].*[)}]/,S=/^on:|(:to|:from|:bind)$|.*:to:on:.*/,d="http://www.w3.org/2000/svg",P={svg:d,g:d,defs:d,path:d,filter:d,feMorphology:d,feGaussianBlur:d,feOffset:d,feComposite:d,feColorMatrix:d,use:d},M={xmlns:"http://www.w3.org/2000/xmlns/","xlink:href":"http://www.w3.org/1999/xlink"},q={style:!0,script:!0};function p(u,e){1===arguments.length&&(e=arguments[0],u=void 0);var l={};"string"==typeof e&&(e=m.cleanWhitespaceControl(e),e=m.cleanLineEndings(e));var s=new g(u),f={node:null,attr:null,sectionElementStack:[],text:!1,namespaceStack:[],textContentOnly:null},i=function(e,t,n,r){if(">"===t)e.add(m.makeLiveBindingPartialRenderer(n,d({filename:e.filename,lineNo:r})));else if("/"===t){if("<"===e.last().startedWith?(l[n]=e.endSubSectionAndReturnRenderer(),e.removeCurrentNode()):e.endSection(),"production"!==process.env.NODE_ENV&&e instanceof g){var a=f.sectionElementStack[f.sectionElementStack.length-1];a.tag&&"section"===a.type&&""!==n&&n!==a.tag&&(u?x.warn(u+":"+r+": unexpected closing tag {{/"+n+"}} expected {{/"+a.tag+"}}"):x.warn(r+": unexpected closing tag {{/"+n+"}} expected {{/"+a.tag+"}}"))}e instanceof g&&f.sectionElementStack.pop()}else if("else"===t)e.inverse();else{var i=e instanceof g?m.makeLiveBindingBranchRenderer:m.makeStringBranchRenderer;if("{"===t||"&"===t)e.add(i(null,n,d({filename:e.filename,lineNo:r})));else if("#"===t||"^"===t||"<"===t){var o=i(t,n,d({filename:e.filename,lineNo:r})),s={type:"section"};if(e.startSection(o),e.last().startedWith=t,e instanceof g){if("production"!==process.env.NODE_ENV){var c="function"==typeof o.exprData.closingTag?o.exprData.closingTag():"";s.tag=c}f.sectionElementStack.push(s)}}else e.add(i(null,n,d({text:!0,filename:e.filename,lineNo:r})))}},o=function(){var e=f.sectionElementStack[f.sectionElementStack.length-1];return!f.sectionElementStack.length||("section"===e.type||"custom"===e.type)},d=function(e){var t={tag:f.node&&f.node.tag,attr:f.attr&&f.attr.name,directlyNested:o(),textContentOnly:!!f.textContentOnly};return e?E(t,e):t},c=function(e,t){e.attributes||(e.attributes=[]),e.attributes.unshift(t)};a(e,{filename:u,start:function(e,t,n){var r=P[e];r&&!t&&f.namespaceStack.push(r),f.node={tag:e,children:[],namespace:r||w(f.namespaceStack)}},end:function(n,e,r){var t=v.tag(n),a=o();e?(s.add(f.node),t&&c(f.node,function(e,t){"production"!==process.env.NODE_ENV&&e.set("scope.lineNumber",r),v.tagHandler(this,n,{scope:e,subtemplate:null,templateType:"stache",parentNodeList:t,directlyNested:a})})):(s.push(f.node),f.sectionElementStack.push({type:t?"custom":null,tag:t?null:n,templates:{},directlyNested:a}),t?s.startSubSection():q[n]&&(f.textContentOnly=new y(u))),f.node=null},close:function(n,r){P[n]&&f.namespaceStack.pop();var a,e=v.tag(n);e&&(a=s.endSubSectionAndReturnRenderer()),q[n]&&(s.last().add(f.textContentOnly.compile(d())),f.textContentOnly=null);var t=s.pop();if(e)if("can-template"===n){var i=f.sectionElementStack[f.sectionElementStack.length-2];a&&(i.templates[t.attrs.name]=b(a)),s.removeCurrentNode()}else{var o=f.sectionElementStack[f.sectionElementStack.length-1];c(t,function(e,t){"production"!==process.env.NODE_ENV&&e.set("scope.lineNumber",r),v.tagHandler(this,n,{scope:e,subtemplate:a?b(a):a,templateType:"stache",parentNodeList:t,templates:o.templates,directlyNested:o.directlyNested})})}f.sectionElementStack.pop()},attrStart:function(e,t){f.node.section?f.node.section.add(e+'="'):f.attr={name:e,value:""}},attrEnd:function(n,r){var e=M[n];if(f.node.section)f.node.section.add('" ');else{f.node.attrs||(f.node.attrs={}),f.attr.section?f.node.attrs[f.attr.name]=f.attr.section.compile(d()):f.node.attrs[f.attr.name]=e?{value:f.attr.value,namespaceURI:M[n]}:f.attr.value;var a=v.attr(n);if("production"!==process.env.NODE_ENV){var t=_.decode(n);(!!D.test(t)||!!S.test(t))&&!a&&x.warn("unknown attribute binding "+t+". Is can-stache-bindings imported?")}a&&(f.node.attributes||(f.node.attributes=[]),f.node.attributes.push(function(e,t){"production"!==process.env.NODE_ENV&&e.set("scope.lineNumber",r),a(this,{attributeName:n,scope:e,nodeList:t})})),f.attr=null}},attrValue:function(e,t){var n=f.node.section||f.attr.section;n?n.add(e):f.attr.value+=e},chars:function(e,t){(f.textContentOnly||s).add(e)},special:function(e,t){var n=m.splitModeFromExpression(e,f),r=n.mode,a=n.expression;if("else"!==a){if("!"!==r)if(f.node&&f.node.section)i(f.node.section,r,a,t),0===f.node.section.subSectionDepth()&&(f.node.attributes.push(f.node.section.compile(d())),delete f.node.section);else if(f.attr)f.attr.section||(f.attr.section=new y(u),f.attr.value&&f.attr.section.add(f.attr.value)),i(f.attr.section,r,a,t);else if(f.node)if(f.node.attributes||(f.node.attributes=[]),r){if("#"!==r&&"^"!==r)throw new Error(r+" is currently not supported within a tag.");f.node.section||(f.node.section=new y(u)),i(f.node.section,r,a,t)}else f.node.attributes.push(m.makeLiveBindingBranchRenderer(null,a,d({filename:s.filename,lineNo:t})));else i(f.textContentOnly||s,r,a,t)}else(f.attr&&f.attr.section?f.attr.section:f.node&&f.node.section?f.node.section:f.textContentOnly||s).inverse()},comment:function(e){s.add({comment:e})},done:function(e){}});var p=s.compile(),h=L.ignore(function(e,t,n){void 0===n&&k.isListLike(t)&&(n=t,t=void 0),!t||t.helpers||t.partials||t.tags||(t={helpers:t}),k.eachKey(t&&t.helpers,function(e){e.requiresOptionsArgument=!0});var r=new N(t);if(k.eachKey(l,function(e,t){k.setKeyValue(r.partials,t,e)}),k.setKeyValue(r,"view",h),"production"!==process.env.NODE_ENV&&k.setKeyValue(r,"filename",s.filename),e instanceof O){var a=new O(r);a._parent=e._parent,e._parent=a}else e=new O(r).add(e);return p(e.addLetContext(),n)});return h[V]=!0,h}E(p,i),p.safeString=function(e){return k.assignSymbols({},{"can.toDOM":function(){return e}})},p.async=function(e){var t=o(e),n=t.imports.map(function(e){return l(e)});return Promise.all(n).then(function(){return p(t.intermediate)})};var h={};p.from=m.getTemplateById=function(e){if(!h[e]){var t=u().getElementById(e);t&&(h[e]=p("#"+e,t.innerHTML))}return h[e]},p.registerPartial=function(e,t){h[e]="string"==typeof t?p(t):t},p.addBindings=v.attrs,r.exports=c.stache=p}(0,e,0,n)}),define("can-view-model",["require","exports","module","can-simple-map","can-namespace","can-globals/document/document","can-reflect","can-symbol"],function(e,t,n){!function(e,t,n,r){"use strict";var a=t("can-simple-map"),i=t("can-namespace"),o=t("can-globals/document/document"),s=t("can-reflect"),c=t("can-symbol").for("can.viewModel");r.exports=i.viewModel=function(e,t,n){if("string"==typeof e?e=o().querySelector(e):s.isListLike(e)&&!e.nodeType&&(e=e[0]),s.isObservableLike(t)&&s.isMapLike(t))e[c]=t;else{var r=e[c];switch(r||(r=new a,e[c]=r),arguments.length){case 0:case 1:return r;case 2:return s.getKeyValue(r,t);default:return s.setKeyValue(r,t,n),e}}}}(0,e,0,n)}),define("can-attribute-observable/event",["require","exports","module","can-reflect","can-dom-events","can-dom-events/helpers/util"],function(e,t,n){"use strict";var r=e("can-reflect"),a=e("can-dom-events"),i=e("can-dom-events/helpers/util").isDomEventTarget,o={on:function(e,t,n){i(this)?a.addEventListener(this,e,t,n):r.onKeyValue(this,e,t,n)},off:function(e,t,n){i(this)?a.removeEventListener(this,e,t,n):r.offKeyValue(this,e,t,n)},one:function(e,t,n){var r=function(){return o.off.call(this,e,r,n),t.apply(this,arguments)};return o.on.call(this,e,r,n),this}};n.exports=o}),define("can-attribute-observable/get-event-name",["require","exports","module","can-attribute-observable/behaviors"],function(e,t,n){"use strict";var a=e("can-attribute-observable/behaviors");n.exports=function(e,t){var n,r="change";return"input"===(n=e).nodeName.toLowerCase()&&"radio"===n.type&&"checked"===t&&(r="can-attribute-observable-radiochange"),a.findSpecialListener(t)&&(r=t),r}}),define("can-event-dom-radiochange",["require","exports","module","can-globals/document/document","can-namespace"],function(e,t,n){!function(e,t,n,r){"use strict";var a=t("can-globals/document/document"),i=t("can-namespace");function u(){return a().documentElement}function l(e){for(;e&&"FORM"!==e.nodeName;)e=e.parentNode;return e}function f(e){return"INPUT"===e.nodeName&&"radio"===e.type}var d={defaultEventType:"radiochange",addEventListener:function(e,t,n){if(!f(e))throw new Error("Listeners for "+t+" must be radio inputs");var o,r,a,i,s=d._eventTypeTrackedRadios;s||(s=d._eventTypeTrackedRadios={},d._rootListener||(d._rootListener=(o=this,r=s,a=u(),i=function(e){var a=e.target;if(f(a))for(var t in r){var i={type:t};r[t].forEach(function(e){var t,n,r;n=e,(r=(t=a).getAttribute("name"))&&r===n.getAttribute("name")&&l(t)===l(n)&&o.dispatch(e,i,!1)})}},o.addEventListener(a,"change",i),i)));var c=d._eventTypeTrackedRadios[t];c||(c=d._eventTypeTrackedRadios[t]=new Set),c.add(e),e.addEventListener(t,n)},removeEventListener:function(e,t,n){e.removeEventListener(t,n);var r=d._eventTypeTrackedRadios;if(r){var a,i,o,s=r[t];if(s)if(s.delete(e),0===s.size){for(var c in delete r[t],r)if(r.hasOwnProperty(c))return;delete d._eventTypeTrackedRadios,a=this,i=d._rootListener,o=u(),a.removeEventListener(o,"change",i),delete d._rootListener}}}};r.exports=i.domEventRadioChange=d}(0,e,0,n)}),define("can-attribute-observable",["require","exports","module","can-queues","can-attribute-observable/event","can-reflect","can-observation","can-attribute-observable/behaviors","can-attribute-observable/get-event-name","can-reflect-dependencies","can-observation-recorder","can-simple-observable/settable/settable","can-assign","can-symbol","can-dom-events","can-event-dom-radiochange"],function(e,t,n){!function(e,t,n,r){"use strict";var a=t("can-queues"),i=t("can-attribute-observable/event"),o=t("can-reflect"),s=t("can-observation"),c=t("can-attribute-observable/behaviors"),u=t("can-attribute-observable/get-event-name"),l=t("can-reflect-dependencies"),f=t("can-observation-recorder"),d=t("can-simple-observable/settable/settable"),p=t("can-assign"),h=t("can-symbol"),v=h.for("can.onValue"),g=h.for("can.offValue"),y=h.for("can.onEmit"),m=h.for("can.offEmit"),b=t("can-dom-events"),w=t("can-event-dom-radiochange"),_="can-attribute-observable-radiochange";b.addEvent(w,_);var x=function(e,t){return"select"===e.nodeName.toLowerCase()&&"value"===t&&e.multiple},E=Array.prototype.slice;function k(){var e=E.call(arguments,0);return e.unshift(this),b.addEventListener.apply(null,e)}function O(){var e=E.call(arguments,0);return e.unshift(this),b.removeEventListener.apply(null,e)}function N(e,t,n,r){"string"==typeof n&&(r=n,n=void 0),this.el=e,this.bound=!1,this.prop=x(e,t)?"values":t,this.event=r||u(e,t),this.handler=this.handler.bind(this),void 0!==r&&(this[v]=null,this[g]=null,this[y]=N.prototype.on,this[m]=N.prototype.off),"production"!==process.env.NODE_ENV&&(l.addMutatedBy(this.el,this.prop,this),o.assignSymbols(this,{"can.getName":function(){return"AttributeObservable<"+e.nodeName.toLowerCase()+"."+this.prop+">"}}))}p(N.prototype=Object.create(d.prototype),{constructor:N,get:function(){f.isRecording()&&(f.add(this),this.bound||s.temporarilyBind(this));var e=c.get(this.el,this.prop);return"function"==typeof e&&(e=e.bind(this.el)),e},set:function(e){return c.setAttrOrProp(this.el,this.prop,e)||(this._value=e),e},handler:function(e,t){var n=this._value,r=[];this._value=c.get(this.el,this.prop),void 0===t&&this._value===n||("production"!==process.env.NODE_ENV&&"function"==typeof this._log&&this._log(n,e),r=[this.handlers.getNode([]),this,[e,n]],"production"!==process.env.NODE_ENV&&(r=[this.handlers.getNode([]),this,[e,n],null,[this.el,this.prop,"changed to",e,"from",n,"by",t]]),a.enqueueByQueue.apply(a,r))},onBound:function(){var t=this;t.bound=!0,t._handler=function(e){t.handler(c.get(t.el,t.prop),e)},t.event===_&&i.on.call(t.el,"change",t._handler);var e=c.findSpecialListener(t.prop);e&&(t._specialDisposal=e.call(t.el,t.prop,t._handler,k)),i.on.call(t.el,t.event,t._handler),this._value=c.get(this.el,this.prop)},onUnbound:function(){var e=this;e.bound=!1,e.event===_&&i.off.call(e.el,"change",e._handler),e._specialDisposal&&(e._specialDisposal.call(e.el,O),e._specialDisposal=null),i.off.call(e.el,e.event,e._handler)},valueHasDependencies:function(){return!0},getValueDependencies:function(){var e=new Map,t=new Set;return t.add(this.prop),e.set(this.el,t),{keyDependencies:e}}}),o.assignSymbols(N.prototype,{"can.isMapLike":!1,"can.getValue":N.prototype.get,"can.setValue":N.prototype.set,"can.onValue":N.prototype.on,"can.offValue":N.prototype.off,"can.valueHasDependencies":N.prototype.hasDependencies,"can.getValueDependencies":N.prototype.getValueDependencies}),r.exports=N}(0,e,0,n)}),define("can-stache-bindings",["require","exports","module","can-bind","can-stache/src/expression","can-view-callbacks","can-view-model","can-stache-key","can-observation-recorder","can-simple-observable","can-assign","can-log/dev/dev","can-dom-mutate","can-dom-data-state","can-symbol","can-reflect","can-reflect-dependencies","can-attribute-encoder","can-queues","can-simple-observable/setter/setter","can-attribute-observable","can-view-scope/make-compute-like","can-view-nodelist","can-event-queue/map/map"],function(e,t,n){"use strict";var h=e("can-bind"),g=e("can-stache/src/expression"),r=e("can-view-callbacks"),y=e("can-view-model"),p=e("can-stache-key"),u=e("can-observation-recorder"),v=e("can-simple-observable"),m=e("can-assign"),b=e("can-log/dev/dev"),w=e("can-dom-mutate"),l=e("can-dom-data-state"),c=e("can-symbol"),_=e("can-reflect"),x=e("can-reflect-dependencies"),E=e("can-attribute-encoder"),k=e("can-queues"),O=e("can-simple-observable/setter/setter"),f=e("can-attribute-observable"),N=e("can-view-scope/make-compute-like"),d=e("can-view-nodelist"),L=e("can-event-queue/map/map"),a=new Map,V="viewModel",D=function(){throw new Error("can-stache-bindings - you can not have contextual bindings ( this:from='value' ) and key bindings ( prop:from='value' ) on one element.")},S=c.for("can.onKeyValue"),i={viewModel:function(i,o,e,t,n){var s,a=[],c={},u={},l=m({},t),f={isSettingOnViewModel:!1,isSettingViewModel:!1,initialViewModelData:t||{}},d=!1;if(_.eachListLike(i.attributes||[],function(e){var t=I(e,i,{templateType:o.templateType,scope:o.scope,getViewModel:function(){return s},attributeViewModelBindings:l,alreadyUpdatedChild:!0,nodeList:o.parentNodeList,favorViewModel:!0});if(t){var n=t.bindingInfo;if(f=function(e,t){var n=t.parentToChild&&t.child===V;if(!n)return e;var r=t.childName;if(!n||"this"!==r&&"."!==r){if(!e.isSettingViewModel)return{isSettingOnViewModel:!0,initialViewModelData:e.initialViewModelData};D()}else{if(!e.isSettingViewModel&&!e.isSettingOnViewModel)return{isSettingViewModel:!0,initialViewModelData:void 0};D()}}(f,n),d=!0,n.parentToChild){var r=n.stickyParentToChild?N(t.parent):t.canBinding.parentValue;void 0!==r&&(f.isSettingViewModel?f.initialViewModelData=r:f.initialViewModelData[A(n.childName,o.scope)]=r)}a.push(t.canBinding.start.bind(t.canBinding)),c[e.name]=t.canBinding.stop.bind(t.canBinding)}}),!n||d){s=e(f.initialViewModelData,d,f);for(var r=0,p=a.length;r<p;r++)a[r]();var h;return f.isSettingViewModel||(h=w.onNodeAttributeChange(i,function(e){var t=e.attributeName,n=i.getAttribute(t);c[t]&&c[t]();var r=u[t]&&"attribute"===u[t].parent;if(null!==n||r){var a=I({name:t,value:n},i,{templateType:o.templateType,scope:o.scope,getViewModel:function(){return s},attributeViewModelBindings:l,initializeValues:!0,nodeList:o.parentNodeList});a&&(a.canBinding.start(),u[t]=a.bindingInfo,c[t]=a.canBinding.stop.bind(a.canBinding))}})),function(){for(var e in h&&(h(),h=void 0),c)c[e]()}}},data:function(a,i){if(!l.get.call(a,"preventDataBindings")){var e,o,t,n,s=u.ignore(function(){return e||(e=y(a))}),r=I({name:i.attributeName,value:a.getAttribute(i.attributeName),nodeList:i.nodeList},a,{templateType:i.templateType,scope:i.scope,getViewModel:s,syncChildWithParent:!1});"production"!==process.env.NODE_ENV&&("viewModel"!==r.bindingInfo.child||l.get(a,"viewModel")||b.warn("This element does not have a viewModel. (Attempting to bind `"+r.bindingInfo.bindingAttributeName+'="'+r.bindingInfo.parentName+'"`)')),r.canBinding.start();var c=function(){o&&(o(),o=void 0),n&&(n(),n=void 0),t&&(t(),t=void 0)};i.nodeList&&d.register([],c,i.nodeList,!1),o=r.canBinding.stop.bind(r.canBinding),t=w.onNodeAttributeChange(a,function(e){var t=e.attributeName,n=a.getAttribute(t);if(t===i.attributeName&&(o&&o(),null!==n)){var r=I({name:t,value:n},a,{templateType:i.templateType,scope:i.scope,getViewModel:s,initializeValues:!0,nodeList:i.nodeList,syncChildWithParent:!1});r&&(r.canBinding.start(),o=r.canBinding.stop.bind(r.canBinding)),o=r.onTeardown}}),n=w.onNodeRemoval(a,function(){var e=a.ownerDocument,t=e.contains?e:e.documentElement;t&&!1!==t.contains(a)||c()})}},event:function(d,p){var e,h,v=E.decode(p.attributeName);if(-1!==v.indexOf(":to:")||-1!==v.indexOf(":from:")||-1!==v.indexOf(":bind:"))return this.data(d,p);if(!M.call(v,"on:"))throw new Error("can-stache-bindings - unsupported event bindings "+v);e=v.substr("on:".length);var t=d[c.for("can.viewModel")],n=p.scope;if(M.call(e,"el:"))e=e.substr("el:".length),h=d;else{M.call(e,"vm:")?(e=e.substr("vm:".length),n=h=t):h=t||d;var r=e.indexOf(":by:");0<=r&&(h=n.get(e.substr(r+":by:".length)),e=e.substr(0,r))}var a,i,o=function(e){var t=d.getAttribute(E.encode(v));if(t){var n,r,a,i=y(d),o=g.parse(t,{lookupRule:function(){return g.Lookup},methodRule:"call"}),s=(n=arguments,r=p,a={element:d,event:e,viewModel:i,arguments:void 0!==h[S]?Array.prototype.slice.call(n,1):n,args:n},r.scope.add(a,{special:!0}));if(o instanceof g.Hashes){var c=o.hashExprs,u=Object.keys(c)[0],l=o.hashExprs[u].value(s),f=_.isObservableLike(l)&&_.isValueLike(l);s.set(u,f?_.getValue(l):l)}else{if(!(o instanceof g.Call))throw new Error("can-stache-bindings: Event bindings must be a call expression. Make sure you have a () in "+p.attributeName+"="+JSON.stringify(t));!function(t,e,n,r,a,i,o){var s=function(){var e=a.value(r,{doNotWrapInObservation:!0});return"function"==typeof(e=_.isValueLike(e)?_.getValue(e):e)?e(t):e};"production"!==process.env.NODE_ENV&&Object.defineProperty(s,"name",{value:i+'="'+o+'"'}),k.batch.start();var c=[];c=[s,null,null,{}],"production"!==process.env.NODE_ENV&&(c=[s,null,null,{reasonLog:[t,e,i+"="+o]}]),k.mutateQueue.enqueue.apply(k.mutateQueue,c),k.batch.stop()}(d,e,0,s,o,v,t)}}},s=function(){L.off.call(h,e,o),a&&(a(),a=void 0),i&&(i(),i=void 0)};L.on.call(h,e,o),a=w.onNodeAttributeChange(d,function(e){var t=e.attributeName===v,n=!d.getAttribute(v);t&&n&&s()}),i=w.onNodeRemoval(d,function(){var e=d.ownerDocument,t=e.contains?e:e.documentElement;t&&t.contains(d)||s()})}};a.set(/[\w\.:]+:to$/,i.data),a.set(/[\w\.:]+:from$/,i.data),a.set(/[\w\.:]+:bind$/,i.data),a.set(/[\w\.:]+:raw$/,i.data),a.set(/[\w\.:]+:to:on:[\w\.:]+/,i.data),a.set(/[\w\.:]+:from:on:[\w\.:]+/,i.data),a.set(/[\w\.:]+:bind:on:[\w\.:]+/,i.data),a.set(/on:[\w\.:]+/,i.event);var P={viewModelOrAttribute:function(e,t,n,r,a,i,o){return e[c.for("can.viewModel")]?this.viewModel.apply(this,arguments):this.attribute.apply(this,arguments)},scope:function(e,a,r,t,n,i){if(r){if(n||0<=r.indexOf("(")||0<=r.indexOf("=")){var o=g.parse(r,{baseMethodType:"Call"});return o instanceof g.Hashes?new v(function(){var e=o.hashExprs,t=Object.keys(e)[0],n=o.hashExprs[t].value(a),r=_.isObservableLike(n)&&_.isValueLike(n);a.set(t,r?_.getValue(n):n)}):o.value(a)}var s={};_.assignSymbols(s,{"can.getValue":function(){},"can.valueHasDependencies":function(){return!1},"can.setValue":function(e){var t=g.parse(A(r,a),{baseMethodType:"Call"}).value(a);_.setValue(t,e)},"can.getWhatIChange":function(){var e=a.getDataForScopeSet(A(r,a)),t=new Map,n=new Set;return n.add(e.key),t.set(e.parent,n),{mutate:{keyDependencies:t}}},"can.getName":function(){if("production"!==process.env.NODE_ENV){var e="ObservableFromScope<>",t=a.getDataForScopeSet(A(r,a));return t.parent&&t.key&&(e="ObservableFromScope<"+_.getName(t.parent)+"."+t.key+">"),e}}});var c=a.getDataForScopeSet(A(r,a));return c.parent&&c.key&&x.addMutatedBy(c.parent,c.key,s),s}return new v},viewModel:function(e,t,n,r,a,i,o){var s=A(n,t),c="."===n||"this"===n,u=c?[]:p.reads(n);function l(){var e=r.getViewModel();return p.read(e,u,{}).value}"production"!==process.env.NODE_ENV&&Object.defineProperty(l,"name",{value:"<"+e.tagName.toLowerCase()+">."+n});var f=new O(l,function(e){var t=r.getViewModel();if(i){var n=_.getKeyValue(t,s);_.isObservableLike(n)?_.setValue(n,e):_.setKeyValue(t,s,new v(_.getValue(i)))}else c?_.setValue(t,e):_.setKeyValue(t,s,e)});if("production"!==process.env.NODE_ENV){var d=r.getViewModel();d&&s&&x.addMutatedBy(d,s,f)}return f},attribute:function(e,t,n,r,a,i,o,s){return new f(e,n,{},o)}},M=String.prototype.startsWith||function(e){return 0===this.indexOf(e)};var q={to:{childToParent:!0,parentToChild:!1,syncChildWithParent:!1},from:{childToParent:!1,parentToChild:!0,syncChildWithParent:!1},bind:{childToParent:!0,parentToChild:!0,syncChildWithParent:!0},raw:{childToParent:!1,parentToChild:!0,syncChildWithParent:!1}},C=[],j={vm:!0,on:!0};_.each(q,function(e,t){C.push(t),j[t]=!0});var T=function(e,t,n,r,a){var i,o,s,c,u,l,f,d=E.decode(e.name),p=e.value||"",h=(c=d.split(":"),u={tokens:[],special:{}},c.forEach(function(e){j[e]?u.special[e]=u.tokens.push(e)-1:u.tokens.push(e)}),u);if(C.forEach(function(e){if(void 0!==h.special[e]&&0<h.special[e])return o=e,s=h.special[e],!1}),o){var v=function(e){if(void 0!==e.special.on)return e.tokens[e.special.on+1]}(h),g=!v||"bind"===o;return i=m({parent:"scope",child:(l=h.tokens,f=a,0<=l.indexOf("vm")?V:0<=l.indexOf("el")?"attribute":f?V:"viewModelOrAttribute"),childName:h.tokens[s-1],childEvent:v,bindingAttributeName:d,parentName:h.special.raw?'"'+p+'"':p,initializeValues:g},q[o]),"~"===p.trim().charAt(0)&&(i.stickyParentToChild=!0),i}},I=function(e,t,n){var r=T(e,n.attributeViewModelBindings,n.templateType,t.nodeName.toLowerCase(),n.favorViewModel);if(r){var a=P[r.parent](t,n.scope,r.parentName,n,r.parentToChild,void 0,void 0,r),i=P[r.child](t,n.scope,r.childName,n,r.childToParent,r.stickyParentToChild&&a,r.childEvent,r),o=!!r.childToParent,s=!!r.parentToChild;"production"!==process.env.NODE_ENV&&r.stickyParentToChild&&o&&s&&b.warn("Two-way binding computes is not supported.");var c={child:i,childToParent:o,cycles:!0===o&&!0===s?0:100,onInitDoNotUpdateChild:n.alreadyUpdatedChild||!1===r.initializeValues,onInitDoNotUpdateParent:!1===r.initializeValues,onInitSetUndefinedParentIfChildIsDefined:!0,parent:a,parentToChild:s,priority:n.nodeList?n.nodeList.nesting+1:void 0,queue:"domUI",sticky:r.syncChildWithParent?"childSticksToParent":void 0};if("production"!==process.env.NODE_ENV){var u=E.decode(e.name)+"="+JSON.stringify(e.value),l="<"+t.nodeName.toLowerCase(),f=l+">",d=function(e,t){return"viewModel"===e?f+"."+t:"scope"===e?"{{"+t+"}}":e+"."+t};c.updateChildName=l+" "+u+"> updates "+d(r.child,r.childName)+" from "+d(r.parent,r.parentName),c.updateParentName=l+" "+u+"> updates "+d(r.parent,r.parentName)+" from "+d(r.child,r.childName)}var p=new h(c);return p.startParent(),{bindingInfo:r,canBinding:p,parent:a}}},A=function(e,t){if("production"!==process.env.NODE_ENV&&0<=e.indexOf("@")){var n=t.peek("scope.filename"),r=t.peek("scope.lineNumber");b.warn((n?n+":":"")+(r?r+": ":"")+"functions are no longer called by default so @ is unnecessary in '"+e+"'.")}return e.replace(/@/g,"")},o={behaviors:i,getBindingInfo:T,bindings:a};o[c.for("can.callbackMap")]=a,r.attrs(o),n.exports=o}),define("can-component",["require","exports","module","can-component/control/control","can-namespace","can-bind","can-construct","can-stache","can-stache-bindings","can-view-scope","can-view-callbacks","can-view-nodelist","can-reflect","can-stache-key","can-simple-observable/setter/setter","can-simple-observable","can-simple-map","can-define/map/map","can-log","can-log/dev/dev","can-assign","can-observation-recorder","can-view-model","can-define/list/list","can-dom-data-state","can-child-nodes","can-string","can-dom-events","can-dom-mutate","can-dom-mutate/node","can-symbol","can-globals/document/document"],function(e,t,n){!function(e,t,n,r){"use strict";var a=t("can-component/control/control"),i=t("can-namespace"),x=t("can-bind"),o=t("can-construct"),E=t("can-stache"),k=t("can-stache-bindings"),O=t("can-view-scope"),s=t("can-view-callbacks"),N=t("can-view-nodelist"),L=t("can-reflect"),V=t("can-stache-key"),D=t("can-simple-observable/setter/setter"),c=t("can-simple-observable"),S=t("can-simple-map"),u=t("can-define/map/map"),l=t("can-log"),f=t("can-log/dev/dev"),d=t("can-assign"),P=t("can-observation-recorder");t("can-view-model"),t("can-define/list/list");var M=t("can-dom-data-state"),q=t("can-child-nodes"),p=t("can-string"),C=t("can-dom-events"),j=t("can-dom-mutate"),T=t("can-dom-mutate/node"),h=t("can-symbol"),I=t("can-globals/document/document"),A=h("can.createdByCanComponent"),K=h.for("can.getValue"),R=h.for("can.setValue"),v=h.for("can.viewInsert"),B=h.for("can.viewModel");function g(e,t,n){var r;M.set.call(e,"preventDataBindings",!0);var a=k.behaviors.viewModel(e,n,function(e,t,n){return r=n&&!0===n.isSettingOnViewModel?new S(e):new c(e)},void 0,!0);return a?d(d({},t),{teardown:a,scope:t.scope.add(r)}):t}function F(l,f,e,d,p){var h=e.options;return function e(t,n){var r=p(t)||n.subtemplate,a=r!==n.subtemplate;if(r){var i;delete h.tags[l],i=a?d.toLightContent?g(t,{scope:n.scope.cloneFromRef(),options:n.options},n):g(t,f,n):g(t,n,n);var o=N.register([t],function(){i.teardown&&i.teardown()},n.parentNodeList||!0,n.directlyNested);o.expression="<can-slot name='"+t.getAttribute("name")+"'/>";var s=r(i.scope,i.options,o),c=L.toArray(q(s)),u=N.update(o,c);N.replace(u,s),h.tags[l]=e}}}E.addBindings(k);var y=o.extend({setup:function(){if(o.setup.apply(this,arguments),y){var n=this;void 0!==this.prototype.events&&0!==L.size(this.prototype.events)&&(this.Control=a.extend(this.prototype.events)),"production"!==process.env.NODE_ENV&&this.prototype.viewModel&&L.isConstructorLike(this.prototype.viewModel)&&f.warn("can-component: Assigning a DefineMap or constructor type to the viewModel property may not be what you intended. Did you mean ViewModel instead? More info: https://canjs.com/doc/can-component.prototype.ViewModel.html");var e=this.prototype.viewModel||this.prototype.scope;if(e&&this.prototype.ViewModel)throw new Error("Cannot provide both a ViewModel and a viewModel property");var t=p.capitalize(p.camelize(this.prototype.tag))+"VM";if(this.prototype.ViewModel?"function"==typeof this.prototype.ViewModel?this.ViewModel=this.prototype.ViewModel:this.ViewModel=u.extend(t,{},this.prototype.ViewModel):e?"function"==typeof e?L.isObservableLike(e.prototype)&&L.isMapLike(e.prototype)?this.ViewModel=e:this.viewModelHandler=e:L.isObservableLike(e)&&L.isMapLike(e)?("production"!==process.env.NODE_ENV&&l.warn("can-component: "+this.prototype.tag+" is sharing a single map across all component instances"),this.viewModelInstance=e):(l.warn("can-component: "+this.prototype.tag+" is extending the viewModel into a can-simple-map"),this.ViewModel=S.extend(t,{},e)):this.ViewModel=S.extend(t,{},{}),this.prototype.template&&("production"!==process.env.NODE_ENV&&l.warn("can-component.prototype.template: is deprecated and will be removed in a future release. Use can-component.prototype.view"),this.renderer=this.prototype.template),this.prototype.view&&(this.renderer=this.prototype.view),"string"==typeof this.renderer){var r=p.capitalize(p.camelize(this.prototype.tag))+"View";this.renderer=E(r,this.renderer)}s.tag(this.prototype.tag,function(e,t){void 0===e[A]&&new n(e,t)})}}},{setup:function(i,o){this._initialArgs=[i,o];var s=this,n={helpers:{},tags:{}};void 0===o&&(void 0===i?o={}:(o=i,i=void 0)),void 0===i&&((i=I().createElement(this.tag))[A]=!0),this.element=i;var e=o.content;void 0!==e&&("function"==typeof e?o.subtemplate=e:"string"==typeof e&&(o.subtemplate=E(e)));var t=o.scope;void 0!==t&&t instanceof O==!1&&(o.scope=new O(t));var r=o.templates;void 0!==r&&L.eachKey(r,function(e,t){if("string"==typeof e){var n=t+" template";r[t]=E(n,e)}});var c,a,u,l,d,f=[],p=function(){for(var e=0,t=f.length;e<t;e++)f[e]()};M.get.call(i,"preventDataBindings")?c=i[B]:(l=o.setupBindings?o.setupBindings:o.viewModel?(d=o.viewModel,P.ignore(function(s,e,c){var u,l=[],f=[];L.eachKey(d,function(e,t){var n=null!=e&&!!e[K],r=null!=e&&!!e[R];if(!0===n||r){var a=V.reads(t),i=new D(function(){return V.read(u,a).value},function(e){L.setKeyValue(u,t,e)}),o=new x({child:i,parent:e,queue:"domUI",updateChildName:"update viewModel."+t+" of <"+s.nodeName.toLowerCase()+">",updateParentName:"update "+L.getName(e)+" of <"+s.nodeName.toLowerCase()+">"});o.startParent(),!0===n&&(c[t]=o.parentValue),l.push(o.start.bind(o)),f.push(o.stop.bind(o))}else c[t]=e}),u=e(c);for(var t=0,n=l.length;t<n;t++)l[t]();return function(){f.forEach(function(e){e()})}})):function(e,t,n){return k.behaviors.viewModel(e,o,t,n)},u=l(i,function(e){var t=s.constructor.ViewModel,n=s.constructor.viewModelHandler,r=s.constructor.viewModelInstance;if(n){var a=n.call(s,e,o.scope,i);L.isObservableLike(a)&&L.isMapLike(a)?r=a:t=L.isObservableLike(a.prototype)&&L.isMapLike(a.prototype)?a:S.extend(a)}return t&&(r=new s.constructor.ViewModel(e)),c=r},{}));if(this.viewModel=c,i[B]=c,i.viewModel=c,M.set.call(i,"preventDataBindings",!0),void 0!==this.helpers&&L.eachKey(this.helpers,function(e,t){"function"==typeof e&&(n.helpers[t]=e.bind(c))}),this.constructor.Control)this._control=new this.constructor.Control(i,{scope:this.viewModel,viewModel:this.viewModel,destroy:p});else var h=j.onNodeRemoval(i,function(){var e=i.ownerDocument,t=e.contains?e:e.documentElement;t&&t.contains(i)||(h(),p())});var v,g,y,m,b={toLightContent:!0===this.leakScope,intoShadowContent:!0===this.leakScope};!this.constructor.renderer?(g={scope:o.scope.add(this.viewModel,{viewModel:!0}),options:n},v=o.subtemplate||i.ownerDocument.createDocumentFragment.bind(i.ownerDocument)):(y=b.intoShadowContent?{scope:o.scope.add(this.viewModel,{viewModel:!0}),options:n}:{scope:new O(this.viewModel,null,{viewModel:!0}),options:n},n.tags["can-slot"]=F("can-slot",o,y,b,function(e){var t=o.templates;if(t)return t[e.getAttribute("name")]}),n.tags.content=F("content",o,y,b,function(){return o.subtemplate}),v=this.constructor.renderer,g=y);var w=N.register([],function(){s._torndown=!0,C.dispatch(i,"beforeremove",!1),u&&u(),m?m(i):"function"==typeof c.stopListening&&c.stopListening()},o.parentNodeList||!0,!1);if(w.expression="<"+this.tag+">",f.push(function(){N.unregister(w)}),this.nodeList=w,a=v(g.scope,g.options,w),T.appendChild.call(i,a),N.update(w,q(i)),c&&c.connectedCallback)if(I().body.contains(i))m=c.connectedCallback(i);else var _=j.onNodeInsertion(i,function(){_(),m=c.connectedCallback(i)});s._torndown=!1}});y.prototype[v]=function(e){return this._torndown&&this.setup.apply(this,this._initialArgs),e.nodeList.newDeepChildren.push(this.nodeList),this.element},r.exports=i.Component=y}(0,e,0,n)}),define("can/es/can-component",["exports","can-component"],function(e,t){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"default",{enumerable:!0,get:function(){return(e=t,e&&e.__esModule?e:{default:e}).default;var e}})}),define("can/es/can-stache",["exports","can-stache"],function(e,t){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"default",{enumerable:!0,get:function(){return(e=t,e&&e.__esModule?e:{default:e}).default;var e}})}),define("can/es/can-stache-bindings",["exports","can-stache-bindings"],function(e,t){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"default",{enumerable:!0,get:function(){return(e=t,e&&e.__esModule?e:{default:e}).default;var e}})}),define("can-simple-observable/make-compute/make-compute",["require","exports","module","can-reflect"],function(e,t,n){"use strict";var i=e("can-reflect"),o=new WeakMap;n.exports=function(r){var a=function(e){return arguments.length?i.setValue(this,e):i.getValue(this)}.bind(r);return a.on=a.bind=a.addEventListener=function(e,n){var t=o.get(n);t||(t=function(e,t){n.call(a,{type:"change"},e,t)},"production"!==process.env.NODE_ENV&&Object.defineProperty(t,"name",{value:"translationHandler("+e+")::"+i.getName(r)+".onValue("+i.getName(n)+")"}),o.set(n,t)),i.onValue(r,t)},a.off=a.unbind=a.removeEventListener=function(e,t){i.offValue(r,o.get(t))},i.assignSymbols(a,{"can.getValue":function(){return i.getValue(r)},"can.setValue":function(e){return i.setValue(r,e)},"can.onValue":function(e,t){return i.onValue(r,e,t)},"can.offValue":function(e,t){return i.offValue(r,e,t)},"can.valueHasDependencies":function(){return i.valueHasDependencies(r)},"can.getPriority":function(){return i.getPriority(r)},"can.setPriority":function(e){i.setPriority(r,e)},"can.isValueLike":!0,"can.isFunctionLike":!1}),a.isComputed=!0,a}}),define("can-route/src/string-coercion",["require","exports","module","can-reflect","can-symbol"],function(e,t,n){var a=e("can-reflect"),i=e("can-symbol"),o=function(n){return n&&"object"==typeof n?(n=n&&"object"==typeof n&&"serialize"in n?n.serialize():"function"==typeof n.slice?n.slice():a.assign({},n),a.eachKey(n,function(e,t){n[t]=o(e)})):null!=n&&"function"==typeof n.toString&&(n=n.toString()),n};t.stringCoercingMapDecorator=function(e){var t=i.for("can.route.stringCoercingMapDecorator");if(!e.attr[t]){var r=e.attr;e.attr=function(e,t){var n;return n="string"!=typeof e||void 0!==this.define&&void 0!==this.define[e]&&!this.define[e].serialize?arguments:o(Array.apply(null,arguments)),r.apply(this,n)},a.setKeyValue(e.attr,t,!0)}return e},t.stringify=o}),define("can-route/src/routedata",["require","exports","module","can-define/map/map","can-route/src/string-coercion"],function(e,t,n){var r=e("can-define/map/map"),a=e("can-route/src/string-coercion").stringify;n.exports=r.extend("RouteData",{seal:!1},{"*":{type:a}})}),define("can-route/src/binding-proxy",["require","exports","module","can-reflect","can-symbol","can-simple-observable"],function(e,t,n){"use strict";var a=e("can-reflect"),i=e("can-symbol"),o=new(e("can-simple-observable"))(null);a.setName(o,"route.urlData");var r={defaultBinding:null,urlDataObservable:o,bindings:{},call:function(){var e=a.toArray(arguments),t=e.shift(),n=o.value;if(null===n)throw new Error("there is no current binding!!!");var r=n[0===t.indexOf("can.")?i.for(t):t];return r.apply?r.apply(n,e):r}};n.exports=r}),define("can-route/src/regexps",function(e,t,n){"use strict";n.exports={curlies:/\{\s*([\w.]+)\s*\}/g,colon:/\:([\w.]+)/g}}),define("can-diff/map/map",["require","exports","module","can-reflect"],function(e,t,n){"use strict";var o=e("can-reflect");n.exports=function(n,r){var a,i=[];for(var e in a=o.assignMap({},n),o.eachKey(r,function(e,t){n&&n.hasOwnProperty(t)?r[t]!==n[t]&&i.push({key:t,type:"set",value:e}):i.push({key:t,type:"add",value:e}),delete a[t]}),a)i.push({key:e,type:"delete"});return i}}),define("can-route/src/register",["require","exports","module","can-reflect","can-log/dev/dev","can-route/src/binding-proxy","can-route/src/regexps","can-diff/list/list","can-diff/map/map","can-route/src/routedata"],function(e,t,n){"use strict";var d=e("can-reflect"),p=e("can-log/dev/dev"),h=e("can-route/src/binding-proxy"),v=e("can-route/src/regexps"),g=e("can-diff/list/list"),y=e("can-diff/map/map"),m=e("can-route/src/routedata"),b=function(e){return e.replace(/\\/g,"")},w={routes:{},register:function(o,s){var e=h.call("root");e.lastIndexOf("/")===e.length-1&&0===o.indexOf("/")&&(o=o.substr(1)),s=s||{};var t,n,r,a,c=[],i="",u=h.call("querySeparator"),l=h.call("matchSlashes");for(v.colon.test(o)?(n=v.colon,"production"!==process.env.NODE_ENV&&p.warn('update route "'+o+'" to "'+o.replace(v.colon,function(e,t){return"{"+t+"}"})+'"')):n=v.curlies,r=n.lastIndex=0;t=n.exec(o);)c.push(t[1]),i+=b(o.substring(r,n.lastIndex-t[0].length)),i+="([^"+("\\"+(b(o.substr(n.lastIndex,1))||u+(l?"":"|/")))+"]"+(s[t[1]]?"*":"+")+")",r=n.lastIndex;if(i+=o.substr(r).replace("\\",""),"production"!==process.env.NODE_ENV&&d.eachKey(w.routes,function(e){var t=e.names.concat(Object.keys(e.defaults)).sort(),n=c.concat(Object.keys(s)).sort(),r=!g(t,n).length,a=!y(e.defaults,s).length,i=e.route.replace(/\/$/,"")===o.replace(/\/$/,"");r&&a&&!i&&p.warn('two routes were registered with matching keys:\n\t(1) route.register("'+e.route+'", '+JSON.stringify(e.defaults)+')\n\t(2) route.register("'+o+'", '+JSON.stringify(s)+")\n(1) will always be chosen since it was registered first")}),this.data instanceof m){var f=this.data;d.eachIndex(c,function(e){var t="string",n=s[e];null!=n&&(t=typeof n),d.defineInstanceKey(f.constructor,e,{type:t})})}return w.routes[o]={test:new RegExp("^"+i+"($|"+(a=u,(a+"").replace(/([.?*+\^$\[\]\\(){}|\-])/g,"\\$1"))+")"),route:o,names:c,defaults:s,length:o.split("/").length}}};n.exports=w}),define("can-deparam",["require","exports","module","can-namespace"],function(e,t,n){"use strict";var r=e("can-namespace"),a=/^\d+$/,p=/([^\[\]]+)|(\[\])/g,i=/([^?#]*)(#.*)?$/,o=/%([^0-9a-f][0-9a-f]|[0-9a-f][^0-9a-f]|[^0-9a-f][^0-9a-f])/i,h=function(t){t=t.replace(/\+/g," ");try{return decodeURIComponent(t)}catch(e){return decodeURIComponent(t.replace(o,function(e,t){return"%25"+t}))}};function v(e){return a.test(e)||"[]"===e}function s(e){return e}n.exports=r.deparam=function(e,l){l=l||s;var f,d={};return e&&i.test(e)&&e.split("&").forEach(function(e){var t=e.split("="),n=h(t.shift()),r=h(t.join("=")),a=d;if(n){for(var i=0,o=(t=n.match(p)).length-1;i<o;i++){var s=t[i],c=t[i+1],u=v(s)&&a instanceof Array;a[s]||(u?a.push(v(c)?[]:{}):a[s]=v(c)?[]:{}),a=u?a[a.length-1]:a[s]}v(f=t.pop())?a.push(l(r)):a[f]=l(r)}}),d}}),define("can-route/src/deparam",["require","exports","module","can-deparam","can-reflect","can-route/src/binding-proxy","can-route/src/register"],function(e,t,n){"use strict";var c=e("can-deparam"),u=e("can-reflect"),l=e("can-route/src/binding-proxy"),a=e("can-route/src/register");function f(e){var t=l.call("root");return t.lastIndexOf("/")===t.length-1&&0===e.indexOf("/")&&(e=e.substr(1)),e}function d(n){n=f(n);var r={length:-1};if(u.eachKey(a.routes,function(e,t){e.test.test(n)&&e.length>r.length&&(r=e)}),-1<r.length)return r}function r(e){var n=d(e),r=l.call("querySeparator"),t=l.call("paramsMatcher");if(e=f(e),n){var a=e.match(n.test),i=a.shift(),o=e.substr(i.length-(a[a.length-1]===r?1:0)),s=o&&t.test(o)?c(o.slice(1)):{};return s=u.assignDeep(u.assignDeep({},n.defaults),s),a.forEach(function(e,t){e&&e!==r&&(s[n.names[t]]=function(t){try{return decodeURIComponent(t)}catch(e){return unescape(t)}}(e))}),s}return e.charAt(0)!==r&&(e=r+e),t.test(e)?c(e.slice(1)):{}}r.getRule=d,n.exports=r}),define("can-param",["require","exports","module","can-namespace"],function(e,t,n){"use strict";var r=e("can-namespace");function o(e,t,n){if(Array.isArray(t))for(var r=0,a=t.length;r<a;++r)o(e+"[]",t[r],n);else if(t&&"object"==typeof t)for(var i in t)o(e+"["+i+"]",t[i],n);else n(e,t)}n.exports=r.param=function(e){var n=[],t=function(e,t){n.push(encodeURIComponent(e)+"="+encodeURIComponent(t))};for(var r in e)o(r,e[r],t);return n.join("&").replace(/%20/g,"+")}}),define("can-route/src/param",["require","exports","module","can-reflect","can-param","can-route/src/register","can-route/src/regexps","can-route/src/binding-proxy"],function(e,t,n){"use strict";var s=e("can-reflect"),o=e("can-param"),c=e("can-route/src/register"),u=e("can-route/src/regexps"),l=e("can-route/src/binding-proxy"),f=function(e,t){var n=0,r=0,a={};for(var i in e.defaults)e.defaults[i]===t[i]&&(a[i]=1,n++);for(;r<e.names.length;r++){if(!t.hasOwnProperty(e.names[r]))return-1;a[e.names[r]]||n++}return n};function r(n,e){var r,a,i=0,o=0;return delete n.route,s.eachKey(n,function(){o++}),s.eachKey(c.routes,function(e,t){if(a=f(e,n),i<a&&(r=e,i=a),o<=a)return!1}),c.routes[e]&&f(c.routes[e],n)===i&&(r=c.routes[e]),r}function a(n,r){var a,e,t,i;return n?(a=s.assignMap({},r),i=u.colon.test(n.route)?u.colon:u.curlies,e=n.route.replace(i,function(e,t){return delete a[t],r[t]===n.defaults[t]?"":encodeURIComponent(r[t])}).replace("\\",""),s.eachKey(n.defaults,function(e,t){a[t]===e&&delete a[t]}),e+((t=o(a))?l.call("querySeparator")+t:"")):0===s.size(r)?"":l.call("querySeparator")+o(r)}function i(e,t){return a(r(e,t),e)}(n.exports=i).paramFromRoute=a,i.getMatchedRoute=r}),define("can-route/src/url-helpers",["require","exports","module","can-route/src/binding-proxy","can-route/src/deparam","can-route/src/param","can-reflect","can-string"],function(e,t,n){"use strict";var r=e("can-route/src/binding-proxy"),a=e("can-route/src/deparam"),i=e("can-route/src/param"),o=e("can-reflect"),s=e("can-string"),c=function(e,t){for(var n in e){var r=e[n],a=t[n];if(r&&a&&"object"==typeof r&&"object"==typeof t)return c(r,a);if(r!=a)return!1}return!0};function u(e,t){if(t){var n=a(r.call("can.getValue"));e=o.assignMap(o.assignMap({},n),e)}return r.call("root")+i(e)}n.exports={url:u,link:function(e,t,n,r){return"<a "+(a=o.assignMap({href:u(t,r)},n),i=[],o.eachKey(a,function(e,t){i.push(("className"===t?"class":t)+'="'+("href"===t?e:s.esc(e))+'"')}),i.join(" "))+">"+e+"</a>";var a,i},isCurrent:function(e,t){if(t){var n=a(r.call("can.getValue"));return c(e,n)}return r.call("can.getValue")===i(e)}}}),define("can-route-hash",["require","exports","module","can-globals/location/location","can-reflect","can-observation-recorder","can-queues","can-key-tree","can-simple-observable","can-dom-events"],function(e,t,n){!function(e,t,n,r){var a=t("can-globals/location/location"),i=t("can-reflect"),o=t("can-observation-recorder"),s=t("can-queues"),c=t("can-key-tree"),u=t("can-simple-observable"),l=t("can-dom-events");function f(){return a().href.split(/#!?/)[1]||""}function d(){var e=this.dispatchHandlers.bind(this),t=this;this._value="",this.handlers=new c([Object,Array],{onFirst:function(){t._value=f(),l.addEventListener(window,"hashchange",e)},onEmpty:function(){l.removeEventListener(window,"hashchange",e)}})}d.prototype=Object.create(u.prototype),d.constructor=d,i.assign(d.prototype,{paramsMatcher:/^(?:&[^=]+=[^&]*)+/,querySeparator:"&",matchSlashes:!1,root:"#!",dispatchHandlers:function(){var e=this._value;this._value=f(),e!==this._value&&s.enqueueByQueue(this.handlers.getNode([]),this,[this._value,e],null,[i.getName(this),"changed to",this._value,"from",e])},get:function(){return o.add(this),f()},set:function(e){var t=a();return(e||t.hash)&&t.hash!=="#"+e&&(t.hash="!"+e),e}}),Object.defineProperty(d.prototype,"value",{get:function(){return i.getValue(this)},set:function(e){i.setValue(this,e)}}),i.assignSymbols(d.prototype,{"can.getValue":d.prototype.get,"can.setValue":d.prototype.set,"can.onValue":d.prototype.on,"can.offValue":d.prototype.off,"can.isMapLike":!1,"can.valueHasDependencies":function(){return!0},"can.getName":function(){return"HashchangeObservable<"+this._value+">"}}),r.exports=d}(0,e,0,n)}),define("can-globals/is-web-worker/is-web-worker",["require","exports","module","can-globals/can-globals-instance"],function(o,e,t){!function(e,t,n,r){"use strict";var a=o("can-globals/can-globals-instance"),i=Function;a.define("isWebWorker",function(){var e=i("return this")();return"undefined"!=typeof WorkerGlobalScope&&e instanceof WorkerGlobalScope}),r.exports=a.makeExport("isWebWorker")}(0,0,0,t)}),define("can-route",["require","exports","module","can-bind","can-queues","can-observation","can-namespace","can-log/dev/dev","can-reflect","can-symbol","can-simple-observable/make-compute/make-compute","can-route/src/routedata","can-route/src/string-coercion","can-route/src/register","can-route/src/url-helpers","can-route/src/param","can-route/src/deparam","can-route/src/binding-proxy","can-route-hash","can-globals/is-web-worker/is-web-worker","can-globals/is-browser-window/is-browser-window"],function(e,t,n){!function(e,t,n,r){"use strict";var a,i=t("can-bind"),o=t("can-queues"),s=t("can-observation"),c=t("can-namespace"),u=t("can-log/dev/dev"),l=t("can-reflect"),f=t("can-symbol"),d=t("can-simple-observable/make-compute/make-compute"),p=t("can-route/src/routedata"),h=t("can-route/src/string-coercion").stringCoercingMapDecorator,v=t("can-route/src/register"),g=t("can-route/src/url-helpers"),y=t("can-route/src/param"),m=t("can-route/src/deparam"),b=t("can-route/src/binding-proxy"),w=t("can-route-hash"),_=t("can-globals/is-web-worker/is-web-worker"),x=t("can-globals/is-browser-window/is-browser-window"),E=new w;function k(e,t){return"undefined"!=typeof process&&"production"!==process.env.NODE_ENV&&u.warn("Call route.register(url,defaults) instead of calling route(url, defaults)"),v.register(e,t),k}b.bindings.hashchange=E,b.defaultBinding="hashchange",b.urlDataObservable.value=E;var O=new s(function(){var e=b.call("can.getValue");return k.rule(e)});function N(e){clearTimeout(a),a=setTimeout(function(){var e=l.serialize(k.data),t=O.get(),n=y.getMatchedRoute(e,t),r=y.paramFromRoute(n,e);b.call("can.setValue",r);var a=k._onStartComplete;a&&(k._onStartComplete=void 0,a())},10)}function L(){var e=b.call("can.getValue");o.batch.start();var t=k.deparam(e);delete t.route,l.update(k.data,t),o.batch.stop()}Object.defineProperty(k,"routes",{get:function(){return v.routes},set:function(e){return v.routes=e}}),Object.defineProperty(k,"defaultBinding",{get:function(){return b.defaultBinding},set:function(e){b.defaultBinding=e;var t=b.bindings[b.defaultBinding];t&&(b.urlDataObservable.value=t)}}),Object.defineProperty(k,"urlData",{get:function(){return b.urlDataObservable.value},set:function(e){k._teardown(),b.urlDataObservable.value=e}}),l.assignMap(k,{param:y,deparam:m,map:function(e){"undefined"!=typeof process&&"production"!==process.env.NODE_ENV&&u.warn("Set route.data directly instead of calling route.map"),k.data=e},start:function(e){if(!0!==e&&(k._setup(),x()||_())){var t=b.call("can.getValue");o.batch.start();var n=k.deparam(t);delete n.route,l.assign(k.data,n),o.batch.stop(),N()}return k},url:g.url,link:g.link,isCurrent:g.isCurrent,bindings:b.bindings,_setup:function(){if(!k._canBinding){var e={parent:b.urlDataObservable.value,setParent:N,child:k.serializedObservation,setChild:L,onInitDoNotUpdateChild:!0,cycles:1,queue:"notify"};"undefined"!=typeof process&&"production"!==process.env.NODE_ENV&&(e.updateChildName="can-route.updateRouteData",e.updateParentName="can-route.updateUrl"),(k._canBinding=new i(e)).start()}},_teardown:function(){k._canBinding&&(k._canBinding.stop(),k._canBinding=null),clearTimeout(a)},stop:function(){return this._teardown(),k},currentRule:d(O),register:v.register,rule:function(e){var t=m.getRule(e);if(t)return t.route}});var V,D=function(e,t){return k.data[e]?k.data[e].apply(k.data,t):k.data.addEventListener.apply(k.data,t)};["addEventListener","removeEventListener","bind","unbind","on","off"].forEach(function(n){k[n]=function(e,t){return"__url"===e?b.call("can.onValue",t):D(n,arguments)}}),["delegate","undelegate","removeAttr","compute","_get","___get","each"].forEach(function(e){k[e]=function(){return D(e,arguments)}});var S,P,M=function(e){return V=e};Object.defineProperty(k,"serializedObservation",{get:function(){return S||(S=new s(function(){return l.serialize(k.data)})),S}}),Object.defineProperty(k,"serializedCompute",{get:function(){return P||(P=d(k.serializedObservation)),P}});var q=f.for("can.viewModel");Object.defineProperty(k,"data",{get:function(){return V||M(new p)},set:function(e){l.isConstructorLike(e)&&(e=new e),e&&void 0!==e[q]&&(e=e[q]),M("attr"in e?h(e):e)}}),k.attr=function(e,t){return console.warn("can-route: can-route.attr is deprecated. Use methods on can-route.data instead."),"attr"in k.data?k.data.attr.apply(k.data,arguments):1<arguments.length?(l.setKeyValue(k.data,e,t),k.data):"object"==typeof e?(l.assignDeep(k.data,e),k.data):1===arguments.length?l.getKeyValue(k.data,e):l.unwrap(k.data)},l.setKeyValue(k,f.for("can.isFunctionLike"),!1),k.matched=k.currentRule,k.current=k.isCurrent,r.exports=c.route=k}(0,e,0,n)}),define("can-stache-route-helpers",["require","exports","module","can-stache/helpers/core","can-route","can-stache/src/expression","can-reflect"],function(e,t,n){"use strict";var a=e("can-stache/helpers/core"),r=e("can-route"),i=e("can-stache/src/expression"),o=e("can-reflect"),s=a.looksLikeOptions,c=function(){var t,n,r;return o.eachIndex(arguments,function(e){"boolean"==typeof e?n=e:e&&"object"==typeof e&&(s(e)?r=e:t=a.resolveHash(e))}),!t&&r&&(t=a.resolveHash(r.hash)),{finalParams:t||{},finalMerge:n,optionsArg:r}};a.registerHelper("routeUrl",function(){var e=c.apply(this,arguments);return r.url(e.finalParams,"boolean"==typeof e.finalMerge?e.finalMerge:void 0)});var u=function(){var e=c.apply(this,arguments),t=r.isCurrent(e.finalParams,"boolean"==typeof e.finalMerge?e.finalMerge:void 0);return!e.optionsArg||e.optionsArg instanceof i.Call?t:t?e.optionsArg.fn():e.optionsArg.inverse()};u.callAsMethod=!0,a.registerHelper("routeCurrent",u)}),define("can/es/can-stache-route-helpers",["exports","can-stache-route-helpers"],function(e,t){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"default",{enumerable:!0,get:function(){return(e=t,e&&e.__esModule?e:{default:e}).default;var e}})}),define("can/es/can-view-callbacks",["exports","can-view-callbacks"],function(e,t){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"default",{enumerable:!0,get:function(){return(e=t,e&&e.__esModule?e:{default:e}).default;var e}})}),define("can/es/can-view-live",["exports","can-view-live"],function(e,t){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"default",{enumerable:!0,get:function(){return(e=t,e&&e.__esModule?e:{default:e}).default;var e}})}),define("can/es/can-view-model",["exports","can-view-model"],function(e,t){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"default",{enumerable:!0,get:function(){return(e=t,e&&e.__esModule?e:{default:e}).default;var e}})}),define("can/es/can-view-nodelist",["exports","can-view-nodelist"],function(e,t){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"default",{enumerable:!0,get:function(){return(e=t,e&&e.__esModule?e:{default:e}).default;var e}})}),define("can/es/can-view-parser",["exports","can-view-parser"],function(e,t){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"default",{enumerable:!0,get:function(){return(e=t,e&&e.__esModule?e:{default:e}).default;var e}})}),define("can/es/can-view-scope",["exports","can-view-scope"],function(e,t){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"default",{enumerable:!0,get:function(){return(e=t,e&&e.__esModule?e:{default:e}).default;var e}})}),define("can/es/can-view-target",["exports","can-view-target"],function(e,t){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"default",{enumerable:!0,get:function(){return(e=t,e&&e.__esModule?e:{default:e}).default;var e}})}),define("can-key/sub/sub",["require","exports","module","can-key/utils","can-key/get/get","can-reflect","can-key/delete/delete"],function(e,t,n){"use strict";var o=e("can-key/utils"),s=e("can-key/get/get"),c=e("can-reflect"),u=e("can-key/delete/delete");n.exports=function(e,r,a){var i=[];return e=e||"",i.push(e.replace(o.strReplacer,function(e,t){var n=s(r,t);return!0===a&&u(r,t),null==n?(i=null,""):!c.isPrimitive(n)&&i?(i.push(n),""):""+n})),null===i?i:i.length<=1?i[0]:i}}),define("can-query-logic/src/set",["require","exports","module","can-symbol","can-reflect"],function(e,t,n){var p,r=e("can-symbol"),h=e("can-reflect"),a=function(e){return h.assignSymbols(e,{"can.serialize":function(){return this}})};function i(n){return function(e,t){return n.call(this,t,e)}}var s=r.for("can.setComparisons");function o(e,t,n){var r=e[s];e[s]||(r=e[s]=new Map);var a=r.get(e);a||(a=new Map,r.set(e,a));var i=a.get(t);if(i)for(var o in n)i.hasOwnProperty(o)&&console.warn("Overwriting "+e.name+" "+o+" "+t.name+" comparitor"),i[o]=n[o];else a.set(t,n)}function c(){}var u={number:c,string:c,undefined:c,boolean:c},v={};["intersection","difference","union"].forEach(function(a){v[a]=function(e,t,n){if(n===p.UNIVERSAL){if("intersection"===a)return t;if("union"===a)return p.UNIVERSAL;if("difference"===a)return p.EMPTY}if(t===p.UNIVERSAL){if("intersection"===a)return t;if("union"===a)return p.UNIVERSAL}if(e&&e[a]){var r=e[a](t,n);return void 0===r&&!0===e.undefinedIsEmptySet?p.EMPTY:r}throw new Error("Unable to perform "+a+" between "+p.getType(t).name+" and "+p.getType(n).name)}});var l={intersection:function(e,t){return e===t?e:p.EMPTY},difference:function(e,t){return e===t?p.EMPTY:e},union:function(e,t){return e===t?e:p.UNDEFINABLE}};(p={UNIVERSAL:h.assignSymbols({name:"UNIVERSAL"},{"can.serialize":function(){return this},"can.isMember":function(){return!0}}),EMPTY:h.assignSymbols({name:"EMPTY"},{"can.serialize":function(){return this},"can.isMember":function(){return!1}}),UNDEFINABLE:a({name:"UNDEFINABLE"}),UNKNOWABLE:a({name:"UNKNOWABLE"}),Identity:c,isSpecial:function(e){return e===p.UNIVERSAL||e===p.EMPTY||e===p.UNDEFINABLE||e===p.UNKNOWABLE},isDefinedAndHasMembers:function(e){return e!==p.EMPTY&&e!==p.UNDEFINABLE&&e!==p.UNKNOWABLE&&e},getType:function(e){return e===p.UNIVERSAL?p.UNIVERSAL:e===p.EMPTY?p.EMPTY:e===p.UNKNOWABLE?p.UNKNOWABLE:null===e?c:u.hasOwnProperty(typeof e)?u[typeof e]:e.constructor},ownAndMemberValue:function(e,t){if(null==e&&null==t)return{own:t,member:e};var n=null!=e?e.valueOf():e,r=null!=t?t.valueOf():t;return null==e||null==t||null!=n&&n.constructor===r.constructor||(r=new e.constructor(r).valueOf()),{own:n,member:r}},getComparisons:function(e,t){var n=e[s];if(n){var r=n.get(e);if(r)return r.get(t)}},hasComparisons:function(e){return!!e[s]},defineComparison:function(e,t,n){if(o(e,t,n),e!==t){var r={};for(var a in n)"difference"!==a&&(r[a]=i(n[a]));o(t,e,r)}},isSubset:function(e,t){if(e===t)return!0;var n=p.getType(e),r=p.getType(t),a=p.getComparisons(n,r);if(a){var i=v.intersection(a,e,t),o=v.difference(a,e,t);return i===p.UNKNOWABLE||o===p.UNKNOWABLE?void 0:i!==p.EMPTY&&o===p.EMPTY}throw new Error("Unable to perform subset comparison between "+n.name+" and "+r.name)},isProperSubset:function(e,t){return p.isSubset(e,t)&&!p.isEqual(e,t)},isEqual:function(e,t){if(e===p.UNKNOWABLE||t===p.UNKNOWABLE)return p.UNKNOWABLE;var n=p.isSpecial(e),r=p.isSpecial(t);if(n&&r)return n===r;var a=p.getType(e),i=p.getType(t);if(e===t)return!0;var o=p.getComparisons(a,i),s=p.getComparisons(i,a);if(o&&s){var c=v.intersection(o,e,t),u=v.difference(o,e,t);if(c===p.EMPTY||u!==p.EMPTY)return!1;var l=v.intersection(s,t,e),f=v.difference(s,t,e);return l!==p.EMPTY&&f===p.EMPTY}var d=p.ownAndMemberValue(e,t);if(h.isPrimitive(d.own)&&h.isPrimitive(d.member))return d.own===d.member;throw new Error("Unable to perform equal comparison between "+a.name+" and "+i.name)},union:function(e,t){if(e===p.UNIVERSAL||t===p.UNIVERSAL)return p.UNIVERSAL;if(e===p.EMPTY)return t;if(t===p.EMPTY)return e;if(e===p.UNKNOWABLE||t===p.UNKNOWABLE)return p.UNKNOWABLE;var n=p.getType(e),r=p.getType(t),a=p.getComparisons(n,r);return v.union(a,e,t)},intersection:function(e,t){if(e===p.UNIVERSAL)return t;if(t===p.UNIVERSAL)return e;if(e===p.EMPTY||t===p.EMPTY)return p.EMPTY;if(e===p.UNKNOWABLE||t===p.UNKNOWABLE)return p.UNKNOWABLE;var n=p.getType(e),r=p.getType(t),a=p.getComparisons(n,r);if(a)return v.intersection(a,e,t);throw new Error("Unable to perform intersection comparison between "+n.name+" and "+r.name)},difference:function(e,t){if(e===p.EMPTY)return p.EMPTY;if(t===p.EMPTY)return e;if(e===p.UNKNOWABLE||t===p.UNKNOWABLE)return p.UNKNOWABLE;var n=p.getType(e),r=p.getType(t),a=p.getComparisons(n,r);if(a)return v.difference(a,e,t);throw new Error("Unable to perform difference comparison between "+n.name+" and "+r.name)},indexWithEqual:function(e,t){for(var n=0,r=e.length;n<r;n++)if(p.isEqual(e[n],t))return n;return-1}}).defineComparison(c,c,l),p.defineComparison(p.UNIVERSAL,p.UNIVERSAL,l),n.exports=p}),define("can-fixture/data-from-url",function(e,t,n){var o=/\{([^\}]+)\}/g;n.exports=function(e,t){if(!e)return{};var n=[],r=e.replace(".","\\.").replace("?","\\?"),a=new RegExp(r.replace(o,function(e,t){return n.push(t),"([^/]+)"})+"$").exec(t),i={};return a?(a.shift(),n.forEach(function(e){i[e]=a.shift()}),i):null}}),define("can-query-logic/src/array-union-intersection-difference",["require","exports","module","can-query-logic/src/set"],function(e,t,n){var o=e("can-query-logic/src/set");function s(e){return null==e?e:e.valueOf()}n.exports=function(e,t){var n=new Set,r=[],a=[],i=e.slice(0);return e.forEach(function(e){n.add(s(e)),a.push(e)}),t.forEach(function(e){if(n.has(s(e))){r.push(e);var t=o.indexWithEqual(i,e);-1!==t&&i.splice(t,1)}else a.push(e)}),{intersection:r,union:a,difference:i}}}),define("can-query-logic/src/types/comparisons",["require","exports","module","can-query-logic/src/set","can-query-logic/src/array-union-intersection-difference","can-symbol"],function(e,t,n){var o=e("can-query-logic/src/set"),s=e("can-query-logic/src/array-union-intersection-difference"),r=e("can-symbol").for("can.isMember"),a={In:function(e){this.values=e},NotIn:function(e){this.values=e},GreaterThan:function(e){this.value=e},GreaterThanEqual:function(e){this.value=e},LessThan:function(e){this.value=e},LessThanEqual:function(e){this.value=e},And:function(e){this.values=e},Or:function(e){this.values=e}};function i(n){return function(e,t){return null!=e&&null!=t&&n(e,t)}}function c(n){return function(e,t){return e===t||null!=e&&null!=t&&n(e,t)}}function u(e){var t=o.ownAndMemberValue(this.value,e);return this.constructor.test(t.member,t.own)}function l(e){return this.constructor.test(this.values,e)}function f(n){return{test:function(e,t){return!n.test(e,t)}}}function d(r,a,i){return function(e,t){var n=s(e.values,t.values);return n[r].length?new a(n[r]):i||o.EMPTY}}function p(n){return function(e,t){return n(t,e)}}function h(n,r){return function(e,t){return new n(t[r||"value"])}}function v(e,t){return e.value<t.value?t:e}function g(e,t){return e.value>t.value?t:e}function y(n,r){return function(e,t){return n.test(e.value,t.value)?L([e,new r(t.value)]):o.EMPTY}}function m(e,t){var n=y(e,t);return function(e,t){return e.value===t.value?new D.In([e.value]):n(e,t)}}function b(r,a,i){return function(e,t){var n=e.values.filter(function(e){return r.test(t,e)});return n.length?new a(n):i||o.EMPTY}}a.Or.prototype.orValues=function(){return this.values},a.In.test=function(e,n){return e.some(function(e){var t=o.ownAndMemberValue(e,n);return t.own===t.member})},a.NotIn.test=function(e,t){return!a.In.test(e,t)},a.NotIn.testValue=function(e,t){return!a.In.testValue(e,t)},a.GreaterThan.test=i(function(e,t){return t<e}),a.GreaterThanEqual.test=c(function(e,t){return t<=e}),a.LessThan.test=i(function(e,t){return e<t}),a.LessThanEqual.test=c(function(e,t){return e<=t}),[a.GreaterThan,a.GreaterThanEqual,a.LessThan,a.LessThanEqual,a.LessThan].forEach(function(e){e.prototype.isMember=u}),[a.In,a.NotIn].forEach(function(e){e.prototype.isMember=l}),a.And.prototype.isMember=function(t){return this.values.every(function(e){return e.isMember(t)})},a.Or.prototype.isMember=function(t){return this.values.some(function(e){return e.isMember(t)})},Object.keys(a).forEach(function(e){a[e].prototype[r]=a[e].prototype.isMember});var w={test:function(e,t){return e.isMember(t)}};function _(e){return e instanceof D.Or}function x(e){return e instanceof D.And||_(e)}function E(a){return function(e,t){var n,r=e.values.filter(function(e){return a.values.test(t,e)});return n=a.complement?o.difference(o.UNIVERSAL,t):a.with?new a.with(t.value):t,r.length?a.combinedUsing([new a.arePut(r),n]):n}}function k(n,r){return function(e,t){return n.test(e.value,t.value)?r||o.UNIVERSAL:V([e,t])}}function O(n,r){return function(e,t){return n.test(e.value,t.value)?r||o.EMPTY:L([e,t])}}function N(n){return function(e,t){return n.test(e.value,t.value)?o.difference(o.UNIVERSAL,t):e}}function L(e){return a.And?new a.And(e):o.UNDEFINABLE}function V(e){return a.Or?new a.Or(e):o.UNDEFINABLE}var D=a;function S(e,t,n){var r=new n(t.value),a=e.values.filter(function(e){return!r.isMember(e)});return a.length?a.length<e.values.length?V([new D.In(a),r]):V([e,t]):r}var P,M,q={union:E({values:f(w),arePut:D.In,combinedUsing:function(e){return function e(t,n){if(n instanceof D.Or){var r=e(t,n.values[0]);if(!(r instanceof D.Or))return o.union(r,n.values[1]);var a=e(t,n.values[1]);return a instanceof D.Or?V([t,n]):o.union(a,n.values[0])}return n instanceof D.GreaterThan?S(t,n,D.GreaterThanEqual):n instanceof D.LessThan?S(t,n,D.LessThanEqual):V([t,n])}(e[0],e[1])}}),intersection:b(w,D.In,o.EMPTY),difference:b(f(w),D.In,o.EMPTY)},C={difference:p(E({values:w,arePut:D.NotIn,combinedUsing:L}))},j=function(){return{union:b(f(w),D.NotIn,o.UNIVERSAL),intersection:E({values:w,arePut:D.NotIn,combinedUsing:L}),difference:E({values:f(w),arePut:D.NotIn,combinedUsing:L,complement:!0})}},T={difference:p(b(w,D.In,o.EMPTY))},I=function(e,t){var n=o.union(e,t.values[0]),r=o.union(e,t.values[1]);return x(n)||x(r)?new D.Or([e,t]):o.intersection(n,r)},A=function(e,t){var n=t.values[0],r=t.values[1],a=o.intersection(e,n),i=o.intersection(e,r);return a===o.EMPTY||i===o.EMPTY?o.EMPTY:x(a)?x(i)?new D.And([e,t]):new o.intersection(i,n):new o.intersection(a,r)},K=function(e,t){var n=t.values[0],r=t.values[1],a=o.difference(e,n),i=o.difference(e,r);return a===o.EMPTY?i:i===o.EMPTY?a:new D.Or([a,i])},R=function(e,t){var n=e.values[0],r=e.values[1],a=o.difference(n,t),i=o.difference(r,t);return o.intersection(a,i)},B={union:function(e,t){var n=t.values[0],r=t.values[1],a=o.union(e,n);if(!x(a))return o.union(a,r);var i=o.union(e,r);return x(i)?new D.Or([e,t]):o.union(n,i)},intersection:function(e,t){var n=t.values[0],r=t.values[1],a=o.intersection(e,n),i=o.intersection(e,r);return a===o.EMPTY?i:i===o.EMPTY?a:o.union(a,i)},difference:function(e,t){var n=t.values[0],r=t.values[1],a=o.difference(e,n),i=o.difference(e,r);return o.intersection(a,i)}},F={difference:function(e,t){var n=e.values[0],r=e.values[1],a=o.difference(n,t),i=o.difference(r,t);return o.union(a,i)}},H={In_In:{union:d("union",D.In),intersection:d("intersection",D.In),difference:d("difference",D.In)},UNIVERSAL_In:{difference:h(D.NotIn,"values")},In_NotIn:{union:p(d("difference",D.NotIn,o.UNIVERSAL)),intersection:d("difference",D.In),difference:d("intersection",D.In)},NotIn_In:{difference:d("union",D.NotIn)},In_GreaterThan:q,GreaterThan_In:C,In_GreaterThanEqual:q,GreaterThanEqual_In:C,In_LessThan:q,LessThan_In:C,In_LessThanEqual:q,LessThanEqual_In:C,In_And:q,And_In:C,In_Or:q,Or_In:C,NotIn_NotIn:{union:d("intersection",D.NotIn,o.UNIVERSAL),intersection:d("union",D.NotIn),difference:d("difference",D.In)},UNIVERSAL_NotIn:{difference:h(D.In,"values")},NotIn_GreaterThan:j(),GreaterThan_NotIn:T,NotIn_GreaterThanEqual:j(),GreaterThanEqual_NotIn:T,NotIn_LessThan:j(),LessThan_NotIn:T,NotIn_LessThanEqual:j(),LessThanEqual_NotIn:T,NotIn_And:j(),And_NotIn:T,NotIn_Or:j(),Or_NotIn:T,GreaterThan_GreaterThan:{union:g,intersection:v,difference:y(D.LessThan,D.LessThanEqual)},UNIVERSAL_GreaterThan:{difference:h(D.LessThanEqual)},GreaterThan_GreaterThanEqual:{union:g,intersection:v,difference:y(D.LessThan,D.LessThan)},GreaterThanEqual_GreaterThan:{difference:m(D.LessThan,D.LessThanEqual)},GreaterThan_LessThan:{union:(M=k(D.LessThan),function(e,t){return a.In.test([e.value],t.value)?new D.NotIn([e.value]):M(e,t)}),intersection:O(D.GreaterThan),difference:N(D.LessThan)},LessThan_GreaterThan:{difference:N(D.GreaterThan)},GreaterThan_LessThanEqual:{union:k(D.LessThanEqual),intersection:O(D.GreaterThanEqual),difference:N(D.LessThanEqual)},LessThanEqual_GreaterThan:{difference:N(D.GreaterThanEqual)},GreaterThan_And:{union:I,intersection:A,difference:K},And_GreaterThan:{difference:R},GreaterThan_Or:B,Or_GreaterThan:F,GreaterThanEqual_GreaterThanEqual:{union:g,intersection:v,difference:y(D.LessThan,D.LessThan)},UNIVERSAL_GreaterThanEqual:{difference:h(D.LessThan)},GreaterThanEqual_LessThan:{union:k(D.LessThanEqual),intersection:O(D.GreaterThanEqual),difference:N(D.LessThanEqual)},LessThan_GreaterThanEqual:{difference:N(D.GreaterThanEqual)},GreaterThanEqual_LessThanEqual:{union:k(D.LessThanEqual),intersection:(P=O(D.GreaterThan),function(e,t){var n=new D.In([e.value]);return n.isMember(t.value)?n:P(e,t)}),difference:N(D.LessThanEqual)},LessThanEqual_GreaterThanEqual:{difference:N(D.GreaterThanEqual)},GreaterThanEqual_And:{union:I,intersection:A,difference:K},And_GreaterThanEqual:{difference:R},GreaterThanEqual_Or:B,Or_GreaterThanEqual:F,LessThan_LessThan:{union:v,intersection:g,difference:y(D.GreaterThan,D.GreaterThanEqual)},UNIVERSAL_LessThan:{difference:h(D.GreaterThanEqual)},LessThan_LessThanEqual:{union:v,intersection:g,difference:y(D.GreaterThan,D.GreaterThan)},LessThanEqual_LessThan:{difference:m(D.GreaterThanEqual,D.GreaterThanEqual)},LessThan_And:{union:I,intersection:A,difference:K},And_LessThan:{difference:R},LessThan_Or:B,Or_LessThan:F,LessThanEqual_LessThanEqual:{union:v,intersection:g,difference:function(e,t){return e.value>=t.value?L([e,new D.GreaterThan(t.value)]):o.EMPTY}},UNIVERSAL_LessThanEqual:{difference:h(D.GreaterThan)},LessThanEqual_And:{union:I,intersection:A,difference:K},And_LessThanEqual:{difference:R},LessThanEqual_Or:B,Or_LessThanEqual:F,And_And:{union:function(e,t){var n=o.union(e,t.values[0]),r=o.union(e,t.values[1]);return(x(n)||x(r))&&(n=o.union(t,e.values[0]),r=o.union(t,e.values[1])),x(n)||x(r)?new D.Or([e,t]):o.intersection(n,r)},intersection:function(e,t){var n=o.intersection(e.values[0],t.values[0]),r=o.intersection(e.values[1],t.values[1]);return x(n)&&x(r)?(n=o.intersection(e.values[0],t.values[1]),r=o.intersection(e.values[1],t.values[0]),x(n)&&x(r)?new D.And([e,t]):o.intersection(n,r)):o.intersection(n,r)},difference:function(e,t){var n=o.difference(e,t.values[0]),r=o.difference(e,t.values[1]);return o.union(n,r)}},And_Or:{union:function(e,t){var n=o.union(e.values[0],t),r=o.union(e.values[1],t);return x(n)&&x(r)?new D.Or([e,t]):o.intersection(n,r)},intersection:function(e,t){var n=o.intersection(e,t.values[0]),r=o.intersection(e,t.values[1]);return _(n)||_(r)?new D.And([e,t]):o.union(n,r)},difference:function(e,t){var n=o.difference(e,t.values[0]),r=o.difference(e,t.values[1]);return o.intersection(n,r)}},Or_And:{difference:function(e,t){var n=o.difference(e,t.values[0]),r=o.difference(e,t.values[1]);return o.union(n,r)}},UNIVERSAL_And:{difference:function(e,t){var n=o.difference(e,t.values[0]),r=o.difference(e,t.values[1]);return o.union(n,r)}},Or_Or:{union:function(e,t){var n=o.union(e.values[0],t.values[0]),r=o.union(e.values[1],t.values[1]);return x(n)&&x(r)?(n=o.union(e.values[0],t.values[1]),r=o.union(e.values[1],t.values[0]),x(n)&&x(r)?new D.Or([e,t]):o.union(n,r)):o.union(n,r)},intersection:function(e,t){var n=t.values[0],r=t.values[1],a=o.intersection(e,n),i=o.intersection(e,r);return _(a)&&_(i)?(a=o.union(t,e.values[0]),i=o.union(t,e.values[1]),_(a)&&_(i)?new D.Or([e,t]):o.union(a,i)):o.union(a,i)},difference:function(e,t){var n=o.difference(e,t.values[0]),r=o.difference(e,t.values[1]);return o.intersection(n,r)}},UNIVERSAL_Or:{difference:function(e,t){var n=o.difference(e,t.values[0]),r=o.difference(e,t.values[1]);return o.intersection(n,r)}}},U=Object.keys(a);U.forEach(function(e,t){H[e+"_"+e]?o.defineComparison(a[e],a[e],H[e+"_"+e]):console.warn("no "+e+"_"+e),H["UNIVERSAL_"+e]?o.defineComparison(o.UNIVERSAL,a[e],H["UNIVERSAL_"+e]):console.warn("no UNIVERSAL_"+e);for(var n=t+1;n<U.length;n++){var r=U[n];H[e+"_"+r]?o.defineComparison(a[e],a[r],H[e+"_"+r]):console.warn("no "+e+"_"+r),H[r+"_"+e]?o.defineComparison(a[r],a[e],H[r+"_"+e]):console.warn("no "+r+"_"+e)}}),n.exports=a}),define("can-query-logic/src/types/make-real-number-range-inclusive",["require","exports","module","can-query-logic/src/set","can-query-logic/src/types/comparisons"],function(e,t,n){var l=e("can-query-logic/src/set"),f=e("can-query-logic/src/types/comparisons");n.exports=function(n,r){function o(e,t){this.start=0<arguments.length?+e:n,this.end=1<arguments.length?+t:r,this.range=new f.And([new f.GreaterThanEqual(this.start),new f.LessThanEqual(this.end)])}var a=new o(n,r);function s(e){return l.isSubset(a.range,e.range)}function c(e){var t={};if(e.values.forEach(function(e){e instanceof f.GreaterThanEqual&&(t.start=e.value),e instanceof f.GreaterThan&&(t.start=e.value+1),e instanceof f.LessThanEqual&&(t.end=e.value),e instanceof f.LessThan&&(t.end=e.value-1)}),"start"in t&&"end"in t)return new o(t.start,t.end)}function i(e){var t;if(e instanceof f.And&&(t=c(e)),e instanceof f.Or){var n=c(e.values[0]),r=c(e.values[1]);if(!n||!r)return l.UNDEFINABLE;var a=n.range.values,i=r.range.values;if(a[1].value+1===i[0].value)t=new o(a[0].value,i[1].value);else{if(i[1].value+1!==a[0].value)return l.UNDEFINABLE;t=new o(i[0].value,a[1].value)}}return t&&s(t)?l.UNIVERSAL:t}function u(e,t){var n=i(l.difference(e.range,t.range));return n||l.EMPTY}return l.defineComparison(o,o,{union:function(e,t){var n=i(l.union(e.range,t.range));return n||l.EMPTY},intersection:function(e,t){var n=i(l.intersection(e.range,t.range));return n||l.EMPTY},difference:u}),l.defineComparison(l.UNIVERSAL,o,{difference:function(e,t){return s(t)?l.EMPTY:u(a,t)}}),o}}),define("can-query-logic/src/types/types",function(e,t,n){n.exports={}}),define("can-query-logic/src/types/values-or",["require","exports","module","can-query-logic/src/set","can-query-logic/src/types/types"],function(e,t,n){var r=e("can-query-logic/src/set"),a=e("can-query-logic/src/types/types");function i(e){this.values=e}i.prototype.isMember=function(t){return this.values.some(function(e){return e&&e.isMember?e.isMember(t):e===t})},r.defineComparison(r.UNIVERSAL,i,{difference:function(){return r.UNDEFINABLE}}),n.exports=a.ValuesOr=i}),define("can-query-logic/src/types/values-not",["require","exports","module","can-query-logic/src/set","can-query-logic/src/types/types"],function(e,t,n){var r=e("can-query-logic/src/set"),a=e("can-query-logic/src/types/types");function i(e){this.value=e}var o=r.Identity;r.defineComparison(r.UNIVERSAL,o,{difference:function(e,t){return new i(t)}}),r.defineComparison(r.UNIVERSAL,i,{difference:function(e,t){return t.value}}),r.defineComparison(i,i,{}),r.defineComparison(i,o,{union:function(e,t){if(r.isEqual(e.value,t))return r.UNIVERSAL;throw new Error("Not,Identity Union is not filled out")},intersection:function(e,t){return r.isEqual(!e.value,t)?t:r.EMPTY},difference:function(e,t){return r.isEqual(e.value,t)?e:r.UNDEFINABLE}}),r.defineComparison(o,i,{difference:function(e,t){return r.isEqual(e,t.value)?e:r.UNDEFINABLE}}),n.exports=a.Not=i}),define("can-query-logic/src/types/keys-and",["require","exports","module","can-query-logic/src/set","can-assign","can-query-logic/src/array-union-intersection-difference","can-reflect","can-key/get/get","can-symbol","can-reflect","can-query-logic/src/types/types"],function(e,t,n){var m=e("can-query-logic/src/set"),b=e("can-assign"),r=e("can-query-logic/src/array-union-intersection-difference"),u=e("can-reflect"),s=e("can-key/get/get"),a=e("can-symbol"),w=(u=e("can-reflect"),e("can-query-logic/src/types/types"));function _(e){var n=this.values={};u.eachKey(e,function(e,t){u.isPlainObject(e)&&!m.isSpecial(e)?n[t]=new _(e):n[t]=e})}var c=a.for("can.isMember");function l(e){return m.isEqual(e,m.UNIVERSAL)?m.UNIVERSAL:e}_.prototype.isMember=function(r,a,e){var i=!0,o=e?e+".":"";return u.eachKey(this.values,function(e,t){var n=e&&(e[c]||e.isMember);n?n.call(e,s(r,t),a||r,o+t)||(i=!1):e!==s(r,t)&&(i=!1)}),i};var f={};function x(e,t){var n=r(Object.keys(e),Object.keys(t));return{aOnlyKeys:n.difference,aAndBKeys:n.intersection,bOnlyKeys:r(Object.keys(t),Object.keys(e)).difference}}function E(e){return e!==m.EMPTY}function i(e,t){var r=e.values,a=t.values,n=x(r,a),i=n.aOnlyKeys,o=n.aAndBKeys,s=n.bOnlyKeys,c={},u={},l={};o.forEach(function(e){var t=m.difference(r[e],a[e]);if(t===m.EMPTY)c[e]=r[e];else{var n=m.intersection(r[e],a[e]);n!==m.EMPTY?u[e]={difference:t,intersection:n}:l[e]=r[e]}});var f,d=Object.keys(u);if(1===d.length&&((f={})[d[0]]=u[d[0]].difference),Object.keys(l).length)return e;if(0===i.length&&0===s.length)return 1<d.length?m.UNDEFINABLE:1===d.length?(b(c,f),new _(c)):m.EMPTY;if(0<i.length&&0===s.length)return 1<d.length?m.UNDEFINABLE:1===d.length?(b(c,f),i.forEach(function(e){c[e]=r[e]}),new _(c)):m.EMPTY;if(0===i.length&&0<s.length){if(1<d.length)return m.UNDEFINABLE;var p;if(1===d.length){var h=d[0];(p=b({},c))[h]=u[h].difference,c[h]=u[h].intersection}var v=s.map(function(e){var t=b({},c),n=t[e]=m.difference(m.UNIVERSAL,a[e]);return n===m.EMPTY?n:new _(t)}).filter(E);return p&&v.push(new _(p)),1<v.length?new w.ValuesOr(v):1===v.length?v[0]:m.EMPTY}if(0<i.length&&0<s.length){if(d.length)throw new Error("Can't handle any productable keys right now");if(i.forEach(function(e){c[e]=r[e]}),1!==s.length)return m.UNDEFINABLE;var g=s[0],y=b({},c);return y[g]=m.difference(m.UNIVERSAL,a[g]),new _(y)}}m.defineComparison(_,_,{union:function(t,n){var e=x(t.values,n.values),r=[],a={};e.aAndBKeys.forEach(function(e){m.isEqual(t.values[e],n.values[e])?a[e]=t.values[e]:r.push(e)});var i={},o={};if(r.forEach(function(e){i[e]=t.values[e],o[e]=n.values[e]}),!e.aOnlyKeys.length&&!e.bOnlyKeys.length){if(1===r.length){var s=r[0],c=a[s]=m.union(t.values[s],n.values[s]);return 1===u.size(a)&&m.isEqual(c,m.UNIVERSAL)?m.UNIVERSAL:new _(a)}if(0===r.length)return t}if(0===r.length){if(0<e.aOnlyKeys.length&&0===e.bOnlyKeys.length)return l(n);if(0===e.aOnlyKeys.length&&0<e.bOnlyKeys.length)return l(t)}return 0<e.aOnlyKeys.length&&0===e.bOnlyKeys.length&&m.isSubset(new _(i),new _(o))?n:0<e.bOnlyKeys.length&&0===e.aOnlyKeys.length&&m.isSubset(new _(o),new _(i))?t:new w.ValuesOr([t,n])},intersection:function(e,t){var n=e.values,r=t.values,a=!1,i={};return function(e,t,n,r,a){var i,o=b({},n);for(var s in e){if(void 0!==(i=t(s,e[s],s in n?n[s]:f,e,n)))return;delete o[s]}for(s in o)if(void 0!==(i=r(s,f,n[s],e,n)))return}(n,function(e,t,n){i[e]=n===f?t:m.intersection(t,n),i[e]===m.EMPTY&&(a=!0)},r,function(e,t,n){i[e]=n,i[e]===m.EMPTY&&(a=!0)}),a?m.EMPTY:new _(i)},difference:i}),m.defineComparison(m.UNIVERSAL,_,{difference:function(e,t){return i({values:{}},t)}}),n.exports=w.KeysAnd=_}),define("can-query-logic/src/types/and-or-not",["require","exports","module","can-query-logic/src/types/values-or","can-query-logic/src/types/values-not","can-query-logic/src/types/keys-and"],function(e,t,n){var r=e("can-query-logic/src/types/values-or"),a=e("can-query-logic/src/types/values-not"),i=e("can-query-logic/src/types/keys-and");n.exports={KeysAnd:i,ValuesOr:r,ValuesNot:a}}),define("can-query-logic/src/helpers",["require","exports","module","can-reflect"],function(e,t,n){var s=e("can-reflect"),r={undefined:0,null:1,number:3,string:4,object:5,boolean:6},a=function(e){var t=typeof e;return null===e&&(t="null"),r[t]},i={$gt:function(e,t){return a(e)>a(t)},$lt:function(e,t){return a(e)<a(t)}},c={$gt:function(e,t){return null==e||null==t?i.$gt(e,t):t<e},$lt:function(e,t){return null==e||null==t?i.$gt(e,t):e<t}},u={uniqueConcat:function(e,t,n){var r=new Set;return e.concat(t).filter(function(e){var t=n(e);return!r.has(t)&&(r.add(t),!0)})},getIndex:function(e,t,n){if(t&&t.length){if(-1===e(n,t[0]))return 0;if(1===e(n,t[t.length-1]))return t.length;for(var r=0,a=t.length;r<a;){var i=r+a>>>1;-1===e(n,t[i])?a=i:r=i+1}return a}},sortData:function(e){return"-"===e[0]?{prop:e.slice(1),desc:!0}:{prop:e,desc:!1}},defaultCompare:c,typeCompare:i,sorter:function(e,t){var i,o=u.sortData(e);return i=t&&t[o.prop]?t[o.prop]:c,function(e,t){var n,r=s.getKeyValue(e,o.prop),a=s.getKeyValue(t,o.prop);return o.desc&&(n=r,r=a,a=n),i.$lt(r,a)?-1:i.$gt(r,a)?1:0}},valueHydrator:function(e){if(s.isBuiltIn(e))return e;throw new Error("can-query-logic doesn't support comparison operator: "+JSON.stringify(e))}};n.exports=u}),define("can-query-logic/src/types/basic-query",["require","exports","module","can-query-logic/src/set","can-query-logic/src/types/make-real-number-range-inclusive","can-assign","can-reflect","can-query-logic/src/types/and-or-not","can-query-logic/src/helpers","can-define-lazy-value","can-symbol"],function(e,t,n){var l=e("can-query-logic/src/set"),r=e("can-query-logic/src/types/make-real-number-range-inclusive"),a=e("can-assign"),i=e("can-reflect"),o=e("can-query-logic/src/types/and-or-not"),s=e("can-query-logic/src/helpers"),c=e("can-define-lazy-value"),u=(e("can-symbol").for("can.isMember"),o.KeysAnd),f=o.ValuesOr,d=o.ValuesNot,p=r(0,1/0);function h(e,o){var t={};function n(e){this.key=e,this.compare=s.sorter(e,t)}return i.eachKey(e,function(a,i){t[i]={$gt:function(e,t){if(null==e||null==t)return s.typeCompare.$gt(e,t);var n=o({$gt:t},i,a,s.valueHydrator),r=o({$eq:e},i,a,s.valueHydrator);return l.isEqual(l.union(n,r),n)},$lt:function(e,t){if(null==e||null==t)return s.typeCompare.$lt(e,t);var n=o({$lt:t},i,a,s.valueHydrator),r=o({$eq:e},i,a,s.valueHydrator);return l.isEqual(l.union(n,r),n)}}}),l.defineComparison(n,n,{intersection:function(e,t){return e.key===t.key?e:l.EMPTY},difference:function(e,t){return e.key===t.key?l.EMPTY:e},union:function(e,t){return e.key===t.key?e:l.UNDEFINABLE}}),n}var v=h({});function g(e){a(this,e),this.filter||(this.filter=l.UNIVERSAL),this.page||(this.page=new p),this.sort||(this.sort="id"),"string"==typeof this.sort&&(this.sort=new v(this.sort))}g.KeysAnd=u,g.Or=f,g.Not=d,g.RecordRange=p,g.makeSort=h,i.assignMap(g.prototype,{count:function(){return this.page.end-this.page.start+1},sortData:function(e){return e.slice(0).sort(this.sort.compare)},filterMembersAndGetCount:function(e,t){if(t){if(!l.isSubset(this,t))throw new Error("can-query-logic: Unable to get members from a set that is not a superset of the current set.")}else t=new g;var n=e.filter(function(e){return this.filter.isMember(e)},this),r=n.length;r&&this.sort.key!==t.sort.key&&(n=this.sortData(n));var a=l.isEqual(this.page,l.UNIVERSAL);if(l.isEqual(t.page,l.UNIVERSAL))return a?{data:n,count:r}:{data:n.slice(this.page.start,this.page.end+1),count:r};if(this.sort.key===t.sort.key&&l.isEqual(t.filter,this.filter))return{data:n.slice(this.page.start-t.page.start,this.page.end-t.page.start+1),count:r};throw new Error("can-query-logic: Unable to get members from the parent set for this subset.")},filterFrom:function(e,t){return this.filterMembersAndGetCount(e,t).data},merge:function(e,t,n,r){var a=l.union(this,e);if(a!==l.UNDEFINABLE){var i=s.uniqueConcat(t,n,r);return a.sortData(i)}},index:function(e,t){var n=s.sortData(this.sort.key);if(i.hasOwnKey(e,n.prop))return s.getIndex(this.sort.compare,t,e)},isMember:function(e){return this.filter.isMember(e)},removePagination:function(){this.page=new p}});var y=["filter","page","sort"];function m(e,t,n){return!!n[e+"FilterIsSubset"]&&(!!n[t+"PageIsUniversal"]||n[e+"PageIsSubset"]&&n.sortIsEqual)}function b(e,t){this.queryA=e,this.queryB=t}function w(e,t){return new b(e,t)}i.eachKey({pageIsEqual:function(){return l.isEqual(this.queryA.page,this.queryB.page)},aPageIsUniversal:function(){return l.isEqual(this.queryA.page,l.UNIVERSAL)},bPageIsUniversal:function(){return l.isEqual(this.queryB.page,l.UNIVERSAL)},pagesAreUniversal:function(){return this.pageIsEqual&&this.aPageIsUniversal},sortIsEqual:function(){return this.queryA.sort.key===this.queryB.sort.key},aFilterIsSubset:function(){return l.isSubset(this.queryA.filter,this.queryB.filter)},bFilterIsSubset:function(){return l.isSubset(this.queryB.filter,this.queryA.filter)},aPageIsSubset:function(){return l.isSubset(this.queryA.page,this.queryB.page)},bPageIsSubset:function(){return l.isSubset(this.queryB.page,this.queryA.page)},filterIsEqual:function(){return l.isEqual(this.queryA.filter,this.queryB.filter)},aIsSubset:function(){return m("a","b",this)},bIsSubset:function(){return m("b","a",this)}},function(e,t){c(b.prototype,t,e)}),l.defineComparison(g,g,{union:function(e,t){var n=w(e,t),r=l.union(e.filter,t.filter);if(n.pagesAreUniversal)return new g({filter:r,sort:n.sortIsEqual?e.sort.key:void 0});if(n.filterIsEqual)return n.sortIsEqual?new g({filter:e.filter,sort:e.sort.key,page:l.union(e.page,t.page)}):n.aIsSubset?t:n.bIsSubset?e:l.UNDEFINABLE;throw new Error("different filters, non-universal pages")},intersection:function(e,t){var n=w(e,t);if(n.pagesAreUniversal){var r=l.intersection(e.filter,t.filter);return l.isDefinedAndHasMembers(r)?new g({filter:r,sort:n.sortIsEqual?e.sort.key:void 0}):r}return l.intersection(e.filter,t.filter)===l.EMPTY?l.EMPTY:n.filterIsEqual?n.sortIsEqual?new g({filter:e.filter,sort:e.sort.key,page:l.intersection(e.page,t.page)}):n.aIsSubset?e:n.bIsSubset?t:l.UNKNOWABLE:n.aIsSubset?e:n.bIsSubset?t:l.UNDEFINABLE},difference:function(e,t){var n,r,a,i,o=(n=e,r=t,a=[],y.forEach(function(e){l.isEqual(n[e],r[e])||a.push(e)}),a),s=w(e,t);if(1<o.length)return s.aIsSubset?l.EMPTY:s.pagesAreUniversal?new g({filter:l.difference(e.filter,t.filter),sort:e.sort.key}):l.UNDEFINABLE;switch(i=o[0]){case void 0:return l.EMPTY;case"sort":return s.pagesAreUniversal?l.EMPTY:l.UNKNOWABLE;case"page":case"filter":var c=l.difference(e[i],t[i]);if(l.isSpecial(c))return c;var u={filter:e.filter,page:e.page,sort:e.sort.key};return u[i]=c,new g(u)}}}),n.exports=g}),define("can-query-logic/src/serializer",["require","exports","module","can-reflect"],function(e,t,n){var r=e("can-reflect"),a=function(e){var r=this.serializers=new Map;e&&e.forEach(function(e){var t=e[0],n=e[1];r.set(t,n)}),this.serialize=this.serialize.bind(this)};a.prototype.add=function(e){r.assign(this.serializers,e instanceof a?e.serializers:e)},a.prototype.serialize=function(e){if(!e)return e;var t=e.constructor,n=this.serializers.get(t);return n?n(e,this.serialize):r.serialize(e)},n.exports=a}),define("can-query-logic/src/serializers/comparisons",["require","exports","module","can-query-logic/src/types/comparisons","can-query-logic/src/serializer","can-reflect"],function(e,t,n){var a=e("can-query-logic/src/types/comparisons"),r=e("can-query-logic/src/serializer"),i=e("can-reflect");function o(t){return function(e){return new t(e)}}var s={};function c(n,r){s[n]=function(e,t){return r(t?t(e[n]):e[n])},Object.defineProperty(s[n],"name",{value:"hydrate "+n,writable:!0})}function u(r,a){s[r]=function(e,t){var n=e[r];return t&&(n=n.map(function(e){return t(e)})),a(n)},Object.defineProperty(s[r],"name",{value:"hydrate "+r,writable:!0})}c("$eq",function(e){return new a.In([e])}),c("$ne",function(e){return new a.NotIn([e])}),c("$gt",o(a.GreaterThan)),c("$gte",o(a.GreaterThanEqual)),u("$in",o(a.In)),c("$lt",o(a.LessThan)),c("$lte",o(a.LessThanEqual)),u("$nin",o(a.GreaterThan));var l=new r([[a.In,function(e,t){return 1===e.values.length?t(e.values[0]):{$in:e.values.map(t)}}],[a.NotIn,function(e,t){return 1===e.values.length?{$ne:t(e.values[0])}:{$nin:e.values.map(t)}}],[a.GreaterThan,function(e,t){return{$gt:t(e.value)}}],[a.GreaterThanEqual,function(e,t){return{$gte:t(e.value)}}],[a.LessThan,function(e,t){return{$lt:t(e.value)}}],[a.LessThanEqual,function(e,t){return{$lte:t(e.value)}}],[a.And,function(e,t){var n={};return e.values.forEach(function(e){i.assignMap(n,t(e))}),n}]]);n.exports={hydrate:function(n,r){if(r||(r=function(){throw new Error("can-query-logic doesn't recognize operator: "+JSON.stringify(n))}),Array.isArray(n))return new a.In(n.map(function(e){return r(e)}));if(n&&"object"==typeof n){var e=Object.keys(n);if(e.every(function(e){return s[e]})){var t=e.map(function(e){var t={};return t[e]=n[e],(0,s[e])(t,r)});return 1<t.length?new a.And(t):t[0]}return r(n)}return new a.In([r(n)])},serializer:l}}),define("can-query-logic/src/schema-helpers",["require","exports","module","can-reflect","can-query-logic/src/set","can-symbol"],function(e,t,n){var r,a=e("can-reflect"),i=e("can-query-logic/src/set"),o=e("can-symbol");n.exports=r={isRangedType:function(e){return e&&a.isConstructorLike(e)&&!i.hasComparisons(e)&&!e[o.for("can.SetType")]&&e.prototype.valueOf&&e.prototype.valueOf!==Object.prototype.valueOf},categorizeOrValues:function(e){var t={primitives:[],valueOfTypes:[],others:[]};return e.forEach(function(e){a.isPrimitive(e)?t.primitives.push(e):r.isRangedType(e)?t.valueOfTypes.push(e):t.others.push(e)}),t}}}),define("can-query-logic/src/types/make-maybe",["require","exports","module","can-query-logic/src/set","can-query-logic/src/types/comparisons","can-reflect","can-query-logic/src/schema-helpers","can-symbol"],function(e,t,n){var s=e("can-query-logic/src/set"),c=e("can-query-logic/src/types/comparisons"),u=e("can-reflect"),a=e("can-query-logic/src/schema-helpers"),r=e("can-symbol"),i=r.for("can.ComparisonSetType"),l=r.for("can.isMember");function o(e,n){var i=new c.In(e);function o(e){var t=function t(n,e){var r;if(e instanceof c.And)return e.values.map(function(e){return t(n,e)}).reduce(function(e,t){return{range:s.intersection(e.range,t.range),enum:s.intersection(e.enum,t.enum)}},{range:s.UNIVERSAL,enum:n});if(e instanceof c.In){var a=e.values.filter(function(e){return n.isMember(e)});if(a.length){var i=e.values.slice(0);return u.removeValues(i,a),{enum:new c.In(a),range:i.length?new c.In(i):s.EMPTY}}return{enum:s.EMPTY,range:e}}if(e instanceof c.NotIn){r=s.intersection(n,e);var o=e.values.filter(function(e){return!n.isMember(e)});return{range:o.length?new c.NotIn(o):s.UNIVERSAL,enum:r}}return{enum:s.EMPTY,range:e}}(i,e.range);if(this.range=t.range||s.EMPTY,e.enum?t.enum!==s.EMPTY?this.enum=s.union(t.enum,e.enum):this.enum=e.enum:this.enum=t.enum,this.enum===s.EMPTY&&this.range===s.EMPTY)return s.EMPTY}return o.prototype.orValues=function(){var e=[];return this.range!==s.EMPTY&&e.push(this.range),this.enum!==s.EMPTY&&e.push(this.enum),e},o.prototype[l]=function(){var e=this.range[l]||this.range.isMember,t=this.enum[l]||this.enum.isMember;return e.apply(this.range,arguments)||t.apply(this.enum,arguments)},s.defineComparison(o,o,{union:function(e,t){return new o({enum:s.union(e.enum,t.enum),range:s.union(e.range,t.range)})},difference:function(e,t){return new o({enum:s.difference(e.enum,t.enum),range:s.difference(e.range,t.range)})},intersection:function(e,t){return new o({enum:s.intersection(e.enum,t.enum),range:s.intersection(e.range,t.range)})}}),o.inValues=e,s.defineComparison(s.UNIVERSAL,o,{difference:function(e,t){var n;if(t.range===s.UNIVERSAL)return new o({range:t.range,enum:s.difference(i,t.enum)});if(t.enum!==s.EMPTY)return n=s.difference(e,t.range),new o({enum:s.difference(i,t.enum),range:n});var r=s.difference(s.UNIVERSAL,t.range),a=s.difference(i,t.range);return new o({range:r,enum:s.difference(a,r)})}}),n=n||function(e){return e},o.hydrate=function(e,t){return new o({range:t(e,n)})},o}o.canMakeMaybeSetType=function(e){var t=u.getSchema(e);if(t&&"Or"===t.type){var n=a.categorizeOrValues(t.values);return 1===n.valueOfTypes.length&&n.valueOfTypes.length+n.primitives.length===t.values.length}return!1},o.makeMaybeSetTypes=function(t){var n,e=u.getSchema(t),r=a.categorizeOrValues(e.values);return t[i]?n=t[i]:((n=function(e){this.value=u.new(t,e)}).prototype.valueOf=function(){return this.value},u.assignSymbols(n.prototype,{"can.serialize":function(){return this.value}}),"production"!==process.env.NODE_ENV&&Object.defineProperty(n,"name",{value:"Or["+r.valueOfTypes[0].name+","+r.primitives.map(String).join(" ")+"]"})),{Maybe:o(r.primitives,function(e){return new n(e)}),ComparisonSetType:n}},n.exports=o}),define("can-query-logic/src/types/make-enum",["require","exports","module","can-query-logic/src/set","can-query-logic/src/array-union-intersection-difference","can-query-logic/src/schema-helpers","can-reflect","can-symbol"],function(e,t,n){var o=e("can-query-logic/src/set"),s=e("can-query-logic/src/array-union-intersection-difference"),a=e("can-query-logic/src/schema-helpers"),c=e("can-reflect"),r=e("can-symbol"),i=r.for("can.SetType"),u=r.for("can.isMember"),l=r.for("can.new");function f(n,r){function a(e){var t=Array.isArray(e)?e:[e];this.values=r?t.map(r):t}c.assignSymbols(a.prototype,{"can.serialize":function(){return 1===this.values.length?this.values[0]:this.values}}),a.prototype[u]=function(t){return this.values.some(function(e){return o.isEqual(e,t)})},a.UNIVERSAL=new a(n);var i=function(e,t){var n=s(e.values,t.values);return n.difference.length?new a(n.difference):o.EMPTY};return o.defineComparison(a,a,{union:function(e,t){var n=s(e.values,t.values);return n.union.length?new a(n.union):o.EMPTY},intersection:function(e,t){var n=s(e.values,t.values);return n.intersection.length?new a(n.intersection):o.EMPTY},difference:i}),o.defineComparison(a,o.UNIVERSAL,{difference:function(e){return i(e,{values:n.slice(0)})}}),o.defineComparison(o.UNIVERSAL,a,{difference:function(e,t){return i({values:n.slice(0)},t)}}),a}function d(e,n,t){var r=f(n,t);return e[i]=r,e[u]=function(t){return n.some(function(e){return o.isEqual(e,t)})},r}d.canMakeEnumSetType=function(e){var t=c.getSchema(e);return!(!t||"Or"!==t.type)&&a.categorizeOrValues(t.values).primitives.length===t.values.length},d.makeEnumSetType=function(e){var t=c.getSchema(e),n=a.categorizeOrValues(t.values),r=e[l]?e[l].bind(e):void 0;return f(n.primitives,r)},n.exports=d}),define("can-query-logic/src/serializers/basic-query",["require","exports","module","can-symbol","can-reflect","can-query-logic/src/types/basic-query","can-query-logic/src/set","can-query-logic/src/serializers/comparisons","can-query-logic/src/serializer","can-query-logic/src/types/comparisons","can-query-logic/src/types/make-maybe","can-query-logic/src/types/make-enum","can-log/dev/dev","can-query-logic/src/helpers"],function(e,t,n){var r=e("can-symbol"),c=e("can-reflect"),u=e("can-query-logic/src/types/basic-query"),l=e("can-query-logic/src/set"),s=e("can-query-logic/src/serializers/comparisons"),f=e("can-query-logic/src/serializer"),d=e("can-query-logic/src/types/comparisons"),i=e("can-query-logic/src/types/make-maybe"),p=e("can-query-logic/src/types/make-enum"),h=e("can-log/dev/dev"),v=e("can-query-logic/src/helpers"),o=r.for("can.SetType"),g=r.for("can.getSchema"),y=new u({});function m(e,t,n){return e&&"object"==typeof e&&"$or"in e?function(e,t,n){var r=e.map(function(e){return _(e,t,n)}),a=function(e){var t=Object.keys(e[0].values),n={},r=new d.In(t);if(t.map(function(e){n[e]=[]}),!e.every(function(e){return!!l.isEqual(r,new d.In(Object.keys(e.values)))&&(c.eachKey(e.values,function(e,t){n[t].push(e)}),!0)}))return;var a=[];if(t.forEach(function(e){n[e].reduce(function(e,t){return!1!==t&&(void 0===t?e:!!l.isEqual(e,t)&&e)})||a.push(e)}),1!==a.length)return;var i=a[0],o=n[i].reduce(function(e,t){return l.union(e,t)},l.EMPTY),s={};return t.map(function(e){s[e]=n[e][0]}),s[i]=o,new u.KeysAnd(s)}(r);if(a)return a;return new u.Or(r)}(e.$or,t,n):_(e,t,n)}var b=new WeakMap;function w(e,t,n,r){if(n){var a=n[o];return a?a.hydrate?a.hydrate(e,s.hydrate):l.hasComparisons(a)?new a(e):s.hydrate(e,function(e){return new a(e)}):p.canMakeEnumSetType(n)?(b.has(n)||b.set(n,p.makeEnumSetType(n)),new(a=b.get(n))(e)):i.canMakeMaybeSetType(n)?(b.has(n)||b.set(n,i.makeMaybeSetTypes(n)),(a=b.get(n).Maybe).hydrate(e,s.hydrate)):s.hydrate(e,r)}return s.hydrate(e,r)}function _(e,n,r){function a(e){if(e){if(Array.isArray(e))return e.map(r);if(c.isPlainObject(e))return _(e,(t=e.constructor)&&t[g]&&t[g]().keys||{})}var t;return r?r(e):e}n=n||{};var i={};return c.eachKey(e,function(e,t){i[t]=w(e,0,n[t],a)}),new u.KeysAnd(i)}n.exports=function(e){var a=e.identity&&e.identity[0],i=e.keys,t=[[u.Or,function(e,t){return e.values.map(function(e){return t(e)})}],[u.KeysAnd,function(e,n){var r=[],a={};return c.eachKey(e.values,function(e,t){"function"==typeof e.orValues?function n(r,e,a,i){e.orValues().forEach(function(e){if("function"==typeof e.orValues)n(r,e,a,i);else{var t={};t[i]=a(e),r.push(t)}})}(r,e,n,t):a[t]=n(e)}),r.length?1===r.length?r[0]:{$or:r.map(function(e){return c.assign(c.serialize(a),e)})}:a}],[u.RecordRange,function(e){return{start:e.start,end:e.end}}],[u,function(e,t){var n=l.isEqual(e.filter,l.UNIVERSAL)?{}:t(e.filter),r={};return 0!==c.size(n)&&(r.filter=n),l.isEqual(e.page,y.page)||(r.page={start:e.page.start},e.page.end!==y.page.end&&(r.page.end=e.page.end)),e.sort.key!==a&&(r.sort=e.sort.key),r}]],o=u.makeSort(i,w),n=new f(t);return n.add(s.serializer),{hydrate:function(e){if("production"!==process.env.NODE_ENV){var t=p(function(){},["filter","sort","page"]),n=l.difference(new t(Object.keys(e)),t.UNIVERSAL);n.values&&n.values.length&&h.warn("can-query-logic: Ignoring keys: "+n.values.join(", ")+".")}var r={filter:m(c.serialize(e.filter),i,v.valueHydrator)};return e.page&&(r.page=new u.RecordRange(e.page.start,e.page.end)),e.sort?r.sort=new o(e.sort):r.sort=new o(a),new u(r)},serializer:n}}}),define("can-query-logic",["require","exports","module","can-query-logic/src/set","can-symbol","can-reflect","can-query-logic/src/serializers/basic-query","can-query-logic/src/types/basic-query","can-query-logic/src/types/comparisons","can-query-logic/src/types/make-enum"],function(e,t,n){var o=e("can-query-logic/src/set"),r=e("can-symbol"),s=e("can-reflect"),c=e("can-query-logic/src/serializers/basic-query"),a=e("can-query-logic/src/types/basic-query"),i=e("can-query-logic/src/types/comparisons"),u=r.for("can.getSchema"),l=r.for("can.new"),f=e("can-query-logic/src/types/make-enum");function d(e,t){e=e||{};var n,r=t&&t.toQuery,a=t&&t.toParams;(n=e[u]?e[u]():e).identity&&n.identity[0]||(n.identity=["id"]);var i,o,s=c(n);i=r?function(e){return s.hydrate(r(e))}:s.hydrate,o=a?function(e){return a(s.serializer.serialize(e))}:s.serializer.serialize,this.hydrate=i,this.serialize=o,this.schema=n}function p(i){return function(e,t){var n=this.hydrate(e),r=this.hydrate(t),a=o[i](n,r);return this.serialize(a)}}function h(a){return function(e,t){var n=this.hydrate(e),r=this.hydrate(t);return o[a](n,r)}}for(var v in s.assignSymbols(d.prototype,{"can.getSchema":function(){return this.schema}}),s.assign(d.prototype,{union:p("union"),difference:p("difference"),intersection:p("intersection"),isEqual:h("isEqual"),isProperSubset:h("isProperSubset"),isSubset:h("isSubset"),isSpecial:o.isSpecial,isDefinedAndHasMembers:o.isDefinedAndHasMembers,count:function(e){var t=this.hydrate(e);return t.page.end-t.page.start+1},identityKeys:function(){return this.schema.identity},filterMembers:function(e,t,n){var r=this.hydrate(e);if(3<=arguments.length){var a=this.hydrate(t);return r.filterFrom(n,a)}return r.filterFrom(t)},filterMembersAndGetCount:function(e,t,n){var r=this.hydrate(e),a=this.hydrate(t);return r.filterMembersAndGetCount(n,a)},unionMembers:function(e,t,n,r){var a=this.hydrate(e),i=this.hydrate(t),o=this.schema;return a.merge(i,n,r,function(e){return s.getIdentity(e,o)})},isMember:function(e,t){return this.hydrate(e).isMember(t)},memberIdentity:function(e){return s.getIdentity(e,this.schema)},index:function(e,t,n){return this.hydrate(e).index(n,t)},insert:function(e,t,n){var r=this.index(e,t,n);void 0===r&&(r=t.length);var a=t.slice(0);return a.splice(r,0,n),a},isPaginated:function(e){var t=this.hydrate(e);return!o.isEqual(t.page,o.UNIVERSAL)},removePagination:function(e){var t=this.hydrate(e);return t.removePagination(),this.serialize(t)}}),o)void 0===d[v]&&(d[v]=o[v]);d.makeEnum=function(e){var t=function(){};return t[l]=function(e){return e},f(t,e),t},d.KeysAnd=a.KeysAnd,d.ValuesOr=a.Or,d.In=i.In,d.NotIn=i.NotIn,d.GreaterThan=i.GreaterThan,d.GreaterThanEqual=i.GreaterThanEqual,d.LessThan=i.LessThan,d.LessThanEqual=i.LessThanEqual,d.ValueAnd=i.And,d.ValueOr=i.Or,n.exports=d}),define("can-fixture/matches",["require","exports","module","can-query-logic/src/set","can-reflect","can-fixture/data-from-url","can-query-logic"],function(e,t,n){var o=e("can-query-logic/src/set"),s=e("can-reflect"),r=e("can-fixture/data-from-url"),c=e("can-query-logic");function u(e){if(e.fixture||e.xhr||e.data){var t=s.serialize(e);return delete t.fixture,delete t.xhr,delete t.data,t}return e}var a={intersection:function(e,t){return e.value===t.value?e:o.EMPTY},difference:function(e,t){return e.value===t.value?o.EMPTY:e},union:function(e,t){return e.value===t.value?e:o.UNDEFINABLE}};function i(r){var e=function(){},t=function(e){this.value=e};return t.prototype.isMember=function(e,t,n){return r(this.value,e,t,n)},s.assignSymbols(e,{"can.SetType":t}),o.defineComparison(t,t,a),o.defineComparison(o.UNIVERSAL,t,{difference:function(){return o.UNDEFINABLE}}),e}function l(e,t){var n=e.data,r=t.data;if(n&&r&&!function n(e,r){if(e===r)return!0;if(Array.isArray(e)&&Array.isArray(r))return e.every(function(e,t){return n(e,r[t])});if(e&&r&&s.isPlainObject(e)&&s.isPlainObject(r)){for(var t in e){if(!r.hasOwnProperty(t))return!1;if(!n(e[t],r[t]))return!1}return!0}return!1}(n,r))return!1;var a=new c.KeysAnd(u(e)),i=new c.KeysAnd(u(t));return o.isEqual(a,i)}var f={};s.eachKey({IsEmptyOrNull:function(e,t){return null==e&&0===s.size(t)||(null==t&&0===s.size(e)||l(e,t))},isEmptyOrSubset:function(e,t){return null==e&&0===s.size(t)||(null==t&&0===s.size(e)||(n=e,r=t,o.isSubset(new c.KeysAnd(n),new c.KeysAnd(r))));var n,r},TemplateUrl:function(e,t){return!!r(e,t)},StringIgnoreCase:function(e,t){return t&&e?e.toLowerCase()===t.toLowerCase():t===e},Ignore:function(){return!0}},function(e,t){f[t]=i(e)});var d={identity:["id"],keys:{url:f.TemplateUrl,fixture:f.Ignore,xhr:f.Ignore,type:f.StringIgnoreCase,method:f.StringIgnoreCase,helpers:f.Ignore,headers:f.IsEmptyOrNull,data:f.IsEmptyOrSubset}},p=new c(d);n.exports={fixture:l,request:function(e,t){return p.isMember({filter:t},e)},matches:function(e,t,n){return n?this.fixture(e,t):this.request(e,t)},makeComparatorType:i}}),define("can-memory-store/make-simple-store",["require","exports","module","can-reflect"],function(e,t,n){var y=e("can-reflect");n.exports=function e(t){t.constructor=e;var n=Object.create(t);return y.assignMap(n,{getRecordFromParams:function(e){var t=y.getIdentity(e,this.queryLogic.schema);return this.getRecord(t)},log:function(){this._log=!0},getSets:function(){return this.getQueries()},getQueries:function(){return Promise.resolve(this.getQueriesSync())},getQueriesSync:function(){return this.getQueryDataSync().map(function(e){return e.query})},getListData:function(e){e=e||{};var t=this.getListDataSync(e);return t?Promise.resolve(t):Promise.reject({title:"no data",status:"404",detail:"No data available for this query.\nAvailable queries: "+JSON.stringify(this.getQueriesSync())})},getPaginatedListDataSync:function(e){var t=this.getAllRecords(),n=this.queryLogic.removePagination(e.query),r=this.queryLogic.filterMembersAndGetCount(n,{},t),a=function(e,t,n){for(var r=y.getSchema(n),a=0;a<e.length;a++)if(t===y.getIdentity(e[a],r))return a;return-1}(r.data,e.startIdentity,this.queryLogic),i=r.data.slice(a,a+this.queryLogic.count(e.query));return{count:r.data.length,data:i}},getListDataSync:function(e){for(var t,n=this.getQueryDataSync(),r=this.queryLogic.isPaginated(e),a=0;a<n.length;a++){var i=n[a].query;this.queryLogic.isSubset(e,i)&&(t=n[a])}var o=this.getAllRecords();if(r&&this.queryLogic.isPaginated(t.query)){var s=this.getPaginatedListDataSync(t);return this.queryLogic.filterMembersAndGetCount(e,t.query,s.data)}var c=this.queryLogic.filterMembersAndGetCount(e,{},o);return c&&c.count?c:t?{count:0,data:[]}:void 0},updateListData:function(e,t){var n=this.getQueryDataSync();t=t||{};var r,a=y.serialize(e),i=(r=a,Array.isArray(r)?r:r.data);this.updateRecordsSync(i);var o=this.queryLogic.isPaginated(t),s=i.length?y.getIdentity(i[0],this.queryLogic.schema):void 0;if(o){for(var c=0;c<n.length;c++){var u=n[c].query,l=this.queryLogic.union(u,t);if(this.queryLogic.isDefinedAndHasMembers(l)){var f=this.getPaginatedListDataSync(n[c]),d=this.queryLogic.unionMembers(u,t,f.data,i);return s=y.getIdentity(d[0],this.queryLogic.schema),n[c]={query:l,startIdentity:s},this.updateQueryDataSync(n),Promise.resolve()}}return n.push({query:t,startIdentity:s}),this.updateQueryDataSync(n),Promise.resolve()}var p=this.getAllRecords(),h=this.queryLogic.filterMembers(t,p);if(h.length){var v=new Map;h.forEach(function(e){v.set(y.getIdentity(e,this.queryLogic.schema),e)},this),i.forEach(function(e){v.delete(y.getIdentity(e,this.queryLogic.schema))},this),this.destroyRecords(y.toArray(v))}var g=this.getQueryDataSync().filter(function(e){return!this.queryLogic.isSubset(e.query,t)},this);return g.filter(function(e){return this.queryLogic.isSubset(t,e.query)},this).length?this.updateQueryDataSync(g):this.updateQueryDataSync(g.concat([{query:t,startIdentity:s}])),Promise.resolve()},getData:function(e){var t=y.getIdentity(e,y.getSchema(this.queryLogic)),n=this.getRecord(t);return n?Promise.resolve(n):Promise.reject({title:"no data",status:"404",detail:"No record with matching identity ("+t+")."})},createData:function(e){return this.updateRecordsSync([e]),Promise.resolve(y.assignMap({},this.getRecordFromParams(e)))},updateData:function(e){if(!this.errorOnMissingRecord||this.getRecordFromParams(e))return this.updateRecordsSync([e]),Promise.resolve(y.assignMap({},this.getRecordFromParams(e)));var t=y.getIdentity(e,this.queryLogic.schema);return Promise.reject({title:"no data",status:"404",detail:"No record with matching identity ("+t+")."})},destroyData:function(e){var t=y.getIdentity(e,this.queryLogic.schema),n=this.getRecordFromParams(e);return this.errorOnMissingRecord&&!n?Promise.reject({title:"no data",status:"404",detail:"No record with matching identity ("+t+")."}):(this.destroyRecords([e]),Promise.resolve(y.assignMap({},n||e)))}})}}),define("can-memory-store",["require","exports","module","can-reflect","can-namespace","can-memory-store/make-simple-store"],function(e,t,n){var r=e("can-reflect"),a=e("can-namespace"),i=e("can-memory-store/make-simple-store");n.exports=a.memoryStore=function e(t){t.constructor=e;var n=Object.create(i(t));return r.assignMap(n,{clear:function(){this._instances={},this._queries=[]},_queryData:[],updateQueryDataSync:function(e){this._queryData=e},getQueryDataSync:function(){return this._queryData},_instances:{},getRecord:function(e){return this._instances[e]},getAllRecords:function(){var e=[];for(var t in this._instances)e.push(this._instances[t]);return e},destroyRecords:function(e){r.eachIndex(e,function(e){var t=r.getIdentity(e,this.queryLogic.schema);delete this._instances[t]},this)},updateRecordsSync:function(e){e.forEach(function(e){var t=r.getIdentity(e,this.queryLogic.schema);this._instances[t]=e},this)}}),n}}),define("can-fixture/store",["require","exports","module","can-query-logic","can-reflect","can-memory-store"],function(e,t,n){var r=e("can-query-logic"),i=e("can-reflect"),s=e("can-memory-store"),a=function(n,r){return function(e,t){this.connection[n](r.call(this,e.data)).then(function(e){t(e)},function(e){t(parseInt(e.status,10),e)})}},c=function(e,r){return function(){var t=[],n=0;return e.forEach(function(e){t.push(i.serialize(e)),n=Math.max(e[r],n)}),{maxId:n,items:t}}},u=function(e,t,n){var r=e.queryLogic.schema,a=r.identity[0],i=r.keys;for(var o in i&&i[a]||console.warn("No type specified for identity key. Going to convert strings to reasonable type."),this.connection=e,this.makeItems=t,this.idProp=n,this.reset(),u.prototype)this[o]=this[o].bind(this)};function o(e){var t=this.connection.queryLogic.schema,n=t.identity[0],r=t.keys;r&&r[n]||((r={})[n]=function(e){return"string"==typeof e?function(e){switch(e){case"NaN":case"Infinity":return+e;case"null":return null;case"undefined":return;case"true":case"false":return"true"===e;default:var t=+e;return isNaN(t)?e:t}}(e):e});var a={};return i.eachKey(e,function(e,t){r[t]?a[t]=i.convert(e,r[t]):a[t]=e}),a}function l(e){return e&&"identityKeys"in e}i.assignMap(u.prototype,{getListData:a("getListData",function(e){return e}),getData:a("getData",o),createData:function(e,t){var n=this.idProp;e.data[n]=++this.maxId,this.connection.createData(o.call(this,e.data)).then(function(e){t(e)},function(e){t(403,e)})},createInstance:function(e){var t=this.idProp;return t in e||(e[t]=++this.maxId),this.connection.createData(e)},updateData:a("updateData",o),updateInstance:function(e){return this.connection.updateData(e)},destroyInstance:function(e){return this.connection.destroyData(e)},destroyData:a("destroyData",o),reset:function(e){e&&(this.makeItems=c(e,this.idProp));var t=this.makeItems();this.maxId=t.maxId,this.connection.updateListData(t.items,{})},get:function(e){var t=this.connection.queryLogic.memberIdentity(e);return this.connection.getRecord(t)},getList:function(e){return this.connection.getListDataSync(e)}}),u.make=function(a,i,e){var t,o;"number"==typeof a?(e?l(e)||(e=new r(e)):e=new r({}),o=e.identityKeys()[0]||"id",t=function(){for(var e=[],t=0,n=0;n<a;n++){var r=i(n,e);r[o]||(r[o]=n),t=Math.max(r[o],t),e.push(r)}return{maxId:t,items:e}}):Array.isArray(a)&&((e=i)?l(e)||(e=new r(e)):e=new r({}),o=e.identityKeys()[0]||"id",t=c(a,o));var n=s({queryLogic:e,errorOnMissingRecord:!0});return new u(n,t,o)},n.exports=u}),define("can-fixture/core",["require","exports","module","can-key/sub/sub","can-reflect","can-fixture/matches","can-log","can-log/dev/dev","can-fixture/data-from-url","can-fixture/store"],function(e,o,t){"use strict";var s=e("can-key/sub/sub"),c=e("can-reflect"),r=e("can-fixture/matches"),u=e("can-log"),w=e("can-log/dev/dev"),l=e("can-fixture/data-from-url");e("can-fixture/store");var f=[];o.fixtures=f;var _={item:{GET:"getData",PUT:"updateData",DELETE:"destroyData"},list:{GET:"getListData",POST:"createData"}};function x(e){var t=e.match(/(GET|POST|PUT|DELETE|PATCH) (.+)/i);return t?[t[1],t[2]]:[void 0,e]}function d(e,t){var n={},r=x(e),a=r[0],i=function(e,t){if(!(t=t||function(e){var t=e.match(/\{(.*)\}/);if(t&&2===t.length)return t[1]}(e)))return[void 0,e];var n=new RegExp("\\/\\{"+t+"\\}.*"),r=n.test(e),a=r?e.replace(n,""):e;return[r?e:e.trim()+"/{"+t+"}",a]}(r[1],t.idProp),o=i[0],s=i[1];if(a){var c=['fixture("'+e+'", fixture) must use a store method, not a store directly.'];if(o){var u=_.item[a];if(u){n[a+" "+o]=t[u];var l='Replace with fixture("'+a+" "+o+'", fixture.'+u+") for items.";c.push(l)}}var f=_.list[a];if(f){n[a+" "+s]=t[f];var d='Replace with fixture("'+a+" "+s+'", fixture.'+f+") for lists.";c.push(d)}var p=c.join(" ");w.warn(p)}else{var h=_.item;for(var v in h){var g=h[v];n[v+" "+o]=t[g]}var y=_.list;for(var m in y){var b=y[m];n[m+" "+s]=t[b]}}return n}o.add=function(e,t){if(void 0!==t){if((n=t)&&(n.getData||n.getListData))return e=d(e,t),void o.add(e);var n,r,a,i;"string"==typeof e&&(r=x(e),a=r[0],i=r[1],e=a?{type:a,url:i}:{url:i}),function(e,t,n){var r=o.index(t,!0);if(-1<r&&f.splice(r,1),null!=n){if("object"==typeof n){var a=n;n=function(){return a}}t.fixture=n,f.unshift(t)}}(0,e,t)}else c.eachKey(e,function(e,t){o.add(t,e)})};var p=o.add;function h(e,t){this.statusCode=t[0],this.responseBody=t[1],this.headers=t[2],this.statusText=t[3],this.fixture=e}p.on=!0,p.delay=10,o.callDynamicFixture=function(t,n,r){if(t.data=n.data,"production"!==process.env.NODE_ENV){var e=JSON.stringify(t.data);u.log(t.type.toUpperCase()+" "+t.url+" "+e.substr(0,50)+" -> handler(req,res)")}var a=function(){var e=o.extractResponse.apply(t,arguments);return u.log("can-fixture: "+t.type.toUpperCase()+" "+t.url+" ",t.data," => ",new h(n.fixture,e)),r.apply(this,e)},i=function(){var e=n.fixture(t,a,t.headers,n);void 0!==e&&a(200,e)};return t.async?setTimeout(i,p.delay):(i(),null)},o.index=function(e,t){for(var n=0;n<f.length;n++)if(r.matches(e,f[n],t))return n;return-1},o.get=function(e){if(p.on){var t=o.index(e,!0);-1===t&&(t=o.index(e,!1));var n=0<=t?c.assignMap({},f[t]):void 0;if(n){var r=n.fixture,a=l(n.url,e.url);if("string"==typeof n.fixture)a&&(r=s(r,a)),n.url=r,n.data=null,n.type="GET",n.error||(n.error=function(e,t,n){throw"fixtures.js Error "+t+" "+n});else if(c.isPlainObject(e.data)||null==e.data){var i=c.assignMap({},e.data||{});n.data=c.assignMap(i,a)}else n.data=e.data}return n}},o.matches=r,o.extractResponse=function(e,t,n,r){return"number"!=typeof e&&(n=t,t=e,e=200),"string"==typeof n&&(r=n,n={}),[e,t,n,r]}}),define("can-fixture/xhr",["require","exports","module","can-fixture/core","can-deparam","can-reflect","can-log"],function(e,t,n){!function(e,t,n,r){"use strict";var o=t("can-fixture/core"),s=t("can-deparam"),c=t("can-reflect"),u=t("can-log"),a=XMLHttpRequest,i=void 0!==e?e:window,l=["type","url","async","response","responseText","responseType","responseXML","responseURL","status","statusText","readyState"],f=["abort","error","load","loadend","loadstart","progress","readystatechange"];function d(e,t){for(var n=e.__events[t]||[],r=0,a=n.length;r<a;r++)n[r].call(e)}function p(e,t,n){Object.defineProperty(e,t,{enumerable:!1,configurable:!0,writable:!0,value:n})}!function(){var e=new a;for(var t in e)0===t.indexOf("on")?-1===f.indexOf(t.substr(2))&&f.push(t.substr(2)):-1===l.indexOf(t)&&"function"!=typeof e[t]&&l.push(t)}(),i.XMLHttpRequest=function(){var t=this,n=new a;p(this,"_xhr",n),p(this,"_requestHeaders",{}),p(this,"__events",{}),f.forEach(function(e){n["on"+e]=function(){if(d(t,e),t["on"+e])return t["on"+e].apply(t,arguments)}}),this.onload=null},i.XMLHttpRequest._XHR=a,c.assignMap(XMLHttpRequest.prototype,{setRequestHeader:function(e,t){this._requestHeaders[e]=t},open:function(e,t,n){this.type=e,this.url=t,this.async=!1!==n},getAllResponseHeaders:function(){return this._xhr.getAllResponseHeaders.apply(this._xhr,arguments)},addEventListener:function(e,t){(this.__events[e]=this.__events[e]||[]).push(t)},removeEventListener:function(e,t){var n=this.__events[e]=this.__events[e]||[],r=n.indexOf(t);0<=r&&n.splice(r,1)},setDisableHeaderCheck:function(e){this._disableHeaderCheck=!!e},getResponseHeader:function(e){return this._xhr.getResponseHeader(e)},abort:function(){var e=this._xhr;return void 0!==this.timeoutId&&(clearTimeout(this.timeoutId),e.open(this.type,this.url,!1!==this.async),e.send()),e.abort()},send:function(e){var t=this.type.toLowerCase()||"get",n={url:this.url,data:e,headers:this._requestHeaders,type:t,method:t,async:this.async,xhr:this};if((!n.data&&"get"===n.type||"delete"===n.type)&&(n.data=s(n.url.split("?")[1]),n.url=n.url.split("?")[0]),"string"==typeof n.data)try{n.data=JSON.parse(n.data)}catch(e){n.data=s(n.data)}var r=o.get(n),a=this;if(!r||"function"!=typeof r.fixture){var i=function(){return a._xhr.open(a._xhr.type,a._xhr.url,a._xhr.async),a._requestHeaders&&Object.keys(a._requestHeaders).forEach(function(e){a._xhr.setRequestHeader(e,a._requestHeaders[e])}),a._xhr.send(e)};return r&&"number"==typeof r.fixture?(u.log("can-fixture: "+n.url+" => delay "+r.fixture+"ms"),void(this.timeoutId=setTimeout(i,r.fixture))):(r&&(u.log("can-fixture: "+n.url+" => "+r.url),c.assignMap(a,r)),i())}this.timeoutId=o.callDynamicFixture(n,r,function(e,t,r,n){t="string"==typeof t?t:JSON.stringify(t),a._xhr={open:function(){},send:function(){},abort:function(){},getResponseHeader:function(){}},c.assignMap(a,{readyState:4,status:e}),200<=e&&e<300||304===e?c.assignMap(a,{statusText:n||"OK",responseText:t}):c.assignMap(a,{statusText:n||"error",responseText:t}),a.getAllResponseHeaders=function(){var n=[];return c.eachKey(r||{},function(e,t){Array.prototype.push.apply(n,[t,": ",e,"\r\n"])}),n.join("")},a.onreadystatechange&&a.onreadystatechange({target:a}),d(a,"progress"),a.onprogress&&a.onprogress(),d(a,"load"),a.onload&&a.onload(),d(a,"loadend"),a.onloadend&&a.onloadend()})}}),l.forEach(function(t){Object.defineProperty(XMLHttpRequest.prototype,t,{get:function(){return this._xhr[t]},set:function(e){try{this._xhr[t]=e}catch(e){}}})})}(function(){return this}(),e)}),define("can-fixture",["require","exports","module","can-fixture/core","can-fixture/store","can-fixture/xhr","can-reflect","can-namespace"],function(e,t,n){"use strict";var r=e("can-fixture/core"),a=r.add,i=e("can-fixture/store");e("can-fixture/xhr");var o=e("can-reflect"),s=e("can-namespace"),c=function(){};o.assignMap(a,{rand:function e(t,n,r){if("number"==typeof t)return"number"==typeof n?t+Math.floor(Math.random()*(n-t+1)):Math.floor(Math.random()*(t+1));var a=t.slice(0);void 0===n?(n=1,r=a.length):void 0===r&&(r=n);for(var i=[],o=n+Math.round(e(r-n)),s=0;s<o;s++){var c=e(a.length-1),u=a.splice(c,1)[0];i.push(u)}return i},xhr:function(e){return o.assignMap({},{abort:c,getAllResponseHeaders:function(){return""},getResponseHeader:function(){return""},open:c,overrideMimeType:c,readyState:4,responseText:"",responseXML:null,send:c,setRequestHeader:c,status:200,statusText:"OK"},e)},store:i.make,fixtures:r.fixtures}),"undefined"!=typeof window&&"function"!=typeof e.resolve&&(window.fixture=a),n.exports=s.fixture=a}),define("can/es/can-fixture",["exports","can-fixture"],function(e,t){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"default",{enumerable:!0,get:function(){return(e=t,e&&e.__esModule?e:{default:e}).default;var e}})}),define("can/es/can-query-logic",["exports","can-query-logic"],function(e,t){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"default",{enumerable:!0,get:function(){return(e=t,e&&e.__esModule?e:{default:e}).default;var e}})}),define("can-connect/behavior",function(e,t,n){"use strict";var r={};function a(i,o){"string"!=typeof i&&(o=i,i=void 0);var e=function(e){var t=function(){};Object.defineProperty(t,"name",{value:i,configurable:!0}),t.prototype=e;var n=new t,r="function"==typeof o?o.apply(n,arguments):o;for(var a in r)r.hasOwnProperty(a)?Object.defineProperty(n,a,Object.getOwnPropertyDescriptor(r,a)):n[a]=r[a];return n.__behaviorName=i,n};return i&&(r[e.behaviorName=i]=e),e.isBehavior=!0,e}a.map=r,n.exports=a}),define("can-connect/connect",["require","exports","module","can-reflect","can-connect/behavior"],function(e,t,n){e("can-reflect").assignMap;var r=e("can-connect/behavior"),a=function(e,t){(e=e.map(function(e,t){var n=-1;return"string"==typeof e?(n=a.order.indexOf(e),e=e.map[e]):e.isBehavior?n=a.order.indexOf(e.behaviorName):e=a.behavior(e),{originalIndex:t,sortedIndex:n,behavior:e}})).sort(function(e,t){return~e.sortedIndex&&~t.sortedIndex?e.sortedIndex-t.sortedIndex:e.originalIndex-t.originalIndex}),e=e.map(function(e){return e.behavior});var n=a.base(a.behavior("options",function(){return t})());return e.forEach(function(e){n=e(n)}),n.init&&n.init(),n};a.order=["data/localstorage-cache","data/url","data/parse","cache-requests","data/combine-requests","constructor","constructor/store","can/map","can/ref","fall-through-cache","data/worker","real-time","data/callbacks-cache","data/callbacks","constructor/callbacks-once"],a.behavior=r,n.exports=a}),define("can-connect/base/base",["require","exports","module","can-connect/behavior","can-reflect","can-symbol"],function(e,t,n){"use strict";var r=e("can-connect/behavior"),a=e("can-reflect"),i=e("can-symbol");n.exports=r("base",function(e){var t;return{id:function(e){if(this.queryLogic)return a.getIdentity(e,this.queryLogic.schema);if(this.idProp)return e[this.idProp];throw new Error("can-connect/base/base - Please add a queryLogic option.")},listQuery:function(e){return e[this.listQueryProp]},listQueryProp:i.for("can.listQuery"),init:function(){},get queryLogic(){return t||(e.queryLogic?e.queryLogic:e.algebra?e.algebra:void 0)},set queryLogic(e){t=e}}})}),define("can-connect",["require","exports","module","can-connect/connect","can-connect/base/base","can-namespace"],function(e,t,n){"use strict";var r=e("can-connect/connect"),a=e("can-connect/base/base"),i=e("can-namespace");r.base=a,n.exports=i.connect=r}),define("can-connect/helpers/weak-reference-map",["require","exports","module","can-reflect"],function(e,t,n){"use strict";var r=function(){this.set={}};(0,e("can-reflect").assignMap)(r.prototype,{has:function(e){return!!this.set[e]},addReference:function(e,t,n){if(void 0===e)throw new Error("can-connect: You must provide a key to store a value in a WeakReferenceMap");var r=this.set[e];r||(r=this.set[e]={item:t,referenceCount:0,key:e}),r.referenceCount+=n||1},referenceCount:function(e){var t=this.set[e];if(t)return t.referenceCount},deleteReference:function(e){var t=this.set[e];t&&(t.referenceCount--,0===t.referenceCount&&delete this.set[e])},get:function(e){var t=this.set[e];if(t)return t.item},forEach:function(e){for(var t in this.set)e(this.set[t].item,t)}}),n.exports=r}),define("can-diff/update-deep-except-identity/update-deep-except-identity",["require","exports","module","can-reflect"],function(e,t,n){"use strict";var a=e("can-reflect");n.exports=function(n,r,e){if(e||(e=a.getSchema(n)),!e)throw new Error("can-diff/update-except-id is unable to update without a schema.");e.identity.forEach(function(e){var t=a.getKeyValue(n,e);void 0!==t&&a.setKeyValue(r,e,t)}),a.updateDeep(n,r)}}),define("can-connect/helpers/id-merge",["require","exports","module","can-diff/list/list","can-reflect"],function(e,t,n){"use strict";var a=e("can-diff/list/list"),i=e("can-reflect");n.exports=function(t,e,n,r){a(t,e,function(e,t){return n(e)===n(t)}).forEach(function(e){i.splice(t,e.index,e.deleteCount,e.insert.map(r))})}}),define("can-connect/constructor/constructor",["require","exports","module","can-reflect","can-connect/helpers/weak-reference-map","can-diff/update-deep-except-identity/update-deep-except-identity","can-connect/helpers/id-merge","can-connect/behavior"],function(e,t,n){"use strict";var r=e("can-reflect"),a=r.toArray,i=r.assignMap,o=e("can-connect/helpers/weak-reference-map"),s=e("can-diff/update-deep-except-identity/update-deep-except-identity"),c=e("can-connect/helpers/id-merge"),u=e("can-connect/behavior");function l(e,t){for(var n in e)"data"!==n&&("function"==typeof t.set?t.set(n,e[n]):"function"==typeof t.attr?t.attr(n,e[n]):t[n]=e[n])}n.exports=u("constructor",function(e){return{cidStore:new o,_cid:0,get:function(e){var t=this;return this.getData(e).then(function(e){return t.hydrateInstance(e)})},getList:function(t){t=t||{};var n=this;return this.getListData(t).then(function(e){return n.hydrateList(e,t)})},hydrateList:function(e,t){Array.isArray(e)&&(e={data:e});for(var n=[],r=0;r<e.data.length;r++)n.push(this.hydrateInstance(e.data[r]));if(e.data=n,this.list)return this.list(e,t);var a=e.data.slice(0);return a[this.listQueryProp||"__listQuery"]=t,l(e,a),a},hydrateInstance:function(e){return this.instance?this.instance(e):i({},e)},save:function(t){var e=this.serializeInstance(t),n=this.id(t),r=this;if(void 0!==n)return this.updateData(e).then(function(e){return void 0!==e&&r.updatedInstance(t,e),t});var a=this._cid++;return this.cidStore.addReference(a,t),this.createData(e,a).then(function(e){return void 0!==e&&r.createdInstance(t,e),r.cidStore.deleteReference(a,t),t})},destroy:function(t){var e=this.serializeInstance(t),n=this;return this.destroyData(e).then(function(e){return void 0!==e&&n.destroyedInstance(t,e),t})},createdInstance:function(e,t){i(e,t)},updatedInstance:function(e,t){s(e,t,this.queryLogic.schema)},updatedList:function(e,t,n){for(var r=[],a=0;a<t.data.length;a++)r.push(this.hydrateInstance(t.data[a]));c(e,r,this.id.bind(this),this.hydrateInstance.bind(this)),l(t,e)},destroyedInstance:function(e,t){s(e,t,this.queryLogic.schema)},serializeInstance:function(e){return i({},e)},serializeList:function(e){var t=this;return a(e).map(function(e){return t.serializeInstance(e)})},isNew:function(e){var t=this.id(e);return!(t||0===t)}}})}),define("can-diff/assign-deep-except-identity/assign-deep-except-identity",["require","exports","module","can-reflect"],function(e,t,n){"use strict";var a=e("can-reflect");n.exports=function(n,r,e){if(e||(e=a.getSchema(n)),!e)throw new Error("can-diff/update-except-id is unable to update without a schema.");e.identity.forEach(function(e){var t=a.getKeyValue(n,e);void 0!==t&&a.setKeyValue(r,e,t)}),a.assignDeep(n,r)}}),define("can-validate-interface",function(e,t,n){"use strict";n.exports=function(e){var t=e.reduce(function(e,t){return e.concat(t)},[]);return function(n){var e=t.reduce(function(e,t){return t in n?e:e.concat(t)},[]);return e.length?{message:"missing expected properties",related:e}:void 0}}}),define("can-connect/helpers/validate",["require","exports","module","can-validate-interface"],function(e,t,n){"use strict";var s=e("can-validate-interface");function c(e,t,n){var r='can-connect: Extending behavior "'+(t.behaviorName||"anonymous behavior")+'" found base behavior "'+(e.__behaviorName||"anonymous behavior")+'" was missing required properties: '+JSON.stringify(n.related),a=new Error(r);return Object.setPrototypeOf&&Object.setPrototypeOf(a,Object.getPrototypeOf(this)),a}n.exports=function(n,e){var t,r,a,i,o=(t=n,r=0,a=e,i=function(e,t){throw new c(t,n,e)},function(){var e=s(a)(arguments[r]);return e&&i&&i(e,arguments[r]),t.apply(this,arguments)});return Object.keys(n).forEach(function(e){o[e]=n[e]}),o.__interfaces=e,o},c.prototype=Object.create(Error.prototype,{constructor:{value:Error}}),Object.setPrototypeOf?Object.setPrototypeOf(c,Error):c.__proto__=Error}),define("can-connect/can/map/map",["require","exports","module","can-reflect","can-queues","can-event-queue/map/map","can-observation-recorder","can-symbol","can-query-logic","can-log/dev/dev","can-connect/behavior","can-diff/update-deep-except-identity/update-deep-except-identity","can-diff/assign-deep-except-identity/assign-deep-except-identity","can-diff/merge-deep/merge-deep","can-symbol","can-connect/helpers/validate"],function(e,t,n){"use strict";var i=e("can-reflect"),r=i.each,a=i.isPlainObject,o=e("can-queues"),s=e("can-event-queue/map/map"),c=(e("can-observation-recorder"),e("can-symbol")),u=e("can-query-logic"),l=e("can-log/dev/dev"),f=e("can-connect/behavior"),d=e("can-diff/update-deep-except-identity/update-deep-except-identity"),p=e("can-diff/assign-deep-except-identity/assign-deep-except-identity"),h=e("can-diff/merge-deep/merge-deep"),v=(c=e("can-symbol")).for("can.getName");var g=f("can/map",function(a){var e={init:function(){if(!this.Map)throw new Error("can-connect/can/map/map must be configured with a Map type");if(this[v]||(this[v]=function(){return this.name?"Connection{"+this.name+"}":this.Map?"Connection{"+i.getName(this.Map)+"}":"string"==typeof this.url?"Connection{"+this.url+"}":"Connection{}"}),this.List=this.List||this.Map.List,!this.List)throw new Error("can-connect/can/map/map - "+i.getName(this)+" must be configured with a List type.");b(this,this.Map,y),b(this,this.List,m),this.queryLogic||(this.queryLogic=new u(this.Map));var r=this;if(this.Map[c.for("can.onInstanceBoundChange")]){var e=function(e,t){var n=t?"addInstanceReference":"deleteInstanceReference";r[n]&&r[n](e)};Object.defineProperty(e,"name",{value:i.getName(this.Map)+" boundChange",configurable:!0}),this.Map[c.for("can.onInstanceBoundChange")](e)}else console.warn("can-connect/can/map is unable to listen to onInstanceBoundChange on the Map type");if(this.List[c.for("can.onInstanceBoundChange")]){var t=function(e,t){var n=t?"addListReference":"deleteListReference";r[n]&&r[n](e)};Object.defineProperty(t,"name",{value:i.getName(this.List)+" boundChange",configurable:!0}),this.List[c.for("can.onInstanceBoundChange")](t)}else console.warn("can-connect/can/map is unable to listen to onInstanceBoundChange on the List type");this.Map[c.for("can.onInstancePatches")]?this.Map[c.for("can.onInstancePatches")](function(t,e){e.forEach(function(e){"add"!==e.type&&"set"!==e.type||e.key!==r.idProp||!t[c.for("can.isBound")]()||r.addInstanceReference(t)})}):console.warn("can-connect/can/map is unable to listen to onInstancePatches on the Map type"),a.init.apply(this,arguments)},serializeInstance:function(e){return i.serialize(e)},serializeList:function(e){return i.serialize(e)},instance:function(e){return new this.Map(e)},list:function(e,t){var n=new(this.List||this.Map&&this.Map.List)(e.data);return i.eachKey(e,function(e,t){"data"!==t&&i.setKeyValue(n,t,e)}),n[this.listQueryProp]=t,n},updatedList:function(e,t,n){o.batch.start();var r={};"production"!==process.env.NODE_ENV&&(r={reasonLog:["set",n,"list",e,"updated with",t]}),o.mutateQueue.enqueue(a.updatedList,this,arguments,r),o.batch.stop()},save:function(e){i.setKeyValue(e,"_saving",!0);var t=function(){i.setKeyValue(e,"_saving",!1)},n=a.save.apply(this,arguments);return n.then(t,t),n},destroy:function(e){i.setKeyValue(e,"_destroying",!0);var t=function(){i.setKeyValue(e,"_destroying",!1)},n=a.destroy.apply(this,arguments);return n.then(t,t),n}};return r(["created","updated","destroyed"],function(n){e[n+"Instance"]=function(e,t){t&&"object"==typeof t&&("destroyed"===n&&0===i.size(t)||(this.constructor.removeAttr?d(e,t,this.queryLogic.schema):this.updateInstanceWithAssignDeep?p(e,t,this.queryLogic.schema):function(n,r,e){if(e||(e=i.getSchema(n)),!e)throw new Error("can-connect/can/map/ is unable to update without a schema.");e.identity.forEach(function(e){var t=i.getKeyValue(n,e);void 0!==t&&i.setKeyValue(r,e,t)}),h(n,r)}(e,t,this.queryLogic.schema))),"created"===n&&this.moveCreatedInstanceToInstanceStore&&this.moveCreatedInstanceToInstanceStore(e),g.callbackInstanceEvents(n,e)}}),e}),y={static:{getList:function(e,t){return function(e){return t.getList(e)}},findAll:function(e,t){return function(e){return t.getList(e)}},get:function(e,t){return function(e){return t.get(e)}},findOne:function(e,t){return function(e){return t.get(e)}}},prototype:{isNew:function(e,t){return function(){return t.isNew(this)}},isSaving:function(e,t){return function(){return!!i.getKeyValue(this,"_saving")}},isDestroying:function(e,t){return function(){return!!i.getKeyValue(this,"_destroying")}},save:function(e,r){return function(e,t){var n=r.save(this);return n.then(e,t),n}},destroy:function(e,r){return function(e,t){var n;return this.isNew()?(n=Promise.resolve(this),r.destroyedInstance(this,{})):n=r.destroy(this),n.then(e,t),n}}},properties:{_saving:{enumerable:!(g.callbackInstanceEvents=function(e,t){var n=t.constructor;o.batch.start(),s.dispatch.call(t,{type:e,target:t}),"production"!==process.env.NODE_ENV&&this.id&&l.log("can-connect/can/map/map.js - "+(n.shortName||this.name)+" "+this.id(t)+" "+e),s.dispatch.call(n,e,[t]),o.batch.stop()}),value:!1,configurable:!0,writable:!0},_destroying:{enumerable:!1,value:!1,configurable:!0,writable:!0}}},m={static:{_bubbleRule:function(r,e){return function(e,t){var n=r(e,t);return n.push("destroyed"),n}}},prototype:{setup:function(t,n){return function(e){a(e)&&!Array.isArray(e)?(this[n.listQueryProp]=e,t.apply(this),this.replace(i.isPromise(e)?e:n.getList(e))):t.apply(this,arguments)}}},properties:{}},b=function(e,t,n){var r;for(r in n.properties)i.defineInstanceKey(t,r,n.properties[r]);for(r in n.prototype)t.prototype[r]=n.prototype[r](t.prototype[r],e);if(n.static)for(r in n.static)t[r]=n.static[r](t[r],e)};if(n.exports=g,"production"!==process.env.NODE_ENV){var w=e("can-connect/helpers/validate");n.exports=w(g,["id","get","updatedList","destroy","save","getList"])}}),define("can-connect/helpers/weak-reference-set",["require","exports","module","can-reflect"],function(e,t,n){var r=function(){this.set=[]};(0,e("can-reflect").assignMap)(r.prototype,{has:function(e){return-1!==this._getIndex(e)},addReference:function(e,t){var n=this._getIndex(e),r=this.set[n];r||(r={item:e,referenceCount:0},this.set.push(r)),r.referenceCount+=t||1},deleteReference:function(e){var t=this._getIndex(e),n=this.set[t];n&&(n.referenceCount--,0===n.referenceCount&&this.set.splice(t,1))},delete:function(e){var t=this._getIndex(e);-1!==t&&this.set.splice(t,1)},get:function(e){var t=this.set[this._getIndex(e)];if(t)return t.item},referenceCount:function(e){var t=this.set[this._getIndex(e)];if(t)return t.referenceCount},_getIndex:function(n){var r;return this.set.every(function(e,t){if(e.item===n)return r=t,!1}),void 0!==r?r:-1},forEach:function(e){return this.set.forEach(e)}}),n.exports=r}),define("can-connect/helpers/sorted-set-json",["require","exports","module","can-reflect"],function(e,t,n){var r=e("can-reflect");n.exports=function(e){return null==e?e:JSON.stringify(r.cloneKeySort(e))}}),define("can-connect/constructor/store/store",["require","exports","module","can-connect","can-connect/helpers/weak-reference-map","can-connect/helpers/weak-reference-set","can-connect/helpers/sorted-set-json","can-event-queue/map/map","can-connect/helpers/validate"],function(e,t,n){"use strict";var r=e("can-connect"),a=e("can-connect/helpers/weak-reference-map"),o=e("can-connect/helpers/weak-reference-set"),s=e("can-connect/helpers/sorted-set-json"),i=e("can-event-queue/map/map"),c=0,u=null,l={increment:function(e){c++,clearTimeout(u)},decrement:function(e){0===--c&&(u=setTimeout(function(){l.dispatch("end")},n.exports.requestCleanupDelay)),c<0&&(c=0)},count:function(){return c}};i(l);var f=r.behavior("constructor/store",function(i){return{instanceStore:new a,newInstanceStore:new o,listStore:new a,init:function(){i.init&&i.init.apply(this,arguments),this.hasOwnProperty("_requestInstances")||(this._requestInstances={}),this.hasOwnProperty("_requestLists")||(this._requestLists={}),l.on("end",function(){var e;for(e in this._requestInstances)this.instanceStore.deleteReference(e);for(e in this._requestInstances={},this._requestLists)this.listStore.deleteReference(e),this._requestLists[e].forEach(this.deleteInstanceReference.bind(this));this._requestLists={}}.bind(this))},_finishedRequest:function(){l.decrement(this)},addInstanceReference:function(e,t){var n=t||this.id(e);void 0===n?this.newInstanceStore.addReference(e):this.instanceStore.addReference(n,e)},createdInstance:function(e,t){i.createdInstance.apply(this,arguments),this.moveCreatedInstanceToInstanceStore(e)},moveCreatedInstanceToInstanceStore:function(e){var t=this.id(e);if(this.newInstanceStore.has(e)&&void 0!==t){var n=this.newInstanceStore.referenceCount(e);this.newInstanceStore.delete(e),this.instanceStore.addReference(t,e,n)}},addInstanceMetaData:function(e,t,n){var r=this.instanceStore.set[this.id(e)];r&&(r[t]=n)},getInstanceMetaData:function(e,t){var n=this.instanceStore.set[this.id(e)];if(n)return n[t]},deleteInstanceMetaData:function(e,t){delete this.instanceStore.set[this.id(e)][t]},deleteInstanceReference:function(e){void 0===this.id(e)?this.newInstanceStore.deleteReference(e):this.instanceStore.deleteReference(this.id(e),e)},addListReference:function(e,t){var n=s(t||this.listQuery(e));n&&(this.listStore.addReference(n,e),e.forEach(function(e){this.addInstanceReference(e)}.bind(this)))},deleteListReference:function(e,t){var n=s(t||this.listQuery(e));n&&(this.listStore.deleteReference(n,e),e.forEach(this.deleteInstanceReference.bind(this)))},hydratedInstance:function(e){if(0<l.count()){var t=this.id(e);this._requestInstances[t]||(this.addInstanceReference(e),this._requestInstances[t]=e)}},hydrateInstance:function(e){var t=this.id(e);if((t||0===t)&&this.instanceStore.has(t)){var n=this.instanceStore.get(t);return this.updatedInstance(n,e),n}var r=i.hydrateInstance.call(this,e);return this.hydratedInstance(r),r},hydratedList:function(e,t){if(0<l.count()){var n=s(t||this.listQuery(e));n&&(this._requestLists[n]||(this.addListReference(e,t),this._requestLists[n]=e))}},hydrateList:function(e,t){t=t||this.listQuery(e);var n=s(t);if(n&&this.listStore.has(n)){var r=this.listStore.get(n);return this.updatedList(r,e,t),r}var a=i.hydrateList.call(this,e,t);return this.hydratedList(a,t),a},getList:function(e){var t=this;l.increment(this);var n=i.getList.call(this,e);return n.then(function(e){t._finishedRequest()},function(){t._finishedRequest()}),n},get:function(e){var t=this;l.increment(this);var n=i.get.call(this,e);return n.then(function(e){t._finishedRequest()},function(){t._finishedRequest()}),n},save:function(t){var n=this;l.increment(this);var r=!this.isNew(t);r&&this.addInstanceReference(t);var e=i.save.call(this,t);return e.then(function(e){r&&n.deleteInstanceReference(t),n._finishedRequest()},function(){n._finishedRequest()}),e},destroy:function(e){var t=this;this.addInstanceReference(e),l.increment(this);var n=i.destroy.call(this,e);return n.then(function(e){t._finishedRequest(),t.deleteInstanceReference(e)},function(){t._finishedRequest()}),n},updatedList:function(e,t,n){var r=e.slice(0);t.data||"number"!=typeof t.length||(t={data:t}),i.updatedList?(i.updatedList.call(this,e,t,n),e.forEach(function(e){this.addInstanceReference(e)}.bind(this))):t.data&&t.data.forEach(function(e){this.addInstanceReference(e)}.bind(this)),r.forEach(this.deleteInstanceReference.bind(this))}}});if(f.requests=l,f.requestCleanupDelay=10,n.exports=f,"production"!==process.env.NODE_ENV){var d=e("can-connect/helpers/validate");n.exports=d(f,["hydrateInstance","hydrateList","getList","get","save","destroy"])}}),define("can-connect/data/callbacks/callbacks",["require","exports","module","can-connect","can-reflect","can-connect/helpers/validate"],function(e,t,n){"use strict";var r=e("can-connect"),a=e("can-reflect").each,o={getListData:"gotListData",createData:"createdData",updateData:"updatedData",destroyData:"destroyedData"},i=r.behavior("data/callbacks",function(i){var t={};return a(o,function(a,e){t[e]=function(t,n){var r=this;return i[e].call(this,t).then(function(e){return r[a]?r[a].call(r,e,t,n):e})}}),t});if(n.exports=i,"production"!==process.env.NODE_ENV){var s=e("can-connect/helpers/validate");n.exports=s(i,["getListData","createData","updateData","destroyData"])}}),define("can-connect/data/parse/parse",["require","exports","module","can-reflect","can-key/get/get","can-connect/behavior"],function(e,t,n){"use strict";var r=e("can-reflect").each,o=e("can-key/get/get"),a=e("can-connect/behavior");n.exports=a("data/parse",function(i){var e={parseListData:function(e){var t;if(i.parseListData&&(e=i.parseListData.apply(this,arguments)),Array.isArray(e))t={data:e};else{var n=this.parseListProp||"data";if(e.data=o(e,n),t=e,"data"!==n&&delete e[n],!Array.isArray(t.data))throw new Error("Could not get any raw data while converting using .parseListData")}for(var r=[],a=0;a<t.data.length;a++)r.push(this.parseInstanceData(t.data[a]));return t.data=r,t},parseInstanceData:function(e){return i.parseInstanceData&&(e=i.parseInstanceData.apply(this,arguments)||e),this.parseInstanceProp&&o(e,this.parseInstanceProp)||e}};return r(s,function(n,r){e[r]=function(e){var t=this;return i[r].call(this,e).then(function(){return t[n].apply(t,arguments)})}}),e});var s={getListData:"parseListData",getData:"parseInstanceData",createData:"parseInstanceData",updateData:"parseInstanceData",destroyData:"parseInstanceData"}}),define("can-ajax",["require","exports","module","can-globals/global/global","can-reflect","can-namespace","can-parse-uri","can-param"],function(e,t,n){!function(e,t,n,r){"use strict";var a=t("can-globals/global/global"),g=t("can-reflect"),i=t("can-namespace"),y=t("can-parse-uri"),m=t("can-param"),b=[function(){return new XMLHttpRequest},function(){return new ActiveXObject("Microsoft.XMLHTTP")},function(){return new ActiveXObject("MSXML2.XMLHTTP.3.0")},function(){return new ActiveXObject("MSXML2.XMLHTTP")}],w=null,_=y(a().location.href),x={},E="application/json",k="application/x-www-form-urlencoded",O=function(t,e){try{var n=e.dataType||t.getResponseHeader("Content-Type").split(";")[0];if(!n||!t.responseText&&!t.responseXML)return t;switch(n){case"text/xml":case"xml":return t.responseXML;case"text/json":case"application/json":case"text/javascript":case"application/javascript":case"application/x-javascript":case"json":return t.responseText&&JSON.parse(t.responseText);default:return t.responseText}}catch(e){return t}};r.exports=i.ajax=function(t){var e,n,r,a=function(){if(null!=w)return w();for(var e=0,t=b.length;e<t;e++)try{var n=b[e],r=n();if(null!=r)return w=n,r}catch(e){continue}return function(){}}(),i=0,o={},s=new Promise(function(e,t){o.resolve=e,o.reject=t});if(s.abort=function(){a.abort()},(t=[{userAgent:"XMLHttpRequest",lang:"en",type:"GET",data:null,dataType:"json"},x,t].reduce(function(e,t,n){return g.assignDeep(e,t)})).contentType||(t.contentType="GET"===t.type.toUpperCase()?k:E),null==t.crossDomain)try{r=y(t.url),t.crossDomain=!!(r.protocol&&r.protocol!==_.protocol||r.host&&r.host!==_.host)}catch(e){t.crossDomain=!0}t.timeout&&(e=setTimeout(function(){a.abort(),t.timeoutFn&&t.timeoutFn(t.url)},t.timeout)),a.onreadystatechange=function(){try{4===a.readyState?(e&&clearTimeout(e),a.status<300?t.success&&t.success(O(a,t)):t.error&&t.error(a,a.status,a.statusText),t.complete&&t.complete(a,a.statusText),200<=a.status&&a.status<300?o.resolve(O(a,t)):o.reject(O(a,t))):t.progress&&t.progress(++i)}catch(e){o.reject(e)}};var c=t.url,u=null,l=t.type.toUpperCase(),f=t.contentType===E,d="POST"===l||"PUT"===l;!d&&t.data&&(c+="?"+(f?JSON.stringify(t.data):m(t.data))),a.open(l,c);var p=t.crossDomain&&-1!==["GET","POST","HEAD"].indexOf(l);if(n="undefined"!=typeof FormData&&t.data instanceof FormData,d){u=n?t.data:f&&!p?"object"==typeof t.data?JSON.stringify(t.data):t.data:m(t.data);var h=f&&!p?"application/json":"application/x-www-form-urlencoded";a.setRequestHeader("Content-Type",h)}else a.setRequestHeader("Content-Type",t.contentType);if(p||a.setRequestHeader("X-Requested-With","XMLHttpRequest"),t.beforeSend&&t.beforeSend.call(t,a,t),t.xhrFields)for(var v in t.xhrFields)a[v]=t.xhrFields[v];return a.send(u),s},r.exports.ajaxSetup=function(e){x=e||{}}}(0,e,0,n)}),define("can-util/js/is-array-like/is-array-like",["require","exports","module","can-namespace"],function(e,t,n){"use strict";var r=e("can-namespace");n.exports=r.isArrayLike=function(e){var t=typeof e;if("string"===t)return!0;if("number"===t)return!1;var n=e&&"boolean"!==t&&"number"!=typeof e&&"length"in e&&e.length;return"function"!=typeof e&&(0===n||"number"==typeof n&&0<n&&n-1 in e)}}),define("can-util/js/is-iterable/is-iterable",["require","exports","module","can-symbol"],function(e,t,n){"use strict";var r=e("can-symbol");n.exports=function(e){return e&&!!e[r.iterator||r.for("iterator")]}}),define("can-util/js/each/each",["require","exports","module","can-util/js/is-array-like/is-array-like","can-util/js/is-iterable/is-iterable","can-symbol","can-namespace"],function(e,t,n){"use strict";var l=e("can-util/js/is-array-like/is-array-like"),f=Object.prototype.hasOwnProperty,d=e("can-util/js/is-iterable/is-iterable"),p=e("can-symbol"),r=e("can-namespace");n.exports=r.each=function(e,t,n){var r,a,i,o=0;if(e)if(l(e))for(a=e.length;o<a&&(i=e[o],!1!==t.call(n||i,i,o,e));o++);else if(d(e))for(var s,c,u=e[p.iterator||p.for("iterator")]();!(s=u.next()).done;)c=s.value,t.call(n||e,Array.isArray(c)?c[1]:c,c[0]);else if("object"==typeof e)for(r in e)if(f.call(e,r)&&!1===t.call(n||e[r],e[r],r,e))break;return e}}),define("can-make-rest",["require","exports","module","can-util/js/each/each"],function(e,t,n){var a=e("can-util/js/each/each"),i={item:{GET:"getData",PUT:"updateData",DELETE:"destroyData"},list:{GET:"getListData",POST:"createData"}};n.exports=function(e,t){var r={};return a(function(e,t){t=t||function(e){var t=e.match(/\{(.*)\}/);if(t&&2===t.length)return t[1]}(e)||"id";var n=new RegExp("\\/\\{"+t+"\\}.*"),r=n.test(e),a=r?e.replace(n,""):e;return{item:r?e:e.trim()+"/{"+t+"}",list:a}}(e,t),function(n,e){a(i[e],function(e,t){r[e]={method:t,url:n}})}),r}}),define("can-connect/helpers/make-promise",["require","exports","module","can-reflect"],function(e,t,n){var r=e("can-reflect");n.exports=function(n){return n&&"function"==typeof n.then&&!r.isPromise(n)?new Promise(function(e,t){n.then(e,t)}):n}}),define("can-connect/data/url/url",["require","exports","module","can-ajax","can-key/replace-with/replace-with","can-reflect","can-log/dev/dev","can-connect/behavior","can-make-rest","can-connect/helpers/make-promise","can-connect/helpers/validate"],function(e,t,n){"use strict";var l=e("can-ajax"),c=e("can-key/replace-with/replace-with"),f=e("can-reflect"),r=e("can-log/dev/dev"),a=e("can-connect/behavior"),d=e("can-make-rest"),i=d("/resource/{id}"),p=e("can-connect/helpers/make-promise"),o=a("data/url",function(u){var e={};return f.eachKey(i,function(s,c){e[c]=function(e){var t=h[c];if("object"==typeof this.url){if("function"==typeof this.url[c])return p(this.url[c](e));if(this.url[c]){var n=g(this.url[c],e,s.method,this.ajax||l,v(this.url,s.method),t);return p(n)}}var r="string"==typeof this.url?this.url:this.url.resource;if(r){var a=f.getSchema(this.queryLogic).identity,i=r.replace(/\/+$/,""),o=d(i,a[0])[c];return p(g(o.url,e,o.method,this.ajax||l,v(this.url,o.method),t))}return u[name].call(this,e)}}),e}),h={getListData:{},getData:{},createData:{},updateData:{},destroyData:{includeData:!1}},v=function(e,t){if("object"==typeof e&&e.contentType){if("application/x-www-form-urlencoded"===e.contentType||"application/json"===e.contentType)return e.contentType;"production"!==process.env.NODE_ENV&&r.warn("Unacceptable contentType on can-connect request. Use 'application/json' or 'application/x-www-form-urlencoded'")}return"GET"===t?"application/x-www-form-urlencoded":"application/json"};function u(e,t){return encodeURIComponent(t)}var g=function(e,t,n,r,a,i){var o={};if("string"==typeof e){var s=e.split(/\s+/);o.url=s.pop(),s.length&&(o.type=s.pop())}else f.assignMap(o,e);return o.data="object"!=typeof t||Array.isArray(t)?t:f.assignMap(o.data||{},t),o.url=c(o.url,o.data,u,!0),o.contentType=a,!1===i.includeData&&delete o.data,r(f.assignMap({type:n||"post",dataType:"json"},o))};if(n.exports=o,"production"!==process.env.NODE_ENV){var s=e("can-connect/helpers/validate");n.exports=s(o,["url"])}}),define("can-diff/index-by-identity/index-by-identity",["require","exports","module","can-reflect"],function(e,t,n){"use strict";var o=e("can-reflect");n.exports=function(e,t,n){var r=o.size(e);if(!n&&0<r&&(n=o.getSchema(e[0])),n||(n=o.getSchema(t)),!n)throw new Error("No schema to use to get identity.");for(var a=o.getIdentity(t,n),i=0;i<r;i++){if(a===o.getIdentity(e[i],n))return i}return-1}}),define("can-connect/real-time/real-time",["require","exports","module","can-connect","can-diff/index-by-identity/index-by-identity","can-log/dev/dev","can-symbol","can-reflect"],function(e,t,n){"use strict";var r=e("can-connect"),s=e("can-diff/index-by-identity/index-by-identity"),c=e("can-log/dev/dev"),a=e("can-symbol"),i=e("can-reflect"),u=a.for("can.splice");function l(e,t,n,r){-1===n?-1!==r&&i.splice(e,r,0,[t()]):-1===r?i.splice(e,n,1,[]):r!==n&&(n<r?(i.splice(e,r,0,[t()]),i.splice(e,n,1,[])):(i.splice(e,n,1,[]),i.splice(e,r,0,[t()])))}function f(e,t,n,r,a,i){if(-1===n||r!==n+1&&r!==n)if(void 0!==e[u])l(e,function(){return a.hydrateInstance(t)},n,r);else{var o=a.serializeList(e);l(o,function(){return t},n,r),a.updatedList(e,{data:o},i)}}n.exports=r.behavior("real-time",function(n){var e,o=Promise.resolve();return e={createData:function(){var e=n.createData.apply(this,arguments),t=e.catch(function(){return""});return o=Promise.all([o,t]),e},createInstance:function(a){var i=this;return new Promise(function(r,e){o.then(function(){setTimeout(function(){var e,t=i.id(a),n=i.instanceStore.get(t);n?r(i.updateInstance(a)):(n=i.hydrateInstance(a),e=i.serializeInstance(n),i.addInstanceReference(n),Promise.resolve(i.createdData(a,e)).then(function(){i.deleteInstanceReference(n),r(n)}))},1)})})},createdData:function(e,t,n){var r;r=void 0!==n?this.cidStore.get(n):this.instanceStore.get(this.id(e)),this.addInstanceReference(r,this.id(e)),this.createdInstance(r,e),d.call(this,this.serializeInstance(r)),this.deleteInstanceReference(r)},updatedData:function(e,t){var n=this.instanceStore.get(this.id(t));this.updatedInstance(n,e),p.call(this,this.serializeInstance(n))},updateInstance:function(e){var t=this.id(e),n=this.instanceStore.get(t);n||(n=this.hydrateInstance(e)),this.addInstanceReference(n);var r=this.serializeInstance(n),a=this;return Promise.resolve(this.updatedData(e,r)).then(function(){return a.deleteInstanceReference(n),n})},destroyedData:function(e,t){var n=this.id(t||e),r=this.instanceStore.get(n);r||(r=this.hydrateInstance(e));var a=this.serializeInstance(r);this.destroyedInstance(r,e),h.call(this,a)},destroyInstance:function(e){var t=this.id(e),n=this.instanceStore.get(t);n||(n=this.hydrateInstance(e)),this.addInstanceReference(n);var r=this.serializeInstance(n),a=this;return Promise.resolve(this.destroyedData(e,r)).then(function(){return a.deleteInstanceReference(n),n})}},"production"!==process.env.NODE_ENV&&(e.gotListData=function(e,t){if(this.queryLogic){Array.isArray(e)&&(e={data:e});for(var n,r=0,a=e.data.length;r<a;r++)if(n=e.data[r],!this.queryLogic.isMember(t,n)){var i="One or more items were retrieved which do not match the 'Set' parameters used to load them. Read the docs for more information: https://canjs.com/doc/can-query-logic.html#TestingyourQueryLogic\n\nBelow are the 'query' parameters:\n"+c.stringify(t)+"\n\nAnd below is an item which does not match those parameters:\n"+c.stringify(n);c.warn(i);break}}return Promise.resolve(e)}),e});var d=function(i){var o=this;this.listStore.forEach(function(e,t){var n=JSON.parse(t),r=s(e,i,o.queryLogic.schema);if(o.queryLogic.isMember(n,i)){var a=o.queryLogic.index(n,e,i);f(e,i,r,a,o,n)}})},p=function(i){var o=this;this.listStore.forEach(function(e,t){var n=JSON.parse(t),r=s(e,i,o.queryLogic.schema);if(o.queryLogic.isMember(n,i)){var a=o.queryLogic.index(n,e,i);f(e,i,r,a,o,n)}else-1!==r&&f(e,i,r,-1,o,n)})},h=function(a){var i=this;this.listStore.forEach(function(e,t){var n=JSON.parse(t),r=s(e,a,i.queryLogic.schema);-1!==r&&f(e,a,r,-1,i,n)})}}),define("can-connect/constructor/callbacks-once/callbacks-once",["require","exports","module","can-connect","can-connect/helpers/sorted-set-json","can-connect/helpers/validate"],function(e,t,n){"use strict";var r=e("can-connect"),s=e("can-connect/helpers/sorted-set-json"),a=[].forEach,i=["createdInstance","updatedInstance","destroyedInstance"],o=r.behavior("constructor/callbacks-once",function(o){var e={};return a.call(i,function(i){e[i]=function(e,t){var n=this.getInstanceMetaData(e,"last-data-"+i),r=s(t);if(n!==r){var a=o[i].apply(this,arguments);return this.addInstanceMetaData(e,"last-data-"+i,r),a}}}),e});if(n.exports=o,"production"!==process.env.NODE_ENV){var c=e("can-connect/helpers/validate");n.exports=c(o,i)}}),define("can-realtime-rest-model",["require","exports","module","can-connect","can-connect/constructor/constructor","can-connect/can/map/map","can-connect/constructor/store/store","can-connect/data/callbacks/callbacks","can-connect/data/parse/parse","can-connect/data/url/url","can-connect/real-time/real-time","can-connect/constructor/callbacks-once/callbacks-once","can-namespace"],function(e,t,n){var r=e("can-connect"),a=e("can-connect/constructor/constructor"),i=e("can-connect/can/map/map"),o=e("can-connect/constructor/store/store"),s=e("can-connect/data/callbacks/callbacks"),c=e("can-connect/data/parse/parse"),u=e("can-connect/data/url/url"),l=e("can-connect/real-time/real-time"),f=e("can-connect/constructor/callbacks-once/callbacks-once"),d=e("can-namespace");n.exports=d.realtimeRestModel=function(e){return r([a,i,o,s,c,u,l,f],e)}}),define("can/es/can-realtime-rest-model",["exports","can-realtime-rest-model"],function(e,t){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"default",{enumerable:!0,get:function(){return(e=t,e&&e.__esModule?e:{default:e}).default;var e}})}),define("can-rest-model",["require","exports","module","can-connect/constructor/constructor","can-connect/can/map/map","can-connect/data/parse/parse","can-connect/data/url/url","can-namespace","can-connect/base/base"],function(e,t,n){var r=e("can-connect/constructor/constructor"),a=e("can-connect/can/map/map"),i=e("can-connect/data/parse/parse"),o=e("can-connect/data/url/url"),s=e("can-namespace"),c=e("can-connect/base/base");n.exports=s.restModel=function(e){var t=[c,o,i,r,a].reduce(function(e,t){return t(e)},e);return t.init(),t}}),define("can/es/can-rest-model",["exports","can-rest-model"],function(e,t){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"default",{enumerable:!0,get:function(){return(e=t,e&&e.__esModule?e:{default:e}).default;var e}})}),define("can-connect/helpers/get-items",function(e,t,n){"use strict";n.exports=function(e){return Array.isArray(e)?e:e.data}}),define("can-connect/cache-requests/cache-requests",["require","exports","module","can-connect","can-connect/helpers/get-items","can-connect/helpers/validate"],function(e,t,n){var r=e("can-connect"),u=e("can-connect/helpers/get-items"),s=Array.prototype.forEach,a=r.behavior("cache-requests",function(c){return{getDiff:function(a,e){var i,o=this;return s.call(e,function(e){var t,n=o.queryLogic.difference(a,e);if(o.queryLogic.isDefinedAndHasMembers(n)){var r=o.queryLogic.intersection(a,e);t={needed:n,cached:!!o.queryLogic.isDefinedAndHasMembers(r)&&r,count:o.queryLogic.count(n)}}else o.queryLogic.isSubset(a,e)&&(t={cached:a,count:0});t&&(!i||t.count<i.count)&&(i=t)}),i?{needed:i.needed,cached:i.cached}:{needed:a}},unionMembers:function(e,t,n,r){return{data:this.queryLogic.unionMembers(t.needed,t.cached,u(n),u(r))}},getListData:function(o){o=o||{};var s=this;return this.cacheConnection.getSets(o).then(function(e){var r=s.getDiff(o,e);if(r.needed){if(r.cached){var t=s.cacheConnection.getListData(r.cached),n=c.getListData(r.needed),a=n.then(function(e){return s.cacheConnection.updateListData(u(e),r.needed).then(function(){return e})}),i=Promise.all([t,n]).then(function(e){var t=e[0],n=e[1];return s.unionMembers(o,r,n,t)});return Promise.all([i,a]).then(function(e){return e[0]})}return c.getListData(r.needed).then(function(e){return s.cacheConnection.updateListData(u(e),r.needed).then(function(){return e})})}return s.cacheConnection.getListData(r.cached)})}}});if(n.exports=a,"production"!==process.env.NODE_ENV)var i=e("can-connect/helpers/validate");n.exports=i(a,["getListData","cacheConnection"])}),define("can-connect/data/callbacks-cache/callbacks-cache",["require","exports","module","can-connect","can-reflect","can-reflect","can-connect/helpers/validate"],function(e,t,n){"use strict";var r=e("can-connect"),o=e("can-reflect").assignMap,a=e("can-reflect").each,s={createdData:"createData",updatedData:"updateData",destroyedData:"destroyData"},i=r.behavior("data/callbacks-cache",function(i){var e={};return a(s,function(r,a){e[a]=function(e,t,n){return this.cacheConnection[r](o(o({},t),e)),i[a]?i[a].call(this,e,t,n):e}}),e});if(n.exports=i,"production"!==process.env.NODE_ENV){var c=e("can-connect/helpers/validate");n.exports=c(i,[])}}),define("can-connect/helpers/deferred",function(e,t,n){"use strict";n.exports=function(){var n={};return n.promise=new Promise(function(e,t){n.resolve=e,n.reject=t}),n}}),define("can-connect/data/combine-requests/combine-requests",["require","exports","module","can-connect","can-connect/helpers/get-items","can-reflect","can-connect/helpers/deferred","can-connect/helpers/validate"],function(e,t,n){var r=e("can-connect"),i=e("can-connect/helpers/get-items"),o=e("can-reflect"),s=e("can-connect/helpers/deferred"),c=[].forEach,a=r.behavior("data/combine-requests",function(a){var n;return{unionPendingRequests:function(e){var n=this;e.sort(function(e,t){return n.queryLogic.isSubset(e.set,t.set)?1:n.queryLogic.isSubset(t.set,e.set)?-1:0});var r,t=[];return l(e,{start:function(e){r={set:e.set,pendingRequests:[e]},t.push(r)},iterate:function(e){var t=n.queryLogic.union(r.set,e.set);if(n.queryLogic.isDefinedAndHasMembers(t))return r.set=t,r.pendingRequests.push(e),!0}}),Promise.resolve(t)},time:1,getListData:function(e){e=e||{};var r=this;n||(n=[],setTimeout(function(){var e=r.unionPendingRequests(n);n=null,e.then(function(e){c.call(e,function(n){var e=o.serialize(n.set);a.getListData(e).then(function(t){1===n.pendingRequests.length?n.pendingRequests[0].deferred.resolve(t):c.call(n.pendingRequests,function(e){e.deferred.resolve({data:r.queryLogic.filterMembers(e.set,n.set,i(t))})})},function(t){1===n.pendingRequests.length?n.pendingRequests[0].deferred.reject(t):c.call(n.pendingRequests,function(e){e.deferred.reject(t)})})})})},this.time||1));var t=s();return n.push({deferred:t,set:e}),t.promise}}});n.exports=a;var u=e("can-connect/helpers/validate");n.exports=u(a,["getListData"]);var l=function(e,t){for(var n=0;n<e.length;){t.start(e[n]);for(var r=n+1;r<e.length;)!0===t.iterate(e[r])?e.splice(r,1):r++;n++}}}),define("can-local-store",["require","exports","module","can-reflect","can-memory-store/make-simple-store","can-namespace"],function(e,t,n){var r=e("can-reflect"),a=e("can-memory-store/make-simple-store"),i=e("can-namespace");n.exports=i.localStore=function e(t){t.constructor=e;var n=Object.create(a(t));return r.assignMap(n,{clear:function(){return localStorage.removeItem(this.name+"/queries"),localStorage.removeItem(this.name+"/records"),this._recordsMap=null,Promise.resolve()},updateQueryDataSync:function(e){localStorage.setItem(this.name+"/queries",JSON.stringify(e))},getQueryDataSync:function(){return JSON.parse(localStorage.getItem(this.name+"/queries"))||[]},getRecord:function(e){return this._recordsMap||this.getAllRecords(),this._recordsMap[e]},getAllRecords:function(){if(!this.cacheLocalStorageReads||!this._recordsMap){var e=JSON.parse(localStorage.getItem(this.name+"/records"))||{};this._recordsMap=e}var t=[];for(var n in this._recordsMap)t.push(this._recordsMap[n]);return t},destroyRecords:function(e){this._recordsMap||this.getAllRecords(),r.eachIndex(e,function(e){var t=r.getIdentity(e,this.queryLogic.schema);delete this._recordsMap[t]},this),localStorage.setItem(this.name+"/records",JSON.stringify(this._recordsMap))},updateRecordsSync:function(e){this._recordsMap||this.getAllRecords(),e.forEach(function(e){var t=r.getIdentity(e,this.queryLogic.schema);this._recordsMap[t]=e},this),localStorage.setItem(this.name+"/records",JSON.stringify(this._recordsMap))}}),n}}),define("can-connect/data/localstorage-cache/localstorage-cache",["require","exports","module","can-local-store"],function(e,t,n){"use strict";n.exports=e("can-local-store")}),define("can-connect/data/memory-cache/memory-cache",["require","exports","module","can-memory-store"],function(e,t,n){"use strict";var r=e("can-memory-store");n.exports=r}),define("can-connect/fall-through-cache/fall-through-cache",["require","exports","module","can-connect","can-connect/helpers/sorted-set-json","can-log","can-connect/helpers/validate"],function(e,t,n){"use strict";var r=e("can-connect"),i=e("can-connect/helpers/sorted-set-json"),o=e("can-log"),a=r.behavior("fall-through-cache",function(a){return{hydrateList:function(e,t){t=t||this.listQuery(e);var n=i(t),r=a.hydrateList.call(this,e,t);return this._getHydrateListCallbacks[n]&&(this._getHydrateListCallbacks[n].shift()(r),this._getHydrateListCallbacks[n].length||delete this._getHydrateListCallbacks[n]),r},_getHydrateListCallbacks:{},_getHydrateList:function(e,t){var n=i(e);this._getHydrateListCallbacks[n]||(this._getHydrateListCallbacks[n]=[]),this._getHydrateListCallbacks[n].push(t)},getListData:function(n){n=n||{};var r=this;return this.cacheConnection.getListData(n).then(function(e){return r._getHydrateList(n,function(t){r.addListReference(t,n),setTimeout(function(){a.getListData.call(r,n).then(function(e){r.cacheConnection.updateListData(e,n),r.updatedList(t,e,n),r.deleteListReference(t,n)},function(e){o.log("REJECTED",e)})},1)}),e},function(){var e=a.getListData.call(r,n);return e.then(function(e){r.cacheConnection.updateListData(e,n)}),e})},hydrateInstance:function(e){var t=this.id(e),n=a.hydrateInstance.apply(this,arguments);return this._getMakeInstanceCallbacks[t]&&(this._getMakeInstanceCallbacks[t].shift()(n),this._getMakeInstanceCallbacks[t].length||delete this._getMakeInstanceCallbacks[t]),n},_getMakeInstanceCallbacks:{},_getMakeInstance:function(e,t){this._getMakeInstanceCallbacks[e]||(this._getMakeInstanceCallbacks[e]=[]),this._getMakeInstanceCallbacks[e].push(t)},getData:function(n){var r=this;return this.cacheConnection.getData(n).then(function(e){return r._getMakeInstance(r.id(e)||r.id(n),function(t){r.addInstanceReference(t),setTimeout(function(){a.getData.call(r,n).then(function(e){r.cacheConnection.updateData(e),r.updatedInstance(t,e),r.deleteInstanceReference(t)},function(e){o.log("REJECTED",e)})},1)}),e},function(){var e=a.getData.call(r,n);return e.then(function(e){r.cacheConnection.updateData(e)}),e})}}});if(n.exports=a,"production"!==process.env.NODE_ENV){var s=e("can-connect/helpers/validate");n.exports=s(a,["hydrateList","hydrateInstance","getListData","getData"])}}),define("can-connect/can/ref/ref",["require","exports","module","can-connect","can-connect/helpers/weak-reference-map","can-observation-recorder","can-connect/constructor/store/store","can-define","can-reflect"],function(e,t,n){"use strict";var r=e("can-connect"),o=e("can-connect/helpers/weak-reference-map"),s=e("can-observation-recorder"),c=e("can-connect/constructor/store/store"),u=e("can-define"),l=e("can-reflect");n.exports=r.behavior("can/ref",function(e){return{init:function(){e.init.apply(this,arguments),this.Map.Ref=function(r){var a=l.getSchema(r.queryLogic).identity[0],i=function(e,t){"object"==typeof e&&(e=(t=e)[a]);var n=i.store.get(e);if(n)return t&&!n._value&&(t instanceof r.Map?n._value=t:n._value=r.hydrateInstance(t)),n;this[a]=e,t&&(t instanceof r.Map?this._value=t:this._value=r.hydrateInstance(t)),0<c.requests.count()&&(i._requestInstances[e]||(i.store.addReference(e,this),i._requestInstances[e]=this))};i.store=new o,i._requestInstances={},i.type=function(e){return e&&"object"!=typeof e?new i(e):new i(e[a],e)};var e={promise:{get:function(){if(this._value)return Promise.resolve(this._value);var e={};return e[a]=this[a],r.Map.get(e)}},_state:{get:function(e,t){return t&&this.promise.then(function(){t("resolved")},function(){t("rejected")}),"pending"}},value:{get:function(e,t){if(this._value)return this._value;t&&this.promise.then(function(e){t(e)})}},reason:{get:function(e,t){this._value||this.promise.catch(function(e){t(e)})}}};e[a]={type:"*",set:function(){this._value=void 0}},u(i.prototype,e),i.prototype.unobservedId=s.ignore(function(){return this[a]}),i.prototype.isResolved=function(){return!!this._value||"resolved"===this._state},i.prototype.isRejected=function(){return"rejected"===this._state},i.prototype.isPending=function(){return!this._value&&("resolved"!==this._state||"rejected"!==this._state)},i.prototype.serialize=function(){return this[a]},l.assignSymbols(i.prototype,{"can.serialize":i.prototype.serialize,"can.getName":function(){return l.getName(this.constructor)+"{"+this[a]+"}"}});var t=i.prototype._eventSetup;i.prototype._eventSetup=function(){return i.store.addReference(this.unobservedId(),this),t.apply(this,arguments)};var n=i.prototype._eventTeardown;return i.prototype._eventTeardown=function(){return i.store.deleteReference(this.unobservedId(),this),n.apply(this,arguments)},c.requests.on("end",function(){for(var e in i._requestInstances)i.store.deleteReference(e);i._requestInstances={}}),Object.defineProperty(i,"name",{value:l.getName(r.Map)+"Ref",configurable:!0}),i}(this)}}})}),define("can-connect/can/super-map/super-map",["require","exports","module","can-connect","can-connect/constructor/constructor","can-connect/can/map/map","can-connect/can/ref/ref","can-connect/constructor/store/store","can-connect/data/callbacks/callbacks","can-connect/data/callbacks-cache/callbacks-cache","can-connect/data/combine-requests/combine-requests","can-connect/data/localstorage-cache/localstorage-cache","can-connect/data/parse/parse","can-connect/data/url/url","can-connect/fall-through-cache/fall-through-cache","can-connect/real-time/real-time","can-connect/constructor/callbacks-once/callbacks-once","can-globals/global/global"],function(e,t,n){!function(e,t,n,r){"use strict";var a=t("can-connect"),i=t("can-connect/constructor/constructor"),o=t("can-connect/can/map/map"),s=t("can-connect/can/ref/ref"),c=t("can-connect/constructor/store/store"),u=t("can-connect/data/callbacks/callbacks"),l=t("can-connect/data/callbacks-cache/callbacks-cache"),f=t("can-connect/data/combine-requests/combine-requests"),d=t("can-connect/data/localstorage-cache/localstorage-cache"),p=t("can-connect/data/parse/parse"),h=t("can-connect/data/url/url"),v=t("can-connect/fall-through-cache/fall-through-cache"),g=t("can-connect/real-time/real-time"),y=t("can-connect/constructor/callbacks-once/callbacks-once"),m=t("can-globals/global/global")().$;a.superMap=function(e){var t=[i,o,s,c,u,f,p,h,g,y];return"undefined"!=typeof localStorage&&(e.cacheConnection||(e.cacheConnection=a([d],{name:e.name+"Cache",idProp:e.idProp,queryLogic:e.queryLogic})),t.push(l,v)),m&&m.ajax&&(e.ajax=m.ajax),a(t,e)},r.exports=a.superMap}(0,e,0,n)}),define("can-connect/can/base-map/base-map",["require","exports","module","can-connect","can-connect/constructor/constructor","can-connect/can/map/map","can-connect/can/ref/ref","can-connect/constructor/store/store","can-connect/data/callbacks/callbacks","can-connect/data/callbacks-cache/callbacks-cache","can-connect/data/parse/parse","can-connect/data/url/url","can-connect/real-time/real-time","can-connect/constructor/callbacks-once/callbacks-once","can-globals/global/global"],function(e,t,n){var r,a,i,o,s,c,u,l,f,d,p,h,v;a=n,i=(r=e)("can-connect"),o=r("can-connect/constructor/constructor"),s=r("can-connect/can/map/map"),c=r("can-connect/can/ref/ref"),u=r("can-connect/constructor/store/store"),l=r("can-connect/data/callbacks/callbacks"),r("can-connect/data/callbacks-cache/callbacks-cache"),f=r("can-connect/data/parse/parse"),d=r("can-connect/data/url/url"),p=r("can-connect/real-time/real-time"),h=r("can-connect/constructor/callbacks-once/callbacks-once"),v=r("can-globals/global/global")().$,i.baseMap=function(e){var t=[o,s,c,u,l,f,d,p,h];return v&&v.ajax&&(e.ajax=v.ajax),i(t,e)},a.exports=i.baseMap}),define("can-connect/all",["require","exports","module","can-connect","can-connect/cache-requests/cache-requests","can-connect/constructor/constructor","can-connect/constructor/callbacks-once/callbacks-once","can-connect/constructor/store/store","can-connect/data/callbacks/callbacks","can-connect/data/callbacks-cache/callbacks-cache","can-connect/data/combine-requests/combine-requests","can-connect/data/localstorage-cache/localstorage-cache","can-connect/data/memory-cache/memory-cache","can-connect/data/parse/parse","can-connect/data/url/url","can-connect/fall-through-cache/fall-through-cache","can-connect/real-time/real-time","can-connect/can/super-map/super-map","can-connect/can/base-map/base-map"],function(e,t,n){"use strict";var r=e("can-connect");r.cacheRequests=e("can-connect/cache-requests/cache-requests"),r.constructor=e("can-connect/constructor/constructor"),r.constructorCallbacksOnce=e("can-connect/constructor/callbacks-once/callbacks-once"),r.constructorStore=e("can-connect/constructor/store/store"),r.dataCallbacks=e("can-connect/data/callbacks/callbacks"),r.dataCallbacksCache=e("can-connect/data/callbacks-cache/callbacks-cache"),r.dataCombineRequests=e("can-connect/data/combine-requests/combine-requests"),r.dataLocalStorageCache=e("can-connect/data/localstorage-cache/localstorage-cache"),r.dataMemoryCache=e("can-connect/data/memory-cache/memory-cache"),r.dataParse=e("can-connect/data/parse/parse"),r.dataUrl=e("can-connect/data/url/url"),r.fallThroughCache=e("can-connect/fall-through-cache/fall-through-cache"),r.realTime=e("can-connect/real-time/real-time"),r.superMap=e("can-connect/can/super-map/super-map"),r.baseMap=e("can-connect/can/base-map/base-map"),n.exports=r}),define("can/es/can-connect",["exports","can-connect/all"],function(e,t){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"default",{enumerable:!0,get:function(){return(e=t,e&&e.__esModule?e:{default:e}).default;var e}})}),define("can/es/can-local-store",["exports","can-local-store"],function(e,t){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"default",{enumerable:!0,get:function(){return(e=t,e&&e.__esModule?e:{default:e}).default;var e}})}),define("can/es/can-memory-store",["exports","can-memory-store"],function(e,t){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"default",{enumerable:!0,get:function(){return(e=t,e&&e.__esModule?e:{default:e}).default;var e}})}),define("can/es/can-route",["exports","can-route"],function(e,t){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"default",{enumerable:!0,get:function(){return(e=t,e&&e.__esModule?e:{default:e}).default;var e}})}),define("can/es/can-route-hash",["exports","can-route-hash"],function(e,t){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"default",{enumerable:!0,get:function(){return(e=t,e&&e.__esModule?e:{default:e}).default;var e}})}),define("can-route-pushstate",["require","exports","module","can-route","can-route/src/binding-proxy","can-reflect","can-symbol","can-simple-observable","can-observation-recorder","can-globals/is-node/is-node","can-globals/location/location","can-globals/document/document","can-globals/global/global","can-dom-events","can-diff/map/map"],function(e,t,n){!function(e,t,n,r){"use strict";var o=t("can-route"),i=t("can-route/src/binding-proxy"),a=t("can-reflect"),s=t("can-symbol"),c=t("can-simple-observable"),u=t("can-observation-recorder"),l=t("can-globals/is-node/is-node"),f=t("can-globals/location/location"),d=t("can-globals/document/document"),p=t("can-globals/global/global"),h=t("can-dom-events"),v=t("can-diff/map/map"),g=["pushState","replaceState"],y=s.for("can.dispatch");function m(){var e=f(),t=e.protocol+"//"+e.host,n=i.call("root");return 0===n.indexOf(t)?n.substr(t.length):n}function b(){var e=m(),t=f(),n=t.pathname+t.search,r=n.indexOf(e);return n.substr(r+e.length)}function w(){this.replaceStateOnceKeys=[],this.replaceStateKeys=[],this.dispatchHandlers=this.dispatchHandlers.bind(this),this.anchorClickHandler=function(e){w.prototype.anchorClickHandler.call(this,this,e)},this.keepHash=!0}w.prototype=Object.create(c.prototype),w.constructor=w,a.assign(w.prototype,{root:"/",matchSlashes:!1,paramsMatcher:/^\?(?:[^=]+=[^&]*&)*[^=]+=[^&]*/,querySeparator:"?",dispatchHandlers:function(){var e=this._value;this._value=b(),e!==this._value&&this[y](this._value,e)},anchorClickHandler:function(e,t){if(!(t.isDefaultPrevented?t.isDefaultPrevented():!0===t.defaultPrevented)){if("javascript://"===e.href)return;if("_blank"===e.target)return;if(t.altKey||t.ctrlKey||t.metaKey||t.shiftKey)return;var n=e.host||window.location.host;if(window.location.host===n){var r=m();if(0===e.pathname.indexOf(r)){var a=e.pathname+e.search,i=a.substr(r.length);if(void 0!==o.rule(i))0<=e.href.indexOf("#")&&(this.keepHash=!0),(a!==window.location.pathname+window.location.search||e.hash===window.location.hash)&&t.preventDefault&&t.preventDefault(),window.history.pushState(null,null,e.href)}}}},onBound:function(){if(!l()){var e=d(),s=p();this._value=b(),h.addDelegateListener(e.documentElement,"click","a",this.anchorClickHandler);var c=this.originalMethods={},u=this.dispatchHandlers;a.eachKey(g,function(o){this.originalMethods[o]=s.history[o],s.history[o]=function(e,t,n){var r=0===n.indexOf("http"),a=f(),i=a.search+a.hash;(!r&&n!==a.pathname+i||r&&n!==a.href+i)&&(c[o].apply(s.history,arguments),u())}},this),h.addEventListener(s,"popstate",this.dispatchHandlers)}},onUnbound:function(){if(!l()){var e=d(),t=p();h.removeDelegateListener(e.documentElement,"click","a",this.anchorClickHandler),a.eachKey(g,function(e){t.history[e]=this.originalMethods[e]},this),h.removeEventListener(t,"popstate",this.dispatchHandlers)}},get:function(){return u.add(this),b()},set:function(e){var t=o.deparam(e),n=o.deparam(b()),r="pushState",a={};this.keepHash&&-1===e.indexOf("#")&&window.location.hash&&(e+=window.location.hash),v(n,t).forEach(function(e){return a[e.key]=!0}),this.replaceStateKeys.length&&this.replaceStateKeys.forEach(function(e){a[e]&&(r="replaceState")}),this.replaceStateOnceKeys.length&&this.replaceStateOnceKeys.forEach(function(e,t,n){a[e]&&(r="replaceState",n.splice(t,1))}),window.history[r](null,null,i.call("root")+e)},replaceStateOn:function(){a.addValues(this.replaceStateKeys,a.toArray(arguments))},replaceStateOnce:function(){a.addValues(this.replaceStateOnceKeys,a.toArray(arguments))},replaceStateOff:function(){a.removeValues(this.replaceStateKeys,a.toArray(arguments)),a.removeValues(this.replaceStateOnceKeys,a.toArray(arguments))}}),a.assignSymbols(w.prototype,{"can.getValue":w.prototype.get,"can.setValue":w.prototype.set}),r.exports=w}(0,e,0,n)}),define("can/es/can-route-pushstate",["exports","can-route-pushstate"],function(e,t){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"default",{enumerable:!0,get:function(){return(e=t,e&&e.__esModule?e:{default:e}).default;var e}})}),define("can/es/can-param",["exports","can-param"],function(e,t){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"default",{enumerable:!0,get:function(){return(e=t,e&&e.__esModule?e:{default:e}).default;var e}})}),define("can/es/can-deparam",["exports","can-deparam"],function(e,t){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"default",{enumerable:!0,get:function(){return(e=t,e&&e.__esModule?e:{default:e}).default;var e}})}),define("can/es/can-assign",["exports","can-assign"],function(e,t){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"default",{enumerable:!0,get:function(){return(e=t,e&&e.__esModule?e:{default:e}).default;var e}})}),define("can/es/can-define-lazy-value",["exports","can-define-lazy-value"],function(e,t){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"default",{enumerable:!0,get:function(){return(e=t,e&&e.__esModule?e:{default:e}).default;var e}})}),define("can-diff/deep/deep",["require","exports","module","can-diff/map/map","can-diff/list/list","can-reflect"],function(e,t,n){"use strict";var a=e("can-diff/map/map"),i=e("can-diff/list/list"),f=e("can-reflect");function o(e,t,a,i){var n,o,r=f.getSchema(e),s=f.size(e);return null!=r&&null!=r.values&&(n=f.getSchema(r.values)),null==n&&0<s&&(n=f.getSchema(f.getKeyValue(e,0))),n&&(o=function(n){if(n.identity&&n.identity.length)return function(e,t){return f.getIdentity(e,n)===f.getIdentity(t,n)}}(n)),function(e,t,n){if(f.isPrimitive(e))return e===t;if(f.isPrimitive(t))return e===t;if(o&&o(e,t)){var r=d(e,t,a?a+"."+n:""+n);return i.push.apply(i,r),!0}return 0===d(e,t).length}}function d(s,c,u){if(s&&f.isMoreListLikeThanMapLike(s)){var e=[],t=o(s,0,u,e),n=i(s,c,t).map(function(e){return u&&(e.key=u),e});return e.concat(n)}u=u?u+".":"";var r=a(s,c),l=[];return r.forEach(function(e){var t=e.key;e.key=u+e.key;var n,r,a=s&&f.getKeyValue(s,t),i=c&&f.getKeyValue(c,t);if(n=a,r=i,"set"===e.type&&n&&r&&"object"==typeof n&&"object"==typeof r){var o=d(a,i,e.key);l.push.apply(l,o)}else l.push(e)}),l}n.exports=d}),define("can-diff",["require","exports","module","can-diff/deep/deep","can-diff/list/list","can-diff/map/map","can-diff/merge-deep/merge-deep","can-diff/patcher/patcher","can-namespace"],function(e,t,n){"use strict";var r=e("can-diff/deep/deep"),a=e("can-diff/list/list"),i=e("can-diff/map/map"),o=e("can-diff/merge-deep/merge-deep"),s=e("can-diff/patcher/patcher"),c=e("can-namespace"),u={deep:r,list:a,map:i,mergeDeep:o,Patcher:s};n.exports=c.diff=u}),define("can/es/can-diff",["exports","can-diff"],function(e,t){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"default",{enumerable:!0,get:function(){return(e=t,e&&e.__esModule?e:{default:e}).default;var e}})}),define("can/es/can-globals",["exports","can-globals"],function(e,t){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"default",{enumerable:!0,get:function(){return(e=t,e&&e.__esModule?e:{default:e}).default;var e}})}),define("can/es/can-key",["exports","can-key"],function(e,t){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"default",{enumerable:!0,get:function(){return(e=t,e&&e.__esModule?e:{default:e}).default;var e}})}),define("can/es/can-key-tree",["exports","can-key-tree"],function(e,t){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"default",{enumerable:!0,get:function(){return(e=t,e&&e.__esModule?e:{default:e}).default;var e}})}),define("can-make-map",function(e,t,n){"use strict";n.exports=function(e){var t={};return e.split(",").forEach(function(e){t[e]=!0}),t}}),define("can/es/can-make-map",["exports","can-make-map"],function(e,t){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"default",{enumerable:!0,get:function(){return(e=t,e&&e.__esModule?e:{default:e}).default;var e}})}),define("can/es/can-parse-uri",["exports","can-parse-uri"],function(e,t){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"default",{enumerable:!0,get:function(){return(e=t,e&&e.__esModule?e:{default:e}).default;var e}})}),define("can/es/can-queues",["exports","can-queues"],function(e,t){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"default",{enumerable:!0,get:function(){return(e=t,e&&e.__esModule?e:{default:e}).default;var e}})}),define("can/es/can-string",["exports","can-string"],function(e,t){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"default",{enumerable:!0,get:function(){return(e=t,e&&e.__esModule?e:{default:e}).default;var e}})}),define("can/es/can-string-to-any",["exports","can-string-to-any"],function(e,t){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"default",{enumerable:!0,get:function(){return(e=t,e&&e.__esModule?e:{default:e}).default;var e}})}),define("can/es/can-ajax",["exports","can-ajax"],function(e,t){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"default",{enumerable:!0,get:function(){return(e=t,e&&e.__esModule?e:{default:e}).default;var e}})}),define("can/es/can-attribute-encoder",["exports","can-attribute-encoder"],function(e,t){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"default",{enumerable:!0,get:function(){return(e=t,e&&e.__esModule?e:{default:e}).default;var e}})}),define("can/es/can-child-nodes",["exports","can-child-nodes"],function(e,t){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"default",{enumerable:!0,get:function(){return(e=t,e&&e.__esModule?e:{default:e}).default;var e}})}),define("can/es/can-control",["exports","can-control"],function(e,t){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"default",{enumerable:!0,get:function(){return(e=t,e&&e.__esModule?e:{default:e}).default;var e}})}),define("can/es/can-dom-events",["exports","can-dom-events"],function(e,t){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"default",{enumerable:!0,get:function(){return(e=t,e&&e.__esModule?e:{default:e}).default;var e}})}),define("can-dom-mutate/events/events",["require","exports","module","can-dom-mutate","can-namespace"],function(e,t,n){"use strict";var r=e("can-dom-mutate"),a=e("can-namespace");function i(e,n,o){var s=new Map;return{_subscriptions:s,defaultEventType:e,addEventListener:function(r,a,e){var i=this.dispatch,t=s.get(r);t||(t={removeListener:null,listeners:new Set},s.set(r,t)),0===t.listeners.size&&(t.removeListener=n(r,function(e){var t={type:a};for(var n in e)t[n]=e[n];i(r,t,!1!==o)})),t.listeners.add(e),r.addEventListener(a,e)},removeEventListener:function(e,t,n){e.removeEventListener(t,n);var r=s.get(e);r&&(r.listeners.delete(n),0===r.listeners.size&&(r.removeListener(),s.delete(e)))}}}n.exports=a.domMutateDomEvents={attributes:i("attributes",r.onNodeAttributeChange),inserted:i("inserted",r.onNodeInsertion,!1),removed:i("removed",r.onNodeRemoval)}}),define("can-dom-mutate/dom-events",["require","exports","module","can-namespace","can-dom-mutate/events/events"],function(e,t,n){"use strict";var r=e("can-namespace"),a=e("can-dom-mutate/events/events");n.exports=r.domMutateDomEvents=a}),define("can/es/can-dom-mutate",["exports","can-dom-mutate","can-dom-mutate/node","can-dom-mutate/dom-events"],function(e,t,n,r){"use strict";function a(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"default",{enumerable:!0,get:function(){return a(t).default}}),Object.defineProperty(e,"domMutateNode",{enumerable:!0,get:function(){return a(n).default}}),Object.defineProperty(e,"domMutateDomEvents",{enumerable:!0,get:function(){return a(r).default}})}),define("can/es/can-fragment",["exports","can-fragment"],function(e,t){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"default",{enumerable:!0,get:function(){return(e=t,e&&e.__esModule?e:{default:e}).default;var e}})}),define("can/es/can-validate-interface",["exports","can-validate-interface"],function(e,t){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"default",{enumerable:!0,get:function(){return(e=t,e&&e.__esModule?e:{default:e}).default;var e}})}),define("can/es/can-data-types",["exports","can-data-types/maybe-boolean/maybe-boolean","can-data-types/maybe-date/maybe-date","can-data-types/maybe-number/maybe-number","can-data-types/maybe-string/maybe-string"],function(e,t,n,r,a){"use strict";function i(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"MaybeBoolean",{enumerable:!0,get:function(){return i(t).default}}),Object.defineProperty(e,"MaybeDate",{enumerable:!0,get:function(){return i(n).default}}),Object.defineProperty(e,"MaybeNumber",{enumerable:!0,get:function(){return i(r).default}}),Object.defineProperty(e,"MaybeString",{enumerable:!0,get:function(){return i(a).default}})}),define("can/es/can-namespace",["exports","can-namespace"],function(e,t){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"default",{enumerable:!0,get:function(){return(e=t,e&&e.__esModule?e:{default:e}).default;var e}})}),define("can/es/can-reflect",["exports","can-reflect"],function(e,t){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"default",{enumerable:!0,get:function(){return(e=t,e&&e.__esModule?e:{default:e}).default;var e}})}),define("can/es/can-reflect-dependencies",["exports","can-reflect-dependencies"],function(e,t){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"default",{enumerable:!0,get:function(){return(e=t,e&&e.__esModule?e:{default:e}).default;var e}})}),define("can/es/can-reflect-promise",["exports","can-reflect-promise"],function(e,t){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"default",{enumerable:!0,get:function(){return(e=t,e&&e.__esModule?e:{default:e}).default;var e}})}),define("can/core",["exports","can/es/can-define","can/es/can-value","can/es/can-observation","can/es/can-observation-recorder","can/es/can-simple-map","can/es/can-bind","can/es/can-event-queue","can/es/can-simple-observable","can/es/can-component","can/es/can-stache","can/es/can-stache-bindings","can/es/can-stache-route-helpers","can/es/can-view-callbacks","can/es/can-view-live","can/es/can-view-model","can/es/can-view-nodelist","can/es/can-view-parser","can/es/can-view-scope","can/es/can-view-target","can/es/can-fixture","can/es/can-query-logic","can/es/can-realtime-rest-model","can/es/can-rest-model","can/es/can-connect","can/es/can-local-store","can/es/can-memory-store","can/es/can-route","can/es/can-route-hash","can/es/can-route-pushstate","can/es/can-param","can/es/can-deparam","can/es/can-assign","can/es/can-define-lazy-value","can/es/can-diff","can/es/can-globals","can/es/can-key","can/es/can-key-tree","can/es/can-make-map","can/es/can-parse-uri","can/es/can-queues","can/es/can-string","can/es/can-string-to-any","can/es/can-ajax","can/es/can-attribute-encoder","can/es/can-child-nodes","can/es/can-control","can/es/can-dom-events","can/es/can-dom-mutate","can/es/can-fragment","can/es/can-validate-interface","can-cid","can-construct","can/es/can-data-types","can/es/can-namespace","can/es/can-reflect","can/es/can-reflect-dependencies","can/es/can-reflect-promise","can/enable-can-debug"],function(e,t,n,r,a,i,o,s,c,u,l,f,d,p,h,v,g,y,m,b,w,_,x,E,k,O,N,L,V,D,S,P,M,q,C,j,T,I,A,K,R,B,F,H,U,z,G,W,Y,$,Q,J,X,Z,ee,te,ne,re){"use strict";function ae(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(e,"__esModule",{value:!0}),e.reflectPromise=e.reflectDependencies=e.Reflect=e.can=e.default=e.MaybeString=e.MaybeNumber=e.MaybeDate=e.MaybeBoolean=e.Construct=e.cid=e.makeInterfaceValidator=e.fragment=e.domMutateDomEvents=e.domMutateNode=e.domMutate=e.domEvents=e.Control=e.childNodes=e.attributeEncoder=e.ajax=e.stringToAny=e.string=e.queues=e.parseURI=e.makeMap=e.KeyTree=e.key=e.globals=e.diff=e.defineLazyValue=e.assign=e.deparam=e.param=e.RoutePushstate=e.RouteHash=e.route=e.memoryStore=e.localStore=e.connect=e.restModel=e.realtimeRestModel=e.QueryLogic=e.fixture=e.target=e.Scope=e.viewParser=e.nodeList=e.viewModel=e.viewLive=e.viewCallbacks=e.stacheRouteHelpers=e.stacheBindings=e.stache=e.Component=e.SimpleObservable=e.valueEventBindings=e.mapEventBindings=e.bind=e.SimpleMap=e.ObservationRecorder=e.Observation=e.value=e.DefineList=e.DefineMap=e.define=void 0,Object.defineProperty(e,"define",{enumerable:!0,get:function(){return t.define}}),Object.defineProperty(e,"DefineMap",{enumerable:!0,get:function(){return t.DefineMap}}),Object.defineProperty(e,"DefineList",{enumerable:!0,get:function(){return t.DefineList}}),Object.defineProperty(e,"value",{enumerable:!0,get:function(){return ae(n).default}}),Object.defineProperty(e,"Observation",{enumerable:!0,get:function(){return ae(r).default}}),Object.defineProperty(e,"ObservationRecorder",{enumerable:!0,get:function(){return ae(a).default}}),Object.defineProperty(e,"SimpleMap",{enumerable:!0,get:function(){return ae(i).default}}),Object.defineProperty(e,"bind",{enumerable:!0,get:function(){return ae(o).default}}),Object.defineProperty(e,"mapEventBindings",{enumerable:!0,get:function(){return s.mapEventBindings}}),Object.defineProperty(e,"valueEventBindings",{enumerable:!0,get:function(){return s.valueEventBindings}}),Object.defineProperty(e,"SimpleObservable",{enumerable:!0,get:function(){return ae(c).default}}),Object.defineProperty(e,"Component",{enumerable:!0,get:function(){return ae(u).default}}),Object.defineProperty(e,"stache",{enumerable:!0,get:function(){return ae(l).default}}),Object.defineProperty(e,"stacheBindings",{enumerable:!0,get:function(){return ae(f).default}}),Object.defineProperty(e,"stacheRouteHelpers",{enumerable:!0,get:function(){return ae(d).default}}),Object.defineProperty(e,"viewCallbacks",{enumerable:!0,get:function(){return ae(p).default}}),Object.defineProperty(e,"viewLive",{enumerable:!0,get:function(){return ae(h).default}}),Object.defineProperty(e,"viewModel",{enumerable:!0,get:function(){return ae(v).default}}),Object.defineProperty(e,"nodeList",{enumerable:!0,get:function(){return ae(g).default}}),Object.defineProperty(e,"viewParser",{enumerable:!0,get:function(){return ae(y).default}}),Object.defineProperty(e,"Scope",{enumerable:!0,get:function(){return ae(m).default}}),Object.defineProperty(e,"target",{enumerable:!0,get:function(){return ae(b).default}}),Object.defineProperty(e,"fixture",{enumerable:!0,get:function(){return ae(w).default}}),Object.defineProperty(e,"QueryLogic",{enumerable:!0,get:function(){return ae(_).default}}),Object.defineProperty(e,"realtimeRestModel",{enumerable:!0,get:function(){return ae(x).default}}),Object.defineProperty(e,"restModel",{enumerable:!0,get:function(){return ae(E).default}}),Object.defineProperty(e,"connect",{enumerable:!0,get:function(){return ae(k).default}}),Object.defineProperty(e,"localStore",{enumerable:!0,get:function(){return ae(O).default}}),Object.defineProperty(e,"memoryStore",{enumerable:!0,get:function(){return ae(N).default}}),Object.defineProperty(e,"route",{enumerable:!0,get:function(){return ae(L).default}}),Object.defineProperty(e,"RouteHash",{enumerable:!0,get:function(){return ae(V).default}}),Object.defineProperty(e,"RoutePushstate",{enumerable:!0,get:function(){return ae(D).default}}),Object.defineProperty(e,"param",{enumerable:!0,get:function(){return ae(S).default}}),Object.defineProperty(e,"deparam",{enumerable:!0,get:function(){return ae(P).default}}),Object.defineProperty(e,"assign",{enumerable:!0,get:function(){return ae(M).default}}),Object.defineProperty(e,"defineLazyValue",{enumerable:!0,get:function(){return ae(q).default}}),Object.defineProperty(e,"diff",{enumerable:!0,get:function(){return ae(C).default}}),Object.defineProperty(e,"globals",{enumerable:!0,get:function(){return ae(j).default}}),Object.defineProperty(e,"key",{enumerable:!0,get:function(){return ae(T).default}}),Object.defineProperty(e,"KeyTree",{enumerable:!0,get:function(){return ae(I).default}}),Object.defineProperty(e,"makeMap",{enumerable:!0,get:function(){return ae(A).default}}),Object.defineProperty(e,"parseURI",{enumerable:!0,get:function(){return ae(K).default}}),Object.defineProperty(e,"queues",{enumerable:!0,get:function(){return ae(R).default}}),Object.defineProperty(e,"string",{enumerable:!0,get:function(){return ae(B).default}}),Object.defineProperty(e,"stringToAny",{enumerable:!0,get:function(){return ae(F).default}}),Object.defineProperty(e,"ajax",{enumerable:!0,get:function(){return ae(H).default}}),Object.defineProperty(e,"attributeEncoder",{enumerable:!0,get:function(){return ae(U).default}}),Object.defineProperty(e,"childNodes",{enumerable:!0,get:function(){return ae(z).default}}),Object.defineProperty(e,"Control",{enumerable:!0,get:function(){return ae(G).default}}),Object.defineProperty(e,"domEvents",{enumerable:!0,get:function(){return ae(W).default}}),Object.defineProperty(e,"domMutate",{enumerable:!0,get:function(){return ae(Y).default}}),Object.defineProperty(e,"domMutateNode",{enumerable:!0,get:function(){return Y.domMutateNode}}),Object.defineProperty(e,"domMutateDomEvents",{enumerable:!0,get:function(){return Y.domMutateDomEvents}}),Object.defineProperty(e,"fragment",{enumerable:!0,get:function(){return ae($).default}}),Object.defineProperty(e,"makeInterfaceValidator",{enumerable:!0,get:function(){return ae(Q).default}}),Object.defineProperty(e,"cid",{enumerable:!0,get:function(){return ae(J).default}}),Object.defineProperty(e,"Construct",{enumerable:!0,get:function(){return ae(X).default}}),Object.defineProperty(e,"MaybeBoolean",{enumerable:!0,get:function(){return Z.MaybeBoolean}}),Object.defineProperty(e,"MaybeDate",{enumerable:!0,get:function(){return Z.MaybeDate}}),Object.defineProperty(e,"MaybeNumber",{enumerable:!0,get:function(){return Z.MaybeNumber}}),Object.defineProperty(e,"MaybeString",{enumerable:!0,get:function(){return Z.MaybeString}}),Object.defineProperty(e,"default",{enumerable:!0,get:function(){return ae(ee).default}}),Object.defineProperty(e,"can",{enumerable:!0,get:function(){return ae(ee).default}}),Object.defineProperty(e,"Reflect",{enumerable:!0,get:function(){return ae(te).default}}),Object.defineProperty(e,"reflectDependencies",{enumerable:!0,get:function(){return ae(ne).default}}),Object.defineProperty(e,"reflectPromise",{enumerable:!0,get:function(){return ae(re).default}})}),define("can-define-backup",["require","exports","module","can-reflect","can-simple-observable","can-diff/deep/deep","can-diff/map/map"],function(e,t,n){"use strict";var i=e("can-reflect"),r=e("can-simple-observable"),o=e("can-diff/deep/deep"),s=e("can-diff/map/map"),a=new WeakMap;function c(e){var t=a.get(e);return t||(t=new r,a.set(e,t)),t}n.exports=function(e){return function(e,t){for(var n in t)Object.defineProperty(e,n,{enumerable:!1,configurable:!0,writable:!0,value:t[n]})}(e.prototype,{backup:function(){var e=c(this);return i.setValue(e,this.serialize()),this},isDirty:function(e){var t=c(this),r=i.getValue(t);if(!r)return!1;var a=this.serialize();return(e?o(a,r):s(a,r).filter(function(e){if("set"!==e.type)return!0;var t=a[e.key],n=r[e.key];return!(t&&n&&"object"==typeof t&&"object"==typeof n)})).length},restore:function(e){var t=c(this),n=i.getValue(t),r=e?n:function(e,t){var n={};for(var r in e)"object"!=typeof e[r]||null===e[r]||e[r]instanceof Date?n[r]=e[r]:n[r]=t[r];return n}(n,this);if(this.isDirty(e))for(var a in r)this[a]=r[a];return this}}),e}}),define("can/es/can-define-backup",["exports","can-define-backup"],function(e,t){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"default",{enumerable:!0,get:function(){return(e=t,e&&e.__esModule?e:{default:e}).default;var e}})}),define("can-define-stream",["require","exports","module","can-define","can-assign","can-reflect"],function(e,t,n){"use strict";var c=e("can-define"),u=e("can-assign"),r=e("can-reflect");n.exports=function(s){return function(a){["toStream","toStreamFromProperty","toStreamFromEvent"].forEach(function(e){a.prototype[e]=function(){return s[e].apply(s,[this].concat([].slice.call(arguments)))}}),a.prototype.stream=a.prototype.toStream;var e=a.prototype._define.definitions,i=a.prototype._define.dataInitializers,o=a.prototype._define.computedInitializers;r.eachKey(e,function(e,t){var n=e.stream;if(n){var r=u({default:function(){return s.toCompute(n,this)}},c.types.compute);c.property(a.prototype,t,r,i,o)}})}}}),define("can/es/can-define-stream",["exports","can-define-stream"],function(e,t){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"default",{enumerable:!0,get:function(){return(e=t,e&&e.__esModule?e:{default:e}).default;var e}})}),define("can-kefir",["require","exports","module","kefir","can-symbol","can-reflect","can-event-queue/map/map","can-observation-recorder"],function(e,t,n){!function(e,t,n,r){"use strict";var a=t("kefir"),i=t("can-symbol"),o=t("can-reflect"),s=t("can-event-queue/map/map"),c=t("can-observation-recorder"),u=i.for("can.meta"),l=i.for("can.onKeyValue"),f=i.for("can.offKeyValue"),d={value:{on:"onValue",off:"offValue",handler:"onValueHandler",handlers:"onValueHandlers"},error:{on:"onError",off:"offError",handler:"onErrorHandler",handlers:"onErrorHandlers"}};function p(e){var t=e[u];return t||(t={},o.setKeyValue(e,u,t)),t}a&&(Object.isExtensible&&!Object.isExtensible(a)&&(a=a.Kefir),a.Observable.prototype._eventSetup=function(){var n=this,r=p(n);r.bound=!0,r.onValueHandler=function(e){var t=r.value;(r.value=e)!==t&&s.dispatch.call(n,{type:"value"},[e,t])},r.onErrorHandler=function(e){var t=r.error;r.error=e,s.dispatch.call(n,{type:"error"},[e,t])},n.onValue(r.onValueHandler),n.onError(r.onErrorHandler)},a.Observable.prototype._eventTeardown=function(){var e=p(this);e.bound=!1,this.offValue(e.onValueHandler),this.offError(e.onErrorHandler)},o.assignSymbols(a.Observable.prototype,{"can.onKeyValue":function(){return s[l].apply(this,arguments)},"can.offKeyValue":function(){return s[f].apply(this,arguments)},"can.getKeyValue":function(e){var t=p(this);if(!d[e])return this[e];if(c.add(this,e),t.bound)return t[e];var n=function(e,t){if(e._currentEvent&&e._currentEvent.type===t)return e._currentEvent.value;var n=d[t];if(!n)return e[t];var r,a=function(e){r=e};return e[n.on](a),e[n.off](a),r}(this,e);return t[e]=n},"can.getValueDependencies":function(){var e;if(null!=this._source?e=[this._source]:null!=this._sources&&(e=this._sources),null!=e)return{valueDependencies:new Set(e)}}}),a.emitterProperty=function(){var t,n,r=!1,e=a.stream(function(e){return t=e,r&&t.value(n),function(){t=void 0}}).toProperty(function(){return n});return e.emitter={value:function(e){if(t)return t.emit(e);r=!0,n=e},error:function(e){if(t)return t.error(e);e}},e.emitter.emit=e.emitter.value,o.assignSymbols(e,{"can.setKeyValue":function(e,t){this.emitter[e](t)}}),e}),r.exports=a}(0,e,0,n)}),define("can-compute/proto-compute",["require","exports","module","can-observation","can-observation-recorder","can-event-queue/map/map","can-stache-key","can-key/get/get","can-assign","can-reflect","can-single-reference"],function(e,t,n){"use strict";var i=e("can-observation"),s=e("can-observation-recorder"),o=e("can-event-queue/map/map"),f=e("can-stache-key"),c=e("can-key/get/get"),u=e("can-assign"),d=e("can-reflect"),a=e("can-single-reference"),l=function(e,t,n,r){for(var a=[],i=0,o=arguments.length;i<o;i++)a[i]=arguments[i];var s=typeof a[1];if("function"==typeof a[0])this._setupGetterSetterFn(a[0],a[1],a[2],a[3]);else if(void 0!==a[1])if("string"===s||"number"===s){var c=d.isObservableLike(a[0])&&d.isListLike(a[0]);if(d.isObservableLike(a[0])&&d.isMapLike(a[0])||c){var u=a[0],l=a[1];this._setupGetterSetterFn(function(e){if(!arguments.length)return c&&f.get(u,"length"),f.get(u,""+l);f.set(u,l,e)},a[1],a[2],a[3])}else this._setupProperty(a[0],a[1],a[2])}else"function"===s?this._setupSetter(a[0],a[1],a[2]):a[1]&&a[1].fn?this._setupAsyncCompute(a[0],a[1]):this._setupSettings(a[0],a[1]);else this._setupSimpleValue(a[0]);this._args=a,this._primaryDepth=0,this.isComputed=!0},p=function(e,t,n){var r=new i(t,n,e),a=e.updater.bind(e);return"production"!==process.env.NODE_ENV&&Object.defineProperty(a,"name",{value:d.getName(e)+".updater"}),e.observation=r,{_on:function(){d.onValue(r,a,"notify"),r.hasOwnProperty("_value")?e.value=r._value:e.value=r.value},_off:function(){d.offValue(r,a,"notify")},getDepth:function(){return r.getDepth()}}};o(l.prototype),u(l.prototype,{setPrimaryDepth:function(e){this._primaryDepth=e},_setupGetterSetterFn:function(e,t,n){this._set=t?e.bind(t):e,this._get=t?e.bind(t):e,this._canObserve=!1!==n;var r=p(this,e,t||this);u(this,r)},_setupProperty:function(r,a,t){var n,e=this;n=function(){e.updater(e._get(),e.value)},this._get=function(){return c(r,a)},this._set=function(e){var t=a.split("."),n=t.pop();t.length?c(r,t.join("."))[n]=e:r[a]=e},this._on=function(e){o.on.call(r,t||a,n),this.value=this._get()},this._off=function(){return o.off.call(r,t||a,n)}},_setupSetter:function(e,t,n){this.value=e,this._set=t,u(this,n)},_setupSettings:function(e,t){if(this.value=e,this._set=t.set||this._set,this._get=t.get||this._get,!t.__selfUpdater){var n=this,r=this.updater;this.updater=function(){r.call(n,n._get(),n.value)}}this._on=t.on?t.on:this._on,this._off=t.off?t.off:this._off},_setupAsyncCompute:function(e,t){var n,r=this,a=t.fn;if(this.value=e,this._setUpdates=!0,this.lastSetValue=new l(e),this._set=function(e){return e===r.lastSetValue.get()?this.value:r.lastSetValue.set(e)},this._get=function(){return a.call(t.context,r.lastSetValue.get())},0===a.length)n=p(this,a,t.context);else if(1===a.length)n=p(this,function(){return a.call(t.context,r.lastSetValue.get())},t);else{var i=this.updater,o=s.ignore(function(e){i.call(r,e,r.value)});this.updater=function(e){i.call(r,e,r.value)},n=p(this,function(){var e=a.call(t.context,r.lastSetValue.get(),o);return void 0!==e?e:this.value},this)}u(this,n)},_setupSimpleValue:function(e){this.value=e},_eventSetup:s.ignore(function(){this.bound=!0,this._on(this.updater)}),_eventTeardown:function(){this._off(this.updater),this.bound=!1},clone:function(e){return e&&"function"==typeof this._args[0]?this._args[1]=e:e&&(this._args[2]=e),new l(this._args[0],this._args[1],this._args[2],this._args[3])},_on:function(){},_off:function(){},get:function(){return s.isRecording()&&!1!==this._canObserve&&(s.add(this,"change"),this.bound||l.temporarilyBind(this)),this.bound?this.observation?this.observation.get():this.value:this._get()},_get:function(){return this.value},set:function(e){var t=this.value,n=this._set(e,t);return this._setUpdates?this.value:this.hasDependencies?this._get():(this.updater(void 0===n?this._get():n,t),this.value)},_set:function(e){return this.value=e},updater:function(e,t,n){this.value=e;var r,a,i,o,s=this.observation;s&&(s.hasOwnProperty("_value")?s._value=e:s.value=e),r=this,o=n,(a=e)!==(i=t)&&(a==a||i==i)&&r.dispatch({type:"change",batchNum:o},[a,i])},toFunction:function(){return this._computeFn.bind(this)},_computeFn:function(e){return arguments.length?this.set(e):this.get()}}),l.prototype.on=l.prototype.bind=l.prototype.addEventListener,l.prototype.off=l.prototype.unbind=l.prototype.removeEventListener;var r=function(){return this.observation&&this.observation.hasDependencies()};Object.defineProperty(l.prototype,"hasDependencies",{get:r}),l.temporarilyBind=i.temporarilyBind,l.async=function(e,t,n){return new l(e,{fn:t,context:n})},l.truthy=function(t){return new l(function(){var e=t.get();return"function"==typeof e&&(e=e.get()),!!e})},d.assignSymbols(l.prototype,{"can.isValueLike":!0,"can.isMapLike":!1,"can.isListLike":!1,"can.setValue":l.prototype.set,"can.getValue":l.prototype.get,"can.valueHasDependencies":r,"can.onValue":function(r,e){function t(e,t,n){r(t,n)}a.set(r,this,t),"production"!==process.env.NODE_ENV&&Object.defineProperty(t,"name",{value:d.getName(r)+"::onValue"}),this.addEventListener("change",t,e)},"can.offValue":function(e,t){this.removeEventListener("change",a.getAndDelete(e,this),t)},"can.getValueDependencies":function(){var e;return this.observation&&(e={valueDependencies:new Set([this.observation])}),e}}),n.exports=l}),define("can-compute",["require","exports","module","can-compute/proto-compute","can-namespace","can-single-reference","can-reflect/reflections/get-set/get-set","can-symbol"],function(e,t,n){"use strict";var i=e("can-compute/proto-compute"),r=e("can-namespace"),a=e("can-single-reference"),o=e("can-reflect/reflections/get-set/get-set"),s=e("can-symbol"),c=s.for("can.onValue"),u=s.for("can.offValue"),l=s.for("can.getValue"),f=s.for("can.setValue"),d=s.for("can.isValueLike"),p=s.for("can.isMapLike"),h=s.for("can.isListLike"),v=s.for("can.isFunctionLike"),g=s.for("can.valueHasDependencies"),y=s.for("can.getValueDependencies"),m=function(e,t){var n,r=this;return t&&(n=function(){t.apply(r,arguments)},a.set(t,this,n)),r.computeInstance.addEventListener(e,n)},b=function(e,t){var n=[];return void 0!==e&&(n.push(e),void 0!==t&&n.push(a.getAndDelete(t,this))),this.computeInstance.removeEventListener.apply(this.computeInstance,n)},w=function(e,t){return this.computeInstance[c](e,t)},_=function(e,t){return this.computeInstance[u](e,t)},x=function(){return this.computeInstance.get()},E=function(e){return this.computeInstance.set(e)},k=function(){return this.computeInstance.hasDependencies},O=function(){return this.computeInstance[y]()},N=function(t,n,e,r){function a(e){return arguments.length?a.computeInstance.set(e):a.computeInstance.get()}return a.computeInstance=new i(t,n,e,r),a.on=a.bind=a.addEventListener=m,a.off=a.unbind=a.removeEventListener=b,a.isComputed=a.computeInstance.isComputed,a.clone=function(e){return"function"==typeof t&&(n=e),N(t,n,e,r)},o.set(a,c,w),o.set(a,u,_),o.set(a,l,x),o.set(a,f,E),o.set(a,d,!0),o.set(a,p,!1),o.set(a,h,!1),o.set(a,v,!1),o.set(a,g,k),o.set(a,y,O),a};N.truthy=function(e){return N(function(){return!!e()})},N.async=function(e,t,n){return N(e,{fn:t,context:n})},N.temporarilyBind=i.temporarilyBind,n.exports=r.compute=N}),define("can-stream",["require","exports","module","can-assign","can-compute","can-reflect","can-namespace"],function(e,t,n){"use strict";var o=e("can-assign"),u=e("can-compute"),i=e("can-reflect"),r=e("can-namespace"),l=function(t,r){var a,i;return u(void 0,{on:function(n){a=function(e,t){i=o({args:[].slice.call(arguments,1)},e),n()},t.on(r,a)},off:function(e){t.off(r,a),i=void 0},get:function(){return i}})},a=function(r){var a;return((a=function(){if(1===arguments.length)return r.toStream(arguments[0]);if(1<arguments.length){var e=arguments[0],t=arguments[1].trim();if(-1===t.indexOf(" "))return 0===t.indexOf(".")?a.toStreamFromProperty(e,t.slice(1)):a.toStreamFromEvent(e,t);var n=t.split(" ");return a.toStreamFromEvent(e,n[0].slice(1),n[1])}}).toStream=a).toStreamFromProperty=function(e,t){return r.toStream(u(e,t))},a.toStreamFromEvent=function(){var a,e,i,t,n=arguments[0];if(2===arguments.length)return t=l(n,arguments[1]),r.toStream(t);e=arguments[1],a=arguments[2],i=n[e];var o,s,c=u(n,e);return t=u(void 0,{on:function(r){o=function(e,t,n){r(i=t)},s=function(e,t,n){n.off(a,o),t.on(a,o)},c.on("change",s),c().on(a,o)},off:function(){c().off(a,o),c.off("change",s)},get:function(){return i},set:function(e){throw new Error("can-stream: you can't set this type of compute")}}),r.toStream(t)},a.toCompute=function(e,t){var n=i.toArray(arguments);return r.toCompute.apply(this,n)},a};a.toComputeFromEvent=l,n.exports=r.stream=a}),define("can-stream-kefir",["require","exports","module","can-kefir","can-compute","can-stream","can-symbol","can-namespace"],function(e,t,n){"use strict";var u=e("can-kefir"),l=e("can-compute"),r=e("can-stream"),a=e("can-symbol"),i=e("can-namespace"),o=a.for("can.getValueDependencies"),f=a.for("can.getKeyDependencies"),s={toStream:function(r){var e=u.stream(function(n){var e=function(e,t){n.emit(t)};r.on("change",e);var t=r();return void 0!==t&&n.emit(t),function(){r.off("change",e)}});return e[o]=function(){return{valueDependencies:new Set([r])}},e},toCompute:function(e,t){var n,r,a,i,o=u.stream(function(e){n=e,void 0!==i&&n.emit(i)}),s=e.call(t,o),c=l(void 0,{get:function(){return r},set:function(e){return n?n.emit(e):i=e,e},on:function(t){a=function(e){r=e,t()},s.onValue(a)},off:function(){s.offValue(a)}});return c.computeInstance[f]=function(e){if("change"===e)return{valueDependencies:new Set([s])}},c}};i.streamKefir||(n.exports=i.streamKefir=r(s))}),define("can-define-stream-kefir",["require","exports","module","can-namespace","can-define-stream","can-stream-kefir"],function(e,t,n){"use strict";var r=e("can-namespace"),a=e("can-define-stream"),i=e("can-stream-kefir");n.exports=r.defineStreamKefir=a(i)}),define("can/es/can-define-stream-kefir",["exports","can-define-stream-kefir"],function(e,t){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"default",{enumerable:!0,get:function(){return(e=t,e&&e.__esModule?e:{default:e}).default;var e}})}),define("can/es/can-kefir",["exports","can-kefir"],function(e,t){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"default",{enumerable:!0,get:function(){return(e=t,e&&e.__esModule?e:{default:e}).default;var e}})}),define("can-observe/src/-symbols",["require","exports","module","can-symbol"],function(e,t,n){"use strict";var r=e("can-symbol");n.exports={metaSymbol:r.for("can.meta"),patchesSymbol:"can.patches",keysSymbol:"can.keys"}}),define("can-observe/src/-observable-store",function(e,t,n){"use strict";n.exports={proxiedObjects:new WeakMap,proxies:new WeakSet}}),define("can-observe/src/-helpers",["require","exports","module","can-symbol"],function(require,exports,module){"use strict";var canSymbol=require("can-symbol"),metaSymbol=canSymbol.for("can.meta"),classTest=/^\s*class\s+/,helpers={assignEverything:function(t,n){return Object.getOwnPropertyNames(n).concat(Object.getOwnPropertySymbols(n)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}),t},isBuiltInButNotArrayOrPlainObject:function(e){if(Array.isArray(e))return!1;if("function"==typeof e)return 0<e.toString().indexOf("[native code]");var t=Object.prototype.toString.call(e);return"[object Object]"!==t&&-1!==t.indexOf("[object ")},inheritsFromArray:function(e){var t=e;do{if(Array.isArray(t))return!0;t=Object.getPrototypeOf(t)}while(t);return!1},isClass:function(e){return"function"==typeof e&&classTest.test(e.toString())},supportsClass:function(){try{return eval('"use strict"; class A{};'),!0}catch(e){return!1}}(),makeSimpleExtender:function(a){return function(e,t,n){var r=function(){var e=a.apply(this,arguments);return this.init&&(e[metaSymbol].preventSideEffects++,this.init.apply(e,arguments),e[metaSymbol].preventSideEffects--),e};return helpers.assignEverything(r,a),helpers.assignEverything(r,t||{}),r.extend=helpers.makeSimpleExtender(r),r.prototype=Object.create(a.prototype),helpers.assignEverything(r.prototype,n||{}),r.prototype.constructor=r,"production"!==process.env.NODE_ENV&&Object.defineProperty(r,"name",{value:e}),r}},assignNonEnumerable:function(e,t,n){return Object.defineProperty(e,t,{enumerable:!1,writable:!0,configurable:!0,value:n})}};module.exports=helpers}),define("can-observe/src/-computed-helpers",["require","exports","module","can-observation","can-observation-recorder","can-event-queue/map/map","can-reflect","can-symbol"],function(e,t,n){"use strict";var i=e("can-observation"),r=e("can-observation-recorder"),a=e("can-event-queue/map/map"),o=e("can-reflect"),s=e("can-symbol"),c=s.for("can.meta"),u=s.for("can.computedPropertyDefinitions"),l=s.for("can.onKeyValue"),f=s.for("can.offKeyValue");function d(e,t,n){this.instance=e,this.prop=t,this.observation=n,this.forward=this.forward.bind(this)}function p(e,t){var n=e[c],r=n.target[u];if(void 0!==r){var a=r[t];if(void 0!==a)return void 0===n.computedKeys[t]&&(n.computedKeys[t]=new d(e,t,a(e,t))),n.computedKeys[t]}}d.prototype.bind=function(){this.bindingCount++,1===this.bindingCount&&this.observation.on(this.forward,"notify")},d.prototype.unbind=function(){this.bindingCount--,0===this.bindingCount&&this.observation.off(this.forward,"notify")},d.prototype.forward=function(e,t){a.dispatch.call(this.instance,{type:this.prop,target:this.instance},[e,t])},d.prototype.bindingCount=0;var h=n.exports={get:function(e,t){var n=p(e,t);if(void 0!==n)return r.add(e,t.toString()),0===n.bindingCount&&r.isRecording()&&i.temporarilyBind(n.observation),{value:o.getValue(n.observation)}},set:function(e,t,n){var r=p(e,t);if(void 0===r)return!1;if("production"!==process.env.NODE_ENV&&void 0===r.observation[s.for("can.setValue")])throw new Error('Cannot set "'+t+'" on '+o.getName(e));return o.setValue(r.observation,n),!0},bind:function(e,t){var n=p(e,t);void 0!==n&&n.bind()},unbind:function(e,t){var n=p(e,t);void 0!==n&&n.unbind()},addKeyDependencies:function(e){var r=e[l],a=e[f];o.assignSymbols(e,{"can.onKeyValue":function(e,t,n){return h.bind(this,e),r.apply(this,arguments)},"can.offKeyValue":function(e,t,n){return h.unbind(this,e),a.apply(this,arguments)},"can.getKeyDependencies":function(e){var t=p(this,e);if(void 0!==t)return{valueDependencies:new Set([t.observation])}}})},addMethodsAndSymbols:function(e){e.prototype.addEventListener=function(e,t,n){return h.bind(this,e),a.addEventListener.call(this,e,t,n)},e.prototype.removeEventListener=function(e,t,n){return h.unbind(this,e),a.removeEventListener.call(this,e,t,n)}},ensureDefinition:function(r){if(!r.hasOwnProperty(u)){var e=r[u],a=r[u]=Object.create(e||null);Object.getOwnPropertyNames(r).forEach(function(e){if("constructor"!==e){var t=Object.getOwnPropertyDescriptor(r,e);if(void 0!==t.get){var n=t.get;a[e]=function(e,t){return new i(n,e)}}}})}return r[u]}}}),define("can-observe/src/-make-object",["require","exports","module","can-reflect","can-observation-recorder","can-event-queue/map/map","can-observe/src/-symbols","can-observe/src/-observable-store","can-observe/src/-helpers","can-observe/src/-computed-helpers"],function(e,t,n){"use strict";var s=e("can-reflect"),c=e("can-observation-recorder"),u=e("can-event-queue/map/map"),a=e("can-observe/src/-symbols"),o=e("can-observe/src/-observable-store"),i=e("can-observe/src/-helpers"),l=e("can-observe/src/-computed-helpers"),f=Object.prototype.hasOwnProperty,d=s.isSymbolLike,r=Object.create(null);Object.getOwnPropertySymbols(u).forEach(function(e){i.assignNonEnumerable(r,e,u[e])}),l.addKeyDependencies(r);var p={observable:function(e,t){void 0===t.shouldRecordObservation&&(t.shouldRecordObservation=p.shouldRecordObservationOnOwnAndMissingKeys);var n={target:e,proxyKeys:void 0!==t.proxyKeys?t.proxyKeys:Object.create(p.proxyKeys()),computedKeys:Object.create(null),options:t,preventSideEffects:0};i.assignNonEnumerable(n.proxyKeys,a.metaSymbol,n);var r={get:p.get.bind(n),set:p.set.bind(n),ownKeys:p.ownKeys.bind(n),deleteProperty:p.deleteProperty.bind(n),getOwnPropertyDescriptor:p.getOwnPropertyDescriptor.bind(n),meta:n};return t.getPrototypeOf&&(r.getPrototypeOf=t.getPrototypeOf),n.proxy=new Proxy(e,r),u.addHandlers(n.proxy,n),n.proxy},proxyKeys:function(){return r},get:function(e,t,n){var r=this.proxyKeys[t];if(void 0!==r)return r;if(d(t))return e[t];var a=l.get(n,t);if(void 0!==a)return a.value;var i=p.getKeyInfo(e,t,n,this),o=i.targetValue;return i.valueIsInvariant||(o=p.getValueFromStore(t,o,this)),this.options.shouldRecordObservation(i,this)&&c.add(this.proxy,t.toString()),i.parentObservableGetCalledOn&&c.add(i.parentObservableGetCalledOn,t.toString()),o},set:function(e,t,n,r){return r!==this.proxy?p.setKey(r,t,n,this):(!0===l.set(r,t,n)||(n=p.getValueToSet(t,n,this),p.setValueAndOnChange(t,n,this,function(e,t,n,r,a){var i=[s.getName(n.proxy)+" set",e,"to",t],o={type:e,patches:[{key:e,type:r?"set":"add",value:t}],keyChanged:r?void 0:e};"production"!==process.env.NODE_ENV&&(o.reasonLog=i),u.dispatch.call(n.proxy,o,[t,a])})),!0)},deleteProperty:function(e,t){var n=this.target[t],r=delete this.target[t];if(r&&0===this.preventSideEffects&&void 0!==n){var a=[s.getName(this.proxy)+" deleted",t],i={type:t,patches:[{key:t,type:"delete"}],keyChanged:t};"production"!==process.env.NODE_ENV&&(i.reasonLog=a),u.dispatch.call(this.proxy,i,[void 0,n])}return r},ownKeys:function(e,t){return c.add(this.proxy,a.keysSymbol),Object.getOwnPropertyNames(this.target).concat(Object.getOwnPropertySymbols(this.target)).concat(Object.getOwnPropertySymbols(this.proxyKeys))},getOwnPropertyDescriptor:function(e,t){var n=Object.getOwnPropertyDescriptor(e,t);return!n&&t in this.proxyKeys?Object.getOwnPropertyDescriptor(this.proxyKeys,t):n},getKeyInfo:function(e,t,n,r){var a=Object.getOwnPropertyDescriptor(e,t),i={key:t,descriptor:a,targetHasOwnKey:Boolean(a),getCalledOnParent:n!==r.proxy,protoHasKey:!1,valueIsInvariant:!1,targetValue:void 0,isAccessor:!1};return!0===i.getCalledOnParent&&(i.parentObservableGetCalledOn=o.proxiedObjects.get(n)),void 0!==a?(i.valueIsInvariant=!1===a.writable,void 0!==a.get?(i.targetValue=a.get.call(i.parentObservableGetCalledOn||n),i.isAccessor=!0):i.targetValue=a.value):(i.targetValue=r.target[t],i.protoHasKey=void 0!==i.targetValue||t in e),i},shouldRecordObservationOnOwnAndMissingKeys:function(e,t){return 0===t.preventSideEffects&&!e.isAccessor&&(e.targetHasOwnKey||!e.protoHasKey&&!Object.isSealed(t.target))},setKey:function(e,t,n){return Object.defineProperty(e,t,{value:n,configurable:!0,enumerable:!0,writable:!0}),!0},getValueToSet:function(e,t,n){return!s.isSymbolLike(e)&&n.handlers.getNode([e])?p.getValueFromStore(e,t,n):t},getValueFromStore:function(e,t,n){return s.isPrimitive(t)||s.isObservableLike(t)||o.proxies.has(t)||(o.proxiedObjects.has(t)?t=o.proxiedObjects.get(t):i.isBuiltInButNotArrayOrPlainObject(t)||(t=n.options.observe(t))),t},setValueAndOnChange:function(e,t,n,r){var a,i=f.call(n.target,e),o=Object.getOwnPropertyDescriptor(n.target,e);o&&o.set?o.set.call(n.proxy,t):(a=n.target[e])!==t&&(n.target[e]=t,0===n.preventSideEffects&&r(e,t,n,i,a))}};n.exports=p}),define("can-observe/src/-make-array",["require","exports","module","can-observation-recorder","can-event-queue/map/map","can-reflect","can-observe/src/-make-object","can-observe/src/-symbols","can-observe/src/-observable-store","can-observe/src/-helpers","can-observe/src/-computed-helpers"],function(e,t,n){"use strict";var r=e("can-observation-recorder"),p=e("can-event-queue/map/map"),h=e("can-reflect"),a=e("can-observe/src/-make-object"),l=e("can-observe/src/-symbols"),i=e("can-observe/src/-observable-store"),o=e("can-observe/src/-helpers"),s=e("can-observe/src/-computed-helpers"),v=h.isSymbolLike,g=Number.isInteger||function(e){return"number"==typeof e&&isFinite(e)&&Math.floor(e)===e};var y={push:function(e,t){return[{index:e.length-t.length,deleteCount:0,insert:t,type:"splice"}]},pop:function(e){return[{index:e.length,deleteCount:1,insert:[],type:"splice"}]},shift:function(){return[{index:0,deleteCount:1,insert:[],type:"splice"}]},unshift:function(e,t){return[{index:0,deleteCount:0,insert:t,type:"splice"}]},splice:function(e,t){return[{index:t[0],deleteCount:t[1],insert:t.slice(2),type:"splice"}]},sort:function(e){return[{index:0,deleteCount:e.length,insert:e,type:"splice"}]},reverse:function(e,t,n){return[{index:0,deleteCount:e.length,insert:e,type:"splice"}]}};h.eachKey(y,function(s,c){var u=Array.prototype[c],e=function(){var e=this[l.metaSymbol],t=0===e.preventSideEffects,n=e.target.length;e.preventSideEffects++;var r=u.apply(e.target,arguments),a=s(e.target,Array.from(arguments),n);if(!0===t){var i=[h.getName(e.proxy)+"."+c+" called with",arguments],o={type:"length",patches:a};"production"!==process.env.NODE_ENV&&(o.reasonLog=i),p.dispatch.call(e.proxy,o,[e.target.length,n])}return e.preventSideEffects--,r};"production"!==process.env.NODE_ENV&&Object.defineProperty(e,"name",{value:c}),i.proxiedObjects.set(u,e),i.proxies.add(e)}),Object.getOwnPropertyNames(Array.prototype).forEach(function(e){var n=Array.prototype[e];if(!i.proxiedObjects.has(n)&&"constructor"!==e&&"function"==typeof n){var t=function(){r.add(this,l.patchesSymbol);var e=this[l.metaSymbol];e.preventSideEffects++;var t=n.apply(this,arguments);return e.preventSideEffects--,e.options.observe(t)};"production"!==process.env.NODE_ENV&&Object.defineProperty(t,"name",{value:e}),i.proxiedObjects.set(n,t),i.proxies.add(t)}});var c=o.assignEverything(Object.create(null),a.proxyKeys()),u={observable:function(e,t){void 0===t.shouldRecordObservation&&(t.shouldRecordObservation=a.shouldRecordObservationOnOwnAndMissingKeys);var n={target:e,proxyKeys:void 0!==t.proxyKeys?t.proxyKeys:Object.create(u.proxyKeys()),computedKeys:Object.create(null),options:t,preventSideEffects:0};return(n.proxyKeys[l.metaSymbol]=n).proxy=new Proxy(e,{get:a.get.bind(n),set:u.set.bind(n),ownKeys:a.ownKeys.bind(n),deleteProperty:a.deleteProperty.bind(n),meta:n}),p.addHandlers(n.proxy,n),n.proxy},proxyKeys:function(){return c},set:function(f,e,t,n){if(n!==this.proxy)return a.setKey(n,e,t,this);if(!0===s.set(n,e,t))return!0;t=a.getValueToSet(e,t,this);var d=f.length;return a.setValueAndOnChange(e,t,this,function(e,t,n,r,a){var i,o,s=[{key:e,type:r?"set":"add",value:t}],c=!v(e)&&+e;g(c)&&(!r&&d<c?s.push({index:d,deleteCount:0,insert:f.slice(d),type:"splice"}):s.push.apply(s,y.splice(f,[c,1,t]))),i=t,o=a,"length"===e&&i<o&&s.push({index:t,deleteCount:a-t,insert:[],type:"splice"});var u=[h.getName(n.proxy)+" set",e,"to",t],l={type:e,patches:s,keyChanged:r?void 0:e};"production"!==process.env.NODE_ENV&&(l.reasonLog=u),p.dispatch.call(n.proxy,l,[t,a])}),!0}};n.exports=u}),define("can-observe/src/-make-observe",["require","exports","module","can-reflect","can-observe/src/-observable-store","can-observe/src/-helpers"],function(e,t,n){"use strict";var r=e("can-reflect"),a=e("can-observe/src/-observable-store"),i=e("can-observe/src/-helpers"),o={observe:function(e){if(r.isPrimitive(e))return e;var t=a.proxiedObjects.get(e);return t||(a.proxies.has(e)?e:i.isBuiltInButNotArrayOrPlainObject(e)?e:(t="function"==typeof e?o.function(e):i.inheritsFromArray(e)?o.array(e):o.object(e),a.proxiedObjects.set(e,t),a.proxies.add(t),t))},object:null,array:null,function:null};n.exports=o}),define("can-observe/src/-make-function",["require","exports","module","can-reflect","can-observe/src/-make-object","can-observe/src/-make-observe","can-observe/src/-symbols","can-observe/src/-observable-store","can-event-queue/map/map","can-event-queue/type/type","can-observe/src/-helpers"],function(e,t,n){"use strict";var r=e("can-reflect"),i=e("can-observe/src/-make-object"),o=e("can-observe/src/-make-observe"),s=e("can-observe/src/-symbols"),c=e("can-observe/src/-observable-store"),u=e("can-event-queue/map/map"),l=e("can-event-queue/type/type"),f=e("can-observe/src/-helpers"),a=f.assignEverything(Object.create(null),i.proxyKeys());l(a),r.assignSymbols(a,{"can.defineInstanceKey":function(e,t){this[s.metaSymbol].definitions[e]=t}});var d={observable:function(e,t){void 0===t.shouldRecordObservation&&(t.shouldRecordObservation=i.shouldRecordObservationOnOwnAndMissingKeys);var n=Object.create(d.proxyKeys()),r={target:e,proxyKeys:n,computedKeys:Object.create(null),options:t,definitions:{},isClass:f.isClass(e),preventSideEffects:0};if((n[s.metaSymbol]=r).proxy=new Proxy(e,{get:i.get.bind(r),set:i.set.bind(r),ownKeys:i.ownKeys.bind(r),deleteProperty:i.deleteProperty.bind(r),construct:d.construct.bind(r),apply:d.apply.bind(r),meta:r}),u.addHandlers(r.proxy,r),l.addHandlers(r.proxy,r),c.proxiedObjects.set(e,r.proxy),c.proxies.add(r.proxy),r.target.prototype&&r.target.prototype.constructor===r.target){var a=i.observable(r.target.prototype,{getPrototypeOf:function(){return r.target.prototype},observe:o.observe});c.proxiedObjects.set(r.target.prototype,a),c.proxies.add(a),r.proxy.prototype.constructor=r.proxy}return r.proxy},construct:function(e,t,n){var r,a;if(this.isClass){for(a in r=Reflect.construct(e,t,n),this.definitions)Object.defineProperty(r,a,this.definitions[a]);return this.options.observe(r)}for(a in r=Object.create(this.proxy.prototype),this.definitions)Object.defineProperty(r,a,this.definitions[a]);var i=this.options.observe(r);i[s.metaSymbol].preventSideEffects++;var o=e.apply(i,t);return i[s.metaSymbol].preventSideEffects--,o||i},apply:function(e,t,n){var r=this.target.apply(t,n);return this.options.observe(r)},proxyKeys:function(){return a}};n.exports=d}),define("can-observe/src/-type-helpers",["require","exports","module","can-queues","can-reflect","can-symbol"],function(e,t,n){"use strict";var a=e("can-queues"),r=e("can-reflect"),i=e("can-symbol"),o=i.for("can.meta"),s=i.for("can.typeDefinitions"),c=n.exports={ensureDefinition:function(e){var t=e[s];if(!t){var n=e[s];t=e[s]=Object.create(n||null)}return t},addMethodsAndSymbols:function(e){r.assignSymbols(e,{"can.defineInstanceKey":function(e,t){c.ensureDefinition(this.prototype)[e]=t},"can.dispatchInstanceBoundChange":function(e,t){var n=this[o];if(n){var r=n.lifecycleHandlers;r&&a.enqueueByQueue(r.getNode([]),this,[e,t])}}})},shouldRecordObservationOnAllKeysExceptFunctionsOnProto:function(e,t){return 0===t.preventSideEffects&&!e.isAccessor&&(e.targetHasOwnKey||!e.protoHasKey&&!Object.isSealed(t.target)||e.protoHasKey&&"function"!=typeof targetValue)}}}),define("can-observe/object/object",["require","exports","module","can-reflect","can-symbol","can-observe/src/-make-observe","can-event-queue/map/map","can-event-queue/type/type","can-observe/src/-helpers","can-observe/src/-make-object","can-observe/src/-observable-store","can-observe/src/-computed-helpers","can-observe/src/-type-helpers"],function(e,t,n){"use strict";var o=e("can-reflect"),r=e("can-symbol"),s=e("can-observe/src/-make-observe"),a=e("can-event-queue/map/map"),i=e("can-event-queue/type/type"),c=e("can-observe/src/-helpers"),u=e("can-observe/src/-make-object"),l=e("can-observe/src/-observable-store"),f=r.for("can.typeDefinitions"),d=e("can-observe/src/-computed-helpers"),p=e("can-observe/src/-type-helpers"),h=c.assignEverything({},u.proxyKeys());d.addKeyDependencies(h);var v=function(e){var t=Object.getPrototypeOf(this);d.ensureDefinition(t),p.ensureDefinition(t);var n=t[f]||{};for(var r in n)Object.defineProperty(this,r,n[r]);void 0!==e&&o.assign(this,e);var a=Object.create(h);a.constructor=this.constructor;var i=u.observable(this,{observe:s.observe,proxyKeys:a,shouldRecordObservation:p.shouldRecordObservationOnAllKeysExceptFunctionsOnProto});return l.proxiedObjects.set(this,i),l.proxies.add(i),i};a(v.prototype),i(v),d.addMethodsAndSymbols(v),p.addMethodsAndSymbols(v),v.extend=c.makeSimpleExtender(v),n.exports=v}),define("can-observe/array/array",["require","exports","module","can-symbol","can-observe/src/-make-array","can-observe/src/-make-observe","can-event-queue/map/map","can-event-queue/type/type","can-observe/src/-helpers","can-observe/src/-observable-store","can-observe/src/-computed-helpers","can-observe/src/-type-helpers"],function(e,t,n){"use strict";var r,a=e("can-symbol"),o=e("can-observe/src/-make-array"),s=e("can-observe/src/-make-observe"),i=e("can-event-queue/map/map"),c=e("can-event-queue/type/type"),u=e("can-observe/src/-helpers"),l=e("can-observe/src/-observable-store"),f=e("can-observe/src/-computed-helpers"),d=e("can-observe/src/-type-helpers"),p=a.for("can.typeDefinitions"),h=u.assignEverything({},o.proxyKeys());(r=function(e){var t=Object.getPrototypeOf(this);f.ensureDefinition(t),d.ensureDefinition(t);var n=t[p]||{};for(var r in n)Object.defineProperty(this,r,n[r]);this.push.apply(this,e||[]);var a=Object.create(h);a.constructor=this.constructor;var i=o.observable(this,{observe:s.observe,proxyKeys:a,shouldRecordObservation:d.shouldRecordObservationOnAllKeysExceptFunctionsOnProto});return l.proxiedObjects.set(this,i),l.proxies.add(i),i}).prototype=Object.create(Array.prototype),i(r.prototype),c(r),f.addMethodsAndSymbols(r),d.addMethodsAndSymbols(r),r.extend=u.makeSimpleExtender(r),n.exports=r}),define("can-observe/decorators/decorators",["require","exports","module","can-reflect","can-simple-observable/async/async","can-simple-observable/resolver/resolver","can-observe/src/-computed-helpers"],function(e,t,n){"use strict";var s=e("can-reflect"),c=e("can-simple-observable/async/async"),a=e("can-simple-observable/resolver/resolver"),r=e("can-observe/src/-computed-helpers");function u(e,t,n){r.ensureDefinition(e)[t]=n}function i(t){function e(e){return 3===arguments.length?t({}).apply(null,arguments):t(e)}return"production"!==process.env.NODE_ENV&&Object.defineProperty(e,"name",{value:s.getName(t.name)}),e}n.exports={async:i(function(o){return function(r,a,e){if(void 0!==e.get){var i=e.get;if("production"!==process.env.NODE_ENV&&0!==i.length)throw new Error("async decorated "+a+" on "+s.getName(r)+": getters should take no arguments.");return u(r,a,function(e,t){function n(e,t){if(!t)return o.default;var n=i.call(this,!0);if(s.isPromise(n))return n.then(t),o.default;if(void 0!==n&&"production"!==process.env.NODE_ENV)throw new Error("async decorated "+a+" on "+s.getName(r)+": getters must return undefined or a promise.")}return"production"!==process.env.NODE_ENV&&s.assignSymbols(n,{"can.getName":function(){return s.getName(i)}}),new c(n,e,o.default)})}if(void 0!==e.value){var n=e.value;if("production"!==process.env.NODE_ENV&&1!==n.length)throw new Error("async decorated "+a+" on "+s.getName(r)+": methods should take 1 argument (resolve).");return u(r,a,function(e,t){return new c(function(e,t){return n.call(this,t)},e,o.default)})}if("production"!==process.env.NODE_ENV)throw new Error("async decorated "+a+" on "+s.getName(r)+": Unrecognized descriptor.")}}),resolver:i(function(e){return function(e,t,n){if(void 0!==n.value){var r=n.value;if("production"!==process.env.NODE_ENV&&1!==r.length)throw new Error("resolver decorated "+t+" on "+s.getName(e)+": methods should take 1 argument (value).");return u(e,t,function(e,t){return new a(r,e)})}if("production"!==process.env.NODE_ENV)throw new Error("resolver decorated "+t+" on "+s.getName(e)+": Unrecognized descriptor.")}})}}),define("can-observe",["require","exports","module","can-observe/src/-make-object","can-observe/src/-make-array","can-observe/src/-make-function","can-observe/src/-make-observe","can-observe/object/object","can-observe/array/array","can-observe/src/-computed-helpers","can-observe/decorators/decorators"],function(e,t,n){"use strict";var r=e("can-observe/src/-make-object"),a=e("can-observe/src/-make-array"),i=e("can-observe/src/-make-function"),o=e("can-observe/src/-make-observe"),s=e("can-observe/object/object"),c=e("can-observe/array/array"),u=e("can-observe/src/-computed-helpers"),l=e("can-observe/decorators/decorators");for(var f in o.object=function(e){return r.observable(e,o)},o.array=function(e){return a.observable(e,o)},o.function=function(e){return i.observable(e,o)},o.observe.Object=s,o.observe.Array=c,n.exports=o.observe,n.exports.defineProperty=function(e,t,n){u.ensureDefinition(e)[t]=n},l)n.exports[f]=l[f]}),define("can/es/can-observe",["exports","can-observe"],function(e,t){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"default",{enumerable:!0,get:function(){return(e=t,e&&e.__esModule?e:{default:e}).default;var e}})}),define("can/es/can-stream",["exports","can-stream"],function(e,t){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"default",{enumerable:!0,get:function(){return(e=t,e&&e.__esModule?e:{default:e}).default;var e}})}),define("can/es/can-stream-kefir",["exports","can-stream-kefir"],function(e,t){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"default",{enumerable:!0,get:function(){return(e=t,e&&e.__esModule?e:{default:e}).default;var e}})}),define("can-map-compat",["require","exports","module","can-key","can-reflect","can-log"],function(e,t,n){var i=e("can-key"),o=e("can-reflect"),s=e("can-log");function r(e,t){var n=e.prototype;if("function"==typeof n.attr)return e;var a=!0===t;return n.attr=function(e,t){a&&s.warn("can-map-compat is intended for migrating away from can-map. Remove all uses of .attr() to remove this warning.");var n=typeof e,r=arguments.length;return 0===r?o.unwrap(this):"string"!==n&&"number"!==n?(!0===t?o.updateDeep(this,e):o.assignDeep(this,e),this):1===r?i.get(this,e):(i.set(this,e,t),this)},n.removeAttr=function(e){var t=o.getKeyValue(this,e);return o.deleteKeyValue(this,e),t},e}(n.exports=function(e){return r(e,!0)}).makeCompat=r}),define("can/es/can-map-compat",["exports","can-map-compat"],function(e,t){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"default",{enumerable:!0,get:function(){return(e=t,e&&e.__esModule?e:{default:e}).default;var e}})}),define("can-stache-converters",["require","exports","module","can-reflect","can-stache","can-string-to-any","can-log/dev/dev","can-stache-bindings","can-stache-helpers"],function(e,t,n){"use strict";var s=e("can-reflect"),r=e("can-stache"),a=e("can-string-to-any"),c=e("can-log/dev/dev");e("can-stache-bindings");var i=e("can-stache-helpers"),o=!1;r("{{echo(args(1))}}")({echo:function(){},args:function(){o=1<arguments.length}}),r.registerConverter("boolean-to-inList",{get:function(e,t){return!!t&&-1!==t.indexOf(e)},set:function(e,t,n){if(n)if(e)n.push(t);else{var r=n.indexOf(t);-1!==r&&n.splice(r,1)}}});var u={"string-to-any":{get:function(e){return""+s.getValue(e)},set:function(e,t){var n=a(e);s.setValue(t,n)}},"index-to-selected":{get:function(e,t){var n=s.getValue(e);return s.getValue(t).indexOf(n)},set:function(e,t,n){var r=s.getValue(n)[e];s.setValue(t,r)}},"selected-to-index":{get:function(e,t){var n=s.getValue(e);return s.getValue(t)[n]},set:function(e,t,n){var r=s.getValue(n).indexOf(e);s.setValue(t,r)}},"either-or":{get:function(e,t,n){var r=s.getValue(e),a=s.getValue(t),i=s.getValue(n),o=a===r;return o||i===r?o:void("production"!==process.env.NODE_ENV&&c.warn("can-stache-converter.either-or:","`"+r+"`","does not match `"+a+"`","or `"+i+"`"))},set:function(e,t,n,r){var a=e?s.getValue(n):s.getValue(r);s.setValue(t,a)}},equal:{get:function(){var e=s.toArray(arguments);if(o&&e.pop(),1<e.length){var t=s.getValue(e.pop());return e.every(function(e){return s.getValue(e)===t})}},set:function(){var e=s.toArray(arguments);if(o&&e.pop(),2<e.length){var t=e.shift(),n=s.getValue(e.pop());if(t)for(var r=0;r<e.length;r++)s.setValue(e[r],n)}}}};r.addConverter(u),i.not||r.addConverter("not",{get:function(e){return!s.getValue(e)},set:function(e,t){s.setValue(t,!e)}}),n.exports=u}),define("can/es/can-stache-converters",["exports","can-stache-converters"],function(e,t){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"default",{enumerable:!0,get:function(){return(e=t,e&&e.__esModule?e:{default:e}).default;var e}})}),define("can-view-autorender",["require","exports","module","can-namespace","can-view-model","can-reflect","can-string","can-import-module","can-dom-events"],function(e,t,n){var r=e("can-namespace"),a=e("can-view-model"),o=e("can-reflect"),i=e("can-string").camelize,s=e("can-import-module"),c=e("can-dom-events"),u=/^(dataViewId|class|id|type|src|style)$/i,l=/\s*text\/(stache)\s*/;function f(e,t,n){var r=i(t);if(!u.test(r)){var a=e.getAttribute(t);o.hasKey(n,r)||o.defineInstanceKey(n.constructor,r,typeof a),o.setKeyValue(n,r,a)}}function d(e,t){e.nextSibling?e.parentNode.insertBefore(t,e.nextSibling):e.parentNode.appendChild(t)}function p(e,t,n){var r=e(t);!function(e,t){for(;e.parentNode;)if((e=e.parentNode).nodeName.toLowerCase()===t.toLowerCase())return!0}(n,"head")?"script"===n.nodeName.toLowerCase()?d(n,r):(d(n,r),n.parentNode.removeChild(n)):document.body.appendChild(r)}function h(t){var n=a(t);return o.each(t.attributes||[],function(e){f(t,e.name,n)}),c.addEventListener(t,"attributes",function(e){f(t,e.attributeName,n)}),n}var v=new Promise(function(e,t){function n(){var i=[];o.each(document.querySelectorAll("[can-autorender]"),function(t,e){t.style.display="none";var n=t.innerHTML||t.text,r=t.getAttribute("type").match(l),a="can-"+(r&&r[1]);i.push(s(a).then(function(e){if(e.async)return e.async(n).then(function(e){p(e,h(t),t)});p(e(n),h(t),t)}))}),Promise.all(i).then(e,t)}"complete"===document.readyState?n():c.addEventListener(window,"load",n)});n.exports=r.autorender=function(e,t){return v.then(e,t)}}),define("can/es/can-view-autorender",["exports","can-view-autorender"],function(e,t){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"default",{enumerable:!0,get:function(){return(e=t,e&&e.__esModule?e:{default:e}).default;var e}})}),define("can-super-model",["require","exports","module","can-connect","can-connect/constructor/constructor","can-connect/can/map/map","can-connect/can/ref/ref","can-connect/constructor/store/store","can-connect/data/callbacks/callbacks","can-connect/data/callbacks-cache/callbacks-cache","can-connect/data/combine-requests/combine-requests","can-connect/data/localstorage-cache/localstorage-cache","can-connect/data/parse/parse","can-connect/data/url/url","can-connect/fall-through-cache/fall-through-cache","can-connect/real-time/real-time","can-connect/constructor/callbacks-once/callbacks-once","can-namespace","can-reflect","can-query-logic"],function(e,t,n){var r=e("can-connect"),a=e("can-connect/constructor/constructor"),i=e("can-connect/can/map/map"),o=e("can-connect/can/ref/ref"),s=e("can-connect/constructor/store/store"),c=e("can-connect/data/callbacks/callbacks"),u=e("can-connect/data/callbacks-cache/callbacks-cache"),l=e("can-connect/data/combine-requests/combine-requests"),f=e("can-connect/data/localstorage-cache/localstorage-cache"),d=e("can-connect/data/parse/parse"),p=e("can-connect/data/url/url"),h=e("can-connect/fall-through-cache/fall-through-cache"),v=e("can-connect/real-time/real-time"),g=e("can-connect/constructor/callbacks-once/callbacks-once"),y=e("can-namespace"),m=e("can-reflect"),b=e("can-query-logic");n.exports=y.superModel=function(e){(e=m.assignDeep({},e)).name||(e.name=m.getName(e.Map)+".connection"),e.queryLogic||(e.queryLogic=new b(e.Map));var t=[a,i,o,s,c,l,d,p,v,g];return"undefined"!=typeof localStorage&&(e.cacheConnection||(e.cacheConnection=r([f],{name:e.name+".cacheConnection",idProp:e.idProp,queryLogic:e.queryLogic})),t.push(u,h)),r(t,e)}}),define("can/es/can-super-model",["exports","can-super-model"],function(e,t){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"default",{enumerable:!0,get:function(){return(e=t,e&&e.__esModule?e:{default:e}).default;var e}})}),define("can-connect-feathers/service/service",["require","exports","module","can-connect"],function(e,t,n){"use strict";var r=e("can-connect");function a(e){var t,n=e.algebra&&e.algebra.clauses&&e.algebra.clauses.id;if(n&&(t=Object.keys(n)[0]),!t&&!e.idProp)throw new Error("An idProp was not set in the Model for "+e+". Things may not work as expected.");return t||e.idProp}n.exports=r.behavior("data/feathers-service",function(e){if(!this.feathersService)throw new Error("You must provide a feathersService to the feathers-service behavior: https://canjs.com/doc/can-connect-feathers.html");var r=this.feathersService;return{init:function(){e.init.apply(this,arguments);var t=this;r.on("created",function(e){t.createInstance(e)}),r.on("updated",function(e){t.updateInstance(e)}),r.on("patched",function(e){t.updateInstance(e)}),r.on("removed",function(e){t.destroyInstance(e)})},getListData:function(e){return r.find({query:e})},getData:function(e){var t=null,n=a(this);return"string"==typeof e||"number"==typeof e?(t=e,e={}):e&&void 0!==e[n]&&(t=e[n],delete e[n]),r.get(t,{query:e})},createData:function(e){return r.create(e)},updateData:function(e){var t=a(this);return r.update(e[t],e)},destroyData:function(e){var t=a(this);return r.remove(e[t])}}})}),define("ms",function(e,t,n){var r=864e5;function a(e,t,n,r){var a=1.5*n<=t;return Math.round(e/n)+" "+r+(a?"s":"")}n.exports=function(e,t){t=t||{};var n=typeof e;if("string"===n&&0<e.length)return function(e){if(100<(e=String(e)).length)return;var t=/^((?:\d+)?\-?\d?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(e);if(!t)return;var n=parseFloat(t[1]);switch((t[2]||"ms").toLowerCase()){case"years":case"year":case"yrs":case"yr":case"y":return 315576e5*n;case"weeks":case"week":case"w":return 6048e5*n;case"days":case"day":case"d":return n*r;case"hours":case"hour":case"hrs":case"hr":case"h":return 36e5*n;case"minutes":case"minute":case"mins":case"min":case"m":return 6e4*n;case"seconds":case"second":case"secs":case"sec":case"s":return 1e3*n;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return n;default:return}}(e);if("number"===n&&!1===isNaN(e))return t.long?function(e){var t=Math.abs(e);if(r<=t)return a(e,t,r,"day");if(36e5<=t)return a(e,t,36e5,"hour");if(6e4<=t)return a(e,t,6e4,"minute");if(1e3<=t)return a(e,t,1e3,"second");return e+" ms"}(e):function(e){var t=Math.abs(e);if(r<=t)return Math.round(e/r)+"d";if(36e5<=t)return Math.round(e/36e5)+"h";if(6e4<=t)return Math.round(e/6e4)+"m";if(1e3<=t)return Math.round(e/1e3)+"s";return e+"ms"}(e);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(e))}}),define("debug/src/common",["require","exports","module","ms"],function(e,t,n){"use strict";n.exports=function(t){function n(e){for(var t=0,n=0;n<e.length;n++)t=(t<<5)-t+e.charCodeAt(n),t|=0;return u.colors[Math.abs(t)%u.colors.length]}function u(e){var s;function c(){if(c.enabled){for(var e=arguments.length,a=new Array(e),t=0;t<e;t++)a[t]=arguments[t];var i=c,n=Number(new Date),r=n-(s||n);i.diff=r,i.prev=s,i.curr=n,s=n,a[0]=u.coerce(a[0]),"string"!=typeof a[0]&&a.unshift("%O");var o=0;a[0]=a[0].replace(/%([a-zA-Z%])/g,function(e,t){if("%%"===e)return e;o++;var n=u.formatters[t];if("function"==typeof n){var r=a[o];e=n.call(i,r),a.splice(o,1),o--}return e}),u.formatArgs.call(i,a),(i.log||u.log).apply(i,a)}}return c.namespace=e,c.enabled=u.enabled(e),c.useColors=u.useColors(),c.color=n(e),c.destroy=r,c.extend=a,"function"==typeof u.init&&u.init(c),u.instances.push(c),c}function r(){var e=u.instances.indexOf(this);return-1!==e&&(u.instances.splice(e,1),!0)}function a(e,t){return u(this.namespace+(void 0===t?":":t)+e)}return((u.debug=u).default=u).coerce=function(e){return e instanceof Error?e.stack||e.message:e},u.disable=function(){u.enable("")},u.enable=function(e){var t;u.save(e),u.names=[],u.skips=[];var n=("string"==typeof e?e:"").split(/[\s,]+/),r=n.length;for(t=0;t<r;t++)n[t]&&("-"===(e=n[t].replace(/\*/g,".*?"))[0]?u.skips.push(new RegExp("^"+e.substr(1)+"$")):u.names.push(new RegExp("^"+e+"$")));for(t=0;t<u.instances.length;t++){var a=u.instances[t];a.enabled=u.enabled(a.namespace)}},u.enabled=function(e){if("*"===e[e.length-1])return!0;var t,n;for(t=0,n=u.skips.length;t<n;t++)if(u.skips[t].test(e))return!1;for(t=0,n=u.names.length;t<n;t++)if(u.names[t].test(e))return!0;return!1},u.humanize=e("ms"),Object.keys(t).forEach(function(e){u[e]=t[e]}),u.instances=[],u.names=[],u.skips=[],u.formatters={},u.selectColor=n,u.enable(u.load()),u}}),define("debug",["require","exports","module","debug/src/common"],function(e,t,n){!function(e,t,n,a){"use strict";function r(e){return(r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}n.log=function(){var e;return"object"===("undefined"==typeof console?"undefined":r(console))&&console.log&&(e=console).log.apply(e,arguments)},n.formatArgs=function(e){if(e[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+e[0]+(this.useColors?"%c ":" ")+"+"+a.exports.humanize(this.diff),!this.useColors)return;var t="color: "+this.color;e.splice(1,0,t,"color: inherit");var n=0,r=0;e[0].replace(/%[a-zA-Z%]/g,function(e){"%%"!==e&&(n++,"%c"===e&&(r=n))}),e.splice(r,0,t)},n.save=function(e){try{e?n.storage.setItem("debug",e):n.storage.removeItem("debug")}catch(e){}},n.load=function(){var e;try{e=n.storage.getItem("debug")}catch(e){}!e&&"undefined"!=typeof process&&"env"in process&&(e=process.env.DEBUG);return e},n.useColors=function(){if("undefined"!=typeof window&&window.process&&("renderer"===window.process.type||window.process.__nwjs))return!0;if("undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/))return!1;return"undefined"!=typeof document&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||"undefined"!=typeof window&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/)&&31<=parseInt(RegExp.$1,10)||"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)},n.storage=function(){try{return localStorage}catch(e){}}(),n.colors=["#0000CC","#0000FF","#0033CC","#0033FF","#0066CC","#0066FF","#0099CC","#0099FF","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#3300CC","#3300FF","#3333CC","#3333FF","#3366CC","#3366FF","#3399CC","#3399FF","#33CC00","#33CC33","#33CC66","#33CC99","#33CCCC","#33CCFF","#6600CC","#6600FF","#6633CC","#6633FF","#66CC00","#66CC33","#9900CC","#9900FF","#9933CC","#9933FF","#99CC00","#99CC33","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF","#CC6600","#CC6633","#CC9900","#CC9933","#CCCC00","#CCCC33","#FF0000","#FF0033","#FF0066","#FF0099","#FF00CC","#FF00FF","#FF3300","#FF3333","#FF3366","#FF3399","#FF33CC","#FF33FF","#FF6600","#FF6633","#FF9900","#FF9933","#FFCC00","#FFCC33"],a.exports=t("debug/src/common")(n),a.exports.formatters.j=function(e){try{return JSON.stringify(e)}catch(e){return"[UnexpectedJSONParseError]: "+e.message}}}(0,e,t,n)}),define("feathers-errors",["require","exports","module","debug"],function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},c="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},u=e("debug")("feathers-errors");function l(e,t,n,r,a){var i=void 0,o=void 0,s=void 0;(e=e||"Error")instanceof Error?(o=e.message||"Error",e.errors&&(i=e.errors)):"object"===(void 0===e?"undefined":c(e))?(o=e.message||"Error",a=e):o=e,a&&((s=JSON.parse(JSON.stringify(a))).errors?(i=s.errors,delete s.errors):a.errors&&(i=JSON.parse(JSON.stringify(a.errors)))),this.type="FeathersError",this.name=t,this.message=o,this.code=n,this.className=r,this.data=s,this.errors=i||{},u(this.name+"("+this.code+"): "+this.message),u(this.errors),Error.captureStackTrace?Error.captureStackTrace(this,l):this.stack=(new Error).stack}function a(e,t){l.call(this,e,"BadRequest",400,"bad-request",t)}function i(e,t){l.call(this,e,"NotAuthenticated",401,"not-authenticated",t)}function o(e,t){l.call(this,e,"PaymentError",402,"payment-error",t)}function s(e,t){l.call(this,e,"Forbidden",403,"forbidden",t)}function f(e,t){l.call(this,e,"NotFound",404,"not-found",t)}function d(e,t){l.call(this,e,"MethodNotAllowed",405,"method-not-allowed",t)}function p(e,t){l.call(this,e,"NotAcceptable",406,"not-acceptable",t)}function h(e,t){l.call(this,e,"Timeout",408,"timeout",t)}function v(e,t){l.call(this,e,"Conflict",409,"conflict",t)}function g(e,t){l.call(this,e,"LengthRequired",411,"length-required",t)}function y(e,t){l.call(this,e,"Unprocessable",422,"unprocessable",t)}function m(e,t){l.call(this,e,"TooManyRequests",429,"too-many-requests",t)}function b(e,t){l.call(this,e,"GeneralError",500,"general-error",t)}function w(e,t){l.call(this,e,"NotImplemented",501,"not-implemented",t)}function _(e,t){l.call(this,e,"BadGateway",502,"bad-gateway",t)}function x(e,t){l.call(this,e,"Unavailable",503,"unavailable",t)}l.prototype=Object.create(Error.prototype),Object.defineProperty(l.prototype,"toJSON",{value:function(){return{name:this.name,message:this.message,code:this.code,className:this.className,data:this.data,errors:this.errors}}}),a.prototype=l.prototype,i.prototype=l.prototype,o.prototype=l.prototype,s.prototype=l.prototype,f.prototype=l.prototype,d.prototype=l.prototype,p.prototype=l.prototype,h.prototype=l.prototype,v.prototype=l.prototype,g.prototype=l.prototype,y.prototype=l.prototype,m.prototype=l.prototype,b.prototype=l.prototype,w.prototype=l.prototype,_.prototype=l.prototype,x.prototype=l.prototype;var E={FeathersError:l,BadRequest:a,NotAuthenticated:i,PaymentError:o,Forbidden:s,NotFound:f,MethodNotAllowed:d,NotAcceptable:p,Timeout:h,Conflict:v,LengthRequired:g,Unprocessable:y,TooManyRequests:m,GeneralError:b,NotImplemented:w,BadGateway:_,Unavailable:x,400:a,401:i,402:o,403:s,404:f,405:d,406:p,408:h,409:v,411:g,422:y,429:m,500:b,501:w,502:_,503:x};t.default=r({convert:function(e){if(!e)return e;var t=E[e.name],n=t?new t(e.message,e.data):new Error(e.message||e);return"object"===(void 0===e?"undefined":c(e))&&r(n,e),n},types:E,errors:E},E),n.exports=t.default}),define("events",function(e,t,n){function r(){this._events=this._events||{},this._maxListeners=this._maxListeners||void 0}function c(e){return"function"==typeof e}function u(e){return"object"==typeof e&&null!==e}function l(e){return void 0===e}((n.exports=r).EventEmitter=r).prototype._events=void 0,r.prototype._maxListeners=void 0,r.defaultMaxListeners=10,r.prototype.setMaxListeners=function(e){if("number"!=typeof e||e<0||isNaN(e))throw TypeError("n must be a positive number");return this._maxListeners=e,this},r.prototype.emit=function(e){var t,n,r,a,i,o;if(this._events||(this._events={}),"error"===e&&(!this._events.error||u(this._events.error)&&!this._events.error.length)){if((t=arguments[1])instanceof Error)throw t;var s=new Error('Uncaught, unspecified "error" event. ('+t+")");throw s.context=t,s}if(l(n=this._events[e]))return!1;if(c(n))switch(arguments.length){case 1:n.call(this);break;case 2:n.call(this,arguments[1]);break;case 3:n.call(this,arguments[1],arguments[2]);break;default:a=Array.prototype.slice.call(arguments,1),n.apply(this,a)}else if(u(n))for(a=Array.prototype.slice.call(arguments,1),r=(o=n.slice()).length,i=0;i<r;i++)o[i].apply(this,a);return!0},r.prototype.on=r.prototype.addListener=function(e,t){var n;if(!c(t))throw TypeError("listener must be a function");return this._events||(this._events={}),this._events.newListener&&this.emit("newListener",e,c(t.listener)?t.listener:t),this._events[e]?u(this._events[e])?this._events[e].push(t):this._events[e]=[this._events[e],t]:this._events[e]=t,u(this._events[e])&&!this._events[e].warned&&(n=l(this._maxListeners)?r.defaultMaxListeners:this._maxListeners)&&0<n&&this._events[e].length>n&&(this._events[e].warned=!0,console.error("(node) warning: possible EventEmitter memory leak detected. %d listeners added. Use emitter.setMaxListeners() to increase limit.",this._events[e].length),"function"==typeof console.trace&&console.trace()),this},r.prototype.once=function(e,t){if(!c(t))throw TypeError("listener must be a function");var n=!1;function r(){this.removeListener(e,r),n||(n=!0,t.apply(this,arguments))}return r.listener=t,this.on(e,r),this},r.prototype.removeListener=function(e,t){var n,r,a,i;if(!c(t))throw TypeError("listener must be a function");if(!this._events||!this._events[e])return this;if(a=(n=this._events[e]).length,r=-1,n===t||c(n.listener)&&n.listener===t)delete this._events[e],this._events.removeListener&&this.emit("removeListener",e,t);else if(u(n)){for(i=a;0<i--;)if(n[i]===t||n[i].listener&&n[i].listener===t){r=i;break}if(r<0)return this;1===n.length?(n.length=0,delete this._events[e]):n.splice(r,1),this._events.removeListener&&this.emit("removeListener",e,t)}return this},r.prototype.removeAllListeners=function(e){var t,n;if(!this._events)return this;if(!this._events.removeListener)return 0===arguments.length?this._events={}:this._events[e]&&delete this._events[e],this;if(0===arguments.length){for(t in this._events)"removeListener"!==t&&this.removeAllListeners(t);return this.removeAllListeners("removeListener"),this._events={},this}if(c(n=this._events[e]))this.removeListener(e,n);else if(n)for(;n.length;)this.removeListener(e,n[n.length-1]);return delete this._events[e],this},r.prototype.listeners=function(e){return this._events&&this._events[e]?c(this._events[e])?[this._events[e]]:this._events[e].slice():[]},r.prototype.listenerCount=function(e){if(this._events){var t=this._events[e];if(c(t))return 1;if(t)return t.length}return 0},r.listenerCount=function(e,t){return e.listenerCount(t)}}),define("feathers-authentication-popups",["require","exports","module","events"],function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.authAgent=void 0,t.default=function(e){var t=1<arguments.length&&void 0!==arguments[1]?arguments[1]:{},n=t.width||1024,r=t.height||640,a=c(window,n,r),i=a.top,o=a.left,s="width="+n+", height="+r+", top="+i+", left="+o;return window.open(e,"authWindow",s)},t.getCenterCoordinates=c;var r,a=e("events"),i=(r=a)&&r.__esModule?r:{default:r};window.authAgent=new i.default;t.authAgent=window.authAgent;function c(e,t,n){return{left:e.screenX+(e.outerWidth-t)/2,top:e.screenY+(e.outerHeight-n)/2}}}),define("jwt-decode/lib/atob",function(e,t,n){function s(e){this.message=e}(s.prototype=new Error).name="InvalidCharacterError",n.exports="undefined"!=typeof window&&window.atob&&window.atob.bind(window)||function(e){var t=String(e).replace(/=+$/,"");if(t.length%4==1)throw new s("'atob' failed: The string to be decoded is not correctly encoded.");for(var n,r,a=0,i=0,o="";r=t.charAt(i++);~r&&(n=a%4?64*n+r:r,a++%4)?o+=String.fromCharCode(255&n>>(-2*a&6)):0)r="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".indexOf(r);return o}}),define("jwt-decode/lib/base64_url_decode",["require","exports","module","jwt-decode/lib/atob"],function(e,t,n){var r=e("jwt-decode/lib/atob");n.exports=function(e){var t=e.replace(/-/g,"+").replace(/_/g,"/");switch(t.length%4){case 0:break;case 2:t+="==";break;case 3:t+="=";break;default:throw"Illegal base64url string!"}try{return decodeURIComponent(r(t).replace(/(.)/g,function(e,t){var n=t.charCodeAt(0).toString(16).toUpperCase();return n.length<2&&(n="0"+n),"%"+n}))}catch(e){return r(t)}}}),define("jwt-decode",["require","exports","module","jwt-decode/lib/base64_url_decode"],function(e,t,n){"use strict";var r=e("jwt-decode/lib/base64_url_decode");function a(e){this.message=e}(a.prototype=new Error).name="InvalidTokenError",n.exports=function(e,t){if("string"!=typeof e)throw new a("Invalid token specified");var n=!0===(t=t||{}).header?0:1;try{return JSON.parse(r(e.split(".")[n]))}catch(e){throw new a("Invalid token specified: "+e.message)}},n.exports.InvalidTokenError=a}),define("can-connect-feathers/utils/utils",["require","exports","module","jwt-decode","can-assign"],function(e,t,n){"use strict";var r=e("jwt-decode"),a=e("can-assign");function i(e){for(var t=e+"=",n=document.cookie.split(";"),r=0;r<n.length;r++){for(var a=n[r];" "===a.charAt(0);)a=a.substring(1,a.length);if(0===a.indexOf(t))return a.substring(t.length,a.length)}return null}function o(e){var t=i(e);return!t&&(window&&window.localStorage||window.sessionStorage)&&(t=window.sessionStorage.getItem(e)||window.localStorage.getItem(e)),t}function s(e){return e&&1e3*e.exp>(new Date).getTime()}n.exports={readCookie:i,getStoredToken:o,hasValidToken:function(e){var t=o(e);if(t)try{return s(r(t))}catch(e){return!1}return!1},payloadIsValid:s,convertLocalAuthData:function(e){var t=a({},e);return t&&"local"===t.strategy&&t.user&&(Object.keys(t.user).forEach(function(e){t[e]=t.user[e]}),delete t.user),t}}}),define("can-connect-feathers/session/storage",function(e,t,n){"use strict";n.exports={data:{},getStore:function(){if(window.doneSsr){var e=window.CanZone||void 0;return void 0===e?this.data:e.current.data}return this.data},setItem:function(e,t){this.getStore()[e]=t},getItem:function(e){return this.getStore()[e]},removeItem:function(e){delete this.getStore()[e]}}}),define("can-connect-feathers/session/session",["require","exports","module","can-connect","feathers-errors","feathers-authentication-popups","jwt-decode","can-connect-feathers/utils/utils","can-connect-feathers/utils/utils","can-connect-feathers/utils/utils","can-observation-recorder","can-connect-feathers/session/storage"],function(e,t,n){"use strict";var r=e("can-connect"),i=e("feathers-errors"),o=e("feathers-authentication-popups").authAgent,s=e("jwt-decode"),c=e("can-connect-feathers/utils/utils").payloadIsValid,u=e("can-connect-feathers/utils/utils").hasValidToken,l=e("can-connect-feathers/utils/utils").convertLocalAuthData,f=e("can-observation-recorder"),d=e("can-connect-feathers/session/storage");n.exports=r.behavior("data/feathers-session",function(e){var t="https://canjs.com/doc/can-connect-feathers.html",r=this.feathersClient;if(!r)throw new Error("You must provide a feathersClient instance to the feathers-session behavior. See "+t);if(!this.Map)throw new Error("You must provide a Map instance to the feathers-session behavior. See "+t);if(!r.passport)throw new Error("You must register the feathers-authentication-client plugin before using the feathers-session behavior. See "+t);var a=r.passport.options,n=this.Map;return Object.defineProperty(n,"current",{get:function(){return f.add(n,"current"),void 0===d.getItem("can-connect-feathers-session")&&(d.removeItem("can-connect-feathers-session"),n.get().then(function(e){d.setItem("can-connect-feathers-session",e),n.dispatch("current",[e])}).catch(function(e){if(d.setItem("can-connect-feathers-session",null),n.dispatch("current",[null]),!e.className||e.className.indexOf("not-authenticated")<0)return Promise.reject(e)})),d.getItem("can-connect-feathers-session")}}),n.on("created",function(e,t){d.setItem("can-connect-feathers-session",t),n.dispatch("current",[t])}),n.on("destroyed",function(){d.removeItem("can-connect-feathers-session"),n.dispatch("current",[void 0,d.getItem("can-connect-feathers-session")])}),{init:function(){e.init.apply(this,arguments);var n=this;o.on("login",function(e){try{var t=s(e);if(!c(t))throw new Error("invalid token")}catch(e){throw new Error("An invalid token was received through the feathers-authentication-popups authAgent")}r.authenticate({strategy:"jwt",accessToken:e}).then(function(e){var t=s(e.accessToken);n.createInstance(t)})})},createData:function(e){var t=l(e);return r.authenticate(t).then(function(e){return e.accessToken&&Object.assign(e,s(e.accessToken)),e})},getData:function(){return new Promise(function(n,e){var t=a.tokenKey||a.cookie;u(t)&&!window.doneSsr?r.authenticate().then(function(e){var t=s(e.accessToken);return n(t)}).catch(e):e(new i.NotAuthenticated("Not Authenticated"))})},destroyData:function(e){return r.logout().then(function(){return e})}}})}),define("can-connect-feathers",["require","exports","module","can-connect-feathers/service/service","can-connect-feathers/session/session"],function(e,t,n){"use strict";n.exports={service:e("can-connect-feathers/service/service"),session:e("can-connect-feathers/session/session")}}),define("can/es/can-connect-feathers",["exports","can-connect-feathers"],function(e,t){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"default",{enumerable:!0,get:function(){return(e=t,e&&e.__esModule?e:{default:e}).default;var e}})}),define("can-connect-tag",["require","exports","module","can-stache-bindings","can-observation","can-stache/src/expression","can-view-callbacks","can-observation-recorder","can-view-nodelist","can-reflect","can-symbol","can-dom-mutate","can-dom-mutate/node","can-reflect","can-namespace"],function(e,t,n){e("can-stache-bindings");var y=e("can-observation"),m=e("can-stache/src/expression"),r=e("can-view-callbacks"),b=e("can-observation-recorder"),w=e("can-view-nodelist"),_=e("can-reflect"),x=e("can-symbol"),E=e("can-dom-mutate"),k=e("can-dom-mutate/node"),O=e("can-reflect").each,a=e("can-namespace"),N=function(e){return"function"==typeof e?N(e()):e};n.exports=a.connectTag=function(e,g){r.tag(e,function(e,r){var t,n,a,i=e.getAttribute("getList")||e.getAttribute("get-list"),o=e.getAttribute("get"),s=i||o,c=i?"getList":"get",u=m.parse("tmp("+(n=n||"{",a=a||"}",(t=s)[0]===n&&t[t.length-1]===a?t.substr(1,t.length-2):t)+")",{baseMethodType:"Call"}),l=!1,f=b.ignore(function(e,t){if(!l){var n=r.scope.peek("%root")||r.scope.peek("@root");n&&n.pageData&&("get"===c&&(e=g.id(e)),n.pageData(g.name,e,t))}l=!0}),d=new y(function(){var n={};if("object"==typeof u.hash)O(u.hash,function(e,t){e&&e.hasOwnProperty("get")?n[t]=r.scope.read(e.get,{}).value:n[t]=e});else if("function"==typeof u.hash){var e=u.hash(r.scope,r.options,{});O(e(),function(e,t){n[t]=N(e)})}else n=u.argExprs.length?_.getValue(u.argExprs[0].value(r.scope,r.options)):{};var t=g[c](n);return f(n,t),t});e[x.for("can.viewModel")]=d;var p=w.register([],void 0,r.parentNodeList||!0),h=r.subtemplate?r.subtemplate(r.scope.add(d),r.options,p):document.createDocumentFragment();k.appendChild.call(e,h),w.update(p,e.childNodes);var v=E.onNodeRemoval(e,function(){e.ownerDocument.contains(e)||(v(),w.unregister(p))})})}}),define("can/es/can-connect-tag",["exports","can-connect-tag"],function(e,t){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"default",{enumerable:!0,get:function(){return(e=t,e&&e.__esModule?e:{default:e}).default;var e}})}),define("can-fixture-socket/src/store",["require","exports","module","can-fixture/core"],function(e,t,n){var r=e("can-fixture/core").extractResponse;function a(n){return function(e,t){n({data:e},function(){var e=r.apply(null,arguments);200===e[0]?t(null,e[1]):t(e[1])})}}n.exports={requestHandlerToListener:a,storeToListeners:function(n){return["getListData","getData","updateData","createData","destroyData"].reduce(function(e,t){return e[t]=a(n[t]),e},{})}}}),define("can-fixture-socket/src/feathers-client",["require","exports","module","can-fixture-socket/src/store","can-assign"],function(e,t,n){var f=e("can-fixture-socket/src/store").storeToListeners,d=e("can-assign");function p(r,a,i){return function(e){var n,t=Array.prototype.slice.call(arguments);"function"==typeof t[t.length-1]&&(n=t[t.length-1]),e=a?a(e):e,r(e,function(e,t){e?n&&n(e):(t=i?i(t):t,n&&n(null,t))})}}function h(n){return function(e){var t={};return t[n&&n.id||"id"]=e,t}}function v(e){return{total:e.count,limit:e.limit,skip:e.offset,data:e.data}}n.exports={subscribeFeathersStoreToServer:function(e,t,n,r){var i,o,s,a,c,u,l=f(t);n.on(e+"::find",p(l.getListData,null,v)),n.on(e+"::get",p(l.getData,h(r),null)),n.on(e+"::remove",(i=l.getData,o=l.destroyData,s=r,function(e,t,r){var a=h(s)(e);i(a,function(e,n){e?r(e):o(a,function(e,t){e?r(e):r(null,n)})})})),n.on(e+"::create",(a=l.createData,function(n,e,r){a(n,function(e,t){e?r(e):r(null,d(n,t))})})),n.on(e+"::update",(c=l.updateData,u=r,function(e,n,t,r){var a=h(u)(e);c(d(a,n),function(e,t){e?r(e):r(null,d(a,d(n,t)))})}))}}}),define("can-fixture-socket/src/index",["require","exports","module","can-fixture-socket/src/feathers-client"],function(e,t,n){var r=e("can-fixture-socket/src/feathers-client").subscribeFeathersStoreToServer,a=function(e){this.io=e,this.events={},this.subscribers={},l(e.managers),this.origs=c(e.Manager.prototype,this)};a.prototype.on=function(e,t){var n=this,r={};"string"==typeof e&&(r[e]=t),"object"==typeof e&&(r=e),Object.keys(r).forEach(function(e){s(n.events,e,r[e])})},a.prototype.emit=function(e){var t=Array.prototype.slice.call(arguments,1);o(this.subscribers,e,t)},a.prototype.onFeathersService=function(e,t,n){r(e,t,this,n)},a.prototype.restore=function(){u(this.io.Manager.prototype,this.origs),l(this.io.managers)};var i=function(e){this._server=e,this.io={engine:this}};function o(e,t,n){d(" >>> pub "+t),(e[t]||[]).forEach(function(e){e.apply(null,n)})}function s(e,t,n){d(" <<< sub "+t),e[t]||(e[t]=[]),e[t].push(n)}function c(t,n){var e=["open","socket"].map(function(e){return{name:e,method:t[e]}});return t.open=t.connect=function(){d("MockedManager.prototype.open or connect ... arguments:",arguments),setTimeout(function(){o(n.subscribers,"connect"),o(n.events,"connection")},0)},t.socket=function(){d("MockedManager.prototype.socket ...");var e=new i(n);return e.connected=!0,e.disconnected=!1,e},e}function u(t,e){d("Restore."),e.forEach(function(e){t[e.name]=e.method})}function l(e){for(var t in e)e.hasOwnProperty(t)&&delete e[t]}var f=!(i.prototype={on:function(e,t){d("MockedSocket.on ... "+e),s(this._server.subscribers,e,t)},emit:function(e){var t=Array.prototype.slice.call(arguments,1);d("MockedSocket.emit ..."+e),o(this._server.events,e,t)},once:function(){d("MockedSocket.once ...")},off:function(e,t){var n,r,a;d("MockedSocket.off ... "+e),n=this._server.subscribers,a=t,d(" <<< unsub "+(r=e)),n[r].forEach(function(e,t){e===a&&n[r].splice(t,1)})},open:function(){return this.connect()},connect:function(){this.connected=!0,this.disconnected=!1},close:function(){return this.disconnect()},disconnect:function(){this.connected=!1,this.disconnected=!0}});function d(e,t){f&&console.log.apply(console,arguments)}n.exports={Server:a,mockSocketManager:c,restoreManager:u}}),define("can-fixture-socket",["require","exports","module","can-fixture-socket/src/index","can-fixture-socket/src/store"],function(e,t,n){var r=e("can-fixture-socket/src/index"),a=e("can-fixture-socket/src/store");n.exports={Server:r.Server,requestHandlerToListener:a.requestHandlerToListener,storeToListeners:a.storeToListeners}}),define("can/es/can-fixture-socket",["exports","can-fixture-socket"],function(e,t){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"default",{enumerable:!0,get:function(){return(e=t,e&&e.__esModule?e:{default:e}).default;var e}})}),define("can-ndjson-stream",["require","exports","module","can-namespace"],function(e,t,n){"use strict";var r=e("can-namespace");n.exports=r.ndjsonStream=function(e){var t,d=!1;return new ReadableStream({start:function(c){var u=e.getReader();t=u;var l=new TextDecoder,f="";u.read().then(function e(t){if(!t.done){for(var n=l.decode(t.value,{stream:!0}),r=(f+=n).split("\n"),a=0;a<r.length-1;++a){var i=r[a].trim();if(0<i.length)try{var o=JSON.parse(i);c.enqueue(o)}catch(e){return c.error(e),d=!0,void u.cancel()}}return f=r[r.length-1],u.read().then(e)}if(!d){if(0!==(f=f.trim()).length)try{var s=JSON.parse(f);c.enqueue(s)}catch(e){return void c.error(e)}c.close()}})},cancel:function(e){console.log("Cancel registered due to ",e),d=!0,t.cancel()}})}}),define("can/es/can-ndjson-stream",["exports","can-ndjson-stream"],function(e,t){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"default",{enumerable:!0,get:function(){return(e=t,e&&e.__esModule?e:{default:e}).default;var e}})}),define("can-connect-ndjson",["require","exports","module","can-connect","can-connect/helpers/sorted-set-json","can-ndjson-stream","can-reflect","can-namespace"],function(e,t,n){var r,a,i,o,s,c,u,l;a=n,i=(r=e)("can-connect"),o=r("can-connect/helpers/sorted-set-json"),s=r("can-ndjson-stream"),c=r("can-reflect"),u=r("can-namespace"),l=i.behavior("data-ndjson",function(a){try{if(new ReadableStream,"function"!=typeof window.fetch)throw new Error("fetch not supported")}catch(e){return{}}return{hydrateList:function(e,t){t=t||this.listSet(e);var n=o(t),r=a.hydrateList.call(this,e,t);return this._getHydrateListCallbacks[n]&&(this._getHydrateListCallbacks[n].shift()(r),this._getHydrateListCallbacks[n].length||delete this._getHydrateListCallbacks[n]),r},_getHydrateListCallbacks:{},_getHydrateList:function(e,t){var n=o(e);this._getHydrateListCallbacks[n]||(this._getHydrateListCallbacks[n]=[]),this._getHydrateListCallbacks[n].push(t)},getListData:function(e){var t=fetch(this.ndjson||this.url);return this._getHydrateList(e,function(r){function a(e){c.setKeyValue(r,"isStreaming",!1),c.setKeyValue(r,"streamError",e)}t.then(function(e){return c.setKeyValue(r,"isStreaming",!0),s(e.body)}).then(function(e){var n=e.getReader();n.read().then(function e(t){t.done?c.setKeyValue(r,"isStreaming",!1):(r.push(t.value),n.read().then(e,a))},a)})}),t.then(function(){return{data:[]}})}}}),a.exports=u.connectNdjson=l}),define("can/es/can-connect-ndjson",["exports","can-connect-ndjson"],function(e,t){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"default",{enumerable:!0,get:function(){return(e=t,e&&e.__esModule?e:{default:e}).default;var e}})}),define("can-route-mock",["require","exports","module","can-simple-observable","can-reflect"],function(e,t,n){var r=e("can-simple-observable"),a=e("can-reflect");function i(){this.routeValue=new r("")}a.assignMap(i.prototype,{paramsMatcher:/^(?:&[^=]+=[^&]*)+/,querySeparator:"&",matchSlashes:!1,root:"#!",get:function(){return this.value},set:function(e){return this.value=e},on:function(e){a.onValue(this,e)},off:function(e){a.offValue(this,e)}}),Object.defineProperty(i.prototype,"value",{get:function(){return this.routeValue.get().split(/#!?/)[1]||""},set:function(e){return"#"!==e[0]?this.routeValue.set("#"+(e||"")):this.routeValue.set(e||""),e}}),a.assignSymbols(i.prototype,{"can.onValue":function(e){this.routeValue.on(e)},"can.offValue":function(e){this.routeValue.off(e)},"can.getValue":function(){return this.value},"can.setValue":function(e){this.value=e}}),n.exports=i}),define("can/es/can-route-mock",["exports","can-route-mock"],function(e,t){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"default",{enumerable:!0,get:function(){return(e=t,e&&e.__esModule?e:{default:e}).default;var e}})}),function(e,t,n){"use strict";var o=function(e,t,n){n=f.extend({},f.options,n);var r,a,i=f.runValidations(e,t,n);for(r in i)for(a in i[r])if(f.isPromise(i[r][a]))throw new Error("Use validate.async if you want support for promises");return o.processValidationResults(i,n)},f=o;f.extend=function(n){return[].slice.call(arguments,1).forEach(function(e){for(var t in e)n[t]=e[t]}),n},f.extend(o,{version:{major:0,minor:11,patch:1,metadata:null,toString:function(){var e=f.format("%{major}.%{minor}.%{patch}",f.version);return f.isEmpty(f.version.metadata)||(e+="+"+f.version.metadata),e}},Promise:"undefined"!=typeof Promise?Promise:null,EMPTY_STRING_REGEXP:/^\s*$/,runValidations:function(e,t,n){var r,a,i,o,s,c,u,l=[];for(r in(f.isDomElement(e)||f.isJqueryElement(e))&&(e=f.collectFormValues(e)),t)for(a in i=f.getDeepObjectValue(e,r),o=f.result(t[r],i,e,r,n,t)){if(!(s=f.validators[a]))throw u=f.format("Unknown validator %{name}",{name:a}),new Error(u);c=o[a],(c=f.result(c,i,e,r,n,t))&&l.push({attribute:r,value:i,validator:a,globalOptions:n,attributes:e,options:c,error:s.call(s,i,c,r,e,n)})}return l},processValidationResults:function(e,t){e=f.pruneEmptyErrors(e,t),e=f.expandMultipleErrors(e,t),e=f.convertErrorMessages(e,t);var n=t.format||"grouped";if("function"!=typeof f.formatters[n])throw new Error(f.format("Unknown format %{format}",t));return e=f.formatters[n](e),f.isEmpty(e)?void 0:e},async:function(r,a,i){var o=(i=f.extend({},f.async.options,i)).wrapErrors||function(e){return e};!1!==i.cleanAttributes&&(r=f.cleanAttributes(r,a));var s=f.runValidations(r,a,i);return new f.Promise(function(t,n){f.waitForResults(s).then(function(){var e=f.processValidationResults(s,i);e?n(new o(e,i,r,a)):t(r)},function(e){n(e)})})},single:function(e,t,n){return n=f.extend({},f.single.options,n,{format:"flat",fullMessages:!1}),f({single:e},{single:t},n)},waitForResults:function(e){return e.reduce(function(e,t){return f.isPromise(t.error)?e.then(function(){return t.error.then(function(e){t.error=e||null})}):e},new f.Promise(function(e){e()}))},result:function(e){var t=[].slice.call(arguments,1);return"function"==typeof e&&(e=e.apply(null,t)),e},isNumber:function(e){return"number"==typeof e&&!isNaN(e)},isFunction:function(e){return"function"==typeof e},isInteger:function(e){return f.isNumber(e)&&e%1==0},isBoolean:function(e){return"boolean"==typeof e},isObject:function(e){return e===Object(e)},isDate:function(e){return e instanceof Date},isDefined:function(e){return null!=e},isPromise:function(e){return!!e&&f.isFunction(e.then)},isJqueryElement:function(e){return e&&f.isString(e.jquery)},isDomElement:function(e){return!!e&&(!(!e.querySelectorAll||!e.querySelector)&&(!(!f.isObject(document)||e!==document)||("object"==typeof HTMLElement?e instanceof HTMLElement:e&&"object"==typeof e&&null!==e&&1===e.nodeType&&"string"==typeof e.nodeName)))},isEmpty:function(e){var t;if(!f.isDefined(e))return!0;if(f.isFunction(e))return!1;if(f.isString(e))return f.EMPTY_STRING_REGEXP.test(e);if(f.isArray(e))return 0===e.length;if(f.isDate(e))return!1;if(f.isObject(e)){for(t in e)return!1;return!0}return!1},format:f.extend(function(e,r){return f.isString(e)?e.replace(f.format.FORMAT_REGEXP,function(e,t,n){return"%"===t?"%{"+n+"}":String(r[n])}):e},{FORMAT_REGEXP:/(%?)%\{([^\}]+)\}/g}),prettify:function(e){return f.isNumber(e)?100*e%1==0?""+e:parseFloat(Math.round(100*e)/100).toFixed(2):f.isArray(e)?e.map(function(e){return f.prettify(e)}).join(", "):f.isObject(e)?e.toString():(e=""+e).replace(/([^\s])\.([^\s])/g,"$1 $2").replace(/\\+/g,"").replace(/[_-]/g," ").replace(/([a-z])([A-Z])/g,function(e,t,n){return t+" "+n.toLowerCase()}).toLowerCase()},stringifyValue:function(e){return f.prettify(e)},isString:function(e){return"string"==typeof e},isArray:function(e){return"[object Array]"==={}.toString.call(e)},isHash:function(e){return f.isObject(e)&&!f.isArray(e)&&!f.isFunction(e)},contains:function(e,t){return!!f.isDefined(e)&&(f.isArray(e)?-1!==e.indexOf(t):t in e)},unique:function(e){return f.isArray(e)?e.filter(function(e,t,n){return n.indexOf(e)==t}):e},forEachKeyInKeypath:function(e,t,n){if(f.isString(t)){var r,a="",i=!1;for(r=0;r<t.length;++r)switch(t[r]){case".":i?(i=!1,a+="."):(e=n(e,a,!1),a="");break;case"\\":i?(i=!1,a+="\\"):i=!0;break;default:i=!1,a+=t[r]}return n(e,a,!0)}},getDeepObjectValue:function(e,t){if(f.isObject(e))return f.forEachKeyInKeypath(e,t,function(e,t){if(f.isObject(e))return e[t]})},collectFormValues:function(e,t){var n,r,a,i,o,s,c={};if(f.isJqueryElement(e)&&(e=e[0]),!e)return c;for(t=t||{},i=e.querySelectorAll("input[name], textarea[name]"),n=0;n<i.length;++n)a=i.item(n),f.isDefined(a.getAttribute("data-ignored"))||(s=f.sanitizeFormValue(a.value,t),"number"===a.type?s=s?+s:null:"checkbox"===a.type?a.attributes.value?a.checked||(s=c[a.name]||null):s=a.checked:"radio"===a.type&&(a.checked||(s=c[a.name]||null)),c[a.name]=s);for(i=e.querySelectorAll("select[name]"),n=0;n<i.length;++n){if((a=i.item(n)).multiple)for(r in s=[],a.options)(o=a.options[r]).selected&&s.push(f.sanitizeFormValue(o.value,t));else s=f.sanitizeFormValue(a.options[a.selectedIndex].value,t);c[a.name]=s}return c},sanitizeFormValue:function(e,t){return t.trim&&f.isString(e)&&(e=e.trim()),!1!==t.nullify&&""===e?null:e},capitalize:function(e){return f.isString(e)?e[0].toUpperCase()+e.slice(1):e},pruneEmptyErrors:function(e){return e.filter(function(e){return!f.isEmpty(e.error)})},expandMultipleErrors:function(e){var n=[];return e.forEach(function(t){f.isArray(t.error)?t.error.forEach(function(e){n.push(f.extend({},t,{error:e}))}):n.push(t)}),n},convertErrorMessages:function(e,n){n=n||{};var r=[];return e.forEach(function(e){var t=f.result(e.error,e.value,e.attribute,e.options,e.attributes,e.globalOptions);f.isString(t)?("^"===t[0]?t=t.slice(1):!1!==n.fullMessages&&(t=f.capitalize(f.prettify(e.attribute))+" "+t),t=t.replace(/\\\^/g,"^"),t=f.format(t,{value:f.stringifyValue(e.value)}),r.push(f.extend({},e,{error:t}))):r.push(e)}),r},groupErrorsByAttribute:function(e){var n={};return e.forEach(function(e){var t=n[e.attribute];t?t.push(e):n[e.attribute]=[e]}),n},flattenErrorsToArray:function(e){return e.map(function(e){return e.error}).filter(function(e,t,n){return n.indexOf(e)===t})},cleanAttributes:function(e,t){function r(e,t,n){return f.isObject(e[t])?e[t]:e[t]=!!n||{}}return f.isObject(t)&&f.isObject(e)?function e(t,n){if(!f.isObject(t))return t;var r,a,i=f.extend({},t);for(a in t)r=n[a],f.isObject(r)?i[a]=e(i[a],r):r||delete i[a];return i}(e,t=function(e){var t,n={};for(t in e)e[t]&&f.forEachKeyInKeypath(n,t,r);return n}(t)):{}},exposeModule:function(e,t,n,r,a){n?(r&&r.exports&&(n=r.exports=e),n.validate=e):(t.validate=e).isFunction(a)&&a.amd&&a("validate.js",[],function(){return e})},warn:function(e){"undefined"!=typeof console&&console.warn&&console.warn("[validate.js] "+e)},error:function(e){"undefined"!=typeof console&&console.error&&console.error("[validate.js] "+e)}}),o.validators={presence:function(e,t){if((t=f.extend({},this.options,t)).allowEmpty?!f.isDefined(e):f.isEmpty(e))return t.message||this.message||"can't be blank"},length:function(e,t,n){if(f.isDefined(e)){var r,a=(t=f.extend({},this.options,t)).is,i=t.maximum,o=t.minimum,s=[],c=(e=(t.tokenizer||function(e){return e})(e)).length;return f.isNumber(c)?(f.isNumber(a)&&c!==a&&(r=t.wrongLength||this.wrongLength||"is the wrong length (should be %{count} characters)",s.push(f.format(r,{count:a}))),f.isNumber(o)&&c<o&&(r=t.tooShort||this.tooShort||"is too short (minimum is %{count} characters)",s.push(f.format(r,{count:o}))),f.isNumber(i)&&i<c&&(r=t.tooLong||this.tooLong||"is too long (maximum is %{count} characters)",s.push(f.format(r,{count:i}))),0<s.length?t.message||s:void 0):(f.error(f.format("Attribute %{attr} has a non numeric value for `length`",{attr:n})),t.message||this.notValid||"has an incorrect length")}},numericality:function(e,t){if(f.isDefined(e)){t=f.extend({},this.options,t);var n,r,a=[],i={greaterThan:function(e,t){return t<e},greaterThanOrEqualTo:function(e,t){return t<=e},equalTo:function(e,t){return e===t},lessThan:function(e,t){return e<t},lessThanOrEqualTo:function(e,t){return e<=t},divisibleBy:function(e,t){return e%t==0}};if(f.isString(e)&&t.strict){var o="^(0|[1-9]\\d*)";if(t.onlyInteger||(o+="(\\.\\d+)?"),o+="$",!new RegExp(o).test(e))return t.message||t.notValid||this.notValid||this.message||"must be a valid number"}if(!0!==t.noStrings&&f.isString(e)&&!f.isEmpty(e)&&(e=+e),!f.isNumber(e))return t.message||t.notValid||this.notValid||this.message||"is not a number";if(t.onlyInteger&&!f.isInteger(e))return t.message||t.notInteger||this.notInteger||this.message||"must be an integer";for(n in i)if(r=t[n],f.isNumber(r)&&!i[n](e,r)){var s="not"+f.capitalize(n),c=t[s]||this[s]||this.message||"must be %{type} %{count}";a.push(f.format(c,{count:r,type:f.prettify(n)}))}return t.odd&&e%2!=1&&a.push(t.notOdd||this.notOdd||this.message||"must be odd"),t.even&&e%2!=0&&a.push(t.notEven||this.notEven||this.message||"must be even"),a.length?t.message||a:void 0}},datetime:f.extend(function(e,t){if(!f.isFunction(this.parse)||!f.isFunction(this.format))throw new Error("Both the parse and format functions needs to be set to use the datetime/date validator");if(f.isDefined(e)){var n,r=[],a=(t=f.extend({},this.options,t)).earliest?this.parse(t.earliest,t):NaN,i=t.latest?this.parse(t.latest,t):NaN;return e=this.parse(e,t),isNaN(e)||t.dateOnly&&e%864e5!=0?(n=t.notValid||t.message||this.notValid||"must be a valid date",f.format(n,{value:arguments[0]})):(!isNaN(a)&&e<a&&(n=t.tooEarly||t.message||this.tooEarly||"must be no earlier than %{date}",n=f.format(n,{value:this.format(e,t),date:this.format(a,t)}),r.push(n)),!isNaN(i)&&i<e&&(n=t.tooLate||t.message||this.tooLate||"must be no later than %{date}",n=f.format(n,{date:this.format(i,t),value:this.format(e,t)}),r.push(n)),r.length?f.unique(r):void 0)}},{parse:null,format:null}),date:function(e,t){return t=f.extend({},t,{dateOnly:!0}),f.validators.datetime.call(f.validators.datetime,e,t)},format:function(e,t){(f.isString(t)||t instanceof RegExp)&&(t={pattern:t});var n,r=(t=f.extend({},this.options,t)).message||this.message||"is invalid",a=t.pattern;if(f.isDefined(e))return f.isString(e)?(f.isString(a)&&(a=new RegExp(t.pattern,t.flags)),(n=a.exec(e))&&n[0].length==e.length?void 0:r):r},inclusion:function(e,t){if(f.isDefined(e)&&(f.isArray(t)&&(t={within:t}),t=f.extend({},this.options,t),!f.contains(t.within,e))){var n=t.message||this.message||"^%{value} is not included in the list";return f.format(n,{value:e})}},exclusion:function(e,t){if(f.isDefined(e)&&(f.isArray(t)&&(t={within:t}),t=f.extend({},this.options,t),f.contains(t.within,e))){var n=t.message||this.message||"^%{value} is restricted";return f.format(n,{value:e})}},email:f.extend(function(e,t){var n=(t=f.extend({},this.options,t)).message||this.message||"is not a valid email";if(f.isDefined(e))return f.isString(e)&&this.PATTERN.exec(e)?void 0:n},{PATTERN:/^[a-z0-9\u007F-\uffff!#$%&'*+\/=?^_`{|}~-]+(?:\.[a-z0-9\u007F-\uffff!#$%&'*+\/=?^_`{|}~-]+)*@(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+[a-z]{2,}$/i}),equality:function(e,t,n,r){if(f.isDefined(e)){f.isString(t)&&(t={attribute:t});var a=(t=f.extend({},this.options,t)).message||this.message||"is not equal to %{attribute}";if(f.isEmpty(t.attribute)||!f.isString(t.attribute))throw new Error("The attribute must be a non empty string");var i=f.getDeepObjectValue(r,t.attribute);return(t.comparator||function(e,t){return e===t})(e,i,t,n,r)?void 0:f.format(a,{attribute:f.prettify(t.attribute)})}},url:function(e,t){if(f.isDefined(e)){var n=(t=f.extend({},this.options,t)).message||this.message||"is not a valid url",r=t.schemes||this.schemes||["http","https"],a=t.allowLocal||this.allowLocal||!1;if(!f.isString(e))return n;var i="^(?:(?:"+r.join("|")+")://)(?:\\S+(?::\\S*)?@)?(?:",o="(?:\\.(?:[a-z\\u00a1-\\uffff]{2,}))";return a?o+="?":i+="(?!(?:10|127)(?:\\.\\d{1,3}){3})(?!(?:169\\.254|192\\.168)(?:\\.\\d{1,3}){2})(?!172\\.(?:1[6-9]|2\\d|3[0-1])(?:\\.\\d{1,3}){2})",i+="(?:[1-9]\\d?|1\\d\\d|2[01]\\d|22[0-3])(?:\\.(?:1?\\d{1,2}|2[0-4]\\d|25[0-5])){2}(?:\\.(?:[1-9]\\d?|1\\d\\d|2[0-4]\\d|25[0-4]))|(?:(?:[a-z\\u00a1-\\uffff0-9]-*)*[a-z\\u00a1-\\uffff0-9]+)(?:\\.(?:[a-z\\u00a1-\\uffff0-9]-*)*[a-z\\u00a1-\\uffff0-9]+)*"+o+")(?::\\d{2,5})?(?:[/?#]\\S*)?$",new RegExp(i,"i").exec(e)?void 0:n}}},o.formatters={detailed:function(e){return e},flat:f.flattenErrorsToArray,grouped:function(e){var t;for(t in e=f.groupErrorsByAttribute(e))e[t]=f.flattenErrorsToArray(e[t]);return e},constraint:function(e){var t;for(t in e=f.groupErrorsByAttribute(e))e[t]=e[t].map(function(e){return e.validator}).sort();return e}},o.exposeModule(o,this,e,t,n)}.call(this,"undefined"!=typeof exports?exports:null,"undefined"!=typeof module?module:null,"undefined"!=typeof define?define:null),define("can-validate-validatejs",["require","exports","module","can-reflect","validate.js"],function(e,t,n){var a=e("can-reflect"),i=e("validate.js"),r=function(t){return function(e){return i.single(e,t)}};r.many=function(r){return function(e){var t,n=i(e,r,{format:"detailed",fullMessages:!1});return n&&(t=[],a.eachIndex(n,function(e){t.push({message:e.options.message||e.error,related:[e.attribute]})})),t}},r.validatejs=i,n.exports=r}),define("can-validate",["require","exports","module","can-reflect"],function(e,t,n){"use strict";var i=e("can-reflect"),r={},o={object:function(e){var n=0<e.length?{}:void 0;return i.eachIndex(e,function(t){i.eachIndex(t.related,function(e){n[e]||(n[e]=[]),n[e].push(t.message)})}),n},flat:function(e){var t=0<e.length?[]:void 0;return i.eachIndex(e,function(e){t.push(e.message)}),t},errors:function(e){return 0<e.length?e:void 0},"errors-object":function(e){var n=0<e.length?{}:void 0;return i.eachIndex(e,function(t){i.eachIndex(t.related,function(e){n[e]||(n[e]=[]),n[e].push(t)})}),n}},s=function(e){var t=[];return"string"==typeof e&&t.push({message:e,related:["*"]}),"object"!=typeof e||Array.isArray(e)||(e.related?Array.isArray(e.related)||(e.related=[e.related]):e.related="*",t.push(e)),Array.isArray(e)&&i.eachIndex(e,function(e){[].push.apply(t,s(e))}),t};r.formatErrors=function(e,t){var n,r,a=(r=[],("string"==typeof(n=e)||"object"==typeof n&&!Array.isArray(n))&&(n=[n]),null!=n&&i.eachIndex(n,function(e){[].push.apply(r,s(e))}),r);return t&&o[t]?o[t](a):a},n.exports=r}),define("can-define-validate-validatejs",["require","exports","module","can-validate-validatejs","can-define","can-assign","can-reflect","can-validate"],function(e,t,n){"use strict";var c=e("can-validate-validatejs"),u=e("can-define"),l=e("can-assign"),f=e("can-reflect"),d=e("can-validate").formatErrors,r=function(e){var t,n,r,a,i,o=(t=e,n={},f.eachKey(t.prototype._define.definitions,function(e,t){e.validate&&0!==f.size(e.validate)&&(n[t]=e.validate)}),n),s=c.many(o);a=function(e){var t=s(e);return d(t,"errors")},i=(r=e).prototype._define,r.prototype.testSet=function(){var e={},t=!1;if(arguments.length){if("object"==typeof arguments[0]&&Boolean(arguments[0])&&(e=arguments[0],t=Boolean(arguments[1])),"string"==typeof arguments[0]&&(e[arguments[0]]=arguments[1]),t)e=new r(e);else{var n=this.serialize();l(n,e),e=n}return a(e)}return this.errors()},r.prototype.errors=function(){var t,e=this._errors;if(arguments.length){var n=d(e,"errors-object");t=[],f.eachIndex(arguments,function(e){[].push.apply(t,n?n[e]:[])}),t=0<t.length?t:void 0}else t=e;return t},u.property(r.prototype,"_errors",{get:function(){return a(this)}},i.dataInitializers,i.computedInitializers)};r.validatejs=c.validatejs,n.exports=r}),define("can/es/can-define-validate-validatejs",["exports","can-define-validate-validatejs"],function(e,t){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"default",{enumerable:!0,get:function(){return(e=t,e&&e.__esModule?e:{default:e}).default;var e}})}),define("can/es/can-validate",["exports","can-validate"],function(e,t){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"default",{enumerable:!0,get:function(){return(e=t,e&&e.__esModule?e:{default:e}).default;var e}})}),define("can-validate-validatejs",["require","exports","module","can-reflect","validate.js"],function(e,t,n){"use strict";var a=e("can-reflect"),i=e("validate.js"),r=function(t){return function(e){return i.single(e,t)}};r.many=function(r){return function(e){var t,n=i(e,r,{format:"detailed",fullMessages:!1});return n&&(t=[],a.eachIndex(n,function(e){t.push({message:e.options.message||e.error,related:[e.attribute]})})),t}},r.validatejs=i,n.exports=r}),define("can/es/can-validate-validatejs",["exports","can-validate-validatejs"],function(e,t){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"default",{enumerable:!0,get:function(){return(e=t,e&&e.__esModule?e:{default:e}).default;var e}})}),define("can/es/can-event-dom-radiochange",["exports","can-event-dom-radiochange"],function(e,t){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"default",{enumerable:!0,get:function(){return(e=t,e&&e.__esModule?e:{default:e}).default;var e}})}),define("can-event-dom-enter",["require","exports","module","can-namespace"],function(e,t,n){"use strict";var r=e("can-namespace");var i={defaultEventType:"enter",addEventListener:function(e,t,a){var n=function(e){if(n="Enter"===(t=e).key,r=13===t.keyCode,n||r)return a.apply(this,arguments);var t,n,r},r=i._eventTypeHandlerMap[t];r||(r=i._eventTypeHandlerMap[t]=new Map),r.set(a,n),this.addEventListener(e,"keyup",n)},removeEventListener:function(e,t,n){var r=i._eventTypeHandlerMap[t];if(r){var a=r.get(n);a&&(r.delete(n),0===r.size&&delete i._eventTypeHandlerMap[t],this.removeEventListener(e,"keyup",a))}},_eventTypeHandlerMap:{}};n.exports=r.domEventEnter=i}),define("can/es/can-event-dom-enter",["exports","can-event-dom-enter"],function(e,t){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"default",{enumerable:!0,get:function(){return(e=t,e&&e.__esModule?e:{default:e}).default;var e}})}),define("can/ecosystem",["exports","can/es/can-debug","can/es/can-define-backup","can/es/can-define-stream","can/es/can-define-stream-kefir","can/es/can-kefir","can/es/can-observe","can/es/can-stream","can/es/can-stream-kefir","can/es/can-map-compat","can/es/can-stache-converters","can/es/can-view-autorender","can/es/can-super-model","can/es/can-connect-feathers","can/es/can-connect-tag","can/es/can-fixture-socket","can/es/can-ndjson-stream","can/es/can-connect-ndjson","can/es/can-route-mock","can/es/can-define-validate-validatejs","can/es/can-validate","can/es/can-validate-validatejs","can/es/can-event-dom-radiochange","can/es/can-event-dom-enter"],function(e,t,n,r,a,i,o,s,c,u,l,f,d,p,h,v,g,y,m,b,w,_,x,E){"use strict";function k(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"debug",{enumerable:!0,get:function(){return k(t).default}}),Object.defineProperty(e,"defineBackup",{enumerable:!0,get:function(){return k(n).default}}),Object.defineProperty(e,"defineStream",{enumerable:!0,get:function(){return k(r).default}}),Object.defineProperty(e,"defineStreamKefir",{enumerable:!0,get:function(){return k(a).default}}),Object.defineProperty(e,"kefir",{enumerable:!0,get:function(){return k(i).default}}),Object.defineProperty(e,"observe",{enumerable:!0,get:function(){return k(o).default}}),Object.defineProperty(e,"stream",{enumerable:!0,get:function(){return k(s).default}}),Object.defineProperty(e,"streamKefir",{enumerable:!0,get:function(){return k(c).default}}),Object.defineProperty(e,"makeMapCompat",{enumerable:!0,get:function(){return k(u).default}}),Object.defineProperty(e,"stacheConverters",{enumerable:!0,get:function(){return k(l).default}}),Object.defineProperty(e,"viewAutorender",{enumerable:!0,get:function(){return k(f).default}}),Object.defineProperty(e,"superModel",{enumerable:!0,get:function(){return k(d).default}}),Object.defineProperty(e,"connectFeathers",{enumerable:!0,get:function(){return k(p).default}}),Object.defineProperty(e,"connectTag",{enumerable:!0,get:function(){return k(h).default}}),Object.defineProperty(e,"fixtureSocket",{enumerable:!0,get:function(){return k(v).default}}),Object.defineProperty(e,"ndjsonStream",{enumerable:!0,get:function(){return k(g).default}}),Object.defineProperty(e,"connectNDJSON",{enumerable:!0,get:function(){return k(y).default}}),Object.defineProperty(e,"RouteMock",{enumerable:!0,get:function(){return k(m).default}}),Object.defineProperty(e,"defineValidateValidatejs",{enumerable:!0,get:function(){return k(b).default}}),Object.defineProperty(e,"validate",{enumerable:!0,get:function(){return k(w).default}}),Object.defineProperty(e,"validateValidatejs",{enumerable:!0,get:function(){return k(_).default}}),Object.defineProperty(e,"radioChangeEvent",{enumerable:!0,get:function(){return k(x).default}}),Object.defineProperty(e,"enterEvent",{enumerable:!0,get:function(){return k(E).default}})}),define("can/es/can-compute",["exports","can-compute"],function(e,t){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"default",{enumerable:!0,get:function(){return(e=t,e&&e.__esModule?e:{default:e}).default;var e}})}),define("can-map/bubble",["require","exports","module","can-event-queue/map/map","can-reflect"],function(e,t,n){"use strict";var o=e("can-event-queue/map/map"),s=e("can-reflect"),c={bind:function(e,t){if(!e.__inSetup){var n,r=c.events(e,t),a=r.length;e._bubbleBindings||(e._bubbleBindings={});for(var i=0;i<a;i++)n=r[i],e._bubbleBindings[n]?e._bubbleBindings[n]++:(e._bubbleBindings[n]=1,c.childrenOf(e,n))}},unbind:function(e,t){for(var n,r=c.events(e,t),a=r.length,i=0;i<a;i++)n=r[i],e._bubbleBindings&&e._bubbleBindings[n]--,e._bubbleBindings&&!e._bubbleBindings[n]&&(delete e._bubbleBindings[n],c.teardownChildrenFrom(e,n),0===s.size(e._bubbleBindings)&&delete e._bubbleBindings)},add:function(e,t,n){if(s.isObservableLike(t)&&s.isMapLike(t)&&e._bubbleBindings)for(var r in e._bubbleBindings)e._bubbleBindings[r]&&(c.teardownFromParent(e,t,r),c.toParent(t,e,n,r))},addMany:function(e,t){for(var n=0,r=t.length;n<r;n++)c.add(e,t[n],n)},remove:function(e,t){if(s.isObservableLike(t)&&s.isMapLike(t)&&e._bubbleBindings)for(var n in e._bubbleBindings)e._bubbleBindings[n]&&c.teardownFromParent(e,t,n)},removeMany:function(e,t){for(var n=0,r=t.length;n<r;n++)c.remove(e,t[n])},set:function(e,t,n,r){return s.isObservableLike(n)&&s.isMapLike(n)&&c.add(e,n,t),s.isObservableLike(r)&&s.isMapLike(r)&&c.remove(e,r),n},events:function(e,t){return e.constructor._bubbleRule(t,e)},toParent:function(n,r,a,i){o.listenTo.call(r,n,i,function(){var e=s.toArray(arguments),t=e.shift();e[0]=(s.isObservableLike(r)&&s.isListLike(r)?r.indexOf(n):a)+(e[0]?"."+e[0]:""),t.triggeredNS=t.triggeredNS||{},t.triggeredNS[r._cid]||(t.triggeredNS[r._cid]=!0,o.dispatch.call(r,t,e),"change"===i&&o.dispatch.call(r,e[0],[e[2],e[3]]))})},childrenOf:function(n,r){n._each(function(e,t){e&&e.bind&&c.toParent(e,n,t,r)})},teardownFromParent:function(e,t,n){t&&t.unbind&&o.stopListening.call(e,t,n)},teardownChildrenFrom:function(t,n){t._each(function(e){c.teardownFromParent(t,e,n)})},isBubbling:function(e,t){return e._bubbleBindings&&e._bubbleBindings[t]}};n.exports=c}),define("can-map/map-helpers",["require","exports","module","can-cid","can-assign","can-reflect","can-symbol"],function(e,t,n){"use strict";var s,c=e("can-cid"),r=e("can-assign"),u=e("can-reflect"),a=e("can-symbol"),i=null,o=function(){for(var e in i)i[e].added&&delete i[e].obj._cid;i=null},l={attrParts:function(e,t){return t?[e]:"object"==typeof e?e:(""+e).split(".")},canMakeObserve:function(e){return e&&!u.isPromise(e)&&(Array.isArray(e)||u.isPlainObject(e))},reflectSerialize:function(n){return this.forEach(function(e,t){void 0!==(e=this.___serialize?this.___serialize(t,e):u.serialize(e))&&(n[t]=e)},this),n},reflectUnwrap:function(n){return this.forEach(function(e,t){void 0!==e&&(n[t]=u.unwrap(e))}),n},removeSpecialKeys:function(t){return t&&["_data","constructor","_cid","__bindEvents"].forEach(function(e){delete t[e]}),t},serialize:(s=null,function(a,i,o){var e=c(a),t=!1;return s||(t=!0,s={attr:{},serialize:{}}),s[i][e]=o,a.forEach(function(e,t){var n,r=u.isObservableLike(e)&&s[i][c(e)];void 0!==(n=r||(a["___"+i]?a["___"+i](t,e):l.getValue(a,t,e,i)))&&(o[t]=n)}),t&&(s=null),o}),getValue:function(e,t,n,r){return"attr"===r&&(r=a.for("can.getValue")),u.isObservableLike(n)&&n[r]?n[r]():n},define:null,addComputedAttr:function(n,r,e){n._computedAttrs[r]={compute:e,count:0,handler:function(e,t){n._triggerChange(r,"set",e,t)}}},addToMap:function(e,t){var n;i||(n=o,i={});var r=e._cid,a=c(e);return i[a]||(i[a]={obj:e,instance:t,added:!r}),n},getMapFromObject:function(e){return i&&i[e._cid]&&i[e._cid].instance},twoLevelDeepExtend:function(e,t){for(var n in t)e[n]=e[n]||{},r(e[n],t[n])}};n.exports=l}),define("can-types",["require","exports","module","can-namespace","can-reflect","can-symbol","can-log/dev/dev"],function(e,t,n){"use strict";var r=e("can-namespace"),a=e("can-reflect"),i=e("can-symbol"),o=e("can-log/dev/dev"),s={isMapLike:function(e){return"production"!==process.env.NODE_ENV&&o.warn("can-types.isMapLike(obj) is deprecated, please use `canReflect.isObservableLike(obj) && canReflect.isMapLike(obj)` instead."),a.isObservableLike(e)&&a.isMapLike(e)},isListLike:function(e){return"production"!==process.env.NODE_ENV&&o.warn("can-types.isListLike(obj) is deprecated, please use `canReflect.isObservableLike(obj) && canReflect.isListLike(obj)` instead."),a.isObservableLike(e)&&a.isListLike(e)},isPromise:function(e){return"production"!==process.env.NODE_ENV&&o.warn("can-types.isPromise is deprecated, please use canReflect.isPromise instead."),a.isPromise(e)},isConstructor:function(e){return"production"!==process.env.NODE_ENV&&o.warn("can-types.isConstructor is deprecated, please use canReflect.isConstructorLike instead."),a.isConstructorLike(e)},isCallableForValue:function(e){return"production"!==process.env.NODE_ENV&&o.warn("can-types.isCallableForValue(obj) is deprecated, please use `canReflect.isFunctionLike(obj) && !canReflect.isConstructorLike(obj)` instead."),e&&a.isFunctionLike(e)&&!a.isConstructorLike(e)},isCompute:function(e){return"production"!==process.env.NODE_ENV&&o.warn("can-types.isCompute is deprecated."),e&&e.isComputed},get iterator(){return"production"!==process.env.NODE_ENV&&o.warn('can-types.iterator is deprecated, use `canSymbol.iterator || canSymbol.for("iterator")` instead.'),i.iterator||i.for("iterator")},DefaultMap:null,DefaultList:null,queueTask:function(e){var t=e[2]||[];e[0].apply(e[1],t)},wrapElement:function(e){return e},unwrapElement:function(e){return e}};if(r.types)throw new Error("You can't have two versions of can-types, check your dependencies");n.exports=r.types=s}),define("can-cid/helpers",function(e,t,n){"use strict";n.exports={each:function(e,t,n){for(var r in e)t.call(n,e[r],r);return e}}}),define("can-cid/set/set",["require","exports","module","can-cid","can-cid/helpers"],function(e,t,n){"use strict";var r,a=e("can-cid").get,i=e("can-cid/helpers");"undefined"!=typeof Set?r=Set:((r=function(){this.values={}}).prototype.add=function(e){this.values[a(e)]=e},r.prototype.delete=function(e){var t=a(e)in this.values;return t&&delete this.values[a(e)],t},r.prototype.forEach=function(e,t){i.each(this.values,e,t)},r.prototype.has=function(e){return a(e)in this.values},r.prototype.clear=function(){return this.values={}},Object.defineProperty(r.prototype,"size",{get:function(){var e=0;return i.each(this.values,function(){e++}),e}}));n.exports=r}),define("can-cid/map/map",["require","exports","module","can-cid","can-cid/helpers"],function(e,t,n){"use strict";var r,a=e("can-cid").get,i=e("can-cid/helpers");"undefined"!=typeof Map?r=Map:((r=function(){this.values={}}).prototype.set=function(e,t){this.values[a(e)]={key:e,value:t}},r.prototype.delete=function(e){var t=a(e)in this.values;return t&&delete this.values[a(e)],t},r.prototype.forEach=function(t,n){i.each(this.values,function(e){return t.call(n||this,e.value,e.key,this)},this)},r.prototype.has=function(e){return a(e)in this.values},r.prototype.get=function(e){var t=this.values[a(e)];return t&&t.value},r.prototype.clear=function(){return this.values={}},Object.defineProperty(r.prototype,"size",{get:function(){var e=0;return i.each(this.values,function(){e++}),e}}));n.exports=r}),define("can-map",["require","exports","module","can-map/bubble","can-map/map-helpers","can-event-queue/map/map","can-event-queue/type/type","can-construct","can-observation-recorder","can-stache-key","can-compute","can-single-reference","can-namespace","can-log/dev/dev","can-cid","can-assign","can-types","can-reflect","can-symbol","can-cid/set/set","can-cid/map/map","can-queues"],function(e,t,n){"use strict";var i=e("can-map/bubble"),o=e("can-map/map-helpers"),s=e("can-event-queue/map/map"),r=e("can-event-queue/type/type"),a=e("can-construct"),c=e("can-observation-recorder"),u=e("can-stache-key"),l=e("can-compute"),f=e("can-single-reference"),d=e("can-namespace"),p=e("can-log/dev/dev"),h=e("can-cid"),v=e("can-assign"),g=e("can-types"),y=e("can-reflect"),m=e("can-symbol"),b=e("can-cid/set/set"),w=e("can-cid/map/map"),_=e("can-queues"),x={constructor:!0},E={}.hasOwnProperty,k=a.extend({setup:function(e){if(a.setup.apply(this,arguments),this._computedPropertyNames=[],k){for(var t in r(this),this[m.for("can.defineInstanceKey")]=function(e,t){void 0!==t.value&&(this.defaults[e]=t.value),!1===t.enumerable&&(this.enumerable[e]=!1)},"production"!==process.env.NODE_ENV&&(this.prototype.define&&!o.define&&p.warn("can/map/define is not included, yet there is a define property used. You may want to add this plugin."),this.define&&!o.define&&p.warn("The define property should be on the map's prototype properties, not the static properties. Also, can/map/define is not included.")),this.defaults||(this.defaults={}),this.enumerable||(this.enumerable={}),this.prototype)"define"!==t&&"constructor"!==t&&("function"!=typeof this.prototype[t]||this.prototype[t].prototype instanceof a)?this.defaults[t]=this.prototype[t]:y.isObservableLike(this.prototype[t])&&this._computedPropertyNames.push(t);o.define&&o.define(this,e.prototype.define)}},shortName:"Map",_bubbleRule:function(e){return"change"===e||0<=e.indexOf(".")?["change"]:[]},addEventListener:s.addEventListener,removeEventListener:s.removeEventListener,keys:function(e){return y.getOwnEnumerableKeys(e)}},{setup:function(e){y.isObservableLike(e)&&"function"==typeof e.serialize&&(e=e.serialize()),this._data=Object.create(null),h(this,".map"),this._setupComputedProperties();var t=e&&o.addToMap(e,this),n=this._setupDefaults(e),r=v(y.assignDeep({},n),e);this.attr(r),t&&t()},_setupComputedProperties:function(){this._computedAttrs=Object.create(null);for(var e=this.constructor._computedPropertyNames,t=0,n=e.length;t<n;t++){var r=e[t];o.addComputedAttr(this,r,this[r])}},_setupDefaults:function(){return this.constructor.defaults||{}},attr:function(e,t){var n=typeof e;return void 0===e?this._getAttrs():"string"!==n&&"number"!==n?this._setAttrs(e,t):1===arguments.length?this._get(e):(this._set(e+"",t),this)},_get:function(e){var t=(e+="").indexOf(".");if(0<=t){var n=this.___get(e);if(void 0!==n)return c.add(this,e),n;var r=e.substr(0,t),a=e.substr(t+1),i=this.__get(r);return i&&y.getKeyValue(i,a)}return this.__get(e)},__get:function(e){return x[e]||this._computedAttrs[e]||c.add(this,e),this.___get(e)},___get:function(e){if(void 0===e)return this._data;var t=this._computedAttrs[e];return t?y.getValue(t.compute):E.call(this._data,e)?this._data[e]:void 0},_set:function(e,t,n){var r,a=(e+="").indexOf(".");if(0<=a&&!n){var i=e.substr(0,a),o=e.substr(a+1);r=this.__inSetup?void 0:this.___get(i),y.isMapLike(r)?y.setKeyValue(r,o,t):(r=this.__inSetup?void 0:this.___get(e),this.__convert&&(t=this.__convert(e,t)),this.__set(e,this.__type(t,e),r))}else r=this.__inSetup?void 0:this.___get(e),this.__convert&&(t=this.__convert(e,t)),this.__set(e,this.__type(t,e),r)},__type:function(e,t){if("object"!=typeof e||y.isObservableLike(e)||!o.canMakeObserve(e)||y.isListLike(e))return e;var n=o.getMapFromObject(e);return n||new(this.constructor.Map||k)(e)},__set:function(e,t,n){if(t!==n||!Object.prototype.hasOwnProperty.call(this._data,e)){var r=this._computedAttrs[e],a=r||void 0!==n||E.call(this.___get(),e)?"set":"add";this.___set(e,"object"==typeof t?i.set(this,e,t,n):t),r&&r.count||this._triggerChange(e,a,t,n),"object"==typeof n&&i.teardownFromParent(this,n)}},___set:function(e,t){var n=this._computedAttrs[e];n?y.setValue(n.compute,t):this._data[e]=t,"function"==typeof this.constructor.prototype[e]||n||(this[e]=t)},removeAttr:function(e){return this._remove(e)},_remove:function(e){var t=o.attrParts(e),n=t.shift(),r=this.___get(n);return t.length&&r?y.deleteKeyValue(r,t.join(".")):("string"==typeof e&&~e.indexOf(".")&&(n=e),this.__remove(n,r),r)},__remove:function(e,t){e in this._data&&(this.___remove(e),this._triggerChange(e,"remove",void 0,t))},___remove:function(e){delete this._data[e],e in this.constructor.prototype||delete this[e]},___serialize:function(e,t){return this._legacyAttrBehavior?o.getValue(this,e,t,"serialize"):y.serialize(t,w)},_getAttrs:function(){return this._legacyAttrBehavior?o.serialize(this,"attr",{}):y.unwrap(this,w)},_setAttrs:function(e,t){return this._legacyAttrBehavior?this.__setAttrs(e,t):(!0===t||"true"===t?this[m.for("can.updateDeep")](e):this[m.for("can.assignDeep")](e),this)},__setAttrs:function(n,r){n=v({},n);var e,a,i=this;for(e in _.batch.start(),this._each(function(e,t){"_cid"!==t&&(void 0!==(a=n[t])?(i.__convert&&(a=i.__convert(t,a)),g.isMapLike(e)&&o.canMakeObserve(a)?!0===r?y.updateDeep(e,a):y.assignDeep(e,a):e!==a&&i.__set(t,i.__type(a,t),e),delete n[t]):r&&i.removeAttr(t))}),n)"_cid"!==e&&(a=n[e],this._set(e,a,!0));return _.batch.stop(),this},serialize:function(){return y.serialize(this,w)},_triggerChange:function(e,t,n,r,a){_.batch.start(),i.isBubbling(this,"change")&&s.dispatch.call(this,{type:"change",target:this,batchNum:a},[e,t,n,r]),s.dispatch.call(this,{type:e,target:this,batchNum:a,patches:[{type:"set",key:e,value:n}]},[n,r]),"remove"!==t&&"add"!==t||s.dispatch.call(this,{type:"__keys",target:this,batchNum:a}),_.batch.stop()},compute:function(t){if("function"==typeof this.constructor.prototype[t])return l(this[t],this);var n=u.reads(t),r=n.length-1;return l(function(e){if(!arguments.length)return u.get(this,t);u.write(this,n[r].key,e,{})},this)},forEach:function(e,t){for(var n,r,a=y.getOwnEnumerableKeys(this),i=0,o=a.length;i<o&&(n=a[i],r=this.attr(n),!1!==e.call(t||r,r,n,this));i++);return this},_each:function(e){var t=this.___get();for(var n in t)E.call(t,n)&&e(t[n],n)},dispatch:s.dispatch});s(k.prototype),k.prototype.addEventListener=function(e,t){var n=this._computedAttrs&&this._computedAttrs[e];return n&&n.compute&&(n.count?n.count++:(n.count=1,y.onValue(n.compute,n.handler,"notify"))),i.bind(this,e),s.addEventListener.apply(this,arguments)},k.prototype.removeEventListener=function(e,t){var n=this._computedAttrs&&this._computedAttrs[e];return n&&(1===n.count?(n.count=0,y.offValue(n.compute,n.handler)):n.count--),i.unbind(this,e),s.removeEventListener.apply(this,arguments)},k.prototype.on=k.prototype.bind=k.prototype.addEventListener,k.prototype.off=k.prototype.unbind=k.prototype.removeEventListener,k.on=k.bind=k.addEventListener,k.off=k.unbind=k.removeEventListener,y.assignSymbols(k.prototype,{"can.isMapLike":!0,"can.isListLike":!1,"can.isValueLike":!1,"can.getKeyValue":k.prototype._get,"can.setKeyValue":k.prototype._set,"can.deleteKeyValue":k.prototype._remove,"can.getOwnEnumerableKeys":function(){this.__inSetup||c.add(this,"__keys");var t=this.constructor.enumerable;return t?Object.keys(this._data).filter(function(e){return!1!==t[e]},this):Object.keys(this._data)},"can.assignDeep":function(e){_.batch.start(),y.assignDeepMap(this,o.removeSpecialKeys(y.assignMap({},e))),_.batch.stop()},"can.updateDeep":function(e){_.batch.start(),y.updateDeepMap(this,o.removeSpecialKeys(y.assignMap({},e))),_.batch.stop()},"can.unwrap":o.reflectUnwrap,"can.serialize":o.reflectSerialize,"can.onKeyValue":function(e,r,t){var n=function(e,t,n){r.call(this,t,n)};f.set(r,this,n,e),this.addEventListener(e,n,t)},"can.offKeyValue":function(e,t,n){this.removeEventListener(e,f.getAndDelete(t,this,e),n)},"can.keyHasDependencies":function(e){return!!(this._computedAttrs&&this._computedAttrs[e]&&this._computedAttrs[e].compute)},"can.getKeyDependencies":function(e){var t;return this._computedAttrs&&this._computedAttrs[e]&&this._computedAttrs[e].compute&&((t={}).valueDependencies=new b,t.valueDependencies.add(this._computedAttrs[e].compute)),t}}),g.DefaultMap||(g.DefaultMap=k),n.exports=d.Map=k}),define("can/es/can-map",["exports","can-map"],function(e,t){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"default",{enumerable:!0,get:function(){return(e=t,e&&e.__esModule?e:{default:e}).default;var e}})}),define("can-list",["require","exports","module","can-namespace","can-map","can-map/bubble","can-map/map-helpers","can-queues","can-event-queue/map/map","can-observation-recorder","can-cid","can-reflect","can-assign","can-types","can-symbol","can-cid/map/map"],function(e,t,n){"use strict";var r,a=e("can-namespace"),o=e("can-map"),u=e("can-map/bubble"),i=e("can-map/map-helpers"),l=e("can-queues"),s=e("can-event-queue/map/map"),c=e("can-observation-recorder"),f=e("can-cid"),d=e("can-reflect"),p=e("can-assign"),h=e("can-types"),v=e("can-symbol"),g=e("can-cid/map/map"),y=[].splice,m=(r={0:"a",length:1},y.call(r,0,1),!r[0]),b=function(e,t,n){!t||!t.serialize||t instanceof e?n.push(t):n.push(new e(t.serialize()))},w=o.extend({Map:o},{setup:function(e,t){var n;this.length=0,f(this,".map"),this._setupComputedProperties(),e=void 0===e?[]:d.toArray(e),d.isPromise(e)?this.replace(e):(n=e.length&&i.addToMap(e,this),this.push.apply(this,e)),n&&n(),p(this,t)},_triggerChange:function(e,t,n,r){l.batch.start();var a,i=+e;~(""+e).indexOf(".")||isNaN(i)?o.prototype._triggerChange.apply(this,arguments):(u.isBubbling(this,"change")&&s.dispatch.call(this,{type:"change",target:this},[e,t,n,r]),"add"===t?(a=[{insert:n,index:i,deleteCount:0,type:"splice"}],s.dispatch.call(this,{type:t,patches:a},[n,i]),s.dispatch.call(this,"length",[this.length])):"remove"===t?(a=[{index:i,deleteCount:r.length,type:"splice"}],s.dispatch.call(this,{type:t,patches:a},[r,i]),s.dispatch.call(this,"length",[this.length])):s.dispatch.call(this,t,[n,i])),l.batch.stop()},___get:function(e){if(e){var t=this._computedAttrs[e];return t&&t.compute?d.getValue(t.compute):this[e]&&this[e].isComputed&&"function"==typeof this.constructor.prototype[e]?d.getValue(this[e]):this[e]}return this},__set:function(e,t,n){if("number"!=typeof(e=isNaN(+e)||e%1?e:+e))return o.prototype.__set.call(this,""+e,t,n);if(e>this.length-1){var r=new Array(e+1-this.length);return r[r.length-1]=t,this.push.apply(this,r),r}return this.splice(e,1,t),this},___set:function(e,t){this[e]=t,+e>=this.length&&(this.length=+e+1)},__remove:function(e,t){isNaN(+e)?(delete this[e],this._triggerChange(e,"remove",void 0,t)):this.splice(e,1)},_each:function(e){for(var t=this.___get(),n=0;n<t.length;n++)e(t[n],n)},serialize:function(){return d.serialize(this,g)},splice:function(e,t){var n,r,a,i=d.toArray(arguments),o=[],s=2<i.length;for(e=e||0,n=0,r=i.length-2;n<r;n++)i[a=n+2]=this.__type(i[a],a),o.push(i[a]),this[n+e]!==i[a]&&(s=!1);if(s&&this.length<=o.length)return o;void 0===t&&(t=i[1]=this.length-e);var c=y.apply(this,i);if(!m)for(n=this.length;n<c.length+this.length;n++)delete this[n];return l.batch.start(),0<t&&(u.removeMany(this,c),this._triggerChange(""+e,"remove",void 0,c)),2<i.length&&(u.addMany(this,o),this._triggerChange(""+e,"add",o,c)),l.batch.stop(),c}});d.eachKey({push:"length",unshift:0},function(i,e){var o=[][e];w.prototype[e]=function(){for(var e,t,n=[],r=i?this.length:0,a=arguments.length;a--;)t=arguments[a],n[a]=u.set(this,a,this.__type(t,a));return e=o.apply(this,n),this.comparator&&!n.length||this._triggerChange(""+r,"add",n,void 0),e}}),d.eachKey({pop:"length",shift:0},function(a,i){w.prototype[i]=function(){if(this.length){var e,t=(e=arguments)[0]&&Array.isArray(e[0])?e[0]:d.toArray(e),n=a&&this.length?this.length-1:0,r=[][i].apply(this,t);return this._triggerChange(""+n,"remove",void 0,[r]),r&&r.removeEventListener&&u.remove(this,r),r}}}),p(w.prototype,{indexOf:function(e,t){c.add(this,"length");for(var n=t||0,r=this.length;n<r;n++)if(this.attr(n)===e)return n;return-1},join:function(){return c.add(this,"length"),[].join.apply(this,arguments)},reverse:function(){var e=[].reverse.call(d.toArray(this));return this.replace(e)},slice:function(){c.add(this,"length");var e=Array.prototype.slice.apply(this,arguments);return new this.constructor(e)},concat:function(){var n=[],r=this.constructor.Map;return d.each(arguments,function(e){if(d.isObservableLike(e)&&d.isListLike(e)||Array.isArray(e)){var t=d.isObservableLike(e)&&d.isListLike(e)?d.toArray(e):e;d.each(t,function(e){b(r,e,n)})}else b(r,e,n)}),new this.constructor(Array.prototype.concat.apply(d.toArray(this),n))},forEach:function(e,t){for(var n,r=0,a=this.attr("length");r<a&&(void 0===(n=this.attr(r))||!1!==e.call(t||n,n,r,this));r++);return this},replace:function(e){if(d.isPromise(e)){this._promise&&(this._promise.__isCurrentPromise=!1);var t=this._promise=e;t.__isCurrentPromise=!0;var n=this;e.then(function(e){t.__isCurrentPromise&&n.replace(e)})}else e=void 0===e?[]:d.toArray(e),this.splice.apply(this,[0,this.length].concat(e));return this},filter:function(r,a){var i=new this.constructor,o=this;return this.forEach(function(e,t,n){r.call(a||o,e,t,o)&&i.push(e)}),i},map:function(a,i){var o=new w,s=this;return this.forEach(function(e,t,n){var r=a.call(i||s,e,t,s);o.push(r)}),o},sort:function(e){var t=Array.prototype.slice.call(this);return Array.prototype.sort.call(t,e),this.splice.apply(this,[0,t.length].concat(t)),this}});var _=o.prototype.__type;o.prototype.__type=function(e,t){if("object"==typeof e&&Array.isArray(e)){var n=i.getMapFromObject(e);return n||new w(e)}return _.apply(this,arguments)};var x=o.setup;o.setup=function(){x.apply(this,arguments),this.prototype instanceof w||(this.List=o.List.extend({Map:this},{}))},h.DefaultList||(h.DefaultList=w),d.assignSymbols(w.prototype,{"can.isMoreListLikeThanMapLike":!0,"can.isListLike":!0,"can.getKeyValue":w.prototype._get,"can.setKeyValue":w.prototype._set,"can.deleteKeyValue":w.prototype._remove,"can.getOwnEnumerableKeys":function(){return Object.keys(this._data||{}).concat(this.map(function(e,t){return t}))},"can.assignDeep":function(e){l.batch.start(),d.assignDeepList(this,e),l.batch.stop()},"can.updateDeep":function(e){l.batch.start(),d.updateDeepList(this,e),l.batch.stop()},"can.unwrap":i.reflectUnwrap,"can.serialize":i.reflectSerialize,"can.onKeysAdded":function(e){this[v.for("can.onKeyValue")]("add",e)},"can.onKeysRemoved":function(e){this[v.for("can.onKeyValue")]("remove",e)},"can.splice":function(e,t,n){this.splice.apply(this,[e,t].concat(n))}}),o.List=w,n.exports=a.List=w}),define("can/es/can-list",["exports","can-list"],function(e,t){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"default",{enumerable:!0,get:function(){return(e=t,e&&e.__esModule?e:{default:e}).default;var e}})}),define("can-map-define",["require","exports","module","can-log/dev/dev","can-assign","can-event-queue/map/map","can-queues","can-map/map-helpers","can-map","can-compute","can-reflect","can-observation-recorder","can-list"],function(e,t,n){"use strict";var d=e("can-log/dev/dev"),o=e("can-assign"),p=e("can-event-queue/map/map"),h=e("can-queues"),s=e("can-map/map-helpers"),i=e("can-map"),r=e("can-compute"),c=e("can-reflect"),u=e("can-observation-recorder");e("can-list");var l={},f=function(e){return"object"==typeof e&&"serialize"in e},v=function(e){var t=!0;return f(e)&&(t=!!e.serialize),t},g=function(e,t,n){var r,a;if(n){if(r=n[t],a=n["*"],r&&void 0!==r[e])return r[e];if(a&&void 0!==a[e])return a[e]}};s.define=function(t,e){var n=t.prototype.define;if(e){var r={};s.twoLevelDeepExtend(r,e),s.twoLevelDeepExtend(r,n),o(n,r)}for(var a in"production"!==process.env.NODE_ENV&&t.define&&d.warn("The define property should be on the map's prototype properties, not the static properties."),t.defaultGenerators={},n){var i=n[a].type;"string"==typeof i&&"object"==typeof l.types[i]&&(delete n[a].type,o(n[a],l.types[i])),"value"in n[a]&&("function"==typeof n[a].value?t.defaultGenerators[a]=n[a].value:t.defaults[a]=n[a].value),"function"==typeof n[a].Value&&function(e){t.defaultGenerators[a]=function(){return new e}}(n[a].Value)}};var y=i.prototype._setupDefaults;i.prototype._setupDefaults=function(e){var n=o({},y.call(this)),r={},t=this.constructor,a=this._get;for(var i in this._get=function(e){var t=-1!==e.indexOf(".")?e.substr(0,e.indexOf(".")):e;return t in n&&!(t in r)&&(this.attr(t,n[t]),r[t]=!0),a.apply(this,arguments)},t.defaultGenerators)e&&i in e||(n[i]=t.defaultGenerators[i].call(this));return delete this._get,n};var a=i.prototype,m=a.__set;a.__set=function(t,e,n,r,a){var i,o=this,s=function(e){return"production"!==process.env.NODE_ENV&&clearTimeout(i),!1!==(a&&a.call(o,e))&&p.dispatch.call(o,"error",[t,e],!0),!1},c=g("set",t,this.define),u=g("get",t,this.define);if(c){h.batch.start();var l=!1,f=c.call(this,e,function(e){u?o[t](e):m.call(o,t,e,n,r,s),l=!0,"production"!==process.env.NODE_ENV&&clearTimeout(i)},s,u?this._computedAttrs[t].compute.computeInstance.lastSetValue.get():n);return u?(void 0!==f&&!l&&1<=c.length&&this._computedAttrs[t].compute(f),void h.batch.stop()):void 0===f&&!l&&1<c.length?("production"!==process.env.NODE_ENV&&(i=setTimeout(function(){d.warn('can/map/define: Setter "'+t+'" did not return a value or call the setter callback.')},d.warnTimeout)),void h.batch.stop()):(l||m.call(o,t,0===c.length&&void 0===f?e:f,n,r,s),h.batch.stop(),this)}return m.call(o,t,e,n,r,s),this},l.types={date:function(e){var t=typeof e;return"string"===t?(e=Date.parse(e),isNaN(e)?null:new Date(e)):"number"===t?new Date(e):e},number:function(e){return null==e?e:+e},boolean:function(e){return null==e?e:!("false"===e||"0"===e||!e)},htmlbool:function(e){return"string"==typeof e||!!e},"*":function(e){return e},string:function(e){return null==e?e:""+e},compute:{set:function(e,t,n,r){return e&&e.isComputed?e:r&&r.isComputed?(r(e),r):e},get:function(e){return e&&e.isComputed?e():e}}};var b=a.__type;a.__type=function(e,t){var n=g("type",t,this.define),r=g("Type",t,this.define),a=e;return"string"==typeof n&&(n=l.types[n]),n||r?(n&&(a=n.call(this,a,t)),!r||null==a||a instanceof r||(a=new r(a)),a):(c.isPlainObject(a)&&a.define&&(a=new(a=i.extend(a))),b.call(this,a,t))};var w=a.__remove;a.__remove=function(e,t){var n,r=g("remove",e,this.define);return r?(h.batch.start(),!1===(n=r.call(this,t))?void h.batch.stop():(n=w.call(this,e,t),h.batch.stop(),n)):w.call(this,e,t)};var _=a._setupComputedProperties;a._setupComputedProperties=function(){for(var e in _.apply(this,arguments),this.define){var t=this.define[e].get;t&&s.addComputedAttr(this,e,r.async(void 0,t,this))}};var x=a.___serialize,E=function(e,t,n){var r="*"!==t&&g("serialize",t,e.define);return void 0===r?x.call(e,t,n):!1!==r?"function"==typeof r?r.call(e,n,t):x.call(e,t,n):void 0};a.___serialize=function(e,t){return E(this,e,t)};var k=a.serialize;a.serialize=function(e){var t,n=k.apply(this,arguments);if(e)return n;for(var r in this.define)r in n||this.define&&(this.define[r]&&this.define[r].serialize||this.define["*"]&&this.define["*"].serialize)&&void 0!==(t=E(this,r,this.attr(r)))&&(n[r]=t);return n},c.assignSymbols(a,{"can.hasKey":function(e){var t=this.define&&e in this.define,n=this._data&&e in this._data;return t||n||e in this},"can.getOwnEnumerableKeys":function(){this.__inSetup||u.add(this,"__keys");var e,t,n=function(e){var t=[],n=e&&e["*"];for(var r in e){var a=e[r],i=v(n);"object"==typeof a&&"serialize"in a?i=!!a.serialize:"object"!=typeof a||f(n)||(i=!a.get),i&&t.push(r)}return t}(this.define),r=Object.keys(this._data),a=v(this.define&&this.define["*"]),i=this.constructor.enumerable;for(r=r.filter(function(e){return i?a&&!1!==i[e]:a}),e=0;e<r.length;e++)t=r[e],!(n.indexOf(t)<0)||this.define&&this.define[t]||n.push(r[e]);return n}}),n.exports=l}),define("can/es/can-map-define",["exports","can-map-define"],function(e,t){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"default",{enumerable:!0,get:function(){return(e=t,e&&e.__esModule?e:{default:e}).default;var e}})}),define("can-set-legacy",["require","exports","module","can-query-logic","can-reflect","can-key/transform/transform","can-key/delete/delete","can-key/get/get","can-query-logic/src/helpers","can-query-logic/src/types/make-enum","can-query-logic/src/set"],function(e,t,n){var r,a=e("can-query-logic"),o=e("can-reflect"),i=e("can-key/transform/transform"),s=e("can-key/delete/delete"),c=e("can-key/get/get"),u=e("can-query-logic/src/helpers"),l=e("can-query-logic/src/types/make-enum"),f=e("can-query-logic/src/set"),d=function(){};l(d,[!0,!1],function(e){return"true"===e||"false"!==e&&e});var p={UNIVERSAL:f.UNIVERSAL,EMPTY:f.EMPTY,UNDEFINABLE:f.UNDEFINABLE,UNKNOWABLE:f.UNKNOWABLE,Algebra:function(){var r={schema:[],hydrate:[],serialize:[]};o.eachIndex(arguments,function(e){for(var t in e){if(!r[t])throw new Error("can-query-logic: This type of configuration is not supported. Please use can-query-logic directly.");r[t].push(e[t])}});var e=o.assignSymbols({},{"can.getSchema":function(){var t={kind:"record",identity:[],keys:{}};return r.schema.forEach(function(e){e(t)}),t.identity.length||t.identity.push("id"),t}});return new a(e,{toQuery:function(e){return r.hydrate.reduce(function(e,t){return t(e)},{filter:e})},toParams:function(e){if(f.isSpecial(e))return e;if(Array.isArray(e.filter))return f.UNDEFINABLE;var t=e.filter||{};if(function e(t,n,r,a){if(t&&"object"==typeof t)for(var i in t)if(n[i]){if("function"!=typeof n[i])return!0;r[a]=n[i](t)}else if(e(t[i],n,t,i))return!0;return!1}(t,{$ne:!0,$in:function(e){return e.$in}}))return f.UNDEFINABLE;var n=r.serialize.reduce(function(e,t){return t(e)},e);return t=n.filter||{},delete n.filter,o.assign(n,t)}})},Translate:function(e,r){if("where"!==e)throw new Error("can-query-logic/compat.Translate is only able to translate the where clause");return{hydrate:function(e){var t=o.serialize(e),n=t.filter[r];return delete t.filter[r],n&&o.assign(t.filter,n),t},serialize:function(e){if(e.filter){var t=o.serialize(e),n=e.filter;return t.filter={},t.filter[r]=n,t}return e}}},props:{boolean:function(t){return{schema:function(e){e.keys[t]=d}}},dotNotation:function(){return{}},enum:function(t,e){function n(){}return l(n,e),{schema:function(e){e.keys[t]=n}}},id:function(t){return{schema:function(e){e.identity.push(t)}}},offsetLimit:function(n,r){return n=n||"offset",r=r||"limit",{hydrate:function(e){var t=o.serialize(e);return(n in t.filter||r in t.filter)&&(t.page={}),n in t.filter&&(t.page.start=parseInt(t.filter[n],10),delete t.filter[n]),r in t.filter&&(t.page.end=(t.page.start||0)+parseInt(t.filter[r],10)-1,delete t.filter[r]),t},serialize:function(e){var t=o.serialize(e);return t.page&&(t[n]=t.page.start,t[r]=t.page.end-t.page.start+1,delete t.page),t}}},rangeInclusive:function(e,t){var n={};n["filter."+e]="page.start",n["filter."+t]="page.end";var r={"page.start":e,"page.end":t};return{hydrate:function(e){var t=i(e,n);return t.page&&(t.page.start&&(t.page.start=parseInt(t.page.start,10)),t.page.end&&(t.page.end=parseInt(t.page.end,10))),t},serialize:function(e){return i(e,r)}}},ignore:function(n){return{hydrate:function(e){var t=o.serialize(e);return delete t.filter[n],t}}},sort:function(i,e){if(i||(i="sort"),e)throw new Error("can-query-logic/compat.sort - sortFunc is not supported");return{hydrate:function(e){var t,n=o.serialize(e),r=c(n,"filter."+i);return void 0!==r&&(s(n,"filter."+i),n.sort="desc"===((t=r.split(" "))[1]||"").toLowerCase()?"-"+t[0]:t[0]),n},serialize:function(e){var t,n,r=o.serialize(e),a=r.sort;return void 0!==a&&(delete r.sort,r[i]=(t=a,(n=u.sortData(t)).desc?"-"+n.prop:n.prop)),r}}}}};function h(e){return e?e instanceof a?e:new p.Algebra(e):r}function v(r){p[r]=function(e,t,n){return h(n)[r](e,t)}}v("difference"),v("union"),v("intersection"),v("isSubset"),v("isEqual"),v("isProperSubset"),p.count=function(e,t){return h(t).count(e)},p.comparators=p.props,r=new p.Algebra,n.exports=p}),define("can/es/can-set-legacy",["exports","can-set-legacy"],function(e,t){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"default",{enumerable:!0,get:function(){return(e=t,e&&e.__esModule?e:{default:e}).default;var e}})}),define("can/legacy",["exports","can/es/can-compute","can/es/can-map","can/es/can-list","can/es/can-map-define","can/es/can-set-legacy"],function(e,t,n,r,a,i){"use strict";function o(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"compute",{enumerable:!0,get:function(){return o(t).default}}),Object.defineProperty(e,"CanMap",{enumerable:!0,get:function(){return o(n).default}}),Object.defineProperty(e,"CanList",{enumerable:!0,get:function(){return o(r).default}}),Object.defineProperty(e,"canMapDefine",{enumerable:!0,get:function(){return o(a).default}}),Object.defineProperty(e,"set",{enumerable:!0,get:function(){return o(i).default}})}),define("can",["exports","can/core","can/ecosystem","can/legacy"],function(t,n,r,a){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.keys(n).forEach(function(e){"default"!==e&&"__esModule"!==e&&Object.defineProperty(t,e,{enumerable:!0,get:function(){return n[e]}})}),Object.keys(r).forEach(function(e){"default"!==e&&"__esModule"!==e&&Object.defineProperty(t,e,{enumerable:!0,get:function(){return r[e]}})}),Object.keys(a).forEach(function(e){"default"!==e&&"__esModule"!==e&&Object.defineProperty(t,e,{enumerable:!0,get:function(){return a[e]}})})}),function(e){e._define=e.define,e.define=e.define.orig}("object"==typeof self&&self.Object==Object?self:"object"==typeof process&&"[object process]"===Object.prototype.toString.call(process)?global:window);
app/containers/SettingsList.js
fakob/electron-test-v003
// @flow import React, { Component } from 'react'; import PropTypes from 'prop-types'; // import imageDB from '../utils/db'; import { Button, Input, Icon, Step, Dropdown } from 'semantic-ui-react'; import AddThumb from '../containers/AddThumb'; import UndoRedo from '../containers/UndoRedo'; import { addDefaultThumbs, setDefaultRowCount, setDefaultColumnCount } from '../actions'; const mpPresets = [ { text: '5 x 3', value: 15 }, { text: '5 x 5', value: 25 }, ]; class SettingsList extends Component { componentDidMount() { const { store } = this.context; this.unsubscribe = store.subscribe(() => this.forceUpdate()); // store.dispatch(updateObjectUrlsFromPosterFrame()); } componentWillUnmount() { this.unsubscribe(); } changeRowCount(amount) { const { store } = this.context; const state = store.getState(); store.dispatch( setDefaultRowCount( amount ) ); if (state.undoGroup.present.settings.currentFileId !== undefined) { store.dispatch( addDefaultThumbs( state.undoGroup.present.files .find(x => x.id === state.undoGroup.present.settings.currentFileId), amount * state.undoGroup.present.settings.defaultColumnCount ) ); } } changeColumnCount(amount) { const { store } = this.context; const state = store.getState(); store.dispatch( setDefaultColumnCount( amount ) ); if (state.undoGroup.present.settings.currentFileId !== undefined) { store.dispatch( addDefaultThumbs( state.undoGroup.present.files .find(x => x.id === state.undoGroup.present.settings.currentFileId), state.undoGroup.present.settings.defaultRowCount * amount ) ); } } render() { const { store } = this.context; const state = store.getState(); return ( <div> <AddThumb /> <UndoRedo /> <Button content="10" icon='plus' labelPosition='left' /> <Input action={{ content: 'Row count', onClick: () => { (this.changeRowCount(parseInt(this.inputtextrow.inputRef.value))); } }} ref={input => this.inputtextrow = input} placeholder={state.undoGroup.present.settings.defaultRowCount} onKeyPress={(e) => { (e.key === 'Enter' ? this.changeRowCount(parseInt(e.target.value)) : null); }} /> <Input action={{ content: 'Column count', onClick: () => { (this.changeColumnCount(parseInt(this.inputtextcolumn.inputRef.value))); } }} ref={input => this.inputtextcolumn = input} placeholder={state.undoGroup.present.settings.defaultColumnCount} onKeyPress={(e) => { (e.key === 'Enter' ? this.changeColumnCount(parseInt(e.target.value)) : null); }} /> <Step.Group size='mini'> <Step> <Step.Content> {/* <Step.Title>Shipping</Step.Title> */} {/* <Step.Description>MoviePrint presets</Step.Description> */} <Dropdown placeholder='MoviePrint presets' fluid selection options={mpPresets} /> </Step.Content> </Step> <Step completed> <Icon name='truck' /> <Step.Content> <Step.Title>Shipping</Step.Title> <Step.Description>Choose your shipping options</Step.Description> </Step.Content> </Step> <Step active> <Icon name='dollar' /> <Step.Content> <Step.Title>Billing</Step.Title> <Step.Description>Enter billing information</Step.Description> </Step.Content> </Step> <Step> <Icon name='dollar' /> <Step.Content> {/* <Step.Title>Billing</Step.Title> */} <Step.Description>Count of thumbs</Step.Description> <Input action={{ content: 'Amount', onClick: () => { (this.changeThumbCount(parseInt(this.inputtext.inputRef.value))); } }} ref={input => this.inputtext = input} placeholder="Amount..." onKeyPress={(e) => { (e.key === 'Enter' ? this.changeThumbCount(parseInt(e.target.value)) : null); }} /> </Step.Content> </Step> </Step.Group> </div> ); } } SettingsList.contextTypes = { store: PropTypes.object }; export default SettingsList;
examples/App/components/Doc.js
tangjinzhou/biz-mobile-ui
import React from 'react' import marked from 'marked' import highlight from 'highlight.js' import request from '../request'; import { Link, History } from 'react-router' marked.setOptions({ renderer: new marked.Renderer(), gfm: true, tables: true, breaks: false, pedantic: false, sanitize: false, smartLists: true, smartypants: false, highlight: function (code) { return highlight.highlightAuto(code).value; } }); export default class Doc extends React.Component { constructor(props) { super(props); this.state = {doc: ''}; this._isMounted = true; } componentWillMount(){ this.getDoc(this.props.name); } componentWillReceiveProps(nextProps){ if(nextProps.name !== this.props.name){ this.getDoc(nextProps.name); } } componentWillUnmount(){ this._isMounted = false; } getDoc = (name)=>{ let that = this; request('/getDoc', { name: name }).then(function(res){ if(that._isMounted) { that.setState({doc: res.data.doc}); } }) } render() { const {style} = this.props; return ( <div style={style}> <div className="markdown" dangerouslySetInnerHTML={{__html: marked(this.state.doc)}} /> </div> ) } }
ajax/libs/6to5/3.3.11/browser-polyfill.js
amoyeh/cdnjs
(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 a(o,!0);if(i)return i(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){(function(global){"use strict";if(global._6to5Polyfill){throw new Error("only one instance of 6to5/polyfill is allowed")}global._6to5Polyfill=true;require("core-js/shim");require("regenerator-6to5/runtime")}).call(this,typeof global!=="undefined"?global:typeof self!=="undefined"?self:typeof window!=="undefined"?window:{})},{"core-js/shim":2,"regenerator-6to5/runtime":3}],2:[function(require,module,exports){!function(global,framework,undefined){"use strict";var OBJECT="Object",FUNCTION="Function",ARRAY="Array",STRING="String",NUMBER="Number",REGEXP="RegExp",DATE="Date",MAP="Map",SET="Set",WEAKMAP="WeakMap",WEAKSET="WeakSet",SYMBOL="Symbol",PROMISE="Promise",MATH="Math",ARGUMENTS="Arguments",PROTOTYPE="prototype",CONSTRUCTOR="constructor",TO_STRING="toString",TO_STRING_TAG=TO_STRING+"Tag",TO_LOCALE="toLocaleString",HAS_OWN="hasOwnProperty",FOR_EACH="forEach",ITERATOR="iterator",FF_ITERATOR="@@"+ITERATOR,PROCESS="process",CREATE_ELEMENT="createElement",Function=global[FUNCTION],Object=global[OBJECT],Array=global[ARRAY],String=global[STRING],Number=global[NUMBER],RegExp=global[REGEXP],Date=global[DATE],Map=global[MAP],Set=global[SET],WeakMap=global[WEAKMAP],WeakSet=global[WEAKSET],Symbol=global[SYMBOL],Math=global[MATH],TypeError=global.TypeError,setTimeout=global.setTimeout,setImmediate=global.setImmediate,clearImmediate=global.clearImmediate,process=global[PROCESS],nextTick=process&&process.nextTick,document=global.document,html=document&&document.documentElement,navigator=global.navigator,define=global.define,ArrayProto=Array[PROTOTYPE],ObjectProto=Object[PROTOTYPE],FunctionProto=Function[PROTOTYPE],Infinity=1/0,DOT=".";function isObject(it){return it!=null&&(typeof it=="object"||typeof it=="function")}function isFunction(it){return typeof it=="function"}var isNative=ctx(/./.test,/\[native code\]\s*\}\s*$/,1);var buildIn={Undefined:1,Null:1,Array:1,String:1,Arguments:1,Function:1,Error:1,Boolean:1,Number:1,Date:1,RegExp:1},toString=ObjectProto[TO_STRING];function setToStringTag(it,tag,stat){if(it&&!has(it=stat?it:it[PROTOTYPE],SYMBOL_TAG))hidden(it,SYMBOL_TAG,tag)}function cof(it){return it==undefined?it===undefined?"Undefined":"Null":toString.call(it).slice(8,-1)}function classof(it){var klass=cof(it),tag;return klass==OBJECT&&(tag=it[SYMBOL_TAG])?has(buildIn,tag)?"~"+tag:tag:klass}var call=FunctionProto.call,apply=FunctionProto.apply,REFERENCE_GET;function part(){var fn=assertFunction(this),length=arguments.length,args=Array(length),i=0,_=path._,holder=false;while(length>i)if((args[i]=arguments[i++])===_)holder=true;return function(){var that=this,_length=arguments.length,i=0,j=0,_args;if(!holder&&!_length)return invoke(fn,args,that);_args=args.slice();if(holder)for(;length>i;i++)if(_args[i]===_)_args[i]=arguments[j++];while(_length>j)_args.push(arguments[j++]);return invoke(fn,_args,that)}}function ctx(fn,that,length){assertFunction(fn);if(~length&&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(){return fn.apply(that,arguments)}}function invoke(fn,args,that){var un=that===undefined;switch(args.length|0){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]);case 5:return un?fn(args[0],args[1],args[2],args[3],args[4]):fn.call(that,args[0],args[1],args[2],args[3],args[4])}return fn.apply(that,args)}function construct(target,argumentsList){var proto=assertFunction(arguments.length<3?target:arguments[2])[PROTOTYPE],instance=create(isObject(proto)?proto:ObjectProto),result=apply.call(target,instance,argumentsList);return isObject(result)?result:instance}var create=Object.create,getPrototypeOf=Object.getPrototypeOf,setPrototypeOf=Object.setPrototypeOf,defineProperty=Object.defineProperty,defineProperties=Object.defineProperties,getOwnDescriptor=Object.getOwnPropertyDescriptor,getKeys=Object.keys,getNames=Object.getOwnPropertyNames,getSymbols=Object.getOwnPropertySymbols,isFrozen=Object.isFrozen,has=ctx(call,ObjectProto[HAS_OWN],2),ES5Object=Object,Dict;function toObject(it){return ES5Object(assertDefined(it))}function returnIt(it){return it}function returnThis(){return this}function get(object,key){if(has(object,key))return object[key]}function ownKeys(it){assertObject(it);return getSymbols?getNames(it).concat(getSymbols(it)):getNames(it)}var assign=Object.assign||function(target,source){var T=Object(assertDefined(target)),l=arguments.length,i=1;while(l>i){var S=ES5Object(arguments[i++]),keys=getKeys(S),length=keys.length,j=0,key;while(length>j)T[key=keys[j++]]=S[key]}return T};function keyOf(object,el){var O=toObject(object),keys=getKeys(O),length=keys.length,index=0,key;while(length>index)if(O[key=keys[index++]]===el)return key}function array(it){return String(it).split(",")}var push=ArrayProto.push,unshift=ArrayProto.unshift,slice=ArrayProto.slice,splice=ArrayProto.splice,indexOf=ArrayProto.indexOf,forEach=ArrayProto[FOR_EACH];function createArrayMethod(type){var isMap=type==1,isFilter=type==2,isSome=type==3,isEvery=type==4,isFindIndex=type==6,noholes=type==5||isFindIndex;return function(callbackfn){var O=Object(assertDefined(this)),that=arguments[1],self=ES5Object(O),f=ctx(callbackfn,that,3),length=toLength(self.length),index=0,result=isMap?Array(length):isFilter?[]:undefined,val,res;for(;length>index;index++)if(noholes||index in self){val=self[index];res=f(val,index,O);if(type){if(isMap)result[index]=res;else if(res)switch(type){case 3:return true;case 5:return val;case 6:return index;case 2:result.push(val)}else if(isEvery)return false}}return isFindIndex?-1:isSome||isEvery?isEvery:result}}function createArrayContains(isContains){return function(el){var O=toObject(this),length=toLength(O.length),index=toIndex(arguments[1],length);if(isContains&&el!=el){for(;length>index;index++)if(sameNaN(O[index]))return isContains||index}else for(;length>index;index++)if(isContains||index in O){if(O[index]===el)return isContains||index}return!isContains&&-1}}function generic(A,B){return typeof A=="function"?A:B}var MAX_SAFE_INTEGER=9007199254740991,ceil=Math.ceil,floor=Math.floor,max=Math.max,min=Math.min,random=Math.random,trunc=Math.trunc||function(it){return(it>0?floor:ceil)(it)};function sameNaN(number){return number!=number}function toInteger(it){return isNaN(it)?0:trunc(it)}function toLength(it){return it>0?min(toInteger(it),MAX_SAFE_INTEGER):0}function toIndex(index,length){var index=toInteger(index);return index<0?max(index+length,0):min(index,length)}function createReplacer(regExp,replace,isStatic){var replacer=isObject(replace)?function(part){return replace[part]}:replace;return function(it){return String(isStatic?it:this).replace(regExp,replacer)}}function createPointAt(toString){return function(pos){var s=String(assertDefined(this)),i=toInteger(pos),l=s.length,a,b;if(i<0||i>=l)return toString?"":undefined;a=s.charCodeAt(i);return a<55296||a>56319||i+1===l||(b=s.charCodeAt(i+1))<56320||b>57343?toString?s.charAt(i):a:toString?s.slice(i,i+2):(a-55296<<10)+(b-56320)+65536}}var REDUCE_ERROR="Reduce of empty object with no initial value";function assert(condition,msg1,msg2){if(!condition)throw TypeError(msg2?msg1+msg2:msg1)}function assertDefined(it){if(it==undefined)throw TypeError("Function called on null or undefined");return it}function assertFunction(it){assert(isFunction(it),it," is not a function!");return it}function assertObject(it){assert(isObject(it),it," is not an object!");return it}function assertInstance(it,Constructor,name){assert(it instanceof Constructor,name,": use the 'new' operator!")}function descriptor(bitmap,value){return{enumerable:!(bitmap&1),configurable:!(bitmap&2),writable:!(bitmap&4),value:value}}function simpleSet(object,key,value){object[key]=value;return object}function createDefiner(bitmap){return DESC?function(object,key,value){return defineProperty(object,key,descriptor(bitmap,value))}:simpleSet}function uid(key){return SYMBOL+"("+key+")_"+(++sid+random())[TO_STRING](36)}function getWellKnownSymbol(name,setter){return Symbol&&Symbol[name]||(setter?Symbol:safeSymbol)(SYMBOL+DOT+name)}var DESC=!!function(){try{return defineProperty({},DOT,ObjectProto)}catch(e){}}(),sid=0,hidden=createDefiner(1),set=Symbol?simpleSet:hidden,safeSymbol=Symbol||uid;function assignHidden(target,src){for(var key in src)hidden(target,key,src[key]);return target}var SYMBOL_UNSCOPABLES=getWellKnownSymbol("unscopables"),ArrayUnscopables=ArrayProto[SYMBOL_UNSCOPABLES]||{},SYMBOL_SPECIES=getWellKnownSymbol("species");function setSpecies(C){if(framework||!isNative(C))defineProperty(C,SYMBOL_SPECIES,{configurable:true,get:returnThis})}var SYMBOL_ITERATOR=getWellKnownSymbol(ITERATOR),SYMBOL_TAG=getWellKnownSymbol(TO_STRING_TAG),SUPPORT_FF_ITER=FF_ITERATOR in ArrayProto,ITER=safeSymbol("iter"),KEY=1,VALUE=2,Iterators={},IteratorPrototype={},NATIVE_ITERATORS=SYMBOL_ITERATOR in ArrayProto,BUGGY_ITERATORS="keys"in ArrayProto&&!("next"in[].keys());setIterator(IteratorPrototype,returnThis);function setIterator(O,value){hidden(O,SYMBOL_ITERATOR,value);SUPPORT_FF_ITER&&hidden(O,FF_ITERATOR,value)}function createIterator(Constructor,NAME,next,proto){Constructor[PROTOTYPE]=create(proto||IteratorPrototype,{next:descriptor(1,next)});setToStringTag(Constructor,NAME+" Iterator")}function defineIterator(Constructor,NAME,value,DEFAULT){var proto=Constructor[PROTOTYPE],iter=get(proto,SYMBOL_ITERATOR)||get(proto,FF_ITERATOR)||DEFAULT&&get(proto,DEFAULT)||value;if(framework){setIterator(proto,iter);if(iter!==value){var iterProto=getPrototypeOf(iter.call(new Constructor));setToStringTag(iterProto,NAME+" Iterator",true);has(proto,FF_ITERATOR)&&setIterator(iterProto,returnThis)}}Iterators[NAME]=iter;Iterators[NAME+" Iterator"]=returnThis;return iter}function defineStdIterators(Base,NAME,Constructor,next,DEFAULT,IS_SET){function createIter(kind){return function(){return new Constructor(this,kind)}}createIterator(Constructor,NAME,next);var entries=createIter(KEY+VALUE),values=createIter(VALUE);if(DEFAULT==VALUE)values=defineIterator(Base,NAME,values,"values");else entries=defineIterator(Base,NAME,entries,"entries");if(DEFAULT){$define(PROTO+FORCED*BUGGY_ITERATORS,NAME,{entries:entries,keys:IS_SET?values:createIter(KEY),values:values})}}function iterResult(done,value){return{value:value,done:!!done}}function isIterable(it){var O=Object(it),Symbol=global[SYMBOL],hasExt=(Symbol&&Symbol[ITERATOR]||FF_ITERATOR)in O;return hasExt||SYMBOL_ITERATOR in O||has(Iterators,classof(O))}function getIterator(it){var Symbol=global[SYMBOL],ext=it[Symbol&&Symbol[ITERATOR]||FF_ITERATOR],getIter=ext||it[SYMBOL_ITERATOR]||Iterators[classof(it)];return assertObject(getIter.call(it))}function stepCall(fn,value,entries){return entries?invoke(fn,value):fn(value)}function forOf(iterable,entries,fn,that){var iterator=getIterator(iterable),f=ctx(fn,that,entries?2:1),step;while(!(step=iterator.next()).done)if(stepCall(f,step.value,entries)===false)return}var NODE=cof(process)==PROCESS,core={},path=framework?global:core,old=global.core,exportGlobal,FORCED=1,GLOBAL=2,STATIC=4,PROTO=8,BIND=16,WRAP=32;function $define(type,name,source){var key,own,out,exp,isGlobal=type&GLOBAL,target=isGlobal?global:type&STATIC?global[name]:(global[name]||ObjectProto)[PROTOTYPE],exports=isGlobal?core:core[name]||(core[name]={});if(isGlobal)source=name;for(key in source){own=!(type&FORCED)&&target&&key in target&&(!isFunction(target[key])||isNative(target[key]));out=(own?target:source)[key];if(type&BIND&&own)exp=ctx(out,global);else if(type&WRAP&&!framework&&target[key]==out){exp=function(param){return this instanceof out?new out(param):out(param)};exp[PROTOTYPE]=out[PROTOTYPE]}else exp=type&PROTO&&isFunction(out)?ctx(call,out):out;if(exports[key]!=out)hidden(exports,key,exp);if(framework&&target&&!own){if(isGlobal)target[key]=out;else delete target[key]&&hidden(target,key,out)}}}if(typeof module!="undefined"&&module.exports)module.exports=core;else if(isFunction(define)&&define.amd)define(function(){return core});else exportGlobal=true;if(exportGlobal||framework){core.noConflict=function(){global.core=old;return core};global.core=core}$define(GLOBAL+FORCED,{global:global});!function(TAG,SymbolRegistry,AllSymbols,setter){if(!isNative(Symbol)){Symbol=function(description){assert(!(this instanceof Symbol),SYMBOL+" is not a "+CONSTRUCTOR);var tag=uid(description);AllSymbols[tag]=true;DESC&&setter&&defineProperty(ObjectProto,tag,{configurable:true,set:function(value){hidden(this,tag,value)}});return set(create(Symbol[PROTOTYPE]),TAG,tag)};hidden(Symbol[PROTOTYPE],TO_STRING,function(){return this[TAG]})}$define(GLOBAL+WRAP,{Symbol:Symbol});var symbolStatics={"for":function(key){return has(SymbolRegistry,key+="")?SymbolRegistry[key]:SymbolRegistry[key]=Symbol(key)},iterator:SYMBOL_ITERATOR,keyFor:part.call(keyOf,SymbolRegistry),species:SYMBOL_SPECIES,toStringTag:SYMBOL_TAG=getWellKnownSymbol(TO_STRING_TAG,true),unscopables:SYMBOL_UNSCOPABLES,pure:safeSymbol,set:set,useSetter:function(){setter=true},useSimple:function(){setter=false}};forEach.call(array("hasInstance,isConcatSpreadable,match,replace,search,split,toPrimitive"),function(it){symbolStatics[it]=getWellKnownSymbol(it)});$define(STATIC,SYMBOL,symbolStatics);setToStringTag(Symbol,SYMBOL);$define(STATIC+FORCED*!isNative(Symbol),OBJECT,{getOwnPropertyNames:function(it){var names=getNames(toObject(it)),result=[],key,i=0;while(names.length>i)has(AllSymbols,key=names[i++])||result.push(key);return result},getOwnPropertySymbols:function(it){var names=getNames(toObject(it)),result=[],key,i=0;while(names.length>i)has(AllSymbols,key=names[i++])&&result.push(key);return result}})}(safeSymbol("tag"),{},{},true);!function(RegExpProto,isFinite,tmp,NAME){var RangeError=global.RangeError,isInteger=Number.isInteger||function(it){return!isObject(it)&&isFinite(it)&&floor(it)===it},sign=Math.sign||function sign(x){return(x=+x)==0||x!=x?x:x<0?-1:1},E=Math.E,pow=Math.pow,abs=Math.abs,exp=Math.exp,log=Math.log,sqrt=Math.sqrt,fcc=String.fromCharCode,at=createPointAt(true);var objectStatic={assign:assign,is:function(x,y){return x===y?x!==0||1/x===1/y:x!=x&&y!=y}};"__proto__"in ObjectProto&&function(buggy,set){try{set=ctx(call,getOwnDescriptor(ObjectProto,"__proto__").set,2);set({},ArrayProto)}catch(e){buggy=true}objectStatic.setPrototypeOf=setPrototypeOf=setPrototypeOf||function(O,proto){assertObject(O);assert(proto===null||isObject(proto),proto,": can't set as prototype!");if(buggy)O.__proto__=proto;else set(O,proto);return O}}();$define(STATIC,OBJECT,objectStatic);function asinh(x){return!isFinite(x=+x)||x==0?x:x<0?-asinh(-x):log(x+sqrt(x*x+1))}function expm1(x){return(x=+x)==0?x:x>-1e-6&&x<1e-6?x+x*x/2:exp(x)-1}$define(STATIC,NUMBER,{EPSILON:pow(2,-52),isFinite:function(it){return typeof it=="number"&&isFinite(it)},isInteger:isInteger,isNaN:sameNaN,isSafeInteger:function(number){return isInteger(number)&&abs(number)<=MAX_SAFE_INTEGER},MAX_SAFE_INTEGER:MAX_SAFE_INTEGER,MIN_SAFE_INTEGER:-MAX_SAFE_INTEGER,parseFloat:parseFloat,parseInt:parseInt});$define(STATIC,MATH,{acosh:function(x){return(x=+x)<1?NaN:isFinite(x)?log(x/E+sqrt(x+1)*sqrt(x-1)/E)+1:x},asinh:asinh,atanh:function(x){return(x=+x)==0?x:log((1+x)/(1-x))/2},cbrt:function(x){return sign(x=+x)*pow(abs(x),1/3)},clz32:function(x){return(x>>>=0)?32-x[TO_STRING](2).length:32},cosh:function(x){return(exp(x=+x)+exp(-x))/2},expm1:expm1,fround:function(x){return new Float32Array([x])[0]},hypot:function(value1,value2){var sum=0,len1=arguments.length,len2=len1,args=Array(len1),larg=-Infinity,arg;while(len1--){arg=args[len1]=+arguments[len1];if(arg==Infinity||arg==-Infinity)return Infinity;if(arg>larg)larg=arg}larg=arg||1;while(len2--)sum+=pow(args[len2]/larg,2);return larg*sqrt(sum)},imul:function(x,y){var UInt16=65535,xn=+x,yn=+y,xl=UInt16&xn,yl=UInt16&yn;return 0|xl*yl+((UInt16&xn>>>16)*yl+xl*(UInt16&yn>>>16)<<16>>>0)},log1p:function(x){return(x=+x)>-1e-8&&x<1e-8?x-x*x/2:log(1+x)},log10:function(x){return log(x)/Math.LN10},log2:function(x){return log(x)/Math.LN2},sign:sign,sinh:function(x){return abs(x=+x)<1?(expm1(x)-expm1(-x))/2:(exp(x-1)-exp(-x-1))*(E/2)},tanh:function(x){var a=expm1(x=+x),b=expm1(-x);return a==Infinity?1:b==Infinity?-1:(a-b)/(exp(x)+exp(-x))},trunc:trunc});setToStringTag(Math,MATH,true);function assertNotRegExp(it){if(cof(it)==REGEXP)throw TypeError()}$define(STATIC,STRING,{fromCodePoint:function(x){var res=[],len=arguments.length,i=0,code;while(len>i){code=+arguments[i++];if(toIndex(code,1114111)!==code)throw RangeError(code+" is not a valid code point");res.push(code<65536?fcc(code):fcc(((code-=65536)>>10)+55296,code%1024+56320))}return res.join("")},raw:function(callSite){var raw=toObject(callSite.raw),len=toLength(raw.length),sln=arguments.length,res=[],i=0;while(len>i){res.push(String(raw[i++]));if(i<sln)res.push(String(arguments[i]))}return res.join("")}});$define(PROTO,STRING,{codePointAt:createPointAt(false),endsWith:function(searchString){assertNotRegExp(searchString);var that=String(assertDefined(this)),endPosition=arguments[1],len=toLength(that.length),end=endPosition===undefined?len:min(toLength(endPosition),len);searchString+="";return that.slice(end-searchString.length,end)===searchString},includes:function(searchString){assertNotRegExp(searchString);return!!~String(assertDefined(this)).indexOf(searchString,arguments[1])},repeat:function(count){var str=String(assertDefined(this)),res="",n=toInteger(count);if(0>n||n==Infinity)throw RangeError("Count can't be negative");for(;n>0;(n>>>=1)&&(str+=str))if(n&1)res+=str;return res},startsWith:function(searchString){assertNotRegExp(searchString);var that=String(assertDefined(this)),index=toLength(min(arguments[1],that.length));searchString+="";return that.slice(index,index+searchString.length)===searchString}});defineStdIterators(String,STRING,function(iterated){set(this,ITER,{o:String(iterated),i:0})},function(){var iter=this[ITER],O=iter.o,index=iter.i,point;if(index>=O.length)return iterResult(1);point=at.call(O,index);iter.i+=point.length;return iterResult(0,point)});$define(STATIC,ARRAY,{from:function(arrayLike){var O=Object(assertDefined(arrayLike)),result=new(generic(this,Array)),mapfn=arguments[1],that=arguments[2],mapping=mapfn!==undefined,f=mapping?ctx(mapfn,that,2):undefined,index=0,length;if(isIterable(O))for(var iter=getIterator(O),step;!(step=iter.next()).done;index++){result[index]=mapping?f(step.value,index):step.value}else for(length=toLength(O.length);length>index;index++){result[index]=mapping?f(O[index],index):O[index]}result.length=index;return result},of:function(){var index=0,length=arguments.length,result=new(generic(this,Array))(length);while(length>index)result[index]=arguments[index++];result.length=length;return result}});$define(PROTO,ARRAY,{copyWithin:function(target,start){var O=Object(assertDefined(this)),len=toLength(O.length),to=toIndex(target,len),from=toIndex(start,len),end=arguments[2],fin=end===undefined?len:toIndex(end,len),count=min(fin-from,len-to),inc=1;if(from<to&&to<from+count){inc=-1;from=from+count-1;to=to+count-1}while(count-->0){if(from in O)O[to]=O[from];else delete O[to];to+=inc;from+=inc}return O},fill:function(value){var O=Object(assertDefined(this)),length=toLength(O.length),index=toIndex(arguments[1],length),end=arguments[2],endPos=end===undefined?length:toIndex(end,length);while(endPos>index)O[index++]=value;return O},find:createArrayMethod(5),findIndex:createArrayMethod(6)});defineStdIterators(Array,ARRAY,function(iterated,kind){set(this,ITER,{o:toObject(iterated),i:0,k:kind})},function(){var iter=this[ITER],O=iter.o,kind=iter.k,index=iter.i++;if(!O||index>=O.length)return iter.o=undefined,iterResult(1);if(kind==KEY)return iterResult(0,index);if(kind==VALUE)return iterResult(0,O[index]);return iterResult(0,[index,O[index]])},VALUE);Iterators[ARGUMENTS]=Iterators[ARRAY];setToStringTag(global.JSON,"JSON",true);function wrapObjectMethod(key,MODE){var fn=Object[key],exp=core[OBJECT][key],f=0,o={};if(!exp||isNative(exp)){o[key]=MODE==1?function(it){return isObject(it)?fn(it):it}:MODE==2?function(it){return isObject(it)?fn(it):true}:MODE==3?function(it){return isObject(it)?fn(it):false}:MODE==4?function(it,key){return fn(toObject(it),key)}:function(it){return fn(toObject(it))};try{fn(DOT)}catch(e){f=1}$define(STATIC+FORCED*f,OBJECT,o)}}wrapObjectMethod("freeze",1);wrapObjectMethod("seal",1);wrapObjectMethod("preventExtensions",1);wrapObjectMethod("isFrozen",2);wrapObjectMethod("isSealed",2);wrapObjectMethod("isExtensible",3);wrapObjectMethod("getOwnPropertyDescriptor",4);wrapObjectMethod("getPrototypeOf");wrapObjectMethod("keys");wrapObjectMethod("getOwnPropertyNames");if(framework){tmp[SYMBOL_TAG]=DOT;if(cof(tmp)!=DOT)hidden(ObjectProto,TO_STRING,function(){return"[object "+classof(this)+"]"});NAME in FunctionProto||defineProperty(FunctionProto,NAME,{configurable:true,get:function(){var match=String(this).match(/^\s*function ([^ (]*)/),name=match?match[1]:"";has(this,NAME)||defineProperty(this,NAME,descriptor(5,name));return name},set:function(value){has(this,NAME)||defineProperty(this,NAME,descriptor(0,value))}});if(DESC&&!function(){try{return RegExp(/a/g,"i")=="/a/i"}catch(e){}}()){var _RegExp=RegExp;RegExp=function RegExp(pattern,flags){return new _RegExp(cof(pattern)==REGEXP&&flags!==undefined?pattern.source:pattern,flags)};forEach.call(getNames(_RegExp),function(key){key in RegExp||defineProperty(RegExp,key,{configurable:true,get:function(){return _RegExp[key]},set:function(it){_RegExp[key]=it}})});RegExpProto[CONSTRUCTOR]=RegExp;RegExp[PROTOTYPE]=RegExpProto;hidden(global,REGEXP,RegExp)}if(/./g.flags!="g")defineProperty(RegExpProto,"flags",{configurable:true,get:createReplacer(/^.*\/(\w*)$/,"$1")});forEach.call(array("find,findIndex,fill,copyWithin,entries,keys,values"),function(it){ArrayUnscopables[it]=true});SYMBOL_UNSCOPABLES in ArrayProto||hidden(ArrayProto,SYMBOL_UNSCOPABLES,ArrayUnscopables)}setSpecies(RegExp);setSpecies(Array)}(RegExp[PROTOTYPE],isFinite,{},"name");isFunction(setImmediate)&&isFunction(clearImmediate)||function(ONREADYSTATECHANGE){var postMessage=global.postMessage,addEventListener=global.addEventListener,MessageChannel=global.MessageChannel,counter=0,queue={},defer,channel,port;setImmediate=function(fn){var args=[],i=1;while(arguments.length>i)args.push(arguments[i++]);queue[++counter]=function(){invoke(isFunction(fn)?fn:Function(fn),args)};defer(counter);return counter};clearImmediate=function(id){delete queue[id]};function run(id){if(has(queue,id)){var fn=queue[id];delete queue[id];fn()}}function listner(event){run(event.data)}if(NODE){defer=function(id){nextTick(part.call(run,id))}}else if(addEventListener&&isFunction(postMessage)&&!global.importScripts){defer=function(id){postMessage(id,"*")};addEventListener("message",listner,false)}else if(isFunction(MessageChannel)){channel=new MessageChannel;port=channel.port2;channel.port1.onmessage=listner;defer=ctx(port.postMessage,port,1)}else if(document&&ONREADYSTATECHANGE in document[CREATE_ELEMENT]("script")){defer=function(id){html.appendChild(document[CREATE_ELEMENT]("script"))[ONREADYSTATECHANGE]=function(){html.removeChild(this);run(id)}}}else{defer=function(id){setTimeout(part.call(run,id),0)}}}("onreadystatechange");$define(GLOBAL+BIND,{setImmediate:setImmediate,clearImmediate:clearImmediate});!function(Promise,test){isFunction(Promise)&&isFunction(Promise.resolve)&&Promise.resolve(test=new Promise(function(){}))==test||function(asap,DEF){function isThenable(o){var then;if(isObject(o))then=o.then;return isFunction(then)?then:false}function notify(def){var chain=def.chain;chain.length&&asap(function(){var msg=def.msg,ok=def.state==1,i=0;while(chain.length>i)!function(react){var cb=ok?react.ok:react.fail,ret,then;try{if(cb){ret=cb===true?msg:cb(msg);if(ret===react.P){react.rej(TypeError(PROMISE+"-chain cycle"))}else if(then=isThenable(ret)){then.call(ret,react.res,react.rej)}else react.res(ret)}else react.rej(msg)}catch(err){react.rej(err)}}(chain[i++]);chain.length=0})}function resolve(msg){var def=this,then,wrapper;if(def.done)return;def.done=true;def=def.def||def;try{if(then=isThenable(msg)){wrapper={def:def,done:false};then.call(msg,ctx(resolve,wrapper,1),ctx(reject,wrapper,1))}else{def.msg=msg;def.state=1;notify(def)}}catch(err){reject.call(wrapper||{def:def,done:false},err)}}function reject(msg){var def=this;if(def.done)return;def.done=true;def=def.def||def;def.msg=msg;def.state=2;notify(def)}function getConstructor(C){var S=assertObject(C)[SYMBOL_SPECIES];return S!=undefined?S:C}Promise=function(executor){assertFunction(executor);assertInstance(this,Promise,PROMISE);var def={chain:[],state:0,done:false,msg:undefined};hidden(this,DEF,def);try{executor(ctx(resolve,def,1),ctx(reject,def,1))}catch(err){reject.call(def,err)}};assignHidden(Promise[PROTOTYPE],{then:function(onFulfilled,onRejected){var S=assertObject(assertObject(this)[CONSTRUCTOR])[SYMBOL_SPECIES];var react={ok:isFunction(onFulfilled)?onFulfilled:true,fail:isFunction(onRejected)?onRejected:false},P=react.P=new(S!=undefined?S:Promise)(function(resolve,reject){react.res=assertFunction(resolve);react.rej=assertFunction(reject)}),def=this[DEF];def.chain.push(react);def.state&&notify(def);return P},"catch":function(onRejected){return this.then(undefined,onRejected)}});assignHidden(Promise,{all:function(iterable){var Promise=getConstructor(this),values=[];return new Promise(function(resolve,reject){forOf(iterable,false,push,values);var remaining=values.length,results=Array(remaining);if(remaining)forEach.call(values,function(promise,index){Promise.resolve(promise).then(function(value){results[index]=value;--remaining||resolve(results)},reject)});else resolve(results)})},race:function(iterable){var Promise=getConstructor(this);return new Promise(function(resolve,reject){forOf(iterable,false,function(promise){Promise.resolve(promise).then(resolve,reject)})})},reject:function(r){return new(getConstructor(this))(function(resolve,reject){reject(r)})},resolve:function(x){return isObject(x)&&DEF in x&&getPrototypeOf(x)===this[PROTOTYPE]?x:new(getConstructor(this))(function(resolve,reject){resolve(x)})}})}(nextTick||setImmediate,safeSymbol("def"));setToStringTag(Promise,PROMISE);setSpecies(Promise);$define(GLOBAL+FORCED*!isNative(Promise),{Promise:Promise})}(global[PROMISE]);!function(){var UID=safeSymbol("uid"),O1=safeSymbol("O1"),WEAK=safeSymbol("weak"),LEAK=safeSymbol("leak"),LAST=safeSymbol("last"),FIRST=safeSymbol("first"),SIZE=DESC?safeSymbol("size"):"size",uid=0,tmp={};function getCollection(C,NAME,methods,commonMethods,isMap,isWeak){var ADDER=isMap?"set":"add",proto=C&&C[PROTOTYPE],O={};function initFromIterable(that,iterable){if(iterable!=undefined)forOf(iterable,isMap,that[ADDER],that);return that}function fixSVZ(key,chain){var method=proto[key];if(framework)proto[key]=function(a,b){var result=method.call(this,a===0?0:a,b);return chain?this:result}}if(!isNative(C)||!(isWeak||!BUGGY_ITERATORS&&has(proto,FOR_EACH)&&has(proto,"entries"))){C=isWeak?function(iterable){assertInstance(this,C,NAME);set(this,UID,uid++);initFromIterable(this,iterable)}:function(iterable){var that=this;assertInstance(that,C,NAME);set(that,O1,create(null));set(that,SIZE,0);set(that,LAST,undefined);set(that,FIRST,undefined);initFromIterable(that,iterable)};assignHidden(assignHidden(C[PROTOTYPE],methods),commonMethods);isWeak||defineProperty(C[PROTOTYPE],"size",{get:function(){return assertDefined(this[SIZE])}})}else{var Native=C,inst=new C,chain=inst[ADDER](isWeak?{}:-0,1),buggyZero;if(!NATIVE_ITERATORS||!C.length){C=function(iterable){assertInstance(this,C,NAME);return initFromIterable(new Native,iterable)};C[PROTOTYPE]=proto;if(framework)proto[CONSTRUCTOR]=C}isWeak||inst[FOR_EACH](function(val,key){buggyZero=1/key===-Infinity});if(buggyZero){fixSVZ("delete");fixSVZ("has");isMap&&fixSVZ("get")}if(buggyZero||chain!==inst)fixSVZ(ADDER,true)}setToStringTag(C,NAME);setSpecies(C);O[NAME]=C;$define(GLOBAL+WRAP+FORCED*!isNative(C),O);isWeak||defineStdIterators(C,NAME,function(iterated,kind){set(this,ITER,{o:iterated,k:kind})},function(){var iter=this[ITER],kind=iter.k,entry=iter.l;while(entry&&entry.r)entry=entry.p;if(!iter.o||!(iter.l=entry=entry?entry.n:iter.o[FIRST])){return iter.o=undefined,iterResult(1)}if(kind==KEY)return iterResult(0,entry.k);if(kind==VALUE)return iterResult(0,entry.v);return iterResult(0,[entry.k,entry.v])},isMap?KEY+VALUE:VALUE,!isMap);return C}function fastKey(it,create){if(!isObject(it))return(typeof it=="string"?"S":"P")+it;if(isFrozen(it))return"F";if(!has(it,UID)){if(!create)return"E";hidden(it,UID,++uid)}return"O"+it[UID]}function getEntry(that,key){var index=fastKey(key),entry;if(index!="F")return that[O1][index];for(entry=that[FIRST];entry;entry=entry.n){if(entry.k==key)return entry}}function def(that,key,value){var entry=getEntry(that,key),prev,index;if(entry)entry.v=value;else{that[LAST]=entry={i:index=fastKey(key,true),k:key,v:value,p:prev=that[LAST],n:undefined,r:false};if(!that[FIRST])that[FIRST]=entry;if(prev)prev.n=entry;that[SIZE]++;if(index!="F")that[O1][index]=entry}return that}var collectionMethods={clear:function(){for(var that=this,data=that[O1],entry=that[FIRST];entry;entry=entry.n){entry.r=true;entry.p=entry.n=undefined;delete data[entry.i]}that[FIRST]=that[LAST]=undefined;that[SIZE]=0},"delete":function(key){var that=this,entry=getEntry(that,key);if(entry){var next=entry.n,prev=entry.p;delete that[O1][entry.i];entry.r=true;if(prev)prev.n=next;if(next)next.p=prev;if(that[FIRST]==entry)that[FIRST]=next;if(that[LAST]==entry)that[LAST]=prev;that[SIZE]--}return!!entry},forEach:function(callbackfn){var f=ctx(callbackfn,arguments[1],3),entry;while(entry=entry?entry.n:this[FIRST]){f(entry.v,entry.k,this);while(entry&&entry.r)entry=entry.p}},has:function(key){return!!getEntry(this,key)}};Map=getCollection(Map,MAP,{get:function(key){var entry=getEntry(this,key);return entry&&entry.v},set:function(key,value){return def(this,key===0?0:key,value)}},collectionMethods,true);Set=getCollection(Set,SET,{add:function(value){return def(this,value=value===0?0:value,value)}},collectionMethods);function defWeak(that,key,value){if(isFrozen(assertObject(key)))leakStore(that).set(key,value);else{has(key,WEAK)||hidden(key,WEAK,{});key[WEAK][that[UID]]=value}return that}function leakStore(that){return that[LEAK]||hidden(that,LEAK,new Map)[LEAK]}var weakMethods={"delete":function(key){if(!isObject(key))return false;if(isFrozen(key))return leakStore(this)["delete"](key);return has(key,WEAK)&&has(key[WEAK],this[UID])&&delete key[WEAK][this[UID]]},has:function(key){if(!isObject(key))return false;if(isFrozen(key))return leakStore(this).has(key);return has(key,WEAK)&&has(key[WEAK],this[UID])}};WeakMap=getCollection(WeakMap,WEAKMAP,{get:function(key){if(isObject(key)){if(isFrozen(key))return leakStore(this).get(key);if(has(key,WEAK))return key[WEAK][this[UID]]}},set:function(key,value){return defWeak(this,key,value)}},weakMethods,true,true);if(framework&&DESC&&new WeakMap([[Object.freeze(tmp),7]]).get(tmp)!=7){forEach.call(array("delete,has,get,set"),function(key){var method=WeakMap[PROTOTYPE][key];WeakMap[PROTOTYPE][key]=function(a,b){if(isObject(a)&&isFrozen(a)){var result=leakStore(this)[key](a,b);return key=="set"?this:result }return method.call(this,a,b)}})}WeakSet=getCollection(WeakSet,WEAKSET,{add:function(value){return defWeak(this,value,true)}},weakMethods,false,true)}();!function(){function Enumerate(iterated){var keys=[],key;for(key in iterated)keys.push(key);set(this,ITER,{o:iterated,a:keys,i:0})}createIterator(Enumerate,OBJECT,function(){var iter=this[ITER],keys=iter.a,key;do{if(iter.i>=keys.length)return iterResult(1)}while(!((key=keys[iter.i++])in iter.o));return iterResult(0,key)});function wrap(fn){return function(it){assertObject(it);try{return fn.apply(undefined,arguments),true}catch(e){return false}}}function reflectGet(target,propertyKey){var receiver=arguments.length<3?target:arguments[2],desc=getOwnDescriptor(assertObject(target),propertyKey),proto;if(desc)return desc.get?desc.get.call(receiver):desc.value;return isObject(proto=getPrototypeOf(target))?reflectGet(proto,propertyKey,receiver):undefined}function reflectSet(target,propertyKey,V){var receiver=arguments.length<4?target:arguments[3],desc=getOwnDescriptor(assertObject(target),propertyKey),proto;if(desc){if(desc.writable===false)return false;if(desc.set)return desc.set.call(receiver,V),true}if(isObject(proto=getPrototypeOf(target)))return reflectSet(proto,propertyKey,V,receiver);desc=getOwnDescriptor(receiver,propertyKey)||descriptor(0);desc.value=V;return defineProperty(receiver,propertyKey,desc),true}var isExtensible=Object.isExtensible||returnIt;var reflect={apply:ctx(call,apply,3),construct:construct,defineProperty:wrap(defineProperty),deleteProperty:function(target,propertyKey){var desc=getOwnDescriptor(assertObject(target),propertyKey);return desc&&!desc.configurable?false:delete target[propertyKey]},enumerate:function(target){return new Enumerate(assertObject(target))},get:reflectGet,getOwnPropertyDescriptor:function(target,propertyKey){return getOwnDescriptor(assertObject(target),propertyKey)},getPrototypeOf:function(target){return getPrototypeOf(assertObject(target))},has:function(target,propertyKey){return propertyKey in target},isExtensible:function(target){return!!isExtensible(assertObject(target))},ownKeys:ownKeys,preventExtensions:wrap(Object.preventExtensions||returnIt),set:reflectSet};if(setPrototypeOf)reflect.setPrototypeOf=function(target,proto){return setPrototypeOf(assertObject(target),proto),true};$define(GLOBAL,{Reflect:{}});$define(STATIC,"Reflect",reflect)}();!function(){$define(PROTO,ARRAY,{includes:createArrayContains(true)});$define(PROTO,STRING,{at:createPointAt(true)});function createObjectToArray(isEntries){return function(object){var O=toObject(object),keys=getKeys(object),length=keys.length,i=0,result=Array(length),key;if(isEntries)while(length>i)result[i]=[key=keys[i++],O[key]];else while(length>i)result[i]=O[keys[i++]];return result}}$define(STATIC,OBJECT,{values:createObjectToArray(false),entries:createObjectToArray(true)});$define(STATIC,REGEXP,{escape:createReplacer(/([\\\-[\]{}()*+?.,^$|])/g,"\\$1",true)})}();!function(REFERENCE){REFERENCE_GET=getWellKnownSymbol(REFERENCE+"Get",true);var REFERENCE_SET=getWellKnownSymbol(REFERENCE+SET,true),REFERENCE_DELETE=getWellKnownSymbol(REFERENCE+"Delete",true);$define(STATIC,SYMBOL,{referenceGet:REFERENCE_GET,referenceSet:REFERENCE_SET,referenceDelete:REFERENCE_DELETE});hidden(FunctionProto,REFERENCE_GET,returnThis);function setMapMethods(Constructor){if(Constructor){var MapProto=Constructor[PROTOTYPE];hidden(MapProto,REFERENCE_GET,MapProto.get);hidden(MapProto,REFERENCE_SET,MapProto.set);hidden(MapProto,REFERENCE_DELETE,MapProto["delete"])}}setMapMethods(Map);setMapMethods(WeakMap)}("reference");!function(NodeList){if(framework&&NodeList&&!(SYMBOL_ITERATOR in NodeList[PROTOTYPE])){hidden(NodeList[PROTOTYPE],SYMBOL_ITERATOR,Iterators[ARRAY])}Iterators.NodeList=Iterators[ARRAY]}(global.NodeList);!function(arrayStatics){function setArrayStatics(keys,length){forEach.call(array(keys),function(key){if(key in ArrayProto)arrayStatics[key]=ctx(call,ArrayProto[key],length)})}setArrayStatics("pop,reverse,shift,keys,values,entries",1);setArrayStatics("indexOf,every,some,forEach,map,filter,find,findIndex,includes",3);setArrayStatics("join,slice,concat,push,splice,unshift,sort,lastIndexOf,"+"reduce,reduceRight,copyWithin,fill,turn");$define(STATIC,ARRAY,arrayStatics)}({})}(typeof self!="undefined"&&self.Math===Math?self:Function("return this")(),true)},{}],3:[function(require,module,exports){(function(global){!function(global){"use strict";var hasOwn=Object.prototype.hasOwnProperty;var undefined;var iteratorSymbol=typeof Symbol==="function"&&Symbol.iterator||"@@iterator";var inModule=typeof module==="object";var runtime=global.regeneratorRuntime;if(runtime){if(inModule){module.exports=runtime}return}runtime=global.regeneratorRuntime=inModule?module.exports:{};function wrap(innerFn,outerFn,self,tryList){return new Generator(innerFn,outerFn,self||null,tryList||[])}runtime.wrap=wrap;function tryCatch(fn,obj,arg){try{return{type:"normal",arg:fn.call(obj,arg)}}catch(err){return{type:"throw",arg:err}}}var GenStateSuspendedStart="suspendedStart";var GenStateSuspendedYield="suspendedYield";var GenStateExecuting="executing";var GenStateCompleted="completed";var ContinueSentinel={};function GeneratorFunction(){}function GeneratorFunctionPrototype(){}var Gp=GeneratorFunctionPrototype.prototype=Generator.prototype;GeneratorFunction.prototype=Gp.constructor=GeneratorFunctionPrototype;GeneratorFunctionPrototype.constructor=GeneratorFunction;GeneratorFunction.displayName="GeneratorFunction";runtime.isGeneratorFunction=function(genFun){var ctor=typeof genFun==="function"&&genFun.constructor;return ctor?ctor===GeneratorFunction||(ctor.displayName||ctor.name)==="GeneratorFunction":false};runtime.mark=function(genFun){genFun.__proto__=GeneratorFunctionPrototype;genFun.prototype=Object.create(Gp);return genFun};runtime.async=function(innerFn,outerFn,self,tryList){return new Promise(function(resolve,reject){var generator=wrap(innerFn,outerFn,self,tryList);var callNext=step.bind(generator.next);var callThrow=step.bind(generator["throw"]);function step(arg){var record=tryCatch(this,null,arg);if(record.type==="throw"){reject(record.arg);return}var info=record.arg;if(info.done){resolve(info.value)}else{Promise.resolve(info.value).then(callNext,callThrow)}}callNext()})};function Generator(innerFn,outerFn,self,tryList){var generator=outerFn?Object.create(outerFn.prototype):this;var context=new Context(tryList);var state=GenStateSuspendedStart;function invoke(method,arg){if(state===GenStateExecuting){throw new Error("Generator is already running")}if(state===GenStateCompleted){return doneResult()}while(true){var delegate=context.delegate;if(delegate){var record=tryCatch(delegate.iterator[method],delegate.iterator,arg);if(record.type==="throw"){context.delegate=null;method="throw";arg=record.arg;continue}method="next";arg=undefined;var info=record.arg;if(info.done){context[delegate.resultName]=info.value;context.next=delegate.nextLoc}else{state=GenStateSuspendedYield;return info}context.delegate=null}if(method==="next"){if(state===GenStateSuspendedStart&&typeof arg!=="undefined"){throw new TypeError("attempt to send "+JSON.stringify(arg)+" to newborn generator")}if(state===GenStateSuspendedYield){context.sent=arg}else{delete context.sent}}else if(method==="throw"){if(state===GenStateSuspendedStart){state=GenStateCompleted;throw arg}if(context.dispatchException(arg)){method="next";arg=undefined}}else if(method==="return"){context.abrupt("return",arg)}state=GenStateExecuting;var record=tryCatch(innerFn,self,context);if(record.type==="normal"){state=context.done?GenStateCompleted:GenStateSuspendedYield;var info={value:record.arg,done:context.done};if(record.arg===ContinueSentinel){if(context.delegate&&method==="next"){arg=undefined}}else{return info}}else if(record.type==="throw"){state=GenStateCompleted;if(method==="next"){context.dispatchException(record.arg)}else{arg=record.arg}}}}generator.next=invoke.bind(generator,"next");generator["throw"]=invoke.bind(generator,"throw");generator["return"]=invoke.bind(generator,"return");return generator}Gp[iteratorSymbol]=function(){return this};Gp.toString=function(){return"[object Generator]"};function pushTryEntry(triple){var entry={tryLoc:triple[0]};if(1 in triple){entry.catchLoc=triple[1]}if(2 in triple){entry.finallyLoc=triple[2]}this.tryEntries.push(entry)}function resetTryEntry(entry,i){var record=entry.completion||{};record.type=i===0?"normal":"return";delete record.arg;entry.completion=record}function Context(tryList){this.tryEntries=[{tryLoc:"root"}];tryList.forEach(pushTryEntry,this);this.reset()}runtime.keys=function(object){var keys=[];for(var key in object){keys.push(key)}keys.reverse();return function next(){while(keys.length){var key=keys.pop();if(key in object){next.value=key;next.done=false;return next}}next.done=true;return next}};function values(iterable){if(iterable){var iteratorMethod=iterable[iteratorSymbol];if(iteratorMethod){return iteratorMethod.call(iterable)}if(typeof iterable.next==="function"){return iterable}if(!isNaN(iterable.length)){var i=-1,next=function next(){while(++i<iterable.length){if(hasOwn.call(iterable,i)){next.value=iterable[i];next.done=false;return next}}next.value=undefined;next.done=true;return next};return next.next=next}}return{next:doneResult}}runtime.values=values;function doneResult(){return{value:undefined,done:true}}Context.prototype={constructor:Context,reset:function(){this.prev=0;this.next=0;this.sent=undefined;this.done=false;this.delegate=null;this.tryEntries.forEach(resetTryEntry);for(var tempIndex=0,tempName;hasOwn.call(this,tempName="t"+tempIndex)||tempIndex<20;++tempIndex){this[tempName]=null}},stop:function(){this.done=true;var rootEntry=this.tryEntries[0];var rootRecord=rootEntry.completion;if(rootRecord.type==="throw"){throw rootRecord.arg}return this.rval},dispatchException:function(exception){if(this.done){throw exception}var context=this;function handle(loc,caught){record.type="throw";record.arg=exception;context.next=loc;return!!caught}for(var i=this.tryEntries.length-1;i>=0;--i){var entry=this.tryEntries[i];var record=entry.completion;if(entry.tryLoc==="root"){return handle("end")}if(entry.tryLoc<=this.prev){var hasCatch=hasOwn.call(entry,"catchLoc");var hasFinally=hasOwn.call(entry,"finallyLoc");if(hasCatch&&hasFinally){if(this.prev<entry.catchLoc){return handle(entry.catchLoc,true)}else if(this.prev<entry.finallyLoc){return handle(entry.finallyLoc)}}else if(hasCatch){if(this.prev<entry.catchLoc){return handle(entry.catchLoc,true)}}else if(hasFinally){if(this.prev<entry.finallyLoc){return handle(entry.finallyLoc)}}else{throw new Error("try statement without catch or finally")}}}},_findFinallyEntry:function(finallyLoc){for(var i=this.tryEntries.length-1;i>=0;--i){var entry=this.tryEntries[i];if(entry.tryLoc<=this.prev&&hasOwn.call(entry,"finallyLoc")&&(entry.finallyLoc===finallyLoc||this.prev<entry.finallyLoc)){return entry}}},abrupt:function(type,arg){var entry=this._findFinallyEntry();var record=entry?entry.completion:{};record.type=type;record.arg=arg;if(entry){this.next=entry.finallyLoc}else{this.complete(record)}return ContinueSentinel},complete:function(record){if(record.type==="throw"){throw record.arg}if(record.type==="break"||record.type==="continue"){this.next=record.arg}else if(record.type==="return"){this.rval=record.arg;this.next="end"}return ContinueSentinel},finish:function(finallyLoc){var entry=this._findFinallyEntry(finallyLoc);return this.complete(entry.completion)},"catch":function(tryLoc){for(var i=this.tryEntries.length-1;i>=0;--i){var entry=this.tryEntries[i];if(entry.tryLoc===tryLoc){var record=entry.completion;if(record.type==="throw"){var thrown=record.arg;resetTryEntry(entry,i)}return thrown}}throw new Error("illegal catch attempt")},delegateYield:function(iterable,resultName,nextLoc){this.delegate={iterator:values(iterable),resultName:resultName,nextLoc:nextLoc};return ContinueSentinel}}}(typeof global==="object"?global:typeof window==="object"?window:this)}).call(this,typeof global!=="undefined"?global:typeof self!=="undefined"?self:typeof window!=="undefined"?window:{})},{}]},{},[1]);
hw8/frontend/src/components/article/searchBar.js
yusong-shen/comp531-web-development
/** * Created by yusong on 10/23/16. */ import React, { Component } from 'react'; import { connect } from 'react-redux' import { Field, reduxForm } from 'redux-form'; import * as ArticleActions from '../../actions/articleActions' class SearchBar extends Component { handleFormSubmit = (values) => { const keyword = values.keyword || '' this.props.setKeyword(keyword) } render() { return ( <form onSubmit={this.props.handleSubmit(this.handleFormSubmit)}> <div> <Field id="keyword" name="keyword" component="input" type="text" placeholder="Search..."/> <button id="searchBtn" type="submit">Search</button> </div> </form> ); } } // Decorate the form component SearchBar = reduxForm({ form: 'searchBar' // a unique name for this form })(SearchBar); export default connect(null, ArticleActions)(SearchBar)
packages/material-ui-icons/src/Cast.js
kybarg/material-ui
import React from 'react'; import createSvgIcon from './utils/createSvgIcon'; export default createSvgIcon( <React.Fragment><path fill="none" d="M0 0h24v24H0z" opacity=".1" /><path d="M21 3H3c-1.1 0-2 .9-2 2v3h2V5h18v14h-7v2h7c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zM1 18v3h3c0-1.66-1.34-3-3-3zm0-4v2c2.76 0 5 2.24 5 5h2c0-3.87-3.13-7-7-7zm0-4v2c4.97 0 9 4.03 9 9h2c0-6.08-4.93-11-11-11z" /></React.Fragment> , 'Cast');
app/components/shared/Autocomplete/loader.js
buildkite/frontend
import React from 'react'; import Spinner from 'app/components/shared/Spinner'; export default class Loader extends React.PureComponent { static displayName = "Autocomplete.Loader"; render() { return ( <li className="center py3"><Spinner /></li> ); } }
src/HoursPanel.js
jlbooker/shop-hours-demo
import React, { Component } from 'react'; import HoursList from './HoursList.js'; // Component to show a panel listing the open hours class HoursPanel extends Component { render(){ // Check for an empty list (size of the array == 0), and show a friendly message if empty var hoursList; if(this.props.hours.length <= 0) { hoursList = <p className="text-muted">No hours yet. Use the form to the right to add your shop's hours.</p> } else { hoursList = <HoursList hours={this.props.hours} removeHours={this.props.removeHours}/> } return ( <div className="panel panel-default"> <div className="panel-body"> My shop is open: {hoursList} </div> </div> ); } } export default HoursPanel;
app/javascript/app/providers/agriculture-world-meat-trade-provider/agriculture-world-meat-trade-provider.js
Vizzuality/climate-watch
import { PureComponent } from 'react'; import { connect } from 'react-redux'; import PropTypes from 'prop-types'; import isEqual from 'lodash/isEqual'; import actions from './agriculture-world-meat-trade-provider-actions'; export { initialState } from './agriculture-world-meat-trade-provider-reducers'; export { default as reducers } from './agriculture-world-meat-trade-provider-reducers'; export { default as actions } from './agriculture-world-meat-trade-provider-actions'; class MeatTradeProvider extends PureComponent { componentDidMount() { const { fetchWorldMeatTrade, params } = this.props; if (params) fetchWorldMeatTrade(params); } componentDidUpdate(prevProps) { const { fetchWorldMeatTrade, params } = this.props; const { params: prevParams } = prevProps; if (!isEqual(prevParams, params)) fetchWorldMeatTrade(params); } render() { return null; } } MeatTradeProvider.propTypes = { fetchWorldMeatTrade: PropTypes.func.isRequired, params: PropTypes.shape({ country: PropTypes.string, year: PropTypes.string }) }; MeatTradeProvider.defaultProps = { country: null, params: {} }; export default connect(null, actions)(MeatTradeProvider);
frontend/src/routes.js
posix4e/reserve-my-life
// src/routes.js import React from 'react'; import { Route, BrowserRouter } from 'react-router-dom'; import history from './history'; import Auth from './Auth/Auth'; import Home from './Home/Home'; import App from './App'; import AdminPage from './Admin'; import Callback from './Callback/Callback'; export const makeMainRoutes = () => { const auth = new Auth(); const handleAuthentication = (nextState) => { if (/access_token|id_token|error/.test(nextState.location.hash)) { auth.handleAuthentication(); } } return ( <BrowserRouter history={history} component={App}> <div> <Route path="/" render={(props) => <App auth={auth} {...props} />} /> <Route path="/home" render={(props) => <Home auth={auth} {...props} />} /> <Route path="/admin" render={(props) => <AdminPage auth={auth} {...props} />} /> <Route path="/callback" render={(props) => { handleAuthentication(props); return <Callback {...props} /> }} /> </div> </BrowserRouter> ); }
docs/src/app/components/pages/components/SvgIcon/ExampleIcons.js
pomerantsev/material-ui
import React from 'react'; import ActionHome from 'material-ui/svg-icons/action/home'; import ActionFlightTakeoff from 'material-ui/svg-icons/action/flight-takeoff'; import FileCloudDownload from 'material-ui/svg-icons/file/cloud-download'; import HardwareVideogameAsset from 'material-ui/svg-icons/hardware/videogame-asset'; import {red500, yellow500, blue500} from 'material-ui/styles/colors'; const iconStyles = { marginRight: 24, }; const SvgIconExampleIcons = () => ( <div> <ActionHome style={iconStyles} /> <ActionFlightTakeoff style={iconStyles} color={red500} /> <FileCloudDownload style={iconStyles} color={yellow500} /> <HardwareVideogameAsset style={iconStyles} color={blue500} /> </div> ); export default SvgIconExampleIcons;
ajax/libs/clappr/0.0.6/clappr.light.js
hpneo/cdnjs
require=(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 a(o,!0);if(i)return i(o,!0);throw new Error("Cannot find module '"+o+"'")}var f=n[o]={exports:{}};t[o][0].call(f.exports,function(e){var n=t[o][1][e];return s(n?n:e)},f,f.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){ // 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. function EventEmitter() { this._events = this._events || {}; this._maxListeners = this._maxListeners || undefined; } module.exports = EventEmitter; // Backwards-compat with node 0.10.x EventEmitter.EventEmitter = EventEmitter; EventEmitter.prototype._events = undefined; EventEmitter.prototype._maxListeners = undefined; // By default EventEmitters will print a warning if more than 10 listeners are // added to it. This is a useful default which helps finding memory leaks. EventEmitter.defaultMaxListeners = 10; // Obviously not all Emitters should be limited to 10. This function allows // that to be increased. Set to zero for unlimited. EventEmitter.prototype.setMaxListeners = function(n) { if (!isNumber(n) || n < 0 || isNaN(n)) throw TypeError('n must be a positive number'); this._maxListeners = n; return this; }; EventEmitter.prototype.emit = function(type) { var er, handler, len, args, i, listeners; if (!this._events) this._events = {}; // If there is no 'error' event listener then throw. if (type === 'error') { if (!this._events.error || (isObject(this._events.error) && !this._events.error.length)) { er = arguments[1]; if (er instanceof Error) { throw er; // Unhandled 'error' event } else { throw TypeError('Uncaught, unspecified "error" event.'); } return false; } } handler = this._events[type]; if (isUndefined(handler)) return false; if (isFunction(handler)) { switch (arguments.length) { // fast cases case 1: handler.call(this); break; case 2: handler.call(this, arguments[1]); break; case 3: handler.call(this, arguments[1], arguments[2]); break; // slower default: len = arguments.length; args = new Array(len - 1); for (i = 1; i < len; i++) args[i - 1] = arguments[i]; handler.apply(this, args); } } else if (isObject(handler)) { len = arguments.length; args = new Array(len - 1); for (i = 1; i < len; i++) args[i - 1] = arguments[i]; listeners = handler.slice(); len = listeners.length; for (i = 0; i < len; i++) listeners[i].apply(this, args); } return true; }; EventEmitter.prototype.addListener = function(type, listener) { var m; if (!isFunction(listener)) throw TypeError('listener must be a function'); if (!this._events) this._events = {}; // To avoid recursion in the case that type === "newListener"! Before // adding it to the listeners, first emit "newListener". if (this._events.newListener) this.emit('newListener', type, isFunction(listener.listener) ? listener.listener : listener); if (!this._events[type]) // Optimize the case of one listener. Don't need the extra array object. this._events[type] = listener; else if (isObject(this._events[type])) // If we've already got an array, just append. this._events[type].push(listener); else // Adding the second element, need to change to array. this._events[type] = [this._events[type], listener]; // Check for listener leak if (isObject(this._events[type]) && !this._events[type].warned) { var m; if (!isUndefined(this._maxListeners)) { m = this._maxListeners; } else { m = EventEmitter.defaultMaxListeners; } if (m && m > 0 && this._events[type].length > m) { this._events[type].warned = true; console.error('(node) warning: possible EventEmitter memory ' + 'leak detected. %d listeners added. ' + 'Use emitter.setMaxListeners() to increase limit.', this._events[type].length); if (typeof console.trace === 'function') { // not supported in IE 10 console.trace(); } } } return this; }; EventEmitter.prototype.on = EventEmitter.prototype.addListener; EventEmitter.prototype.once = function(type, listener) { if (!isFunction(listener)) throw TypeError('listener must be a function'); var fired = false; function g() { this.removeListener(type, g); if (!fired) { fired = true; listener.apply(this, arguments); } } g.listener = listener; this.on(type, g); return this; }; // emits a 'removeListener' event iff the listener was removed EventEmitter.prototype.removeListener = function(type, listener) { var list, position, length, i; if (!isFunction(listener)) throw TypeError('listener must be a function'); if (!this._events || !this._events[type]) return this; list = this._events[type]; length = list.length; position = -1; if (list === listener || (isFunction(list.listener) && list.listener === listener)) { delete this._events[type]; if (this._events.removeListener) this.emit('removeListener', type, listener); } else if (isObject(list)) { for (i = length; i-- > 0;) { if (list[i] === listener || (list[i].listener && list[i].listener === listener)) { position = i; break; } } if (position < 0) return this; if (list.length === 1) { list.length = 0; delete this._events[type]; } else { list.splice(position, 1); } if (this._events.removeListener) this.emit('removeListener', type, listener); } return this; }; EventEmitter.prototype.removeAllListeners = function(type) { var key, listeners; if (!this._events) return this; // not listening for removeListener, no need to emit if (!this._events.removeListener) { if (arguments.length === 0) this._events = {}; else if (this._events[type]) delete this._events[type]; return this; } // emit removeListener for all listeners on all events if (arguments.length === 0) { for (key in this._events) { if (key === 'removeListener') continue; this.removeAllListeners(key); } this.removeAllListeners('removeListener'); this._events = {}; return this; } listeners = this._events[type]; if (isFunction(listeners)) { this.removeListener(type, listeners); } else { // LIFO order while (listeners.length) this.removeListener(type, listeners[listeners.length - 1]); } delete this._events[type]; return this; }; EventEmitter.prototype.listeners = function(type) { var ret; if (!this._events || !this._events[type]) ret = []; else if (isFunction(this._events[type])) ret = [this._events[type]]; else ret = this._events[type].slice(); return ret; }; EventEmitter.listenerCount = function(emitter, type) { var ret; if (!emitter._events || !emitter._events[type]) ret = 0; else if (isFunction(emitter._events[type])) ret = 1; else ret = emitter._events[type].length; return ret; }; function isFunction(arg) { return typeof arg === 'function'; } function isNumber(arg) { return typeof arg === 'number'; } function isObject(arg) { return typeof arg === 'object' && arg !== null; } function isUndefined(arg) { return arg === void 0; } },{}],2:[function(require,module,exports){ // shim for using process in browser var process = module.exports = {}; process.nextTick = (function () { var canSetImmediate = typeof window !== 'undefined' && window.setImmediate; var canPost = typeof window !== 'undefined' && window.postMessage && window.addEventListener ; if (canSetImmediate) { return function (f) { return window.setImmediate(f) }; } if (canPost) { var queue = []; window.addEventListener('message', function (ev) { var source = ev.source; if ((source === window || source === null) && ev.data === 'process-tick') { ev.stopPropagation(); if (queue.length > 0) { var fn = queue.shift(); fn(); } } }, true); return function nextTick(fn) { queue.push(fn); window.postMessage('process-tick', '*'); }; } return function nextTick(fn) { setTimeout(fn, 0); }; })(); process.title = 'browser'; process.browser = true; process.env = {}; process.argv = []; function noop() {} process.on = noop; process.addListener = noop; process.once = noop; process.off = noop; process.removeListener = noop; process.removeAllListeners = noop; process.emit = noop; process.binding = function (name) { throw new Error('process.binding is not supported'); } // TODO(shtylman) process.cwd = function () { return '/' }; process.chdir = function (dir) { throw new Error('process.chdir is not supported'); }; },{}],3:[function(require,module,exports){ (function (process,global){ (function(global) { 'use strict'; if (global.$traceurRuntime) { return; } var $Object = Object; var $TypeError = TypeError; var $create = $Object.create; var $defineProperties = $Object.defineProperties; var $defineProperty = $Object.defineProperty; var $freeze = $Object.freeze; var $getOwnPropertyDescriptor = $Object.getOwnPropertyDescriptor; var $getOwnPropertyNames = $Object.getOwnPropertyNames; var $keys = $Object.keys; var $hasOwnProperty = $Object.prototype.hasOwnProperty; var $toString = $Object.prototype.toString; var $preventExtensions = Object.preventExtensions; var $seal = Object.seal; var $isExtensible = Object.isExtensible; function nonEnum(value) { return { configurable: true, enumerable: false, value: value, writable: true }; } var types = { void: function voidType() {}, any: function any() {}, string: function string() {}, number: function number() {}, boolean: function boolean() {} }; var method = nonEnum; var counter = 0; function newUniqueString() { return '__$' + Math.floor(Math.random() * 1e9) + '$' + ++counter + '$__'; } var symbolInternalProperty = newUniqueString(); var symbolDescriptionProperty = newUniqueString(); var symbolDataProperty = newUniqueString(); var symbolValues = $create(null); var privateNames = $create(null); function createPrivateName() { var s = newUniqueString(); privateNames[s] = true; return s; } function isSymbol(symbol) { return typeof symbol === 'object' && symbol instanceof SymbolValue; } function typeOf(v) { if (isSymbol(v)) return 'symbol'; return typeof v; } function Symbol(description) { var value = new SymbolValue(description); if (!(this instanceof Symbol)) return value; throw new TypeError('Symbol cannot be new\'ed'); } $defineProperty(Symbol.prototype, 'constructor', nonEnum(Symbol)); $defineProperty(Symbol.prototype, 'toString', method(function() { var symbolValue = this[symbolDataProperty]; if (!getOption('symbols')) return symbolValue[symbolInternalProperty]; if (!symbolValue) throw TypeError('Conversion from symbol to string'); var desc = symbolValue[symbolDescriptionProperty]; if (desc === undefined) desc = ''; return 'Symbol(' + desc + ')'; })); $defineProperty(Symbol.prototype, 'valueOf', method(function() { var symbolValue = this[symbolDataProperty]; if (!symbolValue) throw TypeError('Conversion from symbol to string'); if (!getOption('symbols')) return symbolValue[symbolInternalProperty]; return symbolValue; })); function SymbolValue(description) { var key = newUniqueString(); $defineProperty(this, symbolDataProperty, {value: this}); $defineProperty(this, symbolInternalProperty, {value: key}); $defineProperty(this, symbolDescriptionProperty, {value: description}); freeze(this); symbolValues[key] = this; } $defineProperty(SymbolValue.prototype, 'constructor', nonEnum(Symbol)); $defineProperty(SymbolValue.prototype, 'toString', { value: Symbol.prototype.toString, enumerable: false }); $defineProperty(SymbolValue.prototype, 'valueOf', { value: Symbol.prototype.valueOf, enumerable: false }); var hashProperty = createPrivateName(); var hashPropertyDescriptor = {value: undefined}; var hashObjectProperties = { hash: {value: undefined}, self: {value: undefined} }; var hashCounter = 0; function getOwnHashObject(object) { var hashObject = object[hashProperty]; if (hashObject && hashObject.self === object) return hashObject; if ($isExtensible(object)) { hashObjectProperties.hash.value = hashCounter++; hashObjectProperties.self.value = object; hashPropertyDescriptor.value = $create(null, hashObjectProperties); $defineProperty(object, hashProperty, hashPropertyDescriptor); return hashPropertyDescriptor.value; } return undefined; } function freeze(object) { getOwnHashObject(object); return $freeze.apply(this, arguments); } function preventExtensions(object) { getOwnHashObject(object); return $preventExtensions.apply(this, arguments); } function seal(object) { getOwnHashObject(object); return $seal.apply(this, arguments); } Symbol.iterator = Symbol(); freeze(SymbolValue.prototype); function toProperty(name) { if (isSymbol(name)) return name[symbolInternalProperty]; return name; } function getOwnPropertyNames(object) { var rv = []; var names = $getOwnPropertyNames(object); for (var i = 0; i < names.length; i++) { var name = names[i]; if (!symbolValues[name] && !privateNames[name]) rv.push(name); } return rv; } function getOwnPropertyDescriptor(object, name) { return $getOwnPropertyDescriptor(object, toProperty(name)); } function getOwnPropertySymbols(object) { var rv = []; var names = $getOwnPropertyNames(object); for (var i = 0; i < names.length; i++) { var symbol = symbolValues[names[i]]; if (symbol) rv.push(symbol); } return rv; } function hasOwnProperty(name) { return $hasOwnProperty.call(this, toProperty(name)); } function getOption(name) { return global.traceur && global.traceur.options[name]; } function setProperty(object, name, value) { var sym, desc; if (isSymbol(name)) { sym = name; name = name[symbolInternalProperty]; } object[name] = value; if (sym && (desc = $getOwnPropertyDescriptor(object, name))) $defineProperty(object, name, {enumerable: false}); return value; } function defineProperty(object, name, descriptor) { if (isSymbol(name)) { if (descriptor.enumerable) { descriptor = $create(descriptor, {enumerable: {value: false}}); } name = name[symbolInternalProperty]; } $defineProperty(object, name, descriptor); return object; } function polyfillObject(Object) { $defineProperty(Object, 'defineProperty', {value: defineProperty}); $defineProperty(Object, 'getOwnPropertyNames', {value: getOwnPropertyNames}); $defineProperty(Object, 'getOwnPropertyDescriptor', {value: getOwnPropertyDescriptor}); $defineProperty(Object.prototype, 'hasOwnProperty', {value: hasOwnProperty}); $defineProperty(Object, 'freeze', {value: freeze}); $defineProperty(Object, 'preventExtensions', {value: preventExtensions}); $defineProperty(Object, 'seal', {value: seal}); Object.getOwnPropertySymbols = getOwnPropertySymbols; } function exportStar(object) { for (var i = 1; i < arguments.length; i++) { var names = $getOwnPropertyNames(arguments[i]); for (var j = 0; j < names.length; j++) { var name = names[j]; if (privateNames[name]) continue; (function(mod, name) { $defineProperty(object, name, { get: function() { return mod[name]; }, enumerable: true }); })(arguments[i], names[j]); } } return object; } function isObject(x) { return x != null && (typeof x === 'object' || typeof x === 'function'); } function toObject(x) { if (x == null) throw $TypeError(); return $Object(x); } function assertObject(x) { if (!isObject(x)) throw $TypeError(x + ' is not an Object'); return x; } function setupGlobals(global) { global.Symbol = Symbol; polyfillObject(global.Object); } setupGlobals(global); global.$traceurRuntime = { assertObject: assertObject, createPrivateName: createPrivateName, exportStar: exportStar, getOwnHashObject: getOwnHashObject, privateNames: privateNames, setProperty: setProperty, setupGlobals: setupGlobals, toObject: toObject, toProperty: toProperty, type: types, typeof: typeOf, defineProperties: $defineProperties, defineProperty: $defineProperty, getOwnPropertyDescriptor: $getOwnPropertyDescriptor, getOwnPropertyNames: $getOwnPropertyNames, keys: $keys }; })(typeof global !== 'undefined' ? global : this); (function() { 'use strict'; var toObject = $traceurRuntime.toObject; function spread() { var rv = [], k = 0; for (var i = 0; i < arguments.length; i++) { var valueToSpread = toObject(arguments[i]); for (var j = 0; j < valueToSpread.length; j++) { rv[k++] = valueToSpread[j]; } } return rv; } $traceurRuntime.spread = spread; })(); (function() { 'use strict'; var $Object = Object; var $TypeError = TypeError; var $create = $Object.create; var $defineProperties = $traceurRuntime.defineProperties; var $defineProperty = $traceurRuntime.defineProperty; var $getOwnPropertyDescriptor = $traceurRuntime.getOwnPropertyDescriptor; var $getOwnPropertyNames = $traceurRuntime.getOwnPropertyNames; var $getPrototypeOf = Object.getPrototypeOf; function superDescriptor(homeObject, name) { var proto = $getPrototypeOf(homeObject); do { var result = $getOwnPropertyDescriptor(proto, name); if (result) return result; proto = $getPrototypeOf(proto); } while (proto); return undefined; } function superCall(self, homeObject, name, args) { return superGet(self, homeObject, name).apply(self, args); } function superGet(self, homeObject, name) { var descriptor = superDescriptor(homeObject, name); if (descriptor) { if (!descriptor.get) return descriptor.value; return descriptor.get.call(self); } return undefined; } function superSet(self, homeObject, name, value) { var descriptor = superDescriptor(homeObject, name); if (descriptor && descriptor.set) { descriptor.set.call(self, value); return value; } throw $TypeError("super has no setter '" + name + "'."); } function getDescriptors(object) { var descriptors = {}, name, names = $getOwnPropertyNames(object); for (var i = 0; i < names.length; i++) { var name = names[i]; descriptors[name] = $getOwnPropertyDescriptor(object, name); } return descriptors; } function createClass(ctor, object, staticObject, superClass) { $defineProperty(object, 'constructor', { value: ctor, configurable: true, enumerable: false, writable: true }); if (arguments.length > 3) { if (typeof superClass === 'function') ctor.__proto__ = superClass; ctor.prototype = $create(getProtoParent(superClass), getDescriptors(object)); } else { ctor.prototype = object; } $defineProperty(ctor, 'prototype', { configurable: false, writable: false }); return $defineProperties(ctor, getDescriptors(staticObject)); } function getProtoParent(superClass) { if (typeof superClass === 'function') { var prototype = superClass.prototype; if ($Object(prototype) === prototype || prototype === null) return superClass.prototype; } if (superClass === null) return null; throw new $TypeError(); } function defaultSuperCall(self, homeObject, args) { if ($getPrototypeOf(homeObject) !== null) superCall(self, homeObject, 'constructor', args); } $traceurRuntime.createClass = createClass; $traceurRuntime.defaultSuperCall = defaultSuperCall; $traceurRuntime.superCall = superCall; $traceurRuntime.superGet = superGet; $traceurRuntime.superSet = superSet; })(); (function() { 'use strict'; var createPrivateName = $traceurRuntime.createPrivateName; var $defineProperties = $traceurRuntime.defineProperties; var $defineProperty = $traceurRuntime.defineProperty; var $create = Object.create; var $TypeError = TypeError; function nonEnum(value) { return { configurable: true, enumerable: false, value: value, writable: true }; } var ST_NEWBORN = 0; var ST_EXECUTING = 1; var ST_SUSPENDED = 2; var ST_CLOSED = 3; var END_STATE = -2; var RETHROW_STATE = -3; function getInternalError(state) { return new Error('Traceur compiler bug: invalid state in state machine: ' + state); } function GeneratorContext() { this.state = 0; this.GState = ST_NEWBORN; this.storedException = undefined; this.finallyFallThrough = undefined; this.sent_ = undefined; this.returnValue = undefined; this.tryStack_ = []; } GeneratorContext.prototype = { pushTry: function(catchState, finallyState) { if (finallyState !== null) { var finallyFallThrough = null; for (var i = this.tryStack_.length - 1; i >= 0; i--) { if (this.tryStack_[i].catch !== undefined) { finallyFallThrough = this.tryStack_[i].catch; break; } } if (finallyFallThrough === null) finallyFallThrough = RETHROW_STATE; this.tryStack_.push({ finally: finallyState, finallyFallThrough: finallyFallThrough }); } if (catchState !== null) { this.tryStack_.push({catch: catchState}); } }, popTry: function() { this.tryStack_.pop(); }, get sent() { this.maybeThrow(); return this.sent_; }, set sent(v) { this.sent_ = v; }, get sentIgnoreThrow() { return this.sent_; }, maybeThrow: function() { if (this.action === 'throw') { this.action = 'next'; throw this.sent_; } }, end: function() { switch (this.state) { case END_STATE: return this; case RETHROW_STATE: throw this.storedException; default: throw getInternalError(this.state); } }, handleException: function(ex) { this.GState = ST_CLOSED; this.state = END_STATE; throw ex; } }; function nextOrThrow(ctx, moveNext, action, x) { switch (ctx.GState) { case ST_EXECUTING: throw new Error(("\"" + action + "\" on executing generator")); case ST_CLOSED: if (action == 'next') { return { value: undefined, done: true }; } throw new Error(("\"" + action + "\" on closed generator")); case ST_NEWBORN: if (action === 'throw') { ctx.GState = ST_CLOSED; throw x; } if (x !== undefined) throw $TypeError('Sent value to newborn generator'); case ST_SUSPENDED: ctx.GState = ST_EXECUTING; ctx.action = action; ctx.sent = x; var value = moveNext(ctx); var done = value === ctx; if (done) value = ctx.returnValue; ctx.GState = done ? ST_CLOSED : ST_SUSPENDED; return { value: value, done: done }; } } var ctxName = createPrivateName(); var moveNextName = createPrivateName(); function GeneratorFunction() {} function GeneratorFunctionPrototype() {} GeneratorFunction.prototype = GeneratorFunctionPrototype; $defineProperty(GeneratorFunctionPrototype, 'constructor', nonEnum(GeneratorFunction)); GeneratorFunctionPrototype.prototype = { constructor: GeneratorFunctionPrototype, next: function(v) { return nextOrThrow(this[ctxName], this[moveNextName], 'next', v); }, throw: function(v) { return nextOrThrow(this[ctxName], this[moveNextName], 'throw', v); } }; $defineProperties(GeneratorFunctionPrototype.prototype, { constructor: {enumerable: false}, next: {enumerable: false}, throw: {enumerable: false} }); Object.defineProperty(GeneratorFunctionPrototype.prototype, Symbol.iterator, nonEnum(function() { return this; })); function createGeneratorInstance(innerFunction, functionObject, self) { var moveNext = getMoveNext(innerFunction, self); var ctx = new GeneratorContext(); var object = $create(functionObject.prototype); object[ctxName] = ctx; object[moveNextName] = moveNext; return object; } function initGeneratorFunction(functionObject) { functionObject.prototype = $create(GeneratorFunctionPrototype.prototype); functionObject.__proto__ = GeneratorFunctionPrototype; return functionObject; } function AsyncFunctionContext() { GeneratorContext.call(this); this.err = undefined; var ctx = this; ctx.result = new Promise(function(resolve, reject) { ctx.resolve = resolve; ctx.reject = reject; }); } AsyncFunctionContext.prototype = $create(GeneratorContext.prototype); AsyncFunctionContext.prototype.end = function() { switch (this.state) { case END_STATE: this.resolve(this.returnValue); break; case RETHROW_STATE: this.reject(this.storedException); break; default: this.reject(getInternalError(this.state)); } }; AsyncFunctionContext.prototype.handleException = function() { this.state = RETHROW_STATE; }; function asyncWrap(innerFunction, self) { var moveNext = getMoveNext(innerFunction, self); var ctx = new AsyncFunctionContext(); ctx.createCallback = function(newState) { return function(value) { ctx.state = newState; ctx.value = value; moveNext(ctx); }; }; ctx.errback = function(err) { handleCatch(ctx, err); moveNext(ctx); }; moveNext(ctx); return ctx.result; } function getMoveNext(innerFunction, self) { return function(ctx) { while (true) { try { return innerFunction.call(self, ctx); } catch (ex) { handleCatch(ctx, ex); } } }; } function handleCatch(ctx, ex) { ctx.storedException = ex; var last = ctx.tryStack_[ctx.tryStack_.length - 1]; if (!last) { ctx.handleException(ex); return; } ctx.state = last.catch !== undefined ? last.catch : last.finally; if (last.finallyFallThrough !== undefined) ctx.finallyFallThrough = last.finallyFallThrough; } $traceurRuntime.asyncWrap = asyncWrap; $traceurRuntime.initGeneratorFunction = initGeneratorFunction; $traceurRuntime.createGeneratorInstance = createGeneratorInstance; })(); (function() { function buildFromEncodedParts(opt_scheme, opt_userInfo, opt_domain, opt_port, opt_path, opt_queryData, opt_fragment) { var out = []; if (opt_scheme) { out.push(opt_scheme, ':'); } if (opt_domain) { out.push('//'); if (opt_userInfo) { out.push(opt_userInfo, '@'); } out.push(opt_domain); if (opt_port) { out.push(':', opt_port); } } if (opt_path) { out.push(opt_path); } if (opt_queryData) { out.push('?', opt_queryData); } if (opt_fragment) { out.push('#', opt_fragment); } return out.join(''); } ; var splitRe = new RegExp('^' + '(?:' + '([^:/?#.]+)' + ':)?' + '(?://' + '(?:([^/?#]*)@)?' + '([\\w\\d\\-\\u0100-\\uffff.%]*)' + '(?::([0-9]+))?' + ')?' + '([^?#]+)?' + '(?:\\?([^#]*))?' + '(?:#(.*))?' + '$'); var ComponentIndex = { SCHEME: 1, USER_INFO: 2, DOMAIN: 3, PORT: 4, PATH: 5, QUERY_DATA: 6, FRAGMENT: 7 }; function split(uri) { return (uri.match(splitRe)); } function removeDotSegments(path) { if (path === '/') return '/'; var leadingSlash = path[0] === '/' ? '/' : ''; var trailingSlash = path.slice(-1) === '/' ? '/' : ''; var segments = path.split('/'); var out = []; var up = 0; for (var pos = 0; pos < segments.length; pos++) { var segment = segments[pos]; switch (segment) { case '': case '.': break; case '..': if (out.length) out.pop(); else up++; break; default: out.push(segment); } } if (!leadingSlash) { while (up-- > 0) { out.unshift('..'); } if (out.length === 0) out.push('.'); } return leadingSlash + out.join('/') + trailingSlash; } function joinAndCanonicalizePath(parts) { var path = parts[ComponentIndex.PATH] || ''; path = removeDotSegments(path); parts[ComponentIndex.PATH] = path; return buildFromEncodedParts(parts[ComponentIndex.SCHEME], parts[ComponentIndex.USER_INFO], parts[ComponentIndex.DOMAIN], parts[ComponentIndex.PORT], parts[ComponentIndex.PATH], parts[ComponentIndex.QUERY_DATA], parts[ComponentIndex.FRAGMENT]); } function canonicalizeUrl(url) { var parts = split(url); return joinAndCanonicalizePath(parts); } function resolveUrl(base, url) { var parts = split(url); var baseParts = split(base); if (parts[ComponentIndex.SCHEME]) { return joinAndCanonicalizePath(parts); } else { parts[ComponentIndex.SCHEME] = baseParts[ComponentIndex.SCHEME]; } for (var i = ComponentIndex.SCHEME; i <= ComponentIndex.PORT; i++) { if (!parts[i]) { parts[i] = baseParts[i]; } } if (parts[ComponentIndex.PATH][0] == '/') { return joinAndCanonicalizePath(parts); } var path = baseParts[ComponentIndex.PATH]; var index = path.lastIndexOf('/'); path = path.slice(0, index + 1) + parts[ComponentIndex.PATH]; parts[ComponentIndex.PATH] = path; return joinAndCanonicalizePath(parts); } function isAbsolute(name) { if (!name) return false; if (name[0] === '/') return true; var parts = split(name); if (parts[ComponentIndex.SCHEME]) return true; return false; } $traceurRuntime.canonicalizeUrl = canonicalizeUrl; $traceurRuntime.isAbsolute = isAbsolute; $traceurRuntime.removeDotSegments = removeDotSegments; $traceurRuntime.resolveUrl = resolveUrl; })(); (function(global) { 'use strict'; var $__2 = $traceurRuntime.assertObject($traceurRuntime), canonicalizeUrl = $__2.canonicalizeUrl, resolveUrl = $__2.resolveUrl, isAbsolute = $__2.isAbsolute; var moduleInstantiators = Object.create(null); var baseURL; if (global.location && global.location.href) baseURL = resolveUrl(global.location.href, './'); else baseURL = ''; var UncoatedModuleEntry = function UncoatedModuleEntry(url, uncoatedModule) { this.url = url; this.value_ = uncoatedModule; }; ($traceurRuntime.createClass)(UncoatedModuleEntry, {}, {}); var UncoatedModuleInstantiator = function UncoatedModuleInstantiator(url, func) { $traceurRuntime.superCall(this, $UncoatedModuleInstantiator.prototype, "constructor", [url, null]); this.func = func; }; var $UncoatedModuleInstantiator = UncoatedModuleInstantiator; ($traceurRuntime.createClass)(UncoatedModuleInstantiator, {getUncoatedModule: function() { if (this.value_) return this.value_; return this.value_ = this.func.call(global); }}, {}, UncoatedModuleEntry); function getUncoatedModuleInstantiator(name) { if (!name) return; var url = ModuleStore.normalize(name); return moduleInstantiators[url]; } ; var moduleInstances = Object.create(null); var liveModuleSentinel = {}; function Module(uncoatedModule) { var isLive = arguments[1]; var coatedModule = Object.create(null); Object.getOwnPropertyNames(uncoatedModule).forEach((function(name) { var getter, value; if (isLive === liveModuleSentinel) { var descr = Object.getOwnPropertyDescriptor(uncoatedModule, name); if (descr.get) getter = descr.get; } if (!getter) { value = uncoatedModule[name]; getter = function() { return value; }; } Object.defineProperty(coatedModule, name, { get: getter, enumerable: true }); })); Object.preventExtensions(coatedModule); return coatedModule; } var ModuleStore = { normalize: function(name, refererName, refererAddress) { if (typeof name !== "string") throw new TypeError("module name must be a string, not " + typeof name); if (isAbsolute(name)) return canonicalizeUrl(name); if (/[^\.]\/\.\.\//.test(name)) { throw new Error('module name embeds /../: ' + name); } if (name[0] === '.' && refererName) return resolveUrl(refererName, name); return canonicalizeUrl(name); }, get: function(normalizedName) { var m = getUncoatedModuleInstantiator(normalizedName); if (!m) return undefined; var moduleInstance = moduleInstances[m.url]; if (moduleInstance) return moduleInstance; moduleInstance = Module(m.getUncoatedModule(), liveModuleSentinel); return moduleInstances[m.url] = moduleInstance; }, set: function(normalizedName, module) { normalizedName = String(normalizedName); moduleInstantiators[normalizedName] = new UncoatedModuleInstantiator(normalizedName, (function() { return module; })); moduleInstances[normalizedName] = module; }, get baseURL() { return baseURL; }, set baseURL(v) { baseURL = String(v); }, registerModule: function(name, func) { var normalizedName = ModuleStore.normalize(name); if (moduleInstantiators[normalizedName]) throw new Error('duplicate module named ' + normalizedName); moduleInstantiators[normalizedName] = new UncoatedModuleInstantiator(normalizedName, func); }, bundleStore: Object.create(null), register: function(name, deps, func) { if (!deps || !deps.length && !func.length) { this.registerModule(name, func); } else { this.bundleStore[name] = { deps: deps, execute: function() { var $__0 = arguments; var depMap = {}; deps.forEach((function(dep, index) { return depMap[dep] = $__0[index]; })); var registryEntry = func.call(this, depMap); registryEntry.execute.call(this); return registryEntry.exports; } }; } }, getAnonymousModule: function(func) { return new Module(func.call(global), liveModuleSentinel); }, getForTesting: function(name) { var $__0 = this; if (!this.testingPrefix_) { Object.keys(moduleInstances).some((function(key) { var m = /(traceur@[^\/]*\/)/.exec(key); if (m) { $__0.testingPrefix_ = m[1]; return true; } })); } return this.get(this.testingPrefix_ + name); } }; ModuleStore.set('@traceur/src/runtime/ModuleStore', new Module({ModuleStore: ModuleStore})); var setupGlobals = $traceurRuntime.setupGlobals; $traceurRuntime.setupGlobals = function(global) { setupGlobals(global); }; $traceurRuntime.ModuleStore = ModuleStore; global.System = { register: ModuleStore.register.bind(ModuleStore), get: ModuleStore.get, set: ModuleStore.set, normalize: ModuleStore.normalize }; $traceurRuntime.getModuleImpl = function(name) { var instantiator = getUncoatedModuleInstantiator(name); return instantiator && instantiator.getUncoatedModule(); }; })(typeof global !== 'undefined' ? global : this); System.register("traceur-runtime@0.0.42/src/runtime/polyfills/utils", [], function() { "use strict"; var __moduleName = "traceur-runtime@0.0.42/src/runtime/polyfills/utils"; var toObject = $traceurRuntime.toObject; function toUint32(x) { return x | 0; } function isObject(x) { return x && (typeof x === 'object' || typeof x === 'function'); } function isCallable(x) { return typeof x === 'function'; } function toInteger(x) { x = +x; if (isNaN(x)) return 0; if (!isFinite(x) || x === 0) return x; return x > 0 ? Math.floor(x) : Math.ceil(x); } var MAX_SAFE_LENGTH = Math.pow(2, 53) - 1; function toLength(x) { var len = toInteger(x); return len < 0 ? 0 : Math.min(len, MAX_SAFE_LENGTH); } return { get toObject() { return toObject; }, get toUint32() { return toUint32; }, get isObject() { return isObject; }, get isCallable() { return isCallable; }, get toInteger() { return toInteger; }, get toLength() { return toLength; } }; }); System.register("traceur-runtime@0.0.42/src/runtime/polyfills/Array", [], function() { "use strict"; var __moduleName = "traceur-runtime@0.0.42/src/runtime/polyfills/Array"; var $__3 = $traceurRuntime.assertObject(System.get("traceur-runtime@0.0.42/src/runtime/polyfills/utils")), toInteger = $__3.toInteger, toLength = $__3.toLength, toObject = $__3.toObject, isCallable = $__3.isCallable; function fill(value) { var start = arguments[1] !== (void 0) ? arguments[1] : 0; var end = arguments[2]; var object = toObject(this); var len = toLength(object.length); var fillStart = toInteger(start); var fillEnd = end !== undefined ? toInteger(end) : len; fillStart = fillStart < 0 ? Math.max(len + fillStart, 0) : Math.min(fillStart, len); fillEnd = fillEnd < 0 ? Math.max(len + fillEnd, 0) : Math.min(fillEnd, len); while (fillStart < fillEnd) { object[fillStart] = value; fillStart++; } return object; } function find(predicate) { var thisArg = arguments[1]; return findHelper(this, predicate, thisArg); } function findIndex(predicate) { var thisArg = arguments[1]; return findHelper(this, predicate, thisArg, true); } function findHelper(self, predicate) { var thisArg = arguments[2]; var returnIndex = arguments[3] !== (void 0) ? arguments[3] : false; var object = toObject(self); var len = toLength(object.length); if (!isCallable(predicate)) { throw TypeError(); } for (var i = 0; i < len; i++) { if (i in object) { var value = object[i]; if (predicate.call(thisArg, value, i, object)) { return returnIndex ? i : value; } } } return returnIndex ? -1 : undefined; } return { get fill() { return fill; }, get find() { return find; }, get findIndex() { return findIndex; } }; }); System.register("traceur-runtime@0.0.42/src/runtime/polyfills/ArrayIterator", [], function() { "use strict"; var $__5; var __moduleName = "traceur-runtime@0.0.42/src/runtime/polyfills/ArrayIterator"; var $__6 = $traceurRuntime.assertObject(System.get("traceur-runtime@0.0.42/src/runtime/polyfills/utils")), toObject = $__6.toObject, toUint32 = $__6.toUint32; var ARRAY_ITERATOR_KIND_KEYS = 1; var ARRAY_ITERATOR_KIND_VALUES = 2; var ARRAY_ITERATOR_KIND_ENTRIES = 3; var ArrayIterator = function ArrayIterator() {}; ($traceurRuntime.createClass)(ArrayIterator, ($__5 = {}, Object.defineProperty($__5, "next", { value: function() { var iterator = toObject(this); var array = iterator.iteratorObject_; if (!array) { throw new TypeError('Object is not an ArrayIterator'); } var index = iterator.arrayIteratorNextIndex_; var itemKind = iterator.arrayIterationKind_; var length = toUint32(array.length); if (index >= length) { iterator.arrayIteratorNextIndex_ = Infinity; return createIteratorResultObject(undefined, true); } iterator.arrayIteratorNextIndex_ = index + 1; if (itemKind == ARRAY_ITERATOR_KIND_VALUES) return createIteratorResultObject(array[index], false); if (itemKind == ARRAY_ITERATOR_KIND_ENTRIES) return createIteratorResultObject([index, array[index]], false); return createIteratorResultObject(index, false); }, configurable: true, enumerable: true, writable: true }), Object.defineProperty($__5, Symbol.iterator, { value: function() { return this; }, configurable: true, enumerable: true, writable: true }), $__5), {}); function createArrayIterator(array, kind) { var object = toObject(array); var iterator = new ArrayIterator; iterator.iteratorObject_ = object; iterator.arrayIteratorNextIndex_ = 0; iterator.arrayIterationKind_ = kind; return iterator; } function createIteratorResultObject(value, done) { return { value: value, done: done }; } function entries() { return createArrayIterator(this, ARRAY_ITERATOR_KIND_ENTRIES); } function keys() { return createArrayIterator(this, ARRAY_ITERATOR_KIND_KEYS); } function values() { return createArrayIterator(this, ARRAY_ITERATOR_KIND_VALUES); } return { get entries() { return entries; }, get keys() { return keys; }, get values() { return values; } }; }); System.register("traceur-runtime@0.0.42/src/runtime/polyfills/Map", [], function() { "use strict"; var __moduleName = "traceur-runtime@0.0.42/src/runtime/polyfills/Map"; var isObject = $traceurRuntime.assertObject(System.get("traceur-runtime@0.0.42/src/runtime/polyfills/utils")).isObject; var getOwnHashObject = $traceurRuntime.getOwnHashObject; var $hasOwnProperty = Object.prototype.hasOwnProperty; var deletedSentinel = {}; function lookupIndex(map, key) { if (isObject(key)) { var hashObject = getOwnHashObject(key); return hashObject && map.objectIndex_[hashObject.hash]; } if (typeof key === 'string') return map.stringIndex_[key]; return map.primitiveIndex_[key]; } function initMap(map) { map.entries_ = []; map.objectIndex_ = Object.create(null); map.stringIndex_ = Object.create(null); map.primitiveIndex_ = Object.create(null); map.deletedCount_ = 0; } var Map = function Map() { var iterable = arguments[0]; if (!isObject(this)) throw new TypeError("Constructor Map requires 'new'"); if ($hasOwnProperty.call(this, 'entries_')) { throw new TypeError("Map can not be reentrantly initialised"); } initMap(this); if (iterable !== null && iterable !== undefined) { var iter = iterable[Symbol.iterator]; if (iter !== undefined) { for (var $__8 = iterable[Symbol.iterator](), $__9; !($__9 = $__8.next()).done; ) { var $__10 = $traceurRuntime.assertObject($__9.value), key = $__10[0], value = $__10[1]; { this.set(key, value); } } } } }; ($traceurRuntime.createClass)(Map, { get size() { return this.entries_.length / 2 - this.deletedCount_; }, get: function(key) { var index = lookupIndex(this, key); if (index !== undefined) return this.entries_[index + 1]; }, set: function(key, value) { var objectMode = isObject(key); var stringMode = typeof key === 'string'; var index = lookupIndex(this, key); if (index !== undefined) { this.entries_[index + 1] = value; } else { index = this.entries_.length; this.entries_[index] = key; this.entries_[index + 1] = value; if (objectMode) { var hashObject = getOwnHashObject(key); var hash = hashObject.hash; this.objectIndex_[hash] = index; } else if (stringMode) { this.stringIndex_[key] = index; } else { this.primitiveIndex_[key] = index; } } return this; }, has: function(key) { return lookupIndex(this, key) !== undefined; }, delete: function(key) { var objectMode = isObject(key); var stringMode = typeof key === 'string'; var index; var hash; if (objectMode) { var hashObject = getOwnHashObject(key); if (hashObject) { index = this.objectIndex_[hash = hashObject.hash]; delete this.objectIndex_[hash]; } } else if (stringMode) { index = this.stringIndex_[key]; delete this.stringIndex_[key]; } else { index = this.primitiveIndex_[key]; delete this.primitiveIndex_[key]; } if (index !== undefined) { this.entries_[index] = deletedSentinel; this.entries_[index + 1] = undefined; this.deletedCount_++; } }, clear: function() { initMap(this); }, forEach: function(callbackFn) { var thisArg = arguments[1]; for (var i = 0, len = this.entries_.length; i < len; i += 2) { var key = this.entries_[i]; var value = this.entries_[i + 1]; if (key === deletedSentinel) continue; callbackFn.call(thisArg, value, key, this); } } }, {}); return {get Map() { return Map; }}; }); System.register("traceur-runtime@0.0.42/src/runtime/polyfills/Object", [], function() { "use strict"; var __moduleName = "traceur-runtime@0.0.42/src/runtime/polyfills/Object"; var $__11 = $traceurRuntime.assertObject(System.get("traceur-runtime@0.0.42/src/runtime/polyfills/utils")), toInteger = $__11.toInteger, toLength = $__11.toLength, toObject = $__11.toObject, isCallable = $__11.isCallable; var $__11 = $traceurRuntime.assertObject($traceurRuntime), defineProperty = $__11.defineProperty, getOwnPropertyDescriptor = $__11.getOwnPropertyDescriptor, getOwnPropertyNames = $__11.getOwnPropertyNames, keys = $__11.keys, privateNames = $__11.privateNames; function is(left, right) { if (left === right) return left !== 0 || 1 / left === 1 / right; return left !== left && right !== right; } function assign(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; var props = keys(source); var p, length = props.length; for (p = 0; p < length; p++) { var name = props[p]; if (privateNames[name]) continue; target[name] = source[name]; } } return target; } function mixin(target, source) { var props = getOwnPropertyNames(source); var p, descriptor, length = props.length; for (p = 0; p < length; p++) { var name = props[p]; if (privateNames[name]) continue; descriptor = getOwnPropertyDescriptor(source, props[p]); defineProperty(target, props[p], descriptor); } return target; } return { get is() { return is; }, get assign() { return assign; }, get mixin() { return mixin; } }; }); System.register("traceur-runtime@0.0.42/node_modules/rsvp/lib/rsvp/asap", [], function() { "use strict"; var __moduleName = "traceur-runtime@0.0.42/node_modules/rsvp/lib/rsvp/asap"; var $__default = function asap(callback, arg) { var length = queue.push([callback, arg]); if (length === 1) { scheduleFlush(); } }; var browserGlobal = (typeof window !== 'undefined') ? window : {}; var BrowserMutationObserver = browserGlobal.MutationObserver || browserGlobal.WebKitMutationObserver; function useNextTick() { return function() { process.nextTick(flush); }; } function useMutationObserver() { var iterations = 0; var observer = new BrowserMutationObserver(flush); var node = document.createTextNode(''); observer.observe(node, {characterData: true}); return function() { node.data = (iterations = ++iterations % 2); }; } function useSetTimeout() { return function() { setTimeout(flush, 1); }; } var queue = []; function flush() { for (var i = 0; i < queue.length; i++) { var tuple = queue[i]; var callback = tuple[0], arg = tuple[1]; callback(arg); } queue = []; } var scheduleFlush; if (typeof process !== 'undefined' && {}.toString.call(process) === '[object process]') { scheduleFlush = useNextTick(); } else if (BrowserMutationObserver) { scheduleFlush = useMutationObserver(); } else { scheduleFlush = useSetTimeout(); } return {get default() { return $__default; }}; }); System.register("traceur-runtime@0.0.42/src/runtime/polyfills/Promise", [], function() { "use strict"; var __moduleName = "traceur-runtime@0.0.42/src/runtime/polyfills/Promise"; var async = $traceurRuntime.assertObject(System.get("traceur-runtime@0.0.42/node_modules/rsvp/lib/rsvp/asap")).default; var promiseRaw = {}; function isPromise(x) { return x && typeof x === 'object' && x.status_ !== undefined; } function idResolveHandler(x) { return x; } function idRejectHandler(x) { throw x; } function chain(promise) { var onResolve = arguments[1] !== (void 0) ? arguments[1] : idResolveHandler; var onReject = arguments[2] !== (void 0) ? arguments[2] : idRejectHandler; var deferred = getDeferred(promise.constructor); switch (promise.status_) { case undefined: throw TypeError; case 0: promise.onResolve_.push(onResolve, deferred); promise.onReject_.push(onReject, deferred); break; case +1: promiseEnqueue(promise.value_, [onResolve, deferred]); break; case -1: promiseEnqueue(promise.value_, [onReject, deferred]); break; } return deferred.promise; } function getDeferred(C) { if (this === $Promise) { var promise = promiseInit(new $Promise(promiseRaw)); return { promise: promise, resolve: (function(x) { promiseResolve(promise, x); }), reject: (function(r) { promiseReject(promise, r); }) }; } else { var result = {}; result.promise = new C((function(resolve, reject) { result.resolve = resolve; result.reject = reject; })); return result; } } function promiseSet(promise, status, value, onResolve, onReject) { promise.status_ = status; promise.value_ = value; promise.onResolve_ = onResolve; promise.onReject_ = onReject; return promise; } function promiseInit(promise) { return promiseSet(promise, 0, undefined, [], []); } var Promise = function Promise(resolver) { if (resolver === promiseRaw) return; if (typeof resolver !== 'function') throw new TypeError; var promise = promiseInit(this); try { resolver((function(x) { promiseResolve(promise, x); }), (function(r) { promiseReject(promise, r); })); } catch (e) { promiseReject(promise, e); } }; ($traceurRuntime.createClass)(Promise, { catch: function(onReject) { return this.then(undefined, onReject); }, then: function(onResolve, onReject) { if (typeof onResolve !== 'function') onResolve = idResolveHandler; if (typeof onReject !== 'function') onReject = idRejectHandler; var that = this; var constructor = this.constructor; return chain(this, function(x) { x = promiseCoerce(constructor, x); return x === that ? onReject(new TypeError) : isPromise(x) ? x.then(onResolve, onReject) : onResolve(x); }, onReject); } }, { resolve: function(x) { if (this === $Promise) { return promiseSet(new $Promise(promiseRaw), +1, x); } else { return new this(function(resolve, reject) { resolve(x); }); } }, reject: function(r) { if (this === $Promise) { return promiseSet(new $Promise(promiseRaw), -1, r); } else { return new this((function(resolve, reject) { reject(r); })); } }, cast: function(x) { if (x instanceof this) return x; if (isPromise(x)) { var result = getDeferred(this); chain(x, result.resolve, result.reject); return result.promise; } return this.resolve(x); }, all: function(values) { var deferred = getDeferred(this); var resolutions = []; try { var count = values.length; if (count === 0) { deferred.resolve(resolutions); } else { for (var i = 0; i < values.length; i++) { this.resolve(values[i]).then(function(i, x) { resolutions[i] = x; if (--count === 0) deferred.resolve(resolutions); }.bind(undefined, i), (function(r) { deferred.reject(r); })); } } } catch (e) { deferred.reject(e); } return deferred.promise; }, race: function(values) { var deferred = getDeferred(this); try { for (var i = 0; i < values.length; i++) { this.resolve(values[i]).then((function(x) { deferred.resolve(x); }), (function(r) { deferred.reject(r); })); } } catch (e) { deferred.reject(e); } return deferred.promise; } }); var $Promise = Promise; var $PromiseReject = $Promise.reject; function promiseResolve(promise, x) { promiseDone(promise, +1, x, promise.onResolve_); } function promiseReject(promise, r) { promiseDone(promise, -1, r, promise.onReject_); } function promiseDone(promise, status, value, reactions) { if (promise.status_ !== 0) return; promiseEnqueue(value, reactions); promiseSet(promise, status, value); } function promiseEnqueue(value, tasks) { async((function() { for (var i = 0; i < tasks.length; i += 2) { promiseHandle(value, tasks[i], tasks[i + 1]); } })); } function promiseHandle(value, handler, deferred) { try { var result = handler(value); if (result === deferred.promise) throw new TypeError; else if (isPromise(result)) chain(result, deferred.resolve, deferred.reject); else deferred.resolve(result); } catch (e) { try { deferred.reject(e); } catch (e) {} } } var thenableSymbol = '@@thenable'; function isObject(x) { return x && (typeof x === 'object' || typeof x === 'function'); } function promiseCoerce(constructor, x) { if (!isPromise(x) && isObject(x)) { var then; try { then = x.then; } catch (r) { var promise = $PromiseReject.call(constructor, r); x[thenableSymbol] = promise; return promise; } if (typeof then === 'function') { var p = x[thenableSymbol]; if (p) { return p; } else { var deferred = getDeferred(constructor); x[thenableSymbol] = deferred.promise; try { then.call(x, deferred.resolve, deferred.reject); } catch (r) { deferred.reject(r); } return deferred.promise; } } } return x; } return {get Promise() { return Promise; }}; }); System.register("traceur-runtime@0.0.42/src/runtime/polyfills/String", [], function() { "use strict"; var __moduleName = "traceur-runtime@0.0.42/src/runtime/polyfills/String"; var $toString = Object.prototype.toString; var $indexOf = String.prototype.indexOf; var $lastIndexOf = String.prototype.lastIndexOf; function startsWith(search) { var string = String(this); if (this == null || $toString.call(search) == '[object RegExp]') { throw TypeError(); } var stringLength = string.length; var searchString = String(search); var searchLength = searchString.length; var position = arguments.length > 1 ? arguments[1] : undefined; var pos = position ? Number(position) : 0; if (isNaN(pos)) { pos = 0; } var start = Math.min(Math.max(pos, 0), stringLength); return $indexOf.call(string, searchString, pos) == start; } function endsWith(search) { var string = String(this); if (this == null || $toString.call(search) == '[object RegExp]') { throw TypeError(); } var stringLength = string.length; var searchString = String(search); var searchLength = searchString.length; var pos = stringLength; if (arguments.length > 1) { var position = arguments[1]; if (position !== undefined) { pos = position ? Number(position) : 0; if (isNaN(pos)) { pos = 0; } } } var end = Math.min(Math.max(pos, 0), stringLength); var start = end - searchLength; if (start < 0) { return false; } return $lastIndexOf.call(string, searchString, start) == start; } function contains(search) { if (this == null) { throw TypeError(); } var string = String(this); var stringLength = string.length; var searchString = String(search); var searchLength = searchString.length; var position = arguments.length > 1 ? arguments[1] : undefined; var pos = position ? Number(position) : 0; if (isNaN(pos)) { pos = 0; } var start = Math.min(Math.max(pos, 0), stringLength); return $indexOf.call(string, searchString, pos) != -1; } function repeat(count) { if (this == null) { throw TypeError(); } var string = String(this); var n = count ? Number(count) : 0; if (isNaN(n)) { n = 0; } if (n < 0 || n == Infinity) { throw RangeError(); } if (n == 0) { return ''; } var result = ''; while (n--) { result += string; } return result; } function codePointAt(position) { if (this == null) { throw TypeError(); } var string = String(this); var size = string.length; var index = position ? Number(position) : 0; if (isNaN(index)) { index = 0; } if (index < 0 || index >= size) { return undefined; } var first = string.charCodeAt(index); var second; if (first >= 0xD800 && first <= 0xDBFF && size > index + 1) { second = string.charCodeAt(index + 1); if (second >= 0xDC00 && second <= 0xDFFF) { return (first - 0xD800) * 0x400 + second - 0xDC00 + 0x10000; } } return first; } function raw(callsite) { var raw = callsite.raw; var len = raw.length >>> 0; if (len === 0) return ''; var s = ''; var i = 0; while (true) { s += raw[i]; if (i + 1 === len) return s; s += arguments[++i]; } } function fromCodePoint() { var codeUnits = []; var floor = Math.floor; var highSurrogate; var lowSurrogate; var index = -1; var length = arguments.length; if (!length) { return ''; } while (++index < length) { var codePoint = Number(arguments[index]); if (!isFinite(codePoint) || codePoint < 0 || codePoint > 0x10FFFF || floor(codePoint) != codePoint) { throw RangeError('Invalid code point: ' + codePoint); } if (codePoint <= 0xFFFF) { codeUnits.push(codePoint); } else { codePoint -= 0x10000; highSurrogate = (codePoint >> 10) + 0xD800; lowSurrogate = (codePoint % 0x400) + 0xDC00; codeUnits.push(highSurrogate, lowSurrogate); } } return String.fromCharCode.apply(null, codeUnits); } return { get startsWith() { return startsWith; }, get endsWith() { return endsWith; }, get contains() { return contains; }, get repeat() { return repeat; }, get codePointAt() { return codePointAt; }, get raw() { return raw; }, get fromCodePoint() { return fromCodePoint; } }; }); System.register("traceur-runtime@0.0.42/src/runtime/polyfills/polyfills", [], function() { "use strict"; var __moduleName = "traceur-runtime@0.0.42/src/runtime/polyfills/polyfills"; var Map = $traceurRuntime.assertObject(System.get("traceur-runtime@0.0.42/src/runtime/polyfills/Map")).Map; var Promise = $traceurRuntime.assertObject(System.get("traceur-runtime@0.0.42/src/runtime/polyfills/Promise")).Promise; var $__14 = $traceurRuntime.assertObject(System.get("traceur-runtime@0.0.42/src/runtime/polyfills/String")), codePointAt = $__14.codePointAt, contains = $__14.contains, endsWith = $__14.endsWith, fromCodePoint = $__14.fromCodePoint, repeat = $__14.repeat, raw = $__14.raw, startsWith = $__14.startsWith; var $__14 = $traceurRuntime.assertObject(System.get("traceur-runtime@0.0.42/src/runtime/polyfills/Array")), fill = $__14.fill, find = $__14.find, findIndex = $__14.findIndex; var $__14 = $traceurRuntime.assertObject(System.get("traceur-runtime@0.0.42/src/runtime/polyfills/ArrayIterator")), entries = $__14.entries, keys = $__14.keys, values = $__14.values; var $__14 = $traceurRuntime.assertObject(System.get("traceur-runtime@0.0.42/src/runtime/polyfills/Object")), assign = $__14.assign, is = $__14.is, mixin = $__14.mixin; function maybeDefineMethod(object, name, value) { if (!(name in object)) { Object.defineProperty(object, name, { value: value, configurable: true, enumerable: false, writable: true }); } } function maybeAddFunctions(object, functions) { for (var i = 0; i < functions.length; i += 2) { var name = functions[i]; var value = functions[i + 1]; maybeDefineMethod(object, name, value); } } function polyfillPromise(global) { if (!global.Promise) global.Promise = Promise; } function polyfillCollections(global) { if (!global.Map) global.Map = Map; } function polyfillString(String) { maybeAddFunctions(String.prototype, ['codePointAt', codePointAt, 'contains', contains, 'endsWith', endsWith, 'startsWith', startsWith, 'repeat', repeat]); maybeAddFunctions(String, ['fromCodePoint', fromCodePoint, 'raw', raw]); } function polyfillArray(Array, Symbol) { maybeAddFunctions(Array.prototype, ['entries', entries, 'keys', keys, 'values', values, 'fill', fill, 'find', find, 'findIndex', findIndex]); if (Symbol && Symbol.iterator) { Object.defineProperty(Array.prototype, Symbol.iterator, { value: values, configurable: true, enumerable: false, writable: true }); } } function polyfillObject(Object) { maybeAddFunctions(Object, ['assign', assign, 'is', is, 'mixin', mixin]); } function polyfill(global) { polyfillPromise(global); polyfillCollections(global); polyfillString(global.String); polyfillArray(global.Array, global.Symbol); polyfillObject(global.Object); } polyfill(this); var setupGlobals = $traceurRuntime.setupGlobals; $traceurRuntime.setupGlobals = function(global) { setupGlobals(global); polyfill(global); }; return {}; }); System.register("traceur-runtime@0.0.42/src/runtime/polyfill-import", [], function() { "use strict"; var __moduleName = "traceur-runtime@0.0.42/src/runtime/polyfill-import"; var $__16 = $traceurRuntime.assertObject(System.get("traceur-runtime@0.0.42/src/runtime/polyfills/polyfills")); return {}; }); System.get("traceur-runtime@0.0.42/src/runtime/polyfill-import" + ''); }).call(this,require("FWaASH"),typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {}) },{"FWaASH":2}],4:[function(require,module,exports){ (function (global){ //! moment.js //! version : 2.8.1 //! authors : Tim Wood, Iskren Chernev, Moment.js contributors //! license : MIT //! momentjs.com (function (undefined) { /************************************ Constants ************************************/ var moment, VERSION = '2.8.1', // the global-scope this is NOT the global object in Node.js globalScope = typeof global !== 'undefined' ? global : this, oldGlobalMoment, round = Math.round, i, YEAR = 0, MONTH = 1, DATE = 2, HOUR = 3, MINUTE = 4, SECOND = 5, MILLISECOND = 6, // internal storage for locale config files locales = {}, // extra moment internal properties (plugins register props here) momentProperties = [], // check for nodeJS hasModule = (typeof module !== 'undefined' && module.exports), // ASP.NET json date format regex aspNetJsonRegex = /^\/?Date\((\-?\d+)/i, aspNetTimeSpanJsonRegex = /(\-)?(?:(\d*)\.)?(\d+)\:(\d+)(?:\:(\d+)\.?(\d{3})?)?/, // from http://docs.closure-library.googlecode.com/git/closure_goog_date_date.js.source.html // somewhat more in line with 4.4.3.2 2004 spec, but allows decimal anywhere isoDurationRegex = /^(-)?P(?:(?:([0-9,.]*)Y)?(?:([0-9,.]*)M)?(?:([0-9,.]*)D)?(?:T(?:([0-9,.]*)H)?(?:([0-9,.]*)M)?(?:([0-9,.]*)S)?)?|([0-9,.]*)W)$/, // format tokens formattingTokens = /(\[[^\[]*\])|(\\)?(Mo|MM?M?M?|Do|DDDo|DD?D?D?|ddd?d?|do?|w[o|w]?|W[o|W]?|Q|YYYYYY|YYYYY|YYYY|YY|gg(ggg?)?|GG(GGG?)?|e|E|a|A|hh?|HH?|mm?|ss?|S{1,4}|X|zz?|ZZ?|.)/g, localFormattingTokens = /(\[[^\[]*\])|(\\)?(LT|LL?L?L?|l{1,4})/g, // parsing token regexes parseTokenOneOrTwoDigits = /\d\d?/, // 0 - 99 parseTokenOneToThreeDigits = /\d{1,3}/, // 0 - 999 parseTokenOneToFourDigits = /\d{1,4}/, // 0 - 9999 parseTokenOneToSixDigits = /[+\-]?\d{1,6}/, // -999,999 - 999,999 parseTokenDigits = /\d+/, // nonzero number of digits parseTokenWord = /[0-9]*['a-z\u00A0-\u05FF\u0700-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]+|[\u0600-\u06FF\/]+(\s*?[\u0600-\u06FF]+){1,2}/i, // any word (or two) characters or numbers including two/three word month in arabic. parseTokenTimezone = /Z|[\+\-]\d\d:?\d\d/gi, // +00:00 -00:00 +0000 -0000 or Z parseTokenT = /T/i, // T (ISO separator) parseTokenTimestampMs = /[\+\-]?\d+(\.\d{1,3})?/, // 123456789 123456789.123 parseTokenOrdinal = /\d{1,2}/, //strict parsing regexes parseTokenOneDigit = /\d/, // 0 - 9 parseTokenTwoDigits = /\d\d/, // 00 - 99 parseTokenThreeDigits = /\d{3}/, // 000 - 999 parseTokenFourDigits = /\d{4}/, // 0000 - 9999 parseTokenSixDigits = /[+-]?\d{6}/, // -999,999 - 999,999 parseTokenSignedNumber = /[+-]?\d+/, // -inf - inf // iso 8601 regex // 0000-00-00 0000-W00 or 0000-W00-0 + T + 00 or 00:00 or 00:00:00 or 00:00:00.000 + +00:00 or +0000 or +00) isoRegex = /^\s*(?:[+-]\d{6}|\d{4})-(?:(\d\d-\d\d)|(W\d\d$)|(W\d\d-\d)|(\d\d\d))((T| )(\d\d(:\d\d(:\d\d(\.\d+)?)?)?)?([\+\-]\d\d(?::?\d\d)?|\s*Z)?)?$/, isoFormat = 'YYYY-MM-DDTHH:mm:ssZ', isoDates = [ ['YYYYYY-MM-DD', /[+-]\d{6}-\d{2}-\d{2}/], ['YYYY-MM-DD', /\d{4}-\d{2}-\d{2}/], ['GGGG-[W]WW-E', /\d{4}-W\d{2}-\d/], ['GGGG-[W]WW', /\d{4}-W\d{2}/], ['YYYY-DDD', /\d{4}-\d{3}/] ], // iso time formats and regexes isoTimes = [ ['HH:mm:ss.SSSS', /(T| )\d\d:\d\d:\d\d\.\d+/], ['HH:mm:ss', /(T| )\d\d:\d\d:\d\d/], ['HH:mm', /(T| )\d\d:\d\d/], ['HH', /(T| )\d\d/] ], // timezone chunker "+10:00" > ["10", "00"] or "-1530" > ["-15", "30"] parseTimezoneChunker = /([\+\-]|\d\d)/gi, // getter and setter names proxyGettersAndSetters = 'Date|Hours|Minutes|Seconds|Milliseconds'.split('|'), unitMillisecondFactors = { 'Milliseconds' : 1, 'Seconds' : 1e3, 'Minutes' : 6e4, 'Hours' : 36e5, 'Days' : 864e5, 'Months' : 2592e6, 'Years' : 31536e6 }, unitAliases = { ms : 'millisecond', s : 'second', m : 'minute', h : 'hour', d : 'day', D : 'date', w : 'week', W : 'isoWeek', M : 'month', Q : 'quarter', y : 'year', DDD : 'dayOfYear', e : 'weekday', E : 'isoWeekday', gg: 'weekYear', GG: 'isoWeekYear' }, camelFunctions = { dayofyear : 'dayOfYear', isoweekday : 'isoWeekday', isoweek : 'isoWeek', weekyear : 'weekYear', isoweekyear : 'isoWeekYear' }, // format function strings formatFunctions = {}, // default relative time thresholds relativeTimeThresholds = { s: 45, // seconds to minute m: 45, // minutes to hour h: 22, // hours to day d: 26, // days to month M: 11 // months to year }, // tokens to ordinalize and pad ordinalizeTokens = 'DDD w W M D d'.split(' '), paddedTokens = 'M D H h m s w W'.split(' '), formatTokenFunctions = { M : function () { return this.month() + 1; }, MMM : function (format) { return this.localeData().monthsShort(this, format); }, MMMM : function (format) { return this.localeData().months(this, format); }, D : function () { return this.date(); }, DDD : function () { return this.dayOfYear(); }, d : function () { return this.day(); }, dd : function (format) { return this.localeData().weekdaysMin(this, format); }, ddd : function (format) { return this.localeData().weekdaysShort(this, format); }, dddd : function (format) { return this.localeData().weekdays(this, format); }, w : function () { return this.week(); }, W : function () { return this.isoWeek(); }, YY : function () { return leftZeroFill(this.year() % 100, 2); }, YYYY : function () { return leftZeroFill(this.year(), 4); }, YYYYY : function () { return leftZeroFill(this.year(), 5); }, YYYYYY : function () { var y = this.year(), sign = y >= 0 ? '+' : '-'; return sign + leftZeroFill(Math.abs(y), 6); }, gg : function () { return leftZeroFill(this.weekYear() % 100, 2); }, gggg : function () { return leftZeroFill(this.weekYear(), 4); }, ggggg : function () { return leftZeroFill(this.weekYear(), 5); }, GG : function () { return leftZeroFill(this.isoWeekYear() % 100, 2); }, GGGG : function () { return leftZeroFill(this.isoWeekYear(), 4); }, GGGGG : function () { return leftZeroFill(this.isoWeekYear(), 5); }, e : function () { return this.weekday(); }, E : function () { return this.isoWeekday(); }, a : function () { return this.localeData().meridiem(this.hours(), this.minutes(), true); }, A : function () { return this.localeData().meridiem(this.hours(), this.minutes(), false); }, H : function () { return this.hours(); }, h : function () { return this.hours() % 12 || 12; }, m : function () { return this.minutes(); }, s : function () { return this.seconds(); }, S : function () { return toInt(this.milliseconds() / 100); }, SS : function () { return leftZeroFill(toInt(this.milliseconds() / 10), 2); }, SSS : function () { return leftZeroFill(this.milliseconds(), 3); }, SSSS : function () { return leftZeroFill(this.milliseconds(), 3); }, Z : function () { var a = -this.zone(), b = '+'; if (a < 0) { a = -a; b = '-'; } return b + leftZeroFill(toInt(a / 60), 2) + ':' + leftZeroFill(toInt(a) % 60, 2); }, ZZ : function () { var a = -this.zone(), b = '+'; if (a < 0) { a = -a; b = '-'; } return b + leftZeroFill(toInt(a / 60), 2) + leftZeroFill(toInt(a) % 60, 2); }, z : function () { return this.zoneAbbr(); }, zz : function () { return this.zoneName(); }, X : function () { return this.unix(); }, Q : function () { return this.quarter(); } }, deprecations = {}, lists = ['months', 'monthsShort', 'weekdays', 'weekdaysShort', 'weekdaysMin']; // Pick the first defined of two or three arguments. dfl comes from // default. function dfl(a, b, c) { switch (arguments.length) { case 2: return a != null ? a : b; case 3: return a != null ? a : b != null ? b : c; default: throw new Error('Implement me'); } } function defaultParsingFlags() { // We need to deep clone this object, and es5 standard is not very // helpful. return { empty : false, unusedTokens : [], unusedInput : [], overflow : -2, charsLeftOver : 0, nullInput : false, invalidMonth : null, invalidFormat : false, userInvalidated : false, iso: false }; } function printMsg(msg) { if (moment.suppressDeprecationWarnings === false && typeof console !== 'undefined' && console.warn) { console.warn("Deprecation warning: " + msg); } } function deprecate(msg, fn) { var firstTime = true; return extend(function () { if (firstTime) { printMsg(msg); firstTime = false; } return fn.apply(this, arguments); }, fn); } function deprecateSimple(name, msg) { if (!deprecations[name]) { printMsg(msg); deprecations[name] = true; } } function padToken(func, count) { return function (a) { return leftZeroFill(func.call(this, a), count); }; } function ordinalizeToken(func, period) { return function (a) { return this.localeData().ordinal(func.call(this, a), period); }; } while (ordinalizeTokens.length) { i = ordinalizeTokens.pop(); formatTokenFunctions[i + 'o'] = ordinalizeToken(formatTokenFunctions[i], i); } while (paddedTokens.length) { i = paddedTokens.pop(); formatTokenFunctions[i + i] = padToken(formatTokenFunctions[i], 2); } formatTokenFunctions.DDDD = padToken(formatTokenFunctions.DDD, 3); /************************************ Constructors ************************************/ function Locale() { } // Moment prototype object function Moment(config, skipOverflow) { if (skipOverflow !== false) { checkOverflow(config); } copyConfig(this, config); this._d = new Date(+config._d); } // Duration Constructor function Duration(duration) { var normalizedInput = normalizeObjectUnits(duration), years = normalizedInput.year || 0, quarters = normalizedInput.quarter || 0, months = normalizedInput.month || 0, weeks = normalizedInput.week || 0, days = normalizedInput.day || 0, hours = normalizedInput.hour || 0, minutes = normalizedInput.minute || 0, seconds = normalizedInput.second || 0, milliseconds = normalizedInput.millisecond || 0; // representation for dateAddRemove this._milliseconds = +milliseconds + seconds * 1e3 + // 1000 minutes * 6e4 + // 1000 * 60 hours * 36e5; // 1000 * 60 * 60 // Because of dateAddRemove treats 24 hours as different from a // day when working around DST, we need to store them separately this._days = +days + weeks * 7; // It is impossible translate months into days without knowing // which months you are are talking about, so we have to store // it separately. this._months = +months + quarters * 3 + years * 12; this._data = {}; this._locale = moment.localeData(); this._bubble(); } /************************************ Helpers ************************************/ function extend(a, b) { for (var i in b) { if (b.hasOwnProperty(i)) { a[i] = b[i]; } } if (b.hasOwnProperty('toString')) { a.toString = b.toString; } if (b.hasOwnProperty('valueOf')) { a.valueOf = b.valueOf; } return a; } function copyConfig(to, from) { var i, prop, val; if (typeof from._isAMomentObject !== 'undefined') { to._isAMomentObject = from._isAMomentObject; } if (typeof from._i !== 'undefined') { to._i = from._i; } if (typeof from._f !== 'undefined') { to._f = from._f; } if (typeof from._l !== 'undefined') { to._l = from._l; } if (typeof from._strict !== 'undefined') { to._strict = from._strict; } if (typeof from._tzm !== 'undefined') { to._tzm = from._tzm; } if (typeof from._isUTC !== 'undefined') { to._isUTC = from._isUTC; } if (typeof from._offset !== 'undefined') { to._offset = from._offset; } if (typeof from._pf !== 'undefined') { to._pf = from._pf; } if (typeof from._locale !== 'undefined') { to._locale = from._locale; } if (momentProperties.length > 0) { for (i in momentProperties) { prop = momentProperties[i]; val = from[prop]; if (typeof val !== 'undefined') { to[prop] = val; } } } return to; } function absRound(number) { if (number < 0) { return Math.ceil(number); } else { return Math.floor(number); } } // left zero fill a number // see http://jsperf.com/left-zero-filling for performance comparison function leftZeroFill(number, targetLength, forceSign) { var output = '' + Math.abs(number), sign = number >= 0; while (output.length < targetLength) { output = '0' + output; } return (sign ? (forceSign ? '+' : '') : '-') + output; } function positiveMomentsDifference(base, other) { var res = {milliseconds: 0, months: 0}; res.months = other.month() - base.month() + (other.year() - base.year()) * 12; if (base.clone().add(res.months, 'M').isAfter(other)) { --res.months; } res.milliseconds = +other - +(base.clone().add(res.months, 'M')); return res; } function momentsDifference(base, other) { var res; other = makeAs(other, base); if (base.isBefore(other)) { res = positiveMomentsDifference(base, other); } else { res = positiveMomentsDifference(other, base); res.milliseconds = -res.milliseconds; res.months = -res.months; } return res; } // TODO: remove 'name' arg after deprecation is removed function createAdder(direction, name) { return function (val, period) { var dur, tmp; //invert the arguments, but complain about it if (period !== null && !isNaN(+period)) { deprecateSimple(name, "moment()." + name + "(period, number) is deprecated. Please use moment()." + name + "(number, period)."); tmp = val; val = period; period = tmp; } val = typeof val === 'string' ? +val : val; dur = moment.duration(val, period); addOrSubtractDurationFromMoment(this, dur, direction); return this; }; } function addOrSubtractDurationFromMoment(mom, duration, isAdding, updateOffset) { var milliseconds = duration._milliseconds, days = duration._days, months = duration._months; updateOffset = updateOffset == null ? true : updateOffset; if (milliseconds) { mom._d.setTime(+mom._d + milliseconds * isAdding); } if (days) { rawSetter(mom, 'Date', rawGetter(mom, 'Date') + days * isAdding); } if (months) { rawMonthSetter(mom, rawGetter(mom, 'Month') + months * isAdding); } if (updateOffset) { moment.updateOffset(mom, days || months); } } // check if is an array function isArray(input) { return Object.prototype.toString.call(input) === '[object Array]'; } function isDate(input) { return Object.prototype.toString.call(input) === '[object Date]' || input instanceof Date; } // compare two arrays, return the number of differences function compareArrays(array1, array2, dontConvert) { var len = Math.min(array1.length, array2.length), lengthDiff = Math.abs(array1.length - array2.length), diffs = 0, i; for (i = 0; i < len; i++) { if ((dontConvert && array1[i] !== array2[i]) || (!dontConvert && toInt(array1[i]) !== toInt(array2[i]))) { diffs++; } } return diffs + lengthDiff; } function normalizeUnits(units) { if (units) { var lowered = units.toLowerCase().replace(/(.)s$/, '$1'); units = unitAliases[units] || camelFunctions[lowered] || lowered; } return units; } function normalizeObjectUnits(inputObject) { var normalizedInput = {}, normalizedProp, prop; for (prop in inputObject) { if (inputObject.hasOwnProperty(prop)) { normalizedProp = normalizeUnits(prop); if (normalizedProp) { normalizedInput[normalizedProp] = inputObject[prop]; } } } return normalizedInput; } function makeList(field) { var count, setter; if (field.indexOf('week') === 0) { count = 7; setter = 'day'; } else if (field.indexOf('month') === 0) { count = 12; setter = 'month'; } else { return; } moment[field] = function (format, index) { var i, getter, method = moment._locale[field], results = []; if (typeof format === 'number') { index = format; format = undefined; } getter = function (i) { var m = moment().utc().set(setter, i); return method.call(moment._locale, m, format || ''); }; if (index != null) { return getter(index); } else { for (i = 0; i < count; i++) { results.push(getter(i)); } return results; } }; } function toInt(argumentForCoercion) { var coercedNumber = +argumentForCoercion, value = 0; if (coercedNumber !== 0 && isFinite(coercedNumber)) { if (coercedNumber >= 0) { value = Math.floor(coercedNumber); } else { value = Math.ceil(coercedNumber); } } return value; } function daysInMonth(year, month) { return new Date(Date.UTC(year, month + 1, 0)).getUTCDate(); } function weeksInYear(year, dow, doy) { return weekOfYear(moment([year, 11, 31 + dow - doy]), dow, doy).week; } function daysInYear(year) { return isLeapYear(year) ? 366 : 365; } function isLeapYear(year) { return (year % 4 === 0 && year % 100 !== 0) || year % 400 === 0; } function checkOverflow(m) { var overflow; if (m._a && m._pf.overflow === -2) { overflow = m._a[MONTH] < 0 || m._a[MONTH] > 11 ? MONTH : m._a[DATE] < 1 || m._a[DATE] > daysInMonth(m._a[YEAR], m._a[MONTH]) ? DATE : m._a[HOUR] < 0 || m._a[HOUR] > 23 ? HOUR : m._a[MINUTE] < 0 || m._a[MINUTE] > 59 ? MINUTE : m._a[SECOND] < 0 || m._a[SECOND] > 59 ? SECOND : m._a[MILLISECOND] < 0 || m._a[MILLISECOND] > 999 ? MILLISECOND : -1; if (m._pf._overflowDayOfYear && (overflow < YEAR || overflow > DATE)) { overflow = DATE; } m._pf.overflow = overflow; } } function isValid(m) { if (m._isValid == null) { m._isValid = !isNaN(m._d.getTime()) && m._pf.overflow < 0 && !m._pf.empty && !m._pf.invalidMonth && !m._pf.nullInput && !m._pf.invalidFormat && !m._pf.userInvalidated; if (m._strict) { m._isValid = m._isValid && m._pf.charsLeftOver === 0 && m._pf.unusedTokens.length === 0; } } return m._isValid; } function normalizeLocale(key) { return key ? key.toLowerCase().replace('_', '-') : key; } // pick the locale from the array // try ['en-au', 'en-gb'] as 'en-au', 'en-gb', 'en', as in move through the list trying each // substring from most specific to least, but move to the next array item if it's a more specific variant than the current root function chooseLocale(names) { var i = 0, j, next, locale, split; while (i < names.length) { split = normalizeLocale(names[i]).split('-'); j = split.length; next = normalizeLocale(names[i + 1]); next = next ? next.split('-') : null; while (j > 0) { locale = loadLocale(split.slice(0, j).join('-')); if (locale) { return locale; } if (next && next.length >= j && compareArrays(split, next, true) >= j - 1) { //the next array item is better than a shallower substring of this one break; } j--; } i++; } return null; } function loadLocale(name) { var oldLocale = null; if (!locales[name] && hasModule) { try { oldLocale = moment.locale(); require('./locale/' + name); // because defineLocale currently also sets the global locale, we want to undo that for lazy loaded locales moment.locale(oldLocale); } catch (e) { } } return locales[name]; } // Return a moment from input, that is local/utc/zone equivalent to model. function makeAs(input, model) { return model._isUTC ? moment(input).zone(model._offset || 0) : moment(input).local(); } /************************************ Locale ************************************/ extend(Locale.prototype, { set : function (config) { var prop, i; for (i in config) { prop = config[i]; if (typeof prop === 'function') { this[i] = prop; } else { this['_' + i] = prop; } } }, _months : 'January_February_March_April_May_June_July_August_September_October_November_December'.split('_'), months : function (m) { return this._months[m.month()]; }, _monthsShort : 'Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec'.split('_'), monthsShort : function (m) { return this._monthsShort[m.month()]; }, monthsParse : function (monthName) { var i, mom, regex; if (!this._monthsParse) { this._monthsParse = []; } for (i = 0; i < 12; i++) { // make the regex if we don't have it already if (!this._monthsParse[i]) { mom = moment.utc([2000, i]); regex = '^' + this.months(mom, '') + '|^' + this.monthsShort(mom, ''); this._monthsParse[i] = new RegExp(regex.replace('.', ''), 'i'); } // test the regex if (this._monthsParse[i].test(monthName)) { return i; } } }, _weekdays : 'Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday'.split('_'), weekdays : function (m) { return this._weekdays[m.day()]; }, _weekdaysShort : 'Sun_Mon_Tue_Wed_Thu_Fri_Sat'.split('_'), weekdaysShort : function (m) { return this._weekdaysShort[m.day()]; }, _weekdaysMin : 'Su_Mo_Tu_We_Th_Fr_Sa'.split('_'), weekdaysMin : function (m) { return this._weekdaysMin[m.day()]; }, weekdaysParse : function (weekdayName) { var i, mom, regex; if (!this._weekdaysParse) { this._weekdaysParse = []; } for (i = 0; i < 7; i++) { // make the regex if we don't have it already if (!this._weekdaysParse[i]) { mom = moment([2000, 1]).day(i); regex = '^' + this.weekdays(mom, '') + '|^' + this.weekdaysShort(mom, '') + '|^' + this.weekdaysMin(mom, ''); this._weekdaysParse[i] = new RegExp(regex.replace('.', ''), 'i'); } // test the regex if (this._weekdaysParse[i].test(weekdayName)) { return i; } } }, _longDateFormat : { LT : 'h:mm A', L : 'MM/DD/YYYY', LL : 'MMMM D, YYYY', LLL : 'MMMM D, YYYY LT', LLLL : 'dddd, MMMM D, YYYY LT' }, longDateFormat : function (key) { var output = this._longDateFormat[key]; if (!output && this._longDateFormat[key.toUpperCase()]) { output = this._longDateFormat[key.toUpperCase()].replace(/MMMM|MM|DD|dddd/g, function (val) { return val.slice(1); }); this._longDateFormat[key] = output; } return output; }, isPM : function (input) { // IE8 Quirks Mode & IE7 Standards Mode do not allow accessing strings like arrays // Using charAt should be more compatible. return ((input + '').toLowerCase().charAt(0) === 'p'); }, _meridiemParse : /[ap]\.?m?\.?/i, meridiem : function (hours, minutes, isLower) { if (hours > 11) { return isLower ? 'pm' : 'PM'; } else { return isLower ? 'am' : 'AM'; } }, _calendar : { sameDay : '[Today at] LT', nextDay : '[Tomorrow at] LT', nextWeek : 'dddd [at] LT', lastDay : '[Yesterday at] LT', lastWeek : '[Last] dddd [at] LT', sameElse : 'L' }, calendar : function (key, mom) { var output = this._calendar[key]; return typeof output === 'function' ? output.apply(mom) : output; }, _relativeTime : { future : 'in %s', past : '%s ago', s : 'a few seconds', m : 'a minute', mm : '%d minutes', h : 'an hour', hh : '%d hours', d : 'a day', dd : '%d days', M : 'a month', MM : '%d months', y : 'a year', yy : '%d years' }, relativeTime : function (number, withoutSuffix, string, isFuture) { var output = this._relativeTime[string]; return (typeof output === 'function') ? output(number, withoutSuffix, string, isFuture) : output.replace(/%d/i, number); }, pastFuture : function (diff, output) { var format = this._relativeTime[diff > 0 ? 'future' : 'past']; return typeof format === 'function' ? format(output) : format.replace(/%s/i, output); }, ordinal : function (number) { return this._ordinal.replace('%d', number); }, _ordinal : '%d', preparse : function (string) { return string; }, postformat : function (string) { return string; }, week : function (mom) { return weekOfYear(mom, this._week.dow, this._week.doy).week; }, _week : { dow : 0, // Sunday is the first day of the week. doy : 6 // The week that contains Jan 1st is the first week of the year. }, _invalidDate: 'Invalid date', invalidDate: function () { return this._invalidDate; } }); /************************************ Formatting ************************************/ function removeFormattingTokens(input) { if (input.match(/\[[\s\S]/)) { return input.replace(/^\[|\]$/g, ''); } return input.replace(/\\/g, ''); } function makeFormatFunction(format) { var array = format.match(formattingTokens), i, length; for (i = 0, length = array.length; i < length; i++) { if (formatTokenFunctions[array[i]]) { array[i] = formatTokenFunctions[array[i]]; } else { array[i] = removeFormattingTokens(array[i]); } } return function (mom) { var output = ''; for (i = 0; i < length; i++) { output += array[i] instanceof Function ? array[i].call(mom, format) : array[i]; } return output; }; } // format date using native date object function formatMoment(m, format) { if (!m.isValid()) { return m.localeData().invalidDate(); } format = expandFormat(format, m.localeData()); if (!formatFunctions[format]) { formatFunctions[format] = makeFormatFunction(format); } return formatFunctions[format](m); } function expandFormat(format, locale) { var i = 5; function replaceLongDateFormatTokens(input) { return locale.longDateFormat(input) || input; } localFormattingTokens.lastIndex = 0; while (i >= 0 && localFormattingTokens.test(format)) { format = format.replace(localFormattingTokens, replaceLongDateFormatTokens); localFormattingTokens.lastIndex = 0; i -= 1; } return format; } /************************************ Parsing ************************************/ // get the regex to find the next token function getParseRegexForToken(token, config) { var a, strict = config._strict; switch (token) { case 'Q': return parseTokenOneDigit; case 'DDDD': return parseTokenThreeDigits; case 'YYYY': case 'GGGG': case 'gggg': return strict ? parseTokenFourDigits : parseTokenOneToFourDigits; case 'Y': case 'G': case 'g': return parseTokenSignedNumber; case 'YYYYYY': case 'YYYYY': case 'GGGGG': case 'ggggg': return strict ? parseTokenSixDigits : parseTokenOneToSixDigits; case 'S': if (strict) { return parseTokenOneDigit; } /* falls through */ case 'SS': if (strict) { return parseTokenTwoDigits; } /* falls through */ case 'SSS': if (strict) { return parseTokenThreeDigits; } /* falls through */ case 'DDD': return parseTokenOneToThreeDigits; case 'MMM': case 'MMMM': case 'dd': case 'ddd': case 'dddd': return parseTokenWord; case 'a': case 'A': return config._locale._meridiemParse; case 'X': return parseTokenTimestampMs; case 'Z': case 'ZZ': return parseTokenTimezone; case 'T': return parseTokenT; case 'SSSS': return parseTokenDigits; case 'MM': case 'DD': case 'YY': case 'GG': case 'gg': case 'HH': case 'hh': case 'mm': case 'ss': case 'ww': case 'WW': return strict ? parseTokenTwoDigits : parseTokenOneOrTwoDigits; case 'M': case 'D': case 'd': case 'H': case 'h': case 'm': case 's': case 'w': case 'W': case 'e': case 'E': return parseTokenOneOrTwoDigits; case 'Do': return parseTokenOrdinal; default : a = new RegExp(regexpEscape(unescapeFormat(token.replace('\\', '')), 'i')); return a; } } function timezoneMinutesFromString(string) { string = string || ''; var possibleTzMatches = (string.match(parseTokenTimezone) || []), tzChunk = possibleTzMatches[possibleTzMatches.length - 1] || [], parts = (tzChunk + '').match(parseTimezoneChunker) || ['-', 0, 0], minutes = +(parts[1] * 60) + toInt(parts[2]); return parts[0] === '+' ? -minutes : minutes; } // function to convert string input to date function addTimeToArrayFromToken(token, input, config) { var a, datePartArray = config._a; switch (token) { // QUARTER case 'Q': if (input != null) { datePartArray[MONTH] = (toInt(input) - 1) * 3; } break; // MONTH case 'M' : // fall through to MM case 'MM' : if (input != null) { datePartArray[MONTH] = toInt(input) - 1; } break; case 'MMM' : // fall through to MMMM case 'MMMM' : a = config._locale.monthsParse(input); // if we didn't find a month name, mark the date as invalid. if (a != null) { datePartArray[MONTH] = a; } else { config._pf.invalidMonth = input; } break; // DAY OF MONTH case 'D' : // fall through to DD case 'DD' : if (input != null) { datePartArray[DATE] = toInt(input); } break; case 'Do' : if (input != null) { datePartArray[DATE] = toInt(parseInt(input, 10)); } break; // DAY OF YEAR case 'DDD' : // fall through to DDDD case 'DDDD' : if (input != null) { config._dayOfYear = toInt(input); } break; // YEAR case 'YY' : datePartArray[YEAR] = moment.parseTwoDigitYear(input); break; case 'YYYY' : case 'YYYYY' : case 'YYYYYY' : datePartArray[YEAR] = toInt(input); break; // AM / PM case 'a' : // fall through to A case 'A' : config._isPm = config._locale.isPM(input); break; // 24 HOUR case 'H' : // fall through to hh case 'HH' : // fall through to hh case 'h' : // fall through to hh case 'hh' : datePartArray[HOUR] = toInt(input); break; // MINUTE case 'm' : // fall through to mm case 'mm' : datePartArray[MINUTE] = toInt(input); break; // SECOND case 's' : // fall through to ss case 'ss' : datePartArray[SECOND] = toInt(input); break; // MILLISECOND case 'S' : case 'SS' : case 'SSS' : case 'SSSS' : datePartArray[MILLISECOND] = toInt(('0.' + input) * 1000); break; // UNIX TIMESTAMP WITH MS case 'X': config._d = new Date(parseFloat(input) * 1000); break; // TIMEZONE case 'Z' : // fall through to ZZ case 'ZZ' : config._useUTC = true; config._tzm = timezoneMinutesFromString(input); break; // WEEKDAY - human case 'dd': case 'ddd': case 'dddd': a = config._locale.weekdaysParse(input); // if we didn't get a weekday name, mark the date as invalid if (a != null) { config._w = config._w || {}; config._w['d'] = a; } else { config._pf.invalidWeekday = input; } break; // WEEK, WEEK DAY - numeric case 'w': case 'ww': case 'W': case 'WW': case 'd': case 'e': case 'E': token = token.substr(0, 1); /* falls through */ case 'gggg': case 'GGGG': case 'GGGGG': token = token.substr(0, 2); if (input) { config._w = config._w || {}; config._w[token] = toInt(input); } break; case 'gg': case 'GG': config._w = config._w || {}; config._w[token] = moment.parseTwoDigitYear(input); } } function dayOfYearFromWeekInfo(config) { var w, weekYear, week, weekday, dow, doy, temp; w = config._w; if (w.GG != null || w.W != null || w.E != null) { dow = 1; doy = 4; // TODO: We need to take the current isoWeekYear, but that depends on // how we interpret now (local, utc, fixed offset). So create // a now version of current config (take local/utc/offset flags, and // create now). weekYear = dfl(w.GG, config._a[YEAR], weekOfYear(moment(), 1, 4).year); week = dfl(w.W, 1); weekday = dfl(w.E, 1); } else { dow = config._locale._week.dow; doy = config._locale._week.doy; weekYear = dfl(w.gg, config._a[YEAR], weekOfYear(moment(), dow, doy).year); week = dfl(w.w, 1); if (w.d != null) { // weekday -- low day numbers are considered next week weekday = w.d; if (weekday < dow) { ++week; } } else if (w.e != null) { // local weekday -- counting starts from begining of week weekday = w.e + dow; } else { // default to begining of week weekday = dow; } } temp = dayOfYearFromWeeks(weekYear, week, weekday, doy, dow); config._a[YEAR] = temp.year; config._dayOfYear = temp.dayOfYear; } // convert an array to a date. // the array should mirror the parameters below // note: all values past the year are optional and will default to the lowest possible value. // [year, month, day , hour, minute, second, millisecond] function dateFromConfig(config) { var i, date, input = [], currentDate, yearToUse; if (config._d) { return; } currentDate = currentDateArray(config); //compute day of the year from weeks and weekdays if (config._w && config._a[DATE] == null && config._a[MONTH] == null) { dayOfYearFromWeekInfo(config); } //if the day of the year is set, figure out what it is if (config._dayOfYear) { yearToUse = dfl(config._a[YEAR], currentDate[YEAR]); if (config._dayOfYear > daysInYear(yearToUse)) { config._pf._overflowDayOfYear = true; } date = makeUTCDate(yearToUse, 0, config._dayOfYear); config._a[MONTH] = date.getUTCMonth(); config._a[DATE] = date.getUTCDate(); } // Default to current date. // * if no year, month, day of month are given, default to today // * if day of month is given, default month and year // * if month is given, default only year // * if year is given, don't default anything for (i = 0; i < 3 && config._a[i] == null; ++i) { config._a[i] = input[i] = currentDate[i]; } // Zero out whatever was not defaulted, including time for (; i < 7; i++) { config._a[i] = input[i] = (config._a[i] == null) ? (i === 2 ? 1 : 0) : config._a[i]; } config._d = (config._useUTC ? makeUTCDate : makeDate).apply(null, input); // Apply timezone offset from input. The actual zone can be changed // with parseZone. if (config._tzm != null) { config._d.setUTCMinutes(config._d.getUTCMinutes() + config._tzm); } } function dateFromObject(config) { var normalizedInput; if (config._d) { return; } normalizedInput = normalizeObjectUnits(config._i); config._a = [ normalizedInput.year, normalizedInput.month, normalizedInput.day, normalizedInput.hour, normalizedInput.minute, normalizedInput.second, normalizedInput.millisecond ]; dateFromConfig(config); } function currentDateArray(config) { var now = new Date(); if (config._useUTC) { return [ now.getUTCFullYear(), now.getUTCMonth(), now.getUTCDate() ]; } else { return [now.getFullYear(), now.getMonth(), now.getDate()]; } } // date from string and format string function makeDateFromStringAndFormat(config) { if (config._f === moment.ISO_8601) { parseISO(config); return; } config._a = []; config._pf.empty = true; // This array is used to make a Date, either with `new Date` or `Date.UTC` var string = '' + config._i, i, parsedInput, tokens, token, skipped, stringLength = string.length, totalParsedInputLength = 0; tokens = expandFormat(config._f, config._locale).match(formattingTokens) || []; for (i = 0; i < tokens.length; i++) { token = tokens[i]; parsedInput = (string.match(getParseRegexForToken(token, config)) || [])[0]; if (parsedInput) { skipped = string.substr(0, string.indexOf(parsedInput)); if (skipped.length > 0) { config._pf.unusedInput.push(skipped); } string = string.slice(string.indexOf(parsedInput) + parsedInput.length); totalParsedInputLength += parsedInput.length; } // don't parse if it's not a known token if (formatTokenFunctions[token]) { if (parsedInput) { config._pf.empty = false; } else { config._pf.unusedTokens.push(token); } addTimeToArrayFromToken(token, parsedInput, config); } else if (config._strict && !parsedInput) { config._pf.unusedTokens.push(token); } } // add remaining unparsed input length to the string config._pf.charsLeftOver = stringLength - totalParsedInputLength; if (string.length > 0) { config._pf.unusedInput.push(string); } // handle am pm if (config._isPm && config._a[HOUR] < 12) { config._a[HOUR] += 12; } // if is 12 am, change hours to 0 if (config._isPm === false && config._a[HOUR] === 12) { config._a[HOUR] = 0; } dateFromConfig(config); checkOverflow(config); } function unescapeFormat(s) { return s.replace(/\\(\[)|\\(\])|\[([^\]\[]*)\]|\\(.)/g, function (matched, p1, p2, p3, p4) { return p1 || p2 || p3 || p4; }); } // Code from http://stackoverflow.com/questions/3561493/is-there-a-regexp-escape-function-in-javascript function regexpEscape(s) { return s.replace(/[-\/\\^$*+?.()|[\]{}]/g, '\\$&'); } // date from string and array of format strings function makeDateFromStringAndArray(config) { var tempConfig, bestMoment, scoreToBeat, i, currentScore; if (config._f.length === 0) { config._pf.invalidFormat = true; config._d = new Date(NaN); return; } for (i = 0; i < config._f.length; i++) { currentScore = 0; tempConfig = copyConfig({}, config); tempConfig._pf = defaultParsingFlags(); tempConfig._f = config._f[i]; makeDateFromStringAndFormat(tempConfig); if (!isValid(tempConfig)) { continue; } // if there is any input that was not parsed add a penalty for that format currentScore += tempConfig._pf.charsLeftOver; //or tokens currentScore += tempConfig._pf.unusedTokens.length * 10; tempConfig._pf.score = currentScore; if (scoreToBeat == null || currentScore < scoreToBeat) { scoreToBeat = currentScore; bestMoment = tempConfig; } } extend(config, bestMoment || tempConfig); } // date from iso format function parseISO(config) { var i, l, string = config._i, match = isoRegex.exec(string); if (match) { config._pf.iso = true; for (i = 0, l = isoDates.length; i < l; i++) { if (isoDates[i][1].exec(string)) { // match[5] should be "T" or undefined config._f = isoDates[i][0] + (match[6] || ' '); break; } } for (i = 0, l = isoTimes.length; i < l; i++) { if (isoTimes[i][1].exec(string)) { config._f += isoTimes[i][0]; break; } } if (string.match(parseTokenTimezone)) { config._f += 'Z'; } makeDateFromStringAndFormat(config); } else { config._isValid = false; } } // date from iso format or fallback function makeDateFromString(config) { parseISO(config); if (config._isValid === false) { delete config._isValid; moment.createFromInputFallback(config); } } function makeDateFromInput(config) { var input = config._i, matched; if (input === undefined) { config._d = new Date(); } else if (isDate(input)) { config._d = new Date(+input); } else if ((matched = aspNetJsonRegex.exec(input)) !== null) { config._d = new Date(+matched[1]); } else if (typeof input === 'string') { makeDateFromString(config); } else if (isArray(input)) { config._a = input.slice(0); dateFromConfig(config); } else if (typeof(input) === 'object') { dateFromObject(config); } else if (typeof(input) === 'number') { // from milliseconds config._d = new Date(input); } else { moment.createFromInputFallback(config); } } function makeDate(y, m, d, h, M, s, ms) { //can't just apply() to create a date: //http://stackoverflow.com/questions/181348/instantiating-a-javascript-object-by-calling-prototype-constructor-apply var date = new Date(y, m, d, h, M, s, ms); //the date constructor doesn't accept years < 1970 if (y < 1970) { date.setFullYear(y); } return date; } function makeUTCDate(y) { var date = new Date(Date.UTC.apply(null, arguments)); if (y < 1970) { date.setUTCFullYear(y); } return date; } function parseWeekday(input, locale) { if (typeof input === 'string') { if (!isNaN(input)) { input = parseInt(input, 10); } else { input = locale.weekdaysParse(input); if (typeof input !== 'number') { return null; } } } return input; } /************************************ Relative Time ************************************/ // helper function for moment.fn.from, moment.fn.fromNow, and moment.duration.fn.humanize function substituteTimeAgo(string, number, withoutSuffix, isFuture, locale) { return locale.relativeTime(number || 1, !!withoutSuffix, string, isFuture); } function relativeTime(posNegDuration, withoutSuffix, locale) { var duration = moment.duration(posNegDuration).abs(), seconds = round(duration.as('s')), minutes = round(duration.as('m')), hours = round(duration.as('h')), days = round(duration.as('d')), months = round(duration.as('M')), years = round(duration.as('y')), args = seconds < relativeTimeThresholds.s && ['s', seconds] || minutes === 1 && ['m'] || minutes < relativeTimeThresholds.m && ['mm', minutes] || hours === 1 && ['h'] || hours < relativeTimeThresholds.h && ['hh', hours] || days === 1 && ['d'] || days < relativeTimeThresholds.d && ['dd', days] || months === 1 && ['M'] || months < relativeTimeThresholds.M && ['MM', months] || years === 1 && ['y'] || ['yy', years]; args[2] = withoutSuffix; args[3] = +posNegDuration > 0; args[4] = locale; return substituteTimeAgo.apply({}, args); } /************************************ Week of Year ************************************/ // firstDayOfWeek 0 = sun, 6 = sat // the day of the week that starts the week // (usually sunday or monday) // firstDayOfWeekOfYear 0 = sun, 6 = sat // the first week is the week that contains the first // of this day of the week // (eg. ISO weeks use thursday (4)) function weekOfYear(mom, firstDayOfWeek, firstDayOfWeekOfYear) { var end = firstDayOfWeekOfYear - firstDayOfWeek, daysToDayOfWeek = firstDayOfWeekOfYear - mom.day(), adjustedMoment; if (daysToDayOfWeek > end) { daysToDayOfWeek -= 7; } if (daysToDayOfWeek < end - 7) { daysToDayOfWeek += 7; } adjustedMoment = moment(mom).add(daysToDayOfWeek, 'd'); return { week: Math.ceil(adjustedMoment.dayOfYear() / 7), year: adjustedMoment.year() }; } //http://en.wikipedia.org/wiki/ISO_week_date#Calculating_a_date_given_the_year.2C_week_number_and_weekday function dayOfYearFromWeeks(year, week, weekday, firstDayOfWeekOfYear, firstDayOfWeek) { var d = makeUTCDate(year, 0, 1).getUTCDay(), daysToAdd, dayOfYear; d = d === 0 ? 7 : d; weekday = weekday != null ? weekday : firstDayOfWeek; daysToAdd = firstDayOfWeek - d + (d > firstDayOfWeekOfYear ? 7 : 0) - (d < firstDayOfWeek ? 7 : 0); dayOfYear = 7 * (week - 1) + (weekday - firstDayOfWeek) + daysToAdd + 1; return { year: dayOfYear > 0 ? year : year - 1, dayOfYear: dayOfYear > 0 ? dayOfYear : daysInYear(year - 1) + dayOfYear }; } /************************************ Top Level Functions ************************************/ function makeMoment(config) { var input = config._i, format = config._f; config._locale = config._locale || moment.localeData(config._l); if (input === null || (format === undefined && input === '')) { return moment.invalid({nullInput: true}); } if (typeof input === 'string') { config._i = input = config._locale.preparse(input); } if (moment.isMoment(input)) { return new Moment(input, true); } else if (format) { if (isArray(format)) { makeDateFromStringAndArray(config); } else { makeDateFromStringAndFormat(config); } } else { makeDateFromInput(config); } return new Moment(config); } moment = function (input, format, locale, strict) { var c; if (typeof(locale) === "boolean") { strict = locale; locale = undefined; } // object construction must be done this way. // https://github.com/moment/moment/issues/1423 c = {}; c._isAMomentObject = true; c._i = input; c._f = format; c._l = locale; c._strict = strict; c._isUTC = false; c._pf = defaultParsingFlags(); return makeMoment(c); }; moment.suppressDeprecationWarnings = false; moment.createFromInputFallback = deprecate( 'moment construction falls back to js Date. This is ' + 'discouraged and will be removed in upcoming major ' + 'release. Please refer to ' + 'https://github.com/moment/moment/issues/1407 for more info.', function (config) { config._d = new Date(config._i); } ); // Pick a moment m from moments so that m[fn](other) is true for all // other. This relies on the function fn to be transitive. // // moments should either be an array of moment objects or an array, whose // first element is an array of moment objects. function pickBy(fn, moments) { var res, i; if (moments.length === 1 && isArray(moments[0])) { moments = moments[0]; } if (!moments.length) { return moment(); } res = moments[0]; for (i = 1; i < moments.length; ++i) { if (moments[i][fn](res)) { res = moments[i]; } } return res; } moment.min = function () { var args = [].slice.call(arguments, 0); return pickBy('isBefore', args); }; moment.max = function () { var args = [].slice.call(arguments, 0); return pickBy('isAfter', args); }; // creating with utc moment.utc = function (input, format, locale, strict) { var c; if (typeof(locale) === "boolean") { strict = locale; locale = undefined; } // object construction must be done this way. // https://github.com/moment/moment/issues/1423 c = {}; c._isAMomentObject = true; c._useUTC = true; c._isUTC = true; c._l = locale; c._i = input; c._f = format; c._strict = strict; c._pf = defaultParsingFlags(); return makeMoment(c).utc(); }; // creating with unix timestamp (in seconds) moment.unix = function (input) { return moment(input * 1000); }; // duration moment.duration = function (input, key) { var duration = input, // matching against regexp is expensive, do it on demand match = null, sign, ret, parseIso, diffRes; if (moment.isDuration(input)) { duration = { ms: input._milliseconds, d: input._days, M: input._months }; } else if (typeof input === 'number') { duration = {}; if (key) { duration[key] = input; } else { duration.milliseconds = input; } } else if (!!(match = aspNetTimeSpanJsonRegex.exec(input))) { sign = (match[1] === '-') ? -1 : 1; duration = { y: 0, d: toInt(match[DATE]) * sign, h: toInt(match[HOUR]) * sign, m: toInt(match[MINUTE]) * sign, s: toInt(match[SECOND]) * sign, ms: toInt(match[MILLISECOND]) * sign }; } else if (!!(match = isoDurationRegex.exec(input))) { sign = (match[1] === '-') ? -1 : 1; parseIso = function (inp) { // We'd normally use ~~inp for this, but unfortunately it also // converts floats to ints. // inp may be undefined, so careful calling replace on it. var res = inp && parseFloat(inp.replace(',', '.')); // apply sign while we're at it return (isNaN(res) ? 0 : res) * sign; }; duration = { y: parseIso(match[2]), M: parseIso(match[3]), d: parseIso(match[4]), h: parseIso(match[5]), m: parseIso(match[6]), s: parseIso(match[7]), w: parseIso(match[8]) }; } else if (typeof duration === 'object' && ('from' in duration || 'to' in duration)) { diffRes = momentsDifference(moment(duration.from), moment(duration.to)); duration = {}; duration.ms = diffRes.milliseconds; duration.M = diffRes.months; } ret = new Duration(duration); if (moment.isDuration(input) && input.hasOwnProperty('_locale')) { ret._locale = input._locale; } return ret; }; // version number moment.version = VERSION; // default format moment.defaultFormat = isoFormat; // constant that refers to the ISO standard moment.ISO_8601 = function () {}; // Plugins that add properties should also add the key here (null value), // so we can properly clone ourselves. moment.momentProperties = momentProperties; // This function will be called whenever a moment is mutated. // It is intended to keep the offset in sync with the timezone. moment.updateOffset = function () {}; // This function allows you to set a threshold for relative time strings moment.relativeTimeThreshold = function (threshold, limit) { if (relativeTimeThresholds[threshold] === undefined) { return false; } if (limit === undefined) { return relativeTimeThresholds[threshold]; } relativeTimeThresholds[threshold] = limit; return true; }; moment.lang = deprecate( "moment.lang is deprecated. Use moment.locale instead.", function (key, value) { return moment.locale(key, value); } ); // This function will load locale and then set the global locale. If // no arguments are passed in, it will simply return the current global // locale key. moment.locale = function (key, values) { var data; if (key) { if (typeof(values) !== "undefined") { data = moment.defineLocale(key, values); } else { data = moment.localeData(key); } if (data) { moment.duration._locale = moment._locale = data; } } return moment._locale._abbr; }; moment.defineLocale = function (name, values) { if (values !== null) { values.abbr = name; if (!locales[name]) { locales[name] = new Locale(); } locales[name].set(values); // backwards compat for now: also set the locale moment.locale(name); return locales[name]; } else { // useful for testing delete locales[name]; return null; } }; moment.langData = deprecate( "moment.langData is deprecated. Use moment.localeData instead.", function (key) { return moment.localeData(key); } ); // returns locale data moment.localeData = function (key) { var locale; if (key && key._locale && key._locale._abbr) { key = key._locale._abbr; } if (!key) { return moment._locale; } if (!isArray(key)) { //short-circuit everything else locale = loadLocale(key); if (locale) { return locale; } key = [key]; } return chooseLocale(key); }; // compare moment object moment.isMoment = function (obj) { return obj instanceof Moment || (obj != null && obj.hasOwnProperty('_isAMomentObject')); }; // for typechecking Duration objects moment.isDuration = function (obj) { return obj instanceof Duration; }; for (i = lists.length - 1; i >= 0; --i) { makeList(lists[i]); } moment.normalizeUnits = function (units) { return normalizeUnits(units); }; moment.invalid = function (flags) { var m = moment.utc(NaN); if (flags != null) { extend(m._pf, flags); } else { m._pf.userInvalidated = true; } return m; }; moment.parseZone = function () { return moment.apply(null, arguments).parseZone(); }; moment.parseTwoDigitYear = function (input) { return toInt(input) + (toInt(input) > 68 ? 1900 : 2000); }; /************************************ Moment Prototype ************************************/ extend(moment.fn = Moment.prototype, { clone : function () { return moment(this); }, valueOf : function () { return +this._d + ((this._offset || 0) * 60000); }, unix : function () { return Math.floor(+this / 1000); }, toString : function () { return this.clone().locale('en').format("ddd MMM DD YYYY HH:mm:ss [GMT]ZZ"); }, toDate : function () { return this._offset ? new Date(+this) : this._d; }, toISOString : function () { var m = moment(this).utc(); if (0 < m.year() && m.year() <= 9999) { return formatMoment(m, 'YYYY-MM-DD[T]HH:mm:ss.SSS[Z]'); } else { return formatMoment(m, 'YYYYYY-MM-DD[T]HH:mm:ss.SSS[Z]'); } }, toArray : function () { var m = this; return [ m.year(), m.month(), m.date(), m.hours(), m.minutes(), m.seconds(), m.milliseconds() ]; }, isValid : function () { return isValid(this); }, isDSTShifted : function () { if (this._a) { return this.isValid() && compareArrays(this._a, (this._isUTC ? moment.utc(this._a) : moment(this._a)).toArray()) > 0; } return false; }, parsingFlags : function () { return extend({}, this._pf); }, invalidAt: function () { return this._pf.overflow; }, utc : function (keepLocalTime) { return this.zone(0, keepLocalTime); }, local : function (keepLocalTime) { if (this._isUTC) { this.zone(0, keepLocalTime); this._isUTC = false; if (keepLocalTime) { this.add(this._d.getTimezoneOffset(), 'm'); } } return this; }, format : function (inputString) { var output = formatMoment(this, inputString || moment.defaultFormat); return this.localeData().postformat(output); }, add : createAdder(1, 'add'), subtract : createAdder(-1, 'subtract'), diff : function (input, units, asFloat) { var that = makeAs(input, this), zoneDiff = (this.zone() - that.zone()) * 6e4, diff, output; units = normalizeUnits(units); if (units === 'year' || units === 'month') { // average number of days in the months in the given dates diff = (this.daysInMonth() + that.daysInMonth()) * 432e5; // 24 * 60 * 60 * 1000 / 2 // difference in months output = ((this.year() - that.year()) * 12) + (this.month() - that.month()); // adjust by taking difference in days, average number of days // and dst in the given months. output += ((this - moment(this).startOf('month')) - (that - moment(that).startOf('month'))) / diff; // same as above but with zones, to negate all dst output -= ((this.zone() - moment(this).startOf('month').zone()) - (that.zone() - moment(that).startOf('month').zone())) * 6e4 / diff; if (units === 'year') { output = output / 12; } } else { diff = (this - that); output = units === 'second' ? diff / 1e3 : // 1000 units === 'minute' ? diff / 6e4 : // 1000 * 60 units === 'hour' ? diff / 36e5 : // 1000 * 60 * 60 units === 'day' ? (diff - zoneDiff) / 864e5 : // 1000 * 60 * 60 * 24, negate dst units === 'week' ? (diff - zoneDiff) / 6048e5 : // 1000 * 60 * 60 * 24 * 7, negate dst diff; } return asFloat ? output : absRound(output); }, from : function (time, withoutSuffix) { return moment.duration({to: this, from: time}).locale(this.locale()).humanize(!withoutSuffix); }, fromNow : function (withoutSuffix) { return this.from(moment(), withoutSuffix); }, calendar : function (time) { // We want to compare the start of today, vs this. // Getting start-of-today depends on whether we're zone'd or not. var now = time || moment(), sod = makeAs(now, this).startOf('day'), diff = this.diff(sod, 'days', true), format = diff < -6 ? 'sameElse' : diff < -1 ? 'lastWeek' : diff < 0 ? 'lastDay' : diff < 1 ? 'sameDay' : diff < 2 ? 'nextDay' : diff < 7 ? 'nextWeek' : 'sameElse'; return this.format(this.localeData().calendar(format, this)); }, isLeapYear : function () { return isLeapYear(this.year()); }, isDST : function () { return (this.zone() < this.clone().month(0).zone() || this.zone() < this.clone().month(5).zone()); }, day : function (input) { var day = this._isUTC ? this._d.getUTCDay() : this._d.getDay(); if (input != null) { input = parseWeekday(input, this.localeData()); return this.add(input - day, 'd'); } else { return day; } }, month : makeAccessor('Month', true), startOf : function (units) { units = normalizeUnits(units); // the following switch intentionally omits break keywords // to utilize falling through the cases. switch (units) { case 'year': this.month(0); /* falls through */ case 'quarter': case 'month': this.date(1); /* falls through */ case 'week': case 'isoWeek': case 'day': this.hours(0); /* falls through */ case 'hour': this.minutes(0); /* falls through */ case 'minute': this.seconds(0); /* falls through */ case 'second': this.milliseconds(0); /* falls through */ } // weeks are a special case if (units === 'week') { this.weekday(0); } else if (units === 'isoWeek') { this.isoWeekday(1); } // quarters are also special if (units === 'quarter') { this.month(Math.floor(this.month() / 3) * 3); } return this; }, endOf: function (units) { units = normalizeUnits(units); return this.startOf(units).add(1, (units === 'isoWeek' ? 'week' : units)).subtract(1, 'ms'); }, isAfter: function (input, units) { units = typeof units !== 'undefined' ? units : 'millisecond'; return +this.clone().startOf(units) > +moment(input).startOf(units); }, isBefore: function (input, units) { units = typeof units !== 'undefined' ? units : 'millisecond'; return +this.clone().startOf(units) < +moment(input).startOf(units); }, isSame: function (input, units) { units = units || 'ms'; return +this.clone().startOf(units) === +makeAs(input, this).startOf(units); }, min: deprecate( 'moment().min is deprecated, use moment.min instead. https://github.com/moment/moment/issues/1548', function (other) { other = moment.apply(null, arguments); return other < this ? this : other; } ), max: deprecate( 'moment().max is deprecated, use moment.max instead. https://github.com/moment/moment/issues/1548', function (other) { other = moment.apply(null, arguments); return other > this ? this : other; } ), // keepLocalTime = true means only change the timezone, without // affecting the local hour. So 5:31:26 +0300 --[zone(2, true)]--> // 5:31:26 +0200 It is possible that 5:31:26 doesn't exist int zone // +0200, so we adjust the time as needed, to be valid. // // Keeping the time actually adds/subtracts (one hour) // from the actual represented time. That is why we call updateOffset // a second time. In case it wants us to change the offset again // _changeInProgress == true case, then we have to adjust, because // there is no such time in the given timezone. zone : function (input, keepLocalTime) { var offset = this._offset || 0, localAdjust; if (input != null) { if (typeof input === 'string') { input = timezoneMinutesFromString(input); } if (Math.abs(input) < 16) { input = input * 60; } if (!this._isUTC && keepLocalTime) { localAdjust = this._d.getTimezoneOffset(); } this._offset = input; this._isUTC = true; if (localAdjust != null) { this.subtract(localAdjust, 'm'); } if (offset !== input) { if (!keepLocalTime || this._changeInProgress) { addOrSubtractDurationFromMoment(this, moment.duration(offset - input, 'm'), 1, false); } else if (!this._changeInProgress) { this._changeInProgress = true; moment.updateOffset(this, true); this._changeInProgress = null; } } } else { return this._isUTC ? offset : this._d.getTimezoneOffset(); } return this; }, zoneAbbr : function () { return this._isUTC ? 'UTC' : ''; }, zoneName : function () { return this._isUTC ? 'Coordinated Universal Time' : ''; }, parseZone : function () { if (this._tzm) { this.zone(this._tzm); } else if (typeof this._i === 'string') { this.zone(this._i); } return this; }, hasAlignedHourOffset : function (input) { if (!input) { input = 0; } else { input = moment(input).zone(); } return (this.zone() - input) % 60 === 0; }, daysInMonth : function () { return daysInMonth(this.year(), this.month()); }, dayOfYear : function (input) { var dayOfYear = round((moment(this).startOf('day') - moment(this).startOf('year')) / 864e5) + 1; return input == null ? dayOfYear : this.add((input - dayOfYear), 'd'); }, quarter : function (input) { return input == null ? Math.ceil((this.month() + 1) / 3) : this.month((input - 1) * 3 + this.month() % 3); }, weekYear : function (input) { var year = weekOfYear(this, this.localeData()._week.dow, this.localeData()._week.doy).year; return input == null ? year : this.add((input - year), 'y'); }, isoWeekYear : function (input) { var year = weekOfYear(this, 1, 4).year; return input == null ? year : this.add((input - year), 'y'); }, week : function (input) { var week = this.localeData().week(this); return input == null ? week : this.add((input - week) * 7, 'd'); }, isoWeek : function (input) { var week = weekOfYear(this, 1, 4).week; return input == null ? week : this.add((input - week) * 7, 'd'); }, weekday : function (input) { var weekday = (this.day() + 7 - this.localeData()._week.dow) % 7; return input == null ? weekday : this.add(input - weekday, 'd'); }, isoWeekday : function (input) { // behaves the same as moment#day except // as a getter, returns 7 instead of 0 (1-7 range instead of 0-6) // as a setter, sunday should belong to the previous week. return input == null ? this.day() || 7 : this.day(this.day() % 7 ? input : input - 7); }, isoWeeksInYear : function () { return weeksInYear(this.year(), 1, 4); }, weeksInYear : function () { var weekInfo = this.localeData()._week; return weeksInYear(this.year(), weekInfo.dow, weekInfo.doy); }, get : function (units) { units = normalizeUnits(units); return this[units](); }, set : function (units, value) { units = normalizeUnits(units); if (typeof this[units] === 'function') { this[units](value); } return this; }, // If passed a locale key, it will set the locale for this // instance. Otherwise, it will return the locale configuration // variables for this instance. locale : function (key) { if (key === undefined) { return this._locale._abbr; } else { this._locale = moment.localeData(key); return this; } }, lang : deprecate( "moment().lang() is deprecated. Use moment().localeData() instead.", function (key) { if (key === undefined) { return this.localeData(); } else { this._locale = moment.localeData(key); return this; } } ), localeData : function () { return this._locale; } }); function rawMonthSetter(mom, value) { var dayOfMonth; // TODO: Move this out of here! if (typeof value === 'string') { value = mom.localeData().monthsParse(value); // TODO: Another silent failure? if (typeof value !== 'number') { return mom; } } dayOfMonth = Math.min(mom.date(), daysInMonth(mom.year(), value)); mom._d['set' + (mom._isUTC ? 'UTC' : '') + 'Month'](value, dayOfMonth); return mom; } function rawGetter(mom, unit) { return mom._d['get' + (mom._isUTC ? 'UTC' : '') + unit](); } function rawSetter(mom, unit, value) { if (unit === 'Month') { return rawMonthSetter(mom, value); } else { return mom._d['set' + (mom._isUTC ? 'UTC' : '') + unit](value); } } function makeAccessor(unit, keepTime) { return function (value) { if (value != null) { rawSetter(this, unit, value); moment.updateOffset(this, keepTime); return this; } else { return rawGetter(this, unit); } }; } moment.fn.millisecond = moment.fn.milliseconds = makeAccessor('Milliseconds', false); moment.fn.second = moment.fn.seconds = makeAccessor('Seconds', false); moment.fn.minute = moment.fn.minutes = makeAccessor('Minutes', false); // Setting the hour should keep the time, because the user explicitly // specified which hour he wants. So trying to maintain the same hour (in // a new timezone) makes sense. Adding/subtracting hours does not follow // this rule. moment.fn.hour = moment.fn.hours = makeAccessor('Hours', true); // moment.fn.month is defined separately moment.fn.date = makeAccessor('Date', true); moment.fn.dates = deprecate('dates accessor is deprecated. Use date instead.', makeAccessor('Date', true)); moment.fn.year = makeAccessor('FullYear', true); moment.fn.years = deprecate('years accessor is deprecated. Use year instead.', makeAccessor('FullYear', true)); // add plural methods moment.fn.days = moment.fn.day; moment.fn.months = moment.fn.month; moment.fn.weeks = moment.fn.week; moment.fn.isoWeeks = moment.fn.isoWeek; moment.fn.quarters = moment.fn.quarter; // add aliased format methods moment.fn.toJSON = moment.fn.toISOString; /************************************ Duration Prototype ************************************/ function daysToYears (days) { // 400 years have 146097 days (taking into account leap year rules) return days * 400 / 146097; } function yearsToDays (years) { // years * 365 + absRound(years / 4) - // absRound(years / 100) + absRound(years / 400); return years * 146097 / 400; } extend(moment.duration.fn = Duration.prototype, { _bubble : function () { var milliseconds = this._milliseconds, days = this._days, months = this._months, data = this._data, seconds, minutes, hours, years = 0; // The following code bubbles up values, see the tests for // examples of what that means. data.milliseconds = milliseconds % 1000; seconds = absRound(milliseconds / 1000); data.seconds = seconds % 60; minutes = absRound(seconds / 60); data.minutes = minutes % 60; hours = absRound(minutes / 60); data.hours = hours % 24; days += absRound(hours / 24); // Accurately convert days to years, assume start from year 0. years = absRound(daysToYears(days)); days -= absRound(yearsToDays(years)); // 30 days to a month // TODO (iskren): Use anchor date (like 1st Jan) to compute this. months += absRound(days / 30); days %= 30; // 12 months -> 1 year years += absRound(months / 12); months %= 12; data.days = days; data.months = months; data.years = years; }, abs : function () { this._milliseconds = Math.abs(this._milliseconds); this._days = Math.abs(this._days); this._months = Math.abs(this._months); this._data.milliseconds = Math.abs(this._data.milliseconds); this._data.seconds = Math.abs(this._data.seconds); this._data.minutes = Math.abs(this._data.minutes); this._data.hours = Math.abs(this._data.hours); this._data.months = Math.abs(this._data.months); this._data.years = Math.abs(this._data.years); return this; }, weeks : function () { return absRound(this.days() / 7); }, valueOf : function () { return this._milliseconds + this._days * 864e5 + (this._months % 12) * 2592e6 + toInt(this._months / 12) * 31536e6; }, humanize : function (withSuffix) { var output = relativeTime(this, !withSuffix, this.localeData()); if (withSuffix) { output = this.localeData().pastFuture(+this, output); } return this.localeData().postformat(output); }, add : function (input, val) { // supports only 2.0-style add(1, 's') or add(moment) var dur = moment.duration(input, val); this._milliseconds += dur._milliseconds; this._days += dur._days; this._months += dur._months; this._bubble(); return this; }, subtract : function (input, val) { var dur = moment.duration(input, val); this._milliseconds -= dur._milliseconds; this._days -= dur._days; this._months -= dur._months; this._bubble(); return this; }, get : function (units) { units = normalizeUnits(units); return this[units.toLowerCase() + 's'](); }, as : function (units) { var days, months; units = normalizeUnits(units); days = this._days + this._milliseconds / 864e5; if (units === 'month' || units === 'year') { months = this._months + daysToYears(days) * 12; return units === 'month' ? months : months / 12; } else { days += yearsToDays(this._months / 12); switch (units) { case 'week': return days / 7; case 'day': return days; case 'hour': return days * 24; case 'minute': return days * 24 * 60; case 'second': return days * 24 * 60 * 60; case 'millisecond': return days * 24 * 60 * 60 * 1000; default: throw new Error('Unknown unit ' + units); } } }, lang : moment.fn.lang, locale : moment.fn.locale, toIsoString : deprecate( "toIsoString() is deprecated. Please use toISOString() instead " + "(notice the capitals)", function () { return this.toISOString(); } ), toISOString : function () { // inspired by https://github.com/dordille/moment-isoduration/blob/master/moment.isoduration.js var years = Math.abs(this.years()), months = Math.abs(this.months()), days = Math.abs(this.days()), hours = Math.abs(this.hours()), minutes = Math.abs(this.minutes()), seconds = Math.abs(this.seconds() + this.milliseconds() / 1000); if (!this.asSeconds()) { // this is the same as C#'s (Noda) and python (isodate)... // but not other JS (goog.date) return 'P0D'; } return (this.asSeconds() < 0 ? '-' : '') + 'P' + (years ? years + 'Y' : '') + (months ? months + 'M' : '') + (days ? days + 'D' : '') + ((hours || minutes || seconds) ? 'T' : '') + (hours ? hours + 'H' : '') + (minutes ? minutes + 'M' : '') + (seconds ? seconds + 'S' : ''); }, localeData : function () { return this._locale; } }); function makeDurationGetter(name) { moment.duration.fn[name] = function () { return this._data[name]; }; } for (i in unitMillisecondFactors) { if (unitMillisecondFactors.hasOwnProperty(i)) { makeDurationGetter(i.toLowerCase()); } } moment.duration.fn.asMilliseconds = function () { return this.as('ms'); }; moment.duration.fn.asSeconds = function () { return this.as('s'); }; moment.duration.fn.asMinutes = function () { return this.as('m'); }; moment.duration.fn.asHours = function () { return this.as('h'); }; moment.duration.fn.asDays = function () { return this.as('d'); }; moment.duration.fn.asWeeks = function () { return this.as('weeks'); }; moment.duration.fn.asMonths = function () { return this.as('M'); }; moment.duration.fn.asYears = function () { return this.as('y'); }; /************************************ Default Locale ************************************/ // Set default locale, other locale will inherit from English. moment.locale('en', { ordinal : function (number) { var b = number % 10, output = (toInt(number % 100 / 10) === 1) ? 'th' : (b === 1) ? 'st' : (b === 2) ? 'nd' : (b === 3) ? 'rd' : 'th'; return number + output; } }); /* EMBED_LOCALES */ /************************************ Exposing Moment ************************************/ function makeGlobal(shouldDeprecate) { /*global ender:false */ if (typeof ender !== 'undefined') { return; } oldGlobalMoment = globalScope.moment; if (shouldDeprecate) { globalScope.moment = deprecate( 'Accessing Moment through the global scope is ' + 'deprecated, and will be removed in an upcoming ' + 'release.', moment); } else { globalScope.moment = moment; } } // CommonJS module is defined if (hasModule) { module.exports = moment; } else if (typeof define === 'function' && define.amd) { define('moment', function (require, exports, module) { if (module.config && module.config() && module.config().noGlobal === true) { // release the global variable globalScope.moment = oldGlobalMoment; } return moment; }); makeGlobal(true); } else { makeGlobal(); } }).call(this); }).call(this,typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {}) },{}],5:[function(require,module,exports){ var EventEmitter = require('events').EventEmitter var inherits = require('inherits') var shimvis = true var change = null var hidden = null module.exports = Visibility if (typeof document.hidden !== 'undefined') { hidden = 'hidden' change = 'visibilitychange' } else if (typeof document.mozHidden !== 'undefined') { hidden = 'mozHidden' change = 'mozvisibilitychange' } else if (typeof document.webkitHidden !== 'undefined') { hidden = 'webkitHidden' change = 'webkitvisibilitychange' } else if (typeof document.webkitHidden !== 'undefined') { hidden = 'webkitHidden' change = 'webkitvisibilitychange' } inherits(Visibility, EventEmitter) function Visibility() { if (!(this instanceof Visibility)) return new Visibility var self = this EventEmitter.call(this) this.supported = !!hidden if (this.supported) { document.addEventListener(change, function() { var visible = !document[hidden] self.emit('change', visible) self.emit(visible ? 'show' : 'hide') }, false) } else { document.addEventListener('focusout', function() { self.emit('change', false) self.emit('hide') shimvis = false }, false) document.addEventListener('focusin', function() { self.emit('change', true) self.emit('show') shimvis = true }, false) } window.addEventListener('unload', function() { self.emit('exit') }, false) } Visibility.prototype.hidden = function() { return this.supported ? !!document[hidden] : !shimvis } Visibility.prototype.visible = function() { return this.supported ? !document[hidden] : shimvis } },{"events":1,"inherits":6}],6:[function(require,module,exports){ if (typeof Object.create === 'function') { // implementation from standard node.js 'util' module module.exports = function inherits(ctor, superCtor) { ctor.super_ = superCtor ctor.prototype = Object.create(superCtor.prototype, { constructor: { value: ctor, enumerable: false, writable: true, configurable: true } }); }; } else { // old school shim for old browsers module.exports = function inherits(ctor, superCtor) { ctor.super_ = superCtor var TempCtor = function () {} TempCtor.prototype = superCtor.prototype ctor.prototype = new TempCtor() ctor.prototype.constructor = ctor } } },{}],"base_object":[function(require,module,exports){ module.exports=require('2HNVgz'); },{}],"2HNVgz":[function(require,module,exports){ (function (global){ "use strict"; var _ = (typeof window !== "undefined" ? window._ : typeof global !== "undefined" ? global._ : null); var extend = require('./utils').extend; var Events = require('./events'); var pluginOptions = ['container']; var BaseObject = function BaseObject(options) { this.uniqueId = _.uniqueId('o'); options || (options = {}); _.extend(this, _.pick(options, pluginOptions)); if (this.initialize) { this.initialize.apply(this, arguments); } }; ($traceurRuntime.createClass)(BaseObject, {}, {}, Events); BaseObject.extend = extend; module.exports = BaseObject; }).call(this,typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {}) },{"./events":9,"./utils":18}],9:[function(require,module,exports){ (function (global){ "use strict"; var _ = (typeof window !== "undefined" ? window._ : typeof global !== "undefined" ? global._ : null); var Log = require('../plugins/log'); var slice = Array.prototype.slice; var Events = function Events() {}; ($traceurRuntime.createClass)(Events, { on: function(name, callback, context) { if (!eventsApi(this, 'on', name, [callback, context]) || !callback) return this; this._events || (this._events = {}); var events = this._events[name] || (this._events[name] = []); events.push({ callback: callback, context: context, ctx: context || this }); return this; }, once: function(name, callback, context) { if (!eventsApi(this, 'once', name, [callback, context]) || !callback) return this; var self = this; var once = _.once(function() { self.off(name, once); callback.apply(this, arguments); }); once._callback = callback; return this.on(name, once, context); }, off: function(name, callback, context) { var retain, ev, events, names, i, l, j, k; if (!this._events || !eventsApi(this, 'off', name, [callback, context])) return this; if (!name && !callback && !context) { this._events = void 0; return this; } names = name ? [name] : _.keys(this._events); for (i = 0, l = names.length; i < l; i++) { name = names[i]; events = this._events[name]; if (events) { this._events[name] = retain = []; if (callback || context) { for (j = 0, k = events.length; j < k; j++) { ev = events[j]; if ((callback && callback !== ev.callback && callback !== ev.callback._callback) || (context && context !== ev.context)) { retain.push(ev); } } } if (!retain.length) delete this._events[name]; } } return this; }, trigger: function(name) { var klass = arguments[arguments.length - 1]; if (global.DEBUG) { if (Log.BLACKLIST.indexOf(name) < 0) Log.info(klass, 'event ' + name + ' triggered'); } if (!this._events) return this; var args = slice.call(arguments, 1); if (!eventsApi(this, 'trigger', name, args)) return this; var events = this._events[name]; var allEvents = this._events.all; if (events) triggerEvents(events, args); if (allEvents) triggerEvents(allEvents, arguments); return this; }, stopListening: function(obj, name, callback) { var listeningTo = this._listeningTo; if (!listeningTo) return this; var remove = !name && !callback; if (!callback && typeof name === 'object') callback = this; if (obj) (listeningTo = {})[obj._listenId] = obj; for (var id in listeningTo) { obj = listeningTo[id]; obj.off(name, callback, this); if (remove || _.isEmpty(obj._events)) delete this._listeningTo[id]; } return this; } }, {}); var eventSplitter = /\s+/; var eventsApi = function(obj, action, name, rest) { if (!name) return true; if (typeof name === 'object') { for (var key in name) { obj[action].apply(obj, [key, name[key]].concat(rest)); } return false; } if (eventSplitter.test(name)) { var names = name.split(eventSplitter); for (var i = 0, l = names.length; i < l; i++) { obj[action].apply(obj, [names[i]].concat(rest)); } return false; } return true; }; var triggerEvents = function(events, args) { var ev, i = -1, l = events.length, a1 = args[0], a2 = args[1], a3 = args[2]; switch (args.length) { case 0: while (++i < l) (ev = events[i]).callback.call(ev.ctx); return; case 1: while (++i < l) (ev = events[i]).callback.call(ev.ctx, a1); return; case 2: while (++i < l) (ev = events[i]).callback.call(ev.ctx, a1, a2); return; case 3: while (++i < l) (ev = events[i]).callback.call(ev.ctx, a1, a2, a3); return; default: while (++i < l) (ev = events[i]).callback.apply(ev.ctx, args); return; } }; var listenMethods = { listenTo: 'on', listenToOnce: 'once' }; _.each(listenMethods, function(implementation, method) { Events.prototype[method] = function(obj, name, callback) { var listeningTo = this._listeningTo || (this._listeningTo = {}); var id = obj._listenId || (obj._listenId = _.uniqueId('l')); listeningTo[id] = obj; if (!callback && typeof name === 'object') callback = this; obj[implementation](name, callback, this); return this; }; }); module.exports = Events; }).call(this,typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {}) },{"../plugins/log":43}],10:[function(require,module,exports){ (function (global){ "use strict"; var _ = (typeof window !== "undefined" ? window._ : typeof global !== "undefined" ? global._ : null); module.exports = { 'media_control': _.template('<div class="media-control-layer" data-controls> <% var renderBar = function(name) { %> <div class="bar-container" data-<%= name %>> <div class="bar-background" data-<%= name %>> <div class="bar-fill-1" data-<%= name %>></div> <div class="bar-fill-2" data-<%= name %>></div> </div> <div class="bar-scrubber" data-<%= name %>> <div class="bar-scrubber-icon" data-<%= name %>></div> </div> </div> <% }; %> <% var renderDrawer = function(name, renderContent) { %> <div class="drawer-container" data-<%= name %>> <div class="drawer-icon-container" data-<%= name %>> <div class="drawer-icon media-control-icon" data-<%= name %>></div> <span class="drawer-text" data-<%= name %>></span> </div> <% renderContent(name); %> </div> <% }; %> <% var renderIndicator = function(name) { %> <div class="media-control-indicator" data-<%= name %>></div> <% }; %> <% var renderButton = function(name) { %> <button class="media-control-button media-control-icon" data-<%= name %>></button> <% }; %> <% var render = function(settings) { _.each(settings, function(setting) { if(setting === "seekbar") { renderBar(setting); } else if (setting === "volume") { renderDrawer(setting, renderBar); } else if (setting === "duration" || setting === "position") { renderIndicator(setting); } else { renderButton(setting); } }); }; %> <% if (settings.left && settings.left.length) { %> <div class="media-control-left-panel" data-media-control> <% render(settings.left); %> </div> <% } %> <% if (settings.right && settings.right.length) { %> <div class="media-control-right-panel" data-media-control> <% render(settings.right); %> </div> <% } %> <% if (settings.default && settings.default.length) { %> <div class="media-control-center-panel" data-media-control> <% render(settings.default); %> </div> <% } %></div>'), 'flash_vod': _.template(' <param name="movie" value="<%= swfPath %>"> <param name="quality" value="autohigh"> <param name="swliveconnect" value="true"> <param name="allowScriptAccess" value="always"> <param name="bgcolor" value="#001122"> <param name="allowFullScreen" value="false"> <param name="wmode" value="gpu"> <param name="tabindex" value="1"> <param name=FlashVars value="playbackId=<%= playbackId %>" /> <embed type="application/x-shockwave-flash" disabled="disabled" tabindex="-1" enablecontextmenu="false" allowScriptAccess="always" quality="autohight" pluginspage="http://www.macromedia.com/go/getflashplayer" wmode="gpu" swliveconnect="true" type="application/x-shockwave-flash" allowfullscreen="false" bgcolor="#000000" FlashVars="playbackId=<%= playbackId %>" src="<%= swfPath %>"> </embed>'), 'hls': _.template(' <param name="movie" value="<%= swfPath %>?inline=1"> <param name="quality" value="autohigh"> <param name="swliveconnect" value="true"> <param name="allowScriptAccess" value="always"> <param name="bgcolor" value="#001122"> <param name="allowFullScreen" value="false"> <param name="wmode" value="transparent"> <param name="tabindex" value="1"> <param name=FlashVars value="playbackId=<%= playbackId %>" /> <embed type="application/x-shockwave-flash" tabindex="1" enablecontextmenu="false" allowScriptAccess="always" quality="autohigh" pluginspage="http://www.macromedia.com/go/getflashplayer" wmode="transparent" swliveconnect="true" type="application/x-shockwave-flash" allowfullscreen="false" bgcolor="#000000" FlashVars="playbackId=<%= playbackId %>" src="<%= swfPath %>"> </embed>'), 'poster': _.template('<img class="poster-background" data-poster src="" /><div class="play-wrapper" data-poster> <span class="poster-icon play" data-poster /></div>'), 'spinner_loading': _.template('<div data-spinner-container class="spin-container1"> <div data-circle1></div> <div data-circle2></div> <div data-circle3></div> <div data-circle4></div></div><div data-spinner-container class="spin-container2"> <div data-circle1></div> <div data-circle2></div> <div data-circle3></div> <div data-circle4></div></div><div data-spinner-container class="spin-container3"> <div data-circle1></div> <div data-circle2></div> <div data-circle3></div> <div data-circle4></div></div>'), 'spinner_three_bounce': _.template('<div data-bounce1></div><div data-bounce2></div><div data-bounce3></div>'), 'watermark': _.template('<div data-watermark data-watermark-<%=position %>><img src="<%= imageUrl %>"></div>'), CSS: { 'container': '[data-container]{position:absolute;background-color:#000;height:100%;width:100%}', 'core': '[data-player] *{-webkit-touch-callout:none;-webkit-user-select:none;-khtml-user-select:none;-moz-user-select:none;-ms-user-select:none;-o-user-select:none;user-select:none;margin:0;padding:0;border:0;font-style:normal;font-weight:400;text-align:center;font-size:100%;color:#000;font-family:"lucida grande",tahoma,verdana,arial,sans-serif;text-shadow:0 0 0;box-sizing:border-box}[data-player] * a,[data-player] * abbr,[data-player] * acronym,[data-player] * address,[data-player] * applet,[data-player] * article,[data-player] * aside,[data-player] * audio,[data-player] * b,[data-player] * big,[data-player] * blockquote,[data-player] * canvas,[data-player] * caption,[data-player] * center,[data-player] * cite,[data-player] * code,[data-player] * dd,[data-player] * del,[data-player] * details,[data-player] * dfn,[data-player] * div,[data-player] * dl,[data-player] * dt,[data-player] * em,[data-player] * embed,[data-player] * fieldset,[data-player] * figcaption,[data-player] * figure,[data-player] * footer,[data-player] * form,[data-player] * h1,[data-player] * h2,[data-player] * h3,[data-player] * h4,[data-player] * h5,[data-player] * h6,[data-player] * header,[data-player] * hgroup,[data-player] * i,[data-player] * iframe,[data-player] * img,[data-player] * ins,[data-player] * kbd,[data-player] * label,[data-player] * legend,[data-player] * li,[data-player] * mark,[data-player] * menu,[data-player] * nav,[data-player] * object,[data-player] * ol,[data-player] * output,[data-player] * p,[data-player] * pre,[data-player] * q,[data-player] * ruby,[data-player] * s,[data-player] * samp,[data-player] * section,[data-player] * small,[data-player] * span,[data-player] * strike,[data-player] * strong,[data-player] * sub,[data-player] * summary,[data-player] * sup,[data-player] * table,[data-player] * tbody,[data-player] * td,[data-player] * tfoot,[data-player] * th,[data-player] * thead,[data-player] * time,[data-player] * tr,[data-player] * tt,[data-player] * u,[data-player] * ul,[data-player] * var,[data-player] * video{margin:0;padding:0;border:0;font:inherit;font-size:100%;vertical-align:baseline}[data-player] * table{border-collapse:collapse;border-spacing:0}[data-player] * caption,[data-player] * td,[data-player] * th{text-align:left;font-weight:400;vertical-align:middle}[data-player] * blockquote,[data-player] * q{quotes:none}[data-player] * blockquote:after,[data-player] * blockquote:before,[data-player] * q:after,[data-player] * q:before{content:"";content:none}[data-player] * a img{border:none}[data-player]{-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;-webkit-transform:translate3d(0,0,0);-moz-transform:translate3d(0,0,0);transform:translate3d(0,0,0);position:relative;margin:0;height:594px;width:1055px;text-align:center;overflow:hidden}[data-player].fullscreen{width:100%;height:100%}[data-player].nocursor{cursor:none}', 'media_control': '@font-face{font-family:Player;src:url(assets/Player-Regular.eot);src:url(assets/Player-Regular.eot?#iefix) format("embedded-opentype"),url(assets/Player-Regular.ttf) format("truetype"),url(assets/Player-Regular.svg#player) format("svg")}.media-control[data-media-control]{position:absolute;background-color:rgba(2,2,2,.5);border-radius:0;bottom:0;left:0;right:0;margin-left:auto;margin-right:auto;max-width:100%;min-width:60%;height:40px;z-index:9999;-webkit-transition:all .4s ease-out;-moz-transition:all .4s ease-out;-ms-transition:all .4s ease-out;-o-transition:all .4s ease-out;transition:all .4s ease-out}.media-control[data-media-control] .media-control-icon{font-family:Player;font-weight:400;font-style:normal;font-size:26px;line-height:32px;letter-spacing:0;speak:none;color:#fff;vertical-align:middle;text-align:left;padding:0 6px;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}.media-control[data-media-control].media-control-hide{bottom:-40px}.media-control[data-media-control].media-control-hide .media-control-layer[data-controls] .bar-container[data-seekbar] .bar-scrubber[data-seekbar]{opacity:0}.media-control[data-media-control] .media-control-layer[data-controls]{position:relative;top:10%;height:80%;vertical-align:middle}.media-control[data-media-control] .media-control-layer[data-controls] .media-control-left-panel[data-media-control]{position:absolute;top:0;left:5px;height:100%}.media-control[data-media-control] .media-control-layer[data-controls] .media-control-center-panel[data-media-control]{height:100%;text-align:center;line-height:32px}.media-control[data-media-control] .media-control-layer[data-controls] .media-control-right-panel[data-media-control]{position:absolute;top:0;right:5px;height:100%}.media-control[data-media-control] .media-control-layer[data-controls] button.media-control-button{background-color:transparent;border:0;margin:0 8px;cursor:pointer;display:inline-block}.media-control[data-media-control] .media-control-layer[data-controls] button.media-control-button:focus{outline:0}.media-control[data-media-control] .media-control-layer[data-controls] button.media-control-button[data-play]{float:left;width:32px;height:100%}.media-control[data-media-control] .media-control-layer[data-controls] button.media-control-button[data-play]:before{content:"\\e001"}.media-control[data-media-control] .media-control-layer[data-controls] button.media-control-button[data-pause]{float:left;width:32px;height:100%}.media-control[data-media-control] .media-control-layer[data-controls] button.media-control-button[data-pause]:before{content:"\\e002"}.media-control[data-media-control] .media-control-layer[data-controls] button.media-control-button[data-stop]{float:left;width:32px;height:100%}.media-control[data-media-control] .media-control-layer[data-controls] button.media-control-button[data-stop]:before{content:"\\e003"}.media-control[data-media-control] .media-control-layer[data-controls] button.media-control-button[data-fullscreen]{float:right;background-color:transparent;border:0;width:32px;height:100%}.media-control[data-media-control] .media-control-layer[data-controls] button.media-control-button[data-fullscreen]:before{content:"\\e006"}.media-control[data-media-control] .media-control-layer[data-controls] button.media-control-button[data-hd-indicator]{cursor:default;float:right;background-color:transparent;border:0;width:32px;height:100%;opacity:0}.media-control[data-media-control] .media-control-layer[data-controls] button.media-control-button[data-hd-indicator]:before{content:"\\e007"}.media-control[data-media-control] .media-control-layer[data-controls] button.media-control-button[data-hd-indicator].enabled{opacity:1}.media-control[data-media-control] .media-control-layer[data-controls] button.media-control-button[data-playpause]{float:left;width:32px;height:100%}.media-control[data-media-control] .media-control-layer[data-controls] button.media-control-button[data-playpause]:before{content:"\\e001"}.media-control[data-media-control] .media-control-layer[data-controls] button.media-control-button[data-playpause].playing:before{content:"\\e002"}.media-control[data-media-control] .media-control-layer[data-controls] button.media-control-button[data-playpause].paused:before{content:"\\e001"}.media-control[data-media-control] .media-control-layer[data-controls] button.media-control-button[data-playstop]{float:left;width:32px;height:100%}.media-control[data-media-control] .media-control-layer[data-controls] button.media-control-button[data-playstop]:before{content:"\\e001"}.media-control[data-media-control] .media-control-layer[data-controls] button.media-control-button[data-playstop].playing:before{content:"\\e003"}.media-control[data-media-control] .media-control-layer[data-controls] button.media-control-button[data-playstop].stopped:before{content:"\\e001"}.media-control[data-media-control] .media-control-layer[data-controls] .media-control-indicator[data-duration],.media-control[data-media-control] .media-control-layer[data-controls] .media-control-indicator[data-position]{display:inline-block;font-size:13px;color:#fff;cursor:default;line-height:32px;position:relative}.media-control[data-media-control] .media-control-layer[data-controls] .media-control-indicator[data-duration]:before{content:"/";margin-right:3px}.media-control[data-media-control] .media-control-layer[data-controls] .bar-container[data-seekbar]{position:absolute;top:-20px;left:0;display:inline-block;vertical-align:middle;width:100%;height:32px;cursor:pointer}.media-control[data-media-control] .media-control-layer[data-controls] .bar-container[data-seekbar] .bar-background[data-seekbar]{width:100%;height:8px;position:relative;top:12px;background-color:#6f6f6f;overflow:hidden}.media-control[data-media-control] .media-control-layer[data-controls] .bar-container[data-seekbar] .bar-background[data-seekbar] .bar-fill-1[data-seekbar]{position:absolute;top:0;left:0;width:0;height:100%;background-color:#bebebe;-webkit-transition:all .1s ease-out;-moz-transition:all .1s ease-out;-ms-transition:all .1s ease-out;-o-transition:all .1s ease-out;transition:all .1s ease-out}.media-control[data-media-control] .media-control-layer[data-controls] .bar-container[data-seekbar] .bar-background[data-seekbar] .bar-fill-2[data-seekbar]{position:absolute;top:0;left:0;width:0;height:100%;background-color:#fff;-webkit-transition:all .1s ease-out;-moz-transition:all .1s ease-out;-ms-transition:all .1s ease-out;-o-transition:all .1s ease-out;transition:all .1s ease-out}.media-control[data-media-control] .media-control-layer[data-controls] .bar-container[data-seekbar] .bar-scrubber[data-seekbar]{position:absolute;top:6px;left:0;width:20px;height:20px;opacity:1;-webkit-transition:all .1s ease-out;-moz-transition:all .1s ease-out;-ms-transition:all .1s ease-out;-o-transition:all .1s ease-out;transition:all .1s ease-out}.media-control[data-media-control] .media-control-layer[data-controls] .bar-container[data-seekbar] .bar-scrubber[data-seekbar] .bar-scrubber-icon[data-seekbar]{position:absolute;left:3px;top:3px;width:14px;height:14px;border-radius:6px;border:1px solid #6f6f6f;background-color:#fff}.media-control[data-media-control] .media-control-layer[data-controls] .drawer-container[data-volume]{float:right;display:inline-block;width:32px;height:32px;cursor:pointer}.media-control[data-media-control] .media-control-layer[data-controls] .drawer-container[data-volume] .drawer-icon-container[data-volume]{position:absolute;bottom:0}.media-control[data-media-control] .media-control-layer[data-controls] .drawer-container[data-volume] .drawer-icon-container[data-volume] .drawer-icon[data-volume]{background-color:transparent;border:0;width:32px;height:32px}.media-control[data-media-control] .media-control-layer[data-controls] .drawer-container[data-volume] .drawer-icon-container[data-volume] .drawer-icon[data-volume]:before{content:"\\e004"}.media-control[data-media-control] .media-control-layer[data-controls] .drawer-container[data-volume] .drawer-icon-container[data-volume] .drawer-icon[data-volume].muted:before{content:"\\e005"}.media-control[data-media-control] .media-control-layer[data-controls] .drawer-container[data-volume] .bar-container[data-volume]{width:32px;height:88px;position:absolute;bottom:40px;background:rgba(2,2,2,.5);border-radius:4px;-webkit-transition:all .2s ease-out;-moz-transition:all .2s ease-out;-ms-transition:all .2s ease-out;-o-transition:all .2s ease-out;transition:all .2s ease-out}.media-control[data-media-control] .media-control-layer[data-controls] .drawer-container[data-volume] .bar-container[data-volume].volume-bar-hide{opacity:0}.media-control[data-media-control] .media-control-layer[data-controls] .drawer-container[data-volume] .bar-container[data-volume] .bar-background[data-volume]{margin-left:12px;background:#6f6f6f;border-radius:4px;width:8px;height:72px;position:relative;top:8px;overflow:hidden}.media-control[data-media-control] .media-control-layer[data-controls] .drawer-container[data-volume] .bar-container[data-volume] .bar-background[data-volume] .bar-fill-1[data-volume]{position:absolute;bottom:0;background:#fff;width:100%;height:0}.media-control[data-media-control] .media-control-layer[data-controls] .drawer-container[data-volume] .bar-container[data-volume] .bar-scrubber[data-volume]{position:absolute;bottom:40%;left:6px;width:20px;height:20px}.media-control[data-media-control] .media-control-layer[data-controls] .drawer-container[data-volume] .bar-container[data-volume] .bar-scrubber[data-volume] .bar-scrubber-icon[data-volume]{position:absolute;left:4px;top:4px;width:12px;height:12px;border-radius:6px;border:1px solid #6f6f6f;background-color:#fff}', 'flash_vod': '[data-flash-vod]{position:absolute;height:100%;width:100%;background-color:#000;display:block;pointer-events:none}', 'hls': '[data-hls]{position:absolute;height:100%;width:100%;background-color:#000;display:block;pointer-events:none}', 'html5_video': '[data-html5-video]{position:absolute;height:100%;width:100%;display:block}', 'pip': '.pip-loading[data-pip]{left:25px;top:15px;position:relative;float:left;z-index:3001;color:#fff}.pip-transition[data-pip]{-webkit-transition:all .4s ease-out;-moz-transition:all .4s ease-out;-ms-transition:all .4s ease-out;-o-transition:all .4s ease-out;transition:all .4s ease-out}.master-container[data-pip]{cursor:default;width:100%;height:100%;font-size:100%;position:absolute;bottom:0;right:0;border:none}.pip-container[data-pip]{cursor:pointer;width:24%;height:24%;font-size:24%;z-index:2000;position:absolute;right:23px;bottom:23px;border-width:2px;border-radius:3px;border-style:solid;border-color:rgba(255,255,255,.25);background-clip:padding-box;-webkit-background-clip:padding-box}.pip-container[data-pip].over-media-control{bottom:63px}', 'poster': '@font-face{font-family:Player;src:url(assets/Player-Regular.eot);src:url(assets/Player-Regular.eot?#iefix) format("embedded-opentype"),url(assets/Player-Regular.ttf) format("truetype"),url(assets/Player-Regular.svg#player) format("svg")}.player-poster[data-poster]{cursor:pointer;position:absolute;height:100%;width:100%;z-index:998;top:0}.player-poster[data-poster] .poster-background[data-poster]{width:100%;height:100%}.player-poster[data-poster] .play-wrapper[data-poster]{position:absolute;overflow:hidden;width:100%;height:20%;line-height:100%;font-size:20%;top:50%;margin-top:-5%;text-align:center}.player-poster[data-poster] .play-wrapper[data-poster] .poster-icon[data-poster]{font-family:Player;font-weight:400;font-style:normal;line-height:1;letter-spacing:0;speak:none;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;color:#fff;opacity:.75}.player-poster[data-poster] .play-wrapper[data-poster] .poster-icon[data-poster].play[data-poster]:before{content:"\\e001"}.player-poster[data-poster] .play-wrapper[data-poster] .poster-icon[data-poster]:hover{opacity:1}', 'spinner_loading': 'div[data-spinner]{width:50px;height:50px;position:relative;margin-left:auto;margin-right:auto;right:0;left:0;z-index:999;top:45%}.spin-container1>div,.spin-container2>div,.spin-container3>div{width:13px;height:13px;background-color:#fff;border-radius:100%;position:absolute;-webkit-animation:bouncedelay 1.2s infinite ease-in-out;animation:bouncedelay 1.2s infinite ease-in-out;-webkit-animation-fill-mode:both;animation-fill-mode:both}[data-spinner] [data-spinner-container]{position:absolute;width:100%;height:100%}.spin-container2{-webkit-transform:rotateZ(45deg);transform:rotateZ(45deg)}.spin-container3{-webkit-transform:rotateZ(90deg);transform:rotateZ(90deg)}[data-circle1]{top:0;left:0}[data-circle2]{top:0;right:0}[data-circle3]{right:0;bottom:0}[data-circle4]{left:0;bottom:0}.spin-container2 [data-circle1]{-webkit-animation-delay:-1.1s;animation-delay:-1.1s}.spin-container3 [data-circle1]{-webkit-animation-delay:-1s;animation-delay:-1s}.spin-container1 [data-circle2]{-webkit-animation-delay:-.9s;animation-delay:-.9s}.spin-container2 [data-circle2]{-webkit-animation-delay:-.8s;animation-delay:-.8s}.spin-container3 [data-circle2]{-webkit-animation-delay:-.7s;animation-delay:-.7s}.spin-container1 [data-circle3]{-webkit-animation-delay:-.6s;animation-delay:-.6s}.spin-container2 [data-circle3]{-webkit-animation-delay:-.5s;animation-delay:-.5s}.spin-container3 [data-circle3]{-webkit-animation-delay:-.4s;animation-delay:-.4s}.spin-container1 [data-circle4]{-webkit-animation-delay:-.3s;animation-delay:-.3s}.spin-container2 [data-circle4]{-webkit-animation-delay:-.2s;animation-delay:-.2s}.spin-container3 [data-circle4]{-webkit-animation-delay:-.1s;animation-delay:-.1s}@-webkit-keyframes bouncedelay{0%,100%,80%{-webkit-transform:scale(0)}40%{-webkit-transform:scale(1)}}@keyframes bouncedelay{0%,100%,80%{transform:scale(0);-webkit-transform:scale(0)}40%{transform:scale(1);-webkit-transform:scale(1)}}', 'spinner_three_bounce': '.spinner-three-bounce[data-spinner]{position:absolute;margin:0 auto;width:70px;text-align:center;z-index:10;top:47%;left:0;right:0}.spinner-three-bounce[data-spinner]>div{width:18px;height:18px;background-color:#FFF;border-radius:100%;display:inline-block;-webkit-animation:bouncedelay 1.4s infinite ease-in-out;-moz-animation:bouncedelay 1.4s infinite ease-in-out;-o-animation:bouncedelay 1.4s infinite ease-in-out;animation:bouncedelay 1.4s infinite ease-in-out;-webkit-animation-fill-mode:both;-moz-animation-fill-mode:both;-o-animation-fill-mode:both;animation-fill-mode:both}.spinner-three-bounce[data-spinner] [data-bounce1]{-webkit-animation-delay:-.32s;animation-delay:-.32s}.spinner-three-bounce[data-spinner] [data-bounce2]{-webkit-animation-delay:-.16s;animation-delay:-.16s}@-webkit-keyframes bouncedelay{0%,100%,80%{-webkit-transform:scale(0);-moz-transform:scale(0);transform:scale(0)}40%{-webkit-transform:scale(1);-moz-transform:scale(1);transform:scale(1)}}@-moz-keyframes bouncedelay{0%,100%,80%{-webkit-transform:scale(0);-moz-transform:scale(0);transform:scale(0)}40%{-webkit-transform:scale(1);-moz-transform:scale(1);transform:scale(1)}}@-ms-keyframes bouncedelay{0%,100%,80%{-webkit-transform:scale(0);-moz-transform:scale(0);transform:scale(0)}40%{-webkit-transform:scale(1);-moz-transform:scale(1);transform:scale(1)}}@keyframes bouncedelay{0%,100%,80%{-webkit-transform:scale(0);-moz-transform:scale(0);transform:scale(0)}40%{-webkit-transform:scale(1);-moz-transform:scale(1);transform:scale(1)}}', 'watermark': '[data-watermark]{position:absolute;margin:100px auto 0;width:70px;text-align:center;z-index:10}[data-watermark-bottom-left]{bottom:10px;left:10px}[data-watermark-bottom-right]{bottom:10px;right:42px}[data-watermark-top-left]{top:-95px;left:10px}[data-watermark-top-right]{top:-95px;right:37px}' } }; }).call(this,typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {}) },{}],11:[function(require,module,exports){ "use strict"; var PluginMixin = require('./plugin_mixin'); var BaseObject = require('./base_object'); var Plugin = BaseObject.extend(PluginMixin).extend({}); module.exports = Plugin; },{"./base_object":"2HNVgz","./plugin_mixin":12}],12:[function(require,module,exports){ "use strict"; var PluginMixin = { initialize: function() { this.bindEvents(); }, enable: function() { this.bindEvents(); }, disable: function() { this.stopListening(); } }; module.exports = PluginMixin; },{}],13:[function(require,module,exports){ (function (global){ "use strict"; var $ = (typeof window !== "undefined" ? window.$ : typeof global !== "undefined" ? global.$ : null); var _ = (typeof window !== "undefined" ? window._ : typeof global !== "undefined" ? global._ : null); var JST = require('./jst'); var Styler = {getStyleFor: function(name, options) { options = options || {}; return $('<style></style>').html(_.template(JST.CSS[name])(options)); }}; module.exports = Styler; }).call(this,typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {}) },{"./jst":10}],"8lqCAT":[function(require,module,exports){ (function (global){ "use strict"; var $ = (typeof window !== "undefined" ? window.$ : typeof global !== "undefined" ? global.$ : null); var _ = (typeof window !== "undefined" ? window._ : typeof global !== "undefined" ? global._ : null); var extend = require('./utils').extend; var BaseObject = require('./base_object'); var delegateEventSplitter = /^(\S+)\s*(.*)$/; var viewOptions = ['container', 'el', 'id', 'attributes', 'className', 'tagName', 'events']; var UIObject = function UIObject(options) { this.cid = _.uniqueId('c'); this._ensureElement(); $traceurRuntime.superCall(this, $UIObject.prototype, "constructor", [options]); this.delegateEvents(); }; var $UIObject = UIObject; ($traceurRuntime.createClass)(UIObject, { get tagName() { return 'div'; }, $: function(selector) { return this.$el.find(selector); }, initialize: function() {}, render: function() { return this; }, remove: function() { this.$el.remove(); this.stopListening(); return this; }, setElement: function(element, delegate) { if (this.$el) this.undelegateEvents(); this.$el = element instanceof $ ? element : $(element); this.el = this.$el[0]; if (delegate !== false) this.delegateEvents(); return this; }, delegateEvents: function(events) { if (!(events || (events = _.result(this, 'events')))) return this; this.undelegateEvents(); for (var key in events) { var method = events[key]; if (!_.isFunction(method)) method = this[events[key]]; if (!method) continue; var match = key.match(delegateEventSplitter); var eventName = match[1], selector = match[2]; method = _.bind(method, this); eventName += '.delegateEvents' + this.cid; if (selector === '') { this.$el.on(eventName, method); } else { this.$el.on(eventName, selector, method); } } return this; }, undelegateEvents: function() { this.$el.off('.delegateEvents' + this.cid); return this; }, _ensureElement: function() { if (!this.el) { var attrs = _.extend({}, _.result(this, 'attributes')); if (this.id) attrs.id = _.result(this, 'id'); if (this.className) attrs['class'] = _.result(this, 'className'); var $el = $('<' + _.result(this, 'tagName') + '>').attr(attrs); this.setElement($el, false); } else { this.setElement(_.result(this, 'el'), false); } } }, {}, BaseObject); UIObject.extend = extend; module.exports = UIObject; }).call(this,typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {}) },{"./base_object":"2HNVgz","./utils":18}],"ui_object":[function(require,module,exports){ module.exports=require('8lqCAT'); },{}],"Z7u8cr":[function(require,module,exports){ (function (global){ "use strict"; var PluginMixin = require('./plugin_mixin'); var UIObject = require('./ui_object'); var extend = require('./utils').extend; var _ = (typeof window !== "undefined" ? window._ : typeof global !== "undefined" ? global._ : null); var UIPlugin = function UIPlugin() { $traceurRuntime.defaultSuperCall(this, $UIPlugin.prototype, arguments); }; var $UIPlugin = UIPlugin; ($traceurRuntime.createClass)(UIPlugin, { get type() { return 'ui'; }, enable: function() { $UIPlugin.super('enable').call(this); this.$el.show(); }, disable: function() { $UIPlugin.super('disable').call(this); this.$el.hide(); }, bindEvents: function() {} }, {}, UIObject); _.extend(UIPlugin.prototype, PluginMixin); UIPlugin.extend = extend; module.exports = UIPlugin; }).call(this,typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {}) },{"./plugin_mixin":12,"./ui_object":"8lqCAT","./utils":18}],"ui_plugin":[function(require,module,exports){ module.exports=require('Z7u8cr'); },{}],18:[function(require,module,exports){ (function (global){ "use strict"; var _ = (typeof window !== "undefined" ? window._ : typeof global !== "undefined" ? global._ : null); var Moment = require('moment'); var extend = function(protoProps, staticProps) { var parent = this; var child; if (protoProps && _.has(protoProps, 'constructor')) { child = protoProps.constructor; } else { child = function() { return parent.apply(this, arguments); }; } _.extend(child, parent, staticProps); var Surrogate = function() { this.constructor = child; }; Surrogate.prototype = parent.prototype; child.prototype = new Surrogate(); if (protoProps) _.extend(child.prototype, protoProps); child.__super__ = parent.prototype; child.super = function(name) { return parent.prototype[name]; }; child.prototype.getClass = function() { return child; }; return child; }; var zeroPad = function(number, size) { return (new Array(size + 1 - number.toString().length)).join('0') + number; }; var formatTime = function(time, showMillis) { var duration = Moment.duration(time * 1000); var str = zeroPad(duration.seconds(), 2); if (duration.hours()) { str = zeroPad(duration.minutes(), 2) + ':' + str; str = duration.hours() + ':' + str; } else { str = duration.minutes() + ':' + str; } if (showMillis) str += '.' + duration.milliseconds(); return str; }; var Fullscreen = { isFullscreen: function() { return document.webkitIsFullScreen || document.mozFullScreen; }, requestFullscreen: function(el) { if (el.requestFullscreen) { el.requestFullscreen(); } else if (el.webkitRequestFullscreen) { el.webkitRequestFullscreen(); } else if (el.mozRequestFullScreen) { el.mozRequestFullScreen(); } else if (el.msRequestFullscreen) { el.msRequestFullscreen(); } }, cancelFullscreen: function() { if (document.exitFullscreen) { document.exitFullscreen(); } else if (document.webkitCancelFullScreen) { document.webkitCancelFullScreen(); } else if (document.mozCancelFullScreen) { document.mozCancelFullScreen(); } else if (document.msExitFullscreen) { document.msExitFullscreen(); } } }; module.exports = { extend: extend, zeroPad: zeroPad, formatTime: formatTime, Fullscreen: Fullscreen }; }).call(this,typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {}) },{"moment":4}],19:[function(require,module,exports){ (function (global){ "use strict"; var UIObject = require('../../base/ui_object'); var Styler = require('../../base/styler'); var _ = (typeof window !== "undefined" ? window._ : typeof global !== "undefined" ? global._ : null); var Container = function Container() { $traceurRuntime.defaultSuperCall(this, $Container.prototype, arguments); }; var $Container = Container; ($traceurRuntime.createClass)(Container, { get name() { return 'Container'; }, get attributes() { return {'data-container': ''}; }, get events() { return {'click': 'clicked'}; }, initialize: function(options) { this.playback = options.playback; this.settings = this.playback.settings; this.listenTo(this.playback, 'playback:progress', this.progress); this.listenTo(this.playback, 'playback:timeupdate', this.timeUpdated); this.listenTo(this.playback, 'playback:ready', this.ready); this.listenTo(this.playback, 'playback:buffering', this.buffering); this.listenTo(this.playback, 'playback:bufferfull', this.bufferfull); this.listenTo(this.playback, 'playback:settingsupdate', this.settingsUpdate); this.listenTo(this.playback, 'playback:loadedmetadata', this.loadedMetadata); this.listenTo(this.playback, 'playback:highdefinitionupdate', this.highDefinitionUpdate); this.listenTo(this.playback, 'playback:mediacontrol:disable', this.disableMediaControl); this.listenTo(this.playback, 'playback:mediacontrol:enable', this.enableMediaControl); this.listenTo(this.playback, 'playback:ended', this.ended); this.listenTo(this.playback, 'playback:play', this.playing); this.isReady = false; this.mediaControlDisabled = false; this.plugins = [this.playback]; }, with: function(klass) { _.extend(this, klass); return this; }, destroy: function() { this.trigger('container:destroyed', this, this.name); this.playback.destroy(); this.$el.remove(); }, setStyle: function(style) { this.$el.css(style); }, animate: function(style, duration) { return this.$el.animate(style, duration).promise(); }, ready: function() { this.isReady = true; this.trigger('container:ready', this.name); }, isPlaying: function() { return this.playback.isPlaying(); }, error: function(errorObj) { this.trigger('container:error', errorObj, this.name); }, loadedMetadata: function(duration) { this.trigger('container:loadedmetadata', duration); }, timeUpdated: function(position, duration) { this.trigger('container:timeupdate', position, duration, this.name); }, progress: function(startPosition, endPosition, duration) { this.trigger('container:progress', startPosition, endPosition, duration, this.name); }, playing: function() { this.trigger('container:play', this.name); }, play: function() { this.playback.play(); }, stop: function() { this.trigger('container:stop', this.name); this.playback.stop(); }, pause: function() { this.trigger('container:pause', this.name); this.playback.pause(); }, ended: function() { this.trigger('container:ended', this, this.name); }, clicked: function() { this.trigger('container:click', this, this.name); }, setCurrentTime: function(time) { this.trigger('container:seek', time, this.name); this.playback.seek(time); }, setVolume: function(value) { this.trigger('container:volume', value, this.name); this.playback.volume(value); }, requestFullscreen: function() { this.trigger('container:fullscreen', this.name); }, buffering: function() { this.trigger('container:state:buffering', this.name); }, bufferfull: function() { this.trigger('container:state:bufferfull', this.name); }, addPlugin: function(plugin) { this.plugins.push(plugin); }, hasPlugin: function(name) { return !!this.getPlugin(name); }, getPlugin: function(name) { return _(this.plugins).find(function(plugin) { return plugin.name === name; }); }, settingsUpdate: function() { this.settings = this.playback.settings; this.trigger('container:settingsupdate'); }, highDefinitionUpdate: function() { this.trigger('container:highdefinitionupdate'); }, isHighDefinitionInUse: function() { return this.playback.isHighDefinition(); }, disableMediaControl: function() { this.mediaControlDisabled = true; this.trigger('container:mediacontrol:disable'); }, enableMediaControl: function() { this.mediaControlDisabled = false; this.trigger('container:mediacontrol:enable'); }, render: function() { var style = Styler.getStyleFor('container'); this.$el.append(style); this.$el.append(this.playback.render().el); return this; } }, {}, UIObject); ; module.exports = Container; }).call(this,typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {}) },{"../../base/styler":13,"../../base/ui_object":"8lqCAT"}],20:[function(require,module,exports){ "use strict"; module.exports = require('./container'); },{"./container":19}],21:[function(require,module,exports){ (function (global){ "use strict"; var _ = (typeof window !== "undefined" ? window._ : typeof global !== "undefined" ? global._ : null); var BaseObject = require('../../base/base_object'); var Container = require('../container'); var $ = (typeof window !== "undefined" ? window.$ : typeof global !== "undefined" ? global.$ : null); var ContainerFactory = function ContainerFactory() { $traceurRuntime.defaultSuperCall(this, $ContainerFactory.prototype, arguments); }; var $ContainerFactory = ContainerFactory; ($traceurRuntime.createClass)(ContainerFactory, { initialize: function(params, loader) { this.params = params; this.loader = loader; }, createContainers: function() { return $.Deferred(function(promise) { promise.resolve(_.map(this.params.sources, function(source) { return this.createContainer(source); }, this)); }.bind(this)); }, findPlaybackPlugin: function(source) { return _.find(this.loader.playbackPlugins, (function(p) { return p.canPlay("" + source); }), this); }, createContainer: function(source) { var playbackPlugin = this.findPlaybackPlugin(source); var params = _.extend({}, this.params, { src: source, autoPlay: !!this.params.autoPlay }); var playback = new playbackPlugin(params); var container = new Container({playback: playback}); var defer = $.Deferred(); defer.promise(container); this.addContainerPlugins(container, source); this.listenToOnce(container, 'container:ready', (function() { return defer.resolve(container); })); return container; }, addContainerPlugins: function(container, source) { _.each(this.loader.containerPlugins, function(plugin) { var params = _.extend(this.params, { container: container, src: source }); container.addPlugin(new plugin(params)); }, this); } }, {}, BaseObject); ; module.exports = ContainerFactory; }).call(this,typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {}) },{"../../base/base_object":"2HNVgz","../container":20}],22:[function(require,module,exports){ "use strict"; module.exports = require('./container_factory'); },{"./container_factory":21}],23:[function(require,module,exports){ (function (global){ "use strict"; var _ = (typeof window !== "undefined" ? window._ : typeof global !== "undefined" ? global._ : null); var $ = (typeof window !== "undefined" ? window.$ : typeof global !== "undefined" ? global.$ : null); var UIObject = require('../../base/ui_object'); var ContainerFactory = require('../container_factory'); var Fullscreen = require('../../base/utils').Fullscreen; var Loader = require('../loader'); var Styler = require('../../base/styler'); var MediaControl = require('../media_control'); var Core = function Core() { $traceurRuntime.defaultSuperCall(this, $Core.prototype, arguments); }; var $Core = Core; ($traceurRuntime.createClass)(Core, { get events() { return { 'webkitfullscreenchange': 'exit', 'mousemove': 'showMediaControl', 'mouseleave': 'hideMediaControl' }; }, get attributes() { return {'data-player': ''}; }, initialize: function(params) { var $__0 = this; this.defer = $.Deferred(); this.defer.promise(this); this.plugins = []; this.containers = []; this.params = params; this.params.displayType || (this.params.displayType = 'pip'); this.parentElement = params.parentElement; this.loader = new Loader(params); this.containerFactory = new ContainerFactory(params, this.loader); this.containerFactory.createContainers().then((function(containers) { return $__0.setupContainers(containers); })).then((function(containers) { return $__0.resolveOnContainersReady(containers); })); this.updateSize(); document.addEventListener('mozfullscreenchange', (function() { return $__0.exit(); })); $(window).resize((function() { return $__0.updateSize(); })); }, updateSize: function() { if (Fullscreen.isFullscreen()) { this.$el.addClass('fullscreen'); this.$el.removeAttr('style'); } else { var width = 0; var height = 0; if (this.params.stretchWidth && this.params.stretchHeight && this.params.stretchWidth <= window.innerWidth && this.params.stretchHeight <= (window.innerHeight * 0.73)) { width = this.params.stretchWidth; height = this.params.stretchHeight; } else { width = this.params.width || width; height = this.params.height || height; } if (width > 0) { this.$el.css({width: width}); } if (height > 0) { this.$el.css({height: height}); } this.$el.removeClass('fullscreen'); } }, resolveOnContainersReady: function(containers) { var $__0 = this; $.when.apply($, containers).done((function() { return $__0.defer.resolve($__0); })); }, addPlugin: function(plugin) { this.plugins.push(plugin); }, hasPlugin: function(name) { return !!this.getPlugin(name); }, getPlugin: function(name) { return _(this.plugins).find((function(plugin) { return plugin.name === name; })); }, load: function(sources) { var $__0 = this; sources = _.isString(sources) ? [sources] : sources; _(this.containers).each((function(container) { return container.destroy(); })); this.containerFactory.params = _(this.params).extend({sources: sources}); this.containerFactory.createContainers().then((function(containers) { return $__0.setupContainers(containers); })); }, destroy: function() { _(this.containers).each((function(container) { return container.destroy(); })); this.$el.remove(); }, exit: function() { this.updateSize(); this.mediaControl.show(); }, setMediaControlContainer: function(container) { this.mediaControl.setContainer(container); this.mediaControl.render(); }, disableMediaControl: function() { this.mediaControl.disable(); this.$el.removeClass('nocursor'); }, enableMediaControl: function() { this.mediaControl.enable(); }, removeContainer: function(container) { console.log('container being removed'); this.stopListening(container); this.containers = _.without(this.containers, container); }, appendContainer: function(container) { this.listenTo(container, 'container:destroyed', this.removeContainer); this.el.appendChild(container.render().el); this.containers.push(container); }, prependContainer: function(container) { this.listenTo(container, 'container:destroyed', this.removeContainer); this.$el.append(container.render().el); this.containers.unshift(container); }, setupContainers: function(containers) { _.map(containers, this.appendContainer, this); this.setupMediaControl(this.getCurrentContainer()); this.render(); this.$el.appendTo(this.parentElement); return containers; }, createContainer: function(source) { var container = this.containerFactory.createContainer(source); this.appendContainer(container); return container; }, setupMediaControl: function(container) { var params = _.extend({container: container}, this.params); if (this.mediaControl) { this.mediaControl.setContainer(container); } else { this.mediaControl = new MediaControl(_.extend({container: container}, this.params)); this.listenTo(this.mediaControl, 'mediacontrol:fullscreen', this.toggleFullscreen); this.listenTo(this.mediaControl, 'mediacontrol:show', this.onMediaControlShow.bind(this, true)); this.listenTo(this.mediaControl, 'mediacontrol:hide', this.onMediaControlShow.bind(this, false)); } }, getCurrentContainer: function() { return this.containers[0]; }, toggleFullscreen: function() { if (!Fullscreen.isFullscreen()) { Fullscreen.requestFullscreen(this.el); this.$el.addClass('fullscreen'); } else { Fullscreen.cancelFullscreen(); this.$el.removeClass('fullscreen nocursor'); } this.mediaControl.show(); }, showMediaControl: function(event) { this.mediaControl.show(event); }, hideMediaControl: function(event) { this.mediaControl.hide(event); }, onMediaControlShow: function(showing) { if (showing) this.$el.removeClass('nocursor'); else if (Fullscreen.isFullscreen()) this.$el.addClass('nocursor'); }, render: function() { var $__0 = this; var style = Styler.getStyleFor('core'); this.$el.append(style); this.$el.append(this.mediaControl.render().el); this.$el.ready((function() { $__0.params.width = $__0.params.width || $__0.$el.width(); $__0.params.height = $__0.params.height || $__0.$el.height(); $__0.updateSize(); })); return this; } }, {}, UIObject); module.exports = Core; }).call(this,typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {}) },{"../../base/styler":13,"../../base/ui_object":"8lqCAT","../../base/utils":18,"../container_factory":22,"../loader":27,"../media_control":29}],24:[function(require,module,exports){ "use strict"; module.exports = require('./core'); },{"./core":23}],25:[function(require,module,exports){ (function (global){ "use strict"; var _ = (typeof window !== "undefined" ? window._ : typeof global !== "undefined" ? global._ : null); var BaseObject = require('../../base/base_object'); var Core = require('../core'); var CoreFactory = BaseObject.extend({ initialize: function(player, loader) { this.player = player; this.params = player.params; this.loader = loader; }, create: function() { this.core = new Core(this.params); this.core.then(this.addCorePlugins.bind(this)); return this.core; }, addCorePlugins: function() { _.each(this.loader.globalPlugins, function(Plugin) { var plugin = new Plugin(this.core); this.core.addPlugin(plugin); this.setupExternalInterface(plugin); }, this); return this.core; }, setupExternalInterface: function(plugin) { _.each(plugin.getExternalInterface(), function(value, key) { this.player[key] = value.bind(plugin); }, this); } }); module.exports = CoreFactory; }).call(this,typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {}) },{"../../base/base_object":"2HNVgz","../core":24}],26:[function(require,module,exports){ "use strict"; module.exports = require('./core_factory'); },{"./core_factory":25}],27:[function(require,module,exports){ "use strict"; module.exports = require('./loader'); },{"./loader":28}],28:[function(require,module,exports){ (function (global){ "use strict"; var BaseObject = require('../../base/base_object'); var _ = (typeof window !== "undefined" ? window._ : typeof global !== "undefined" ? global._ : null); var HTML5VideoPlaybackPlugin = require('../../playbacks/html5_video'); var FlashVideoPlaybackPlugin = require('../../playbacks/flash_vod'); var HTML5AudioPlaybackPlugin = require('../../playbacks/html5_audio'); var HLSVideoPlaybackPlugin = require('../../playbacks/hls'); var SpinnerThreeBouncePlugin = require('../../plugins/spinner_three_bounce'); var StatsPlugin = require('../../plugins/stats'); var WaterMarkPlugin = require('../../plugins/watermark'); var PosterPlugin = require('../../plugins/poster'); var PipPlugin = require('../../plugins/pip'); var Sequence = require('../../plugins/sequence'); var Loader = BaseObject.extend({ displayPlugins: { 'sequence': Sequence, 'pip': PipPlugin }, initialize: function(params) { this.params = params; this.playbackPlugins = [FlashVideoPlaybackPlugin, HTML5VideoPlaybackPlugin, HTML5AudioPlaybackPlugin, HLSVideoPlaybackPlugin]; this.containerPlugins = [SpinnerThreeBouncePlugin, WaterMarkPlugin, PosterPlugin, StatsPlugin]; this.globalPlugins = [this.displayPlugins[this.params.displayType]]; this.addExternalPlugins(params.plugins || []); }, addExternalPlugins: function(plugins) { if (plugins.playback) { this.playbackPlugins = plugins.playback.concat(this.playbackPlugins); } if (plugins.container) { this.containerPlugins = plugins.container.concat(this.containerPlugins); } if (plugins.core) { this.globalPlugins = plugins.core.concat(this.globalPlugins); } }, getPlugin: function(name) { return _.find(_.union(this.containerPlugins, this.playbackPlugins, this.globalPlugins), function(plugin) { return plugin.prototype.name === name; }); } }); module.exports = Loader; }).call(this,typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {}) },{"../../base/base_object":"2HNVgz","../../playbacks/flash_vod":34,"../../playbacks/hls":36,"../../playbacks/html5_audio":38,"../../playbacks/html5_video":40,"../../plugins/pip":45,"../../plugins/poster":47,"../../plugins/sequence":49,"../../plugins/spinner_three_bounce":52,"../../plugins/stats":54,"../../plugins/watermark":57}],29:[function(require,module,exports){ "use strict"; module.exports = require('./media_control'); },{"./media_control":30}],30:[function(require,module,exports){ (function (global){ "use strict"; var _ = (typeof window !== "undefined" ? window._ : typeof global !== "undefined" ? global._ : null); var $ = (typeof window !== "undefined" ? window.$ : typeof global !== "undefined" ? global.$ : null); var JST = require('../../base/jst'); var Styler = require('../../base/styler'); var UIObject = require('../../base/ui_object'); var Utils = require('../../base/utils'); var MediaControl = function MediaControl() { $traceurRuntime.defaultSuperCall(this, $MediaControl.prototype, arguments); }; var $MediaControl = MediaControl; ($traceurRuntime.createClass)(MediaControl, { get name() { return 'MediaControl'; }, get attributes() { return { class: 'media-control', 'data-media-control': '' }; }, get events() { return { 'click [data-play]': 'play', 'click [data-pause]': 'pause', 'click [data-playpause]': 'togglePlayPause', 'click [data-stop]': 'stop', 'click [data-playstop]': 'togglePlayStop', 'click [data-fullscreen]': 'toggleFullscreen', 'click [data-seekbar]': 'seek', 'click .bar-background[data-volume]': 'volume', 'click .drawer-icon[data-volume]': 'toggleMute', 'mouseover .drawer-container[data-volume]': 'showVolumeBar', 'mouseleave .drawer-container[data-volume]': 'hideVolumeBar', 'mousedown .bar-scrubber[data-seekbar]': 'startSeekDrag', 'mousedown .bar-scrubber[data-volume]': 'startVolumeDrag', 'mouseenter .media-control-layer[data-controls]': 'setKeepVisible', 'mouseleave .media-control-layer[data-controls]': 'resetKeepVisible' }; }, get template() { return JST.media_control; }, initialize: function(params) { var $__0 = this; this.params = params; this.container = params.container; this.keepVisible = false; this.addEventListeners(); this.defaultSettings = { left: ['play', 'stop', 'pause'], right: ['volume'], default: ['position', 'seekbar', 'duration'] }; this.disabled = false; if (this.container.mediaControlDisabled || this.params.chromeless) this.disable(); this.currentVolume = 100; $(document).bind('mouseup', (function(event) { return $__0.stopDrag(event); })); $(document).bind('mousemove', (function(event) { return $__0.updateDrag(event); })); }, addEventListeners: function() { this.listenTo(this.container, 'container:play', this.changeTogglePlay); this.listenTo(this.container, 'container:playing', this.changeTogglePlay); this.listenTo(this.container, 'container:timeupdate', this.updateSeekBar); this.listenTo(this.container, 'container:progress', this.updateProgressBar); this.listenTo(this.container, 'container:settingsupdate', this.settingsUpdate); this.listenTo(this.container, 'container:highdefinitionupdate', this.highDefinitionUpdate); this.listenTo(this.container, 'container:mediacontrol:disable', this.disable); this.listenTo(this.container, 'container:mediacontrol:enable', this.enable); this.listenTo(this.container, 'container:ended', this.ended); }, disable: function() { this.disabled = true; this.hide(); this.$el.hide(); }, enable: function() { if (this.params.chromeless) return; this.disabled = false; this.show(); }, play: function() { this.container.play(); }, pause: function() { this.container.pause(); }, stop: function() { this.container.stop(); }, changeTogglePlay: function() { if (this.container.isPlaying()) { this.$playPauseToggle.removeClass('paused').addClass('playing'); this.$playStopToggle.removeClass('stopped').addClass('playing'); } else { this.$playPauseToggle.removeClass('playing').addClass('paused'); this.$playStopToggle.removeClass('playing').addClass('stopped'); } }, onKeyDown: function(event) { if (event.keyCode === 32) this.togglePlayPause(); }, togglePlayPause: function() { if (this.container.isPlaying()) { this.container.pause(); } else { this.container.play(); } this.changeTogglePlay(); }, togglePlayStop: function() { if (this.container.isPlaying()) { this.container.stop(); } else { this.container.play(); } this.changeTogglePlay(); }, startSeekDrag: function(event) { this.draggingSeekBar = true; if (event) { event.preventDefault(); } }, startVolumeDrag: function(event) { this.draggingVolumeBar = true; if (event) { event.preventDefault(); } }, stopDrag: function(event) { if (this.draggingSeekBar) { this.seek(event); } this.draggingSeekBar = false; this.draggingVolumeBar = false; }, updateDrag: function(event) { if (event) { event.preventDefault(); } if (this.draggingSeekBar) { var offsetX = event.pageX - this.$seekBarContainer.offset().left; var pos = offsetX / this.$seekBarContainer.width() * 100; pos = Math.min(100, Math.max(pos, 0)); this.setSeekPercentage(pos); } else if (this.draggingVolumeBar) { this.volume(event); } }, volume: function(event) { var offsetY = event.pageY - this.$volumeBarContainer.offset().top; this.currentVolume = (1 - (offsetY / this.$volumeBarContainer.height())) * 100; this.currentVolume = Math.min(100, Math.max(this.currentVolume, 0)); this.container.setVolume(this.currentVolume); this.setVolumeLevel(this.currentVolume); }, toggleMute: function() { if (!!this.mute) { this.container.setVolume(this.currentVolume); this.setVolumeLevel(this.currentVolume); this.mute = false; } else { this.container.setVolume(0); this.setVolumeLevel(0); this.mute = true; } }, toggleFullscreen: function() { this.trigger('mediacontrol:fullscreen', this.name); }, setContainer: function(container) { this.stopListening(this.container); this.container = container; this.changeTogglePlay(); this.addEventListeners(); this.settingsUpdate(); this.container.setVolume(this.currentVolume); if (this.container.mediaControlDisabled) this.disable(); }, showVolumeBar: function() { if (this.hideVolumeId) { clearTimeout(this.hideVolumeId); } this.$volumeBarContainer.show(); this.$volumeBarContainer.removeClass('volume-bar-hide'); }, hideVolumeBar: function() { var $__0 = this; if (!this.$volumeBarContainer) return; if (this.hideVolumeId) { clearTimeout(this.hideVolumeId); } this.hideVolumeId = setTimeout((function() { $__0.$volumeBarContainer.one('webkitTransitionEnd otransitionend oTransitionEnd msTransitionEnd transitionend', (function() { $__0.$volumeBarContainer.off('webkitTransitionEnd otransitionend oTransitionEnd msTransitionEnd transitionend'); $__0.$volumeBarContainer.hide(); })); $__0.$volumeBarContainer.addClass('volume-bar-hide'); }), 750); }, ended: function() { this.changeTogglePlay(); }, updateProgressBar: function(startPosition, endPosition, duration) { var loadedStart = startPosition / duration * 100; var loadedEnd = endPosition / duration * 100; this.$seekBarLoaded.css({ left: loadedStart + '%', width: (loadedEnd - loadedStart) + '%' }); }, updateSeekBar: function(position, duration) { if (this.draggingSeekBar) return; var seekbarValue = (100 / duration) * position; this.setSeekPercentage(seekbarValue); this.$('[data-position]').html(Utils.formatTime(position)); this.$('[data-duration]').html(Utils.formatTime(duration)); }, seek: function(event) { var offsetX = event.pageX - this.$seekBarContainer.offset().left; var pos = offsetX / this.$seekBarContainer.width() * 100; pos = Math.min(100, Math.max(pos, 0)); this.container.setCurrentTime(pos); }, setKeepVisible: function() { this.keepVisible = true; }, resetKeepVisible: function() { this.keepVisible = false; }, show: function(event) { var $__0 = this; if (this.disabled) return; var timeout = 2000; if (!event || (event.clientX !== this.lastMouseX && event.clientY !== this.lastMouseY) || navigator.userAgent.match(/firefox/i)) { if (this.hideId) { clearTimeout(this.hideId); } this.$el.show(); this.trigger('mediacontrol:show', this.name); this.$el.removeClass('media-control-hide'); this.hideId = setTimeout((function() { return $__0.hide(); }), timeout); if (event) { this.lastMouseX = event.clientX; this.lastMouseY = event.clientY; } } }, hide: function() { var $__0 = this; var timeout = 2000; if (this.hideId) { clearTimeout(this.hideId); } if (this.keepVisible || this.draggingVolumeBar || this.draggingSeekBar) { this.hideId = setTimeout((function() { return $__0.hide(); }), timeout); } else { if (this.$volumeBarContainer) { this.$volumeBarContainer.hide(); } this.trigger('mediacontrol:hide', this.name); this.$el.addClass('media-control-hide'); } }, settingsUpdate: function() { this.render(); }, highDefinitionUpdate: function() { var $element = this.$el.find('button[data-hd]'); $element.removeClass('enabled'); if (this.container.isHighDefinitionInUse()) { $element.addClass('enabled'); } }, createCachedElements: function() { this.$playPauseToggle = this.$el.find('button.media-control-button[data-playpause]'); this.$playStopToggle = this.$el.find('button.media-control-button[data-playstop]'); this.$seekBarContainer = this.$el.find('.bar-container[data-seekbar]'); this.$seekBarLoaded = this.$el.find('.bar-fill-1[data-seekbar]'); this.$seekBarPosition = this.$el.find('.bar-fill-2[data-seekbar]'); this.$seekBarScrubber = this.$el.find('.bar-scrubber[data-seekbar]'); this.$volumeBarContainer = this.$el.find('.bar-container[data-volume]'); this.$volumeBarBackground = this.$el.find('.bar-background[data-volume]'); this.$volumeBarFill = this.$el.find('.bar-fill-1[data-volume]'); this.$volumeBarScrubber = this.$el.find('.bar-scrubber[data-volume]'); this.$volumeIcon = this.$el.find('.drawer-icon[data-volume]'); }, setVolumeLevel: function(value) { var containerHeight = this.$volumeBarContainer.height(); var barHeight = this.$volumeBarBackground.height(); var offset = (containerHeight - barHeight) / 2.0; var pos = barHeight * value / 100.0 - this.$volumeBarScrubber.height() / 2.0 + offset; this.$volumeBarFill.css({height: value + '%'}); this.$volumeBarScrubber.css({bottom: pos}); if (value > 0) { this.$volumeIcon.removeClass('muted'); } else { this.$volumeIcon.addClass('muted'); } }, setSeekPercentage: function(value) { var pos = this.$seekBarContainer.width() * value / 100.0 - this.$seekBarScrubber.width() / 2.0; this.$seekBarPosition.css({width: value + '%'}); this.$seekBarScrubber.css({left: pos}); }, bindKeyEvents: function() { var $__0 = this; if (this.keydownHandlerFn) { $(document).unbind('keydown', this.keydownHandlerFn); } else { this.keydownHandlerFn = (function(event) { return $__0.onKeyDown(event); }); } if (this.$playPauseToggle.length > 0) { $(document).bind('keydown', this.keydownHandlerFn); } }, render: function() { var $__0 = this; var timeout = 1000; var style = Styler.getStyleFor('media_control'); var settings = _.isEmpty(this.container.settings) ? this.defaultSettings : this.container.settings; this.$el.html(this.template({settings: settings})); this.$el.append(style); this.createCachedElements(); this.$playPauseToggle.addClass('paused'); this.$playStopToggle.addClass('stopped'); this.currentVolume = this.currentVolume || 100; this.$volumeBarContainer.hide(); if (this.params.autoPlay) { this.togglePlayPause(); this.togglePlayStop(); } this.changeTogglePlay(); this.hideId = setTimeout((function() { return $__0.hide(); }), timeout); if (this.disabled) this.hide(); this.$el.ready((function() { $__0.setVolumeLevel($__0.currentVolume); $__0.setSeekPercentage(0); $__0.bindKeyEvents(); })); return this; } }, {}, UIObject); module.exports = MediaControl; }).call(this,typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {}) },{"../../base/jst":10,"../../base/styler":13,"../../base/ui_object":"8lqCAT","../../base/utils":18}],31:[function(require,module,exports){ "use strict"; var Events = require('../base/events'); var events = new Events(); var Mediator = function Mediator() {}; ($traceurRuntime.createClass)(Mediator, {}, {}); Mediator.on = function(name, callback, context) { events.on(name, callback, context); return; }; Mediator.once = function(name, callback, context) { events.once(name, callback, context); return; }; Mediator.off = function(name, callback, context) { events.off(name, callback, context); return; }; Mediator.trigger = function(name, opts) { events.trigger(name, opts); return; }; Mediator.stopListening = function(obj, name, callback) { events.stopListening(obj, name, callback); return; }; module.exports = Mediator; },{"../base/events":9}],32:[function(require,module,exports){ (function (global){ "use strict"; var BaseObject = require('./base/base_object'); var CoreFactory = require('./components/core_factory'); var Loader = require('./components/loader'); var Mediator = require('./components/mediator'); var Player = function Player() { $traceurRuntime.defaultSuperCall(this, $Player.prototype, arguments); }; var $Player = Player; ($traceurRuntime.createClass)(Player, { initialize: function(params) { window.p = this; params.displayType || (params.displayType = 'pip'); this.params = params; this.loader = new Loader(this.params); this.coreFactory = new CoreFactory(this, this.loader); }, attachTo: function(element) { this.params.parentElement = element; this.core = this.coreFactory.create(); }, load: function(sources) { this.core.load(sources); }, destroy: function() { this.core.destroy(); } }, {}, BaseObject); global.DEBUG = false; window.WP3 = { Player: Player, Mediator: Mediator }; module.exports = window.WP3; }).call(this,typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {}) },{"./base/base_object":"2HNVgz","./components/core_factory":26,"./components/loader":27,"./components/mediator":31}],33:[function(require,module,exports){ (function (global){ "use strict"; var UIObject = require('../../base/ui_object'); var Styler = require('../../base/styler'); var JST = require('../../base/jst'); var Mediator = require('../../components/mediator'); var _ = (typeof window !== "undefined" ? window._ : typeof global !== "undefined" ? global._ : null); var $ = (typeof window !== "undefined" ? window.$ : typeof global !== "undefined" ? global.$ : null); var objectIE = '<object type="application/x-shockwave-flash" id="<%= cid %>" classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" data-flash-vod=""><param name="movie" value="<%= swfPath %>"> <param name="quality" value="autohigh"> <param name="swliveconnect" value="true"> <param name="allowScriptAccess" value="always"> <param name="bgcolor" value="#001122"> <param name="allowFullScreen" value="false"> <param name="wmode" value="gpu"> <param name="tabindex" value="1"> </object>'; var FlashVOD = function FlashVOD() { $traceurRuntime.defaultSuperCall(this, $FlashVOD.prototype, arguments); }; var $FlashVOD = FlashVOD; ($traceurRuntime.createClass)(FlashVOD, { get name() { return 'flash_vod'; }, get tagName() { return 'object'; }, get template() { return JST.flash_vod; }, initialize: function(options) { $traceurRuntime.superCall(this, $FlashVOD.prototype, "initialize", [options]); this.src = options.src; this.swfPath = options.swfPath || "assets/Player.swf"; this.autoPlay = options.autoPlay; this.settings = { left: ["playpause", "position", "duration"], default: ["seekbar"], right: ["fullscreen", "volume"] }; this.isReady = false; this.addListeners(); }, safe: function(fn) { if (this.el.getState && this.el.getDuration && this.el.getPosition && this.el.getBytesLoaded && this.el.getBytesTotal) { return fn.apply(this); } }, bootstrap: function() { this.el.width = "100%"; this.el.height = "100%"; this.isReady = true; this.trigger('playback:ready', this.name); this.currentState = "IDLE"; this.autoPlay && this.play(); $('<div style="position: absolute; top: 0; left: 0; width: 100%; height: 100%" />').insertAfter(this.$el); }, setupFirefox: function() { var $el = this.$('embed'); $el.attr('data-flash-vod', ''); this.setElement($el[0]); }, getPlaybackType: function() { return "vod"; }, updateTime: function() { var $__0 = this; this.safe((function() { $__0.trigger('playback:timeupdate', $__0.el.getPosition(), $__0.el.getDuration(), $__0.name); })); }, addListeners: function() { var $__0 = this; Mediator.on(this.uniqueId + ':progress', (function() { return $__0.progress(); })); Mediator.on(this.uniqueId + ':timeupdate', (function() { return $__0.updateTime(); })); Mediator.on(this.uniqueId + ':statechanged', (function() { return $__0.checkState(); })); Mediator.on(this.uniqueId + ':flashready', (function() { return $__0.bootstrap(); })); }, stopListening: function() { $traceurRuntime.superCall(this, $FlashVOD.prototype, "stopListening", []); Mediator.off(this.uniqueId + ':progress'); Mediator.off(this.uniqueId + ':timeupdate'); Mediator.off(this.uniqueId + ':statechanged'); }, checkState: function() { var $__0 = this; this.safe((function() { if ($__0.currentState !== "PLAYING_BUFFERING" && $__0.el.getState() === "PLAYING_BUFFERING") { $__0.trigger('playback:buffering', $__0.name); $__0.currentState = "PLAYING_BUFFERING"; } else if ($__0.currentState === "PLAYING_BUFFERING" && $__0.el.getState() === "PLAYING") { $__0.trigger('playback:bufferfull', $__0.name); $__0.currentState = "PLAYING"; } else if ($__0.el.getState() === "IDLE") { $__0.currentState = "IDLE"; } else if ($__0.el.getState() === "ENDED") { $__0.trigger('playback:ended', $__0.name); $__0.trigger('playback:timeupdate', 0, $__0.el.getDuration(), $__0.name); $__0.currentState = "ENDED"; } })); }, progress: function() { var $__0 = this; this.safe((function() { if ($__0.currentState !== "IDLE" && $__0.currentState !== "ENDED") { $__0.trigger('playback:progress', 0, $__0.el.getBytesLoaded(), $__0.el.getBytesTotal(), $__0.name); } })); }, firstPlay: function() { var $__0 = this; this.safe((function() { $__0.currentState = "PLAYING"; $__0.el.playerPlay($__0.src); })); }, play: function() { var $__0 = this; this.safe((function() { if ($__0.el.getState() === 'PAUSED') { $__0.currentState = "PLAYING"; $__0.el.playerResume(); } else if ($__0.el.getState() !== 'PLAYING') { $__0.firstPlay(); } $__0.trigger('playback:play', $__0.name); })); }, volume: function(value) { var $__0 = this; this.safe((function() { $__0.el.playerVolume(value); })); }, pause: function() { var $__0 = this; this.safe((function() { $__0.currentState = "PAUSED"; $__0.el.playerPause(); })); }, stop: function() { var $__0 = this; this.safe((function() { $__0.el.playerStop(); $__0.trigger('playback:timeupdate', 0, $__0.name); })); }, isPlaying: function() { return !!(this.isReady && this.currentState == "PLAYING"); }, getDuration: function() { var $__0 = this; return this.safe((function() { return $__0.el.getDuration(); })); }, seek: function(time) { var $__0 = this; this.safe((function() { var seekTo = $__0.el.getDuration() * (time / 100); $__0.el.playerSeek(seekTo); $__0.trigger('playback:timeupdate', seekTo, $__0.el.getDuration(), $__0.name); if ($__0.currentState == "PAUSED") { $__0.pause(); } })); }, destroy: function() { clearInterval(this.bootstrapId); this.stopListening(); this.$el.remove(); }, setupIE: function() { this.setElement($(_.template(objectIE)({ cid: this.cid, swfPath: this.swfPath }))); }, render: function() { var style = Styler.getStyleFor(this.name); this.$el.html(this.template({ cid: this.cid, swfPath: this.swfPath, playbackId: this.uniqueId })); if (navigator.userAgent.match(/firefox/i)) { this.setupFirefox(); } else if (window.ActiveXObject) { this.setupIE(); } this.$el.append(style); return this; } }, {}, UIObject); FlashVOD.canPlay = function(resource) { if (navigator.userAgent.match(/firefox/i) || window.ActiveXObject) { return _.isString(resource) && !!resource.match(/(.*).(mp4|mov|f4v|3gpp|3gp)/); } else { return _.isString(resource) && !!resource.match(/(.*).(mov|f4v|3gpp|3gp)/); } }; module.exports = FlashVOD; }).call(this,typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {}) },{"../../base/jst":10,"../../base/styler":13,"../../base/ui_object":"8lqCAT","../../components/mediator":31}],34:[function(require,module,exports){ "use strict"; module.exports = require('./flash_vod'); },{"./flash_vod":33}],35:[function(require,module,exports){ (function (global){ "use strict"; var UIPlugin = require('../../base/ui_plugin'); var Styler = require('../../base/styler'); var JST = require('../../base/jst'); var _ = (typeof window !== "undefined" ? window._ : typeof global !== "undefined" ? global._ : null); var Mediator = require('../../components/mediator'); var Visibility = require('visibility'); var objectIE = '<object type="application/x-shockwave-flash" id="<%= cid %>" classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" data-hls=""><param name="movie" value="<%= swfPath %>"> <param name="quality" value="autohigh"> <param name="swliveconnect" value="true"> <param name="allowScriptAccess" value="always"> <param name="bgcolor" value="#001122"> <param name="allowFullScreen" value="false"> <param name="wmode" value="transparent"> <param name="tabindex" value="1"> </object>'; var HLS = function HLS() { $traceurRuntime.defaultSuperCall(this, $HLS.prototype, arguments); }; var $HLS = HLS; ($traceurRuntime.createClass)(HLS, { get name() { return 'hls'; }, get tagName() { return 'object'; }, get template() { return JST.hls; }, get attributes() { return { 'data-hls': '', 'type': 'application/x-shockwave-flash' }; }, initialize: function(options) { $traceurRuntime.superCall(this, $HLS.prototype, "initialize", [options]); this.src = options.src; this.swfPath = options.swfPath || "assets/HLSPlayer.swf"; this.setupBrowser(); this.setupVisibility(); this.highDefinition = false; this.autoPlay = options.autoPlay; this.defaultSettings = { left: ["playstop"], default: [], right: ["fullscreen", "volume", "hd"] }; this.settings = _.extend({}, this.defaultSettings); this.addListeners(); }, setupBrowser: function() { this.isLegacyIE = window.ActiveXObject; this.isChrome = navigator.userAgent.match(/chrome/i); this.isFirefox = navigator.userAgent.match(/firefox/i); this.isSafari = navigator.userAgent.match(/safari/i); }, setupVisibility: function() { var $__0 = this; this.visibility = new Visibility(); this.visibility.on('show', (function() { return $__0.visibleCallback(); })); this.visibility.on('hide', (function() { return $__0.hiddenCallback(); })); }, addListeners: function() { var $__0 = this; Mediator.on(this.uniqueId + ':flashready', (function() { return $__0.bootstrap(); })); Mediator.on(this.uniqueId + ':timeupdate', (function(params) { return $__0.updateTime(params); })); Mediator.on(this.uniqueId + ':playbackstate', (function(params) { return $__0.setPlaybackState(params); })); Mediator.on(this.uniqueId + ':highdefinition', (function(params) { return $__0.updateHighDefinition(params); })); }, stopListening: function() { $traceurRuntime.superCall(this, $HLS.prototype, "stopListening", []); Mediator.off(this.uniqueId + ':flashready'); Mediator.off(this.uniqueId + ':timeupdate'); Mediator.off(this.uniqueId + ':playbackstate'); Mediator.off(this.uniqueId + ':highdefinition'); }, safe: function(fn) { if (this.el.globoGetState && this.el.globoGetDuration && this.el.globoGetPosition && this.el.globoPlayerSmoothSetLevel && this.el.globoPlayerSetflushLiveURLCache) { return fn.apply(this); } }, hiddenCallback: function() { var $__0 = this; this.hiddenId = this.safe((function() { return setTimeout((function() { return $__0.el.globoPlayerSmoothSetLevel(0); }), 10000); })); }, visibleCallback: function() { var $__0 = this; this.safe((function() { if ($__0.hiddenId) { clearTimeout($__0.hiddenId); } if (!$__0.el.globoGetAutoLevel()) { $__0.el.globoPlayerSmoothSetLevel(-1); } })); }, bootstrap: function() { this.el.width = "100%"; this.el.height = "100%"; this.trigger('playback:ready', this.name); this.currentState = "IDLE"; this.el.globoPlayerSetflushLiveURLCache(true); this.autoPlay && this.play(); }, updateHighDefinition: function(params) { this.highDefinition = params.isHD; this.trigger('playback:highdefinitionupdate'); }, updateTime: function(params) { var $__0 = this; return this.safe((function() { var previousDvrEnabled = $__0.dvrEnabled; $__0.dvrEnabled = ($__0.playbackType === 'live' && params.duration > 240); var duration = $__0.getDuration(); if ($__0.playbackType === 'live') { var position = $__0.el.globoGetPosition(); if (position >= duration) { position = duration; } $__0.trigger('playback:timeupdate', position, duration, $__0.name); } else { $__0.trigger('playback:timeupdate', $__0.el.globoGetPosition(), duration, $__0.name); } if ($__0.dvrEnabled != previousDvrEnabled) { $__0.updateSettings(); } })); }, play: function() { var $__0 = this; this.safe((function() { if ($__0.el.currentState === 'PAUSED') { $__0.el.globoPlayerResume(); } else { $__0.firstPlay(); } $__0.trigger('playback:play', $__0.name); })); }, getPlaybackType: function() { if (this.playbackType) return this.playbackType; return null; }, getCurrentBitrate: function() { return this.safe(function() { var currentLevel = this.getLevels()[this.el.globoGetLevel()]; return currentLevel.bitrate; }); }, getLastProgramDate: function() { var programDate = this.el.globoGetLastProgramDate(); return programDate - 1.08e+7; }, isHighDefinition: function() { return this.highDefinition; }, getLevels: function() { var $__0 = this; return this.safe((function() { if (!$__0.levels || $__0.levels.length === 0) { $__0.levels = $__0.el.globoGetLevels(); } return $__0.levels; })); }, setPlaybackState: function(params) { if (params.state === "PLAYING_BUFFERING" && this.el.globoGetbufferLength() < 1 && this.currentState !== "PLAYING_BUFFERING") { this.trigger('playback:buffering', this.name); } else if (params.state === "PLAYING" && this.currentState === "PLAYING_BUFFERING") { this.trigger('playback:bufferfull', this.name); } else if (params.state === "IDLE") { this.trigger('playback:ended', this.name); this.trigger('playback:timeupdate', 0, this.el.globoGetDuration(), this.name); } this.currentState = params.state; this.updatePlaybackType(); }, updatePlaybackType: function() { var $__0 = this; this.safe((function() { if (!$__0.playbackType) { $__0.playbackType = $__0.el.globoGetType(); if ($__0.playbackType) { $__0.playbackType = $__0.playbackType.toLowerCase(); $__0.updateSettings(); } } })); }, firstPlay: function() { var $__0 = this; this.safe((function() { $__0.el.globoPlayerLoad($__0.src); $__0.el.globoPlayerPlay(); })); }, volume: function(value) { var $__0 = this; this.safe((function() { $__0.el.globoPlayerVolume(value); })); }, pause: function() { var $__0 = this; this.safe((function() { $__0.el.globoPlayerPause(); })); }, stop: function() { var $__0 = this; this.safe((function() { $__0.el.globoPlayerStop(); $__0.trigger('playback:timeupdate', 0, $__0.name); })); }, isPlaying: function() { var $__0 = this; return this.safe((function() { if ($__0.currentState) return !!($__0.currentState.match(/playing/i)); return false; })); }, getDuration: function() { var $__0 = this; return this.safe((function() { var duration = $__0.el.globoGetDuration(); if ($__0.playbackType === 'live') { duration = duration - 10; } return duration; })); }, seek: function(time) { var $__0 = this; this.safe((function() { if (time < 0) { $__0.el.globoPlayerSeek(time); } else { var duration = $__0.getDuration(); time = duration * time / 100; if ($__0.playbackType === 'live' && duration - time < 2) time = -1; $__0.el.globoPlayerSeek(time); } })); }, isPip: function(pipStatus) { if (pipStatus == true && this.getCurrentBitrate() > 750000) { this.el.globoPlayerSetStageScaleMode("exactFit"); this.el.globoPlayerSmoothSetLevel(2); } else if (!this.el.globoGetAutoLevel()) { this.el.globoPlayerSetStageScaleMode("noScale"); this.el.globoPlayerSetLevel(-1); } }, timeUpdate: function(time, duration) { this.trigger('playback:timeupdate', time, duration, this.name); }, destroy: function() { this.stopListening(); this.$el.remove(); }, setupFirefox: function() { var $el = this.$('embed'); $el.attr('data-hls', ''); this.setElement($el[0]); }, setupIE: function() { this.setElement($(_.template(objectIE)({ cid: this.cid, swfPath: this.swfPath }))); }, updateSettings: function() { this.settings = _.extend({}, this.defaultSettings); if (this.playbackType === "vod" || this.dvrEnabled) { this.settings.left = ["playpause", "position", "duration"]; this.settings.default = ["seekbar"]; } this.trigger('playback:settingsupdate', this.name); }, render: function() { var style = Styler.getStyleFor(this.name); this.$el.html(this.template({ cid: this.cid, swfPath: this.swfPath, playbackId: this.uniqueId })); this.$el.append(style); this.el.id = this.cid; if (this.isFirefox) { this.setupFirefox(); } else if (this.isLegacyIE) { this.setupIE(); } return this; } }, {}, UIPlugin); HLS.canPlay = function(resource) { return !!resource.match(/^http(.*).m3u8/); }; module.exports = HLS; }).call(this,typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {}) },{"../../base/jst":10,"../../base/styler":13,"../../base/ui_plugin":"Z7u8cr","../../components/mediator":31,"visibility":5}],36:[function(require,module,exports){ "use strict"; module.exports = require('./hls'); },{"./hls":35}],37:[function(require,module,exports){ "use strict"; var UIPlugin = require('../../base/ui_plugin'); var HTML5Audio = function HTML5Audio() { $traceurRuntime.defaultSuperCall(this, $HTML5Audio.prototype, arguments); }; var $HTML5Audio = HTML5Audio; ($traceurRuntime.createClass)(HTML5Audio, { get name() { return 'html5_audio'; }, get type() { return 'playback'; }, get tagName() { return 'audio'; }, get events() { return { 'timeupdate': 'timeUpdated', 'ended': 'ended' }; }, initialize: function(options) { this.el.src = options.src; this.render(); }, setContainer: function() { this.container.settings = { left: ['playpause'], right: ['volume'], default: ['position', 'seekbar', 'duration'] }; this.render(); this.params.autoPlay && this.play(); }, bindEvents: function() { this.listenTo(this.container, 'container:play', this.play); this.listenTo(this.container, 'container:pause', this.pause); this.listenTo(this.container, 'container:seek', this.seek); this.listenTo(this.container, 'container:volume', this.volume); this.listenTo(this.container, 'container:stop', this.stop); }, play: function() { this.el.play(); }, pause: function() { this.el.pause(); }, stop: function() { this.pause(); this.el.currentTime = 0; }, volume: function(value) { this.el.volume = value / 100; }, mute: function() { this.el.volume = 0; }, unmute: function() { this.el.volume = 1; }, isMuted: function() { return !!this.el.volume; }, ended: function() { this.trigger('container:timeupdate', 0); }, seek: function(seekBarValue) { var time = this.el.duration * (seekBarValue / 100); this.el.currentTime = time; }, getCurrentTime: function() { return this.el.currentTime; }, getDuration: function() { return this.el.duration; }, timeUpdated: function() { this.container.timeUpdated(this.el.currentTime, this.el.duration); }, render: function() { this.container.$el.append(this.el); return this; } }, {}, UIPlugin); HTML5Audio.canPlay = function(resource) { return !!resource.match(/(.*).mp3/); }; module.exports = HTML5Audio; },{"../../base/ui_plugin":"Z7u8cr"}],38:[function(require,module,exports){ "use strict"; module.exports = require('./html5_audio'); },{"./html5_audio":37}],39:[function(require,module,exports){ "use strict"; var UIPlugin = require('../../base/ui_plugin'); var Styler = require('../../base/styler'); var HTML5Video = function HTML5Video() { $traceurRuntime.defaultSuperCall(this, $HTML5Video.prototype, arguments); }; var $HTML5Video = HTML5Video; ($traceurRuntime.createClass)(HTML5Video, { get name() { return 'html5_video'; }, get type() { return 'playback'; }, get tagName() { return 'video'; }, get attributes() { return {'data-html5-video': ''}; }, get events() { return { 'timeupdate': 'timeUpdated', 'progress': 'progress', 'ended': 'ended', 'playing': 'playing', 'stalled': 'buffering', 'waiting': 'buffering', 'canplaythrough': 'bufferFull', 'loadedmetadata': 'loadedMetadata' }; }, initialize: function(options) { this.options = options; this.src = options.src; this.el.src = options.src; this.el.loop = options.loop; this.settings = { left: ['playpause', 'position', 'duration'], right: ['fullscreen', 'volume'], default: ['seekbar'] }; }, loadedMetadata: function(e) { this.trigger('playback:loadedmetadata', e.target.duration); }, play: function() { this.el.play(); }, pause: function() { this.el.pause(); }, stop: function() { this.pause(); if (this.el.readyState !== 0) { this.el.currentTime = 0; } }, volume: function(value) { this.el.volume = value / 100; }, mute: function() { this.el.volume = 0; }, unmute: function() { this.el.volume = 1; }, isMuted: function() { return !!this.el.volume; }, isPlaying: function() { return !this.el.paused && !this.el.ended; }, ended: function() { this.trigger('playback:ended', this.name); this.trigger('playback:timeupdate', 0, this.el.duration, this.name); }, buffering: function() { this.trigger('playback:buffering', this.name); }, bufferFull: function() { this.trigger('playback:bufferfull', this.name); }, destroy: function() { this.stop(); this.el.src = ''; this.$el.remove(); }, seek: function(seekBarValue) { var time = this.el.duration * (seekBarValue / 100); this.el.currentTime = time; }, getCurrentTime: function() { return this.el.currentTime; }, getDuration: function() { return this.el.duration; }, timeUpdated: function() { this.trigger('playback:timeupdate', this.el.currentTime, this.el.duration, this.name); }, progress: function() { if (!this.el.buffered.length) return; var bufferedPos = 0; for (var i = 0; i < this.el.buffered.length; i++) { if (this.el.currentTime >= this.el.buffered.start(i) && this.el.currentTime <= this.el.buffered.end(i)) { bufferedPos = i; break; } } this.trigger('playback:progress', this.el.buffered.start(bufferedPos), this.el.buffered.end(bufferedPos), this.el.duration, this.name); }, playing: function() { this.trigger('playback:play', this.name); }, render: function() { var style = Styler.getStyleFor(this.name); this.$el.append(style); this.trigger('playback:ready', this.name); this.options.autoPlay && this.play(); return this; } }, {}, UIPlugin); HTML5Video.canPlay = function(resource) { return !!resource.match(/(.*).mp4/); }; module.exports = HTML5Video; },{"../../base/styler":13,"../../base/ui_plugin":"Z7u8cr"}],40:[function(require,module,exports){ "use strict"; module.exports = require('./html5_video'); },{"./html5_video":39}],41:[function(require,module,exports){ "use strict"; module.exports = require('./loading'); },{"./loading":42}],42:[function(require,module,exports){ (function (global){ "use strict"; var UIObject = require('../../base/ui_object'); var _ = (typeof window !== "undefined" ? window._ : typeof global !== "undefined" ? global._ : null); var defaultImage = "data:image/gif;base64,R0lGODlhGQAZAPMAAP////f39+/v7+bm5t7e3tbW1szMzMXFxb29vbW1ta2traWlpZmZmYyMjISEhHNzcyH/C05FVFNDQVBFMi4wAwEAAAAh+QQFCAAQACwAAAAAGQAZAAAFjCAkjiTkPE6pqssyPvBIECu5MIwLwY881yMcQ8QTzX5AiNBVPNJWiUQQt4sdSU9IQsEV3XA8p/Gq5XKlOB3k6kSKzN1aOzvaxldiYBToHhX+gAVJa3OBgINzBIZ/iHMqfSWQkWR4lFh5lZiOlGxtY0iJeZpZnTSWdJc/paiZn5+sqU+ckpM+pLBJlishACH5BAUIABAALAAAAAAUAA4AAAVRICSOJLQwS6lCSTIy8Og4aqIoLgQz4/PQpZtCtBP5fiqhq+g4jgqEkVAXc4oK2ILIhts1fc8sFnLLQb4qsXbFFrPfkDEcQqjbo3P6vZ7X7/shACH5BAUIABAALAEAAAAXAAsAAAVQICSOZKIkZKoSxai847KoY2G30KuMDDPTkJtIJ+r5gEEhcWFckZSw5sgBIVgJoltBx+yJHI+H43pN4iBdCDgsFpGxQHaYOiIj2fQVnAZOhQAAIfkEBQgAEAAsBQAAABQADgAABUogJI5FOZ4oRJCmmCQpIa9QWYyKAqOzaIs5Xaz3SwRTIqLpOFqcZgSbUQhhWJ2jnisHWVivyNQXHEaNy0gvuvxoux1rkXseh8zdIQAh+QQFCAAQACwLAAAADgAUAAAFSyAhQmRpQiJRFsWJjiTbmmksn7U80+NdJqSUjpRQKIArFqRoPLogTSPS1Zw+i08XY8tdPLngL3jrcjyypofagYao3+ysGd6mtyHxEAAh+QQFCAAQACwOAAEACwAXAAAFTiAkEoRonmR5jukKperamgVLikVetnlf074fMOeCEIsihXKZOC2fzqeiKVowkBCGdlHUerkQx+MBsX7DY4foDBmTTWD0GOlWF9NIh/0UAgAh+QQFCAAQACwLAAUADgAUAAAFTiAkjiRElCihoqPqnukLxysr1vZY7HzB9rwf0FdKJHIjhfKYUzqZowWDAUk4FceHVspYiJ4Q7QMypY6YYgjXTEqTp962dgQvudVx+RgZAgAh+QQFCAAQACwFAAsAFAAOAAAFUSAkjuRInChRrmKKsqt7wmRR0LRt46uul4+HY5RQKCC+ncgRfDCeRUVC5Bs1IU8GxHgc3ZbBYRYSna6u2KeIax4xhaLxWrpyDONqUaJNW+RpIQAh+QQFCAAQACwBAA4AFwALAAAFUiAkio4zniJBoKPzvOyoquhrx+lMu/YDMYzFqECE6FQ8H2QBZCiexKJxBimNmpCnAhI9rVBNRvbJ7eJ+QJFWFP2ymEE1mS2NLYTyLf3MSigSfCEAIfkEBQgAEAAsAAALABQADgAABU6g84wkZJ7oSa5pa66lK5/LMrsLo9+p7vOmnI8BUSgSJ4ISJSRCEkZFYapc0mymKGRagFRl0ON26v22tONumTBIhZHppBWVgMdN8xm3FQIAIfkEBQgAEAAsAAAFAA4AFAAABUsgBDmOaJ6i86woqq5P2ZowO6fwfZLtwvzAGXAoHP50p0QCmVA4dc7orBldFq5JKeR6JXhFShMX4iW0uAXyFzVWm09oUfmclq915RAAIfkECQgAEAAsAAAAABkAGQAABVwgJI5kaZ6j46Bs6TzP2s7wM9OwfI/LMtY7HmMoesGCkMVw6MshRUvik6SUTqm+Z0LB7V674OsWrLiaCgWzCI1Ws9vTd5tAR75F9Lo9jdeb8wRqEHmCgIKDgYdmIQA7"; var Loading = function Loading() { $traceurRuntime.defaultSuperCall(this, $Loading.prototype, arguments); }; var $Loading = Loading; ($traceurRuntime.createClass)(Loading, { get template() { return _.template('<img src=<%= base64Image %> <h3> <%= message %> </h3>'); }, get defaultImage() { return defaultImage; }, initialize: function(options) { this.message = options.message || ''; this.base64Image = options.base64Image || this.defaultImage; this.customStyle = options.style || {}; }, show: function() { return this.$el.show().promise(); }, hide: function() { return this.$el.hide().promise(); }, render: function() { this.$el.css(this.customStyle); this.$el.html(this.template({ base64Image: this.base64Image, message: this.message })); this.$el.hide(); return this; } }, {}, UIObject); module.exports = Loading; }).call(this,typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {}) },{"../../base/ui_object":"8lqCAT"}],43:[function(require,module,exports){ "use strict"; module.exports = require('./log'); },{"./log":44}],44:[function(require,module,exports){ (function (global){ "use strict"; var BaseObject = require('../../base/base_object'); var $ = (typeof window !== "undefined" ? window.$ : typeof global !== "undefined" ? global.$ : null); var BOLD = 'font-weight: bold; font-size: 13px;'; var INFO = 'color: green;' + BOLD; var DEBUG = 'color: #222;' + BOLD; var ERROR = 'color: red;' + BOLD; var DEFAULT = ''; $(document).keydown(function(e) { if (e.ctrlKey && e.shiftKey && e.keyCode === 68) { window.DEBUG = !window.DEBUG; } }); var Log = function(klass) { this.klass = klass || 'Logger'; }; Log.info = function(klass, msg) { console.log('%s %cINFO%c [%s] %s', (new Date()).toLocaleTimeString(), INFO, DEFAULT, klass, msg); }; Log.error = function(klass, msg) { console.log('%s %cINFO%c [%s] %s', (new Date()).toLocaleTimeString(), INFO, DEFAULT, klass, msg); }; Log.BLACKLIST = ['mediacontrol:show', 'mediacontrol:hide', 'playback:timeupdate', 'playback:progress', 'container:hover', 'container:timeupdate', 'container:progress']; Log.prototype = { log: function(msg) { this.info(msg); }, info: function(msg) { console.log('%s %cINFO%c [%s] %s', (new Date()).toLocaleTimeString(), INFO, DEFAULT, this.klass, msg); }, error: function(msg) { console.log('%s %cERROR%c [%s] %s', (new Date()).toLocaleTimeString(), ERROR, DEFAULT, this.klass, msg); } }; module.exports = Log; }).call(this,typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {}) },{"../../base/base_object":"2HNVgz"}],45:[function(require,module,exports){ "use strict"; module.exports = require('./pip'); },{"./pip":46}],46:[function(require,module,exports){ (function (global){ "use strict"; var BaseObject = require('../../base/base_object'); var Styler = require('../../base/styler'); var $ = (typeof window !== "undefined" ? window.$ : typeof global !== "undefined" ? global.$ : null); var _ = (typeof window !== "undefined" ? window._ : typeof global !== "undefined" ? global._ : null); var Loading = require('../loading'); var PipPlugin = function PipPlugin() { $traceurRuntime.defaultSuperCall(this, $PipPlugin.prototype, arguments); }; var $PipPlugin = PipPlugin; ($traceurRuntime.createClass)(PipPlugin, { get name() { return 'pip'; }, initialize: function(core) { this.core = core; this.addListeners(); this.loading = new Loading({message: 'Carregando...'}); this.core.$el.append(this.loading.render().el); var style = Styler.getStyleFor('pip'); this.core.$el.append(style); this.loading.$el.attr('data-pip', ''); this.loading.$el.addClass('pip-loading'); this.setupContainers(); }, getExternalInterface: function() { return { addPip: this.addPip, discardPip: this.discardPip, addMaster: this.addMaster, addMasterContainer: this.addMasterContainer, changeMaster: this.changeMaster, pipToMaster: this.pipToMaster, hasPip: this.hasPip }; }, addListeners: function() { this.listenTo(this.core.mediaControl, 'mediacontrol:show', this.onMediaControlShow); this.listenTo(this.core.mediaControl, 'mediacontrol:hide', this.onMediaControlHide); }, setupContainers: function() { this.masterContainer = this.core.containers[0]; this.setMasterStyle(this.masterContainer, false); this.core.mediaControl.setContainer(this.masterContainer); this.core.mediaControl.render(); if (this.core.containers.length === 2) { this.pipContainer = this.core.containers[1]; this.setPipStyle(this.pipContainer, false); this.masterContainer.play(); this.pipContainer.play(); this.pipContainer.setVolume(0); this.pipContainer.trigger("container:pip", true); this.listenToPipClick(); } }, hasPip: function() { return !!this.pipContainer; }, addPip: function(source) { this.stopListening(this.pipContainer); this.discardPip(); this.core.createContainer(source).then(this.addPipCallback.bind(this)); }, addPipCallback: function(container) { this.pipContainer = _(container).isArray() ? container[0] : container; this.onContainerReady(); if (this.core.params.onPipLoaded) this.core.params.onPipLoaded(this.pipContainer.playback.src); }, onContainerReady: function() { this.pipContainer.setVolume(0); this.setPipStyle(this.pipContainer); this.pipContainer.play(); this.stopListening(this.pipContainer); this.listenToPipClick(); this.listenTo(this.pipContainer, "container:ended", this.discardPip); this.pipContainer.trigger("container:pip", true); }, discardPip: function() { if (this.pipContainer) { this.stopListening(this.pipContainer); this.discardContainer(this.pipContainer); this.pipContainer = undefined; } }, discardMaster: function() { if (this.masterContainer) { this.stopListening(this.masterContainer); this.discardContainer(this.masterContainer); this.masterContainer = undefined; } }, setMasterContainer: function(container) { this.discardContainer(this.masterContainer); this.masterContainer = container; this.setMasterStyle(this.masterContainer); this.listenTo(this.masterContainer, "container:ended", this.pipToMaster); this.masterContainer.play(); }, addMaster: function(source) { if (this.masterContainer) { this.loading.show(); this.stopListening(this.masterContainer); this.tmpContainer = this.masterContainer; this.tmpContainer.setStyle({'z-index': 2000}); this.core.createContainer(source).then(this.addMasterCallback.bind(this)); } }, addMasterContainer: function(container) { if (this.masterContainer) { this.tmpContainer = this.masterContainer; this.tmpContainer.setStyle({'z-index': 2000}); this.addMasterCallback(container); } }, addMasterCallback: function(container) { this.masterContainer = container; if (this.pipContainer) { this.discardPip(); } this.pipContainer = this.tmpContainer; this.setPipStyle(this.pipContainer); this.setMasterStyle(this.masterContainer); this.masterContainer.play(); this.animateMasterToPip(); this.tmpContainer = undefined; this.pipContainer.setVolume(0); }, animateMasterToPip: function() { var $__0 = this; this.loading.hide(); this.listenTo(this.masterContainer, "container:ended", this.pipToMaster); this.pipContainer.$el.one('webkitTransitionEnd otransitionend oTransitionEnd msTransitionEnd transitionend', (function() { $__0.pipContainer.trigger("container:pip", true); if ($__0.core.params.onMasterLoaded) { $__0.core.params.onMasterLoaded($__0.masterContainer.getSource()); } })); this.setPipStyle(this.pipContainer); this.core.mediaControl.setContainer(this.masterContainer); this.listenToPipClick(); }, changeMaster: function(source) { if (this.masterContainer) { this.stopListening(this.masterContainer); this.tmpContainer = this.masterContainer; this.tmpContainer.setStyle({'z-index': 2000}); this.core.createContainer(source).then(this.changeMasterCallback.bind(this)); } }, changeMasterCallback: function(container) { this.masterContainer.destroy(); this.masterContainer = container; this.masterContainer.play(); this.tmpContainer = undefined; this.setMasterStyle(this.masterContainer); this.listenTo(this.masterContainer, "container:ended", this.pipToMaster); this.core.mediaControl.setContainer(this.masterContainer); if (this.core.params.onMasterLoaded) this.core.params.onMasterLoaded(this.masterContainer.playback.params.src); }, listenToPipClick: function() { if (this.pipContainer) { this.stopListening(this.pipContainer); this.listenTo(this.pipContainer, "container:click", this.pipToMaster.bind(this)); } }, discardContainer: function(container) { container.destroy(); }, pipToMaster: function() { var $__0 = this; this.stopListening(this.masterContainer); this.stopListening(this.pipContainer, "container:click"); if (this.pipContainer) { this.pipContainer.setStyle({'z-index': 998}); this.setMasterStyle(this.pipContainer); this.pipContainer.$el.one('webkitTransitionEnd otransitionend oTransitionEnd msTransitionEnd transitionend', (function() { $__0.pipContainer.$el.off('webkitTransitionEnd otransitionend oTransitionEnd msTransitionEnd transitionend'); $__0.pipToMasterCallback(); })); } return this; }, pipToMasterCallback: function() { this.discardMaster(); this.pipContainer.setVolume(100); this.pipContainer.trigger("container:pip", false); this.pipContainer.play(); this.masterContainer = this.pipContainer; this.masterContainer.setStyle({"z-index": 20}); this.pipContainer = undefined; this.core.mediaControl.setContainer(this.masterContainer); this.core.enableMediaControl(); if (this.core.params.onPipToMaster) this.core.params.onPipToMaster(this.masterContainer.playback.params.src); }, onMediaControlShow: function() { if (this.pipContainer) { this.pipContainer.$el.addClass('pip-transition over-media-control'); } }, onMediaControlHide: function() { this.masterContainer.$el.removeClass('over-media-control'); if (this.pipContainer) { this.pipContainer.$el.addClass('pip-transition'); this.pipContainer.$el.removeClass('over-media-control'); } }, setAnimatedTransition: function(container, animated) { if (animated) { container.$el.addClass('pip-transition'); } else { container.$el.removeClass('pip-transition'); } }, setPipStyle: function(container) { var animated = arguments[1] !== (void 0) ? arguments[1] : true; this.setAnimatedTransition(container, animated); container.$el.attr('data-pip', ''); container.$el.addClass('pip-container'); container.$el.removeClass('over-media-control master-container'); }, setMasterStyle: function(container) { var animated = arguments[1] !== (void 0) ? arguments[1] : true; this.setAnimatedTransition(container, animated); container.$el.attr('data-pip', ''); container.$el.addClass('master-container'); container.$el.removeClass('over-media-control pip-container'); } }, {}, BaseObject); module.exports = PipPlugin; }).call(this,typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {}) },{"../../base/base_object":"2HNVgz","../../base/styler":13,"../loading":41}],47:[function(require,module,exports){ "use strict"; module.exports = require('./poster'); },{"./poster":48}],48:[function(require,module,exports){ (function (global){ "use strict"; var UIPlugin = require('../../base/ui_plugin'); var Styler = require('../../base/styler'); var JST = require('../../base/jst'); var $ = (typeof window !== "undefined" ? window.$ : typeof global !== "undefined" ? global.$ : null); var PosterPlugin = function PosterPlugin() { $traceurRuntime.defaultSuperCall(this, $PosterPlugin.prototype, arguments); }; var $PosterPlugin = PosterPlugin; ($traceurRuntime.createClass)(PosterPlugin, { get name() { return 'poster'; }, get template() { return JST.poster; }, get attributes() { return { 'class': 'player-poster', 'data-poster': '' }; }, get events() { return {'click': 'clicked'}; }, initialize: function(options) { $traceurRuntime.superCall(this, $PosterPlugin.prototype, "initialize", [options]); if (options.disableControlsOnPoster === undefined) options.disableControlsOnPoster = true; this.options = options; if (this.options.disableControlsOnPoster) this.container.disableMediaControl(); this.render(); }, bindEvents: function() { this.listenTo(this.container, 'container:state:buffering', this.onBuffering); this.listenTo(this.container, 'container:play', this.onPlay); this.listenTo(this.container, 'container:stop', this.onStop); this.listenTo(this.container, 'container:ended', this.onStop); this.listenTo(this.container, 'container:pip', this.onPipStateChanged); }, onBuffering: function() { this.hidePlayButton(); }, onPlay: function() { this.$el.hide(); if (this.options.disableControlsOnPoster) { this.container.enableMediaControl(); } }, onStop: function() { this.$el.show(); if (this.options.disableControlsOnPoster) { this.container.disableMediaControl(); } if (!this.options.hidePlayButton) { this.showPlayButton(); } }, onPipStateChanged: function(isPip) { this.$el.css({fontSize: this.$el.height()}); if (!this.options.hidePlayButton) { this.showPlayButton(); } }, hidePlayButton: function() { this.$playButton.hide(); }, showPlayButton: function() { this.$el.css({fontSize: this.$el.height()}); this.$playButton.show(); }, clicked: function() { this.container.play(); }, render: function() { var $__0 = this; var style = Styler.getStyleFor(this.name); this.$el.html(this.template()); this.$el.append(style); this.container.$el.append(this.el); this.$el.ready((function() { $__0.$el.css({fontSize: $__0.options.height || $__0.$el.height()}); })); var imgEl = this.$el.find('img')[0]; imgEl.src = this.options.poster || 'assets/default.png'; this.$playButton = $(this.$el.find('.play-wrapper')); if (this.options.hidePlayButton) this.$playButton.hide(); return this; } }, {}, UIPlugin); module.exports = PosterPlugin; }).call(this,typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {}) },{"../../base/jst":10,"../../base/styler":13,"../../base/ui_plugin":"Z7u8cr"}],49:[function(require,module,exports){ "use strict"; module.exports = require('./sequence'); },{"./sequence":50}],50:[function(require,module,exports){ (function (global){ "use strict"; var BaseObject = require('../../base/base_object'); var SequenceContainer = require('./sequence_container'); var _ = (typeof window !== "undefined" ? window._ : typeof global !== "undefined" ? global._ : null); var Utils = require('../../base/utils'); var Sequence = BaseObject.extend({ initialize: function(core) { this.core = core; this.sequenceContainer = new SequenceContainer(this.core.containers); this.core.mediaControl.setContainer(this.sequenceContainer); }, getExternalInterface: function() { return {}; } }); module.exports = Sequence; }).call(this,typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {}) },{"../../base/base_object":"2HNVgz","../../base/utils":18,"./sequence_container":51}],51:[function(require,module,exports){ (function (global){ "use strict"; var BaseObject = require('../../base/base_object'); var _ = (typeof window !== "undefined" ? window._ : typeof global !== "undefined" ? global._ : null); var SequenceContainer = BaseObject.extend({ name: 'SequenceContainer', initialize: function(containers) { this.containers = containers; this.plugins = []; this.containersRange = []; this.currentContainer = 0; this.checkpoint = 0; this.duration = 0; _.each(this.containers, this._setupContainers, this); this.containersToSetup = this.containers.length; this._bindChildEvents(this.getCurrentContainer()); this.getCurrentContainer().$el.show(); this.settings = this.getCurrentContainer().settings; }, _bindChildEvents: function(container) { this.listenTo(container, 'container:ended', this.playNextContainer); this.listenTo(container, 'container:timeupdate', this.timeUpdateProxy); this.listenTo(container, 'container:progress', this.progressProxy); }, _setupContainers: function(container) { container.$el.hide(); this._injectInChildPlugins(container.plugins); this.listenTo(container, 'container:loadedmetadata', this._setupDuration); }, _injectInChildPlugins: function(plugins) { _.each(plugins, function(plugin) { plugin.stopListening(); plugin.container = this; plugin.bindEvents(); }, this); }, _setupDuration: function(duration) { this.duration += duration; this.trigger('container:timeupdate', 0, this.duration); if (--this.containersToSetup === 0) { this._setupSeek(); } }, _setupSeek: function() { _.each(this.containers, function(container) { var containerDuration = container.playback.getDuration(); var totalPercent = (containerDuration * 100) / this.duration; this.containersRange.push(totalPercent); }, this); }, getPlaybackType: function() { return this.getCurrentContainer().getPlaybackType(); }, length: function() { return this.containers.length; }, playNextContainer: function() { this.getCurrentContainer().$el.hide(); this.stopListening(this.getCurrentContainer()); var nextContainer = this.getNextContainer(); this.trigger('container:next', this.currentContainer); this._bindChildEvents(nextContainer); if (this.currentContainer === 0) { this.checkpoint = 0; nextContainer.$el.show(); this.trigger('container:ended'); nextContainer.stop(); } else { nextContainer.play(); this.trigger('container:play'); this.trigger('container:settingsupdate'); this.trigger('container:timeupdate', this.checkpoint, this.duration); nextContainer.$el.show(); } }, timeUpdateProxy: function(position, duration) { this.trigger('container:timeupdate', position + this.checkpoint, this.duration, this.name); }, progressProxy: function(startPosition, endPosition, duration) { this.trigger('container:progress', startPosition, endPosition, this.duration, this.name); }, getCurrentContainer: function() { return this.containers[this.currentContainer]; }, getNextContainer: function() { this.checkpoint += this.getCurrentContainer().playback.getDuration(); this.currentContainer = ++this.currentContainer % this.containers.length; var nextContainer = this.containers[this.currentContainer]; this.settings = nextContainer.settings; return nextContainer; }, play: function() { this.getCurrentContainer().playback.play(); this.trigger('container:play', this.name); }, setVolume: function(value) { this.trigger('container:volume', value, this.name); this.getCurrentContainer().setVolume(value); }, pause: function() { this.getCurrentContainer().pause(); this.trigger('container:pause', this.name); }, stop: function() { this.getCurrentContainer().stop(); this.trigger('container:stop', this.name); }, playing: function() { this.trigger('container:playing', this.name); }, progress: function(startPosition, endPosition, duration) { this.trigger('container:progress', startPosition, endPosition, duration); }, _matchContainerIndex: function(percent) { var total = 0; for (var i = 0, l = this.containers.length; i < l; i++) { total += this.containersRange[i]; if (total >= percent) { return i; } } return this.containers.length - 1; }, jumpToContainer: function(index) { if (index === 0) { this.seekToContainer(index, 0); } else { var value = _.reduce(this.containersRange.slice(0, index), function(total, percent) { return total + percent; }); this.seekToContainer(index, value); } }, setCurrentTime: function(time) { var containerIndex = this._matchContainerIndex(time); this.seekToContainer(containerIndex, time); }, seekToContainer: function(containerIndex, time) { if (containerIndex === 0) { this.checkpoint = 0; } else { var slice = this.containers.slice(0, containerIndex); this.checkpoint = _.reduce(slice, function(duration, container) { return duration + container.playback.getDuration(); }, 0); var pastRange = _.reduce(this.containersRange.slice(0, containerIndex), function(total, percent) { return percent + total; }, 0); time = time - pastRange; } var containerSeek = time * 100 / this.containersRange[containerIndex]; var currentContainer = this.getCurrentContainer(); currentContainer.$el.hide(); this.stopListening(currentContainer); currentContainer.stop(); this.currentContainer = containerIndex; var newContainer = this.containers[containerIndex]; this.listenTo(newContainer, 'container:ended', this.playNextContainer); this.listenTo(newContainer, 'container:timeupdate', this.timeUpdateProxy); this.listenTo(newContainer, 'container:progress', this.progressProxy); newContainer.play(); this.trigger('container:settingsupdate'); this.trigger('container:play'); newContainer.setCurrentTime(containerSeek); newContainer.$el.show(); }, settingsUpdate: function() { this.settings = this.getCurrentContainer().settings; this.trigger('container:settingsupdate'); }, isPlaying: function() { return this.getCurrentContainer().isPlaying(); }, render: function() { this.el = _.map(this.containers, function(container) { return container.render().el; }); return this; } }); module.exports = SequenceContainer; }).call(this,typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {}) },{"../../base/base_object":"2HNVgz"}],52:[function(require,module,exports){ "use strict"; module.exports = require('./spinner_three_bounce'); },{"./spinner_three_bounce":53}],53:[function(require,module,exports){ "use strict"; var UIPlugin = require('../../base/ui_plugin'); var Styler = require('../../base/styler'); var JST = require('../../base/jst'); var SpinnerThreeBouncePlugin = UIPlugin.extend({ name: 'spinner_three_bounce', attributes: { 'data-spinner': '', 'class': 'spinner-three-bounce' }, initialize: function(options) { SpinnerThreeBouncePlugin.super('initialize').call(this, options); this.template = JST[this.name]; this.listenTo(this.container, 'container:state:buffering', this.onBuffering); this.listenTo(this.container, 'container:state:bufferfull', this.onBufferFull); this.listenTo(this.container, 'container:stop', this.onStop); this.render(); }, onBuffering: function() { this.$el.show(); }, onBufferFull: function() { this.$el.hide(); }, onStop: function() { this.$el.hide(); }, render: function() { this.$el.hide(); this.$el.html(this.template()); var style = Styler.getStyleFor(this.name); this.container.$el.append(style); this.container.$el.append(this.$el); return this; } }); module.exports = SpinnerThreeBouncePlugin; },{"../../base/jst":10,"../../base/styler":13,"../../base/ui_plugin":"Z7u8cr"}],54:[function(require,module,exports){ "use strict"; module.exports = require('./stats'); },{"./stats":55}],55:[function(require,module,exports){ (function (global){ "use strict"; var Plugin = require('../../base/plugin'); var StatsEvents = require('./stats_events'); var $ = (typeof window !== "undefined" ? window.$ : typeof global !== "undefined" ? global.$ : null); var StatsPlugin = Plugin.extend({ name: 'stats', type: 'stats', initialize: function(options) { StatsPlugin.super('initialize').call(this, options); this.container.with(StatsEvents); this.setInitialAttrs(); this.reportInterval = options.reportInterval || 5000; this.state = "IDLE"; }, bindEvents: function() { this.listenTo(this.container, 'container:play', this.onPlay); this.listenTo(this.container, 'container:stop', this.onStop); this.listenTo(this.container, 'container:destroyed', this.onStop); this.listenTo(this.container, 'container:setreportinterval', this.setReportInterval); this.listenTo(this.container, 'container:state:buffering', this.onBuffering); this.listenTo(this.container, 'container:state:bufferfull', this.onBufferFull); this.listenTo(this.container, 'container:stats:add', this.onStatsAdd); this.listenTo(this.container.playback, 'playback:stats:add', this.onStatsAdd); }, setReportInterval: function(reportInterval) { this.reportInterval = reportInterval; }, setInitialAttrs: function() { this.firstPlay = true; this.startupTime = 0; this.rebufferingTime = 0; this.watchingTime = 0; this.rebuffers = 0; this.externalMetrics = {}; }, onPlay: function() { this.state = "PLAYING"; this.watchingTimeInit = Date.now(); this.intervalId = setInterval(this.report.bind(this), this.reportInterval); }, onStop: function() { clearInterval(this.intervalId); this.state = "STOPPED"; }, onBuffering: function() { if (this.firstPlay) { this.startupTimeInit = Date.now(); } else { this.rebufferingTimeInit = Date.now(); } this.state = "BUFFERING"; this.rebuffers++; }, onBufferFull: function() { if (this.state !== "BUFFERING") return; if (this.firstPlay) { this.firstPlay = false; this.startupTime = Date.now() - this.startupTimeInit; this.watchingTimeInit = Date.now(); } else { this.rebufferingTime += this.getRebufferingTime(); } this.rebufferingTimeInit = undefined; this.state = "PLAYING"; }, getRebufferingTime: function() { return Date.now() - this.rebufferingTimeInit; }, getWatchingTime: function() { var totalTime = (Date.now() - this.watchingTimeInit); return totalTime - this.rebufferingTime - this.startupTime; }, isRebuffering: function() { return !!this.rebufferingTimeInit; }, onStatsAdd: function(metric) { $.extend(this.externalMetrics, metric); }, getStats: function() { var metrics = { startupTime: this.startupTime, rebuffers: this.rebuffers, rebufferingTime: this.isRebuffering() ? this.rebufferingTime + this.getRebufferingTime() : this.rebufferingTime, watchingTime: this.isRebuffering() ? this.getWatchingTime() - this.getRebufferingTime() : this.getWatchingTime() }; $.extend(metrics, this.externalMetrics); return metrics; }, report: function() { this.container.statsReport(this.getStats()); } }); module.exports = StatsPlugin; }).call(this,typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {}) },{"../../base/plugin":11,"./stats_events":56}],56:[function(require,module,exports){ "use strict"; var StatsEvents = { statsAdd: function(metric) { this.trigger('container:stats:add', metric); }, statsReport: function(metrics) { this.trigger('container:stats:report', metrics); } }; module.exports = StatsEvents; },{}],57:[function(require,module,exports){ "use strict"; module.exports = require('./watermark'); },{"./watermark":58}],58:[function(require,module,exports){ "use strict"; var UIPlugin = require('../../base/ui_plugin'); var Styler = require('../../base/styler'); var JST = require('../../base/jst'); var WaterMarkPlugin = function WaterMarkPlugin() { $traceurRuntime.defaultSuperCall(this, $WaterMarkPlugin.prototype, arguments); }; var $WaterMarkPlugin = WaterMarkPlugin; ($traceurRuntime.createClass)(WaterMarkPlugin, { get name() { return 'watermark'; }, get type() { return 'ui'; }, initialize: function(options) { $traceurRuntime.superCall(this, $WaterMarkPlugin.prototype, "initialize", [options]); this.template = JST[this.name]; this.position = options.position || "bottom-right"; this.imageUrl = options.watermark || 'assets/watermark.png'; this.render(); }, bindEvents: function() { this.listenTo(this.container, 'container:play', this.onPlay); this.listenTo(this.container, 'container:stop', this.onStop); this.listenTo(this.container, 'container:pip', this.onPip); }, onPlay: function() { if (!this.hidden) this.$el.show(); }, onStop: function() { this.$el.hide(); }, onPip: function(isPip) { this.hidden = !!isPip; if (isPip) { this.$el.hide(); } else { this.$el.show(); } }, render: function() { this.$el.hide(); var templateOptions = { position: this.position, imageUrl: this.imageUrl }; this.$el.html(this.template(templateOptions)); var style = Styler.getStyleFor(this.name); this.container.$el.append(style); this.container.$el.append(this.$el); return this; } }, {}, UIPlugin); module.exports = WaterMarkPlugin; },{"../../base/jst":10,"../../base/styler":13,"../../base/ui_plugin":"Z7u8cr"}]},{},[3,32])
packages/react-scripts/fixtures/kitchensink/src/features/webpack/UnknownExtInclusion.js
CodingZeal/create-react-app
/** * Copyright (c) 2015-present, Facebook, Inc. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. */ import React from 'react'; import aFileWithExtUnknown from './assets/aFileWithExt.unknown'; const text = aFileWithExtUnknown.includes('base64') ? atob(aFileWithExtUnknown.split('base64,')[1]).trim() : aFileWithExtUnknown; export default () => ( <a id="feature-unknown-ext-inclusion" href={text}> aFileWithExtUnknown </a> );
app/components/ConsoleToolbar.js
zoo1/fil
import React from 'react'; import {connect} from 'react-redux'; import {setPreference} from 'actions/preferences'; import {getExtension} from 'helpers'; import {byExtension} from 'interpreters'; class ConsoleToolbar extends React.Component { handleRunButton(event) { event.preventDefault(); this.props.onRun(); } handleLiveCodingCheckbox(event) { const checked = event.target.checked; const {dispatch} = this.props; dispatch(setPreference('liveCoding', checked)); } render() { const block = this.props.className; const {preferences, currentFile} = this.props; const extension = getExtension(currentFile); const interpreterInfo = byExtension(extension); return ( <div className={block}> <button className={block + "__run-button"} onClick={this.handleRunButton.bind(this)}> {String.fromCharCode(9654)} </button> <div className={block + "__interpreter-info"}> {interpreterInfo.description} </div> <label className={block + "__live-coding"}> <input onChange={this.handleLiveCodingCheckbox.bind(this)} checked={preferences.liveCoding} type="checkbox" /> <span className={block + "__live-coding-text"}>Live coding</span> </label> </div> ); } } function select(state) { return { preferences: state.preferences, currentFile: state.currentFile }; } export default connect(select)(ConsoleToolbar);
components/elfinder/dist/js/i18n/elfinder.nl.js
ThomasFortin/WorldOfAdelaide
/** * Dutch translation * @author Barry vd. Heuvel <barry@fruitcakestudio.nl> * @version 2015-12-01 */ if (elFinder && elFinder.prototype && typeof(elFinder.prototype.i18) == 'object') { elFinder.prototype.i18.nl = { translator : 'Barry vd. Heuvel &lt;barry@fruitcakestudio.nl&gt;', language : 'Nederlands', direction : 'ltr', dateFormat : 'd-m-Y H:i', // Mar 13, 2012 05:27 PM fancyDateFormat : '$1 H:i', // will produce smth like: Today 12:25 PM messages : { /********************************** errors **********************************/ 'error' : 'Fout', 'errUnknown' : 'Onbekend fout.', 'errUnknownCmd' : 'Onbekend commando.', 'errJqui' : 'Ongeldige jQuery UI configuratie. Selectable, draggable en droppable componenten moeten aanwezig zijn.', 'errNode' : 'Voor elFinder moet een DOM Element gemaakt worden.', 'errURL' : 'Ongeldige elFinder configuratie! URL optie is niet ingesteld.', 'errAccess' : 'Toegang geweigerd.', 'errConnect' : 'Kan geen verbinding met de backend maken.', 'errAbort' : 'Verbinding afgebroken.', 'errTimeout' : 'Verbinding time-out.', 'errNotFound' : 'Backend niet gevonden.', 'errResponse' : 'Ongeldige reactie van de backend.', 'errConf' : 'Ongeldige backend configuratie.', 'errJSON' : 'PHP JSON module niet geïnstalleerd.', 'errNoVolumes' : 'Leesbaar volume is niet beschikbaar.', 'errCmdParams' : 'Ongeldige parameters voor commando "$1".', 'errDataNotJSON' : 'Data is niet JSON.', 'errDataEmpty' : 'Data is leeg.', 'errCmdReq' : 'Backend verzoek heeft een commando naam nodig.', 'errOpen' : 'Kan "$1" niet openen.', 'errNotFolder' : 'Object is geen map.', 'errNotFile' : 'Object is geen bestand.', 'errRead' : 'Kan "$1" niet lezen.', 'errWrite' : 'Kan niet schrijven in "$1".', 'errPerm' : 'Toegang geweigerd.', 'errLocked' : '"$1" is vergrendeld en kan niet hernoemd, verplaats of verwijderd worden.', 'errExists' : 'Bestand "$1" bestaat al.', 'errInvName' : 'Ongeldige bestandsnaam.', 'errFolderNotFound' : 'Map niet gevonden.', 'errFileNotFound' : 'Bestand niet gevonden.', 'errTrgFolderNotFound' : 'Doelmap"$1" niet gevonden.', 'errPopup' : 'De browser heeft voorkomen dat de pop-up is geopend. Pas de browser instellingen aan om de popup te kunnen openen.', 'errMkdir' : 'Kan map "$1" niet aanmaken.', 'errMkfile' : 'Kan bestand "$1" niet aanmaken.', 'errRename' : 'Kan "$1" niet hernoemen.', 'errCopyFrom' : 'Bestanden kopiëren van "$1" is niet toegestaan.', 'errCopyTo' : 'Bestanden kopiëren naar "$1" is niet toegestaan.', 'errMkOutLink' : 'Kan geen link maken buiten de hoofdmap.', // from v2.1 added 03.10.2015 'errUpload' : 'Upload fout.', // old name - errUploadCommon 'errUploadFile' : 'Kan "$1" niet uploaden.', // old name - errUpload 'errUploadNoFiles' : 'Geen bestanden gevonden om te uploaden.', 'errUploadTotalSize' : 'Data overschrijdt de maximale grootte.', // old name - errMaxSize 'errUploadFileSize' : 'Bestand overschrijdt de maximale grootte.', // old name - errFileMaxSize 'errUploadMime' : 'Bestandstype niet toegestaan.', 'errUploadTransfer' : '"$1" overdrachtsfout.', 'errUploadTemp' : 'Kan geen tijdelijk bestand voor de upload maken.', // from v2.1 added 26.09.2015 'errNotReplace' : 'Object "$1" bestaat al op deze locatie en kan niet vervangen worden door een ander type object.', // new 'errReplace' : 'Kan "$1" niet vervangen.', 'errSave' : 'Kan "$1" niet opslaan.', 'errCopy' : 'Kan "$1" niet kopiëren.', 'errMove' : 'Kan "$1" niet verplaatsen.', 'errCopyInItself' : 'Kan "$1" niet in zichzelf kopiëren.', 'errRm' : 'Kan "$1" niet verwijderen.', 'errRmSrc' : 'Kan bronbestanden niet verwijderen.', 'errExtract' : 'Kan de bestanden van "$1" niet uitpakken.', 'errArchive' : 'Kan het archief niet maken.', 'errArcType' : 'Archief type is niet ondersteund.', 'errNoArchive' : 'Bestand is geen archief of geen ondersteund archief type.', 'errCmdNoSupport' : 'Backend ondersteund dit commando niet.', 'errReplByChild' : 'De map "$1" kan niet vervangen worden door een item uit die map.', 'errArcSymlinks' : 'Om veiligheidsredenen kan een bestand met symlinks of bestanden met niet toegestane namen niet worden uitgepakt .', // edited 24.06.2012 'errArcMaxSize' : 'Archief overschrijdt de maximale bestandsgrootte.', 'errResize' : 'Kan het formaat van "$1" niet wijzigen.', 'errResizeDegree' : 'Ongeldig aantal graden om te draaien.', // added 7.3.2013 'errResizeRotate' : 'Afbeelding kan niet gedraaid worden.', // added 7.3.2013 'errResizeSize' : 'Ongeldig afbeelding formaat.', // added 7.3.2013 'errResizeNoChange' : 'Afbeelding formaat is niet veranderd.', // added 7.3.2013 'errUsupportType' : 'Bestandstype wordt niet ondersteund.', 'errNotUTF8Content' : 'Bestand "$1" is niet in UTF-8 and kan niet aangepast worden.', // added 9.11.2011 'errNetMount' : 'Kan "$1" niet mounten.', // added 17.04.2012 'errNetMountNoDriver' : 'Niet ondersteund protocol.', // added 17.04.2012 'errNetMountFailed' : 'Mount mislukt.', // added 17.04.2012 'errNetMountHostReq' : 'Host is verplicht.', // added 18.04.2012 'errSessionExpires' : 'Uw sessie is verlopen vanwege inactiviteit.', 'errCreatingTempDir' : 'Kan de tijdelijke map niet aanmaken: "$1" ', 'errFtpDownloadFile' : 'Kan het bestand niet downloaden vanaf FTP: "$1"', 'errFtpUploadFile' : 'Kan het bestand niet uploaden naar FTP: "$1"', 'errFtpMkdir' : 'Kan het externe map niet aanmaken op de FTP-server: "$1"', 'errArchiveExec' : 'Er is een fout opgetreden bij het archivering van de bestanden: "$1" ', 'errExtractExec' : 'Er is een fout opgetreden bij het uitpakken van de bestanden: "$1" ', 'errNetUnMount' : 'Kan niet unmounten', // from v2.1 added 30.04.2012 'errConvUTF8' : 'Kan niet converteren naar UTF-8', // from v2.1 added 08.04.2014 'errFolderUpload' : 'Probeer Google Chrome, als je de map wil uploaden.', // from v2.1 added 26.6.2015 /******************************* commands names ********************************/ 'cmdarchive' : 'Maak archief', 'cmdback' : 'Vorige', 'cmdcopy' : 'Kopieer', 'cmdcut' : 'Knip', 'cmddownload' : 'Download', 'cmdduplicate' : 'Dupliceer', 'cmdedit' : 'Pas bestand aan', 'cmdextract' : 'Bestanden uit archief uitpakken', 'cmdforward' : 'Volgende', 'cmdgetfile' : 'Kies bestanden', 'cmdhelp' : 'Over deze software', 'cmdhome' : 'Home', 'cmdinfo' : 'Bekijk info', 'cmdmkdir' : 'Nieuwe map', 'cmdmkfile' : 'Nieuw tekstbestand', 'cmdopen' : 'Open', 'cmdpaste' : 'Plak', 'cmdquicklook' : 'Voorbeeld', 'cmdreload' : 'Vernieuwen', 'cmdrename' : 'Naam wijzigen', 'cmdrm' : 'Verwijder', 'cmdsearch' : 'Zoek bestanden', 'cmdup' : 'Ga een map hoger', 'cmdupload' : 'Upload bestanden', 'cmdview' : 'Bekijk', 'cmdresize' : 'Formaat wijzigen', 'cmdsort' : 'Sorteren', 'cmdnetmount' : 'Mount netwerk volume', // added 18.04.2012 'cmdnetunmount': 'Unmount', // from v2.1 added 30.04.2012 'cmdplaces' : 'Naar Plaatsen', // added 28.12.2014 'cmdchmod' : 'Wijzig modus', // from v2.1 added 20.6.2015 /*********************************** buttons ***********************************/ 'btnClose' : 'Sluit', 'btnSave' : 'Opslaan', 'btnRm' : 'Verwijder', 'btnApply' : 'Toepassen', 'btnCancel' : 'Annuleren', 'btnNo' : 'Nee', 'btnYes' : 'Ja', 'btnMount' : 'Mount', // added 18.04.2012 'btnApprove': 'Ga naar $1 & keur goed', // from v2.1 added 26.04.2012 'btnUnmount': 'Unmount', // from v2.1 added 30.04.2012 'btnConv' : 'Converteer', // from v2.1 added 08.04.2014 'btnCwd' : 'Hier', // from v2.1 added 22.5.2015 'btnVolume' : 'Volume', // from v2.1 added 22.5.2015 'btnAll' : 'Alles', // from v2.1 added 22.5.2015 'btnMime' : 'MIME Type', // from v2.1 added 22.5.2015 'btnFileName':'Bestandsnaam', // from v2.1 added 22.5.2015 'btnSaveClose': 'Opslaan & Sluiten', // from v2.1 added 12.6.2015 'btnBackup' : 'Back-up', // fromv2.1 added 28.11.2015 /******************************** notifications ********************************/ 'ntfopen' : 'Bezig met openen van map', 'ntffile' : 'Bezig met openen bestand', 'ntfreload' : 'Herladen map inhoud', 'ntfmkdir' : 'Bezig met map maken', 'ntfmkfile' : 'Bezig met Bestanden maken', 'ntfrm' : 'Verwijderen bestanden', 'ntfcopy' : 'Kopieer bestanden', 'ntfmove' : 'Verplaats bestanden', 'ntfprepare' : 'Voorbereiden kopiëren', 'ntfrename' : 'Hernoem bestanden', 'ntfupload' : 'Bestanden uploaden actief', 'ntfdownload' : 'Bestanden downloaden actief', 'ntfsave' : 'Bestanden opslaan', 'ntfarchive' : 'Archief aan het maken', 'ntfextract' : 'Bestanden uitpakken actief', 'ntfsearch' : 'Zoeken naar bestanden', 'ntfresize' : 'Formaat wijzigen van afbeeldingen', 'ntfsmth' : 'Iets aan het doen', 'ntfloadimg' : 'Laden van plaatje', 'ntfnetmount' : 'Mounten van netwerk volume', // added 18.04.2012 'ntfnetunmount': 'Unmounten van netwerk volume', // from v2.1 added 30.04.2012 'ntfdim' : 'Opvragen afbeeldingen dimensies', // added 20.05.2013 'ntfreaddir' : 'Map informatie lezen', // from v2.1 added 01.07.2013 'ntfurl' : 'URL van link ophalen', // from v2.1 added 11.03.2014 'ntfchmod' : 'Bestandsmodus wijzigen', // from v2.1 added 20.6.2015 'ntfpreupload': 'Upload bestandsnaam verifiëren', // from v2.1 added 31.11.2015 /************************************ dates **********************************/ 'dateUnknown' : 'onbekend', 'Today' : 'Vandaag', 'Yesterday' : 'Gisteren', 'msJan' : 'Jan', 'msFeb' : 'Feb', 'msMar' : 'Mar', 'msApr' : 'Apr', 'msMay' : 'Mei', 'msJun' : 'Jun', 'msJul' : 'Jul', 'msAug' : 'Aug', 'msSep' : 'Sep', 'msOct' : 'Okt', 'msNov' : 'Nov', 'msDec' : 'Dec', 'January' : 'Januari', 'February' : 'Februari', 'March' : 'Maart', 'April' : 'April', 'May' : 'Mei', 'June' : 'Juni', 'July' : 'Juli', 'August' : 'Augustus', 'September' : 'September', 'October' : 'Oktober', 'November' : 'November', 'December' : 'December', 'Sunday' : 'Zondag', 'Monday' : 'Maandag', 'Tuesday' : 'Dinsdag', 'Wednesday' : 'Woensdag', 'Thursday' : 'Donderdag', 'Friday' : 'Vrijdag', 'Saturday' : 'Zaterdag', 'Sun' : 'Zo', 'Mon' : 'Ma', 'Tue' : 'Di', 'Wed' : 'Wo', 'Thu' : 'Do', 'Fri' : 'Vr', 'Sat' : 'Za', /******************************** sort variants ********************************/ 'sortname' : 'op naam', 'sortkind' : 'op type', 'sortsize' : 'op grootte', 'sortdate' : 'op datum', 'sortFoldersFirst' : 'Mappen eerst', /********************************** new items **********************************/ 'untitled file.txt' : 'NieuwBestand.txt', // added 10.11.2015 'untitled folder' : 'NieuweMap', // added 10.11.2015 'Archive' : 'NieuwArchief', // from v2.1 added 10.11.2015 /********************************** messages **********************************/ 'confirmReq' : 'Bevestiging nodig', 'confirmRm' : 'Weet u zeker dat u deze bestanden wil verwijderen?<br/>Deze actie kan niet ongedaan gemaakt worden!', 'confirmRepl' : 'Oud bestand vervangen door het nieuwe bestand?', 'confirmConvUTF8' : 'Niet in UTF-8<br/>Converteren naar UTF-8?<br/>De inhoud wordt UTF-8 door op te slaan na de conversie.', // from v2.1 added 08.04.2014 'confirmNotSave' : 'Het is aangepast.<br/>Wijzigingen gaan verloren als je niet opslaat.', // from v2.1 added 15.7.2015 'apllyAll' : 'Toepassen op alles', 'name' : 'Naam', 'size' : 'Grootte', 'perms' : 'Rechten', 'modify' : 'Aangepast', 'kind' : 'Type', 'read' : 'lees', 'write' : 'schrijf', 'noaccess' : 'geen toegang', 'and' : 'en', 'unknown' : 'onbekend', 'selectall' : 'Selecteer alle bestanden', 'selectfiles' : 'Selecteer bestand(en)', 'selectffile' : 'Selecteer eerste bestand', 'selectlfile' : 'Selecteer laatste bestand', 'viewlist' : 'Lijst weergave', 'viewicons' : 'Icoon weergave', 'places' : 'Plaatsen', 'calc' : 'Bereken', 'path' : 'Pad', 'aliasfor' : 'Alias voor', 'locked' : 'Vergrendeld', 'dim' : 'Dimensies', 'files' : 'Bestanden', 'folders' : 'Mappen', 'items' : 'Items', 'yes' : 'ja', 'no' : 'nee', 'link' : 'Link', 'searcresult' : 'Zoek resultaten', 'selected' : 'geselecteerde items', 'about' : 'Over', 'shortcuts' : 'Snelkoppelingen', 'help' : 'Help', 'webfm' : 'Web bestandsmanager', 'ver' : 'Versie', 'protocolver' : 'protocol versie', 'homepage' : 'Project home', 'docs' : 'Documentatie', 'github' : 'Fork ons op Github', 'twitter' : 'Volg ons op twitter', 'facebook' : 'Wordt lid op facebook', 'team' : 'Team', 'chiefdev' : 'Hoofd ontwikkelaar', 'developer' : 'ontwikkelaar', 'contributor' : 'bijdrager', 'maintainer' : 'onderhouder', 'translator' : 'vertaler', 'icons' : 'Iconen', 'dontforget' : 'En vergeet je handdoek niet!', 'shortcutsof' : 'Snelkoppelingen uitgeschakeld', 'dropFiles' : 'Sleep hier uw bestanden heen', 'or' : 'of', 'selectForUpload' : 'Selecteer bestanden om te uploaden', 'moveFiles' : 'Verplaats bestanden', 'copyFiles' : 'Kopieer bestanden', 'rmFromPlaces' : 'Verwijder uit Plaatsen', 'aspectRatio' : 'Aspect ratio', 'scale' : 'Schaal', 'width' : 'Breedte', 'height' : 'Hoogte', 'resize' : 'Verkleinen', 'crop' : 'Bijsnijden', 'rotate' : 'Draaien', 'rotate-cw' : 'Draai 90 graden rechtsom', 'rotate-ccw' : 'Draai 90 graden linksom', 'degree' : '°', 'netMountDialogTitle' : 'Mount netwerk volume', // added 18.04.2012 'protocol' : 'Protocol', // added 18.04.2012 'host' : 'Host', // added 18.04.2012 'port' : 'Poort', // added 18.04.2012 'user' : 'Gebruikersnaams', // added 18.04.2012 'pass' : 'Wachtwoord', // added 18.04.2012 'confirmUnmount' : 'Weet u zeker dat u $1 wil unmounten?', // from v2.1 added 30.04.2012 'dropFilesBrowser': 'Sleep of plak bestanden vanuit de browser', // from v2.1 added 30.05.2012 'dropPasteFiles' : 'Sleep of plak bestanden hier', // from v2.1 added 07.04.2014 'encoding' : 'Encodering', // from v2.1 added 19.12.2014 'locale' : 'Locale', // from v2.1 added 19.12.2014 'searchTarget' : 'Doel: $1', // from v2.1 added 22.5.2015 'searchMime' : 'Zoek op invoer MIME Type', // from v2.1 added 22.5.2015 'owner' : 'Eigenaar', // from v2.1 added 20.6.2015 'group' : 'Groep', // from v2.1 added 20.6.2015 'other' : 'Overig', // from v2.1 added 20.6.2015 'execute' : 'Uitvoeren', // from v2.1 added 20.6.2015 'perm' : 'Rechten', // from v2.1 added 20.6.2015 'mode' : 'Modus', // from v2.1 added 20.6.2015 /********************************** mimetypes **********************************/ 'kindUnknown' : 'Onbekend', 'kindFolder' : 'Map', 'kindAlias' : 'Alias', 'kindAliasBroken' : 'Kapot alias', // applications 'kindApp' : 'Applicatie', 'kindPostscript' : 'Postscript document', 'kindMsOffice' : 'Microsoft Office document', 'kindMsWord' : 'Microsoft Word document', 'kindMsExcel' : 'Microsoft Excel document', 'kindMsPP' : 'Microsoft Powerpoint presentation', 'kindOO' : 'Open Office document', 'kindAppFlash' : 'Flash applicatie', 'kindPDF' : 'Portable Document Format (PDF)', 'kindTorrent' : 'Bittorrent bestand', 'kind7z' : '7z archief', 'kindTAR' : 'TAR archief', 'kindGZIP' : 'GZIP archief', 'kindBZIP' : 'BZIP archief', 'kindXZ' : 'XZ archief', 'kindZIP' : 'ZIP archief', 'kindRAR' : 'RAR archief', 'kindJAR' : 'Java JAR bestand', 'kindTTF' : 'True Type font', 'kindOTF' : 'Open Type font', 'kindRPM' : 'RPM package', // texts 'kindText' : 'Tekst bestand', 'kindTextPlain' : 'Tekst', 'kindPHP' : 'PHP bronbestand', 'kindCSS' : 'Cascading style sheet', 'kindHTML' : 'HTML document', 'kindJS' : 'Javascript bronbestand', 'kindRTF' : 'Rich Text Format', 'kindC' : 'C bronbestand', 'kindCHeader' : 'C header bronbestand', 'kindCPP' : 'C++ bronbestand', 'kindCPPHeader' : 'C++ header bronbestand', 'kindShell' : 'Unix shell script', 'kindPython' : 'Python bronbestand', 'kindJava' : 'Java bronbestand', 'kindRuby' : 'Ruby bronbestand', 'kindPerl' : 'Perl bronbestand', 'kindSQL' : 'SQL bronbestand', 'kindXML' : 'XML document', 'kindAWK' : 'AWK bronbestand', 'kindCSV' : 'Komma gescheiden waardes', 'kindDOCBOOK' : 'Docbook XML document', 'kindMarkdown' : 'Markdown tekst', // added 20.7.2015 // images 'kindImage' : 'Afbeelding', 'kindBMP' : 'BMP afbeelding', 'kindJPEG' : 'JPEG afbeelding', 'kindGIF' : 'GIF afbeelding', 'kindPNG' : 'PNG afbeelding', 'kindTIFF' : 'TIFF afbeelding', 'kindTGA' : 'TGA afbeelding', 'kindPSD' : 'Adobe Photoshop afbeelding', 'kindXBITMAP' : 'X bitmap afbeelding', 'kindPXM' : 'Pixelmator afbeelding', // media 'kindAudio' : 'Audio media', 'kindAudioMPEG' : 'MPEG audio', 'kindAudioMPEG4' : 'MPEG-4 audio', 'kindAudioMIDI' : 'MIDI audio', 'kindAudioOGG' : 'Ogg Vorbis audio', 'kindAudioWAV' : 'WAV audio', 'AudioPlaylist' : 'MP3 playlist', 'kindVideo' : 'Video media', 'kindVideoDV' : 'DV video', 'kindVideoMPEG' : 'MPEG video', 'kindVideoMPEG4' : 'MPEG-4 video', 'kindVideoAVI' : 'AVI video', 'kindVideoMOV' : 'Quick Time video', 'kindVideoWM' : 'Windows Media video', 'kindVideoFlash' : 'Flash video', 'kindVideoMKV' : 'Matroska video', 'kindVideoOGG' : 'Ogg video' } }; }
pl-redux-admin/src/components/about/AboutPage.js
pinoytech/react-playground
import React, { Component } from 'react'; class AboutPage extends Component { render () { return ( <div> <h1>About</h1> <p className="">This application uses React, Redux, React Router and a variety of other helpful libraries</p> </div> ); } } export default AboutPage;
ajax/libs/onsen/1.3.15/js/onsenui_all.min.js
nolsherry/cdnjs
/*! onsenui - v1.3.15 - 2016-01-14 */ !function(){function getAttributes(element){return Node_get_attributes.call(element)}function setAttribute(element,attribute,value){try{Element_setAttribute.call(element,attribute,value)}catch(e){}}function removeAttribute(element,attribute){Element_removeAttribute.call(element,attribute)}function childNodes(element){return Node_get_childNodes.call(element)}function empty(element){for(;element.childNodes.length;)element.removeChild(element.lastChild)}function insertAdjacentHTML(element,position,html){HTMLElement_insertAdjacentHTMLPropertyDescriptor.value.call(element,position,html)}function inUnsafeMode(){var isUnsafe=!0;try{detectionDiv.innerHTML="<test/>"}catch(ex){isUnsafe=!1}return isUnsafe}function cleanse(html,targetElement){function cleanseAttributes(element){var attributes=getAttributes(element);if(attributes&&attributes.length){for(var events,i=0,len=attributes.length;len>i;i++){var attribute=attributes[i],name=attribute.name;"o"!==name[0]&&"O"!==name[0]||"n"!==name[1]&&"N"!==name[1]||(events=events||[],events.push({name:attribute.name,value:attribute.value}))}if(events)for(var i=0,len=events.length;len>i;i++){var attribute=events[i];removeAttribute(element,attribute.name),setAttribute(element,"x-"+attribute.name,attribute.value)}}for(var children=childNodes(element),i=0,len=children.length;len>i;i++)cleanseAttributes(children[i])}var cleaner=document.implementation.createHTMLDocument("cleaner");empty(cleaner.documentElement),MSApp.execUnsafeLocalFunction(function(){insertAdjacentHTML(cleaner.documentElement,"afterbegin",html)});var scripts=cleaner.documentElement.querySelectorAll("script");Array.prototype.forEach.call(scripts,function(script){switch(script.type.toLowerCase()){case"":script.type="text/inert";break;case"text/javascript":case"text/ecmascript":case"text/x-javascript":case"text/jscript":case"text/livescript":case"text/javascript1.1":case"text/javascript1.2":case"text/javascript1.3":script.type="text/inert-"+script.type.slice("text/".length);break;case"application/javascript":case"application/ecmascript":case"application/x-javascript":script.type="application/inert-"+script.type.slice("application/".length)}}),cleanseAttributes(cleaner.documentElement);var cleanedNodes=[];return"HTML"===targetElement.tagName?cleanedNodes=Array.prototype.slice.call(document.adoptNode(cleaner.documentElement).childNodes):(cleaner.head&&(cleanedNodes=cleanedNodes.concat(Array.prototype.slice.call(document.adoptNode(cleaner.head).childNodes))),cleaner.body&&(cleanedNodes=cleanedNodes.concat(Array.prototype.slice.call(document.adoptNode(cleaner.body).childNodes)))),cleanedNodes}function cleansePropertySetter(property,setter){var propertyDescriptor=Object.getOwnPropertyDescriptor(HTMLElement.prototype,property),originalSetter=propertyDescriptor.set;Object.defineProperty(HTMLElement.prototype,property,{get:propertyDescriptor.get,set:function(value){if(window.WinJS&&window.WinJS._execUnsafe&&inUnsafeMode())originalSetter.call(this,value);else{var that=this,nodes=cleanse(value,that);MSApp.execUnsafeLocalFunction(function(){setter(propertyDescriptor,that,nodes)})}},enumerable:propertyDescriptor.enumerable,configurable:propertyDescriptor.configurable})}if(window.MSApp&&MSApp.execUnsafeLocalFunction){var Element_setAttribute=Object.getOwnPropertyDescriptor(Element.prototype,"setAttribute").value,Element_removeAttribute=Object.getOwnPropertyDescriptor(Element.prototype,"removeAttribute").value,HTMLElement_insertAdjacentHTMLPropertyDescriptor=Object.getOwnPropertyDescriptor(HTMLElement.prototype,"insertAdjacentHTML"),Node_get_attributes=Object.getOwnPropertyDescriptor(Node.prototype,"attributes").get,Node_get_childNodes=Object.getOwnPropertyDescriptor(Node.prototype,"childNodes").get,detectionDiv=document.createElement("div");cleansePropertySetter("innerHTML",function(propertyDescriptor,target,elements){empty(target);for(var i=0,len=elements.length;len>i;i++)target.appendChild(elements[i])}),cleansePropertySetter("outerHTML",function(propertyDescriptor,target,elements){for(var i=0,len=elements.length;len>i;i++)target.insertAdjacentElement("afterend",elements[i]);target.parentNode.removeChild(target)})}}(),function(window,document,undefined){"use strict";function minErr(module,ErrorConstructor){return ErrorConstructor=ErrorConstructor||Error,function(){var paramPrefix,i,SKIP_INDEXES=2,templateArgs=arguments,code=templateArgs[0],message="["+(module?module+":":"")+code+"] ",template=templateArgs[1];for(message+=template.replace(/\{\d+\}/g,function(match){var index=+match.slice(1,-1),shiftedIndex=index+SKIP_INDEXES;return shiftedIndex<templateArgs.length?toDebugString(templateArgs[shiftedIndex]):match}),message+="\nhttp://errors.angularjs.org/1.4.3/"+(module?module+"/":"")+code,i=SKIP_INDEXES,paramPrefix="?";i<templateArgs.length;i++,paramPrefix="&")message+=paramPrefix+"p"+(i-SKIP_INDEXES)+"="+encodeURIComponent(toDebugString(templateArgs[i]));return new ErrorConstructor(message)}}function isArrayLike(obj){if(null==obj||isWindow(obj))return!1;var length="length"in Object(obj)&&obj.length;return obj.nodeType===NODE_TYPE_ELEMENT&&length?!0:isString(obj)||isArray(obj)||0===length||"number"==typeof length&&length>0&&length-1 in obj}function forEach(obj,iterator,context){var key,length;if(obj)if(isFunction(obj))for(key in obj)"prototype"==key||"length"==key||"name"==key||obj.hasOwnProperty&&!obj.hasOwnProperty(key)||iterator.call(context,obj[key],key,obj);else if(isArray(obj)||isArrayLike(obj)){var isPrimitive="object"!=typeof obj;for(key=0,length=obj.length;length>key;key++)(isPrimitive||key in obj)&&iterator.call(context,obj[key],key,obj)}else if(obj.forEach&&obj.forEach!==forEach)obj.forEach(iterator,context,obj);else if(isBlankObject(obj))for(key in obj)iterator.call(context,obj[key],key,obj);else if("function"==typeof obj.hasOwnProperty)for(key in obj)obj.hasOwnProperty(key)&&iterator.call(context,obj[key],key,obj);else for(key in obj)hasOwnProperty.call(obj,key)&&iterator.call(context,obj[key],key,obj);return obj}function forEachSorted(obj,iterator,context){for(var keys=Object.keys(obj).sort(),i=0;i<keys.length;i++)iterator.call(context,obj[keys[i]],keys[i]);return keys}function reverseParams(iteratorFn){return function(value,key){iteratorFn(key,value)}}function nextUid(){return++uid}function setHashKey(obj,h){h?obj.$$hashKey=h:delete obj.$$hashKey}function baseExtend(dst,objs,deep){for(var h=dst.$$hashKey,i=0,ii=objs.length;ii>i;++i){var obj=objs[i];if(isObject(obj)||isFunction(obj))for(var keys=Object.keys(obj),j=0,jj=keys.length;jj>j;j++){var key=keys[j],src=obj[key];deep&&isObject(src)?isDate(src)?dst[key]=new Date(src.valueOf()):(isObject(dst[key])||(dst[key]=isArray(src)?[]:{}),baseExtend(dst[key],[src],!0)):dst[key]=src}}return setHashKey(dst,h),dst}function extend(dst){return baseExtend(dst,slice.call(arguments,1),!1)}function merge(dst){return baseExtend(dst,slice.call(arguments,1),!0)}function toInt(str){return parseInt(str,10)}function inherit(parent,extra){return extend(Object.create(parent),extra)}function noop(){}function identity($){return $}function valueFn(value){return function(){return value}}function hasCustomToString(obj){return isFunction(obj.toString)&&obj.toString!==Object.prototype.toString}function isUndefined(value){return"undefined"==typeof value}function isDefined(value){return"undefined"!=typeof value}function isObject(value){return null!==value&&"object"==typeof value}function isBlankObject(value){return null!==value&&"object"==typeof value&&!getPrototypeOf(value)}function isString(value){return"string"==typeof value}function isNumber(value){return"number"==typeof value}function isDate(value){return"[object Date]"===toString.call(value)}function isFunction(value){return"function"==typeof value}function isRegExp(value){return"[object RegExp]"===toString.call(value)}function isWindow(obj){return obj&&obj.window===obj}function isScope(obj){return obj&&obj.$evalAsync&&obj.$watch}function isFile(obj){return"[object File]"===toString.call(obj)}function isFormData(obj){return"[object FormData]"===toString.call(obj)}function isBlob(obj){return"[object Blob]"===toString.call(obj)}function isBoolean(value){return"boolean"==typeof value}function isPromiseLike(obj){return obj&&isFunction(obj.then)}function isTypedArray(value){return TYPED_ARRAY_REGEXP.test(toString.call(value))}function isElement(node){return!(!node||!(node.nodeName||node.prop&&node.attr&&node.find))}function makeMap(str){var i,obj={},items=str.split(",");for(i=0;i<items.length;i++)obj[items[i]]=!0;return obj}function nodeName_(element){return lowercase(element.nodeName||element[0]&&element[0].nodeName)}function arrayRemove(array,value){var index=array.indexOf(value);return index>=0&&array.splice(index,1),index}function copy(source,destination,stackSource,stackDest){if(isWindow(source)||isScope(source))throw ngMinErr("cpws","Can't copy! Making copies of Window or Scope instances is not supported.");if(isTypedArray(destination))throw ngMinErr("cpta","Can't copy! TypedArray destination cannot be mutated.");if(destination){if(source===destination)throw ngMinErr("cpi","Can't copy! Source and destination are identical.");stackSource=stackSource||[],stackDest=stackDest||[],isObject(source)&&(stackSource.push(source),stackDest.push(destination));var key;if(isArray(source)){destination.length=0;for(var i=0;i<source.length;i++)destination.push(copy(source[i],null,stackSource,stackDest))}else{var h=destination.$$hashKey;if(isArray(destination)?destination.length=0:forEach(destination,function(value,key){delete destination[key]}),isBlankObject(source))for(key in source)destination[key]=copy(source[key],null,stackSource,stackDest);else if(source&&"function"==typeof source.hasOwnProperty)for(key in source)source.hasOwnProperty(key)&&(destination[key]=copy(source[key],null,stackSource,stackDest));else for(key in source)hasOwnProperty.call(source,key)&&(destination[key]=copy(source[key],null,stackSource,stackDest));setHashKey(destination,h)}}else if(destination=source,isObject(source)){var index;if(stackSource&&-1!==(index=stackSource.indexOf(source)))return stackDest[index];if(isArray(source))return copy(source,[],stackSource,stackDest);if(isTypedArray(source))destination=new source.constructor(source);else if(isDate(source))destination=new Date(source.getTime());else{if(!isRegExp(source)){var emptyObject=Object.create(getPrototypeOf(source));return copy(source,emptyObject,stackSource,stackDest)}destination=new RegExp(source.source,source.toString().match(/[^\/]*$/)[0]),destination.lastIndex=source.lastIndex}stackDest&&(stackSource.push(source),stackDest.push(destination))}return destination}function shallowCopy(src,dst){if(isArray(src)){dst=dst||[];for(var i=0,ii=src.length;ii>i;i++)dst[i]=src[i]}else if(isObject(src)){dst=dst||{};for(var key in src)("$"!==key.charAt(0)||"$"!==key.charAt(1))&&(dst[key]=src[key])}return dst||src}function equals(o1,o2){if(o1===o2)return!0;if(null===o1||null===o2)return!1;if(o1!==o1&&o2!==o2)return!0;var length,key,keySet,t1=typeof o1,t2=typeof o2;if(t1==t2&&"object"==t1){if(!isArray(o1)){if(isDate(o1))return isDate(o2)?equals(o1.getTime(),o2.getTime()):!1;if(isRegExp(o1))return isRegExp(o2)?o1.toString()==o2.toString():!1;if(isScope(o1)||isScope(o2)||isWindow(o1)||isWindow(o2)||isArray(o2)||isDate(o2)||isRegExp(o2))return!1;keySet=createMap();for(key in o1)if("$"!==key.charAt(0)&&!isFunction(o1[key])){if(!equals(o1[key],o2[key]))return!1;keySet[key]=!0}for(key in o2)if(!(key in keySet||"$"===key.charAt(0)||o2[key]===undefined||isFunction(o2[key])))return!1;return!0}if(!isArray(o2))return!1;if((length=o1.length)==o2.length){for(key=0;length>key;key++)if(!equals(o1[key],o2[key]))return!1;return!0}}return!1}function concat(array1,array2,index){return array1.concat(slice.call(array2,index))}function sliceArgs(args,startIndex){return slice.call(args,startIndex||0)}function bind(self,fn){var curryArgs=arguments.length>2?sliceArgs(arguments,2):[];return!isFunction(fn)||fn instanceof RegExp?fn:curryArgs.length?function(){return arguments.length?fn.apply(self,concat(curryArgs,arguments,0)):fn.apply(self,curryArgs)}:function(){return arguments.length?fn.apply(self,arguments):fn.call(self)}}function toJsonReplacer(key,value){var val=value;return"string"==typeof key&&"$"===key.charAt(0)&&"$"===key.charAt(1)?val=undefined:isWindow(value)?val="$WINDOW":value&&document===value?val="$DOCUMENT":isScope(value)&&(val="$SCOPE"),val}function toJson(obj,pretty){return"undefined"==typeof obj?undefined:(isNumber(pretty)||(pretty=pretty?2:null),JSON.stringify(obj,toJsonReplacer,pretty))}function fromJson(json){return isString(json)?JSON.parse(json):json}function timezoneToOffset(timezone,fallback){var requestedTimezoneOffset=Date.parse("Jan 01, 1970 00:00:00 "+timezone)/6e4;return isNaN(requestedTimezoneOffset)?fallback:requestedTimezoneOffset}function addDateMinutes(date,minutes){return date=new Date(date.getTime()),date.setMinutes(date.getMinutes()+minutes),date}function convertTimezoneToLocal(date,timezone,reverse){reverse=reverse?-1:1;var timezoneOffset=timezoneToOffset(timezone,date.getTimezoneOffset());return addDateMinutes(date,reverse*(timezoneOffset-date.getTimezoneOffset()))}function startingTag(element){element=jqLite(element).clone();try{element.empty()}catch(e){}var elemHtml=jqLite("<div>").append(element).html();try{return element[0].nodeType===NODE_TYPE_TEXT?lowercase(elemHtml):elemHtml.match(/^(<[^>]+>)/)[1].replace(/^<([\w\-]+)/,function(match,nodeName){return"<"+lowercase(nodeName)})}catch(e){return lowercase(elemHtml)}}function tryDecodeURIComponent(value){try{return decodeURIComponent(value)}catch(e){}}function parseKeyValue(keyValue){var key_value,key,obj={};return forEach((keyValue||"").split("&"),function(keyValue){if(keyValue&&(key_value=keyValue.replace(/\+/g,"%20").split("="),key=tryDecodeURIComponent(key_value[0]),isDefined(key))){var val=isDefined(key_value[1])?tryDecodeURIComponent(key_value[1]):!0;hasOwnProperty.call(obj,key)?isArray(obj[key])?obj[key].push(val):obj[key]=[obj[key],val]:obj[key]=val}}),obj}function toKeyValue(obj){var parts=[];return forEach(obj,function(value,key){isArray(value)?forEach(value,function(arrayValue){parts.push(encodeUriQuery(key,!0)+(arrayValue===!0?"":"="+encodeUriQuery(arrayValue,!0)))}):parts.push(encodeUriQuery(key,!0)+(value===!0?"":"="+encodeUriQuery(value,!0)))}),parts.length?parts.join("&"):""}function encodeUriSegment(val){return encodeUriQuery(val,!0).replace(/%26/gi,"&").replace(/%3D/gi,"=").replace(/%2B/gi,"+")}function encodeUriQuery(val,pctEncodeSpaces){return encodeURIComponent(val).replace(/%40/gi,"@").replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%3B/gi,";").replace(/%20/g,pctEncodeSpaces?"%20":"+")}function getNgAttribute(element,ngAttr){var attr,i,ii=ngAttrPrefixes.length;for(i=0;ii>i;++i)if(attr=ngAttrPrefixes[i]+ngAttr,isString(attr=element.getAttribute(attr)))return attr;return null}function angularInit(element,bootstrap){var appElement,module,config={};forEach(ngAttrPrefixes,function(prefix){var name=prefix+"app";!appElement&&element.hasAttribute&&element.hasAttribute(name)&&(appElement=element,module=element.getAttribute(name))}),forEach(ngAttrPrefixes,function(prefix){var candidate,name=prefix+"app";!appElement&&(candidate=element.querySelector("["+name.replace(":","\\:")+"]"))&&(appElement=candidate,module=candidate.getAttribute(name))}),appElement&&(config.strictDi=null!==getNgAttribute(appElement,"strict-di"),bootstrap(appElement,module?[module]:[],config))}function bootstrap(element,modules,config){isObject(config)||(config={});var defaultConfig={strictDi:!1};config=extend(defaultConfig,config);var doBootstrap=function(){if(element=jqLite(element),element.injector()){var tag=element[0]===document?"document":startingTag(element);throw ngMinErr("btstrpd","App Already Bootstrapped with this Element '{0}'",tag.replace(/</,"&lt;").replace(/>/,"&gt;"))}modules=modules||[],modules.unshift(["$provide",function($provide){$provide.value("$rootElement",element)}]),config.debugInfoEnabled&&modules.push(["$compileProvider",function($compileProvider){$compileProvider.debugInfoEnabled(!0)}]),modules.unshift("ng");var injector=createInjector(modules,config.strictDi);return injector.invoke(["$rootScope","$rootElement","$compile","$injector",function(scope,element,compile,injector){scope.$apply(function(){element.data("$injector",injector),compile(element)(scope)})}]),injector},NG_ENABLE_DEBUG_INFO=/^NG_ENABLE_DEBUG_INFO!/,NG_DEFER_BOOTSTRAP=/^NG_DEFER_BOOTSTRAP!/;return window&&NG_ENABLE_DEBUG_INFO.test(window.name)&&(config.debugInfoEnabled=!0,window.name=window.name.replace(NG_ENABLE_DEBUG_INFO,"")),window&&!NG_DEFER_BOOTSTRAP.test(window.name)?doBootstrap():(window.name=window.name.replace(NG_DEFER_BOOTSTRAP,""),angular.resumeBootstrap=function(extraModules){return forEach(extraModules,function(module){modules.push(module)}),doBootstrap()},void(isFunction(angular.resumeDeferredBootstrap)&&angular.resumeDeferredBootstrap()))}function reloadWithDebugInfo(){window.name="NG_ENABLE_DEBUG_INFO!"+window.name,window.location.reload()}function getTestability(rootElement){var injector=angular.element(rootElement).injector();if(!injector)throw ngMinErr("test","no injector found for element argument to getTestability");return injector.get("$$testability")}function snake_case(name,separator){return separator=separator||"_",name.replace(SNAKE_CASE_REGEXP,function(letter,pos){return(pos?separator:"")+letter.toLowerCase()})}function bindJQuery(){var originalCleanData;if(!bindJQueryFired){var jqName=jq();jQuery=window.jQuery,isDefined(jqName)&&(jQuery=null===jqName?undefined:window[jqName]),jQuery&&jQuery.fn.on?(jqLite=jQuery,extend(jQuery.fn,{scope:JQLitePrototype.scope,isolateScope:JQLitePrototype.isolateScope,controller:JQLitePrototype.controller,injector:JQLitePrototype.injector,inheritedData:JQLitePrototype.inheritedData}),originalCleanData=jQuery.cleanData,jQuery.cleanData=function(elems){var events;if(skipDestroyOnNextJQueryCleanData)skipDestroyOnNextJQueryCleanData=!1;else for(var elem,i=0;null!=(elem=elems[i]);i++)events=jQuery._data(elem,"events"),events&&events.$destroy&&jQuery(elem).triggerHandler("$destroy");originalCleanData(elems)}):jqLite=JQLite,angular.element=jqLite,bindJQueryFired=!0}}function assertArg(arg,name,reason){if(!arg)throw ngMinErr("areq","Argument '{0}' is {1}",name||"?",reason||"required");return arg}function assertArgFn(arg,name,acceptArrayAnnotation){return acceptArrayAnnotation&&isArray(arg)&&(arg=arg[arg.length-1]),assertArg(isFunction(arg),name,"not a function, got "+(arg&&"object"==typeof arg?arg.constructor.name||"Object":typeof arg)),arg}function assertNotHasOwnProperty(name,context){if("hasOwnProperty"===name)throw ngMinErr("badname","hasOwnProperty is not a valid {0} name",context)}function getter(obj,path,bindFnToScope){if(!path)return obj;for(var key,keys=path.split("."),lastInstance=obj,len=keys.length,i=0;len>i;i++)key=keys[i],obj&&(obj=(lastInstance=obj)[key]);return!bindFnToScope&&isFunction(obj)?bind(lastInstance,obj):obj}function getBlockNodes(nodes){var node=nodes[0],endNode=nodes[nodes.length-1],blockNodes=[node];do{if(node=node.nextSibling,!node)break;blockNodes.push(node)}while(node!==endNode);return jqLite(blockNodes)}function createMap(){return Object.create(null)}function setupModuleLoader(window){function ensure(obj,name,factory){return obj[name]||(obj[name]=factory())}var $injectorMinErr=minErr("$injector"),ngMinErr=minErr("ng"),angular=ensure(window,"angular",Object);return angular.$$minErr=angular.$$minErr||minErr,ensure(angular,"module",function(){var modules={};return function(name,requires,configFn){var assertNotHasOwnProperty=function(name,context){if("hasOwnProperty"===name)throw ngMinErr("badname","hasOwnProperty is not a valid {0} name",context)};return assertNotHasOwnProperty(name,"module"),requires&&modules.hasOwnProperty(name)&&(modules[name]=null),ensure(modules,name,function(){function invokeLater(provider,method,insertMethod,queue){return queue||(queue=invokeQueue),function(){return queue[insertMethod||"push"]([provider,method,arguments]),moduleInstance}}function invokeLaterAndSetModuleName(provider,method){return function(recipeName,factoryFunction){return factoryFunction&&isFunction(factoryFunction)&&(factoryFunction.$$moduleName=name),invokeQueue.push([provider,method,arguments]),moduleInstance}}if(!requires)throw $injectorMinErr("nomod","Module '{0}' is not available! You either misspelled the module name or forgot to load it. If registering a module ensure that you specify the dependencies as the second argument.",name);var invokeQueue=[],configBlocks=[],runBlocks=[],config=invokeLater("$injector","invoke","push",configBlocks),moduleInstance={_invokeQueue:invokeQueue,_configBlocks:configBlocks,_runBlocks:runBlocks,requires:requires,name:name,provider:invokeLaterAndSetModuleName("$provide","provider"),factory:invokeLaterAndSetModuleName("$provide","factory"),service:invokeLaterAndSetModuleName("$provide","service"),value:invokeLater("$provide","value"),constant:invokeLater("$provide","constant","unshift"),decorator:invokeLaterAndSetModuleName("$provide","decorator"),animation:invokeLaterAndSetModuleName("$animateProvider","register"),filter:invokeLaterAndSetModuleName("$filterProvider","register"),controller:invokeLaterAndSetModuleName("$controllerProvider","register"),directive:invokeLaterAndSetModuleName("$compileProvider","directive"),config:config,run:function(block){return runBlocks.push(block),this}};return configFn&&config(configFn),moduleInstance})}})}function serializeObject(obj){var seen=[];return JSON.stringify(obj,function(key,val){if(val=toJsonReplacer(key,val),isObject(val)){if(seen.indexOf(val)>=0)return"<<already seen>>";seen.push(val)}return val})}function toDebugString(obj){return"function"==typeof obj?obj.toString().replace(/ \{[\s\S]*$/,""):"undefined"==typeof obj?"undefined":"string"!=typeof obj?serializeObject(obj):obj}function publishExternalAPI(angular){extend(angular,{bootstrap:bootstrap,copy:copy,extend:extend,merge:merge,equals:equals,element:jqLite,forEach:forEach,injector:createInjector,noop:noop,bind:bind,toJson:toJson,fromJson:fromJson,identity:identity,isUndefined:isUndefined,isDefined:isDefined,isString:isString,isFunction:isFunction,isObject:isObject,isNumber:isNumber,isElement:isElement,isArray:isArray,version:version,isDate:isDate,lowercase:lowercase,uppercase:uppercase,callbacks:{counter:0},getTestability:getTestability,$$minErr:minErr,$$csp:csp,reloadWithDebugInfo:reloadWithDebugInfo}),angularModule=setupModuleLoader(window);try{angularModule("ngLocale")}catch(e){angularModule("ngLocale",[]).provider("$locale",$LocaleProvider)}angularModule("ng",["ngLocale"],["$provide",function($provide){$provide.provider({$$sanitizeUri:$$SanitizeUriProvider}),$provide.provider("$compile",$CompileProvider).directive({a:htmlAnchorDirective,input:inputDirective,textarea:inputDirective,form:formDirective,script:scriptDirective,select:selectDirective,style:styleDirective,option:optionDirective,ngBind:ngBindDirective,ngBindHtml:ngBindHtmlDirective,ngBindTemplate:ngBindTemplateDirective,ngClass:ngClassDirective,ngClassEven:ngClassEvenDirective,ngClassOdd:ngClassOddDirective,ngCloak:ngCloakDirective,ngController:ngControllerDirective,ngForm:ngFormDirective,ngHide:ngHideDirective,ngIf:ngIfDirective,ngInclude:ngIncludeDirective,ngInit:ngInitDirective,ngNonBindable:ngNonBindableDirective,ngPluralize:ngPluralizeDirective,ngRepeat:ngRepeatDirective,ngShow:ngShowDirective,ngStyle:ngStyleDirective,ngSwitch:ngSwitchDirective,ngSwitchWhen:ngSwitchWhenDirective,ngSwitchDefault:ngSwitchDefaultDirective,ngOptions:ngOptionsDirective,ngTransclude:ngTranscludeDirective,ngModel:ngModelDirective,ngList:ngListDirective,ngChange:ngChangeDirective,pattern:patternDirective,ngPattern:patternDirective,required:requiredDirective,ngRequired:requiredDirective,minlength:minlengthDirective,ngMinlength:minlengthDirective,maxlength:maxlengthDirective,ngMaxlength:maxlengthDirective,ngValue:ngValueDirective,ngModelOptions:ngModelOptionsDirective}).directive({ngInclude:ngIncludeFillContentDirective}).directive(ngAttributeAliasDirectives).directive(ngEventDirectives),$provide.provider({$anchorScroll:$AnchorScrollProvider,$animate:$AnimateProvider,$$animateQueue:$$CoreAnimateQueueProvider,$$AnimateRunner:$$CoreAnimateRunnerProvider,$browser:$BrowserProvider,$cacheFactory:$CacheFactoryProvider,$controller:$ControllerProvider,$document:$DocumentProvider,$exceptionHandler:$ExceptionHandlerProvider,$filter:$FilterProvider,$interpolate:$InterpolateProvider,$interval:$IntervalProvider,$http:$HttpProvider,$httpParamSerializer:$HttpParamSerializerProvider,$httpParamSerializerJQLike:$HttpParamSerializerJQLikeProvider,$httpBackend:$HttpBackendProvider,$location:$LocationProvider,$log:$LogProvider,$parse:$ParseProvider,$rootScope:$RootScopeProvider,$q:$QProvider,$$q:$$QProvider,$sce:$SceProvider,$sceDelegate:$SceDelegateProvider,$sniffer:$SnifferProvider,$templateCache:$TemplateCacheProvider,$templateRequest:$TemplateRequestProvider,$$testability:$$TestabilityProvider,$timeout:$TimeoutProvider,$window:$WindowProvider,$$rAF:$$RAFProvider,$$jqLite:$$jqLiteProvider,$$HashMap:$$HashMapProvider,$$cookieReader:$$CookieReaderProvider})}])}function jqNextId(){return++jqId}function camelCase(name){return name.replace(SPECIAL_CHARS_REGEXP,function(_,separator,letter,offset){return offset?letter.toUpperCase():letter}).replace(MOZ_HACK_REGEXP,"Moz$1")}function jqLiteIsTextNode(html){return!HTML_REGEXP.test(html)}function jqLiteAcceptsData(node){var nodeType=node.nodeType;return nodeType===NODE_TYPE_ELEMENT||!nodeType||nodeType===NODE_TYPE_DOCUMENT}function jqLiteHasData(node){for(var key in jqCache[node.ng339])return!0;return!1}function jqLiteBuildFragment(html,context){var tmp,tag,wrap,i,fragment=context.createDocumentFragment(),nodes=[];if(jqLiteIsTextNode(html))nodes.push(context.createTextNode(html));else{for(tmp=tmp||fragment.appendChild(context.createElement("div")),tag=(TAG_NAME_REGEXP.exec(html)||["",""])[1].toLowerCase(),wrap=wrapMap[tag]||wrapMap._default,tmp.innerHTML=wrap[1]+html.replace(XHTML_TAG_REGEXP,"<$1></$2>")+wrap[2],i=wrap[0];i--;)tmp=tmp.lastChild;nodes=concat(nodes,tmp.childNodes),tmp=fragment.firstChild,tmp.textContent=""}return fragment.textContent="",fragment.innerHTML="",forEach(nodes,function(node){fragment.appendChild(node)}),fragment}function jqLiteParseHTML(html,context){context=context||document;var parsed;return(parsed=SINGLE_TAG_REGEXP.exec(html))?[context.createElement(parsed[1])]:(parsed=jqLiteBuildFragment(html,context))?parsed.childNodes:[]}function JQLite(element){if(element instanceof JQLite)return element;var argIsString;if(isString(element)&&(element=trim(element),argIsString=!0),!(this instanceof JQLite)){if(argIsString&&"<"!=element.charAt(0))throw jqLiteMinErr("nosel","Looking up elements via selectors is not supported by jqLite! See: http://docs.angularjs.org/api/angular.element");return new JQLite(element)}argIsString?jqLiteAddNodes(this,jqLiteParseHTML(element)):jqLiteAddNodes(this,element)}function jqLiteClone(element){return element.cloneNode(!0)}function jqLiteDealoc(element,onlyDescendants){if(onlyDescendants||jqLiteRemoveData(element),element.querySelectorAll)for(var descendants=element.querySelectorAll("*"),i=0,l=descendants.length;l>i;i++)jqLiteRemoveData(descendants[i])}function jqLiteOff(element,type,fn,unsupported){if(isDefined(unsupported))throw jqLiteMinErr("offargs","jqLite#off() does not support the `selector` argument");var expandoStore=jqLiteExpandoStore(element),events=expandoStore&&expandoStore.events,handle=expandoStore&&expandoStore.handle;if(handle)if(type)forEach(type.split(" "),function(type){if(isDefined(fn)){var listenerFns=events[type];if(arrayRemove(listenerFns||[],fn),listenerFns&&listenerFns.length>0)return}removeEventListenerFn(element,type,handle),delete events[type]});else for(type in events)"$destroy"!==type&&removeEventListenerFn(element,type,handle),delete events[type]}function jqLiteRemoveData(element,name){var expandoId=element.ng339,expandoStore=expandoId&&jqCache[expandoId];if(expandoStore){if(name)return void delete expandoStore.data[name];expandoStore.handle&&(expandoStore.events.$destroy&&expandoStore.handle({},"$destroy"),jqLiteOff(element)),delete jqCache[expandoId],element.ng339=undefined}}function jqLiteExpandoStore(element,createIfNecessary){var expandoId=element.ng339,expandoStore=expandoId&&jqCache[expandoId];return createIfNecessary&&!expandoStore&&(element.ng339=expandoId=jqNextId(),expandoStore=jqCache[expandoId]={events:{},data:{},handle:undefined}),expandoStore}function jqLiteData(element,key,value){if(jqLiteAcceptsData(element)){var isSimpleSetter=isDefined(value),isSimpleGetter=!isSimpleSetter&&key&&!isObject(key),massGetter=!key,expandoStore=jqLiteExpandoStore(element,!isSimpleGetter),data=expandoStore&&expandoStore.data;if(isSimpleSetter)data[key]=value;else{if(massGetter)return data;if(isSimpleGetter)return data&&data[key];extend(data,key)}}}function jqLiteHasClass(element,selector){return element.getAttribute?(" "+(element.getAttribute("class")||"")+" ").replace(/[\n\t]/g," ").indexOf(" "+selector+" ")>-1:!1}function jqLiteRemoveClass(element,cssClasses){cssClasses&&element.setAttribute&&forEach(cssClasses.split(" "),function(cssClass){element.setAttribute("class",trim((" "+(element.getAttribute("class")||"")+" ").replace(/[\n\t]/g," ").replace(" "+trim(cssClass)+" "," ")))})}function jqLiteAddClass(element,cssClasses){if(cssClasses&&element.setAttribute){var existingClasses=(" "+(element.getAttribute("class")||"")+" ").replace(/[\n\t]/g," ");forEach(cssClasses.split(" "),function(cssClass){cssClass=trim(cssClass),-1===existingClasses.indexOf(" "+cssClass+" ")&&(existingClasses+=cssClass+" ")}),element.setAttribute("class",trim(existingClasses))}}function jqLiteAddNodes(root,elements){if(elements)if(elements.nodeType)root[root.length++]=elements;else{var length=elements.length;if("number"==typeof length&&elements.window!==elements){if(length)for(var i=0;length>i;i++)root[root.length++]=elements[i]}else root[root.length++]=elements}}function jqLiteController(element,name){return jqLiteInheritedData(element,"$"+(name||"ngController")+"Controller")}function jqLiteInheritedData(element,name,value){element.nodeType==NODE_TYPE_DOCUMENT&&(element=element.documentElement);for(var names=isArray(name)?name:[name];element;){for(var i=0,ii=names.length;ii>i;i++)if((value=jqLite.data(element,names[i]))!==undefined)return value;element=element.parentNode||element.nodeType===NODE_TYPE_DOCUMENT_FRAGMENT&&element.host}}function jqLiteEmpty(element){for(jqLiteDealoc(element,!0);element.firstChild;)element.removeChild(element.firstChild)}function jqLiteRemove(element,keepData){keepData||jqLiteDealoc(element);var parent=element.parentNode;parent&&parent.removeChild(element)}function jqLiteDocumentLoaded(action,win){win=win||window,"complete"===win.document.readyState?win.setTimeout(action):jqLite(win).on("load",action)}function getBooleanAttrName(element,name){var booleanAttr=BOOLEAN_ATTR[name.toLowerCase()];return booleanAttr&&BOOLEAN_ELEMENTS[nodeName_(element)]&&booleanAttr}function getAliasedAttrName(element,name){var nodeName=element.nodeName;return("INPUT"===nodeName||"TEXTAREA"===nodeName)&&ALIASED_ATTR[name]}function createEventHandler(element,events){var eventHandler=function(event,type){event.isDefaultPrevented=function(){return event.defaultPrevented};var eventFns=events[type||event.type],eventFnsLength=eventFns?eventFns.length:0;if(eventFnsLength){if(isUndefined(event.immediatePropagationStopped)){var originalStopImmediatePropagation=event.stopImmediatePropagation;event.stopImmediatePropagation=function(){event.immediatePropagationStopped=!0,event.stopPropagation&&event.stopPropagation(),originalStopImmediatePropagation&&originalStopImmediatePropagation.call(event)}}event.isImmediatePropagationStopped=function(){ return event.immediatePropagationStopped===!0},eventFnsLength>1&&(eventFns=shallowCopy(eventFns));for(var i=0;eventFnsLength>i;i++)event.isImmediatePropagationStopped()||eventFns[i].call(element,event)}};return eventHandler.elem=element,eventHandler}function $$jqLiteProvider(){this.$get=function(){return extend(JQLite,{hasClass:function(node,classes){return node.attr&&(node=node[0]),jqLiteHasClass(node,classes)},addClass:function(node,classes){return node.attr&&(node=node[0]),jqLiteAddClass(node,classes)},removeClass:function(node,classes){return node.attr&&(node=node[0]),jqLiteRemoveClass(node,classes)}})}}function hashKey(obj,nextUidFn){var key=obj&&obj.$$hashKey;if(key)return"function"==typeof key&&(key=obj.$$hashKey()),key;var objType=typeof obj;return key="function"==objType||"object"==objType&&null!==obj?obj.$$hashKey=objType+":"+(nextUidFn||nextUid)():objType+":"+obj}function HashMap(array,isolatedUid){if(isolatedUid){var uid=0;this.nextUid=function(){return++uid}}forEach(array,this.put,this)}function anonFn(fn){var fnText=fn.toString().replace(STRIP_COMMENTS,""),args=fnText.match(FN_ARGS);return args?"function("+(args[1]||"").replace(/[\s\r\n]+/," ")+")":"fn"}function annotate(fn,strictDi,name){var $inject,fnText,argDecl,last;if("function"==typeof fn){if(!($inject=fn.$inject)){if($inject=[],fn.length){if(strictDi)throw isString(name)&&name||(name=fn.name||anonFn(fn)),$injectorMinErr("strictdi","{0} is not using explicit annotation and cannot be invoked in strict mode",name);fnText=fn.toString().replace(STRIP_COMMENTS,""),argDecl=fnText.match(FN_ARGS),forEach(argDecl[1].split(FN_ARG_SPLIT),function(arg){arg.replace(FN_ARG,function(all,underscore,name){$inject.push(name)})})}fn.$inject=$inject}}else isArray(fn)?(last=fn.length-1,assertArgFn(fn[last],"fn"),$inject=fn.slice(0,last)):assertArgFn(fn,"fn",!0);return $inject}function createInjector(modulesToLoad,strictDi){function supportObject(delegate){return function(key,value){return isObject(key)?void forEach(key,reverseParams(delegate)):delegate(key,value)}}function provider(name,provider_){if(assertNotHasOwnProperty(name,"service"),(isFunction(provider_)||isArray(provider_))&&(provider_=providerInjector.instantiate(provider_)),!provider_.$get)throw $injectorMinErr("pget","Provider '{0}' must define $get factory method.",name);return providerCache[name+providerSuffix]=provider_}function enforceReturnValue(name,factory){return function(){var result=instanceInjector.invoke(factory,this);if(isUndefined(result))throw $injectorMinErr("undef","Provider '{0}' must return a value from $get factory method.",name);return result}}function factory(name,factoryFn,enforce){return provider(name,{$get:enforce!==!1?enforceReturnValue(name,factoryFn):factoryFn})}function service(name,constructor){return factory(name,["$injector",function($injector){return $injector.instantiate(constructor)}])}function value(name,val){return factory(name,valueFn(val),!1)}function constant(name,value){assertNotHasOwnProperty(name,"constant"),providerCache[name]=value,instanceCache[name]=value}function decorator(serviceName,decorFn){var origProvider=providerInjector.get(serviceName+providerSuffix),orig$get=origProvider.$get;origProvider.$get=function(){var origInstance=instanceInjector.invoke(orig$get,origProvider);return instanceInjector.invoke(decorFn,null,{$delegate:origInstance})}}function loadModules(modulesToLoad){var moduleFn,runBlocks=[];return forEach(modulesToLoad,function(module){function runInvokeQueue(queue){var i,ii;for(i=0,ii=queue.length;ii>i;i++){var invokeArgs=queue[i],provider=providerInjector.get(invokeArgs[0]);provider[invokeArgs[1]].apply(provider,invokeArgs[2])}}if(!loadedModules.get(module)){loadedModules.put(module,!0);try{isString(module)?(moduleFn=angularModule(module),runBlocks=runBlocks.concat(loadModules(moduleFn.requires)).concat(moduleFn._runBlocks),runInvokeQueue(moduleFn._invokeQueue),runInvokeQueue(moduleFn._configBlocks)):isFunction(module)?runBlocks.push(providerInjector.invoke(module)):isArray(module)?runBlocks.push(providerInjector.invoke(module)):assertArgFn(module,"module")}catch(e){throw isArray(module)&&(module=module[module.length-1]),e.message&&e.stack&&-1==e.stack.indexOf(e.message)&&(e=e.message+"\n"+e.stack),$injectorMinErr("modulerr","Failed to instantiate module {0} due to:\n{1}",module,e.stack||e.message||e)}}}),runBlocks}function createInternalInjector(cache,factory){function getService(serviceName,caller){if(cache.hasOwnProperty(serviceName)){if(cache[serviceName]===INSTANTIATING)throw $injectorMinErr("cdep","Circular dependency found: {0}",serviceName+" <- "+path.join(" <- "));return cache[serviceName]}try{return path.unshift(serviceName),cache[serviceName]=INSTANTIATING,cache[serviceName]=factory(serviceName,caller)}catch(err){throw cache[serviceName]===INSTANTIATING&&delete cache[serviceName],err}finally{path.shift()}}function invoke(fn,self,locals,serviceName){"string"==typeof locals&&(serviceName=locals,locals=null);var length,i,key,args=[],$inject=createInjector.$$annotate(fn,strictDi,serviceName);for(i=0,length=$inject.length;length>i;i++){if(key=$inject[i],"string"!=typeof key)throw $injectorMinErr("itkn","Incorrect injection token! Expected service name as string, got {0}",key);args.push(locals&&locals.hasOwnProperty(key)?locals[key]:getService(key,serviceName))}return isArray(fn)&&(fn=fn[length]),fn.apply(self,args)}function instantiate(Type,locals,serviceName){var instance=Object.create((isArray(Type)?Type[Type.length-1]:Type).prototype||null),returnedValue=invoke(Type,instance,locals,serviceName);return isObject(returnedValue)||isFunction(returnedValue)?returnedValue:instance}return{invoke:invoke,instantiate:instantiate,get:getService,annotate:createInjector.$$annotate,has:function(name){return providerCache.hasOwnProperty(name+providerSuffix)||cache.hasOwnProperty(name)}}}strictDi=strictDi===!0;var INSTANTIATING={},providerSuffix="Provider",path=[],loadedModules=new HashMap([],!0),providerCache={$provide:{provider:supportObject(provider),factory:supportObject(factory),service:supportObject(service),value:supportObject(value),constant:supportObject(constant),decorator:decorator}},providerInjector=providerCache.$injector=createInternalInjector(providerCache,function(serviceName,caller){throw angular.isString(caller)&&path.push(caller),$injectorMinErr("unpr","Unknown provider: {0}",path.join(" <- "))}),instanceCache={},instanceInjector=instanceCache.$injector=createInternalInjector(instanceCache,function(serviceName,caller){var provider=providerInjector.get(serviceName+providerSuffix,caller);return instanceInjector.invoke(provider.$get,provider,undefined,serviceName)});return forEach(loadModules(modulesToLoad),function(fn){fn&&instanceInjector.invoke(fn)}),instanceInjector}function $AnchorScrollProvider(){var autoScrollingEnabled=!0;this.disableAutoScrolling=function(){autoScrollingEnabled=!1},this.$get=["$window","$location","$rootScope",function($window,$location,$rootScope){function getFirstAnchor(list){var result=null;return Array.prototype.some.call(list,function(element){return"a"===nodeName_(element)?(result=element,!0):void 0}),result}function getYOffset(){var offset=scroll.yOffset;if(isFunction(offset))offset=offset();else if(isElement(offset)){var elem=offset[0],style=$window.getComputedStyle(elem);offset="fixed"!==style.position?0:elem.getBoundingClientRect().bottom}else isNumber(offset)||(offset=0);return offset}function scrollTo(elem){if(elem){elem.scrollIntoView();var offset=getYOffset();if(offset){var elemTop=elem.getBoundingClientRect().top;$window.scrollBy(0,elemTop-offset)}}else $window.scrollTo(0,0)}function scroll(hash){hash=isString(hash)?hash:$location.hash();var elm;hash?(elm=document.getElementById(hash))?scrollTo(elm):(elm=getFirstAnchor(document.getElementsByName(hash)))?scrollTo(elm):"top"===hash&&scrollTo(null):scrollTo(null)}var document=$window.document;return autoScrollingEnabled&&$rootScope.$watch(function(){return $location.hash()},function(newVal,oldVal){(newVal!==oldVal||""!==newVal)&&jqLiteDocumentLoaded(function(){$rootScope.$evalAsync(scroll)})}),scroll}]}function mergeClasses(a,b){return a||b?a?b?(isArray(a)&&(a=a.join(" ")),isArray(b)&&(b=b.join(" ")),a+" "+b):a:b:""}function extractElementNode(element){for(var i=0;i<element.length;i++){var elm=element[i];if(elm.nodeType===ELEMENT_NODE)return elm}}function splitClasses(classes){isString(classes)&&(classes=classes.split(" "));var obj=createMap();return forEach(classes,function(klass){klass.length&&(obj[klass]=!0)}),obj}function prepareAnimateOptions(options){return isObject(options)?options:{}}function Browser(window,document,$log,$sniffer){function completeOutstandingRequest(fn){try{fn.apply(null,sliceArgs(arguments,1))}finally{if(outstandingRequestCount--,0===outstandingRequestCount)for(;outstandingRequestCallbacks.length;)try{outstandingRequestCallbacks.pop()()}catch(e){$log.error(e)}}}function getHash(url){var index=url.indexOf("#");return-1===index?"":url.substr(index)}function cacheStateAndFireUrlChange(){cacheState(),fireUrlChange()}function getCurrentState(){try{return history.state}catch(e){}}function cacheState(){cachedState=getCurrentState(),cachedState=isUndefined(cachedState)?null:cachedState,equals(cachedState,lastCachedState)&&(cachedState=lastCachedState),lastCachedState=cachedState}function fireUrlChange(){(lastBrowserUrl!==self.url()||lastHistoryState!==cachedState)&&(lastBrowserUrl=self.url(),lastHistoryState=cachedState,forEach(urlChangeListeners,function(listener){listener(self.url(),cachedState)}))}var self=this,location=(document[0],window.location),history=window.history,setTimeout=window.setTimeout,clearTimeout=window.clearTimeout,pendingDeferIds={};self.isMock=!1;var outstandingRequestCount=0,outstandingRequestCallbacks=[];self.$$completeOutstandingRequest=completeOutstandingRequest,self.$$incOutstandingRequestCount=function(){outstandingRequestCount++},self.notifyWhenNoOutstandingRequests=function(callback){0===outstandingRequestCount?callback():outstandingRequestCallbacks.push(callback)};var cachedState,lastHistoryState,lastBrowserUrl=location.href,baseElement=document.find("base"),reloadLocation=null;cacheState(),lastHistoryState=cachedState,self.url=function(url,replace,state){if(isUndefined(state)&&(state=null),location!==window.location&&(location=window.location),history!==window.history&&(history=window.history),url){var sameState=lastHistoryState===state;if(lastBrowserUrl===url&&(!$sniffer.history||sameState))return self;var sameBase=lastBrowserUrl&&stripHash(lastBrowserUrl)===stripHash(url);return lastBrowserUrl=url,lastHistoryState=state,!$sniffer.history||sameBase&&sameState?((!sameBase||reloadLocation)&&(reloadLocation=url),replace?location.replace(url):sameBase?location.hash=getHash(url):location.href=url):(history[replace?"replaceState":"pushState"](state,"",url),cacheState(),lastHistoryState=cachedState),self}return reloadLocation||location.href.replace(/%27/g,"'")},self.state=function(){return cachedState};var urlChangeListeners=[],urlChangeInit=!1,lastCachedState=null;self.onUrlChange=function(callback){return urlChangeInit||($sniffer.history&&jqLite(window).on("popstate",cacheStateAndFireUrlChange),jqLite(window).on("hashchange",cacheStateAndFireUrlChange),urlChangeInit=!0),urlChangeListeners.push(callback),callback},self.$$applicationDestroyed=function(){jqLite(window).off("hashchange popstate",cacheStateAndFireUrlChange)},self.$$checkUrlChange=fireUrlChange,self.baseHref=function(){var href=baseElement.attr("href");return href?href.replace(/^(https?\:)?\/\/[^\/]*/,""):""},self.defer=function(fn,delay){var timeoutId;return outstandingRequestCount++,timeoutId=setTimeout(function(){delete pendingDeferIds[timeoutId],completeOutstandingRequest(fn)},delay||0),pendingDeferIds[timeoutId]=!0,timeoutId},self.defer.cancel=function(deferId){return pendingDeferIds[deferId]?(delete pendingDeferIds[deferId],clearTimeout(deferId),completeOutstandingRequest(noop),!0):!1}}function $BrowserProvider(){this.$get=["$window","$log","$sniffer","$document",function($window,$log,$sniffer,$document){return new Browser($window,$document,$log,$sniffer)}]}function $CacheFactoryProvider(){this.$get=function(){function cacheFactory(cacheId,options){function refresh(entry){entry!=freshEnd&&(staleEnd?staleEnd==entry&&(staleEnd=entry.n):staleEnd=entry,link(entry.n,entry.p),link(entry,freshEnd),freshEnd=entry,freshEnd.n=null)}function link(nextEntry,prevEntry){nextEntry!=prevEntry&&(nextEntry&&(nextEntry.p=prevEntry),prevEntry&&(prevEntry.n=nextEntry))}if(cacheId in caches)throw minErr("$cacheFactory")("iid","CacheId '{0}' is already taken!",cacheId);var size=0,stats=extend({},options,{id:cacheId}),data={},capacity=options&&options.capacity||Number.MAX_VALUE,lruHash={},freshEnd=null,staleEnd=null;return caches[cacheId]={put:function(key,value){if(!isUndefined(value)){if(capacity<Number.MAX_VALUE){var lruEntry=lruHash[key]||(lruHash[key]={key:key});refresh(lruEntry)}return key in data||size++,data[key]=value,size>capacity&&this.remove(staleEnd.key),value}},get:function(key){if(capacity<Number.MAX_VALUE){var lruEntry=lruHash[key];if(!lruEntry)return;refresh(lruEntry)}return data[key]},remove:function(key){if(capacity<Number.MAX_VALUE){var lruEntry=lruHash[key];if(!lruEntry)return;lruEntry==freshEnd&&(freshEnd=lruEntry.p),lruEntry==staleEnd&&(staleEnd=lruEntry.n),link(lruEntry.n,lruEntry.p),delete lruHash[key]}delete data[key],size--},removeAll:function(){data={},size=0,lruHash={},freshEnd=staleEnd=null},destroy:function(){data=null,stats=null,lruHash=null,delete caches[cacheId]},info:function(){return extend({},stats,{size:size})}}}var caches={};return cacheFactory.info=function(){var info={};return forEach(caches,function(cache,cacheId){info[cacheId]=cache.info()}),info},cacheFactory.get=function(cacheId){return caches[cacheId]},cacheFactory}}function $TemplateCacheProvider(){this.$get=["$cacheFactory",function($cacheFactory){return $cacheFactory("templates")}]}function $CompileProvider($provide,$$sanitizeUriProvider){function parseIsolateBindings(scope,directiveName,isController){var LOCAL_REGEXP=/^\s*([@&]|=(\*?))(\??)\s*(\w*)\s*$/,bindings={};return forEach(scope,function(definition,scopeName){var match=definition.match(LOCAL_REGEXP);if(!match)throw $compileMinErr("iscp","Invalid {3} for directive '{0}'. Definition: {... {1}: '{2}' ...}",directiveName,scopeName,definition,isController?"controller bindings definition":"isolate scope definition");bindings[scopeName]={mode:match[1][0],collection:"*"===match[2],optional:"?"===match[3],attrName:match[4]||scopeName}}),bindings}function parseDirectiveBindings(directive,directiveName){var bindings={isolateScope:null,bindToController:null};if(isObject(directive.scope)&&(directive.bindToController===!0?(bindings.bindToController=parseIsolateBindings(directive.scope,directiveName,!0),bindings.isolateScope={}):bindings.isolateScope=parseIsolateBindings(directive.scope,directiveName,!1)),isObject(directive.bindToController)&&(bindings.bindToController=parseIsolateBindings(directive.bindToController,directiveName,!0)),isObject(bindings.bindToController)){var controller=directive.controller,controllerAs=directive.controllerAs;if(!controller)throw $compileMinErr("noctrl","Cannot bind to controller without directive '{0}'s controller.",directiveName);if(!identifierForController(controller,controllerAs))throw $compileMinErr("noident","Cannot bind to controller without identifier for directive '{0}'.",directiveName)}return bindings}function assertValidDirectiveName(name){var letter=name.charAt(0);if(!letter||letter!==lowercase(letter))throw $compileMinErr("baddir","Directive name '{0}' is invalid. The first character must be a lowercase letter",name);if(name!==name.trim())throw $compileMinErr("baddir","Directive name '{0}' is invalid. The name should not contain leading or trailing whitespaces",name)}var hasDirectives={},Suffix="Directive",COMMENT_DIRECTIVE_REGEXP=/^\s*directive\:\s*([\w\-]+)\s+(.*)$/,CLASS_DIRECTIVE_REGEXP=/(([\w\-]+)(?:\:([^;]+))?;?)/,ALL_OR_NOTHING_ATTRS=makeMap("ngSrc,ngSrcset,src,srcset"),REQUIRE_PREFIX_REGEXP=/^(?:(\^\^?)?(\?)?(\^\^?)?)?/,EVENT_HANDLER_ATTR_REGEXP=/^(on[a-z]+|formaction)$/;this.directive=function registerDirective(name,directiveFactory){return assertNotHasOwnProperty(name,"directive"),isString(name)?(assertValidDirectiveName(name),assertArg(directiveFactory,"directiveFactory"),hasDirectives.hasOwnProperty(name)||(hasDirectives[name]=[],$provide.factory(name+Suffix,["$injector","$exceptionHandler",function($injector,$exceptionHandler){var directives=[];return forEach(hasDirectives[name],function(directiveFactory,index){try{var directive=$injector.invoke(directiveFactory);isFunction(directive)?directive={compile:valueFn(directive)}:!directive.compile&&directive.link&&(directive.compile=valueFn(directive.link)),directive.priority=directive.priority||0,directive.index=index,directive.name=directive.name||name,directive.require=directive.require||directive.controller&&directive.name,directive.restrict=directive.restrict||"EA";var bindings=directive.$$bindings=parseDirectiveBindings(directive,directive.name);isObject(bindings.isolateScope)&&(directive.$$isolateBindings=bindings.isolateScope),directive.$$moduleName=directiveFactory.$$moduleName,directives.push(directive)}catch(e){$exceptionHandler(e)}}),directives}])),hasDirectives[name].push(directiveFactory)):forEach(name,reverseParams(registerDirective)),this},this.aHrefSanitizationWhitelist=function(regexp){return isDefined(regexp)?($$sanitizeUriProvider.aHrefSanitizationWhitelist(regexp),this):$$sanitizeUriProvider.aHrefSanitizationWhitelist()},this.imgSrcSanitizationWhitelist=function(regexp){return isDefined(regexp)?($$sanitizeUriProvider.imgSrcSanitizationWhitelist(regexp),this):$$sanitizeUriProvider.imgSrcSanitizationWhitelist()};var debugInfoEnabled=!0;this.debugInfoEnabled=function(enabled){return isDefined(enabled)?(debugInfoEnabled=enabled,this):debugInfoEnabled},this.$get=["$injector","$interpolate","$exceptionHandler","$templateRequest","$parse","$controller","$rootScope","$document","$sce","$animate","$$sanitizeUri",function($injector,$interpolate,$exceptionHandler,$templateRequest,$parse,$controller,$rootScope,$document,$sce,$animate,$$sanitizeUri){function safeAddClass($element,className){try{$element.addClass(className)}catch(e){}}function compile($compileNodes,transcludeFn,maxPriority,ignoreDirective,previousCompileContext){$compileNodes instanceof jqLite||($compileNodes=jqLite($compileNodes)),forEach($compileNodes,function(node,index){node.nodeType==NODE_TYPE_TEXT&&node.nodeValue.match(/\S+/)&&($compileNodes[index]=jqLite(node).wrap("<span></span>").parent()[0])});var compositeLinkFn=compileNodes($compileNodes,transcludeFn,$compileNodes,maxPriority,ignoreDirective,previousCompileContext);compile.$$addScopeClass($compileNodes);var namespace=null;return function(scope,cloneConnectFn,options){assertArg(scope,"scope"),options=options||{};var parentBoundTranscludeFn=options.parentBoundTranscludeFn,transcludeControllers=options.transcludeControllers,futureParentElement=options.futureParentElement;parentBoundTranscludeFn&&parentBoundTranscludeFn.$$boundTransclude&&(parentBoundTranscludeFn=parentBoundTranscludeFn.$$boundTransclude),namespace||(namespace=detectNamespaceForChildElements(futureParentElement));var $linkNode;if($linkNode="html"!==namespace?jqLite(wrapTemplate(namespace,jqLite("<div>").append($compileNodes).html())):cloneConnectFn?JQLitePrototype.clone.call($compileNodes):$compileNodes,transcludeControllers)for(var controllerName in transcludeControllers)$linkNode.data("$"+controllerName+"Controller",transcludeControllers[controllerName].instance);return compile.$$addScopeInfo($linkNode,scope),cloneConnectFn&&cloneConnectFn($linkNode,scope),compositeLinkFn&&compositeLinkFn(scope,$linkNode,$linkNode,parentBoundTranscludeFn),$linkNode}}function detectNamespaceForChildElements(parentElement){var node=parentElement&&parentElement[0];return node&&"foreignobject"!==nodeName_(node)&&node.toString().match(/SVG/)?"svg":"html"}function compileNodes(nodeList,transcludeFn,$rootElement,maxPriority,ignoreDirective,previousCompileContext){function compositeLinkFn(scope,nodeList,$rootElement,parentBoundTranscludeFn){var nodeLinkFn,childLinkFn,node,childScope,i,ii,idx,childBoundTranscludeFn,stableNodeList;if(nodeLinkFnFound){var nodeListLength=nodeList.length;for(stableNodeList=new Array(nodeListLength),i=0;i<linkFns.length;i+=3)idx=linkFns[i],stableNodeList[idx]=nodeList[idx]}else stableNodeList=nodeList;for(i=0,ii=linkFns.length;ii>i;)if(node=stableNodeList[linkFns[i++]],nodeLinkFn=linkFns[i++],childLinkFn=linkFns[i++],nodeLinkFn){if(nodeLinkFn.scope){childScope=scope.$new(),compile.$$addScopeInfo(jqLite(node),childScope);var destroyBindings=nodeLinkFn.$$destroyBindings;destroyBindings&&(nodeLinkFn.$$destroyBindings=null,childScope.$on("$destroyed",destroyBindings))}else childScope=scope;childBoundTranscludeFn=nodeLinkFn.transcludeOnThisElement?createBoundTranscludeFn(scope,nodeLinkFn.transclude,parentBoundTranscludeFn):!nodeLinkFn.templateOnThisElement&&parentBoundTranscludeFn?parentBoundTranscludeFn:!parentBoundTranscludeFn&&transcludeFn?createBoundTranscludeFn(scope,transcludeFn):null,nodeLinkFn(childLinkFn,childScope,node,$rootElement,childBoundTranscludeFn,nodeLinkFn)}else childLinkFn&&childLinkFn(scope,node.childNodes,undefined,parentBoundTranscludeFn)}for(var attrs,directives,nodeLinkFn,childNodes,childLinkFn,linkFnFound,nodeLinkFnFound,linkFns=[],i=0;i<nodeList.length;i++)attrs=new Attributes,directives=collectDirectives(nodeList[i],[],attrs,0===i?maxPriority:undefined,ignoreDirective),nodeLinkFn=directives.length?applyDirectivesToNode(directives,nodeList[i],attrs,transcludeFn,$rootElement,null,[],[],previousCompileContext):null,nodeLinkFn&&nodeLinkFn.scope&&compile.$$addScopeClass(attrs.$$element),childLinkFn=nodeLinkFn&&nodeLinkFn.terminal||!(childNodes=nodeList[i].childNodes)||!childNodes.length?null:compileNodes(childNodes,nodeLinkFn?(nodeLinkFn.transcludeOnThisElement||!nodeLinkFn.templateOnThisElement)&&nodeLinkFn.transclude:transcludeFn),(nodeLinkFn||childLinkFn)&&(linkFns.push(i,nodeLinkFn,childLinkFn),linkFnFound=!0,nodeLinkFnFound=nodeLinkFnFound||nodeLinkFn),previousCompileContext=null;return linkFnFound?compositeLinkFn:null}function createBoundTranscludeFn(scope,transcludeFn,previousBoundTranscludeFn){var boundTranscludeFn=function(transcludedScope,cloneFn,controllers,futureParentElement,containingScope){return transcludedScope||(transcludedScope=scope.$new(!1,containingScope),transcludedScope.$$transcluded=!0),transcludeFn(transcludedScope,cloneFn,{parentBoundTranscludeFn:previousBoundTranscludeFn,transcludeControllers:controllers,futureParentElement:futureParentElement})};return boundTranscludeFn}function collectDirectives(node,directives,attrs,maxPriority,ignoreDirective){var match,className,nodeType=node.nodeType,attrsMap=attrs.$attr;switch(nodeType){case NODE_TYPE_ELEMENT:addDirective(directives,directiveNormalize(nodeName_(node)),"E",maxPriority,ignoreDirective);for(var attr,name,nName,ngAttrName,value,isNgAttr,nAttrs=node.attributes,j=0,jj=nAttrs&&nAttrs.length;jj>j;j++){var attrStartName=!1,attrEndName=!1;attr=nAttrs[j],name=attr.name,value=trim(attr.value),ngAttrName=directiveNormalize(name),(isNgAttr=NG_ATTR_BINDING.test(ngAttrName))&&(name=name.replace(PREFIX_REGEXP,"").substr(8).replace(/_(.)/g,function(match,letter){return letter.toUpperCase()}));var directiveNName=ngAttrName.replace(/(Start|End)$/,"");directiveIsMultiElement(directiveNName)&&ngAttrName===directiveNName+"Start"&&(attrStartName=name,attrEndName=name.substr(0,name.length-5)+"end",name=name.substr(0,name.length-6)),nName=directiveNormalize(name.toLowerCase()),attrsMap[nName]=name,(isNgAttr||!attrs.hasOwnProperty(nName))&&(attrs[nName]=value,getBooleanAttrName(node,nName)&&(attrs[nName]=!0)),addAttrInterpolateDirective(node,directives,value,nName,isNgAttr),addDirective(directives,nName,"A",maxPriority,ignoreDirective,attrStartName,attrEndName)}if(className=node.className,isObject(className)&&(className=className.animVal),isString(className)&&""!==className)for(;match=CLASS_DIRECTIVE_REGEXP.exec(className);)nName=directiveNormalize(match[2]),addDirective(directives,nName,"C",maxPriority,ignoreDirective)&&(attrs[nName]=trim(match[3])),className=className.substr(match.index+match[0].length);break;case NODE_TYPE_TEXT:if(11===msie)for(;node.parentNode&&node.nextSibling&&node.nextSibling.nodeType===NODE_TYPE_TEXT;)node.nodeValue=node.nodeValue+node.nextSibling.nodeValue,node.parentNode.removeChild(node.nextSibling);addTextInterpolateDirective(directives,node.nodeValue);break;case NODE_TYPE_COMMENT:try{match=COMMENT_DIRECTIVE_REGEXP.exec(node.nodeValue),match&&(nName=directiveNormalize(match[1]),addDirective(directives,nName,"M",maxPriority,ignoreDirective)&&(attrs[nName]=trim(match[2])))}catch(e){}}return directives.sort(byPriority),directives}function groupScan(node,attrStart,attrEnd){var nodes=[],depth=0;if(attrStart&&node.hasAttribute&&node.hasAttribute(attrStart)){do{if(!node)throw $compileMinErr("uterdir","Unterminated attribute, found '{0}' but no matching '{1}' found.",attrStart,attrEnd);node.nodeType==NODE_TYPE_ELEMENT&&(node.hasAttribute(attrStart)&&depth++,node.hasAttribute(attrEnd)&&depth--),nodes.push(node),node=node.nextSibling}while(depth>0)}else nodes.push(node);return jqLite(nodes)}function groupElementsLinkFnWrapper(linkFn,attrStart,attrEnd){return function(scope,element,attrs,controllers,transcludeFn){return element=groupScan(element[0],attrStart,attrEnd),linkFn(scope,element,attrs,controllers,transcludeFn)}}function applyDirectivesToNode(directives,compileNode,templateAttrs,transcludeFn,jqCollection,originalReplaceDirective,preLinkFns,postLinkFns,previousCompileContext){function addLinkFns(pre,post,attrStart,attrEnd){pre&&(attrStart&&(pre=groupElementsLinkFnWrapper(pre,attrStart,attrEnd)),pre.require=directive.require,pre.directiveName=directiveName,(newIsolateScopeDirective===directive||directive.$$isolateScope)&&(pre=cloneAndAnnotateFn(pre,{isolateScope:!0})),preLinkFns.push(pre)),post&&(attrStart&&(post=groupElementsLinkFnWrapper(post,attrStart,attrEnd)),post.require=directive.require,post.directiveName=directiveName,(newIsolateScopeDirective===directive||directive.$$isolateScope)&&(post=cloneAndAnnotateFn(post,{isolateScope:!0})),postLinkFns.push(post))}function getControllers(directiveName,require,$element,elementControllers){var value;if(isString(require)){var match=require.match(REQUIRE_PREFIX_REGEXP),name=require.substring(match[0].length),inheritType=match[1]||match[3],optional="?"===match[2];if("^^"===inheritType?$element=$element.parent():(value=elementControllers&&elementControllers[name],value=value&&value.instance),!value){var dataName="$"+name+"Controller";value=inheritType?$element.inheritedData(dataName):$element.data(dataName)}if(!value&&!optional)throw $compileMinErr("ctreq","Controller '{0}', required by directive '{1}', can't be found!",name,directiveName)}else if(isArray(require)){value=[];for(var i=0,ii=require.length;ii>i;i++)value[i]=getControllers(directiveName,require[i],$element,elementControllers)}return value||null}function setupControllers($element,attrs,transcludeFn,controllerDirectives,isolateScope,scope){var elementControllers=createMap();for(var controllerKey in controllerDirectives){var directive=controllerDirectives[controllerKey],locals={$scope:directive===newIsolateScopeDirective||directive.$$isolateScope?isolateScope:scope,$element:$element,$attrs:attrs,$transclude:transcludeFn},controller=directive.controller;"@"==controller&&(controller=attrs[directive.name]);var controllerInstance=$controller(controller,locals,!0,directive.controllerAs);elementControllers[directive.name]=controllerInstance,hasElementTranscludeDirective||$element.data("$"+directive.name+"Controller",controllerInstance.instance)}return elementControllers}function nodeLinkFn(childLinkFn,scope,linkNode,$rootElement,boundTranscludeFn,thisLinkFn){function controllersBoundTransclude(scope,cloneAttachFn,futureParentElement){var transcludeControllers;return isScope(scope)||(futureParentElement=cloneAttachFn,cloneAttachFn=scope,scope=undefined),hasElementTranscludeDirective&&(transcludeControllers=elementControllers),futureParentElement||(futureParentElement=hasElementTranscludeDirective?$element.parent():$element),boundTranscludeFn(scope,cloneAttachFn,transcludeControllers,futureParentElement,scopeToChild)}var i,ii,linkFn,controller,isolateScope,elementControllers,transcludeFn,$element,attrs;if(compileNode===linkNode?(attrs=templateAttrs,$element=templateAttrs.$$element):($element=jqLite(linkNode),attrs=new Attributes($element,templateAttrs)),newIsolateScopeDirective&&(isolateScope=scope.$new(!0)),boundTranscludeFn&&(transcludeFn=controllersBoundTransclude,transcludeFn.$$boundTransclude=boundTranscludeFn),controllerDirectives&&(elementControllers=setupControllers($element,attrs,transcludeFn,controllerDirectives,isolateScope,scope)),newIsolateScopeDirective&&(compile.$$addScopeInfo($element,isolateScope,!0,!(templateDirective&&(templateDirective===newIsolateScopeDirective||templateDirective===newIsolateScopeDirective.$$originalDirective))),compile.$$addScopeClass($element,!0),isolateScope.$$isolateBindings=newIsolateScopeDirective.$$isolateBindings,initializeDirectiveBindings(scope,attrs,isolateScope,isolateScope.$$isolateBindings,newIsolateScopeDirective,isolateScope)),elementControllers){var bindings,controllerForBindings,scopeDirective=newIsolateScopeDirective||newScopeDirective;scopeDirective&&elementControllers[scopeDirective.name]&&(bindings=scopeDirective.$$bindings.bindToController,controller=elementControllers[scopeDirective.name],controller&&controller.identifier&&bindings&&(controllerForBindings=controller,thisLinkFn.$$destroyBindings=initializeDirectiveBindings(scope,attrs,controller.instance,bindings,scopeDirective)));for(i in elementControllers){controller=elementControllers[i];var controllerResult=controller();controllerResult!==controller.instance&&(controller.instance=controllerResult,$element.data("$"+i+"Controller",controllerResult),controller===controllerForBindings&&(thisLinkFn.$$destroyBindings(),thisLinkFn.$$destroyBindings=initializeDirectiveBindings(scope,attrs,controllerResult,bindings,scopeDirective)))}}for(i=0,ii=preLinkFns.length;ii>i;i++)linkFn=preLinkFns[i],invokeLinkFn(linkFn,linkFn.isolateScope?isolateScope:scope,$element,attrs,linkFn.require&&getControllers(linkFn.directiveName,linkFn.require,$element,elementControllers),transcludeFn);var scopeToChild=scope;for(newIsolateScopeDirective&&(newIsolateScopeDirective.template||null===newIsolateScopeDirective.templateUrl)&&(scopeToChild=isolateScope),childLinkFn&&childLinkFn(scopeToChild,linkNode.childNodes,undefined,boundTranscludeFn),i=postLinkFns.length-1;i>=0;i--)linkFn=postLinkFns[i],invokeLinkFn(linkFn,linkFn.isolateScope?isolateScope:scope,$element,attrs,linkFn.require&&getControllers(linkFn.directiveName,linkFn.require,$element,elementControllers),transcludeFn)}previousCompileContext=previousCompileContext||{};for(var directive,directiveName,$template,linkFn,directiveValue,terminalPriority=-Number.MAX_VALUE,newScopeDirective=previousCompileContext.newScopeDirective,controllerDirectives=previousCompileContext.controllerDirectives,newIsolateScopeDirective=previousCompileContext.newIsolateScopeDirective,templateDirective=previousCompileContext.templateDirective,nonTlbTranscludeDirective=previousCompileContext.nonTlbTranscludeDirective,hasTranscludeDirective=!1,hasTemplate=!1,hasElementTranscludeDirective=previousCompileContext.hasElementTranscludeDirective,$compileNode=templateAttrs.$$element=jqLite(compileNode),replaceDirective=originalReplaceDirective,childTranscludeFn=transcludeFn,i=0,ii=directives.length;ii>i;i++){directive=directives[i];var attrStart=directive.$$start,attrEnd=directive.$$end; if(attrStart&&($compileNode=groupScan(compileNode,attrStart,attrEnd)),$template=undefined,terminalPriority>directive.priority)break;if((directiveValue=directive.scope)&&(directive.templateUrl||(isObject(directiveValue)?(assertNoDuplicate("new/isolated scope",newIsolateScopeDirective||newScopeDirective,directive,$compileNode),newIsolateScopeDirective=directive):assertNoDuplicate("new/isolated scope",newIsolateScopeDirective,directive,$compileNode)),newScopeDirective=newScopeDirective||directive),directiveName=directive.name,!directive.templateUrl&&directive.controller&&(directiveValue=directive.controller,controllerDirectives=controllerDirectives||createMap(),assertNoDuplicate("'"+directiveName+"' controller",controllerDirectives[directiveName],directive,$compileNode),controllerDirectives[directiveName]=directive),(directiveValue=directive.transclude)&&(hasTranscludeDirective=!0,directive.$$tlb||(assertNoDuplicate("transclusion",nonTlbTranscludeDirective,directive,$compileNode),nonTlbTranscludeDirective=directive),"element"==directiveValue?(hasElementTranscludeDirective=!0,terminalPriority=directive.priority,$template=$compileNode,$compileNode=templateAttrs.$$element=jqLite(document.createComment(" "+directiveName+": "+templateAttrs[directiveName]+" ")),compileNode=$compileNode[0],replaceWith(jqCollection,sliceArgs($template),compileNode),childTranscludeFn=compile($template,transcludeFn,terminalPriority,replaceDirective&&replaceDirective.name,{nonTlbTranscludeDirective:nonTlbTranscludeDirective})):($template=jqLite(jqLiteClone(compileNode)).contents(),$compileNode.empty(),childTranscludeFn=compile($template,transcludeFn))),directive.template)if(hasTemplate=!0,assertNoDuplicate("template",templateDirective,directive,$compileNode),templateDirective=directive,directiveValue=isFunction(directive.template)?directive.template($compileNode,templateAttrs):directive.template,directiveValue=denormalizeTemplate(directiveValue),directive.replace){if(replaceDirective=directive,$template=jqLiteIsTextNode(directiveValue)?[]:removeComments(wrapTemplate(directive.templateNamespace,trim(directiveValue))),compileNode=$template[0],1!=$template.length||compileNode.nodeType!==NODE_TYPE_ELEMENT)throw $compileMinErr("tplrt","Template for directive '{0}' must have exactly one root element. {1}",directiveName,"");replaceWith(jqCollection,$compileNode,compileNode);var newTemplateAttrs={$attr:{}},templateDirectives=collectDirectives(compileNode,[],newTemplateAttrs),unprocessedDirectives=directives.splice(i+1,directives.length-(i+1));newIsolateScopeDirective&&markDirectivesAsIsolate(templateDirectives),directives=directives.concat(templateDirectives).concat(unprocessedDirectives),mergeTemplateAttributes(templateAttrs,newTemplateAttrs),ii=directives.length}else $compileNode.html(directiveValue);if(directive.templateUrl)hasTemplate=!0,assertNoDuplicate("template",templateDirective,directive,$compileNode),templateDirective=directive,directive.replace&&(replaceDirective=directive),nodeLinkFn=compileTemplateUrl(directives.splice(i,directives.length-i),$compileNode,templateAttrs,jqCollection,hasTranscludeDirective&&childTranscludeFn,preLinkFns,postLinkFns,{controllerDirectives:controllerDirectives,newScopeDirective:newScopeDirective!==directive&&newScopeDirective,newIsolateScopeDirective:newIsolateScopeDirective,templateDirective:templateDirective,nonTlbTranscludeDirective:nonTlbTranscludeDirective}),ii=directives.length;else if(directive.compile)try{linkFn=directive.compile($compileNode,templateAttrs,childTranscludeFn),isFunction(linkFn)?addLinkFns(null,linkFn,attrStart,attrEnd):linkFn&&addLinkFns(linkFn.pre,linkFn.post,attrStart,attrEnd)}catch(e){$exceptionHandler(e,startingTag($compileNode))}directive.terminal&&(nodeLinkFn.terminal=!0,terminalPriority=Math.max(terminalPriority,directive.priority))}return nodeLinkFn.scope=newScopeDirective&&newScopeDirective.scope===!0,nodeLinkFn.transcludeOnThisElement=hasTranscludeDirective,nodeLinkFn.templateOnThisElement=hasTemplate,nodeLinkFn.transclude=childTranscludeFn,previousCompileContext.hasElementTranscludeDirective=hasElementTranscludeDirective,nodeLinkFn}function markDirectivesAsIsolate(directives){for(var j=0,jj=directives.length;jj>j;j++)directives[j]=inherit(directives[j],{$$isolateScope:!0})}function addDirective(tDirectives,name,location,maxPriority,ignoreDirective,startAttrName,endAttrName){if(name===ignoreDirective)return null;var match=null;if(hasDirectives.hasOwnProperty(name))for(var directive,directives=$injector.get(name+Suffix),i=0,ii=directives.length;ii>i;i++)try{directive=directives[i],(maxPriority===undefined||maxPriority>directive.priority)&&-1!=directive.restrict.indexOf(location)&&(startAttrName&&(directive=inherit(directive,{$$start:startAttrName,$$end:endAttrName})),tDirectives.push(directive),match=directive)}catch(e){$exceptionHandler(e)}return match}function directiveIsMultiElement(name){if(hasDirectives.hasOwnProperty(name))for(var directive,directives=$injector.get(name+Suffix),i=0,ii=directives.length;ii>i;i++)if(directive=directives[i],directive.multiElement)return!0;return!1}function mergeTemplateAttributes(dst,src){var srcAttr=src.$attr,dstAttr=dst.$attr,$element=dst.$$element;forEach(dst,function(value,key){"$"!=key.charAt(0)&&(src[key]&&src[key]!==value&&(value+=("style"===key?";":" ")+src[key]),dst.$set(key,value,!0,srcAttr[key]))}),forEach(src,function(value,key){"class"==key?(safeAddClass($element,value),dst["class"]=(dst["class"]?dst["class"]+" ":"")+value):"style"==key?($element.attr("style",$element.attr("style")+";"+value),dst.style=(dst.style?dst.style+";":"")+value):"$"==key.charAt(0)||dst.hasOwnProperty(key)||(dst[key]=value,dstAttr[key]=srcAttr[key])})}function compileTemplateUrl(directives,$compileNode,tAttrs,$rootElement,childTranscludeFn,preLinkFns,postLinkFns,previousCompileContext){var afterTemplateNodeLinkFn,afterTemplateChildLinkFn,linkQueue=[],beforeTemplateCompileNode=$compileNode[0],origAsyncDirective=directives.shift(),derivedSyncDirective=inherit(origAsyncDirective,{templateUrl:null,transclude:null,replace:null,$$originalDirective:origAsyncDirective}),templateUrl=isFunction(origAsyncDirective.templateUrl)?origAsyncDirective.templateUrl($compileNode,tAttrs):origAsyncDirective.templateUrl,templateNamespace=origAsyncDirective.templateNamespace;return $compileNode.empty(),$templateRequest(templateUrl).then(function(content){var compileNode,tempTemplateAttrs,$template,childBoundTranscludeFn;if(content=denormalizeTemplate(content),origAsyncDirective.replace){if($template=jqLiteIsTextNode(content)?[]:removeComments(wrapTemplate(templateNamespace,trim(content))),compileNode=$template[0],1!=$template.length||compileNode.nodeType!==NODE_TYPE_ELEMENT)throw $compileMinErr("tplrt","Template for directive '{0}' must have exactly one root element. {1}",origAsyncDirective.name,templateUrl);tempTemplateAttrs={$attr:{}},replaceWith($rootElement,$compileNode,compileNode);var templateDirectives=collectDirectives(compileNode,[],tempTemplateAttrs);isObject(origAsyncDirective.scope)&&markDirectivesAsIsolate(templateDirectives),directives=templateDirectives.concat(directives),mergeTemplateAttributes(tAttrs,tempTemplateAttrs)}else compileNode=beforeTemplateCompileNode,$compileNode.html(content);for(directives.unshift(derivedSyncDirective),afterTemplateNodeLinkFn=applyDirectivesToNode(directives,compileNode,tAttrs,childTranscludeFn,$compileNode,origAsyncDirective,preLinkFns,postLinkFns,previousCompileContext),forEach($rootElement,function(node,i){node==compileNode&&($rootElement[i]=$compileNode[0])}),afterTemplateChildLinkFn=compileNodes($compileNode[0].childNodes,childTranscludeFn);linkQueue.length;){var scope=linkQueue.shift(),beforeTemplateLinkNode=linkQueue.shift(),linkRootElement=linkQueue.shift(),boundTranscludeFn=linkQueue.shift(),linkNode=$compileNode[0];if(!scope.$$destroyed){if(beforeTemplateLinkNode!==beforeTemplateCompileNode){var oldClasses=beforeTemplateLinkNode.className;previousCompileContext.hasElementTranscludeDirective&&origAsyncDirective.replace||(linkNode=jqLiteClone(compileNode)),replaceWith(linkRootElement,jqLite(beforeTemplateLinkNode),linkNode),safeAddClass(jqLite(linkNode),oldClasses)}childBoundTranscludeFn=afterTemplateNodeLinkFn.transcludeOnThisElement?createBoundTranscludeFn(scope,afterTemplateNodeLinkFn.transclude,boundTranscludeFn):boundTranscludeFn,afterTemplateNodeLinkFn(afterTemplateChildLinkFn,scope,linkNode,$rootElement,childBoundTranscludeFn,afterTemplateNodeLinkFn)}}linkQueue=null}),function(ignoreChildLinkFn,scope,node,rootElement,boundTranscludeFn){var childBoundTranscludeFn=boundTranscludeFn;scope.$$destroyed||(linkQueue?linkQueue.push(scope,node,rootElement,childBoundTranscludeFn):(afterTemplateNodeLinkFn.transcludeOnThisElement&&(childBoundTranscludeFn=createBoundTranscludeFn(scope,afterTemplateNodeLinkFn.transclude,boundTranscludeFn)),afterTemplateNodeLinkFn(afterTemplateChildLinkFn,scope,node,rootElement,childBoundTranscludeFn,afterTemplateNodeLinkFn)))}}function byPriority(a,b){var diff=b.priority-a.priority;return 0!==diff?diff:a.name!==b.name?a.name<b.name?-1:1:a.index-b.index}function assertNoDuplicate(what,previousDirective,directive,element){function wrapModuleNameIfDefined(moduleName){return moduleName?" (module: "+moduleName+")":""}if(previousDirective)throw $compileMinErr("multidir","Multiple directives [{0}{1}, {2}{3}] asking for {4} on: {5}",previousDirective.name,wrapModuleNameIfDefined(previousDirective.$$moduleName),directive.name,wrapModuleNameIfDefined(directive.$$moduleName),what,startingTag(element))}function addTextInterpolateDirective(directives,text){var interpolateFn=$interpolate(text,!0);interpolateFn&&directives.push({priority:0,compile:function(templateNode){var templateNodeParent=templateNode.parent(),hasCompileParent=!!templateNodeParent.length;return hasCompileParent&&compile.$$addBindingClass(templateNodeParent),function(scope,node){var parent=node.parent();hasCompileParent||compile.$$addBindingClass(parent),compile.$$addBindingInfo(parent,interpolateFn.expressions),scope.$watch(interpolateFn,function(value){node[0].nodeValue=value})}}})}function wrapTemplate(type,template){switch(type=lowercase(type||"html")){case"svg":case"math":var wrapper=document.createElement("div");return wrapper.innerHTML="<"+type+">"+template+"</"+type+">",wrapper.childNodes[0].childNodes;default:return template}}function getTrustedContext(node,attrNormalizedName){if("srcdoc"==attrNormalizedName)return $sce.HTML;var tag=nodeName_(node);return"xlinkHref"==attrNormalizedName||"form"==tag&&"action"==attrNormalizedName||"img"!=tag&&("src"==attrNormalizedName||"ngSrc"==attrNormalizedName)?$sce.RESOURCE_URL:void 0}function addAttrInterpolateDirective(node,directives,value,name,allOrNothing){var trustedContext=getTrustedContext(node,name);allOrNothing=ALL_OR_NOTHING_ATTRS[name]||allOrNothing;var interpolateFn=$interpolate(value,!0,trustedContext,allOrNothing);if(interpolateFn){if("multiple"===name&&"select"===nodeName_(node))throw $compileMinErr("selmulti","Binding to the 'multiple' attribute is not supported. Element: {0}",startingTag(node));directives.push({priority:100,compile:function(){return{pre:function(scope,element,attr){var $$observers=attr.$$observers||(attr.$$observers={});if(EVENT_HANDLER_ATTR_REGEXP.test(name))throw $compileMinErr("nodomevents","Interpolations for HTML DOM event attributes are disallowed. Please use the ng- versions (such as ng-click instead of onclick) instead.");var newValue=attr[name];newValue!==value&&(interpolateFn=newValue&&$interpolate(newValue,!0,trustedContext,allOrNothing),value=newValue),interpolateFn&&(attr[name]=interpolateFn(scope),($$observers[name]||($$observers[name]=[])).$$inter=!0,(attr.$$observers&&attr.$$observers[name].$$scope||scope).$watch(interpolateFn,function(newValue,oldValue){"class"===name&&newValue!=oldValue?attr.$updateClass(newValue,oldValue):attr.$set(name,newValue)}))}}}})}}function replaceWith($rootElement,elementsToRemove,newNode){var i,ii,firstElementToRemove=elementsToRemove[0],removeCount=elementsToRemove.length,parent=firstElementToRemove.parentNode;if($rootElement)for(i=0,ii=$rootElement.length;ii>i;i++)if($rootElement[i]==firstElementToRemove){$rootElement[i++]=newNode;for(var j=i,j2=j+removeCount-1,jj=$rootElement.length;jj>j;j++,j2++)jj>j2?$rootElement[j]=$rootElement[j2]:delete $rootElement[j];$rootElement.length-=removeCount-1,$rootElement.context===firstElementToRemove&&($rootElement.context=newNode);break}parent&&parent.replaceChild(newNode,firstElementToRemove);var fragment=document.createDocumentFragment();fragment.appendChild(firstElementToRemove),jqLite.hasData(firstElementToRemove)&&(jqLite(newNode).data(jqLite(firstElementToRemove).data()),jQuery?(skipDestroyOnNextJQueryCleanData=!0,jQuery.cleanData([firstElementToRemove])):delete jqLite.cache[firstElementToRemove[jqLite.expando]]);for(var k=1,kk=elementsToRemove.length;kk>k;k++){var element=elementsToRemove[k];jqLite(element).remove(),fragment.appendChild(element),delete elementsToRemove[k]}elementsToRemove[0]=newNode,elementsToRemove.length=1}function cloneAndAnnotateFn(fn,annotation){return extend(function(){return fn.apply(null,arguments)},fn,annotation)}function invokeLinkFn(linkFn,scope,$element,attrs,controllers,transcludeFn){try{linkFn(scope,$element,attrs,controllers,transcludeFn)}catch(e){$exceptionHandler(e,startingTag($element))}}function initializeDirectiveBindings(scope,attrs,destination,bindings,directive,newScope){var onNewScopeDestroyed;forEach(bindings,function(definition,scopeName){var lastValue,parentGet,parentSet,compare,attrName=definition.attrName,optional=definition.optional,mode=definition.mode;switch(hasOwnProperty.call(attrs,attrName)||(attrs[attrName]=undefined),mode){case"@":attrs[attrName]||optional||(destination[scopeName]=undefined),attrs.$observe(attrName,function(value){destination[scopeName]=value}),attrs.$$observers[attrName].$$scope=scope,attrs[attrName]&&(destination[scopeName]=$interpolate(attrs[attrName])(scope));break;case"=":if(optional&&!attrs[attrName])return;parentGet=$parse(attrs[attrName]),compare=parentGet.literal?equals:function(a,b){return a===b||a!==a&&b!==b},parentSet=parentGet.assign||function(){throw lastValue=destination[scopeName]=parentGet(scope),$compileMinErr("nonassign","Expression '{0}' used with directive '{1}' is non-assignable!",attrs[attrName],directive.name)},lastValue=destination[scopeName]=parentGet(scope);var parentValueWatch=function(parentValue){return compare(parentValue,destination[scopeName])||(compare(parentValue,lastValue)?parentSet(scope,parentValue=destination[scopeName]):destination[scopeName]=parentValue),lastValue=parentValue};parentValueWatch.$stateful=!0;var unwatch;unwatch=definition.collection?scope.$watchCollection(attrs[attrName],parentValueWatch):scope.$watch($parse(attrs[attrName],parentValueWatch),null,parentGet.literal),onNewScopeDestroyed=onNewScopeDestroyed||[],onNewScopeDestroyed.push(unwatch);break;case"&":if(parentGet=$parse(attrs[attrName]),parentGet===noop&&optional)break;destination[scopeName]=function(locals){return parentGet(scope,locals)}}});var destroyBindings=onNewScopeDestroyed?function(){for(var i=0,ii=onNewScopeDestroyed.length;ii>i;++i)onNewScopeDestroyed[i]()}:noop;return newScope&&destroyBindings!==noop?(newScope.$on("$destroy",destroyBindings),noop):destroyBindings}var Attributes=function(element,attributesToCopy){if(attributesToCopy){var i,l,key,keys=Object.keys(attributesToCopy);for(i=0,l=keys.length;l>i;i++)key=keys[i],this[key]=attributesToCopy[key]}else this.$attr={};this.$$element=element};Attributes.prototype={$normalize:directiveNormalize,$addClass:function(classVal){classVal&&classVal.length>0&&$animate.addClass(this.$$element,classVal)},$removeClass:function(classVal){classVal&&classVal.length>0&&$animate.removeClass(this.$$element,classVal)},$updateClass:function(newClasses,oldClasses){var toAdd=tokenDifference(newClasses,oldClasses);toAdd&&toAdd.length&&$animate.addClass(this.$$element,toAdd);var toRemove=tokenDifference(oldClasses,newClasses);toRemove&&toRemove.length&&$animate.removeClass(this.$$element,toRemove)},$set:function(key,value,writeAttr,attrName){var nodeName,node=this.$$element[0],booleanKey=getBooleanAttrName(node,key),aliasedKey=getAliasedAttrName(node,key),observer=key;if(booleanKey?(this.$$element.prop(key,value),attrName=booleanKey):aliasedKey&&(this[aliasedKey]=value,observer=aliasedKey),this[key]=value,attrName?this.$attr[key]=attrName:(attrName=this.$attr[key],attrName||(this.$attr[key]=attrName=snake_case(key,"-"))),nodeName=nodeName_(this.$$element),"a"===nodeName&&"href"===key||"img"===nodeName&&"src"===key)this[key]=value=$$sanitizeUri(value,"src"===key);else if("img"===nodeName&&"srcset"===key){for(var result="",trimmedSrcset=trim(value),srcPattern=/(\s+\d+x\s*,|\s+\d+w\s*,|\s+,|,\s+)/,pattern=/\s/.test(trimmedSrcset)?srcPattern:/(,)/,rawUris=trimmedSrcset.split(pattern),nbrUrisWith2parts=Math.floor(rawUris.length/2),i=0;nbrUrisWith2parts>i;i++){var innerIdx=2*i;result+=$$sanitizeUri(trim(rawUris[innerIdx]),!0),result+=" "+trim(rawUris[innerIdx+1])}var lastTuple=trim(rawUris[2*i]).split(/\s/);result+=$$sanitizeUri(trim(lastTuple[0]),!0),2===lastTuple.length&&(result+=" "+trim(lastTuple[1])),this[key]=value=result}writeAttr!==!1&&(null===value||value===undefined?this.$$element.removeAttr(attrName):this.$$element.attr(attrName,value));var $$observers=this.$$observers;$$observers&&forEach($$observers[observer],function(fn){try{fn(value)}catch(e){$exceptionHandler(e)}})},$observe:function(key,fn){var attrs=this,$$observers=attrs.$$observers||(attrs.$$observers=createMap()),listeners=$$observers[key]||($$observers[key]=[]);return listeners.push(fn),$rootScope.$evalAsync(function(){!listeners.$$inter&&attrs.hasOwnProperty(key)&&fn(attrs[key])}),function(){arrayRemove(listeners,fn)}}};var startSymbol=$interpolate.startSymbol(),endSymbol=$interpolate.endSymbol(),denormalizeTemplate="{{"==startSymbol||"}}"==endSymbol?identity:function(template){return template.replace(/\{\{/g,startSymbol).replace(/}}/g,endSymbol)},NG_ATTR_BINDING=/^ngAttr[A-Z]/;return compile.$$addBindingInfo=debugInfoEnabled?function($element,binding){var bindings=$element.data("$binding")||[];isArray(binding)?bindings=bindings.concat(binding):bindings.push(binding),$element.data("$binding",bindings)}:noop,compile.$$addBindingClass=debugInfoEnabled?function($element){safeAddClass($element,"ng-binding")}:noop,compile.$$addScopeInfo=debugInfoEnabled?function($element,scope,isolated,noTemplate){var dataName=isolated?noTemplate?"$isolateScopeNoTemplate":"$isolateScope":"$scope";$element.data(dataName,scope)}:noop,compile.$$addScopeClass=debugInfoEnabled?function($element,isolated){safeAddClass($element,isolated?"ng-isolate-scope":"ng-scope")}:noop,compile}]}function directiveNormalize(name){return camelCase(name.replace(PREFIX_REGEXP,""))}function tokenDifference(str1,str2){var values="",tokens1=str1.split(/\s+/),tokens2=str2.split(/\s+/);outer:for(var i=0;i<tokens1.length;i++){for(var token=tokens1[i],j=0;j<tokens2.length;j++)if(token==tokens2[j])continue outer;values+=(values.length>0?" ":"")+token}return values}function removeComments(jqNodes){jqNodes=jqLite(jqNodes);var i=jqNodes.length;if(1>=i)return jqNodes;for(;i--;){var node=jqNodes[i];node.nodeType===NODE_TYPE_COMMENT&&splice.call(jqNodes,i,1)}return jqNodes}function identifierForController(controller,ident){if(ident&&isString(ident))return ident;if(isString(controller)){var match=CNTRL_REG.exec(controller);if(match)return match[3]}}function $ControllerProvider(){var controllers={},globals=!1;this.register=function(name,constructor){assertNotHasOwnProperty(name,"controller"),isObject(name)?extend(controllers,name):controllers[name]=constructor},this.allowGlobals=function(){globals=!0},this.$get=["$injector","$window",function($injector,$window){function addIdentifier(locals,identifier,instance,name){if(!locals||!isObject(locals.$scope))throw minErr("$controller")("noscp","Cannot export controller '{0}' as '{1}'! No $scope object provided via `locals`.",name,identifier);locals.$scope[identifier]=instance}return function(expression,locals,later,ident){var instance,match,constructor,identifier;if(later=later===!0,ident&&isString(ident)&&(identifier=ident),isString(expression)){if(match=expression.match(CNTRL_REG),!match)throw $controllerMinErr("ctrlfmt","Badly formed controller string '{0}'. Must match `__name__ as __id__` or `__name__`.",expression);constructor=match[1],identifier=identifier||match[3],expression=controllers.hasOwnProperty(constructor)?controllers[constructor]:getter(locals.$scope,constructor,!0)||(globals?getter($window,constructor,!0):undefined),assertArgFn(expression,constructor,!0)}if(later){var controllerPrototype=(isArray(expression)?expression[expression.length-1]:expression).prototype;instance=Object.create(controllerPrototype||null),identifier&&addIdentifier(locals,identifier,instance,constructor||expression.name);var instantiate;return instantiate=extend(function(){var result=$injector.invoke(expression,instance,locals,constructor);return result!==instance&&(isObject(result)||isFunction(result))&&(instance=result,identifier&&addIdentifier(locals,identifier,instance,constructor||expression.name)),instance},{instance:instance,identifier:identifier})}return instance=$injector.instantiate(expression,locals,constructor),identifier&&addIdentifier(locals,identifier,instance,constructor||expression.name),instance}}]}function $DocumentProvider(){this.$get=["$window",function(window){return jqLite(window.document)}]}function $ExceptionHandlerProvider(){this.$get=["$log",function($log){return function(exception,cause){$log.error.apply($log,arguments)}}]}function serializeValue(v){return isObject(v)?isDate(v)?v.toISOString():toJson(v):v}function $HttpParamSerializerProvider(){this.$get=function(){return function(params){if(!params)return"";var parts=[];return forEachSorted(params,function(value,key){null===value||isUndefined(value)||(isArray(value)?forEach(value,function(v,k){parts.push(encodeUriQuery(key)+"="+encodeUriQuery(serializeValue(v)))}):parts.push(encodeUriQuery(key)+"="+encodeUriQuery(serializeValue(value))))}),parts.join("&")}}}function $HttpParamSerializerJQLikeProvider(){this.$get=function(){return function(params){function serialize(toSerialize,prefix,topLevel){null===toSerialize||isUndefined(toSerialize)||(isArray(toSerialize)?forEach(toSerialize,function(value){serialize(value,prefix+"[]")}):isObject(toSerialize)&&!isDate(toSerialize)?forEachSorted(toSerialize,function(value,key){serialize(value,prefix+(topLevel?"":"[")+key+(topLevel?"":"]"))}):parts.push(encodeUriQuery(prefix)+"="+encodeUriQuery(serializeValue(toSerialize))))}if(!params)return"";var parts=[];return serialize(params,"",!0),parts.join("&")}}}function defaultHttpResponseTransform(data,headers){if(isString(data)){var tempData=data.replace(JSON_PROTECTION_PREFIX,"").trim();if(tempData){var contentType=headers("Content-Type");(contentType&&0===contentType.indexOf(APPLICATION_JSON)||isJsonLike(tempData))&&(data=fromJson(tempData))}}return data}function isJsonLike(str){var jsonStart=str.match(JSON_START);return jsonStart&&JSON_ENDS[jsonStart[0]].test(str)}function parseHeaders(headers){function fillInParsed(key,val){key&&(parsed[key]=parsed[key]?parsed[key]+", "+val:val)}var i,parsed=createMap();return isString(headers)?forEach(headers.split("\n"),function(line){i=line.indexOf(":"),fillInParsed(lowercase(trim(line.substr(0,i))),trim(line.substr(i+1)))}):isObject(headers)&&forEach(headers,function(headerVal,headerKey){fillInParsed(lowercase(headerKey),trim(headerVal))}),parsed}function headersGetter(headers){var headersObj;return function(name){if(headersObj||(headersObj=parseHeaders(headers)),name){var value=headersObj[lowercase(name)];return void 0===value&&(value=null),value}return headersObj}}function transformData(data,headers,status,fns){return isFunction(fns)?fns(data,headers,status):(forEach(fns,function(fn){data=fn(data,headers,status)}),data)}function isSuccess(status){return status>=200&&300>status}function $HttpProvider(){var defaults=this.defaults={transformResponse:[defaultHttpResponseTransform],transformRequest:[function(d){return!isObject(d)||isFile(d)||isBlob(d)||isFormData(d)?d:toJson(d)}],headers:{common:{Accept:"application/json, text/plain, */*"},post:shallowCopy(CONTENT_TYPE_APPLICATION_JSON),put:shallowCopy(CONTENT_TYPE_APPLICATION_JSON),patch:shallowCopy(CONTENT_TYPE_APPLICATION_JSON)},xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",paramSerializer:"$httpParamSerializer"},useApplyAsync=!1;this.useApplyAsync=function(value){return isDefined(value)?(useApplyAsync=!!value,this):useApplyAsync};var interceptorFactories=this.interceptors=[];this.$get=["$httpBackend","$$cookieReader","$cacheFactory","$rootScope","$q","$injector",function($httpBackend,$$cookieReader,$cacheFactory,$rootScope,$q,$injector){function $http(requestConfig){function transformResponse(response){var resp=extend({},response);return resp.data=response.data?transformData(response.data,response.headers,response.status,config.transformResponse):response.data,isSuccess(response.status)?resp:$q.reject(resp)}function executeHeaderFns(headers,config){var headerContent,processedHeaders={};return forEach(headers,function(headerFn,header){isFunction(headerFn)?(headerContent=headerFn(config),null!=headerContent&&(processedHeaders[header]=headerContent)):processedHeaders[header]=headerFn}),processedHeaders}function mergeHeaders(config){var defHeaderName,lowercaseDefHeaderName,reqHeaderName,defHeaders=defaults.headers,reqHeaders=extend({},config.headers);defHeaders=extend({},defHeaders.common,defHeaders[lowercase(config.method)]);defaultHeadersIteration:for(defHeaderName in defHeaders){lowercaseDefHeaderName=lowercase(defHeaderName);for(reqHeaderName in reqHeaders)if(lowercase(reqHeaderName)===lowercaseDefHeaderName)continue defaultHeadersIteration;reqHeaders[defHeaderName]=defHeaders[defHeaderName]}return executeHeaderFns(reqHeaders,shallowCopy(config))}if(!angular.isObject(requestConfig))throw minErr("$http")("badreq","Http request configuration must be an object. Received: {0}",requestConfig);var config=extend({method:"get",transformRequest:defaults.transformRequest,transformResponse:defaults.transformResponse,paramSerializer:defaults.paramSerializer},requestConfig);config.headers=mergeHeaders(requestConfig),config.method=uppercase(config.method),config.paramSerializer=isString(config.paramSerializer)?$injector.get(config.paramSerializer):config.paramSerializer;var serverRequest=function(config){var headers=config.headers,reqData=transformData(config.data,headersGetter(headers),undefined,config.transformRequest);return isUndefined(reqData)&&forEach(headers,function(value,header){"content-type"===lowercase(header)&&delete headers[header]}),isUndefined(config.withCredentials)&&!isUndefined(defaults.withCredentials)&&(config.withCredentials=defaults.withCredentials),sendReq(config,reqData).then(transformResponse,transformResponse)},chain=[serverRequest,undefined],promise=$q.when(config);for(forEach(reversedInterceptors,function(interceptor){(interceptor.request||interceptor.requestError)&&chain.unshift(interceptor.request,interceptor.requestError),(interceptor.response||interceptor.responseError)&&chain.push(interceptor.response,interceptor.responseError)});chain.length;){var thenFn=chain.shift(),rejectFn=chain.shift();promise=promise.then(thenFn,rejectFn)}return promise.success=function(fn){return assertArgFn(fn,"fn"),promise.then(function(response){fn(response.data,response.status,response.headers,config)}),promise},promise.error=function(fn){return assertArgFn(fn,"fn"),promise.then(null,function(response){fn(response.data,response.status,response.headers,config)}),promise},promise}function createShortMethods(names){forEach(arguments,function(name){$http[name]=function(url,config){return $http(extend({},config||{},{method:name,url:url}))}})}function createShortMethodsWithData(name){forEach(arguments,function(name){$http[name]=function(url,data,config){return $http(extend({},config||{},{method:name,url:url,data:data}))}})}function sendReq(config,reqData){function done(status,response,headersString,statusText){function resolveHttpPromise(){resolvePromise(response,status,headersString,statusText)}cache&&(isSuccess(status)?cache.put(url,[status,response,parseHeaders(headersString),statusText]):cache.remove(url)),useApplyAsync?$rootScope.$applyAsync(resolveHttpPromise):(resolveHttpPromise(),$rootScope.$$phase||$rootScope.$apply())}function resolvePromise(response,status,headers,statusText){status=Math.max(status,0),(isSuccess(status)?deferred.resolve:deferred.reject)({data:response,status:status,headers:headersGetter(headers),config:config,statusText:statusText})}function resolvePromiseWithResult(result){resolvePromise(result.data,result.status,shallowCopy(result.headers()),result.statusText)}function removePendingReq(){var idx=$http.pendingRequests.indexOf(config);-1!==idx&&$http.pendingRequests.splice(idx,1)}var cache,cachedResp,deferred=$q.defer(),promise=deferred.promise,reqHeaders=config.headers,url=buildUrl(config.url,config.paramSerializer(config.params));if($http.pendingRequests.push(config),promise.then(removePendingReq,removePendingReq),!config.cache&&!defaults.cache||config.cache===!1||"GET"!==config.method&&"JSONP"!==config.method||(cache=isObject(config.cache)?config.cache:isObject(defaults.cache)?defaults.cache:defaultCache),cache&&(cachedResp=cache.get(url),isDefined(cachedResp)?isPromiseLike(cachedResp)?cachedResp.then(resolvePromiseWithResult,resolvePromiseWithResult):isArray(cachedResp)?resolvePromise(cachedResp[1],cachedResp[0],shallowCopy(cachedResp[2]),cachedResp[3]):resolvePromise(cachedResp,200,{},"OK"):cache.put(url,promise)),isUndefined(cachedResp)){var xsrfValue=urlIsSameOrigin(config.url)?$$cookieReader()[config.xsrfCookieName||defaults.xsrfCookieName]:undefined;xsrfValue&&(reqHeaders[config.xsrfHeaderName||defaults.xsrfHeaderName]=xsrfValue),$httpBackend(config.method,url,reqData,done,reqHeaders,config.timeout,config.withCredentials,config.responseType)}return promise}function buildUrl(url,serializedParams){return serializedParams.length>0&&(url+=(-1==url.indexOf("?")?"?":"&")+serializedParams),url}var defaultCache=$cacheFactory("$http");defaults.paramSerializer=isString(defaults.paramSerializer)?$injector.get(defaults.paramSerializer):defaults.paramSerializer;var reversedInterceptors=[];return forEach(interceptorFactories,function(interceptorFactory){reversedInterceptors.unshift(isString(interceptorFactory)?$injector.get(interceptorFactory):$injector.invoke(interceptorFactory))}),$http.pendingRequests=[],createShortMethods("get","delete","head","jsonp"),createShortMethodsWithData("post","put","patch"),$http.defaults=defaults,$http}]}function createXhr(){return new window.XMLHttpRequest}function $HttpBackendProvider(){this.$get=["$browser","$window","$document",function($browser,$window,$document){return createHttpBackend($browser,createXhr,$browser.defer,$window.angular.callbacks,$document[0])}]}function createHttpBackend($browser,createXhr,$browserDefer,callbacks,rawDocument){function jsonpReq(url,callbackId,done){var script=rawDocument.createElement("script"),callback=null;return script.type="text/javascript",script.src=url,script.async=!0,callback=function(event){removeEventListenerFn(script,"load",callback),removeEventListenerFn(script,"error",callback),rawDocument.body.removeChild(script),script=null;var status=-1,text="unknown";event&&("load"!==event.type||callbacks[callbackId].called||(event={type:"error"}),text=event.type,status="error"===event.type?404:200),done&&done(status,text)},addEventListenerFn(script,"load",callback),addEventListenerFn(script,"error",callback),rawDocument.body.appendChild(script),callback}return function(method,url,post,callback,headers,timeout,withCredentials,responseType){ function timeoutRequest(){jsonpDone&&jsonpDone(),xhr&&xhr.abort()}function completeRequest(callback,status,response,headersString,statusText){timeoutId!==undefined&&$browserDefer.cancel(timeoutId),jsonpDone=xhr=null,callback(status,response,headersString,statusText),$browser.$$completeOutstandingRequest(noop)}if($browser.$$incOutstandingRequestCount(),url=url||$browser.url(),"jsonp"==lowercase(method)){var callbackId="_"+(callbacks.counter++).toString(36);callbacks[callbackId]=function(data){callbacks[callbackId].data=data,callbacks[callbackId].called=!0};var jsonpDone=jsonpReq(url.replace("JSON_CALLBACK","angular.callbacks."+callbackId),callbackId,function(status,text){completeRequest(callback,status,callbacks[callbackId].data,"",text),callbacks[callbackId]=noop})}else{var xhr=createXhr();xhr.open(method,url,!0),forEach(headers,function(value,key){isDefined(value)&&xhr.setRequestHeader(key,value)}),xhr.onload=function(){var statusText=xhr.statusText||"",response="response"in xhr?xhr.response:xhr.responseText,status=1223===xhr.status?204:xhr.status;0===status&&(status=response?200:"file"==urlResolve(url).protocol?404:0),completeRequest(callback,status,response,xhr.getAllResponseHeaders(),statusText)};var requestError=function(){completeRequest(callback,-1,null,null,"")};if(xhr.onerror=requestError,xhr.onabort=requestError,withCredentials&&(xhr.withCredentials=!0),responseType)try{xhr.responseType=responseType}catch(e){if("json"!==responseType)throw e}xhr.send(post)}if(timeout>0)var timeoutId=$browserDefer(timeoutRequest,timeout);else isPromiseLike(timeout)&&timeout.then(timeoutRequest)}}function $InterpolateProvider(){var startSymbol="{{",endSymbol="}}";this.startSymbol=function(value){return value?(startSymbol=value,this):startSymbol},this.endSymbol=function(value){return value?(endSymbol=value,this):endSymbol},this.$get=["$parse","$exceptionHandler","$sce",function($parse,$exceptionHandler,$sce){function escape(ch){return"\\\\\\"+ch}function unescapeText(text){return text.replace(escapedStartRegexp,startSymbol).replace(escapedEndRegexp,endSymbol)}function stringify(value){if(null==value)return"";switch(typeof value){case"string":break;case"number":value=""+value;break;default:value=toJson(value)}return value}function $interpolate(text,mustHaveExpression,trustedContext,allOrNothing){function parseStringifyInterceptor(value){try{return value=getValue(value),allOrNothing&&!isDefined(value)?value:stringify(value)}catch(err){$exceptionHandler($interpolateMinErr.interr(text,err))}}allOrNothing=!!allOrNothing;for(var startIndex,endIndex,exp,index=0,expressions=[],parseFns=[],textLength=text.length,concat=[],expressionPositions=[];textLength>index;){if(-1==(startIndex=text.indexOf(startSymbol,index))||-1==(endIndex=text.indexOf(endSymbol,startIndex+startSymbolLength))){index!==textLength&&concat.push(unescapeText(text.substring(index)));break}index!==startIndex&&concat.push(unescapeText(text.substring(index,startIndex))),exp=text.substring(startIndex+startSymbolLength,endIndex),expressions.push(exp),parseFns.push($parse(exp,parseStringifyInterceptor)),index=endIndex+endSymbolLength,expressionPositions.push(concat.length),concat.push("")}if(trustedContext&&concat.length>1&&$interpolateMinErr.throwNoconcat(text),!mustHaveExpression||expressions.length){var compute=function(values){for(var i=0,ii=expressions.length;ii>i;i++){if(allOrNothing&&isUndefined(values[i]))return;concat[expressionPositions[i]]=values[i]}return concat.join("")},getValue=function(value){return trustedContext?$sce.getTrusted(trustedContext,value):$sce.valueOf(value)};return extend(function(context){var i=0,ii=expressions.length,values=new Array(ii);try{for(;ii>i;i++)values[i]=parseFns[i](context);return compute(values)}catch(err){$exceptionHandler($interpolateMinErr.interr(text,err))}},{exp:text,expressions:expressions,$$watchDelegate:function(scope,listener){var lastValue;return scope.$watchGroup(parseFns,function(values,oldValues){var currValue=compute(values);isFunction(listener)&&listener.call(this,currValue,values!==oldValues?lastValue:currValue,scope),lastValue=currValue})}})}}var startSymbolLength=startSymbol.length,endSymbolLength=endSymbol.length,escapedStartRegexp=new RegExp(startSymbol.replace(/./g,escape),"g"),escapedEndRegexp=new RegExp(endSymbol.replace(/./g,escape),"g");return $interpolate.startSymbol=function(){return startSymbol},$interpolate.endSymbol=function(){return endSymbol},$interpolate}]}function $IntervalProvider(){this.$get=["$rootScope","$window","$q","$$q",function($rootScope,$window,$q,$$q){function interval(fn,delay,count,invokeApply){var hasParams=arguments.length>4,args=hasParams?sliceArgs(arguments,4):[],setInterval=$window.setInterval,clearInterval=$window.clearInterval,iteration=0,skipApply=isDefined(invokeApply)&&!invokeApply,deferred=(skipApply?$$q:$q).defer(),promise=deferred.promise;return count=isDefined(count)?count:0,promise.then(null,null,hasParams?function(){fn.apply(null,args)}:fn),promise.$$intervalId=setInterval(function(){deferred.notify(iteration++),count>0&&iteration>=count&&(deferred.resolve(iteration),clearInterval(promise.$$intervalId),delete intervals[promise.$$intervalId]),skipApply||$rootScope.$apply()},delay),intervals[promise.$$intervalId]=deferred,promise}var intervals={};return interval.cancel=function(promise){return promise&&promise.$$intervalId in intervals?(intervals[promise.$$intervalId].reject("canceled"),$window.clearInterval(promise.$$intervalId),delete intervals[promise.$$intervalId],!0):!1},interval}]}function $LocaleProvider(){this.$get=function(){return{id:"en-us",NUMBER_FORMATS:{DECIMAL_SEP:".",GROUP_SEP:",",PATTERNS:[{minInt:1,minFrac:0,maxFrac:3,posPre:"",posSuf:"",negPre:"-",negSuf:"",gSize:3,lgSize:3},{minInt:1,minFrac:2,maxFrac:2,posPre:"¤",posSuf:"",negPre:"(¤",negSuf:")",gSize:3,lgSize:3}],CURRENCY_SYM:"$"},DATETIME_FORMATS:{MONTH:"January,February,March,April,May,June,July,August,September,October,November,December".split(","),SHORTMONTH:"Jan,Feb,Mar,Apr,May,Jun,Jul,Aug,Sep,Oct,Nov,Dec".split(","),DAY:"Sunday,Monday,Tuesday,Wednesday,Thursday,Friday,Saturday".split(","),SHORTDAY:"Sun,Mon,Tue,Wed,Thu,Fri,Sat".split(","),AMPMS:["AM","PM"],medium:"MMM d, y h:mm:ss a","short":"M/d/yy h:mm a",fullDate:"EEEE, MMMM d, y",longDate:"MMMM d, y",mediumDate:"MMM d, y",shortDate:"M/d/yy",mediumTime:"h:mm:ss a",shortTime:"h:mm a",ERANAMES:["Before Christ","Anno Domini"],ERAS:["BC","AD"]},pluralCat:function(num){return 1===num?"one":"other"}}}}function encodePath(path){for(var segments=path.split("/"),i=segments.length;i--;)segments[i]=encodeUriSegment(segments[i]);return segments.join("/")}function parseAbsoluteUrl(absoluteUrl,locationObj){var parsedUrl=urlResolve(absoluteUrl);locationObj.$$protocol=parsedUrl.protocol,locationObj.$$host=parsedUrl.hostname,locationObj.$$port=toInt(parsedUrl.port)||DEFAULT_PORTS[parsedUrl.protocol]||null}function parseAppUrl(relativeUrl,locationObj){var prefixed="/"!==relativeUrl.charAt(0);prefixed&&(relativeUrl="/"+relativeUrl);var match=urlResolve(relativeUrl);locationObj.$$path=decodeURIComponent(prefixed&&"/"===match.pathname.charAt(0)?match.pathname.substring(1):match.pathname),locationObj.$$search=parseKeyValue(match.search),locationObj.$$hash=decodeURIComponent(match.hash),locationObj.$$path&&"/"!=locationObj.$$path.charAt(0)&&(locationObj.$$path="/"+locationObj.$$path)}function beginsWith(begin,whole){return 0===whole.indexOf(begin)?whole.substr(begin.length):void 0}function stripHash(url){var index=url.indexOf("#");return-1==index?url:url.substr(0,index)}function trimEmptyHash(url){return url.replace(/(#.+)|#$/,"$1")}function stripFile(url){return url.substr(0,stripHash(url).lastIndexOf("/")+1)}function serverBase(url){return url.substring(0,url.indexOf("/",url.indexOf("//")+2))}function LocationHtml5Url(appBase,basePrefix){this.$$html5=!0,basePrefix=basePrefix||"";var appBaseNoFile=stripFile(appBase);parseAbsoluteUrl(appBase,this),this.$$parse=function(url){var pathUrl=beginsWith(appBaseNoFile,url);if(!isString(pathUrl))throw $locationMinErr("ipthprfx",'Invalid url "{0}", missing path prefix "{1}".',url,appBaseNoFile);parseAppUrl(pathUrl,this),this.$$path||(this.$$path="/"),this.$$compose()},this.$$compose=function(){var search=toKeyValue(this.$$search),hash=this.$$hash?"#"+encodeUriSegment(this.$$hash):"";this.$$url=encodePath(this.$$path)+(search?"?"+search:"")+hash,this.$$absUrl=appBaseNoFile+this.$$url.substr(1)},this.$$parseLinkUrl=function(url,relHref){if(relHref&&"#"===relHref[0])return this.hash(relHref.slice(1)),!0;var appUrl,prevAppUrl,rewrittenUrl;return(appUrl=beginsWith(appBase,url))!==undefined?(prevAppUrl=appUrl,rewrittenUrl=(appUrl=beginsWith(basePrefix,appUrl))!==undefined?appBaseNoFile+(beginsWith("/",appUrl)||appUrl):appBase+prevAppUrl):(appUrl=beginsWith(appBaseNoFile,url))!==undefined?rewrittenUrl=appBaseNoFile+appUrl:appBaseNoFile==url+"/"&&(rewrittenUrl=appBaseNoFile),rewrittenUrl&&this.$$parse(rewrittenUrl),!!rewrittenUrl}}function LocationHashbangUrl(appBase,hashPrefix){var appBaseNoFile=stripFile(appBase);parseAbsoluteUrl(appBase,this),this.$$parse=function(url){function removeWindowsDriveName(path,url,base){var firstPathSegmentMatch,windowsFilePathExp=/^\/[A-Z]:(\/.*)/;return 0===url.indexOf(base)&&(url=url.replace(base,"")),windowsFilePathExp.exec(url)?path:(firstPathSegmentMatch=windowsFilePathExp.exec(path),firstPathSegmentMatch?firstPathSegmentMatch[1]:path)}var withoutHashUrl,withoutBaseUrl=beginsWith(appBase,url)||beginsWith(appBaseNoFile,url);isUndefined(withoutBaseUrl)||"#"!==withoutBaseUrl.charAt(0)?this.$$html5?withoutHashUrl=withoutBaseUrl:(withoutHashUrl="",isUndefined(withoutBaseUrl)&&(appBase=url,this.replace())):(withoutHashUrl=beginsWith(hashPrefix,withoutBaseUrl),isUndefined(withoutHashUrl)&&(withoutHashUrl=withoutBaseUrl)),parseAppUrl(withoutHashUrl,this),this.$$path=removeWindowsDriveName(this.$$path,withoutHashUrl,appBase),this.$$compose()},this.$$compose=function(){var search=toKeyValue(this.$$search),hash=this.$$hash?"#"+encodeUriSegment(this.$$hash):"";this.$$url=encodePath(this.$$path)+(search?"?"+search:"")+hash,this.$$absUrl=appBase+(this.$$url?hashPrefix+this.$$url:"")},this.$$parseLinkUrl=function(url,relHref){return stripHash(appBase)==stripHash(url)?(this.$$parse(url),!0):!1}}function LocationHashbangInHtml5Url(appBase,hashPrefix){this.$$html5=!0,LocationHashbangUrl.apply(this,arguments);var appBaseNoFile=stripFile(appBase);this.$$parseLinkUrl=function(url,relHref){if(relHref&&"#"===relHref[0])return this.hash(relHref.slice(1)),!0;var rewrittenUrl,appUrl;return appBase==stripHash(url)?rewrittenUrl=url:(appUrl=beginsWith(appBaseNoFile,url))?rewrittenUrl=appBase+hashPrefix+appUrl:appBaseNoFile===url+"/"&&(rewrittenUrl=appBaseNoFile),rewrittenUrl&&this.$$parse(rewrittenUrl),!!rewrittenUrl},this.$$compose=function(){var search=toKeyValue(this.$$search),hash=this.$$hash?"#"+encodeUriSegment(this.$$hash):"";this.$$url=encodePath(this.$$path)+(search?"?"+search:"")+hash,this.$$absUrl=appBase+hashPrefix+this.$$url}}function locationGetter(property){return function(){return this[property]}}function locationGetterSetter(property,preprocess){return function(value){return isUndefined(value)?this[property]:(this[property]=preprocess(value),this.$$compose(),this)}}function $LocationProvider(){var hashPrefix="",html5Mode={enabled:!1,requireBase:!0,rewriteLinks:!0};this.hashPrefix=function(prefix){return isDefined(prefix)?(hashPrefix=prefix,this):hashPrefix},this.html5Mode=function(mode){return isBoolean(mode)?(html5Mode.enabled=mode,this):isObject(mode)?(isBoolean(mode.enabled)&&(html5Mode.enabled=mode.enabled),isBoolean(mode.requireBase)&&(html5Mode.requireBase=mode.requireBase),isBoolean(mode.rewriteLinks)&&(html5Mode.rewriteLinks=mode.rewriteLinks),this):html5Mode},this.$get=["$rootScope","$browser","$sniffer","$rootElement","$window",function($rootScope,$browser,$sniffer,$rootElement,$window){function setBrowserUrlWithFallback(url,replace,state){var oldUrl=$location.url(),oldState=$location.$$state;try{$browser.url(url,replace,state),$location.$$state=$browser.state()}catch(e){throw $location.url(oldUrl),$location.$$state=oldState,e}}function afterLocationChange(oldUrl,oldState){$rootScope.$broadcast("$locationChangeSuccess",$location.absUrl(),oldUrl,$location.$$state,oldState)}var $location,LocationMode,appBase,baseHref=$browser.baseHref(),initialUrl=$browser.url();if(html5Mode.enabled){if(!baseHref&&html5Mode.requireBase)throw $locationMinErr("nobase","$location in HTML5 mode requires a <base> tag to be present!");appBase=serverBase(initialUrl)+(baseHref||"/"),LocationMode=$sniffer.history?LocationHtml5Url:LocationHashbangInHtml5Url}else appBase=stripHash(initialUrl),LocationMode=LocationHashbangUrl;$location=new LocationMode(appBase,"#"+hashPrefix),$location.$$parseLinkUrl(initialUrl,initialUrl),$location.$$state=$browser.state();var IGNORE_URI_REGEXP=/^\s*(javascript|mailto):/i;$rootElement.on("click",function(event){if(html5Mode.rewriteLinks&&!event.ctrlKey&&!event.metaKey&&!event.shiftKey&&2!=event.which&&2!=event.button){for(var elm=jqLite(event.target);"a"!==nodeName_(elm[0]);)if(elm[0]===$rootElement[0]||!(elm=elm.parent())[0])return;var absHref=elm.prop("href"),relHref=elm.attr("href")||elm.attr("xlink:href");isObject(absHref)&&"[object SVGAnimatedString]"===absHref.toString()&&(absHref=urlResolve(absHref.animVal).href),IGNORE_URI_REGEXP.test(absHref)||!absHref||elm.attr("target")||event.isDefaultPrevented()||$location.$$parseLinkUrl(absHref,relHref)&&(event.preventDefault(),$location.absUrl()!=$browser.url()&&($rootScope.$apply(),$window.angular["ff-684208-preventDefault"]=!0))}}),trimEmptyHash($location.absUrl())!=trimEmptyHash(initialUrl)&&$browser.url($location.absUrl(),!0);var initializing=!0;return $browser.onUrlChange(function(newUrl,newState){$rootScope.$evalAsync(function(){var defaultPrevented,oldUrl=$location.absUrl(),oldState=$location.$$state;$location.$$parse(newUrl),$location.$$state=newState,defaultPrevented=$rootScope.$broadcast("$locationChangeStart",newUrl,oldUrl,newState,oldState).defaultPrevented,$location.absUrl()===newUrl&&(defaultPrevented?($location.$$parse(oldUrl),$location.$$state=oldState,setBrowserUrlWithFallback(oldUrl,!1,oldState)):(initializing=!1,afterLocationChange(oldUrl,oldState)))}),$rootScope.$$phase||$rootScope.$digest()}),$rootScope.$watch(function(){var oldUrl=trimEmptyHash($browser.url()),newUrl=trimEmptyHash($location.absUrl()),oldState=$browser.state(),currentReplace=$location.$$replace,urlOrStateChanged=oldUrl!==newUrl||$location.$$html5&&$sniffer.history&&oldState!==$location.$$state;(initializing||urlOrStateChanged)&&(initializing=!1,$rootScope.$evalAsync(function(){var newUrl=$location.absUrl(),defaultPrevented=$rootScope.$broadcast("$locationChangeStart",newUrl,oldUrl,$location.$$state,oldState).defaultPrevented;$location.absUrl()===newUrl&&(defaultPrevented?($location.$$parse(oldUrl),$location.$$state=oldState):(urlOrStateChanged&&setBrowserUrlWithFallback(newUrl,currentReplace,oldState===$location.$$state?null:$location.$$state),afterLocationChange(oldUrl,oldState)))})),$location.$$replace=!1}),$location}]}function $LogProvider(){var debug=!0,self=this;this.debugEnabled=function(flag){return isDefined(flag)?(debug=flag,this):debug},this.$get=["$window",function($window){function formatError(arg){return arg instanceof Error&&(arg.stack?arg=arg.message&&-1===arg.stack.indexOf(arg.message)?"Error: "+arg.message+"\n"+arg.stack:arg.stack:arg.sourceURL&&(arg=arg.message+"\n"+arg.sourceURL+":"+arg.line)),arg}function consoleLog(type){var console=$window.console||{},logFn=console[type]||console.log||noop,hasApply=!1;try{hasApply=!!logFn.apply}catch(e){}return hasApply?function(){var args=[];return forEach(arguments,function(arg){args.push(formatError(arg))}),logFn.apply(console,args)}:function(arg1,arg2){logFn(arg1,null==arg2?"":arg2)}}return{log:consoleLog("log"),info:consoleLog("info"),warn:consoleLog("warn"),error:consoleLog("error"),debug:function(){var fn=consoleLog("debug");return function(){debug&&fn.apply(self,arguments)}}()}}]}function ensureSafeMemberName(name,fullExpression){if("__defineGetter__"===name||"__defineSetter__"===name||"__lookupGetter__"===name||"__lookupSetter__"===name||"__proto__"===name)throw $parseMinErr("isecfld","Attempting to access a disallowed field in Angular expressions! Expression: {0}",fullExpression);return name}function ensureSafeObject(obj,fullExpression){if(obj){if(obj.constructor===obj)throw $parseMinErr("isecfn","Referencing Function in Angular expressions is disallowed! Expression: {0}",fullExpression);if(obj.window===obj)throw $parseMinErr("isecwindow","Referencing the Window in Angular expressions is disallowed! Expression: {0}",fullExpression);if(obj.children&&(obj.nodeName||obj.prop&&obj.attr&&obj.find))throw $parseMinErr("isecdom","Referencing DOM nodes in Angular expressions is disallowed! Expression: {0}",fullExpression);if(obj===Object)throw $parseMinErr("isecobj","Referencing Object in Angular expressions is disallowed! Expression: {0}",fullExpression)}return obj}function ensureSafeFunction(obj,fullExpression){if(obj){if(obj.constructor===obj)throw $parseMinErr("isecfn","Referencing Function in Angular expressions is disallowed! Expression: {0}",fullExpression);if(obj===CALL||obj===APPLY||obj===BIND)throw $parseMinErr("isecff","Referencing call, apply or bind in Angular expressions is disallowed! Expression: {0}",fullExpression)}}function ifDefined(v,d){return"undefined"!=typeof v?v:d}function plusFn(l,r){return"undefined"==typeof l?r:"undefined"==typeof r?l:l+r}function isStateless($filter,filterName){var fn=$filter(filterName);return!fn.$stateful}function findConstantAndWatchExpressions(ast,$filter){var allConstants,argsToWatch;switch(ast.type){case AST.Program:allConstants=!0,forEach(ast.body,function(expr){findConstantAndWatchExpressions(expr.expression,$filter),allConstants=allConstants&&expr.expression.constant}),ast.constant=allConstants;break;case AST.Literal:ast.constant=!0,ast.toWatch=[];break;case AST.UnaryExpression:findConstantAndWatchExpressions(ast.argument,$filter),ast.constant=ast.argument.constant,ast.toWatch=ast.argument.toWatch;break;case AST.BinaryExpression:findConstantAndWatchExpressions(ast.left,$filter),findConstantAndWatchExpressions(ast.right,$filter),ast.constant=ast.left.constant&&ast.right.constant,ast.toWatch=ast.left.toWatch.concat(ast.right.toWatch);break;case AST.LogicalExpression:findConstantAndWatchExpressions(ast.left,$filter),findConstantAndWatchExpressions(ast.right,$filter),ast.constant=ast.left.constant&&ast.right.constant,ast.toWatch=ast.constant?[]:[ast];break;case AST.ConditionalExpression:findConstantAndWatchExpressions(ast.test,$filter),findConstantAndWatchExpressions(ast.alternate,$filter),findConstantAndWatchExpressions(ast.consequent,$filter),ast.constant=ast.test.constant&&ast.alternate.constant&&ast.consequent.constant,ast.toWatch=ast.constant?[]:[ast];break;case AST.Identifier:ast.constant=!1,ast.toWatch=[ast];break;case AST.MemberExpression:findConstantAndWatchExpressions(ast.object,$filter),ast.computed&&findConstantAndWatchExpressions(ast.property,$filter),ast.constant=ast.object.constant&&(!ast.computed||ast.property.constant),ast.toWatch=[ast];break;case AST.CallExpression:allConstants=ast.filter?isStateless($filter,ast.callee.name):!1,argsToWatch=[],forEach(ast.arguments,function(expr){findConstantAndWatchExpressions(expr,$filter),allConstants=allConstants&&expr.constant,expr.constant||argsToWatch.push.apply(argsToWatch,expr.toWatch)}),ast.constant=allConstants,ast.toWatch=ast.filter&&isStateless($filter,ast.callee.name)?argsToWatch:[ast];break;case AST.AssignmentExpression:findConstantAndWatchExpressions(ast.left,$filter),findConstantAndWatchExpressions(ast.right,$filter),ast.constant=ast.left.constant&&ast.right.constant,ast.toWatch=[ast];break;case AST.ArrayExpression:allConstants=!0,argsToWatch=[],forEach(ast.elements,function(expr){findConstantAndWatchExpressions(expr,$filter),allConstants=allConstants&&expr.constant,expr.constant||argsToWatch.push.apply(argsToWatch,expr.toWatch)}),ast.constant=allConstants,ast.toWatch=argsToWatch;break;case AST.ObjectExpression:allConstants=!0,argsToWatch=[],forEach(ast.properties,function(property){findConstantAndWatchExpressions(property.value,$filter),allConstants=allConstants&&property.value.constant,property.value.constant||argsToWatch.push.apply(argsToWatch,property.value.toWatch)}),ast.constant=allConstants,ast.toWatch=argsToWatch;break;case AST.ThisExpression:ast.constant=!1,ast.toWatch=[]}}function getInputs(body){if(1==body.length){var lastExpression=body[0].expression,candidate=lastExpression.toWatch;return 1!==candidate.length?candidate:candidate[0]!==lastExpression?candidate:undefined}}function isAssignable(ast){return ast.type===AST.Identifier||ast.type===AST.MemberExpression}function assignableAST(ast){return 1===ast.body.length&&isAssignable(ast.body[0].expression)?{type:AST.AssignmentExpression,left:ast.body[0].expression,right:{type:AST.NGValueParameter},operator:"="}:void 0}function isLiteral(ast){return 0===ast.body.length||1===ast.body.length&&(ast.body[0].expression.type===AST.Literal||ast.body[0].expression.type===AST.ArrayExpression||ast.body[0].expression.type===AST.ObjectExpression)}function isConstant(ast){return ast.constant}function ASTCompiler(astBuilder,$filter){this.astBuilder=astBuilder,this.$filter=$filter}function ASTInterpreter(astBuilder,$filter){this.astBuilder=astBuilder,this.$filter=$filter}function setter(obj,path,setValue,fullExp){ensureSafeObject(obj,fullExp);for(var key,element=path.split("."),i=0;element.length>1;i++){key=ensureSafeMemberName(element.shift(),fullExp);var propertyObj=ensureSafeObject(obj[key],fullExp);propertyObj||(propertyObj={},obj[key]=propertyObj),obj=propertyObj}return key=ensureSafeMemberName(element.shift(),fullExp),ensureSafeObject(obj[key],fullExp),obj[key]=setValue,setValue}function isPossiblyDangerousMemberName(name){return"constructor"==name}function getValueOf(value){return isFunction(value.valueOf)?value.valueOf():objectValueOf.call(value)}function $ParseProvider(){var cacheDefault=createMap(),cacheExpensive=createMap();this.$get=["$filter","$sniffer",function($filter,$sniffer){function expressionInputDirtyCheck(newValue,oldValueOfValue){return null==newValue||null==oldValueOfValue?newValue===oldValueOfValue:"object"==typeof newValue&&(newValue=getValueOf(newValue),"object"==typeof newValue)?!1:newValue===oldValueOfValue||newValue!==newValue&&oldValueOfValue!==oldValueOfValue}function inputsWatchDelegate(scope,listener,objectEquality,parsedExpression,prettyPrintExpression){var lastResult,inputExpressions=parsedExpression.inputs;if(1===inputExpressions.length){var oldInputValueOf=expressionInputDirtyCheck;return inputExpressions=inputExpressions[0],scope.$watch(function(scope){var newInputValue=inputExpressions(scope);return expressionInputDirtyCheck(newInputValue,oldInputValueOf)||(lastResult=parsedExpression(scope,undefined,undefined,[newInputValue]),oldInputValueOf=newInputValue&&getValueOf(newInputValue)),lastResult},listener,objectEquality,prettyPrintExpression)}for(var oldInputValueOfValues=[],oldInputValues=[],i=0,ii=inputExpressions.length;ii>i;i++)oldInputValueOfValues[i]=expressionInputDirtyCheck,oldInputValues[i]=null;return scope.$watch(function(scope){for(var changed=!1,i=0,ii=inputExpressions.length;ii>i;i++){var newInputValue=inputExpressions[i](scope);(changed||(changed=!expressionInputDirtyCheck(newInputValue,oldInputValueOfValues[i])))&&(oldInputValues[i]=newInputValue,oldInputValueOfValues[i]=newInputValue&&getValueOf(newInputValue))}return changed&&(lastResult=parsedExpression(scope,undefined,undefined,oldInputValues)),lastResult},listener,objectEquality,prettyPrintExpression)}function oneTimeWatchDelegate(scope,listener,objectEquality,parsedExpression){var unwatch,lastValue;return unwatch=scope.$watch(function(scope){return parsedExpression(scope)},function(value,old,scope){lastValue=value,isFunction(listener)&&listener.apply(this,arguments),isDefined(value)&&scope.$$postDigest(function(){isDefined(lastValue)&&unwatch()})},objectEquality)}function oneTimeLiteralWatchDelegate(scope,listener,objectEquality,parsedExpression){function isAllDefined(value){var allDefined=!0;return forEach(value,function(val){isDefined(val)||(allDefined=!1)}),allDefined}var unwatch,lastValue;return unwatch=scope.$watch(function(scope){return parsedExpression(scope)},function(value,old,scope){lastValue=value,isFunction(listener)&&listener.call(this,value,old,scope),isAllDefined(value)&&scope.$$postDigest(function(){isAllDefined(lastValue)&&unwatch()})},objectEquality)}function constantWatchDelegate(scope,listener,objectEquality,parsedExpression){var unwatch;return unwatch=scope.$watch(function(scope){return parsedExpression(scope)},function(value,old,scope){isFunction(listener)&&listener.apply(this,arguments),unwatch()},objectEquality)}function addInterceptor(parsedExpression,interceptorFn){if(!interceptorFn)return parsedExpression;var watchDelegate=parsedExpression.$$watchDelegate,regularWatch=watchDelegate!==oneTimeLiteralWatchDelegate&&watchDelegate!==oneTimeWatchDelegate,fn=regularWatch?function(scope,locals,assign,inputs){var value=parsedExpression(scope,locals,assign,inputs);return interceptorFn(value,scope,locals)}:function(scope,locals,assign,inputs){var value=parsedExpression(scope,locals,assign,inputs),result=interceptorFn(value,scope,locals);return isDefined(value)?result:value};return parsedExpression.$$watchDelegate&&parsedExpression.$$watchDelegate!==inputsWatchDelegate?fn.$$watchDelegate=parsedExpression.$$watchDelegate:interceptorFn.$stateful||(fn.$$watchDelegate=inputsWatchDelegate,fn.inputs=parsedExpression.inputs?parsedExpression.inputs:[parsedExpression]),fn}var $parseOptions={csp:$sniffer.csp,expensiveChecks:!1},$parseOptionsExpensive={csp:$sniffer.csp,expensiveChecks:!0};return function(exp,interceptorFn,expensiveChecks){var parsedExpression,oneTime,cacheKey;switch(typeof exp){case"string":exp=exp.trim(),cacheKey=exp;var cache=expensiveChecks?cacheExpensive:cacheDefault;if(parsedExpression=cache[cacheKey],!parsedExpression){":"===exp.charAt(0)&&":"===exp.charAt(1)&&(oneTime=!0,exp=exp.substring(2));var parseOptions=expensiveChecks?$parseOptionsExpensive:$parseOptions,lexer=new Lexer(parseOptions),parser=new Parser(lexer,$filter,parseOptions);parsedExpression=parser.parse(exp),parsedExpression.constant?parsedExpression.$$watchDelegate=constantWatchDelegate:oneTime?parsedExpression.$$watchDelegate=parsedExpression.literal?oneTimeLiteralWatchDelegate:oneTimeWatchDelegate:parsedExpression.inputs&&(parsedExpression.$$watchDelegate=inputsWatchDelegate),cache[cacheKey]=parsedExpression}return addInterceptor(parsedExpression,interceptorFn);case"function":return addInterceptor(exp,interceptorFn);default:return noop}}}]}function $QProvider(){this.$get=["$rootScope","$exceptionHandler",function($rootScope,$exceptionHandler){return qFactory(function(callback){$rootScope.$evalAsync(callback)},$exceptionHandler)}]}function $$QProvider(){this.$get=["$browser","$exceptionHandler",function($browser,$exceptionHandler){return qFactory(function(callback){$browser.defer(callback)},$exceptionHandler)}]}function qFactory(nextTick,exceptionHandler){function callOnce(self,resolveFn,rejectFn){function wrap(fn){return function(value){called||(called=!0,fn.call(self,value))}}var called=!1;return[wrap(resolveFn),wrap(rejectFn)]}function Promise(){this.$$state={status:0}}function simpleBind(context,fn){return function(value){fn.call(context,value)}}function processQueue(state){var fn,deferred,pending;pending=state.pending,state.processScheduled=!1,state.pending=undefined;for(var i=0,ii=pending.length;ii>i;++i){deferred=pending[i][0],fn=pending[i][state.status];try{isFunction(fn)?deferred.resolve(fn(state.value)):1===state.status?deferred.resolve(state.value):deferred.reject(state.value)}catch(e){deferred.reject(e),exceptionHandler(e)}}}function scheduleProcessQueue(state){!state.processScheduled&&state.pending&&(state.processScheduled=!0,nextTick(function(){processQueue(state)}))}function Deferred(){this.promise=new Promise,this.resolve=simpleBind(this,this.resolve),this.reject=simpleBind(this,this.reject),this.notify=simpleBind(this,this.notify)}function all(promises){var deferred=new Deferred,counter=0,results=isArray(promises)?[]:{};return forEach(promises,function(promise,key){counter++,when(promise).then(function(value){results.hasOwnProperty(key)||(results[key]=value,--counter||deferred.resolve(results))},function(reason){results.hasOwnProperty(key)||deferred.reject(reason)})}),0===counter&&deferred.resolve(results),deferred.promise}var $qMinErr=minErr("$q",TypeError),defer=function(){return new Deferred};Promise.prototype={then:function(onFulfilled,onRejected,progressBack){var result=new Deferred;return this.$$state.pending=this.$$state.pending||[],this.$$state.pending.push([result,onFulfilled,onRejected,progressBack]),this.$$state.status>0&&scheduleProcessQueue(this.$$state),result.promise},"catch":function(callback){return this.then(null,callback)},"finally":function(callback,progressBack){return this.then(function(value){return handleCallback(value,!0,callback)},function(error){return handleCallback(error,!1,callback)},progressBack)}},Deferred.prototype={resolve:function(val){this.promise.$$state.status||(val===this.promise?this.$$reject($qMinErr("qcycle","Expected promise to be resolved with value other than itself '{0}'",val)):this.$$resolve(val))},$$resolve:function(val){var then,fns;fns=callOnce(this,this.$$resolve,this.$$reject);try{(isObject(val)||isFunction(val))&&(then=val&&val.then),isFunction(then)?(this.promise.$$state.status=-1,then.call(val,fns[0],fns[1],this.notify)):(this.promise.$$state.value=val,this.promise.$$state.status=1,scheduleProcessQueue(this.promise.$$state))}catch(e){fns[1](e),exceptionHandler(e)}},reject:function(reason){this.promise.$$state.status||this.$$reject(reason)},$$reject:function(reason){this.promise.$$state.value=reason,this.promise.$$state.status=2,scheduleProcessQueue(this.promise.$$state)},notify:function(progress){var callbacks=this.promise.$$state.pending;this.promise.$$state.status<=0&&callbacks&&callbacks.length&&nextTick(function(){for(var callback,result,i=0,ii=callbacks.length;ii>i;i++){result=callbacks[i][0],callback=callbacks[i][3];try{result.notify(isFunction(callback)?callback(progress):progress)}catch(e){exceptionHandler(e)}}})}};var reject=function(reason){var result=new Deferred;return result.reject(reason),result.promise},makePromise=function(value,resolved){var result=new Deferred;return resolved?result.resolve(value):result.reject(value),result.promise},handleCallback=function(value,isResolved,callback){var callbackOutput=null;try{isFunction(callback)&&(callbackOutput=callback())}catch(e){return makePromise(e,!1)}return isPromiseLike(callbackOutput)?callbackOutput.then(function(){return makePromise(value,isResolved)},function(error){return makePromise(error,!1)}):makePromise(value,isResolved)},when=function(value,callback,errback,progressBack){var result=new Deferred;return result.resolve(value),result.promise.then(callback,errback,progressBack)},resolve=when,$Q=function Q(resolver){function resolveFn(value){deferred.resolve(value)}function rejectFn(reason){deferred.reject(reason)}if(!isFunction(resolver))throw $qMinErr("norslvr","Expected resolverFn, got '{0}'",resolver);if(!(this instanceof Q))return new Q(resolver);var deferred=new Deferred;return resolver(resolveFn,rejectFn),deferred.promise};return $Q.defer=defer,$Q.reject=reject,$Q.when=when,$Q.resolve=resolve,$Q.all=all,$Q}function $$RAFProvider(){this.$get=["$window","$timeout",function($window,$timeout){function flush(){for(var i=0;i<taskQueue.length;i++){var task=taskQueue[i];task&&(taskQueue[i]=null,task())}taskCount=taskQueue.length=0}function queueFn(asyncFn){var index=taskQueue.length; return taskCount++,taskQueue.push(asyncFn),0===index&&(cancelLastRAF=rafFn(flush)),function(){index>=0&&(taskQueue[index]=null,index=null,0===--taskCount&&cancelLastRAF&&(cancelLastRAF(),cancelLastRAF=null,taskQueue.length=0))}}var requestAnimationFrame=$window.requestAnimationFrame||$window.webkitRequestAnimationFrame,cancelAnimationFrame=$window.cancelAnimationFrame||$window.webkitCancelAnimationFrame||$window.webkitCancelRequestAnimationFrame,rafSupported=!!requestAnimationFrame,rafFn=rafSupported?function(fn){var id=requestAnimationFrame(fn);return function(){cancelAnimationFrame(id)}}:function(fn){var timer=$timeout(fn,16.66,!1);return function(){$timeout.cancel(timer)}};queueFn.supported=rafSupported;var cancelLastRAF,taskCount=0,taskQueue=[];return queueFn}]}function $RootScopeProvider(){function createChildScopeClass(parent){function ChildScope(){this.$$watchers=this.$$nextSibling=this.$$childHead=this.$$childTail=null,this.$$listeners={},this.$$listenerCount={},this.$$watchersCount=0,this.$id=nextUid(),this.$$ChildScope=null}return ChildScope.prototype=parent,ChildScope}var TTL=10,$rootScopeMinErr=minErr("$rootScope"),lastDirtyWatch=null,applyAsyncId=null;this.digestTtl=function(value){return arguments.length&&(TTL=value),TTL},this.$get=["$injector","$exceptionHandler","$parse","$browser",function($injector,$exceptionHandler,$parse,$browser){function destroyChildScope($event){$event.currentScope.$$destroyed=!0}function Scope(){this.$id=nextUid(),this.$$phase=this.$parent=this.$$watchers=this.$$nextSibling=this.$$prevSibling=this.$$childHead=this.$$childTail=null,this.$root=this,this.$$destroyed=!1,this.$$listeners={},this.$$listenerCount={},this.$$watchersCount=0,this.$$isolateBindings=null}function beginPhase(phase){if($rootScope.$$phase)throw $rootScopeMinErr("inprog","{0} already in progress",$rootScope.$$phase);$rootScope.$$phase=phase}function clearPhase(){$rootScope.$$phase=null}function incrementWatchersCount(current,count){do current.$$watchersCount+=count;while(current=current.$parent)}function decrementListenerCount(current,count,name){do current.$$listenerCount[name]-=count,0===current.$$listenerCount[name]&&delete current.$$listenerCount[name];while(current=current.$parent)}function initWatchVal(){}function flushApplyAsync(){for(;applyAsyncQueue.length;)try{applyAsyncQueue.shift()()}catch(e){$exceptionHandler(e)}applyAsyncId=null}function scheduleApplyAsync(){null===applyAsyncId&&(applyAsyncId=$browser.defer(function(){$rootScope.$apply(flushApplyAsync)}))}Scope.prototype={constructor:Scope,$new:function(isolate,parent){var child;return parent=parent||this,isolate?(child=new Scope,child.$root=this.$root):(this.$$ChildScope||(this.$$ChildScope=createChildScopeClass(this)),child=new this.$$ChildScope),child.$parent=parent,child.$$prevSibling=parent.$$childTail,parent.$$childHead?(parent.$$childTail.$$nextSibling=child,parent.$$childTail=child):parent.$$childHead=parent.$$childTail=child,(isolate||parent!=this)&&child.$on("$destroy",destroyChildScope),child},$watch:function(watchExp,listener,objectEquality,prettyPrintExpression){var get=$parse(watchExp);if(get.$$watchDelegate)return get.$$watchDelegate(this,listener,objectEquality,get,watchExp);var scope=this,array=scope.$$watchers,watcher={fn:listener,last:initWatchVal,get:get,exp:prettyPrintExpression||watchExp,eq:!!objectEquality};return lastDirtyWatch=null,isFunction(listener)||(watcher.fn=noop),array||(array=scope.$$watchers=[]),array.unshift(watcher),incrementWatchersCount(this,1),function(){arrayRemove(array,watcher)>=0&&incrementWatchersCount(scope,-1),lastDirtyWatch=null}},$watchGroup:function(watchExpressions,listener){function watchGroupAction(){changeReactionScheduled=!1,firstRun?(firstRun=!1,listener(newValues,newValues,self)):listener(newValues,oldValues,self)}var oldValues=new Array(watchExpressions.length),newValues=new Array(watchExpressions.length),deregisterFns=[],self=this,changeReactionScheduled=!1,firstRun=!0;if(!watchExpressions.length){var shouldCall=!0;return self.$evalAsync(function(){shouldCall&&listener(newValues,newValues,self)}),function(){shouldCall=!1}}return 1===watchExpressions.length?this.$watch(watchExpressions[0],function(value,oldValue,scope){newValues[0]=value,oldValues[0]=oldValue,listener(newValues,value===oldValue?newValues:oldValues,scope)}):(forEach(watchExpressions,function(expr,i){var unwatchFn=self.$watch(expr,function(value,oldValue){newValues[i]=value,oldValues[i]=oldValue,changeReactionScheduled||(changeReactionScheduled=!0,self.$evalAsync(watchGroupAction))});deregisterFns.push(unwatchFn)}),function(){for(;deregisterFns.length;)deregisterFns.shift()()})},$watchCollection:function(obj,listener){function $watchCollectionInterceptor(_value){newValue=_value;var newLength,key,bothNaN,newItem,oldItem;if(!isUndefined(newValue)){if(isObject(newValue))if(isArrayLike(newValue)){oldValue!==internalArray&&(oldValue=internalArray,oldLength=oldValue.length=0,changeDetected++),newLength=newValue.length,oldLength!==newLength&&(changeDetected++,oldValue.length=oldLength=newLength);for(var i=0;newLength>i;i++)oldItem=oldValue[i],newItem=newValue[i],bothNaN=oldItem!==oldItem&&newItem!==newItem,bothNaN||oldItem===newItem||(changeDetected++,oldValue[i]=newItem)}else{oldValue!==internalObject&&(oldValue=internalObject={},oldLength=0,changeDetected++),newLength=0;for(key in newValue)newValue.hasOwnProperty(key)&&(newLength++,newItem=newValue[key],oldItem=oldValue[key],key in oldValue?(bothNaN=oldItem!==oldItem&&newItem!==newItem,bothNaN||oldItem===newItem||(changeDetected++,oldValue[key]=newItem)):(oldLength++,oldValue[key]=newItem,changeDetected++));if(oldLength>newLength){changeDetected++;for(key in oldValue)newValue.hasOwnProperty(key)||(oldLength--,delete oldValue[key])}}else oldValue!==newValue&&(oldValue=newValue,changeDetected++);return changeDetected}}function $watchCollectionAction(){if(initRun?(initRun=!1,listener(newValue,newValue,self)):listener(newValue,veryOldValue,self),trackVeryOldValue)if(isObject(newValue))if(isArrayLike(newValue)){veryOldValue=new Array(newValue.length);for(var i=0;i<newValue.length;i++)veryOldValue[i]=newValue[i]}else{veryOldValue={};for(var key in newValue)hasOwnProperty.call(newValue,key)&&(veryOldValue[key]=newValue[key])}else veryOldValue=newValue}$watchCollectionInterceptor.$stateful=!0;var newValue,oldValue,veryOldValue,self=this,trackVeryOldValue=listener.length>1,changeDetected=0,changeDetector=$parse(obj,$watchCollectionInterceptor),internalArray=[],internalObject={},initRun=!0,oldLength=0;return this.$watch(changeDetector,$watchCollectionAction)},$digest:function(){var watch,value,last,watchers,length,dirty,next,current,logIdx,asyncTask,ttl=TTL,target=this,watchLog=[];beginPhase("$digest"),$browser.$$checkUrlChange(),this===$rootScope&&null!==applyAsyncId&&($browser.defer.cancel(applyAsyncId),flushApplyAsync()),lastDirtyWatch=null;do{for(dirty=!1,current=target;asyncQueue.length;){try{asyncTask=asyncQueue.shift(),asyncTask.scope.$eval(asyncTask.expression,asyncTask.locals)}catch(e){$exceptionHandler(e)}lastDirtyWatch=null}traverseScopesLoop:do{if(watchers=current.$$watchers)for(length=watchers.length;length--;)try{if(watch=watchers[length])if((value=watch.get(current))===(last=watch.last)||(watch.eq?equals(value,last):"number"==typeof value&&"number"==typeof last&&isNaN(value)&&isNaN(last))){if(watch===lastDirtyWatch){dirty=!1;break traverseScopesLoop}}else dirty=!0,lastDirtyWatch=watch,watch.last=watch.eq?copy(value,null):value,watch.fn(value,last===initWatchVal?value:last,current),5>ttl&&(logIdx=4-ttl,watchLog[logIdx]||(watchLog[logIdx]=[]),watchLog[logIdx].push({msg:isFunction(watch.exp)?"fn: "+(watch.exp.name||watch.exp.toString()):watch.exp,newVal:value,oldVal:last}))}catch(e){$exceptionHandler(e)}if(!(next=current.$$watchersCount&&current.$$childHead||current!==target&&current.$$nextSibling))for(;current!==target&&!(next=current.$$nextSibling);)current=current.$parent}while(current=next);if((dirty||asyncQueue.length)&&!ttl--)throw clearPhase(),$rootScopeMinErr("infdig","{0} $digest() iterations reached. Aborting!\nWatchers fired in the last 5 iterations: {1}",TTL,watchLog)}while(dirty||asyncQueue.length);for(clearPhase();postDigestQueue.length;)try{postDigestQueue.shift()()}catch(e){$exceptionHandler(e)}},$destroy:function(){if(!this.$$destroyed){var parent=this.$parent;this.$broadcast("$destroy"),this.$$destroyed=!0,this===$rootScope&&$browser.$$applicationDestroyed(),incrementWatchersCount(this,-this.$$watchersCount);for(var eventName in this.$$listenerCount)decrementListenerCount(this,this.$$listenerCount[eventName],eventName);parent&&parent.$$childHead==this&&(parent.$$childHead=this.$$nextSibling),parent&&parent.$$childTail==this&&(parent.$$childTail=this.$$prevSibling),this.$$prevSibling&&(this.$$prevSibling.$$nextSibling=this.$$nextSibling),this.$$nextSibling&&(this.$$nextSibling.$$prevSibling=this.$$prevSibling),this.$destroy=this.$digest=this.$apply=this.$evalAsync=this.$applyAsync=noop,this.$on=this.$watch=this.$watchGroup=function(){return noop},this.$$listeners={},this.$parent=this.$$nextSibling=this.$$prevSibling=this.$$childHead=this.$$childTail=this.$root=this.$$watchers=null}},$eval:function(expr,locals){return $parse(expr)(this,locals)},$evalAsync:function(expr,locals){$rootScope.$$phase||asyncQueue.length||$browser.defer(function(){asyncQueue.length&&$rootScope.$digest()}),asyncQueue.push({scope:this,expression:expr,locals:locals})},$$postDigest:function(fn){postDigestQueue.push(fn)},$apply:function(expr){try{return beginPhase("$apply"),this.$eval(expr)}catch(e){$exceptionHandler(e)}finally{clearPhase();try{$rootScope.$digest()}catch(e){throw $exceptionHandler(e),e}}},$applyAsync:function(expr){function $applyAsyncExpression(){scope.$eval(expr)}var scope=this;expr&&applyAsyncQueue.push($applyAsyncExpression),scheduleApplyAsync()},$on:function(name,listener){var namedListeners=this.$$listeners[name];namedListeners||(this.$$listeners[name]=namedListeners=[]),namedListeners.push(listener);var current=this;do current.$$listenerCount[name]||(current.$$listenerCount[name]=0),current.$$listenerCount[name]++;while(current=current.$parent);var self=this;return function(){var indexOfListener=namedListeners.indexOf(listener);-1!==indexOfListener&&(namedListeners[indexOfListener]=null,decrementListenerCount(self,1,name))}},$emit:function(name,args){var namedListeners,i,length,empty=[],scope=this,stopPropagation=!1,event={name:name,targetScope:scope,stopPropagation:function(){stopPropagation=!0},preventDefault:function(){event.defaultPrevented=!0},defaultPrevented:!1},listenerArgs=concat([event],arguments,1);do{for(namedListeners=scope.$$listeners[name]||empty,event.currentScope=scope,i=0,length=namedListeners.length;length>i;i++)if(namedListeners[i])try{namedListeners[i].apply(null,listenerArgs)}catch(e){$exceptionHandler(e)}else namedListeners.splice(i,1),i--,length--;if(stopPropagation)return event.currentScope=null,event;scope=scope.$parent}while(scope);return event.currentScope=null,event},$broadcast:function(name,args){var target=this,current=target,next=target,event={name:name,targetScope:target,preventDefault:function(){event.defaultPrevented=!0},defaultPrevented:!1};if(!target.$$listenerCount[name])return event;for(var listeners,i,length,listenerArgs=concat([event],arguments,1);current=next;){for(event.currentScope=current,listeners=current.$$listeners[name]||[],i=0,length=listeners.length;length>i;i++)if(listeners[i])try{listeners[i].apply(null,listenerArgs)}catch(e){$exceptionHandler(e)}else listeners.splice(i,1),i--,length--;if(!(next=current.$$listenerCount[name]&&current.$$childHead||current!==target&&current.$$nextSibling))for(;current!==target&&!(next=current.$$nextSibling);)current=current.$parent}return event.currentScope=null,event}};var $rootScope=new Scope,asyncQueue=$rootScope.$$asyncQueue=[],postDigestQueue=$rootScope.$$postDigestQueue=[],applyAsyncQueue=$rootScope.$$applyAsyncQueue=[];return $rootScope}]}function $$SanitizeUriProvider(){var aHrefSanitizationWhitelist=/^\s*(https?|ftp|mailto|tel|file):/,imgSrcSanitizationWhitelist=/^\s*((https?|ftp|file|blob):|data:image\/)/;this.aHrefSanitizationWhitelist=function(regexp){return isDefined(regexp)?(aHrefSanitizationWhitelist=regexp,this):aHrefSanitizationWhitelist},this.imgSrcSanitizationWhitelist=function(regexp){return isDefined(regexp)?(imgSrcSanitizationWhitelist=regexp,this):imgSrcSanitizationWhitelist},this.$get=function(){return function(uri,isImage){var normalizedVal,regex=isImage?imgSrcSanitizationWhitelist:aHrefSanitizationWhitelist;return normalizedVal=urlResolve(uri).href,""===normalizedVal||normalizedVal.match(regex)?uri:"unsafe:"+normalizedVal}}}function adjustMatcher(matcher){if("self"===matcher)return matcher;if(isString(matcher)){if(matcher.indexOf("***")>-1)throw $sceMinErr("iwcard","Illegal sequence *** in string matcher. String: {0}",matcher);return matcher=escapeForRegexp(matcher).replace("\\*\\*",".*").replace("\\*","[^:/.?&;]*"),new RegExp("^"+matcher+"$")}if(isRegExp(matcher))return new RegExp("^"+matcher.source+"$");throw $sceMinErr("imatcher",'Matchers may only be "self", string patterns or RegExp objects')}function adjustMatchers(matchers){var adjustedMatchers=[];return isDefined(matchers)&&forEach(matchers,function(matcher){adjustedMatchers.push(adjustMatcher(matcher))}),adjustedMatchers}function $SceDelegateProvider(){this.SCE_CONTEXTS=SCE_CONTEXTS;var resourceUrlWhitelist=["self"],resourceUrlBlacklist=[];this.resourceUrlWhitelist=function(value){return arguments.length&&(resourceUrlWhitelist=adjustMatchers(value)),resourceUrlWhitelist},this.resourceUrlBlacklist=function(value){return arguments.length&&(resourceUrlBlacklist=adjustMatchers(value)),resourceUrlBlacklist},this.$get=["$injector",function($injector){function matchUrl(matcher,parsedUrl){return"self"===matcher?urlIsSameOrigin(parsedUrl):!!matcher.exec(parsedUrl.href)}function isResourceUrlAllowedByPolicy(url){var i,n,parsedUrl=urlResolve(url.toString()),allowed=!1;for(i=0,n=resourceUrlWhitelist.length;n>i;i++)if(matchUrl(resourceUrlWhitelist[i],parsedUrl)){allowed=!0;break}if(allowed)for(i=0,n=resourceUrlBlacklist.length;n>i;i++)if(matchUrl(resourceUrlBlacklist[i],parsedUrl)){allowed=!1;break}return allowed}function generateHolderType(Base){var holderType=function(trustedValue){this.$$unwrapTrustedValue=function(){return trustedValue}};return Base&&(holderType.prototype=new Base),holderType.prototype.valueOf=function(){return this.$$unwrapTrustedValue()},holderType.prototype.toString=function(){return this.$$unwrapTrustedValue().toString()},holderType}function trustAs(type,trustedValue){var Constructor=byType.hasOwnProperty(type)?byType[type]:null;if(!Constructor)throw $sceMinErr("icontext","Attempted to trust a value in invalid context. Context: {0}; Value: {1}",type,trustedValue);if(null===trustedValue||trustedValue===undefined||""===trustedValue)return trustedValue;if("string"!=typeof trustedValue)throw $sceMinErr("itype","Attempted to trust a non-string value in a content requiring a string: Context: {0}",type);return new Constructor(trustedValue)}function valueOf(maybeTrusted){return maybeTrusted instanceof trustedValueHolderBase?maybeTrusted.$$unwrapTrustedValue():maybeTrusted}function getTrusted(type,maybeTrusted){if(null===maybeTrusted||maybeTrusted===undefined||""===maybeTrusted)return maybeTrusted;var constructor=byType.hasOwnProperty(type)?byType[type]:null;if(constructor&&maybeTrusted instanceof constructor)return maybeTrusted.$$unwrapTrustedValue();if(type===SCE_CONTEXTS.RESOURCE_URL){if(isResourceUrlAllowedByPolicy(maybeTrusted))return maybeTrusted;throw $sceMinErr("insecurl","Blocked loading resource from url not allowed by $sceDelegate policy. URL: {0}",maybeTrusted.toString())}if(type===SCE_CONTEXTS.HTML)return htmlSanitizer(maybeTrusted);throw $sceMinErr("unsafe","Attempting to use an unsafe value in a safe context.")}var htmlSanitizer=function(html){throw $sceMinErr("unsafe","Attempting to use an unsafe value in a safe context.")};$injector.has("$sanitize")&&(htmlSanitizer=$injector.get("$sanitize"));var trustedValueHolderBase=generateHolderType(),byType={};return byType[SCE_CONTEXTS.HTML]=generateHolderType(trustedValueHolderBase),byType[SCE_CONTEXTS.CSS]=generateHolderType(trustedValueHolderBase),byType[SCE_CONTEXTS.URL]=generateHolderType(trustedValueHolderBase),byType[SCE_CONTEXTS.JS]=generateHolderType(trustedValueHolderBase),byType[SCE_CONTEXTS.RESOURCE_URL]=generateHolderType(byType[SCE_CONTEXTS.URL]),{trustAs:trustAs,getTrusted:getTrusted,valueOf:valueOf}}]}function $SceProvider(){var enabled=!0;this.enabled=function(value){return arguments.length&&(enabled=!!value),enabled},this.$get=["$parse","$sceDelegate",function($parse,$sceDelegate){if(enabled&&8>msie)throw $sceMinErr("iequirks","Strict Contextual Escaping does not support Internet Explorer version < 11 in quirks mode. You can fix this by adding the text <!doctype html> to the top of your HTML document. See http://docs.angularjs.org/api/ng.$sce for more information.");var sce=shallowCopy(SCE_CONTEXTS);sce.isEnabled=function(){return enabled},sce.trustAs=$sceDelegate.trustAs,sce.getTrusted=$sceDelegate.getTrusted,sce.valueOf=$sceDelegate.valueOf,enabled||(sce.trustAs=sce.getTrusted=function(type,value){return value},sce.valueOf=identity),sce.parseAs=function(type,expr){var parsed=$parse(expr);return parsed.literal&&parsed.constant?parsed:$parse(expr,function(value){return sce.getTrusted(type,value)})};var parse=sce.parseAs,getTrusted=sce.getTrusted,trustAs=sce.trustAs;return forEach(SCE_CONTEXTS,function(enumValue,name){var lName=lowercase(name);sce[camelCase("parse_as_"+lName)]=function(expr){return parse(enumValue,expr)},sce[camelCase("get_trusted_"+lName)]=function(value){return getTrusted(enumValue,value)},sce[camelCase("trust_as_"+lName)]=function(value){return trustAs(enumValue,value)}}),sce}]}function $SnifferProvider(){this.$get=["$window","$document",function($window,$document){var vendorPrefix,match,eventSupport={},android=toInt((/android (\d+)/.exec(lowercase(($window.navigator||{}).userAgent))||[])[1]),boxee=/Boxee/i.test(($window.navigator||{}).userAgent),document=$document[0]||{},vendorRegex=/^(Moz|webkit|ms)(?=[A-Z])/,bodyStyle=document.body&&document.body.style,transitions=!1,animations=!1;if(bodyStyle){for(var prop in bodyStyle)if(match=vendorRegex.exec(prop)){vendorPrefix=match[0],vendorPrefix=vendorPrefix.substr(0,1).toUpperCase()+vendorPrefix.substr(1);break}vendorPrefix||(vendorPrefix="WebkitOpacity"in bodyStyle&&"webkit"),transitions=!!("transition"in bodyStyle||vendorPrefix+"Transition"in bodyStyle),animations=!!("animation"in bodyStyle||vendorPrefix+"Animation"in bodyStyle),!android||transitions&&animations||(transitions=isString(bodyStyle.webkitTransition),animations=isString(bodyStyle.webkitAnimation))}return{history:!(!$window.history||!$window.history.pushState||4>android||boxee),hasEvent:function(event){if("input"===event&&11>=msie)return!1;if(isUndefined(eventSupport[event])){var divElm=document.createElement("div");eventSupport[event]="on"+event in divElm}return eventSupport[event]},csp:csp(),vendorPrefix:vendorPrefix,transitions:transitions,animations:animations,android:android}}]}function $TemplateRequestProvider(){this.$get=["$templateCache","$http","$q","$sce",function($templateCache,$http,$q,$sce){function handleRequestFn(tpl,ignoreRequestError){function handleError(resp){if(!ignoreRequestError)throw $compileMinErr("tpload","Failed to load template: {0} (HTTP status: {1} {2})",tpl,resp.status,resp.statusText);return $q.reject(resp)}handleRequestFn.totalPendingRequests++,isString(tpl)&&$templateCache.get(tpl)||(tpl=$sce.getTrustedResourceUrl(tpl));var transformResponse=$http.defaults&&$http.defaults.transformResponse;isArray(transformResponse)?transformResponse=transformResponse.filter(function(transformer){return transformer!==defaultHttpResponseTransform}):transformResponse===defaultHttpResponseTransform&&(transformResponse=null);var httpOptions={cache:$templateCache,transformResponse:transformResponse};return $http.get(tpl,httpOptions)["finally"](function(){handleRequestFn.totalPendingRequests--}).then(function(response){return $templateCache.put(tpl,response.data),response.data},handleError)}return handleRequestFn.totalPendingRequests=0,handleRequestFn}]}function $$TestabilityProvider(){this.$get=["$rootScope","$browser","$location",function($rootScope,$browser,$location){var testability={};return testability.findBindings=function(element,expression,opt_exactMatch){var bindings=element.getElementsByClassName("ng-binding"),matches=[];return forEach(bindings,function(binding){var dataBinding=angular.element(binding).data("$binding");dataBinding&&forEach(dataBinding,function(bindingName){if(opt_exactMatch){var matcher=new RegExp("(^|\\s)"+escapeForRegexp(expression)+"(\\s|\\||$)");matcher.test(bindingName)&&matches.push(binding)}else-1!=bindingName.indexOf(expression)&&matches.push(binding)})}),matches},testability.findModels=function(element,expression,opt_exactMatch){for(var prefixes=["ng-","data-ng-","ng\\:"],p=0;p<prefixes.length;++p){var attributeEquals=opt_exactMatch?"=":"*=",selector="["+prefixes[p]+"model"+attributeEquals+'"'+expression+'"]',elements=element.querySelectorAll(selector);if(elements.length)return elements}},testability.getLocation=function(){return $location.url()},testability.setLocation=function(url){url!==$location.url()&&($location.url(url),$rootScope.$digest())},testability.whenStable=function(callback){$browser.notifyWhenNoOutstandingRequests(callback)},testability}]}function $TimeoutProvider(){this.$get=["$rootScope","$browser","$q","$$q","$exceptionHandler",function($rootScope,$browser,$q,$$q,$exceptionHandler){function timeout(fn,delay,invokeApply){isFunction(fn)||(invokeApply=delay,delay=fn,fn=noop);var timeoutId,args=sliceArgs(arguments,3),skipApply=isDefined(invokeApply)&&!invokeApply,deferred=(skipApply?$$q:$q).defer(),promise=deferred.promise;return timeoutId=$browser.defer(function(){try{deferred.resolve(fn.apply(null,args))}catch(e){deferred.reject(e),$exceptionHandler(e)}finally{delete deferreds[promise.$$timeoutId]}skipApply||$rootScope.$apply()},delay),promise.$$timeoutId=timeoutId,deferreds[timeoutId]=deferred,promise}var deferreds={};return timeout.cancel=function(promise){return promise&&promise.$$timeoutId in deferreds?(deferreds[promise.$$timeoutId].reject("canceled"),delete deferreds[promise.$$timeoutId],$browser.defer.cancel(promise.$$timeoutId)):!1},timeout}]}function urlResolve(url){var href=url;return msie&&(urlParsingNode.setAttribute("href",href),href=urlParsingNode.href),urlParsingNode.setAttribute("href",href),{href:urlParsingNode.href,protocol:urlParsingNode.protocol?urlParsingNode.protocol.replace(/:$/,""):"",host:urlParsingNode.host,search:urlParsingNode.search?urlParsingNode.search.replace(/^\?/,""):"",hash:urlParsingNode.hash?urlParsingNode.hash.replace(/^#/,""):"",hostname:urlParsingNode.hostname,port:urlParsingNode.port,pathname:"/"===urlParsingNode.pathname.charAt(0)?urlParsingNode.pathname:"/"+urlParsingNode.pathname}}function urlIsSameOrigin(requestUrl){var parsed=isString(requestUrl)?urlResolve(requestUrl):requestUrl;return parsed.protocol===originUrl.protocol&&parsed.host===originUrl.host}function $WindowProvider(){this.$get=valueFn(window)}function $$CookieReader($document){function safeDecodeURIComponent(str){try{return decodeURIComponent(str)}catch(e){return str}}var rawDocument=$document[0]||{},lastCookies={},lastCookieString="";return function(){var cookieArray,cookie,i,index,name,currentCookieString=rawDocument.cookie||"";if(currentCookieString!==lastCookieString)for(lastCookieString=currentCookieString,cookieArray=lastCookieString.split("; "),lastCookies={},i=0;i<cookieArray.length;i++)cookie=cookieArray[i],index=cookie.indexOf("="),index>0&&(name=safeDecodeURIComponent(cookie.substring(0,index)),lastCookies[name]===undefined&&(lastCookies[name]=safeDecodeURIComponent(cookie.substring(index+1))));return lastCookies}}function $$CookieReaderProvider(){this.$get=$$CookieReader}function $FilterProvider($provide){function register(name,factory){if(isObject(name)){var filters={};return forEach(name,function(filter,key){filters[key]=register(key,filter)}),filters}return $provide.factory(name+suffix,factory)}var suffix="Filter";this.register=register,this.$get=["$injector",function($injector){return function(name){return $injector.get(name+suffix)}}],register("currency",currencyFilter),register("date",dateFilter),register("filter",filterFilter),register("json",jsonFilter),register("limitTo",limitToFilter),register("lowercase",lowercaseFilter),register("number",numberFilter),register("orderBy",orderByFilter),register("uppercase",uppercaseFilter)}function filterFilter(){return function(array,expression,comparator){if(!isArrayLike(array)){if(null==array)return array;throw minErr("filter")("notarray","Expected array but received: {0}",array)}var predicateFn,matchAgainstAnyProp,expressionType=getTypeForFilter(expression);switch(expressionType){case"function":predicateFn=expression;break;case"boolean":case"null":case"number":case"string":matchAgainstAnyProp=!0;case"object":predicateFn=createPredicateFn(expression,comparator,matchAgainstAnyProp);break;default:return array}return Array.prototype.filter.call(array,predicateFn)}}function createPredicateFn(expression,comparator,matchAgainstAnyProp){var predicateFn,shouldMatchPrimitives=isObject(expression)&&"$"in expression;return comparator===!0?comparator=equals:isFunction(comparator)||(comparator=function(actual,expected){return isUndefined(actual)?!1:null===actual||null===expected?actual===expected:isObject(expected)||isObject(actual)&&!hasCustomToString(actual)?!1:(actual=lowercase(""+actual),expected=lowercase(""+expected),-1!==actual.indexOf(expected))}),predicateFn=function(item){return shouldMatchPrimitives&&!isObject(item)?deepCompare(item,expression.$,comparator,!1):deepCompare(item,expression,comparator,matchAgainstAnyProp)}}function deepCompare(actual,expected,comparator,matchAgainstAnyProp,dontMatchWholeObject){var actualType=getTypeForFilter(actual),expectedType=getTypeForFilter(expected);if("string"===expectedType&&"!"===expected.charAt(0))return!deepCompare(actual,expected.substring(1),comparator,matchAgainstAnyProp);if(isArray(actual))return actual.some(function(item){return deepCompare(item,expected,comparator,matchAgainstAnyProp)});switch(actualType){case"object":var key;if(matchAgainstAnyProp){for(key in actual)if("$"!==key.charAt(0)&&deepCompare(actual[key],expected,comparator,!0))return!0;return dontMatchWholeObject?!1:deepCompare(actual,expected,comparator,!1)}if("object"===expectedType){for(key in expected){var expectedVal=expected[key];if(!isFunction(expectedVal)&&!isUndefined(expectedVal)){var matchAnyProperty="$"===key,actualVal=matchAnyProperty?actual:actual[key];if(!deepCompare(actualVal,expectedVal,comparator,matchAnyProperty,matchAnyProperty))return!1}}return!0}return comparator(actual,expected);case"function":return!1;default:return comparator(actual,expected)}}function getTypeForFilter(val){return null===val?"null":typeof val}function currencyFilter($locale){var formats=$locale.NUMBER_FORMATS;return function(amount,currencySymbol,fractionSize){return isUndefined(currencySymbol)&&(currencySymbol=formats.CURRENCY_SYM),isUndefined(fractionSize)&&(fractionSize=formats.PATTERNS[1].maxFrac),null==amount?amount:formatNumber(amount,formats.PATTERNS[1],formats.GROUP_SEP,formats.DECIMAL_SEP,fractionSize).replace(/\u00A4/g,currencySymbol)}}function numberFilter($locale){var formats=$locale.NUMBER_FORMATS;return function(number,fractionSize){return null==number?number:formatNumber(number,formats.PATTERNS[0],formats.GROUP_SEP,formats.DECIMAL_SEP,fractionSize)}}function formatNumber(number,pattern,groupSep,decimalSep,fractionSize){if(isObject(number))return"";var isNegative=0>number;number=Math.abs(number);var isInfinity=number===1/0;if(!isInfinity&&!isFinite(number))return"";var numStr=number+"",formatedText="",hasExponent=!1,parts=[];if(isInfinity&&(formatedText="∞"),!isInfinity&&-1!==numStr.indexOf("e")){var match=numStr.match(/([\d\.]+)e(-?)(\d+)/);match&&"-"==match[2]&&match[3]>fractionSize+1?number=0:(formatedText=numStr,hasExponent=!0)}if(isInfinity||hasExponent)fractionSize>0&&1>number&&(formatedText=number.toFixed(fractionSize),number=parseFloat(formatedText));else{var fractionLen=(numStr.split(DECIMAL_SEP)[1]||"").length;isUndefined(fractionSize)&&(fractionSize=Math.min(Math.max(pattern.minFrac,fractionLen),pattern.maxFrac)),number=+(Math.round(+(number.toString()+"e"+fractionSize)).toString()+"e"+-fractionSize);var fraction=(""+number).split(DECIMAL_SEP),whole=fraction[0];fraction=fraction[1]||"";var i,pos=0,lgroup=pattern.lgSize,group=pattern.gSize;if(whole.length>=lgroup+group)for(pos=whole.length-lgroup,i=0;pos>i;i++)(pos-i)%group===0&&0!==i&&(formatedText+=groupSep),formatedText+=whole.charAt(i);for(i=pos;i<whole.length;i++)(whole.length-i)%lgroup===0&&0!==i&&(formatedText+=groupSep),formatedText+=whole.charAt(i);for(;fraction.length<fractionSize;)fraction+="0";fractionSize&&"0"!==fractionSize&&(formatedText+=decimalSep+fraction.substr(0,fractionSize))}return 0===number&&(isNegative=!1),parts.push(isNegative?pattern.negPre:pattern.posPre,formatedText,isNegative?pattern.negSuf:pattern.posSuf),parts.join("")}function padNumber(num,digits,trim){var neg="";for(0>num&&(neg="-",num=-num),num=""+num;num.length<digits;)num="0"+num;return trim&&(num=num.substr(num.length-digits)),neg+num}function dateGetter(name,size,offset,trim){return offset=offset||0,function(date){var value=date["get"+name]();return(offset>0||value>-offset)&&(value+=offset),0===value&&-12==offset&&(value=12),padNumber(value,size,trim)}}function dateStrGetter(name,shortForm){return function(date,formats){var value=date["get"+name](),get=uppercase(shortForm?"SHORT"+name:name);return formats[get][value]}}function timeZoneGetter(date,formats,offset){var zone=-1*offset,paddedZone=zone>=0?"+":"";return paddedZone+=padNumber(Math[zone>0?"floor":"ceil"](zone/60),2)+padNumber(Math.abs(zone%60),2)}function getFirstThursdayOfYear(year){var dayOfWeekOnFirst=new Date(year,0,1).getDay();return new Date(year,0,(4>=dayOfWeekOnFirst?5:12)-dayOfWeekOnFirst)}function getThursdayThisWeek(datetime){return new Date(datetime.getFullYear(),datetime.getMonth(),datetime.getDate()+(4-datetime.getDay()))}function weekGetter(size){return function(date){var firstThurs=getFirstThursdayOfYear(date.getFullYear()),thisThurs=getThursdayThisWeek(date),diff=+thisThurs-+firstThurs,result=1+Math.round(diff/6048e5);return padNumber(result,size)}}function ampmGetter(date,formats){return date.getHours()<12?formats.AMPMS[0]:formats.AMPMS[1]}function eraGetter(date,formats){return date.getFullYear()<=0?formats.ERAS[0]:formats.ERAS[1]}function longEraGetter(date,formats){return date.getFullYear()<=0?formats.ERANAMES[0]:formats.ERANAMES[1]}function dateFilter($locale){function jsonStringToDate(string){var match;if(match=string.match(R_ISO8601_STR)){var date=new Date(0),tzHour=0,tzMin=0,dateSetter=match[8]?date.setUTCFullYear:date.setFullYear,timeSetter=match[8]?date.setUTCHours:date.setHours;match[9]&&(tzHour=toInt(match[9]+match[10]),tzMin=toInt(match[9]+match[11])),dateSetter.call(date,toInt(match[1]),toInt(match[2])-1,toInt(match[3]));var h=toInt(match[4]||0)-tzHour,m=toInt(match[5]||0)-tzMin,s=toInt(match[6]||0),ms=Math.round(1e3*parseFloat("0."+(match[7]||0)));return timeSetter.call(date,h,m,s,ms),date}return string}var R_ISO8601_STR=/^(\d{4})-?(\d\d)-?(\d\d)(?:T(\d\d)(?::?(\d\d)(?::?(\d\d)(?:\.(\d+))?)?)?(Z|([+-])(\d\d):?(\d\d))?)?$/;return function(date,format,timezone){var fn,match,text="",parts=[];if(format=format||"mediumDate",format=$locale.DATETIME_FORMATS[format]||format,isString(date)&&(date=NUMBER_STRING.test(date)?toInt(date):jsonStringToDate(date)),isNumber(date)&&(date=new Date(date)), !isDate(date)||!isFinite(date.getTime()))return date;for(;format;)match=DATE_FORMATS_SPLIT.exec(format),match?(parts=concat(parts,match,1),format=parts.pop()):(parts.push(format),format=null);var dateTimezoneOffset=date.getTimezoneOffset();return timezone&&(dateTimezoneOffset=timezoneToOffset(timezone,date.getTimezoneOffset()),date=convertTimezoneToLocal(date,timezone,!0)),forEach(parts,function(value){fn=DATE_FORMATS[value],text+=fn?fn(date,$locale.DATETIME_FORMATS,dateTimezoneOffset):value.replace(/(^'|'$)/g,"").replace(/''/g,"'")}),text}}function jsonFilter(){return function(object,spacing){return isUndefined(spacing)&&(spacing=2),toJson(object,spacing)}}function limitToFilter(){return function(input,limit,begin){return limit=Math.abs(Number(limit))===1/0?Number(limit):toInt(limit),isNaN(limit)?input:(isNumber(input)&&(input=input.toString()),isArray(input)||isString(input)?(begin=!begin||isNaN(begin)?0:toInt(begin),begin=0>begin&&begin>=-input.length?input.length+begin:begin,limit>=0?input.slice(begin,begin+limit):0===begin?input.slice(limit,input.length):input.slice(Math.max(0,begin+limit),begin)):input)}}function orderByFilter($parse){function processPredicates(sortPredicate,reverseOrder){return reverseOrder=reverseOrder?-1:1,sortPredicate.map(function(predicate){var descending=1,get=identity;if(isFunction(predicate))get=predicate;else if(isString(predicate)&&(("+"==predicate.charAt(0)||"-"==predicate.charAt(0))&&(descending="-"==predicate.charAt(0)?-1:1,predicate=predicate.substring(1)),""!==predicate&&(get=$parse(predicate),get.constant))){var key=get();get=function(value){return value[key]}}return{get:get,descending:descending*reverseOrder}})}function isPrimitive(value){switch(typeof value){case"number":case"boolean":case"string":return!0;default:return!1}}function objectValue(value,index){return"function"==typeof value.valueOf&&(value=value.valueOf(),isPrimitive(value))?value:hasCustomToString(value)&&(value=value.toString(),isPrimitive(value))?value:index}function getPredicateValue(value,index){var type=typeof value;return null===value?(type="string",value="null"):"string"===type?value=value.toLowerCase():"object"===type&&(value=objectValue(value,index)),{value:value,type:type}}function compare(v1,v2){var result=0;return v1.type===v2.type?v1.value!==v2.value&&(result=v1.value<v2.value?-1:1):result=v1.type<v2.type?-1:1,result}return function(array,sortPredicate,reverseOrder){function getComparisonObject(value,index){return{value:value,predicateValues:predicates.map(function(predicate){return getPredicateValue(predicate.get(value),index)})}}function doComparison(v1,v2){for(var result=0,index=0,length=predicates.length;length>index&&!(result=compare(v1.predicateValues[index],v2.predicateValues[index])*predicates[index].descending);++index);return result}if(!isArrayLike(array))return array;isArray(sortPredicate)||(sortPredicate=[sortPredicate]),0===sortPredicate.length&&(sortPredicate=["+"]);var predicates=processPredicates(sortPredicate,reverseOrder),compareValues=Array.prototype.map.call(array,getComparisonObject);return compareValues.sort(doComparison),array=compareValues.map(function(item){return item.value})}}function ngDirective(directive){return isFunction(directive)&&(directive={link:directive}),directive.restrict=directive.restrict||"AC",valueFn(directive)}function nullFormRenameControl(control,name){control.$name=name}function FormController(element,attrs,$scope,$animate,$interpolate){var form=this,controls=[],parentForm=form.$$parentForm=element.parent().controller("form")||nullFormCtrl;form.$error={},form.$$success={},form.$pending=undefined,form.$name=$interpolate(attrs.name||attrs.ngForm||"")($scope),form.$dirty=!1,form.$pristine=!0,form.$valid=!0,form.$invalid=!1,form.$submitted=!1,parentForm.$addControl(form),form.$rollbackViewValue=function(){forEach(controls,function(control){control.$rollbackViewValue()})},form.$commitViewValue=function(){forEach(controls,function(control){control.$commitViewValue()})},form.$addControl=function(control){assertNotHasOwnProperty(control.$name,"input"),controls.push(control),control.$name&&(form[control.$name]=control)},form.$$renameControl=function(control,newName){var oldName=control.$name;form[oldName]===control&&delete form[oldName],form[newName]=control,control.$name=newName},form.$removeControl=function(control){control.$name&&form[control.$name]===control&&delete form[control.$name],forEach(form.$pending,function(value,name){form.$setValidity(name,null,control)}),forEach(form.$error,function(value,name){form.$setValidity(name,null,control)}),forEach(form.$$success,function(value,name){form.$setValidity(name,null,control)}),arrayRemove(controls,control)},addSetValidityMethod({ctrl:this,$element:element,set:function(object,property,controller){var list=object[property];if(list){var index=list.indexOf(controller);-1===index&&list.push(controller)}else object[property]=[controller]},unset:function(object,property,controller){var list=object[property];list&&(arrayRemove(list,controller),0===list.length&&delete object[property])},parentForm:parentForm,$animate:$animate}),form.$setDirty=function(){$animate.removeClass(element,PRISTINE_CLASS),$animate.addClass(element,DIRTY_CLASS),form.$dirty=!0,form.$pristine=!1,parentForm.$setDirty()},form.$setPristine=function(){$animate.setClass(element,PRISTINE_CLASS,DIRTY_CLASS+" "+SUBMITTED_CLASS),form.$dirty=!1,form.$pristine=!0,form.$submitted=!1,forEach(controls,function(control){control.$setPristine()})},form.$setUntouched=function(){forEach(controls,function(control){control.$setUntouched()})},form.$setSubmitted=function(){$animate.addClass(element,SUBMITTED_CLASS),form.$submitted=!0,parentForm.$setSubmitted()}}function stringBasedInputType(ctrl){ctrl.$formatters.push(function(value){return ctrl.$isEmpty(value)?value:value.toString()})}function textInputType(scope,element,attr,ctrl,$sniffer,$browser){baseInputType(scope,element,attr,ctrl,$sniffer,$browser),stringBasedInputType(ctrl)}function baseInputType(scope,element,attr,ctrl,$sniffer,$browser){var type=lowercase(element[0].type);if(!$sniffer.android){var composing=!1;element.on("compositionstart",function(data){composing=!0}),element.on("compositionend",function(){composing=!1,listener()})}var listener=function(ev){if(timeout&&($browser.defer.cancel(timeout),timeout=null),!composing){var value=element.val(),event=ev&&ev.type;"password"===type||attr.ngTrim&&"false"===attr.ngTrim||(value=trim(value)),(ctrl.$viewValue!==value||""===value&&ctrl.$$hasNativeValidators)&&ctrl.$setViewValue(value,event)}};if($sniffer.hasEvent("input"))element.on("input",listener);else{var timeout,deferListener=function(ev,input,origValue){timeout||(timeout=$browser.defer(function(){timeout=null,input&&input.value===origValue||listener(ev)}))};element.on("keydown",function(event){var key=event.keyCode;91===key||key>15&&19>key||key>=37&&40>=key||deferListener(event,this,this.value)}),$sniffer.hasEvent("paste")&&element.on("paste cut",deferListener)}element.on("change",listener),ctrl.$render=function(){element.val(ctrl.$isEmpty(ctrl.$viewValue)?"":ctrl.$viewValue)}}function weekParser(isoWeek,existingDate){if(isDate(isoWeek))return isoWeek;if(isString(isoWeek)){WEEK_REGEXP.lastIndex=0;var parts=WEEK_REGEXP.exec(isoWeek);if(parts){var year=+parts[1],week=+parts[2],hours=0,minutes=0,seconds=0,milliseconds=0,firstThurs=getFirstThursdayOfYear(year),addDays=7*(week-1);return existingDate&&(hours=existingDate.getHours(),minutes=existingDate.getMinutes(),seconds=existingDate.getSeconds(),milliseconds=existingDate.getMilliseconds()),new Date(year,0,firstThurs.getDate()+addDays,hours,minutes,seconds,milliseconds)}}return 0/0}function createDateParser(regexp,mapping){return function(iso,date){var parts,map;if(isDate(iso))return iso;if(isString(iso)){if('"'==iso.charAt(0)&&'"'==iso.charAt(iso.length-1)&&(iso=iso.substring(1,iso.length-1)),ISO_DATE_REGEXP.test(iso))return new Date(iso);if(regexp.lastIndex=0,parts=regexp.exec(iso))return parts.shift(),map=date?{yyyy:date.getFullYear(),MM:date.getMonth()+1,dd:date.getDate(),HH:date.getHours(),mm:date.getMinutes(),ss:date.getSeconds(),sss:date.getMilliseconds()/1e3}:{yyyy:1970,MM:1,dd:1,HH:0,mm:0,ss:0,sss:0},forEach(parts,function(part,index){index<mapping.length&&(map[mapping[index]]=+part)}),new Date(map.yyyy,map.MM-1,map.dd,map.HH,map.mm,map.ss||0,1e3*map.sss||0)}return 0/0}}function createDateInputType(type,regexp,parseDate,format){return function(scope,element,attr,ctrl,$sniffer,$browser,$filter){function isValidDate(value){return value&&!(value.getTime&&value.getTime()!==value.getTime())}function parseObservedDateValue(val){return isDefined(val)?isDate(val)?val:parseDate(val):undefined}badInputChecker(scope,element,attr,ctrl),baseInputType(scope,element,attr,ctrl,$sniffer,$browser);var previousDate,timezone=ctrl&&ctrl.$options&&ctrl.$options.timezone;if(ctrl.$$parserName=type,ctrl.$parsers.push(function(value){if(ctrl.$isEmpty(value))return null;if(regexp.test(value)){var parsedDate=parseDate(value,previousDate);return timezone&&(parsedDate=convertTimezoneToLocal(parsedDate,timezone)),parsedDate}return undefined}),ctrl.$formatters.push(function(value){if(value&&!isDate(value))throw $ngModelMinErr("datefmt","Expected `{0}` to be a date",value);return isValidDate(value)?(previousDate=value,previousDate&&timezone&&(previousDate=convertTimezoneToLocal(previousDate,timezone,!0)),$filter("date")(value,format,timezone)):(previousDate=null,"")}),isDefined(attr.min)||attr.ngMin){var minVal;ctrl.$validators.min=function(value){return!isValidDate(value)||isUndefined(minVal)||parseDate(value)>=minVal},attr.$observe("min",function(val){minVal=parseObservedDateValue(val),ctrl.$validate()})}if(isDefined(attr.max)||attr.ngMax){var maxVal;ctrl.$validators.max=function(value){return!isValidDate(value)||isUndefined(maxVal)||parseDate(value)<=maxVal},attr.$observe("max",function(val){maxVal=parseObservedDateValue(val),ctrl.$validate()})}}}function badInputChecker(scope,element,attr,ctrl){var node=element[0],nativeValidation=ctrl.$$hasNativeValidators=isObject(node.validity);nativeValidation&&ctrl.$parsers.push(function(value){var validity=element.prop(VALIDITY_STATE_PROPERTY)||{};return validity.badInput&&!validity.typeMismatch?undefined:value})}function numberInputType(scope,element,attr,ctrl,$sniffer,$browser){if(badInputChecker(scope,element,attr,ctrl),baseInputType(scope,element,attr,ctrl,$sniffer,$browser),ctrl.$$parserName="number",ctrl.$parsers.push(function(value){return ctrl.$isEmpty(value)?null:NUMBER_REGEXP.test(value)?parseFloat(value):undefined}),ctrl.$formatters.push(function(value){if(!ctrl.$isEmpty(value)){if(!isNumber(value))throw $ngModelMinErr("numfmt","Expected `{0}` to be a number",value);value=value.toString()}return value}),isDefined(attr.min)||attr.ngMin){var minVal;ctrl.$validators.min=function(value){return ctrl.$isEmpty(value)||isUndefined(minVal)||value>=minVal},attr.$observe("min",function(val){isDefined(val)&&!isNumber(val)&&(val=parseFloat(val,10)),minVal=isNumber(val)&&!isNaN(val)?val:undefined,ctrl.$validate()})}if(isDefined(attr.max)||attr.ngMax){var maxVal;ctrl.$validators.max=function(value){return ctrl.$isEmpty(value)||isUndefined(maxVal)||maxVal>=value},attr.$observe("max",function(val){isDefined(val)&&!isNumber(val)&&(val=parseFloat(val,10)),maxVal=isNumber(val)&&!isNaN(val)?val:undefined,ctrl.$validate()})}}function urlInputType(scope,element,attr,ctrl,$sniffer,$browser){baseInputType(scope,element,attr,ctrl,$sniffer,$browser),stringBasedInputType(ctrl),ctrl.$$parserName="url",ctrl.$validators.url=function(modelValue,viewValue){var value=modelValue||viewValue;return ctrl.$isEmpty(value)||URL_REGEXP.test(value)}}function emailInputType(scope,element,attr,ctrl,$sniffer,$browser){baseInputType(scope,element,attr,ctrl,$sniffer,$browser),stringBasedInputType(ctrl),ctrl.$$parserName="email",ctrl.$validators.email=function(modelValue,viewValue){var value=modelValue||viewValue;return ctrl.$isEmpty(value)||EMAIL_REGEXP.test(value)}}function radioInputType(scope,element,attr,ctrl){isUndefined(attr.name)&&element.attr("name",nextUid());var listener=function(ev){element[0].checked&&ctrl.$setViewValue(attr.value,ev&&ev.type)};element.on("click",listener),ctrl.$render=function(){var value=attr.value;element[0].checked=value==ctrl.$viewValue},attr.$observe("value",ctrl.$render)}function parseConstantExpr($parse,context,name,expression,fallback){var parseFn;if(isDefined(expression)){if(parseFn=$parse(expression),!parseFn.constant)throw minErr("ngModel")("constexpr","Expected constant expression for `{0}`, but saw `{1}`.",name,expression);return parseFn(context)}return fallback}function checkboxInputType(scope,element,attr,ctrl,$sniffer,$browser,$filter,$parse){var trueValue=parseConstantExpr($parse,scope,"ngTrueValue",attr.ngTrueValue,!0),falseValue=parseConstantExpr($parse,scope,"ngFalseValue",attr.ngFalseValue,!1),listener=function(ev){ctrl.$setViewValue(element[0].checked,ev&&ev.type)};element.on("click",listener),ctrl.$render=function(){element[0].checked=ctrl.$viewValue},ctrl.$isEmpty=function(value){return value===!1},ctrl.$formatters.push(function(value){return equals(value,trueValue)}),ctrl.$parsers.push(function(value){return value?trueValue:falseValue})}function classDirective(name,selector){return name="ngClass"+name,["$animate",function($animate){function arrayDifference(tokens1,tokens2){var values=[];outer:for(var i=0;i<tokens1.length;i++){for(var token=tokens1[i],j=0;j<tokens2.length;j++)if(token==tokens2[j])continue outer;values.push(token)}return values}function arrayClasses(classVal){var classes=[];return isArray(classVal)?(forEach(classVal,function(v){classes=classes.concat(arrayClasses(v))}),classes):isString(classVal)?classVal.split(" "):isObject(classVal)?(forEach(classVal,function(v,k){v&&(classes=classes.concat(k.split(" ")))}),classes):classVal}return{restrict:"AC",link:function(scope,element,attr){function addClasses(classes){var newClasses=digestClassCounts(classes,1);attr.$addClass(newClasses)}function removeClasses(classes){var newClasses=digestClassCounts(classes,-1);attr.$removeClass(newClasses)}function digestClassCounts(classes,count){var classCounts=element.data("$classCounts")||createMap(),classesToUpdate=[];return forEach(classes,function(className){(count>0||classCounts[className])&&(classCounts[className]=(classCounts[className]||0)+count,classCounts[className]===+(count>0)&&classesToUpdate.push(className))}),element.data("$classCounts",classCounts),classesToUpdate.join(" ")}function updateClasses(oldClasses,newClasses){var toAdd=arrayDifference(newClasses,oldClasses),toRemove=arrayDifference(oldClasses,newClasses);toAdd=digestClassCounts(toAdd,1),toRemove=digestClassCounts(toRemove,-1),toAdd&&toAdd.length&&$animate.addClass(element,toAdd),toRemove&&toRemove.length&&$animate.removeClass(element,toRemove)}function ngClassWatchAction(newVal){if(selector===!0||scope.$index%2===selector){var newClasses=arrayClasses(newVal||[]);if(oldVal){if(!equals(newVal,oldVal)){var oldClasses=arrayClasses(oldVal);updateClasses(oldClasses,newClasses)}}else addClasses(newClasses)}oldVal=shallowCopy(newVal)}var oldVal;scope.$watch(attr[name],ngClassWatchAction,!0),attr.$observe("class",function(value){ngClassWatchAction(scope.$eval(attr[name]))}),"ngClass"!==name&&scope.$watch("$index",function($index,old$index){var mod=1&$index;if(mod!==(1&old$index)){var classes=arrayClasses(scope.$eval(attr[name]));mod===selector?addClasses(classes):removeClasses(classes)}})}}}]}function addSetValidityMethod(context){function setValidity(validationErrorKey,state,controller){state===undefined?createAndSet("$pending",validationErrorKey,controller):unsetAndCleanup("$pending",validationErrorKey,controller),isBoolean(state)?state?(unset(ctrl.$error,validationErrorKey,controller),set(ctrl.$$success,validationErrorKey,controller)):(set(ctrl.$error,validationErrorKey,controller),unset(ctrl.$$success,validationErrorKey,controller)):(unset(ctrl.$error,validationErrorKey,controller),unset(ctrl.$$success,validationErrorKey,controller)),ctrl.$pending?(cachedToggleClass(PENDING_CLASS,!0),ctrl.$valid=ctrl.$invalid=undefined,toggleValidationCss("",null)):(cachedToggleClass(PENDING_CLASS,!1),ctrl.$valid=isObjectEmpty(ctrl.$error),ctrl.$invalid=!ctrl.$valid,toggleValidationCss("",ctrl.$valid));var combinedState;combinedState=ctrl.$pending&&ctrl.$pending[validationErrorKey]?undefined:ctrl.$error[validationErrorKey]?!1:ctrl.$$success[validationErrorKey]?!0:null,toggleValidationCss(validationErrorKey,combinedState),parentForm.$setValidity(validationErrorKey,combinedState,ctrl)}function createAndSet(name,value,controller){ctrl[name]||(ctrl[name]={}),set(ctrl[name],value,controller)}function unsetAndCleanup(name,value,controller){ctrl[name]&&unset(ctrl[name],value,controller),isObjectEmpty(ctrl[name])&&(ctrl[name]=undefined)}function cachedToggleClass(className,switchValue){switchValue&&!classCache[className]?($animate.addClass($element,className),classCache[className]=!0):!switchValue&&classCache[className]&&($animate.removeClass($element,className),classCache[className]=!1)}function toggleValidationCss(validationErrorKey,isValid){validationErrorKey=validationErrorKey?"-"+snake_case(validationErrorKey,"-"):"",cachedToggleClass(VALID_CLASS+validationErrorKey,isValid===!0),cachedToggleClass(INVALID_CLASS+validationErrorKey,isValid===!1)}var ctrl=context.ctrl,$element=context.$element,classCache={},set=context.set,unset=context.unset,parentForm=context.parentForm,$animate=context.$animate;classCache[INVALID_CLASS]=!(classCache[VALID_CLASS]=$element.hasClass(VALID_CLASS)),ctrl.$setValidity=setValidity}function isObjectEmpty(obj){if(obj)for(var prop in obj)if(obj.hasOwnProperty(prop))return!1;return!0}var REGEX_STRING_REGEXP=/^\/(.+)\/([a-z]*)$/,VALIDITY_STATE_PROPERTY="validity",lowercase=function(string){return isString(string)?string.toLowerCase():string},hasOwnProperty=Object.prototype.hasOwnProperty,uppercase=function(string){return isString(string)?string.toUpperCase():string},manualLowercase=function(s){return isString(s)?s.replace(/[A-Z]/g,function(ch){return String.fromCharCode(32|ch.charCodeAt(0))}):s},manualUppercase=function(s){return isString(s)?s.replace(/[a-z]/g,function(ch){return String.fromCharCode(-33&ch.charCodeAt(0))}):s};"i"!=="I".toLowerCase()&&(lowercase=manualLowercase,uppercase=manualUppercase);var msie,jqLite,jQuery,angularModule,slice=[].slice,splice=[].splice,push=[].push,toString=Object.prototype.toString,getPrototypeOf=Object.getPrototypeOf,ngMinErr=minErr("ng"),angular=window.angular||(window.angular={}),uid=0;msie=document.documentMode,noop.$inject=[],identity.$inject=[];var skipDestroyOnNextJQueryCleanData,isArray=Array.isArray,TYPED_ARRAY_REGEXP=/^\[object (Uint8(Clamped)?)|(Uint16)|(Uint32)|(Int8)|(Int16)|(Int32)|(Float(32)|(64))Array\]$/,trim=function(value){return isString(value)?value.trim():value},escapeForRegexp=function(s){return s.replace(/([-()\[\]{}+?*.$\^|,:#<!\\])/g,"\\$1").replace(/\x08/g,"\\x08")},csp=function(){if(isDefined(csp.isActive_))return csp.isActive_;var active=!(!document.querySelector("[ng-csp]")&&!document.querySelector("[data-ng-csp]"));if(!active)try{new Function("")}catch(e){active=!0}return csp.isActive_=active},jq=function(){if(isDefined(jq.name_))return jq.name_;var el,i,prefix,name,ii=ngAttrPrefixes.length;for(i=0;ii>i;++i)if(prefix=ngAttrPrefixes[i],el=document.querySelector("["+prefix.replace(":","\\:")+"jq]")){name=el.getAttribute(prefix+"jq");break}return jq.name_=name},ngAttrPrefixes=["ng-","data-ng-","ng:","x-ng-"],SNAKE_CASE_REGEXP=/[A-Z]/g,bindJQueryFired=!1,NODE_TYPE_ELEMENT=1,NODE_TYPE_ATTRIBUTE=2,NODE_TYPE_TEXT=3,NODE_TYPE_COMMENT=8,NODE_TYPE_DOCUMENT=9,NODE_TYPE_DOCUMENT_FRAGMENT=11,version={full:"1.4.3",major:1,minor:4,dot:3,codeName:"foam-acceleration"};JQLite.expando="ng339";var jqCache=JQLite.cache={},jqId=1,addEventListenerFn=function(element,type,fn){element.addEventListener(type,fn,!1)},removeEventListenerFn=function(element,type,fn){element.removeEventListener(type,fn,!1)};JQLite._data=function(node){return this.cache[node[this.expando]]||{}};var SPECIAL_CHARS_REGEXP=/([\:\-\_]+(.))/g,MOZ_HACK_REGEXP=/^moz([A-Z])/,MOUSE_EVENT_MAP={mouseleave:"mouseout",mouseenter:"mouseover"},jqLiteMinErr=minErr("jqLite"),SINGLE_TAG_REGEXP=/^<(\w+)\s*\/?>(?:<\/\1>|)$/,HTML_REGEXP=/<|&#?\w+;/,TAG_NAME_REGEXP=/<([\w:]+)/,XHTML_TAG_REGEXP=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/gi,wrapMap={option:[1,'<select multiple="multiple">',"</select>"],thead:[1,"<table>","</table>"],col:[2,"<table><colgroup>","</colgroup></table>"],tr:[2,"<table><tbody>","</tbody></table>"],td:[3,"<table><tbody><tr>","</tr></tbody></table>"],_default:[0,"",""]};wrapMap.optgroup=wrapMap.option,wrapMap.tbody=wrapMap.tfoot=wrapMap.colgroup=wrapMap.caption=wrapMap.thead,wrapMap.th=wrapMap.td;var JQLitePrototype=JQLite.prototype={ready:function(fn){function trigger(){fired||(fired=!0,fn())}var fired=!1;"complete"===document.readyState?setTimeout(trigger):(this.on("DOMContentLoaded",trigger),JQLite(window).on("load",trigger))},toString:function(){var value=[];return forEach(this,function(e){value.push(""+e)}),"["+value.join(", ")+"]"},eq:function(index){return jqLite(index>=0?this[index]:this[this.length+index])},length:0,push:push,sort:[].sort,splice:[].splice},BOOLEAN_ATTR={};forEach("multiple,selected,checked,disabled,readOnly,required,open".split(","),function(value){BOOLEAN_ATTR[lowercase(value)]=value});var BOOLEAN_ELEMENTS={};forEach("input,select,option,textarea,button,form,details".split(","),function(value){BOOLEAN_ELEMENTS[value]=!0});var ALIASED_ATTR={ngMinlength:"minlength",ngMaxlength:"maxlength",ngMin:"min",ngMax:"max",ngPattern:"pattern"};forEach({data:jqLiteData,removeData:jqLiteRemoveData,hasData:jqLiteHasData},function(fn,name){JQLite[name]=fn}),forEach({data:jqLiteData,inheritedData:jqLiteInheritedData,scope:function(element){return jqLite.data(element,"$scope")||jqLiteInheritedData(element.parentNode||element,["$isolateScope","$scope"])},isolateScope:function(element){return jqLite.data(element,"$isolateScope")||jqLite.data(element,"$isolateScopeNoTemplate")},controller:jqLiteController,injector:function(element){return jqLiteInheritedData(element,"$injector")},removeAttr:function(element,name){element.removeAttribute(name)},hasClass:jqLiteHasClass,css:function(element,name,value){return name=camelCase(name),isDefined(value)?void(element.style[name]=value):element.style[name]},attr:function(element,name,value){var nodeType=element.nodeType;if(nodeType!==NODE_TYPE_TEXT&&nodeType!==NODE_TYPE_ATTRIBUTE&&nodeType!==NODE_TYPE_COMMENT){var lowercasedName=lowercase(name);if(BOOLEAN_ATTR[lowercasedName]){if(!isDefined(value))return element[name]||(element.attributes.getNamedItem(name)||noop).specified?lowercasedName:undefined;value?(element[name]=!0,element.setAttribute(name,lowercasedName)):(element[name]=!1,element.removeAttribute(lowercasedName))}else if(isDefined(value))element.setAttribute(name,value);else if(element.getAttribute){var ret=element.getAttribute(name,2);return null===ret?undefined:ret}}},prop:function(element,name,value){return isDefined(value)?void(element[name]=value):element[name]},text:function(){function getText(element,value){if(isUndefined(value)){var nodeType=element.nodeType;return nodeType===NODE_TYPE_ELEMENT||nodeType===NODE_TYPE_TEXT?element.textContent:""}element.textContent=value}return getText.$dv="",getText}(),val:function(element,value){if(isUndefined(value)){if(element.multiple&&"select"===nodeName_(element)){var result=[];return forEach(element.options,function(option){option.selected&&result.push(option.value||option.text)}),0===result.length?null:result}return element.value}element.value=value},html:function(element,value){return isUndefined(value)?element.innerHTML:(jqLiteDealoc(element,!0),void(element.innerHTML=value))},empty:jqLiteEmpty},function(fn,name){JQLite.prototype[name]=function(arg1,arg2){var i,key,nodeCount=this.length;if(fn!==jqLiteEmpty&&(2==fn.length&&fn!==jqLiteHasClass&&fn!==jqLiteController?arg1:arg2)===undefined){if(isObject(arg1)){for(i=0;nodeCount>i;i++)if(fn===jqLiteData)fn(this[i],arg1);else for(key in arg1)fn(this[i],key,arg1[key]);return this}for(var value=fn.$dv,jj=value===undefined?Math.min(nodeCount,1):nodeCount,j=0;jj>j;j++){var nodeValue=fn(this[j],arg1,arg2);value=value?value+nodeValue:nodeValue}return value}for(i=0;nodeCount>i;i++)fn(this[i],arg1,arg2);return this}}),forEach({removeData:jqLiteRemoveData,on:function jqLiteOn(element,type,fn,unsupported){if(isDefined(unsupported))throw jqLiteMinErr("onargs","jqLite#on() does not support the `selector` or `eventData` parameters");if(jqLiteAcceptsData(element)){var expandoStore=jqLiteExpandoStore(element,!0),events=expandoStore.events,handle=expandoStore.handle;handle||(handle=expandoStore.handle=createEventHandler(element,events));for(var types=type.indexOf(" ")>=0?type.split(" "):[type],i=types.length;i--;){type=types[i];var eventFns=events[type];eventFns||(events[type]=[],"mouseenter"===type||"mouseleave"===type?jqLiteOn(element,MOUSE_EVENT_MAP[type],function(event){var target=this,related=event.relatedTarget;(!related||related!==target&&!target.contains(related))&&handle(event,type)}):"$destroy"!==type&&addEventListenerFn(element,type,handle),eventFns=events[type]),eventFns.push(fn)}}},off:jqLiteOff,one:function(element,type,fn){element=jqLite(element),element.on(type,function onFn(){element.off(type,fn),element.off(type,onFn)}),element.on(type,fn)},replaceWith:function(element,replaceNode){var index,parent=element.parentNode;jqLiteDealoc(element),forEach(new JQLite(replaceNode),function(node){index?parent.insertBefore(node,index.nextSibling):parent.replaceChild(node,element),index=node})},children:function(element){var children=[];return forEach(element.childNodes,function(element){element.nodeType===NODE_TYPE_ELEMENT&&children.push(element)}),children},contents:function(element){return element.contentDocument||element.childNodes||[]},append:function(element,node){var nodeType=element.nodeType;if(nodeType===NODE_TYPE_ELEMENT||nodeType===NODE_TYPE_DOCUMENT_FRAGMENT){node=new JQLite(node);for(var i=0,ii=node.length;ii>i;i++){var child=node[i];element.appendChild(child)}}},prepend:function(element,node){if(element.nodeType===NODE_TYPE_ELEMENT){var index=element.firstChild;forEach(new JQLite(node),function(child){element.insertBefore(child,index)})}},wrap:function(element,wrapNode){wrapNode=jqLite(wrapNode).eq(0).clone()[0];var parent=element.parentNode;parent&&parent.replaceChild(wrapNode,element),wrapNode.appendChild(element)},remove:jqLiteRemove,detach:function(element){jqLiteRemove(element,!0)},after:function(element,newElement){var index=element,parent=element.parentNode;newElement=new JQLite(newElement);for(var i=0,ii=newElement.length;ii>i;i++){var node=newElement[i];parent.insertBefore(node,index.nextSibling),index=node}},addClass:jqLiteAddClass,removeClass:jqLiteRemoveClass,toggleClass:function(element,selector,condition){selector&&forEach(selector.split(" "),function(className){var classCondition=condition;isUndefined(classCondition)&&(classCondition=!jqLiteHasClass(element,className)),(classCondition?jqLiteAddClass:jqLiteRemoveClass)(element,className)})},parent:function(element){var parent=element.parentNode;return parent&&parent.nodeType!==NODE_TYPE_DOCUMENT_FRAGMENT?parent:null},next:function(element){return element.nextElementSibling},find:function(element,selector){return element.getElementsByTagName?element.getElementsByTagName(selector):[]},clone:jqLiteClone,triggerHandler:function(element,event,extraParameters){var dummyEvent,eventFnsCopy,handlerArgs,eventName=event.type||event,expandoStore=jqLiteExpandoStore(element),events=expandoStore&&expandoStore.events,eventFns=events&&events[eventName];eventFns&&(dummyEvent={preventDefault:function(){this.defaultPrevented=!0},isDefaultPrevented:function(){return this.defaultPrevented===!0},stopImmediatePropagation:function(){this.immediatePropagationStopped=!0},isImmediatePropagationStopped:function(){return this.immediatePropagationStopped===!0},stopPropagation:noop,type:eventName,target:element},event.type&&(dummyEvent=extend(dummyEvent,event)),eventFnsCopy=shallowCopy(eventFns),handlerArgs=extraParameters?[dummyEvent].concat(extraParameters):[dummyEvent],forEach(eventFnsCopy,function(fn){dummyEvent.isImmediatePropagationStopped()||fn.apply(element,handlerArgs)}))}},function(fn,name){JQLite.prototype[name]=function(arg1,arg2,arg3){for(var value,i=0,ii=this.length;ii>i;i++)isUndefined(value)?(value=fn(this[i],arg1,arg2,arg3),isDefined(value)&&(value=jqLite(value))):jqLiteAddNodes(value,fn(this[i],arg1,arg2,arg3));return isDefined(value)?value:this},JQLite.prototype.bind=JQLite.prototype.on,JQLite.prototype.unbind=JQLite.prototype.off}),HashMap.prototype={put:function(key,value){this[hashKey(key,this.nextUid)]=value},get:function(key){return this[hashKey(key,this.nextUid)]},remove:function(key){var value=this[key=hashKey(key,this.nextUid)];return delete this[key],value}};var $$HashMapProvider=[function(){this.$get=[function(){return HashMap}]}],FN_ARGS=/^function\s*[^\(]*\(\s*([^\)]*)\)/m,FN_ARG_SPLIT=/,/,FN_ARG=/^\s*(_?)(\S+?)\1\s*$/,STRIP_COMMENTS=/((\/\/.*$)|(\/\*[\s\S]*?\*\/))/gm,$injectorMinErr=minErr("$injector");createInjector.$$annotate=annotate;var $animateMinErr=minErr("$animate"),ELEMENT_NODE=1,NG_ANIMATE_CLASSNAME="ng-animate",$$CoreAnimateRunnerProvider=function(){this.$get=["$q","$$rAF",function($q,$$rAF){function AnimateRunner(){}return AnimateRunner.all=noop,AnimateRunner.chain=noop,AnimateRunner.prototype={end:noop,cancel:noop,resume:noop,pause:noop,complete:noop,then:function(pass,fail){return $q(function(resolve){$$rAF(function(){resolve()})}).then(pass,fail)}},AnimateRunner}]},$$CoreAnimateQueueProvider=function(){var postDigestQueue=new HashMap,postDigestElements=[];this.$get=["$$AnimateRunner","$rootScope",function($$AnimateRunner,$rootScope){function addRemoveClassesPostDigest(element,add,remove){var data=postDigestQueue.get(element);data||(postDigestQueue.put(element,data={}),postDigestElements.push(element)),add&&forEach(add.split(" "),function(className){className&&(data[className]=!0)}),remove&&forEach(remove.split(" "),function(className){className&&(data[className]=!1)}),postDigestElements.length>1||$rootScope.$$postDigest(function(){forEach(postDigestElements,function(element){var data=postDigestQueue.get(element);if(data){var existing=splitClasses(element.attr("class")),toAdd="",toRemove="";forEach(data,function(status,className){var hasClass=!!existing[className];status!==hasClass&&(status?toAdd+=(toAdd.length?" ":"")+className:toRemove+=(toRemove.length?" ":"")+className)}),forEach(element,function(elm){toAdd&&jqLiteAddClass(elm,toAdd),toRemove&&jqLiteRemoveClass(elm,toRemove)}),postDigestQueue.remove(element)}}),postDigestElements.length=0})}return{enabled:noop,on:noop,off:noop,pin:noop,push:function(element,event,options,domOperation){return domOperation&&domOperation(),options=options||{},options.from&&element.css(options.from),options.to&&element.css(options.to),(options.addClass||options.removeClass)&&addRemoveClassesPostDigest(element,options.addClass,options.removeClass),new $$AnimateRunner}}}]},$AnimateProvider=["$provide",function($provide){var provider=this;this.$$registeredAnimations=Object.create(null),this.register=function(name,factory){if(name&&"."!==name.charAt(0))throw $animateMinErr("notcsel","Expecting class selector starting with '.' got '{0}'.",name);var key=name+"-animation";provider.$$registeredAnimations[name.substr(1)]=key,$provide.factory(key,factory)},this.classNameFilter=function(expression){if(1===arguments.length&&(this.$$classNameFilter=expression instanceof RegExp?expression:null,this.$$classNameFilter)){var reservedRegex=new RegExp("(\\s+|\\/)"+NG_ANIMATE_CLASSNAME+"(\\s+|\\/)");if(reservedRegex.test(this.$$classNameFilter.toString()))throw $animateMinErr("nongcls",'$animateProvider.classNameFilter(regex) prohibits accepting a regex value which matches/contains the "{0}" CSS class.',NG_ANIMATE_CLASSNAME); }return this.$$classNameFilter},this.$get=["$$animateQueue",function($$animateQueue){function domInsert(element,parentElement,afterElement){if(afterElement){var afterNode=extractElementNode(afterElement);!afterNode||afterNode.parentNode||afterNode.previousElementSibling||(afterElement=null)}afterElement?afterElement.after(element):parentElement.prepend(element)}return{on:$$animateQueue.on,off:$$animateQueue.off,pin:$$animateQueue.pin,enabled:$$animateQueue.enabled,cancel:function(runner){runner.end&&runner.end()},enter:function(element,parent,after,options){return parent=parent&&jqLite(parent),after=after&&jqLite(after),parent=parent||after.parent(),domInsert(element,parent,after),$$animateQueue.push(element,"enter",prepareAnimateOptions(options))},move:function(element,parent,after,options){return parent=parent&&jqLite(parent),after=after&&jqLite(after),parent=parent||after.parent(),domInsert(element,parent,after),$$animateQueue.push(element,"move",prepareAnimateOptions(options))},leave:function(element,options){return $$animateQueue.push(element,"leave",prepareAnimateOptions(options),function(){element.remove()})},addClass:function(element,className,options){return options=prepareAnimateOptions(options),options.addClass=mergeClasses(options.addclass,className),$$animateQueue.push(element,"addClass",options)},removeClass:function(element,className,options){return options=prepareAnimateOptions(options),options.removeClass=mergeClasses(options.removeClass,className),$$animateQueue.push(element,"removeClass",options)},setClass:function(element,add,remove,options){return options=prepareAnimateOptions(options),options.addClass=mergeClasses(options.addClass,add),options.removeClass=mergeClasses(options.removeClass,remove),$$animateQueue.push(element,"setClass",options)},animate:function(element,from,to,className,options){return options=prepareAnimateOptions(options),options.from=options.from?extend(options.from,from):from,options.to=options.to?extend(options.to,to):to,className=className||"ng-inline-animate",options.tempClasses=mergeClasses(options.tempClasses,className),$$animateQueue.push(element,"animate",options)}}}]}],$compileMinErr=minErr("$compile");$CompileProvider.$inject=["$provide","$$sanitizeUriProvider"];var PREFIX_REGEXP=/^((?:x|data)[\:\-_])/i,$controllerMinErr=minErr("$controller"),CNTRL_REG=/^(\S+)(\s+as\s+(\w+))?$/,APPLICATION_JSON="application/json",CONTENT_TYPE_APPLICATION_JSON={"Content-Type":APPLICATION_JSON+";charset=utf-8"},JSON_START=/^\[|^\{(?!\{)/,JSON_ENDS={"[":/]$/,"{":/}$/},JSON_PROTECTION_PREFIX=/^\)\]\}',?\n/,$interpolateMinErr=angular.$interpolateMinErr=minErr("$interpolate");$interpolateMinErr.throwNoconcat=function(text){throw $interpolateMinErr("noconcat","Error while interpolating: {0}\nStrict Contextual Escaping disallows interpolations that concatenate multiple expressions when a trusted value is required. See http://docs.angularjs.org/api/ng.$sce",text)},$interpolateMinErr.interr=function(text,err){return $interpolateMinErr("interr","Can't interpolate: {0}\n{1}",text,err.toString())};var PATH_MATCH=/^([^\?#]*)(\?([^#]*))?(#(.*))?$/,DEFAULT_PORTS={http:80,https:443,ftp:21},$locationMinErr=minErr("$location"),locationPrototype={$$html5:!1,$$replace:!1,absUrl:locationGetter("$$absUrl"),url:function(url){if(isUndefined(url))return this.$$url;var match=PATH_MATCH.exec(url);return(match[1]||""===url)&&this.path(decodeURIComponent(match[1])),(match[2]||match[1]||""===url)&&this.search(match[3]||""),this.hash(match[5]||""),this},protocol:locationGetter("$$protocol"),host:locationGetter("$$host"),port:locationGetter("$$port"),path:locationGetterSetter("$$path",function(path){return path=null!==path?path.toString():"","/"==path.charAt(0)?path:"/"+path}),search:function(search,paramValue){switch(arguments.length){case 0:return this.$$search;case 1:if(isString(search)||isNumber(search))search=search.toString(),this.$$search=parseKeyValue(search);else{if(!isObject(search))throw $locationMinErr("isrcharg","The first argument of the `$location#search()` call must be a string or an object.");search=copy(search,{}),forEach(search,function(value,key){null==value&&delete search[key]}),this.$$search=search}break;default:isUndefined(paramValue)||null===paramValue?delete this.$$search[search]:this.$$search[search]=paramValue}return this.$$compose(),this},hash:locationGetterSetter("$$hash",function(hash){return null!==hash?hash.toString():""}),replace:function(){return this.$$replace=!0,this}};forEach([LocationHashbangInHtml5Url,LocationHashbangUrl,LocationHtml5Url],function(Location){Location.prototype=Object.create(locationPrototype),Location.prototype.state=function(state){if(!arguments.length)return this.$$state;if(Location!==LocationHtml5Url||!this.$$html5)throw $locationMinErr("nostate","History API state support is available only in HTML5 mode and only in browsers supporting HTML5 History API");return this.$$state=isUndefined(state)?null:state,this}});var $parseMinErr=minErr("$parse"),CALL=Function.prototype.call,APPLY=Function.prototype.apply,BIND=Function.prototype.bind,OPERATORS=createMap();forEach("+ - * / % === !== == != < > <= >= && || ! = |".split(" "),function(operator){OPERATORS[operator]=!0});var ESCAPE={n:"\n",f:"\f",r:"\r",t:" ",v:" ","'":"'",'"':'"'},Lexer=function(options){this.options=options};Lexer.prototype={constructor:Lexer,lex:function(text){for(this.text=text,this.index=0,this.tokens=[];this.index<this.text.length;){var ch=this.text.charAt(this.index);if('"'===ch||"'"===ch)this.readString(ch);else if(this.isNumber(ch)||"."===ch&&this.isNumber(this.peek()))this.readNumber();else if(this.isIdent(ch))this.readIdent();else if(this.is(ch,"(){}[].,;:?"))this.tokens.push({index:this.index,text:ch}),this.index++;else if(this.isWhitespace(ch))this.index++;else{var ch2=ch+this.peek(),ch3=ch2+this.peek(2),op1=OPERATORS[ch],op2=OPERATORS[ch2],op3=OPERATORS[ch3];if(op1||op2||op3){var token=op3?ch3:op2?ch2:ch;this.tokens.push({index:this.index,text:token,operator:!0}),this.index+=token.length}else this.throwError("Unexpected next character ",this.index,this.index+1)}}return this.tokens},is:function(ch,chars){return-1!==chars.indexOf(ch)},peek:function(i){var num=i||1;return this.index+num<this.text.length?this.text.charAt(this.index+num):!1},isNumber:function(ch){return ch>="0"&&"9">=ch&&"string"==typeof ch},isWhitespace:function(ch){return" "===ch||"\r"===ch||" "===ch||"\n"===ch||" "===ch||" "===ch},isIdent:function(ch){return ch>="a"&&"z">=ch||ch>="A"&&"Z">=ch||"_"===ch||"$"===ch},isExpOperator:function(ch){return"-"===ch||"+"===ch||this.isNumber(ch)},throwError:function(error,start,end){end=end||this.index;var colStr=isDefined(start)?"s "+start+"-"+this.index+" ["+this.text.substring(start,end)+"]":" "+end;throw $parseMinErr("lexerr","Lexer Error: {0} at column{1} in expression [{2}].",error,colStr,this.text)},readNumber:function(){for(var number="",start=this.index;this.index<this.text.length;){var ch=lowercase(this.text.charAt(this.index));if("."==ch||this.isNumber(ch))number+=ch;else{var peekCh=this.peek();if("e"==ch&&this.isExpOperator(peekCh))number+=ch;else if(this.isExpOperator(ch)&&peekCh&&this.isNumber(peekCh)&&"e"==number.charAt(number.length-1))number+=ch;else{if(!this.isExpOperator(ch)||peekCh&&this.isNumber(peekCh)||"e"!=number.charAt(number.length-1))break;this.throwError("Invalid exponent")}}this.index++}this.tokens.push({index:start,text:number,constant:!0,value:Number(number)})},readIdent:function(){for(var start=this.index;this.index<this.text.length;){var ch=this.text.charAt(this.index);if(!this.isIdent(ch)&&!this.isNumber(ch))break;this.index++}this.tokens.push({index:start,text:this.text.slice(start,this.index),identifier:!0})},readString:function(quote){var start=this.index;this.index++;for(var string="",rawString=quote,escape=!1;this.index<this.text.length;){var ch=this.text.charAt(this.index);if(rawString+=ch,escape){if("u"===ch){var hex=this.text.substring(this.index+1,this.index+5);hex.match(/[\da-f]{4}/i)||this.throwError("Invalid unicode escape [\\u"+hex+"]"),this.index+=4,string+=String.fromCharCode(parseInt(hex,16))}else{var rep=ESCAPE[ch];string+=rep||ch}escape=!1}else if("\\"===ch)escape=!0;else{if(ch===quote)return this.index++,void this.tokens.push({index:start,text:rawString,constant:!0,value:string});string+=ch}this.index++}this.throwError("Unterminated quote",start)}};var AST=function(lexer,options){this.lexer=lexer,this.options=options};AST.Program="Program",AST.ExpressionStatement="ExpressionStatement",AST.AssignmentExpression="AssignmentExpression",AST.ConditionalExpression="ConditionalExpression",AST.LogicalExpression="LogicalExpression",AST.BinaryExpression="BinaryExpression",AST.UnaryExpression="UnaryExpression",AST.CallExpression="CallExpression",AST.MemberExpression="MemberExpression",AST.Identifier="Identifier",AST.Literal="Literal",AST.ArrayExpression="ArrayExpression",AST.Property="Property",AST.ObjectExpression="ObjectExpression",AST.ThisExpression="ThisExpression",AST.NGValueParameter="NGValueParameter",AST.prototype={ast:function(text){this.text=text,this.tokens=this.lexer.lex(text);var value=this.program();return 0!==this.tokens.length&&this.throwError("is an unexpected token",this.tokens[0]),value},program:function(){for(var body=[];;)if(this.tokens.length>0&&!this.peek("}",")",";","]")&&body.push(this.expressionStatement()),!this.expect(";"))return{type:AST.Program,body:body}},expressionStatement:function(){return{type:AST.ExpressionStatement,expression:this.filterChain()}},filterChain:function(){for(var token,left=this.expression();token=this.expect("|");)left=this.filter(left);return left},expression:function(){return this.assignment()},assignment:function(){var result=this.ternary();return this.expect("=")&&(result={type:AST.AssignmentExpression,left:result,right:this.assignment(),operator:"="}),result},ternary:function(){var alternate,consequent,test=this.logicalOR();return this.expect("?")&&(alternate=this.expression(),this.consume(":"))?(consequent=this.expression(),{type:AST.ConditionalExpression,test:test,alternate:alternate,consequent:consequent}):test},logicalOR:function(){for(var left=this.logicalAND();this.expect("||");)left={type:AST.LogicalExpression,operator:"||",left:left,right:this.logicalAND()};return left},logicalAND:function(){for(var left=this.equality();this.expect("&&");)left={type:AST.LogicalExpression,operator:"&&",left:left,right:this.equality()};return left},equality:function(){for(var token,left=this.relational();token=this.expect("==","!=","===","!==");)left={type:AST.BinaryExpression,operator:token.text,left:left,right:this.relational()};return left},relational:function(){for(var token,left=this.additive();token=this.expect("<",">","<=",">=");)left={type:AST.BinaryExpression,operator:token.text,left:left,right:this.additive()};return left},additive:function(){for(var token,left=this.multiplicative();token=this.expect("+","-");)left={type:AST.BinaryExpression,operator:token.text,left:left,right:this.multiplicative()};return left},multiplicative:function(){for(var token,left=this.unary();token=this.expect("*","/","%");)left={type:AST.BinaryExpression,operator:token.text,left:left,right:this.unary()};return left},unary:function(){var token;return(token=this.expect("+","-","!"))?{type:AST.UnaryExpression,operator:token.text,prefix:!0,argument:this.unary()}:this.primary()},primary:function(){var primary;this.expect("(")?(primary=this.filterChain(),this.consume(")")):this.expect("[")?primary=this.arrayDeclaration():this.expect("{")?primary=this.object():this.constants.hasOwnProperty(this.peek().text)?primary=copy(this.constants[this.consume().text]):this.peek().identifier?primary=this.identifier():this.peek().constant?primary=this.constant():this.throwError("not a primary expression",this.peek());for(var next;next=this.expect("(","[",".");)"("===next.text?(primary={type:AST.CallExpression,callee:primary,arguments:this.parseArguments()},this.consume(")")):"["===next.text?(primary={type:AST.MemberExpression,object:primary,property:this.expression(),computed:!0},this.consume("]")):"."===next.text?primary={type:AST.MemberExpression,object:primary,property:this.identifier(),computed:!1}:this.throwError("IMPOSSIBLE");return primary},filter:function(baseExpression){for(var args=[baseExpression],result={type:AST.CallExpression,callee:this.identifier(),arguments:args,filter:!0};this.expect(":");)args.push(this.expression());return result},parseArguments:function(){var args=[];if(")"!==this.peekToken().text)do args.push(this.expression());while(this.expect(","));return args},identifier:function(){var token=this.consume();return token.identifier||this.throwError("is not a valid identifier",token),{type:AST.Identifier,name:token.text}},constant:function(){return{type:AST.Literal,value:this.consume().value}},arrayDeclaration:function(){var elements=[];if("]"!==this.peekToken().text)do{if(this.peek("]"))break;elements.push(this.expression())}while(this.expect(","));return this.consume("]"),{type:AST.ArrayExpression,elements:elements}},object:function(){var property,properties=[];if("}"!==this.peekToken().text)do{if(this.peek("}"))break;property={type:AST.Property,kind:"init"},this.peek().constant?property.key=this.constant():this.peek().identifier?property.key=this.identifier():this.throwError("invalid key",this.peek()),this.consume(":"),property.value=this.expression(),properties.push(property)}while(this.expect(","));return this.consume("}"),{type:AST.ObjectExpression,properties:properties}},throwError:function(msg,token){throw $parseMinErr("syntax","Syntax Error: Token '{0}' {1} at column {2} of the expression [{3}] starting at [{4}].",token.text,msg,token.index+1,this.text,this.text.substring(token.index))},consume:function(e1){if(0===this.tokens.length)throw $parseMinErr("ueoe","Unexpected end of expression: {0}",this.text);var token=this.expect(e1);return token||this.throwError("is unexpected, expecting ["+e1+"]",this.peek()),token},peekToken:function(){if(0===this.tokens.length)throw $parseMinErr("ueoe","Unexpected end of expression: {0}",this.text);return this.tokens[0]},peek:function(e1,e2,e3,e4){return this.peekAhead(0,e1,e2,e3,e4)},peekAhead:function(i,e1,e2,e3,e4){if(this.tokens.length>i){var token=this.tokens[i],t=token.text;if(t===e1||t===e2||t===e3||t===e4||!e1&&!e2&&!e3&&!e4)return token}return!1},expect:function(e1,e2,e3,e4){var token=this.peek(e1,e2,e3,e4);return token?(this.tokens.shift(),token):!1},constants:{"true":{type:AST.Literal,value:!0},"false":{type:AST.Literal,value:!1},"null":{type:AST.Literal,value:null},undefined:{type:AST.Literal,value:undefined},"this":{type:AST.ThisExpression}}},ASTCompiler.prototype={compile:function(expression,expensiveChecks){var self=this,ast=this.astBuilder.ast(expression);this.state={nextId:0,filters:{},expensiveChecks:expensiveChecks,fn:{vars:[],body:[],own:{}},assign:{vars:[],body:[],own:{}},inputs:[]},findConstantAndWatchExpressions(ast,self.$filter);var assignable,extra="";if(this.stage="assign",assignable=assignableAST(ast)){this.state.computing="assign";var result=this.nextId();this.recurse(assignable,result),extra="fn.assign="+this.generateFunction("assign","s,v,l")}var toWatch=getInputs(ast.body);self.stage="inputs",forEach(toWatch,function(watch,key){var fnKey="fn"+key;self.state[fnKey]={vars:[],body:[],own:{}},self.state.computing=fnKey;var intoId=self.nextId();self.recurse(watch,intoId),self.return_(intoId),self.state.inputs.push(fnKey),watch.watchId=key}),this.state.computing="fn",this.stage="main",this.recurse(ast);var fnString='"'+this.USE+" "+this.STRICT+'";\n'+this.filterPrefix()+"var fn="+this.generateFunction("fn","s,l,a,i")+extra+this.watchFns()+"return fn;",fn=new Function("$filter","ensureSafeMemberName","ensureSafeObject","ensureSafeFunction","ifDefined","plus","text",fnString)(this.$filter,ensureSafeMemberName,ensureSafeObject,ensureSafeFunction,ifDefined,plusFn,expression);return this.state=this.stage=undefined,fn.literal=isLiteral(ast),fn.constant=isConstant(ast),fn},USE:"use",STRICT:"strict",watchFns:function(){var result=[],fns=this.state.inputs,self=this;return forEach(fns,function(name){result.push("var "+name+"="+self.generateFunction(name,"s"))}),fns.length&&result.push("fn.inputs=["+fns.join(",")+"];"),result.join("")},generateFunction:function(name,params){return"function("+params+"){"+this.varsPrefix(name)+this.body(name)+"};"},filterPrefix:function(){var parts=[],self=this;return forEach(this.state.filters,function(id,filter){parts.push(id+"=$filter("+self.escape(filter)+")")}),parts.length?"var "+parts.join(",")+";":""},varsPrefix:function(section){return this.state[section].vars.length?"var "+this.state[section].vars.join(",")+";":""},body:function(section){return this.state[section].body.join("")},recurse:function(ast,intoId,nameId,recursionFn,create,skipWatchIdCheck){var left,right,args,expression,self=this;if(recursionFn=recursionFn||noop,!skipWatchIdCheck&&isDefined(ast.watchId))return intoId=intoId||this.nextId(),void this.if_("i",this.lazyAssign(intoId,this.computedMember("i",ast.watchId)),this.lazyRecurse(ast,intoId,nameId,recursionFn,create,!0));switch(ast.type){case AST.Program:forEach(ast.body,function(expression,pos){self.recurse(expression.expression,undefined,undefined,function(expr){right=expr}),pos!==ast.body.length-1?self.current().body.push(right,";"):self.return_(right)});break;case AST.Literal:expression=this.escape(ast.value),this.assign(intoId,expression),recursionFn(expression);break;case AST.UnaryExpression:this.recurse(ast.argument,undefined,undefined,function(expr){right=expr}),expression=ast.operator+"("+this.ifDefined(right,0)+")",this.assign(intoId,expression),recursionFn(expression);break;case AST.BinaryExpression:this.recurse(ast.left,undefined,undefined,function(expr){left=expr}),this.recurse(ast.right,undefined,undefined,function(expr){right=expr}),expression="+"===ast.operator?this.plus(left,right):"-"===ast.operator?this.ifDefined(left,0)+ast.operator+this.ifDefined(right,0):"("+left+")"+ast.operator+"("+right+")",this.assign(intoId,expression),recursionFn(expression);break;case AST.LogicalExpression:intoId=intoId||this.nextId(),self.recurse(ast.left,intoId),self.if_("&&"===ast.operator?intoId:self.not(intoId),self.lazyRecurse(ast.right,intoId)),recursionFn(intoId);break;case AST.ConditionalExpression:intoId=intoId||this.nextId(),self.recurse(ast.test,intoId),self.if_(intoId,self.lazyRecurse(ast.alternate,intoId),self.lazyRecurse(ast.consequent,intoId)),recursionFn(intoId);break;case AST.Identifier:intoId=intoId||this.nextId(),nameId&&(nameId.context="inputs"===self.stage?"s":this.assign(this.nextId(),this.getHasOwnProperty("l",ast.name)+"?l:s"),nameId.computed=!1,nameId.name=ast.name),ensureSafeMemberName(ast.name),self.if_("inputs"===self.stage||self.not(self.getHasOwnProperty("l",ast.name)),function(){self.if_("inputs"===self.stage||"s",function(){create&&1!==create&&self.if_(self.not(self.nonComputedMember("s",ast.name)),self.lazyAssign(self.nonComputedMember("s",ast.name),"{}")),self.assign(intoId,self.nonComputedMember("s",ast.name))})},intoId&&self.lazyAssign(intoId,self.nonComputedMember("l",ast.name))),(self.state.expensiveChecks||isPossiblyDangerousMemberName(ast.name))&&self.addEnsureSafeObject(intoId),recursionFn(intoId);break;case AST.MemberExpression:left=nameId&&(nameId.context=this.nextId())||this.nextId(),intoId=intoId||this.nextId(),self.recurse(ast.object,left,undefined,function(){self.if_(self.notNull(left),function(){ast.computed?(right=self.nextId(),self.recurse(ast.property,right),self.addEnsureSafeMemberName(right),create&&1!==create&&self.if_(self.not(self.computedMember(left,right)),self.lazyAssign(self.computedMember(left,right),"{}")),expression=self.ensureSafeObject(self.computedMember(left,right)),self.assign(intoId,expression),nameId&&(nameId.computed=!0,nameId.name=right)):(ensureSafeMemberName(ast.property.name),create&&1!==create&&self.if_(self.not(self.nonComputedMember(left,ast.property.name)),self.lazyAssign(self.nonComputedMember(left,ast.property.name),"{}")),expression=self.nonComputedMember(left,ast.property.name),(self.state.expensiveChecks||isPossiblyDangerousMemberName(ast.property.name))&&(expression=self.ensureSafeObject(expression)),self.assign(intoId,expression),nameId&&(nameId.computed=!1,nameId.name=ast.property.name))},function(){self.assign(intoId,"undefined")}),recursionFn(intoId)},!!create);break;case AST.CallExpression:intoId=intoId||this.nextId(),ast.filter?(right=self.filter(ast.callee.name),args=[],forEach(ast.arguments,function(expr){var argument=self.nextId();self.recurse(expr,argument),args.push(argument)}),expression=right+"("+args.join(",")+")",self.assign(intoId,expression),recursionFn(intoId)):(right=self.nextId(),left={},args=[],self.recurse(ast.callee,right,left,function(){self.if_(self.notNull(right),function(){self.addEnsureSafeFunction(right),forEach(ast.arguments,function(expr){self.recurse(expr,self.nextId(),undefined,function(argument){args.push(self.ensureSafeObject(argument))})}),left.name?(self.state.expensiveChecks||self.addEnsureSafeObject(left.context),expression=self.member(left.context,left.name,left.computed)+"("+args.join(",")+")"):expression=right+"("+args.join(",")+")",expression=self.ensureSafeObject(expression),self.assign(intoId,expression)},function(){self.assign(intoId,"undefined")}),recursionFn(intoId)}));break;case AST.AssignmentExpression:if(right=this.nextId(),left={},!isAssignable(ast.left))throw $parseMinErr("lval","Trying to assing a value to a non l-value");this.recurse(ast.left,undefined,left,function(){self.if_(self.notNull(left.context),function(){self.recurse(ast.right,right),self.addEnsureSafeObject(self.member(left.context,left.name,left.computed)),expression=self.member(left.context,left.name,left.computed)+ast.operator+right,self.assign(intoId,expression),recursionFn(intoId||expression)})},1);break;case AST.ArrayExpression:args=[],forEach(ast.elements,function(expr){self.recurse(expr,self.nextId(),undefined,function(argument){args.push(argument)})}),expression="["+args.join(",")+"]",this.assign(intoId,expression),recursionFn(expression);break;case AST.ObjectExpression:args=[],forEach(ast.properties,function(property){self.recurse(property.value,self.nextId(),undefined,function(expr){args.push(self.escape(property.key.type===AST.Identifier?property.key.name:""+property.key.value)+":"+expr)})}),expression="{"+args.join(",")+"}",this.assign(intoId,expression),recursionFn(expression);break;case AST.ThisExpression:this.assign(intoId,"s"),recursionFn("s");break;case AST.NGValueParameter:this.assign(intoId,"v"),recursionFn("v")}},getHasOwnProperty:function(element,property){var key=element+"."+property,own=this.current().own;return own.hasOwnProperty(key)||(own[key]=this.nextId(!1,element+"&&("+this.escape(property)+" in "+element+")")),own[key]},assign:function(id,value){return id?(this.current().body.push(id,"=",value,";"),id):void 0},filter:function(filterName){return this.state.filters.hasOwnProperty(filterName)||(this.state.filters[filterName]=this.nextId(!0)),this.state.filters[filterName]},ifDefined:function(id,defaultValue){return"ifDefined("+id+","+this.escape(defaultValue)+")"},plus:function(left,right){return"plus("+left+","+right+")"},return_:function(id){this.current().body.push("return ",id,";")},if_:function(test,alternate,consequent){if(test===!0)alternate();else{var body=this.current().body;body.push("if(",test,"){"),alternate(),body.push("}"),consequent&&(body.push("else{"),consequent(),body.push("}"))}},not:function(expression){return"!("+expression+")"},notNull:function(expression){return expression+"!=null"},nonComputedMember:function(left,right){return left+"."+right},computedMember:function(left,right){return left+"["+right+"]"},member:function(left,right,computed){return computed?this.computedMember(left,right):this.nonComputedMember(left,right)},addEnsureSafeObject:function(item){this.current().body.push(this.ensureSafeObject(item),";")},addEnsureSafeMemberName:function(item){this.current().body.push(this.ensureSafeMemberName(item),";")},addEnsureSafeFunction:function(item){this.current().body.push(this.ensureSafeFunction(item),";")},ensureSafeObject:function(item){return"ensureSafeObject("+item+",text)"},ensureSafeMemberName:function(item){return"ensureSafeMemberName("+item+",text)"},ensureSafeFunction:function(item){return"ensureSafeFunction("+item+",text)"},lazyRecurse:function(ast,intoId,nameId,recursionFn,create,skipWatchIdCheck){var self=this;return function(){self.recurse(ast,intoId,nameId,recursionFn,create,skipWatchIdCheck)}},lazyAssign:function(id,value){var self=this;return function(){self.assign(id,value)}},stringEscapeRegex:/[^ a-zA-Z0-9]/g,stringEscapeFn:function(c){return"\\u"+("0000"+c.charCodeAt(0).toString(16)).slice(-4)},escape:function(value){if(isString(value))return"'"+value.replace(this.stringEscapeRegex,this.stringEscapeFn)+"'";if(isNumber(value))return value.toString();if(value===!0)return"true";if(value===!1)return"false";if(null===value)return"null";if("undefined"==typeof value)return"undefined";throw $parseMinErr("esc","IMPOSSIBLE")},nextId:function(skip,init){var id="v"+this.state.nextId++;return skip||this.current().vars.push(id+(init?"="+init:"")),id},current:function(){return this.state[this.state.computing]}},ASTInterpreter.prototype={compile:function(expression,expensiveChecks){var self=this,ast=this.astBuilder.ast(expression);this.expression=expression,this.expensiveChecks=expensiveChecks,findConstantAndWatchExpressions(ast,self.$filter);var assignable,assign;(assignable=assignableAST(ast))&&(assign=this.recurse(assignable));var inputs,toWatch=getInputs(ast.body);toWatch&&(inputs=[],forEach(toWatch,function(watch,key){var input=self.recurse(watch);watch.input=input,inputs.push(input),watch.watchId=key}));var expressions=[];forEach(ast.body,function(expression){expressions.push(self.recurse(expression.expression))});var fn=0===ast.body.length?function(){}:1===ast.body.length?expressions[0]:function(scope,locals){var lastValue;return forEach(expressions,function(exp){lastValue=exp(scope,locals)}),lastValue};return assign&&(fn.assign=function(scope,value,locals){return assign(scope,locals,value)}),inputs&&(fn.inputs=inputs),fn.literal=isLiteral(ast),fn.constant=isConstant(ast),fn},recurse:function(ast,context,create){var left,right,args,self=this;if(ast.input)return this.inputs(ast.input,ast.watchId);switch(ast.type){case AST.Literal:return this.value(ast.value,context);case AST.UnaryExpression:return right=this.recurse(ast.argument),this["unary"+ast.operator](right,context);case AST.BinaryExpression:return left=this.recurse(ast.left),right=this.recurse(ast.right),this["binary"+ast.operator](left,right,context);case AST.LogicalExpression:return left=this.recurse(ast.left),right=this.recurse(ast.right),this["binary"+ast.operator](left,right,context);case AST.ConditionalExpression:return this["ternary?:"](this.recurse(ast.test),this.recurse(ast.alternate),this.recurse(ast.consequent),context);case AST.Identifier:return ensureSafeMemberName(ast.name,self.expression),self.identifier(ast.name,self.expensiveChecks||isPossiblyDangerousMemberName(ast.name),context,create,self.expression);case AST.MemberExpression:return left=this.recurse(ast.object,!1,!!create),ast.computed||(ensureSafeMemberName(ast.property.name,self.expression),right=ast.property.name),ast.computed&&(right=this.recurse(ast.property)),ast.computed?this.computedMember(left,right,context,create,self.expression):this.nonComputedMember(left,right,self.expensiveChecks,context,create,self.expression);case AST.CallExpression:return args=[],forEach(ast.arguments,function(expr){args.push(self.recurse(expr))}),ast.filter&&(right=this.$filter(ast.callee.name)),ast.filter||(right=this.recurse(ast.callee,!0)),ast.filter?function(scope,locals,assign,inputs){for(var values=[],i=0;i<args.length;++i)values.push(args[i](scope,locals,assign,inputs));var value=right.apply(undefined,values,inputs);return context?{context:undefined,name:undefined,value:value}:value}:function(scope,locals,assign,inputs){var value,rhs=right(scope,locals,assign,inputs);if(null!=rhs.value){ensureSafeObject(rhs.context,self.expression),ensureSafeFunction(rhs.value,self.expression);for(var values=[],i=0;i<args.length;++i)values.push(ensureSafeObject(args[i](scope,locals,assign,inputs),self.expression));value=ensureSafeObject(rhs.value.apply(rhs.context,values),self.expression)}return context?{value:value}:value};case AST.AssignmentExpression:return left=this.recurse(ast.left,!0,1),right=this.recurse(ast.right),function(scope,locals,assign,inputs){var lhs=left(scope,locals,assign,inputs),rhs=right(scope,locals,assign,inputs);return ensureSafeObject(lhs.value,self.expression),lhs.context[lhs.name]=rhs,context?{value:rhs}:rhs};case AST.ArrayExpression:return args=[],forEach(ast.elements,function(expr){args.push(self.recurse(expr))}),function(scope,locals,assign,inputs){for(var value=[],i=0;i<args.length;++i)value.push(args[i](scope,locals,assign,inputs));return context?{value:value}:value};case AST.ObjectExpression:return args=[],forEach(ast.properties,function(property){args.push({key:property.key.type===AST.Identifier?property.key.name:""+property.key.value,value:self.recurse(property.value)})}),function(scope,locals,assign,inputs){for(var value={},i=0;i<args.length;++i)value[args[i].key]=args[i].value(scope,locals,assign,inputs);return context?{value:value}:value};case AST.ThisExpression:return function(scope){return context?{value:scope}:scope};case AST.NGValueParameter:return function(scope,locals,assign,inputs){return context?{value:assign}:assign}}},"unary+":function(argument,context){return function(scope,locals,assign,inputs){var arg=argument(scope,locals,assign,inputs);return arg=isDefined(arg)?+arg:0,context?{value:arg}:arg}},"unary-":function(argument,context){return function(scope,locals,assign,inputs){var arg=argument(scope,locals,assign,inputs);return arg=isDefined(arg)?-arg:0,context?{value:arg}:arg}},"unary!":function(argument,context){return function(scope,locals,assign,inputs){var arg=!argument(scope,locals,assign,inputs);return context?{value:arg}:arg}},"binary+":function(left,right,context){return function(scope,locals,assign,inputs){var lhs=left(scope,locals,assign,inputs),rhs=right(scope,locals,assign,inputs),arg=plusFn(lhs,rhs);return context?{value:arg}:arg}},"binary-":function(left,right,context){return function(scope,locals,assign,inputs){var lhs=left(scope,locals,assign,inputs),rhs=right(scope,locals,assign,inputs),arg=(isDefined(lhs)?lhs:0)-(isDefined(rhs)?rhs:0);return context?{value:arg}:arg}},"binary*":function(left,right,context){return function(scope,locals,assign,inputs){var arg=left(scope,locals,assign,inputs)*right(scope,locals,assign,inputs);return context?{value:arg}:arg}},"binary/":function(left,right,context){return function(scope,locals,assign,inputs){var arg=left(scope,locals,assign,inputs)/right(scope,locals,assign,inputs);return context?{value:arg}:arg}},"binary%":function(left,right,context){return function(scope,locals,assign,inputs){var arg=left(scope,locals,assign,inputs)%right(scope,locals,assign,inputs);return context?{value:arg}:arg}},"binary===":function(left,right,context){return function(scope,locals,assign,inputs){var arg=left(scope,locals,assign,inputs)===right(scope,locals,assign,inputs);return context?{value:arg}:arg}},"binary!==":function(left,right,context){return function(scope,locals,assign,inputs){var arg=left(scope,locals,assign,inputs)!==right(scope,locals,assign,inputs);return context?{value:arg}:arg}},"binary==":function(left,right,context){return function(scope,locals,assign,inputs){var arg=left(scope,locals,assign,inputs)==right(scope,locals,assign,inputs);return context?{value:arg}:arg}},"binary!=":function(left,right,context){return function(scope,locals,assign,inputs){var arg=left(scope,locals,assign,inputs)!=right(scope,locals,assign,inputs); return context?{value:arg}:arg}},"binary<":function(left,right,context){return function(scope,locals,assign,inputs){var arg=left(scope,locals,assign,inputs)<right(scope,locals,assign,inputs);return context?{value:arg}:arg}},"binary>":function(left,right,context){return function(scope,locals,assign,inputs){var arg=left(scope,locals,assign,inputs)>right(scope,locals,assign,inputs);return context?{value:arg}:arg}},"binary<=":function(left,right,context){return function(scope,locals,assign,inputs){var arg=left(scope,locals,assign,inputs)<=right(scope,locals,assign,inputs);return context?{value:arg}:arg}},"binary>=":function(left,right,context){return function(scope,locals,assign,inputs){var arg=left(scope,locals,assign,inputs)>=right(scope,locals,assign,inputs);return context?{value:arg}:arg}},"binary&&":function(left,right,context){return function(scope,locals,assign,inputs){var arg=left(scope,locals,assign,inputs)&&right(scope,locals,assign,inputs);return context?{value:arg}:arg}},"binary||":function(left,right,context){return function(scope,locals,assign,inputs){var arg=left(scope,locals,assign,inputs)||right(scope,locals,assign,inputs);return context?{value:arg}:arg}},"ternary?:":function(test,alternate,consequent,context){return function(scope,locals,assign,inputs){var arg=test(scope,locals,assign,inputs)?alternate(scope,locals,assign,inputs):consequent(scope,locals,assign,inputs);return context?{value:arg}:arg}},value:function(value,context){return function(){return context?{context:undefined,name:undefined,value:value}:value}},identifier:function(name,expensiveChecks,context,create,expression){return function(scope,locals,assign,inputs){var base=locals&&name in locals?locals:scope;create&&1!==create&&base&&!base[name]&&(base[name]={});var value=base?base[name]:undefined;return expensiveChecks&&ensureSafeObject(value,expression),context?{context:base,name:name,value:value}:value}},computedMember:function(left,right,context,create,expression){return function(scope,locals,assign,inputs){var rhs,value,lhs=left(scope,locals,assign,inputs);return null!=lhs&&(rhs=right(scope,locals,assign,inputs),ensureSafeMemberName(rhs,expression),create&&1!==create&&lhs&&!lhs[rhs]&&(lhs[rhs]={}),value=lhs[rhs],ensureSafeObject(value,expression)),context?{context:lhs,name:rhs,value:value}:value}},nonComputedMember:function(left,right,expensiveChecks,context,create,expression){return function(scope,locals,assign,inputs){var lhs=left(scope,locals,assign,inputs);create&&1!==create&&lhs&&!lhs[right]&&(lhs[right]={});var value=null!=lhs?lhs[right]:undefined;return(expensiveChecks||isPossiblyDangerousMemberName(right))&&ensureSafeObject(value,expression),context?{context:lhs,name:right,value:value}:value}},inputs:function(input,watchId){return function(scope,value,locals,inputs){return inputs?inputs[watchId]:input(scope,value,locals)}}};var Parser=function(lexer,$filter,options){this.lexer=lexer,this.$filter=$filter,this.options=options,this.ast=new AST(this.lexer),this.astCompiler=options.csp?new ASTInterpreter(this.ast,$filter):new ASTCompiler(this.ast,$filter)};Parser.prototype={constructor:Parser,parse:function(text){return this.astCompiler.compile(text,this.options.expensiveChecks)}};var objectValueOf=(createMap(),createMap(),Object.prototype.valueOf),$sceMinErr=minErr("$sce"),SCE_CONTEXTS={HTML:"html",CSS:"css",URL:"url",RESOURCE_URL:"resourceUrl",JS:"js"},$compileMinErr=minErr("$compile"),urlParsingNode=document.createElement("a"),originUrl=urlResolve(window.location.href);$$CookieReader.$inject=["$document"],$FilterProvider.$inject=["$provide"],currencyFilter.$inject=["$locale"],numberFilter.$inject=["$locale"];var DECIMAL_SEP=".",DATE_FORMATS={yyyy:dateGetter("FullYear",4),yy:dateGetter("FullYear",2,0,!0),y:dateGetter("FullYear",1),MMMM:dateStrGetter("Month"),MMM:dateStrGetter("Month",!0),MM:dateGetter("Month",2,1),M:dateGetter("Month",1,1),dd:dateGetter("Date",2),d:dateGetter("Date",1),HH:dateGetter("Hours",2),H:dateGetter("Hours",1),hh:dateGetter("Hours",2,-12),h:dateGetter("Hours",1,-12),mm:dateGetter("Minutes",2),m:dateGetter("Minutes",1),ss:dateGetter("Seconds",2),s:dateGetter("Seconds",1),sss:dateGetter("Milliseconds",3),EEEE:dateStrGetter("Day"),EEE:dateStrGetter("Day",!0),a:ampmGetter,Z:timeZoneGetter,ww:weekGetter(2),w:weekGetter(1),G:eraGetter,GG:eraGetter,GGG:eraGetter,GGGG:longEraGetter},DATE_FORMATS_SPLIT=/((?:[^yMdHhmsaZEwG']+)|(?:'(?:[^']|'')*')|(?:E+|y+|M+|d+|H+|h+|m+|s+|a|Z|G+|w+))(.*)/,NUMBER_STRING=/^\-?\d+$/;dateFilter.$inject=["$locale"];var lowercaseFilter=valueFn(lowercase),uppercaseFilter=valueFn(uppercase);orderByFilter.$inject=["$parse"];var htmlAnchorDirective=valueFn({restrict:"E",compile:function(element,attr){return attr.href||attr.xlinkHref?void 0:function(scope,element){if("a"===element[0].nodeName.toLowerCase()){var href="[object SVGAnimatedString]"===toString.call(element.prop("href"))?"xlink:href":"href";element.on("click",function(event){element.attr(href)||event.preventDefault()})}}}}),ngAttributeAliasDirectives={};forEach(BOOLEAN_ATTR,function(propName,attrName){function defaultLinkFn(scope,element,attr){scope.$watch(attr[normalized],function(value){attr.$set(attrName,!!value)})}if("multiple"!=propName){var normalized=directiveNormalize("ng-"+attrName),linkFn=defaultLinkFn;"checked"===propName&&(linkFn=function(scope,element,attr){attr.ngModel!==attr[normalized]&&defaultLinkFn(scope,element,attr)}),ngAttributeAliasDirectives[normalized]=function(){return{restrict:"A",priority:100,link:linkFn}}}}),forEach(ALIASED_ATTR,function(htmlAttr,ngAttr){ngAttributeAliasDirectives[ngAttr]=function(){return{priority:100,link:function(scope,element,attr){if("ngPattern"===ngAttr&&"/"==attr.ngPattern.charAt(0)){var match=attr.ngPattern.match(REGEX_STRING_REGEXP);if(match)return void attr.$set("ngPattern",new RegExp(match[1],match[2]))}scope.$watch(attr[ngAttr],function(value){attr.$set(ngAttr,value)})}}}}),forEach(["src","srcset","href"],function(attrName){var normalized=directiveNormalize("ng-"+attrName);ngAttributeAliasDirectives[normalized]=function(){return{priority:99,link:function(scope,element,attr){var propName=attrName,name=attrName;"href"===attrName&&"[object SVGAnimatedString]"===toString.call(element.prop("href"))&&(name="xlinkHref",attr.$attr[name]="xlink:href",propName=null),attr.$observe(normalized,function(value){return value?(attr.$set(name,value),void(msie&&propName&&element.prop(propName,attr[name]))):void("href"===attrName&&attr.$set(name,null))})}}}});var nullFormCtrl={$addControl:noop,$$renameControl:nullFormRenameControl,$removeControl:noop,$setValidity:noop,$setDirty:noop,$setPristine:noop,$setSubmitted:noop},SUBMITTED_CLASS="ng-submitted";FormController.$inject=["$element","$attrs","$scope","$animate","$interpolate"];var formDirectiveFactory=function(isNgForm){return["$timeout",function($timeout){var formDirective={name:"form",restrict:isNgForm?"EAC":"E",controller:FormController,compile:function(formElement,attr){formElement.addClass(PRISTINE_CLASS).addClass(VALID_CLASS);var nameAttr=attr.name?"name":isNgForm&&attr.ngForm?"ngForm":!1;return{pre:function(scope,formElement,attr,controller){if(!("action"in attr)){var handleFormSubmission=function(event){scope.$apply(function(){controller.$commitViewValue(),controller.$setSubmitted()}),event.preventDefault()};addEventListenerFn(formElement[0],"submit",handleFormSubmission),formElement.on("$destroy",function(){$timeout(function(){removeEventListenerFn(formElement[0],"submit",handleFormSubmission)},0,!1)})}var parentFormCtrl=controller.$$parentForm;nameAttr&&(setter(scope,controller.$name,controller,controller.$name),attr.$observe(nameAttr,function(newValue){controller.$name!==newValue&&(setter(scope,controller.$name,undefined,controller.$name),parentFormCtrl.$$renameControl(controller,newValue),setter(scope,controller.$name,controller,controller.$name))})),formElement.on("$destroy",function(){parentFormCtrl.$removeControl(controller),nameAttr&&setter(scope,attr[nameAttr],undefined,controller.$name),extend(controller,nullFormCtrl)})}}}};return formDirective}]},formDirective=formDirectiveFactory(),ngFormDirective=formDirectiveFactory(!0),ISO_DATE_REGEXP=/\d{4}-[01]\d-[0-3]\dT[0-2]\d:[0-5]\d:[0-5]\d\.\d+([+-][0-2]\d:[0-5]\d|Z)/,URL_REGEXP=/^(ftp|http|https):\/\/(\w+:{0,1}\w*@)?(\S+)(:[0-9]+)?(\/|\/([\w#!:.?+=&%@!\-\/]))?$/,EMAIL_REGEXP=/^[a-z0-9!#$%&'*+\/=?^_`{|}~.-]+@[a-z0-9]([a-z0-9-]*[a-z0-9])?(\.[a-z0-9]([a-z0-9-]*[a-z0-9])?)*$/i,NUMBER_REGEXP=/^\s*(\-|\+)?(\d+|(\d*(\.\d*)))([eE][+-]?\d+)?\s*$/,DATE_REGEXP=/^(\d{4})-(\d{2})-(\d{2})$/,DATETIMELOCAL_REGEXP=/^(\d{4})-(\d\d)-(\d\d)T(\d\d):(\d\d)(?::(\d\d)(\.\d{1,3})?)?$/,WEEK_REGEXP=/^(\d{4})-W(\d\d)$/,MONTH_REGEXP=/^(\d{4})-(\d\d)$/,TIME_REGEXP=/^(\d\d):(\d\d)(?::(\d\d)(\.\d{1,3})?)?$/,inputType={text:textInputType,date:createDateInputType("date",DATE_REGEXP,createDateParser(DATE_REGEXP,["yyyy","MM","dd"]),"yyyy-MM-dd"),"datetime-local":createDateInputType("datetimelocal",DATETIMELOCAL_REGEXP,createDateParser(DATETIMELOCAL_REGEXP,["yyyy","MM","dd","HH","mm","ss","sss"]),"yyyy-MM-ddTHH:mm:ss.sss"),time:createDateInputType("time",TIME_REGEXP,createDateParser(TIME_REGEXP,["HH","mm","ss","sss"]),"HH:mm:ss.sss"),week:createDateInputType("week",WEEK_REGEXP,weekParser,"yyyy-Www"),month:createDateInputType("month",MONTH_REGEXP,createDateParser(MONTH_REGEXP,["yyyy","MM"]),"yyyy-MM"),number:numberInputType,url:urlInputType,email:emailInputType,radio:radioInputType,checkbox:checkboxInputType,hidden:noop,button:noop,submit:noop,reset:noop,file:noop},inputDirective=["$browser","$sniffer","$filter","$parse",function($browser,$sniffer,$filter,$parse){return{restrict:"E",require:["?ngModel"],link:{pre:function(scope,element,attr,ctrls){ctrls[0]&&(inputType[lowercase(attr.type)]||inputType.text)(scope,element,attr,ctrls[0],$sniffer,$browser,$filter,$parse)}}}}],CONSTANT_VALUE_REGEXP=/^(true|false|\d+)$/,ngValueDirective=function(){return{restrict:"A",priority:100,compile:function(tpl,tplAttr){return CONSTANT_VALUE_REGEXP.test(tplAttr.ngValue)?function(scope,elm,attr){attr.$set("value",scope.$eval(attr.ngValue))}:function(scope,elm,attr){scope.$watch(attr.ngValue,function(value){attr.$set("value",value)})}}}},ngBindDirective=["$compile",function($compile){return{restrict:"AC",compile:function(templateElement){return $compile.$$addBindingClass(templateElement),function(scope,element,attr){$compile.$$addBindingInfo(element,attr.ngBind),element=element[0],scope.$watch(attr.ngBind,function(value){element.textContent=value===undefined?"":value})}}}}],ngBindTemplateDirective=["$interpolate","$compile",function($interpolate,$compile){return{compile:function(templateElement){return $compile.$$addBindingClass(templateElement),function(scope,element,attr){var interpolateFn=$interpolate(element.attr(attr.$attr.ngBindTemplate));$compile.$$addBindingInfo(element,interpolateFn.expressions),element=element[0],attr.$observe("ngBindTemplate",function(value){element.textContent=value===undefined?"":value})}}}}],ngBindHtmlDirective=["$sce","$parse","$compile",function($sce,$parse,$compile){return{restrict:"A",compile:function(tElement,tAttrs){var ngBindHtmlGetter=$parse(tAttrs.ngBindHtml),ngBindHtmlWatch=$parse(tAttrs.ngBindHtml,function(value){return(value||"").toString()});return $compile.$$addBindingClass(tElement),function(scope,element,attr){$compile.$$addBindingInfo(element,attr.ngBindHtml),scope.$watch(ngBindHtmlWatch,function(){element.html($sce.getTrustedHtml(ngBindHtmlGetter(scope))||"")})}}}}],ngChangeDirective=valueFn({restrict:"A",require:"ngModel",link:function(scope,element,attr,ctrl){ctrl.$viewChangeListeners.push(function(){scope.$eval(attr.ngChange)})}}),ngClassDirective=classDirective("",!0),ngClassOddDirective=classDirective("Odd",0),ngClassEvenDirective=classDirective("Even",1),ngCloakDirective=ngDirective({compile:function(element,attr){attr.$set("ngCloak",undefined),element.removeClass("ng-cloak")}}),ngControllerDirective=[function(){return{restrict:"A",scope:!0,controller:"@",priority:500}}],ngEventDirectives={},forceAsyncEvents={blur:!0,focus:!0};forEach("click dblclick mousedown mouseup mouseover mouseout mousemove mouseenter mouseleave keydown keyup keypress submit focus blur copy cut paste".split(" "),function(eventName){var directiveName=directiveNormalize("ng-"+eventName);ngEventDirectives[directiveName]=["$parse","$rootScope",function($parse,$rootScope){return{restrict:"A",compile:function($element,attr){var fn=$parse(attr[directiveName],null,!0);return function(scope,element){element.on(eventName,function(event){var callback=function(){fn(scope,{$event:event})};forceAsyncEvents[eventName]&&$rootScope.$$phase?scope.$evalAsync(callback):scope.$apply(callback)})}}}}]});var ngIfDirective=["$animate",function($animate){return{multiElement:!0,transclude:"element",priority:600,terminal:!0,restrict:"A",$$tlb:!0,link:function($scope,$element,$attr,ctrl,$transclude){var block,childScope,previousElements;$scope.$watch($attr.ngIf,function(value){value?childScope||$transclude(function(clone,newScope){childScope=newScope,clone[clone.length++]=document.createComment(" end ngIf: "+$attr.ngIf+" "),block={clone:clone},$animate.enter(clone,$element.parent(),$element)}):(previousElements&&(previousElements.remove(),previousElements=null),childScope&&(childScope.$destroy(),childScope=null),block&&(previousElements=getBlockNodes(block.clone),$animate.leave(previousElements).then(function(){previousElements=null}),block=null))})}}}],ngIncludeDirective=["$templateRequest","$anchorScroll","$animate",function($templateRequest,$anchorScroll,$animate){return{restrict:"ECA",priority:400,terminal:!0,transclude:"element",controller:angular.noop,compile:function(element,attr){var srcExp=attr.ngInclude||attr.src,onloadExp=attr.onload||"",autoScrollExp=attr.autoscroll;return function(scope,$element,$attr,ctrl,$transclude){var currentScope,previousElement,currentElement,changeCounter=0,cleanupLastIncludeContent=function(){previousElement&&(previousElement.remove(),previousElement=null),currentScope&&(currentScope.$destroy(),currentScope=null),currentElement&&($animate.leave(currentElement).then(function(){previousElement=null}),previousElement=currentElement,currentElement=null)};scope.$watch(srcExp,function(src){var afterAnimation=function(){!isDefined(autoScrollExp)||autoScrollExp&&!scope.$eval(autoScrollExp)||$anchorScroll()},thisChangeId=++changeCounter;src?($templateRequest(src,!0).then(function(response){if(thisChangeId===changeCounter){var newScope=scope.$new();ctrl.template=response;var clone=$transclude(newScope,function(clone){cleanupLastIncludeContent(),$animate.enter(clone,null,$element).then(afterAnimation)});currentScope=newScope,currentElement=clone,currentScope.$emit("$includeContentLoaded",src),scope.$eval(onloadExp)}},function(){thisChangeId===changeCounter&&(cleanupLastIncludeContent(),scope.$emit("$includeContentError",src))}),scope.$emit("$includeContentRequested",src)):(cleanupLastIncludeContent(),ctrl.template=null)})}}}}],ngIncludeFillContentDirective=["$compile",function($compile){return{restrict:"ECA",priority:-400,require:"ngInclude",link:function(scope,$element,$attr,ctrl){return/SVG/.test($element[0].toString())?($element.empty(),void $compile(jqLiteBuildFragment(ctrl.template,document).childNodes)(scope,function(clone){$element.append(clone)},{futureParentElement:$element})):($element.html(ctrl.template),void $compile($element.contents())(scope))}}}],ngInitDirective=ngDirective({priority:450,compile:function(){return{pre:function(scope,element,attrs){scope.$eval(attrs.ngInit)}}}}),ngListDirective=function(){return{restrict:"A",priority:100,require:"ngModel",link:function(scope,element,attr,ctrl){var ngList=element.attr(attr.$attr.ngList)||", ",trimValues="false"!==attr.ngTrim,separator=trimValues?trim(ngList):ngList,parse=function(viewValue){if(!isUndefined(viewValue)){var list=[];return viewValue&&forEach(viewValue.split(separator),function(value){value&&list.push(trimValues?trim(value):value)}),list}};ctrl.$parsers.push(parse),ctrl.$formatters.push(function(value){return isArray(value)?value.join(ngList):undefined}),ctrl.$isEmpty=function(value){return!value||!value.length}}}},VALID_CLASS="ng-valid",INVALID_CLASS="ng-invalid",PRISTINE_CLASS="ng-pristine",DIRTY_CLASS="ng-dirty",UNTOUCHED_CLASS="ng-untouched",TOUCHED_CLASS="ng-touched",PENDING_CLASS="ng-pending",$ngModelMinErr=new minErr("ngModel"),NgModelController=["$scope","$exceptionHandler","$attrs","$element","$parse","$animate","$timeout","$rootScope","$q","$interpolate",function($scope,$exceptionHandler,$attr,$element,$parse,$animate,$timeout,$rootScope,$q,$interpolate){this.$viewValue=Number.NaN,this.$modelValue=Number.NaN,this.$$rawModelValue=undefined,this.$validators={},this.$asyncValidators={},this.$parsers=[],this.$formatters=[],this.$viewChangeListeners=[],this.$untouched=!0,this.$touched=!1,this.$pristine=!0,this.$dirty=!1,this.$valid=!0,this.$invalid=!1,this.$error={},this.$$success={},this.$pending=undefined,this.$name=$interpolate($attr.name||"",!1)($scope);var parserValid,parsedNgModel=$parse($attr.ngModel),parsedNgModelAssign=parsedNgModel.assign,ngModelGet=parsedNgModel,ngModelSet=parsedNgModelAssign,pendingDebounce=null,ctrl=this;this.$$setOptions=function(options){if(ctrl.$options=options,options&&options.getterSetter){var invokeModelGetter=$parse($attr.ngModel+"()"),invokeModelSetter=$parse($attr.ngModel+"($$$p)");ngModelGet=function($scope){var modelValue=parsedNgModel($scope);return isFunction(modelValue)&&(modelValue=invokeModelGetter($scope)),modelValue},ngModelSet=function($scope,newValue){isFunction(parsedNgModel($scope))?invokeModelSetter($scope,{$$$p:ctrl.$modelValue}):parsedNgModelAssign($scope,ctrl.$modelValue)}}else if(!parsedNgModel.assign)throw $ngModelMinErr("nonassign","Expression '{0}' is non-assignable. Element: {1}",$attr.ngModel,startingTag($element))},this.$render=noop,this.$isEmpty=function(value){return isUndefined(value)||""===value||null===value||value!==value};var parentForm=$element.inheritedData("$formController")||nullFormCtrl,currentValidationRunId=0;addSetValidityMethod({ctrl:this,$element:$element,set:function(object,property){object[property]=!0},unset:function(object,property){delete object[property]},parentForm:parentForm,$animate:$animate}),this.$setPristine=function(){ctrl.$dirty=!1,ctrl.$pristine=!0,$animate.removeClass($element,DIRTY_CLASS),$animate.addClass($element,PRISTINE_CLASS)},this.$setDirty=function(){ctrl.$dirty=!0,ctrl.$pristine=!1,$animate.removeClass($element,PRISTINE_CLASS),$animate.addClass($element,DIRTY_CLASS),parentForm.$setDirty()},this.$setUntouched=function(){ctrl.$touched=!1,ctrl.$untouched=!0,$animate.setClass($element,UNTOUCHED_CLASS,TOUCHED_CLASS)},this.$setTouched=function(){ctrl.$touched=!0,ctrl.$untouched=!1,$animate.setClass($element,TOUCHED_CLASS,UNTOUCHED_CLASS)},this.$rollbackViewValue=function(){$timeout.cancel(pendingDebounce),ctrl.$viewValue=ctrl.$$lastCommittedViewValue,ctrl.$render()},this.$validate=function(){if(!isNumber(ctrl.$modelValue)||!isNaN(ctrl.$modelValue)){var viewValue=ctrl.$$lastCommittedViewValue,modelValue=ctrl.$$rawModelValue,prevValid=ctrl.$valid,prevModelValue=ctrl.$modelValue,allowInvalid=ctrl.$options&&ctrl.$options.allowInvalid;ctrl.$$runValidators(modelValue,viewValue,function(allValid){allowInvalid||prevValid===allValid||(ctrl.$modelValue=allValid?modelValue:undefined,ctrl.$modelValue!==prevModelValue&&ctrl.$$writeModelToScope())})}},this.$$runValidators=function(modelValue,viewValue,doneCallback){function processParseErrors(){var errorKey=ctrl.$$parserName||"parse";return parserValid!==undefined?(parserValid||(forEach(ctrl.$validators,function(v,name){setValidity(name,null)}),forEach(ctrl.$asyncValidators,function(v,name){setValidity(name,null)})),setValidity(errorKey,parserValid),parserValid):(setValidity(errorKey,null),!0)}function processSyncValidators(){var syncValidatorsValid=!0;return forEach(ctrl.$validators,function(validator,name){var result=validator(modelValue,viewValue);syncValidatorsValid=syncValidatorsValid&&result,setValidity(name,result)}),syncValidatorsValid?!0:(forEach(ctrl.$asyncValidators,function(v,name){setValidity(name,null)}),!1)}function processAsyncValidators(){var validatorPromises=[],allValid=!0;forEach(ctrl.$asyncValidators,function(validator,name){var promise=validator(modelValue,viewValue);if(!isPromiseLike(promise))throw $ngModelMinErr("$asyncValidators","Expected asynchronous validator to return a promise but got '{0}' instead.",promise);setValidity(name,undefined),validatorPromises.push(promise.then(function(){setValidity(name,!0)},function(error){allValid=!1,setValidity(name,!1)}))}),validatorPromises.length?$q.all(validatorPromises).then(function(){validationDone(allValid)},noop):validationDone(!0)}function setValidity(name,isValid){localValidationRunId===currentValidationRunId&&ctrl.$setValidity(name,isValid)}function validationDone(allValid){localValidationRunId===currentValidationRunId&&doneCallback(allValid)}currentValidationRunId++;var localValidationRunId=currentValidationRunId;return processParseErrors()&&processSyncValidators()?void processAsyncValidators():void validationDone(!1)},this.$commitViewValue=function(){var viewValue=ctrl.$viewValue;$timeout.cancel(pendingDebounce),(ctrl.$$lastCommittedViewValue!==viewValue||""===viewValue&&ctrl.$$hasNativeValidators)&&(ctrl.$$lastCommittedViewValue=viewValue,ctrl.$pristine&&this.$setDirty(),this.$$parseAndValidate())},this.$$parseAndValidate=function(){function writeToModelIfNeeded(){ctrl.$modelValue!==prevModelValue&&ctrl.$$writeModelToScope()}var viewValue=ctrl.$$lastCommittedViewValue,modelValue=viewValue;if(parserValid=isUndefined(modelValue)?undefined:!0)for(var i=0;i<ctrl.$parsers.length;i++)if(modelValue=ctrl.$parsers[i](modelValue),isUndefined(modelValue)){parserValid=!1;break}isNumber(ctrl.$modelValue)&&isNaN(ctrl.$modelValue)&&(ctrl.$modelValue=ngModelGet($scope));var prevModelValue=ctrl.$modelValue,allowInvalid=ctrl.$options&&ctrl.$options.allowInvalid;ctrl.$$rawModelValue=modelValue,allowInvalid&&(ctrl.$modelValue=modelValue,writeToModelIfNeeded()),ctrl.$$runValidators(modelValue,ctrl.$$lastCommittedViewValue,function(allValid){allowInvalid||(ctrl.$modelValue=allValid?modelValue:undefined,writeToModelIfNeeded())})},this.$$writeModelToScope=function(){ngModelSet($scope,ctrl.$modelValue),forEach(ctrl.$viewChangeListeners,function(listener){try{listener()}catch(e){$exceptionHandler(e)}})},this.$setViewValue=function(value,trigger){ctrl.$viewValue=value,(!ctrl.$options||ctrl.$options.updateOnDefault)&&ctrl.$$debounceViewValueCommit(trigger)},this.$$debounceViewValueCommit=function(trigger){var debounce,debounceDelay=0,options=ctrl.$options;options&&isDefined(options.debounce)&&(debounce=options.debounce,isNumber(debounce)?debounceDelay=debounce:isNumber(debounce[trigger])?debounceDelay=debounce[trigger]:isNumber(debounce["default"])&&(debounceDelay=debounce["default"])),$timeout.cancel(pendingDebounce),debounceDelay?pendingDebounce=$timeout(function(){ctrl.$commitViewValue()},debounceDelay):$rootScope.$$phase?ctrl.$commitViewValue():$scope.$apply(function(){ctrl.$commitViewValue()})},$scope.$watch(function(){var modelValue=ngModelGet($scope);if(modelValue!==ctrl.$modelValue&&(ctrl.$modelValue===ctrl.$modelValue||modelValue===modelValue)){ctrl.$modelValue=ctrl.$$rawModelValue=modelValue,parserValid=undefined;for(var formatters=ctrl.$formatters,idx=formatters.length,viewValue=modelValue;idx--;)viewValue=formatters[idx](viewValue);ctrl.$viewValue!==viewValue&&(ctrl.$viewValue=ctrl.$$lastCommittedViewValue=viewValue,ctrl.$render(),ctrl.$$runValidators(modelValue,viewValue,noop))}return modelValue})}],ngModelDirective=["$rootScope",function($rootScope){return{restrict:"A",require:["ngModel","^?form","^?ngModelOptions"],controller:NgModelController,priority:1,compile:function(element){return element.addClass(PRISTINE_CLASS).addClass(UNTOUCHED_CLASS).addClass(VALID_CLASS),{pre:function(scope,element,attr,ctrls){var modelCtrl=ctrls[0],formCtrl=ctrls[1]||nullFormCtrl;modelCtrl.$$setOptions(ctrls[2]&&ctrls[2].$options),formCtrl.$addControl(modelCtrl),attr.$observe("name",function(newValue){modelCtrl.$name!==newValue&&formCtrl.$$renameControl(modelCtrl,newValue)}),scope.$on("$destroy",function(){formCtrl.$removeControl(modelCtrl)})},post:function(scope,element,attr,ctrls){var modelCtrl=ctrls[0];modelCtrl.$options&&modelCtrl.$options.updateOn&&element.on(modelCtrl.$options.updateOn,function(ev){modelCtrl.$$debounceViewValueCommit(ev&&ev.type)}),element.on("blur",function(ev){modelCtrl.$touched||($rootScope.$$phase?scope.$evalAsync(modelCtrl.$setTouched):scope.$apply(modelCtrl.$setTouched))})}}}}}],DEFAULT_REGEXP=/(\s+|^)default(\s+|$)/,ngModelOptionsDirective=function(){return{restrict:"A",controller:["$scope","$attrs",function($scope,$attrs){var that=this;this.$options=copy($scope.$eval($attrs.ngModelOptions)),this.$options.updateOn!==undefined?(this.$options.updateOnDefault=!1,this.$options.updateOn=trim(this.$options.updateOn.replace(DEFAULT_REGEXP,function(){return that.$options.updateOnDefault=!0," "}))):this.$options.updateOnDefault=!0}]}},ngNonBindableDirective=ngDirective({terminal:!0,priority:1e3}),ngOptionsMinErr=minErr("ngOptions"),NG_OPTIONS_REGEXP=/^\s*([\s\S]+?)(?:\s+as\s+([\s\S]+?))?(?:\s+group\s+by\s+([\s\S]+?))?(?:\s+disable\s+when\s+([\s\S]+?))?\s+for\s+(?:([\$\w][\$\w]*)|(?:\(\s*([\$\w][\$\w]*)\s*,\s*([\$\w][\$\w]*)\s*\)))\s+in\s+([\s\S]+?)(?:\s+track\s+by\s+([\s\S]+?))?$/,ngOptionsDirective=["$compile","$parse",function($compile,$parse){function parseOptionsExpression(optionsExp,selectElement,scope){function Option(selectValue,viewValue,label,group,disabled){this.selectValue=selectValue,this.viewValue=viewValue,this.label=label,this.group=group,this.disabled=disabled}function getOptionValuesKeys(optionValues){var optionValuesKeys;if(!keyName&&isArrayLike(optionValues))optionValuesKeys=optionValues;else{optionValuesKeys=[];for(var itemKey in optionValues)optionValues.hasOwnProperty(itemKey)&&"$"!==itemKey.charAt(0)&&optionValuesKeys.push(itemKey)}return optionValuesKeys}var match=optionsExp.match(NG_OPTIONS_REGEXP);if(!match)throw ngOptionsMinErr("iexp","Expected expression in form of '_select_ (as _label_)? for (_key_,)?_value_ in _collection_' but got '{0}'. Element: {1}",optionsExp,startingTag(selectElement));var valueName=match[5]||match[7],keyName=match[6],selectAs=/ as /.test(match[0])&&match[1],trackBy=match[9],valueFn=$parse(match[2]?match[1]:valueName),selectAsFn=selectAs&&$parse(selectAs),viewValueFn=selectAsFn||valueFn,trackByFn=trackBy&&$parse(trackBy),getTrackByValueFn=trackBy?function(value,locals){return trackByFn(scope,locals)}:function(value){return hashKey(value)},getTrackByValue=function(value,key){return getTrackByValueFn(value,getLocals(value,key))},displayFn=$parse(match[2]||match[1]),groupByFn=$parse(match[3]||""),disableWhenFn=$parse(match[4]||""),valuesFn=$parse(match[8]),locals={},getLocals=keyName?function(value,key){return locals[keyName]=key,locals[valueName]=value,locals}:function(value){return locals[valueName]=value,locals};return{trackBy:trackBy,getTrackByValue:getTrackByValue,getWatchables:$parse(valuesFn,function(optionValues){var watchedArray=[];optionValues=optionValues||[];for(var optionValuesKeys=getOptionValuesKeys(optionValues),optionValuesLength=optionValuesKeys.length,index=0;optionValuesLength>index;index++){var key=optionValues===optionValuesKeys?index:optionValuesKeys[index],locals=(optionValues[key],getLocals(optionValues[key],key)),selectValue=getTrackByValueFn(optionValues[key],locals);if(watchedArray.push(selectValue),match[2]||match[1]){var label=displayFn(scope,locals);watchedArray.push(label)}if(match[4]){var disableWhen=disableWhenFn(scope,locals);watchedArray.push(disableWhen)}}return watchedArray}),getOptions:function(){for(var optionItems=[],selectValueMap={},optionValues=valuesFn(scope)||[],optionValuesKeys=getOptionValuesKeys(optionValues),optionValuesLength=optionValuesKeys.length,index=0;optionValuesLength>index;index++){var key=optionValues===optionValuesKeys?index:optionValuesKeys[index],value=optionValues[key],locals=getLocals(value,key),viewValue=viewValueFn(scope,locals),selectValue=getTrackByValueFn(viewValue,locals),label=displayFn(scope,locals),group=groupByFn(scope,locals),disabled=disableWhenFn(scope,locals),optionItem=new Option(selectValue,viewValue,label,group,disabled);optionItems.push(optionItem),selectValueMap[selectValue]=optionItem}return{items:optionItems,selectValueMap:selectValueMap,getOptionFromViewValue:function(value){return selectValueMap[getTrackByValue(value)]},getViewValueFromOption:function(option){return trackBy?angular.copy(option.viewValue):option.viewValue}}}}}var optionTemplate=document.createElement("option"),optGroupTemplate=document.createElement("optgroup");return{restrict:"A",terminal:!0,require:["select","?ngModel"],link:function(scope,selectElement,attr,ctrls){function updateOptionElement(option,element){option.element=element,element.disabled=option.disabled,option.value!==element.value&&(element.value=option.selectValue),option.label!==element.label&&(element.label=option.label,element.textContent=option.label)}function addOrReuseElement(parent,current,type,templateElement){var element;return current&&lowercase(current.nodeName)===type?element=current:(element=templateElement.cloneNode(!1),current?parent.insertBefore(element,current):parent.appendChild(element)),element}function removeExcessElements(current){for(var next;current;)next=current.nextSibling,jqLiteRemove(current),current=next}function skipEmptyAndUnknownOptions(current){var emptyOption_=emptyOption&&emptyOption[0],unknownOption_=unknownOption&&unknownOption[0];if(emptyOption_||unknownOption_)for(;current&&(current===emptyOption_||current===unknownOption_);)current=current.nextSibling;return current}function updateOptions(){var previousValue=options&&selectCtrl.readValue();options=ngOptions.getOptions();var groupMap={},currentElement=selectElement[0].firstChild;if(providedEmptyOption&&selectElement.prepend(emptyOption),currentElement=skipEmptyAndUnknownOptions(currentElement),options.items.forEach(function(option){var group,groupElement,optionElement;option.group?(group=groupMap[option.group],group||(groupElement=addOrReuseElement(selectElement[0],currentElement,"optgroup",optGroupTemplate),currentElement=groupElement.nextSibling,groupElement.label=option.group,group=groupMap[option.group]={groupElement:groupElement,currentOptionElement:groupElement.firstChild}),optionElement=addOrReuseElement(group.groupElement,group.currentOptionElement,"option",optionTemplate),updateOptionElement(option,optionElement),group.currentOptionElement=optionElement.nextSibling):(optionElement=addOrReuseElement(selectElement[0],currentElement,"option",optionTemplate),updateOptionElement(option,optionElement),currentElement=optionElement.nextSibling)}),Object.keys(groupMap).forEach(function(key){removeExcessElements(groupMap[key].currentOptionElement)}),removeExcessElements(currentElement),ngModelCtrl.$render(),!ngModelCtrl.$isEmpty(previousValue)){var nextValue=selectCtrl.readValue();(ngOptions.trackBy?equals(previousValue,nextValue):previousValue===nextValue)||(ngModelCtrl.$setViewValue(nextValue),ngModelCtrl.$render())}}var ngModelCtrl=ctrls[1];if(ngModelCtrl){for(var emptyOption,selectCtrl=ctrls[0],multiple=attr.multiple,i=0,children=selectElement.children(),ii=children.length;ii>i;i++)if(""===children[i].value){emptyOption=children.eq(i);break}var providedEmptyOption=!!emptyOption,unknownOption=jqLite(optionTemplate.cloneNode(!1));unknownOption.val("?");var options,ngOptions=parseOptionsExpression(attr.ngOptions,selectElement,scope),renderEmptyOption=function(){providedEmptyOption||selectElement.prepend(emptyOption),selectElement.val(""),emptyOption.prop("selected",!0),emptyOption.attr("selected",!0)},removeEmptyOption=function(){providedEmptyOption||emptyOption.remove(); },renderUnknownOption=function(){selectElement.prepend(unknownOption),selectElement.val("?"),unknownOption.prop("selected",!0),unknownOption.attr("selected",!0)},removeUnknownOption=function(){unknownOption.remove()};multiple?(ngModelCtrl.$isEmpty=function(value){return!value||0===value.length},selectCtrl.writeValue=function(value){options.items.forEach(function(option){option.element.selected=!1}),value&&value.forEach(function(item){var option=options.getOptionFromViewValue(item);option&&!option.disabled&&(option.element.selected=!0)})},selectCtrl.readValue=function(){var selectedValues=selectElement.val()||[],selections=[];return forEach(selectedValues,function(value){var option=options.selectValueMap[value];option.disabled||selections.push(options.getViewValueFromOption(option))}),selections},ngOptions.trackBy&&scope.$watchCollection(function(){return isArray(ngModelCtrl.$viewValue)?ngModelCtrl.$viewValue.map(function(value){return ngOptions.getTrackByValue(value)}):void 0},function(){ngModelCtrl.$render()})):(selectCtrl.writeValue=function(value){var option=options.getOptionFromViewValue(value);option&&!option.disabled?selectElement[0].value!==option.selectValue&&(removeUnknownOption(),removeEmptyOption(),selectElement[0].value=option.selectValue,option.element.selected=!0,option.element.setAttribute("selected","selected")):null===value||providedEmptyOption?(removeUnknownOption(),renderEmptyOption()):(removeEmptyOption(),renderUnknownOption())},selectCtrl.readValue=function(){var selectedOption=options.selectValueMap[selectElement.val()];return selectedOption&&!selectedOption.disabled?(removeEmptyOption(),removeUnknownOption(),options.getViewValueFromOption(selectedOption)):null},ngOptions.trackBy&&scope.$watch(function(){return ngOptions.getTrackByValue(ngModelCtrl.$viewValue)},function(){ngModelCtrl.$render()})),providedEmptyOption?(emptyOption.remove(),$compile(emptyOption)(scope),emptyOption.removeClass("ng-scope")):emptyOption=jqLite(optionTemplate.cloneNode(!1)),updateOptions(),scope.$watchCollection(ngOptions.getWatchables,updateOptions)}}}}],ngPluralizeDirective=["$locale","$interpolate","$log",function($locale,$interpolate,$log){var BRACE=/{}/g,IS_WHEN=/^when(Minus)?(.+)$/;return{link:function(scope,element,attr){function updateElementText(newText){element.text(newText||"")}var lastCount,numberExp=attr.count,whenExp=attr.$attr.when&&element.attr(attr.$attr.when),offset=attr.offset||0,whens=scope.$eval(whenExp)||{},whensExpFns={},startSymbol=$interpolate.startSymbol(),endSymbol=$interpolate.endSymbol(),braceReplacement=startSymbol+numberExp+"-"+offset+endSymbol,watchRemover=angular.noop;forEach(attr,function(expression,attributeName){var tmpMatch=IS_WHEN.exec(attributeName);if(tmpMatch){var whenKey=(tmpMatch[1]?"-":"")+lowercase(tmpMatch[2]);whens[whenKey]=element.attr(attr.$attr[attributeName])}}),forEach(whens,function(expression,key){whensExpFns[key]=$interpolate(expression.replace(BRACE,braceReplacement))}),scope.$watch(numberExp,function(newVal){var count=parseFloat(newVal),countIsNaN=isNaN(count);if(countIsNaN||count in whens||(count=$locale.pluralCat(count-offset)),count!==lastCount&&!(countIsNaN&&isNumber(lastCount)&&isNaN(lastCount))){watchRemover();var whenExpFn=whensExpFns[count];isUndefined(whenExpFn)?(null!=newVal&&$log.debug("ngPluralize: no rule defined for '"+count+"' in "+whenExp),watchRemover=noop,updateElementText()):watchRemover=scope.$watch(whenExpFn,updateElementText),lastCount=count}})}}}],ngRepeatDirective=["$parse","$animate",function($parse,$animate){var NG_REMOVED="$$NG_REMOVED",ngRepeatMinErr=minErr("ngRepeat"),updateScope=function(scope,index,valueIdentifier,value,keyIdentifier,key,arrayLength){scope[valueIdentifier]=value,keyIdentifier&&(scope[keyIdentifier]=key),scope.$index=index,scope.$first=0===index,scope.$last=index===arrayLength-1,scope.$middle=!(scope.$first||scope.$last),scope.$odd=!(scope.$even=0===(1&index))},getBlockStart=function(block){return block.clone[0]},getBlockEnd=function(block){return block.clone[block.clone.length-1]};return{restrict:"A",multiElement:!0,transclude:"element",priority:1e3,terminal:!0,$$tlb:!0,compile:function($element,$attr){var expression=$attr.ngRepeat,ngRepeatEndComment=document.createComment(" end ngRepeat: "+expression+" "),match=expression.match(/^\s*([\s\S]+?)\s+in\s+([\s\S]+?)(?:\s+as\s+([\s\S]+?))?(?:\s+track\s+by\s+([\s\S]+?))?\s*$/);if(!match)throw ngRepeatMinErr("iexp","Expected expression in form of '_item_ in _collection_[ track by _id_]' but got '{0}'.",expression);var lhs=match[1],rhs=match[2],aliasAs=match[3],trackByExp=match[4];if(match=lhs.match(/^(?:(\s*[\$\w]+)|\(\s*([\$\w]+)\s*,\s*([\$\w]+)\s*\))$/),!match)throw ngRepeatMinErr("iidexp","'_item_' in '_item_ in _collection_' should be an identifier or '(_key_, _value_)' expression, but got '{0}'.",lhs);var valueIdentifier=match[3]||match[1],keyIdentifier=match[2];if(aliasAs&&(!/^[$a-zA-Z_][$a-zA-Z0-9_]*$/.test(aliasAs)||/^(null|undefined|this|\$index|\$first|\$middle|\$last|\$even|\$odd|\$parent|\$root|\$id)$/.test(aliasAs)))throw ngRepeatMinErr("badident","alias '{0}' is invalid --- must be a valid JS identifier which is not a reserved name.",aliasAs);var trackByExpGetter,trackByIdExpFn,trackByIdArrayFn,trackByIdObjFn,hashFnLocals={$id:hashKey};return trackByExp?trackByExpGetter=$parse(trackByExp):(trackByIdArrayFn=function(key,value){return hashKey(value)},trackByIdObjFn=function(key){return key}),function($scope,$element,$attr,ctrl,$transclude){trackByExpGetter&&(trackByIdExpFn=function(key,value,index){return keyIdentifier&&(hashFnLocals[keyIdentifier]=key),hashFnLocals[valueIdentifier]=value,hashFnLocals.$index=index,trackByExpGetter($scope,hashFnLocals)});var lastBlockMap=createMap();$scope.$watchCollection(rhs,function(collection){var index,length,nextNode,collectionLength,key,value,trackById,trackByIdFn,collectionKeys,block,nextBlockOrder,elementsToRemove,previousNode=$element[0],nextBlockMap=createMap();if(aliasAs&&($scope[aliasAs]=collection),isArrayLike(collection))collectionKeys=collection,trackByIdFn=trackByIdExpFn||trackByIdArrayFn;else{trackByIdFn=trackByIdExpFn||trackByIdObjFn,collectionKeys=[];for(var itemKey in collection)collection.hasOwnProperty(itemKey)&&"$"!==itemKey.charAt(0)&&collectionKeys.push(itemKey)}for(collectionLength=collectionKeys.length,nextBlockOrder=new Array(collectionLength),index=0;collectionLength>index;index++)if(key=collection===collectionKeys?index:collectionKeys[index],value=collection[key],trackById=trackByIdFn(key,value,index),lastBlockMap[trackById])block=lastBlockMap[trackById],delete lastBlockMap[trackById],nextBlockMap[trackById]=block,nextBlockOrder[index]=block;else{if(nextBlockMap[trackById])throw forEach(nextBlockOrder,function(block){block&&block.scope&&(lastBlockMap[block.id]=block)}),ngRepeatMinErr("dupes","Duplicates in a repeater are not allowed. Use 'track by' expression to specify unique keys. Repeater: {0}, Duplicate key: {1}, Duplicate value: {2}",expression,trackById,value);nextBlockOrder[index]={id:trackById,scope:undefined,clone:undefined},nextBlockMap[trackById]=!0}for(var blockKey in lastBlockMap){if(block=lastBlockMap[blockKey],elementsToRemove=getBlockNodes(block.clone),$animate.leave(elementsToRemove),elementsToRemove[0].parentNode)for(index=0,length=elementsToRemove.length;length>index;index++)elementsToRemove[index][NG_REMOVED]=!0;block.scope.$destroy()}for(index=0;collectionLength>index;index++)if(key=collection===collectionKeys?index:collectionKeys[index],value=collection[key],block=nextBlockOrder[index],block.scope){nextNode=previousNode;do nextNode=nextNode.nextSibling;while(nextNode&&nextNode[NG_REMOVED]);getBlockStart(block)!=nextNode&&$animate.move(getBlockNodes(block.clone),null,jqLite(previousNode)),previousNode=getBlockEnd(block),updateScope(block.scope,index,valueIdentifier,value,keyIdentifier,key,collectionLength)}else $transclude(function(clone,scope){block.scope=scope;var endNode=ngRepeatEndComment.cloneNode(!1);clone[clone.length++]=endNode,$animate.enter(clone,null,jqLite(previousNode)),previousNode=endNode,block.clone=clone,nextBlockMap[block.id]=block,updateScope(block.scope,index,valueIdentifier,value,keyIdentifier,key,collectionLength)});lastBlockMap=nextBlockMap})}}}}],NG_HIDE_CLASS="ng-hide",NG_HIDE_IN_PROGRESS_CLASS="ng-hide-animate",ngShowDirective=["$animate",function($animate){return{restrict:"A",multiElement:!0,link:function(scope,element,attr){scope.$watch(attr.ngShow,function(value){$animate[value?"removeClass":"addClass"](element,NG_HIDE_CLASS,{tempClasses:NG_HIDE_IN_PROGRESS_CLASS})})}}}],ngHideDirective=["$animate",function($animate){return{restrict:"A",multiElement:!0,link:function(scope,element,attr){scope.$watch(attr.ngHide,function(value){$animate[value?"addClass":"removeClass"](element,NG_HIDE_CLASS,{tempClasses:NG_HIDE_IN_PROGRESS_CLASS})})}}}],ngStyleDirective=ngDirective(function(scope,element,attr){scope.$watch(attr.ngStyle,function(newStyles,oldStyles){oldStyles&&newStyles!==oldStyles&&forEach(oldStyles,function(val,style){element.css(style,"")}),newStyles&&element.css(newStyles)},!0)}),ngSwitchDirective=["$animate",function($animate){return{require:"ngSwitch",controller:["$scope",function(){this.cases={}}],link:function(scope,element,attr,ngSwitchController){var watchExpr=attr.ngSwitch||attr.on,selectedTranscludes=[],selectedElements=[],previousLeaveAnimations=[],selectedScopes=[],spliceFactory=function(array,index){return function(){array.splice(index,1)}};scope.$watch(watchExpr,function(value){var i,ii;for(i=0,ii=previousLeaveAnimations.length;ii>i;++i)$animate.cancel(previousLeaveAnimations[i]);for(previousLeaveAnimations.length=0,i=0,ii=selectedScopes.length;ii>i;++i){var selected=getBlockNodes(selectedElements[i].clone);selectedScopes[i].$destroy();var promise=previousLeaveAnimations[i]=$animate.leave(selected);promise.then(spliceFactory(previousLeaveAnimations,i))}selectedElements.length=0,selectedScopes.length=0,(selectedTranscludes=ngSwitchController.cases["!"+value]||ngSwitchController.cases["?"])&&forEach(selectedTranscludes,function(selectedTransclude){selectedTransclude.transclude(function(caseElement,selectedScope){selectedScopes.push(selectedScope);var anchor=selectedTransclude.element;caseElement[caseElement.length++]=document.createComment(" end ngSwitchWhen: ");var block={clone:caseElement};selectedElements.push(block),$animate.enter(caseElement,anchor.parent(),anchor)})})})}}}],ngSwitchWhenDirective=ngDirective({transclude:"element",priority:1200,require:"^ngSwitch",multiElement:!0,link:function(scope,element,attrs,ctrl,$transclude){ctrl.cases["!"+attrs.ngSwitchWhen]=ctrl.cases["!"+attrs.ngSwitchWhen]||[],ctrl.cases["!"+attrs.ngSwitchWhen].push({transclude:$transclude,element:element})}}),ngSwitchDefaultDirective=ngDirective({transclude:"element",priority:1200,require:"^ngSwitch",multiElement:!0,link:function(scope,element,attr,ctrl,$transclude){ctrl.cases["?"]=ctrl.cases["?"]||[],ctrl.cases["?"].push({transclude:$transclude,element:element})}}),ngTranscludeDirective=ngDirective({restrict:"EAC",link:function($scope,$element,$attrs,controller,$transclude){if(!$transclude)throw minErr("ngTransclude")("orphan","Illegal use of ngTransclude directive in the template! No parent directive that requires a transclusion found. Element: {0}",startingTag($element));$transclude(function(clone){$element.empty(),$element.append(clone)})}}),scriptDirective=["$templateCache",function($templateCache){return{restrict:"E",terminal:!0,compile:function(element,attr){if("text/ng-template"==attr.type){var templateUrl=attr.id,text=element[0].text;$templateCache.put(templateUrl,text)}}}}],noopNgModelController={$setViewValue:noop,$render:noop},SelectController=["$element","$scope","$attrs",function($element,$scope,$attrs){var self=this,optionsMap=new HashMap;self.ngModelCtrl=noopNgModelController,self.unknownOption=jqLite(document.createElement("option")),self.renderUnknownOption=function(val){var unknownVal="? "+hashKey(val)+" ?";self.unknownOption.val(unknownVal),$element.prepend(self.unknownOption),$element.val(unknownVal)},$scope.$on("$destroy",function(){self.renderUnknownOption=noop}),self.removeUnknownOption=function(){self.unknownOption.parent()&&self.unknownOption.remove()},self.readValue=function(){return self.removeUnknownOption(),$element.val()},self.writeValue=function(value){self.hasOption(value)?(self.removeUnknownOption(),$element.val(value),""===value&&self.emptyOption.prop("selected",!0)):null==value&&self.emptyOption?(self.removeUnknownOption(),$element.val("")):self.renderUnknownOption(value)},self.addOption=function(value,element){assertNotHasOwnProperty(value,'"option value"'),""===value&&(self.emptyOption=element);var count=optionsMap.get(value)||0;optionsMap.put(value,count+1)},self.removeOption=function(value){var count=optionsMap.get(value);count&&(1===count?(optionsMap.remove(value),""===value&&(self.emptyOption=undefined)):optionsMap.put(value,count-1))},self.hasOption=function(value){return!!optionsMap.get(value)}}],selectDirective=function(){return{restrict:"E",require:["select","?ngModel"],controller:SelectController,link:function(scope,element,attr,ctrls){var ngModelCtrl=ctrls[1];if(ngModelCtrl){var selectCtrl=ctrls[0];if(selectCtrl.ngModelCtrl=ngModelCtrl,ngModelCtrl.$render=function(){selectCtrl.writeValue(ngModelCtrl.$viewValue)},element.on("change",function(){scope.$apply(function(){ngModelCtrl.$setViewValue(selectCtrl.readValue())})}),attr.multiple){selectCtrl.readValue=function(){var array=[];return forEach(element.find("option"),function(option){option.selected&&array.push(option.value)}),array},selectCtrl.writeValue=function(value){var items=new HashMap(value);forEach(element.find("option"),function(option){option.selected=isDefined(items.get(option.value))})};var lastView,lastViewRef=0/0;scope.$watch(function(){lastViewRef!==ngModelCtrl.$viewValue||equals(lastView,ngModelCtrl.$viewValue)||(lastView=shallowCopy(ngModelCtrl.$viewValue),ngModelCtrl.$render()),lastViewRef=ngModelCtrl.$viewValue}),ngModelCtrl.$isEmpty=function(value){return!value||0===value.length}}}}}},optionDirective=["$interpolate",function($interpolate){function chromeHack(optionElement){optionElement[0].hasAttribute("selected")&&(optionElement[0].selected=!0)}return{restrict:"E",priority:100,compile:function(element,attr){if(isUndefined(attr.value)){var interpolateFn=$interpolate(element.text(),!0);interpolateFn||attr.$set("value",element.text())}return function(scope,element,attr){var selectCtrlName="$selectController",parent=element.parent(),selectCtrl=parent.data(selectCtrlName)||parent.parent().data(selectCtrlName);selectCtrl&&selectCtrl.ngModelCtrl&&(interpolateFn?scope.$watch(interpolateFn,function(newVal,oldVal){attr.$set("value",newVal),oldVal!==newVal&&selectCtrl.removeOption(oldVal),selectCtrl.addOption(newVal,element),selectCtrl.ngModelCtrl.$render(),chromeHack(element)}):(selectCtrl.addOption(attr.value,element),selectCtrl.ngModelCtrl.$render(),chromeHack(element)),element.on("$destroy",function(){selectCtrl.removeOption(attr.value),selectCtrl.ngModelCtrl.$render()}))}}}}],styleDirective=valueFn({restrict:"E",terminal:!1}),requiredDirective=function(){return{restrict:"A",require:"?ngModel",link:function(scope,elm,attr,ctrl){ctrl&&(attr.required=!0,ctrl.$validators.required=function(modelValue,viewValue){return!attr.required||!ctrl.$isEmpty(viewValue)},attr.$observe("required",function(){ctrl.$validate()}))}}},patternDirective=function(){return{restrict:"A",require:"?ngModel",link:function(scope,elm,attr,ctrl){if(ctrl){var regexp,patternExp=attr.ngPattern||attr.pattern;attr.$observe("pattern",function(regex){if(isString(regex)&&regex.length>0&&(regex=new RegExp("^"+regex+"$")),regex&&!regex.test)throw minErr("ngPattern")("noregexp","Expected {0} to be a RegExp but was {1}. Element: {2}",patternExp,regex,startingTag(elm));regexp=regex||undefined,ctrl.$validate()}),ctrl.$validators.pattern=function(value){return ctrl.$isEmpty(value)||isUndefined(regexp)||regexp.test(value)}}}}},maxlengthDirective=function(){return{restrict:"A",require:"?ngModel",link:function(scope,elm,attr,ctrl){if(ctrl){var maxlength=-1;attr.$observe("maxlength",function(value){var intVal=toInt(value);maxlength=isNaN(intVal)?-1:intVal,ctrl.$validate()}),ctrl.$validators.maxlength=function(modelValue,viewValue){return 0>maxlength||ctrl.$isEmpty(viewValue)||viewValue.length<=maxlength}}}}},minlengthDirective=function(){return{restrict:"A",require:"?ngModel",link:function(scope,elm,attr,ctrl){if(ctrl){var minlength=0;attr.$observe("minlength",function(value){minlength=toInt(value)||0,ctrl.$validate()}),ctrl.$validators.minlength=function(modelValue,viewValue){return ctrl.$isEmpty(viewValue)||viewValue.length>=minlength}}}}};return window.angular.bootstrap?void console.log("WARNING: Tried to load angular more than once."):(bindJQuery(),publishExternalAPI(angular),void jqLite(document).ready(function(){angularInit(document,bootstrap)}))}(window,document),!window.angular.$$csp()&&window.angular.element(document.head).prepend('<style type="text/css">@charset "UTF-8";[ng\\:cloak],[ng-cloak],[data-ng-cloak],[x-ng-cloak],.ng-cloak,.x-ng-cloak,.ng-hide:not(.ng-hide-animate){display:none !important;}ng\\:form{display:block;}.ng-animate-shim{visibility:hidden;}.ng-anchor{position:absolute;}</style>'),function(){var initializing=!1,fnTest=/xyz/.test(function(){xyz})?/\b_super\b/:/.*/;this.Class=function(){},Class.extend=function(prop){function Class(){!initializing&&this.init&&this.init.apply(this,arguments)}var _super=this.prototype;initializing=!0;var prototype=new this;initializing=!1;for(var name in prop)prototype[name]="function"==typeof prop[name]&&"function"==typeof _super[name]&&fnTest.test(prop[name])?function(name,fn){return function(){var tmp=this._super;this._super=_super[name];var ret=fn.apply(this,arguments);return this._super=tmp,ret}}(name,prop[name]):prop[name];return Class.prototype=prototype,Class.prototype.constructor=Class,Class.extend=arguments.callee,Class}}(),function(){"use strict";function FastClick(layer,options){function bind(method,context){return function(){return method.apply(context,arguments)}}var oldOnClick;if(options=options||{},this.trackingClick=!1,this.trackingClickStart=0,this.targetElement=null,this.touchStartX=0,this.touchStartY=0,this.lastTouchIdentifier=0,this.touchBoundary=options.touchBoundary||10,this.layer=layer,this.tapDelay=options.tapDelay||200,this.tapTimeout=options.tapTimeout||700,!FastClick.notNeeded(layer)){for(var methods=["onMouse","onClick","onTouchStart","onTouchMove","onTouchEnd","onTouchCancel"],context=this,i=0,l=methods.length;l>i;i++)context[methods[i]]=bind(context[methods[i]],context);deviceIsAndroid&&(layer.addEventListener("mouseover",this.onMouse,!0),layer.addEventListener("mousedown",this.onMouse,!0),layer.addEventListener("mouseup",this.onMouse,!0)),layer.addEventListener("click",this.onClick,!0),layer.addEventListener("touchstart",this.onTouchStart,!1),layer.addEventListener("touchmove",this.onTouchMove,!1),layer.addEventListener("touchend",this.onTouchEnd,!1),layer.addEventListener("touchcancel",this.onTouchCancel,!1),Event.prototype.stopImmediatePropagation||(layer.removeEventListener=function(type,callback,capture){var rmv=Node.prototype.removeEventListener;"click"===type?rmv.call(layer,type,callback.hijacked||callback,capture):rmv.call(layer,type,callback,capture)},layer.addEventListener=function(type,callback,capture){var adv=Node.prototype.addEventListener;"click"===type?adv.call(layer,type,callback.hijacked||(callback.hijacked=function(event){event.propagationStopped||callback(event)}),capture):adv.call(layer,type,callback,capture)}),"function"==typeof layer.onclick&&(oldOnClick=layer.onclick,layer.addEventListener("click",function(event){oldOnClick(event)},!1),layer.onclick=null)}}var deviceIsWindowsPhone=navigator.userAgent.indexOf("Windows Phone")>=0,deviceIsAndroid=navigator.userAgent.indexOf("Android")>0&&!deviceIsWindowsPhone,deviceIsIOS=/iP(ad|hone|od)/.test(navigator.userAgent)&&!deviceIsWindowsPhone,deviceIsIOS4=deviceIsIOS&&/OS 4_\d(_\d)?/.test(navigator.userAgent),deviceIsIOSWithBadTarget=deviceIsIOS&&/OS [6-7]_\d/.test(navigator.userAgent),deviceIsBlackBerry10=navigator.userAgent.indexOf("BB10")>0;FastClick.prototype.needsClick=function(target){switch(target.nodeName.toLowerCase()){case"button":case"select":case"textarea":if(target.disabled)return!0;break;case"input":if(deviceIsIOS&&"file"===target.type||target.disabled)return!0;break;case"label":case"iframe":case"video":return!0}return/\bneedsclick\b/.test(target.className)},FastClick.prototype.needsFocus=function(target){switch(target.nodeName.toLowerCase()){case"textarea":return!0;case"select":return!deviceIsAndroid;case"input":switch(target.type){case"button":case"checkbox":case"file":case"image":case"radio":case"submit":return!1}return!target.disabled&&!target.readOnly;default:return/\bneedsfocus\b/.test(target.className)}},FastClick.prototype.sendClick=function(targetElement,event){var clickEvent,touch;document.activeElement&&document.activeElement!==targetElement&&document.activeElement.blur(),touch=event.changedTouches[0],clickEvent=document.createEvent("MouseEvents"),clickEvent.initMouseEvent(this.determineEventType(targetElement),!0,!0,window,1,touch.screenX,touch.screenY,touch.clientX,touch.clientY,!1,!1,!1,!1,0,null),clickEvent.forwardedTouchEvent=!0,targetElement.dispatchEvent(clickEvent)},FastClick.prototype.determineEventType=function(targetElement){return deviceIsAndroid&&"select"===targetElement.tagName.toLowerCase()?"mousedown":"click"},FastClick.prototype.focus=function(targetElement){var length;deviceIsIOS&&targetElement.setSelectionRange&&0!==targetElement.type.indexOf("date")&&"time"!==targetElement.type&&"month"!==targetElement.type?(length=targetElement.value.length,targetElement.setSelectionRange(length,length)):targetElement.focus()},FastClick.prototype.updateScrollParent=function(targetElement){var scrollParent,parentElement;if(scrollParent=targetElement.fastClickScrollParent,!scrollParent||!scrollParent.contains(targetElement)){parentElement=targetElement;do{if(parentElement.scrollHeight>parentElement.offsetHeight){scrollParent=parentElement,targetElement.fastClickScrollParent=parentElement;break}parentElement=parentElement.parentElement}while(parentElement)}scrollParent&&(scrollParent.fastClickLastScrollTop=scrollParent.scrollTop)},FastClick.prototype.getTargetElementFromEventTarget=function(eventTarget){return eventTarget.nodeType===Node.TEXT_NODE?eventTarget.parentNode:eventTarget},FastClick.prototype.onTouchStart=function(event){var targetElement,touch,selection;if(event.targetTouches.length>1)return!0;if(targetElement=this.getTargetElementFromEventTarget(event.target),touch=event.targetTouches[0],deviceIsIOS){if(selection=window.getSelection(),selection.rangeCount&&!selection.isCollapsed)return!0;if(!deviceIsIOS4){if(touch.identifier&&touch.identifier===this.lastTouchIdentifier)return event.preventDefault(),!1;this.lastTouchIdentifier=touch.identifier,this.updateScrollParent(targetElement)}}return this.trackingClick=!0,this.trackingClickStart=event.timeStamp,this.targetElement=targetElement,this.touchStartX=touch.pageX,this.touchStartY=touch.pageY,event.timeStamp-this.lastClickTime<this.tapDelay&&event.timeStamp-this.lastClickTime>-1&&event.preventDefault(),!0},FastClick.prototype.touchHasMoved=function(event){var touch=event.changedTouches[0],boundary=this.touchBoundary;return Math.abs(touch.pageX-this.touchStartX)>boundary||Math.abs(touch.pageY-this.touchStartY)>boundary?!0:!1},FastClick.prototype.onTouchMove=function(event){return this.trackingClick?((this.targetElement!==this.getTargetElementFromEventTarget(event.target)||this.touchHasMoved(event))&&(this.trackingClick=!1,this.targetElement=null),!0):!0},FastClick.prototype.findControl=function(labelElement){return void 0!==labelElement.control?labelElement.control:labelElement.htmlFor?document.getElementById(labelElement.htmlFor):labelElement.querySelector("button, input:not([type=hidden]), keygen, meter, output, progress, select, textarea")},FastClick.prototype.onTouchEnd=function(event){var forElement,trackingClickStart,targetTagName,scrollParent,touch,targetElement=this.targetElement;if(!this.trackingClick)return!0;if(event.timeStamp-this.lastClickTime<this.tapDelay&&event.timeStamp-this.lastClickTime>-1)return this.cancelNextClick=!0,!0;if(event.timeStamp-this.trackingClickStart>this.tapTimeout)return!0;if(this.cancelNextClick=!1,this.lastClickTime=event.timeStamp,trackingClickStart=this.trackingClickStart,this.trackingClick=!1,this.trackingClickStart=0,deviceIsIOSWithBadTarget&&(touch=event.changedTouches[0],targetElement=document.elementFromPoint(touch.pageX-window.pageXOffset,touch.pageY-window.pageYOffset)||targetElement,targetElement.fastClickScrollParent=this.targetElement.fastClickScrollParent),targetTagName=targetElement.tagName.toLowerCase(),"label"===targetTagName){if(forElement=this.findControl(targetElement)){if(this.focus(targetElement),deviceIsAndroid)return!1;targetElement=forElement}}else if(this.needsFocus(targetElement))return event.timeStamp-trackingClickStart>100||deviceIsIOS&&window.top!==window&&"input"===targetTagName?(this.targetElement=null,!1):(this.focus(targetElement),this.sendClick(targetElement,event),deviceIsIOS&&"select"===targetTagName||(this.targetElement=null,event.preventDefault()),!1);return deviceIsIOS&&!deviceIsIOS4&&(scrollParent=targetElement.fastClickScrollParent,scrollParent&&scrollParent.fastClickLastScrollTop!==scrollParent.scrollTop)?!0:(this.needsClick(targetElement)||(event.preventDefault(),this.sendClick(targetElement,event)),!1)},FastClick.prototype.onTouchCancel=function(){this.trackingClick=!1,this.targetElement=null},FastClick.prototype.onMouse=function(event){return this.targetElement?event.forwardedTouchEvent?!0:event.cancelable&&(!this.needsClick(this.targetElement)||this.cancelNextClick)?(event.stopImmediatePropagation?event.stopImmediatePropagation():event.propagationStopped=!0,event.stopPropagation(),event.preventDefault(),!1):!0:!0},FastClick.prototype.onClick=function(event){var permitted;return this.trackingClick?(this.targetElement=null,this.trackingClick=!1,!0):"submit"===event.target.type&&0===event.detail?!0:(permitted=this.onMouse(event),permitted||(this.targetElement=null),permitted)},FastClick.prototype.destroy=function(){var layer=this.layer;deviceIsAndroid&&(layer.removeEventListener("mouseover",this.onMouse,!0),layer.removeEventListener("mousedown",this.onMouse,!0),layer.removeEventListener("mouseup",this.onMouse,!0)),layer.removeEventListener("click",this.onClick,!0),layer.removeEventListener("touchstart",this.onTouchStart,!1),layer.removeEventListener("touchmove",this.onTouchMove,!1),layer.removeEventListener("touchend",this.onTouchEnd,!1),layer.removeEventListener("touchcancel",this.onTouchCancel,!1)},FastClick.notNeeded=function(layer){var metaViewport,chromeVersion,blackberryVersion,firefoxVersion;if("undefined"==typeof window.ontouchstart)return!0;if(chromeVersion=+(/Chrome\/([0-9]+)/.exec(navigator.userAgent)||[,0])[1]){if(!deviceIsAndroid)return!0;if(metaViewport=document.querySelector("meta[name=viewport]")){if(-1!==metaViewport.content.indexOf("user-scalable=no"))return!0;if(chromeVersion>31&&document.documentElement.scrollWidth<=window.outerWidth)return!0}}if(deviceIsBlackBerry10&&(blackberryVersion=navigator.userAgent.match(/Version\/([0-9]*)\.([0-9]*)/),blackberryVersion[1]>=10&&blackberryVersion[2]>=3&&(metaViewport=document.querySelector("meta[name=viewport]")))){if(-1!==metaViewport.content.indexOf("user-scalable=no"))return!0;if(document.documentElement.scrollWidth<=window.outerWidth)return!0}return"none"===layer.style.msTouchAction||"manipulation"===layer.style.touchAction?!0:(firefoxVersion=+(/Firefox\/([0-9]+)/.exec(navigator.userAgent)||[,0])[1],firefoxVersion>=27&&(metaViewport=document.querySelector("meta[name=viewport]"),metaViewport&&(-1!==metaViewport.content.indexOf("user-scalable=no")||document.documentElement.scrollWidth<=window.outerWidth))?!0:"none"===layer.style.touchAction||"manipulation"===layer.style.touchAction?!0:!1)},FastClick.attach=function(layer,options){return new FastClick(layer,options)},"function"==typeof define&&"object"==typeof define.amd&&define.amd?define(function(){return FastClick}):"undefined"!=typeof module&&module.exports?(module.exports=FastClick.attach,module.exports.FastClick=FastClick):window.FastClick=FastClick}(),function(window,undefined){"use strict";function setup(){Hammer.READY||(Event.determineEventTypes(),Utils.each(Hammer.gestures,function(gesture){Detection.register(gesture)}),Event.onTouch(Hammer.DOCUMENT,EVENT_MOVE,Detection.detect),Event.onTouch(Hammer.DOCUMENT,EVENT_END,Detection.detect),Hammer.READY=!0)}var Hammer=function Hammer(element,options){return new Hammer.Instance(element,options||{})};Hammer.VERSION="1.1.3",Hammer.defaults={behavior:{userSelect:"none",touchAction:"pan-y",touchCallout:"none",contentZooming:"none",userDrag:"none",tapHighlightColor:"rgba(0,0,0,0)"}},Hammer.DOCUMENT=document,Hammer.HAS_POINTEREVENTS=navigator.pointerEnabled||navigator.msPointerEnabled,Hammer.HAS_TOUCHEVENTS="ontouchstart"in window,Hammer.IS_MOBILE=/mobile|tablet|ip(ad|hone|od)|android|silk/i.test(navigator.userAgent),Hammer.NO_MOUSEEVENTS=Hammer.HAS_TOUCHEVENTS&&Hammer.IS_MOBILE||Hammer.HAS_POINTEREVENTS,Hammer.CALCULATE_INTERVAL=25;var EVENT_TYPES={},DIRECTION_DOWN=Hammer.DIRECTION_DOWN="down",DIRECTION_LEFT=Hammer.DIRECTION_LEFT="left",DIRECTION_UP=Hammer.DIRECTION_UP="up",DIRECTION_RIGHT=Hammer.DIRECTION_RIGHT="right",POINTER_MOUSE=Hammer.POINTER_MOUSE="mouse",POINTER_TOUCH=Hammer.POINTER_TOUCH="touch",POINTER_PEN=Hammer.POINTER_PEN="pen",EVENT_START=Hammer.EVENT_START="start",EVENT_MOVE=Hammer.EVENT_MOVE="move",EVENT_END=Hammer.EVENT_END="end",EVENT_RELEASE=Hammer.EVENT_RELEASE="release",EVENT_TOUCH=Hammer.EVENT_TOUCH="touch";Hammer.READY=!1,Hammer.plugins=Hammer.plugins||{},Hammer.gestures=Hammer.gestures||{};var Utils=Hammer.utils={extend:function(dest,src,merge){for(var key in src)!src.hasOwnProperty(key)||dest[key]!==undefined&&merge||(dest[key]=src[key]);return dest},on:function(element,type,handler){element.addEventListener(type,handler,!1)},off:function(element,type,handler){element.removeEventListener(type,handler,!1)},each:function(obj,iterator,context){var i,len;if("forEach"in obj)obj.forEach(iterator,context);else if(obj.length!==undefined){for(i=0,len=obj.length;len>i;i++)if(iterator.call(context,obj[i],i,obj)===!1)return}else for(i in obj)if(obj.hasOwnProperty(i)&&iterator.call(context,obj[i],i,obj)===!1)return},inStr:function(src,find){return src.indexOf(find)>-1},inArray:function(src,find){if(src.indexOf){var index=src.indexOf(find);return-1===index?!1:index}for(var i=0,len=src.length;len>i;i++)if(src[i]===find)return i;return!1},toArray:function(obj){return Array.prototype.slice.call(obj,0)},hasParent:function(node,parent){for(;node;){if(node==parent)return!0;node=node.parentNode}return!1},getCenter:function(touches){var pageX=[],pageY=[],clientX=[],clientY=[],min=Math.min,max=Math.max;return 1===touches.length?{pageX:touches[0].pageX,pageY:touches[0].pageY,clientX:touches[0].clientX,clientY:touches[0].clientY}:(Utils.each(touches,function(touch){pageX.push(touch.pageX),pageY.push(touch.pageY),clientX.push(touch.clientX),clientY.push(touch.clientY)}),{pageX:(min.apply(Math,pageX)+max.apply(Math,pageX))/2,pageY:(min.apply(Math,pageY)+max.apply(Math,pageY))/2,clientX:(min.apply(Math,clientX)+max.apply(Math,clientX))/2,clientY:(min.apply(Math,clientY)+max.apply(Math,clientY))/2})},getVelocity:function(deltaTime,deltaX,deltaY){return{x:Math.abs(deltaX/deltaTime)||0,y:Math.abs(deltaY/deltaTime)||0}},getAngle:function(touch1,touch2){var x=touch2.clientX-touch1.clientX,y=touch2.clientY-touch1.clientY;return 180*Math.atan2(y,x)/Math.PI},getDirection:function(touch1,touch2){var x=Math.abs(touch1.clientX-touch2.clientX),y=Math.abs(touch1.clientY-touch2.clientY); return x>=y?touch1.clientX-touch2.clientX>0?DIRECTION_LEFT:DIRECTION_RIGHT:touch1.clientY-touch2.clientY>0?DIRECTION_UP:DIRECTION_DOWN},getDistance:function(touch1,touch2){var x=touch2.clientX-touch1.clientX,y=touch2.clientY-touch1.clientY;return Math.sqrt(x*x+y*y)},getScale:function(start,end){return start.length>=2&&end.length>=2?this.getDistance(end[0],end[1])/this.getDistance(start[0],start[1]):1},getRotation:function(start,end){return start.length>=2&&end.length>=2?this.getAngle(end[1],end[0])-this.getAngle(start[1],start[0]):0},isVertical:function(direction){return direction==DIRECTION_UP||direction==DIRECTION_DOWN},setPrefixedCss:function(element,prop,value,toggle){var prefixes=["","Webkit","Moz","O","ms"];prop=Utils.toCamelCase(prop);for(var i=0;i<prefixes.length;i++){var p=prop;if(prefixes[i]&&(p=prefixes[i]+p.slice(0,1).toUpperCase()+p.slice(1)),p in element.style){element.style[p]=(null==toggle||toggle)&&value||"";break}}},toggleBehavior:function(element,props,toggle){if(props&&element&&element.style){Utils.each(props,function(value,prop){Utils.setPrefixedCss(element,prop,value,toggle)});var falseFn=toggle&&function(){return!1};"none"==props.userSelect&&(element.onselectstart=falseFn),"none"==props.userDrag&&(element.ondragstart=falseFn)}},toCamelCase:function(str){return str.replace(/[_-]([a-z])/g,function(s){return s[1].toUpperCase()})}},Event=Hammer.event={preventMouseEvents:!1,started:!1,shouldDetect:!1,on:function(element,type,handler,hook){var types=type.split(" ");Utils.each(types,function(type){Utils.on(element,type,handler),hook&&hook(type)})},off:function(element,type,handler,hook){var types=type.split(" ");Utils.each(types,function(type){Utils.off(element,type,handler),hook&&hook(type)})},onTouch:function(element,eventType,handler){var self=this,onTouchHandler=function(ev){var triggerType,srcType=ev.type.toLowerCase(),isPointer=Hammer.HAS_POINTEREVENTS,isMouse=Utils.inStr(srcType,"mouse");isMouse&&self.preventMouseEvents||(isMouse&&eventType==EVENT_START&&0===ev.button?(self.preventMouseEvents=!1,self.shouldDetect=!0):isPointer&&eventType==EVENT_START?self.shouldDetect=1===ev.buttons||PointerEvent.matchType(POINTER_TOUCH,ev):isMouse||eventType!=EVENT_START||(self.preventMouseEvents=!0,self.shouldDetect=!0),isPointer&&eventType!=EVENT_END&&PointerEvent.updatePointer(eventType,ev),self.shouldDetect&&(triggerType=self.doDetect.call(self,ev,eventType,element,handler)),triggerType==EVENT_END&&(self.preventMouseEvents=!1,self.shouldDetect=!1,PointerEvent.reset()),isPointer&&eventType==EVENT_END&&PointerEvent.updatePointer(eventType,ev))};return this.on(element,EVENT_TYPES[eventType],onTouchHandler),onTouchHandler},doDetect:function(ev,eventType,element,handler){var touchList=this.getTouchList(ev,eventType),touchListLength=touchList.length,triggerType=eventType,triggerChange=touchList.trigger,changedLength=touchListLength;eventType==EVENT_START?triggerChange=EVENT_TOUCH:eventType==EVENT_END&&(triggerChange=EVENT_RELEASE,changedLength=touchList.length-(ev.changedTouches?ev.changedTouches.length:1)),changedLength>0&&this.started&&(triggerType=EVENT_MOVE),this.started=!0;var evData=this.collectEventData(element,triggerType,touchList,ev);return eventType!=EVENT_END&&handler.call(Detection,evData),triggerChange&&(evData.changedLength=changedLength,evData.eventType=triggerChange,handler.call(Detection,evData),evData.eventType=triggerType,delete evData.changedLength),triggerType==EVENT_END&&(handler.call(Detection,evData),this.started=!1),triggerType},determineEventTypes:function(){var types;return types=Hammer.HAS_POINTEREVENTS?window.PointerEvent?["pointerdown","pointermove","pointerup pointercancel lostpointercapture"]:["MSPointerDown","MSPointerMove","MSPointerUp MSPointerCancel MSLostPointerCapture"]:Hammer.NO_MOUSEEVENTS?["touchstart","touchmove","touchend touchcancel"]:["touchstart mousedown","touchmove mousemove","touchend touchcancel mouseup"],EVENT_TYPES[EVENT_START]=types[0],EVENT_TYPES[EVENT_MOVE]=types[1],EVENT_TYPES[EVENT_END]=types[2],EVENT_TYPES},getTouchList:function(ev,eventType){if(Hammer.HAS_POINTEREVENTS)return PointerEvent.getTouchList();if(ev.touches){if(eventType==EVENT_MOVE)return ev.touches;var identifiers=[],concat=[].concat(Utils.toArray(ev.touches),Utils.toArray(ev.changedTouches)),touchList=[];return Utils.each(concat,function(touch){Utils.inArray(identifiers,touch.identifier)===!1&&touchList.push(touch),identifiers.push(touch.identifier)}),touchList}return ev.identifier=1,[ev]},collectEventData:function(element,eventType,touches,ev){var pointerType=POINTER_TOUCH;return Utils.inStr(ev.type,"mouse")||PointerEvent.matchType(POINTER_MOUSE,ev)?pointerType=POINTER_MOUSE:PointerEvent.matchType(POINTER_PEN,ev)&&(pointerType=POINTER_PEN),{center:Utils.getCenter(touches),timeStamp:Date.now(),target:ev.target,touches:touches,eventType:eventType,pointerType:pointerType,srcEvent:ev,preventDefault:function(){var srcEvent=this.srcEvent;srcEvent.preventManipulation&&srcEvent.preventManipulation(),srcEvent.preventDefault&&srcEvent.preventDefault()},stopPropagation:function(){this.srcEvent.stopPropagation()},stopDetect:function(){return Detection.stopDetect()}}}},PointerEvent=Hammer.PointerEvent={pointers:{},getTouchList:function(){var touchlist=[];return Utils.each(this.pointers,function(pointer){touchlist.push(pointer)}),touchlist},updatePointer:function(eventType,pointerEvent){eventType==EVENT_END||eventType!=EVENT_END&&1!==pointerEvent.buttons?delete this.pointers[pointerEvent.pointerId]:(pointerEvent.identifier=pointerEvent.pointerId,this.pointers[pointerEvent.pointerId]=pointerEvent)},matchType:function(pointerType,ev){if(!ev.pointerType)return!1;var pt=ev.pointerType,types={};return types[POINTER_MOUSE]=pt===(ev.MSPOINTER_TYPE_MOUSE||POINTER_MOUSE),types[POINTER_TOUCH]=pt===(ev.MSPOINTER_TYPE_TOUCH||POINTER_TOUCH),types[POINTER_PEN]=pt===(ev.MSPOINTER_TYPE_PEN||POINTER_PEN),types[pointerType]},reset:function(){this.pointers={}}},Detection=Hammer.detection={gestures:[],current:null,previous:null,stopped:!1,startDetect:function(inst,eventData){this.current||(this.stopped=!1,this.current={inst:inst,startEvent:Utils.extend({},eventData),lastEvent:!1,lastCalcEvent:!1,futureCalcEvent:!1,lastCalcData:{},name:""},this.detect(eventData))},detect:function(eventData){if(this.current&&!this.stopped){eventData=this.extendEventData(eventData);var inst=this.current.inst,instOptions=inst.options;return Utils.each(this.gestures,function(gesture){!this.stopped&&inst.enabled&&instOptions[gesture.name]&&gesture.handler.call(gesture,eventData,inst)},this),this.current&&(this.current.lastEvent=eventData),eventData.eventType==EVENT_END&&this.stopDetect(),eventData}},stopDetect:function(){this.previous=Utils.extend({},this.current),this.current=null,this.stopped=!0},getCalculatedData:function(ev,center,deltaTime,deltaX,deltaY){var cur=this.current,recalc=!1,calcEv=cur.lastCalcEvent,calcData=cur.lastCalcData;calcEv&&ev.timeStamp-calcEv.timeStamp>Hammer.CALCULATE_INTERVAL&&(center=calcEv.center,deltaTime=ev.timeStamp-calcEv.timeStamp,deltaX=ev.center.clientX-calcEv.center.clientX,deltaY=ev.center.clientY-calcEv.center.clientY,recalc=!0),(ev.eventType==EVENT_TOUCH||ev.eventType==EVENT_RELEASE)&&(cur.futureCalcEvent=ev),(!cur.lastCalcEvent||recalc)&&(calcData.velocity=Utils.getVelocity(deltaTime,deltaX,deltaY),calcData.angle=Utils.getAngle(center,ev.center),calcData.direction=Utils.getDirection(center,ev.center),cur.lastCalcEvent=cur.futureCalcEvent||ev,cur.futureCalcEvent=ev),ev.velocityX=calcData.velocity.x,ev.velocityY=calcData.velocity.y,ev.interimAngle=calcData.angle,ev.interimDirection=calcData.direction},extendEventData:function(ev){var cur=this.current,startEv=cur.startEvent,lastEv=cur.lastEvent||startEv;(ev.eventType==EVENT_TOUCH||ev.eventType==EVENT_RELEASE)&&(startEv.touches=[],Utils.each(ev.touches,function(touch){startEv.touches.push({clientX:touch.clientX,clientY:touch.clientY})}));var deltaTime=ev.timeStamp-startEv.timeStamp,deltaX=ev.center.clientX-startEv.center.clientX,deltaY=ev.center.clientY-startEv.center.clientY;return this.getCalculatedData(ev,lastEv.center,deltaTime,deltaX,deltaY),Utils.extend(ev,{startEvent:startEv,deltaTime:deltaTime,deltaX:deltaX,deltaY:deltaY,distance:Utils.getDistance(startEv.center,ev.center),angle:Utils.getAngle(startEv.center,ev.center),direction:Utils.getDirection(startEv.center,ev.center),scale:Utils.getScale(startEv.touches,ev.touches),rotation:Utils.getRotation(startEv.touches,ev.touches)}),ev},register:function(gesture){var options=gesture.defaults||{};return options[gesture.name]===undefined&&(options[gesture.name]=!0),Utils.extend(Hammer.defaults,options,!0),gesture.index=gesture.index||1e3,this.gestures.push(gesture),this.gestures.sort(function(a,b){return a.index<b.index?-1:a.index>b.index?1:0}),this.gestures}};Hammer.Instance=function(element,options){var self=this;setup(),this.element=element,this.enabled=!0,Utils.each(options,function(value,name){delete options[name],options[Utils.toCamelCase(name)]=value}),this.options=Utils.extend(Utils.extend({},Hammer.defaults),options||{}),this.options.behavior&&Utils.toggleBehavior(this.element,this.options.behavior,!0),this.eventStartHandler=Event.onTouch(element,EVENT_START,function(ev){self.enabled&&ev.eventType==EVENT_START?Detection.startDetect(self,ev):ev.eventType==EVENT_TOUCH&&Detection.detect(ev)}),this.eventHandlers=[]},Hammer.Instance.prototype={on:function(gestures,handler){var self=this;return Event.on(self.element,gestures,handler,function(type){self.eventHandlers.push({gesture:type,handler:handler})}),self},off:function(gestures,handler){var self=this;return Event.off(self.element,gestures,handler,function(type){var index=Utils.inArray({gesture:type,handler:handler});index!==!1&&self.eventHandlers.splice(index,1)}),self},trigger:function(gesture,eventData){eventData||(eventData={});var event=Hammer.DOCUMENT.createEvent("Event");event.initEvent(gesture,!0,!0),event.gesture=eventData;var element=this.element;return Utils.hasParent(eventData.target,element)&&(element=eventData.target),element.dispatchEvent(event),this},enable:function(state){return this.enabled=state,this},dispose:function(){var i,eh;for(Utils.toggleBehavior(this.element,this.options.behavior,!1),i=-1;eh=this.eventHandlers[++i];)Utils.off(this.element,eh.gesture,eh.handler);return this.eventHandlers=[],Event.off(this.element,EVENT_TYPES[EVENT_START],this.eventStartHandler),null}},function(name){function dragGesture(ev,inst){var cur=Detection.current;if(!(inst.options.dragMaxTouches>0&&ev.touches.length>inst.options.dragMaxTouches))switch(ev.eventType){case EVENT_START:triggered=!1;break;case EVENT_MOVE:if(ev.distance<inst.options.dragMinDistance&&cur.name!=name)return;var startCenter=cur.startEvent.center;if(cur.name!=name&&(cur.name=name,inst.options.dragDistanceCorrection&&ev.distance>0)){var factor=Math.abs(inst.options.dragMinDistance/ev.distance);startCenter.pageX+=ev.deltaX*factor,startCenter.pageY+=ev.deltaY*factor,startCenter.clientX+=ev.deltaX*factor,startCenter.clientY+=ev.deltaY*factor,ev=Detection.extendEventData(ev)}(cur.lastEvent.dragLockToAxis||inst.options.dragLockToAxis&&inst.options.dragLockMinDistance<=ev.distance)&&(ev.dragLockToAxis=!0);var lastDirection=cur.lastEvent.direction;ev.dragLockToAxis&&lastDirection!==ev.direction&&(ev.direction=Utils.isVertical(lastDirection)?ev.deltaY<0?DIRECTION_UP:DIRECTION_DOWN:ev.deltaX<0?DIRECTION_LEFT:DIRECTION_RIGHT),triggered||(inst.trigger(name+"start",ev),triggered=!0),inst.trigger(name,ev),inst.trigger(name+ev.direction,ev);var isVertical=Utils.isVertical(ev.direction);(inst.options.dragBlockVertical&&isVertical||inst.options.dragBlockHorizontal&&!isVertical)&&ev.preventDefault();break;case EVENT_RELEASE:triggered&&ev.changedLength<=inst.options.dragMaxTouches&&(inst.trigger(name+"end",ev),triggered=!1);break;case EVENT_END:triggered=!1}}var triggered=!1;Hammer.gestures.Drag={name:name,index:50,handler:dragGesture,defaults:{dragMinDistance:10,dragDistanceCorrection:!0,dragMaxTouches:1,dragBlockHorizontal:!1,dragBlockVertical:!1,dragLockToAxis:!1,dragLockMinDistance:25}}}("drag"),Hammer.gestures.Gesture={name:"gesture",index:1337,handler:function(ev,inst){inst.trigger(this.name,ev)}},function(name){function holdGesture(ev,inst){var options=inst.options,current=Detection.current;switch(ev.eventType){case EVENT_START:clearTimeout(timer),current.name=name,timer=setTimeout(function(){current&&current.name==name&&inst.trigger(name,ev)},options.holdTimeout);break;case EVENT_MOVE:ev.distance>options.holdThreshold&&clearTimeout(timer);break;case EVENT_RELEASE:clearTimeout(timer)}}var timer;Hammer.gestures.Hold={name:name,index:10,defaults:{holdTimeout:500,holdThreshold:2},handler:holdGesture}}("hold"),Hammer.gestures.Release={name:"release",index:1/0,handler:function(ev,inst){ev.eventType==EVENT_RELEASE&&inst.trigger(this.name,ev)}},Hammer.gestures.Swipe={name:"swipe",index:40,defaults:{swipeMinTouches:1,swipeMaxTouches:1,swipeVelocityX:.6,swipeVelocityY:.6},handler:function(ev,inst){if(ev.eventType==EVENT_RELEASE){var touches=ev.touches.length,options=inst.options;if(touches<options.swipeMinTouches||touches>options.swipeMaxTouches)return;(ev.velocityX>options.swipeVelocityX||ev.velocityY>options.swipeVelocityY)&&(inst.trigger(this.name,ev),inst.trigger(this.name+ev.direction,ev))}}},function(name){function tapGesture(ev,inst){var sincePrev,didDoubleTap,options=inst.options,current=Detection.current,prev=Detection.previous;switch(ev.eventType){case EVENT_START:hasMoved=!1;break;case EVENT_MOVE:hasMoved=hasMoved||ev.distance>options.tapMaxDistance;break;case EVENT_END:!Utils.inStr(ev.srcEvent.type,"cancel")&&ev.deltaTime<options.tapMaxTime&&!hasMoved&&(sincePrev=prev&&prev.lastEvent&&ev.timeStamp-prev.lastEvent.timeStamp,didDoubleTap=!1,prev&&prev.name==name&&sincePrev&&sincePrev<options.doubleTapInterval&&ev.distance<options.doubleTapDistance&&(inst.trigger("doubletap",ev),didDoubleTap=!0),(!didDoubleTap||options.tapAlways)&&(current.name=name,inst.trigger(current.name,ev)))}}var hasMoved=!1;Hammer.gestures.Tap={name:name,index:100,handler:tapGesture,defaults:{tapMaxTime:250,tapMaxDistance:10,tapAlways:!0,doubleTapDistance:20,doubleTapInterval:300}}}("tap"),Hammer.gestures.Touch={name:"touch",index:-(1/0),defaults:{preventDefault:!1,preventMouse:!1},handler:function(ev,inst){return inst.options.preventMouse&&ev.pointerType==POINTER_MOUSE?void ev.stopDetect():(inst.options.preventDefault&&ev.preventDefault(),void(ev.eventType==EVENT_TOUCH&&inst.trigger("touch",ev)))}},function(name){function transformGesture(ev,inst){switch(ev.eventType){case EVENT_START:triggered=!1;break;case EVENT_MOVE:if(ev.touches.length<2)return;var scaleThreshold=Math.abs(1-ev.scale),rotationThreshold=Math.abs(ev.rotation);if(scaleThreshold<inst.options.transformMinScale&&rotationThreshold<inst.options.transformMinRotation)return;Detection.current.name=name,triggered||(inst.trigger(name+"start",ev),triggered=!0),inst.trigger(name,ev),rotationThreshold>inst.options.transformMinRotation&&inst.trigger("rotate",ev),scaleThreshold>inst.options.transformMinScale&&(inst.trigger("pinch",ev),inst.trigger("pinch"+(ev.scale<1?"in":"out"),ev));break;case EVENT_RELEASE:triggered&&ev.changedLength<2&&(inst.trigger(name+"end",ev),triggered=!1)}}var triggered=!1;Hammer.gestures.Transform={name:name,index:45,defaults:{transformMinScale:.01,transformMinRotation:1},handler:transformGesture}}("transform"),"function"==typeof define&&define.amd?define(function(){return Hammer}):"undefined"!=typeof module&&module.exports?module.exports=Hammer:window.Hammer=Hammer}(window);var IScroll=function(window,document,Math){function IScroll(el,options){this.wrapper="string"==typeof el?document.querySelector(el):el,this.scroller=this.wrapper.children[0],this.scrollerStyle=this.scroller.style,this.options={startX:0,startY:0,scrollY:!0,directionLockThreshold:5,momentum:!0,bounce:!0,bounceTime:600,bounceEasing:"",preventDefault:!0,preventDefaultException:{tagName:/^(INPUT|TEXTAREA|BUTTON|SELECT)$/},HWCompositing:!0,useTransition:!0,useTransform:!0};for(var i in options)this.options[i]=options[i];this.translateZ=this.options.HWCompositing&&utils.hasPerspective?" translateZ(0)":"",this.options.useTransition=utils.hasTransition&&this.options.useTransition,this.options.useTransform=utils.hasTransform&&this.options.useTransform,this.options.eventPassthrough=this.options.eventPassthrough===!0?"vertical":this.options.eventPassthrough,this.options.preventDefault=!this.options.eventPassthrough&&this.options.preventDefault,this.options.scrollY="vertical"==this.options.eventPassthrough?!1:this.options.scrollY,this.options.scrollX="horizontal"==this.options.eventPassthrough?!1:this.options.scrollX,this.options.freeScroll=this.options.freeScroll&&!this.options.eventPassthrough,this.options.directionLockThreshold=this.options.eventPassthrough?0:this.options.directionLockThreshold,this.options.bounceEasing="string"==typeof this.options.bounceEasing?utils.ease[this.options.bounceEasing]||utils.ease.circular:this.options.bounceEasing,this.options.resizePolling=void 0===this.options.resizePolling?60:this.options.resizePolling,this.options.tap===!0&&(this.options.tap="tap"),this.x=0,this.y=0,this.directionX=0,this.directionY=0,this._events={},this._init(),this.refresh(),this.scrollTo(this.options.startX,this.options.startY),this.enable()}var rAF=window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||window.oRequestAnimationFrame||window.msRequestAnimationFrame||function(callback){window.setTimeout(callback,1e3/60)},utils=function(){function _prefixStyle(style){return _vendor===!1?!1:""===_vendor?style:_vendor+style.charAt(0).toUpperCase()+style.substr(1)}var me={},_elementStyle=document.createElement("div").style,_vendor=function(){for(var transform,vendors=["t","webkitT","MozT","msT","OT"],i=0,l=vendors.length;l>i;i++)if(transform=vendors[i]+"ransform",transform in _elementStyle)return vendors[i].substr(0,vendors[i].length-1);return!1}();me.getTime=Date.now||function(){return(new Date).getTime()},me.extend=function(target,obj){for(var i in obj)target[i]=obj[i]},me.addEvent=function(el,type,fn,capture){el.addEventListener(type,fn,!!capture)},me.removeEvent=function(el,type,fn,capture){el.removeEventListener(type,fn,!!capture)},me.momentum=function(current,start,time,lowerMargin,wrapperSize){var destination,duration,distance=current-start,speed=Math.abs(distance)/time,deceleration=6e-4;return destination=current+speed*speed/(2*deceleration)*(0>distance?-1:1),duration=speed/deceleration,lowerMargin>destination?(destination=wrapperSize?lowerMargin-wrapperSize/2.5*(speed/8):lowerMargin,distance=Math.abs(destination-current),duration=distance/speed):destination>0&&(destination=wrapperSize?wrapperSize/2.5*(speed/8):0,distance=Math.abs(current)+destination,duration=distance/speed),{destination:Math.round(destination),duration:duration}};var _transform=_prefixStyle("transform");return me.extend(me,{hasTransform:_transform!==!1,hasPerspective:_prefixStyle("perspective")in _elementStyle,hasTouch:"ontouchstart"in window,hasPointer:navigator.msPointerEnabled,hasTransition:_prefixStyle("transition")in _elementStyle}),me.isAndroidBrowser=/Android/.test(window.navigator.appVersion)&&/Version\/\d/.test(window.navigator.appVersion),me.extend(me.style={},{transform:_transform,transitionTimingFunction:_prefixStyle("transitionTimingFunction"),transitionDuration:_prefixStyle("transitionDuration"),transformOrigin:_prefixStyle("transformOrigin")}),me.hasClass=function(e,c){var re=new RegExp("(^|\\s)"+c+"(\\s|$)");return re.test(e.className)},me.addClass=function(e,c){if(!me.hasClass(e,c)){var newclass=e.className.split(" ");newclass.push(c),e.className=newclass.join(" ")}},me.removeClass=function(e,c){if(me.hasClass(e,c)){var re=new RegExp("(^|\\s)"+c+"(\\s|$)","g");e.className=e.className.replace(re," ")}},me.offset=function(el){for(var left=-el.offsetLeft,top=-el.offsetTop;el=el.offsetParent;)left-=el.offsetLeft,top-=el.offsetTop;return{left:left,top:top}},me.preventDefaultException=function(el,exceptions){for(var i in exceptions)if(exceptions[i].test(el[i]))return!0;return!1},me.extend(me.eventType={},{touchstart:1,touchmove:1,touchend:1,mousedown:2,mousemove:2,mouseup:2,MSPointerDown:3,MSPointerMove:3,MSPointerUp:3}),me.extend(me.ease={},{quadratic:{style:"cubic-bezier(0.25, 0.46, 0.45, 0.94)",fn:function(k){return k*(2-k)}},circular:{style:"cubic-bezier(0.1, 0.57, 0.1, 1)",fn:function(k){return Math.sqrt(1- --k*k)}},back:{style:"cubic-bezier(0.175, 0.885, 0.32, 1.275)",fn:function(k){var b=4;return(k-=1)*k*((b+1)*k+b)+1}},bounce:{style:"",fn:function(k){return(k/=1)<1/2.75?7.5625*k*k:2/2.75>k?7.5625*(k-=1.5/2.75)*k+.75:2.5/2.75>k?7.5625*(k-=2.25/2.75)*k+.9375:7.5625*(k-=2.625/2.75)*k+.984375}},elastic:{style:"",fn:function(k){var f=.22,e=.4;return 0===k?0:1==k?1:e*Math.pow(2,-10*k)*Math.sin(2*(k-f/4)*Math.PI/f)+1}}}),me.tap=function(e,eventName){var ev=document.createEvent("Event");ev.initEvent(eventName,!0,!0),ev.pageX=e.pageX,ev.pageY=e.pageY,e.target.dispatchEvent(ev)},me.click=function(e){var ev,target=e.target;"SELECT"!=target.tagName&&"INPUT"!=target.tagName&&"TEXTAREA"!=target.tagName&&(ev=document.createEvent("MouseEvents"),ev.initMouseEvent("click",!0,!0,e.view,1,target.screenX,target.screenY,target.clientX,target.clientY,e.ctrlKey,e.altKey,e.shiftKey,e.metaKey,0,null),ev._constructed=!0,target.dispatchEvent(ev))},me}();return IScroll.prototype={version:"5.0.6",_init:function(){this._initEvents()},destroy:function(){this._initEvents(!0),this._execEvent("destroy")},_transitionEnd:function(e){e.target==this.scroller&&(this._transitionTime(0),this.resetPosition(this.options.bounceTime)||this._execEvent("scrollEnd"))},_start:function(e){if(!(1!=utils.eventType[e.type]&&0!==e.button||!this.enabled||this.initiated&&utils.eventType[e.type]!==this.initiated)){!this.options.preventDefault||utils.isAndroidBrowser||utils.preventDefaultException(e.target,this.options.preventDefaultException)||e.preventDefault();var pos,point=e.touches?e.touches[0]:e;this.initiated=utils.eventType[e.type],this.moved=!1,this.distX=0,this.distY=0,this.directionX=0,this.directionY=0,this.directionLocked=0,this._transitionTime(),this.isAnimating=!1,this.startTime=utils.getTime(),this.options.useTransition&&this.isInTransition&&(pos=this.getComputedPosition(),this._translate(Math.round(pos.x),Math.round(pos.y)),this._execEvent("scrollEnd"),this.isInTransition=!1),this.startX=this.x,this.startY=this.y,this.absStartX=this.x,this.absStartY=this.y,this.pointX=point.pageX,this.pointY=point.pageY,this._execEvent("beforeScrollStart")}},_move:function(e){if(this.enabled&&utils.eventType[e.type]===this.initiated){this.options.preventDefault&&e.preventDefault();var newX,newY,absDistX,absDistY,point=e.touches?e.touches[0]:e,deltaX=point.pageX-this.pointX,deltaY=point.pageY-this.pointY,timestamp=utils.getTime();if(this.pointX=point.pageX,this.pointY=point.pageY,this.distX+=deltaX,this.distY+=deltaY,absDistX=Math.abs(this.distX),absDistY=Math.abs(this.distY),!(timestamp-this.endTime>300&&10>absDistX&&10>absDistY)){if(this.directionLocked||this.options.freeScroll||(this.directionLocked=absDistX>absDistY+this.options.directionLockThreshold?"h":absDistY>=absDistX+this.options.directionLockThreshold?"v":"n"),"h"==this.directionLocked){if("vertical"==this.options.eventPassthrough)e.preventDefault();else if("horizontal"==this.options.eventPassthrough)return void(this.initiated=!1);deltaY=0}else if("v"==this.directionLocked){if("horizontal"==this.options.eventPassthrough)e.preventDefault();else if("vertical"==this.options.eventPassthrough)return void(this.initiated=!1);deltaX=0}deltaX=this.hasHorizontalScroll?deltaX:0,deltaY=this.hasVerticalScroll?deltaY:0,newX=this.x+deltaX,newY=this.y+deltaY,(newX>0||newX<this.maxScrollX)&&(newX=this.options.bounce?this.x+deltaX/3:newX>0?0:this.maxScrollX),(newY>0||newY<this.maxScrollY)&&(newY=this.options.bounce?this.y+deltaY/3:newY>0?0:this.maxScrollY),this.directionX=deltaX>0?-1:0>deltaX?1:0,this.directionY=deltaY>0?-1:0>deltaY?1:0,this.moved||this._execEvent("scrollStart"),this.moved=!0,this._translate(newX,newY),timestamp-this.startTime>300&&(this.startTime=timestamp,this.startX=this.x,this.startY=this.y)}}},_end:function(e){if(this.enabled&&utils.eventType[e.type]===this.initiated){this.options.preventDefault&&!utils.preventDefaultException(e.target,this.options.preventDefaultException)&&e.preventDefault();var momentumX,momentumY,duration=(e.changedTouches?e.changedTouches[0]:e,utils.getTime()-this.startTime),newX=Math.round(this.x),newY=Math.round(this.y),distanceX=Math.abs(newX-this.startX),distanceY=Math.abs(newY-this.startY),time=0,easing="";if(this.scrollTo(newX,newY),this.isInTransition=0,this.initiated=0,this.endTime=utils.getTime(),!this.resetPosition(this.options.bounceTime))return this.moved?this._events.flick&&200>duration&&100>distanceX&&100>distanceY?void this._execEvent("flick"):(this.options.momentum&&300>duration&&(momentumX=this.hasHorizontalScroll?utils.momentum(this.x,this.startX,duration,this.maxScrollX,this.options.bounce?this.wrapperWidth:0):{destination:newX,duration:0},momentumY=this.hasVerticalScroll?utils.momentum(this.y,this.startY,duration,this.maxScrollY,this.options.bounce?this.wrapperHeight:0):{destination:newY,duration:0},newX=momentumX.destination,newY=momentumY.destination,time=Math.max(momentumX.duration,momentumY.duration),this.isInTransition=1),newX!=this.x||newY!=this.y?((newX>0||newX<this.maxScrollX||newY>0||newY<this.maxScrollY)&&(easing=utils.ease.quadratic),void this.scrollTo(newX,newY,time,easing)):void this._execEvent("scrollEnd")):(this.options.tap&&utils.tap(e,this.options.tap),void(this.options.click&&utils.click(e)))}},_resize:function(){var that=this;clearTimeout(this.resizeTimeout),this.resizeTimeout=setTimeout(function(){that.refresh()},this.options.resizePolling)},resetPosition:function(time){var x=this.x,y=this.y;return time=time||0,!this.hasHorizontalScroll||this.x>0?x=0:this.x<this.maxScrollX&&(x=this.maxScrollX),!this.hasVerticalScroll||this.y>0?y=0:this.y<this.maxScrollY&&(y=this.maxScrollY),x==this.x&&y==this.y?!1:(this.scrollTo(x,y,time,this.options.bounceEasing),!0)},disable:function(){this.enabled=!1},enable:function(){this.enabled=!0},refresh:function(){this.wrapper.offsetHeight;this.wrapperWidth=this.wrapper.clientWidth,this.wrapperHeight=this.wrapper.clientHeight,this.scrollerWidth=this.scroller.offsetWidth,this.scrollerHeight=this.scroller.offsetHeight,this.maxScrollX=this.wrapperWidth-this.scrollerWidth,this.maxScrollY=this.wrapperHeight-this.scrollerHeight,this.hasHorizontalScroll=this.options.scrollX&&this.maxScrollX<0,this.hasVerticalScroll=this.options.scrollY&&this.maxScrollY<0,this.hasHorizontalScroll||(this.maxScrollX=0,this.scrollerWidth=this.wrapperWidth),this.hasVerticalScroll||(this.maxScrollY=0,this.scrollerHeight=this.wrapperHeight),this.endTime=0,this.directionX=0,this.directionY=0,this.wrapperOffset=utils.offset(this.wrapper),this._execEvent("refresh"),this.resetPosition()},on:function(type,fn){this._events[type]||(this._events[type]=[]),this._events[type].push(fn)},_execEvent:function(type){if(this._events[type]){var i=0,l=this._events[type].length;if(l)for(;l>i;i++)this._events[type][i].call(this)}},scrollBy:function(x,y,time,easing){x=this.x+x,y=this.y+y,time=time||0,this.scrollTo(x,y,time,easing)},scrollTo:function(x,y,time,easing){easing=easing||utils.ease.circular,!time||this.options.useTransition&&easing.style?(this._transitionTimingFunction(easing.style),this._transitionTime(time),this._translate(x,y)):this._animate(x,y,time,easing.fn)},scrollToElement:function(el,time,offsetX,offsetY,easing){if(el=el.nodeType?el:this.scroller.querySelector(el)){var pos=utils.offset(el);pos.left-=this.wrapperOffset.left,pos.top-=this.wrapperOffset.top,offsetX===!0&&(offsetX=Math.round(el.offsetWidth/2-this.wrapper.offsetWidth/2)),offsetY===!0&&(offsetY=Math.round(el.offsetHeight/2-this.wrapper.offsetHeight/2)),pos.left-=offsetX||0,pos.top-=offsetY||0,pos.left=pos.left>0?0:pos.left<this.maxScrollX?this.maxScrollX:pos.left,pos.top=pos.top>0?0:pos.top<this.maxScrollY?this.maxScrollY:pos.top,time=void 0===time||null===time||"auto"===time?Math.max(Math.abs(this.x-pos.left),Math.abs(this.y-pos.top)):time,this.scrollTo(pos.left,pos.top,time,easing)}},_transitionTime:function(time){time=time||0,this.scrollerStyle[utils.style.transitionDuration]=time+"ms"},_transitionTimingFunction:function(easing){this.scrollerStyle[utils.style.transitionTimingFunction]=easing},_translate:function(x,y){this.options.useTransform?this.scrollerStyle[utils.style.transform]="translate("+x+"px,"+y+"px)"+this.translateZ:(x=Math.round(x),y=Math.round(y),this.scrollerStyle.left=x+"px",this.scrollerStyle.top=y+"px"),this.x=x,this.y=y},_initEvents:function(remove){var eventType=remove?utils.removeEvent:utils.addEvent,target=this.options.bindToWrapper?this.wrapper:window;eventType(window,"orientationchange",this),eventType(window,"resize",this),this.options.click&&eventType(this.wrapper,"click",this,!0),this.options.disableMouse||(eventType(this.wrapper,"mousedown",this),eventType(target,"mousemove",this),eventType(target,"mousecancel",this),eventType(target,"mouseup",this)),utils.hasPointer&&!this.options.disablePointer&&(eventType(this.wrapper,"MSPointerDown",this),eventType(target,"MSPointerMove",this),eventType(target,"MSPointerCancel",this),eventType(target,"MSPointerUp",this)),utils.hasTouch&&!this.options.disableTouch&&(eventType(this.wrapper,"touchstart",this),eventType(target,"touchmove",this),eventType(target,"touchcancel",this),eventType(target,"touchend",this)),eventType(this.scroller,"transitionend",this),eventType(this.scroller,"webkitTransitionEnd",this),eventType(this.scroller,"oTransitionEnd",this),eventType(this.scroller,"MSTransitionEnd",this)},getComputedPosition:function(){var x,y,matrix=window.getComputedStyle(this.scroller,null);return this.options.useTransform?(matrix=matrix[utils.style.transform].split(")")[0].split(", "),x=+(matrix[12]||matrix[4]),y=+(matrix[13]||matrix[5])):(x=+matrix.left.replace(/[^-\d]/g,""),y=+matrix.top.replace(/[^-\d]/g,"")),{x:x,y:y}},_animate:function(destX,destY,duration,easingFn){function step(){var newX,newY,easing,now=utils.getTime();return now>=destTime?(that.isAnimating=!1,that._translate(destX,destY),void(that.resetPosition(that.options.bounceTime)||that._execEvent("scrollEnd"))):(now=(now-startTime)/duration,easing=easingFn(now),newX=(destX-startX)*easing+startX,newY=(destY-startY)*easing+startY,that._translate(newX,newY),void(that.isAnimating&&rAF(step)))}var that=this,startX=this.x,startY=this.y,startTime=utils.getTime(),destTime=startTime+duration;this.isAnimating=!0,step()},handleEvent:function(e){switch(e.type){case"touchstart":case"MSPointerDown":case"mousedown":this._start(e);break;case"touchmove":case"MSPointerMove":case"mousemove":this._move(e);break;case"touchend":case"MSPointerUp":case"mouseup":case"touchcancel":case"MSPointerCancel":case"mousecancel":this._end(e);break;case"orientationchange":case"resize":this._resize();break;case"transitionend":case"webkitTransitionEnd":case"oTransitionEnd":case"MSTransitionEnd":this._transitionEnd(e);break;case"DOMMouseScroll":case"mousewheel":this._wheel(e);break;case"keydown":this._key(e);break;case"click":e._constructed||(e.preventDefault(),e.stopPropagation())}}},IScroll.ease=utils.ease,IScroll}(window,document,Math),MicroEvent=function(){};MicroEvent.prototype={on:function(event,fct){this._events=this._events||{},this._events[event]=this._events[event]||[],this._events[event].push(fct)},once:function(event,fct){var self=this,wrapper=function(){return self.off(event,wrapper),fct.apply(null,arguments)};this.on(event,wrapper)},off:function(event,fct){this._events=this._events||{},event in this._events!=!1&&this._events[event].splice(this._events[event].indexOf(fct),1); },emit:function(event){if(this._events=this._events||{},event in this._events!=!1)for(var i=0;i<this._events[event].length;i++)this._events[event][i].apply(this,Array.prototype.slice.call(arguments,1))}},MicroEvent.mixin=function(destObject){for(var props=["on","once","off","emit"],i=0;i<props.length;i++)"function"==typeof destObject?destObject.prototype[props[i]]=MicroEvent.prototype[props[i]]:destObject[props[i]]=MicroEvent.prototype[props[i]]},"undefined"!=typeof module&&"exports"in module&&(module.exports=MicroEvent),window.Modernizr=function(window,document,undefined){function setCss(str){mStyle.cssText=str}function is(obj,type){return typeof obj===type}function contains(str,substr){return!!~(""+str).indexOf(substr)}function testProps(props,prefixed){for(var i in props){var prop=props[i];if(!contains(prop,"-")&&mStyle[prop]!==undefined)return"pfx"==prefixed?prop:!0}return!1}function testDOMProps(props,obj,elem){for(var i in props){var item=obj[props[i]];if(item!==undefined)return elem===!1?props[i]:is(item,"function")?item.bind(elem||obj):item}return!1}function testPropsAll(prop,prefixed,elem){var ucProp=prop.charAt(0).toUpperCase()+prop.slice(1),props=(prop+" "+cssomPrefixes.join(ucProp+" ")+ucProp).split(" ");return is(prefixed,"string")||is(prefixed,"undefined")?testProps(props,prefixed):(props=(prop+" "+domPrefixes.join(ucProp+" ")+ucProp).split(" "),testDOMProps(props,prefixed,elem))}var inputElem,featureName,hasOwnProp,version="2.6.2",Modernizr={},enableClasses=!0,docElement=document.documentElement,mod="modernizr",modElem=document.createElement(mod),mStyle=modElem.style,prefixes=({}.toString," -webkit- -moz- -o- -ms- ".split(" ")),omPrefixes="Webkit Moz O ms",cssomPrefixes=omPrefixes.split(" "),domPrefixes=omPrefixes.toLowerCase().split(" "),ns={svg:"http://www.w3.org/2000/svg"},tests={},classes=[],slice=classes.slice,injectElementWithStyles=function(rule,callback,nodes,testnames){var style,ret,node,docOverflow,div=document.createElement("div"),body=document.body,fakeBody=body||document.createElement("body");if(parseInt(nodes,10))for(;nodes--;)node=document.createElement("div"),node.id=testnames?testnames[nodes]:mod+(nodes+1),div.appendChild(node);return style=["&#173;",'<style id="s',mod,'">',rule,"</style>"].join(""),div.id=mod,(body?div:fakeBody).innerHTML+=style,fakeBody.appendChild(div),body||(fakeBody.style.background="",fakeBody.style.overflow="hidden",docOverflow=docElement.style.overflow,docElement.style.overflow="hidden",docElement.appendChild(fakeBody)),ret=callback(div,rule),body?div.parentNode.removeChild(div):(fakeBody.parentNode.removeChild(fakeBody),docElement.style.overflow=docOverflow),!!ret},_hasOwnProperty={}.hasOwnProperty;hasOwnProp=is(_hasOwnProperty,"undefined")||is(_hasOwnProperty.call,"undefined")?function(object,property){return property in object&&is(object.constructor.prototype[property],"undefined")}:function(object,property){return _hasOwnProperty.call(object,property)},Function.prototype.bind||(Function.prototype.bind=function(that){var target=this;if("function"!=typeof target)throw new TypeError;var args=slice.call(arguments,1),bound=function(){if(this instanceof bound){var F=function(){};F.prototype=target.prototype;var self=new F,result=target.apply(self,args.concat(slice.call(arguments)));return Object(result)===result?result:self}return target.apply(that,args.concat(slice.call(arguments)))};return bound}),tests.canvas=function(){var elem=document.createElement("canvas");return!(!elem.getContext||!elem.getContext("2d"))},tests.borderradius=function(){return testPropsAll("borderRadius")},tests.boxshadow=function(){return testPropsAll("boxShadow")},tests.cssanimations=function(){return testPropsAll("animationName")},tests.csstransforms=function(){return!!testPropsAll("transform")},tests.csstransforms3d=function(){var ret=!!testPropsAll("perspective");return ret&&"webkitPerspective"in docElement.style&&injectElementWithStyles("@media (transform-3d),(-webkit-transform-3d){#modernizr{left:9px;position:absolute;height:3px;}}",function(node,rule){ret=9===node.offsetLeft&&3===node.offsetHeight}),ret},tests.csstransitions=function(){return testPropsAll("transition")},tests.svg=function(){return!!document.createElementNS&&!!document.createElementNS(ns.svg,"svg").createSVGRect};for(var feature in tests)hasOwnProp(tests,feature)&&(featureName=feature.toLowerCase(),Modernizr[featureName]=tests[feature](),classes.push((Modernizr[featureName]?"":"no-")+featureName));return Modernizr.addTest=function(feature,test){if("object"==typeof feature)for(var key in feature)hasOwnProp(feature,key)&&Modernizr.addTest(key,feature[key]);else{if(feature=feature.toLowerCase(),Modernizr[feature]!==undefined)return Modernizr;test="function"==typeof test?test():test,"undefined"!=typeof enableClasses&&enableClasses&&(docElement.className+=" "+(test?"":"no-")+feature),Modernizr[feature]=test}return Modernizr},setCss(""),modElem=inputElem=null,function(window,document){function addStyleSheet(ownerDocument,cssText){var p=ownerDocument.createElement("p"),parent=ownerDocument.getElementsByTagName("head")[0]||ownerDocument.documentElement;return p.innerHTML="x<style>"+cssText+"</style>",parent.insertBefore(p.lastChild,parent.firstChild)}function getElements(){var elements=html5.elements;return"string"==typeof elements?elements.split(" "):elements}function getExpandoData(ownerDocument){var data=expandoData[ownerDocument[expando]];return data||(data={},expanID++,ownerDocument[expando]=expanID,expandoData[expanID]=data),data}function createElement(nodeName,ownerDocument,data){if(ownerDocument||(ownerDocument=document),supportsUnknownElements)return ownerDocument.createElement(nodeName);data||(data=getExpandoData(ownerDocument));var node;return node=data.cache[nodeName]?data.cache[nodeName].cloneNode():saveClones.test(nodeName)?(data.cache[nodeName]=data.createElem(nodeName)).cloneNode():data.createElem(nodeName),node.canHaveChildren&&!reSkip.test(nodeName)?data.frag.appendChild(node):node}function createDocumentFragment(ownerDocument,data){if(ownerDocument||(ownerDocument=document),supportsUnknownElements)return ownerDocument.createDocumentFragment();data=data||getExpandoData(ownerDocument);for(var clone=data.frag.cloneNode(),i=0,elems=getElements(),l=elems.length;l>i;i++)clone.createElement(elems[i]);return clone}function shivMethods(ownerDocument,data){data.cache||(data.cache={},data.createElem=ownerDocument.createElement,data.createFrag=ownerDocument.createDocumentFragment,data.frag=data.createFrag()),ownerDocument.createElement=function(nodeName){return html5.shivMethods?createElement(nodeName,ownerDocument,data):data.createElem(nodeName)},ownerDocument.createDocumentFragment=Function("h,f","return function(){var n=f.cloneNode(),c=n.createElement;h.shivMethods&&("+getElements().join().replace(/\w+/g,function(nodeName){return data.createElem(nodeName),data.frag.createElement(nodeName),'c("'+nodeName+'")'})+");return n}")(html5,data.frag)}function shivDocument(ownerDocument){ownerDocument||(ownerDocument=document);var data=getExpandoData(ownerDocument);return!html5.shivCSS||supportsHtml5Styles||data.hasCSS||(data.hasCSS=!!addStyleSheet(ownerDocument,"article,aside,figcaption,figure,footer,header,hgroup,nav,section{display:block}mark{background:#FF0;color:#000}")),supportsUnknownElements||shivMethods(ownerDocument,data),ownerDocument}var supportsHtml5Styles,supportsUnknownElements,options=window.html5||{},reSkip=/^<|^(?:button|map|select|textarea|object|iframe|option|optgroup)$/i,saveClones=/^(?:a|b|code|div|fieldset|h1|h2|h3|h4|h5|h6|i|label|li|ol|p|q|span|strong|style|table|tbody|td|th|tr|ul)$/i,expando="_html5shiv",expanID=0,expandoData={};!function(){try{var a=document.createElement("a");a.innerHTML="<xyz></xyz>",supportsHtml5Styles="hidden"in a,supportsUnknownElements=1==a.childNodes.length||function(){document.createElement("a");var frag=document.createDocumentFragment();return"undefined"==typeof frag.cloneNode||"undefined"==typeof frag.createDocumentFragment||"undefined"==typeof frag.createElement}()}catch(e){supportsHtml5Styles=!0,supportsUnknownElements=!0}}();var html5={elements:options.elements||"abbr article aside audio bdi canvas data datalist details figcaption figure footer header hgroup mark meter nav output progress section summary time video",shivCSS:options.shivCSS!==!1,supportsUnknownElements:supportsUnknownElements,shivMethods:options.shivMethods!==!1,type:"default",shivDocument:shivDocument,createElement:createElement,createDocumentFragment:createDocumentFragment};window.html5=html5,shivDocument(document)}(this,document),Modernizr._version=version,Modernizr._prefixes=prefixes,Modernizr._domPrefixes=domPrefixes,Modernizr._cssomPrefixes=cssomPrefixes,Modernizr.testProp=function(prop){return testProps([prop])},Modernizr.testAllProps=testPropsAll,Modernizr.testStyles=injectElementWithStyles,docElement.className=docElement.className.replace(/(^|\s)no-js(\s|$)/,"$1$2")+(enableClasses?" js "+classes.join(" "):""),Modernizr}(this,this.document),function(a,b,c){function d(a){return"[object Function]"==o.call(a)}function e(a){return"string"==typeof a}function f(){}function g(a){return!a||"loaded"==a||"complete"==a||"uninitialized"==a}function h(){var a=p.shift();q=1,a?a.t?m(function(){("c"==a.t?B.injectCss:B.injectJs)(a.s,0,a.a,a.x,a.e,1)},0):(a(),h()):q=0}function i(a,c,d,e,f,i,j){function k(b){if(!o&&g(l.readyState)&&(u.r=o=1,!q&&h(),l.onload=l.onreadystatechange=null,b)){"img"!=a&&m(function(){t.removeChild(l)},50);for(var d in y[c])y[c].hasOwnProperty(d)&&y[c][d].onload()}}var j=j||B.errorTimeout,l=b.createElement(a),o=0,r=0,u={t:d,s:c,e:f,a:i,x:j};1===y[c]&&(r=1,y[c]=[]),"object"==a?l.data=c:(l.src=c,l.type=a),l.width=l.height="0",l.onerror=l.onload=l.onreadystatechange=function(){k.call(this,r)},p.splice(e,0,u),"img"!=a&&(r||2===y[c]?(t.insertBefore(l,s?null:n),m(k,j)):y[c].push(l))}function j(a,b,c,d,f){return q=0,b=b||"j",e(a)?i("c"==b?v:u,a,b,this.i++,c,d,f):(p.splice(this.i++,0,a),1==p.length&&h()),this}function k(){var a=B;return a.loader={load:j,i:0},a}var A,B,l=b.documentElement,m=a.setTimeout,n=b.getElementsByTagName("script")[0],o={}.toString,p=[],q=0,r="MozAppearance"in l.style,s=r&&!!b.createRange().compareNode,t=s?l:n.parentNode,l=a.opera&&"[object Opera]"==o.call(a.opera),l=!!b.attachEvent&&!l,u=r?"object":l?"script":"img",v=l?"script":u,w=Array.isArray||function(a){return"[object Array]"==o.call(a)},x=[],y={},z={timeout:function(a,b){return b.length&&(a.timeout=b[0]),a}};B=function(a){function b(a){var e,f,g,a=a.split("!"),b=x.length,c=a.pop(),d=a.length,c={url:c,origUrl:c,prefixes:a};for(f=0;d>f;f++)g=a[f].split("="),(e=z[g.shift()])&&(c=e(c,g));for(f=0;b>f;f++)c=x[f](c);return c}function g(a,e,f,g,h){var i=b(a),j=i.autoCallback;i.url.split(".").pop().split("?").shift(),i.bypass||(e&&(e=d(e)?e:e[a]||e[g]||e[a.split("/").pop().split("?")[0]]),i.instead?i.instead(a,e,f,g,h):(y[i.url]?i.noexec=!0:y[i.url]=1,f.load(i.url,i.forceCSS||!i.forceJS&&"css"==i.url.split(".").pop().split("?").shift()?"c":c,i.noexec,i.attrs,i.timeout),(d(e)||d(j))&&f.load(function(){k(),e&&e(i.origUrl,h,g),j&&j(i.origUrl,h,g),y[i.url]=2})))}function h(a,b){function c(a,c){if(a){if(e(a))c||(j=function(){var a=[].slice.call(arguments);k.apply(this,a),l()}),g(a,j,b,0,h);else if(Object(a)===a)for(n in m=function(){var c,b=0;for(c in a)a.hasOwnProperty(c)&&b++;return b}(),a)a.hasOwnProperty(n)&&(!c&&!--m&&(d(j)?j=function(){var a=[].slice.call(arguments);k.apply(this,a),l()}:j[n]=function(a){return function(){var b=[].slice.call(arguments);a&&a.apply(this,b),l()}}(k[n])),g(a[n],j,b,n,h))}else!c&&l()}var m,n,h=!!a.test,i=a.load||a.both,j=a.callback||f,k=j,l=a.complete||f;c(h?a.yep:a.nope,!!i),i&&c(i)}var i,j,l=this.yepnope.loader;if(e(a))g(a,0,l,0);else if(w(a))for(i=0;i<a.length;i++)j=a[i],e(j)?g(j,0,l,0):w(j)?B(j):Object(j)===j&&h(j,l);else Object(a)===a&&h(a,l)},B.addPrefix=function(a,b){z[a]=b},B.addFilter=function(a){x.push(a)},B.errorTimeout=1e4,null==b.readyState&&b.addEventListener&&(b.readyState="loading",b.addEventListener("DOMContentLoaded",A=function(){b.removeEventListener("DOMContentLoaded",A,0),b.readyState="complete"},0)),a.yepnope=k(),a.yepnope.executeStack=h,a.yepnope.injectJs=function(a,c,d,e,i,j){var l,o,k=b.createElement("script"),e=e||B.errorTimeout;k.src=a;for(o in d)k.setAttribute(o,d[o]);c=j?h:c||f,k.onreadystatechange=k.onload=function(){!l&&g(k.readyState)&&(l=1,c(),k.onload=k.onreadystatechange=null)},m(function(){l||(l=1,c(1))},e),i?k.onload():n.parentNode.insertBefore(k,n)},a.yepnope.injectCss=function(a,c,d,e,g,i){var j,e=b.createElement("link"),c=i?h:c||f;e.href=a,e.rel="stylesheet",e.type="text/css";for(j in d)e.setAttribute(j,d[j]);g||(n.parentNode.insertBefore(e,n),m(c,0))}}(this,document),Modernizr.load=function(){yepnope.apply(window,[].slice.call(arguments,0))},function(global,undefined){"use strict";function addFromSetImmediateArguments(args){return tasksByHandle[nextHandle]=partiallyApplied.apply(undefined,args),nextHandle++}function partiallyApplied(handler){var args=[].slice.call(arguments,1);return function(){"function"==typeof handler?handler.apply(undefined,args):new Function(""+handler)()}}function runIfPresent(handle){if(currentlyRunningATask)setTimeout(partiallyApplied(runIfPresent,handle),0);else{var task=tasksByHandle[handle];if(task){currentlyRunningATask=!0;try{task()}finally{clearImmediate(handle),currentlyRunningATask=!1}}}}function clearImmediate(handle){delete tasksByHandle[handle]}function installNextTickImplementation(){setImmediate=function(){var handle=addFromSetImmediateArguments(arguments);return process.nextTick(partiallyApplied(runIfPresent,handle)),handle}}function canUsePostMessage(){if(global.postMessage&&!global.importScripts){var postMessageIsAsynchronous=!0,oldOnMessage=global.onmessage;return global.onmessage=function(){postMessageIsAsynchronous=!1},global.postMessage("","*"),global.onmessage=oldOnMessage,postMessageIsAsynchronous}}function installPostMessageImplementation(){var messagePrefix="setImmediate$"+Math.random()+"$",onGlobalMessage=function(event){event.source===global&&"string"==typeof event.data&&0===event.data.indexOf(messagePrefix)&&runIfPresent(+event.data.slice(messagePrefix.length))};global.addEventListener?global.addEventListener("message",onGlobalMessage,!1):global.attachEvent("onmessage",onGlobalMessage),setImmediate=function(){var handle=addFromSetImmediateArguments(arguments);return global.postMessage(messagePrefix+handle,"*"),handle}}function installMessageChannelImplementation(){var channel=new MessageChannel;channel.port1.onmessage=function(event){var handle=event.data;runIfPresent(handle)},setImmediate=function(){var handle=addFromSetImmediateArguments(arguments);return channel.port2.postMessage(handle),handle}}function installReadyStateChangeImplementation(){var html=doc.documentElement;setImmediate=function(){var handle=addFromSetImmediateArguments(arguments),script=doc.createElement("script");return script.onreadystatechange=function(){runIfPresent(handle),script.onreadystatechange=null,html.removeChild(script),script=null},html.appendChild(script),handle}}function installSetTimeoutImplementation(){setImmediate=function(){var handle=addFromSetImmediateArguments(arguments);return setTimeout(partiallyApplied(runIfPresent,handle),0),handle}}if(!global.setImmediate){var setImmediate,nextHandle=1,tasksByHandle={},currentlyRunningATask=!1,doc=global.document,attachTo=Object.getPrototypeOf&&Object.getPrototypeOf(global);attachTo=attachTo&&attachTo.setTimeout?attachTo:global,"[object process]"==={}.toString.call(global.process)?installNextTickImplementation():canUsePostMessage()?installPostMessageImplementation():global.MessageChannel?installMessageChannelImplementation():doc&&"onreadystatechange"in doc.createElement("script")?installReadyStateChangeImplementation():installSetTimeoutImplementation(),attachTo.setImmediate=setImmediate,attachTo.clearImmediate=clearImmediate}}(function(){return this}()),function(){function Viewport(){return this.PRE_IOS7_VIEWPORT="initial-scale=1, maximum-scale=1, user-scalable=no",this.IOS7_VIEWPORT="initial-scale=1, maximum-scale=1, user-scalable=no",this.DEFAULT_VIEWPORT="initial-scale=1, maximum-scale=1, user-scalable=no",this.ensureViewportElement(),this.platform={},this.platform.name=this.getPlatformName(),this.platform.version=this.getPlatformVersion(),this}Viewport.prototype.ensureViewportElement=function(){this.viewportElement=document.querySelector("meta[name=viewport]"),this.viewportElement||(this.viewportElement=document.createElement("meta"),this.viewportElement.name="viewport",document.head.appendChild(this.viewportElement))},Viewport.prototype.setup=function(){function isWebView(){return!!(window.cordova||window.phonegap||window.PhoneGap)}this.viewportElement&&"true"!=this.viewportElement.getAttribute("data-no-adjust")&&("ios"==this.platform.name?this.platform.version>=7&&isWebView()?this.viewportElement.setAttribute("content",this.IOS7_VIEWPORT):this.viewportElement.setAttribute("content",this.PRE_IOS7_VIEWPORT):this.viewportElement.setAttribute("content",this.DEFAULT_VIEWPORT))},Viewport.prototype.getPlatformName=function(){return navigator.userAgent.match(/Android/i)?"android":navigator.userAgent.match(/iPhone|iPad|iPod/i)?"ios":void 0},Viewport.prototype.getPlatformVersion=function(){var start=window.navigator.userAgent.indexOf("OS ");return window.Number(window.navigator.userAgent.substr(start+3,3).replace("_","."))},window.Viewport=Viewport}(),function(module){try{module=angular.module("templates-main")}catch(err){module=angular.module("templates-main",[])}module.run(["$templateCache",function($templateCache){"use strict";$templateCache.put("templates/back_button.tpl",'<span \n class="toolbar-button--quiet {{modifierTemplater(\'toolbar-button--*\')}}" \n ng-click="$root.ons.findParentComponentUntil(\'ons-navigator\', $event).popPage({cancelIfRunning: true})"\n ng-show="showBackButton"\n style="height: 44px; line-height: 0; padding: 0 10px 0 0; position: relative;">\n \n <i \n class="ion-ios-arrow-back ons-back-button__icon" \n style="vertical-align: top; background-color: transparent; height: 44px; line-height: 44px; font-size: 36px; margin-left: 8px; margin-right: 2px; width: 16px; display: inline-block; padding-top: 1px;"></i>\n\n <span \n style="vertical-align: top; display: inline-block; line-height: 44px; height: 44px;" \n class="back-button__label"></span>\n</span>\n')}])}(),function(module){try{module=angular.module("templates-main")}catch(err){module=angular.module("templates-main",[])}module.run(["$templateCache",function($templateCache){"use strict";$templateCache.put("templates/button.tpl",'<span class="label ons-button-inner"></span>\n<span class="spinner button__spinner {{modifierTemplater(\'button--*__spinner\')}}"></span>\n')}])}(),function(module){try{module=angular.module("templates-main")}catch(err){module=angular.module("templates-main",[])}module.run(["$templateCache",function($templateCache){"use strict";$templateCache.put("templates/dialog.tpl",'<div class="dialog-mask"></div>\n<div class="dialog {{ modifierTemplater(\'dialog--*\') }}"></div>\n</div>\n')}])}(),function(module){try{module=angular.module("templates-main")}catch(err){module=angular.module("templates-main",[])}module.run(["$templateCache",function($templateCache){"use strict";$templateCache.put("templates/icon.tpl",'<i class="fa fa-{{icon}} fa-{{spin}} fa-{{fixedWidth}} fa-rotate-{{rotate}} fa-flip-{{flip}}" ng-class="sizeClass" ng-style="style"></i>\n')}])}(),function(module){try{module=angular.module("templates-main")}catch(err){module=angular.module("templates-main",[])}module.run(["$templateCache",function($templateCache){"use strict";$templateCache.put("templates/popover.tpl",'<div class="popover-mask"></div>\n<div class="popover popover--{{ direction }} {{ modifierTemplater(\'popover--*\') }}">\n <div class="popover__content {{ modifierTemplater(\'popover__content--*\') }}"></div>\n <div class="popover__{{ arrowPosition }}-arrow"></div>\n</div>\n')}])}(),function(module){try{module=angular.module("templates-main")}catch(err){module=angular.module("templates-main",[])}module.run(["$templateCache",function($templateCache){"use strict";$templateCache.put("templates/row.tpl",'<div class="row row-{{align}} ons-row-inner"></div>\n')}])}(),function(module){try{module=angular.module("templates-main")}catch(err){module=angular.module("templates-main",[])}module.run(["$templateCache",function($templateCache){"use strict";$templateCache.put("templates/sliding_menu.tpl",'<div class="onsen-sliding-menu__menu ons-sliding-menu-inner"></div>\n<div class="onsen-sliding-menu__main ons-sliding-menu-inner"></div>\n')}])}(),function(module){try{module=angular.module("templates-main")}catch(err){module=angular.module("templates-main",[])}module.run(["$templateCache",function($templateCache){"use strict";$templateCache.put("templates/split_view.tpl",'<div class="onsen-split-view__secondary full-screen ons-split-view-inner"></div>\n<div class="onsen-split-view__main full-screen ons-split-view-inner"></div>\n')}])}(),function(module){try{module=angular.module("templates-main")}catch(err){module=angular.module("templates-main",[])}module.run(["$templateCache",function($templateCache){"use strict";$templateCache.put("templates/switch.tpl",'<label class="switch {{modifierTemplater(\'switch--*\')}}">\n <input type="checkbox" class="switch__input {{modifierTemplater(\'switch--*__input\')}}" ng-model="model">\n <div class="switch__toggle {{modifierTemplater(\'switch--*__toggle\')}}"></div>\n</label>\n')}])}(),function(module){try{module=angular.module("templates-main")}catch(err){module=angular.module("templates-main",[])}module.run(["$templateCache",function($templateCache){"use strict";$templateCache.put("templates/tab.tpl",'<input type="radio" name="tab-bar-{{tabbarId}}" style="display: none">\n<button class="tab-bar__button tab-bar-inner {{tabbarModifierTemplater(\'tab-bar--*__button\')}} {{modifierTemplater(\'tab-bar__button--*\')}}" ng-click="tryToChange()">\n</button>\n')}])}(),function(module){try{module=angular.module("templates-main")}catch(err){module=angular.module("templates-main",[])}module.run(["$templateCache",function($templateCache){"use strict";$templateCache.put("templates/tab_bar.tpl",'<div class="ons-tab-bar__content tab-bar__content"></div>\n<div ng-hide="hideTabs" class="tab-bar ons-tab-bar__footer {{modifierTemplater(\'tab-bar--*\')}} ons-tabbar-inner"></div>\n')}])}(),function(module){try{module=angular.module("templates-main")}catch(err){module=angular.module("templates-main",[])}module.run(["$templateCache",function($templateCache){"use strict";$templateCache.put("templates/toolbar_button.tpl","<span class=\"toolbar-button {{modifierTemplater('toolbar-button--*')}} navigation-bar__line-height\" ng-transclude></span>\n")}])}(),window.DoorLock=function(){var DoorLock=function(options){options=options||{},this._lockList=[],this._waitList=[],this._log=options.log||function(){}};return DoorLock.generateId=function(){var i=0;return function(){return i++}}(),DoorLock.prototype={lock:function(){var self=this,unlock=function(){self._unlock(unlock)};return unlock.id=DoorLock.generateId(),this._lockList.push(unlock),this._log("lock: "+unlock.id),unlock},_unlock:function(fn){var index=this._lockList.indexOf(fn);if(-1===index)throw new Error("This function is not registered in the lock list.");this._lockList.splice(index,1),this._log("unlock: "+fn.id),this._tryToFreeWaitList()},_tryToFreeWaitList:function(){for(;!this.isLocked()&&this._waitList.length>0;)this._waitList.shift()()},waitUnlock:function(callback){if(!(callback instanceof Function))throw new Error("The callback param must be a function.");this.isLocked()?this._waitList.push(callback):callback()},isLocked:function(){return this._lockList.length>0}},DoorLock}(),window.ons=function(){"use strict";function waitDeviceReady(){var unlockDeviceReady=ons._readyLock.lock();window.addEventListener("DOMContentLoaded",function(){ons.isWebView()?window.document.addEventListener("deviceready",unlockDeviceReady,!1):unlockDeviceReady()},!1)}function waitOnsenUILoad(){var unlockOnsenUI=ons._readyLock.lock();module.run(["$compile","$rootScope","$onsen",function($compile,$rootScope,$onsen){if("loading"===document.readyState||"uninitialized"==document.readyState)window.addEventListener("DOMContentLoaded",function(){document.body.appendChild(document.createElement("ons-dummy-for-init"))});else{if(!document.body)throw new Error("Invalid initialization state.");document.body.appendChild(document.createElement("ons-dummy-for-init"))}$rootScope.$on("$ons-ready",unlockOnsenUI)}])}function initAngularModule(){module.value("$onsGlobal",ons),module.run(["$compile","$rootScope","$onsen","$q",function($compile,$rootScope,$onsen,$q){ons._onsenService=$onsen,ons._qService=$q,$rootScope.ons=window.ons,$rootScope.console=window.console,$rootScope.alert=window.alert,ons.$compile=$compile}])}function initKeyboardEvents(){ons.softwareKeyboard=new MicroEvent,ons.softwareKeyboard._visible=!1;var onShow=function(){ons.softwareKeyboard._visible=!0,ons.softwareKeyboard.emit("show")},onHide=function(){ons.softwareKeyboard._visible=!1,ons.softwareKeyboard.emit("hide")},bindEvents=function(){return"undefined"!=typeof Keyboard?(Keyboard.onshow=onShow,Keyboard.onhide=onHide,ons.softwareKeyboard.emit("init",{visible:Keyboard.isVisible}),!0):"undefined"!=typeof cordova.plugins&&"undefined"!=typeof cordova.plugins.Keyboard?(window.addEventListener("native.keyboardshow",onShow),window.addEventListener("native.keyboardhide",onHide),ons.softwareKeyboard.emit("init",{visible:cordova.plugins.Keyboard.isVisible}),!0):!1},noPluginError=function(){console.warn("ons-keyboard: Cordova Keyboard plugin is not present.")};document.addEventListener("deviceready",function(){bindEvents()||((document.querySelector("[ons-keyboard-active]")||document.querySelector("[ons-keyboard-inactive]"))&&noPluginError(),ons.softwareKeyboard.on=noPluginError)})}function createOnsenFacade(){var ons={_readyLock:new DoorLock,_onsenService:null,_config:{autoStatusBarFill:!0},_unlockersDict:{},componentBase:window,bootstrap:function(name,deps){angular.isArray(name)&&(deps=name,name=void 0),name||(name="myOnsenApp"),deps=["onsen"].concat(angular.isArray(deps)?deps:[]);var module=angular.module(name,deps),doc=window.document;if("loading"==doc.readyState||"uninitialized"==doc.readyState||"interactive"==doc.readyState)doc.addEventListener("DOMContentLoaded",function(){angular.bootstrap(doc.documentElement,[name])},!1);else{if(!doc.documentElement)throw new Error("Invalid state");angular.bootstrap(doc.documentElement,[name])}return module},enableAutoStatusBarFill:function(){if(this.isReady())throw new Error("This method must be called before ons.isReady() is true.");this._config.autoStatusBarFill=!0},disableAutoStatusBarFill:function(){if(this.isReady())throw new Error("This method must be called before ons.isReady() is true.");this._config.autoStatusBarFill=!1},findParentComponentUntil:function(name,dom){var element;return dom instanceof HTMLElement?element=angular.element(dom):dom instanceof angular.element?element=dom:dom.target&&(element=angular.element(dom.target)),element.inheritedData(name)},setDefaultDeviceBackButtonListener:function(listener){this._getOnsenService().getDefaultDeviceBackButtonHandler().setListener(listener)},disableDeviceBackButtonHandler:function(){this._getOnsenService().DeviceBackButtonHandler.disable()},enableDeviceBackButtonHandler:function(){this._getOnsenService().DeviceBackButtonHandler.enable()},findComponent:function(selector,dom){var target=(dom?dom:document).querySelector(selector);return target?angular.element(target).data(target.nodeName.toLowerCase())||null:null},isReady:function(){return!ons._readyLock.isLocked()},compile:function(dom){if(!ons.$compile)throw new Error("ons.$compile() is not ready. Wait for initialization with ons.ready().");if(!(dom instanceof HTMLElement))throw new Error("First argument must be an instance of HTMLElement.");var scope=angular.element(dom).scope();if(!scope)throw new Error("AngularJS Scope is null. Argument DOM element must be attached in DOM document.");ons.$compile(dom)(scope)},_getOnsenService:function(){if(!this._onsenService)throw new Error("$onsen is not loaded, wait for ons.ready().");return this._onsenService},ready:function(callback){if(callback instanceof Function)ons.isReady()?callback():ons._readyLock.waitUnlock(callback);else if(angular.isArray(callback)&&arguments[1]instanceof Function){var dependencies=callback;callback=arguments[1],ons.ready(function(){var $onsen=ons._getOnsenService();$onsen.waitForVariables(dependencies,callback)})}},isWebView:function(){if("loading"===document.readyState||"uninitialized"==document.readyState)throw new Error("isWebView() method is available after dom contents loaded.");return!!(window.cordova||window.phonegap||window.PhoneGap)},createAlertDialog:function(page,options){if(options=options||{},!page)throw new Error("Page url must be defined.");var alertDialog=angular.element("<ons-alert-dialog>"),$onsen=this._getOnsenService();return angular.element(document.body).append(angular.element(alertDialog)),$onsen.getPageHTMLAsync(page).then(function(html){var div=document.createElement("div");div.innerHTML=html;for(var el=angular.element(div.querySelector("ons-alert-dialog")),attrs=el.prop("attributes"),i=0,l=attrs.length;l>i;i++)alertDialog.attr(attrs[i].name,attrs[i].value);alertDialog.html(el.html());var parentScope;return options.parentScope?(parentScope=options.parentScope.$new(),ons.$compile(alertDialog)(parentScope)):ons.compile(alertDialog[0]),el.attr("disabled")&&alertDialog.attr("disabled","disabled"),parentScope&&(alertDialog.data("ons-alert-dialog")._parentScope=parentScope),alertDialog.data("ons-alert-dialog")})},createDialog:function(page,options){if(options=options||{},!page)throw new Error("Page url must be defined.");var dialog=angular.element("<ons-dialog>"),$onsen=this._getOnsenService();return angular.element(document.body).append(angular.element(dialog)),$onsen.getPageHTMLAsync(page).then(function(html){var div=document.createElement("div");div.innerHTML=html;for(var el=angular.element(div.querySelector("ons-dialog")),attrs=el.prop("attributes"),i=0,l=attrs.length;l>i;i++)dialog.attr(attrs[i].name,attrs[i].value);dialog.html(el.html());var parentScope;options.parentScope?(parentScope=options.parentScope.$new(),ons.$compile(dialog)(parentScope)):ons.compile(dialog[0]),el.attr("disabled")&&dialog.attr("disabled","disabled");var deferred=ons._qService.defer();return dialog.on("ons-dialog:init",function(e){var child=dialog[0].querySelector(".dialog");if(el[0].hasAttribute("style")){var parentStyle=el[0].getAttribute("style"),childStyle=child.getAttribute("style"),newStyle=function(a,b){var c=(";"===a.substr(-1)?a:a+";")+(";"===b.substr(-1)?b:b+";");return c}(parentStyle,childStyle);child.setAttribute("style",newStyle)}parentScope&&(e.component._parentScope=parentScope),deferred.resolve(e.component)}),deferred.promise})},createPopover:function(page,options){if(options=options||{},!page)throw new Error("Page url must be defined.");var popover=angular.element("<ons-popover>"),$onsen=this._getOnsenService();return angular.element(document.body).append(angular.element(popover)),$onsen.getPageHTMLAsync(page).then(function(html){var div=document.createElement("div");div.innerHTML=html;for(var el=angular.element(div.querySelector("ons-popover")),attrs=el.prop("attributes"),i=0,l=attrs.length;l>i;i++)popover.attr(attrs[i].name,attrs[i].value);popover.html(el.html());var parentScope;options.parentScope?(parentScope=options.parentScope.$new(),ons.$compile(popover)(parentScope)):ons.compile(popover[0]),el.attr("disabled")&&popover.attr("disabled","disabled");var deferred=ons._qService.defer();return popover.on("ons-popover:init",function(e){var child=popover[0].querySelector(".popover"); if(el[0].hasAttribute("style")){var parentStyle=el[0].getAttribute("style"),childStyle=child.getAttribute("style"),newStyle=function(a,b){var c=(";"===a.substr(-1)?a:a+";")+(";"===b.substr(-1)?b:b+";");return c}(parentStyle,childStyle);child.setAttribute("style",newStyle)}parentScope&&(e.component._parentScope=parentScope),deferred.resolve(e.component)}),deferred.promise})}};return ons}var module=angular.module("onsen",["templates-main"]);angular.module("onsen.directives",["onsen"]);var ons=createOnsenFacade();return initKeyboardEvents(),waitDeviceReady(),waitOnsenUILoad(),initAngularModule(),ons}(),function(){"use strict";var module=angular.module("onsen");module.factory("AlertDialogView",["$onsen","DialogAnimator","SlideDialogAnimator","AndroidAlertDialogAnimator","IOSAlertDialogAnimator",function($onsen,DialogAnimator,SlideDialogAnimator,AndroidAlertDialogAnimator,IOSAlertDialogAnimator){var AlertDialogView=Class.extend({init:function(scope,element,attrs){if(this._scope=scope,this._element=element,this._attrs=attrs,this._element.css({display:"none",zIndex:20001}),this._dialog=element,this._visible=!1,this._doorLock=new DoorLock,this._animation=AlertDialogView._animatorDict["undefined"!=typeof attrs.animation?attrs.animation:"default"],!this._animation)throw new Error("No such animation: "+attrs.animation);this._deviceBackButtonHandler=$onsen.DeviceBackButtonHandler.create(this._element,this._onDeviceBackButton.bind(this)),this._createMask(attrs.maskColor),this._scope.$on("$destroy",this._destroy.bind(this))},show:function(options){options=options||{};var cancel=!1,callback=options.callback||function(){};this.emit("preshow",{alertDialog:this,cancel:function(){cancel=!0}}),cancel||this._doorLock.waitUnlock(function(){var unlock=this._doorLock.lock(),animation=this._animation;this._mask.css("display","block"),this._mask.css("opacity",1),this._element.css("display","block"),options.animation&&(animation=AlertDialogView._animatorDict[options.animation]),animation.show(this,function(){this._visible=!0,unlock(),this.emit("postshow",{alertDialog:this}),callback()}.bind(this))}.bind(this))},hide:function(options){options=options||{};var cancel=!1,callback=options.callback||function(){};this.emit("prehide",{alertDialog:this,cancel:function(){cancel=!0}}),cancel||this._doorLock.waitUnlock(function(){var unlock=this._doorLock.lock(),animation=this._animation;options.animation&&(animation=AlertDialogView._animatorDict[options.animation]),animation.hide(this,function(){this._element.css("display","none"),this._mask.css("display","none"),this._visible=!1,unlock(),this.emit("posthide",{alertDialog:this}),callback()}.bind(this))}.bind(this))},isShown:function(){return this._visible},destroy:function(){this._parentScope?(this._parentScope.$destroy(),this._parentScope=null):this._scope.$destroy()},_destroy:function(){this.emit("destroy"),this._mask.off(),this._element.remove(),this._mask.remove(),this._deviceBackButtonHandler.destroy(),this._deviceBackButtonHandler=this._scope=this._attrs=this._element=this._mask=null},setDisabled:function(disabled){if("boolean"!=typeof disabled)throw new Error("Argument must be a boolean.");disabled?this._element.attr("disabled",!0):this._element.removeAttr("disabled")},isDisabled:function(){return this._element[0].hasAttribute("disabled")},setCancelable:function(cancelable){if("boolean"!=typeof cancelable)throw new Error("Argument must be a boolean.");cancelable?this._element.attr("cancelable",!0):this._element.removeAttr("cancelable")},isCancelable:function(){return this._element[0].hasAttribute("cancelable")},_cancel:function(){this.isCancelable()&&this.hide({callback:function(){this.emit("cancel")}.bind(this)})},_onDeviceBackButton:function(event){this.isCancelable()?this._cancel.bind(this)():event.callParentHandler()},_createMask:function(color){this._mask=angular.element("<div>").addClass("alert-dialog-mask").css({zIndex:2e4,display:"none"}),this._mask.on("click",this._cancel.bind(this)),color&&this._mask.css("background-color",color),angular.element(document.body).append(this._mask)}});return AlertDialogView._animatorDict={"default":$onsen.isAndroid()?new AndroidAlertDialogAnimator:new IOSAlertDialogAnimator,fade:$onsen.isAndroid()?new AndroidAlertDialogAnimator:new IOSAlertDialogAnimator,slide:new SlideDialogAnimator,none:new DialogAnimator},AlertDialogView.registerAnimator=function(name,animator){if(!(animator instanceof DialogAnimator))throw new Error('"animator" param must be an instance of DialogAnimator');this._animatorDict[name]=animator},MicroEvent.mixin(AlertDialogView),AlertDialogView}])}(),function(){"use strict;";var module=angular.module("onsen");module.factory("AndroidAlertDialogAnimator",["DialogAnimator",function(DialogAnimator){var AndroidAlertDialogAnimator=DialogAnimator.extend({timing:"cubic-bezier(.1, .7, .4, 1)",duration:.2,init:function(options){options=options||{},this.timing=options.timing||this.timing,this.duration=void 0!==options.duration?options.duration:this.duration},show:function(dialog,callback){callback=callback?callback:function(){},animit.runAll(animit(dialog._mask[0]).queue({opacity:0}).queue({opacity:1},{duration:this.duration,timing:this.timing}),animit(dialog._dialog[0]).queue({css:{transform:"translate3d(-50%, -50%, 0) scale3d(0.9, 0.9, 1.0)",opacity:0},duration:0}).queue({css:{transform:"translate3d(-50%, -50%, 0) scale3d(1.0, 1.0, 1.0)",opacity:1},duration:this.duration,timing:this.timing}).resetStyle().queue(function(done){callback(),done()}))},hide:function(dialog,callback){callback=callback?callback:function(){},animit.runAll(animit(dialog._mask[0]).queue({opacity:1}).queue({opacity:0},{duration:this.duration,timing:this.timing}),animit(dialog._dialog[0]).queue({css:{transform:"translate3d(-50%, -50%, 0) scale3d(1.0, 1.0, 1.0)",opacity:1},duration:0}).queue({css:{transform:"translate3d(-50%, -50%, 0) scale3d(0.9, 0.9, 1.0)",opacity:0},duration:this.duration,timing:this.timing}).resetStyle().queue(function(done){callback(),done()}))}});return AndroidAlertDialogAnimator}])}(),function(){"use strict;";var module=angular.module("onsen");module.factory("AndroidDialogAnimator",["DialogAnimator",function(DialogAnimator){var AndroidDialogAnimator=DialogAnimator.extend({timing:"ease-in-out",duration:.3,init:function(options){options=options||{},this.timing=options.timing||this.timing,this.duration=void 0!==options.duration?options.duration:this.duration},show:function(dialog,callback){callback=callback?callback:function(){},animit.runAll(animit(dialog._mask[0]).queue({opacity:0}).queue({opacity:1},{duration:this.duration,timing:this.timing}),animit(dialog._dialog[0]).queue({css:{transform:"translate3d(-50%, -60%, 0)",opacity:0},duration:0}).queue({css:{transform:"translate3d(-50%, -50%, 0)",opacity:1},duration:this.duration,timing:this.timing}).resetStyle().queue(function(done){callback(),done()}))},hide:function(dialog,callback){callback=callback?callback:function(){},animit.runAll(animit(dialog._mask[0]).queue({opacity:1}).queue({opacity:0},{duration:this.duration,timing:this.timing}),animit(dialog._dialog[0]).queue({css:{transform:"translate3d(-50%, -50%, 0)",opacity:1},duration:0}).queue({css:{transform:"translate3d(-50%, -60%, 0)",opacity:0},duration:this.duration,timing:this.timing}).resetStyle().queue(function(done){callback(),done()}))}});return AndroidDialogAnimator}])}(),function(){"use strict";var module=angular.module("onsen");module.factory("ButtonView",["$onsen",function($onsen){var ButtonView=Class.extend({init:function(scope,element,attrs){this._element=element,this._scope=scope,this._attrs=attrs},startSpin:function(){this._attrs.$set("shouldSpin","true")},stopSpin:function(){this._attrs.$set("shouldSpin","false")},isSpinning:function(){return"true"===this._attrs.shouldSpin},setSpinAnimation:function(animation){this._scope.$apply(function(){var animations=["slide-left","slide-right","slide-up","slide-down","expand-left","expand-right","expand-up","expand-down","zoom-out","zoom-in"];animations.indexOf(animation)<0&&(console.warn("Animation "+animation+"doesn't exist."),animation="slide-left"),this._scope.animation=animation}.bind(this))},isDisabled:function(){return this._element[0].hasAttribute("disabled")},setDisabled:function(disabled){if("boolean"!=typeof disabled)throw new Error("Argument must be a boolean.");disabled?this._element[0].setAttribute("disabled",""):this._element[0].removeAttribute("disabled")}});return MicroEvent.mixin(ButtonView),ButtonView}])}(),function(){"use strict;";var module=angular.module("onsen");module.factory("CarouselView",["$onsen",function($onsen){var VerticalModeTrait={_getScrollDelta:function(event){return event.gesture.deltaY},_getScrollVelocity:function(event){return event.gesture.velocityY},_getElementSize:function(){return this._currentElementSize||(this._currentElementSize=this._element[0].getBoundingClientRect().height),this._currentElementSize},_generateScrollTransform:function(scroll){return"translate3d(0px, "+-scroll+"px, 0px)"},_layoutCarouselItems:function(){for(var children=this._getCarouselItemElements(),sizeAttr=this._getCarouselItemSizeAttr(),sizeInfo=this._decomposeSizeString(sizeAttr),i=0;i<children.length;i++)angular.element(children[i]).css({position:"absolute",height:sizeAttr,width:"100%",visibility:"visible",left:"0px",top:i*sizeInfo.number+sizeInfo.unit})}},HorizontalModeTrait={_getScrollDelta:function(event){return event.gesture.deltaX},_getScrollVelocity:function(event){return event.gesture.velocityX},_getElementSize:function(){return this._currentElementSize||(this._currentElementSize=this._element[0].getBoundingClientRect().width),this._currentElementSize},_generateScrollTransform:function(scroll){return"translate3d("+-scroll+"px, 0px, 0px)"},_layoutCarouselItems:function(){for(var children=this._getCarouselItemElements(),sizeAttr=this._getCarouselItemSizeAttr(),sizeInfo=this._decomposeSizeString(sizeAttr),i=0;i<children.length;i++)angular.element(children[i]).css({position:"absolute",width:sizeAttr,height:"100%",top:"0px",visibility:"visible",left:i*sizeInfo.number+sizeInfo.unit})}},CarouselView=Class.extend({_element:void 0,_scope:void 0,_doorLock:void 0,_scroll:void 0,init:function(scope,element,attrs){this._element=element,this._scope=scope,this._attrs=attrs,this._doorLock=new DoorLock,this._scroll=0,this._lastActiveIndex=0,this._bindedOnDrag=this._onDrag.bind(this),this._bindedOnDragEnd=this._onDragEnd.bind(this),this._bindedOnResize=this._onResize.bind(this),this._mixin(this._isVertical()?VerticalModeTrait:HorizontalModeTrait),this._prepareEventListeners(),this._layoutCarouselItems(),this._setupInitialIndex(),this._attrs.$observe("direction",this._onDirectionChange.bind(this)),this._scope.$on("$destroy",this._destroy.bind(this)),this._saveLastState()},_onResize:function(){this.refresh()},_onDirectionChange:function(){this._element.css(this._isVertical()?{overflowX:"auto",overflowY:""}:{overflowX:"",overflowY:"auto"})},_saveLastState:function(){this._lastState={elementSize:this._getCarouselItemSize(),carouselElementCount:this._getCarouselItemCount(),width:this._getCarouselItemSize()*this._getCarouselItemCount()}},_getCarouselItemSize:function(){var sizeAttr=this._getCarouselItemSizeAttr(),sizeInfo=this._decomposeSizeString(sizeAttr),elementSize=this._getElementSize();if("%"===sizeInfo.unit)return Math.round(sizeInfo.number/100*elementSize);if("px"===sizeInfo.unit)return sizeInfo.number;throw new Error("Invalid state")},_getInitialIndex:function(){var index=parseInt(this._element.attr("initial-index"),10);return"number"!=typeof index||isNaN(index)?0:Math.max(Math.min(index,this._getCarouselItemCount()-1),0)},_getCarouselItemSizeAttr:function(){var attrName="item-"+(this._isVertical()?"height":"width"),itemSizeAttr=(""+this._element.attr(attrName)).trim();return itemSizeAttr.match(/^\d+(px|%)$/)?itemSizeAttr:"100%"},_decomposeSizeString:function(size){var matches=size.match(/^(\d+)(px|%)/);return{number:parseInt(matches[1],10),unit:matches[2]}},_setupInitialIndex:function(){this._scroll=this._getCarouselItemSize()*this._getInitialIndex(),this._lastActiveIndex=this._getInitialIndex(),this._scrollTo(this._scroll)},setSwipeable:function(swipeable){swipeable?this._element[0].setAttribute("swipeable",""):this._element[0].removeAttribute("swipeable")},isSwipeable:function(){return this._element[0].hasAttribute("swipeable")},setAutoScrollRatio:function(ratio){if(0>ratio||ratio>1)throw new Error("Invalid ratio.");this._element[0].setAttribute("auto-scroll-ratio",ratio)},getAutoScrollRatio:function(ratio){var attr=this._element[0].getAttribute("auto-scroll-ratio");if(!attr)return.5;var scrollRatio=parseFloat(attr);if(0>scrollRatio||scrollRatio>1)throw new Error("Invalid ratio.");return isNaN(scrollRatio)?.5:scrollRatio},setActiveCarouselItemIndex:function(index,options){options=options||{},index=Math.max(0,Math.min(index,this._getCarouselItemCount()-1));var scroll=this._getCarouselItemSize()*index,max=this._calculateMaxScroll();this._scroll=Math.max(0,Math.min(max,scroll)),this._scrollTo(this._scroll,{animate:"none"!==options.animation,callback:options.callback}),this._tryFirePostChangeEvent()},getActiveCarouselItemIndex:function(){var scroll=this._scroll,count=this._getCarouselItemCount(),size=this._getCarouselItemSize();if(0>scroll)return 0;for(var i=0;count>i;i++)if(scroll>=size*i&&size*(i+1)>scroll)return i;return i},next:function(options){this.setActiveCarouselItemIndex(this.getActiveCarouselItemIndex()+1,options)},prev:function(options){this.setActiveCarouselItemIndex(this.getActiveCarouselItemIndex()-1,options)},setAutoScrollEnabled:function(enabled){enabled?this._element[0].setAttribute("auto-scroll",""):this._element[0].removeAttribute("auto-scroll")},isAutoScrollEnabled:function(enabled){return this._element[0].hasAttribute("auto-scroll")},setDisabled:function(disabled){disabled?this._element[0].setAttribute("disabled",""):this._element[0].removeAttribute("disabled")},isDisabled:function(){return this._element[0].hasAttribute("disabled")},setOverscrollable:function(scrollable){scrollable?this._element[0].setAttribute("overscrollable",""):this._element[0].removeAttribute("overscrollable")},_mixin:function(trait){Object.keys(trait).forEach(function(key){this[key]=trait[key]}.bind(this))},_isEnabledChangeEvent:function(){var elementSize=this._getElementSize(),carouselItemSize=this._getCarouselItemSize();return this.isAutoScrollEnabled()&&elementSize===carouselItemSize},_isVertical:function(){return"vertical"===this._element.attr("direction")},_prepareEventListeners:function(){this._hammer=new Hammer(this._element[0],{dragMinDistance:1}),this._hammer.on("drag dragleft dragright dragup dragdown swipe swipeleft swiperight swipeup swipedown",this._bindedOnDrag),this._hammer.on("dragend",this._bindedOnDragEnd),angular.element(window).on("resize",this._bindedOnResize)},_tryFirePostChangeEvent:function(){var currentIndex=this.getActiveCarouselItemIndex();if(this._lastActiveIndex!==currentIndex){var lastActiveIndex=this._lastActiveIndex;this._lastActiveIndex=currentIndex,this.emit("postchange",{carousel:this,activeIndex:currentIndex,lastActiveIndex:lastActiveIndex})}},_onDrag:function(event){if(this.isSwipeable()){var direction=event.gesture.direction;if((!this._isVertical()||"left"!==direction&&"right"!==direction)&&(this._isVertical()||"up"!==direction&&"down"!==direction)){event.stopPropagation(),this._lastDragEvent=event;var scroll=this._scroll-this._getScrollDelta(event);this._scrollTo(scroll),event.gesture.preventDefault(),this._tryFirePostChangeEvent()}}},_onDragEnd:function(event){if(this._currentElementSize=void 0,this._carouselItemElements=void 0,this.isSwipeable()){if(this._scroll=this._scroll-this._getScrollDelta(event),0!==this._getScrollDelta(event)&&event.stopPropagation(),this._isOverScroll(this._scroll)){var waitForAction=!1;this.emit("overscroll",{carousel:this,activeIndex:this.getActiveCarouselItemIndex(),direction:this._getOverScrollDirection(),waitToReturn:function(promise){waitForAction=!0,promise.then(function(){this._scrollToKillOverScroll()}.bind(this))}.bind(this)}),waitForAction||this._scrollToKillOverScroll()}else this._startMomemtumScroll(event);this._lastDragEvent=null,event.gesture.preventDefault()}},_getTouchEvents:function(){var EVENTS=["drag","dragstart","dragend","dragup","dragdown","dragleft","dragright","swipe","swipeup","swipedown","swipeleft","swiperight"];return EVENTS.join(" ")},isOverscrollable:function(){return this._element[0].hasAttribute("overscrollable")},_startMomemtumScroll:function(event){if(this._lastDragEvent){var velocity=this._getScrollVelocity(this._lastDragEvent),duration=.3,scrollDelta=100*duration*velocity,scroll=this._scroll+(this._getScrollDelta(this._lastDragEvent)>0?-scrollDelta:scrollDelta);scroll=this._normalizeScrollPosition(scroll),this._scroll=scroll,animit(this._getCarouselItemElements()).queue({transform:this._generateScrollTransform(this._scroll)},{duration:duration,timing:"cubic-bezier(.1, .7, .1, 1)"}).queue(function(done){done(),this._tryFirePostChangeEvent()}.bind(this)).play()}},_normalizeScrollPosition:function(scroll){var max=this._calculateMaxScroll();if(this.isAutoScrollEnabled()){for(var arr=[],size=this._getCarouselItemSize(),i=0;i<this._getCarouselItemCount();i++)max>=i*size&&arr.push(i*size);arr.push(max),arr.sort(function(left,right){return left=Math.abs(left-scroll),right=Math.abs(right-scroll),left-right}),arr=arr.filter(function(item,pos){return!pos||item!=arr[pos-1]});var lastScroll=this._lastActiveIndex*size,scrollRatio=Math.abs(scroll-lastScroll)/size;return scrollRatio<=this.getAutoScrollRatio()?lastScroll:scrollRatio>this.getAutoScrollRatio()&&1>scrollRatio&&arr[0]===lastScroll&&arr.length>1?arr[1]:arr[0]}return Math.max(0,Math.min(max,scroll))},_getCarouselItemElements:function(){for(var nodeList=this._element[0].children,rv=[],i=nodeList.length;i--;)rv.unshift(nodeList[i]);return rv=rv.filter(function(item){return"ons-carousel-item"===item.nodeName.toLowerCase()})},_scrollTo:function(scroll,options){function normalizeScroll(scroll){var ratio=.35;if(0>scroll)return isOverscrollable?Math.round(scroll*ratio):0;var maxScroll=self._calculateMaxScroll();return scroll>maxScroll?isOverscrollable?maxScroll+Math.round((scroll-maxScroll)*ratio):maxScroll:scroll}options=options||{};var self=this,isOverscrollable=this.isOverscrollable();options.animate?animit(this._getCarouselItemElements()).queue({transform:this._generateScrollTransform(normalizeScroll(scroll))},{duration:.3,timing:"cubic-bezier(.1, .7, .1, 1)"}).play(options.callback):animit(this._getCarouselItemElements()).queue({transform:this._generateScrollTransform(normalizeScroll(scroll))}).play(options.callback)},_calculateMaxScroll:function(){var max=this._getCarouselItemCount()*this._getCarouselItemSize()-this._getElementSize();return Math.ceil(0>max?0:max)},_isOverScroll:function(scroll){return 0>scroll||scroll>this._calculateMaxScroll()?!0:!1},_getOverScrollDirection:function(){return this._isVertical()?this._scroll<=0?"up":"down":this._scroll<=0?"left":"right"},_scrollToKillOverScroll:function(){var duration=.4;if(this._scroll<0)return animit(this._getCarouselItemElements()).queue({transform:this._generateScrollTransform(0)},{duration:duration,timing:"cubic-bezier(.1, .4, .1, 1)"}).queue(function(done){done(),this._tryFirePostChangeEvent()}.bind(this)).play(),void(this._scroll=0);var maxScroll=this._calculateMaxScroll();return maxScroll<this._scroll?(animit(this._getCarouselItemElements()).queue({transform:this._generateScrollTransform(maxScroll)},{duration:duration,timing:"cubic-bezier(.1, .4, .1, 1)"}).queue(function(done){done(),this._tryFirePostChangeEvent()}.bind(this)).play(),void(this._scroll=maxScroll)):void 0},_getCarouselItemCount:function(){return this._getCarouselItemElements().length},refresh:function(){if(0!==this._getCarouselItemSize()){if(this._mixin(this._isVertical()?VerticalModeTrait:HorizontalModeTrait),this._layoutCarouselItems(),this._lastState&&this._lastState.width>0){var scroll=this._scroll;this._isOverScroll(scroll)?this._scrollToKillOverScroll():(this.isAutoScrollEnabled()&&(scroll=this._normalizeScrollPosition(scroll)),this._scrollTo(scroll))}this._saveLastState(),this.emit("refresh",{carousel:this})}},first:function(){this.setActiveCarouselItemIndex(0)},last:function(){this.setActiveCarouselItemIndex(Math.max(this._getCarouselItemCount()-1,0))},_destroy:function(){this.emit("destroy"),this._hammer.off("drag dragleft dragright dragup dragdown swipe swipeleft swiperight swipeup swipedown",this._bindedOnDrag),this._hammer.off("dragend",this._bindedOnDragEnd),angular.element(window).off("resize",this._bindedOnResize),this._element=this._scope=this._attrs=null}});return MicroEvent.mixin(CarouselView),CarouselView}])}(),function(){"use strict";var module=angular.module("onsen");module.factory("DialogView",["$onsen","DialogAnimator","IOSDialogAnimator","AndroidDialogAnimator","SlideDialogAnimator",function($onsen,DialogAnimator,IOSDialogAnimator,AndroidDialogAnimator,SlideDialogAnimator){var DialogView=Class.extend({init:function(scope,element,attrs){if(this._scope=scope,this._element=element,this._attrs=attrs,this._element.css("display","none"),this._dialog=angular.element(element[0].querySelector(".dialog")),this._mask=angular.element(element[0].querySelector(".dialog-mask")),this._dialog.css("z-index",20001),this._mask.css("z-index",2e4),this._mask.on("click",this._cancel.bind(this)),this._visible=!1,this._doorLock=new DoorLock,this._animation=DialogView._animatorDict["undefined"!=typeof attrs.animation?attrs.animation:"default"],!this._animation)throw new Error("No such animation: "+attrs.animation);this._deviceBackButtonHandler=$onsen.DeviceBackButtonHandler.create(this._element,this._onDeviceBackButton.bind(this)),this._scope.$on("$destroy",this._destroy.bind(this))},getDeviceBackButtonHandler:function(){return this._deviceBackButtonHandler},_getMaskColor:function(){return this._element[0].getAttribute("mask-color")||"rgba(0, 0, 0, 0.2)"},show:function(options){options=options||{};var cancel=!1,callback=options.callback||function(){};this.emit("preshow",{dialog:this,cancel:function(){cancel=!0}}),cancel||this._doorLock.waitUnlock(function(){var unlock=this._doorLock.lock(),animation=this._animation;this._element.css("display","block"),this._mask.css("opacity",1),this._mask.css("backgroundColor",this._getMaskColor()),options.animation&&(animation=DialogView._animatorDict[options.animation]),animation.show(this,function(){this._visible=!0,unlock(),this.emit("postshow",{dialog:this}),callback()}.bind(this))}.bind(this))},hide:function(options){options=options||{};var cancel=!1,callback=options.callback||function(){};this.emit("prehide",{dialog:this,cancel:function(){cancel=!0}}),cancel||this._doorLock.waitUnlock(function(){var unlock=this._doorLock.lock(),animation=this._animation;options.animation&&(animation=DialogView._animatorDict[options.animation]),animation.hide(this,function(){this._element.css("display","none"),this._visible=!1,unlock(),this.emit("posthide",{dialog:this}),callback()}.bind(this))}.bind(this))},isShown:function(){return this._visible},destroy:function(){this._parentScope?(this._parentScope.$destroy(),this._parentScope=null):this._scope.$destroy()},_destroy:function(){this.emit("destroy"),this._element.remove(),this._deviceBackButtonHandler.destroy(),this._mask.off(),this._deviceBackButtonHandler=this._scope=this._attrs=this._element=this._dialog=this._mask=null},setDisabled:function(disabled){if("boolean"!=typeof disabled)throw new Error("Argument must be a boolean.");disabled?this._element.attr("disabled",!0):this._element.removeAttr("disabled")},isDisabled:function(){return this._element[0].hasAttribute("disabled")},setCancelable:function(cancelable){if("boolean"!=typeof cancelable)throw new Error("Argument must be a boolean.");cancelable?this._element.attr("cancelable",!0):this._element.removeAttr("cancelable")},isCancelable:function(){return this._element[0].hasAttribute("cancelable")},_cancel:function(){this.isCancelable()&&this.hide({callback:function(){this.emit("cancel")}.bind(this)})},_onDeviceBackButton:function(event){this.isCancelable()?this._cancel.bind(this)():event.callParentHandler()}});return DialogView._animatorDict={"default":$onsen.isAndroid()?new AndroidDialogAnimator:new IOSDialogAnimator,fade:$onsen.isAndroid()?new AndroidDialogAnimator:new IOSDialogAnimator,slide:new SlideDialogAnimator,none:new DialogAnimator},DialogView.registerAnimator=function(name,animator){if(!(animator instanceof DialogAnimator))throw new Error('"animator" param must be an instance of DialogAnimator');this._animatorDict[name]=animator},MicroEvent.mixin(DialogView),DialogView}])}(),function(){"use strict;";var module=angular.module("onsen");module.factory("DialogAnimator",function(){var DialogAnimator=Class.extend({show:function(dialog,callback){callback()},hide:function(dialog,callback){callback()}});return DialogAnimator})}(),function(){"use strict";var module=angular.module("onsen");module.factory("FadePopoverAnimator",["PopoverAnimator",function(PopoverAnimator){var FadePopoverAnimator=PopoverAnimator.extend({timing:"cubic-bezier(.1, .7, .4, 1)",duration:.2,init:function(options){options=options||{},this.timing=options.timing||this.timing,this.duration=void 0!==options.duration?options.duration:this.duration},show:function(popover,callback){var pop=popover._element[0].querySelector(".popover"),mask=popover._element[0].querySelector(".popover-mask");animit.runAll(animit(mask).queue({opacity:0}).queue({opacity:1},{duration:this.duration,timing:this.timing}),animit(pop).queue({transform:"scale3d(1.3, 1.3, 1.0)",opacity:0}).queue({transform:"scale3d(1.0, 1.0, 1.0)",opacity:1},{duration:this.duration,timing:this.timing}).resetStyle().queue(function(done){callback(),done()}))},hide:function(popover,callback){var pop=popover._element[0].querySelector(".popover"),mask=popover._element[0].querySelector(".popover-mask");animit.runAll(animit(mask).queue({opacity:1}).queue({opacity:0},{duration:this.duration,timing:this.timing}),animit(pop).queue({opacity:1}).queue({opacity:0},{duration:this.duration,timing:this.timing}).resetStyle().queue(function(done){callback(),done()}))}});return FadePopoverAnimator}])}(),function(){"use strict;";var module=angular.module("onsen");module.factory("FadeTransitionAnimator",["NavigatorTransitionAnimator",function(NavigatorTransitionAnimator){var FadeTransitionAnimator=NavigatorTransitionAnimator.extend({push:function(enterPage,leavePage,callback){animit.runAll(animit([enterPage.getPageView().getContentElement(),enterPage.getPageView().getBackgroundElement()]).queue({css:{transform:"translate3D(0, 0, 0)",opacity:0},duration:0}).queue({css:{transform:"translate3D(0, 0, 0)",opacity:1},duration:.4,timing:"linear"}).resetStyle().queue(function(done){callback(),done()}),animit(enterPage.getPageView().getToolbarElement()).queue({css:{transform:"translate3D(0, 0, 0)",opacity:0},duration:0}).queue({css:{transform:"translate3D(0, 0, 0)",opacity:1},duration:.4,timing:"linear"}).resetStyle())},pop:function(enterPage,leavePage,callback){animit.runAll(animit([leavePage.getPageView().getContentElement(),leavePage.getPageView().getBackgroundElement()]).queue({css:{transform:"translate3D(0, 0, 0)",opacity:1},duration:0}).queue({css:{transform:"translate3D(0, 0, 0)",opacity:0},duration:.4,timing:"linear"}).queue(function(done){callback(),done()}),animit(leavePage.getPageView().getToolbarElement()).queue({css:{transform:"translate3D(0, 0, 0)",opacity:1},duration:0}).queue({css:{transform:"translate3D(0, 0, 0)",opacity:0},duration:.4,timing:"linear"}))}});return FadeTransitionAnimator}])}(),function(){"use strict";var module=angular.module("onsen");module.factory("GenericView",["$onsen",function($onsen){var GenericView=Class.extend({init:function(scope,element,attrs){this._element=element,this._scope=scope}});return MicroEvent.mixin(GenericView),GenericView}])}(),function(){"use strict;";var module=angular.module("onsen");module.factory("IOSAlertDialogAnimator",["DialogAnimator",function(DialogAnimator){var IOSAlertDialogAnimator=DialogAnimator.extend({timing:"cubic-bezier(.1, .7, .4, 1)",duration:.2,init:function(options){options=options||{},this.timing=options.timing||this.timing,this.duration=void 0!==options.duration?options.duration:this.duration},show:function(dialog,callback){callback=callback?callback:function(){},animit.runAll(animit(dialog._mask[0]).queue({opacity:0}).queue({opacity:1},{duration:this.duration,timing:this.timing}),animit(dialog._dialog[0]).queue({css:{transform:"translate3d(-50%, -50%, 0) scale3d(1.3, 1.3, 1.0)",opacity:0},duration:0}).queue({css:{transform:"translate3d(-50%, -50%, 0) scale3d(1.0, 1.0, 1.0)",opacity:1},duration:this.duration,timing:this.timing}).resetStyle().queue(function(done){callback(),done()}))},hide:function(dialog,callback){callback=callback?callback:function(){},animit.runAll(animit(dialog._mask[0]).queue({opacity:1}).queue({opacity:0},{duration:this.duration,timing:this.timing}),animit(dialog._dialog[0]).queue({css:{opacity:1},duration:0}).queue({css:{opacity:0},duration:this.duration,timing:this.timing}).resetStyle().queue(function(done){callback(),done()}))}});return IOSAlertDialogAnimator}])}(),function(){"use strict;";var module=angular.module("onsen");module.factory("IOSDialogAnimator",["DialogAnimator",function(DialogAnimator){var IOSDialogAnimator=DialogAnimator.extend({timing:"ease-in-out",duration:.3,init:function(options){options=options||{},this.timing=options.timing||this.timing,this.duration=void 0!==options.duration?options.duration:this.duration},show:function(dialog,callback){callback=callback?callback:function(){},animit.runAll(animit(dialog._mask[0]).queue({opacity:0}).queue({opacity:1},{duration:this.duration,timing:this.timing}),animit(dialog._dialog[0]).queue({css:{transform:"translate3d(-50%, 300%, 0)"},duration:0}).queue({css:{transform:"translate3d(-50%, -50%, 0)"},duration:this.duration,timing:this.timing}).resetStyle().queue(function(done){callback(),done()}))},hide:function(dialog,callback){callback=callback?callback:function(){},animit.runAll(animit(dialog._mask[0]).queue({opacity:1}).queue({opacity:0},{duration:this.duration,timing:this.timing}),animit(dialog._dialog[0]).queue({css:{transform:"translate3d(-50%, -50%, 0)"},duration:0}).queue({css:{transform:"translate3d(-50%, 300%, 0)"},duration:this.duration,timing:this.timing}).resetStyle().queue(function(done){callback(),done()}))}});return IOSDialogAnimator}])}(),function(){"use strict;";var module=angular.module("onsen");module.factory("IOSSlideTransitionAnimator",["NavigatorTransitionAnimator","PageView",function(NavigatorTransitionAnimator,PageView){var IOSSlideTransitionAnimator=NavigatorTransitionAnimator.extend({backgroundMask:angular.element('<div style="position: absolute; width: 100%;height: 100%; background-color: black; opacity: 0;"></div>'),_decompose:function(page){function excludeBackButtonLabel(elements){for(var result=[],i=0;i<elements.length;i++)result.push("ons-back-button"===elements[i].nodeName.toLowerCase()?elements[i].querySelector(".ons-back-button__icon"):elements[i]);return result}var left=page.getPageView().getToolbarLeftItemsElement(),right=page.getPageView().getToolbarRightItemsElement(),other=[].concat(0===left.children.length?left:excludeBackButtonLabel(left.children)).concat(0===right.children.length?right:excludeBackButtonLabel(right.children)),pageLabels=[page.getPageView().getToolbarCenterItemsElement(),page.getPageView().getToolbarBackButtonLabelElement()];return{pageLabels:pageLabels,other:other,content:page.getPageView().getContentElement(),background:page.getPageView().getBackgroundElement(),toolbar:page.getPageView().getToolbarElement(),bottomToolbar:page.getPageView().getBottomToolbarElement()}},_shouldAnimateToolbar:function(enterPage,leavePage){var bothPageHasToolbar=enterPage.getPageView().hasToolbarElement()&&leavePage.getPageView().hasToolbarElement(),noAndroidLikeToolbar=!angular.element(enterPage.getPageView().getToolbarElement()).hasClass("navigation-bar--android")&&!angular.element(leavePage.getPageView().getToolbarElement()).hasClass("navigation-bar--android"); return bothPageHasToolbar&&noAndroidLikeToolbar},push:function(enterPage,leavePage,callback){var mask=this.backgroundMask.remove();leavePage.element[0].parentNode.insertBefore(mask[0],leavePage.element[0].nextSibling);var enterPageDecomposition=this._decompose(enterPage),leavePageDecomposition=this._decompose(leavePage),delta=function(){var rect=leavePage.element[0].getBoundingClientRect();return Math.round((rect.right-rect.left)/2*.6)}(),maskClear=animit(mask[0]).queue({opacity:0,transform:"translate3d(0, 0, 0)"}).queue({opacity:.1},{duration:.4,timing:"cubic-bezier(.1, .7, .1, 1)"}).resetStyle().queue(function(done){mask.remove(),done()}),shouldAnimateToolbar=this._shouldAnimateToolbar(enterPage,leavePage);shouldAnimateToolbar?(enterPage.element.css({zIndex:"auto"}),leavePage.element.css({zIndex:"auto"}),animit.runAll(maskClear,animit([enterPageDecomposition.content,enterPageDecomposition.bottomToolbar,enterPageDecomposition.background]).queue({css:{transform:"translate3D(100%, 0px, 0px)"},duration:0}).queue({css:{transform:"translate3D(0px, 0px, 0px)"},duration:.4,timing:"cubic-bezier(.1, .7, .1, 1)"}).resetStyle(),animit(enterPageDecomposition.toolbar).queue({css:{background:"none",backgroundColor:"rgba(0, 0, 0, 0)",borderColor:"rgba(0, 0, 0, 0)"},duration:0}).wait(.3).resetStyle({duration:.1,transition:"background-color 0.1s linear, border-color 0.1s linear"}),animit(enterPageDecomposition.pageLabels).queue({css:{transform:"translate3d("+delta+"px, 0, 0)",opacity:0},duration:0}).queue({css:{transform:"translate3d(0, 0, 0)",opacity:1},duration:.4,timing:"cubic-bezier(.1, .7, .1, 1)"}).resetStyle(),animit(enterPageDecomposition.other).queue({css:{opacity:0},duration:0}).queue({css:{opacity:1},duration:.4,timing:"cubic-bezier(.1, .7, .1, 1)"}).resetStyle(),animit([leavePageDecomposition.content,leavePageDecomposition.bottomToolbar,leavePageDecomposition.background]).queue({css:{transform:"translate3D(0, 0, 0)"},duration:0}).queue({css:{transform:"translate3D(-25%, 0px, 0px)"},duration:.4,timing:"cubic-bezier(.1, .7, .1, 1)"}).resetStyle().queue(function(done){enterPage.element.css({zIndex:""}),leavePage.element.css({zIndex:""}),callback(),done()}),animit(leavePageDecomposition.pageLabels).queue({css:{transform:"translate3d(0, 0, 0)",opacity:1},duration:0}).queue({css:{transform:"translate3d(-"+delta+"px, 0, 0)",opacity:0},duration:.4,timing:"cubic-bezier(.1, .7, .1, 1)"}).resetStyle(),animit(leavePageDecomposition.other).queue({css:{opacity:1},duration:0}).queue({css:{opacity:0},duration:.4,timing:"cubic-bezier(.1, .7, .1, 1)"}).resetStyle())):animit.runAll(maskClear,animit(enterPage.element[0]).queue({css:{transform:"translate3D(100%, 0px, 0px)"},duration:0}).queue({css:{transform:"translate3D(0px, 0px, 0px)"},duration:.4,timing:"cubic-bezier(.1, .7, .1, 1)"}).resetStyle(),animit(leavePage.element[0]).queue({css:{transform:"translate3D(0, 0, 0)"},duration:0}).queue({css:{transform:"translate3D(-25%, 0px, 0px)"},duration:.4,timing:"cubic-bezier(.1, .7, .1, 1)"}).resetStyle().queue(function(done){callback(),done()}))},pop:function(enterPage,leavePage,done){var mask=this.backgroundMask.remove();enterPage.element[0].parentNode.insertBefore(mask[0],enterPage.element[0].nextSibling);var enterPageDecomposition=this._decompose(enterPage),leavePageDecomposition=this._decompose(leavePage),delta=function(){var rect=leavePage.element[0].getBoundingClientRect();return Math.round((rect.right-rect.left)/2*.6)}(),maskClear=animit(mask[0]).queue({opacity:.1,transform:"translate3d(0, 0, 0)"}).queue({opacity:0},{duration:.4,timing:"cubic-bezier(.1, .7, .1, 1)"}).resetStyle().queue(function(done){mask.remove(),done()}),shouldAnimateToolbar=this._shouldAnimateToolbar(enterPage,leavePage);shouldAnimateToolbar?(enterPage.element.css({zIndex:"auto"}),leavePage.element.css({zIndex:"auto"}),animit.runAll(maskClear,animit([enterPageDecomposition.content,enterPageDecomposition.bottomToolbar,enterPageDecomposition.background]).queue({css:{transform:"translate3D(-25%, 0px, 0px)",opacity:.9},duration:0}).queue({css:{transform:"translate3D(0px, 0px, 0px)",opacity:1},duration:.4,timing:"cubic-bezier(.1, .7, .1, 1)"}).resetStyle(),animit(enterPageDecomposition.pageLabels).queue({css:{transform:"translate3d(-"+delta+"px, 0, 0)",opacity:0},duration:0}).queue({css:{transform:"translate3d(0, 0, 0)",opacity:1},duration:.4,timing:"cubic-bezier(.1, .7, .1, 1)"}).resetStyle(),animit(enterPageDecomposition.toolbar).queue({css:{transform:"translate3d(0, 0, 0)",opacity:1},duration:0}).queue({css:{transform:"translate3d(0, 0, 0)",opacity:1},duration:.4,timing:"cubic-bezier(.1, .7, .1, 1)"}).resetStyle(),animit(enterPageDecomposition.other).queue({css:{opacity:0},duration:0}).queue({css:{opacity:1},duration:.4,timing:"cubic-bezier(.1, .7, .1, 1)"}).resetStyle(),animit([leavePageDecomposition.content,leavePageDecomposition.bottomToolbar,leavePageDecomposition.background]).queue({css:{transform:"translate3D(0px, 0px, 0px)"},duration:0}).queue({css:{transform:"translate3D(100%, 0px, 0px)"},duration:.4,timing:"cubic-bezier(.1, .7, .1, 1)"}).wait(0).queue(function(finish){enterPage.element.css({zIndex:""}),leavePage.element.css({zIndex:""}),done(),finish()}),animit(leavePageDecomposition.other).queue({css:{transform:"translate3d(0, 0, 0)",opacity:1},duration:0}).queue({css:{transform:"translate3d(0, 0, 0)",opacity:0},duration:.4,timing:"cubic-bezier(.1, .7, .1, 1)"}),animit(leavePageDecomposition.toolbar).queue({css:{background:"none",backgroundColor:"rgba(0, 0, 0, 0)",borderColor:"rgba(0, 0, 0, 0)"},duration:0}),animit(leavePageDecomposition.pageLabels).queue({css:{transform:"translate3d(0, 0, 0)",opacity:1},duration:0}).queue({css:{transform:"translate3d("+delta+"px, 0, 0)",opacity:0},duration:.4,timing:"cubic-bezier(.1, .7, .1, 1)"}))):animit.runAll(maskClear,animit(enterPage.element[0]).queue({css:{transform:"translate3D(-25%, 0px, 0px)",opacity:.9},duration:0}).queue({css:{transform:"translate3D(0px, 0px, 0px)",opacity:1},duration:.4,timing:"cubic-bezier(.1, .7, .1, 1)"}).resetStyle(),animit(leavePage.element[0]).queue({css:{transform:"translate3D(0px, 0px, 0px)"},duration:0}).queue({css:{transform:"translate3D(100%, 0px, 0px)"},duration:.4,timing:"cubic-bezier(.1, .7, .1, 1)"}).queue(function(finish){done(),finish()}))}});return IOSSlideTransitionAnimator}])}(),function(){"use strict";var module=angular.module("onsen");module.factory("LazyRepeatView",["$onsen","$document","$compile",function($onsen,$document,$compile){var LazyRepeatView=Class.extend({init:function(scope,element,attrs,linker){if(this._element=element,this._scope=scope,this._attrs=attrs,this._linker=linker,this._parentElement=element.parent(),this._pageContent=this._findPageContent(),!this._pageContent)throw new Error("ons-lazy-repeat must be a descendant of an <ons-page> or an <ons-scroller> element.");this._itemHeightSum=[],this._maxIndex=0,this._delegate=this._getDelegate(),this._renderedElements={},this._addEventListeners(),this._scope.$watch(this._countItems.bind(this),this._onChange.bind(this)),this._scope.$on("$destroy",this._destroy.bind(this)),this._onChange()},_getDelegate:function(){var delegate=this._scope.$eval(this._attrs.onsLazyRepeat);return"undefined"==typeof delegate&&(delegate=eval(this._attrs.onsLazyRepeat)),delegate},_countItems:function(){return this._delegate.countItems()},_getItemHeight:function(i){return this._delegate.calculateItemHeight(i)},_getTopOffset:function(){return this._parentElement[0].getBoundingClientRect().top},_render:function(){var items=this._getItemsInView(),keep={};this._parentElement.css("height",this._itemHeightSum[this._maxIndex]+"px");for(var i=0,l=items.length;l>i;i++){var _item=items[i];this._renderElement(_item),keep[_item.index]=!0}for(var key in this._renderedElements)this._renderedElements.hasOwnProperty(key)&&!keep.hasOwnProperty(key)&&this._removeElement(key)},_isRendered:function(i){return this._renderedElements.hasOwnProperty(i)},_renderElement:function(item){if(this._isRendered(item.index)){var currentItem=this._renderedElements[item.index];this._delegate.configureItemScope&&this._delegate.configureItemScope(item.index,currentItem.scope);var element=this._renderedElements[item.index].element;return void(element[0].style.top=item.top+"px")}var childScope=this._scope.$new();this._addSpecialProperties(item.index,childScope),this._linker(childScope,function(clone){this._delegate.configureItemScope?this._delegate.configureItemScope(item.index,childScope):this._delegate.createItemContent&&(clone.append(this._delegate.createItemContent(item.index)),$compile(clone[0].firstChild)(childScope)),this._parentElement.append(clone),clone.css({position:"absolute",top:item.top+"px",left:"0px",right:"0px",display:"none"});var element={element:clone,scope:childScope};this._scope.$evalAsync(function(){clone.css("display","block")}),this._renderedElements[item.index]=element}.bind(this))},_removeElement:function(i){if(this._isRendered(i)){var element=this._renderedElements[i];this._delegate.destroyItemScope?this._delegate.destroyItemScope(i,element.scope):this._delegate.destroyItemContent&&this._delegate.destroyItemContent(i,element.element.children()[0]),element.element.remove(),element.scope.$destroy(),element.element=element.scope=null,delete this._renderedElements[i]}},_removeAllElements:function(){for(var key in this._renderedElements)this._removeElement.hasOwnProperty(key)&&this._removeElement(key)},_calculateStartIndex:function(current){for(var start=0,end=this._maxIndex;;){var middle=Math.floor((start+end)/2),value=current+this._itemHeightSum[middle];if(start>end)return 0;if(value>=0&&value-this._getItemHeight(middle)<0)return middle;isNaN(value)||value>=0?end=middle-1:start=middle+1}},_recalculateItemHeightSum:function(){for(var sums=this._itemHeightSum,i=0,sum=0;i<Math.min(sums.length,this._countItems());i++)sum+=this._getItemHeight(i),sums[i]=sum},_getItemsInView:function(){var topOffset=this._getTopOffset(),topPosition=topOffset,cnt=this._countItems();cnt!==this._itemCount&&(this._recalculateItemHeightSum(),this._maxIndex=cnt-1),this._itemCount=cnt;var startIndex=this._calculateStartIndex(topPosition);startIndex=Math.max(startIndex-30,0),startIndex>0&&(topPosition+=this._itemHeightSum[startIndex-1]);for(var items=[],i=startIndex;cnt>i&&topPosition<4*window.innerHeight;i++){var h=this._getItemHeight(i);i>=this._itemHeightSum.length&&(this._itemHeightSum=this._itemHeightSum.concat(new Array(100))),this._itemHeightSum[i]=i>0?this._itemHeightSum[i-1]+h:h,this._maxIndex=Math.max(i,this._maxIndex),items.push({index:i,top:topPosition-topOffset}),topPosition+=h}return items},_addSpecialProperties:function(i,scope){scope.$index=i,scope.$first=0===i,scope.$last=i===this._countItems()-1,scope.$middle=!scope.$first&&!scope.$last,scope.$even=i%2===0,scope.$odd=!scope.$even},_onChange:function(){this._render()},_findPageContent:function(){for(var e=this._element[0];e.parentNode;)if(e=e.parentNode,e.className){var classNames=e.className.split(/\s+/);if(classNames.indexOf("page__content")>=0||classNames.indexOf("ons-scroller__content")>=0)return e}return null},_debounce:function(func,wait,immediate){var timeout;return function(){var context=this,args=arguments,later=function(){timeout=null,immediate||func.apply(context,args)},callNow=immediate&&!timeout;clearTimeout(timeout),timeout=setTimeout(later,wait),callNow&&func.apply(context,args)}},_doubleFireOnTouchend:function(){this._render(),this._debounce(this._render.bind(this),100)},_addEventListeners:function(){this._boundOnChange=ons.platform.isIOS()?this._debounce(this._onChange.bind(this),30):this._onChange.bind(this),this._pageContent.addEventListener("scroll",this._boundOnChange,!0),ons.platform.isIOS()&&(this._pageContent.addEventListener("touchmove",this._boundOnChange,!0),this._pageContent.addEventListener("touchend",this._doubleFireOnTouchend,!0)),$document[0].addEventListener("resize",this._boundOnChange,!0)},_removeEventListeners:function(){this._pageContent.removeEventListener("scroll",this._boundOnChange,!0),ons.platform.isIOS()&&(this._pageContent.removeEventListener("touchmove",this._boundOnChange,!0),this._pageContent.removeEventListener("touchend",this._doubleFireOnTouchend,!0)),$document[0].removeEventListener("resize",this._boundOnChange,!0)},_destroy:function(){this._removeEventListeners(),this._removeAllElements(),this._parentElement=this._renderedElements=this._element=this._scope=this._attrs=null}});return LazyRepeatView}])}(),function(){"use strict;";var module=angular.module("onsen");module.factory("LiftTransitionAnimator",["NavigatorTransitionAnimator",function(NavigatorTransitionAnimator){var LiftTransitionAnimator=NavigatorTransitionAnimator.extend({backgroundMask:angular.element('<div style="position: absolute; width: 100%;height: 100%; background-color: black;"></div>'),push:function(enterPage,leavePage,callback){var mask=this.backgroundMask.remove();leavePage.element[0].parentNode.insertBefore(mask[0],leavePage.element[0]);var maskClear=animit(mask[0]).wait(.6).queue(function(done){mask.remove(),done()});animit.runAll(maskClear,animit(enterPage.element[0]).queue({css:{transform:"translate3D(0, 100%, 0)"},duration:0}).queue({css:{transform:"translate3D(0, 0, 0)"},duration:.4,timing:"cubic-bezier(.1, .7, .1, 1)"}).wait(.2).resetStyle().queue(function(done){callback(),done()}),animit(leavePage.element[0]).queue({css:{transform:"translate3D(0, 0, 0)",opacity:1},duration:0}).queue({css:{transform:"translate3D(0, -10%, 0)",opacity:.9},duration:.4,timing:"cubic-bezier(.1, .7, .1, 1)"}))},pop:function(enterPage,leavePage,callback){var mask=this.backgroundMask.remove();enterPage.element[0].parentNode.insertBefore(mask[0],enterPage.element[0]),animit.runAll(animit(mask[0]).wait(.4).queue(function(done){mask.remove(),done()}),animit(enterPage.element[0]).queue({css:{transform:"translate3D(0, -10%, 0)",opacity:.9},duration:0}).queue({css:{transform:"translate3D(0, 0, 0)",opacity:1},duration:.4,timing:"cubic-bezier(.1, .7, .1, 1)"}).resetStyle().wait(.4).queue(function(done){callback(),done()}),animit(leavePage.element[0]).queue({css:{transform:"translate3D(0, 0, 0)"},duration:0}).queue({css:{transform:"translate3D(0, 100%, 0)"},duration:.4,timing:"cubic-bezier(.1, .7, .1, 1)"}))}});return LiftTransitionAnimator}])}(),function(){"use strict;";var module=angular.module("onsen");module.factory("ModalView",["$onsen","$rootScope",function($onsen,$rootScope){var ModalView=Class.extend({_element:void 0,_scope:void 0,init:function(scope,element){this._scope=scope,this._element=element;var pageView=$rootScope.ons.findParentComponentUntil("ons-page",this._element);pageView&&(this._pageContent=angular.element(pageView._element[0].querySelector(".page__content"))),this._scope.$on("$destroy",this._destroy.bind(this)),this._deviceBackButtonHandler=$onsen.DeviceBackButtonHandler.create(this._element,this._onDeviceBackButton.bind(this)),this.hide()},getDeviceBackButtonHandler:function(){return this._deviceBackButtonHandler},show:function(){this._element.css("display","table")},_isVisible:function(){return this._element[0].clientWidth>0},_onDeviceBackButton:function(){},hide:function(){this._element.css("display","none")},toggle:function(){return this._isVisible()?this.hide.apply(this,arguments):this.show.apply(this,arguments)},_destroy:function(){this.emit("destroy",{page:this}),this._deviceBackButtonHandler.destroy(),this._element=this._scope=null}});return MicroEvent.mixin(ModalView),ModalView}])}(),function(){"use strict;";var module=angular.module("onsen"),NavigatorPageObject=Class.extend({init:function(params){this.page=params.page,this.name=params.page,this.element=params.element,this.pageScope=params.pageScope,this.options=params.options,this.navigator=params.navigator,this._blockEvents=function(event){(this.navigator._isPopping||this.navigator._isPushing)&&(event.preventDefault(),event.stopPropagation())}.bind(this),this.element.on(this._pointerEvents,this._blockEvents)},_pointerEvents:"touchmove",getPageView:function(){if(!this._pageView&&(this._pageView=this.element.inheritedData("ons-page"),!this._pageView))throw new Error("Fail to fetch PageView from ons-page element.");return this._pageView},destroy:function(){this.pageScope.$destroy(),this.element.off(this._pointerEvents,this._blockEvents),this.element.remove(),this.element=null,this._pageView=null,this.pageScope=null,this.options=null;var index=this.navigator.pages.indexOf(this);-1!==index&&this.navigator.pages.splice(index,1),this.navigator=null}});module.factory("NavigatorView",["$http","$parse","$templateCache","$compile","$onsen","$timeout","SimpleSlideTransitionAnimator","NavigatorTransitionAnimator","LiftTransitionAnimator","NullTransitionAnimator","IOSSlideTransitionAnimator","FadeTransitionAnimator",function($http,$parse,$templateCache,$compile,$onsen,$timeout,SimpleSlideTransitionAnimator,NavigatorTransitionAnimator,LiftTransitionAnimator,NullTransitionAnimator,IOSSlideTransitionAnimator,FadeTransitionAnimator){var NavigatorView=Class.extend({_element:void 0,_attrs:void 0,pages:void 0,_scope:void 0,_doorLock:void 0,_profiling:!1,init:function(scope,element,attrs){this._element=element||angular.element(window.document.body),this._scope=scope||this._element.scope(),this._attrs=attrs,this._doorLock=new DoorLock,this.pages=[],this._isPopping=this._isPushing=!1,this._deviceBackButtonHandler=$onsen.DeviceBackButtonHandler.create(this._element,this._onDeviceBackButton.bind(this)),this._scope.$on("$destroy",this._destroy.bind(this))},_destroy:function(){this.emit("destroy"),this.pages.forEach(function(page){page.destroy()}),this._deviceBackButtonHandler.destroy(),this._deviceBackButtonHandler=null,this._element=this._scope=this._attrs=null},_onDeviceBackButton:function(event){this.pages.length>1?this._scope.$evalAsync(this.popPage.bind(this)):event.callParentHandler()},_normalizePageElement:function(element){for(var i=0;i<element.length;i++)if(1===element[i].nodeType)return angular.element(element[i]);throw new Error("invalid state")},_createPageElementAndLinkFunction:function(templateHTML,pageScope,done){function safeApply(scope){var phase=scope.$root.$$phase;"$apply"!==phase&&"$digest"!==phase&&scope.$apply()}var div=document.createElement("div");div.innerHTML=templateHTML.trim();var pageElement=angular.element(div),hasPage=1===div.childElementCount&&"ons-page"===div.childNodes[0].nodeName.toLowerCase();if(!hasPage)throw new Error('You can not supply no "ons-page" element to "ons-navigator".');pageElement=angular.element(div.childNodes[0]);var link=$compile(pageElement);return{element:pageElement,link:function(){link(pageScope),safeApply(pageScope)}}},insertPage:function(index,page,options){if(options=options||{},options&&"object"!=typeof options)throw new Error("options must be an object. You supplied "+options);if(index===this.pages.length)return this.pushPage.apply(this,[].slice.call(arguments,1));this._doorLock.waitUnlock(function(){var unlock=this._doorLock.lock();$onsen.getPageHTMLAsync(page).then(function(templateHTML){var pageScope=this._createPageScope(),object=this._createPageElementAndLinkFunction(templateHTML,pageScope),element=object.element,link=object.link;element=this._normalizePageElement(element);var pageObject=this._createPageObject(page,element,pageScope,options);this.pages.length>0?(index=normalizeIndex(index),this._element[0].insertBefore(element[0],this.pages[index]?this.pages[index].element[0]:null),this.pages.splice(index,0,pageObject),link(),setTimeout(function(){this.getCurrentPage()!==pageObject&&element.css("display","none"),unlock(),element=null}.bind(this),1e3/60)):(this._element.append(element),this.pages.push(pageObject),link(),unlock(),element=null)}.bind(this),function(){throw unlock(),new Error("Page is not found: "+page)})}.bind(this));var normalizeIndex=function(index){return 0>index&&(index=this.pages.length+index),index}.bind(this)},pushPage:function(page,options){if(this._profiling&&console.time("pushPage"),options=options||{},!options.cancelIfRunning||!this._isPushing){if(options&&"object"!=typeof options)throw new Error("options must be an object. You supplied "+options);this._emitPrePushEvent()||this._doorLock.waitUnlock(function(){this._pushPage(page,options)}.bind(this))}},_pushPage:function(page,options){var unlock=this._doorLock.lock(),done=function(){unlock(),this._profiling&&console.timeEnd("pushPage")};$onsen.getPageHTMLAsync(page).then(function(templateHTML){var pageScope=this._createPageScope(),object=this._createPageElementAndLinkFunction(templateHTML,pageScope);setImmediate(function(){this._pushPageDOM(page,object.element,object.link,pageScope,options,done),object=null}.bind(this))}.bind(this),function(){throw done(),new Error("Page is not found: "+page)}.bind(this))},getDeviceBackButtonHandler:function(){return this._deviceBackButtonHandler},_getAnimatorOption:function(options,defaultAnimator){var animator=null;if(options.animation instanceof NavigatorTransitionAnimator)return options.animation;if("string"==typeof options.animation&&(animator=NavigatorView._transitionAnimatorDict[options.animation]),!animator&&this._element.attr("animation")&&(animator=NavigatorView._transitionAnimatorDict[this._element.attr("animation")]),animator||(animator=defaultAnimator||NavigatorView._transitionAnimatorDict["default"]),!(animator instanceof NavigatorTransitionAnimator))throw new Error('"animator" is not an instance of NavigatorTransitionAnimator.');return animator},_createPageScope:function(){return this._scope.$new()},_createPageObject:function(page,element,pageScope,options){return options.animator=this._getAnimatorOption(options),new NavigatorPageObject({page:page,element:element,pageScope:pageScope,options:options,navigator:this})},_pushPageDOM:function(page,element,link,pageScope,options,unlock){this._profiling&&console.time("pushPageDOM"),unlock=unlock||function(){},options=options||{},element=this._normalizePageElement(element);var pageObject=this._createPageObject(page,element,pageScope,options),event={enterPage:pageObject,leavePage:this.pages[this.pages.length-1],navigator:this};this.pages.push(pageObject);var done=function(){this.pages[this.pages.length-2]&&this.pages[this.pages.length-2].element.css("display","none"),this._profiling&&console.timeEnd("pushPageDOM"),this._isPushing=!1,unlock(),this.emit("postpush",event),"function"==typeof options.onTransitionEnd&&options.onTransitionEnd(),element=null}.bind(this);if(this._isPushing=!0,this.pages.length>1){var leavePage=this.pages.slice(-2)[0],enterPage=this.pages.slice(-1)[0];this._element.append(element),link(),options.animator.push(enterPage,leavePage,done),element=null}else this._element.append(element),link(),done(),element=null},_emitPrePushEvent:function(){var isCanceled=!1,prePushEvent={navigator:this,currentPage:this.getCurrentPage(),cancel:function(){isCanceled=!0}};return this.emit("prepush",prePushEvent),isCanceled},_emitPrePopEvent:function(){var isCanceled=!1,leavePage=this.getCurrentPage(),prePopEvent={navigator:this,currentPage:leavePage,leavePage:leavePage,enterPage:this.pages[this.pages.length-2],cancel:function(){isCanceled=!0}};return this.emit("prepop",prePopEvent),isCanceled},popPage:function(options){options=options||{},options.cancelIfRunning&&this._isPopping||this._doorLock.waitUnlock(function(){if(this.pages.length<=1)throw new Error("NavigatorView's page stack is empty.");this._emitPrePopEvent()||this._popPage(options)}.bind(this))},_popPage:function(options){var unlock=this._doorLock.lock(),leavePage=this.pages.pop();this.pages[this.pages.length-1]&&this.pages[this.pages.length-1].element.css("display","block");var enterPage=this.pages[this.pages.length-1],event={leavePage:leavePage,enterPage:this.pages[this.pages.length-1],navigator:this},callback=function(){leavePage.destroy(),this._isPopping=!1,unlock(),this.emit("postpop",event),event.leavePage=null,"function"==typeof options.onTransitionEnd&&options.onTransitionEnd()}.bind(this);this._isPopping=!0;var animator=this._getAnimatorOption(options,leavePage.options.animator);animator.pop(enterPage,leavePage,callback)},replacePage:function(page,options){options=options||{};var onTransitionEnd=options.onTransitionEnd||function(){};options.onTransitionEnd=function(){this.pages.length>1&&this.pages[this.pages.length-2].destroy(),onTransitionEnd()}.bind(this),this.pushPage(page,options)},resetToPage:function(page,options){options=options||{},options.animator||options.animation||(options.animation="none");var onTransitionEnd=options.onTransitionEnd||function(){},self=this;options.onTransitionEnd=function(){for(;self.pages.length>1;)self.pages.shift().destroy();self._scope.$digest(),onTransitionEnd()},this.pushPage(page,options)},getCurrentPage:function(){return this.pages[this.pages.length-1]},getPages:function(){return this.pages},canPopPage:function(){return this.pages.length>1}});return NavigatorView._transitionAnimatorDict={"default":$onsen.isAndroid()?new SimpleSlideTransitionAnimator:new IOSSlideTransitionAnimator,slide:$onsen.isAndroid()?new SimpleSlideTransitionAnimator:new IOSSlideTransitionAnimator,simpleslide:new SimpleSlideTransitionAnimator,lift:new LiftTransitionAnimator,fade:new FadeTransitionAnimator,none:new NullTransitionAnimator},NavigatorView.registerTransitionAnimator=function(name,animator){if(!(animator instanceof NavigatorTransitionAnimator))throw new Error('"animator" param must be an instance of NavigatorTransitionAnimator');this._transitionAnimatorDict[name]=animator},MicroEvent.mixin(NavigatorView),NavigatorView}])}(),function(){"use strict;";var module=angular.module("onsen");module.factory("NavigatorTransitionAnimator",function(){var NavigatorTransitionAnimator=Class.extend({push:function(enterPage,leavePage,callback){callback()},pop:function(enterPage,leavePage,callback){callback()}});return NavigatorTransitionAnimator})}(),function(){"use strict;";var module=angular.module("onsen");module.factory("NullTransitionAnimator",["NavigatorTransitionAnimator",function(NavigatorTransitionAnimator){var NullTransitionAnimator=NavigatorTransitionAnimator.extend({});return NullTransitionAnimator}])}(),function(){"use strict";var module=angular.module("onsen");module.factory("OverlaySlidingMenuAnimator",["SlidingMenuAnimator",function(SlidingMenuAnimator){var OverlaySlidingMenuAnimator=SlidingMenuAnimator.extend({_blackMask:void 0,_isRight:!1,_element:!1,_menuPage:!1,_mainPage:!1,_width:!1,_duration:!1,setup:function(element,mainPage,menuPage,options){options=options||{},this._width=options.width||"90%",this._isRight=!!options.isRight,this._element=element,this._mainPage=mainPage,this._menuPage=menuPage,this._duration=.4,menuPage.css("box-shadow","0px 0 10px 0px rgba(0, 0, 0, 0.2)"),menuPage.css({width:options.width,display:"none",zIndex:2}),menuPage.css("-webkit-transform","translate3d(0px, 0px, 0px)"),mainPage.css({zIndex:1}),menuPage.css(this._isRight?{right:"-"+options.width,left:"auto"}:{right:"auto",left:"-"+options.width}),this._blackMask=angular.element("<div></div>").css({backgroundColor:"black",top:"0px",left:"0px",right:"0px",bottom:"0px",position:"absolute",display:"none",zIndex:0}),element.prepend(this._blackMask)},onResized:function(options){if(this._menuPage.css("width",options.width),this._menuPage.css(this._isRight?{right:"-"+options.width,left:"auto"}:{right:"auto",left:"-"+options.width}),options.isOpened){var max=this._menuPage[0].clientWidth,menuStyle=this._generateMenuPageStyle(max);animit(this._menuPage[0]).queue(menuStyle).play()}},destroy:function(){this._blackMask&&(this._blackMask.remove(),this._blackMask=null),this._mainPage.removeAttr("style"),this._menuPage.removeAttr("style"),this._element=this._mainPage=this._menuPage=null},openMenu:function(callback,instant){var duration=instant===!0?0:this._duration;this._menuPage.css("display","block"),this._blackMask.css("display","block");var max=this._menuPage[0].clientWidth,menuStyle=this._generateMenuPageStyle(max),mainPageStyle=this._generateMainPageStyle(max);setTimeout(function(){animit(this._mainPage[0]).queue(mainPageStyle,{duration:duration,timing:"cubic-bezier(.1, .7, .1, 1)"}).queue(function(done){callback(),done()}).play(),animit(this._menuPage[0]).queue(menuStyle,{duration:duration,timing:"cubic-bezier(.1, .7, .1, 1)"}).play()}.bind(this),1e3/60)},closeMenu:function(callback,instant){var duration=instant===!0?0:this._duration;this._blackMask.css({display:"block"});var menuPageStyle=this._generateMenuPageStyle(0),mainPageStyle=this._generateMainPageStyle(0);setTimeout(function(){animit(this._mainPage[0]).queue(mainPageStyle,{duration:duration,timing:"cubic-bezier(.1, .7, .1, 1)"}).queue(function(done){this._menuPage.css("display","none"),callback(),done()}.bind(this)).play(),animit(this._menuPage[0]).queue(menuPageStyle,{duration:duration,timing:"cubic-bezier(.1, .7, .1, 1)"}).play()}.bind(this),1e3/60)},translateMenu:function(options){this._menuPage.css("display","block"),this._blackMask.css({display:"block"});var menuPageStyle=this._generateMenuPageStyle(Math.min(options.maxDistance,options.distance)),mainPageStyle=this._generateMainPageStyle(Math.min(options.maxDistance,options.distance));delete mainPageStyle.opacity,animit(this._menuPage[0]).queue(menuPageStyle).play(),Object.keys(mainPageStyle).length>0&&animit(this._mainPage[0]).queue(mainPageStyle).play()},_generateMenuPageStyle:function(distance){var x=(this._menuPage[0].clientWidth,this._isRight?-distance:distance),transform="translate3d("+x+"px, 0, 0)";return{transform:transform,"box-shadow":0===distance?"none":"0px 0 10px 0px rgba(0, 0, 0, 0.2)"}},_generateMainPageStyle:function(distance){var max=this._menuPage[0].clientWidth,opacity=1-.1*distance/max;return{opacity:opacity}},copy:function(){return new OverlaySlidingMenuAnimator}});return OverlaySlidingMenuAnimator}])}(),function(){"use strict;";var module=angular.module("onsen");module.factory("PageView",["$onsen","$parse",function($onsen,$parse){var PageView=Class.extend({_registeredToolbarElement:!1,_registeredBottomToolbarElement:!1,_nullElement:window.document.createElement("div"),_toolbarElement:null,_bottomToolbarElement:null,init:function(scope,element,attrs){this._scope=scope,this._element=element,this._attrs=attrs,this._registeredToolbarElement=!1,this._registeredBottomToolbarElement=!1,this._nullElement=window.document.createElement("div"),this._toolbarElement=angular.element(this._nullElement),this._bottomToolbarElement=angular.element(this._nullElement),this._clearListener=scope.$on("$destroy",this._destroy.bind(this)),this._userDeviceBackButtonListener=angular.noop,(this._attrs.ngDeviceBackbutton||this._attrs.onDeviceBackbutton)&&(this._deviceBackButtonHandler=$onsen.DeviceBackButtonHandler.create(this._element,this._onDeviceBackButton.bind(this)))},_onDeviceBackButton:function($event){if(this._userDeviceBackButtonListener($event),this._attrs.ngDeviceBackbutton&&$parse(this._attrs.ngDeviceBackbutton)(this._scope,{$event:$event}),this._attrs.onDeviceBackbutton){var lastEvent=window.$event;window.$event=$event,new Function(this._attrs.onDeviceBackbutton)(),window.$event=lastEvent}},setDeviceBackButtonHandler:function(callback){this._deviceBackButtonHandler||(this._deviceBackButtonHandler=$onsen.DeviceBackButtonHandler.create(this._element,this._onDeviceBackButton.bind(this))),this._userDeviceBackButtonListener=callback},getDeviceBackButtonHandler:function(){return this._deviceBackButtonHandler||null},registerToolbar:function(element){if(this._registeredToolbarElement)throw new Error("This page's toolbar is already registered.");angular.element(this.getContentElement()).attr("no-status-bar-fill",""),element.remove();var statusFill=this._element[0].querySelector(".page__status-bar-fill");statusFill?angular.element(statusFill).after(element):this._element.prepend(element),this._toolbarElement=element,this._registeredToolbarElement=!0},registerBottomToolbar:function(element){if(this._registeredBottomToolbarElement)throw new Error("This page's bottom-toolbar is already registered."); element.remove(),this._bottomToolbarElement=element,this._registeredBottomToolbarElement=!0;var fill=angular.element(document.createElement("div"));fill.addClass("page__bottom-bar-fill"),fill.css({width:"0px",height:"0px"}),this._element.prepend(fill),this._element.append(element)},registerExtraElement:function(element){this._extraElement||(this._extraElement=angular.element("<div></div>"),this._extraElement.addClass("page__extra"),this._extraElement.css({"z-index":"10001"}),this._element.append(this._extraElement)),this._extraElement.append(element.remove())},hasToolbarElement:function(){return!!this._registeredToolbarElement},hasBottomToolbarElement:function(){return!!this._registeredBottomToolbarElement},getContentElement:function(){for(var i=0;i<this._element.length;i++)if(this._element[i].querySelector){var content=this._element[i].querySelector(".page__content");if(content)return content}throw Error('fail to get ".page__content" element.')},getBackgroundElement:function(){for(var i=0;i<this._element.length;i++)if(this._element[i].querySelector){var content=this._element[i].querySelector(".page__background");if(content)return content}throw Error('fail to get ".page__background" element.')},getToolbarElement:function(){return this._toolbarElement[0]||this._nullElement},getBottomToolbarElement:function(){return this._bottomToolbarElement[0]||this._nullElement},getToolbarLeftItemsElement:function(){return this._toolbarElement[0].querySelector(".left")||this._nullElement},getToolbarCenterItemsElement:function(){return this._toolbarElement[0].querySelector(".center")||this._nullElement},getToolbarRightItemsElement:function(){return this._toolbarElement[0].querySelector(".right")||this._nullElement},getToolbarBackButtonLabelElement:function(){return this._toolbarElement[0].querySelector("ons-back-button .back-button__label")||this._nullElement},_destroy:function(){this.emit("destroy",{page:this}),this._deviceBackButtonHandler&&(this._deviceBackButtonHandler.destroy(),this._deviceBackButtonHandler=null),this._element=null,this._toolbarElement=null,this._nullElement=null,this._bottomToolbarElement=null,this._extraElement=null,this._scope=null,this._clearListener()}});return MicroEvent.mixin(PageView),PageView}])}(),function(){"use strict";var module=angular.module("onsen");module.factory("PopoverView",["$onsen","PopoverAnimator","FadePopoverAnimator",function($onsen,PopoverAnimator,FadePopoverAnimator){var PopoverView=Class.extend({init:function(scope,element,attrs){if(this._element=element,this._scope=scope,this._attrs=attrs,this._mask=angular.element(this._element[0].querySelector(".popover-mask")),this._popover=angular.element(this._element[0].querySelector(".popover")),this._mask.css("z-index",2e4),this._popover.css("z-index",20001),this._element.css("display","none"),attrs.maskColor&&this._mask.css("background-color",attrs.maskColor),this._mask.on("click",this._cancel.bind(this)),this._visible=!1,this._doorLock=new DoorLock,this._animation=PopoverView._animatorDict["undefined"!=typeof attrs.animation?attrs.animation:"fade"],!this._animation)throw new Error("No such animation: "+attrs.animation);this._deviceBackButtonHandler=$onsen.DeviceBackButtonHandler.create(this._element,this._onDeviceBackButton.bind(this)),this._onChange=function(){setImmediate(function(){this._currentTarget&&this._positionPopover(this._currentTarget)}.bind(this))}.bind(this),this._popover[0].addEventListener("DOMNodeInserted",this._onChange,!1),this._popover[0].addEventListener("DOMNodeRemoved",this._onChange,!1),window.addEventListener("resize",this._onChange,!1),this._scope.$on("$destroy",this._destroy.bind(this))},_onDeviceBackButton:function(event){this.isCancelable()?this._cancel.bind(this)():event.callParentHandler()},_setDirection:function(direction){if("up"===direction)this._scope.direction=direction,this._scope.arrowPosition="bottom";else if("left"===direction)this._scope.direction=direction,this._scope.arrowPosition="right";else if("down"===direction)this._scope.direction=direction,this._scope.arrowPosition="top";else{if("right"!=direction)throw new Error("Invalid direction.");this._scope.direction=direction,this._scope.arrowPosition="left"}this._scope.$$phase||this._scope.$apply()},_positionPopoverByDirection:function(target,direction){var el=angular.element(this._element[0].querySelector(".popover")),pos=target.getBoundingClientRect(),own=el[0].getBoundingClientRect(),arrow=angular.element(el.children()[1]),offset=14,margin=6,radius=parseInt(window.getComputedStyle(el[0].querySelector(".popover__content")).borderRadius);arrow.css({top:"",left:""});var diff=function(x){return x/2*Math.sqrt(2)-x/2}(parseInt(window.getComputedStyle(arrow[0]).width)),limit=margin+radius+diff;this._setDirection(direction),["left","right"].indexOf(direction)>-1?("left"==direction?el.css("left",pos.right-pos.width-own.width-offset+"px"):el.css("left",pos.right+offset+"px"),el.css("top",pos.bottom-pos.height/2-own.height/2+"px")):("up"==direction?el.css("top",pos.bottom-pos.height-own.height-offset+"px"):el.css("top",pos.bottom+offset+"px"),el.css("left",pos.right-pos.width/2-own.width/2+"px")),own=el[0].getBoundingClientRect(),["left","right"].indexOf(direction)>-1?own.top<margin?(arrow.css("top",Math.max(own.height/2+own.top-margin,limit)+"px"),el.css("top",margin+"px")):own.bottom>window.innerHeight-margin&&(arrow.css("top",Math.min(own.height/2-(window.innerHeight-own.bottom)+margin,own.height-limit)+"px"),el.css("top",window.innerHeight-own.height-margin+"px")):own.left<margin?(arrow.css("left",Math.max(own.width/2+own.left-margin,limit)+"px"),el.css("left",margin+"px")):own.right>window.innerWidth-margin&&(arrow.css("left",Math.min(own.width/2-(window.innerWidth-own.right)+margin,own.width-limit)+"px"),el.css("left",window.innerWidth-own.width-margin+"px"))},_positionPopover:function(target){var directions;directions=this._element.attr("direction")?this._element.attr("direction").split(/\s+/):["up","down","left","right"];for(var position=target.getBoundingClientRect(),scores={left:position.left,right:window.innerWidth-position.right,up:position.top,down:window.innerHeight-position.bottom},orderedDirections=Object.keys(scores).sort(function(a,b){return-(scores[a]-scores[b])}),i=0,l=orderedDirections.length;l>i;i++){var direction=orderedDirections[i];if(directions.indexOf(direction)>-1)return void this._positionPopoverByDirection(target,direction)}},show:function(target,options){if("string"==typeof target?target=document.querySelector(target):target instanceof Event&&(target=target.target),!target)throw new Error("Target undefined");options=options||{};var cancel=!1;this.emit("preshow",{popover:this,cancel:function(){cancel=!0}}),cancel||this._doorLock.waitUnlock(function(){var unlock=this._doorLock.lock(),animation=this._animation;this._element.css("display","block"),this._currentTarget=target,this._positionPopover(target),options.animation&&(animation=PopoverView._animatorDict[options.animation]),animation.show(this,function(){this._visible=!0,this._positionPopover(target),unlock(),this.emit("postshow",{popover:this})}.bind(this))}.bind(this))},hide:function(options){options=options||{};var cancel=!1;this.emit("prehide",{popover:this,cancel:function(){cancel=!0}}),cancel||this._doorLock.waitUnlock(function(){var unlock=this._doorLock.lock(),animation=this._animation;options.animation&&(animation=PopoverView._animatorDict[options.animation]),animation.hide(this,function(){this._element.css("display","none"),this._visible=!1,unlock(),this.emit("posthide",{popover:this})}.bind(this))}.bind(this))},isShown:function(){return this._visible},destroy:function(){this._parentScope?(this._parentScope.$destroy(),this._parentScope=null):this._scope.$destroy()},_destroy:function(){this.emit("destroy"),this._deviceBackButtonHandler.destroy(),this._popover[0].removeEventListener("DOMNodeInserted",this._onChange,!1),this._popover[0].removeEventListener("DOMNodeRemoved",this._onChange,!1),window.removeEventListener("resize",this._onChange,!1),this._mask.off(),this._mask.remove(),this._popover.remove(),this._element.remove(),this._onChange=this._deviceBackButtonHandler=this._mask=this._popover=this._element=this._scope=null},setCancelable:function(cancelable){if("boolean"!=typeof cancelable)throw new Error("Argument must be a boolean.");cancelable?this._element.attr("cancelable",!0):this._element.removeAttr("cancelable")},isCancelable:function(){return this._element[0].hasAttribute("cancelable")},_cancel:function(){this.isCancelable()&&this.hide()}});return PopoverView._animatorDict={fade:new FadePopoverAnimator,none:new PopoverAnimator},PopoverView.registerAnimator=function(name,animator){if(!(animator instanceof PopoverAnimator))throw new Error('"animator" param must be an instance of PopoverAnimator');this._animatorDict[name]=animator},MicroEvent.mixin(PopoverView),PopoverView}])}(),function(){"use strict";var module=angular.module("onsen");module.factory("PopoverAnimator",function(){var PopoverAnimator=Class.extend({show:function(popover,callback){callback()},hide:function(popover,callback){callback()}});return PopoverAnimator})}(),function(){"use strict";var module=angular.module("onsen");module.factory("PullHookView",["$onsen","$parse",function($onsen,$parse){var PullHookView=Class.extend({STATE_INITIAL:"initial",STATE_PREACTION:"preaction",STATE_ACTION:"action",init:function(scope,element,attrs){if(this._element=element,this._scope=scope,this._attrs=attrs,this._scrollElement=this._createScrollElement(),this._pageElement=this._scrollElement.parent(),!this._pageElement.hasClass("page__content")&&!this._pageElement.hasClass("ons-scroller__content"))throw new Error("<ons-pull-hook> must be a direct descendant of an <ons-page> or an <ons-scroller> element.");this._currentTranslation=0,this._createEventListeners(),this._setState(this.STATE_INITIAL,!0),this._setStyle(),this._scope.$on("$destroy",this._destroy.bind(this))},_createScrollElement:function(){var scrollElement=angular.element("<div>").addClass("scroll"),pageElement=this._element.parent(),children=pageElement.children();return pageElement.append(scrollElement),scrollElement.append(children),scrollElement},_setStyle:function(){var h=this._getHeight();this._element.css({top:"-"+h+"px",height:h+"px",lineHeight:h+"px"})},_onScroll:function(event){var el=this._pageElement[0];el.scrollTop<0&&(el.scrollTop=0)},_generateTranslationTransform:function(scroll){return"translate3d(0px, "+scroll+"px, 0px)"},_onDrag:function(event){if(!this.isDisabled()&&"left"!==event.gesture.direction&&"right"!==event.gesture.direction){var el=this._pageElement[0];if(el.scrollTop=this._startScroll-event.gesture.deltaY,el.scrollTop<window.innerHeight&&"up"!==event.gesture.direction&&event.gesture.preventDefault(),0===this._currentTranslation&&0===this._getCurrentScroll()){this._transitionDragLength=event.gesture.deltaY;var direction=event.gesture.interimDirection;"down"===direction?this._transitionDragLength-=1:this._transitionDragLength+=1}var scroll=event.gesture.deltaY-this._startScroll;scroll=Math.max(scroll,0),this._thresholdHeightEnabled()&&scroll>=this._getThresholdHeight()?(event.gesture.stopDetect(),setImmediate(function(){this._setState(this.STATE_ACTION),this._translateTo(this._getHeight(),{animate:!0}),this._waitForAction(this._onDone.bind(this))}.bind(this))):this._setState(scroll>=this._getHeight()?this.STATE_PREACTION:this.STATE_INITIAL),event.stopPropagation(),this._translateTo(scroll)}},_onDragStart:function(event){this.isDisabled()||(this._startScroll=this._getCurrentScroll())},_onDragEnd:function(event){if(!this.isDisabled()&&this._currentTranslation>0){var scroll=this._currentTranslation;scroll>this._getHeight()?(this._setState(this.STATE_ACTION),this._translateTo(this._getHeight(),{animate:!0}),this._waitForAction(this._onDone.bind(this))):this._translateTo(0,{animate:!0})}},_waitForAction:function(done){this._attrs.ngAction?this._scope.$eval(this._attrs.ngAction,{$done:done}):this._attrs.onAction?eval(this._attrs.onAction):done()},_onDone:function(done){this._element&&(this._translateTo(0,{animate:!0}),this._setState(this.STATE_INITIAL))},_getHeight:function(){return parseInt(this._element[0].getAttribute("height")||"64",10)},setHeight:function(height){this._element[0].setAttribute("height",height+"px"),this._setStyle()},setThresholdHeight:function(thresholdHeight){this._element[0].setAttribute("threshold-height",thresholdHeight+"px")},_getThresholdHeight:function(){return parseInt(this._element[0].getAttribute("threshold-height")||"96",10)},_thresholdHeightEnabled:function(){var th=this._getThresholdHeight();return th>0&&th>=this._getHeight()},_setState:function(state,noEvent){var oldState=this._getState();this._scope.$evalAsync(function(){this._element[0].setAttribute("state",state),noEvent||oldState===this._getState()||this.emit("changestate",{state:state,pullHook:this})}.bind(this))},_getState:function(){return this._element[0].getAttribute("state")},getCurrentState:function(){return this._getState()},_getCurrentScroll:function(){return this._pageElement[0].scrollTop},isDisabled:function(){return this._element[0].hasAttribute("disabled")},setDisabled:function(disabled){disabled?this._element[0].setAttribute("disabled",""):this._element[0].removeAttribute("disabled")},_translateTo:function(scroll,options){if(options=options||{},0!=this._currentTranslation||0!=scroll){var done=function(){0===scroll&&this._scrollElement[0].removeAttribute("style"),options.callback&&options.callback()}.bind(this);this._currentTranslation=scroll,options.animate?animit(this._scrollElement[0]).queue({transform:this._generateTranslationTransform(scroll)},{duration:.3,timing:"cubic-bezier(.1, .7, .1, 1)"}).play(done):animit(this._scrollElement[0]).queue({transform:this._generateTranslationTransform(scroll)}).play(done)}},_getMinimumScroll:function(){var scrollHeight=this._scrollElement[0].getBoundingClientRect().height,pageHeight=this._pageElement[0].getBoundingClientRect().height;return scrollHeight>pageHeight?-(scrollHeight-pageHeight):0},_createEventListeners:function(){var element=this._scrollElement.parent();this._hammer=new Hammer(element[0],{dragMinDistance:1,dragDistanceCorrection:!1}),this._bindedOnDrag=this._onDrag.bind(this),this._bindedOnDragStart=this._onDragStart.bind(this),this._bindedOnDragEnd=this._onDragEnd.bind(this),this._bindedOnScroll=this._onScroll.bind(this),this._hammer.on("drag",this._bindedOnDrag),this._hammer.on("dragstart",this._bindedOnDragStart),this._hammer.on("dragend",this._bindedOnDragEnd),element.on("scroll",this._bindedOnScroll)},_destroyEventListeners:function(){var element=this._scrollElement.parent();this._hammer.off("drag",this._bindedOnDrag),this._hammer.off("dragstart",this._bindedOnDragStart),this._hammer.off("dragend",this._bindedOnDragEnd),element.off("scroll",this._bindedOnScroll)},_destroy:function(){this.emit("destroy"),this._destroyEventListeners(),this._element=this._scope=this._attrs=null}});return MicroEvent.mixin(PullHookView),PullHookView}])}(),function(){"use strict";var module=angular.module("onsen");module.factory("PushSlidingMenuAnimator",["SlidingMenuAnimator",function(SlidingMenuAnimator){var PushSlidingMenuAnimator=SlidingMenuAnimator.extend({_isRight:!1,_element:void 0,_menuPage:void 0,_mainPage:void 0,_width:void 0,_duration:!1,setup:function(element,mainPage,menuPage,options){options=options||{},this._element=element,this._mainPage=mainPage,this._menuPage=menuPage,this._isRight=!!options.isRight,this._width=options.width||"90%",this._duration=.4,menuPage.css({width:options.width,display:"none"}),menuPage.css(this._isRight?{right:"-"+options.width,left:"auto"}:{right:"auto",left:"-"+options.width})},onResized:function(options){if(this._menuPage.css("width",options.width),this._menuPage.css(this._isRight?{right:"-"+options.width,left:"auto"}:{right:"auto",left:"-"+options.width}),options.isOpened){var max=this._menuPage[0].clientWidth,mainPageTransform=this._generateAbovePageTransform(max),menuPageStyle=this._generateBehindPageStyle(max);animit(this._mainPage[0]).queue({transform:mainPageTransform}).play(),animit(this._menuPage[0]).queue(menuPageStyle).play()}},destroy:function(){this._mainPage.removeAttr("style"),this._menuPage.removeAttr("style"),this._element=this._mainPage=this._menuPage=null},openMenu:function(callback,instant){var duration=instant===!0?0:this._duration;this._menuPage.css("display","block");var max=this._menuPage[0].clientWidth,aboveTransform=this._generateAbovePageTransform(max),behindStyle=this._generateBehindPageStyle(max);setTimeout(function(){animit(this._mainPage[0]).queue({transform:aboveTransform},{duration:duration,timing:"cubic-bezier(.1, .7, .1, 1)"}).queue(function(done){callback(),done()}).play(),animit(this._menuPage[0]).queue(behindStyle,{duration:duration,timing:"cubic-bezier(.1, .7, .1, 1)"}).play()}.bind(this),1e3/60)},closeMenu:function(callback,instant){var duration=instant===!0?0:this._duration,aboveTransform=this._generateAbovePageTransform(0),behindStyle=this._generateBehindPageStyle(0);setTimeout(function(){animit(this._mainPage[0]).queue({transform:aboveTransform},{duration:duration,timing:"cubic-bezier(.1, .7, .1, 1)"}).queue({transform:"translate3d(0, 0, 0)"}).queue(function(done){this._menuPage.css("display","none"),callback(),done()}.bind(this)).play(),animit(this._menuPage[0]).queue(behindStyle,{duration:duration,timing:"cubic-bezier(.1, .7, .1, 1)"}).queue(function(done){done()}).play()}.bind(this),1e3/60)},translateMenu:function(options){this._menuPage.css("display","block");var aboveTransform=this._generateAbovePageTransform(Math.min(options.maxDistance,options.distance)),behindStyle=this._generateBehindPageStyle(Math.min(options.maxDistance,options.distance));animit(this._mainPage[0]).queue({transform:aboveTransform}).play(),animit(this._menuPage[0]).queue(behindStyle).play()},_generateAbovePageTransform:function(distance){var x=this._isRight?-distance:distance,aboveTransform="translate3d("+x+"px, 0, 0)";return aboveTransform},_generateBehindPageStyle:function(distance){var behindX=(this._menuPage[0].clientWidth,this._isRight?-distance:distance),behindTransform="translate3d("+behindX+"px, 0, 0)";return{transform:behindTransform}},copy:function(){return new PushSlidingMenuAnimator}});return PushSlidingMenuAnimator}])}(),function(){"use strict";var module=angular.module("onsen");module.factory("RevealSlidingMenuAnimator",["SlidingMenuAnimator",function(SlidingMenuAnimator){var RevealSlidingMenuAnimator=SlidingMenuAnimator.extend({_blackMask:void 0,_isRight:!1,_menuPage:void 0,_element:void 0,_mainPage:void 0,_duration:void 0,setup:function(element,mainPage,menuPage,options){this._element=element,this._menuPage=menuPage,this._mainPage=mainPage,this._isRight=!!options.isRight,this._width=options.width||"90%",this._duration=.4,mainPage.css({boxShadow:"0px 0 10px 0px rgba(0, 0, 0, 0.2)"}),menuPage.css({width:options.width,opacity:.9,display:"none"}),menuPage.css(this._isRight?{right:"0px",left:"auto"}:{right:"auto",left:"0px"}),this._blackMask=angular.element("<div></div>").css({backgroundColor:"black",top:"0px",left:"0px",right:"0px",bottom:"0px",position:"absolute",display:"none"}),element.prepend(this._blackMask),animit(mainPage[0]).queue({transform:"translate3d(0, 0, 0)"}).play()},onResized:function(options){if(this._width=options.width,this._menuPage.css("width",this._width),options.isOpened){var max=this._menuPage[0].clientWidth,aboveTransform=this._generateAbovePageTransform(max),behindStyle=this._generateBehindPageStyle(max);animit(this._mainPage[0]).queue({transform:aboveTransform}).play(),animit(this._menuPage[0]).queue(behindStyle).play()}},destroy:function(){this._blackMask&&(this._blackMask.remove(),this._blackMask=null),this._mainPage&&this._mainPage.attr("style",""),this._menuPage&&this._menuPage.attr("style",""),this._mainPage=this._menuPage=this._element=void 0},openMenu:function(callback,instant){var duration=instant===!0?0:this._duration;this._menuPage.css("display","block"),this._blackMask.css("display","block");var max=this._menuPage[0].clientWidth,aboveTransform=this._generateAbovePageTransform(max),behindStyle=this._generateBehindPageStyle(max);setTimeout(function(){animit(this._mainPage[0]).queue({transform:aboveTransform},{duration:duration,timing:"cubic-bezier(.1, .7, .1, 1)"}).queue(function(done){callback(),done()}).play(),animit(this._menuPage[0]).queue(behindStyle,{duration:duration,timing:"cubic-bezier(.1, .7, .1, 1)"}).play()}.bind(this),1e3/60)},closeMenu:function(callback,instant){var duration=instant===!0?0:this._duration;this._blackMask.css("display","block");var aboveTransform=this._generateAbovePageTransform(0),behindStyle=this._generateBehindPageStyle(0);setTimeout(function(){animit(this._mainPage[0]).queue({transform:aboveTransform},{duration:duration,timing:"cubic-bezier(.1, .7, .1, 1)"}).queue({transform:"translate3d(0, 0, 0)"}).queue(function(done){this._menuPage.css("display","none"),callback(),done()}.bind(this)).play(),animit(this._menuPage[0]).queue(behindStyle,{duration:duration,timing:"cubic-bezier(.1, .7, .1, 1)"}).queue(function(done){done()}).play()}.bind(this),1e3/60)},translateMenu:function(options){this._menuPage.css("display","block"),this._blackMask.css("display","block");var aboveTransform=this._generateAbovePageTransform(Math.min(options.maxDistance,options.distance)),behindStyle=this._generateBehindPageStyle(Math.min(options.maxDistance,options.distance));delete behindStyle.opacity,animit(this._mainPage[0]).queue({transform:aboveTransform}).play(),animit(this._menuPage[0]).queue(behindStyle).play()},_generateAbovePageTransform:function(distance){var x=this._isRight?-distance:distance,aboveTransform="translate3d("+x+"px, 0, 0)";return aboveTransform},_generateBehindPageStyle:function(distance){var max=this._menuPage[0].getBoundingClientRect().width,behindDistance=(distance-max)/max*10;behindDistance=isNaN(behindDistance)?0:Math.max(Math.min(behindDistance,0),-10);var behindX=this._isRight?-behindDistance:behindDistance,behindTransform="translate3d("+behindX+"%, 0, 0)",opacity=1+behindDistance/100;return{transform:behindTransform,opacity:opacity}},copy:function(){return new RevealSlidingMenuAnimator}});return RevealSlidingMenuAnimator}])}(),function(){"use strict;";var module=angular.module("onsen");module.factory("SimpleSlideTransitionAnimator",["NavigatorTransitionAnimator",function(NavigatorTransitionAnimator){var SimpleSlideTransitionAnimator=NavigatorTransitionAnimator.extend({backgroundMask:angular.element('<div style="z-index: 2; position: absolute; width: 100%;height: 100%; background-color: black; opacity: 0;"></div>'),timing:"cubic-bezier(.1, .7, .4, 1)",duration:.3,blackMaskOpacity:.4,init:function(options){options=options||{},this.timing=options.timing||this.timing,this.duration=void 0!==options.duration?options.duration:this.duration},push:function(enterPage,leavePage,callback){var mask=this.backgroundMask.remove();leavePage.element[0].parentNode.insertBefore(mask[0],leavePage.element[0].nextSibling),animit.runAll(animit(mask[0]).queue({opacity:0,transform:"translate3d(0, 0, 0)"}).queue({opacity:this.blackMaskOpacity},{duration:this.duration,timing:this.timing}).resetStyle().queue(function(done){mask.remove(),done()}),animit(enterPage.element[0]).queue({css:{transform:"translate3D(100%, 0, 0)"},duration:0}).queue({css:{transform:"translate3D(0, 0, 0)"},duration:this.duration,timing:this.timing}).resetStyle(),animit(leavePage.element[0]).queue({css:{transform:"translate3D(0, 0, 0)"},duration:0}).queue({css:{transform:"translate3D(-45%, 0px, 0px)"},duration:this.duration,timing:this.timing}).resetStyle().wait(.2).queue(function(done){callback(),done()}))},pop:function(enterPage,leavePage,done){var mask=this.backgroundMask.remove();enterPage.element[0].parentNode.insertBefore(mask[0],enterPage.element[0].nextSibling),animit.runAll(animit(mask[0]).queue({opacity:this.blackMaskOpacity,transform:"translate3d(0, 0, 0)"}).queue({opacity:0},{duration:this.duration,timing:this.timing}).resetStyle().queue(function(done){mask.remove(),done()}),animit(enterPage.element[0]).queue({css:{transform:"translate3D(-45%, 0px, 0px)",opacity:.9},duration:0}).queue({css:{transform:"translate3D(0px, 0px, 0px)",opacity:1},duration:this.duration,timing:this.timing}).resetStyle(),animit(leavePage.element[0]).queue({css:{transform:"translate3D(0px, 0px, 0px)"},duration:0}).queue({css:{transform:"translate3D(100%, 0px, 0px)"},duration:this.duration,timing:this.timing}).wait(.2).queue(function(finish){done(),finish()}))}});return SimpleSlideTransitionAnimator}])}(),function(){"use strict;";var module=angular.module("onsen");module.factory("SlideDialogAnimator",["DialogAnimator",function(DialogAnimator){var SlideDialogAnimator=DialogAnimator.extend({timing:"cubic-bezier(.1, .7, .4, 1)",duration:.2,init:function(options){options=options||{},this.timing=options.timing||this.timing,this.duration=void 0!==options.duration?options.duration:this.duration},show:function(dialog,callback){callback=callback?callback:function(){},animit.runAll(animit(dialog._mask[0]).queue({opacity:0}).queue({opacity:1},{duration:this.duration,timing:this.timing}),animit(dialog._dialog[0]).queue({css:{transform:"translate3D(-50%, -350%, 0)"},duration:0}).queue({css:{transform:"translate3D(-50%, -50%, 0)"},duration:this.duration,timing:this.timing}).resetStyle().queue(function(done){callback(),done()}))},hide:function(dialog,callback){callback=callback?callback:function(){},animit.runAll(animit(dialog._mask[0]).queue({opacity:1}).queue({opacity:0},{duration:this.duration,timing:this.timing}),animit(dialog._dialog[0]).queue({css:{transform:"translate3D(-50%, -50%, 0)"},duration:0}).queue({css:{transform:"translate3D(-50%, -350%, 0)"},duration:this.duration,timing:this.timing}).resetStyle().queue(function(done){callback(),done()}))}});return SlideDialogAnimator}])}(),function(){"use strict";var module=angular.module("onsen"),SlidingMenuViewModel=Class.extend({_distance:0,_maxDistance:void 0,init:function(options){if(!angular.isNumber(options.maxDistance))throw new Error("options.maxDistance must be number");this.setMaxDistance(options.maxDistance)},setMaxDistance:function(maxDistance){if(0>=maxDistance)throw new Error("maxDistance must be greater then zero.");this.isOpened()&&(this._distance=maxDistance),this._maxDistance=maxDistance},shouldOpen:function(){return!this.isOpened()&&this._distance>=this._maxDistance/2},shouldClose:function(){return!this.isClosed()&&this._distance<this._maxDistance/2},openOrClose:function(options){this.shouldOpen()?this.open(options):this.shouldClose()&&this.close(options)},close:function(options){var callback=options.callback||function(){};this.isClosed()?callback():(this._distance=0,this.emit("close",options))},open:function(options){var callback=options.callback||function(){};this.isOpened()?callback():(this._distance=this._maxDistance,this.emit("open",options))},isClosed:function(){return 0===this._distance},isOpened:function(){return this._distance===this._maxDistance},getX:function(){return this._distance},getMaxDistance:function(){return this._maxDistance},translate:function(x){this._distance=Math.max(1,Math.min(this._maxDistance-1,x));var options={distance:this._distance,maxDistance:this._maxDistance};this.emit("translate",options)},toggle:function(){this.isClosed()?this.open():this.close()}});MicroEvent.mixin(SlidingMenuViewModel),module.factory("SlidingMenuView",["$onsen","$compile","SlidingMenuAnimator","RevealSlidingMenuAnimator","PushSlidingMenuAnimator","OverlaySlidingMenuAnimator",function($onsen,$compile,SlidingMenuAnimator,RevealSlidingMenuAnimator,PushSlidingMenuAnimator,OverlaySlidingMenuAnimator){var SlidingMenuView=Class.extend({_scope:void 0,_attrs:void 0,_element:void 0,_menuPage:void 0,_mainPage:void 0,_doorLock:void 0,_isRightMenu:!1,init:function(scope,element,attrs){this._scope=scope,this._attrs=attrs,this._element=element,this._menuPage=angular.element(element[0].querySelector(".onsen-sliding-menu__menu")),this._mainPage=angular.element(element[0].querySelector(".onsen-sliding-menu__main")),this._doorLock=new DoorLock,this._isRightMenu="right"===attrs.side,this._mainPageHammer=new Hammer(this._mainPage[0]),this._bindedOnTap=this._onTap.bind(this);var maxDistance=this._normalizeMaxSlideDistanceAttr();this._logic=new SlidingMenuViewModel({maxDistance:Math.max(maxDistance,1)}),this._logic.on("translate",this._translate.bind(this)),this._logic.on("open",function(options){this._open(options)}.bind(this)),this._logic.on("close",function(options){this._close(options)}.bind(this)),attrs.$observe("maxSlideDistance",this._onMaxSlideDistanceChanged.bind(this)),attrs.$observe("swipeable",this._onSwipeableChanged.bind(this)),this._bindedOnWindowResize=this._onWindowResize.bind(this),window.addEventListener("resize",this._bindedOnWindowResize),this._boundHandleEvent=this._handleEvent.bind(this),this._bindEvents(),attrs.mainPage&&this.setMainPage(attrs.mainPage),attrs.menuPage&&this.setMenuPage(attrs.menuPage),this._deviceBackButtonHandler=$onsen.DeviceBackButtonHandler.create(this._element,this._onDeviceBackButton.bind(this));var unlock=this._doorLock.lock();window.setTimeout(function(){var maxDistance=this._normalizeMaxSlideDistanceAttr();this._logic.setMaxDistance(maxDistance),this._menuPage.css({opacity:1}),this._animator=this._getAnimatorOption(),this._animator.setup(this._element,this._mainPage,this._menuPage,{isRight:this._isRightMenu,width:this._attrs.maxSlideDistance||"90%"}),unlock()}.bind(this),400),scope.$on("$destroy",this._destroy.bind(this)),attrs.swipeable||this.setSwipeable(!0)},getDeviceBackButtonHandler:function(){return this._deviceBackButtonHandler},_onDeviceBackButton:function(event){this.isMenuOpened()?this.closeMenu():event.callParentHandler()},_onTap:function(){this.isMenuOpened()&&this.closeMenu()},_refreshMenuPageWidth:function(){var width="maxSlideDistance"in this._attrs?this._attrs.maxSlideDistance:"90%";this._animator&&this._animator.onResized({isOpened:this._logic.isOpened(),width:width})},_destroy:function(){this.emit("destroy"),this._deviceBackButtonHandler.destroy(),window.removeEventListener("resize",this._bindedOnWindowResize),this._mainPageHammer.off("tap",this._bindedOnTap),this._element=this._scope=this._attrs=null},_getAnimatorOption:function(){var animator=SlidingMenuView._animatorDict[this._attrs.type];return animator instanceof SlidingMenuAnimator||(animator=SlidingMenuView._animatorDict["default"]),animator.copy()},_onSwipeableChanged:function(swipeable){swipeable=""===swipeable||void 0===swipeable||"true"==swipeable,this.setSwipeable(swipeable)},setSwipeable:function(enabled){enabled?this._activateHammer():this._deactivateHammer()},_onWindowResize:function(){this._recalculateMAX(),this._refreshMenuPageWidth()},_onMaxSlideDistanceChanged:function(){this._recalculateMAX(),this._refreshMenuPageWidth()},_normalizeMaxSlideDistanceAttr:function(){var maxDistance=this._attrs.maxSlideDistance;if("maxSlideDistance"in this._attrs){if("string"!=typeof maxDistance)throw new Error("invalid state");-1!==maxDistance.indexOf("px",maxDistance.length-2)?maxDistance=parseInt(maxDistance.replace("px",""),10):maxDistance.indexOf("%",maxDistance.length-1)>0&&(maxDistance=maxDistance.replace("%",""),maxDistance=parseFloat(maxDistance)/100*this._mainPage[0].clientWidth)}else maxDistance=.9*this._mainPage[0].clientWidth;return maxDistance},_recalculateMAX:function(){var maxDistance=this._normalizeMaxSlideDistanceAttr();maxDistance&&this._logic.setMaxDistance(parseInt(maxDistance,10))},_activateHammer:function(){this._hammertime.on("touch dragleft dragright swipeleft swiperight release",this._boundHandleEvent)},_deactivateHammer:function(){this._hammertime.off("touch dragleft dragright swipeleft swiperight release",this._boundHandleEvent)},_bindEvents:function(){this._hammertime=new Hammer(this._element[0],{dragMinDistance:1 })},_appendMainPage:function(pageUrl,templateHTML){var pageScope=this._scope.$new(),pageContent=angular.element(templateHTML),link=$compile(pageContent);this._mainPage.append(pageContent),this._currentPageElement&&(this._currentPageElement.remove(),this._currentPageScope.$destroy()),link(pageScope),this._currentPageElement=pageContent,this._currentPageScope=pageScope,this._currentPageUrl=pageUrl},_appendMenuPage:function(templateHTML){var pageScope=this._scope.$new(),pageContent=angular.element(templateHTML),link=$compile(pageContent);this._menuPage.append(pageContent),this._currentMenuPageScope&&(this._currentMenuPageScope.$destroy(),this._currentMenuPageElement.remove()),link(pageScope),this._currentMenuPageElement=pageContent,this._currentMenuPageScope=pageScope},setMenuPage:function(page,options){if(!page)throw new Error("cannot set undefined page");options=options||{},options.callback=options.callback||function(){};var self=this;$onsen.getPageHTMLAsync(page).then(function(html){self._appendMenuPage(angular.element(html)),options.closeMenu&&self.close(),options.callback()},function(){throw new Error("Page is not found: "+page)})},setMainPage:function(pageUrl,options){options=options||{},options.callback=options.callback||function(){};var done=function(){options.closeMenu&&this.close(),options.callback()}.bind(this);if(this.currentPageUrl===pageUrl)return void done();if(!pageUrl)throw new Error("cannot set undefined page");var self=this;$onsen.getPageHTMLAsync(pageUrl).then(function(html){self._appendMainPage(pageUrl,html),done()},function(){throw new Error("Page is not found: "+page)})},_handleEvent:function(event){if(!this._doorLock.isLocked())switch(this._isInsideIgnoredElement(event.target)&&this._deactivateHammer(),event.type){case"dragleft":case"dragright":if(this._logic.isClosed()&&!this._isInsideSwipeTargetArea(event))return;event.gesture.preventDefault();var deltaX=event.gesture.deltaX,deltaDistance=this._isRightMenu?-deltaX:deltaX,startEvent=event.gesture.startEvent;if("isOpened"in startEvent||(startEvent.isOpened=this._logic.isOpened()),0>deltaDistance&&this._logic.isClosed())break;if(deltaDistance>0&&this._logic.isOpened())break;var distance=startEvent.isOpened?deltaDistance+this._logic.getMaxDistance():deltaDistance;this._logic.translate(distance);break;case"swipeleft":if(event.gesture.preventDefault(),this._logic.isClosed()&&!this._isInsideSwipeTargetArea(event))return;this._isRightMenu?this.open():this.close(),event.gesture.stopDetect();break;case"swiperight":if(event.gesture.preventDefault(),this._logic.isClosed()&&!this._isInsideSwipeTargetArea(event))return;this._isRightMenu?this.close():this.open(),event.gesture.stopDetect();break;case"release":this._lastDistance=null,this._logic.shouldOpen()?this.open():this._logic.shouldClose()&&this.close()}},_isInsideIgnoredElement:function(element){do{if(element.getAttribute&&element.getAttribute("sliding-menu-ignore"))return!0;element=element.parentNode}while(element);return!1},_isInsideSwipeTargetArea:function(event){var x=event.gesture.center.pageX;"_swipeTargetWidth"in event.gesture.startEvent||(event.gesture.startEvent._swipeTargetWidth=this._getSwipeTargetWidth());var targetWidth=event.gesture.startEvent._swipeTargetWidth;return this._isRightMenu?this._mainPage[0].clientWidth-x<targetWidth:targetWidth>x},_getSwipeTargetWidth:function(){var targetWidth=this._attrs.swipeTargetWidth;"string"==typeof targetWidth&&(targetWidth=targetWidth.replace("px",""));var width=parseInt(targetWidth,10);return 0>width||!targetWidth?this._mainPage[0].clientWidth:width},closeMenu:function(){return this.close.apply(this,arguments)},close:function(options){options=options||{},options="function"==typeof options?{callback:options}:options,this._logic.isClosed()||(this.emit("preclose",{slidingMenu:this}),this._doorLock.waitUnlock(function(){this._logic.close(options)}.bind(this)))},_close:function(options){var callback=options.callback||function(){},unlock=this._doorLock.lock(),instant="none"==options.animation;this._animator.closeMenu(function(){unlock(),this._mainPage.children().css("pointer-events",""),this._mainPageHammer.off("tap",this._bindedOnTap),this.emit("postclose",{slidingMenu:this}),callback()}.bind(this),instant)},openMenu:function(){return this.open.apply(this,arguments)},open:function(options){options=options||{},options="function"==typeof options?{callback:options}:options,this.emit("preopen",{slidingMenu:this}),this._doorLock.waitUnlock(function(){this._logic.open(options)}.bind(this))},_open:function(options){var callback=options.callback||function(){},unlock=this._doorLock.lock(),instant="none"==options.animation;this._animator.openMenu(function(){unlock(),this._mainPage.children().css("pointer-events","none"),this._mainPageHammer.on("tap",this._bindedOnTap),this.emit("postopen",{slidingMenu:this}),callback()}.bind(this),instant)},toggle:function(options){this._logic.isClosed()?this.open(options):this.close(options)},toggleMenu:function(){return this.toggle.apply(this,arguments)},isMenuOpened:function(){return this._logic.isOpened()},_translate:function(event){this._animator.translateMenu(event)}});return SlidingMenuView._animatorDict={"default":new RevealSlidingMenuAnimator,overlay:new OverlaySlidingMenuAnimator,reveal:new RevealSlidingMenuAnimator,push:new PushSlidingMenuAnimator},SlidingMenuView.registerSlidingMenuAnimator=function(name,animator){if(!(animator instanceof SlidingMenuAnimator))throw new Error('"animator" param must be an instance of SlidingMenuAnimator');this._animatorDict[name]=animator},MicroEvent.mixin(SlidingMenuView),SlidingMenuView}])}(),function(){"use strict";var module=angular.module("onsen");module.factory("SlidingMenuAnimator",function(){return Class.extend({setup:function(element,mainPage,menuPage,options){},onResized:function(options){},openMenu:function(callback){},closeClose:function(callback){},destroy:function(){},translateMenu:function(mainPage,menuPage,options){},copy:function(){throw new Error("Override copy method.")}})})}(),function(){"use strict";var module=angular.module("onsen");module.factory("SplitView",["$compile","RevealSlidingMenuAnimator","$onsen","$onsGlobal",function($compile,RevealSlidingMenuAnimator,$onsen,$onsGlobal){function isNumber(n){return!isNaN(parseFloat(n))&&isFinite(n)}var SPLIT_MODE=0,COLLAPSE_MODE=1,MAIN_PAGE_RATIO=.9,SplitView=Class.extend({init:function(scope,element,attrs){element.addClass("onsen-sliding-menu"),this._element=element,this._scope=scope,this._attrs=attrs,this._mainPage=angular.element(element[0].querySelector(".onsen-split-view__main")),this._secondaryPage=angular.element(element[0].querySelector(".onsen-split-view__secondary")),this._max=this._mainPage[0].clientWidth*MAIN_PAGE_RATIO,this._mode=SPLIT_MODE,this._doorLock=new DoorLock,this._doSplit=!1,this._doCollapse=!1,$onsGlobal.orientation.on("change",this._onResize.bind(this)),this._animator=new RevealSlidingMenuAnimator,this._element.css("display","none"),attrs.mainPage&&this.setMainPage(attrs.mainPage),attrs.secondaryPage&&this.setSecondaryPage(attrs.secondaryPage);var unlock=this._doorLock.lock();this._considerChangingCollapse(),this._setSize(),setTimeout(function(){this._element.css("display","block"),unlock()}.bind(this),1e3/60*2),scope.$on("$destroy",this._destroy.bind(this))},_appendSecondPage:function(templateHTML){var pageScope=this._scope.$new(),pageContent=$compile(templateHTML)(pageScope);this._secondaryPage.append(pageContent),this._currentSecondaryPageElement&&(this._currentSecondaryPageElement.remove(),this._currentSecondaryPageScope.$destroy()),this._currentSecondaryPageElement=pageContent,this._currentSecondaryPageScope=pageScope},_appendMainPage:function(templateHTML){var pageScope=this._scope.$new(),pageContent=$compile(templateHTML)(pageScope);this._mainPage.append(pageContent),this._currentPage&&(this._currentPage.remove(),this._currentPageScope.$destroy()),this._currentPage=pageContent,this._currentPageScope=pageScope},setSecondaryPage:function(page){if(!page)throw new Error("cannot set undefined page");$onsen.getPageHTMLAsync(page).then(function(html){this._appendSecondPage(angular.element(html.trim()))}.bind(this),function(){throw new Error("Page is not found: "+page)})},setMainPage:function(page){if(!page)throw new Error("cannot set undefined page");$onsen.getPageHTMLAsync(page).then(function(html){this._appendMainPage(angular.element(html.trim()))}.bind(this),function(){throw new Error("Page is not found: "+page)})},_onResize:function(){var lastMode=this._mode;this._considerChangingCollapse(),lastMode===COLLAPSE_MODE&&this._mode===COLLAPSE_MODE&&this._animator.onResized({isOpened:!1,width:"90%"}),this._max=this._mainPage[0].clientWidth*MAIN_PAGE_RATIO},_considerChangingCollapse:function(){var should=this._shouldCollapse();should&&this._mode!==COLLAPSE_MODE?(this._fireUpdateEvent(),this._doSplit?this._activateSplitMode():this._activateCollapseMode()):should||this._mode!==COLLAPSE_MODE||(this._fireUpdateEvent(),this._doCollapse?this._activateCollapseMode():this._activateSplitMode()),this._doCollapse=this._doSplit=!1},update:function(){this._fireUpdateEvent();var should=this._shouldCollapse();this._doSplit?this._activateSplitMode():this._doCollapse?this._activateCollapseMode():should?this._activateCollapseMode():should||this._activateSplitMode(),this._doSplit=this._doCollapse=!1},_getOrientation:function(){return $onsGlobal.orientation.isPortrait()?"portrait":"landscape"},getCurrentMode:function(){return this._mode===COLLAPSE_MODE?"collapse":"split"},_shouldCollapse:function(){var c="portrait";if("string"==typeof this._attrs.collapse&&(c=this._attrs.collapse.trim()),"portrait"==c)return $onsGlobal.orientation.isPortrait();if("landscape"==c)return $onsGlobal.orientation.isLandscape();if("width"==c.substr(0,5)){var num=c.split(" ")[1];num.indexOf("px")>=0&&(num=num.substr(0,num.length-2));var width=window.innerWidth;return isNumber(num)&&num>width}var mq=window.matchMedia(c);return mq.matches},_setSize:function(){if(this._mode===SPLIT_MODE){this._attrs.mainPageWidth||(this._attrs.mainPageWidth="70");var secondarySize=100-this._attrs.mainPageWidth.replace("%","");this._secondaryPage.css({width:secondarySize+"%",opacity:1}),this._mainPage.css({width:this._attrs.mainPageWidth+"%"}),this._mainPage.css("left",secondarySize+"%")}},_fireEvent:function(name){this.emit(name,{splitView:this,width:window.innerWidth,orientation:this._getOrientation()})},_fireUpdateEvent:function(){var that=this;this.emit("update",{splitView:this,shouldCollapse:this._shouldCollapse(),currentMode:this.getCurrentMode(),split:function(){that._doSplit=!0,that._doCollapse=!1},collapse:function(){that._doSplit=!1,that._doCollapse=!0},width:window.innerWidth,orientation:this._getOrientation()})},_activateCollapseMode:function(){this._mode!==COLLAPSE_MODE&&(this._fireEvent("precollapse"),this._secondaryPage.attr("style",""),this._mainPage.attr("style",""),this._mode=COLLAPSE_MODE,this._animator.setup(this._element,this._mainPage,this._secondaryPage,{isRight:!1,width:"90%"}),this._fireEvent("postcollapse"))},_activateSplitMode:function(){this._mode!==SPLIT_MODE&&(this._fireEvent("presplit"),this._animator.destroy(),this._secondaryPage.attr("style",""),this._mainPage.attr("style",""),this._mode=SPLIT_MODE,this._setSize(),this._fireEvent("postsplit"))},_destroy:function(){this.emit("destroy"),this._element=null,this._scope=null}});return MicroEvent.mixin(SplitView),SplitView}])}(),function(){"use strict";var module=angular.module("onsen");module.factory("SwitchView",["$onsen",function($onsen){var SwitchView=Class.extend({init:function(element,scope,attrs){this._element=element,this._checkbox=angular.element(element[0].querySelector("input[type=checkbox]")),this._scope=scope,attrs.$observe("disabled",function(disabled){element.attr("disabled")?this._checkbox.attr("disabled","disabled"):this._checkbox.removeAttr("disabled")}.bind(this)),this._checkbox.on("change",function(event){this.emit("change",{"switch":this,value:this._checkbox[0].checked,isInteractive:!0})}.bind(this))},isChecked:function(){return this._checkbox[0].checked},setChecked:function(isChecked){isChecked=!!isChecked,this._checkbox[0].checked!=isChecked&&(this._scope.model=isChecked,this._checkbox[0].checked=isChecked,this._scope.$evalAsync(),this.emit("change",{"switch":this,value:isChecked,isInteractive:!1}))},getCheckboxElement:function(){return this._checkbox[0]}});return MicroEvent.mixin(SwitchView),SwitchView}])}(),function(){"use strict;";var module=angular.module("onsen");module.factory("TabbarAnimator",function(){var TabbarAnimator=Class.extend({apply:function(enterPage,leavePage,done){throw new Error("This method must be implemented.")}});return TabbarAnimator}),module.factory("TabbarNoneAnimator",["TabbarAnimator",function(TabbarAnimator){var TabbarNoneAnimator=TabbarAnimator.extend({apply:function(enterPage,leavePage,done){done()}});return TabbarNoneAnimator}]),module.factory("TabbarFadeAnimator",["TabbarAnimator",function(TabbarAnimator){var TabbarFadeAnimator=TabbarAnimator.extend({apply:function(enterPage,leavePage,done){animit.runAll(animit(enterPage[0]).queue({transform:"translate3D(0, 0, 0)",opacity:0}).queue({transform:"translate3D(0, 0, 0)",opacity:1},{duration:.4,timing:"linear"}).resetStyle().queue(function(callback){done(),callback()}),animit(leavePage[0]).queue({transform:"translate3D(0, 0, 0)",opacity:1}).queue({transform:"translate3D(0, 0, 0)",opacity:0},{duration:.4,timing:"linear"}))}});return TabbarFadeAnimator}]),module.factory("TabbarView",["$onsen","$compile","TabbarAnimator","TabbarNoneAnimator","TabbarFadeAnimator",function($onsen,$compile,TabbarAnimator,TabbarNoneAnimator,TabbarFadeAnimator){var TabbarView=Class.extend({_tabbarId:void 0,_tabItems:void 0,init:function(scope,element,attrs){this._scope=scope,this._element=element,this._attrs=attrs,this._tabbarId=Date.now(),this._tabItems=[],this._contentElement=angular.element(element[0].querySelector(".ons-tab-bar__content")),this._tabbarElement=angular.element(element[0].querySelector(".ons-tab-bar__footer")),this._scope.$on("$destroy",this._destroy.bind(this)),this._hasTopTabbar()&&this._prepareForTopTabbar()},_prepareForTopTabbar:function(){this._contentElement.attr("no-status-bar-fill",""),setImmediate(function(){this._contentElement.addClass("tab-bar--top__content"),this._tabbarElement.addClass("tab-bar--top")}.bind(this));var page=ons.findParentComponentUntil("ons-page",this._element[0]);if(page&&this._element.css("top",window.getComputedStyle(page.getContentElement(),null).getPropertyValue("padding-top")),$onsen.shouldFillStatusBar(this._element[0])){var fill=angular.element(document.createElement("div"));fill.addClass("tab-bar__status-bar-fill"),fill.css({width:"0px",height:"0px"}),this._element.prepend(fill)}},_hasTopTabbar:function(){return"top"===this._attrs.position},setActiveTab:function(index,options){options=options||{};var previousTabItem=this._tabItems[this.getActiveTabIndex()],selectedTabItem=this._tabItems[index];if(("undefined"!=typeof selectedTabItem.noReload||selectedTabItem.isPersistent())&&index===this.getActiveTabIndex())return this.emit("reactive",{index:index,tabItem:selectedTabItem}),!1;var needLoad=selectedTabItem.page&&!options.keepPage;if(!selectedTabItem)return!1;var canceled=!1;if(this.emit("prechange",{index:index,tabItem:selectedTabItem,cancel:function(){canceled=!0}}),canceled)return selectedTabItem.setInactive(),previousTabItem&&previousTabItem.setActive(),!1;selectedTabItem.setActive();for(var i=0;i<this._tabItems.length;i++)this._tabItems[i]!=selectedTabItem?this._tabItems[i].setInactive():needLoad||this.emit("postchange",{index:index,tabItem:selectedTabItem});if(needLoad){var removeElement=!0;previousTabItem&&previousTabItem.isPersistent()&&(removeElement=!1,previousTabItem._pageElement=this._currentPageElement);var params={callback:function(){this.emit("postchange",{index:index,tabItem:selectedTabItem})}.bind(this),_removeElement:removeElement};options.animation&&(params.animation=options.animation),selectedTabItem.isPersistent()&&selectedTabItem._pageElement?this._loadPersistentPageDOM(selectedTabItem._pageElement,params):this._loadPage(selectedTabItem.page,params)}return!0},setTabbarVisibility:function(visible){this._scope.hideTabs=!visible,this._onTabbarVisibilityChanged()},_onTabbarVisibilityChanged:function(){this._hasTopTabbar()?this._scope.hideTabs?this._contentElement.css("top","0px"):this._contentElement.css("top",""):this._scope.hideTabs?this._contentElement.css("bottom","0px"):this._contentElement.css("bottom","")},addTabItem:function(tabItem){this._tabItems.push(tabItem)},getActiveTabIndex:function(){for(var tabItem,i=0;i<this._tabItems.length;i++)if(tabItem=this._tabItems[i],tabItem.isActive())return i;return-1},loadPage:function(page,options){return this._loadPage(page,options)},_loadPage:function(page,options){$onsen.getPageHTMLAsync(page).then(function(html){var pageElement=angular.element(html.trim());this._loadPageDOM(pageElement,options)}.bind(this),function(){throw new Error("Page is not found: "+page)})},_switchPage:function(element,options){if(this._currentPageElement){var oldPageElement=this._currentPageElement,oldPageScope=this._currentPageScope;this._currentPageElement=element,this._currentPageScope=element.data("_scope"),this._getAnimatorOption(options).apply(element,oldPageElement,function(){options._removeElement?(oldPageElement.remove(),oldPageScope.$destroy()):oldPageElement.css("display","none"),options.callback instanceof Function&&options.callback()})}else this._currentPageElement=element,this._currentPageScope=element.data("_scope"),options.callback instanceof Function&&options.callback()},_loadPageDOM:function(element,options){options=options||{};var pageScope=this._scope.$new(),link=$compile(element);this._contentElement.append(element);var pageContent=link(pageScope);pageScope.$evalAsync(),this._switchPage(pageContent,options)},_loadPersistentPageDOM:function(element,options){options=options||{},element.css("display","block"),this._switchPage(element,options)},_getAnimatorOption:function(options){var animationAttr=this._element.attr("animation")||"default";return TabbarView._animatorDict[options.animation||animationAttr]||TabbarView._animatorDict["default"]},_destroy:function(){this.emit("destroy"),this._element=this._scope=this._attrs=null}});return MicroEvent.mixin(TabbarView),TabbarView._animatorDict={"default":new TabbarNoneAnimator,none:new TabbarNoneAnimator,fade:new TabbarFadeAnimator},TabbarView.registerAnimator=function(name,animator){if(!(animator instanceof TabbarAnimator))throw new Error('"animator" param must be an instance of TabbarAnimator');this._animatorDict[name]=animator},TabbarView}])}(),function(){"use strict";var module=angular.module("onsen");module.directive("onsAlertDialog",["$onsen","AlertDialogView",function($onsen,AlertDialogView){return{restrict:"E",replace:!1,scope:!0,transclude:!1,compile:function(element,attrs){var modifierTemplater=$onsen.generateModifierTemplater(attrs);element.addClass("alert-dialog "+modifierTemplater("alert-dialog--*"));var titleElement=angular.element(element[0].querySelector(".alert-dialog-title")),contentElement=angular.element(element[0].querySelector(".alert-dialog-content"));return titleElement.length&&titleElement.addClass(modifierTemplater("alert-dialog-title--*")),contentElement.length&&contentElement.addClass(modifierTemplater("alert-dialog-content--*")),{pre:function(scope,element,attrs){var alertDialog=new AlertDialogView(scope,element,attrs);$onsen.declareVarAttribute(attrs,alertDialog),$onsen.registerEventHandlers(alertDialog,"preshow prehide postshow posthide destroy"),$onsen.addModifierMethods(alertDialog,"alert-dialog--*",element),titleElement.length&&$onsen.addModifierMethods(alertDialog,"alert-dialog-title--*",titleElement),contentElement.length&&$onsen.addModifierMethods(alertDialog,"alert-dialog-content--*",contentElement),$onsen.isAndroid()&&alertDialog.addModifier("android"),element.data("ons-alert-dialog",alertDialog),scope.$on("$destroy",function(){alertDialog._events=void 0,$onsen.removeModifierMethods(alertDialog),element.data("ons-alert-dialog",void 0),element=null})},post:function(scope,element){$onsen.fireComponentEvent(element[0],"init")}}}}}])}(),function(){"use strict";var module=angular.module("onsen");module.directive("onsBackButton",["$onsen","$compile","GenericView","ComponentCleaner",function($onsen,$compile,GenericView,ComponentCleaner){return{restrict:"E",replace:!1,templateUrl:$onsen.DIRECTIVE_TEMPLATE_URL+"/back_button.tpl",transclude:!0,scope:!0,link:{pre:function(scope,element,attrs,controller,transclude){var backButton=new GenericView(scope,element,attrs);$onsen.declareVarAttribute(attrs,backButton),element.data("ons-back-button",backButton),scope.$on("$destroy",function(){backButton._events=void 0,$onsen.removeModifierMethods(backButton),element.data("ons-back-button",void 0),element=null}),scope.modifierTemplater=$onsen.generateModifierTemplater(attrs);var navigator=ons.findParentComponentUntil("ons-navigator",element);scope.$watch(function(){return navigator.pages.length},function(nbrOfPages){scope.showBackButton=nbrOfPages>1}),$onsen.addModifierMethods(backButton,"toolbar-button--*",element.children()),transclude(scope,function(clonedElement){clonedElement[0]&&element[0].querySelector(".back-button__label").appendChild(clonedElement[0])}),ComponentCleaner.onDestroy(scope,function(){ComponentCleaner.destroyScope(scope),ComponentCleaner.destroyAttributes(attrs),element=null,scope=null,attrs=null})},post:function(scope,element){$onsen.fireComponentEvent(element[0],"init")}}}}])}(),function(){"use strict";var module=angular.module("onsen");module.directive("onsBottomToolbar",["$onsen","GenericView",function($onsen,GenericView){return{restrict:"E",replace:!1,transclude:!1,scope:!1,compile:function(element,attrs){var modifierTemplater=$onsen.generateModifierTemplater(attrs),inline="undefined"!=typeof attrs.inline;return element.addClass("bottom-bar"),element.addClass(modifierTemplater("bottom-bar--*")),element.css({"z-index":0}),inline&&element.css("position","static"),{pre:function(scope,element,attrs){var bottomToolbar=new GenericView(scope,element,attrs);$onsen.declareVarAttribute(attrs,bottomToolbar),element.data("ons-bottomToolbar",bottomToolbar),scope.$on("$destroy",function(){bottomToolbar._events=void 0,$onsen.removeModifierMethods(bottomToolbar),element.data("ons-bottomToolbar",void 0),element=null}),$onsen.addModifierMethods(bottomToolbar,"bottom-bar--*",element);var pageView=element.inheritedData("ons-page");pageView&&!inline&&pageView.registerBottomToolbar(element)},post:function(scope,element,attrs){$onsen.fireComponentEvent(element[0],"init")}}}}}])}(),function(){"use strict";var module=angular.module("onsen");module.directive("onsButton",["$onsen","ButtonView",function($onsen,ButtonView){return{restrict:"E",replace:!1,transclude:!0,scope:{animation:"@"},templateUrl:$onsen.DIRECTIVE_TEMPLATE_URL+"/button.tpl",link:function(scope,element,attrs,_,transclude){var button=new ButtonView(scope,element,attrs);$onsen.declareVarAttribute(attrs,button),element.data("ons-button",button),scope.$on("$destroy",function(){button._events=void 0,$onsen.removeModifierMethods(button),element.data("ons-button",void 0),element=null});var initialAnimation="slide-left";if(scope.modifierTemplater=$onsen.generateModifierTemplater(attrs),element.addClass("button effeckt-button"),element.addClass(scope.modifierTemplater("button--*")),element.addClass(initialAnimation),$onsen.addModifierMethods(button,"button--*",element),transclude(scope.$parent,function(cloned){angular.element(element[0].querySelector(".ons-button-inner")).append(cloned)}),attrs.ngController)throw new Error("This element can't accept ng-controller directive.");scope.item={},scope.item.animation=initialAnimation,scope.$watch("animation",function(newAnimation){newAnimation&&(scope.item.animation&&element.removeClass(scope.item.animation),scope.item.animation=newAnimation,element.addClass(scope.item.animation))}),attrs.$observe("shouldSpin",function(shouldSpin){"true"===shouldSpin?element.attr("data-loading",!0):element.removeAttr("data-loading")}),$onsen.cleaner.onDestroy(scope,function(){$onsen.clearComponent({scope:scope,attrs:attrs,element:element}),scope=element=attrs=null}),$onsen.fireComponentEvent(element[0],"init")}}}])}(),function(){"use strict";var module=angular.module("onsen");module.directive("onsCarousel",["$onsen","CarouselView",function($onsen,CarouselView){return{restrict:"E",replace:!1,scope:!1,transclude:!1,compile:function(element,attrs){var templater=$onsen.generateModifierTemplater(attrs);return element.addClass(templater("carousel--*")),function(scope,element,attrs){var carousel=new CarouselView(scope,element,attrs);element.data("ons-carousel",carousel),$onsen.registerEventHandlers(carousel,"postchange refresh overscroll destroy"),$onsen.declareVarAttribute(attrs,carousel),scope.$on("$destroy",function(){carousel._events=void 0,element.data("ons-carousel",void 0),element=null}),element[0].hasAttribute("auto-refresh")&&scope.$watch(function(){return element[0].childNodes.length},function(){setImmediate(function(){carousel.refresh()})}),setImmediate(function(){carousel.refresh()}),$onsen.fireComponentEvent(element[0],"init")}}}}]),module.directive("onsCarouselItem",["$onsen",function($onsen){return{restrict:"E",replace:!1,scope:!1,transclude:!1,compile:function(element,attrs){var templater=$onsen.generateModifierTemplater(attrs);return element.addClass(templater("carousel-item--*")),element.css("width","100%"),function(scope,element,attrs){}}}}])}(),function(){"use strict";var module=angular.module("onsen");module.directive("onsCol",["$timeout","$onsen",function($timeout,$onsen){return{restrict:"E",replace:!1,transclude:!1,scope:!1,compile:function(element,attrs,transclude){return element.addClass("col ons-col-inner"),function(scope,element,attrs){function updateAlign(align){"top"===align||"center"===align||"bottom"===align?(element.removeClass("col-top col-center col-bottom"),element.addClass("col-"+align)):element.removeClass("col-top col-center col-bottom")}function updateWidth(width){"string"==typeof width?(width=(""+width).trim(),width=width.match(/^\d+$/)?width+"%":width,element.css({"-webkit-box-flex":"0","-webkit-flex":"0 0 "+width,"-moz-box-flex":"0","-moz-flex":"0 0 "+width,"-ms-flex":"0 0 "+width,flex:"0 0 "+width,"max-width":width})):element.removeAttr("style")}attrs.$observe("align",function(align){updateAlign(align)}),attrs.$observe("width",function(width){updateWidth(width)}),attrs.$observe("size",function(size){attrs.width||updateWidth(size)}),updateAlign(attrs.align),updateWidth(attrs.size&&!attrs.width?attrs.size:attrs.width),$onsen.cleaner.onDestroy(scope,function(){$onsen.clearComponent({scope:scope,element:element,attrs:attrs}),element=attrs=scope=null}),$onsen.fireComponentEvent(element[0],"init")}}}}])}(),function(){"use strict";var module=angular.module("onsen");module.directive("onsDialog",["$onsen","DialogView",function($onsen,DialogView){return{restrict:"E",replace:!1,scope:!0,transclude:!0,templateUrl:$onsen.DIRECTIVE_TEMPLATE_URL+"/dialog.tpl",compile:function(element,attrs,transclude){return element[0].setAttribute("no-status-bar-fill",""),{pre:function(scope,element,attrs){transclude(scope,function(clone){angular.element(element[0].querySelector(".dialog")).append(clone)});var dialog=new DialogView(scope,element,attrs);scope.modifierTemplater=$onsen.generateModifierTemplater(attrs),$onsen.addModifierMethods(dialog,"dialog--*",angular.element(element[0].querySelector(".dialog"))),$onsen.declareVarAttribute(attrs,dialog),$onsen.registerEventHandlers(dialog,"preshow prehide postshow posthide destroy"),element.data("ons-dialog",dialog),scope.$on("$destroy",function(){dialog._events=void 0,$onsen.removeModifierMethods(dialog),element.data("ons-dialog",void 0),element=null})},post:function(scope,element){$onsen.fireComponentEvent(element[0],"init")}}}}}])}(),function(){"use strict";var module=angular.module("onsen");module.directive("onsDummyForInit",["$rootScope",function($rootScope){var isReady=!1;return{restrict:"E",replace:!1,link:{post:function(scope,element){isReady||(isReady=!0,$rootScope.$broadcast("$ons-ready")),element.remove()}}}}])}(),function(){"use strict";var EVENTS="drag dragleft dragright dragup dragdown hold release swipe swipeleft swiperight swipeup swipedown tap doubletap touch transform pinch pinchin pinchout rotate".split(/ +/);angular.module("onsen").directive("onsGestureDetector",["$onsen",function($onsen){function titlize(str){return str.charAt(0).toUpperCase()+str.slice(1)}var scopeDef=EVENTS.reduce(function(dict,name){return dict["ng"+titlize(name)]="&",dict},{});return{restrict:"E",scope:scopeDef,replace:!1,transclude:!0,compile:function(element,attrs){return function(scope,element,attrs,controller,transclude){function handleEvent(event){var attr="ng"+titlize(event.type);attr in scopeDef&&scope[attr]({$event:event})}transclude(scope.$parent,function(cloned){element.append(cloned)});var hammer=new Hammer(element[0]);hammer.on(EVENTS.join(" "),handleEvent),$onsen.cleaner.onDestroy(scope,function(){hammer.off(EVENTS.join(" "),handleEvent),$onsen.clearComponent({scope:scope,element:element,attrs:attrs}),hammer.element=scope=element=attrs=null}),$onsen.fireComponentEvent(element[0],"init")}}}}])}(),function(){"use strict";function cleanClassAttribute(element){var classList=(""+element.attr("class")).split(/ +/).filter(function(classString){return"fa"!==classString&&"fa-"!==classString.substring(0,3)&&"ion-"!==classString.substring(0,4)});element.attr("class",classList.join(" "))}function buildClassAndStyle(attrs){var classList=["ons-icon"],style={};0===attrs.icon.indexOf("ion-")?(classList.push(attrs.icon),classList.push("ons-icon--ion")):0===attrs.icon.indexOf("fa-")?(classList.push(attrs.icon),classList.push("fa")):(classList.push("fa"),classList.push("fa-"+attrs.icon));var size=""+attrs.size;return size.match(/^[1-5]x|lg$/)?classList.push("fa-"+size):"string"==typeof attrs.size?style["font-size"]=size:classList.push("fa-lg"),{"class":classList.join(" "),style:style}}var module=angular.module("onsen");module.directive("onsIcon",["$onsen",function($onsen){return{restrict:"E",replace:!1,transclude:!1,link:function(scope,element,attrs){if(attrs.ngController)throw new Error("This element can't accept ng-controller directive.");var update=function(){cleanClassAttribute(element);var builded=buildClassAndStyle(attrs);element.css(builded.style),element.addClass(builded["class"])},builded=buildClassAndStyle(attrs);element.css(builded.style),element.addClass(builded["class"]),attrs.$observe("icon",update),attrs.$observe("size",update),attrs.$observe("fixedWidth",update),attrs.$observe("rotate",update),attrs.$observe("flip",update),attrs.$observe("spin",update),$onsen.cleaner.onDestroy(scope,function(){$onsen.clearComponent({scope:scope,element:element,attrs:attrs}),element=scope=attrs=null}),$onsen.fireComponentEvent(element[0],"init")}}}])}(),function(){"use strict";var module=angular.module("onsen");module.directive("onsIfOrientation",["$onsen","$onsGlobal",function($onsen,$onsGlobal){return{restrict:"A",replace:!1,transclude:!1,scope:!1,compile:function(element){return element.css("display","none"),function(scope,element,attrs){function update(){var userOrientation=(""+attrs.onsIfOrientation).toLowerCase(),orientation=getLandscapeOrPortrait();("portrait"===userOrientation||"landscape"===userOrientation)&&(userOrientation===orientation?element.css("display",""):element.css("display","none"))}function getLandscapeOrPortrait(){return $onsGlobal.orientation.isPortrait()?"portrait":"landscape"}element.addClass("ons-if-orientation-inner"),attrs.$observe("onsIfOrientation",update),$onsGlobal.orientation.on("change",update),update(),$onsen.cleaner.onDestroy(scope,function(){$onsGlobal.orientation.off("change",update), $onsen.clearComponent({element:element,scope:scope,attrs:attrs}),element=scope=attrs=null})}}}}])}(),function(){"use strict";var module=angular.module("onsen");module.directive("onsIfPlatform",["$onsen",function($onsen){return{restrict:"A",replace:!1,transclude:!1,scope:!1,compile:function(element){function getPlatformString(){if(navigator.userAgent.match(/Android/i))return"android";if(navigator.userAgent.match(/BlackBerry/i)||navigator.userAgent.match(/RIM Tablet OS/i)||navigator.userAgent.match(/BB10/i))return"blackberry";if(navigator.userAgent.match(/iPhone|iPad|iPod/i))return"ios";if(navigator.userAgent.match(/IEMobile/i))return"windows";var isOpera=!!window.opera||navigator.userAgent.indexOf(" OPR/")>=0;if(isOpera)return"opera";var isFirefox="undefined"!=typeof InstallTrigger;if(isFirefox)return"firefox";var isSafari=Object.prototype.toString.call(window.HTMLElement).indexOf("Constructor")>0;if(isSafari)return"safari";var isChrome=!!window.chrome&&!isOpera;if(isChrome)return"chrome";var isIE=!1||!!document.documentMode;return isIE?"ie":"unknown"}element.addClass("ons-if-platform-inner"),element.css("display","none");var platform=getPlatformString();return function(scope,element,attrs){function update(){attrs.onsIfPlatform.toLowerCase()===platform.toLowerCase()?element.css("display","block"):element.css("display","none")}attrs.$observe("onsIfPlatform",function(userPlatform){userPlatform&&update()}),update(),$onsen.cleaner.onDestroy(scope,function(){$onsen.clearComponent({element:element,scope:scope,attrs:attrs}),element=scope=attrs=null})}}}}])}(),function(){"use strict";var module=angular.module("onsen"),compileFunction=function(show,$onsen){return function(element){return function(scope,element,attrs){var dispShow=show?"block":"none",dispHide=show?"none":"block",onShow=function(){element.css("display",dispShow)},onHide=function(){element.css("display",dispHide)},onInit=function(e){e.visible?onShow():onHide()};ons.softwareKeyboard.on("show",onShow),ons.softwareKeyboard.on("hide",onHide),ons.softwareKeyboard.on("init",onInit),ons.softwareKeyboard._visible?onShow():onHide(),$onsen.cleaner.onDestroy(scope,function(){ons.softwareKeyboard.off("show",onShow),ons.softwareKeyboard.off("hide",onHide),ons.softwareKeyboard.off("init",onInit),$onsen.clearComponent({element:element,scope:scope,attrs:attrs}),element=scope=attrs=null})}}};module.directive("onsKeyboardActive",["$onsen",function($onsen){return{restrict:"A",replace:!1,transclude:!1,scope:!1,compile:compileFunction(!0,$onsen)}}]),module.directive("onsKeyboardInactive",["$onsen",function($onsen){return{restrict:"A",replace:!1,transclude:!1,scope:!1,compile:compileFunction(!1,$onsen)}}])}(),function(){"use strict";var module=angular.module("onsen");module.directive("onsLazyRepeat",["$onsen","LazyRepeatView",function($onsen,LazyRepeatView){return{restrict:"A",replace:!1,priority:1e3,transclude:"element",compile:function(element,attrs,linker){return function(scope,element,attrs){new LazyRepeatView(scope,element,attrs,linker);scope.$on("$destroy",function(){scope=element=attrs=linker=null})}}}}])}(),function(){"use strict";var module=angular.module("onsen");module.directive("onsList",["$onsen","GenericView",function($onsen,GenericView){return{restrict:"E",scope:!1,replace:!1,transclude:!1,compile:function(element,attrs){return function(scope,element,attrs){var list=new GenericView(scope,element,attrs);$onsen.declareVarAttribute(attrs,list),element.data("ons-list",list),scope.$on("$destroy",function(){list._events=void 0,$onsen.removeModifierMethods(list),element.data("ons-list",void 0),element=null});var templater=$onsen.generateModifierTemplater(attrs);element.addClass("list ons-list-inner"),element.addClass(templater("list--*")),$onsen.addModifierMethods(list,"list--*",element),$onsen.fireComponentEvent(element[0],"init")}}}}])}(),function(){"use strict";var module=angular.module("onsen");module.directive("onsListHeader",["$onsen","GenericView",function($onsen,GenericView){return{restrict:"E",replace:!1,transclude:!1,compile:function(){return function(scope,element,attrs){var listHeader=new GenericView(scope,element,attrs);$onsen.declareVarAttribute(attrs,listHeader),element.data("ons-listHeader",listHeader),scope.$on("$destroy",function(){listHeader._events=void 0,$onsen.removeModifierMethods(listHeader),element.data("ons-listHeader",void 0),element=null});var templater=$onsen.generateModifierTemplater(attrs);element.addClass("list__header ons-list-header-inner"),element.addClass(templater("list__header--*")),$onsen.addModifierMethods(listHeader,"list__header--*",element),$onsen.fireComponentEvent(element[0],"init")}}}}])}(),function(){"use strict";var module=angular.module("onsen");module.directive("onsListItem",["$onsen","GenericView",function($onsen,GenericView){return{restrict:"E",replace:!1,transclude:!1,compile:function(){return function(scope,element,attrs){var listItem=new GenericView(scope,element,attrs);$onsen.declareVarAttribute(attrs,listItem),element.data("ons-list-item",listItem),scope.$on("$destroy",function(){listItem._events=void 0,$onsen.removeModifierMethods(listItem),element.data("ons-list-item",void 0),element=null});var templater=$onsen.generateModifierTemplater(attrs);element.addClass("list__item ons-list-item-inner"),element.addClass(templater("list__item--*")),$onsen.addModifierMethods(listItem,"list__item--*",element),$onsen.fireComponentEvent(element[0],"init")}}}}])}(),function(){"use strict";var module=angular.module("onsen");module.directive("onsLoadingPlaceholder",["$onsen","$compile",function($onsen,$compile){return{restrict:"A",replace:!1,transclude:!1,scope:!1,link:function(scope,element,attrs){if(!attrs.onsLoadingPlaceholder.length)throw Error("Must define page to load.");setImmediate(function(){$onsen.getPageHTMLAsync(attrs.onsLoadingPlaceholder).then(function(html){html=html.trim().replace(/^<ons-page>/,"").replace(/<\/ons-page>$/,"");var div=document.createElement("div");div.innerHTML=html;var newElement=angular.element(div);newElement.css("display","none"),element.append(newElement),$compile(newElement)(scope);for(var i=element[0].childNodes.length-1;i>=0;i--){var e=element[0].childNodes[i];e!==div&&element[0].removeChild(e)}newElement.css("display","block")})})}}}])}(),function(){"use strict";var module=angular.module("onsen");module.directive("onsModal",["$onsen","ModalView",function($onsen,ModalView){function compile(element,attrs){var modifierTemplater=$onsen.generateModifierTemplater(attrs),html=element[0].innerHTML;element[0].innerHTML="";var wrapper=angular.element("<div></div>");wrapper.addClass("modal__content"),wrapper.addClass(modifierTemplater("modal--*__content")),element.css("display","none"),element.addClass("modal"),element.addClass(modifierTemplater("modal--*")),wrapper[0].innerHTML=html,element.append(wrapper)}return{restrict:"E",replace:!1,scope:!1,transclude:!1,compile:function(element,attrs){return compile(element,attrs),{pre:function(scope,element,attrs){var page=element.inheritedData("ons-page");page&&page.registerExtraElement(element);var modal=new ModalView(scope,element);$onsen.addModifierMethods(modal,"modal--*",element),$onsen.addModifierMethods(modal,"modal--*__content",element.children()),$onsen.declareVarAttribute(attrs,modal),element.data("ons-modal",modal),scope.$on("$destroy",function(){modal._events=void 0,$onsen.removeModifierMethods(modal),element.data("ons-modal",void 0)})},post:function(scope,element){$onsen.fireComponentEvent(element[0],"init")}}}}}])}(),function(){"use strict";var module=angular.module("onsen");module.directive("onsNavigator",["$compile","NavigatorView","$onsen",function($compile,NavigatorView,$onsen){return{restrict:"E",transclude:!1,scope:!0,compile:function(element){var html=$onsen.normalizePageHTML(element.html());return element.contents().remove(),{pre:function(scope,element,attrs,controller){var navigator=new NavigatorView(scope,element,attrs);if($onsen.declareVarAttribute(attrs,navigator),$onsen.registerEventHandlers(navigator,"prepush prepop postpush postpop destroy"),attrs.page)navigator.pushPage(attrs.page,{});else{var pageScope=navigator._createPageScope(),pageElement=angular.element(html),linkScope=$compile(pageElement),link=function(){linkScope(pageScope)};navigator._pushPageDOM("",pageElement,link,pageScope,{}),pageElement=null}element.data("ons-navigator",navigator),element.data("_scope",scope),scope.$on("$destroy",function(){element.data("_scope",void 0),navigator._events=void 0,element.data("ons-navigator",void 0),element=null})},post:function(scope,element,attrs){$onsen.fireComponentEvent(element[0],"init")}}}}}])}(),function(){"use strict";var module=angular.module("onsen");module.directive("onsPage",["$onsen","PageView",function($onsen,PageView){function firePageInitEvent(element){var i=0,f=function(){if(!(i++<5))throw new Error('Fail to fire "pageinit" event. Attach "ons-page" element to the document after initialization.');isAttached(element)?(fillStatusBar(element),$onsen.fireComponentEvent(element,"init"),fireActualPageInitEvent(element)):setImmediate(f)};f()}function fireActualPageInitEvent(element){var event=document.createEvent("HTMLEvents");event.initEvent("pageinit",!0,!0),element.dispatchEvent(event)}function fillStatusBar(element){if($onsen.shouldFillStatusBar(element)){var fill=angular.element(document.createElement("div"));fill.addClass("page__status-bar-fill"),fill.css({width:"0px",height:"0px"}),angular.element(element).prepend(fill)}}function isAttached(element){return document.documentElement===element?!0:element.parentNode?isAttached(element.parentNode):!1}function preLink(scope,element,attrs,controller,transclude){var page=new PageView(scope,element,attrs);$onsen.declareVarAttribute(attrs,page),element.data("ons-page",page);var modifierTemplater=$onsen.generateModifierTemplater(attrs),template="page--*";element.addClass("page "+modifierTemplater(template)),$onsen.addModifierMethods(page,template,element);var pageContent=angular.element(element[0].querySelector(".page__content"));pageContent.addClass(modifierTemplater("page--*__content")),pageContent=null;var pageBackground=angular.element(element[0].querySelector(".page__background"));pageBackground.addClass(modifierTemplater("page--*__background")),pageBackground=null,element.data("_scope",scope),$onsen.cleaner.onDestroy(scope,function(){element.data("_scope",void 0),page._events=void 0,$onsen.removeModifierMethods(page),element.data("ons-page",void 0),$onsen.clearComponent({element:element,scope:scope,attrs:attrs}),scope=element=attrs=null})}function postLink(scope,element,attrs){firePageInitEvent(element[0])}return{restrict:"E",transclude:!1,scope:!1,compile:function(element){var children=element.children().remove(),content=angular.element('<div class="page__content ons-page-inner"></div>').append(children),background=angular.element('<div class="page__background"></div>');if(element.attr("style")&&(background.attr("style",element.attr("style")),element.attr("style","")),element.append(background),Modernizr.csstransforms3d)element.append(content);else{content.css("overflow","visible");var wrapper=angular.element("<div></div>");wrapper.append(children),content.append(wrapper),element.append(content),wrapper=null;var scroller=new IScroll(content[0],{momentum:!0,bounce:!0,hScrollbar:!1,vScrollbar:!1,preventDefault:!1}),offset=10;scroller.on("scrollStart",function(e){var scrolled=scroller.y-offset;scrolled<scroller.maxScrollY+40&&scroller.refresh()})}return content=null,background=null,children=null,{pre:preLink,post:postLink}}}}])}(),function(){"use strict";var module=angular.module("onsen");module.directive("onsPopover",["$onsen","PopoverView",function($onsen,PopoverView){return{restrict:"E",replace:!1,transclude:!0,scope:!0,templateUrl:$onsen.DIRECTIVE_TEMPLATE_URL+"/popover.tpl",compile:function(element,attrs,transclude){return{pre:function(scope,element,attrs){transclude(scope,function(clone){angular.element(element[0].querySelector(".popover__content")).append(clone)});var popover=new PopoverView(scope,element,attrs);$onsen.declareVarAttribute(attrs,popover),$onsen.registerEventHandlers(popover,"preshow prehide postshow posthide destroy"),element.data("ons-popover",popover),scope.$on("$destroy",function(){popover._events=void 0,$onsen.removeModifierMethods(popover),element.data("ons-popover",void 0),element=null}),scope.modifierTemplater=$onsen.generateModifierTemplater(attrs),$onsen.addModifierMethods(popover,"popover--*",angular.element(element[0].querySelector(".popover"))),$onsen.addModifierMethods(popover,"popover__content--*",angular.element(element[0].querySelector(".popover__content"))),$onsen.isAndroid()&&setImmediate(function(){popover.addModifier("android")}),scope.direction="up",scope.arrowPosition="bottom"},post:function(scope,element){$onsen.fireComponentEvent(element[0],"init")}}}}}])}(),function(){"use strict";var module=angular.module("onsen");module.directive("onsPullHook",["$onsen","PullHookView",function($onsen,PullHookView){return{restrict:"E",replace:!1,scope:!0,compile:function(element,attrs){return{pre:function(scope,element,attrs){var pullHook=new PullHookView(scope,element,attrs);$onsen.declareVarAttribute(attrs,pullHook),$onsen.registerEventHandlers(pullHook,"changestate destroy"),element.data("ons-pull-hook",pullHook),scope.$on("$destroy",function(){pullHook._events=void 0,element.data("ons-pull-hook",void 0),scope=element=attrs=null})},post:function(scope,element){$onsen.fireComponentEvent(element[0],"init")}}}}}])}(),function(){"use strict";var module=angular.module("onsen");module.directive("onsRow",["$onsen","$timeout",function($onsen,$timeout){return{restrict:"E",replace:!1,transclude:!1,scope:!1,compile:function(element,attrs){return element.addClass("row ons-row-inner"),function(scope,element,attrs){function update(){var align=(""+attrs.align).trim();("top"===align||"center"===align||"bottom"===align)&&(element.removeClass("row-bottom row-center row-top"),element.addClass("row-"+align))}attrs.$observe("align",function(align){update()}),update(),$onsen.fireComponentEvent(element[0],"init")}}}}])}(),function(){"use strict";var module=angular.module("onsen");module.directive("onsScroller",["$onsen","$timeout",function($onsen,$timeout){return{restrict:"E",replace:!1,transclude:!0,scope:{onScrolled:"&",infinitScrollEnable:"="},compile:function(element,attrs){element.addClass("ons-scroller").children().remove();return function(scope,element,attrs,controller,transclude){if(attrs.ngController)throw new Error('"ons-scroller" can\'t accept "ng-controller" directive.');var wrapper=angular.element("<div></div>");wrapper.addClass("ons-scroller__content ons-scroller-inner"),element.append(wrapper),transclude(scope.$parent,function(cloned){wrapper.append(cloned),wrapper=null});var scrollWrapper;scrollWrapper=element[0];var offset=parseInt(attrs.threshold)||10;scope.onScrolled&&scrollWrapper.addEventListener("scroll",function(){if(scope.infinitScrollEnable){var scrollTopAndOffsetHeight=scrollWrapper.scrollTop+scrollWrapper.offsetHeight,scrollHeightMinusOffset=scrollWrapper.scrollHeight-offset;scrollTopAndOffsetHeight>=scrollHeightMinusOffset&&scope.onScrolled()}}),Modernizr.csstransforms3d||$timeout(function(){var iScroll=new IScroll(scrollWrapper,{momentum:!0,bounce:!0,hScrollbar:!1,vScrollbar:!1,preventDefault:!1});iScroll.on("scrollStart",function(e){var scrolled=iScroll.y-offset;scrolled<iScroll.maxScrollY+40&&iScroll.refresh()}),scope.onScrolled&&iScroll.on("scrollEnd",function(e){var scrolled=iScroll.y-offset;scrolled<iScroll.maxScrollY&&scope.onScrolled()})},500),$onsen.fireComponentEvent(element[0],"init")}}}}])}(),function(){"use strict";var module=angular.module("onsen");module.directive("onsSlidingMenu",["$compile","SlidingMenuView","$onsen",function($compile,SlidingMenuView,$onsen){return{restrict:"E",replace:!1,transclude:!1,scope:!0,compile:function(element,attrs){var main=element[0].querySelector(".main"),menu=element[0].querySelector(".menu");if(main)var mainHtml=angular.element(main).remove().html().trim();if(menu)var menuHtml=angular.element(menu).remove().html().trim();return function(scope,element,attrs){if(attrs.ngController)throw new Error("This element can't accept ng-controller directive.");element.append(angular.element("<div></div>").addClass("onsen-sliding-menu__menu ons-sliding-menu-inner")),element.append(angular.element("<div></div>").addClass("onsen-sliding-menu__main ons-sliding-menu-inner"));var slidingMenu=new SlidingMenuView(scope,element,attrs);$onsen.registerEventHandlers(slidingMenu,"preopen preclose postopen postclose destroy"),mainHtml&&!attrs.mainPage&&slidingMenu._appendMainPage(null,mainHtml),menuHtml&&!attrs.menuPage&&slidingMenu._appendMenuPage(menuHtml),$onsen.declareVarAttribute(attrs,slidingMenu),element.data("ons-sliding-menu",slidingMenu),element.data("_scope",scope),scope.$on("$destroy",function(){element.data("_scope",void 0),slidingMenu._events=void 0,element.data("ons-sliding-menu",void 0)}),$onsen.fireComponentEvent(element[0],"init")}}}}])}(),function(){"use strict";var module=angular.module("onsen");module.directive("onsSplitView",["$compile","SplitView","$onsen",function($compile,SplitView,$onsen){return{restrict:"E",replace:!1,transclude:!1,scope:!0,compile:function(element,attrs){var mainPage=element[0].querySelector(".main-page"),secondaryPage=element[0].querySelector(".secondary-page");if(mainPage)var mainHtml=angular.element(mainPage).remove().html().trim();if(secondaryPage)var secondaryHtml=angular.element(secondaryPage).remove().html().trim();return function(scope,element,attrs){if(attrs.ngController)throw new Error("This element can't accept ng-controller directive.");element.append(angular.element("<div></div>").addClass("onsen-split-view__secondary full-screen ons-split-view-inner")),element.append(angular.element("<div></div>").addClass("onsen-split-view__main full-screen ons-split-view-inner"));var splitView=new SplitView(scope,element,attrs);mainHtml&&!attrs.mainPage&&splitView._appendMainPage(mainHtml),secondaryHtml&&!attrs.secondaryPage&&splitView._appendSecondPage(secondaryHtml),$onsen.declareVarAttribute(attrs,splitView),$onsen.registerEventHandlers(splitView,"update presplit precollapse postsplit postcollapse destroy"),element.data("ons-split-view",splitView),element.data("_scope",scope),scope.$on("$destroy",function(){element.data("_scope",void 0),splitView._events=void 0,element.data("ons-split-view",void 0)}),$onsen.fireComponentEvent(element[0],"init")}}}}])}(),function(){"use strict";var module=angular.module("onsen");module.directive("onsSwitch",["$onsen","$parse","SwitchView",function($onsen,$parse,SwitchView){return{restrict:"E",replace:!1,transclude:!1,scope:!0,templateUrl:$onsen.DIRECTIVE_TEMPLATE_URL+"/switch.tpl",compile:function(element){return function(scope,element,attrs){if(attrs.ngController)throw new Error("This element can't accept ng-controller directive.");var switchView=new SwitchView(element,scope,attrs),checkbox=angular.element(element[0].querySelector("input[type=checkbox]"));scope.modifierTemplater=$onsen.generateModifierTemplater(attrs);var label=element.children(),input=angular.element(label.children()[0]),toggle=angular.element(label.children()[1]);if($onsen.addModifierMethods(switchView,"switch--*",label),$onsen.addModifierMethods(switchView,"switch--*__input",input),$onsen.addModifierMethods(switchView,"switch--*__toggle",toggle),attrs.$observe("checked",function(checked){scope.model=!!element.attr("checked")}),attrs.$observe("name",function(name){element.attr("name")&&checkbox.attr("name",name)}),attrs.ngModel){var set=$parse(attrs.ngModel).assign;scope.$parent.$watch(attrs.ngModel,function(value){scope.model=value}),scope.$watch("model",function(to,from){set(scope.$parent,to),to!==from&&scope.$eval(attrs.ngChange)})}$onsen.declareVarAttribute(attrs,switchView),element.data("ons-switch",switchView),$onsen.cleaner.onDestroy(scope,function(){switchView._events=void 0,$onsen.removeModifierMethods(switchView),element.data("ons-switch",void 0),$onsen.clearComponent({element:element,scope:scope,attrs:attrs}),checkbox=element=attrs=scope=null}),$onsen.fireComponentEvent(element[0],"init")}}}}])}(),function(){"use strict";function tab($onsen,$compile){return{restrict:"E",transclude:!0,scope:{page:"@",active:"@",icon:"@",activeIcon:"@",label:"@",noReload:"@",persistent:"@"},templateUrl:$onsen.DIRECTIVE_TEMPLATE_URL+"/tab.tpl",compile:function(element,attrs){return element.addClass("tab-bar__item"),function(scope,element,attrs,controller,transclude){var tabbarView=element.inheritedData("ons-tabbar");if(!tabbarView)throw new Error("This ons-tab element is must be child of ons-tabbar element.");element.addClass(tabbarView._scope.modifierTemplater("tab-bar--*__item")),element.addClass(tabbarView._scope.modifierTemplater("tab-bar__item--*")),transclude(scope.$parent,function(cloned){var wrapper=angular.element(element[0].querySelector(".tab-bar-inner"));if(attrs.icon||attrs.label||!cloned[0]){var innerElement=angular.element("<div>"+defaultInnerTemplate+"</div>").children();wrapper.append(innerElement),$compile(innerElement)(scope)}else wrapper.append(cloned)});var radioButton=element[0].querySelector("input");scope.tabbarModifierTemplater=tabbarView._scope.modifierTemplater,scope.modifierTemplater=$onsen.generateModifierTemplater(attrs),scope.tabbarId=tabbarView._tabbarId,scope.tabIcon=scope.icon,tabbarView.addTabItem(scope),scope.setActive=function(){element.addClass("active"),radioButton.checked=!0,scope.activeIcon&&(scope.tabIcon=scope.activeIcon),angular.element(element[0].querySelectorAll("[ons-tab-inactive]")).css("display","none"),angular.element(element[0].querySelectorAll("[ons-tab-active]")).css("display","inherit")},scope.setInactive=function(){element.removeClass("active"),radioButton.checked=!1,scope.tabIcon=scope.icon,angular.element(element[0].querySelectorAll("[ons-tab-inactive]")).css("display","inherit"),angular.element(element[0].querySelectorAll("[ons-tab-active]")).css("display","none")},scope.isPersistent=function(){return"undefined"!=typeof scope.persistent},scope.isActive=function(){return element.hasClass("active")},scope.tryToChange=function(){tabbarView.setActiveTab(tabbarView._tabItems.indexOf(scope))},scope.active&&tabbarView.setActiveTab(tabbarView._tabItems.indexOf(scope)),$onsen.fireComponentEvent(element[0],"init")}}}}var module=angular.module("onsen");module.directive("onsTab",tab),module.directive("onsTabbarItem",tab);var defaultInnerTemplate='<div ng-if="icon != undefined" class="tab-bar__icon"><ons-icon icon="{{tabIcon}}" style="font-size: 28px; line-height: 34px; vertical-align: top;"></ons-icon></div><div ng-if="label" class="tab-bar__label">{{label}}</div>';tab.$inject=["$onsen","$compile"]}(),function(){"use strict";var module=angular.module("onsen");module.directive("onsTabbar",["$onsen","$compile","TabbarView",function($onsen,$compile,TabbarView){return{restrict:"E",replace:!1,transclude:!0,scope:!0,templateUrl:$onsen.DIRECTIVE_TEMPLATE_URL+"/tab_bar.tpl",link:function(scope,element,attrs,controller,transclude){scope.modifierTemplater=$onsen.generateModifierTemplater(attrs),scope.selectedTabItem={source:""},attrs.$observe("hideTabs",function(hide){var visible="true"!==hide;tabbarView.setTabbarVisibility(visible)});var tabbarView=new TabbarView(scope,element,attrs);$onsen.addModifierMethods(tabbarView,"tab-bar--*",angular.element(element.children()[1])),$onsen.registerEventHandlers(tabbarView,"reactive prechange postchange destroy"),scope.tabbarId=tabbarView._tabbarId,element.data("ons-tabbar",tabbarView),$onsen.declareVarAttribute(attrs,tabbarView),transclude(scope,function(cloned){angular.element(element[0].querySelector(".ons-tabbar-inner")).append(cloned)}),scope.$on("$destroy",function(){tabbarView._events=void 0,$onsen.removeModifierMethods(tabbarView),element.data("ons-tabbar",void 0)}),$onsen.fireComponentEvent(element[0],"init")}}}])}(),function(){"use strict";var module=angular.module("onsen");module.directive("onsTemplate",["$onsen","$templateCache",function($onsen,$templateCache){return{restrict:"E",transclude:!1,priority:1e3,terminal:!0,compile:function(element){$templateCache.put(element.attr("id"),element.remove().html()),$onsen.fireComponentEvent(element[0],"init")}}}])}(),function(){"use strict";function ensureLeftContainer(element,modifierTemplater){var container=element[0].querySelector(".left");return container||(container=document.createElement("div"),container.setAttribute("class","left"),container.innerHTML="&nbsp;"),""===container.innerHTML.trim()&&(container.innerHTML="&nbsp;"),angular.element(container).addClass("navigation-bar__left").addClass(modifierTemplater("navigation-bar--*__left")),container}function ensureCenterContainer(element,modifierTemplater){var container=element[0].querySelector(".center");return container||(container=document.createElement("div"),container.setAttribute("class","center")),""===container.innerHTML.trim()&&(container.innerHTML="&nbsp;"),angular.element(container).addClass("navigation-bar__title navigation-bar__center").addClass(modifierTemplater("navigation-bar--*__center")),container}function ensureRightContainer(element,modifierTemplater){var container=element[0].querySelector(".right");return container||(container=document.createElement("div"),container.setAttribute("class","right"),container.innerHTML="&nbsp;"),""===container.innerHTML.trim()&&(container.innerHTML="&nbsp;"),angular.element(container).addClass("navigation-bar__right").addClass(modifierTemplater("navigation-bar--*__right")),container}function hasCenterClassElementOnly(element){for(var child,hasCenter=!1,hasOther=!1,children=element.contents(),i=0;i<children.length;i++)child=angular.element(children[i]),child.hasClass("center")?hasCenter=!0:(child.hasClass("left")||child.hasClass("right"))&&(hasOther=!0);return hasCenter&&!hasOther}function ensureToolbarItemElements(element,modifierTemplater){var center;if(hasCenterClassElementOnly(element))center=ensureCenterContainer(element,modifierTemplater),element.contents().remove(),element.append(center);else{center=ensureCenterContainer(element,modifierTemplater);var left=ensureLeftContainer(element,modifierTemplater),right=ensureRightContainer(element,modifierTemplater);element.contents().remove(),element.append(angular.element([left,center,right]))}}var module=angular.module("onsen");module.directive("onsToolbar",["$onsen","GenericView",function($onsen,GenericView){return{restrict:"E",replace:!1,scope:!1,transclude:!1,compile:function(element,attrs){var shouldAppendAndroidModifier=ons.platform.isAndroid()&&!element[0].hasAttribute("fixed-style"),modifierTemplater=$onsen.generateModifierTemplater(attrs,shouldAppendAndroidModifier?["android"]:[]),inline="undefined"!=typeof attrs.inline;return element.addClass("navigation-bar"),element.addClass(modifierTemplater("navigation-bar--*")),inline||element.css({position:"absolute","z-index":"10000",left:"0px",right:"0px",top:"0px"}),ensureToolbarItemElements(element,modifierTemplater),{pre:function(scope,element,attrs){var toolbar=new GenericView(scope,element,attrs);$onsen.declareVarAttribute(attrs,toolbar),scope.$on("$destroy",function(){toolbar._events=void 0,$onsen.removeModifierMethods(toolbar),element.data("ons-toolbar",void 0),element=null}),$onsen.addModifierMethods(toolbar,"navigation-bar--*",element),angular.forEach(["left","center","right"],function(position){var el=element[0].querySelector(".navigation-bar__"+position);el&&$onsen.addModifierMethods(toolbar,"navigation-bar--*__"+position,angular.element(el))});var pageView=element.inheritedData("ons-page");pageView&&!inline&&pageView.registerToolbar(element),element.data("ons-toolbar",toolbar)},post:function(scope,element,attrs){$onsen.fireComponentEvent(element[0],"init")}}}}}])}(),function(){"use strict";var module=angular.module("onsen");module.directive("onsToolbarButton",["$onsen","GenericView",function($onsen,GenericView){return{restrict:"E",transclude:!0,scope:{},templateUrl:$onsen.DIRECTIVE_TEMPLATE_URL+"/toolbar_button.tpl",link:{pre:function(scope,element,attrs){var toolbarButton=new GenericView(scope,element,attrs),innerElement=element[0].querySelector(".toolbar-button");$onsen.declareVarAttribute(attrs,toolbarButton),element.data("ons-toolbar-button",toolbarButton),scope.$on("$destroy",function(){toolbarButton._events=void 0,$onsen.removeModifierMethods(toolbarButton),element.data("ons-toolbar-button",void 0),element=null});var modifierTemplater=$onsen.generateModifierTemplater(attrs);if(attrs.ngController)throw new Error("This element can't accept ng-controller directive.");attrs.$observe("disabled",function(value){value===!1||"undefined"==typeof value?innerElement.removeAttribute("disabled"):innerElement.setAttribute("disabled","disabled")}),scope.modifierTemplater=$onsen.generateModifierTemplater(attrs),$onsen.addModifierMethods(toolbarButton,"toolbar-button--*",element.children()),element.children("span").addClass(modifierTemplater("toolbar-button--*")),$onsen.cleaner.onDestroy(scope,function(){$onsen.clearComponent({scope:scope,attrs:attrs,element:element}),scope=element=attrs=null})},post:function(scope,element,attrs){$onsen.fireComponentEvent(element[0],"init")}}}}])}(),function(){"use strict";var module=angular.module("onsen"),ComponentCleaner={decomposeNode:function(element){for(var children=element.remove().children(),i=0;i<children.length;i++)ComponentCleaner.decomposeNode(angular.element(children[i]))},destroyAttributes:function(attrs){attrs.$$element=null,attrs.$$observers=null},destroyElement:function(element){element.remove()},destroyScope:function(scope){scope.$$listeners={},scope.$$watchers=null,scope=null},onDestroy:function(scope,fn){var clear=scope.$on("$destroy",function(){clear(),fn.apply(null,arguments)})}};module.factory("ComponentCleaner",function(){return ComponentCleaner}),function(){var ngEventDirectives={};"click dblclick mousedown mouseup mouseover mouseout mousemove mouseenter mouseleave keydown keyup keypress submit focus blur copy cut paste".split(" ").forEach(function(name){function directiveNormalize(name){return name.replace(/-([a-z])/g,function(matches){return matches[1].toUpperCase()})}var directiveName=directiveNormalize("ng-"+name);ngEventDirectives[directiveName]=["$parse",function($parse){return{compile:function($element,attr){var fn=$parse(attr[directiveName]);return function(scope,element,attr){var listener=function(event){scope.$apply(function(){fn(scope,{$event:event})})};element.on(name,listener),ComponentCleaner.onDestroy(scope,function(){element.off(name,listener),element=null,ComponentCleaner.destroyScope(scope),scope=null,ComponentCleaner.destroyAttributes(attr),attr=null})}}}}]}),module.config(["$provide",function($provide){var shift=function($delegate){return $delegate.shift(),$delegate};Object.keys(ngEventDirectives).forEach(function(directiveName){$provide.decorator(directiveName+"Directive",["$delegate",shift])})}]),Object.keys(ngEventDirectives).forEach(function(directiveName){module.directive(directiveName,ngEventDirectives[directiveName])})}()}(),function(){"use strict";var util={init:function(){this.ready=!1},addBackButtonListener:function(fn){this._ready?window.document.addEventListener("backbutton",fn,!1):window.document.addEventListener("deviceready",function(){window.document.addEventListener("backbutton",fn,!1)})},removeBackButtonListener:function(fn){this._ready?window.document.removeEventListener("backbutton",fn,!1):window.document.addEventListener("deviceready",function(){window.document.removeEventListener("backbutton",fn,!1)})}};util.init(),angular.module("onsen").service("DeviceBackButtonHandler",function(){this._init=function(){window.ons.isWebView()?window.document.addEventListener("deviceready",function(){util._ready=!0},!1):util._ready=!0,this._bindedCallback=this._callback.bind(this),this.enable()},this._isEnabled=!1,this.enable=function(){ this._isEnabled||(util.addBackButtonListener(this._bindedCallback),this._isEnabled=!0)},this.disable=function(){this._isEnabled&&(util.removeBackButtonListener(this._bindedCallback),this._isEnabled=!1)},this.fireDeviceBackButtonEvent=function(){var event=document.createEvent("Event");event.initEvent("backbutton",!0,!0),document.dispatchEvent(event)},this._callback=function(){this._dispatchDeviceBackButtonEvent()},this.create=function(element,callback){if(!(element instanceof angular.element().constructor))throw new Error("element must be an instance of jqLite");if(!(callback instanceof Function))throw new Error("callback must be an instance of Function");var handler={_callback:callback,_element:element,disable:function(){this._element.data("device-backbutton-handler",null)},setListener:function(callback){this._callback=callback},enable:function(){this._element.data("device-backbutton-handler",this)},isEnabled:function(){return this._element.data("device-backbutton-handler")===this},destroy:function(){this._element.data("device-backbutton-handler",null),this._callback=this._element=null}};return handler.enable(),handler},this._dispatchDeviceBackButtonEvent=function(event){function createEvent(element){return{_element:element,callParentHandler:function(){for(var parent=this._element.parent();parent[0];){if(handler=parent.data("device-backbutton-handler"))return handler._callback(createEvent(parent));parent=parent.parent()}}}}var tree=this._captureTree(),element=this._findHandlerLeafElement(tree),handler=element.data("device-backbutton-handler");handler._callback(createEvent(element))},this._dumpParents=function(element){for(;element[0];)console.log(element[0].nodeName.toLowerCase()+"."+element.attr("class")),element=element.parent()},this._captureTree=function(){function createTree(element){return{element:element,children:Array.prototype.concat.apply([],Array.prototype.map.call(element.children(),function(child){if(child=angular.element(child),"none"===child[0].style.display)return[];if(0===child.children().length&&!child.data("device-backbutton-handler"))return[];var result=createTree(child);return 0!==result.children.length||child.data("device-backbutton-handler")?[result]:[]}))}}return createTree(angular.element(document.body))},this._dumpTree=function(node){function _dump(node,level){var pad=new Array(level+1).join(" ");console.log(pad+node.element[0].nodeName.toLowerCase()),node.children.forEach(function(node){_dump(node,level+1)})}_dump(node,0)},this._findHandlerLeafElement=function(tree){function find(node){return 0===node.children.length?node.element:1===node.children.length?find(node.children[0]):node.children.map(function(childNode){return childNode.element}).reduce(function(left,right){if(null===left)return right;var leftZ=parseInt(window.getComputedStyle(left[0],"").zIndex,10),rightZ=parseInt(window.getComputedStyle(right[0],"").zIndex,10);if(!isNaN(leftZ)&&!isNaN(rightZ))return leftZ>rightZ?left:right;throw new Error("Capturing backbutton-handler is failure.")},null)}return find(tree)},this._init()})}(),function(){"use strict";var module=angular.module("onsen");module.factory("$onsen",["$rootScope","$window","$cacheFactory","$document","$templateCache","$http","$q","$onsGlobal","ComponentCleaner","DeviceBackButtonHandler",function($rootScope,$window,$cacheFactory,$document,$templateCache,$http,$q,$onsGlobal,ComponentCleaner,DeviceBackButtonHandler){function createOnsenService(){return{DIRECTIVE_TEMPLATE_URL:"templates",cleaner:ComponentCleaner,DeviceBackButtonHandler:DeviceBackButtonHandler,_defaultDeviceBackButtonHandler:DeviceBackButtonHandler.create(angular.element(document.body),function(){navigator.app.exitApp()}),getDefaultDeviceBackButtonHandler:function(){return this._defaultDeviceBackButtonHandler},isEnabledAutoStatusBarFill:function(){return!!$onsGlobal._config.autoStatusBarFill},shouldFillStatusBar:function(element){if(this.isEnabledAutoStatusBarFill()&&this.isWebView()&&this.isIOS7Above()){if(!(element instanceof HTMLElement))throw new Error("element must be an instance of HTMLElement");for(var debug="ONS-TABBAR"===element.tagName?console.log.bind(console):angular.noop;;){if(element.hasAttribute("no-status-bar-fill"))return!1;if(element=element.parentNode,debug(element),!element||!element.hasAttribute)return!0}}return!1},clearComponent:function(params){params.scope&&ComponentCleaner.destroyScope(params.scope),params.attrs&&ComponentCleaner.destroyAttributes(params.attrs),params.element&&ComponentCleaner.destroyElement(params.element),params.elements&&params.elements.forEach(function(element){ComponentCleaner.destroyElement(element)})},upTo:function(el,tagName){tagName=tagName.toLowerCase();do{if(!el)return null;if(el=el.parentNode,el.tagName.toLowerCase()==tagName)return el}while(el.parentNode);return null},waitForVariables:function(dependencies,callback){unlockerDict.addCallback(dependencies,callback)},findElementeObject:function(element,name){return element.inheritedData(name)},getPageHTMLAsync:function(page){var cache=$templateCache.get(page);if(cache){var deferred=$q.defer(),html="string"==typeof cache?cache:cache[1];return deferred.resolve(this.normalizePageHTML(html)),deferred.promise}return $http({url:page,method:"GET"}).then(function(response){var html=response.data;return this.normalizePageHTML(html)}.bind(this))},normalizePageHTML:function(html){return html=(""+html).trim(),html.match(/^<(ons-page|ons-navigator|ons-tabbar|ons-sliding-menu|ons-split-view)/)||(html="<ons-page>"+html+"</ons-page>"),html},generateModifierTemplater:function(attrs,modifiers){var attrModifiers=attrs&&"string"==typeof attrs.modifier?attrs.modifier.trim().split(/ +/):[];return modifiers=angular.isArray(modifiers)?attrModifiers.concat(modifiers):attrModifiers,function(template){return modifiers.map(function(modifier){return template.replace("*",modifier)}).join(" ")}},addModifierMethods:function(view,template,element){var _tr=function(modifier){return template.replace("*",modifier)},fns={hasModifier:function(modifier){return element.hasClass(_tr(modifier))},removeModifier:function(modifier){element.removeClass(_tr(modifier))},addModifier:function(modifier){element.addClass(_tr(modifier))},setModifier:function(modifier){for(var classes=element.attr("class").split(/\s+/),patt=template.replace("*","."),i=0;i<classes.length;i++){var cls=classes[i];cls.match(patt)&&element.removeClass(cls)}element.addClass(_tr(modifier))},toggleModifier:function(modifier){var cls=_tr(modifier);element.hasClass(cls)?element.removeClass(cls):element.addClass(cls)}},append=function(oldFn,newFn){return"undefined"!=typeof oldFn?function(){return oldFn.apply(null,arguments)||newFn.apply(null,arguments)}:newFn};view.hasModifier=append(view.hasModifier,fns.hasModifier),view.removeModifier=append(view.removeModifier,fns.removeModifier),view.addModifier=append(view.addModifier,fns.addModifier),view.setModifier=append(view.setModifier,fns.setModifier),view.toggleModifier=append(view.toggleModifier,fns.toggleModifier)},removeModifierMethods:function(view){view.hasModifier=view.removeModifier=view.addModifier=view.setModifier=view.toggleModifier=void 0},declareVarAttribute:function(attrs,object){if("string"==typeof attrs["var"]){var varName=attrs["var"];this._defineVar(varName,object),unlockerDict.unlockVarName(varName)}},_registerEventHandler:function(component,eventName){var capitalizedEventName=eventName.charAt(0).toUpperCase()+eventName.slice(1);component.on(eventName,function(event){$onsen.fireComponentEvent(component._element[0],eventName,event);var handler=component._attrs["ons"+capitalizedEventName];handler&&(component._scope.$eval(handler,{$event:event}),component._scope.$evalAsync())})},registerEventHandlers:function(component,eventNames){eventNames=eventNames.trim().split(/\s+/);for(var i=0,l=eventNames.length;l>i;i++){var eventName=eventNames[i];this._registerEventHandler(component,eventName)}},isAndroid:function(){return!!window.navigator.userAgent.match(/android/i)},isIOS:function(){return!!window.navigator.userAgent.match(/(ipad|iphone|ipod touch)/i)},isWebView:function(){return window.ons.isWebView()},isIOS7Above:function(){var ua=window.navigator.userAgent,match=ua.match(/(iPad|iPhone|iPod touch);.*CPU.*OS (\d+)_(\d+)/i),result=match?parseFloat(match[2]+"."+match[3])>=7:!1;return function(){return result}}(),fireComponentEvent:function(dom,eventName,data){data=data||{};var event=document.createEvent("HTMLEvents");for(var key in data)data.hasOwnProperty(key)&&(event[key]=data[key]);event.component=dom?angular.element(dom).data(dom.nodeName.toLowerCase())||null:null,event.initEvent(dom.nodeName.toLowerCase()+":"+eventName,!0,!0),dom.dispatchEvent(event)},_defineVar:function(name,object){function set(container,names,object){for(var name,i=0;i<names.length-1;i++)name=names[i],(void 0===container[name]||null===container[name])&&(container[name]={}),container=container[name];if(container[names[names.length-1]]=object,container[names[names.length-1]]!==object)throw new Error('Cannot set var="'+object._attrs["var"]+'" because it will overwrite a read-only variable.')}var names=name.split(/\./);ons.componentBase&&set(ons.componentBase,names,object),set($rootScope,names,object)}}}function createUnlockerDict(){return{_unlockersDict:{},_unlockedVarDict:{},_addVarLock:function(name,unlocker){if(!(unlocker instanceof Function))throw new Error("unlocker argument must be an instance of Function.");this._unlockersDict[name]?this._unlockersDict[name].push(unlocker):this._unlockersDict[name]=[unlocker]},unlockVarName:function(varName){var unlockers=this._unlockersDict[varName];unlockers&&unlockers.forEach(function(unlock){unlock()}),this._unlockedVarDict[varName]=!0},addCallback:function(dependencies,callback){if(!(callback instanceof Function))throw new Error("callback argument must be an instance of Function.");var doorLock=new DoorLock,self=this;dependencies.forEach(function(varName){if(!self._unlockedVarDict[varName]){var unlock=doorLock.lock();self._addVarLock(varName,unlock)}}),doorLock.isLocked()?doorLock.waitUnlock(callback):callback()}}}var unlockerDict=createUnlockerDict(),$onsen=createOnsenService();return $onsen}])}(),window.animit=function(){"use strict";var Animit=function(element){if(!(this instanceof Animit))return new Animit(element);if(element instanceof HTMLElement)this.elements=[element];else{if("[object Array]"!==Object.prototype.toString.call(element))throw new Error("First argument must be an array or an instance of HTMLElement.");this.elements=element}this.transitionQueue=[],this.lastStyleAttributeDict=[];var self=this;this.elements.forEach(function(element,index){element.hasAttribute("data-animit-orig-style")?self.lastStyleAttributeDict[index]=element.getAttribute("data-animit-orig-style"):(self.lastStyleAttributeDict[index]=element.getAttribute("style"),element.setAttribute("data-animit-orig-style",self.lastStyleAttributeDict[index]||""))})};Animit.prototype={transitionQueue:void 0,element:void 0,play:function(callback){return"function"==typeof callback&&this.transitionQueue.push(function(done){callback(),done()}),this.startAnimation(),this},queue:function(transition,options){var queue=this.transitionQueue;if(transition&&options&&(options.css=transition,transition=new Animit.Transition(options)),transition instanceof Function||transition instanceof Animit.Transition||(transition=new Animit.Transition(transition.css?transition:{css:transition})),transition instanceof Function)queue.push(transition);else{if(!(transition instanceof Animit.Transition))throw new Error("Invalid arguments");queue.push(transition.build())}return this},wait:function(seconds){return this.transitionQueue.push(function(done){setTimeout(done,1e3*seconds)}),this},resetStyle:function(options){function reset(){self.elements.forEach(function(element,index){element.style[Animit.prefix+"Transition"]="none",element.style.transition="none",self.lastStyleAttributeDict[index]?element.setAttribute("style",self.lastStyleAttributeDict[index]):(element.setAttribute("style",""),element.removeAttribute("style"))})}options=options||{};var self=this;if(options.transition&&!options.duration)throw new Error('"options.duration" is required when "options.transition" is enabled.');if(options.transition||options.duration&&options.duration>0){var transitionValue=options.transition||"all "+options.duration+"s "+(options.timing||"linear"),transitionStyle="transition: "+transitionValue+"; -"+Animit.prefix+"-transition: "+transitionValue+";";this.transitionQueue.push(function(done){var elements=this.elements;elements.forEach(function(element,index){element.style[Animit.prefix+"Transition"]=transitionValue,element.style.transition=transitionValue;var styleValue=(self.lastStyleAttributeDict[index]?self.lastStyleAttributeDict[index]+"; ":"")+transitionStyle;element.setAttribute("style",styleValue)});var removeListeners=util.addOnTransitionEnd(elements[0],function(){clearTimeout(timeoutId),reset(),done()}),timeoutId=setTimeout(function(){removeListeners(),reset(),done()},1e3*options.duration*1.4)})}else this.transitionQueue.push(function(done){reset(),done()});return this},startAnimation:function(){return this._dequeueTransition(),this},_dequeueTransition:function(){var transition=this.transitionQueue.shift();if(this._currentTransition)throw new Error("Current transition exists.");this._currentTransition=transition;var self=this,called=!1,done=function(){if(called)throw new Error("Invalid state: This callback is called twice.");called=!0,self._currentTransition=void 0,self._dequeueTransition()};transition&&transition.call(this,done)}},Animit.cssPropertyDict=function(){var styles=window.getComputedStyle(document.documentElement,""),dict={},a="A".charCodeAt(0),z="z".charCodeAt(0);for(var key in styles)if(styles.hasOwnProperty(key)){{key.charCodeAt(0)}a<=key.charCodeAt(0)&&z>=key.charCodeAt(0)&&"cssText"!==key&&"parentText"!==key&&"length"!==key&&(dict[key]=!0)}return dict}(),Animit.hasCssProperty=function(name){return!!Animit.cssPropertyDict[name]},Animit.prefix=function(){var styles=window.getComputedStyle(document.documentElement,""),pre=(Array.prototype.slice.call(styles).join("").match(/-(moz|webkit|ms)-/)||""===styles.OLink&&["","o"])[1];return pre}(),Animit.runAll=function(){for(var i=0;i<arguments.length;i++)arguments[i].play()},Animit.Transition=function(options){this.options=options||{},this.options.duration=this.options.duration||0,this.options.timing=this.options.timing||"linear",this.options.css=this.options.css||{},this.options.property=this.options.property||"all"},Animit.Transition.prototype={build:function(){function createActualCssProps(css){var result={};return Object.keys(css).forEach(function(name){var value=css[name];name=util.normalizeStyleName(name);var prefixed=Animit.prefix+util.capitalize(name);Animit.cssPropertyDict[name]?result[name]=value:Animit.cssPropertyDict[prefixed]?result[prefixed]=value:(result[prefixed]=value,result[name]=value)}),result}if(0===Object.keys(this.options.css).length)throw new Error("options.css is required.");var css=createActualCssProps(this.options.css);if(this.options.duration>0){var transitionValue=util.buildTransitionValue(this.options),self=this;return function(callback){var elements=this.elements,timeout=1e3*self.options.duration*1.4,removeListeners=util.addOnTransitionEnd(elements[0],function(){clearTimeout(timeoutId),callback()}),timeoutId=setTimeout(function(){removeListeners(),callback()},timeout);elements.forEach(function(element,index){element.style[Animit.prefix+"Transition"]=transitionValue,element.style.transition=transitionValue,Object.keys(css).forEach(function(name){element.style[name]=css[name]})})}}return this.options.duration<=0?function(callback){var elements=this.elements;elements.forEach(function(element,index){element.style[Animit.prefix+"Transition"]="none",element.transition="none",Object.keys(css).forEach(function(name){element.style[name]=css[name]})}),elements.length&&elements[0].offsetHeight,window.requestAnimationFrame?requestAnimationFrame(callback):setTimeout(callback,1e3/30)}:void 0}};var util={normalizeStyleName:function(name){return name=name.replace(/-[a-zA-Z]/g,function(all){return all.slice(1).toUpperCase()}),name.charAt(0).toLowerCase()+name.slice(1)},capitalize:function(str){return str.charAt(0).toUpperCase()+str.slice(1)},buildTransitionValue:function(params){params.property=params.property||"all",params.duration=params.duration||.4,params.timing=params.timing||"linear";var props=params.property.split(/ +/);return props.map(function(prop){return prop+" "+params.duration+"s "+params.timing}).join(", ")},addOnTransitionEnd:function(element,callback){if(!element)return function(){};var fn=function(event){element==event.target&&(event.stopPropagation(),removeListeners(),callback())},removeListeners=function(){util._transitionEndEvents.forEach(function(eventName){element.removeEventListener(eventName,fn)})};return util._transitionEndEvents.forEach(function(eventName){element.addEventListener(eventName,fn,!1)}),removeListeners},_transitionEndEvents:function(){return"webkit"===Animit.prefix||"o"===Animit.prefix||"moz"===Animit.prefix||"ms"===Animit.prefix?[Animit.prefix+"TransitionEnd","transitionend"]:["transitionend"]}()};return Animit}(),window.ons.notification=function(){var createAlertDialog=function(title,message,buttonLabels,primaryButtonIndex,modifier,animation,callback,messageIsHTML,cancelable,promptDialog,autofocus,placeholder){var inputEl,dialogEl=angular.element("<ons-alert-dialog>"),titleEl=angular.element("<div>").addClass("alert-dialog-title").text(title),messageEl=angular.element("<div>").addClass("alert-dialog-content"),footerEl=angular.element("<div>").addClass("alert-dialog-footer");modifier&&dialogEl.attr("modifier",modifier),dialogEl.attr("animation",animation),messageIsHTML?messageEl.html(message):messageEl.text(message),dialogEl.append(titleEl).append(messageEl),promptDialog&&(inputEl=angular.element("<input>").addClass("text-input").attr("placeholder",placeholder).css({width:"100%",marginTop:"10px"}),messageEl.append(inputEl)),dialogEl.append(footerEl),angular.element(document.body).append(dialogEl),ons.$compile(dialogEl)(dialogEl.injector().get("$rootScope"));var alertDialog=dialogEl.data("ons-alert-dialog");buttonLabels.length<=2&&footerEl.addClass("alert-dialog-footer--one");for(var createButton=function(i){var buttonEl=angular.element("<button>").addClass("alert-dialog-button").text(buttonLabels[i]);i==primaryButtonIndex&&buttonEl.addClass("alert-dialog-button--primal"),buttonLabels.length<=2&&buttonEl.addClass("alert-dialog-button--one"),buttonEl.on("click",function(){buttonEl.off("click"),alertDialog.hide({callback:function(){callback(promptDialog?inputEl.val():i),alertDialog.destroy(),alertDialog=inputEl=buttonEl=null}})}),footerEl.append(buttonEl)},i=0;i<buttonLabels.length;i++)createButton(i);cancelable&&(alertDialog.setCancelable(cancelable),alertDialog.on("cancel",function(){callback(promptDialog?null:-1),setTimeout(function(){alertDialog.destroy(),alertDialog=null,inputEl=null})})),alertDialog.show({callback:function(){promptDialog&&autofocus&&inputEl[0].focus()}}),dialogEl=titleEl=messageEl=footerEl=null};return{alert:function(options){var defaults={buttonLabel:"OK",animation:"default",title:"Alert",callback:function(){}};if(options=angular.extend({},defaults,options),!options.message&&!options.messageHTML)throw new Error("Alert dialog must contain a message.");createAlertDialog(options.title,options.message||options.messageHTML,[options.buttonLabel],0,options.modifier,options.animation,options.callback,options.message?!1:!0,!1,!1,!1)},confirm:function(options){var defaults={buttonLabels:["Cancel","OK"],primaryButtonIndex:1,animation:"default",title:"Confirm",callback:function(){},cancelable:!1};if(options=angular.extend({},defaults,options),!options.message&&!options.messageHTML)throw new Error("Confirm dialog must contain a message.");createAlertDialog(options.title,options.message||options.messageHTML,options.buttonLabels,options.primaryButtonIndex,options.modifier,options.animation,options.callback,options.message?!1:!0,options.cancelable,!1,!1)},prompt:function(options){var defaults={buttonLabel:"OK",animation:"default",title:"Alert",placeholder:"",callback:function(){},cancelable:!1,autofocus:!0};if(options=angular.extend({},defaults,options),!options.message&&!options.messageHTML)throw new Error("Prompt dialog must contain a message.");createAlertDialog(options.title,options.message||options.messageHTML,[options.buttonLabel],0,options.modifier,options.animation,options.callback,options.message?!1:!0,options.cancelable,!0,options.autofocus,options.placeholder)}}}(),window.ons.orientation=function(){function create(){var obj={_isPortrait:!1,isPortrait:function(){return this._isPortrait()},isLandscape:function(){return!this.isPortrait()},_init:function(){return document.addEventListener("DOMContentLoaded",this._onDOMContentLoaded.bind(this),!1),"orientation"in window?window.addEventListener("orientationchange",this._onOrientationChange.bind(this),!1):window.addEventListener("resize",this._onResize.bind(this),!1),this._isPortrait=function(){return window.innerHeight>window.innerWidth},this},_onDOMContentLoaded:function(){this._installIsPortraitImplementation(),this.emit("change",{isPortrait:this.isPortrait()})},_installIsPortraitImplementation:function(){var isPortrait=window.innerWidth<window.innerHeight;this._isPortrait="orientation"in window?window.orientation%180===0?function(){return 0===Math.abs(window.orientation%180)?isPortrait:!isPortrait}:function(){return 90===Math.abs(window.orientation%180)?isPortrait:!isPortrait}:function(){return window.innerHeight>window.innerWidth}},_onOrientationChange:function(){var isPortrait=this._isPortrait(),nIter=0,interval=setInterval(function(){nIter++;var w=window.innerWidth,h=window.innerHeight;isPortrait&&h>=w||!isPortrait&&w>=h?(this.emit("change",{isPortrait:isPortrait}),clearInterval(interval)):50===nIter&&(this.emit("change",{isPortrait:isPortrait}),clearInterval(interval))}.bind(this),20)},_onResize:function(){this.emit("change",{isPortrait:this.isPortrait()})}};return MicroEvent.mixin(obj),obj}return create()._init()}(),function(){"use strict";window.ons.platform={isWebView:function(){return ons.isWebView()},isIOS:function(){return/iPhone|iPad|iPod/i.test(navigator.userAgent)},isAndroid:function(){return/Android/i.test(navigator.userAgent)},isIPhone:function(){return/iPhone/i.test(navigator.userAgent)},isIPad:function(){return/iPad/i.test(navigator.userAgent)},isBlackBerry:function(){return/BlackBerry|RIM Tablet OS|BB10/i.test(navigator.userAgent)},isOpera:function(){return!!window.opera||navigator.userAgent.indexOf(" OPR/")>=0},isFirefox:function(){return"undefined"!=typeof InstallTrigger},isSafari:function(){return Object.prototype.toString.call(window.HTMLElement).indexOf("Constructor")>0},isChrome:function(){return!!window.chrome&&!(window.opera||navigator.userAgent.indexOf(" OPR/")>=0)},isIE:function(){return!1||!!document.documentMode},isIOS7above:function(){if(/iPhone|iPad|iPod/i.test(navigator.userAgent)){var ver=(navigator.userAgent.match(/\b[0-9]+_[0-9]+(?:_[0-9]+)?\b/)||[""])[0].replace(/_/g,".");return parseInt(ver.split(".")[0])>=7}return!1}}}(),function(){"use strict";window.addEventListener("load",function(){FastClick.attach(document.body)},!1),(new Viewport).setup(),Modernizr.testStyles("#modernizr { -webkit-overflow-scrolling:touch }",function(elem,rule){Modernizr.addTest("overflowtouch",window.getComputedStyle&&"touch"==window.getComputedStyle(elem).getPropertyValue("-webkit-overflow-scrolling"))}),window.jQuery&&angular.element===window.jQuery&&console.warn("Onsen UI require jqLite. Load jQuery after loading AngularJS to fix this error. jQuery may break Onsen UI behavior.")}(),function(){"use strict";angular.module("onsen").run(["$templateCache",function($templateCache){for(var templates=window.document.querySelectorAll('script[type="text/ons-template"]'),i=0;i<templates.length;i++){var template=angular.element(templates[i]),id=template.attr("id");"string"==typeof id&&$templateCache.put(id,template.text())}}])}();
src/parser/monk/mistweaver/modules/talents/RefreshingJadeWind.js
sMteX/WoWAnalyzer
import React from 'react'; import SPELLS from 'common/SPELLS'; import SpellLink from 'common/SpellLink'; import { formatPercentage } from 'common/format'; import Analyzer from 'parser/core/Analyzer'; const debug = false; const TARGETSPERCAST = 78; class RefreshingJadeWind extends Analyzer { healsRJW = 0; healingRJW = 0; overhealingRJW = 0; castRJW = 0; constructor(...args) { super(...args); this.active = this.selectedCombatant.hasTalent(SPELLS.REFRESHING_JADE_WIND_TALENT.id); } on_byPlayer_applybuff(event) { const spellId = event.ability.guid; if (spellId === SPELLS.REFRESHING_JADE_WIND_TALENT.id) { this.castRJW += 1; } } on_byPlayer_heal(event) { const spellId = event.ability.guid; if (spellId === SPELLS.REFRESHING_JADE_WIND_HEAL.id) { this.healsRJW += 1; this.healingRJW += event.amount; if (event.overheal) { this.overhealingRJW += event.amount; } } } get avgTargetsHitPerRJWPercentage() { return (this.healsRJW / this.castRJW) / TARGETSPERCAST || 0; } get rjwEffectiveness() { const rjwEfficiency = (this.healsRJW / (this.castRJW * TARGETSPERCAST)) || 0; return rjwEfficiency.toFixed(4); } get suggestionThresholds() { return { actual: this.avgTargetsHitPerRJWPercentage, isLessThan: { minor: .9, average: .8, major: .7, }, style: 'percentage', }; } suggestions(when) { when(this.suggestionThresholds).addSuggestion((suggest, actual, recommended) => { return suggest( <> You are not utilizing your <SpellLink id={SPELLS.REFRESHING_JADE_WIND_TALENT.id} /> effectively. <SpellLink id={SPELLS.REFRESHING_JADE_WIND_TALENT.id} /> excells when you hit 6 targets for the duration of the spell. The easiest way to accomplish this is to stand in melee, but there can be other uses when the raid stacks for various abilities. </> ) .icon(SPELLS.REFRESHING_JADE_WIND_TALENT.icon) .actual(`${formatPercentage(this.avgRJWTargetsPercentage)}% of targets hit per Refreshing Jade Wind`) .recommended(`>${formatPercentage(recommended)}% is recommended`); }); } on_fightend() { if (debug) { console.log(`RJW Casts: ${this.castRJW}`); console.log(`RJW Targets Hit: ${this.healsRJW}`); console.log('RJW Targets Hit per Cast: ', (this.healsRJW / this.castRJW)); console.log(`Avg Heals per Cast: ${this.healingRJW / this.castRJW}`); console.log(`Avg Heals Amount: ${this.healingRJW / this.healsRJW}`); } } } export default RefreshingJadeWind;
files/core-js/1.1.0/library.js
vuejs/jsdelivr
/** * core-js 1.1.0 * https://github.com/zloirock/core-js * License: http://rock.mit-license.org * © 2015 Denis Pushkarev */ !function(__e, __g, undefined){ 'use strict'; /******/ (function(modules) { // webpackBootstrap /******/ // 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] = { /******/ exports: {}, /******/ id: moduleId, /******/ loaded: false /******/ }; /******/ // Execute the module function /******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__); /******/ // Flag the module as loaded /******/ module.loaded = 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; /******/ // __webpack_public_path__ /******/ __webpack_require__.p = ""; /******/ // Load entry module and return exports /******/ return __webpack_require__(0); /******/ }) /************************************************************************/ /******/ ([ /* 0 */ /***/ function(module, exports, __webpack_require__) { __webpack_require__(1); __webpack_require__(28); __webpack_require__(38); __webpack_require__(40); __webpack_require__(42); __webpack_require__(44); __webpack_require__(46); __webpack_require__(47); __webpack_require__(48); __webpack_require__(49); __webpack_require__(50); __webpack_require__(51); __webpack_require__(52); __webpack_require__(53); __webpack_require__(54); __webpack_require__(55); __webpack_require__(56); __webpack_require__(57); __webpack_require__(58); __webpack_require__(60); __webpack_require__(61); __webpack_require__(62); __webpack_require__(63); __webpack_require__(64); __webpack_require__(65); __webpack_require__(66); __webpack_require__(68); __webpack_require__(69); __webpack_require__(70); __webpack_require__(72); __webpack_require__(73); __webpack_require__(74); __webpack_require__(76); __webpack_require__(77); __webpack_require__(78); __webpack_require__(79); __webpack_require__(80); __webpack_require__(81); __webpack_require__(82); __webpack_require__(83); __webpack_require__(84); __webpack_require__(85); __webpack_require__(86); __webpack_require__(87); __webpack_require__(88); __webpack_require__(90); __webpack_require__(92); __webpack_require__(94); __webpack_require__(95); __webpack_require__(97); __webpack_require__(98); __webpack_require__(103); __webpack_require__(109); __webpack_require__(110); __webpack_require__(113); __webpack_require__(115); __webpack_require__(116); __webpack_require__(117); __webpack_require__(118); __webpack_require__(119); __webpack_require__(124); __webpack_require__(127); __webpack_require__(128); __webpack_require__(130); __webpack_require__(131); __webpack_require__(132); __webpack_require__(133); __webpack_require__(134); __webpack_require__(135); __webpack_require__(136); __webpack_require__(137); __webpack_require__(138); __webpack_require__(139); __webpack_require__(140); __webpack_require__(141); __webpack_require__(143); __webpack_require__(144); __webpack_require__(145); __webpack_require__(146); __webpack_require__(147); __webpack_require__(148); __webpack_require__(150); __webpack_require__(151); __webpack_require__(152); __webpack_require__(153); __webpack_require__(155); __webpack_require__(156); __webpack_require__(158); __webpack_require__(159); __webpack_require__(161); __webpack_require__(162); __webpack_require__(163); __webpack_require__(164); __webpack_require__(167); __webpack_require__(106); __webpack_require__(169); __webpack_require__(168); __webpack_require__(170); __webpack_require__(171); __webpack_require__(172); __webpack_require__(173); __webpack_require__(174); __webpack_require__(176); __webpack_require__(177); __webpack_require__(178); __webpack_require__(179); __webpack_require__(180); __webpack_require__(181); /***/ }, /* 1 */ /***/ function(module, exports, __webpack_require__) { 'use strict'; var $ = __webpack_require__(2) , SUPPORT_DESC = __webpack_require__(3) , createDesc = __webpack_require__(5) , html = __webpack_require__(6) , cel = __webpack_require__(8) , has = __webpack_require__(10) , cof = __webpack_require__(11) , $def = __webpack_require__(12) , invoke = __webpack_require__(14) , arrayMethod = __webpack_require__(15) , IE_PROTO = __webpack_require__(23)('__proto__') , isObject = __webpack_require__(9) , anObject = __webpack_require__(24) , aFunction = __webpack_require__(17) , toObject = __webpack_require__(19) , toIObject = __webpack_require__(25) , toInteger = __webpack_require__(22) , toIndex = __webpack_require__(26) , toLength = __webpack_require__(21) , IObject = __webpack_require__(18) , fails = __webpack_require__(4) , ObjectProto = Object.prototype , A = [] , _slice = A.slice , _join = A.join , defineProperty = $.setDesc , getOwnDescriptor = $.getDesc , defineProperties = $.setDescs , $indexOf = __webpack_require__(27)(false) , factories = {} , IE8_DOM_DEFINE; if(!SUPPORT_DESC){ IE8_DOM_DEFINE = !fails(function(){ return defineProperty(cel('div'), 'a', {get: function(){ return 7; }}).a != 7; }); $.setDesc = function(O, P, Attributes){ if(IE8_DOM_DEFINE)try { return defineProperty(O, P, Attributes); } catch(e){ /* empty */ } if('get' in Attributes || 'set' in Attributes)throw TypeError('Accessors not supported!'); if('value' in Attributes)anObject(O)[P] = Attributes.value; return O; }; $.getDesc = function(O, P){ if(IE8_DOM_DEFINE)try { return getOwnDescriptor(O, P); } catch(e){ /* empty */ } if(has(O, P))return createDesc(!ObjectProto.propertyIsEnumerable.call(O, P), O[P]); }; $.setDescs = defineProperties = function(O, Properties){ anObject(O); var keys = $.getKeys(Properties) , length = keys.length , i = 0 , P; while(length > i)$.setDesc(O, P = keys[i++], Properties[P]); return O; }; } $def($def.S + $def.F * !SUPPORT_DESC, 'Object', { // 19.1.2.6 / 15.2.3.3 Object.getOwnPropertyDescriptor(O, P) getOwnPropertyDescriptor: $.getDesc, // 19.1.2.4 / 15.2.3.6 Object.defineProperty(O, P, Attributes) defineProperty: $.setDesc, // 19.1.2.3 / 15.2.3.7 Object.defineProperties(O, Properties) defineProperties: defineProperties }); // IE 8- don't enum bug keys var keys1 = ('constructor,hasOwnProperty,isPrototypeOf,propertyIsEnumerable,' + 'toLocaleString,toString,valueOf').split(',') // Additional keys for getOwnPropertyNames , keys2 = keys1.concat('length', 'prototype') , keysLen1 = keys1.length; // Create object with `null` prototype: use iframe Object with cleared prototype var createDict = function(){ // Thrash, waste and sodomy: IE GC bug var iframe = cel('iframe') , i = keysLen1 , gt = '>' , iframeDocument; iframe.style.display = 'none'; html.appendChild(iframe); iframe.src = 'javascript:'; // eslint-disable-line no-script-url // createDict = iframe.contentWindow.Object; // html.removeChild(iframe); iframeDocument = iframe.contentWindow.document; iframeDocument.open(); iframeDocument.write('<script>document.F=Object</script' + gt); iframeDocument.close(); createDict = iframeDocument.F; while(i--)delete createDict.prototype[keys1[i]]; return createDict(); }; var createGetKeys = function(names, length){ return function(object){ var O = toIObject(object) , i = 0 , result = [] , key; for(key in O)if(key != IE_PROTO)has(O, key) && result.push(key); // Don't enum bug & hidden keys while(length > i)if(has(O, key = names[i++])){ ~$indexOf(result, key) || result.push(key); } return result; }; }; var Empty = function(){}; $def($def.S, 'Object', { // 19.1.2.9 / 15.2.3.2 Object.getPrototypeOf(O) getPrototypeOf: $.getProto = $.getProto || function(O){ O = toObject(O); if(has(O, IE_PROTO))return O[IE_PROTO]; if(typeof O.constructor == 'function' && O instanceof O.constructor){ return O.constructor.prototype; } return O instanceof Object ? ObjectProto : null; }, // 19.1.2.7 / 15.2.3.4 Object.getOwnPropertyNames(O) getOwnPropertyNames: $.getNames = $.getNames || createGetKeys(keys2, keys2.length, true), // 19.1.2.2 / 15.2.3.5 Object.create(O [, Properties]) create: $.create = $.create || function(O, /*?*/Properties){ var result; if(O !== null){ Empty.prototype = anObject(O); result = new Empty(); Empty.prototype = null; // add "__proto__" for Object.getPrototypeOf shim result[IE_PROTO] = O; } else result = createDict(); return Properties === undefined ? result : defineProperties(result, Properties); }, // 19.1.2.14 / 15.2.3.14 Object.keys(O) keys: $.getKeys = $.getKeys || createGetKeys(keys1, keysLen1, false) }); var construct = function(F, len, args){ if(!(len in factories)){ for(var n = [], i = 0; i < len; i++)n[i] = 'a[' + i + ']'; factories[len] = Function('F,a', 'return new F(' + n.join(',') + ')'); } return factories[len](F, args); }; // 19.2.3.2 / 15.3.4.5 Function.prototype.bind(thisArg, args...) $def($def.P, 'Function', { bind: function bind(that /*, args... */){ var fn = aFunction(this) , partArgs = _slice.call(arguments, 1); var bound = function(/* args... */){ var args = partArgs.concat(_slice.call(arguments)); return this instanceof bound ? construct(fn, args.length, args) : invoke(fn, args, that); }; if(isObject(fn.prototype))bound.prototype = fn.prototype; return bound; } }); // fallback for not array-like ES3 strings and DOM objects var buggySlice = fails(function(){ if(html)_slice.call(html); }); $def($def.P + $def.F * buggySlice, 'Array', { slice: function(begin, end){ var len = toLength(this.length) , klass = cof(this); end = end === undefined ? len : end; if(klass == 'Array')return _slice.call(this, begin, end); var start = toIndex(begin, len) , upTo = toIndex(end, len) , size = toLength(upTo - start) , cloned = Array(size) , i = 0; for(; i < size; i++)cloned[i] = klass == 'String' ? this.charAt(start + i) : this[start + i]; return cloned; } }); $def($def.P + $def.F * (IObject != Object), 'Array', { join: function(){ return _join.apply(IObject(this), arguments); } }); // 22.1.2.2 / 15.4.3.2 Array.isArray(arg) $def($def.S, 'Array', {isArray: function(arg){ return cof(arg) == 'Array'; }}); var createArrayReduce = function(isRight){ return function(callbackfn, memo){ aFunction(callbackfn); var O = IObject(this) , length = toLength(O.length) , index = isRight ? length - 1 : 0 , i = isRight ? -1 : 1; if(arguments.length < 2)for(;;){ if(index in O){ memo = O[index]; index += i; break; } index += i; if(isRight ? index < 0 : length <= index){ throw TypeError('Reduce of empty array with no initial value'); } } for(;isRight ? index >= 0 : length > index; index += i)if(index in O){ memo = callbackfn(memo, O[index], index, this); } return memo; }; }; var methodize = function($fn){ return function(arg1/*, arg2 = undefined */){ return $fn(this, arg1, arguments[1]); }; }; $def($def.P, 'Array', { // 22.1.3.10 / 15.4.4.18 Array.prototype.forEach(callbackfn [, thisArg]) forEach: $.each = $.each || methodize(arrayMethod(0)), // 22.1.3.15 / 15.4.4.19 Array.prototype.map(callbackfn [, thisArg]) map: methodize(arrayMethod(1)), // 22.1.3.7 / 15.4.4.20 Array.prototype.filter(callbackfn [, thisArg]) filter: methodize(arrayMethod(2)), // 22.1.3.23 / 15.4.4.17 Array.prototype.some(callbackfn [, thisArg]) some: methodize(arrayMethod(3)), // 22.1.3.5 / 15.4.4.16 Array.prototype.every(callbackfn [, thisArg]) every: methodize(arrayMethod(4)), // 22.1.3.18 / 15.4.4.21 Array.prototype.reduce(callbackfn [, initialValue]) reduce: createArrayReduce(false), // 22.1.3.19 / 15.4.4.22 Array.prototype.reduceRight(callbackfn [, initialValue]) reduceRight: createArrayReduce(true), // 22.1.3.11 / 15.4.4.14 Array.prototype.indexOf(searchElement [, fromIndex]) indexOf: methodize($indexOf), // 22.1.3.14 / 15.4.4.15 Array.prototype.lastIndexOf(searchElement [, fromIndex]) lastIndexOf: function(el, fromIndex /* = @[*-1] */){ var O = toIObject(this) , length = toLength(O.length) , index = length - 1; if(arguments.length > 1)index = Math.min(index, toInteger(fromIndex)); if(index < 0)index = toLength(length + index); for(;index >= 0; index--)if(index in O)if(O[index] === el)return index; return -1; } }); // 20.3.3.1 / 15.9.4.4 Date.now() $def($def.S, 'Date', {now: function(){ return +new Date; }}); var lz = function(num){ return num > 9 ? num : '0' + num; }; // 20.3.4.36 / 15.9.5.43 Date.prototype.toISOString() // PhantomJS and old webkit had a broken Date implementation. var date = new Date(-5e13 - 1) , brokenDate = !(date.toISOString && date.toISOString() == '0385-07-25T07:06:39.999Z' && fails(function(){ new Date(NaN).toISOString(); })); $def($def.P + $def.F * brokenDate, 'Date', { toISOString: function toISOString(){ if(!isFinite(this))throw RangeError('Invalid time value'); var d = this , y = d.getUTCFullYear() , m = d.getUTCMilliseconds() , s = y < 0 ? '-' : y > 9999 ? '+' : ''; return s + ('00000' + Math.abs(y)).slice(s ? -6 : -4) + '-' + lz(d.getUTCMonth() + 1) + '-' + lz(d.getUTCDate()) + 'T' + lz(d.getUTCHours()) + ':' + lz(d.getUTCMinutes()) + ':' + lz(d.getUTCSeconds()) + '.' + (m > 99 ? m : '0' + lz(m)) + 'Z'; } }); /***/ }, /* 2 */ /***/ function(module, exports) { var $Object = Object; module.exports = { create: $Object.create, getProto: $Object.getPrototypeOf, isEnum: {}.propertyIsEnumerable, getDesc: $Object.getOwnPropertyDescriptor, setDesc: $Object.defineProperty, setDescs: $Object.defineProperties, getKeys: $Object.keys, getNames: $Object.getOwnPropertyNames, getSymbols: $Object.getOwnPropertySymbols, each: [].forEach }; /***/ }, /* 3 */ /***/ function(module, exports, __webpack_require__) { // Thank's IE8 for his funny defineProperty module.exports = !__webpack_require__(4)(function(){ return Object.defineProperty({}, 'a', {get: function(){ return 7; }}).a != 7; }); /***/ }, /* 4 */ /***/ function(module, exports) { module.exports = function(exec){ try { return !!exec(); } catch(e){ return true; } }; /***/ }, /* 5 */ /***/ function(module, exports) { module.exports = function(bitmap, value){ return { enumerable : !(bitmap & 1), configurable: !(bitmap & 2), writable : !(bitmap & 4), value : value }; }; /***/ }, /* 6 */ /***/ function(module, exports, __webpack_require__) { module.exports = __webpack_require__(7).document && document.documentElement; /***/ }, /* 7 */ /***/ function(module, exports) { var global = typeof self != 'undefined' && self.Math == Math ? self : Function('return this')(); module.exports = global; if(typeof __g == 'number')__g = global; // eslint-disable-line no-undef /***/ }, /* 8 */ /***/ function(module, exports, __webpack_require__) { var isObject = __webpack_require__(9) , document = __webpack_require__(7).document // in old IE typeof document.createElement is 'object' , is = isObject(document) && isObject(document.createElement); module.exports = function(it){ return is ? document.createElement(it) : {}; }; /***/ }, /* 9 */ /***/ function(module, exports) { // http://jsperf.com/core-js-isobject module.exports = function(it){ return it !== null && (typeof it == 'object' || typeof it == 'function'); }; /***/ }, /* 10 */ /***/ function(module, exports) { var hasOwnProperty = {}.hasOwnProperty; module.exports = function(it, key){ return hasOwnProperty.call(it, key); }; /***/ }, /* 11 */ /***/ function(module, exports) { var toString = {}.toString; module.exports = function(it){ return toString.call(it).slice(8, -1); }; /***/ }, /* 12 */ /***/ function(module, exports, __webpack_require__) { var global = __webpack_require__(7) , core = __webpack_require__(13) , PROTOTYPE = 'prototype'; var ctx = function(fn, that){ return function(){ return fn.apply(that, arguments); }; }; var $def = function(type, name, source){ var key, own, out, exp , isGlobal = type & $def.G , isProto = type & $def.P , target = isGlobal ? global : type & $def.S ? global[name] : (global[name] || {})[PROTOTYPE] , exports = isGlobal ? core : core[name] || (core[name] = {}); if(isGlobal)source = name; for(key in source){ // contains in native own = !(type & $def.F) && target && key in target; if(own && key in exports)continue; // export native or passed out = own ? target[key] : source[key]; // prevent global pollution for namespaces if(isGlobal && typeof target[key] != 'function')exp = source[key]; // bind timers to global for call from export context else if(type & $def.B && own)exp = ctx(out, global); // wrap global constructors for prevent change them in library else if(type & $def.W && target[key] == out)!function(C){ exp = function(param){ return this instanceof C ? new C(param) : C(param); }; exp[PROTOTYPE] = C[PROTOTYPE]; }(out); else exp = isProto && typeof out == 'function' ? ctx(Function.call, out) : out; // export exports[key] = exp; if(isProto)(exports[PROTOTYPE] || (exports[PROTOTYPE] = {}))[key] = out; } }; // type bitmap $def.F = 1; // forced $def.G = 2; // global $def.S = 4; // static $def.P = 8; // proto $def.B = 16; // bind $def.W = 32; // wrap module.exports = $def; /***/ }, /* 13 */ /***/ function(module, exports) { var core = module.exports = {}; if(typeof __e == 'number')__e = core; // eslint-disable-line no-undef /***/ }, /* 14 */ /***/ function(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); }; /***/ }, /* 15 */ /***/ function(module, exports, __webpack_require__) { // 0 -> Array#forEach // 1 -> Array#map // 2 -> Array#filter // 3 -> Array#some // 4 -> Array#every // 5 -> Array#find // 6 -> Array#findIndex var ctx = __webpack_require__(16) , IObject = __webpack_require__(18) , toObject = __webpack_require__(19) , toLength = __webpack_require__(21); module.exports = function(TYPE){ var IS_MAP = TYPE == 1 , IS_FILTER = TYPE == 2 , IS_SOME = TYPE == 3 , IS_EVERY = TYPE == 4 , IS_FIND_INDEX = TYPE == 6 , NO_HOLES = TYPE == 5 || IS_FIND_INDEX; return function($this, callbackfn, that){ var O = toObject($this) , self = IObject(O) , f = ctx(callbackfn, that, 3) , length = toLength(self.length) , index = 0 , result = IS_MAP ? Array(length) : IS_FILTER ? [] : undefined , val, res; for(;length > index; index++)if(NO_HOLES || index in self){ val = self[index]; res = f(val, index, O); if(TYPE){ if(IS_MAP)result[index] = res; // map else if(res)switch(TYPE){ case 3: return true; // some case 5: return val; // find case 6: return index; // findIndex case 2: result.push(val); // filter } else if(IS_EVERY)return false; // every } } return IS_FIND_INDEX ? -1 : IS_SOME || IS_EVERY ? IS_EVERY : result; }; }; /***/ }, /* 16 */ /***/ function(module, exports, __webpack_require__) { // optional / simple context binding var aFunction = __webpack_require__(17); 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); }; }; /***/ }, /* 17 */ /***/ function(module, exports) { module.exports = function(it){ if(typeof it != 'function')throw TypeError(it + ' is not a function!'); return it; }; /***/ }, /* 18 */ /***/ function(module, exports, __webpack_require__) { // indexed object, fallback for non-array-like ES3 strings var cof = __webpack_require__(11); module.exports = 0 in Object('z') ? Object : function(it){ return cof(it) == 'String' ? it.split('') : Object(it); }; /***/ }, /* 19 */ /***/ function(module, exports, __webpack_require__) { // 7.1.13 ToObject(argument) var defined = __webpack_require__(20); module.exports = function(it){ return Object(defined(it)); }; /***/ }, /* 20 */ /***/ function(module, exports) { // 7.2.1 RequireObjectCoercible(argument) module.exports = function(it){ if(it == undefined)throw TypeError("Can't call method on " + it); return it; }; /***/ }, /* 21 */ /***/ function(module, exports, __webpack_require__) { // 7.1.15 ToLength var toInteger = __webpack_require__(22) , min = Math.min; module.exports = function(it){ return it > 0 ? min(toInteger(it), 0x1fffffffffffff) : 0; // pow(2, 53) - 1 == 9007199254740991 }; /***/ }, /* 22 */ /***/ function(module, exports) { // 7.1.4 ToInteger var ceil = Math.ceil , floor = Math.floor; module.exports = function(it){ return isNaN(it = +it) ? 0 : (it > 0 ? floor : ceil)(it); }; /***/ }, /* 23 */ /***/ function(module, exports) { var id = 0 , px = Math.random(); module.exports = function(key){ return 'Symbol('.concat(key === undefined ? '' : key, ')_', (++id + px).toString(36)); }; /***/ }, /* 24 */ /***/ function(module, exports, __webpack_require__) { var isObject = __webpack_require__(9); module.exports = function(it){ if(!isObject(it))throw TypeError(it + ' is not an object!'); return it; }; /***/ }, /* 25 */ /***/ function(module, exports, __webpack_require__) { // to indexed object, toObject with fallback for non-array-like ES3 strings var IObject = __webpack_require__(18) , defined = __webpack_require__(20); module.exports = function(it){ return IObject(defined(it)); }; /***/ }, /* 26 */ /***/ function(module, exports, __webpack_require__) { var toInteger = __webpack_require__(22) , max = Math.max , min = Math.min; module.exports = function(index, length){ index = toInteger(index); return index < 0 ? max(index + length, 0) : min(index, length); }; /***/ }, /* 27 */ /***/ function(module, exports, __webpack_require__) { // false -> Array#indexOf // true -> Array#includes var toIObject = __webpack_require__(25) , toLength = __webpack_require__(21) , toIndex = __webpack_require__(26); module.exports = function(IS_INCLUDES){ return function($this, el, fromIndex){ var O = toIObject($this) , length = toLength(O.length) , index = toIndex(fromIndex, length) , value; // Array#includes uses SameValueZero equality algorithm if(IS_INCLUDES && el != el)while(length > index){ value = O[index++]; if(value != value)return true; // Array#toIndex ignores holes, Array#includes - not } else for(;length > index; index++)if(IS_INCLUDES || index in O){ if(O[index] === el)return IS_INCLUDES || index; } return !IS_INCLUDES && -1; }; }; /***/ }, /* 28 */ /***/ function(module, exports, __webpack_require__) { 'use strict'; // ECMAScript 6 symbols shim var $ = __webpack_require__(2) , global = __webpack_require__(7) , has = __webpack_require__(10) , SUPPORT_DESC = __webpack_require__(3) , $def = __webpack_require__(12) , $redef = __webpack_require__(29) , shared = __webpack_require__(31) , setTag = __webpack_require__(32) , uid = __webpack_require__(23) , wks = __webpack_require__(33) , keyOf = __webpack_require__(34) , $names = __webpack_require__(35) , enumKeys = __webpack_require__(36) , anObject = __webpack_require__(24) , toIObject = __webpack_require__(25) , createDesc = __webpack_require__(5) , getDesc = $.getDesc , setDesc = $.setDesc , $create = $.create , getNames = $names.get , $Symbol = global.Symbol , setter = false , HIDDEN = wks('_hidden') , isEnum = $.isEnum , SymbolRegistry = shared('symbol-registry') , AllSymbols = shared('symbols') , useNative = typeof $Symbol == 'function' , ObjectProto = Object.prototype; var setSymbolDesc = SUPPORT_DESC ? function(){ // fallback for old Android try { return $create(setDesc({}, HIDDEN, { get: function(){ return setDesc(this, HIDDEN, {value: false})[HIDDEN]; } }))[HIDDEN] || setDesc; } catch(e){ return function(it, key, D){ var protoDesc = getDesc(ObjectProto, key); if(protoDesc)delete ObjectProto[key]; setDesc(it, key, D); if(protoDesc && it !== ObjectProto)setDesc(ObjectProto, key, protoDesc); }; } }() : setDesc; var wrap = function(tag){ var sym = AllSymbols[tag] = $create($Symbol.prototype); sym._k = tag; SUPPORT_DESC && setter && setSymbolDesc(ObjectProto, tag, { configurable: true, set: function(value){ if(has(this, HIDDEN) && has(this[HIDDEN], tag))this[HIDDEN][tag] = false; setSymbolDesc(this, tag, createDesc(1, value)); } }); return sym; }; function defineProperty(it, key, D){ if(D && has(AllSymbols, key)){ if(!D.enumerable){ if(!has(it, HIDDEN))setDesc(it, HIDDEN, createDesc(1, {})); it[HIDDEN][key] = true; } else { if(has(it, HIDDEN) && it[HIDDEN][key])it[HIDDEN][key] = false; D = $create(D, {enumerable: createDesc(0, false)}); } return setSymbolDesc(it, key, D); } return setDesc(it, key, D); } function defineProperties(it, P){ anObject(it); var keys = enumKeys(P = toIObject(P)) , i = 0 , l = keys.length , key; while(l > i)defineProperty(it, key = keys[i++], P[key]); return it; } function create(it, P){ return P === undefined ? $create(it) : defineProperties($create(it), P); } function propertyIsEnumerable(key){ var E = isEnum.call(this, key); return E || !has(this, key) || !has(AllSymbols, key) || has(this, HIDDEN) && this[HIDDEN][key] ? E : true; } function getOwnPropertyDescriptor(it, key){ var D = getDesc(it = toIObject(it), key); if(D && has(AllSymbols, key) && !(has(it, HIDDEN) && it[HIDDEN][key]))D.enumerable = true; return D; } function getOwnPropertyNames(it){ var names = getNames(toIObject(it)) , result = [] , i = 0 , key; while(names.length > i)if(!has(AllSymbols, key = names[i++]) && key != HIDDEN)result.push(key); return result; } function getOwnPropertySymbols(it){ var names = getNames(toIObject(it)) , result = [] , i = 0 , key; while(names.length > i)if(has(AllSymbols, key = names[i++]))result.push(AllSymbols[key]); return result; } // 19.4.1.1 Symbol([description]) if(!useNative){ $Symbol = function Symbol(){ if(this instanceof $Symbol)throw TypeError('Symbol is not a constructor'); return wrap(uid(arguments[0])); }; $redef($Symbol.prototype, 'toString', function(){ return this._k; }); $.create = create; $.isEnum = propertyIsEnumerable; $.getDesc = getOwnPropertyDescriptor; $.setDesc = defineProperty; $.setDescs = defineProperties; $.getNames = $names.get = getOwnPropertyNames; $.getSymbols = getOwnPropertySymbols; if(SUPPORT_DESC && !__webpack_require__(37)){ $redef(ObjectProto, 'propertyIsEnumerable', propertyIsEnumerable, true); } } var symbolStatics = { // 19.4.2.1 Symbol.for(key) 'for': function(key){ return has(SymbolRegistry, key += '') ? SymbolRegistry[key] : SymbolRegistry[key] = $Symbol(key); }, // 19.4.2.5 Symbol.keyFor(sym) keyFor: function keyFor(key){ return keyOf(SymbolRegistry, key); }, useSetter: function(){ setter = true; }, useSimple: function(){ setter = false; } }; // 19.4.2.2 Symbol.hasInstance // 19.4.2.3 Symbol.isConcatSpreadable // 19.4.2.4 Symbol.iterator // 19.4.2.6 Symbol.match // 19.4.2.8 Symbol.replace // 19.4.2.9 Symbol.search // 19.4.2.10 Symbol.species // 19.4.2.11 Symbol.split // 19.4.2.12 Symbol.toPrimitive // 19.4.2.13 Symbol.toStringTag // 19.4.2.14 Symbol.unscopables $.each.call(( 'hasInstance,isConcatSpreadable,iterator,match,replace,search,' + 'species,split,toPrimitive,toStringTag,unscopables' ).split(','), function(it){ var sym = wks(it); symbolStatics[it] = useNative ? sym : wrap(sym); } ); setter = true; $def($def.G + $def.W, {Symbol: $Symbol}); $def($def.S, 'Symbol', symbolStatics); $def($def.S + $def.F * !useNative, 'Object', { // 19.1.2.2 Object.create(O [, Properties]) create: create, // 19.1.2.4 Object.defineProperty(O, P, Attributes) defineProperty: defineProperty, // 19.1.2.3 Object.defineProperties(O, Properties) defineProperties: defineProperties, // 19.1.2.6 Object.getOwnPropertyDescriptor(O, P) getOwnPropertyDescriptor: getOwnPropertyDescriptor, // 19.1.2.7 Object.getOwnPropertyNames(O) getOwnPropertyNames: getOwnPropertyNames, // 19.1.2.8 Object.getOwnPropertySymbols(O) getOwnPropertySymbols: getOwnPropertySymbols }); // 19.4.3.5 Symbol.prototype[@@toStringTag] setTag($Symbol, 'Symbol'); // 20.2.1.9 Math[@@toStringTag] setTag(Math, 'Math', true); // 24.3.3 JSON[@@toStringTag] setTag(global.JSON, 'JSON', true); /***/ }, /* 29 */ /***/ function(module, exports, __webpack_require__) { module.exports = __webpack_require__(30); /***/ }, /* 30 */ /***/ function(module, exports, __webpack_require__) { var $ = __webpack_require__(2) , createDesc = __webpack_require__(5); module.exports = __webpack_require__(3) ? function(object, key, value){ return $.setDesc(object, key, createDesc(1, value)); } : function(object, key, value){ object[key] = value; return object; }; /***/ }, /* 31 */ /***/ function(module, exports, __webpack_require__) { var global = __webpack_require__(7) , SHARED = '__core-js_shared__' , store = global[SHARED] || (global[SHARED] = {}); module.exports = function(key){ return store[key] || (store[key] = {}); }; /***/ }, /* 32 */ /***/ function(module, exports, __webpack_require__) { var has = __webpack_require__(10) , hide = __webpack_require__(30) , TAG = __webpack_require__(33)('toStringTag'); module.exports = function(it, tag, stat){ if(it && !has(it = stat ? it : it.prototype, TAG))hide(it, TAG, tag); }; /***/ }, /* 33 */ /***/ function(module, exports, __webpack_require__) { var store = __webpack_require__(31)('wks') , Symbol = __webpack_require__(7).Symbol; module.exports = function(name){ return store[name] || (store[name] = Symbol && Symbol[name] || (Symbol || __webpack_require__(23))('Symbol.' + name)); }; /***/ }, /* 34 */ /***/ function(module, exports, __webpack_require__) { var $ = __webpack_require__(2) , toIObject = __webpack_require__(25); module.exports = function(object, el){ var O = toIObject(object) , keys = $.getKeys(O) , length = keys.length , index = 0 , key; while(length > index)if(O[key = keys[index++]] === el)return key; }; /***/ }, /* 35 */ /***/ function(module, exports, __webpack_require__) { // fallback for IE11 buggy Object.getOwnPropertyNames with iframe and window var toString = {}.toString , toIObject = __webpack_require__(25) , getNames = __webpack_require__(2).getNames; var windowNames = typeof window == 'object' && Object.getOwnPropertyNames ? Object.getOwnPropertyNames(window) : []; var getWindowNames = function(it){ try { return getNames(it); } catch(e){ return windowNames.slice(); } }; module.exports.get = function getOwnPropertyNames(it){ if(windowNames && toString.call(it) == '[object Window]')return getWindowNames(it); return getNames(toIObject(it)); }; /***/ }, /* 36 */ /***/ function(module, exports, __webpack_require__) { // all enumerable object keys, includes symbols var $ = __webpack_require__(2); module.exports = function(it){ var keys = $.getKeys(it) , getSymbols = $.getSymbols; if(getSymbols){ var symbols = getSymbols(it) , isEnum = $.isEnum , i = 0 , key; while(symbols.length > i)if(isEnum.call(it, key = symbols[i++]))keys.push(key); } return keys; }; /***/ }, /* 37 */ /***/ function(module, exports) { module.exports = true; /***/ }, /* 38 */ /***/ function(module, exports, __webpack_require__) { // 19.1.3.1 Object.assign(target, source) var $def = __webpack_require__(12); $def($def.S, 'Object', {assign: __webpack_require__(39)}); /***/ }, /* 39 */ /***/ function(module, exports, __webpack_require__) { // 19.1.2.1 Object.assign(target, source, ...) var toObject = __webpack_require__(19) , IObject = __webpack_require__(18) , enumKeys = __webpack_require__(36); /* eslint-disable no-unused-vars */ module.exports = Object.assign || function assign(target, source){ /* eslint-enable no-unused-vars */ var T = toObject(target) , l = arguments.length , i = 1; while(l > i){ var S = IObject(arguments[i++]) , keys = enumKeys(S) , length = keys.length , j = 0 , key; while(length > j)T[key = keys[j++]] = S[key]; } return T; }; /***/ }, /* 40 */ /***/ function(module, exports, __webpack_require__) { // 19.1.3.10 Object.is(value1, value2) var $def = __webpack_require__(12); $def($def.S, 'Object', { is: __webpack_require__(41) }); /***/ }, /* 41 */ /***/ function(module, exports) { module.exports = Object.is || function is(x, y){ return x === y ? x !== 0 || 1 / x === 1 / y : x != x && y != y; }; /***/ }, /* 42 */ /***/ function(module, exports, __webpack_require__) { // 19.1.3.19 Object.setPrototypeOf(O, proto) var $def = __webpack_require__(12); $def($def.S, 'Object', {setPrototypeOf: __webpack_require__(43).set}); /***/ }, /* 43 */ /***/ function(module, exports, __webpack_require__) { // Works with __proto__ only. Old v8 can't work with null proto objects. /* eslint-disable no-proto */ var getDesc = __webpack_require__(2).getDesc , isObject = __webpack_require__(9) , anObject = __webpack_require__(24); var check = function(O, proto){ anObject(O); if(!isObject(proto) && proto !== null)throw TypeError(proto + ": can't set as prototype!"); }; module.exports = { set: Object.setPrototypeOf || ('__proto__' in {} // eslint-disable-line ? function(buggy, set){ try { set = __webpack_require__(16)(Function.call, getDesc(Object.prototype, '__proto__').set, 2); set({}, []); } catch(e){ buggy = true; } return function setPrototypeOf(O, proto){ check(O, proto); if(buggy)O.__proto__ = proto; else set(O, proto); return O; }; }() : undefined), check: check }; /***/ }, /* 44 */ /***/ function(module, exports, __webpack_require__) { // 19.1.2.5 Object.freeze(O) var isObject = __webpack_require__(9); __webpack_require__(45)('freeze', function($freeze){ return function freeze(it){ return $freeze && isObject(it) ? $freeze(it) : it; }; }); /***/ }, /* 45 */ /***/ function(module, exports, __webpack_require__) { // most Object methods by ES6 should accept primitives module.exports = function(KEY, exec){ var $def = __webpack_require__(12) , fn = (__webpack_require__(13).Object || {})[KEY] || Object[KEY] , exp = {}; exp[KEY] = exec(fn); $def($def.S + $def.F * __webpack_require__(4)(function(){ fn(1); }), 'Object', exp); }; /***/ }, /* 46 */ /***/ function(module, exports, __webpack_require__) { // 19.1.2.17 Object.seal(O) var isObject = __webpack_require__(9); __webpack_require__(45)('seal', function($seal){ return function seal(it){ return $seal && isObject(it) ? $seal(it) : it; }; }); /***/ }, /* 47 */ /***/ function(module, exports, __webpack_require__) { // 19.1.2.15 Object.preventExtensions(O) var isObject = __webpack_require__(9); __webpack_require__(45)('preventExtensions', function($preventExtensions){ return function preventExtensions(it){ return $preventExtensions && isObject(it) ? $preventExtensions(it) : it; }; }); /***/ }, /* 48 */ /***/ function(module, exports, __webpack_require__) { // 19.1.2.12 Object.isFrozen(O) var isObject = __webpack_require__(9); __webpack_require__(45)('isFrozen', function($isFrozen){ return function isFrozen(it){ return isObject(it) ? $isFrozen ? $isFrozen(it) : false : true; }; }); /***/ }, /* 49 */ /***/ function(module, exports, __webpack_require__) { // 19.1.2.13 Object.isSealed(O) var isObject = __webpack_require__(9); __webpack_require__(45)('isSealed', function($isSealed){ return function isSealed(it){ return isObject(it) ? $isSealed ? $isSealed(it) : false : true; }; }); /***/ }, /* 50 */ /***/ function(module, exports, __webpack_require__) { // 19.1.2.11 Object.isExtensible(O) var isObject = __webpack_require__(9); __webpack_require__(45)('isExtensible', function($isExtensible){ return function isExtensible(it){ return isObject(it) ? $isExtensible ? $isExtensible(it) : true : false; }; }); /***/ }, /* 51 */ /***/ function(module, exports, __webpack_require__) { // 19.1.2.6 Object.getOwnPropertyDescriptor(O, P) var toIObject = __webpack_require__(25); __webpack_require__(45)('getOwnPropertyDescriptor', function($getOwnPropertyDescriptor){ return function getOwnPropertyDescriptor(it, key){ return $getOwnPropertyDescriptor(toIObject(it), key); }; }); /***/ }, /* 52 */ /***/ function(module, exports, __webpack_require__) { // 19.1.2.9 Object.getPrototypeOf(O) var toObject = __webpack_require__(19); __webpack_require__(45)('getPrototypeOf', function($getPrototypeOf){ return function getPrototypeOf(it){ return $getPrototypeOf(toObject(it)); }; }); /***/ }, /* 53 */ /***/ function(module, exports, __webpack_require__) { // 19.1.2.14 Object.keys(O) var toObject = __webpack_require__(19); __webpack_require__(45)('keys', function($keys){ return function keys(it){ return $keys(toObject(it)); }; }); /***/ }, /* 54 */ /***/ function(module, exports, __webpack_require__) { // 19.1.2.7 Object.getOwnPropertyNames(O) __webpack_require__(45)('getOwnPropertyNames', function(){ return __webpack_require__(35).get; }); /***/ }, /* 55 */ /***/ function(module, exports, __webpack_require__) { 'use strict'; var $ = __webpack_require__(2) , isObject = __webpack_require__(9) , HAS_INSTANCE = __webpack_require__(33)('hasInstance') , FunctionProto = Function.prototype; // 19.2.3.6 Function.prototype[@@hasInstance](V) if(!(HAS_INSTANCE in FunctionProto))$.setDesc(FunctionProto, HAS_INSTANCE, {value: function(O){ if(typeof this != 'function' || !isObject(O))return false; if(!isObject(this.prototype))return O instanceof this; // for environment w/o native `@@hasInstance` logic enough `instanceof`, but add this: while(O = $.getProto(O))if(this.prototype === O)return true; return false; }}); /***/ }, /* 56 */ /***/ function(module, exports, __webpack_require__) { // 20.1.2.1 Number.EPSILON var $def = __webpack_require__(12); $def($def.S, 'Number', {EPSILON: Math.pow(2, -52)}); /***/ }, /* 57 */ /***/ function(module, exports, __webpack_require__) { // 20.1.2.2 Number.isFinite(number) var $def = __webpack_require__(12) , _isFinite = __webpack_require__(7).isFinite; $def($def.S, 'Number', { isFinite: function isFinite(it){ return typeof it == 'number' && _isFinite(it); } }); /***/ }, /* 58 */ /***/ function(module, exports, __webpack_require__) { // 20.1.2.3 Number.isInteger(number) var $def = __webpack_require__(12); $def($def.S, 'Number', {isInteger: __webpack_require__(59)}); /***/ }, /* 59 */ /***/ function(module, exports, __webpack_require__) { // 20.1.2.3 Number.isInteger(number) var isObject = __webpack_require__(9) , floor = Math.floor; module.exports = function isInteger(it){ return !isObject(it) && isFinite(it) && floor(it) === it; }; /***/ }, /* 60 */ /***/ function(module, exports, __webpack_require__) { // 20.1.2.4 Number.isNaN(number) var $def = __webpack_require__(12); $def($def.S, 'Number', { isNaN: function isNaN(number){ return number != number; } }); /***/ }, /* 61 */ /***/ function(module, exports, __webpack_require__) { // 20.1.2.5 Number.isSafeInteger(number) var $def = __webpack_require__(12) , isInteger = __webpack_require__(59) , abs = Math.abs; $def($def.S, 'Number', { isSafeInteger: function isSafeInteger(number){ return isInteger(number) && abs(number) <= 0x1fffffffffffff; } }); /***/ }, /* 62 */ /***/ function(module, exports, __webpack_require__) { // 20.1.2.6 Number.MAX_SAFE_INTEGER var $def = __webpack_require__(12); $def($def.S, 'Number', {MAX_SAFE_INTEGER: 0x1fffffffffffff}); /***/ }, /* 63 */ /***/ function(module, exports, __webpack_require__) { // 20.1.2.10 Number.MIN_SAFE_INTEGER var $def = __webpack_require__(12); $def($def.S, 'Number', {MIN_SAFE_INTEGER: -0x1fffffffffffff}); /***/ }, /* 64 */ /***/ function(module, exports, __webpack_require__) { // 20.1.2.12 Number.parseFloat(string) var $def = __webpack_require__(12); $def($def.S, 'Number', {parseFloat: parseFloat}); /***/ }, /* 65 */ /***/ function(module, exports, __webpack_require__) { // 20.1.2.13 Number.parseInt(string, radix) var $def = __webpack_require__(12); $def($def.S, 'Number', {parseInt: parseInt}); /***/ }, /* 66 */ /***/ function(module, exports, __webpack_require__) { // 20.2.2.3 Math.acosh(x) var $def = __webpack_require__(12) , log1p = __webpack_require__(67) , sqrt = Math.sqrt , $acosh = Math.acosh; // V8 bug https://code.google.com/p/v8/issues/detail?id=3509 $def($def.S + $def.F * !($acosh && Math.floor($acosh(Number.MAX_VALUE)) == 710), 'Math', { acosh: function acosh(x){ return (x = +x) < 1 ? NaN : x > 94906265.62425156 ? Math.log(x) + Math.LN2 : log1p(x - 1 + sqrt(x - 1) * sqrt(x + 1)); } }); /***/ }, /* 67 */ /***/ function(module, exports) { // 20.2.2.20 Math.log1p(x) module.exports = Math.log1p || function log1p(x){ return (x = +x) > -1e-8 && x < 1e-8 ? x - x * x / 2 : Math.log(1 + x); }; /***/ }, /* 68 */ /***/ function(module, exports, __webpack_require__) { // 20.2.2.5 Math.asinh(x) var $def = __webpack_require__(12); function asinh(x){ return !isFinite(x = +x) || x == 0 ? x : x < 0 ? -asinh(-x) : Math.log(x + Math.sqrt(x * x + 1)); } $def($def.S, 'Math', {asinh: asinh}); /***/ }, /* 69 */ /***/ function(module, exports, __webpack_require__) { // 20.2.2.7 Math.atanh(x) var $def = __webpack_require__(12); $def($def.S, 'Math', { atanh: function atanh(x){ return (x = +x) == 0 ? x : Math.log((1 + x) / (1 - x)) / 2; } }); /***/ }, /* 70 */ /***/ function(module, exports, __webpack_require__) { // 20.2.2.9 Math.cbrt(x) var $def = __webpack_require__(12) , sign = __webpack_require__(71); $def($def.S, 'Math', { cbrt: function cbrt(x){ return sign(x = +x) * Math.pow(Math.abs(x), 1 / 3); } }); /***/ }, /* 71 */ /***/ function(module, exports) { // 20.2.2.28 Math.sign(x) module.exports = Math.sign || function sign(x){ return (x = +x) == 0 || x != x ? x : x < 0 ? -1 : 1; }; /***/ }, /* 72 */ /***/ function(module, exports, __webpack_require__) { // 20.2.2.11 Math.clz32(x) var $def = __webpack_require__(12); $def($def.S, 'Math', { clz32: function clz32(x){ return (x >>>= 0) ? 31 - Math.floor(Math.log(x + 0.5) * Math.LOG2E) : 32; } }); /***/ }, /* 73 */ /***/ function(module, exports, __webpack_require__) { // 20.2.2.12 Math.cosh(x) var $def = __webpack_require__(12) , exp = Math.exp; $def($def.S, 'Math', { cosh: function cosh(x){ return (exp(x = +x) + exp(-x)) / 2; } }); /***/ }, /* 74 */ /***/ function(module, exports, __webpack_require__) { // 20.2.2.14 Math.expm1(x) var $def = __webpack_require__(12); $def($def.S, 'Math', {expm1: __webpack_require__(75)}); /***/ }, /* 75 */ /***/ function(module, exports) { // 20.2.2.14 Math.expm1(x) module.exports = Math.expm1 || function expm1(x){ return (x = +x) == 0 ? x : x > -1e-6 && x < 1e-6 ? x + x * x / 2 : Math.exp(x) - 1; }; /***/ }, /* 76 */ /***/ function(module, exports, __webpack_require__) { // 20.2.2.16 Math.fround(x) var $def = __webpack_require__(12) , sign = __webpack_require__(71) , pow = Math.pow , EPSILON = pow(2, -52) , EPSILON32 = pow(2, -23) , MAX32 = pow(2, 127) * (2 - EPSILON32) , MIN32 = pow(2, -126); var roundTiesToEven = function(n){ return n + 1 / EPSILON - 1 / EPSILON; }; $def($def.S, 'Math', { fround: function fround(x){ var $abs = Math.abs(x) , $sign = sign(x) , a, result; if($abs < MIN32)return $sign * roundTiesToEven($abs / MIN32 / EPSILON32) * MIN32 * EPSILON32; a = (1 + EPSILON32 / EPSILON) * $abs; result = a - (a - $abs); if(result > MAX32 || result != result)return $sign * Infinity; return $sign * result; } }); /***/ }, /* 77 */ /***/ function(module, exports, __webpack_require__) { // 20.2.2.17 Math.hypot([value1[, value2[, … ]]]) var $def = __webpack_require__(12) , abs = Math.abs; $def($def.S, 'Math', { hypot: function hypot(value1, value2){ // eslint-disable-line no-unused-vars var sum = 0 , i = 0 , len = arguments.length , larg = 0 , arg, div; while(i < len){ arg = abs(arguments[i++]); if(larg < arg){ div = larg / arg; sum = sum * div * div + 1; larg = arg; } else if(arg > 0){ div = arg / larg; sum += div * div; } else sum += arg; } return larg === Infinity ? Infinity : larg * Math.sqrt(sum); } }); /***/ }, /* 78 */ /***/ function(module, exports, __webpack_require__) { // 20.2.2.18 Math.imul(x, y) var $def = __webpack_require__(12); // WebKit fails with big numbers $def($def.S + $def.F * __webpack_require__(4)(function(){ return Math.imul(0xffffffff, 5) != -5; }), 'Math', { imul: function imul(x, y){ var UINT16 = 0xffff , xn = +x , yn = +y , xl = UINT16 & xn , yl = UINT16 & yn; return 0 | xl * yl + ((UINT16 & xn >>> 16) * yl + xl * (UINT16 & yn >>> 16) << 16 >>> 0); } }); /***/ }, /* 79 */ /***/ function(module, exports, __webpack_require__) { // 20.2.2.21 Math.log10(x) var $def = __webpack_require__(12); $def($def.S, 'Math', { log10: function log10(x){ return Math.log(x) / Math.LN10; } }); /***/ }, /* 80 */ /***/ function(module, exports, __webpack_require__) { // 20.2.2.20 Math.log1p(x) var $def = __webpack_require__(12); $def($def.S, 'Math', {log1p: __webpack_require__(67)}); /***/ }, /* 81 */ /***/ function(module, exports, __webpack_require__) { // 20.2.2.22 Math.log2(x) var $def = __webpack_require__(12); $def($def.S, 'Math', { log2: function log2(x){ return Math.log(x) / Math.LN2; } }); /***/ }, /* 82 */ /***/ function(module, exports, __webpack_require__) { // 20.2.2.28 Math.sign(x) var $def = __webpack_require__(12); $def($def.S, 'Math', {sign: __webpack_require__(71)}); /***/ }, /* 83 */ /***/ function(module, exports, __webpack_require__) { // 20.2.2.30 Math.sinh(x) var $def = __webpack_require__(12) , expm1 = __webpack_require__(75) , exp = Math.exp; $def($def.S, 'Math', { sinh: function sinh(x){ return Math.abs(x = +x) < 1 ? (expm1(x) - expm1(-x)) / 2 : (exp(x - 1) - exp(-x - 1)) * (Math.E / 2); } }); /***/ }, /* 84 */ /***/ function(module, exports, __webpack_require__) { // 20.2.2.33 Math.tanh(x) var $def = __webpack_require__(12) , expm1 = __webpack_require__(75) , exp = Math.exp; $def($def.S, 'Math', { tanh: function tanh(x){ var a = expm1(x = +x) , b = expm1(-x); return a == Infinity ? 1 : b == Infinity ? -1 : (a - b) / (exp(x) + exp(-x)); } }); /***/ }, /* 85 */ /***/ function(module, exports, __webpack_require__) { // 20.2.2.34 Math.trunc(x) var $def = __webpack_require__(12); $def($def.S, 'Math', { trunc: function trunc(it){ return (it > 0 ? Math.floor : Math.ceil)(it); } }); /***/ }, /* 86 */ /***/ function(module, exports, __webpack_require__) { var $def = __webpack_require__(12) , toIndex = __webpack_require__(26) , fromCharCode = String.fromCharCode , $fromCodePoint = String.fromCodePoint; // length should be 1, old FF problem $def($def.S + $def.F * (!!$fromCodePoint && $fromCodePoint.length != 1), 'String', { // 21.1.2.2 String.fromCodePoint(...codePoints) fromCodePoint: function fromCodePoint(x){ // eslint-disable-line no-unused-vars var res = [] , len = arguments.length , i = 0 , code; while(len > i){ code = +arguments[i++]; if(toIndex(code, 0x10ffff) !== code)throw RangeError(code + ' is not a valid code point'); res.push(code < 0x10000 ? fromCharCode(code) : fromCharCode(((code -= 0x10000) >> 10) + 0xd800, code % 0x400 + 0xdc00) ); } return res.join(''); } }); /***/ }, /* 87 */ /***/ function(module, exports, __webpack_require__) { var $def = __webpack_require__(12) , toIObject = __webpack_require__(25) , toLength = __webpack_require__(21); $def($def.S, 'String', { // 21.1.2.4 String.raw(callSite, ...substitutions) raw: function raw(callSite){ var tpl = toIObject(callSite.raw) , len = toLength(tpl.length) , sln = arguments.length , res = [] , i = 0; while(len > i){ res.push(String(tpl[i++])); if(i < sln)res.push(String(arguments[i])); } return res.join(''); } }); /***/ }, /* 88 */ /***/ function(module, exports, __webpack_require__) { 'use strict'; // 21.1.3.25 String.prototype.trim() __webpack_require__(89)('trim', function($trim){ return function trim(){ return $trim(this, 3); }; }); /***/ }, /* 89 */ /***/ function(module, exports, __webpack_require__) { // 1 -> String#trimLeft // 2 -> String#trimRight // 3 -> String#trim var trim = function(string, TYPE){ string = String(defined(string)); if(TYPE & 1)string = string.replace(ltrim, ''); if(TYPE & 2)string = string.replace(rtrim, ''); return string; }; var $def = __webpack_require__(12) , defined = __webpack_require__(20) , spaces = '\x09\x0A\x0B\x0C\x0D\x20\xA0\u1680\u180E\u2000\u2001\u2002\u2003' + '\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u202F\u205F\u3000\u2028\u2029\uFEFF' , space = '[' + spaces + ']' , non = '\u200b\u0085' , ltrim = RegExp('^' + space + space + '*') , rtrim = RegExp(space + space + '*$'); module.exports = function(KEY, exec){ var exp = {}; exp[KEY] = exec(trim); $def($def.P + $def.F * __webpack_require__(4)(function(){ return !!spaces[KEY]() || non[KEY]() != non; }), 'String', exp); }; /***/ }, /* 90 */ /***/ function(module, exports, __webpack_require__) { 'use strict'; var $def = __webpack_require__(12) , $at = __webpack_require__(91)(false); $def($def.P, 'String', { // 21.1.3.3 String.prototype.codePointAt(pos) codePointAt: function codePointAt(pos){ return $at(this, pos); } }); /***/ }, /* 91 */ /***/ function(module, exports, __webpack_require__) { // true -> String#at // false -> String#codePointAt var toInteger = __webpack_require__(22) , defined = __webpack_require__(20); module.exports = function(TO_STRING){ return function(that, pos){ var s = String(defined(that)) , i = toInteger(pos) , l = s.length , a, b; if(i < 0 || i >= l)return TO_STRING ? '' : undefined; a = s.charCodeAt(i); return a < 0xd800 || a > 0xdbff || i + 1 === l || (b = s.charCodeAt(i + 1)) < 0xdc00 || b > 0xdfff ? TO_STRING ? s.charAt(i) : a : TO_STRING ? s.slice(i, i + 2) : (a - 0xd800 << 10) + (b - 0xdc00) + 0x10000; }; }; /***/ }, /* 92 */ /***/ function(module, exports, __webpack_require__) { 'use strict'; var $def = __webpack_require__(12) , toLength = __webpack_require__(21) , context = __webpack_require__(93); // should throw error on regex $def($def.P + $def.F * !__webpack_require__(4)(function(){ 'q'.endsWith(/./); }), 'String', { // 21.1.3.6 String.prototype.endsWith(searchString [, endPosition]) endsWith: function endsWith(searchString /*, endPosition = @length */){ var that = context(this, searchString, 'endsWith') , endPosition = arguments[1] , len = toLength(that.length) , end = endPosition === undefined ? len : Math.min(toLength(endPosition), len) , search = String(searchString); return that.slice(end - search.length, end) === search; } }); /***/ }, /* 93 */ /***/ function(module, exports, __webpack_require__) { // helper for String#{startsWith, endsWith, includes} var defined = __webpack_require__(20) , cof = __webpack_require__(11); module.exports = function(that, searchString, NAME){ if(cof(searchString) == 'RegExp')throw TypeError('String#' + NAME + " doesn't accept regex!"); return String(defined(that)); }; /***/ }, /* 94 */ /***/ function(module, exports, __webpack_require__) { 'use strict'; var $def = __webpack_require__(12) , context = __webpack_require__(93); $def($def.P, 'String', { // 21.1.3.7 String.prototype.includes(searchString, position = 0) includes: function includes(searchString /*, position = 0 */){ return !!~context(this, searchString, 'includes').indexOf(searchString, arguments[1]); } }); /***/ }, /* 95 */ /***/ function(module, exports, __webpack_require__) { var $def = __webpack_require__(12); $def($def.P, 'String', { // 21.1.3.13 String.prototype.repeat(count) repeat: __webpack_require__(96) }); /***/ }, /* 96 */ /***/ function(module, exports, __webpack_require__) { 'use strict'; var toInteger = __webpack_require__(22) , defined = __webpack_require__(20); module.exports = function repeat(count){ var str = String(defined(this)) , res = '' , n = toInteger(count); if(n < 0 || n == Infinity)throw RangeError("Count can't be negative"); for(;n > 0; (n >>>= 1) && (str += str))if(n & 1)res += str; return res; }; /***/ }, /* 97 */ /***/ function(module, exports, __webpack_require__) { 'use strict'; var $def = __webpack_require__(12) , toLength = __webpack_require__(21) , context = __webpack_require__(93); // should throw error on regex $def($def.P + $def.F * !__webpack_require__(4)(function(){ 'q'.startsWith(/./); }), 'String', { // 21.1.3.18 String.prototype.startsWith(searchString [, position ]) startsWith: function startsWith(searchString /*, position = 0 */){ var that = context(this, searchString, 'startsWith') , index = toLength(Math.min(arguments[1], that.length)) , search = String(searchString); return that.slice(index, index + search.length) === search; } }); /***/ }, /* 98 */ /***/ function(module, exports, __webpack_require__) { 'use strict'; var $at = __webpack_require__(91)(true); // 21.1.3.27 String.prototype[@@iterator]() __webpack_require__(99)(String, 'String', function(iterated){ this._t = String(iterated); // target this._i = 0; // next index // 21.1.5.2.1 %StringIteratorPrototype%.next() }, function(){ var O = this._t , index = this._i , point; if(index >= O.length)return {value: undefined, done: true}; point = $at(O, index); this._i += point.length; return {value: point, done: false}; }); /***/ }, /* 99 */ /***/ function(module, exports, __webpack_require__) { 'use strict'; var LIBRARY = __webpack_require__(37) , $def = __webpack_require__(12) , $redef = __webpack_require__(29) , hide = __webpack_require__(30) , has = __webpack_require__(10) , SYMBOL_ITERATOR = __webpack_require__(33)('iterator') , Iterators = __webpack_require__(100) , FF_ITERATOR = '@@iterator' , KEYS = 'keys' , VALUES = 'values'; var returnThis = function(){ return this; }; module.exports = function(Base, NAME, Constructor, next, DEFAULT, IS_SET, FORCE){ __webpack_require__(101)(Constructor, NAME, next); var createMethod = function(kind){ switch(kind){ case KEYS: return function keys(){ return new Constructor(this, kind); }; case VALUES: return function values(){ return new Constructor(this, kind); }; } return function entries(){ return new Constructor(this, kind); }; }; var TAG = NAME + ' Iterator' , proto = Base.prototype , _native = proto[SYMBOL_ITERATOR] || proto[FF_ITERATOR] || DEFAULT && proto[DEFAULT] , _default = _native || createMethod(DEFAULT) , methods, key; // Fix native if(_native){ var IteratorPrototype = __webpack_require__(2).getProto(_default.call(new Base)); // Set @@toStringTag to native iterators __webpack_require__(32)(IteratorPrototype, TAG, true); // FF fix if(!LIBRARY && has(proto, FF_ITERATOR))hide(IteratorPrototype, SYMBOL_ITERATOR, returnThis); } // Define iterator if(!LIBRARY || FORCE)hide(proto, SYMBOL_ITERATOR, _default); // Plug for library Iterators[NAME] = _default; Iterators[TAG] = returnThis; if(DEFAULT){ methods = { keys: IS_SET ? _default : createMethod(KEYS), values: DEFAULT == VALUES ? _default : createMethod(VALUES), entries: DEFAULT != VALUES ? _default : createMethod('entries') }; if(FORCE)for(key in methods){ if(!(key in proto))$redef(proto, key, methods[key]); } else $def($def.P + $def.F * __webpack_require__(102), NAME, methods); } }; /***/ }, /* 100 */ /***/ function(module, exports) { module.exports = {}; /***/ }, /* 101 */ /***/ function(module, exports, __webpack_require__) { 'use strict'; var $ = __webpack_require__(2) , IteratorPrototype = {}; // 25.1.2.1.1 %IteratorPrototype%[@@iterator]() __webpack_require__(30)(IteratorPrototype, __webpack_require__(33)('iterator'), function(){ return this; }); module.exports = function(Constructor, NAME, next){ Constructor.prototype = $.create(IteratorPrototype, {next: __webpack_require__(5)(1,next)}); __webpack_require__(32)(Constructor, NAME + ' Iterator'); }; /***/ }, /* 102 */ /***/ function(module, exports) { // Safari has buggy iterators w/o `next` module.exports = 'keys' in [] && !('next' in [].keys()); /***/ }, /* 103 */ /***/ function(module, exports, __webpack_require__) { 'use strict'; var ctx = __webpack_require__(16) , $def = __webpack_require__(12) , toObject = __webpack_require__(19) , call = __webpack_require__(104) , isArrayIter = __webpack_require__(105) , toLength = __webpack_require__(21) , getIterFn = __webpack_require__(106); $def($def.S + $def.F * !__webpack_require__(108)(function(iter){ Array.from(iter); }), 'Array', { // 22.1.2.1 Array.from(arrayLike, mapfn = undefined, thisArg = undefined) from: function from(arrayLike/*, mapfn = undefined, thisArg = undefined*/){ var O = toObject(arrayLike) , C = typeof this == 'function' ? this : Array , mapfn = arguments[1] , mapping = mapfn !== undefined , index = 0 , iterFn = getIterFn(O) , length, result, step, iterator; if(mapping)mapfn = ctx(mapfn, arguments[2], 2); // if object isn't iterable or it's array with default iterator - use simple case if(iterFn != undefined && !(C == Array && isArrayIter(iterFn))){ for(iterator = iterFn.call(O), result = new C; !(step = iterator.next()).done; index++){ result[index] = mapping ? call(iterator, mapfn, [step.value, index], true) : step.value; } } else { for(result = new C(length = toLength(O.length)); length > index; index++){ result[index] = mapping ? mapfn(O[index], index) : O[index]; } } result.length = index; return result; } }); /***/ }, /* 104 */ /***/ function(module, exports, __webpack_require__) { // call something on iterator step with safe closing on error var anObject = __webpack_require__(24); module.exports = function(iterator, fn, value, entries){ try { return entries ? fn(anObject(value)[0], value[1]) : fn(value); // 7.4.6 IteratorClose(iterator, completion) } catch(e){ var ret = iterator['return']; if(ret !== undefined)anObject(ret.call(iterator)); throw e; } }; /***/ }, /* 105 */ /***/ function(module, exports, __webpack_require__) { // check on default Array iterator var Iterators = __webpack_require__(100) , ITERATOR = __webpack_require__(33)('iterator'); module.exports = function(it){ return (Iterators.Array || Array.prototype[ITERATOR]) === it; }; /***/ }, /* 106 */ /***/ function(module, exports, __webpack_require__) { var classof = __webpack_require__(107) , ITERATOR = __webpack_require__(33)('iterator') , Iterators = __webpack_require__(100); module.exports = __webpack_require__(13).getIteratorMethod = function(it){ if(it != undefined)return it[ITERATOR] || it['@@iterator'] || Iterators[classof(it)]; }; /***/ }, /* 107 */ /***/ function(module, exports, __webpack_require__) { // getting tag from 19.1.3.6 Object.prototype.toString() var cof = __webpack_require__(11) , TAG = __webpack_require__(33)('toStringTag') // ES3 wrong here , ARG = cof(function(){ return arguments; }()) == 'Arguments'; module.exports = function(it){ var O, T, B; return it === undefined ? 'Undefined' : it === null ? 'Null' // @@toStringTag case : typeof (T = (O = Object(it))[TAG]) == 'string' ? T // builtinTag case : ARG ? cof(O) // ES3 arguments fallback : (B = cof(O)) == 'Object' && typeof O.callee == 'function' ? 'Arguments' : B; }; /***/ }, /* 108 */ /***/ function(module, exports, __webpack_require__) { var SYMBOL_ITERATOR = __webpack_require__(33)('iterator') , SAFE_CLOSING = false; try { var riter = [7][SYMBOL_ITERATOR](); riter['return'] = function(){ SAFE_CLOSING = true; }; Array.from(riter, function(){ throw 2; }); } catch(e){ /* empty */ } module.exports = function(exec){ if(!SAFE_CLOSING)return false; var safe = false; try { var arr = [7] , iter = arr[SYMBOL_ITERATOR](); iter.next = function(){ safe = true; }; arr[SYMBOL_ITERATOR] = function(){ return iter; }; exec(arr); } catch(e){ /* empty */ } return safe; }; /***/ }, /* 109 */ /***/ function(module, exports, __webpack_require__) { 'use strict'; var $def = __webpack_require__(12); $def($def.S, 'Array', { // 22.1.2.3 Array.of( ...items) of: function of(/* ...args */){ var index = 0 , length = arguments.length , result = new (typeof this == 'function' ? this : Array)(length); while(length > index)result[index] = arguments[index++]; result.length = length; return result; } }); /***/ }, /* 110 */ /***/ function(module, exports, __webpack_require__) { 'use strict'; var setUnscope = __webpack_require__(111) , step = __webpack_require__(112) , Iterators = __webpack_require__(100) , toIObject = __webpack_require__(25); // 22.1.3.4 Array.prototype.entries() // 22.1.3.13 Array.prototype.keys() // 22.1.3.29 Array.prototype.values() // 22.1.3.30 Array.prototype[@@iterator]() __webpack_require__(99)(Array, 'Array', function(iterated, kind){ this._t = toIObject(iterated); // target this._i = 0; // next index this._k = kind; // kind // 22.1.5.2.1 %ArrayIteratorPrototype%.next() }, function(){ var O = this._t , kind = this._k , index = this._i++; if(!O || index >= O.length){ this._t = undefined; return step(1); } if(kind == 'keys' )return step(0, index); if(kind == 'values')return step(0, O[index]); return step(0, [index, O[index]]); }, 'values'); // argumentsList[@@iterator] is %ArrayProto_values% (9.4.4.6, 9.4.4.7) Iterators.Arguments = Iterators.Array; setUnscope('keys'); setUnscope('values'); setUnscope('entries'); /***/ }, /* 111 */ /***/ function(module, exports) { module.exports = function(){ /* empty */ }; /***/ }, /* 112 */ /***/ function(module, exports) { module.exports = function(done, value){ return {value: value, done: !!done}; }; /***/ }, /* 113 */ /***/ function(module, exports, __webpack_require__) { __webpack_require__(114)(Array); /***/ }, /* 114 */ /***/ function(module, exports, __webpack_require__) { 'use strict'; var $ = __webpack_require__(2) , SPECIES = __webpack_require__(33)('species'); module.exports = function(C){ if(__webpack_require__(3) && !(SPECIES in C))$.setDesc(C, SPECIES, { configurable: true, get: function(){ return this; } }); }; /***/ }, /* 115 */ /***/ function(module, exports, __webpack_require__) { 'use strict'; var $def = __webpack_require__(12) , toObject = __webpack_require__(19) , toIndex = __webpack_require__(26) , toLength = __webpack_require__(21); $def($def.P, 'Array', { // 22.1.3.3 Array.prototype.copyWithin(target, start, end = this.length) copyWithin: function copyWithin(target/* = 0 */, start /* = 0, end = @length */){ var O = toObject(this) , len = toLength(O.length) , to = toIndex(target, len) , from = toIndex(start, len) , end = arguments[2] , fin = end === undefined ? len : toIndex(end, len) , count = Math.min(fin - from, len - to) , inc = 1; if(from < to && to < from + count){ inc = -1; from = from + count - 1; to = to + count - 1; } while(count-- > 0){ if(from in O)O[to] = O[from]; else delete O[to]; to += inc; from += inc; } return O; } }); __webpack_require__(111)('copyWithin'); /***/ }, /* 116 */ /***/ function(module, exports, __webpack_require__) { 'use strict'; var $def = __webpack_require__(12) , toObject = __webpack_require__(19) , toIndex = __webpack_require__(26) , toLength = __webpack_require__(21); $def($def.P, 'Array', { // 22.1.3.6 Array.prototype.fill(value, start = 0, end = this.length) fill: function fill(value /*, start = 0, end = @length */){ var O = toObject(this, true) , length = toLength(O.length) , index = toIndex(arguments[1], length) , end = arguments[2] , endPos = end === undefined ? length : toIndex(end, length); while(endPos > index)O[index++] = value; return O; } }); __webpack_require__(111)('fill'); /***/ }, /* 117 */ /***/ function(module, exports, __webpack_require__) { 'use strict'; // 22.1.3.8 Array.prototype.find(predicate, thisArg = undefined) var KEY = 'find' , $def = __webpack_require__(12) , forced = true , $find = __webpack_require__(15)(5); // Shouldn't skip holes if(KEY in [])Array(1)[KEY](function(){ forced = false; }); $def($def.P + $def.F * forced, 'Array', { find: function find(callbackfn/*, that = undefined */){ return $find(this, callbackfn, arguments[1]); } }); __webpack_require__(111)(KEY); /***/ }, /* 118 */ /***/ function(module, exports, __webpack_require__) { 'use strict'; // 22.1.3.9 Array.prototype.findIndex(predicate, thisArg = undefined) var KEY = 'findIndex' , $def = __webpack_require__(12) , forced = true , $find = __webpack_require__(15)(6); // Shouldn't skip holes if(KEY in [])Array(1)[KEY](function(){ forced = false; }); $def($def.P + $def.F * forced, 'Array', { findIndex: function findIndex(callbackfn/*, that = undefined */){ return $find(this, callbackfn, arguments[1]); } }); __webpack_require__(111)(KEY); /***/ }, /* 119 */ /***/ function(module, exports, __webpack_require__) { 'use strict'; var $ = __webpack_require__(2) , LIBRARY = __webpack_require__(37) , global = __webpack_require__(7) , ctx = __webpack_require__(16) , classof = __webpack_require__(107) , $def = __webpack_require__(12) , isObject = __webpack_require__(9) , anObject = __webpack_require__(24) , aFunction = __webpack_require__(17) , strictNew = __webpack_require__(120) , forOf = __webpack_require__(121) , setProto = __webpack_require__(43).set , same = __webpack_require__(41) , species = __webpack_require__(114) , SPECIES = __webpack_require__(33)('species') , RECORD = __webpack_require__(23)('record') , PROMISE = 'Promise' , process = global.process , isNode = classof(process) == 'process' , asap = process && process.nextTick || __webpack_require__(122).set , P = global[PROMISE] , Wrapper; var testResolve = function(sub){ var test = new P(function(){}); if(sub)test.constructor = Object; return P.resolve(test) === test; }; var useNative = function(){ var works = false; function P2(x){ var self = new P(x); setProto(self, P2.prototype); return self; } try { works = P && P.resolve && testResolve(); setProto(P2, P); P2.prototype = $.create(P.prototype, {constructor: {value: P2}}); // actual Firefox has broken subclass support, test that if(!(P2.resolve(5).then(function(){}) instanceof P2)){ works = false; } // actual V8 bug, https://code.google.com/p/v8/issues/detail?id=4162 if(works && __webpack_require__(3)){ var thenableThenGotten = false; P.resolve($.setDesc({}, 'then', { get: function(){ thenableThenGotten = true; } })); works = thenableThenGotten; } } catch(e){ works = false; } return works; }(); // helpers var isPromise = function(it){ return isObject(it) && (useNative ? classof(it) == 'Promise' : RECORD in it); }; var sameConstructor = function(a, b){ // library wrapper special case if(LIBRARY && a === P && b === Wrapper)return true; return same(a, b); }; var getConstructor = function(C){ var S = anObject(C)[SPECIES]; return S != undefined ? S : C; }; var isThenable = function(it){ var then; return isObject(it) && typeof (then = it.then) == 'function' ? then : false; }; var notify = function(record, isReject){ if(record.n)return; record.n = true; var chain = record.c; // strange IE + webpack dev server bug - use .call(global) asap.call(global, function(){ var value = record.v , ok = record.s == 1 , i = 0; var run = function(react){ var cb = ok ? react.ok : react.fail , ret, then; try { if(cb){ if(!ok)record.h = true; ret = cb === true ? value : cb(value); if(ret === react.P){ react.rej(TypeError('Promise-chain cycle')); } else if(then = isThenable(ret)){ then.call(ret, react.res, react.rej); } else react.res(ret); } else react.rej(value); } catch(err){ react.rej(err); } }; while(chain.length > i)run(chain[i++]); // variable length - can't use forEach chain.length = 0; record.n = false; if(isReject)setTimeout(function(){ // strange IE + webpack dev server bug - use .call(global) asap.call(global, function(){ if(isUnhandled(record.p)){ if(isNode){ process.emit('unhandledRejection', value, record.p); } else if(global.console && console.error){ console.error('Unhandled promise rejection', value); } } record.a = undefined; }); }, 1); }); }; var isUnhandled = function(promise){ var record = promise[RECORD] , chain = record.a || record.c , i = 0 , react; if(record.h)return false; while(chain.length > i){ react = chain[i++]; if(react.fail || !isUnhandled(react.P))return false; } return true; }; var $reject = function(value){ var record = this; if(record.d)return; record.d = true; record = record.r || record; // unwrap record.v = value; record.s = 2; record.a = record.c.slice(); notify(record, true); }; var $resolve = function(value){ var record = this , then; if(record.d)return; record.d = true; record = record.r || record; // unwrap try { if(then = isThenable(value)){ // strange IE + webpack dev server bug - use .call(global) asap.call(global, function(){ var wrapper = {r: record, d: false}; // wrap try { then.call(value, ctx($resolve, wrapper, 1), ctx($reject, wrapper, 1)); } catch(e){ $reject.call(wrapper, e); } }); } else { record.v = value; record.s = 1; notify(record, false); } } catch(e){ $reject.call({r: record, d: false}, e); // wrap } }; // constructor polyfill if(!useNative){ // 25.4.3.1 Promise(executor) P = function Promise(executor){ aFunction(executor); var record = { p: strictNew(this, P, PROMISE), // <- promise c: [], // <- awaiting reactions a: undefined, // <- checked in isUnhandled reactions s: 0, // <- state d: false, // <- done v: undefined, // <- value h: false, // <- handled rejection n: false // <- notify }; this[RECORD] = record; try { executor(ctx($resolve, record, 1), ctx($reject, record, 1)); } catch(err){ $reject.call(record, err); } }; __webpack_require__(123)(P.prototype, { // 25.4.5.3 Promise.prototype.then(onFulfilled, onRejected) then: function then(onFulfilled, onRejected){ var S = anObject(anObject(this).constructor)[SPECIES]; var react = { ok: typeof onFulfilled == 'function' ? onFulfilled : true, fail: typeof onRejected == 'function' ? onRejected : false }; var promise = react.P = new (S != undefined ? S : P)(function(res, rej){ react.res = aFunction(res); react.rej = aFunction(rej); }); var record = this[RECORD]; record.c.push(react); if(record.a)record.a.push(react); if(record.s)notify(record, false); return promise; }, // 25.4.5.1 Promise.prototype.catch(onRejected) 'catch': function(onRejected){ return this.then(undefined, onRejected); } }); } // export $def($def.G + $def.W + $def.F * !useNative, {Promise: P}); __webpack_require__(32)(P, PROMISE); species(P); species(Wrapper = __webpack_require__(13)[PROMISE]); // statics $def($def.S + $def.F * !useNative, PROMISE, { // 25.4.4.5 Promise.reject(r) reject: function reject(r){ return new this(function(res, rej){ rej(r); }); } }); $def($def.S + $def.F * (!useNative || testResolve(true)), PROMISE, { // 25.4.4.6 Promise.resolve(x) resolve: function resolve(x){ return isPromise(x) && sameConstructor(x.constructor, this) ? x : new this(function(res){ res(x); }); } }); $def($def.S + $def.F * !(useNative && __webpack_require__(108)(function(iter){ P.all(iter)['catch'](function(){}); })), PROMISE, { // 25.4.4.1 Promise.all(iterable) all: function all(iterable){ var C = getConstructor(this) , values = []; return new C(function(res, rej){ forOf(iterable, false, values.push, values); var remaining = values.length , results = Array(remaining); if(remaining)$.each.call(values, function(promise, index){ C.resolve(promise).then(function(value){ results[index] = value; --remaining || res(results); }, rej); }); else res(results); }); }, // 25.4.4.4 Promise.race(iterable) race: function race(iterable){ var C = getConstructor(this); return new C(function(res, rej){ forOf(iterable, false, function(promise){ C.resolve(promise).then(res, rej); }); }); } }); /***/ }, /* 120 */ /***/ function(module, exports) { module.exports = function(it, Constructor, name){ if(!(it instanceof Constructor))throw TypeError(name + ": use the 'new' operator!"); return it; }; /***/ }, /* 121 */ /***/ function(module, exports, __webpack_require__) { var ctx = __webpack_require__(16) , call = __webpack_require__(104) , isArrayIter = __webpack_require__(105) , anObject = __webpack_require__(24) , toLength = __webpack_require__(21) , getIterFn = __webpack_require__(106); module.exports = function(iterable, entries, fn, that){ var iterFn = getIterFn(iterable) , f = ctx(fn, that, entries ? 2 : 1) , index = 0 , length, step, iterator; if(typeof iterFn != 'function')throw TypeError(iterable + ' is not iterable!'); // fast case for arrays with default iterator if(isArrayIter(iterFn))for(length = toLength(iterable.length); length > index; index++){ entries ? f(anObject(step = iterable[index])[0], step[1]) : f(iterable[index]); } else for(iterator = iterFn.call(iterable); !(step = iterator.next()).done; ){ call(iterator, f, step.value, entries); } }; /***/ }, /* 122 */ /***/ function(module, exports, __webpack_require__) { 'use strict'; var ctx = __webpack_require__(16) , invoke = __webpack_require__(14) , html = __webpack_require__(6) , cel = __webpack_require__(8) , global = __webpack_require__(7) , 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 listner = 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(__webpack_require__(11)(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 = listner; 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.importScript){ defer = function(id){ global.postMessage(id + '', '*'); }; global.addEventListener('message', listner, 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 }; /***/ }, /* 123 */ /***/ function(module, exports, __webpack_require__) { var $redef = __webpack_require__(29); module.exports = function(target, src){ for(var key in src)$redef(target, key, src[key]); return target; }; /***/ }, /* 124 */ /***/ function(module, exports, __webpack_require__) { 'use strict'; var strong = __webpack_require__(125); // 23.1 Map Objects __webpack_require__(126)('Map', function(get){ return function Map(){ return get(this, arguments[0]); }; }, { // 23.1.3.6 Map.prototype.get(key) get: function get(key){ var entry = strong.getEntry(this, key); return entry && entry.v; }, // 23.1.3.9 Map.prototype.set(key, value) set: function set(key, value){ return strong.def(this, key === 0 ? 0 : key, value); } }, strong, true); /***/ }, /* 125 */ /***/ function(module, exports, __webpack_require__) { 'use strict'; var $ = __webpack_require__(2) , hide = __webpack_require__(30) , ctx = __webpack_require__(16) , species = __webpack_require__(114) , strictNew = __webpack_require__(120) , defined = __webpack_require__(20) , forOf = __webpack_require__(121) , step = __webpack_require__(112) , ID = __webpack_require__(23)('id') , $has = __webpack_require__(10) , isObject = __webpack_require__(9) , isExtensible = Object.isExtensible || isObject , SUPPORT_DESC = __webpack_require__(3) , SIZE = SUPPORT_DESC ? '_s' : 'size' , id = 0; var fastKey = function(it, create){ // return primitive with prefix if(!isObject(it))return typeof it == 'symbol' ? it : (typeof it == 'string' ? 'S' : 'P') + it; if(!$has(it, ID)){ // can't set id to frozen object if(!isExtensible(it))return 'F'; // not necessary to add id if(!create)return 'E'; // add missing object id hide(it, ID, ++id); // return object id with prefix } return 'O' + it[ID]; }; var getEntry = function(that, key){ // fast case var index = fastKey(key), entry; if(index !== 'F')return that._i[index]; // frozen object case for(entry = that._f; entry; entry = entry.n){ if(entry.k == key)return entry; } }; module.exports = { getConstructor: function(wrapper, NAME, IS_MAP, ADDER){ var C = wrapper(function(that, iterable){ strictNew(that, C, NAME); that._i = $.create(null); // index that._f = undefined; // first entry that._l = undefined; // last entry that[SIZE] = 0; // size if(iterable != undefined)forOf(iterable, IS_MAP, that[ADDER], that); }); __webpack_require__(123)(C.prototype, { // 23.1.3.1 Map.prototype.clear() // 23.2.3.2 Set.prototype.clear() clear: function clear(){ for(var that = this, data = that._i, entry = that._f; entry; entry = entry.n){ entry.r = true; if(entry.p)entry.p = entry.p.n = undefined; delete data[entry.i]; } that._f = that._l = undefined; that[SIZE] = 0; }, // 23.1.3.3 Map.prototype.delete(key) // 23.2.3.4 Set.prototype.delete(value) 'delete': function(key){ var that = this , entry = getEntry(that, key); if(entry){ var next = entry.n , prev = entry.p; delete that._i[entry.i]; entry.r = true; if(prev)prev.n = next; if(next)next.p = prev; if(that._f == entry)that._f = next; if(that._l == entry)that._l = prev; that[SIZE]--; } return !!entry; }, // 23.2.3.6 Set.prototype.forEach(callbackfn, thisArg = undefined) // 23.1.3.5 Map.prototype.forEach(callbackfn, thisArg = undefined) forEach: function forEach(callbackfn /*, that = undefined */){ var f = ctx(callbackfn, arguments[1], 3) , entry; while(entry = entry ? entry.n : this._f){ f(entry.v, entry.k, this); // revert to the last existing entry while(entry && entry.r)entry = entry.p; } }, // 23.1.3.7 Map.prototype.has(key) // 23.2.3.7 Set.prototype.has(value) has: function has(key){ return !!getEntry(this, key); } }); if(SUPPORT_DESC)$.setDesc(C.prototype, 'size', { get: function(){ return defined(this[SIZE]); } }); return C; }, def: function(that, key, value){ var entry = getEntry(that, key) , prev, index; // change existing entry if(entry){ entry.v = value; // create new entry } else { that._l = entry = { i: index = fastKey(key, true), // <- index k: key, // <- key v: value, // <- value p: prev = that._l, // <- previous entry n: undefined, // <- next entry r: false // <- removed }; if(!that._f)that._f = entry; if(prev)prev.n = entry; that[SIZE]++; // add to index if(index !== 'F')that._i[index] = entry; } return that; }, getEntry: getEntry, setStrong: function(C, NAME, IS_MAP){ // add .keys, .values, .entries, [@@iterator] // 23.1.3.4, 23.1.3.8, 23.1.3.11, 23.1.3.12, 23.2.3.5, 23.2.3.8, 23.2.3.10, 23.2.3.11 __webpack_require__(99)(C, NAME, function(iterated, kind){ this._t = iterated; // target this._k = kind; // kind this._l = undefined; // previous }, function(){ var that = this , kind = that._k , entry = that._l; // revert to the last existing entry while(entry && entry.r)entry = entry.p; // get next entry if(!that._t || !(that._l = entry = entry ? entry.n : that._t._f)){ // or finish the iteration that._t = undefined; return step(1); } // return step by kind if(kind == 'keys' )return step(0, entry.k); if(kind == 'values')return step(0, entry.v); return step(0, [entry.k, entry.v]); }, IS_MAP ? 'entries' : 'values' , !IS_MAP, true); // add [@@species], 23.1.2.2, 23.2.2.2 species(C); species(__webpack_require__(13)[NAME]); // for wrapper } }; /***/ }, /* 126 */ /***/ function(module, exports, __webpack_require__) { 'use strict'; var $ = __webpack_require__(2) , $def = __webpack_require__(12) , hide = __webpack_require__(30) , BUGGY = __webpack_require__(102) , forOf = __webpack_require__(121) , strictNew = __webpack_require__(120); module.exports = function(NAME, wrapper, methods, common, IS_MAP, IS_WEAK){ var Base = __webpack_require__(7)[NAME] , C = Base , ADDER = IS_MAP ? 'set' : 'add' , proto = C && C.prototype , O = {}; if(!__webpack_require__(3) || typeof C != 'function' || !(IS_WEAK || !BUGGY && proto.forEach && proto.entries)){ // create collection constructor C = common.getConstructor(wrapper, NAME, IS_MAP, ADDER); __webpack_require__(123)(C.prototype, methods); } else { C = wrapper(function(target, iterable){ strictNew(target, C, NAME); target._c = new Base; if(iterable != undefined)forOf(iterable, IS_MAP, target[ADDER], target); }); $.each.call('add,clear,delete,forEach,get,has,set,keys,values,entries'.split(','),function(KEY){ var chain = KEY == 'add' || KEY == 'set'; if(KEY in proto && !(IS_WEAK && KEY == 'clear'))hide(C.prototype, KEY, function(a, b){ var result = this._c[KEY](a === 0 ? 0 : a, b); return chain ? this : result; }); }); if('size' in proto)$.setDesc(C.prototype, 'size', { get: function(){ return this._c.size; } }); } __webpack_require__(32)(C, NAME); O[NAME] = C; $def($def.G + $def.W + $def.F, O); if(!IS_WEAK)common.setStrong(C, NAME, IS_MAP); return C; }; /***/ }, /* 127 */ /***/ function(module, exports, __webpack_require__) { 'use strict'; var strong = __webpack_require__(125); // 23.2 Set Objects __webpack_require__(126)('Set', function(get){ return function Set(){ return get(this, arguments[0]); }; }, { // 23.2.3.1 Set.prototype.add(value) add: function add(value){ return strong.def(this, value = value === 0 ? 0 : value, value); } }, strong); /***/ }, /* 128 */ /***/ function(module, exports, __webpack_require__) { 'use strict'; var $ = __webpack_require__(2) , weak = __webpack_require__(129) , isObject = __webpack_require__(9) , has = __webpack_require__(10) , frozenStore = weak.frozenStore , WEAK = weak.WEAK , isExtensible = Object.isExtensible || isObject , tmp = {}; // 23.3 WeakMap Objects var $WeakMap = __webpack_require__(126)('WeakMap', function(get){ return function WeakMap(){ return get(this, arguments[0]); }; }, { // 23.3.3.3 WeakMap.prototype.get(key) get: function get(key){ if(isObject(key)){ if(!isExtensible(key))return frozenStore(this).get(key); if(has(key, WEAK))return key[WEAK][this._i]; } }, // 23.3.3.5 WeakMap.prototype.set(key, value) set: function set(key, value){ return weak.def(this, key, value); } }, weak, true, true); // IE11 WeakMap frozen keys fix if(new $WeakMap().set((Object.freeze || Object)(tmp), 7).get(tmp) != 7){ $.each.call(['delete', 'has', 'get', 'set'], function(key){ var proto = $WeakMap.prototype , method = proto[key]; __webpack_require__(29)(proto, key, function(a, b){ // store frozen objects on leaky map if(isObject(a) && !isExtensible(a)){ var result = frozenStore(this)[key](a, b); return key == 'set' ? this : result; // store all the rest on native weakmap } return method.call(this, a, b); }); }); } /***/ }, /* 129 */ /***/ function(module, exports, __webpack_require__) { 'use strict'; var hide = __webpack_require__(30) , anObject = __webpack_require__(24) , strictNew = __webpack_require__(120) , forOf = __webpack_require__(121) , method = __webpack_require__(15) , WEAK = __webpack_require__(23)('weak') , isObject = __webpack_require__(9) , $has = __webpack_require__(10) , isExtensible = Object.isExtensible || isObject , find = method(5) , findIndex = method(6) , id = 0; // fallback for frozen keys var frozenStore = function(that){ return that._l || (that._l = new FrozenStore); }; var FrozenStore = function(){ this.a = []; }; var findFrozen = function(store, key){ return find(store.a, function(it){ return it[0] === key; }); }; FrozenStore.prototype = { get: function(key){ var entry = findFrozen(this, key); if(entry)return entry[1]; }, has: function(key){ return !!findFrozen(this, key); }, set: function(key, value){ var entry = findFrozen(this, key); if(entry)entry[1] = value; else this.a.push([key, value]); }, 'delete': function(key){ var index = findIndex(this.a, function(it){ return it[0] === key; }); if(~index)this.a.splice(index, 1); return !!~index; } }; module.exports = { getConstructor: function(wrapper, NAME, IS_MAP, ADDER){ var C = wrapper(function(that, iterable){ strictNew(that, C, NAME); that._i = id++; // collection id that._l = undefined; // leak store for frozen objects if(iterable != undefined)forOf(iterable, IS_MAP, that[ADDER], that); }); __webpack_require__(123)(C.prototype, { // 23.3.3.2 WeakMap.prototype.delete(key) // 23.4.3.3 WeakSet.prototype.delete(value) 'delete': function(key){ if(!isObject(key))return false; if(!isExtensible(key))return frozenStore(this)['delete'](key); return $has(key, WEAK) && $has(key[WEAK], this._i) && delete key[WEAK][this._i]; }, // 23.3.3.4 WeakMap.prototype.has(key) // 23.4.3.4 WeakSet.prototype.has(value) has: function has(key){ if(!isObject(key))return false; if(!isExtensible(key))return frozenStore(this).has(key); return $has(key, WEAK) && $has(key[WEAK], this._i); } }); return C; }, def: function(that, key, value){ if(!isExtensible(anObject(key))){ frozenStore(that).set(key, value); } else { $has(key, WEAK) || hide(key, WEAK, {}); key[WEAK][that._i] = value; } return that; }, frozenStore: frozenStore, WEAK: WEAK }; /***/ }, /* 130 */ /***/ function(module, exports, __webpack_require__) { 'use strict'; var weak = __webpack_require__(129); // 23.4 WeakSet Objects __webpack_require__(126)('WeakSet', function(get){ return function WeakSet(){ return get(this, arguments[0]); }; }, { // 23.4.3.1 WeakSet.prototype.add(value) add: function add(value){ return weak.def(this, value, true); } }, weak, false, true); /***/ }, /* 131 */ /***/ function(module, exports, __webpack_require__) { // 26.1.1 Reflect.apply(target, thisArgument, argumentsList) var $def = __webpack_require__(12) , _apply = Function.apply; $def($def.S, 'Reflect', { apply: function apply(target, thisArgument, argumentsList){ return _apply.call(target, thisArgument, argumentsList); } }); /***/ }, /* 132 */ /***/ function(module, exports, __webpack_require__) { // 26.1.2 Reflect.construct(target, argumentsList [, newTarget]) var $ = __webpack_require__(2) , $def = __webpack_require__(12) , aFunction = __webpack_require__(17) , anObject = __webpack_require__(24) , isObject = __webpack_require__(9) , bind = Function.bind || __webpack_require__(13).Function.prototype.bind; $def($def.S, 'Reflect', { construct: function construct(Target, args /*, newTarget*/){ aFunction(Target); if(arguments.length < 3){ // w/o newTarget, optimization for 0-4 arguments if(args != undefined)switch(anObject(args).length){ case 0: return new Target; case 1: return new Target(args[0]); case 2: return new Target(args[0], args[1]); case 3: return new Target(args[0], args[1], args[2]); case 4: return new Target(args[0], args[1], args[2], args[3]); } // w/o newTarget, lot of arguments case var $args = [null]; $args.push.apply($args, args); return new (bind.apply(Target, $args)); } // with newTarget, not support built-in constructors var proto = aFunction(arguments[2]).prototype , instance = $.create(isObject(proto) ? proto : Object.prototype) , result = Function.apply.call(Target, instance, args); return isObject(result) ? result : instance; } }); /***/ }, /* 133 */ /***/ function(module, exports, __webpack_require__) { // 26.1.3 Reflect.defineProperty(target, propertyKey, attributes) var $ = __webpack_require__(2) , $def = __webpack_require__(12) , anObject = __webpack_require__(24); // MS Edge has broken Reflect.defineProperty - throwing instead of returning false $def($def.S + $def.F * __webpack_require__(4)(function(){ Reflect.defineProperty($.setDesc({}, 1, {value: 1}), 1, {value: 2}); }), 'Reflect', { defineProperty: function defineProperty(target, propertyKey, attributes){ anObject(target); try { $.setDesc(target, propertyKey, attributes); return true; } catch(e){ return false; } } }); /***/ }, /* 134 */ /***/ function(module, exports, __webpack_require__) { // 26.1.4 Reflect.deleteProperty(target, propertyKey) var $def = __webpack_require__(12) , getDesc = __webpack_require__(2).getDesc , anObject = __webpack_require__(24); $def($def.S, 'Reflect', { deleteProperty: function deleteProperty(target, propertyKey){ var desc = getDesc(anObject(target), propertyKey); return desc && !desc.configurable ? false : delete target[propertyKey]; } }); /***/ }, /* 135 */ /***/ function(module, exports, __webpack_require__) { 'use strict'; // 26.1.5 Reflect.enumerate(target) var $def = __webpack_require__(12) , anObject = __webpack_require__(24); var Enumerate = function(iterated){ this._t = anObject(iterated); // target this._i = 0; // next index var keys = this._k = [] // keys , key; for(key in iterated)keys.push(key); }; __webpack_require__(101)(Enumerate, 'Object', function(){ var that = this , keys = that._k , key; do { if(that._i >= keys.length)return {value: undefined, done: true}; } while(!((key = keys[that._i++]) in that._t)); return {value: key, done: false}; }); $def($def.S, 'Reflect', { enumerate: function enumerate(target){ return new Enumerate(target); } }); /***/ }, /* 136 */ /***/ function(module, exports, __webpack_require__) { // 26.1.6 Reflect.get(target, propertyKey [, receiver]) var $ = __webpack_require__(2) , has = __webpack_require__(10) , $def = __webpack_require__(12) , isObject = __webpack_require__(9) , anObject = __webpack_require__(24); function get(target, propertyKey/*, receiver*/){ var receiver = arguments.length < 3 ? target : arguments[2] , desc, proto; if(anObject(target) === receiver)return target[propertyKey]; if(desc = $.getDesc(target, propertyKey))return has(desc, 'value') ? desc.value : desc.get !== undefined ? desc.get.call(receiver) : undefined; if(isObject(proto = $.getProto(target)))return get(proto, propertyKey, receiver); } $def($def.S, 'Reflect', {get: get}); /***/ }, /* 137 */ /***/ function(module, exports, __webpack_require__) { // 26.1.7 Reflect.getOwnPropertyDescriptor(target, propertyKey) var $ = __webpack_require__(2) , $def = __webpack_require__(12) , anObject = __webpack_require__(24); $def($def.S, 'Reflect', { getOwnPropertyDescriptor: function getOwnPropertyDescriptor(target, propertyKey){ return $.getDesc(anObject(target), propertyKey); } }); /***/ }, /* 138 */ /***/ function(module, exports, __webpack_require__) { // 26.1.8 Reflect.getPrototypeOf(target) var $def = __webpack_require__(12) , getProto = __webpack_require__(2).getProto , anObject = __webpack_require__(24); $def($def.S, 'Reflect', { getPrototypeOf: function getPrototypeOf(target){ return getProto(anObject(target)); } }); /***/ }, /* 139 */ /***/ function(module, exports, __webpack_require__) { // 26.1.9 Reflect.has(target, propertyKey) var $def = __webpack_require__(12); $def($def.S, 'Reflect', { has: function has(target, propertyKey){ return propertyKey in target; } }); /***/ }, /* 140 */ /***/ function(module, exports, __webpack_require__) { // 26.1.10 Reflect.isExtensible(target) var $def = __webpack_require__(12) , anObject = __webpack_require__(24) , $isExtensible = Object.isExtensible; $def($def.S, 'Reflect', { isExtensible: function isExtensible(target){ anObject(target); return $isExtensible ? $isExtensible(target) : true; } }); /***/ }, /* 141 */ /***/ function(module, exports, __webpack_require__) { // 26.1.11 Reflect.ownKeys(target) var $def = __webpack_require__(12); $def($def.S, 'Reflect', {ownKeys: __webpack_require__(142)}); /***/ }, /* 142 */ /***/ function(module, exports, __webpack_require__) { // all object keys, includes non-enumerable and symbols var $ = __webpack_require__(2) , anObject = __webpack_require__(24); module.exports = function ownKeys(it){ var keys = $.getNames(anObject(it)) , getSymbols = $.getSymbols; return getSymbols ? keys.concat(getSymbols(it)) : keys; }; /***/ }, /* 143 */ /***/ function(module, exports, __webpack_require__) { // 26.1.12 Reflect.preventExtensions(target) var $def = __webpack_require__(12) , anObject = __webpack_require__(24) , $preventExtensions = Object.preventExtensions; $def($def.S, 'Reflect', { preventExtensions: function preventExtensions(target){ anObject(target); try { if($preventExtensions)$preventExtensions(target); return true; } catch(e){ return false; } } }); /***/ }, /* 144 */ /***/ function(module, exports, __webpack_require__) { // 26.1.13 Reflect.set(target, propertyKey, V [, receiver]) var $ = __webpack_require__(2) , has = __webpack_require__(10) , $def = __webpack_require__(12) , createDesc = __webpack_require__(5) , anObject = __webpack_require__(24) , isObject = __webpack_require__(9); function set(target, propertyKey, V/*, receiver*/){ var receiver = arguments.length < 4 ? target : arguments[3] , ownDesc = $.getDesc(anObject(target), propertyKey) , existingDescriptor, proto; if(!ownDesc){ if(isObject(proto = $.getProto(target))){ return set(proto, propertyKey, V, receiver); } ownDesc = createDesc(0); } if(has(ownDesc, 'value')){ if(ownDesc.writable === false || !isObject(receiver))return false; existingDescriptor = $.getDesc(receiver, propertyKey) || createDesc(0); existingDescriptor.value = V; $.setDesc(receiver, propertyKey, existingDescriptor); return true; } return ownDesc.set === undefined ? false : (ownDesc.set.call(receiver, V), true); } $def($def.S, 'Reflect', {set: set}); /***/ }, /* 145 */ /***/ function(module, exports, __webpack_require__) { // 26.1.14 Reflect.setPrototypeOf(target, proto) var $def = __webpack_require__(12) , setProto = __webpack_require__(43); if(setProto)$def($def.S, 'Reflect', { setPrototypeOf: function setPrototypeOf(target, proto){ setProto.check(target, proto); try { setProto.set(target, proto); return true; } catch(e){ return false; } } }); /***/ }, /* 146 */ /***/ function(module, exports, __webpack_require__) { 'use strict'; var $def = __webpack_require__(12) , $includes = __webpack_require__(27)(true); $def($def.P, 'Array', { // https://github.com/domenic/Array.prototype.includes includes: function includes(el /*, fromIndex = 0 */){ return $includes(this, el, arguments[1]); } }); __webpack_require__(111)('includes'); /***/ }, /* 147 */ /***/ function(module, exports, __webpack_require__) { // https://github.com/mathiasbynens/String.prototype.at 'use strict'; var $def = __webpack_require__(12) , $at = __webpack_require__(91)(true); $def($def.P, 'String', { at: function at(pos){ return $at(this, pos); } }); /***/ }, /* 148 */ /***/ function(module, exports, __webpack_require__) { 'use strict'; var $def = __webpack_require__(12) , $pad = __webpack_require__(149); $def($def.P, 'String', { padLeft: function padLeft(maxLength /*, fillString = ' ' */){ return $pad(this, maxLength, arguments[1], true); } }); /***/ }, /* 149 */ /***/ function(module, exports, __webpack_require__) { // https://github.com/ljharb/proposal-string-pad-left-right var toLength = __webpack_require__(21) , repeat = __webpack_require__(96) , defined = __webpack_require__(20); module.exports = function(that, maxLength, fillString, left){ var S = String(defined(that)) , stringLength = S.length , fillStr = fillString === undefined ? ' ' : String(fillString) , intMaxLength = toLength(maxLength); if(intMaxLength <= stringLength)return S; if(fillStr == '')fillStr = ' '; var fillLen = intMaxLength - stringLength , stringFiller = repeat.call(fillStr, Math.ceil(fillLen / fillStr.length)); if(stringFiller.length > fillLen)stringFiller = left ? stringFiller.slice(stringFiller.length - fillLen) : stringFiller.slice(0, fillLen); return left ? stringFiller + S : S + stringFiller; }; /***/ }, /* 150 */ /***/ function(module, exports, __webpack_require__) { 'use strict'; var $def = __webpack_require__(12) , $pad = __webpack_require__(149); $def($def.P, 'String', { padRight: function padRight(maxLength /*, fillString = ' ' */){ return $pad(this, maxLength, arguments[1], false); } }); /***/ }, /* 151 */ /***/ function(module, exports, __webpack_require__) { 'use strict'; // https://github.com/sebmarkbage/ecmascript-string-left-right-trim __webpack_require__(89)('trimLeft', function($trim){ return function trimLeft(){ return $trim(this, 1); }; }); /***/ }, /* 152 */ /***/ function(module, exports, __webpack_require__) { 'use strict'; // https://github.com/sebmarkbage/ecmascript-string-left-right-trim __webpack_require__(89)('trimRight', function($trim){ return function trimRight(){ return $trim(this, 2); }; }); /***/ }, /* 153 */ /***/ function(module, exports, __webpack_require__) { // https://github.com/benjamingr/RexExp.escape var $def = __webpack_require__(12) , $re = __webpack_require__(154)(/[\\^$*+?.()|[\]{}]/g, '\\$&'); $def($def.S, 'RegExp', {escape: function escape(it){ return $re(it); }}); /***/ }, /* 154 */ /***/ function(module, exports) { module.exports = function(regExp, replace){ var replacer = replace === Object(replace) ? function(part){ return replace[part]; } : replace; return function(it){ return String(it).replace(regExp, replacer); }; }; /***/ }, /* 155 */ /***/ function(module, exports, __webpack_require__) { // https://gist.github.com/WebReflection/9353781 var $ = __webpack_require__(2) , $def = __webpack_require__(12) , ownKeys = __webpack_require__(142) , toIObject = __webpack_require__(25) , createDesc = __webpack_require__(5); $def($def.S, 'Object', { getOwnPropertyDescriptors: function getOwnPropertyDescriptors(object){ var O = toIObject(object) , setDesc = $.setDesc , getDesc = $.getDesc , keys = ownKeys(O) , result = {} , i = 0 , key, D; while(keys.length > i){ D = getDesc(O, key = keys[i++]); if(key in result)setDesc(result, key, createDesc(0, D)); else result[key] = D; } return result; } }); /***/ }, /* 156 */ /***/ function(module, exports, __webpack_require__) { // http://goo.gl/XkBrjD var $def = __webpack_require__(12) , $values = __webpack_require__(157)(false); $def($def.S, 'Object', { values: function values(it){ return $values(it); } }); /***/ }, /* 157 */ /***/ function(module, exports, __webpack_require__) { var $ = __webpack_require__(2) , toIObject = __webpack_require__(25); module.exports = function(isEntries){ return function(it){ var O = toIObject(it) , keys = $.getKeys(O) , length = keys.length , i = 0 , result = Array(length) , key; if(isEntries)while(length > i)result[i] = [key = keys[i++], O[key]]; else while(length > i)result[i] = O[keys[i++]]; return result; }; }; /***/ }, /* 158 */ /***/ function(module, exports, __webpack_require__) { // http://goo.gl/XkBrjD var $def = __webpack_require__(12) , $entries = __webpack_require__(157)(true); $def($def.S, 'Object', { entries: function entries(it){ return $entries(it); } }); /***/ }, /* 159 */ /***/ function(module, exports, __webpack_require__) { // https://github.com/DavidBruant/Map-Set.prototype.toJSON var $def = __webpack_require__(12); $def($def.P, 'Map', {toJSON: __webpack_require__(160)('Map')}); /***/ }, /* 160 */ /***/ function(module, exports, __webpack_require__) { // https://github.com/DavidBruant/Map-Set.prototype.toJSON var forOf = __webpack_require__(121) , classof = __webpack_require__(107); module.exports = function(NAME){ return function toJSON(){ if(classof(this) != NAME)throw TypeError(NAME + "#toJSON isn't generic"); var arr = []; forOf(this, false, arr.push, arr); return arr; }; }; /***/ }, /* 161 */ /***/ function(module, exports, __webpack_require__) { // https://github.com/DavidBruant/Map-Set.prototype.toJSON var $def = __webpack_require__(12); $def($def.P, 'Set', {toJSON: __webpack_require__(160)('Set')}); /***/ }, /* 162 */ /***/ function(module, exports, __webpack_require__) { var $def = __webpack_require__(12) , $task = __webpack_require__(122); $def($def.G + $def.B, { setImmediate: $task.set, clearImmediate: $task.clear }); /***/ }, /* 163 */ /***/ function(module, exports, __webpack_require__) { __webpack_require__(110); var Iterators = __webpack_require__(100); Iterators.NodeList = Iterators.HTMLCollection = Iterators.Array; /***/ }, /* 164 */ /***/ function(module, exports, __webpack_require__) { // ie9- setTimeout & setInterval additional parameters fix var global = __webpack_require__(7) , $def = __webpack_require__(12) , invoke = __webpack_require__(14) , partial = __webpack_require__(165) , navigator = global.navigator , MSIE = !!navigator && /MSIE .\./.test(navigator.userAgent); // <- dirty ie9- check var wrap = function(set){ return MSIE ? function(fn, time /*, ...args */){ return set(invoke( partial, [].slice.call(arguments, 2), typeof fn == 'function' ? fn : Function(fn) ), time); } : set; }; $def($def.G + $def.B + $def.F * MSIE, { setTimeout: wrap(global.setTimeout), setInterval: wrap(global.setInterval) }); /***/ }, /* 165 */ /***/ function(module, exports, __webpack_require__) { 'use strict'; var path = __webpack_require__(166) , invoke = __webpack_require__(14) , aFunction = __webpack_require__(17); module.exports = function(/* ...pargs */){ var fn = aFunction(this) , length = arguments.length , pargs = Array(length) , i = 0 , _ = path._ , holder = false; while(length > i)if((pargs[i] = arguments[i++]) === _)holder = true; return function(/* ...args */){ var that = this , _length = arguments.length , j = 0, k = 0, args; if(!holder && !_length)return invoke(fn, pargs, that); args = pargs.slice(); if(holder)for(;length > j; j++)if(args[j] === _)args[j] = arguments[k++]; while(_length > k)args.push(arguments[k++]); return invoke(fn, args, that); }; }; /***/ }, /* 166 */ /***/ function(module, exports, __webpack_require__) { module.exports = __webpack_require__(13); /***/ }, /* 167 */ /***/ function(module, exports, __webpack_require__) { 'use strict'; var $ = __webpack_require__(2) , ctx = __webpack_require__(16) , $def = __webpack_require__(12) , createDesc = __webpack_require__(5) , assign = __webpack_require__(39) , keyOf = __webpack_require__(34) , aFunction = __webpack_require__(17) , forOf = __webpack_require__(121) , isIterable = __webpack_require__(168) , step = __webpack_require__(112) , isObject = __webpack_require__(9) , toIObject = __webpack_require__(25) , SUPPORT_DESC = __webpack_require__(3) , has = __webpack_require__(10) , getKeys = $.getKeys; // 0 -> Dict.forEach // 1 -> Dict.map // 2 -> Dict.filter // 3 -> Dict.some // 4 -> Dict.every // 5 -> Dict.find // 6 -> Dict.findKey // 7 -> Dict.mapPairs var createDictMethod = function(TYPE){ var IS_MAP = TYPE == 1 , IS_EVERY = TYPE == 4; return function(object, callbackfn, that /* = undefined */){ var f = ctx(callbackfn, that, 3) , O = toIObject(object) , result = IS_MAP || TYPE == 7 || TYPE == 2 ? new (typeof this == 'function' ? this : Dict) : undefined , key, val, res; for(key in O)if(has(O, key)){ val = O[key]; res = f(val, key, object); if(TYPE){ if(IS_MAP)result[key] = res; // map else if(res)switch(TYPE){ case 2: result[key] = val; break; // filter case 3: return true; // some case 5: return val; // find case 6: return key; // findKey case 7: result[res[0]] = res[1]; // mapPairs } else if(IS_EVERY)return false; // every } } return TYPE == 3 || IS_EVERY ? IS_EVERY : result; }; }; var findKey = createDictMethod(6); var createDictIter = function(kind){ return function(it){ return new DictIterator(it, kind); }; }; var DictIterator = function(iterated, kind){ this._t = toIObject(iterated); // target this._a = getKeys(iterated); // keys this._i = 0; // next index this._k = kind; // kind }; __webpack_require__(101)(DictIterator, 'Dict', function(){ var that = this , O = that._t , keys = that._a , kind = that._k , key; do { if(that._i >= keys.length){ that._t = undefined; return step(1); } } while(!has(O, key = keys[that._i++])); if(kind == 'keys' )return step(0, key); if(kind == 'values')return step(0, O[key]); return step(0, [key, O[key]]); }); function Dict(iterable){ var dict = $.create(null); if(iterable != undefined){ if(isIterable(iterable)){ forOf(iterable, true, function(key, value){ dict[key] = value; }); } else assign(dict, iterable); } return dict; } Dict.prototype = null; function reduce(object, mapfn, init){ aFunction(mapfn); var O = toIObject(object) , keys = getKeys(O) , length = keys.length , i = 0 , memo, key; if(arguments.length < 3){ if(!length)throw TypeError('Reduce of empty object with no initial value'); memo = O[keys[i++]]; } else memo = Object(init); while(length > i)if(has(O, key = keys[i++])){ memo = mapfn(memo, O[key], key, object); } return memo; } function includes(object, el){ return (el == el ? keyOf(object, el) : findKey(object, function(it){ return it != it; })) !== undefined; } function get(object, key){ if(has(object, key))return object[key]; } function set(object, key, value){ if(SUPPORT_DESC && key in Object)$.setDesc(object, key, createDesc(0, value)); else object[key] = value; return object; } function isDict(it){ return isObject(it) && $.getProto(it) === Dict.prototype; } $def($def.G + $def.F, {Dict: Dict}); $def($def.S, 'Dict', { keys: createDictIter('keys'), values: createDictIter('values'), entries: createDictIter('entries'), forEach: createDictMethod(0), map: createDictMethod(1), filter: createDictMethod(2), some: createDictMethod(3), every: createDictMethod(4), find: createDictMethod(5), findKey: findKey, mapPairs: createDictMethod(7), reduce: reduce, keyOf: keyOf, includes: includes, has: has, get: get, set: set, isDict: isDict }); /***/ }, /* 168 */ /***/ function(module, exports, __webpack_require__) { var classof = __webpack_require__(107) , ITERATOR = __webpack_require__(33)('iterator') , Iterators = __webpack_require__(100); module.exports = __webpack_require__(13).isIterable = function(it){ var O = Object(it); return ITERATOR in O || '@@iterator' in O || Iterators.hasOwnProperty(classof(O)); }; /***/ }, /* 169 */ /***/ function(module, exports, __webpack_require__) { var anObject = __webpack_require__(24) , get = __webpack_require__(106); module.exports = __webpack_require__(13).getIterator = function(it){ var iterFn = get(it); if(typeof iterFn != 'function')throw TypeError(it + ' is not iterable!'); return anObject(iterFn.call(it)); }; /***/ }, /* 170 */ /***/ function(module, exports, __webpack_require__) { var global = __webpack_require__(7) , core = __webpack_require__(13) , $def = __webpack_require__(12) , partial = __webpack_require__(165); // https://esdiscuss.org/topic/promise-returning-delay-function $def($def.G + $def.F, { delay: function delay(time){ return new (core.Promise || global.Promise)(function(resolve){ setTimeout(partial.call(resolve, true), time); }); } }); /***/ }, /* 171 */ /***/ function(module, exports, __webpack_require__) { 'use strict'; var path = __webpack_require__(166) , $def = __webpack_require__(12); // Placeholder __webpack_require__(13)._ = path._ = path._ || {}; $def($def.P + $def.F, 'Function', {part: __webpack_require__(165)}); /***/ }, /* 172 */ /***/ function(module, exports, __webpack_require__) { var $def = __webpack_require__(12); $def($def.S + $def.F, 'Object', {isObject: __webpack_require__(9)}); /***/ }, /* 173 */ /***/ function(module, exports, __webpack_require__) { var $def = __webpack_require__(12); $def($def.S + $def.F, 'Object', {classof: __webpack_require__(107)}); /***/ }, /* 174 */ /***/ function(module, exports, __webpack_require__) { var $def = __webpack_require__(12) , define = __webpack_require__(175); $def($def.S + $def.F, 'Object', {define: define}); /***/ }, /* 175 */ /***/ function(module, exports, __webpack_require__) { var $ = __webpack_require__(2) , ownKeys = __webpack_require__(142) , toIObject = __webpack_require__(25); module.exports = function define(target, mixin){ var keys = ownKeys(toIObject(mixin)) , length = keys.length , i = 0, key; while(length > i)$.setDesc(target, key = keys[i++], $.getDesc(mixin, key)); return target; }; /***/ }, /* 176 */ /***/ function(module, exports, __webpack_require__) { var $def = __webpack_require__(12) , create = __webpack_require__(2).create , define = __webpack_require__(175); $def($def.S + $def.F, 'Object', { make: function(proto, mixin){ return define(create(proto), mixin); } }); /***/ }, /* 177 */ /***/ function(module, exports, __webpack_require__) { 'use strict'; __webpack_require__(99)(Number, 'Number', function(iterated){ this._l = +iterated; this._i = 0; }, function(){ var i = this._i++ , done = !(i < this._l); return {done: done, value: done ? undefined : i}; }); /***/ }, /* 178 */ /***/ function(module, exports, __webpack_require__) { 'use strict'; var $def = __webpack_require__(12) , $re = __webpack_require__(154)(/[&<>"']/g, { '&': '&amp;', '<': '&lt;', '>': '&gt;', '"': '&quot;', "'": '&apos;' }); $def($def.P + $def.F, 'String', {escapeHTML: function escapeHTML(){ return $re(this); }}); /***/ }, /* 179 */ /***/ function(module, exports, __webpack_require__) { 'use strict'; var $def = __webpack_require__(12) , $re = __webpack_require__(154)(/&(?:amp|lt|gt|quot|apos);/g, { '&amp;': '&', '&lt;': '<', '&gt;': '>', '&quot;': '"', '&apos;': "'" }); $def($def.P + $def.F, 'String', {unescapeHTML: function unescapeHTML(){ return $re(this); }}); /***/ }, /* 180 */ /***/ function(module, exports, __webpack_require__) { var $ = __webpack_require__(2) , global = __webpack_require__(7) , $def = __webpack_require__(12) , log = {} , enabled = true; // Methods from https://github.com/DeveloperToolsWG/console-object/blob/master/api.md $.each.call(('assert,clear,count,debug,dir,dirxml,error,exception,' + 'group,groupCollapsed,groupEnd,info,isIndependentlyComposed,log,' + 'markTimeline,profile,profileEnd,table,time,timeEnd,timeline,' + 'timelineEnd,timeStamp,trace,warn').split(','), function(key){ log[key] = function(){ var $console = global.console; if(enabled && $console && $console[key]){ return Function.apply.call($console[key], $console, arguments); } }; }); $def($def.G + $def.F, {log: __webpack_require__(39)(log.log, log, { enable: function(){ enabled = true; }, disable: function(){ enabled = false; } })}); /***/ }, /* 181 */ /***/ function(module, exports, __webpack_require__) { // JavaScript 1.6 / Strawman array statics shim var $ = __webpack_require__(2) , $def = __webpack_require__(12) , $Array = __webpack_require__(13).Array || Array , statics = {}; var setStatics = function(keys, length){ $.each.call(keys.split(','), function(key){ if(length == undefined && key in $Array)statics[key] = $Array[key]; else if(key in [])statics[key] = __webpack_require__(16)(Function.call, [][key], length); }); }; setStatics('pop,reverse,shift,keys,values,entries', 1); setStatics('indexOf,every,some,forEach,map,filter,find,findIndex,includes', 3); setStatics('join,slice,concat,push,splice,unshift,sort,lastIndexOf,' + 'reduce,reduceRight,copyWithin,fill'); $def($def.S, 'Array', statics); /***/ } /******/ ]); // CommonJS export if(typeof module != 'undefined' && module.exports)module.exports = __e; // RequireJS export else if(typeof define == 'function' && define.amd)define(function(){return __e}); // Export to global object else __g.core = __e; }(1, 1);
src/server.js
mkuipers/terra-mystica
/* * React.js Starter Kit * Copyright (c) 2014 Konstantin Tarkus (@koistya), KriaSoft LLC. * * This source code is licensed under the MIT license found in the * LICENSE.txt file in the root directory of this source tree. */ 'use strict'; import _ from 'lodash'; import fs from 'fs'; import path from 'path'; import express from 'express'; import React from 'react'; import Dispatcher from './core/Dispatcher'; import ActionTypes from './constants/ActionTypes'; import AppStore from './stores/AppStore'; var server = express(); server.set('port', (process.env.PORT || 5000)); server.use(express.static(path.join(__dirname))); // // Page API // ----------------------------------------------------------------------------- server.get('/api/page/*', function(req, res) { var urlPath = req.path.substr(9); var page = AppStore.getPage(urlPath); res.send(page); }); // // Server-side rendering // ----------------------------------------------------------------------------- // The top-level React component + HTML template for it var App = React.createFactory(require('./components/App')); var templateFile = path.join(__dirname, 'templates/index.html'); var template = _.template(fs.readFileSync(templateFile, 'utf8')); server.get('*', function(req, res) { var data = {description: ''}; var app = new App({ path: req.path, onSetTitle: function(title) { data.title = title; }, onSetMeta: function(name, content) { data[name] = content; }, onPageNotFound: function() { res.status(404); } }); data.body = React.renderToString(app); var html = template(data); res.send(html); }); // Load pages from the `/src/content/` folder into the AppStore (function() { var assign = require('react/lib/Object.assign'); var fm = require('front-matter'); var jade = require('jade'); var sourceDir = path.join(__dirname, './content'); var getFiles = function(dir) { var pages = []; fs.readdirSync(dir).forEach(function(file) { var stat = fs.statSync(path.join(dir, file)); if (stat && stat.isDirectory()) { pages = pages.concat(getFiles(file)); } else { // Convert the file to a Page object var filename = path.join(dir, file); var url = filename. substr(sourceDir.length, filename.length - sourceDir.length - 5) .replace('\\', '/'); if (url.indexOf('/index', url.length - 6) !== -1) { url = url.substr(0, url.length - (url.length > 6 ? 6 : 5)); } var source = fs.readFileSync(filename, 'utf8'); var content = fm(source); var html = jade.render(content.body, null, ' '); var page = assign({}, {path: url, body: html}, content.attributes); Dispatcher.handleServerAction({ actionType: ActionTypes.LOAD_PAGE, path: url, page: page }); } }); return pages; }; return getFiles(sourceDir); })(); server.listen(server.get('port'), function() { if (process.send) { process.send('online'); } else { console.log('The server is running at http://localhost:' + server.get('port')); } });
ajax/libs/analytics.js/2.3.10/analytics.min.js
fbender/cdnjs
(function outer(modules,cache,entries){var global=function(){return this}();function require(name,jumped){if(cache[name])return cache[name].exports;if(modules[name])return call(name,require);throw new Error('cannot find module "'+name+'"')}function call(id,require){var m=cache[id]={exports:{}};var mod=modules[id];var name=mod[2];var fn=mod[0];fn.call(m.exports,function(req){var dep=modules[id][1][req];return require(dep?dep:req)},m,m.exports,outer,modules,cache,entries);if(name)cache[name]=cache[id];return cache[id].exports}for(var id in entries){if(entries[id]){global[entries[id]]=require(id)}else{require(id)}}require.duo=true;require.cache=cache;require.modules=modules;return require})({1:[function(require,module,exports){var Integrations=require("analytics.js-integrations");var Analytics=require("./analytics");var each=require("each");var analytics=module.exports=exports=new Analytics;analytics.require=require;exports.VERSION=require("./version");each(Integrations,function(name,Integration){analytics.use(Integration)})},{"analytics.js-integrations":2,"./analytics":3,each:4,"./version":5}],2:[function(require,module,exports){var each=require("each");var plugins=require("./integrations.js");each(plugins,function(plugin){var name=(plugin.Integration||plugin).prototype.name;exports[name]=plugin})},{each:4,"./integrations.js":6}],4:[function(require,module,exports){var type=require("type");var has=Object.prototype.hasOwnProperty;module.exports=function(obj,fn){switch(type(obj)){case"array":return array(obj,fn);case"object":if("number"==typeof obj.length)return array(obj,fn);return object(obj,fn);case"string":return string(obj,fn)}};function string(obj,fn){for(var i=0;i<obj.length;++i){fn(obj.charAt(i),i)}}function object(obj,fn){for(var key in obj){if(has.call(obj,key)){fn(key,obj[key])}}}function array(obj,fn){for(var i=0;i<obj.length;++i){fn(obj[i],i)}}},{type:7}],7:[function(require,module,exports){var toString=Object.prototype.toString;module.exports=function(val){switch(toString.call(val)){case"[object Function]":return"function";case"[object Date]":return"date";case"[object RegExp]":return"regexp";case"[object Arguments]":return"arguments";case"[object Array]":return"array";case"[object String]":return"string"}if(val===null)return"null";if(val===undefined)return"undefined";if(val&&val.nodeType===1)return"element";if(val===Object(val))return"object";return typeof val}},{}],6:[function(require,module,exports){module.exports=[require("./lib/adroll"),require("./lib/adwords"),require("./lib/alexa"),require("./lib/amplitude"),require("./lib/appcues"),require("./lib/awesm"),require("./lib/awesomatic"),require("./lib/bing-ads"),require("./lib/bronto"),require("./lib/bugherd"),require("./lib/bugsnag"),require("./lib/chartbeat"),require("./lib/churnbee"),require("./lib/clicktale"),require("./lib/clicky"),require("./lib/comscore"),require("./lib/crazy-egg"),require("./lib/curebit"),require("./lib/customerio"),require("./lib/drip"),require("./lib/errorception"),require("./lib/evergage"),require("./lib/facebook-conversion-tracking"),require("./lib/foxmetrics"),require("./lib/frontleaf"),require("./lib/gauges"),require("./lib/get-satisfaction"),require("./lib/google-analytics"),require("./lib/google-tag-manager"),require("./lib/gosquared"),require("./lib/heap"),require("./lib/hellobar"),require("./lib/hittail"),require("./lib/hublo"),require("./lib/hubspot"),require("./lib/improvely"),require("./lib/insidevault"),require("./lib/inspectlet"),require("./lib/intercom"),require("./lib/keen-io"),require("./lib/kenshoo"),require("./lib/kissmetrics"),require("./lib/klaviyo"),require("./lib/leadlander"),require("./lib/livechat"),require("./lib/lucky-orange"),require("./lib/lytics"),require("./lib/mixpanel"),require("./lib/mojn"),require("./lib/mouseflow"),require("./lib/mousestats"),require("./lib/navilytics"),require("./lib/olark"),require("./lib/optimizely"),require("./lib/perfect-audience"),require("./lib/pingdom"),require("./lib/piwik"),require("./lib/preact"),require("./lib/qualaroo"),require("./lib/quantcast"),require("./lib/rollbar"),require("./lib/saasquatch"),require("./lib/sentry"),require("./lib/snapengage"),require("./lib/spinnakr"),require("./lib/tapstream"),require("./lib/trakio"),require("./lib/twitter-ads"),require("./lib/usercycle"),require("./lib/userfox"),require("./lib/uservoice"),require("./lib/vero"),require("./lib/visual-website-optimizer"),require("./lib/webengage"),require("./lib/woopra"),require("./lib/yandex-metrica")]},{"./lib/adroll":8,"./lib/adwords":9,"./lib/alexa":10,"./lib/amplitude":11,"./lib/appcues":12,"./lib/awesm":13,"./lib/awesomatic":14,"./lib/bing-ads":15,"./lib/bronto":16,"./lib/bugherd":17,"./lib/bugsnag":18,"./lib/chartbeat":19,"./lib/churnbee":20,"./lib/clicktale":21,"./lib/clicky":22,"./lib/comscore":23,"./lib/crazy-egg":24,"./lib/curebit":25,"./lib/customerio":26,"./lib/drip":27,"./lib/errorception":28,"./lib/evergage":29,"./lib/facebook-conversion-tracking":30,"./lib/foxmetrics":31,"./lib/frontleaf":32,"./lib/gauges":33,"./lib/get-satisfaction":34,"./lib/google-analytics":35,"./lib/google-tag-manager":36,"./lib/gosquared":37,"./lib/heap":38,"./lib/hellobar":39,"./lib/hittail":40,"./lib/hublo":41,"./lib/hubspot":42,"./lib/improvely":43,"./lib/insidevault":44,"./lib/inspectlet":45,"./lib/intercom":46,"./lib/keen-io":47,"./lib/kenshoo":48,"./lib/kissmetrics":49,"./lib/klaviyo":50,"./lib/leadlander":51,"./lib/livechat":52,"./lib/lucky-orange":53,"./lib/lytics":54,"./lib/mixpanel":55,"./lib/mojn":56,"./lib/mouseflow":57,"./lib/mousestats":58,"./lib/navilytics":59,"./lib/olark":60,"./lib/optimizely":61,"./lib/perfect-audience":62,"./lib/pingdom":63,"./lib/piwik":64,"./lib/preact":65,"./lib/qualaroo":66,"./lib/quantcast":67,"./lib/rollbar":68,"./lib/saasquatch":69,"./lib/sentry":70,"./lib/snapengage":71,"./lib/spinnakr":72,"./lib/tapstream":73,"./lib/trakio":74,"./lib/twitter-ads":75,"./lib/usercycle":76,"./lib/userfox":77,"./lib/uservoice":78,"./lib/vero":79,"./lib/visual-website-optimizer":80,"./lib/webengage":81,"./lib/woopra":82,"./lib/yandex-metrica":83}],8:[function(require,module,exports){var integration=require("analytics.js-integration");var snake=require("to-snake-case");var useHttps=require("use-https");var each=require("each");var is=require("is");var has=Object.prototype.hasOwnProperty;var AdRoll=module.exports=integration("AdRoll").assumesPageview().global("__adroll_loaded").global("adroll_adv_id").global("adroll_pix_id").global("adroll_custom_data").option("advId","").option("pixId","").tag("http",'<script src="http://a.adroll.com/j/roundtrip.js">').tag("https",'<script src="https://s.adroll.com/j/roundtrip.js">').mapping("events");AdRoll.prototype.initialize=function(page){window.adroll_adv_id=this.options.advId;window.adroll_pix_id=this.options.pixId;window.__adroll_loaded=true;var name=useHttps()?"https":"http";this.load(name,this.ready)};AdRoll.prototype.loaded=function(){return window.__adroll};AdRoll.prototype.page=function(page){var name=page.fullName();this.track(page.track(name))};AdRoll.prototype.track=function(track){var event=track.event();var user=this.analytics.user();var events=this.events(event);var total=track.revenue()||track.total()||0;var orderId=track.orderId()||0;each(events,function(event){var data={};if(user.id())data.user_id=user.id();data.adroll_conversion_value_in_dollars=total;data.order_id=orderId;data.adroll_segments=snake(event);window.__adroll.record_user(data)});if(!events.length){var data={};if(user.id())data.user_id=user.id();data.adroll_segments=snake(event);window.__adroll.record_user(data)}}},{"analytics.js-integration":84,"to-snake-case":85,"use-https":86,each:4,is:87}],84:[function(require,module,exports){var bind=require("bind");var callback=require("callback");var clone=require("clone");var debug=require("debug");var defaults=require("defaults");var protos=require("./protos");var slug=require("slug");var statics=require("./statics");module.exports=createIntegration;function createIntegration(name){function Integration(options){if(options&&options.addIntegration){return options.addIntegration(Integration)}this.debug=debug("analytics:integration:"+slug(name));this.options=defaults(clone(options)||{},this.defaults);this._queue=[];this.once("ready",bind(this,this.flush));Integration.emit("construct",this);this.ready=bind(this,this.ready);this._wrapInitialize();this._wrapPage();this._wrapTrack()}Integration.prototype.defaults={};Integration.prototype.globals=[];Integration.prototype.templates={};Integration.prototype.name=name;for(var key in statics)Integration[key]=statics[key];for(var key in protos)Integration.prototype[key]=protos[key];return Integration}},{bind:88,callback:89,clone:90,debug:91,defaults:92,"./protos":93,slug:94,"./statics":95}],88:[function(require,module,exports){var bind=require("bind"),bindAll=require("bind-all");module.exports=exports=bind;exports.all=bindAll;exports.methods=bindMethods;function bindMethods(obj,methods){methods=[].slice.call(arguments,1);for(var i=0,method;method=methods[i];i++){obj[method]=bind(obj,obj[method])}return obj}},{bind:96,"bind-all":97}],96:[function(require,module,exports){var slice=[].slice;module.exports=function(obj,fn){if("string"==typeof fn)fn=obj[fn];if("function"!=typeof fn)throw new Error("bind() requires a function");var args=slice.call(arguments,2);return function(){return fn.apply(obj,args.concat(slice.call(arguments)))}}},{}],97:[function(require,module,exports){try{var bind=require("bind");var type=require("type")}catch(e){var bind=require("bind-component");var type=require("type-component")}module.exports=function(obj){for(var key in obj){var val=obj[key];if(type(val)==="function")obj[key]=bind(obj,obj[key])}return obj}},{bind:96,type:7}],89:[function(require,module,exports){var next=require("next-tick");module.exports=callback;function callback(fn){if("function"===typeof fn)fn()}callback.async=function(fn,wait){if("function"!==typeof fn)return;if(!wait)return next(fn);setTimeout(fn,wait)};callback.sync=callback},{"next-tick":98}],98:[function(require,module,exports){"use strict";if(typeof setImmediate=="function"){module.exports=function(f){setImmediate(f)}}else if(typeof process!="undefined"&&typeof process.nextTick=="function"){module.exports=process.nextTick}else if(typeof window=="undefined"||window.ActiveXObject||!window.postMessage){module.exports=function(f){setTimeout(f)}}else{var q=[];window.addEventListener("message",function(){var i=0;while(i<q.length){try{q[i++]()}catch(e){q=q.slice(i);window.postMessage("tic!","*");throw e}}q.length=0},true);module.exports=function(fn){if(!q.length)window.postMessage("tic!","*");q.push(fn)}}},{}],90:[function(require,module,exports){var type;try{type=require("type")}catch(e){type=require("type-component")}module.exports=clone;function clone(obj){switch(type(obj)){case"object":var copy={};for(var key in obj){if(obj.hasOwnProperty(key)){copy[key]=clone(obj[key])}}return copy;case"array":var copy=new Array(obj.length);for(var i=0,l=obj.length;i<l;i++){copy[i]=clone(obj[i])}return copy;case"regexp":var flags="";flags+=obj.multiline?"m":"";flags+=obj.global?"g":"";flags+=obj.ignoreCase?"i":"";return new RegExp(obj.source,flags);case"date":return new Date(obj.getTime());default:return obj}}},{type:7}],91:[function(require,module,exports){if("undefined"==typeof window){module.exports=require("./lib/debug")}else{module.exports=require("./debug")}},{"./lib/debug":99,"./debug":100}],99:[function(require,module,exports){var tty=require("tty");module.exports=debug;var names=[],skips=[];(process.env.DEBUG||"").split(/[\s,]+/).forEach(function(name){name=name.replace("*",".*?");if(name[0]==="-"){skips.push(new RegExp("^"+name.substr(1)+"$"))}else{names.push(new RegExp("^"+name+"$"))}});var colors=[6,2,3,4,5,1];var prev={};var prevColor=0;var isatty=tty.isatty(2);function color(){return colors[prevColor++%colors.length]}function humanize(ms){var sec=1e3,min=60*1e3,hour=60*min;if(ms>=hour)return(ms/hour).toFixed(1)+"h";if(ms>=min)return(ms/min).toFixed(1)+"m";if(ms>=sec)return(ms/sec|0)+"s";return ms+"ms"}function debug(name){function disabled(){}disabled.enabled=false;var match=skips.some(function(re){return re.test(name)});if(match)return disabled;match=names.some(function(re){return re.test(name)});if(!match)return disabled;var c=color();function colored(fmt){fmt=coerce(fmt);var curr=new Date;var ms=curr-(prev[name]||curr);prev[name]=curr;fmt=" [9"+c+"m"+name+" "+"[3"+c+"m"+fmt+"[3"+c+"m"+" +"+humanize(ms)+"";console.error.apply(this,arguments)}function plain(fmt){fmt=coerce(fmt);fmt=(new Date).toUTCString()+" "+name+" "+fmt;console.error.apply(this,arguments)}colored.enabled=plain.enabled=true;return isatty||process.env.DEBUG_COLORS?colored:plain}function coerce(val){if(val instanceof Error)return val.stack||val.message;return val}},{}],100:[function(require,module,exports){module.exports=debug;function debug(name){if(!debug.enabled(name))return function(){};return function(fmt){fmt=coerce(fmt);var curr=new Date;var ms=curr-(debug[name]||curr);debug[name]=curr;fmt=name+" "+fmt+" +"+debug.humanize(ms);window.console&&console.log&&Function.prototype.apply.call(console.log,console,arguments)}}debug.names=[];debug.skips=[];debug.enable=function(name){try{localStorage.debug=name}catch(e){}var split=(name||"").split(/[\s,]+/),len=split.length;for(var i=0;i<len;i++){name=split[i].replace("*",".*?");if(name[0]==="-"){debug.skips.push(new RegExp("^"+name.substr(1)+"$"))}else{debug.names.push(new RegExp("^"+name+"$"))}}};debug.disable=function(){debug.enable("")};debug.humanize=function(ms){var sec=1e3,min=60*1e3,hour=60*min;if(ms>=hour)return(ms/hour).toFixed(1)+"h";if(ms>=min)return(ms/min).toFixed(1)+"m";if(ms>=sec)return(ms/sec|0)+"s";return ms+"ms"};debug.enabled=function(name){for(var i=0,len=debug.skips.length;i<len;i++){if(debug.skips[i].test(name)){return false}}for(var i=0,len=debug.names.length;i<len;i++){if(debug.names[i].test(name)){return true}}return false};function coerce(val){if(val instanceof Error)return val.stack||val.message;return val}try{if(window.localStorage)debug.enable(localStorage.debug)}catch(e){}},{}],92:[function(require,module,exports){"use strict";var defaults=function(dest,src,recursive){for(var prop in src){if(recursive&&dest[prop]instanceof Object&&src[prop]instanceof Object){dest[prop]=defaults(dest[prop],src[prop],true)}else if(!(prop in dest)){dest[prop]=src[prop]}}return dest};module.exports=defaults},{}],93:[function(require,module,exports){var loadScript=require("segmentio/load-script");var normalize=require("to-no-case");var callback=require("callback");var Emitter=require("emitter");var events=require("./events");var tick=require("next-tick");var assert=require("assert");var after=require("after");var each=require("component/each");var type=require("type");var fmt=require("yields/fmt");var setTimeout=window.setTimeout;var setInterval=window.setInterval;var onerror=null;var onload=null;Emitter(exports);exports.initialize=function(){var ready=this.ready;tick(ready)};exports.loaded=function(){return false};exports.load=function(cb){callback.async(cb)};exports.page=function(page){};exports.track=function(track){};exports.map=function(obj,str){var a=normalize(str);var ret=[];if(!obj)return ret;if("object"==type(obj)){for(var k in obj){var item=obj[k];var b=normalize(k);if(b==a)ret.push(item)}}if("array"==type(obj)){if(!obj.length)return ret;if(!obj[0].key)return ret;for(var i=0;i<obj.length;++i){var item=obj[i];var b=normalize(item.key);if(b==a)ret.push(item.value)}}return ret};exports.invoke=function(method){if(!this[method])return;var args=[].slice.call(arguments,1);if(!this._ready)return this.queue(method,args);var ret;try{this.debug("%s with %o",method,args);ret=this[method].apply(this,args)}catch(e){this.debug("error %o calling %s with %o",e,method,args)}return ret};exports.queue=function(method,args){if("page"==method&&this._assumesPageview&&!this._initialized){return this.page.apply(this,args)}this._queue.push({method:method,args:args})};exports.flush=function(){this._ready=true;var call;while(call=this._queue.shift())this[call.method].apply(this,call.args)};exports.reset=function(){for(var i=0,key;key=this.globals[i];i++)window[key]=undefined;window.setTimeout=setTimeout;window.setInterval=setInterval;window.onerror=onerror;window.onload=onload};exports.load=function(name,locals,fn){if("function"==typeof name)fn=name,locals=null,name=null;if(name&&"object"==typeof name)fn=locals,locals=name,name=null;if("function"==typeof locals)fn=locals,locals=null;name=name||"library";locals=locals||{};locals=this.locals(locals);var template=this.templates[name];assert(template,fmt('Template "%s" not defined.',name));var attrs=render(template,locals);var el;switch(template.type){case"img":attrs.width=1;attrs.height=1;el=loadImage(attrs,fn);break;case"script":el=loadScript(attrs,fn);delete attrs.src;each(attrs,function(key,val){el.setAttribute(key,val)});break;case"iframe":el=loadIframe(attrs,fn);break}return el};exports.locals=function(locals){locals=locals||{};var cache=Math.floor((new Date).getTime()/36e5);if(!locals.hasOwnProperty("cache"))locals.cache=cache;each(this.options,function(key,val){if(!locals.hasOwnProperty(key))locals[key]=val});return locals};exports.ready=function(){this.emit("ready")};exports._wrapInitialize=function(){var initialize=this.initialize;this.initialize=function(){this.debug("initialize");this._initialized=true;var ret=initialize.apply(this,arguments);this.emit("initialize");return ret};if(this._assumesPageview)this.initialize=after(2,this.initialize)};exports._wrapPage=function(){var page=this.page;this.page=function(){if(this._assumesPageview&&!this._initialized){return this.initialize.apply(this,arguments)}return page.apply(this,arguments)}};exports._wrapTrack=function(){var t=this.track;this.track=function(track){var event=track.event();var called;var ret;for(var method in events){var regexp=events[method];if(!this[method])continue;if(!regexp.test(event))continue;ret=this[method].apply(this,arguments);called=true;break}if(!called)ret=t.apply(this,arguments);return ret}};function loadImage(attrs,fn){fn=fn||function(){};var img=new Image;img.onerror=error(fn,"failed to load pixel",img);img.onload=function(){fn()};img.src=attrs.src;img.width=1;img.height=1;return img}function error(fn,message,img){return function(e){e=e||window.event;var err=new Error(message);err.event=e;err.source=img;fn(err)}}function render(template,locals){var attrs={};each(template.attrs,function(key,val){attrs[key]=val.replace(/\{\{\ *(\w+)\ *\}\}/g,function(_,$1){return locals[$1]})});return attrs}},{"segmentio/load-script":101,"to-no-case":102,callback:89,emitter:103,"./events":104,"next-tick":98,assert:105,after:106,"component/each":107,type:7,"yields/fmt":108}],101:[function(require,module,exports){var onload=require("script-onload");var tick=require("next-tick");var type=require("type");module.exports=function loadScript(options,fn){if(!options)throw new Error("Cant load nothing...");if("string"==type(options))options={src:options};var https=document.location.protocol==="https:"||document.location.protocol==="chrome-extension:";if(options.src&&options.src.indexOf("//")===0){options.src=https?"https:"+options.src:"http:"+options.src}if(https&&options.https)options.src=options.https;else if(!https&&options.http)options.src=options.http;var script=document.createElement("script");script.type="text/javascript";script.async=true;script.src=options.src;if("function"==type(fn)){onload(script,fn)}tick(function(){var firstScript=document.getElementsByTagName("script")[0];firstScript.parentNode.insertBefore(script,firstScript)});return script}},{"script-onload":109,"next-tick":98,type:7}],109:[function(require,module,exports){module.exports=function(el,fn){return el.addEventListener?add(el,fn):attach(el,fn)};function add(el,fn){el.addEventListener("load",function(_,e){fn(null,e)},false);el.addEventListener("error",function(e){var err=new Error('failed to load the script "'+el.src+'"');err.event=e;fn(err)},false)}function attach(el,fn){el.attachEvent("onreadystatechange",function(e){if(!/complete|loaded/.test(el.readyState))return;fn(null,e)})}},{}],102:[function(require,module,exports){module.exports=toNoCase;var hasSpace=/\s/;var hasSeparator=/[\W_]/;function toNoCase(string){if(hasSpace.test(string))return string.toLowerCase();if(hasSeparator.test(string))return unseparate(string).toLowerCase();return uncamelize(string).toLowerCase()}var separatorSplitter=/[\W_]+(.|$)/g;function unseparate(string){return string.replace(separatorSplitter,function(m,next){return next?" "+next:""})}var camelSplitter=/(.)([A-Z]+)/g;function uncamelize(string){return string.replace(camelSplitter,function(m,previous,uppers){return previous+" "+uppers.toLowerCase().split("").join(" ")})}},{}],103:[function(require,module,exports){var index=require("indexof");module.exports=Emitter;function Emitter(obj){if(obj)return mixin(obj)}function mixin(obj){for(var key in Emitter.prototype){obj[key]=Emitter.prototype[key]}return obj}Emitter.prototype.on=Emitter.prototype.addEventListener=function(event,fn){this._callbacks=this._callbacks||{};(this._callbacks[event]=this._callbacks[event]||[]).push(fn);return this};Emitter.prototype.once=function(event,fn){var self=this;this._callbacks=this._callbacks||{};function on(){self.off(event,on);fn.apply(this,arguments)}fn._off=on;this.on(event,on);return this};Emitter.prototype.off=Emitter.prototype.removeListener=Emitter.prototype.removeAllListeners=Emitter.prototype.removeEventListener=function(event,fn){this._callbacks=this._callbacks||{};if(0==arguments.length){this._callbacks={};return this}var callbacks=this._callbacks[event];if(!callbacks)return this;if(1==arguments.length){delete this._callbacks[event];return this}var i=index(callbacks,fn._off||fn);if(~i)callbacks.splice(i,1);return this};Emitter.prototype.emit=function(event){this._callbacks=this._callbacks||{};var args=[].slice.call(arguments,1),callbacks=this._callbacks[event];if(callbacks){callbacks=callbacks.slice(0);for(var i=0,len=callbacks.length;i<len;++i){callbacks[i].apply(this,args)}}return this};Emitter.prototype.listeners=function(event){this._callbacks=this._callbacks||{};return this._callbacks[event]||[]};Emitter.prototype.hasListeners=function(event){return!!this.listeners(event).length}},{indexof:110}],110:[function(require,module,exports){module.exports=function(arr,obj){if(arr.indexOf)return arr.indexOf(obj);for(var i=0;i<arr.length;++i){if(arr[i]===obj)return i}return-1}},{}],104:[function(require,module,exports){module.exports={removedProduct:/removed[ _]?product/i,viewedProduct:/viewed[ _]?product/i,addedProduct:/added[ _]?product/i,completedOrder:/completed[ _]?order/i}},{}],105:[function(require,module,exports){var equals=require("equals");var fmt=require("fmt");var stack=require("stack");module.exports=exports=function(expr,msg){if(expr)return;throw new Error(msg||message())};exports.equal=function(actual,expected,msg){if(actual==expected)return;throw new Error(msg||fmt("Expected %o to equal %o.",actual,expected))};exports.notEqual=function(actual,expected,msg){if(actual!=expected)return;throw new Error(msg||fmt("Expected %o not to equal %o.",actual,expected))};exports.deepEqual=function(actual,expected,msg){if(equals(actual,expected))return;throw new Error(msg||fmt("Expected %o to deeply equal %o.",actual,expected))};exports.notDeepEqual=function(actual,expected,msg){if(!equals(actual,expected))return;throw new Error(msg||fmt("Expected %o not to deeply equal %o.",actual,expected))};exports.strictEqual=function(actual,expected,msg){if(actual===expected)return;throw new Error(msg||fmt("Expected %o to strictly equal %o.",actual,expected))};exports.notStrictEqual=function(actual,expected,msg){if(actual!==expected)return;throw new Error(msg||fmt("Expected %o not to strictly equal %o.",actual,expected))};exports.throws=function(block,error,msg){var err;try{block()}catch(e){err=e}if(!err)throw new Error(msg||fmt("Expected %s to throw an error.",block.toString()));if(error&&!(err instanceof error)){throw new Error(msg||fmt("Expected %s to throw an %o.",block.toString(),error))}};exports.doesNotThrow=function(block,error,msg){var err;try{block()}catch(e){err=e}if(err)throw new Error(msg||fmt("Expected %s not to throw an error.",block.toString()));if(error&&err instanceof error){throw new Error(msg||fmt("Expected %s not to throw an %o.",block.toString(),error))}};function message(){if(!Error.captureStackTrace)return"assertion failed";var callsite=stack()[2];var fn=callsite.getFunctionName();var file=callsite.getFileName();var line=callsite.getLineNumber()-1;var col=callsite.getColumnNumber()-1;var src=get(file);line=src.split("\n")[line].slice(col);var m=line.match(/assert\((.*)\)/);return m&&m[1].trim()}function get(script){var xhr=new XMLHttpRequest;xhr.open("GET",script,false);xhr.send(null);return xhr.responseText}},{equals:111,fmt:108,stack:112}],111:[function(require,module,exports){var type=require("type");module.exports=equals;equals.compare=compare;function equals(){var i=arguments.length-1;while(i>0){if(!compare(arguments[i],arguments[--i]))return false}return true}function compare(a,b,memos){if(a===b)return true;var fnA=types[type(a)];var fnB=types[type(b)];return fnA&&fnA===fnB?fnA(a,b,memos):false}var types={};types.number=function(a){return a!==a};types["function"]=function(a,b,memos){return a.toString()===b.toString()&&types.object(a,b,memos)&&compare(a.prototype,b.prototype)};types.date=function(a,b){return+a===+b};types.regexp=function(a,b){return a.toString()===b.toString()};types.element=function(a,b){return a.outerHTML===b.outerHTML};types.textnode=function(a,b){return a.textContent===b.textContent};function memoGaurd(fn){return function(a,b,memos){if(!memos)return fn(a,b,[]);var i=memos.length,memo;while(memo=memos[--i]){if(memo[0]===a&&memo[1]===b)return true}return fn(a,b,memos)}}types["arguments"]=types.array=memoGaurd(compareArrays);function compareArrays(a,b,memos){var i=a.length;if(i!==b.length)return false;memos.push([a,b]);while(i--){if(!compare(a[i],b[i],memos))return false}return true}types.object=memoGaurd(compareObjects);function compareObjects(a,b,memos){var ka=getEnumerableProperties(a);var kb=getEnumerableProperties(b);var i=ka.length;if(i!==kb.length)return false;ka.sort();kb.sort();while(i--)if(ka[i]!==kb[i])return false;memos.push([a,b]);i=ka.length;while(i--){var key=ka[i];if(!compare(a[key],b[key],memos))return false}return true}function getEnumerableProperties(object){var result=[];for(var k in object)if(k!=="constructor"){result.push(k)}return result}},{type:113}],113:[function(require,module,exports){var toString={}.toString;var DomNode=typeof window!="undefined"?window.Node:Function;module.exports=exports=function(x){var type=typeof x;if(type!="object")return type;type=types[toString.call(x)];if(type)return type;if(x instanceof DomNode)switch(x.nodeType){case 1:return"element";case 3:return"text-node";case 9:return"document";case 11:return"document-fragment";default:return"dom-node"}};var types=exports.types={"[object Function]":"function","[object Date]":"date","[object RegExp]":"regexp","[object Arguments]":"arguments","[object Array]":"array","[object String]":"string","[object Null]":"null","[object Undefined]":"undefined","[object Number]":"number","[object Boolean]":"boolean","[object Object]":"object","[object Text]":"text-node","[object Uint8Array]":"bit-array","[object Uint16Array]":"bit-array","[object Uint32Array]":"bit-array","[object Uint8ClampedArray]":"bit-array","[object Error]":"error","[object FormData]":"form-data","[object File]":"file","[object Blob]":"blob"}},{}],108:[function(require,module,exports){module.exports=fmt;fmt.o=JSON.stringify;fmt.s=String;fmt.d=parseInt;function fmt(str){var args=[].slice.call(arguments,1);var j=0;return str.replace(/%([a-z])/gi,function(_,f){return fmt[f]?fmt[f](args[j++]):_+f})}},{}],112:[function(require,module,exports){module.exports=stack;function stack(){var orig=Error.prepareStackTrace;Error.prepareStackTrace=function(_,stack){return stack};var err=new Error;Error.captureStackTrace(err,arguments.callee);var stack=err.stack;Error.prepareStackTrace=orig;return stack}},{}],106:[function(require,module,exports){module.exports=function after(times,func){if(times<=0)return func();return function(){if(--times<1){return func.apply(this,arguments)}}}},{}],107:[function(require,module,exports){try{var type=require("type")}catch(err){var type=require("component-type")}var toFunction=require("to-function");var has=Object.prototype.hasOwnProperty;module.exports=function(obj,fn,ctx){fn=toFunction(fn);ctx=ctx||this;switch(type(obj)){case"array":return array(obj,fn,ctx);case"object":if("number"==typeof obj.length)return array(obj,fn,ctx);return object(obj,fn,ctx);case"string":return string(obj,fn,ctx)}};function string(obj,fn,ctx){for(var i=0;i<obj.length;++i){fn.call(ctx,obj.charAt(i),i)}}function object(obj,fn,ctx){for(var key in obj){if(has.call(obj,key)){fn.call(ctx,key,obj[key])}}}function array(obj,fn,ctx){for(var i=0;i<obj.length;++i){fn.call(ctx,obj[i],i)}}},{type:7,"component-type":7,"to-function":114}],114:[function(require,module,exports){var expr;try{expr=require("props")}catch(e){expr=require("component-props")}module.exports=toFunction;function toFunction(obj){switch({}.toString.call(obj)){case"[object Object]":return objectToFunction(obj);case"[object Function]":return obj;case"[object String]":return stringToFunction(obj);case"[object RegExp]":return regexpToFunction(obj);default:return defaultToFunction(obj)}}function defaultToFunction(val){return function(obj){return val===obj}}function regexpToFunction(re){return function(obj){return re.test(obj)}}function stringToFunction(str){if(/^ *\W+/.test(str))return new Function("_","return _ "+str);return new Function("_","return "+get(str))}function objectToFunction(obj){var match={};for(var key in obj){match[key]=typeof obj[key]==="string"?defaultToFunction(obj[key]):toFunction(obj[key])}return function(val){if(typeof val!=="object")return false;for(var key in match){if(!(key in val))return false;if(!match[key](val[key]))return false}return true}}function get(str){var props=expr(str);if(!props.length)return"_."+str;var val,i,prop;for(i=0;i<props.length;i++){prop=props[i];val="_."+prop;val="('function' == typeof "+val+" ? "+val+"() : "+val+")";str=stripNested(prop,str,val)}return str}function stripNested(prop,str,val){return str.replace(new RegExp("(\\.)?"+prop,"g"),function($0,$1){return $1?$0:val})}},{props:115,"component-props":115}],115:[function(require,module,exports){var globals=/\b(this|Array|Date|Object|Math|JSON)\b/g;module.exports=function(str,fn){var p=unique(props(str));if(fn&&"string"==typeof fn)fn=prefixed(fn);if(fn)return map(str,p,fn);return p};function props(str){return str.replace(/\.\w+|\w+ *\(|"[^"]*"|'[^']*'|\/([^/]+)\//g,"").replace(globals,"").match(/[$a-zA-Z_]\w*/g)||[]}function map(str,props,fn){var re=/\.\w+|\w+ *\(|"[^"]*"|'[^']*'|\/([^/]+)\/|[a-zA-Z_]\w*/g;return str.replace(re,function(_){if("("==_[_.length-1])return fn(_);if(!~props.indexOf(_))return _;return fn(_)})}function unique(arr){var ret=[];for(var i=0;i<arr.length;i++){if(~ret.indexOf(arr[i]))continue;ret.push(arr[i])}return ret}function prefixed(str){return function(_){return str+_}}},{}],94:[function(require,module,exports){module.exports=function(str,options){options||(options={});return str.toLowerCase().replace(options.replace||/[^a-z0-9]/g," ").replace(/^ +| +$/g,"").replace(/ +/g,options.separator||"-")}},{}],95:[function(require,module,exports){var after=require("after");var domify=require("component/domify");var each=require("component/each");var Emitter=require("emitter");Emitter(exports);exports.option=function(key,value){this.prototype.defaults[key]=value;return this};exports.mapping=function(name){this.option(name,[]);this.prototype[name]=function(str){return this.map(this.options[name],str) };return this};exports.global=function(key){this.prototype.globals.push(key);return this};exports.assumesPageview=function(){this.prototype._assumesPageview=true;return this};exports.readyOnLoad=function(){this.prototype._readyOnLoad=true;return this};exports.readyOnInitialize=function(){this.prototype._readyOnInitialize=true;return this};exports.tag=function(name,str){if(null==str){str=name;name="library"}this.prototype.templates[name]=objectify(str);return this};function objectify(str){str=str.replace(' src="',' data-src="');var el=domify(str);var attrs={};each(el.attributes,function(attr){var name="data-src"==attr.name?"src":attr.name;attrs[name]=attr.value});return{type:el.tagName.toLowerCase(),attrs:attrs}}},{after:106,"component/domify":116,"component/each":107,emitter:103}],116:[function(require,module,exports){module.exports=parse;var div=document.createElement("div");div.innerHTML=' <link/><table></table><a href="/a">a</a><input type="checkbox"/>';var innerHTMLBug=!div.getElementsByTagName("link").length;div=undefined;var map={legend:[1,"<fieldset>","</fieldset>"],tr:[2,"<table><tbody>","</tbody></table>"],col:[2,"<table><tbody></tbody><colgroup>","</colgroup></table>"],_default:innerHTMLBug?[1,"X<div>","</div>"]:[0,"",""]};map.td=map.th=[3,"<table><tbody><tr>","</tr></tbody></table>"];map.option=map.optgroup=[1,'<select multiple="multiple">',"</select>"];map.thead=map.tbody=map.colgroup=map.caption=map.tfoot=[1,"<table>","</table>"];map.text=map.circle=map.ellipse=map.line=map.path=map.polygon=map.polyline=map.rect=[1,'<svg xmlns="http://www.w3.org/2000/svg" version="1.1">',"</svg>"];function parse(html,doc){if("string"!=typeof html)throw new TypeError("String expected");if(!doc)doc=document;var m=/<([\w:]+)/.exec(html);if(!m)return doc.createTextNode(html);html=html.replace(/^\s+|\s+$/g,"");var tag=m[1];if(tag=="body"){var el=doc.createElement("html");el.innerHTML=html;return el.removeChild(el.lastChild)}var wrap=map[tag]||map._default;var depth=wrap[0];var prefix=wrap[1];var suffix=wrap[2];var el=doc.createElement("div");el.innerHTML=prefix+html+suffix;while(depth--)el=el.lastChild;if(el.firstChild==el.lastChild){return el.removeChild(el.firstChild)}var fragment=doc.createDocumentFragment();while(el.firstChild){fragment.appendChild(el.removeChild(el.firstChild))}return fragment}},{}],85:[function(require,module,exports){var toSpace=require("to-space-case");module.exports=toSnakeCase;function toSnakeCase(string){return toSpace(string).replace(/\s/g,"_")}},{"to-space-case":117}],117:[function(require,module,exports){var clean=require("to-no-case");module.exports=toSpaceCase;function toSpaceCase(string){return clean(string).replace(/[\W_]+(.|$)/g,function(matches,match){return match?" "+match:""})}},{"to-no-case":118}],118:[function(require,module,exports){module.exports=toNoCase;var hasSpace=/\s/;var hasCamel=/[a-z][A-Z]/;var hasSeparator=/[\W_]/;function toNoCase(string){if(hasSpace.test(string))return string.toLowerCase();if(hasSeparator.test(string))string=unseparate(string);if(hasCamel.test(string))string=uncamelize(string);return string.toLowerCase()}var separatorSplitter=/[\W_]+(.|$)/g;function unseparate(string){return string.replace(separatorSplitter,function(m,next){return next?" "+next:""})}var camelSplitter=/(.)([A-Z]+)/g;function uncamelize(string){return string.replace(camelSplitter,function(m,previous,uppers){return previous+" "+uppers.toLowerCase().split("").join(" ")})}},{}],86:[function(require,module,exports){module.exports=function(url){switch(arguments.length){case 0:return check();case 1:return transform(url)}};function transform(url){return check()?"https:"+url:"http:"+url}function check(){return location.protocol=="https:"||location.protocol=="chrome-extension:"}},{}],87:[function(require,module,exports){var isEmpty=require("is-empty");try{var typeOf=require("type")}catch(e){var typeOf=require("component-type")}var types=["arguments","array","boolean","date","element","function","null","number","object","regexp","string","undefined"];for(var i=0,type;type=types[i];i++)exports[type]=generate(type);exports.fn=exports["function"];exports.empty=isEmpty;exports.nan=function(val){return exports.number(val)&&val!=val};function generate(type){return function(value){return type===typeOf(value)}}},{"is-empty":119,type:7,"component-type":7}],119:[function(require,module,exports){module.exports=isEmpty;var has=Object.prototype.hasOwnProperty;function isEmpty(val){if(null==val)return true;if("number"==typeof val)return 0===val;if(undefined!==val.length)return 0===val.length;for(var key in val)if(has.call(val,key))return false;return true}},{}],9:[function(require,module,exports){var integration=require("analytics.js-integration");var onbody=require("on-body");var domify=require("domify");var Queue=require("queue");var each=require("each");var has=Object.prototype.hasOwnProperty;var q=new Queue({concurrency:1,timeout:2e3});var AdWords=module.exports=integration("AdWords").option("conversionId","").option("remarketing",false).tag("conversion",'<script src="//www.googleadservices.com/pagead/conversion.js">').mapping("events");AdWords.prototype.initialize=function(){onbody(this.ready)};AdWords.prototype.loaded=function(){return!!document.body};AdWords.prototype.page=function(page){var remarketing=this.options.remarketing;var id=this.options.conversionId;if(remarketing)this.remarketing(id)};AdWords.prototype.track=function(track){var id=this.options.conversionId;var events=this.events(track.event());var revenue=track.revenue()||0;var self=this;each(events,function(label){self.conversion({conversionId:id,value:revenue,label:label})})};AdWords.prototype.conversion=function(obj,fn){this.enqueue({google_conversion_id:obj.conversionId,google_conversion_language:"en",google_conversion_format:"3",google_conversion_color:"ffffff",google_conversion_label:obj.label,google_conversion_value:obj.value,google_remarketing_only:false},fn)};AdWords.prototype.remarketing=function(id){this.enqueue({google_conversion_id:id,google_remarketing_only:true})};AdWords.prototype.enqueue=function(obj,fn){this.debug("sending %o",obj);var self=this;q.push(function(next){self.globalize(obj);self.shim();self.load("conversion",function(){if(fn)fn();next()})})};AdWords.prototype.globalize=function(obj){for(var name in obj){if(obj.hasOwnProperty(name)){window[name]=obj[name]}}};AdWords.prototype.shim=function(){var self=this;var write=document.write;document.write=append;function append(str){var el=domify(str);if(!el.src)return write(str);if(!/googleadservices/.test(el.src))return write(str);self.debug("append %o",el);document.body.appendChild(el);document.write=write}}},{"analytics.js-integration":84,"on-body":120,domify:121,queue:122,each:4}],120:[function(require,module,exports){var each=require("each");var body=false;var callbacks=[];module.exports=function onBody(callback){if(body){call(callback)}else{callbacks.push(callback)}};var interval=setInterval(function(){if(!document.body)return;body=true;each(callbacks,call);clearInterval(interval)},5);function call(callback){callback(document.body)}},{each:107}],121:[function(require,module,exports){module.exports=parse;var map={legend:[1,"<fieldset>","</fieldset>"],tr:[2,"<table><tbody>","</tbody></table>"],col:[2,"<table><tbody></tbody><colgroup>","</colgroup></table>"],_default:[0,"",""]};map.td=map.th=[3,"<table><tbody><tr>","</tr></tbody></table>"];map.option=map.optgroup=[1,'<select multiple="multiple">',"</select>"];map.thead=map.tbody=map.colgroup=map.caption=map.tfoot=[1,"<table>","</table>"];map.text=map.circle=map.ellipse=map.line=map.path=map.polygon=map.polyline=map.rect=[1,'<svg xmlns="http://www.w3.org/2000/svg" version="1.1">',"</svg>"];function parse(html){if("string"!=typeof html)throw new TypeError("String expected");html=html.replace(/^\s+|\s+$/g,"");var m=/<([\w:]+)/.exec(html);if(!m)return document.createTextNode(html);var tag=m[1];if(tag=="body"){var el=document.createElement("html");el.innerHTML=html;return el.removeChild(el.lastChild)}var wrap=map[tag]||map._default;var depth=wrap[0];var prefix=wrap[1];var suffix=wrap[2];var el=document.createElement("div");el.innerHTML=prefix+html+suffix;while(depth--)el=el.lastChild;if(el.firstChild==el.lastChild){return el.removeChild(el.firstChild)}var fragment=document.createDocumentFragment();while(el.firstChild){fragment.appendChild(el.removeChild(el.firstChild))}return fragment}},{}],122:[function(require,module,exports){var Emitter;var bind;try{Emitter=require("emitter");bind=require("bind")}catch(err){Emitter=require("component-emitter");bind=require("component-bind")}module.exports=Queue;function Queue(options){options=options||{};this.timeout=options.timeout||0;this.concurrency=options.concurrency||1;this.pending=0;this.jobs=[]}Emitter(Queue.prototype);Queue.prototype.length=function(){return this.pending+this.jobs.length};Queue.prototype.push=function(fn,cb){this.jobs.push([fn,cb]);setTimeout(bind(this,this.run),0)};Queue.prototype.run=function(){while(this.pending<this.concurrency){var job=this.jobs.shift();if(!job)break;this.exec(job)}};Queue.prototype.exec=function(job){var self=this;var ms=this.timeout;var fn=job[0];var cb=job[1];if(ms)fn=timeout(fn,ms);this.pending++;fn(function(err,res){cb&&cb(err,res);self.pending--;self.run()})};function timeout(fn,ms){return function(cb){var done;var id=setTimeout(function(){done=true;var err=new Error("Timeout of "+ms+"ms exceeded");err.timeout=timeout;cb(err)},ms);fn(function(err,res){if(done)return;clearTimeout(id);cb(err,res)})}}},{emitter:123,bind:96,"component-emitter":123,"component-bind":96}],123:[function(require,module,exports){module.exports=Emitter;function Emitter(obj){if(obj)return mixin(obj)}function mixin(obj){for(var key in Emitter.prototype){obj[key]=Emitter.prototype[key]}return obj}Emitter.prototype.on=Emitter.prototype.addEventListener=function(event,fn){this._callbacks=this._callbacks||{};(this._callbacks[event]=this._callbacks[event]||[]).push(fn);return this};Emitter.prototype.once=function(event,fn){var self=this;this._callbacks=this._callbacks||{};function on(){self.off(event,on);fn.apply(this,arguments)}on.fn=fn;this.on(event,on);return this};Emitter.prototype.off=Emitter.prototype.removeListener=Emitter.prototype.removeAllListeners=Emitter.prototype.removeEventListener=function(event,fn){this._callbacks=this._callbacks||{};if(0==arguments.length){this._callbacks={};return this}var callbacks=this._callbacks[event];if(!callbacks)return this;if(1==arguments.length){delete this._callbacks[event];return this}var cb;for(var i=0;i<callbacks.length;i++){cb=callbacks[i];if(cb===fn||cb.fn===fn){callbacks.splice(i,1);break}}return this};Emitter.prototype.emit=function(event){this._callbacks=this._callbacks||{};var args=[].slice.call(arguments,1),callbacks=this._callbacks[event];if(callbacks){callbacks=callbacks.slice(0);for(var i=0,len=callbacks.length;i<len;++i){callbacks[i].apply(this,args)}}return this};Emitter.prototype.listeners=function(event){this._callbacks=this._callbacks||{};return this._callbacks[event]||[]};Emitter.prototype.hasListeners=function(event){return!!this.listeners(event).length}},{}],10:[function(require,module,exports){var integration=require("analytics.js-integration");var Alexa=module.exports=integration("Alexa").assumesPageview().global("_atrk_opts").option("account",null).option("domain","").option("dynamic",true).tag('<script src="//d31qbv1cthcecs.cloudfront.net/atrk.js">');Alexa.prototype.initialize=function(page){var self=this;window._atrk_opts={atrk_acct:this.options.account,domain:this.options.domain,dynamic:this.options.dynamic};this.load(function(){window.atrk();self.ready()})};Alexa.prototype.loaded=function(){return!!window.atrk}},{"analytics.js-integration":84}],11:[function(require,module,exports){var integration=require("analytics.js-integration");var Amplitude=module.exports=integration("Amplitude").global("amplitude").option("apiKey","").option("trackAllPages",false).option("trackNamedPages",true).option("trackCategorizedPages",true).tag('<script src="https://d24n15hnbwhuhn.cloudfront.net/libs/amplitude-1.1-min.js">');Amplitude.prototype.initialize=function(page){(function(e,t){var r=e.amplitude||{};r._q=[];function i(e){r[e]=function(){r._q.push([e].concat(Array.prototype.slice.call(arguments,0)))}}var s=["init","logEvent","setUserId","setGlobalUserProperties","setVersionName","setDomain"];for(var c=0;c<s.length;c++){i(s[c])}e.amplitude=r})(window,document);window.amplitude.init(this.options.apiKey);this.load(this.ready)};Amplitude.prototype.loaded=function(){return!!(window.amplitude&&window.amplitude.options)};Amplitude.prototype.page=function(page){var properties=page.properties();var category=page.category();var name=page.fullName();var opts=this.options;if(opts.trackAllPages){this.track(page.track())}if(category&&opts.trackCategorizedPages){this.track(page.track(category))}if(name&&opts.trackNamedPages){this.track(page.track(name))}};Amplitude.prototype.identify=function(identify){var id=identify.userId();var traits=identify.traits();if(id)window.amplitude.setUserId(id);if(traits)window.amplitude.setGlobalUserProperties(traits)};Amplitude.prototype.track=function(track){var props=track.properties();var event=track.event();window.amplitude.logEvent(event,props)}},{"analytics.js-integration":84}],12:[function(require,module,exports){var integration=require("analytics.js-integration");var load=require("load-script");var is=require("is");module.exports=exports=function(analytics){analytics.addIntegration(Appcues)};var Appcues=exports.Integration=integration("Appcues").assumesPageview().global("Appcues").global("AppcuesIdentity").option("appcuesId","").option("userId","").option("userEmail","");Appcues.prototype.initialize=function(){this.load(function(){window.Appcues.init()})};Appcues.prototype.loaded=function(){return is.object(window.Appcues)};Appcues.prototype.load=function(callback){var script=load("//d2dubfq97s02eu.cloudfront.net/appcues-bundle.min.js",callback);script.setAttribute("data-appcues-id",this.options.appcuesId);script.setAttribute("data-user-id",this.options.userId);script.setAttribute("data-user-email",this.options.userEmail)};Appcues.prototype.identify=function(identify){window.Appcues.identify(identify.traits())}},{"analytics.js-integration":84,"load-script":124,is:87}],124:[function(require,module,exports){var onload=require("script-onload");var tick=require("next-tick");var type=require("type");module.exports=function loadScript(options,fn){if(!options)throw new Error("Cant load nothing...");if("string"==type(options))options={src:options};var https=document.location.protocol==="https:"||document.location.protocol==="chrome-extension:";if(options.src&&options.src.indexOf("//")===0){options.src=https?"https:"+options.src:"http:"+options.src}if(https&&options.https)options.src=options.https;else if(!https&&options.http)options.src=options.http;var script=document.createElement("script");script.type="text/javascript";script.async=true;script.src=options.src;if("function"==type(fn)){onload(script,fn)}tick(function(){var firstScript=document.getElementsByTagName("script")[0];firstScript.parentNode.insertBefore(script,firstScript)});return script}},{"script-onload":109,"next-tick":98,type:7}],13:[function(require,module,exports){var integration=require("analytics.js-integration");var each=require("each");var Awesm=module.exports=integration("awe.sm").assumesPageview().global("AWESM").option("apiKey","").tag('<script src="//widgets.awe.sm/v3/widgets.js?key={{ apiKey }}&async=true">').mapping("events");Awesm.prototype.initialize=function(page){window.AWESM={api_key:this.options.apiKey};this.load(this.ready)};Awesm.prototype.loaded=function(){return!!(window.AWESM&&window.AWESM._exists)};Awesm.prototype.track=function(track){var user=this.analytics.user();var goals=this.events(track.event());each(goals,function(goal){window.AWESM.convert(goal,track.cents(),null,user.id())})}},{"analytics.js-integration":84,each:4}],14:[function(require,module,exports){var integration=require("analytics.js-integration");var is=require("is");var noop=function(){};var onBody=require("on-body");var Awesomatic=module.exports=integration("Awesomatic").assumesPageview().global("Awesomatic").global("AwesomaticSettings").global("AwsmSetup").global("AwsmTmp").option("appId","").tag('<script src="https://1c817b7a15b6941337c0-dff9b5f4adb7ba28259631e99c3f3691.ssl.cf2.rackcdn.com/gen/embed.js">');Awesomatic.prototype.initialize=function(page){var self=this;var user=this.analytics.user();var id=user.id();var options=user.traits();options.appId=this.options.appId;if(id)options.user_id=id;this.load(function(){window.Awesomatic.initialize(options,function(){self.ready()})})};Awesomatic.prototype.loaded=function(){return is.object(window.Awesomatic)}},{"analytics.js-integration":84,is:87,"on-body":120}],15:[function(require,module,exports){var integration=require("analytics.js-integration");var onbody=require("on-body");var domify=require("domify");var extend=require("extend");var bind=require("bind");var when=require("when");var each=require("each");var has=Object.prototype.hasOwnProperty;var noop=function(){};var Bing=module.exports=integration("Bing Ads").option("siteId","").option("domainId","").tag('<script id="mstag_tops" src="//flex.msn.com/mstag/site/{{ siteId }}/mstag.js">').mapping("events");Bing.prototype.initialize=function(page){if(!window.mstag){window.mstag={loadTag:noop,time:(new Date).getTime(),_write:writeToAppend}}var self=this;onbody(function(){self.load(function(){var loaded=bind(self,self.loaded);when(loaded,self.ready)})})};Bing.prototype.loaded=function(){return!!(window.mstag&&window.mstag.loadTag!==noop)};Bing.prototype.track=function(track){var events=this.events(track.event());var revenue=track.revenue()||0;var self=this;each(events,function(goal){window.mstag.loadTag("analytics",{domainId:self.options.domainId,revenue:revenue,dedup:"1",type:"1",actionid:goal})})};function writeToAppend(str){var first=document.getElementsByTagName("script")[0];var el=domify(str);if("script"==el.tagName.toLowerCase()&&el.getAttribute("src")){var tmp=document.createElement("script");tmp.src=el.getAttribute("src");tmp.async=true;el=tmp}document.body.appendChild(el)}},{"analytics.js-integration":84,"on-body":120,domify:121,extend:125,bind:96,when:126,each:4}],125:[function(require,module,exports){module.exports=function extend(object){var args=Array.prototype.slice.call(arguments,1);for(var i=0,source;source=args[i];i++){if(!source)continue;for(var property in source){object[property]=source[property]}}return object}},{}],126:[function(require,module,exports){var callback=require("callback");module.exports=when;function when(condition,fn,interval){if(condition())return callback.async(fn);var ref=setInterval(function(){if(!condition())return;callback(fn);clearInterval(ref)},interval||10)}},{callback:89}],16:[function(require,module,exports){var integration=require("analytics.js-integration");var Identify=require("facade").Identify;var Track=require("facade").Track;var pixel=require("load-pixel")("http://app.bronto.com/public/");var qs=require("querystring");var each=require("each");var Bronto=module.exports=integration("Bronto").global("__bta").option("siteId","").option("host","").tag('<script src="//p.bm23.com/bta.js">');Bronto.prototype.initialize=function(page){var self=this;var params=qs.parse(window.location.search);if(!params._bta_tid&&!params._bta_c){this.debug("missing tracking URL parameters `_bta_tid` and `_bta_c`.")}this.load(function(){var opts=self.options;self.bta=new window.__bta(opts.siteId);if(opts.host)self.bta.setHost(opts.host);self.ready()})};Bronto.prototype.loaded=function(){return this.bta};Bronto.prototype.completedOrder=function(track){var user=this.analytics.user();var products=track.products();var props=track.properties();var items=[];var identify=new Identify({userId:user.id(),traits:user.traits()});var email=identify.email();each(products,function(product){var track=new Track({properties:product});items.push({item_id:track.id()||track.sku(),desc:product.description||track.name(),quantity:track.quantity(),amount:track.price()})});this.bta.addOrder({order_id:track.orderId(),email:email,items:items})}},{"analytics.js-integration":84,facade:127,"load-pixel":128,querystring:129,each:4}],127:[function(require,module,exports){var Facade=require("./facade");module.exports=Facade;Facade.Alias=require("./alias");Facade.Group=require("./group");Facade.Identify=require("./identify");Facade.Track=require("./track");Facade.Page=require("./page");Facade.Screen=require("./screen")},{"./facade":130,"./alias":131,"./group":132,"./identify":133,"./track":134,"./page":135,"./screen":136}],130:[function(require,module,exports){var clone=require("./utils").clone;var isEnabled=require("./is-enabled");var objCase=require("obj-case");var traverse=require("isodate-traverse");var newDate=require("new-date");module.exports=Facade;function Facade(obj){if(!obj.hasOwnProperty("timestamp"))obj.timestamp=new Date;else obj.timestamp=newDate(obj.timestamp);traverse(obj);this.obj=obj}Facade.prototype.proxy=function(field){var fields=field.split(".");field=fields.shift();var obj=this[field]||this.field(field);if(!obj)return obj;if(typeof obj==="function")obj=obj.call(this)||{};if(fields.length===0)return transform(obj);obj=objCase(obj,fields.join("."));return transform(obj)};Facade.prototype.field=function(field){var obj=this.obj[field];return transform(obj)};Facade.proxy=function(field){return function(){return this.proxy(field)}};Facade.field=function(field){return function(){return this.field(field)}};Facade.prototype.json=function(){var ret=clone(this.obj);if(this.type)ret.type=this.type();return ret};Facade.prototype.context=Facade.prototype.options=function(integration){var options=clone(this.obj.options||this.obj.context)||{};if(!integration)return clone(options);if(!this.enabled(integration))return;var integrations=this.integrations();var value=integrations[integration]||objCase(integrations,integration);if("boolean"==typeof value)value={};return value||{}};Facade.prototype.enabled=function(integration){var allEnabled=this.proxy("options.providers.all");if(typeof allEnabled!=="boolean")allEnabled=this.proxy("options.all");if(typeof allEnabled!=="boolean")allEnabled=this.proxy("integrations.all");if(typeof allEnabled!=="boolean")allEnabled=true;var enabled=allEnabled&&isEnabled(integration);var options=this.integrations();if(options.providers&&options.providers.hasOwnProperty(integration)){enabled=options.providers[integration]}if(options.hasOwnProperty(integration)){var settings=options[integration];if(typeof settings==="boolean"){enabled=settings}else{enabled=true}}return enabled?true:false};Facade.prototype.integrations=function(){return this.obj.integrations||this.proxy("options.providers")||this.options()};Facade.prototype.active=function(){var active=this.proxy("options.active");if(active===null||active===undefined)active=true;return active};Facade.prototype.sessionId=Facade.prototype.anonymousId=function(){return this.field("anonymousId")||this.field("sessionId")};Facade.prototype.groupId=Facade.proxy("options.groupId");Facade.prototype.traits=function(aliases){var ret=this.proxy("options.traits")||{};var id=this.userId();aliases=aliases||{};if(id)ret.id=id;for(var alias in aliases){var value=null==this[alias]?this.proxy("options.traits."+alias):this[alias]();if(null==value)continue;ret[aliases[alias]]=value;delete ret[alias]}return ret};Facade.prototype.library=function(){var library=this.proxy("options.library");if(!library)return{name:"unknown",version:null};if(typeof library==="string")return{name:library,version:null};return library};Facade.prototype.userId=Facade.field("userId");Facade.prototype.channel=Facade.field("channel");Facade.prototype.timestamp=Facade.field("timestamp");Facade.prototype.userAgent=Facade.proxy("options.userAgent");Facade.prototype.ip=Facade.proxy("options.ip");function transform(obj){var cloned=clone(obj);return cloned}},{"./utils":137,"./is-enabled":138,"obj-case":139,"isodate-traverse":140,"new-date":141}],137:[function(require,module,exports){try{exports.inherit=require("inherit");exports.clone=require("clone")}catch(e){exports.inherit=require("inherit-component");exports.clone=require("clone-component")}},{inherit:142,clone:143}],142:[function(require,module,exports){module.exports=function(a,b){var fn=function(){};fn.prototype=b.prototype;a.prototype=new fn;a.prototype.constructor=a}},{}],143:[function(require,module,exports){var type;try{type=require("component-type")}catch(_){type=require("type")}module.exports=clone;function clone(obj){switch(type(obj)){case"object":var copy={};for(var key in obj){if(obj.hasOwnProperty(key)){copy[key]=clone(obj[key])}}return copy;case"array":var copy=new Array(obj.length);for(var i=0,l=obj.length;i<l;i++){copy[i]=clone(obj[i])}return copy;case"regexp":var flags="";flags+=obj.multiline?"m":"";flags+=obj.global?"g":"";flags+=obj.ignoreCase?"i":"";return new RegExp(obj.source,flags);case"date":return new Date(obj.getTime());default:return obj}}},{"component-type":7,type:7}],138:[function(require,module,exports){var disabled={Salesforce:true};module.exports=function(integration){return!disabled[integration]}},{}],139:[function(require,module,exports){var Case=require("case");var identity=function(_){return _};var cases=[identity,Case.upper,Case.lower,Case.snake,Case.pascal,Case.camel,Case.constant,Case.title,Case.capital,Case.sentence];module.exports=module.exports.find=multiple(find);module.exports.replace=function(obj,key,val){multiple(replace).apply(this,arguments);return obj};module.exports.del=function(obj,key){multiple(del).apply(this,arguments);return obj};function multiple(fn){return function(obj,key,val){var keys=key.split(".");if(keys.length===0)return;while(keys.length>1){key=keys.shift();obj=find(obj,key);if(obj===null||obj===undefined)return}key=keys.shift();return fn(obj,key,val)}}function find(obj,key){for(var i=0;i<cases.length;i++){var cased=cases[i](key);if(obj.hasOwnProperty(cased))return obj[cased]}}function del(obj,key){for(var i=0;i<cases.length;i++){var cased=cases[i](key);if(obj.hasOwnProperty(cased))delete obj[cased]}return obj}function replace(obj,key,val){for(var i=0;i<cases.length;i++){var cased=cases[i](key);if(obj.hasOwnProperty(cased))obj[cased]=val}return obj}},{"case":144}],144:[function(require,module,exports){var cases=require("./cases");module.exports=exports=determineCase;function determineCase(string){for(var key in cases){if(key=="none")continue;var convert=cases[key];if(convert(string)==string)return key}return null}exports.add=function(name,convert){exports[name]=cases[name]=convert};for(var key in cases){exports.add(key,cases[key])}},{"./cases":145}],145:[function(require,module,exports){var camel=require("to-camel-case"),capital=require("to-capital-case"),constant=require("to-constant-case"),dot=require("to-dot-case"),none=require("to-no-case"),pascal=require("to-pascal-case"),sentence=require("to-sentence-case"),slug=require("to-slug-case"),snake=require("to-snake-case"),space=require("to-space-case"),title=require("to-title-case");exports.camel=camel;exports.pascal=pascal;exports.dot=dot;exports.slug=slug;exports.snake=snake;exports.space=space;exports.constant=constant;exports.capital=capital;exports.title=title;exports.sentence=sentence;exports.lower=function(string){return none(string).toLowerCase()};exports.upper=function(string){return none(string).toUpperCase()};exports.inverse=function(string){for(var i=0,char;char=string[i];i++){if(!/[a-z]/i.test(char))continue;var upper=char.toUpperCase();var lower=char.toLowerCase();string[i]=char==upper?lower:upper}return string};exports.none=none},{"to-camel-case":146,"to-capital-case":147,"to-constant-case":148,"to-dot-case":149,"to-no-case":118,"to-pascal-case":150,"to-sentence-case":151,"to-slug-case":152,"to-snake-case":153,"to-space-case":154,"to-title-case":155}],146:[function(require,module,exports){var toSpace=require("to-space-case");module.exports=toCamelCase;function toCamelCase(string){return toSpace(string).replace(/\s(\w)/g,function(matches,letter){return letter.toUpperCase()})}},{"to-space-case":154}],154:[function(require,module,exports){var clean=require("to-no-case");module.exports=toSpaceCase;function toSpaceCase(string){return clean(string).replace(/[\W_]+(.|$)/g,function(matches,match){return match?" "+match:""})}},{"to-no-case":118}],147:[function(require,module,exports){var clean=require("to-no-case");module.exports=toCapitalCase;function toCapitalCase(string){return clean(string).replace(/(^|\s)(\w)/g,function(matches,previous,letter){return previous+letter.toUpperCase()})}},{"to-no-case":118}],148:[function(require,module,exports){var snake=require("to-snake-case");module.exports=toConstantCase;function toConstantCase(string){return snake(string).toUpperCase()}},{"to-snake-case":153}],153:[function(require,module,exports){var toSpace=require("to-space-case");module.exports=toSnakeCase;function toSnakeCase(string){return toSpace(string).replace(/\s/g,"_")}},{"to-space-case":154}],149:[function(require,module,exports){var toSpace=require("to-space-case");module.exports=toDotCase;function toDotCase(string){return toSpace(string).replace(/\s/g,".")}},{"to-space-case":154}],150:[function(require,module,exports){var toSpace=require("to-space-case");module.exports=toPascalCase;function toPascalCase(string){return toSpace(string).replace(/(?:^|\s)(\w)/g,function(matches,letter){return letter.toUpperCase()})}},{"to-space-case":154}],151:[function(require,module,exports){var clean=require("to-no-case");module.exports=toSentenceCase;function toSentenceCase(string){return clean(string).replace(/[a-z]/i,function(letter){return letter.toUpperCase()})}},{"to-no-case":118}],152:[function(require,module,exports){var toSpace=require("to-space-case");module.exports=toSlugCase;function toSlugCase(string){return toSpace(string).replace(/\s/g,"-")}},{"to-space-case":154}],155:[function(require,module,exports){var capital=require("to-capital-case"),escape=require("escape-regexp"),map=require("map"),minors=require("title-case-minors");module.exports=toTitleCase;var escaped=map(minors,escape);var minorMatcher=new RegExp("[^^]\\b("+escaped.join("|")+")\\b","ig");var colonMatcher=/:\s*(\w)/g;function toTitleCase(string){return capital(string).replace(minorMatcher,function(minor){return minor.toLowerCase()}).replace(colonMatcher,function(letter){return letter.toUpperCase()})}},{"to-capital-case":147,"escape-regexp":156,map:157,"title-case-minors":158}],156:[function(require,module,exports){module.exports=function(str){return String(str).replace(/([.*+?=^!:${}()|[\]\/\\])/g,"\\$1")}},{}],157:[function(require,module,exports){var each=require("each");module.exports=function map(obj,iterator){var arr=[];each(obj,function(o){arr.push(iterator.apply(null,arguments))});return arr}},{each:107}],158:[function(require,module,exports){module.exports=["a","an","and","as","at","but","by","en","for","from","how","if","in","neither","nor","of","on","only","onto","out","or","per","so","than","that","the","to","until","up","upon","v","v.","versus","vs","vs.","via","when","with","without","yet"]},{}],140:[function(require,module,exports){var is=require("is");var isodate=require("isodate");var each;try{each=require("each")}catch(err){each=require("each-component")}module.exports=traverse;function traverse(input,strict){if(strict===undefined)strict=true;if(is.object(input))return object(input,strict);if(is.array(input))return array(input,strict);return input}function object(obj,strict){each(obj,function(key,val){if(isodate.is(val,strict)){obj[key]=isodate.parse(val)}else if(is.object(val)||is.array(val)){traverse(val,strict)}});return obj}function array(arr,strict){each(arr,function(val,x){if(is.object(val)){traverse(val,strict)}else if(isodate.is(val,strict)){arr[x]=isodate.parse(val) }});return arr}},{is:159,isodate:160,each:4}],159:[function(require,module,exports){var isEmpty=require("is-empty");try{var typeOf=require("type")}catch(e){var typeOf=require("component-type")}var types=["arguments","array","boolean","date","element","function","null","number","object","regexp","string","undefined"];for(var i=0,type;type=types[i];i++)exports[type]=generate(type);exports.fn=exports["function"];exports.empty=isEmpty;exports.nan=function(val){return exports.number(val)&&val!=val};function generate(type){return function(value){return type===typeOf(value)}}},{"is-empty":119,type:7,"component-type":7}],160:[function(require,module,exports){var matcher=/^(\d{4})(?:-?(\d{2})(?:-?(\d{2}))?)?(?:([ T])(\d{2}):?(\d{2})(?::?(\d{2})(?:[,\.](\d{1,}))?)?(?:(Z)|([+\-])(\d{2})(?::?(\d{2}))?)?)?$/;exports.parse=function(iso){var numericKeys=[1,5,6,7,11,12];var arr=matcher.exec(iso);var offset=0;if(!arr)return new Date(iso);for(var i=0,val;val=numericKeys[i];i++){arr[val]=parseInt(arr[val],10)||0}arr[2]=parseInt(arr[2],10)||1;arr[3]=parseInt(arr[3],10)||1;arr[2]--;arr[8]=arr[8]?(arr[8]+"00").substring(0,3):0;if(arr[4]==" "){offset=(new Date).getTimezoneOffset()}else if(arr[9]!=="Z"&&arr[10]){offset=arr[11]*60+arr[12];if("+"==arr[10])offset=0-offset}var millis=Date.UTC(arr[1],arr[2],arr[3],arr[5],arr[6]+offset,arr[7],arr[8]);return new Date(millis)};exports.is=function(string,strict){if(strict&&false===/^\d{4}-\d{2}-\d{2}/.test(string))return false;return matcher.test(string)}},{}],141:[function(require,module,exports){var is=require("is");var isodate=require("isodate");var milliseconds=require("./milliseconds");var seconds=require("./seconds");module.exports=function newDate(val){if(is.date(val))return val;if(is.number(val))return new Date(toMs(val));if(isodate.is(val))return isodate.parse(val);if(milliseconds.is(val))return milliseconds.parse(val);if(seconds.is(val))return seconds.parse(val);return new Date(val)};function toMs(num){if(num<315576e5)return num*1e3;return num}},{is:161,isodate:160,"./milliseconds":162,"./seconds":163}],161:[function(require,module,exports){var isEmpty=require("is-empty"),typeOf=require("type");var types=["arguments","array","boolean","date","element","function","null","number","object","regexp","string","undefined"];for(var i=0,type;type=types[i];i++)exports[type]=generate(type);exports.fn=exports["function"];exports.empty=isEmpty;exports.nan=function(val){return exports.number(val)&&val!=val};function generate(type){return function(value){return type===typeOf(value)}}},{"is-empty":119,type:7}],162:[function(require,module,exports){var matcher=/\d{13}/;exports.is=function(string){return matcher.test(string)};exports.parse=function(millis){millis=parseInt(millis,10);return new Date(millis)}},{}],163:[function(require,module,exports){var matcher=/\d{10}/;exports.is=function(string){return matcher.test(string)};exports.parse=function(seconds){var millis=parseInt(seconds,10)*1e3;return new Date(millis)}},{}],131:[function(require,module,exports){var inherit=require("./utils").inherit;var Facade=require("./facade");module.exports=Alias;function Alias(dictionary){Facade.call(this,dictionary)}inherit(Alias,Facade);Alias.prototype.type=Alias.prototype.action=function(){return"alias"};Alias.prototype.from=Alias.prototype.previousId=function(){return this.field("previousId")||this.field("from")};Alias.prototype.to=Alias.prototype.userId=function(){return this.field("userId")||this.field("to")}},{"./utils":137,"./facade":130}],132:[function(require,module,exports){var inherit=require("./utils").inherit;var Facade=require("./facade");var newDate=require("new-date");module.exports=Group;function Group(dictionary){Facade.call(this,dictionary)}inherit(Group,Facade);Group.prototype.type=Group.prototype.action=function(){return"group"};Group.prototype.groupId=Facade.field("groupId");Group.prototype.created=function(){var created=this.proxy("traits.createdAt")||this.proxy("traits.created")||this.proxy("properties.createdAt")||this.proxy("properties.created");if(created)return newDate(created)};Group.prototype.traits=function(aliases){var ret=this.properties();var id=this.groupId();aliases=aliases||{};if(id)ret.id=id;for(var alias in aliases){var value=null==this[alias]?this.proxy("traits."+alias):this[alias]();if(null==value)continue;ret[aliases[alias]]=value;delete ret[alias]}return ret};Group.prototype.properties=function(){return this.field("traits")||this.field("properties")||{}}},{"./utils":137,"./facade":130,"new-date":141}],133:[function(require,module,exports){var Facade=require("./facade");var isEmail=require("is-email");var newDate=require("new-date");var utils=require("./utils");var trim=require("trim");var inherit=utils.inherit;var clone=utils.clone;module.exports=Identify;function Identify(dictionary){Facade.call(this,dictionary)}inherit(Identify,Facade);Identify.prototype.type=Identify.prototype.action=function(){return"identify"};Identify.prototype.traits=function(aliases){var ret=this.field("traits")||{};var id=this.userId();aliases=aliases||{};if(id)ret.id=id;for(var alias in aliases){var value=null==this[alias]?this.proxy("traits."+alias):this[alias]();if(null==value)continue;ret[aliases[alias]]=value;if(alias!==aliases[alias])delete ret[alias]}return ret};Identify.prototype.email=function(){var email=this.proxy("traits.email");if(email)return email;var userId=this.userId();if(isEmail(userId))return userId};Identify.prototype.created=function(){var created=this.proxy("traits.created")||this.proxy("traits.createdAt");if(created)return newDate(created)};Identify.prototype.companyCreated=function(){var created=this.proxy("traits.company.created")||this.proxy("traits.company.createdAt");if(created)return newDate(created)};Identify.prototype.name=function(){var name=this.proxy("traits.name");if(typeof name==="string")return trim(name);var firstName=this.firstName();var lastName=this.lastName();if(firstName&&lastName)return trim(firstName+" "+lastName)};Identify.prototype.firstName=function(){var firstName=this.proxy("traits.firstName");if(typeof firstName==="string")return trim(firstName);var name=this.proxy("traits.name");if(typeof name==="string")return trim(name).split(" ")[0]};Identify.prototype.lastName=function(){var lastName=this.proxy("traits.lastName");if(typeof lastName==="string")return trim(lastName);var name=this.proxy("traits.name");if(typeof name!=="string")return;var space=trim(name).indexOf(" ");if(space===-1)return;return trim(name.substr(space+1))};Identify.prototype.uid=function(){return this.userId()||this.username()||this.email()};Identify.prototype.description=function(){return this.proxy("traits.description")||this.proxy("traits.background")};Identify.prototype.username=Facade.proxy("traits.username");Identify.prototype.website=Facade.proxy("traits.website");Identify.prototype.phone=Facade.proxy("traits.phone");Identify.prototype.address=Facade.proxy("traits.address");Identify.prototype.avatar=Facade.proxy("traits.avatar")},{"./facade":130,"is-email":164,"new-date":141,"./utils":137,trim:165}],164:[function(require,module,exports){module.exports=isEmail;var matcher=/.+\@.+\..+/;function isEmail(string){return matcher.test(string)}},{}],165:[function(require,module,exports){exports=module.exports=trim;function trim(str){if(str.trim)return str.trim();return str.replace(/^\s*|\s*$/g,"")}exports.left=function(str){if(str.trimLeft)return str.trimLeft();return str.replace(/^\s*/,"")};exports.right=function(str){if(str.trimRight)return str.trimRight();return str.replace(/\s*$/,"")}},{}],134:[function(require,module,exports){var inherit=require("./utils").inherit;var clone=require("./utils").clone;var Facade=require("./facade");var Identify=require("./identify");var isEmail=require("is-email");module.exports=Track;function Track(dictionary){Facade.call(this,dictionary)}inherit(Track,Facade);Track.prototype.type=Track.prototype.action=function(){return"track"};Track.prototype.event=Facade.field("event");Track.prototype.value=Facade.proxy("properties.value");Track.prototype.category=Facade.proxy("properties.category");Track.prototype.country=Facade.proxy("properties.country");Track.prototype.state=Facade.proxy("properties.state");Track.prototype.city=Facade.proxy("properties.city");Track.prototype.zip=Facade.proxy("properties.zip");Track.prototype.id=Facade.proxy("properties.id");Track.prototype.sku=Facade.proxy("properties.sku");Track.prototype.tax=Facade.proxy("properties.tax");Track.prototype.name=Facade.proxy("properties.name");Track.prototype.price=Facade.proxy("properties.price");Track.prototype.total=Facade.proxy("properties.total");Track.prototype.coupon=Facade.proxy("properties.coupon");Track.prototype.shipping=Facade.proxy("properties.shipping");Track.prototype.orderId=function(){return this.proxy("properties.id")||this.proxy("properties.orderId")};Track.prototype.subtotal=function(){var subtotal=this.obj.properties.subtotal;var total=this.total();var n;if(subtotal)return subtotal;if(!total)return 0;if(n=this.tax())total-=n;if(n=this.shipping())total-=n;return total};Track.prototype.products=function(){var props=this.obj.properties||{};return props.products||[]};Track.prototype.quantity=function(){var props=this.obj.properties||{};return props.quantity||1};Track.prototype.currency=function(){var props=this.obj.properties||{};return props.currency||"USD"};Track.prototype.referrer=Facade.proxy("properties.referrer");Track.prototype.query=Facade.proxy("options.query");Track.prototype.properties=function(aliases){var ret=this.field("properties")||{};aliases=aliases||{};for(var alias in aliases){var value=null==this[alias]?this.proxy("properties."+alias):this[alias]();if(null==value)continue;ret[aliases[alias]]=value;delete ret[alias]}return ret};Track.prototype.username=function(){return this.proxy("traits.username")||this.proxy("properties.username")||this.userId()||this.sessionId()};Track.prototype.email=function(){var email=this.proxy("traits.email");email=email||this.proxy("properties.email");if(email)return email;var userId=this.userId();if(isEmail(userId))return userId};Track.prototype.revenue=function(){var revenue=this.proxy("properties.revenue");var event=this.event();if(!revenue&&event&&event.match(/completed ?order/i)){revenue=this.proxy("properties.total")}return currency(revenue)};Track.prototype.cents=function(){var revenue=this.revenue();return"number"!=typeof revenue?this.value()||0:revenue*100};Track.prototype.identify=function(){var json=this.json();json.traits=this.traits();return new Identify(json)};function currency(val){if(!val)return;if(typeof val==="number")return val;if(typeof val!=="string")return;val=val.replace(/\$/g,"");val=parseFloat(val);if(!isNaN(val))return val}},{"./utils":137,"./facade":130,"./identify":133,"is-email":164}],135:[function(require,module,exports){var inherit=require("./utils").inherit;var Facade=require("./facade");var Track=require("./track");module.exports=Page;function Page(dictionary){Facade.call(this,dictionary)}inherit(Page,Facade);Page.prototype.type=Page.prototype.action=function(){return"page"};Page.prototype.category=Facade.field("category");Page.prototype.name=Facade.field("name");Page.prototype.properties=function(){var props=this.field("properties")||{};var category=this.category();var name=this.name();if(category)props.category=category;if(name)props.name=name;return props};Page.prototype.fullName=function(){var category=this.category();var name=this.name();return name&&category?category+" "+name:name};Page.prototype.event=function(name){return name?"Viewed "+name+" Page":"Loaded a Page"};Page.prototype.track=function(name){var props=this.properties();return new Track({event:this.event(name),properties:props})}},{"./utils":137,"./facade":130,"./track":134}],136:[function(require,module,exports){var inherit=require("./utils").inherit;var Page=require("./page");var Track=require("./track");module.exports=Screen;function Screen(dictionary){Page.call(this,dictionary)}inherit(Screen,Page);Screen.prototype.type=Screen.prototype.action=function(){return"screen"};Screen.prototype.event=function(name){return name?"Viewed "+name+" Screen":"Loaded a Screen"};Screen.prototype.track=function(name){var props=this.properties();return new Track({event:this.event(name),properties:props})}},{"./utils":137,"./page":135,"./track":134}],128:[function(require,module,exports){var stringify=require("querystring").stringify;var sub=require("substitute");module.exports=function(path){return function(query,obj,fn){if("function"==typeof obj)fn=obj,obj={};obj=obj||{};fn=fn||function(){};var url=sub(path,obj);var img=new Image;img.onerror=error(fn,"failed to load pixel",img);img.onload=function(){fn()};query=stringify(query);if(query)query="?"+query;img.src=url+query;img.width=1;img.height=1;return img}};function error(fn,message,img){return function(e){e=e||window.event;var err=new Error(message);err.event=e;err.source=img;fn(err)}}},{querystring:129,substitute:166}],129:[function(require,module,exports){var encode=encodeURIComponent;var decode=decodeURIComponent;var trim=require("trim");var type=require("type");exports.parse=function(str){if("string"!=typeof str)return{};str=trim(str);if(""==str)return{};if("?"==str.charAt(0))str=str.slice(1);var obj={};var pairs=str.split("&");for(var i=0;i<pairs.length;i++){var parts=pairs[i].split("=");var key=decode(parts[0]);var m;if(m=/(\w+)\[(\d+)\]/.exec(key)){obj[m[1]]=obj[m[1]]||[];obj[m[1]][m[2]]=decode(parts[1]);continue}obj[parts[0]]=null==parts[1]?"":decode(parts[1])}return obj};exports.stringify=function(obj){if(!obj)return"";var pairs=[];for(var key in obj){var value=obj[key];if("array"==type(value)){for(var i=0;i<value.length;++i){pairs.push(encode(key+"["+i+"]")+"="+encode(value[i]))}continue}pairs.push(encode(key)+"="+encode(obj[key]))}return pairs.join("&")}},{trim:165,type:7}],166:[function(require,module,exports){module.exports=substitute;function substitute(str,obj,expr){if(!obj)throw new TypeError("expected an object");expr=expr||/:(\w+)/g;return str.replace(expr,function(_,prop){return null!=obj[prop]?obj[prop]:_})}},{}],17:[function(require,module,exports){var integration=require("analytics.js-integration");var tick=require("next-tick");var BugHerd=module.exports=integration("BugHerd").assumesPageview().global("BugHerdConfig").global("_bugHerd").option("apiKey","").option("showFeedbackTab",true).tag('<script src="//www.bugherd.com/sidebarv2.js?apikey={{ apiKey }}">');BugHerd.prototype.initialize=function(page){window.BugHerdConfig={feedback:{hide:!this.options.showFeedbackTab}};var ready=this.ready;this.load(function(){tick(ready)})};BugHerd.prototype.loaded=function(){return!!window._bugHerd}},{"analytics.js-integration":84,"next-tick":98}],18:[function(require,module,exports){var integration=require("analytics.js-integration");var is=require("is");var extend=require("extend");var onError=require("on-error");var Bugsnag=module.exports=integration("Bugsnag").global("Bugsnag").option("apiKey","").tag('<script src="//d2wy8f7a9ursnm.cloudfront.net/bugsnag-2.min.js">');Bugsnag.prototype.initialize=function(page){var self=this;this.load(function(){window.Bugsnag.apiKey=self.options.apiKey;self.ready()})};Bugsnag.prototype.loaded=function(){return is.object(window.Bugsnag)};Bugsnag.prototype.identify=function(identify){window.Bugsnag.metaData=window.Bugsnag.metaData||{};extend(window.Bugsnag.metaData,identify.traits())}},{"analytics.js-integration":84,is:87,extend:125,"on-error":167}],167:[function(require,module,exports){module.exports=onError;var callbacks=[];if("function"==typeof window.onerror)callbacks.push(window.onerror);window.onerror=handler;function handler(){for(var i=0,fn;fn=callbacks[i];i++)fn.apply(this,arguments)}function onError(fn){callbacks.push(fn);if(window.onerror!=handler){callbacks.push(window.onerror);window.onerror=handler}}},{}],19:[function(require,module,exports){var integration=require("analytics.js-integration");var defaults=require("defaults");var onBody=require("on-body");var Chartbeat=module.exports=integration("Chartbeat").assumesPageview().global("_sf_async_config").global("_sf_endpt").global("pSUPERFLY").option("domain","").option("uid",null).tag('<script src="//static.chartbeat.com/js/chartbeat.js">');Chartbeat.prototype.initialize=function(page){var self=this;window._sf_async_config=window._sf_async_config||{};window._sf_async_config.useCanonical=true;defaults(window._sf_async_config,this.options);onBody(function(){window._sf_endpt=(new Date).getTime();self.load(self.ready)})};Chartbeat.prototype.loaded=function(){return!!window.pSUPERFLY};Chartbeat.prototype.page=function(page){var props=page.properties();var name=page.fullName();window.pSUPERFLY.virtualPage(props.path,name||props.title)}},{"analytics.js-integration":84,defaults:168,"on-body":120}],168:[function(require,module,exports){module.exports=defaults;function defaults(dest,defaults){for(var prop in defaults){if(!(prop in dest)){dest[prop]=defaults[prop]}}return dest}},{}],20:[function(require,module,exports){var integration=require("analytics.js-integration");var push=require("global-queue")("_cbq");var each=require("each");var has=Object.prototype.hasOwnProperty;var supported={activation:true,changePlan:true,register:true,refund:true,charge:true,cancel:true,login:true};var ChurnBee=module.exports=integration("ChurnBee").global("_cbq").global("ChurnBee").option("apiKey","").tag('<script src="//api.churnbee.com/cb.js">').mapping("events");ChurnBee.prototype.initialize=function(page){push("_setApiKey",this.options.apiKey);this.load(this.ready)};ChurnBee.prototype.loaded=function(){return!!window.ChurnBee};ChurnBee.prototype.track=function(track){var event=track.event();var events=this.events(event);events.push(event);each(events,function(event){if(true!=supported[event])return;push(event,track.properties({revenue:"amount"}))})}},{"analytics.js-integration":84,"global-queue":169,each:4}],169:[function(require,module,exports){module.exports=generate;function generate(name,options){options=options||{};return function(args){args=[].slice.call(arguments);window[name]||(window[name]=[]);options.wrap===false?window[name].push.apply(window[name],args):window[name].push(args)}}},{}],21:[function(require,module,exports){var date=require("load-date");var domify=require("domify");var each=require("each");var integration=require("analytics.js-integration");var is=require("is");var useHttps=require("use-https");var onBody=require("on-body");var ClickTale=module.exports=integration("ClickTale").assumesPageview().global("WRInitTime").global("ClickTale").global("ClickTaleSetUID").global("ClickTaleField").global("ClickTaleEvent").option("httpCdnUrl","http://s.clicktale.net/WRe0.js").option("httpsCdnUrl","").option("projectId","").option("recordingRatio",.01).option("partitionId","").tag('<script src="{{src}}">');ClickTale.prototype.initialize=function(page){var self=this;window.WRInitTime=date.getTime();onBody(function(body){body.appendChild(domify('<div id="ClickTaleDiv" style="display: none;">'))});var http=this.options.httpCdnUrl;var https=this.options.httpsCdnUrl;if(useHttps()&&!https)return this.debug("https option required");var src=useHttps()?https:http;this.load({src:src},function(){window.ClickTale(self.options.projectId,self.options.recordingRatio,self.options.partitionId);self.ready()})};ClickTale.prototype.loaded=function(){return is.fn(window.ClickTale)};ClickTale.prototype.identify=function(identify){var id=identify.userId();window.ClickTaleSetUID(id);each(identify.traits(),function(key,value){window.ClickTaleField(key,value)})};ClickTale.prototype.track=function(track){window.ClickTaleEvent(track.event())}},{"load-date":170,domify:121,each:4,"analytics.js-integration":84,is:87,"use-https":86,"on-body":120}],170:[function(require,module,exports){var time=new Date,perf=window.performance;if(perf&&perf.timing&&perf.timing.responseEnd){time=new Date(perf.timing.responseEnd)}module.exports=time},{}],22:[function(require,module,exports){var Identify=require("facade").Identify;var extend=require("extend");var integration=require("analytics.js-integration");var is=require("is");var Clicky=module.exports=integration("Clicky").assumesPageview().global("clicky").global("clicky_site_ids").global("clicky_custom").option("siteId",null).tag('<script src="//static.getclicky.com/js"></script>');Clicky.prototype.initialize=function(page){var user=this.analytics.user();window.clicky_site_ids=window.clicky_site_ids||[this.options.siteId];this.identify(new Identify({userId:user.id(),traits:user.traits()}));this.load(this.ready)};Clicky.prototype.loaded=function(){return is.object(window.clicky)};Clicky.prototype.page=function(page){var properties=page.properties();var category=page.category();var name=page.fullName();window.clicky.log(properties.path,name||properties.title)};Clicky.prototype.identify=function(identify){window.clicky_custom=window.clicky_custom||{};window.clicky_custom.session=window.clicky_custom.session||{};extend(window.clicky_custom.session,identify.traits())};Clicky.prototype.track=function(track){window.clicky.goal(track.event(),track.revenue())}},{facade:127,extend:125,"analytics.js-integration":84,is:87}],23:[function(require,module,exports){var integration=require("analytics.js-integration");var useHttps=require("use-https");var Comscore=module.exports=integration("comScore").assumesPageview().global("_comscore").global("COMSCORE").option("c1","2").option("c2","").tag("http",'<script src="http://b.scorecardresearch.com/beacon.js">').tag("https",'<script src="https://sb.scorecardresearch.com/beacon.js">');Comscore.prototype.initialize=function(page){window._comscore=window._comscore||[this.options];var name=useHttps()?"https":"http";this.load(name,this.ready)};Comscore.prototype.loaded=function(){return!!window.COMSCORE}},{"analytics.js-integration":84,"use-https":86}],24:[function(require,module,exports){var integration=require("analytics.js-integration");var CrazyEgg=module.exports=integration("Crazy Egg").assumesPageview().global("CE2").option("accountNumber","").tag('<script src="//dnn506yrbagrg.cloudfront.net/pages/scripts/{{ path }}.js?{{ cache }}">');CrazyEgg.prototype.initialize=function(page){var number=this.options.accountNumber;var path=number.slice(0,4)+"/"+number.slice(4);var cache=Math.floor((new Date).getTime()/36e5);this.load({path:path,cache:cache},this.ready)};CrazyEgg.prototype.loaded=function(){return!!window.CE2}},{"analytics.js-integration":84}],25:[function(require,module,exports){var integration=require("analytics.js-integration");var push=require("global-queue")("_curebitq");var Identify=require("facade").Identify;var throttle=require("throttle");var Track=require("facade").Track;var iso=require("to-iso-string");var clone=require("clone");var each=require("each");var bind=require("bind");var Curebit=module.exports=integration("Curebit").global("_curebitq").global("curebit").option("siteId","").option("iframeWidth","100%").option("iframeHeight","480").option("iframeBorder",0).option("iframeId","curebit_integration").option("responsive",true).option("device","").option("insertIntoId","").option("campaigns",{}).option("server","https://www.curebit.com").tag('<script src="//d2jjzw81hqbuqv.cloudfront.net/integration/curebit-1.0.min.js">');Curebit.prototype.initialize=function(page){push("init",{site_id:this.options.siteId,server:this.options.server});this.load(this.ready);this.page=throttle(bind(this,this.page),250)};Curebit.prototype.loaded=function(){return!!window.curebit};Curebit.prototype.injectIntoId=function(url,id,fn){var server=this.options.server;when(function(){return document.getElementById(id)},function(){var script=document.createElement("script");script.src=url;var parent=document.getElementById(id);parent.appendChild(script);onload(script,fn)})};Curebit.prototype.page=function(page){var user=this.analytics.user();var campaigns=this.options.campaigns;var path=window.location.pathname;if(!campaigns[path])return;var tags=(campaigns[path]||"").split(",");if(!tags.length)return;var settings={responsive:this.options.responsive,device:this.options.device,campaign_tags:tags,iframe:{width:this.options.iframeWidth,height:this.options.iframeHeight,id:this.options.iframeId,frameborder:this.options.iframeBorder,container:this.options.insertIntoId}};var identify=new Identify({userId:user.id(),traits:user.traits()});if(identify.email()){settings.affiliate_member={email:identify.email(),first_name:identify.firstName(),last_name:identify.lastName(),customer_id:identify.userId()}}push("register_affiliate",settings)};Curebit.prototype.completedOrder=function(track){var user=this.analytics.user();var orderId=track.orderId();var products=track.products();var props=track.properties();var items=[];var identify=new Identify({traits:user.traits(),userId:user.id()});each(products,function(product){var track=new Track({properties:product});items.push({product_id:track.id()||track.sku(),quantity:track.quantity(),image_url:product.image,price:track.price(),title:track.name(),url:product.url})});push("register_purchase",{order_date:iso(props.date||new Date),order_number:orderId,coupon_code:track.coupon(),subtotal:track.total(),customer_id:identify.userId(),first_name:identify.firstName(),last_name:identify.lastName(),email:identify.email(),items:items})}},{"analytics.js-integration":84,"global-queue":169,facade:127,throttle:171,"to-iso-string":172,clone:173,each:4,bind:96}],171:[function(require,module,exports){module.exports=throttle;function throttle(func,wait){var rtn;var last=0;return function throttled(){var now=(new Date).getTime();var delta=now-last;if(delta>=wait){rtn=func.apply(this,arguments);last=now}return rtn}}},{}],172:[function(require,module,exports){module.exports=toIsoString;function toIsoString(date){return date.getUTCFullYear()+"-"+pad(date.getUTCMonth()+1)+"-"+pad(date.getUTCDate())+"T"+pad(date.getUTCHours())+":"+pad(date.getUTCMinutes())+":"+pad(date.getUTCSeconds())+"."+String((date.getUTCMilliseconds()/1e3).toFixed(3)).slice(2,5)+"Z"}function pad(number){var n=number.toString();return n.length===1?"0"+n:n}},{}],173:[function(require,module,exports){var type;try{type=require("type")}catch(e){type=require("type-component")}module.exports=clone;function clone(obj){switch(type(obj)){case"object":var copy={};for(var key in obj){if(obj.hasOwnProperty(key)){copy[key]=clone(obj[key])}}return copy;case"array":var copy=new Array(obj.length);for(var i=0,l=obj.length;i<l;i++){copy[i]=clone(obj[i])}return copy;case"regexp":var flags="";flags+=obj.multiline?"m":"";flags+=obj.global?"g":"";flags+=obj.ignoreCase?"i":"";return new RegExp(obj.source,flags);case"date":return new Date(obj.getTime());default:return obj}}},{type:7}],26:[function(require,module,exports){var alias=require("alias");var convertDates=require("convert-dates");var Identify=require("facade").Identify;var integration=require("analytics.js-integration");var Customerio=module.exports=integration("Customer.io").assumesPageview().global("_cio").option("siteId","").tag('<script id="cio-tracker" src="https://assets.customer.io/assets/track.js" data-site-id="{{ siteId }}">');Customerio.prototype.initialize=function(page){window._cio=window._cio||[];(function(){var a,b,c;a=function(f){return function(){window._cio.push([f].concat(Array.prototype.slice.call(arguments,0)))}};b=["identify","track"];for(c=0;c<b.length;c++){window._cio[b[c]]=a(b[c])}})();this.load(this.ready)};Customerio.prototype.loaded=function(){return!!window._cio&&window._cio.push!==Array.prototype.push};Customerio.prototype.identify=function(identify){if(!identify.userId())return this.debug("user id required");var traits=identify.traits({created:"created_at"});traits=convertDates(traits,convertDate);window._cio.identify(traits)};Customerio.prototype.group=function(group){var traits=group.traits();var user=this.analytics.user();traits=alias(traits,function(trait){return"Group "+trait});this.identify(new Identify({userId:user.id(),traits:traits}))};Customerio.prototype.track=function(track){var properties=track.properties();properties=convertDates(properties,convertDate);window._cio.track(track.event(),properties)};function convertDate(date){return Math.floor(date.getTime()/1e3)}},{alias:174,"convert-dates":175,facade:127,"analytics.js-integration":84}],174:[function(require,module,exports){var type=require("type");try{var clone=require("clone")}catch(e){var clone=require("clone-component")}module.exports=alias;function alias(obj,method){switch(type(method)){case"object":return aliasByDictionary(clone(obj),method);case"function":return aliasByFunction(clone(obj),method)}}function aliasByDictionary(obj,aliases){for(var key in aliases){if(undefined===obj[key])continue;obj[aliases[key]]=obj[key];delete obj[key]}return obj}function aliasByFunction(obj,convert){var output={};for(var key in obj)output[convert(key)]=obj[key];return output}},{type:7,clone:143}],175:[function(require,module,exports){var is=require("is");try{var clone=require("clone")}catch(e){var clone=require("clone-component")}module.exports=convertDates;function convertDates(obj,convert){obj=clone(obj);for(var key in obj){var val=obj[key];if(is.date(val))obj[key]=convert(val);if(is.object(val))obj[key]=convertDates(val,convert)}return obj}},{is:87,clone:90}],27:[function(require,module,exports){var alias=require("alias");var integration=require("analytics.js-integration");var is=require("is");var load=require("load-script");var push=require("global-queue")("_dcq");var Drip=module.exports=integration("Drip").assumesPageview().global("dc").global("_dcq").global("_dcs").option("account","").tag('<script src="//tag.getdrip.com/{{ account }}.js">');Drip.prototype.initialize=function(page){window._dcq=window._dcq||[];window._dcs=window._dcs||{};window._dcs.account=this.options.account;this.load(this.ready)};Drip.prototype.loaded=function(){return is.object(window.dc)};Drip.prototype.track=function(track){var props=track.properties();var cents=track.cents();if(cents)props.value=cents;delete props.revenue;push("track",track.event(),props)};Drip.prototype.identify=function(identify){push("identify",identify.traits())}},{alias:174,"analytics.js-integration":84,is:87,"load-script":124,"global-queue":169}],28:[function(require,module,exports){var extend=require("extend");var integration=require("analytics.js-integration");var onError=require("on-error");var push=require("global-queue")("_errs");var Errorception=module.exports=integration("Errorception").assumesPageview().global("_errs").option("projectId","").option("meta",true).tag('<script src="//beacon.errorception.com/{{ projectId }}.js">');Errorception.prototype.initialize=function(page){window._errs=window._errs||[this.options.projectId];onError(push);this.load(this.ready)};Errorception.prototype.loaded=function(){return!!(window._errs&&window._errs.push!==Array.prototype.push)};Errorception.prototype.identify=function(identify){if(!this.options.meta)return;var traits=identify.traits();window._errs=window._errs||[];window._errs.meta=window._errs.meta||{};extend(window._errs.meta,traits)}},{extend:125,"analytics.js-integration":84,"on-error":167,"global-queue":169}],29:[function(require,module,exports){var each=require("each");var integration=require("analytics.js-integration");var push=require("global-queue")("_aaq");var Evergage=module.exports=integration("Evergage").assumesPageview().global("_aaq").option("account","").option("dataset","").tag('<script src="//cdn.evergage.com/beacon/{{ account }}/{{ dataset }}/scripts/evergage.min.js">');Evergage.prototype.initialize=function(page){var account=this.options.account;var dataset=this.options.dataset;window._aaq=window._aaq||[];push("setEvergageAccount",account);push("setDataset",dataset);push("setUseSiteConfig",true);this.load(this.ready)};Evergage.prototype.loaded=function(){return!!(window._aaq&&window._aaq.push!==Array.prototype.push)};Evergage.prototype.page=function(page){var props=page.properties(); var name=page.name();if(name)push("namePage",name);each(props,function(key,value){push("setCustomField",key,value,"page")});window.Evergage.init(true)};Evergage.prototype.identify=function(identify){var id=identify.userId();if(!id)return;push("setUser",id);var traits=identify.traits({email:"userEmail",name:"userName"});each(traits,function(key,value){push("setUserField",key,value,"page")})};Evergage.prototype.group=function(group){var props=group.traits();var id=group.groupId();if(!id)return;push("setCompany",id);each(props,function(key,value){push("setAccountField",key,value,"page")})};Evergage.prototype.track=function(track){push("trackAction",track.event(),track.properties())}},{each:4,"analytics.js-integration":84,"global-queue":169}],30:[function(require,module,exports){var integration=require("analytics.js-integration");var push=require("global-queue")("_fbq");var each=require("each");var has=Object.prototype.hasOwnProperty;var Facebook=module.exports=integration("Facebook Conversion Tracking").global("_fbq").option("currency","USD").tag('<script src="//connect.facebook.net/en_US/fbds.js">').mapping("events");Facebook.prototype.initialize=function(page){window._fbq=window._fbq||[];this.load(this.ready);window._fbq.loaded=true};Facebook.prototype.loaded=function(){return!!(window._fbq&&window._fbq.loaded)};Facebook.prototype.track=function(track){var event=track.event();var events=this.events(event);var revenue=track.revenue()||0;var self=this;each(events,function(event){push("track",event,{value:String(revenue.toFixed(2)),currency:self.options.currency})});if(!events.length){var data=track.properties();push("track",event,data)}}},{"analytics.js-integration":84,"global-queue":169,each:4}],31:[function(require,module,exports){var push=require("global-queue")("_fxm");var integration=require("analytics.js-integration");var Track=require("facade").Track;var each=require("each");var FoxMetrics=module.exports=integration("FoxMetrics").assumesPageview().global("_fxm").option("appId","").tag('<script src="//d35tca7vmefkrc.cloudfront.net/scripts/{{ appId }}.js">');FoxMetrics.prototype.initialize=function(page){window._fxm=window._fxm||[];this.load(this.ready)};FoxMetrics.prototype.loaded=function(){return!!(window._fxm&&window._fxm.appId)};FoxMetrics.prototype.page=function(page){var properties=page.proxy("properties");var category=page.category();var name=page.name();this._category=category;push("_fxm.pages.view",properties.title,name,category,properties.url,properties.referrer)};FoxMetrics.prototype.identify=function(identify){var id=identify.userId();if(!id)return;push("_fxm.visitor.profile",id,identify.firstName(),identify.lastName(),identify.email(),identify.address(),undefined,undefined,identify.traits())};FoxMetrics.prototype.track=function(track){var props=track.properties();var category=this._category||props.category;push(track.event(),category,props)};FoxMetrics.prototype.viewedProduct=function(track){ecommerce("productview",track)};FoxMetrics.prototype.removedProduct=function(track){ecommerce("removecartitem",track)};FoxMetrics.prototype.addedProduct=function(track){ecommerce("cartitem",track)};FoxMetrics.prototype.completedOrder=function(track){var orderId=track.orderId();push("_fxm.ecommerce.order",orderId,track.subtotal(),track.shipping(),track.tax(),track.city(),track.state(),track.zip(),track.quantity());each(track.products(),function(product){var track=new Track({properties:product});ecommerce("purchaseitem",track,[track.quantity(),track.price(),orderId])})};function ecommerce(event,track,arr){push.apply(null,["_fxm.ecommerce."+event,track.id()||track.sku(),track.name(),track.category()].concat(arr||[]))}},{"global-queue":169,"analytics.js-integration":84,facade:127,each:4}],32:[function(require,module,exports){var integration=require("analytics.js-integration");var bind=require("bind");var when=require("when");var is=require("is");var Frontleaf=module.exports=integration("Frontleaf").assumesPageview().global("_fl").global("_flBaseUrl").option("baseUrl","https://api.frontleaf.com").option("token","").option("stream","").option("trackNamedPages",false).option("trackCategorizedPages",false).tag('<script id="_fl" src="{{ baseUrl }}/lib/tracker.js">');Frontleaf.prototype.initialize=function(page){window._fl=window._fl||[];window._flBaseUrl=window._flBaseUrl||this.options.baseUrl;this._push("setApiToken",this.options.token);this._push("setStream",this.options.stream);var loaded=bind(this,this.loaded);var ready=this.ready;this.load({baseUrl:window._flBaseUrl},this.ready)};Frontleaf.prototype.loaded=function(){return is.array(window._fl)&&window._fl.ready===true};Frontleaf.prototype.identify=function(identify){var userId=identify.userId();if(userId){this._push("setUser",{id:userId,name:identify.name()||identify.username(),data:clean(identify.traits())})}};Frontleaf.prototype.group=function(group){var groupId=group.groupId();if(groupId){this._push("setAccount",{id:groupId,name:group.proxy("traits.name"),data:clean(group.traits())})}};Frontleaf.prototype.page=function(page){var category=page.category();var name=page.fullName();var opts=this.options;if(category&&opts.trackCategorizedPages){this.track(page.track(category))}if(name&&opts.trackNamedPages){this.track(page.track(name))}};Frontleaf.prototype.track=function(track){var event=track.event();this._push("event",event,clean(track.properties()))};Frontleaf.prototype._push=function(command){var args=[].slice.call(arguments,1);window._fl.push(function(t){t[command].apply(command,args)})};function clean(obj){var ret={};var excludeKeys=["id","name","firstName","lastName"];var len=excludeKeys.length;for(var i=0;i<len;i++){clear(obj,excludeKeys[i])}obj=flatten(obj);for(var key in obj){var val=obj[key];if(null==val){continue}if(is.array(val)){ret[key]=val.toString();continue}ret[key]=val}return ret}function clear(obj,key){if(obj.hasOwnProperty(key)){delete obj[key]}}function flatten(source){var output={};function step(object,prev){for(var key in object){var value=object[key];var newKey=prev?prev+" "+key:key;if(!is.array(value)&&is.object(value)){return step(value,newKey)}output[newKey]=value}}step(source);return output}},{"analytics.js-integration":84,bind:96,when:126,is:87}],33:[function(require,module,exports){var integration=require("analytics.js-integration");var push=require("global-queue")("_gauges");var Gauges=module.exports=integration("Gauges").assumesPageview().global("_gauges").option("siteId","").tag('<script id="gauges-tracker" src="//secure.gaug.es/track.js" data-site-id="{{ siteId }}">');Gauges.prototype.initialize=function(page){window._gauges=window._gauges||[];this.load(this.ready)};Gauges.prototype.loaded=function(){return!!(window._gauges&&window._gauges.push!==Array.prototype.push)};Gauges.prototype.page=function(page){push("track")}},{"analytics.js-integration":84,"global-queue":169}],34:[function(require,module,exports){var integration=require("analytics.js-integration");var onBody=require("on-body");var GetSatisfaction=module.exports=integration("Get Satisfaction").assumesPageview().global("GSFN").option("widgetId","").tag('<script src="https://loader.engage.gsfn.us/loader.js">');GetSatisfaction.prototype.initialize=function(page){var self=this;var widget=this.options.widgetId;var div=document.createElement("div");var id=div.id="getsat-widget-"+widget;onBody(function(body){body.appendChild(div)});this.load(function(){window.GSFN.loadWidget(widget,{containerId:id});self.ready()})};GetSatisfaction.prototype.loaded=function(){return!!window.GSFN}},{"analytics.js-integration":84,"on-body":120}],35:[function(require,module,exports){var integration=require("analytics.js-integration");var push=require("global-queue")("_gaq");var length=require("object").length;var canonical=require("canonical");var useHttps=require("use-https");var Track=require("facade").Track;var callback=require("callback");var load=require("load-script");var keys=require("object").keys;var dot=require("obj-case");var each=require("each");var type=require("type");var url=require("url");var is=require("is");var group;var user;module.exports=exports=function(analytics){analytics.addIntegration(GA);group=analytics.group();user=analytics.user()};var GA=exports.Integration=integration("Google Analytics").readyOnLoad().global("ga").global("gaplugins").global("_gaq").global("GoogleAnalyticsObject").option("anonymizeIp",false).option("classic",false).option("domain","none").option("doubleClick",false).option("enhancedLinkAttribution",false).option("ignoredReferrers",null).option("includeSearch",false).option("siteSpeedSampleRate",1).option("trackingId","").option("trackNamedPages",true).option("trackCategorizedPages",true).option("sendUserId",false).option("metrics",{}).option("dimensions",{}).tag("library",'<script src="//www.google-analytics.com/analytics.js">').tag("double click",'<script src="//stats.g.doubleclick.net/dc.js">').tag("http",'<script src="http://www.google-analytics.com/ga.js">').tag("https",'<script src="https://ssl.google-analytics.com/ga.js">');GA.on("construct",function(integration){if(!integration.options.classic)return;integration.initialize=integration.initializeClassic;integration.loaded=integration.loadedClassic;integration.page=integration.pageClassic;integration.track=integration.trackClassic;integration.completedOrder=integration.completedOrderClassic});GA.prototype.initialize=function(){var opts=this.options;window.GoogleAnalyticsObject="ga";window.ga=window.ga||function(){window.ga.q=window.ga.q||[];window.ga.q.push(arguments)};window.ga.l=(new Date).getTime();window.ga("create",opts.trackingId,{cookieDomain:opts.domain||GA.prototype.defaults.domain,siteSpeedSampleRate:opts.siteSpeedSampleRate,allowLinker:true});if(opts.doubleClick){window.ga("require","displayfeatures")}if(opts.sendUserId&&user.id()){window.ga("set","userId",user.id())}if(opts.anonymizeIp)window.ga("set","anonymizeIp",true);var custom=metrics(user.traits(),opts);if(length(custom))window.ga("set",custom);this.load("library",this.ready)};GA.prototype.loaded=function(){return!!window.gaplugins};GA.prototype.page=function(page){var category=page.category();var props=page.properties();var name=page.fullName();var pageview={};var track;this._category=category;window.ga("send","pageview",{page:path(props,this.options),title:name||props.title,location:props.url});if(category&&this.options.trackCategorizedPages){track=page.track(category);this.track(track,{noninteraction:true})}if(name&&this.options.trackNamedPages){track=page.track(name);this.track(track,{noninteraction:true})}};GA.prototype.track=function(track,options){var opts=options||track.options(this.name);var props=track.properties();window.ga("send","event",{eventAction:track.event(),eventCategory:props.category||this._category||"All",eventLabel:props.label,eventValue:formatValue(props.value||track.revenue()),nonInteraction:props.noninteraction||opts.noninteraction})};GA.prototype.completedOrder=function(track){var total=track.total()||track.revenue()||0;var orderId=track.orderId();var products=track.products();var props=track.properties();if(!orderId)return;if(!this.ecommerce){window.ga("require","ecommerce","ecommerce.js");this.ecommerce=true}window.ga("ecommerce:addTransaction",{affiliation:props.affiliation,shipping:track.shipping(),revenue:total,tax:track.tax(),id:orderId,currency:track.currency()});each(products,function(product){var track=new Track({properties:product});window.ga("ecommerce:addItem",{category:track.category(),quantity:track.quantity(),price:track.price(),name:track.name(),sku:track.sku(),id:orderId,currency:track.currency()})});window.ga("ecommerce:send")};GA.prototype.initializeClassic=function(){var opts=this.options;var anonymize=opts.anonymizeIp;var db=opts.doubleClick;var domain=opts.domain;var enhanced=opts.enhancedLinkAttribution;var ignore=opts.ignoredReferrers;var sample=opts.siteSpeedSampleRate;window._gaq=window._gaq||[];push("_setAccount",opts.trackingId);push("_setAllowLinker",true);if(anonymize)push("_gat._anonymizeIp");if(domain)push("_setDomainName",domain);if(sample)push("_setSiteSpeedSampleRate",sample);if(enhanced){var protocol="https:"===document.location.protocol?"https:":"http:";var pluginUrl=protocol+"//www.google-analytics.com/plugins/ga/inpage_linkid.js";push("_require","inpage_linkid",pluginUrl)}if(ignore){if(!is.array(ignore))ignore=[ignore];each(ignore,function(domain){push("_addIgnoredRef",domain)})}if(this.options.doubleClick){this.load("double click",this.ready)}else{var name=useHttps()?"https":"http";this.load(name,this.ready)}};GA.prototype.loadedClassic=function(){return!!(window._gaq&&window._gaq.push!==Array.prototype.push)};GA.prototype.pageClassic=function(page){var opts=page.options(this.name);var category=page.category();var props=page.properties();var name=page.fullName();var track;push("_trackPageview",path(props,this.options));if(category&&this.options.trackCategorizedPages){track=page.track(category);this.track(track,{noninteraction:true})}if(name&&this.options.trackNamedPages){track=page.track(name);this.track(track,{noninteraction:true})}};GA.prototype.trackClassic=function(track,options){var opts=options||track.options(this.name);var props=track.properties();var revenue=track.revenue();var event=track.event();var category=this._category||props.category||"All";var label=props.label;var value=formatValue(revenue||props.value);var noninteraction=props.noninteraction||opts.noninteraction;push("_trackEvent",category,event,label,value,noninteraction)};GA.prototype.completedOrderClassic=function(track){var total=track.total()||track.revenue()||0;var orderId=track.orderId();var products=track.products()||[];var props=track.properties();var currency=track.currency();if(!orderId)return;push("_addTrans",orderId,props.affiliation,total,track.tax(),track.shipping(),track.city(),track.state(),track.country());each(products,function(product){var track=new Track({properties:product});push("_addItem",orderId,track.sku(),track.name(),track.category(),track.price(),track.quantity())});push("_set","currencyCode",currency);push("_trackTrans")};function path(properties,options){if(!properties)return;var str=properties.path;if(options.includeSearch&&properties.search)str+=properties.search;return str}function formatValue(value){if(!value||value<0)return 0;return Math.round(value)}function metrics(obj,data){var dimensions=data.dimensions;var metrics=data.metrics;var names=keys(metrics).concat(keys(dimensions));var ret={};for(var i=0;i<names.length;++i){var name=names[i];var key=metrics[name]||dimensions[name];var value=dot(obj,name)||obj[name];if(null==value)continue;ret[key]=value}return ret}},{"analytics.js-integration":84,"global-queue":169,object:176,canonical:177,"use-https":86,facade:127,callback:89,"load-script":124,"obj-case":139,each:4,type:7,url:178,is:87}],176:[function(require,module,exports){var has=Object.prototype.hasOwnProperty;exports.keys=Object.keys||function(obj){var keys=[];for(var key in obj){if(has.call(obj,key)){keys.push(key)}}return keys};exports.values=function(obj){var vals=[];for(var key in obj){if(has.call(obj,key)){vals.push(obj[key])}}return vals};exports.merge=function(a,b){for(var key in b){if(has.call(b,key)){a[key]=b[key]}}return a};exports.length=function(obj){return exports.keys(obj).length};exports.isEmpty=function(obj){return 0==exports.length(obj)}},{}],177:[function(require,module,exports){module.exports=function canonical(){var tags=document.getElementsByTagName("link");for(var i=0,tag;tag=tags[i];i++){if("canonical"==tag.getAttribute("rel"))return tag.getAttribute("href")}}},{}],178:[function(require,module,exports){exports.parse=function(url){var a=document.createElement("a");a.href=url;return{href:a.href,host:a.host,port:a.port,hash:a.hash,hostname:a.hostname,pathname:a.pathname,protocol:a.protocol,search:a.search,query:a.search.slice(1)}};exports.isAbsolute=function(url){if(0==url.indexOf("//"))return true;if(~url.indexOf("://"))return true;return false};exports.isRelative=function(url){return!exports.isAbsolute(url)};exports.isCrossDomain=function(url){url=exports.parse(url);return url.hostname!=location.hostname||url.port!=location.port||url.protocol!=location.protocol}},{}],36:[function(require,module,exports){var push=require("global-queue")("dataLayer",{wrap:false});var integration=require("analytics.js-integration");var GTM=module.exports=integration("Google Tag Manager").assumesPageview().global("dataLayer").global("google_tag_manager").option("containerId","").option("trackNamedPages",true).option("trackCategorizedPages",true).tag('<script src="//www.googletagmanager.com/gtm.js?id={{ containerId }}&l=dataLayer">');GTM.prototype.initialize=function(){push({"gtm.start":+new Date,event:"gtm.js"});this.load(this.ready)};GTM.prototype.loaded=function(){return!!(window.dataLayer&&[].push!=window.dataLayer.push)};GTM.prototype.page=function(page){var category=page.category();var props=page.properties();var name=page.fullName();var opts=this.options;var track;if(opts.trackAllPages){this.track(page.track())}if(category&&opts.trackCategorizedPages){this.track(page.track(category))}if(name&&opts.trackNamedPages){this.track(page.track(name))}};GTM.prototype.track=function(track){var props=track.properties();props.event=track.event();push(props)}},{"global-queue":169,"analytics.js-integration":84}],37:[function(require,module,exports){var integration=require("analytics.js-integration");var Identify=require("facade").Identify;var Track=require("facade").Track;var callback=require("callback");var load=require("load-script");var onBody=require("on-body");var each=require("each");var GoSquared=module.exports=integration("GoSquared").assumesPageview().global("_gs").option("siteToken","").option("anonymizeIP",false).option("cookieDomain",null).option("useCookies",true).option("trackHash",false).option("trackLocal",false).option("trackParams",true).tag('<script src="//d1l6p2sc9645hc.cloudfront.net/tracker.js">');GoSquared.prototype.initialize=function(page){var self=this;var options=this.options;var user=this.analytics.user();push(options.siteToken);each(options,function(name,value){if("siteToken"==name)return;if(null==value)return;push("set",name,value)});self.identify(new Identify({traits:user.traits(),userId:user.id()}));self.load(this.ready)};GoSquared.prototype.loaded=function(){return!!(window._gs&&window._gs.v)};GoSquared.prototype.page=function(page){var props=page.properties();var name=page.fullName();push("track",props.path,name||props.title)};GoSquared.prototype.identify=function(identify){var traits=identify.traits({userId:"userID"});var username=identify.username();var email=identify.email();var id=identify.userId();if(id)push("set","visitorID",id);var name=email||username||id;if(name)push("set","visitorName",name);push("set","visitor",traits)};GoSquared.prototype.track=function(track){push("event",track.event(),track.properties())};GoSquared.prototype.completedOrder=function(track){var products=track.products();var items=[];each(products,function(product){var track=new Track({properties:product});items.push({category:track.category(),quantity:track.quantity(),price:track.price(),name:track.name()})});push("transaction",track.orderId(),{revenue:track.total(),track:true},items)};function push(){var _gs=window._gs=window._gs||function(){(_gs.q=_gs.q||[]).push(arguments)};_gs.apply(null,arguments)}},{"analytics.js-integration":84,facade:127,callback:89,"load-script":124,"on-body":120,each:4}],38:[function(require,module,exports){var integration=require("analytics.js-integration");var alias=require("alias");var Heap=module.exports=integration("Heap").assumesPageview().global("heap").global("_heapid").option("apiKey","").tag('<script src="//d36lvucg9kzous.cloudfront.net">');Heap.prototype.initialize=function(page){window.heap=window.heap||[];window.heap.load=function(a){window._heapid=a;var d=function(a){return function(){window.heap.push([a].concat(Array.prototype.slice.call(arguments,0)))}},e=["identify","track"];for(var f=0;f<e.length;f++)window.heap[e[f]]=d(e[f])};window.heap.load(this.options.apiKey);this.load(this.ready)};Heap.prototype.loaded=function(){return window.heap&&window.heap.appid};Heap.prototype.identify=function(identify){var traits=identify.traits();var username=identify.username();var id=identify.userId();var handle=username||id;if(handle)traits.handle=handle;delete traits.username;window.heap.identify(traits)};Heap.prototype.track=function(track){window.heap.track(track.event(),track.properties())}},{"analytics.js-integration":84,alias:174}],39:[function(require,module,exports){var integration=require("analytics.js-integration");var Hellobar=module.exports=integration("Hello Bar").assumesPageview().global("_hbq").option("apiKey","").tag('<script src="//s3.amazonaws.com/scripts.hellobar.com/{{ apiKey }}.js">');Hellobar.prototype.initialize=function(page){window._hbq=window._hbq||[];this.load(this.ready)};Hellobar.prototype.loaded=function(){return!!(window._hbq&&window._hbq.push!==Array.prototype.push)}},{"analytics.js-integration":84}],40:[function(require,module,exports){var integration=require("analytics.js-integration");var is=require("is");var HitTail=module.exports=integration("HitTail").assumesPageview().global("htk").option("siteId","").tag('<script src="//{{ siteId }}.hittail.com/mlt.js">');HitTail.prototype.initialize=function(page){this.load(this.ready)};HitTail.prototype.loaded=function(){return is.fn(window.htk)}},{"analytics.js-integration":84,is:87}],41:[function(require,module,exports){var integration=require("analytics.js-integration");var Hublo=module.exports=integration("Hublo").assumesPageview().global("_hublo_").option("apiKey",null).tag('<script src="//cdn.hublo.co/{{ apiKey }}.js">');Hublo.prototype.initialize=function(page){this.load(this.ready)};Hublo.prototype.loaded=function(){return!!(window._hublo_&&typeof window._hublo_.setup==="function")}},{"analytics.js-integration":84}],42:[function(require,module,exports){var integration=require("analytics.js-integration");var push=require("global-queue")("_hsq");var convert=require("convert-dates");var HubSpot=module.exports=integration("HubSpot").assumesPageview().global("_hsq").option("portalId",null).tag('<script id="hs-analytics" src="https://js.hs-analytics.net/analytics/{{ cache }}/{{ portalId }}.js">');HubSpot.prototype.initialize=function(page){window._hsq=[];var cache=Math.ceil(new Date/3e5)*3e5;this.load({cache:cache},this.ready)};HubSpot.prototype.loaded=function(){return!!(window._hsq&&window._hsq.push!==Array.prototype.push)};HubSpot.prototype.page=function(page){push("_trackPageview")};HubSpot.prototype.identify=function(identify){if(!identify.email())return;var traits=identify.traits();traits=convertDates(traits);push("identify",traits)};HubSpot.prototype.track=function(track){var props=track.properties();props=convertDates(props);push("trackEvent",track.event(),props)};function convertDates(properties){return convert(properties,function(date){return date.getTime()})}},{"analytics.js-integration":84,"global-queue":169,"convert-dates":175}],43:[function(require,module,exports){var integration=require("analytics.js-integration");var alias=require("alias");var Improvely=module.exports=integration("Improvely").assumesPageview().global("_improvely").global("improvely").option("domain","").option("projectId",null).tag('<script src="//{{ domain }}.iljmp.com/improvely.js">');Improvely.prototype.initialize=function(page){window._improvely=[];window.improvely={init:function(e,t){window._improvely.push(["init",e,t])},goal:function(e){window._improvely.push(["goal",e])},label:function(e){window._improvely.push(["label",e])}};var domain=this.options.domain;var id=this.options.projectId;window.improvely.init(domain,id);this.load(this.ready)};Improvely.prototype.loaded=function(){return!!(window.improvely&&window.improvely.identify)};Improvely.prototype.identify=function(identify){var id=identify.userId();if(id)window.improvely.label(id)};Improvely.prototype.track=function(track){var props=track.properties({revenue:"amount"});props.type=track.event();window.improvely.goal(props)}},{"analytics.js-integration":84,alias:174}],44:[function(require,module,exports){var integration=require("analytics.js-integration");var push=require("global-queue")("_iva");var Track=require("facade").Track;var is=require("is");var has=Object.prototype.hasOwnProperty;var InsideVault=module.exports=integration("InsideVault").global("_iva").option("clientId","").option("domain","").tag('<script src="//analytics.staticiv.com/iva.js">').mapping("events");InsideVault.prototype.initialize=function(page){var domain=this.options.domain;window._iva=window._iva||[];push("setClientId",this.options.clientId);if(domain)push("setDomain",domain);this.load(this.ready)};InsideVault.prototype.loaded=function(){return!!(window._iva&&window._iva.push!==Array.prototype.push)};InsideVault.prototype.page=function(page){push("trackEvent","click")};InsideVault.prototype.track=function(track){var user=this.analytics.user();var events=this.options.events;var event=track.event();var value=track.revenue()||track.value()||0;var eventId=track.orderId()||user.id()||"";if(!has.call(events,event))return;event=events[event];if(event!="sale"){push("trackEvent",event,value,eventId)}}},{"analytics.js-integration":84,"global-queue":169,facade:127,is:87}],45:[function(require,module,exports){var integration=require("analytics.js-integration");var push=require("global-queue")("__insp");var alias=require("alias");var clone=require("clone");var Inspectlet=module.exports=integration("Inspectlet").assumesPageview().global("__insp").global("__insp_").option("wid","").tag('<script src="//www.inspectlet.com/inspectlet.js">');Inspectlet.prototype.initialize=function(page){push("wid",this.options.wid);this.load(this.ready)};Inspectlet.prototype.loaded=function(){return!!window.__insp_};Inspectlet.prototype.identify=function(identify){var traits=identify.traits({id:"userid"});push("tagSession",traits)};Inspectlet.prototype.track=function(track){push("tagSession",track.event())}},{"analytics.js-integration":84,"global-queue":169,alias:174,clone:173}],46:[function(require,module,exports){var integration=require("analytics.js-integration");var convertDates=require("convert-dates");var defaults=require("defaults");var isEmail=require("is-email");var load=require("load-script");var empty=require("is-empty");var alias=require("alias");var each=require("each");var when=require("when");var is=require("is");var Intercom=module.exports=integration("Intercom").assumesPageview().global("Intercom").option("activator","#IntercomDefaultWidget").option("appId","").option("inbox",false).tag('<script src="https://static.intercomcdn.com/intercom.v1.js">');Intercom.prototype.initialize=function(page){var self=this;this.load(function(){when(function(){return self.loaded()},self.ready)})};Intercom.prototype.loaded=function(){return is.fn(window.Intercom)};Intercom.prototype.page=function(page){window.Intercom("update")};Intercom.prototype.identify=function(identify){var traits=identify.traits({userId:"user_id"});var activator=this.options.activator;var opts=identify.options(this.name);var companyCreated=identify.companyCreated();var created=identify.created();var email=identify.email();var name=identify.name();var id=identify.userId();var group=this.analytics.group();if(!id&&!traits.email)return;traits.app_id=this.options.appId;if(null!=traits.company&&!is.object(traits.company))delete traits.company;if(traits.company)defaults(traits.company,group.traits());if(name)traits.name=name;if(traits.company&&companyCreated)traits.company.created=companyCreated;if(created)traits.created=created;traits=convertDates(traits,formatDate);traits=alias(traits,{created:"created_at"});if(traits.company)traits.company=alias(traits.company,{created:"created_at"});if(opts.increments)traits.increments=opts.increments;if(opts.userHash)traits.user_hash=opts.userHash;if(opts.user_hash)traits.user_hash=opts.user_hash;if("#IntercomDefaultWidget"!=activator){traits.widget={activator:activator}}var method=this._id!==id?"boot":"update";this._id=id;window.Intercom(method,traits)};Intercom.prototype.group=function(group){var props=group.properties();var id=group.groupId();if(id)props.id=id;window.Intercom("update",{company:props})};Intercom.prototype.track=function(track){window.Intercom("trackEvent",track.event(),track.properties())};function formatDate(date){return Math.floor(date/1e3)}},{"analytics.js-integration":84,"convert-dates":175,defaults:168,"is-email":164,"load-script":124,"is-empty":119,alias:174,each:4,when:126,is:87}],47:[function(require,module,exports){var integration=require("analytics.js-integration");var Keen=module.exports=integration("Keen IO").global("Keen").option("projectId","").option("readKey","").option("writeKey","").option("trackNamedPages",true).option("trackAllPages",false).option("trackCategorizedPages",true).tag('<script src="//dc8na2hxrj29i.cloudfront.net/code/keen-2.1.0-min.js">');Keen.prototype.initialize=function(){var options=this.options;window.Keen=window.Keen||{configure:function(e){this._cf=e},addEvent:function(e,t,n,i){this._eq=this._eq||[],this._eq.push([e,t,n,i])},setGlobalProperties:function(e){this._gp=e},onChartsReady:function(e){this._ocrq=this._ocrq||[],this._ocrq.push(e)}};window.Keen.configure({projectId:options.projectId,writeKey:options.writeKey,readKey:options.readKey});this.load(this.ready)};Keen.prototype.loaded=function(){return!!(window.Keen&&window.Keen.Base64)};Keen.prototype.page=function(page){var category=page.category();var props=page.properties();var name=page.fullName();var opts=this.options;if(opts.trackAllPages){this.track(page.track())}if(name&&opts.trackNamedPages){this.track(page.track(name))}if(category&&opts.trackCategorizedPages){this.track(page.track(category))}};Keen.prototype.identify=function(identify){var traits=identify.traits();var id=identify.userId();var user={};if(id)user.userId=id;if(traits)user.traits=traits;window.Keen.setGlobalProperties(function(){return{user:user}})};Keen.prototype.track=function(track){window.Keen.addEvent(track.event(),track.properties())}},{"analytics.js-integration":84}],48:[function(require,module,exports){var integration=require("analytics.js-integration");var indexof=require("indexof");var is=require("is");var Kenshoo=module.exports=integration("Kenshoo").global("k_trackevent").option("cid","").option("subdomain","").option("events",[]).tag('<script src="//{{ subdomain }}.xg4ken.com/media/getpx.php?cid={{ cid }}">');Kenshoo.prototype.initialize=function(page){this.load(this.ready)};Kenshoo.prototype.loaded=function(){return is.fn(window.k_trackevent)};Kenshoo.prototype.track=function(track){var events=this.options.events;var traits=track.traits();var event=track.event();var revenue=track.revenue()||0;if(!~indexof(events,event))return;var params=["id="+this.options.cid,"type=conv","val="+revenue,"orderId="+track.orderId(),"promoCode="+track.coupon(),"valueCurrency="+track.currency(),"GCID=","kw=","product="];window.k_trackevent(params,this.options.subdomain)}},{"analytics.js-integration":84,indexof:110,is:87}],49:[function(require,module,exports){var integration=require("analytics.js-integration");var push=require("global-queue")("_kmq");var Track=require("facade").Track;var alias=require("alias");var Batch=require("batch");var each=require("each");var is=require("is");var KISSmetrics=module.exports=integration("KISSmetrics").assumesPageview().global("_kmq").global("KM").global("_kmil").option("apiKey","").option("trackNamedPages",true).option("trackCategorizedPages",true).option("prefixProperties",true).tag("useless",'<script src="//i.kissmetrics.com/i.js">').tag("library",'<script src="//doug1izaerwt3.cloudfront.net/{{ apiKey }}.1.js">');exports.isMobile=navigator.userAgent.match(/Android/i)||navigator.userAgent.match(/BlackBerry/i)||navigator.userAgent.match(/iPhone|iPod/i)||navigator.userAgent.match(/iPad/i)||navigator.userAgent.match(/Opera Mini/i)||navigator.userAgent.match(/IEMobile/i); KISSmetrics.prototype.initialize=function(page){var self=this;window._kmq=[];if(exports.isMobile)push("set",{"Mobile Session":"Yes"});var batch=new Batch;batch.push(function(done){self.load("useless",done)});batch.push(function(done){self.load("library",done)});batch.end(function(){self.trackPage(page);self.ready()})};KISSmetrics.prototype.loaded=function(){return is.object(window.KM)};KISSmetrics.prototype.page=function(page){if(!window.KM_SKIP_PAGE_VIEW)window.KM.pageView();this.trackPage(page)};KISSmetrics.prototype.trackPage=function(page){var category=page.category();var name=page.fullName();var opts=this.options;if(name&&opts.trackNamedPages){this.track(page.track(name))}if(category&&opts.trackCategorizedPages){this.track(page.track(category))}};KISSmetrics.prototype.identify=function(identify){var traits=identify.traits();var id=identify.userId();if(id)push("identify",id);if(traits)push("set",traits)};KISSmetrics.prototype.track=function(track){var mapping={revenue:"Billing Amount"};var event=track.event();var properties=track.properties(mapping);if(this.options.prefixProperties)properties=prefix(event,properties);push("record",event,properties)};KISSmetrics.prototype.alias=function(alias){push("alias",alias.to(),alias.from())};KISSmetrics.prototype.completedOrder=function(track){var products=track.products();var event=track.event();push("record",event,prefix(event,track.properties()));window._kmq.push(function(){var km=window.KM;each(products,function(product,i){var temp=new Track({event:event,properties:product});var item=prefix(event,product);item._t=km.ts()+i;item._d=1;km.set(item)})})};function prefix(event,properties){var prefixed={};each(properties,function(key,val){if(key==="Billing Amount"){prefixed[key]=val}else{prefixed[event+" - "+key]=val}});return prefixed}},{"analytics.js-integration":84,"global-queue":169,facade:127,alias:174,batch:179,each:4,is:87}],179:[function(require,module,exports){try{var EventEmitter=require("events").EventEmitter}catch(err){var Emitter=require("emitter")}function noop(){}module.exports=Batch;function Batch(){if(!(this instanceof Batch))return new Batch;this.fns=[];this.concurrency(Infinity);this.throws(true);for(var i=0,len=arguments.length;i<len;++i){this.push(arguments[i])}}if(EventEmitter){Batch.prototype.__proto__=EventEmitter.prototype}else{Emitter(Batch.prototype)}Batch.prototype.concurrency=function(n){this.n=n;return this};Batch.prototype.push=function(fn){this.fns.push(fn);return this};Batch.prototype.throws=function(throws){this.e=!!throws;return this};Batch.prototype.end=function(cb){var self=this,total=this.fns.length,pending=total,results=[],errors=[],cb=cb||noop,fns=this.fns,max=this.n,throws=this.e,index=0,done;if(!fns.length)return cb(null,results);function next(){var i=index++;var fn=fns[i];if(!fn)return;var start=new Date;try{fn(callback)}catch(err){callback(err)}function callback(err,res){if(done)return;if(err&&throws)return done=true,cb(err);var complete=total-pending+1;var end=new Date;results[i]=res;errors[i]=err;self.emit("progress",{index:i,value:res,error:err,pending:pending,total:total,complete:complete,percent:complete/total*100|0,start:start,end:end,duration:end-start});if(--pending)next();else if(!throws)cb(errors,results);else cb(null,results)}}for(var i=0;i<fns.length;i++){if(i==max)break;next()}return this}},{emitter:180}],180:[function(require,module,exports){module.exports=Emitter;function Emitter(obj){if(obj)return mixin(obj)}function mixin(obj){for(var key in Emitter.prototype){obj[key]=Emitter.prototype[key]}return obj}Emitter.prototype.on=Emitter.prototype.addEventListener=function(event,fn){this._callbacks=this._callbacks||{};(this._callbacks[event]=this._callbacks[event]||[]).push(fn);return this};Emitter.prototype.once=function(event,fn){var self=this;this._callbacks=this._callbacks||{};function on(){self.off(event,on);fn.apply(this,arguments)}on.fn=fn;this.on(event,on);return this};Emitter.prototype.off=Emitter.prototype.removeListener=Emitter.prototype.removeAllListeners=Emitter.prototype.removeEventListener=function(event,fn){this._callbacks=this._callbacks||{};if(0==arguments.length){this._callbacks={};return this}var callbacks=this._callbacks[event];if(!callbacks)return this;if(1==arguments.length){delete this._callbacks[event];return this}var cb;for(var i=0;i<callbacks.length;i++){cb=callbacks[i];if(cb===fn||cb.fn===fn){callbacks.splice(i,1);break}}return this};Emitter.prototype.emit=function(event){this._callbacks=this._callbacks||{};var args=[].slice.call(arguments,1),callbacks=this._callbacks[event];if(callbacks){callbacks=callbacks.slice(0);for(var i=0,len=callbacks.length;i<len;++i){callbacks[i].apply(this,args)}}return this};Emitter.prototype.listeners=function(event){this._callbacks=this._callbacks||{};return this._callbacks[event]||[]};Emitter.prototype.hasListeners=function(event){return!!this.listeners(event).length}},{}],50:[function(require,module,exports){var integration=require("analytics.js-integration");var push=require("global-queue")("_learnq");var tick=require("next-tick");var alias=require("alias");var aliases={id:"$id",email:"$email",firstName:"$first_name",lastName:"$last_name",phone:"$phone_number",title:"$title"};var Klaviyo=module.exports=integration("Klaviyo").assumesPageview().global("_learnq").option("apiKey","").tag('<script src="//a.klaviyo.com/media/js/learnmarklet.js">');Klaviyo.prototype.initialize=function(page){var self=this;push("account",this.options.apiKey);this.load(function(){tick(self.ready)})};Klaviyo.prototype.loaded=function(){return!!(window._learnq&&window._learnq.push!==Array.prototype.push)};Klaviyo.prototype.identify=function(identify){var traits=identify.traits(aliases);if(!traits.$id&&!traits.$email)return;push("identify",traits)};Klaviyo.prototype.group=function(group){var props=group.properties();if(!props.name)return;push("identify",{$organization:props.name})};Klaviyo.prototype.track=function(track){push("track",track.event(),track.properties({revenue:"$value"}))}},{"analytics.js-integration":84,"global-queue":169,"next-tick":98,alias:174}],51:[function(require,module,exports){var integration=require("analytics.js-integration");var LeadLander=module.exports=integration("LeadLander").assumesPageview().global("llactid").global("trackalyzer").option("accountId",null).tag('<script src="http://t6.trackalyzer.com/trackalyze-nodoc.js">');LeadLander.prototype.initialize=function(page){window.llactid=this.options.accountId;this.load(this.ready)};LeadLander.prototype.loaded=function(){return!!window.trackalyzer}},{"analytics.js-integration":84}],52:[function(require,module,exports){var integration=require("analytics.js-integration");var clone=require("clone");var each=require("each");var Identify=require("facade").Identify;var when=require("when");var LiveChat=module.exports=integration("LiveChat").assumesPageview().global("__lc").global("__lc_inited").global("LC_API").global("LC_Invite").option("group",0).option("license","").tag('<script src="//cdn.livechatinc.com/tracking.js">');LiveChat.prototype.initialize=function(page){var self=this;var user=this.analytics.user();var identify=new Identify({userId:user.id(),traits:user.traits()});window.__lc=clone(this.options);window.__lc.visitor={name:identify.name(),email:identify.email()};this.load(function(){when(function(){return self.loaded()},self.ready)})};LiveChat.prototype.loaded=function(){return!!(window.LC_API&&window.LC_Invite)};LiveChat.prototype.identify=function(identify){var traits=identify.traits({userId:"User ID"});window.LC_API.set_custom_variables(convert(traits))};function convert(traits){var arr=[];each(traits,function(key,value){arr.push({name:key,value:value})});return arr}},{"analytics.js-integration":84,clone:173,each:4,facade:127,when:126}],53:[function(require,module,exports){var integration=require("analytics.js-integration");var Identify=require("facade").Identify;var useHttps=require("use-https");var LuckyOrange=module.exports=integration("Lucky Orange").assumesPageview().global("_loq").global("__wtw_watcher_added").global("__wtw_lucky_site_id").global("__wtw_lucky_is_segment_io").global("__wtw_custom_user_data").option("siteId",null).tag("http",'<script src="http://www.luckyorange.com/w.js?{{ cache }}">').tag("https",'<script src="https://ssl.luckyorange.com/w.js?{{ cache }}">');LuckyOrange.prototype.initialize=function(page){var user=this.analytics.user();window._loq||(window._loq=[]);window.__wtw_lucky_site_id=this.options.siteId;this.identify(new Identify({traits:user.traits(),userId:user.id()}));var cache=Math.floor((new Date).getTime()/6e4);var name=useHttps()?"https":"http";this.load(name,{cache:cache},this.ready)};LuckyOrange.prototype.loaded=function(){return!!window.__wtw_watcher_added};LuckyOrange.prototype.identify=function(identify){var traits=identify.traits();var email=identify.email();var name=identify.name();if(name)traits.name=name;if(email)traits.email=email;window.__wtw_custom_user_data=traits}},{"analytics.js-integration":84,facade:127,"use-https":86}],54:[function(require,module,exports){var integration=require("analytics.js-integration");var alias=require("alias");var Lytics=module.exports=integration("Lytics").global("jstag").option("cid","").option("cookie","seerid").option("delay",2e3).option("sessionTimeout",1800).option("url","//c.lytics.io").tag('<script src="//c.lytics.io/static/io.min.js">');var aliases={sessionTimeout:"sessecs"};Lytics.prototype.initialize=function(page){var options=alias(this.options,aliases);window.jstag=function(){var t={_q:[],_c:options,ts:(new Date).getTime()};t.send=function(){this._q.push(["ready","send",Array.prototype.slice.call(arguments)]);return this};return t}();this.load(this.ready)};Lytics.prototype.loaded=function(){return!!(window.jstag&&window.jstag.bind)};Lytics.prototype.page=function(page){window.jstag.send(page.properties())};Lytics.prototype.identify=function(identify){var traits=identify.traits({userId:"_uid"});window.jstag.send(traits)};Lytics.prototype.track=function(track){var props=track.properties();props._e=track.event();window.jstag.send(props)}},{"analytics.js-integration":84,alias:174}],55:[function(require,module,exports){var alias=require("alias");var clone=require("clone");var dates=require("convert-dates");var integration=require("analytics.js-integration");var is=require("is");var iso=require("to-iso-string");var indexof=require("indexof");var del=require("obj-case").del;var Mixpanel=module.exports=integration("Mixpanel").global("mixpanel").option("increments",[]).option("cookieName","").option("nameTag",true).option("pageview",false).option("people",false).option("token","").option("trackAllPages",false).option("trackNamedPages",true).option("trackCategorizedPages",true).tag('<script src="//cdn.mxpnl.com/libs/mixpanel-2.2.min.js">');var optionsAliases={cookieName:"cookie_name"};Mixpanel.prototype.initialize=function(){(function(c,a){window.mixpanel=a;var b,d,h,e;a._i=[];a.init=function(b,c,f){function d(a,b){var c=b.split(".");2==c.length&&(a=a[c[0]],b=c[1]);a[b]=function(){a.push([b].concat(Array.prototype.slice.call(arguments,0)))}}var g=a;"undefined"!==typeof f?g=a[f]=[]:f="mixpanel";g.people=g.people||[];h=["disable","track","track_pageview","track_links","track_forms","register","register_once","unregister","identify","alias","name_tag","set_config","people.set","people.increment","people.track_charge","people.append"];for(e=0;e<h.length;e++)d(g,h[e]);a._i.push([b,c,f])};a.__SV=1.2})(document,window.mixpanel||[]);this.options.increments=lowercase(this.options.increments);var options=alias(this.options,optionsAliases);window.mixpanel.init(options.token,options);this.load(this.ready)};Mixpanel.prototype.loaded=function(){return!!(window.mixpanel&&window.mixpanel.config)};Mixpanel.prototype.page=function(page){var category=page.category();var name=page.fullName();var opts=this.options;if(opts.trackAllPages){this.track(page.track())}if(category&&opts.trackCategorizedPages){this.track(page.track(category))}if(name&&opts.trackNamedPages){this.track(page.track(name))}};var traitAliases={created:"$created",email:"$email",firstName:"$first_name",lastName:"$last_name",lastSeen:"$last_seen",name:"$name",username:"$username",phone:"$phone"};Mixpanel.prototype.identify=function(identify){var username=identify.username();var email=identify.email();var id=identify.userId();if(id)window.mixpanel.identify(id);var nametag=email||username||id;if(nametag)window.mixpanel.name_tag(nametag);var traits=identify.traits(traitAliases);if(traits.$created)del(traits,"createdAt");window.mixpanel.register(traits);if(this.options.people)window.mixpanel.people.set(traits)};Mixpanel.prototype.track=function(track){var increments=this.options.increments;var increment=track.event().toLowerCase();var people=this.options.people;var props=track.properties();var revenue=track.revenue();delete props.distinct_id;delete props.ip;delete props.mp_name_tag;delete props.mp_note;delete props.token;for(var key in props){var val=props[key];if(is.array(val))props[key]=val.length}if(people&&~indexof(increments,increment)){window.mixpanel.people.increment(track.event());window.mixpanel.people.set("Last "+track.event(),new Date)}props=dates(props,iso);window.mixpanel.track(track.event(),props);if(revenue&&people){window.mixpanel.people.track_charge(revenue)}};Mixpanel.prototype.alias=function(alias){var mp=window.mixpanel;var to=alias.to();if(mp.get_distinct_id&&mp.get_distinct_id()===to)return;if(mp.get_property&&mp.get_property("$people_distinct_id")===to)return;mp.alias(to,alias.from())};function lowercase(arr){var ret=new Array(arr.length);for(var i=0;i<arr.length;++i){ret[i]=String(arr[i]).toLowerCase()}return ret}},{alias:174,clone:173,"convert-dates":175,"analytics.js-integration":84,is:87,"to-iso-string":172,indexof:110,"obj-case":139}],56:[function(require,module,exports){var integration=require("analytics.js-integration");var bind=require("bind");var when=require("when");var is=require("is");var Mojn=module.exports=integration("Mojn").option("customerCode","").global("_mojnTrack").tag('<script src="https://track.idtargeting.com/{{ customerCode }}/track.js">');Mojn.prototype.initialize=function(){window._mojnTrack=window._mojnTrack||[];window._mojnTrack.push({cid:this.options.customerCode});var loaded=bind(this,this.loaded);var ready=this.ready;this.load(function(){when(loaded,ready)})};Mojn.prototype.loaded=function(){return is.object(window._mojnTrack)};Mojn.prototype.identify=function(identify){var email=identify.email();if(!email)return;var img=new Image;img.src="//matcher.idtargeting.com/analytics.gif?cid="+this.options.customerCode+"&_mjnctid="+email;img.width=1;img.height=1;return img};Mojn.prototype.track=function(track){var properties=track.properties();var revenue=properties.revenue;var currency=properties.currency||"";var conv=currency+revenue;if(!revenue)return;window._mojnTrack.push({conv:conv});return conv}},{"analytics.js-integration":84,bind:96,when:126,is:87}],57:[function(require,module,exports){var push=require("global-queue")("_mfq");var integration=require("analytics.js-integration");var each=require("each");var Mouseflow=module.exports=integration("Mouseflow").assumesPageview().global("mouseflow").global("_mfq").option("apiKey","").option("mouseflowHtmlDelay",0).tag('<script src="//cdn.mouseflow.com/projects/{{ apiKey }}.js">');Mouseflow.prototype.initialize=function(page){window.mouseflowHtmlDelay=this.options.mouseflowHtmlDelay;this.load(this.ready)};Mouseflow.prototype.loaded=function(){return!!window.mouseflow};Mouseflow.prototype.page=function(page){if(!window.mouseflow)return;if("function"!=typeof mouseflow.newPageView)return;mouseflow.newPageView()};Mouseflow.prototype.identify=function(identify){set(identify.traits())};Mouseflow.prototype.track=function(track){var props=track.properties();props.event=track.event();set(props)};function set(obj){each(obj,function(key,value){push("setVariable",key,value)})}},{"global-queue":169,"analytics.js-integration":84,each:4}],58:[function(require,module,exports){var integration=require("analytics.js-integration");var useHttps=require("use-https");var each=require("each");var is=require("is");var MouseStats=module.exports=integration("MouseStats").assumesPageview().global("msaa").global("MouseStatsVisitorPlaybacks").option("accountNumber","").tag("http",'<script src="http://www2.mousestats.com/js/{{ path }}.js?{{ cache }}">').tag("https",'<script src="https://ssl.mousestats.com/js/{{ path }}.js?{{ cache }}">');MouseStats.prototype.initialize=function(page){var number=this.options.accountNumber;var path=number.slice(0,1)+"/"+number.slice(1,2)+"/"+number;var cache=Math.floor((new Date).getTime()/6e4);var name=useHttps()?"https":"http";this.load(name,{path:path,cache:cache},this.ready)};MouseStats.prototype.loaded=function(){return is.array(window.MouseStatsVisitorPlaybacks)};MouseStats.prototype.identify=function(identify){each(identify.traits(),function(key,value){window.MouseStatsVisitorPlaybacks.customVariable(key,value)})}},{"analytics.js-integration":84,"use-https":86,each:4,is:87}],59:[function(require,module,exports){var integration=require("analytics.js-integration");var push=require("global-queue")("__nls");var Navilytics=module.exports=integration("Navilytics").assumesPageview().global("__nls").option("memberId","").option("projectId","").tag('<script src="//www.navilytics.com/nls.js?mid={{ memberId }}&pid={{ projectId }}">');Navilytics.prototype.initialize=function(page){window.__nls=window.__nls||[];this.load(this.ready)};Navilytics.prototype.loaded=function(){return!!(window.__nls&&[].push!=window.__nls.push)};Navilytics.prototype.track=function(track){push("tagRecording",track.event())}},{"analytics.js-integration":84,"global-queue":169}],60:[function(require,module,exports){var integration=require("analytics.js-integration");var https=require("use-https");var tick=require("next-tick");var Olark=module.exports=integration("Olark").assumesPageview().global("olark").option("identify",true).option("page",true).option("siteId","").option("groupId","").option("track",false);Olark.prototype.initialize=function(page){var self=this;this.load(function(){tick(self.ready)});var groupId=this.options.groupId;if(groupId){chat("setOperatorGroup",{group:groupId})}var self=this;box("onExpand",function(){self._open=true});box("onShrink",function(){self._open=false})};Olark.prototype.loaded=function(){return!!window.olark};Olark.prototype.load=function(callback){var el=document.getElementById("olark");window.olark||function(c){var f=window,d=document,l=https()?"https:":"http:",z=c.name,r="load";var nt=function(){f[z]=function(){(a.s=a.s||[]).push(arguments)};var a=f[z]._={},q=c.methods.length;while(q--){(function(n){f[z][n]=function(){f[z]("call",n,arguments)}})(c.methods[q])}a.l=c.loader;a.i=nt;a.p={0:+new Date};a.P=function(u){a.p[u]=new Date-a.p[0]};function s(){a.P(r);f[z](r)}f.addEventListener?f.addEventListener(r,s,false):f.attachEvent("on"+r,s);var ld=function(){function p(hd){hd="head";return["<",hd,"></",hd,"><",i," onl"+'oad="var d=',g,";d.getElementsByTagName('head')[0].",j,"(d.",h,"('script')).",k,"='",l,"//",a.l,"'",'"',"></",i,">"].join("")}var i="body",m=d[i];if(!m){return setTimeout(ld,100)}a.P(1);var j="appendChild",h="createElement",k="src",n=d[h]("div"),v=n[j](d[h](z)),b=d[h]("iframe"),g="document",e="domain",o;n.style.display="none";m.insertBefore(n,m.firstChild).id=z;b.frameBorder="0";b.id=z+"-loader";if(/MSIE[ ]+6/.test(navigator.userAgent)){b.src="javascript:false"}b.allowTransparency="true";v[j](b);try{b.contentWindow[g].open()}catch(w){c[e]=d[e];o="javascript:var d="+g+".open();d.domain='"+d.domain+"';";b[k]=o+"void(0);"}try{var t=b.contentWindow[g];t.write(p());t.close()}catch(x){b[k]=o+'d.write("'+p().replace(/"/g,String.fromCharCode(92)+'"')+'");d.close();'}a.P(2)};ld()};nt()}({loader:"static.olark.com/jsclient/loader0.js",name:"olark",methods:["configure","extend","declare","identify"]});window.olark.identify(this.options.siteId);callback()};Olark.prototype.page=function(page){if(!this.options.page||!this._open)return;var props=page.properties();var name=page.fullName();if(!name&&!props.url)return;var msg=name?name.toLowerCase()+" page":props.url;chat("sendNotificationToOperator",{body:"looking at "+msg})};Olark.prototype.identify=function(identify){if(!this.options.identify)return;var username=identify.username();var traits=identify.traits();var id=identify.userId();var email=identify.email();var phone=identify.phone();var name=identify.name()||identify.firstName();visitor("updateCustomFields",traits);if(email)visitor("updateEmailAddress",{emailAddress:email});if(phone)visitor("updatePhoneNumber",{phoneNumber:phone});if(name)visitor("updateFullName",{fullName:name});var nickname=name||email||username||id;if(name&&email)nickname+=" ("+email+")";if(nickname)chat("updateVisitorNickname",{snippet:nickname})};Olark.prototype.track=function(track){if(!this.options.track||!this._open)return;chat("sendNotificationToOperator",{body:'visitor triggered "'+track.event()+'"'})};function box(action,value){window.olark("api.box."+action,value)}function visitor(action,value){window.olark("api.visitor."+action,value)}function chat(action,value){window.olark("api.chat."+action,value)}},{"analytics.js-integration":84,"use-https":86,"next-tick":98}],61:[function(require,module,exports){var integration=require("analytics.js-integration");var push=require("global-queue")("optimizely");var callback=require("callback");var tick=require("next-tick");var bind=require("bind");var each=require("each");var Optimizely=module.exports=integration("Optimizely").option("variations",true).option("trackNamedPages",true).option("trackCategorizedPages",true);Optimizely.prototype.initialize=function(){if(this.options.variations){var self=this;tick(function(){self.replay()})}this.ready()};Optimizely.prototype.track=function(track){var props=track.properties();if(props.revenue)props.revenue*=100;push("trackEvent",track.event(),props)};Optimizely.prototype.page=function(page){var category=page.category();var name=page.fullName();var opts=this.options;if(category&&opts.trackCategorizedPages){this.track(page.track(category))}if(name&&opts.trackNamedPages){this.track(page.track(name))}};Optimizely.prototype.replay=function(){if(!window.optimizely)return;var data=window.optimizely.data;if(!data)return;var experiments=data.experiments;var map=data.state.variationNamesMap;var traits={};each(map,function(experimentId,variation){var experiment=experiments[experimentId].name;traits["Experiment: "+experiment]=variation});this.analytics.identify(traits)}},{"analytics.js-integration":84,"global-queue":169,callback:89,"next-tick":98,bind:96,each:4}],62:[function(require,module,exports){var integration=require("analytics.js-integration");var PerfectAudience=module.exports=integration("Perfect Audience").assumesPageview().global("_pa").option("siteId","").tag('<script src="//tag.perfectaudience.com/serve/{{ siteId }}.js">');PerfectAudience.prototype.initialize=function(page){window._pa=window._pa||{};this.load(this.ready)};PerfectAudience.prototype.loaded=function(){return!!(window._pa&&window._pa.track)};PerfectAudience.prototype.track=function(track){window._pa.track(track.event(),track.properties())}},{"analytics.js-integration":84}],63:[function(require,module,exports){var integration=require("analytics.js-integration");var push=require("global-queue")("_prum");var date=require("load-date");var Pingdom=module.exports=integration("Pingdom").assumesPageview().global("_prum").global("PRUM_EPISODES").option("id","").tag('<script src="//rum-static.pingdom.net/prum.min.js">');Pingdom.prototype.initialize=function(page){window._prum=window._prum||[];push("id",this.options.id);push("mark","firstbyte",date.getTime());var self=this;this.load(this.ready)};Pingdom.prototype.loaded=function(){return!!(window._prum&&window._prum.push!==Array.prototype.push)}},{"analytics.js-integration":84,"global-queue":169,"load-date":170}],64:[function(require,module,exports){var integration=require("analytics.js-integration");var push=require("global-queue")("_paq");var each=require("each");var Piwik=module.exports=integration("Piwik").global("_paq").option("url",null).option("siteId","").mapping("goals").tag('<script src="{{ url }}/piwik.js">');Piwik.prototype.initialize=function(){window._paq=window._paq||[];push("setSiteId",this.options.siteId);push("setTrackerUrl",this.options.url+"/piwik.php");push("enableLinkTracking");this.load(this.ready)};Piwik.prototype.loaded=function(){return!!(window._paq&&window._paq.push!=[].push)};Piwik.prototype.page=function(page){push("trackPageView")};Piwik.prototype.track=function(track){var goals=this.goals(track.event());var revenue=track.revenue()||0;each(goals,function(goal){push("trackGoal",goal,revenue)})}},{"analytics.js-integration":84,"global-queue":169,each:4}],65:[function(require,module,exports){var integration=require("analytics.js-integration");var convertDates=require("convert-dates");var push=require("global-queue")("_lnq");var alias=require("alias");var Preact=module.exports=integration("Preact").assumesPageview().global("_lnq").option("projectCode","").tag('<script src="//d2bbvl6dq48fa6.cloudfront.net/js/ln-2.4.min.js">');Preact.prototype.initialize=function(page){window._lnq=window._lnq||[];push("_setCode",this.options.projectCode);this.load(this.ready)};Preact.prototype.loaded=function(){return!!(window._lnq&&window._lnq.push!==Array.prototype.push)};Preact.prototype.identify=function(identify){if(!identify.userId())return;var traits=identify.traits({created:"created_at"});traits=convertDates(traits,convertDate);push("_setPersonData",{name:identify.name(),email:identify.email(),uid:identify.userId(),properties:traits})};Preact.prototype.group=function(group){if(!group.groupId())return;push("_setAccount",group.traits())};Preact.prototype.track=function(track){var props=track.properties();var revenue=track.revenue();var event=track.event();var special={name:event};if(revenue){special.revenue=revenue*100;delete props.revenue}if(props.note){special.note=props.note;delete props.note}push("_logEvent",special,props)};function convertDate(date){return Math.floor(date/1e3)}},{"analytics.js-integration":84,"convert-dates":175,"global-queue":169,alias:174}],66:[function(require,module,exports){var integration=require("analytics.js-integration");var push=require("global-queue")("_kiq");var Facade=require("facade");var Identify=Facade.Identify;var bind=require("bind");var when=require("when");var Qualaroo=module.exports=integration("Qualaroo").assumesPageview().global("_kiq").option("customerId","").option("siteToken","").option("track",false).tag('<script src="//s3.amazonaws.com/ki.js/{{ customerId }}/{{ siteToken }}.js">');Qualaroo.prototype.initialize=function(page){window._kiq=window._kiq||[];var loaded=bind(this,this.loaded);var ready=this.ready;this.load(function(){when(loaded,ready)})};Qualaroo.prototype.loaded=function(){return!!(window._kiq&&window._kiq.push!==Array.prototype.push)};Qualaroo.prototype.identify=function(identify){var traits=identify.traits();var id=identify.userId();var email=identify.email();if(email)id=email;if(id)push("identify",id);if(traits)push("set",traits)};Qualaroo.prototype.track=function(track){if(!this.options.track)return;var event=track.event();var traits={};traits["Triggered: "+event]=true;this.identify(new Identify({traits:traits}))}},{"analytics.js-integration":84,"global-queue":169,facade:127,bind:96,when:126}],67:[function(require,module,exports){var push=require("global-queue")("_qevents",{wrap:false});var integration=require("analytics.js-integration");var useHttps=require("use-https");var Quantcast=module.exports=integration("Quantcast").assumesPageview().global("_qevents").global("__qc").option("pCode",null).option("advertise",false).tag("http",'<script src="http://edge.quantserve.com/quant.js">').tag("https",'<script src="https://secure.quantserve.com/quant.js">');Quantcast.prototype.initialize=function(page){window._qevents=window._qevents||[];var opts=this.options;var settings={qacct:opts.pCode};var user=this.analytics.user();if(user.id())settings.uid=user.id();if(page){settings.labels=this.labels("page",page.category(),page.name())}push(settings);var name=useHttps()?"https":"http";this.load(name,this.ready)};Quantcast.prototype.loaded=function(){return!!window.__qc};Quantcast.prototype.page=function(page){var category=page.category();var name=page.name();var settings={event:"refresh",labels:this.labels("page",category,name),qacct:this.options.pCode};var user=this.analytics.user();if(user.id())settings.uid=user.id();push(settings)};Quantcast.prototype.identify=function(identify){var id=identify.userId();if(id){window._qevents[0]=window._qevents[0]||{};window._qevents[0].uid=id}};Quantcast.prototype.track=function(track){var name=track.event();var revenue=track.revenue();var settings={event:"click",labels:this.labels("event",name),qacct:this.options.pCode};var user=this.analytics.user();if(null!=revenue)settings.revenue=revenue+"";if(user.id())settings.uid=user.id();push(settings)};Quantcast.prototype.completedOrder=function(track){var name=track.event();var revenue=track.total();var labels=this.labels("event",name);var category=track.category();if(this.options.advertise&&category){labels+=","+this.labels("pcat",category)}var settings={event:"refresh",labels:labels,revenue:revenue+"",orderid:track.orderId(),qacct:this.options.pCode};push(settings)};Quantcast.prototype.labels=function(type){var args=[].slice.call(arguments,1);var advertise=this.options.advertise;var ret=[];if(advertise&&"page"==type)type="event";if(advertise)type="_fp."+type;for(var i=0;i<args.length;++i){if(null==args[i])continue;var value=String(args[i]);ret.push(value.replace(/,/g,";"))}ret=advertise?ret.join(" "):ret.join(".");return[type,ret].join(".")}},{"global-queue":169,"analytics.js-integration":84,"use-https":86}],68:[function(require,module,exports){var integration=require("analytics.js-integration");var extend=require("extend");var is=require("is");var RollbarIntegration=module.exports=integration("Rollbar").global("Rollbar").option("identify",true).option("accessToken","").option("environment","unknown").option("captureUncaught",true);RollbarIntegration.prototype.initialize=function(page){var _rollbarConfig=this.config={accessToken:this.options.accessToken,captureUncaught:this.options.captureUncaught,payload:{environment:this.options.environment}};(function(a){function b(b){this.shimId=++g,this.notifier=null,this.parentShim=b,this.logger=function(){},a.console&&void 0===a.console.shimId&&(this.logger=a.console.log)}function c(b,c,d){!d[4]&&a._rollbarWrappedError&&(d[4]=a._rollbarWrappedError,a._rollbarWrappedError=null),b.uncaughtError.apply(b,d),c&&c.apply(a,d)}function d(c){var d=b;return f(function(){if(this.notifier)return this.notifier[c].apply(this.notifier,arguments);var b=this,e="scope"===c;e&&(b=new d(this));var f=Array.prototype.slice.call(arguments,0),g={shim:b,method:c,args:f,ts:new Date};return a._rollbarShimQueue.push(g),e?b:void 0})}function e(a,b){if(b.hasOwnProperty&&b.hasOwnProperty("addEventListener")){var c=b.addEventListener;b.addEventListener=function(b,d,e){c.call(this,b,a.wrap(d),e)};var d=b.removeEventListener;b.removeEventListener=function(a,b,c){d.call(this,a,b._wrapped||b,c)}}}function f(a,b){return b=b||this.logger,function(){try{return a.apply(this,arguments)}catch(c){b("Rollbar internal error:",c)}}}var g=0;b.init=function(a,d){var g=d.globalAlias||"Rollbar";if("object"==typeof a[g])return a[g];a._rollbarShimQueue=[],a._rollbarWrappedError=null,d=d||{};var h=new b;return f(function(){if(h.configure(d),d.captureUncaught){var b=a.onerror;a.onerror=function(){var a=Array.prototype.slice.call(arguments,0);c(h,b,a)};var f,i,j=["EventTarget","Window","Node","ApplicationCache","AudioTrackList","ChannelMergerNode","CryptoOperation","EventSource","FileReader","HTMLUnknownElement","IDBDatabase","IDBRequest","IDBTransaction","KeyOperation","MediaController","MessagePort","ModalWindow","Notification","SVGElementInstance","Screen","TextTrack","TextTrackCue","TextTrackList","WebSocket","WebSocketWorker","Worker","XMLHttpRequest","XMLHttpRequestEventTarget","XMLHttpRequestUpload"]; for(f=0;f<j.length;++f)i=j[f],a[i]&&a[i].prototype&&e(h,a[i].prototype)}return a[g]=h,h},h.logger)()},b.prototype.loadFull=function(a,b,c,d,e){var g=f(function(){var a=b.createElement("script"),e=b.getElementsByTagName("script")[0];a.src=d.rollbarJsUrl,a.async=!c,a.onload=h,e.parentNode.insertBefore(a,e)},this.logger),h=f(function(){var b;if(void 0===a._rollbarPayloadQueue){var c,d,f,g;for(b=new Error("rollbar.js did not load");c=a._rollbarShimQueue.shift();)for(f=c.args,g=0;g<f.length;++g)if(d=f[g],"function"==typeof d){d(b);break}}e&&e(b)},this.logger);f(function(){c?g():a.addEventListener?a.addEventListener("load",g,!1):a.attachEvent("onload",g)},this.logger)()},b.prototype.wrap=function(b){if("function"!=typeof b)return b;if(b._isWrap)return b;if(!b._wrapped){b._wrapped=function(){try{return b.apply(this,arguments)}catch(c){throw a._rollbarWrappedError=c,c}},b._wrapped._isWrap=!0;for(var c in b)b.hasOwnProperty(c)&&(b._wrapped[c]=b[c])}return b._wrapped};for(var h="log,debug,info,warn,warning,error,critical,global,configure,scope,uncaughtError".split(","),i=0;i<h.length;++i)b.prototype[h[i]]=d(h[i]);var j="//d37gvrvc0wt4s1.cloudfront.net/js/v1.0/rollbar.min.js";_rollbarConfig.rollbarJsUrl=_rollbarConfig.rollbarJsUrl||j,b.init(a,_rollbarConfig)})(window,document);this.load(this.ready)};RollbarIntegration.prototype.loaded=function(){return is.object(window.Rollbar)&&null==window.Rollbar.shimId};RollbarIntegration.prototype.load=function(callback){window.Rollbar.loadFull(window,document,true,this.config,callback)};RollbarIntegration.prototype.identify=function(identify){if(!this.options.identify)return;var uid=identify.userId();if(uid===null||uid===undefined)return;var rollbar=window.Rollbar;var person={id:uid};extend(person,identify.traits());rollbar.configure({payload:{person:person}})}},{"analytics.js-integration":84,extend:125,is:87}],69:[function(require,module,exports){var integration=require("analytics.js-integration");var SaaSquatch=module.exports=integration("SaaSquatch").option("tenantAlias","").global("_sqh").tag('<script src="//d2rcp9ak152ke1.cloudfront.net/assets/javascripts/squatch.min.js">');SaaSquatch.prototype.initialize=function(page){window._sqh=window._sqh||[];this.load(this.ready)};SaaSquatch.prototype.loaded=function(){return window._sqh&&window._sqh.push!=[].push};SaaSquatch.prototype.identify=function(identify){var sqh=window._sqh;var accountId=identify.proxy("traits.accountId");var image=identify.proxy("traits.referralImage");var opts=identify.options(this.name);var id=identify.userId();var email=identify.email();if(!(id||email))return;if(this.called)return;var init={tenant_alias:this.options.tenantAlias,first_name:identify.firstName(),last_name:identify.lastName(),user_image:identify.avatar(),email:email,user_id:id};if(accountId)init.account_id=accountId;if(opts.checksum)init.checksum=opts.checksum;if(image)init.fb_share_image=image;sqh.push(["init",init]);this.called=true;this.load()}},{"analytics.js-integration":84}],70:[function(require,module,exports){var integration=require("analytics.js-integration");var is=require("is");var Sentry=module.exports=integration("Sentry").global("Raven").option("config","").tag('<script src="//cdn.ravenjs.com/1.1.10/native/raven.min.js">');Sentry.prototype.initialize=function(){var config=this.options.config;var self=this;this.load(function(){window.Raven.config(config).install();self.ready()})};Sentry.prototype.loaded=function(){return is.object(window.Raven)};Sentry.prototype.identify=function(identify){window.Raven.setUser(identify.traits())}},{"analytics.js-integration":84,is:87}],71:[function(require,module,exports){var integration=require("analytics.js-integration");var is=require("is");var SnapEngage=module.exports=integration("SnapEngage").assumesPageview().global("SnapABug").option("apiKey","").tag('<script src="//commondatastorage.googleapis.com/code.snapengage.com/js/{{ apiKey }}.js">');SnapEngage.prototype.initialize=function(page){this.load(this.ready)};SnapEngage.prototype.loaded=function(){return is.object(window.SnapABug)};SnapEngage.prototype.identify=function(identify){var email=identify.email();if(!email)return;window.SnapABug.setUserEmail(email)}},{"analytics.js-integration":84,is:87}],72:[function(require,module,exports){var integration=require("analytics.js-integration");var bind=require("bind");var when=require("when");var Spinnakr=module.exports=integration("Spinnakr").assumesPageview().global("_spinnakr_site_id").global("_spinnakr").option("siteId","").tag('<script src="//d3ojzyhbolvoi5.cloudfront.net/js/so.js">');Spinnakr.prototype.initialize=function(page){window._spinnakr_site_id=this.options.siteId;var loaded=bind(this,this.loaded);var ready=this.ready;this.load(function(){when(loaded,ready)})};Spinnakr.prototype.loaded=function(){return!!window._spinnakr}},{"analytics.js-integration":84,bind:96,when:126}],73:[function(require,module,exports){var integration=require("analytics.js-integration");var slug=require("slug");var push=require("global-queue")("_tsq");var Tapstream=module.exports=integration("Tapstream").assumesPageview().global("_tsq").option("accountName","").option("trackAllPages",true).option("trackNamedPages",true).option("trackCategorizedPages",true).tag('<script src="//cdn.tapstream.com/static/js/tapstream.js">');Tapstream.prototype.initialize=function(page){window._tsq=window._tsq||[];push("setAccountName",this.options.accountName);this.load(this.ready)};Tapstream.prototype.loaded=function(){return!!(window._tsq&&window._tsq.push!==Array.prototype.push)};Tapstream.prototype.page=function(page){var category=page.category();var opts=this.options;var name=page.fullName();if(opts.trackAllPages){this.track(page.track())}if(name&&opts.trackNamedPages){this.track(page.track(name))}if(category&&opts.trackCategorizedPages){this.track(page.track(category))}};Tapstream.prototype.track=function(track){var props=track.properties();push("fireHit",slug(track.event()),[props.url])}},{"analytics.js-integration":84,slug:94,"global-queue":169}],74:[function(require,module,exports){var integration=require("analytics.js-integration");var alias=require("alias");var clone=require("clone");var Trakio=module.exports=integration("trak.io").assumesPageview().global("trak").option("token","").option("trackNamedPages",true).option("trackCategorizedPages",true).tag('<script src="//d29p64779x43zo.cloudfront.net/v1/trak.io.min.js">');var optionsAliases={initialPageview:"auto_track_page_view"};Trakio.prototype.initialize=function(page){var options=this.options;window.trak=window.trak||[];window.trak.io=window.trak.io||{};window.trak.push=window.trak.push||function(){};window.trak.io.load=window.trak.io.load||function(e){var r=function(e){return function(){window.trak.push([e].concat(Array.prototype.slice.call(arguments,0)))}},i=["initialize","identify","track","alias","channel","source","host","protocol","page_view"];for(var s=0;s<i.length;s++)window.trak.io[i[s]]=r(i[s]);window.trak.io.initialize.apply(window.trak.io,arguments)};window.trak.io.load(options.token,alias(options,optionsAliases));this.load(this.ready)};Trakio.prototype.loaded=function(){return!!(window.trak&&window.trak.loaded)};Trakio.prototype.page=function(page){var category=page.category();var props=page.properties();var name=page.fullName();window.trak.io.page_view(props.path,name||props.title);if(name&&this.options.trackNamedPages){this.track(page.track(name))}if(category&&this.options.trackCategorizedPages){this.track(page.track(category))}};var traitAliases={avatar:"avatar_url",firstName:"first_name",lastName:"last_name"};Trakio.prototype.identify=function(identify){var traits=identify.traits(traitAliases);var id=identify.userId();if(id){window.trak.io.identify(id,traits)}else{window.trak.io.identify(traits)}};Trakio.prototype.track=function(track){window.trak.io.track(track.event(),track.properties())};Trakio.prototype.alias=function(alias){if(!window.trak.io.distinct_id)return;var from=alias.from();var to=alias.to();if(to===window.trak.io.distinct_id())return;if(from){window.trak.io.alias(from,to)}else{window.trak.io.alias(to)}}},{"analytics.js-integration":84,alias:174,clone:173}],75:[function(require,module,exports){var integration=require("analytics.js-integration");var each=require("each");var has=Object.prototype.hasOwnProperty;var TwitterAds=module.exports=integration("Twitter Ads").option("page","").tag('<img src="//analytics.twitter.com/i/adsct?txn_id={{ pixelId }}&p_id=Twitter"/>').mapping("events");TwitterAds.prototype.initialize=function(){this.ready()};TwitterAds.prototype.page=function(page){if(this.options.page){this.load({pixelId:this.options.page})}};TwitterAds.prototype.track=function(track){var events=this.events(track.event());var self=this;each(events,function(pixelId){self.load({pixelId:pixelId})})}},{"analytics.js-integration":84,each:4}],76:[function(require,module,exports){var integration=require("analytics.js-integration");var push=require("global-queue")("_uc");var Usercycle=module.exports=integration("USERcycle").assumesPageview().global("_uc").option("key","").tag('<script src="//api.usercycle.com/javascripts/track.js">');Usercycle.prototype.initialize=function(page){push("_key",this.options.key);this.load(this.ready)};Usercycle.prototype.loaded=function(){return!!(window._uc&&window._uc.push!==Array.prototype.push)};Usercycle.prototype.identify=function(identify){var traits=identify.traits();var id=identify.userId();if(id)push("uid",id);push("action","came_back",traits)};Usercycle.prototype.track=function(track){push("action",track.event(),track.properties({revenue:"revenue_amount"}))}},{"analytics.js-integration":84,"global-queue":169}],77:[function(require,module,exports){var alias=require("alias");var callback=require("callback");var convertDates=require("convert-dates");var integration=require("analytics.js-integration");var load=require("load-script");var push=require("global-queue")("_ufq");module.exports=exports=function(analytics){analytics.addIntegration(Userfox)};var Userfox=exports.Integration=integration("userfox").assumesPageview().readyOnLoad().global("_ufq").option("clientId","");Userfox.prototype.initialize=function(page){window._ufq=[];this.load()};Userfox.prototype.loaded=function(){return!!(window._ufq&&window._ufq.push!==Array.prototype.push)};Userfox.prototype.load=function(callback){load("//d2y71mjhnajxcg.cloudfront.net/js/userfox-stable.js",callback)};Userfox.prototype.identify=function(identify){var traits=identify.traits({created:"signup_date"});var email=identify.email();if(!email)return;push("init",{clientId:this.options.clientId,email:email});traits=convertDates(traits,formatDate);push("track",traits)};function formatDate(date){return Math.round(date.getTime()/1e3).toString()}},{alias:174,callback:89,"convert-dates":175,"analytics.js-integration":84,"load-script":124,"global-queue":169}],78:[function(require,module,exports){var integration=require("analytics.js-integration");var push=require("global-queue")("UserVoice");var convertDates=require("convert-dates");var unix=require("to-unix-timestamp");var alias=require("alias");var clone=require("clone");var UserVoice=module.exports=integration("UserVoice").assumesPageview().global("UserVoice").global("showClassicWidget").option("apiKey","").option("classic",false).option("forumId",null).option("showWidget",true).option("mode","contact").option("accentColor","#448dd6").option("smartvote",true).option("trigger",null).option("triggerPosition","bottom-right").option("triggerColor","#ffffff").option("triggerBackgroundColor","rgba(46, 49, 51, 0.6)").option("classicMode","full").option("primaryColor","#cc6d00").option("linkColor","#007dbf").option("defaultMode","support").option("tabLabel","Feedback & Support").option("tabColor","#cc6d00").option("tabPosition","middle-right").option("tabInverted",false).tag('<script src="//widget.uservoice.com/{{ apiKey }}.js">');UserVoice.on("construct",function(integration){if(!integration.options.classic)return;integration.group=undefined;integration.identify=integration.identifyClassic;integration.initialize=integration.initializeClassic});UserVoice.prototype.initialize=function(page){var options=this.options;var opts=formatOptions(options);push("set",opts);push("autoprompt",{});if(options.showWidget){options.trigger?push("addTrigger",options.trigger,opts):push("addTrigger",opts)}this.load(this.ready)};UserVoice.prototype.loaded=function(){return!!(window.UserVoice&&window.UserVoice.push!==Array.prototype.push)};UserVoice.prototype.identify=function(identify){var traits=identify.traits({created:"created_at"});traits=convertDates(traits,unix);push("identify",traits)};UserVoice.prototype.group=function(group){var traits=group.traits({created:"created_at"});traits=convertDates(traits,unix);push("identify",{account:traits})};UserVoice.prototype.initializeClassic=function(){var options=this.options;window.showClassicWidget=showClassicWidget;if(options.showWidget)showClassicWidget("showTab",formatClassicOptions(options));this.load(this.ready)};UserVoice.prototype.identifyClassic=function(identify){push("setCustomFields",identify.traits())};function formatOptions(options){return alias(options,{forumId:"forum_id",accentColor:"accent_color",smartvote:"smartvote_enabled",triggerColor:"trigger_color",triggerBackgroundColor:"trigger_background_color",triggerPosition:"trigger_position"})}function formatClassicOptions(options){return alias(options,{forumId:"forum_id",classicMode:"mode",primaryColor:"primary_color",tabPosition:"tab_position",tabColor:"tab_color",linkColor:"link_color",defaultMode:"default_mode",tabLabel:"tab_label",tabInverted:"tab_inverted"})}function showClassicWidget(type,options){type=type||"showLightbox";push(type,"classic_widget",options)}},{"analytics.js-integration":84,"global-queue":169,"convert-dates":175,"to-unix-timestamp":181,alias:174,clone:173}],181:[function(require,module,exports){module.exports=toUnixTimestamp;function toUnixTimestamp(date){return Math.floor(date.getTime()/1e3)}},{}],79:[function(require,module,exports){var integration=require("analytics.js-integration");var push=require("global-queue")("_veroq");var cookie=require("component/cookie");var Vero=module.exports=integration("Vero").global("_veroq").option("apiKey","").tag('<script src="//d3qxef4rp70elm.cloudfront.net/m.js">');Vero.prototype.initialize=function(page){if(!cookie("__veroc4"))cookie("__veroc4","[]");push("init",{api_key:this.options.apiKey});this.load(this.ready)};Vero.prototype.loaded=function(){return!!(window._veroq&&window._veroq.push!==Array.prototype.push)};Vero.prototype.page=function(page){push("trackPageview")};Vero.prototype.identify=function(identify){var traits=identify.traits();var email=identify.email();var id=identify.userId();if(!id||!email)return;push("user",traits)};Vero.prototype.track=function(track){push("track",track.event(),track.properties())}},{"analytics.js-integration":84,"global-queue":169,"component/cookie":182}],182:[function(require,module,exports){var encode=encodeURIComponent;var decode=decodeURIComponent;module.exports=function(name,value,options){switch(arguments.length){case 3:case 2:return set(name,value,options);case 1:return get(name);default:return all()}};function set(name,value,options){options=options||{};var str=encode(name)+"="+encode(value);if(null==value)options.maxage=-1;if(options.maxage){options.expires=new Date(+new Date+options.maxage)}if(options.path)str+="; path="+options.path;if(options.domain)str+="; domain="+options.domain;if(options.expires)str+="; expires="+options.expires.toGMTString();if(options.secure)str+="; secure";document.cookie=str}function all(){return parse(document.cookie)}function get(name){return all()[name]}function parse(str){var obj={};var pairs=str.split(/ *; */);var pair;if(""==pairs[0])return obj;for(var i=0;i<pairs.length;++i){pair=pairs[i].split("=");obj[decode(pair[0])]=decode(pair[1])}return obj}},{}],80:[function(require,module,exports){var integration=require("analytics.js-integration");var tick=require("next-tick");var each=require("each");var VWO=module.exports=integration("Visual Website Optimizer").option("replay",true);VWO.prototype.initialize=function(){if(this.options.replay)this.replay();this.ready()};VWO.prototype.replay=function(){var analytics=this.analytics;tick(function(){experiments(function(err,traits){if(traits)analytics.identify(traits)})})};function experiments(fn){enqueue(function(){var data={};var ids=window._vwo_exp_ids;if(!ids)return fn();each(ids,function(id){var name=variation(id);if(name)data["Experiment: "+id]=name});fn(null,data)})}function enqueue(fn){window._vis_opt_queue=window._vis_opt_queue||[];window._vis_opt_queue.push(fn)}function variation(id){var experiments=window._vwo_exp;if(!experiments)return null;var experiment=experiments[id];var variationId=experiment.combination_chosen;return variationId?experiment.comb_n[variationId]:null}},{"analytics.js-integration":84,"next-tick":98,each:4}],81:[function(require,module,exports){var integration=require("analytics.js-integration");var useHttps=require("use-https");var WebEngage=module.exports=integration("WebEngage").assumesPageview().global("_weq").global("webengage").option("widgetVersion","4.0").option("licenseCode","").tag("http",'<script src="http://cdn.widgets.webengage.com/js/widget/webengage-min-v-4.0.js">').tag("https",'<script src="https://ssl.widgets.webengage.com/js/widget/webengage-min-v-4.0.js">');WebEngage.prototype.initialize=function(page){var _weq=window._weq=window._weq||{};_weq["webengage.licenseCode"]=this.options.licenseCode;_weq["webengage.widgetVersion"]=this.options.widgetVersion;var name=useHttps()?"https":"http";this.load(name,this.ready)};WebEngage.prototype.loaded=function(){return!!window.webengage}},{"analytics.js-integration":84,"use-https":86}],82:[function(require,module,exports){var integration=require("analytics.js-integration");var snake=require("to-snake-case");var isEmail=require("is-email");var extend=require("extend");var each=require("each");var type=require("type");var Woopra=module.exports=integration("Woopra").global("woopra").option("domain","").option("cookieName","wooTracker").option("cookieDomain",null).option("cookiePath","/").option("ping",true).option("pingInterval",12e3).option("idleTimeout",3e5).option("downloadTracking",true).option("outgoingTracking",true).option("outgoingIgnoreSubdomain",true).option("downloadPause",200).option("outgoingPause",400).option("ignoreQueryUrl",true).option("hideCampaign",false).tag('<script src="//static.woopra.com/js/w.js">');Woopra.prototype.initialize=function(page){(function(){var i,s,z,w=window,d=document,a=arguments,q="script",f=["config","track","identify","visit","push","call"],c=function(){var i,self=this;self._e=[];for(i=0;i<f.length;i++){(function(f){self[f]=function(){self._e.push([f].concat(Array.prototype.slice.call(arguments,0)));return self}})(f[i])}};w._w=w._w||{};for(i=0;i<a.length;i++){w._w[a[i]]=w[a[i]]=w[a[i]]||new c}})("woopra");this.load(this.ready);each(this.options,function(key,value){key=snake(key);if(null==value)return;if(""===value)return;window.woopra.config(key,value)})};Woopra.prototype.loaded=function(){return!!(window.woopra&&window.woopra.loaded)};Woopra.prototype.page=function(page){var props=page.properties();var name=page.fullName();if(name)props.title=name;window.woopra.track("pv",props)};Woopra.prototype.identify=function(identify){var traits=identify.traits();if(identify.name())traits.name=identify.name();window.woopra.identify(traits).push()};Woopra.prototype.track=function(track){window.woopra.track(track.event(),track.properties())}},{"analytics.js-integration":84,"to-snake-case":85,"is-email":164,extend:125,each:4,type:7}],83:[function(require,module,exports){var integration=require("analytics.js-integration");var tick=require("next-tick");var bind=require("bind");var when=require("when");var Yandex=module.exports=integration("Yandex Metrica").assumesPageview().global("yandex_metrika_callbacks").global("Ya").option("counterId",null).option("clickmap",false).option("webvisor",false).tag('<script src="//mc.yandex.ru/metrika/watch.js">');Yandex.prototype.initialize=function(page){var id=this.options.counterId;var clickmap=this.options.clickmap;var webvisor=this.options.webvisor;push(function(){window["yaCounter"+id]=new window.Ya.Metrika({id:id,clickmap:clickmap,webvisor:webvisor})});var loaded=bind(this,this.loaded);var ready=this.ready;this.load(function(){when(loaded,function(){tick(ready)})})};Yandex.prototype.loaded=function(){return!!(window.Ya&&window.Ya.Metrika)};function push(callback){window.yandex_metrika_callbacks=window.yandex_metrika_callbacks||[];window.yandex_metrika_callbacks.push(callback)}},{"analytics.js-integration":84,"next-tick":98,bind:96,when:126}],3:[function(require,module,exports){var after=require("after");var bind=require("bind");var callback=require("callback");var canonical=require("canonical");var clone=require("clone");var cookie=require("./cookie");var debug=require("debug");var defaults=require("defaults");var each=require("each");var Emitter=require("emitter");var group=require("./group");var is=require("is");var isEmail=require("is-email");var isMeta=require("is-meta");var newDate=require("new-date");var on=require("event").bind;var prevent=require("prevent");var querystring=require("querystring");var size=require("object").length;var store=require("./store");var url=require("url");var user=require("./user");var Facade=require("facade");var Identify=Facade.Identify;var Group=Facade.Group;var Alias=Facade.Alias;var Track=Facade.Track;var Page=Facade.Page;exports=module.exports=Analytics;exports.cookie=cookie;exports.store=store;function Analytics(){this.Integrations={};this._integrations={};this._readied=false;this._timeout=300;this._user=user;bind.all(this);var self=this;this.on("initialize",function(settings,options){if(options.initialPageview)self.page()});this.on("initialize",function(){self._parseQuery()})}Emitter(Analytics.prototype);Analytics.prototype.use=function(plugin){plugin(this);return this};Analytics.prototype.addIntegration=function(Integration){var name=Integration.prototype.name;if(!name)throw new TypeError("attempted to add an invalid integration");this.Integrations[name]=Integration;return this};Analytics.prototype.init=Analytics.prototype.initialize=function(settings,options){settings=settings||{};options=options||{};this._options(options);this._readied=false;var self=this;each(settings,function(name){var Integration=self.Integrations[name];if(!Integration)delete settings[name]});each(settings,function(name,opts){var Integration=self.Integrations[name];var integration=new Integration(clone(opts));self.add(integration)});var integrations=this._integrations;user.load();group.load();var ready=after(size(integrations),function(){self._readied=true;self.emit("ready")});each(integrations,function(name,integration){if(options.initialPageview&&integration.options.initialPageview===false){integration.page=after(2,integration.page)}integration.analytics=self;integration.once("ready",ready);integration.initialize()});this.initialized=true;this.emit("initialize",settings,options);return this};Analytics.prototype.add=function(integration){this._integrations[integration.name]=integration;return this};Analytics.prototype.identify=function(id,traits,options,fn){if(is.fn(options))fn=options,options=null;if(is.fn(traits))fn=traits,options=null,traits=null;if(is.object(id))options=traits,traits=id,id=user.id();user.identify(id,traits);id=user.id();traits=user.traits();this._invoke("identify",message(Identify,{options:options,traits:traits,userId:id}));this.emit("identify",id,traits,options);this._callback(fn);return this};Analytics.prototype.user=function(){return user};Analytics.prototype.group=function(id,traits,options,fn){if(0===arguments.length)return group;if(is.fn(options))fn=options,options=null;if(is.fn(traits))fn=traits,options=null,traits=null;if(is.object(id))options=traits,traits=id,id=group.id();group.identify(id,traits);id=group.id();traits=group.traits();this._invoke("group",message(Group,{options:options,traits:traits,groupId:id}));this.emit("group",id,traits,options);this._callback(fn);return this};Analytics.prototype.track=function(event,properties,options,fn){if(is.fn(options))fn=options,options=null;if(is.fn(properties))fn=properties,options=null,properties=null;this._invoke("track",message(Track,{properties:properties,options:options,event:event}));this.emit("track",event,properties,options);this._callback(fn);return this};Analytics.prototype.trackClick=Analytics.prototype.trackLink=function(links,event,properties){if(!links)return this;if(is.element(links))links=[links];var self=this;each(links,function(el){if(!is.element(el))throw new TypeError("Must pass HTMLElement to `analytics.trackLink`.");on(el,"click",function(e){var ev=is.fn(event)?event(el):event;var props=is.fn(properties)?properties(el):properties;self.track(ev,props);if(el.href&&el.target!=="_blank"&&!isMeta(e)){prevent(e);self._callback(function(){window.location.href=el.href})}})});return this};Analytics.prototype.trackSubmit=Analytics.prototype.trackForm=function(forms,event,properties){if(!forms)return this;if(is.element(forms))forms=[forms];var self=this;each(forms,function(el){if(!is.element(el))throw new TypeError("Must pass HTMLElement to `analytics.trackForm`.");function handler(e){prevent(e);var ev=is.fn(event)?event(el):event;var props=is.fn(properties)?properties(el):properties;self.track(ev,props);self._callback(function(){el.submit()})}var $=window.jQuery||window.Zepto;if($){$(el).submit(handler)}else{on(el,"submit",handler)}});return this};Analytics.prototype.page=function(category,name,properties,options,fn){if(is.fn(options))fn=options,options=null;if(is.fn(properties))fn=properties,options=properties=null;if(is.fn(name))fn=name,options=properties=name=null;if(is.object(category))options=name,properties=category,name=category=null;if(is.object(name))options=properties,properties=name,name=null;if(is.string(category)&&!is.string(name))name=category,category=null;var defs={path:canonicalPath(),referrer:document.referrer,title:document.title,search:location.search};if(name)defs.name=name;if(category)defs.category=category;properties=clone(properties)||{};defaults(properties,defs);properties.url=properties.url||canonicalUrl(properties.search);this._invoke("page",message(Page,{properties:properties,category:category,options:options,name:name}));this.emit("page",category,name,properties,options);this._callback(fn);return this};Analytics.prototype.pageview=function(url,options){var properties={};if(url)properties.path=url;this.page(properties);return this};Analytics.prototype.alias=function(to,from,options,fn){if(is.fn(options))fn=options,options=null;if(is.fn(from))fn=from,options=null,from=null;if(is.object(from))options=from,from=null;this._invoke("alias",message(Alias,{options:options,from:from,to:to}));this.emit("alias",to,from,options);this._callback(fn);return this};Analytics.prototype.ready=function(fn){if(!is.fn(fn))return this;this._readied?callback.async(fn):this.once("ready",fn);return this};Analytics.prototype.timeout=function(timeout){this._timeout=timeout};Analytics.prototype.debug=function(str){if(0==arguments.length||str){debug.enable("analytics:"+(str||"*"))}else{debug.disable()}};Analytics.prototype._options=function(options){options=options||{};cookie.options(options.cookie);store.options(options.localStorage);user.options(options.user);group.options(options.group);return this};Analytics.prototype._callback=function(fn){callback.async(fn,this._timeout);return this};Analytics.prototype._invoke=function(method,facade){var options=facade.options();this.emit("invoke",facade);each(this._integrations,function(name,integration){if(!facade.enabled(name))return;integration.invoke.call(integration,method,facade)});return this};Analytics.prototype.push=function(args){var method=args.shift();if(!this[method])return;this[method].apply(this,args)};Analytics.prototype._parseQuery=function(){var q=querystring.parse(window.location.search);if(q.ajs_uid)this.identify(q.ajs_uid);if(q.ajs_event)this.track(q.ajs_event);return this};function canonicalPath(){var canon=canonical();if(!canon)return window.location.pathname;var parsed=url.parse(canon);return parsed.pathname}function canonicalUrl(search){var canon=canonical();if(canon)return~canon.indexOf("?")?canon:canon+search;var url=window.location.href;var i=url.indexOf("#");return-1==i?url:url.slice(0,i)}function message(Type,msg){var ctx=msg.options||{};if(ctx.timestamp||ctx.integrations||ctx.context){msg=defaults(ctx,msg);delete msg.options}return new Type(msg)}},{after:106,bind:183,callback:89,canonical:177,clone:90,"./cookie":184,debug:185,defaults:92,each:4,emitter:103,"./group":186,is:87,"is-email":164,"is-meta":187,"new-date":141,event:188,prevent:189,querystring:190,object:176,"./store":191,url:178,"./user":192,facade:127}],183:[function(require,module,exports){try{var bind=require("bind")}catch(e){var bind=require("bind-component")}var bindAll=require("bind-all");module.exports=exports=bind;exports.all=bindAll;exports.methods=bindMethods;function bindMethods(obj,methods){methods=[].slice.call(arguments,1);for(var i=0,method;method=methods[i];i++){obj[method]=bind(obj,obj[method])}return obj}},{bind:96,"bind-all":97}],184:[function(require,module,exports){var debug=require("debug")("analytics.js:cookie");var bind=require("bind");var cookie=require("cookie");var clone=require("clone");var defaults=require("defaults");var json=require("json");var topDomain=require("top-domain");function Cookie(options){this.options(options)}Cookie.prototype.options=function(options){if(arguments.length===0)return this._options;options=options||{};var domain="."+topDomain(window.location.href);this._options=defaults(options,{maxage:31536e6,path:"/",domain:domain});this.set("ajs:test",true);if(!this.get("ajs:test")){debug("fallback to domain=null");this._options.domain=null}this.remove("ajs:test")};Cookie.prototype.set=function(key,value){try{value=json.stringify(value);cookie(key,value,clone(this._options));return true}catch(e){return false}};Cookie.prototype.get=function(key){try{var value=cookie(key);value=value?json.parse(value):null;return value}catch(e){return null}};Cookie.prototype.remove=function(key){try{cookie(key,null,clone(this._options));return true}catch(e){return false}};module.exports=bind.all(new Cookie);module.exports.Cookie=Cookie},{debug:185,bind:183,cookie:182,clone:90,defaults:92,json:193,"top-domain":194}],185:[function(require,module,exports){if("undefined"==typeof window){module.exports=require("./lib/debug")}else{module.exports=require("./debug")}},{"./lib/debug":195,"./debug":196}],195:[function(require,module,exports){var tty=require("tty");module.exports=debug;var names=[],skips=[];(process.env.DEBUG||"").split(/[\s,]+/).forEach(function(name){name=name.replace("*",".*?");if(name[0]==="-"){skips.push(new RegExp("^"+name.substr(1)+"$"))}else{names.push(new RegExp("^"+name+"$"))}});var colors=[6,2,3,4,5,1];var prev={};var prevColor=0;var isatty=tty.isatty(2);function color(){return colors[prevColor++%colors.length]}function humanize(ms){var sec=1e3,min=60*1e3,hour=60*min;if(ms>=hour)return(ms/hour).toFixed(1)+"h";if(ms>=min)return(ms/min).toFixed(1)+"m";if(ms>=sec)return(ms/sec|0)+"s";return ms+"ms"}function debug(name){function disabled(){}disabled.enabled=false;var match=skips.some(function(re){return re.test(name)});if(match)return disabled;match=names.some(function(re){return re.test(name)});if(!match)return disabled;var c=color();function colored(fmt){fmt=coerce(fmt);var curr=new Date;var ms=curr-(prev[name]||curr);prev[name]=curr;fmt=" [9"+c+"m"+name+" "+"[3"+c+"m"+fmt+"[3"+c+"m"+" +"+humanize(ms)+"";console.error.apply(this,arguments)}function plain(fmt){fmt=coerce(fmt);fmt=(new Date).toUTCString()+" "+name+" "+fmt; console.error.apply(this,arguments)}colored.enabled=plain.enabled=true;return isatty||process.env.DEBUG_COLORS?colored:plain}function coerce(val){if(val instanceof Error)return val.stack||val.message;return val}},{}],196:[function(require,module,exports){module.exports=debug;function debug(name){if(!debug.enabled(name))return function(){};return function(fmt){fmt=coerce(fmt);var curr=new Date;var ms=curr-(debug[name]||curr);debug[name]=curr;fmt=name+" "+fmt+" +"+debug.humanize(ms);window.console&&console.log&&Function.prototype.apply.call(console.log,console,arguments)}}debug.names=[];debug.skips=[];debug.enable=function(name){try{localStorage.debug=name}catch(e){}var split=(name||"").split(/[\s,]+/),len=split.length;for(var i=0;i<len;i++){name=split[i].replace("*",".*?");if(name[0]==="-"){debug.skips.push(new RegExp("^"+name.substr(1)+"$"))}else{debug.names.push(new RegExp("^"+name+"$"))}}};debug.disable=function(){debug.enable("")};debug.humanize=function(ms){var sec=1e3,min=60*1e3,hour=60*min;if(ms>=hour)return(ms/hour).toFixed(1)+"h";if(ms>=min)return(ms/min).toFixed(1)+"m";if(ms>=sec)return(ms/sec|0)+"s";return ms+"ms"};debug.enabled=function(name){for(var i=0,len=debug.skips.length;i<len;i++){if(debug.skips[i].test(name)){return false}}for(var i=0,len=debug.names.length;i<len;i++){if(debug.names[i].test(name)){return true}}return false};function coerce(val){if(val instanceof Error)return val.stack||val.message;return val}try{if(window.localStorage)debug.enable(localStorage.debug)}catch(e){}},{}],193:[function(require,module,exports){var json=window.JSON||{};var stringify=json.stringify;var parse=json.parse;module.exports=parse&&stringify?JSON:require("json-fallback")},{"json-fallback":197}],197:[function(require,module,exports){(function(){"use strict";var JSON=module.exports={};function f(n){return n<10?"0"+n:n}if(typeof Date.prototype.toJSON!=="function"){Date.prototype.toJSON=function(){return isFinite(this.valueOf())?this.getUTCFullYear()+"-"+f(this.getUTCMonth()+1)+"-"+f(this.getUTCDate())+"T"+f(this.getUTCHours())+":"+f(this.getUTCMinutes())+":"+f(this.getUTCSeconds())+"Z":null};String.prototype.toJSON=Number.prototype.toJSON=Boolean.prototype.toJSON=function(){return this.valueOf()}}var cx,escapable,gap,indent,meta,rep;function quote(string){escapable.lastIndex=0;return escapable.test(string)?'"'+string.replace(escapable,function(a){var c=meta[a];return typeof c==="string"?c:"\\u"+("0000"+a.charCodeAt(0).toString(16)).slice(-4)})+'"':'"'+string+'"'}function str(key,holder){var i,k,v,length,mind=gap,partial,value=holder[key];if(value&&typeof value==="object"&&typeof value.toJSON==="function"){value=value.toJSON(key)}if(typeof rep==="function"){value=rep.call(holder,key,value)}switch(typeof value){case"string":return quote(value);case"number":return isFinite(value)?String(value):"null";case"boolean":case"null":return String(value);case"object":if(!value){return"null"}gap+=indent;partial=[];if(Object.prototype.toString.apply(value)==="[object Array]"){length=value.length;for(i=0;i<length;i+=1){partial[i]=str(i,value)||"null"}v=partial.length===0?"[]":gap?"[\n"+gap+partial.join(",\n"+gap)+"\n"+mind+"]":"["+partial.join(",")+"]";gap=mind;return v}if(rep&&typeof rep==="object"){length=rep.length;for(i=0;i<length;i+=1){if(typeof rep[i]==="string"){k=rep[i];v=str(k,value);if(v){partial.push(quote(k)+(gap?": ":":")+v)}}}}else{for(k in value){if(Object.prototype.hasOwnProperty.call(value,k)){v=str(k,value);if(v){partial.push(quote(k)+(gap?": ":":")+v)}}}}v=partial.length===0?"{}":gap?"{\n"+gap+partial.join(",\n"+gap)+"\n"+mind+"}":"{"+partial.join(",")+"}";gap=mind;return v}}if(typeof JSON.stringify!=="function"){escapable=/[\\\"\x00-\x1f\x7f-\x9f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g;meta={"\b":"\\b"," ":"\\t","\n":"\\n","\f":"\\f","\r":"\\r",'"':'\\"',"\\":"\\\\"};JSON.stringify=function(value,replacer,space){var i;gap="";indent="";if(typeof space==="number"){for(i=0;i<space;i+=1){indent+=" "}}else if(typeof space==="string"){indent=space}rep=replacer;if(replacer&&typeof replacer!=="function"&&(typeof replacer!=="object"||typeof replacer.length!=="number")){throw new Error("JSON.stringify")}return str("",{"":value})}}if(typeof JSON.parse!=="function"){cx=/[\u0000\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g;JSON.parse=function(text,reviver){var j;function walk(holder,key){var k,v,value=holder[key];if(value&&typeof value==="object"){for(k in value){if(Object.prototype.hasOwnProperty.call(value,k)){v=walk(value,k);if(v!==undefined){value[k]=v}else{delete value[k]}}}}return reviver.call(holder,key,value)}text=String(text);cx.lastIndex=0;if(cx.test(text)){text=text.replace(cx,function(a){return"\\u"+("0000"+a.charCodeAt(0).toString(16)).slice(-4)})}if(/^[\],:{}\s]*$/.test(text.replace(/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g,"@").replace(/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,"]").replace(/(?:^|:|,)(?:\s*\[)+/g,""))){j=eval("("+text+")");return typeof reviver==="function"?walk({"":j},""):j}throw new SyntaxError("JSON.parse")}}})()},{}],194:[function(require,module,exports){var parse=require("url").parse;module.exports=domain;var regexp=/[a-z0-9][a-z0-9\-]*[a-z0-9]\.[a-z\.]{2,6}$/i;function domain(url){var host=parse(url).hostname;var match=host.match(regexp);return match?match[0]:""}},{url:178}],186:[function(require,module,exports){var debug=require("debug")("analytics:group");var Entity=require("./entity");var inherit=require("inherit");var bind=require("bind");Group.defaults={persist:true,cookie:{key:"ajs_group_id"},localStorage:{key:"ajs_group_properties"}};function Group(options){this.defaults=Group.defaults;this.debug=debug;Entity.call(this,options)}inherit(Group,Entity);module.exports=bind.all(new Group);module.exports.Group=Group},{debug:185,"./entity":198,inherit:199,bind:183}],198:[function(require,module,exports){var traverse=require("isodate-traverse");var defaults=require("defaults");var cookie=require("./cookie");var store=require("./store");var extend=require("extend");var clone=require("clone");module.exports=Entity;function Entity(options){this.options(options)}Entity.prototype.options=function(options){if(arguments.length===0)return this._options;options||(options={});defaults(options,this.defaults||{});this._options=options};Entity.prototype.id=function(id){switch(arguments.length){case 0:return this._getId();case 1:return this._setId(id)}};Entity.prototype._getId=function(){var ret=this._options.persist?cookie.get(this._options.cookie.key):this._id;return ret===undefined?null:ret};Entity.prototype._setId=function(id){if(this._options.persist){cookie.set(this._options.cookie.key,id)}else{this._id=id}};Entity.prototype.properties=Entity.prototype.traits=function(traits){switch(arguments.length){case 0:return this._getTraits();case 1:return this._setTraits(traits)}};Entity.prototype._getTraits=function(){var ret=this._options.persist?store.get(this._options.localStorage.key):this._traits;return ret?traverse(clone(ret)):{}};Entity.prototype._setTraits=function(traits){traits||(traits={});if(this._options.persist){store.set(this._options.localStorage.key,traits)}else{this._traits=traits}};Entity.prototype.identify=function(id,traits){traits||(traits={});var current=this.id();if(current===null||current===id)traits=extend(this.traits(),traits);if(id)this.id(id);this.debug("identify %o, %o",id,traits);this.traits(traits);this.save()};Entity.prototype.save=function(){if(!this._options.persist)return false;cookie.set(this._options.cookie.key,this.id());store.set(this._options.localStorage.key,this.traits());return true};Entity.prototype.logout=function(){this.id(null);this.traits({});cookie.remove(this._options.cookie.key);store.remove(this._options.localStorage.key)};Entity.prototype.reset=function(){this.logout();this.options({})};Entity.prototype.load=function(){this.id(cookie.get(this._options.cookie.key));this.traits(store.get(this._options.localStorage.key))}},{"isodate-traverse":140,defaults:92,"./cookie":184,"./store":191,extend:125,clone:90}],191:[function(require,module,exports){var bind=require("bind");var defaults=require("defaults");var store=require("store.js");function Store(options){this.options(options)}Store.prototype.options=function(options){if(arguments.length===0)return this._options;options=options||{};defaults(options,{enabled:true});this.enabled=options.enabled&&store.enabled;this._options=options};Store.prototype.set=function(key,value){if(!this.enabled)return false;return store.set(key,value)};Store.prototype.get=function(key){if(!this.enabled)return null;return store.get(key)};Store.prototype.remove=function(key){if(!this.enabled)return false;return store.remove(key)};module.exports=bind.all(new Store);module.exports.Store=Store},{bind:183,defaults:92,"store.js":200}],200:[function(require,module,exports){var json=require("json"),store={},win=window,doc=win.document,localStorageName="localStorage",namespace="__storejs__",storage;store.disabled=false;store.set=function(key,value){};store.get=function(key){};store.remove=function(key){};store.clear=function(){};store.transact=function(key,defaultVal,transactionFn){var val=store.get(key);if(transactionFn==null){transactionFn=defaultVal;defaultVal=null}if(typeof val=="undefined"){val=defaultVal||{}}transactionFn(val);store.set(key,val)};store.getAll=function(){};store.serialize=function(value){return json.stringify(value)};store.deserialize=function(value){if(typeof value!="string"){return undefined}try{return json.parse(value)}catch(e){return value||undefined}};function isLocalStorageNameSupported(){try{return localStorageName in win&&win[localStorageName]}catch(err){return false}}if(isLocalStorageNameSupported()){storage=win[localStorageName];store.set=function(key,val){if(val===undefined){return store.remove(key)}storage.setItem(key,store.serialize(val));return val};store.get=function(key){return store.deserialize(storage.getItem(key))};store.remove=function(key){storage.removeItem(key)};store.clear=function(){storage.clear()};store.getAll=function(){var ret={};for(var i=0;i<storage.length;++i){var key=storage.key(i);ret[key]=store.get(key)}return ret}}else if(doc.documentElement.addBehavior){var storageOwner,storageContainer;try{storageContainer=new ActiveXObject("htmlfile");storageContainer.open();storageContainer.write("<s"+"cript>document.w=window</s"+'cript><iframe src="/favicon.ico"></iframe>');storageContainer.close();storageOwner=storageContainer.w.frames[0].document;storage=storageOwner.createElement("div")}catch(e){storage=doc.createElement("div");storageOwner=doc.body}function withIEStorage(storeFunction){return function(){var args=Array.prototype.slice.call(arguments,0);args.unshift(storage);storageOwner.appendChild(storage);storage.addBehavior("#default#userData");storage.load(localStorageName);var result=storeFunction.apply(store,args);storageOwner.removeChild(storage);return result}}var forbiddenCharsRegex=new RegExp("[!\"#$%&'()*+,/\\\\:;<=>?@[\\]^`{|}~]","g");function ieKeyFix(key){return key.replace(forbiddenCharsRegex,"___")}store.set=withIEStorage(function(storage,key,val){key=ieKeyFix(key);if(val===undefined){return store.remove(key)}storage.setAttribute(key,store.serialize(val));storage.save(localStorageName);return val});store.get=withIEStorage(function(storage,key){key=ieKeyFix(key);return store.deserialize(storage.getAttribute(key))});store.remove=withIEStorage(function(storage,key){key=ieKeyFix(key);storage.removeAttribute(key);storage.save(localStorageName)});store.clear=withIEStorage(function(storage){var attributes=storage.XMLDocument.documentElement.attributes;storage.load(localStorageName);for(var i=0,attr;attr=attributes[i];i++){storage.removeAttribute(attr.name)}storage.save(localStorageName)});store.getAll=withIEStorage(function(storage){var attributes=storage.XMLDocument.documentElement.attributes;var ret={};for(var i=0,attr;attr=attributes[i];++i){var key=ieKeyFix(attr.name);ret[attr.name]=store.deserialize(storage.getAttribute(key))}return ret})}try{store.set(namespace,namespace);if(store.get(namespace)!=namespace){store.disabled=true}store.remove(namespace)}catch(e){store.disabled=true}store.enabled=!store.disabled;module.exports=store},{json:193}],199:[function(require,module,exports){module.exports=function(a,b){var fn=function(){};fn.prototype=b.prototype;a.prototype=new fn;a.prototype.constructor=a}},{}],187:[function(require,module,exports){module.exports=function isMeta(e){if(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)return true;var which=e.which,button=e.button;if(!which&&button!==undefined){return!button&1&&!button&2&&button&4}else if(which===2){return true}return false}},{}],188:[function(require,module,exports){exports.bind=function(el,type,fn,capture){if(el.addEventListener){el.addEventListener(type,fn,capture||false)}else{el.attachEvent("on"+type,fn)}return fn};exports.unbind=function(el,type,fn,capture){if(el.removeEventListener){el.removeEventListener(type,fn,capture||false)}else{el.detachEvent("on"+type,fn)}return fn}},{}],189:[function(require,module,exports){module.exports=function(e){e=e||window.event;return e.preventDefault?e.preventDefault():e.returnValue=false}},{}],190:[function(require,module,exports){var encode=encodeURIComponent;var decode=decodeURIComponent;var trim=require("trim");var type=require("type");exports.parse=function(str){if("string"!=typeof str)return{};str=trim(str);if(""==str)return{};if("?"==str.charAt(0))str=str.slice(1);var obj={};var pairs=str.split("&");for(var i=0;i<pairs.length;i++){var parts=pairs[i].split("=");var key=decode(parts[0]);var m;if(m=/(\w+)\[(\d+)\]/.exec(key)){obj[m[1]]=obj[m[1]]||[];obj[m[1]][m[2]]=decode(parts[1]);continue}obj[parts[0]]=null==parts[1]?"":decode(parts[1])}return obj};exports.stringify=function(obj){if(!obj)return"";var pairs=[];for(var key in obj){var value=obj[key];if("array"==type(value)){for(var i=0;i<value.length;++i){pairs.push(encode(key+"["+i+"]")+"="+encode(value[i]))}continue}pairs.push(encode(key)+"="+encode(obj[key]))}return pairs.join("&")}},{trim:165,type:7}],192:[function(require,module,exports){var debug=require("debug")("analytics:user");var Entity=require("./entity");var inherit=require("inherit");var bind=require("bind");var cookie=require("./cookie");User.defaults={persist:true,cookie:{key:"ajs_user_id",oldKey:"ajs_user"},localStorage:{key:"ajs_user_traits"}};function User(options){this.defaults=User.defaults;this.debug=debug;Entity.call(this,options)}inherit(User,Entity);User.prototype.load=function(){if(this._loadOldCookie())return;Entity.prototype.load.call(this)};User.prototype._loadOldCookie=function(){var user=cookie.get(this._options.cookie.oldKey);if(!user)return false;this.id(user.id);this.traits(user.traits);cookie.remove(this._options.cookie.oldKey);return true};module.exports=bind.all(new User);module.exports.User=User},{debug:185,"./entity":198,inherit:199,bind:183,"./cookie":184}],5:[function(require,module,exports){module.exports="2.3.10"},{}]},{},{1:"analytics"});
src/components/CollapsiblePanel.js
hairmot/REACTModuleTest
import React from 'react'; import ValidTick from './validTick'; export default class collapsiblePanel extends React.Component { constructor(props) { super(props); this.state = { expanded: true } } render() { return ( <div className={this.props.valid ? 'sv-panel sv-panel-default' : 'sv-panel sv-panel-danger'}> <div className="sv-panel-heading" style={{ cursor: 'pointer' }} onClick={() => this.setState({ expanded: !this.state.expanded })}> {this.props.title} {!this.state.expanded ? '(click to expand)' : '(click to hide)'} <ValidTick valid={this.props.valid} /> </div> <div className="sv-panel-body" style={this.state.expanded ? { display: 'block' } : { display: 'none' }}> {this.props.children} </div> </div> ) } }
wp-includes/js/jquery/jquery.js
plongx21/WP3
/*! jQuery v1.11.3 | (c) 2005, 2015 jQuery Foundation, Inc. | jquery.org/license */ !function(a,b){"object"==typeof module&&"object"==typeof module.exports?module.exports=a.document?b(a,!0):function(a){if(!a.document)throw new Error("jQuery requires a window with a document");return b(a)}:b(a)}("undefined"!=typeof window?window:this,function(a,b){var c=[],d=c.slice,e=c.concat,f=c.push,g=c.indexOf,h={},i=h.toString,j=h.hasOwnProperty,k={},l="1.11.3",m=function(a,b){return new m.fn.init(a,b)},n=/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,o=/^-ms-/,p=/-([\da-z])/gi,q=function(a,b){return b.toUpperCase()};m.fn=m.prototype={jquery:l,constructor:m,selector:"",length:0,toArray:function(){return d.call(this)},get:function(a){return null!=a?0>a?this[a+this.length]:this[a]:d.call(this)},pushStack:function(a){var b=m.merge(this.constructor(),a);return b.prevObject=this,b.context=this.context,b},each:function(a,b){return m.each(this,a,b)},map:function(a){return this.pushStack(m.map(this,function(b,c){return a.call(b,c,b)}))},slice:function(){return this.pushStack(d.apply(this,arguments))},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},eq:function(a){var b=this.length,c=+a+(0>a?b:0);return this.pushStack(c>=0&&b>c?[this[c]]:[])},end:function(){return this.prevObject||this.constructor(null)},push:f,sort:c.sort,splice:c.splice},m.extend=m.fn.extend=function(){var a,b,c,d,e,f,g=arguments[0]||{},h=1,i=arguments.length,j=!1;for("boolean"==typeof g&&(j=g,g=arguments[h]||{},h++),"object"==typeof g||m.isFunction(g)||(g={}),h===i&&(g=this,h--);i>h;h++)if(null!=(e=arguments[h]))for(d in e)a=g[d],c=e[d],g!==c&&(j&&c&&(m.isPlainObject(c)||(b=m.isArray(c)))?(b?(b=!1,f=a&&m.isArray(a)?a:[]):f=a&&m.isPlainObject(a)?a:{},g[d]=m.extend(j,f,c)):void 0!==c&&(g[d]=c));return g},m.extend({expando:"jQuery"+(l+Math.random()).replace(/\D/g,""),isReady:!0,error:function(a){throw new Error(a)},noop:function(){},isFunction:function(a){return"function"===m.type(a)},isArray:Array.isArray||function(a){return"array"===m.type(a)},isWindow:function(a){return null!=a&&a==a.window},isNumeric:function(a){return!m.isArray(a)&&a-parseFloat(a)+1>=0},isEmptyObject:function(a){var b;for(b in a)return!1;return!0},isPlainObject:function(a){var b;if(!a||"object"!==m.type(a)||a.nodeType||m.isWindow(a))return!1;try{if(a.constructor&&!j.call(a,"constructor")&&!j.call(a.constructor.prototype,"isPrototypeOf"))return!1}catch(c){return!1}if(k.ownLast)for(b in a)return j.call(a,b);for(b in a);return void 0===b||j.call(a,b)},type:function(a){return null==a?a+"":"object"==typeof a||"function"==typeof a?h[i.call(a)]||"object":typeof a},globalEval:function(b){b&&m.trim(b)&&(a.execScript||function(b){a.eval.call(a,b)})(b)},camelCase:function(a){return a.replace(o,"ms-").replace(p,q)},nodeName:function(a,b){return a.nodeName&&a.nodeName.toLowerCase()===b.toLowerCase()},each:function(a,b,c){var d,e=0,f=a.length,g=r(a);if(c){if(g){for(;f>e;e++)if(d=b.apply(a[e],c),d===!1)break}else for(e in a)if(d=b.apply(a[e],c),d===!1)break}else if(g){for(;f>e;e++)if(d=b.call(a[e],e,a[e]),d===!1)break}else for(e in a)if(d=b.call(a[e],e,a[e]),d===!1)break;return a},trim:function(a){return null==a?"":(a+"").replace(n,"")},makeArray:function(a,b){var c=b||[];return null!=a&&(r(Object(a))?m.merge(c,"string"==typeof a?[a]:a):f.call(c,a)),c},inArray:function(a,b,c){var d;if(b){if(g)return g.call(b,a,c);for(d=b.length,c=c?0>c?Math.max(0,d+c):c:0;d>c;c++)if(c in b&&b[c]===a)return c}return-1},merge:function(a,b){var c=+b.length,d=0,e=a.length;while(c>d)a[e++]=b[d++];if(c!==c)while(void 0!==b[d])a[e++]=b[d++];return a.length=e,a},grep:function(a,b,c){for(var d,e=[],f=0,g=a.length,h=!c;g>f;f++)d=!b(a[f],f),d!==h&&e.push(a[f]);return e},map:function(a,b,c){var d,f=0,g=a.length,h=r(a),i=[];if(h)for(;g>f;f++)d=b(a[f],f,c),null!=d&&i.push(d);else for(f in a)d=b(a[f],f,c),null!=d&&i.push(d);return e.apply([],i)},guid:1,proxy:function(a,b){var c,e,f;return"string"==typeof b&&(f=a[b],b=a,a=f),m.isFunction(a)?(c=d.call(arguments,2),e=function(){return a.apply(b||this,c.concat(d.call(arguments)))},e.guid=a.guid=a.guid||m.guid++,e):void 0},now:function(){return+new Date},support:k}),m.each("Boolean Number String Function Array Date RegExp Object Error".split(" "),function(a,b){h["[object "+b+"]"]=b.toLowerCase()});function r(a){var b="length"in a&&a.length,c=m.type(a);return"function"===c||m.isWindow(a)?!1:1===a.nodeType&&b?!0:"array"===c||0===b||"number"==typeof b&&b>0&&b-1 in a}var s=function(a){var b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u="sizzle"+1*new Date,v=a.document,w=0,x=0,y=ha(),z=ha(),A=ha(),B=function(a,b){return a===b&&(l=!0),0},C=1<<31,D={}.hasOwnProperty,E=[],F=E.pop,G=E.push,H=E.push,I=E.slice,J=function(a,b){for(var c=0,d=a.length;d>c;c++)if(a[c]===b)return c;return-1},K="checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|ismap|loop|multiple|open|readonly|required|scoped",L="[\\x20\\t\\r\\n\\f]",M="(?:\\\\.|[\\w-]|[^\\x00-\\xa0])+",N=M.replace("w","w#"),O="\\["+L+"*("+M+")(?:"+L+"*([*^$|!~]?=)"+L+"*(?:'((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\"|("+N+"))|)"+L+"*\\]",P=":("+M+")(?:\\((('((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\")|((?:\\\\.|[^\\\\()[\\]]|"+O+")*)|.*)\\)|)",Q=new RegExp(L+"+","g"),R=new RegExp("^"+L+"+|((?:^|[^\\\\])(?:\\\\.)*)"+L+"+$","g"),S=new RegExp("^"+L+"*,"+L+"*"),T=new RegExp("^"+L+"*([>+~]|"+L+")"+L+"*"),U=new RegExp("="+L+"*([^\\]'\"]*?)"+L+"*\\]","g"),V=new RegExp(P),W=new RegExp("^"+N+"$"),X={ID:new RegExp("^#("+M+")"),CLASS:new RegExp("^\\.("+M+")"),TAG:new RegExp("^("+M.replace("w","w*")+")"),ATTR:new RegExp("^"+O),PSEUDO:new RegExp("^"+P),CHILD:new RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\("+L+"*(even|odd|(([+-]|)(\\d*)n|)"+L+"*(?:([+-]|)"+L+"*(\\d+)|))"+L+"*\\)|)","i"),bool:new RegExp("^(?:"+K+")$","i"),needsContext:new RegExp("^"+L+"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\("+L+"*((?:-\\d)?\\d*)"+L+"*\\)|)(?=[^-]|$)","i")},Y=/^(?:input|select|textarea|button)$/i,Z=/^h\d$/i,$=/^[^{]+\{\s*\[native \w/,_=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,aa=/[+~]/,ba=/'|\\/g,ca=new RegExp("\\\\([\\da-f]{1,6}"+L+"?|("+L+")|.)","ig"),da=function(a,b,c){var d="0x"+b-65536;return d!==d||c?b:0>d?String.fromCharCode(d+65536):String.fromCharCode(d>>10|55296,1023&d|56320)},ea=function(){m()};try{H.apply(E=I.call(v.childNodes),v.childNodes),E[v.childNodes.length].nodeType}catch(fa){H={apply:E.length?function(a,b){G.apply(a,I.call(b))}:function(a,b){var c=a.length,d=0;while(a[c++]=b[d++]);a.length=c-1}}}function ga(a,b,d,e){var f,h,j,k,l,o,r,s,w,x;if((b?b.ownerDocument||b:v)!==n&&m(b),b=b||n,d=d||[],k=b.nodeType,"string"!=typeof a||!a||1!==k&&9!==k&&11!==k)return d;if(!e&&p){if(11!==k&&(f=_.exec(a)))if(j=f[1]){if(9===k){if(h=b.getElementById(j),!h||!h.parentNode)return d;if(h.id===j)return d.push(h),d}else if(b.ownerDocument&&(h=b.ownerDocument.getElementById(j))&&t(b,h)&&h.id===j)return d.push(h),d}else{if(f[2])return H.apply(d,b.getElementsByTagName(a)),d;if((j=f[3])&&c.getElementsByClassName)return H.apply(d,b.getElementsByClassName(j)),d}if(c.qsa&&(!q||!q.test(a))){if(s=r=u,w=b,x=1!==k&&a,1===k&&"object"!==b.nodeName.toLowerCase()){o=g(a),(r=b.getAttribute("id"))?s=r.replace(ba,"\\$&"):b.setAttribute("id",s),s="[id='"+s+"'] ",l=o.length;while(l--)o[l]=s+ra(o[l]);w=aa.test(a)&&pa(b.parentNode)||b,x=o.join(",")}if(x)try{return H.apply(d,w.querySelectorAll(x)),d}catch(y){}finally{r||b.removeAttribute("id")}}}return i(a.replace(R,"$1"),b,d,e)}function ha(){var a=[];function b(c,e){return a.push(c+" ")>d.cacheLength&&delete b[a.shift()],b[c+" "]=e}return b}function ia(a){return a[u]=!0,a}function ja(a){var b=n.createElement("div");try{return!!a(b)}catch(c){return!1}finally{b.parentNode&&b.parentNode.removeChild(b),b=null}}function ka(a,b){var c=a.split("|"),e=a.length;while(e--)d.attrHandle[c[e]]=b}function la(a,b){var c=b&&a,d=c&&1===a.nodeType&&1===b.nodeType&&(~b.sourceIndex||C)-(~a.sourceIndex||C);if(d)return d;if(c)while(c=c.nextSibling)if(c===b)return-1;return a?1:-1}function ma(a){return function(b){var c=b.nodeName.toLowerCase();return"input"===c&&b.type===a}}function na(a){return function(b){var c=b.nodeName.toLowerCase();return("input"===c||"button"===c)&&b.type===a}}function oa(a){return ia(function(b){return b=+b,ia(function(c,d){var e,f=a([],c.length,b),g=f.length;while(g--)c[e=f[g]]&&(c[e]=!(d[e]=c[e]))})})}function pa(a){return a&&"undefined"!=typeof a.getElementsByTagName&&a}c=ga.support={},f=ga.isXML=function(a){var b=a&&(a.ownerDocument||a).documentElement;return b?"HTML"!==b.nodeName:!1},m=ga.setDocument=function(a){var b,e,g=a?a.ownerDocument||a:v;return g!==n&&9===g.nodeType&&g.documentElement?(n=g,o=g.documentElement,e=g.defaultView,e&&e!==e.top&&(e.addEventListener?e.addEventListener("unload",ea,!1):e.attachEvent&&e.attachEvent("onunload",ea)),p=!f(g),c.attributes=ja(function(a){return a.className="i",!a.getAttribute("className")}),c.getElementsByTagName=ja(function(a){return a.appendChild(g.createComment("")),!a.getElementsByTagName("*").length}),c.getElementsByClassName=$.test(g.getElementsByClassName),c.getById=ja(function(a){return o.appendChild(a).id=u,!g.getElementsByName||!g.getElementsByName(u).length}),c.getById?(d.find.ID=function(a,b){if("undefined"!=typeof b.getElementById&&p){var c=b.getElementById(a);return c&&c.parentNode?[c]:[]}},d.filter.ID=function(a){var b=a.replace(ca,da);return function(a){return a.getAttribute("id")===b}}):(delete d.find.ID,d.filter.ID=function(a){var b=a.replace(ca,da);return function(a){var c="undefined"!=typeof a.getAttributeNode&&a.getAttributeNode("id");return c&&c.value===b}}),d.find.TAG=c.getElementsByTagName?function(a,b){return"undefined"!=typeof b.getElementsByTagName?b.getElementsByTagName(a):c.qsa?b.querySelectorAll(a):void 0}:function(a,b){var c,d=[],e=0,f=b.getElementsByTagName(a);if("*"===a){while(c=f[e++])1===c.nodeType&&d.push(c);return d}return f},d.find.CLASS=c.getElementsByClassName&&function(a,b){return p?b.getElementsByClassName(a):void 0},r=[],q=[],(c.qsa=$.test(g.querySelectorAll))&&(ja(function(a){o.appendChild(a).innerHTML="<a id='"+u+"'></a><select id='"+u+"-\f]' msallowcapture=''><option selected=''></option></select>",a.querySelectorAll("[msallowcapture^='']").length&&q.push("[*^$]="+L+"*(?:''|\"\")"),a.querySelectorAll("[selected]").length||q.push("\\["+L+"*(?:value|"+K+")"),a.querySelectorAll("[id~="+u+"-]").length||q.push("~="),a.querySelectorAll(":checked").length||q.push(":checked"),a.querySelectorAll("a#"+u+"+*").length||q.push(".#.+[+~]")}),ja(function(a){var b=g.createElement("input");b.setAttribute("type","hidden"),a.appendChild(b).setAttribute("name","D"),a.querySelectorAll("[name=d]").length&&q.push("name"+L+"*[*^$|!~]?="),a.querySelectorAll(":enabled").length||q.push(":enabled",":disabled"),a.querySelectorAll("*,:x"),q.push(",.*:")})),(c.matchesSelector=$.test(s=o.matches||o.webkitMatchesSelector||o.mozMatchesSelector||o.oMatchesSelector||o.msMatchesSelector))&&ja(function(a){c.disconnectedMatch=s.call(a,"div"),s.call(a,"[s!='']:x"),r.push("!=",P)}),q=q.length&&new RegExp(q.join("|")),r=r.length&&new RegExp(r.join("|")),b=$.test(o.compareDocumentPosition),t=b||$.test(o.contains)?function(a,b){var c=9===a.nodeType?a.documentElement:a,d=b&&b.parentNode;return a===d||!(!d||1!==d.nodeType||!(c.contains?c.contains(d):a.compareDocumentPosition&&16&a.compareDocumentPosition(d)))}:function(a,b){if(b)while(b=b.parentNode)if(b===a)return!0;return!1},B=b?function(a,b){if(a===b)return l=!0,0;var d=!a.compareDocumentPosition-!b.compareDocumentPosition;return d?d:(d=(a.ownerDocument||a)===(b.ownerDocument||b)?a.compareDocumentPosition(b):1,1&d||!c.sortDetached&&b.compareDocumentPosition(a)===d?a===g||a.ownerDocument===v&&t(v,a)?-1:b===g||b.ownerDocument===v&&t(v,b)?1:k?J(k,a)-J(k,b):0:4&d?-1:1)}:function(a,b){if(a===b)return l=!0,0;var c,d=0,e=a.parentNode,f=b.parentNode,h=[a],i=[b];if(!e||!f)return a===g?-1:b===g?1:e?-1:f?1:k?J(k,a)-J(k,b):0;if(e===f)return la(a,b);c=a;while(c=c.parentNode)h.unshift(c);c=b;while(c=c.parentNode)i.unshift(c);while(h[d]===i[d])d++;return d?la(h[d],i[d]):h[d]===v?-1:i[d]===v?1:0},g):n},ga.matches=function(a,b){return ga(a,null,null,b)},ga.matchesSelector=function(a,b){if((a.ownerDocument||a)!==n&&m(a),b=b.replace(U,"='$1']"),!(!c.matchesSelector||!p||r&&r.test(b)||q&&q.test(b)))try{var d=s.call(a,b);if(d||c.disconnectedMatch||a.document&&11!==a.document.nodeType)return d}catch(e){}return ga(b,n,null,[a]).length>0},ga.contains=function(a,b){return(a.ownerDocument||a)!==n&&m(a),t(a,b)},ga.attr=function(a,b){(a.ownerDocument||a)!==n&&m(a);var e=d.attrHandle[b.toLowerCase()],f=e&&D.call(d.attrHandle,b.toLowerCase())?e(a,b,!p):void 0;return void 0!==f?f:c.attributes||!p?a.getAttribute(b):(f=a.getAttributeNode(b))&&f.specified?f.value:null},ga.error=function(a){throw new Error("Syntax error, unrecognized expression: "+a)},ga.uniqueSort=function(a){var b,d=[],e=0,f=0;if(l=!c.detectDuplicates,k=!c.sortStable&&a.slice(0),a.sort(B),l){while(b=a[f++])b===a[f]&&(e=d.push(f));while(e--)a.splice(d[e],1)}return k=null,a},e=ga.getText=function(a){var b,c="",d=0,f=a.nodeType;if(f){if(1===f||9===f||11===f){if("string"==typeof a.textContent)return a.textContent;for(a=a.firstChild;a;a=a.nextSibling)c+=e(a)}else if(3===f||4===f)return a.nodeValue}else while(b=a[d++])c+=e(b);return c},d=ga.selectors={cacheLength:50,createPseudo:ia,match:X,attrHandle:{},find:{},relative:{">":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(a){return a[1]=a[1].replace(ca,da),a[3]=(a[3]||a[4]||a[5]||"").replace(ca,da),"~="===a[2]&&(a[3]=" "+a[3]+" "),a.slice(0,4)},CHILD:function(a){return a[1]=a[1].toLowerCase(),"nth"===a[1].slice(0,3)?(a[3]||ga.error(a[0]),a[4]=+(a[4]?a[5]+(a[6]||1):2*("even"===a[3]||"odd"===a[3])),a[5]=+(a[7]+a[8]||"odd"===a[3])):a[3]&&ga.error(a[0]),a},PSEUDO:function(a){var b,c=!a[6]&&a[2];return X.CHILD.test(a[0])?null:(a[3]?a[2]=a[4]||a[5]||"":c&&V.test(c)&&(b=g(c,!0))&&(b=c.indexOf(")",c.length-b)-c.length)&&(a[0]=a[0].slice(0,b),a[2]=c.slice(0,b)),a.slice(0,3))}},filter:{TAG:function(a){var b=a.replace(ca,da).toLowerCase();return"*"===a?function(){return!0}:function(a){return a.nodeName&&a.nodeName.toLowerCase()===b}},CLASS:function(a){var b=y[a+" "];return b||(b=new RegExp("(^|"+L+")"+a+"("+L+"|$)"))&&y(a,function(a){return b.test("string"==typeof a.className&&a.className||"undefined"!=typeof a.getAttribute&&a.getAttribute("class")||"")})},ATTR:function(a,b,c){return function(d){var e=ga.attr(d,a);return null==e?"!="===b:b?(e+="","="===b?e===c:"!="===b?e!==c:"^="===b?c&&0===e.indexOf(c):"*="===b?c&&e.indexOf(c)>-1:"$="===b?c&&e.slice(-c.length)===c:"~="===b?(" "+e.replace(Q," ")+" ").indexOf(c)>-1:"|="===b?e===c||e.slice(0,c.length+1)===c+"-":!1):!0}},CHILD:function(a,b,c,d,e){var f="nth"!==a.slice(0,3),g="last"!==a.slice(-4),h="of-type"===b;return 1===d&&0===e?function(a){return!!a.parentNode}:function(b,c,i){var j,k,l,m,n,o,p=f!==g?"nextSibling":"previousSibling",q=b.parentNode,r=h&&b.nodeName.toLowerCase(),s=!i&&!h;if(q){if(f){while(p){l=b;while(l=l[p])if(h?l.nodeName.toLowerCase()===r:1===l.nodeType)return!1;o=p="only"===a&&!o&&"nextSibling"}return!0}if(o=[g?q.firstChild:q.lastChild],g&&s){k=q[u]||(q[u]={}),j=k[a]||[],n=j[0]===w&&j[1],m=j[0]===w&&j[2],l=n&&q.childNodes[n];while(l=++n&&l&&l[p]||(m=n=0)||o.pop())if(1===l.nodeType&&++m&&l===b){k[a]=[w,n,m];break}}else if(s&&(j=(b[u]||(b[u]={}))[a])&&j[0]===w)m=j[1];else while(l=++n&&l&&l[p]||(m=n=0)||o.pop())if((h?l.nodeName.toLowerCase()===r:1===l.nodeType)&&++m&&(s&&((l[u]||(l[u]={}))[a]=[w,m]),l===b))break;return m-=e,m===d||m%d===0&&m/d>=0}}},PSEUDO:function(a,b){var c,e=d.pseudos[a]||d.setFilters[a.toLowerCase()]||ga.error("unsupported pseudo: "+a);return e[u]?e(b):e.length>1?(c=[a,a,"",b],d.setFilters.hasOwnProperty(a.toLowerCase())?ia(function(a,c){var d,f=e(a,b),g=f.length;while(g--)d=J(a,f[g]),a[d]=!(c[d]=f[g])}):function(a){return e(a,0,c)}):e}},pseudos:{not:ia(function(a){var b=[],c=[],d=h(a.replace(R,"$1"));return d[u]?ia(function(a,b,c,e){var f,g=d(a,null,e,[]),h=a.length;while(h--)(f=g[h])&&(a[h]=!(b[h]=f))}):function(a,e,f){return b[0]=a,d(b,null,f,c),b[0]=null,!c.pop()}}),has:ia(function(a){return function(b){return ga(a,b).length>0}}),contains:ia(function(a){return a=a.replace(ca,da),function(b){return(b.textContent||b.innerText||e(b)).indexOf(a)>-1}}),lang:ia(function(a){return W.test(a||"")||ga.error("unsupported lang: "+a),a=a.replace(ca,da).toLowerCase(),function(b){var c;do if(c=p?b.lang:b.getAttribute("xml:lang")||b.getAttribute("lang"))return c=c.toLowerCase(),c===a||0===c.indexOf(a+"-");while((b=b.parentNode)&&1===b.nodeType);return!1}}),target:function(b){var c=a.location&&a.location.hash;return c&&c.slice(1)===b.id},root:function(a){return a===o},focus:function(a){return a===n.activeElement&&(!n.hasFocus||n.hasFocus())&&!!(a.type||a.href||~a.tabIndex)},enabled:function(a){return a.disabled===!1},disabled:function(a){return a.disabled===!0},checked:function(a){var b=a.nodeName.toLowerCase();return"input"===b&&!!a.checked||"option"===b&&!!a.selected},selected:function(a){return a.parentNode&&a.parentNode.selectedIndex,a.selected===!0},empty:function(a){for(a=a.firstChild;a;a=a.nextSibling)if(a.nodeType<6)return!1;return!0},parent:function(a){return!d.pseudos.empty(a)},header:function(a){return Z.test(a.nodeName)},input:function(a){return Y.test(a.nodeName)},button:function(a){var b=a.nodeName.toLowerCase();return"input"===b&&"button"===a.type||"button"===b},text:function(a){var b;return"input"===a.nodeName.toLowerCase()&&"text"===a.type&&(null==(b=a.getAttribute("type"))||"text"===b.toLowerCase())},first:oa(function(){return[0]}),last:oa(function(a,b){return[b-1]}),eq:oa(function(a,b,c){return[0>c?c+b:c]}),even:oa(function(a,b){for(var c=0;b>c;c+=2)a.push(c);return a}),odd:oa(function(a,b){for(var c=1;b>c;c+=2)a.push(c);return a}),lt:oa(function(a,b,c){for(var d=0>c?c+b:c;--d>=0;)a.push(d);return a}),gt:oa(function(a,b,c){for(var d=0>c?c+b:c;++d<b;)a.push(d);return a})}},d.pseudos.nth=d.pseudos.eq;for(b in{radio:!0,checkbox:!0,file:!0,password:!0,image:!0})d.pseudos[b]=ma(b);for(b in{submit:!0,reset:!0})d.pseudos[b]=na(b);function qa(){}qa.prototype=d.filters=d.pseudos,d.setFilters=new qa,g=ga.tokenize=function(a,b){var c,e,f,g,h,i,j,k=z[a+" "];if(k)return b?0:k.slice(0);h=a,i=[],j=d.preFilter;while(h){(!c||(e=S.exec(h)))&&(e&&(h=h.slice(e[0].length)||h),i.push(f=[])),c=!1,(e=T.exec(h))&&(c=e.shift(),f.push({value:c,type:e[0].replace(R," ")}),h=h.slice(c.length));for(g in d.filter)!(e=X[g].exec(h))||j[g]&&!(e=j[g](e))||(c=e.shift(),f.push({value:c,type:g,matches:e}),h=h.slice(c.length));if(!c)break}return b?h.length:h?ga.error(a):z(a,i).slice(0)};function ra(a){for(var b=0,c=a.length,d="";c>b;b++)d+=a[b].value;return d}function sa(a,b,c){var d=b.dir,e=c&&"parentNode"===d,f=x++;return b.first?function(b,c,f){while(b=b[d])if(1===b.nodeType||e)return a(b,c,f)}:function(b,c,g){var h,i,j=[w,f];if(g){while(b=b[d])if((1===b.nodeType||e)&&a(b,c,g))return!0}else while(b=b[d])if(1===b.nodeType||e){if(i=b[u]||(b[u]={}),(h=i[d])&&h[0]===w&&h[1]===f)return j[2]=h[2];if(i[d]=j,j[2]=a(b,c,g))return!0}}}function ta(a){return a.length>1?function(b,c,d){var e=a.length;while(e--)if(!a[e](b,c,d))return!1;return!0}:a[0]}function ua(a,b,c){for(var d=0,e=b.length;e>d;d++)ga(a,b[d],c);return c}function va(a,b,c,d,e){for(var f,g=[],h=0,i=a.length,j=null!=b;i>h;h++)(f=a[h])&&(!c||c(f,d,e))&&(g.push(f),j&&b.push(h));return g}function wa(a,b,c,d,e,f){return d&&!d[u]&&(d=wa(d)),e&&!e[u]&&(e=wa(e,f)),ia(function(f,g,h,i){var j,k,l,m=[],n=[],o=g.length,p=f||ua(b||"*",h.nodeType?[h]:h,[]),q=!a||!f&&b?p:va(p,m,a,h,i),r=c?e||(f?a:o||d)?[]:g:q;if(c&&c(q,r,h,i),d){j=va(r,n),d(j,[],h,i),k=j.length;while(k--)(l=j[k])&&(r[n[k]]=!(q[n[k]]=l))}if(f){if(e||a){if(e){j=[],k=r.length;while(k--)(l=r[k])&&j.push(q[k]=l);e(null,r=[],j,i)}k=r.length;while(k--)(l=r[k])&&(j=e?J(f,l):m[k])>-1&&(f[j]=!(g[j]=l))}}else r=va(r===g?r.splice(o,r.length):r),e?e(null,g,r,i):H.apply(g,r)})}function xa(a){for(var b,c,e,f=a.length,g=d.relative[a[0].type],h=g||d.relative[" "],i=g?1:0,k=sa(function(a){return a===b},h,!0),l=sa(function(a){return J(b,a)>-1},h,!0),m=[function(a,c,d){var e=!g&&(d||c!==j)||((b=c).nodeType?k(a,c,d):l(a,c,d));return b=null,e}];f>i;i++)if(c=d.relative[a[i].type])m=[sa(ta(m),c)];else{if(c=d.filter[a[i].type].apply(null,a[i].matches),c[u]){for(e=++i;f>e;e++)if(d.relative[a[e].type])break;return wa(i>1&&ta(m),i>1&&ra(a.slice(0,i-1).concat({value:" "===a[i-2].type?"*":""})).replace(R,"$1"),c,e>i&&xa(a.slice(i,e)),f>e&&xa(a=a.slice(e)),f>e&&ra(a))}m.push(c)}return ta(m)}function ya(a,b){var c=b.length>0,e=a.length>0,f=function(f,g,h,i,k){var l,m,o,p=0,q="0",r=f&&[],s=[],t=j,u=f||e&&d.find.TAG("*",k),v=w+=null==t?1:Math.random()||.1,x=u.length;for(k&&(j=g!==n&&g);q!==x&&null!=(l=u[q]);q++){if(e&&l){m=0;while(o=a[m++])if(o(l,g,h)){i.push(l);break}k&&(w=v)}c&&((l=!o&&l)&&p--,f&&r.push(l))}if(p+=q,c&&q!==p){m=0;while(o=b[m++])o(r,s,g,h);if(f){if(p>0)while(q--)r[q]||s[q]||(s[q]=F.call(i));s=va(s)}H.apply(i,s),k&&!f&&s.length>0&&p+b.length>1&&ga.uniqueSort(i)}return k&&(w=v,j=t),r};return c?ia(f):f}return h=ga.compile=function(a,b){var c,d=[],e=[],f=A[a+" "];if(!f){b||(b=g(a)),c=b.length;while(c--)f=xa(b[c]),f[u]?d.push(f):e.push(f);f=A(a,ya(e,d)),f.selector=a}return f},i=ga.select=function(a,b,e,f){var i,j,k,l,m,n="function"==typeof a&&a,o=!f&&g(a=n.selector||a);if(e=e||[],1===o.length){if(j=o[0]=o[0].slice(0),j.length>2&&"ID"===(k=j[0]).type&&c.getById&&9===b.nodeType&&p&&d.relative[j[1].type]){if(b=(d.find.ID(k.matches[0].replace(ca,da),b)||[])[0],!b)return e;n&&(b=b.parentNode),a=a.slice(j.shift().value.length)}i=X.needsContext.test(a)?0:j.length;while(i--){if(k=j[i],d.relative[l=k.type])break;if((m=d.find[l])&&(f=m(k.matches[0].replace(ca,da),aa.test(j[0].type)&&pa(b.parentNode)||b))){if(j.splice(i,1),a=f.length&&ra(j),!a)return H.apply(e,f),e;break}}}return(n||h(a,o))(f,b,!p,e,aa.test(a)&&pa(b.parentNode)||b),e},c.sortStable=u.split("").sort(B).join("")===u,c.detectDuplicates=!!l,m(),c.sortDetached=ja(function(a){return 1&a.compareDocumentPosition(n.createElement("div"))}),ja(function(a){return a.innerHTML="<a href='#'></a>","#"===a.firstChild.getAttribute("href")})||ka("type|href|height|width",function(a,b,c){return c?void 0:a.getAttribute(b,"type"===b.toLowerCase()?1:2)}),c.attributes&&ja(function(a){return a.innerHTML="<input/>",a.firstChild.setAttribute("value",""),""===a.firstChild.getAttribute("value")})||ka("value",function(a,b,c){return c||"input"!==a.nodeName.toLowerCase()?void 0:a.defaultValue}),ja(function(a){return null==a.getAttribute("disabled")})||ka(K,function(a,b,c){var d;return c?void 0:a[b]===!0?b.toLowerCase():(d=a.getAttributeNode(b))&&d.specified?d.value:null}),ga}(a);m.find=s,m.expr=s.selectors,m.expr[":"]=m.expr.pseudos,m.unique=s.uniqueSort,m.text=s.getText,m.isXMLDoc=s.isXML,m.contains=s.contains;var t=m.expr.match.needsContext,u=/^<(\w+)\s*\/?>(?:<\/\1>|)$/,v=/^.[^:#\[\.,]*$/;function w(a,b,c){if(m.isFunction(b))return m.grep(a,function(a,d){return!!b.call(a,d,a)!==c});if(b.nodeType)return m.grep(a,function(a){return a===b!==c});if("string"==typeof b){if(v.test(b))return m.filter(b,a,c);b=m.filter(b,a)}return m.grep(a,function(a){return m.inArray(a,b)>=0!==c})}m.filter=function(a,b,c){var d=b[0];return c&&(a=":not("+a+")"),1===b.length&&1===d.nodeType?m.find.matchesSelector(d,a)?[d]:[]:m.find.matches(a,m.grep(b,function(a){return 1===a.nodeType}))},m.fn.extend({find:function(a){var b,c=[],d=this,e=d.length;if("string"!=typeof a)return this.pushStack(m(a).filter(function(){for(b=0;e>b;b++)if(m.contains(d[b],this))return!0}));for(b=0;e>b;b++)m.find(a,d[b],c);return c=this.pushStack(e>1?m.unique(c):c),c.selector=this.selector?this.selector+" "+a:a,c},filter:function(a){return this.pushStack(w(this,a||[],!1))},not:function(a){return this.pushStack(w(this,a||[],!0))},is:function(a){return!!w(this,"string"==typeof a&&t.test(a)?m(a):a||[],!1).length}});var x,y=a.document,z=/^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]*))$/,A=m.fn.init=function(a,b){var c,d;if(!a)return this;if("string"==typeof a){if(c="<"===a.charAt(0)&&">"===a.charAt(a.length-1)&&a.length>=3?[null,a,null]:z.exec(a),!c||!c[1]&&b)return!b||b.jquery?(b||x).find(a):this.constructor(b).find(a);if(c[1]){if(b=b instanceof m?b[0]:b,m.merge(this,m.parseHTML(c[1],b&&b.nodeType?b.ownerDocument||b:y,!0)),u.test(c[1])&&m.isPlainObject(b))for(c in b)m.isFunction(this[c])?this[c](b[c]):this.attr(c,b[c]);return this}if(d=y.getElementById(c[2]),d&&d.parentNode){if(d.id!==c[2])return x.find(a);this.length=1,this[0]=d}return this.context=y,this.selector=a,this}return a.nodeType?(this.context=this[0]=a,this.length=1,this):m.isFunction(a)?"undefined"!=typeof x.ready?x.ready(a):a(m):(void 0!==a.selector&&(this.selector=a.selector,this.context=a.context),m.makeArray(a,this))};A.prototype=m.fn,x=m(y);var B=/^(?:parents|prev(?:Until|All))/,C={children:!0,contents:!0,next:!0,prev:!0};m.extend({dir:function(a,b,c){var d=[],e=a[b];while(e&&9!==e.nodeType&&(void 0===c||1!==e.nodeType||!m(e).is(c)))1===e.nodeType&&d.push(e),e=e[b];return d},sibling:function(a,b){for(var c=[];a;a=a.nextSibling)1===a.nodeType&&a!==b&&c.push(a);return c}}),m.fn.extend({has:function(a){var b,c=m(a,this),d=c.length;return this.filter(function(){for(b=0;d>b;b++)if(m.contains(this,c[b]))return!0})},closest:function(a,b){for(var c,d=0,e=this.length,f=[],g=t.test(a)||"string"!=typeof a?m(a,b||this.context):0;e>d;d++)for(c=this[d];c&&c!==b;c=c.parentNode)if(c.nodeType<11&&(g?g.index(c)>-1:1===c.nodeType&&m.find.matchesSelector(c,a))){f.push(c);break}return this.pushStack(f.length>1?m.unique(f):f)},index:function(a){return a?"string"==typeof a?m.inArray(this[0],m(a)):m.inArray(a.jquery?a[0]:a,this):this[0]&&this[0].parentNode?this.first().prevAll().length:-1},add:function(a,b){return this.pushStack(m.unique(m.merge(this.get(),m(a,b))))},addBack:function(a){return this.add(null==a?this.prevObject:this.prevObject.filter(a))}});function D(a,b){do a=a[b];while(a&&1!==a.nodeType);return a}m.each({parent:function(a){var b=a.parentNode;return b&&11!==b.nodeType?b:null},parents:function(a){return m.dir(a,"parentNode")},parentsUntil:function(a,b,c){return m.dir(a,"parentNode",c)},next:function(a){return D(a,"nextSibling")},prev:function(a){return D(a,"previousSibling")},nextAll:function(a){return m.dir(a,"nextSibling")},prevAll:function(a){return m.dir(a,"previousSibling")},nextUntil:function(a,b,c){return m.dir(a,"nextSibling",c)},prevUntil:function(a,b,c){return m.dir(a,"previousSibling",c)},siblings:function(a){return m.sibling((a.parentNode||{}).firstChild,a)},children:function(a){return m.sibling(a.firstChild)},contents:function(a){return m.nodeName(a,"iframe")?a.contentDocument||a.contentWindow.document:m.merge([],a.childNodes)}},function(a,b){m.fn[a]=function(c,d){var e=m.map(this,b,c);return"Until"!==a.slice(-5)&&(d=c),d&&"string"==typeof d&&(e=m.filter(d,e)),this.length>1&&(C[a]||(e=m.unique(e)),B.test(a)&&(e=e.reverse())),this.pushStack(e)}});var E=/\S+/g,F={};function G(a){var b=F[a]={};return m.each(a.match(E)||[],function(a,c){b[c]=!0}),b}m.Callbacks=function(a){a="string"==typeof a?F[a]||G(a):m.extend({},a);var b,c,d,e,f,g,h=[],i=!a.once&&[],j=function(l){for(c=a.memory&&l,d=!0,f=g||0,g=0,e=h.length,b=!0;h&&e>f;f++)if(h[f].apply(l[0],l[1])===!1&&a.stopOnFalse){c=!1;break}b=!1,h&&(i?i.length&&j(i.shift()):c?h=[]:k.disable())},k={add:function(){if(h){var d=h.length;!function f(b){m.each(b,function(b,c){var d=m.type(c);"function"===d?a.unique&&k.has(c)||h.push(c):c&&c.length&&"string"!==d&&f(c)})}(arguments),b?e=h.length:c&&(g=d,j(c))}return this},remove:function(){return h&&m.each(arguments,function(a,c){var d;while((d=m.inArray(c,h,d))>-1)h.splice(d,1),b&&(e>=d&&e--,f>=d&&f--)}),this},has:function(a){return a?m.inArray(a,h)>-1:!(!h||!h.length)},empty:function(){return h=[],e=0,this},disable:function(){return h=i=c=void 0,this},disabled:function(){return!h},lock:function(){return i=void 0,c||k.disable(),this},locked:function(){return!i},fireWith:function(a,c){return!h||d&&!i||(c=c||[],c=[a,c.slice?c.slice():c],b?i.push(c):j(c)),this},fire:function(){return k.fireWith(this,arguments),this},fired:function(){return!!d}};return k},m.extend({Deferred:function(a){var b=[["resolve","done",m.Callbacks("once memory"),"resolved"],["reject","fail",m.Callbacks("once memory"),"rejected"],["notify","progress",m.Callbacks("memory")]],c="pending",d={state:function(){return c},always:function(){return e.done(arguments).fail(arguments),this},then:function(){var a=arguments;return m.Deferred(function(c){m.each(b,function(b,f){var g=m.isFunction(a[b])&&a[b];e[f[1]](function(){var a=g&&g.apply(this,arguments);a&&m.isFunction(a.promise)?a.promise().done(c.resolve).fail(c.reject).progress(c.notify):c[f[0]+"With"](this===d?c.promise():this,g?[a]:arguments)})}),a=null}).promise()},promise:function(a){return null!=a?m.extend(a,d):d}},e={};return d.pipe=d.then,m.each(b,function(a,f){var g=f[2],h=f[3];d[f[1]]=g.add,h&&g.add(function(){c=h},b[1^a][2].disable,b[2][2].lock),e[f[0]]=function(){return e[f[0]+"With"](this===e?d:this,arguments),this},e[f[0]+"With"]=g.fireWith}),d.promise(e),a&&a.call(e,e),e},when:function(a){var b=0,c=d.call(arguments),e=c.length,f=1!==e||a&&m.isFunction(a.promise)?e:0,g=1===f?a:m.Deferred(),h=function(a,b,c){return function(e){b[a]=this,c[a]=arguments.length>1?d.call(arguments):e,c===i?g.notifyWith(b,c):--f||g.resolveWith(b,c)}},i,j,k;if(e>1)for(i=new Array(e),j=new Array(e),k=new Array(e);e>b;b++)c[b]&&m.isFunction(c[b].promise)?c[b].promise().done(h(b,k,c)).fail(g.reject).progress(h(b,j,i)):--f;return f||g.resolveWith(k,c),g.promise()}});var H;m.fn.ready=function(a){return m.ready.promise().done(a),this},m.extend({isReady:!1,readyWait:1,holdReady:function(a){a?m.readyWait++:m.ready(!0)},ready:function(a){if(a===!0?!--m.readyWait:!m.isReady){if(!y.body)return setTimeout(m.ready);m.isReady=!0,a!==!0&&--m.readyWait>0||(H.resolveWith(y,[m]),m.fn.triggerHandler&&(m(y).triggerHandler("ready"),m(y).off("ready")))}}});function I(){y.addEventListener?(y.removeEventListener("DOMContentLoaded",J,!1),a.removeEventListener("load",J,!1)):(y.detachEvent("onreadystatechange",J),a.detachEvent("onload",J))}function J(){(y.addEventListener||"load"===event.type||"complete"===y.readyState)&&(I(),m.ready())}m.ready.promise=function(b){if(!H)if(H=m.Deferred(),"complete"===y.readyState)setTimeout(m.ready);else if(y.addEventListener)y.addEventListener("DOMContentLoaded",J,!1),a.addEventListener("load",J,!1);else{y.attachEvent("onreadystatechange",J),a.attachEvent("onload",J);var c=!1;try{c=null==a.frameElement&&y.documentElement}catch(d){}c&&c.doScroll&&!function e(){if(!m.isReady){try{c.doScroll("left")}catch(a){return setTimeout(e,50)}I(),m.ready()}}()}return H.promise(b)};var K="undefined",L;for(L in m(k))break;k.ownLast="0"!==L,k.inlineBlockNeedsLayout=!1,m(function(){var a,b,c,d;c=y.getElementsByTagName("body")[0],c&&c.style&&(b=y.createElement("div"),d=y.createElement("div"),d.style.cssText="position:absolute;border:0;width:0;height:0;top:0;left:-9999px",c.appendChild(d).appendChild(b),typeof b.style.zoom!==K&&(b.style.cssText="display:inline;margin:0;border:0;padding:1px;width:1px;zoom:1",k.inlineBlockNeedsLayout=a=3===b.offsetWidth,a&&(c.style.zoom=1)),c.removeChild(d))}),function(){var a=y.createElement("div");if(null==k.deleteExpando){k.deleteExpando=!0;try{delete a.test}catch(b){k.deleteExpando=!1}}a=null}(),m.acceptData=function(a){var b=m.noData[(a.nodeName+" ").toLowerCase()],c=+a.nodeType||1;return 1!==c&&9!==c?!1:!b||b!==!0&&a.getAttribute("classid")===b};var M=/^(?:\{[\w\W]*\}|\[[\w\W]*\])$/,N=/([A-Z])/g;function O(a,b,c){if(void 0===c&&1===a.nodeType){var d="data-"+b.replace(N,"-$1").toLowerCase();if(c=a.getAttribute(d),"string"==typeof c){try{c="true"===c?!0:"false"===c?!1:"null"===c?null:+c+""===c?+c:M.test(c)?m.parseJSON(c):c}catch(e){}m.data(a,b,c)}else c=void 0}return c}function P(a){var b;for(b in a)if(("data"!==b||!m.isEmptyObject(a[b]))&&"toJSON"!==b)return!1; return!0}function Q(a,b,d,e){if(m.acceptData(a)){var f,g,h=m.expando,i=a.nodeType,j=i?m.cache:a,k=i?a[h]:a[h]&&h;if(k&&j[k]&&(e||j[k].data)||void 0!==d||"string"!=typeof b)return k||(k=i?a[h]=c.pop()||m.guid++:h),j[k]||(j[k]=i?{}:{toJSON:m.noop}),("object"==typeof b||"function"==typeof b)&&(e?j[k]=m.extend(j[k],b):j[k].data=m.extend(j[k].data,b)),g=j[k],e||(g.data||(g.data={}),g=g.data),void 0!==d&&(g[m.camelCase(b)]=d),"string"==typeof b?(f=g[b],null==f&&(f=g[m.camelCase(b)])):f=g,f}}function R(a,b,c){if(m.acceptData(a)){var d,e,f=a.nodeType,g=f?m.cache:a,h=f?a[m.expando]:m.expando;if(g[h]){if(b&&(d=c?g[h]:g[h].data)){m.isArray(b)?b=b.concat(m.map(b,m.camelCase)):b in d?b=[b]:(b=m.camelCase(b),b=b in d?[b]:b.split(" ")),e=b.length;while(e--)delete d[b[e]];if(c?!P(d):!m.isEmptyObject(d))return}(c||(delete g[h].data,P(g[h])))&&(f?m.cleanData([a],!0):k.deleteExpando||g!=g.window?delete g[h]:g[h]=null)}}}m.extend({cache:{},noData:{"applet ":!0,"embed ":!0,"object ":"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"},hasData:function(a){return a=a.nodeType?m.cache[a[m.expando]]:a[m.expando],!!a&&!P(a)},data:function(a,b,c){return Q(a,b,c)},removeData:function(a,b){return R(a,b)},_data:function(a,b,c){return Q(a,b,c,!0)},_removeData:function(a,b){return R(a,b,!0)}}),m.fn.extend({data:function(a,b){var c,d,e,f=this[0],g=f&&f.attributes;if(void 0===a){if(this.length&&(e=m.data(f),1===f.nodeType&&!m._data(f,"parsedAttrs"))){c=g.length;while(c--)g[c]&&(d=g[c].name,0===d.indexOf("data-")&&(d=m.camelCase(d.slice(5)),O(f,d,e[d])));m._data(f,"parsedAttrs",!0)}return e}return"object"==typeof a?this.each(function(){m.data(this,a)}):arguments.length>1?this.each(function(){m.data(this,a,b)}):f?O(f,a,m.data(f,a)):void 0},removeData:function(a){return this.each(function(){m.removeData(this,a)})}}),m.extend({queue:function(a,b,c){var d;return a?(b=(b||"fx")+"queue",d=m._data(a,b),c&&(!d||m.isArray(c)?d=m._data(a,b,m.makeArray(c)):d.push(c)),d||[]):void 0},dequeue:function(a,b){b=b||"fx";var c=m.queue(a,b),d=c.length,e=c.shift(),f=m._queueHooks(a,b),g=function(){m.dequeue(a,b)};"inprogress"===e&&(e=c.shift(),d--),e&&("fx"===b&&c.unshift("inprogress"),delete f.stop,e.call(a,g,f)),!d&&f&&f.empty.fire()},_queueHooks:function(a,b){var c=b+"queueHooks";return m._data(a,c)||m._data(a,c,{empty:m.Callbacks("once memory").add(function(){m._removeData(a,b+"queue"),m._removeData(a,c)})})}}),m.fn.extend({queue:function(a,b){var c=2;return"string"!=typeof a&&(b=a,a="fx",c--),arguments.length<c?m.queue(this[0],a):void 0===b?this:this.each(function(){var c=m.queue(this,a,b);m._queueHooks(this,a),"fx"===a&&"inprogress"!==c[0]&&m.dequeue(this,a)})},dequeue:function(a){return this.each(function(){m.dequeue(this,a)})},clearQueue:function(a){return this.queue(a||"fx",[])},promise:function(a,b){var c,d=1,e=m.Deferred(),f=this,g=this.length,h=function(){--d||e.resolveWith(f,[f])};"string"!=typeof a&&(b=a,a=void 0),a=a||"fx";while(g--)c=m._data(f[g],a+"queueHooks"),c&&c.empty&&(d++,c.empty.add(h));return h(),e.promise(b)}});var S=/[+-]?(?:\d*\.|)\d+(?:[eE][+-]?\d+|)/.source,T=["Top","Right","Bottom","Left"],U=function(a,b){return a=b||a,"none"===m.css(a,"display")||!m.contains(a.ownerDocument,a)},V=m.access=function(a,b,c,d,e,f,g){var h=0,i=a.length,j=null==c;if("object"===m.type(c)){e=!0;for(h in c)m.access(a,b,h,c[h],!0,f,g)}else if(void 0!==d&&(e=!0,m.isFunction(d)||(g=!0),j&&(g?(b.call(a,d),b=null):(j=b,b=function(a,b,c){return j.call(m(a),c)})),b))for(;i>h;h++)b(a[h],c,g?d:d.call(a[h],h,b(a[h],c)));return e?a:j?b.call(a):i?b(a[0],c):f},W=/^(?:checkbox|radio)$/i;!function(){var a=y.createElement("input"),b=y.createElement("div"),c=y.createDocumentFragment();if(b.innerHTML=" <link/><table></table><a href='/a'>a</a><input type='checkbox'/>",k.leadingWhitespace=3===b.firstChild.nodeType,k.tbody=!b.getElementsByTagName("tbody").length,k.htmlSerialize=!!b.getElementsByTagName("link").length,k.html5Clone="<:nav></:nav>"!==y.createElement("nav").cloneNode(!0).outerHTML,a.type="checkbox",a.checked=!0,c.appendChild(a),k.appendChecked=a.checked,b.innerHTML="<textarea>x</textarea>",k.noCloneChecked=!!b.cloneNode(!0).lastChild.defaultValue,c.appendChild(b),b.innerHTML="<input type='radio' checked='checked' name='t'/>",k.checkClone=b.cloneNode(!0).cloneNode(!0).lastChild.checked,k.noCloneEvent=!0,b.attachEvent&&(b.attachEvent("onclick",function(){k.noCloneEvent=!1}),b.cloneNode(!0).click()),null==k.deleteExpando){k.deleteExpando=!0;try{delete b.test}catch(d){k.deleteExpando=!1}}}(),function(){var b,c,d=y.createElement("div");for(b in{submit:!0,change:!0,focusin:!0})c="on"+b,(k[b+"Bubbles"]=c in a)||(d.setAttribute(c,"t"),k[b+"Bubbles"]=d.attributes[c].expando===!1);d=null}();var X=/^(?:input|select|textarea)$/i,Y=/^key/,Z=/^(?:mouse|pointer|contextmenu)|click/,$=/^(?:focusinfocus|focusoutblur)$/,_=/^([^.]*)(?:\.(.+)|)$/;function aa(){return!0}function ba(){return!1}function ca(){try{return y.activeElement}catch(a){}}m.event={global:{},add:function(a,b,c,d,e){var f,g,h,i,j,k,l,n,o,p,q,r=m._data(a);if(r){c.handler&&(i=c,c=i.handler,e=i.selector),c.guid||(c.guid=m.guid++),(g=r.events)||(g=r.events={}),(k=r.handle)||(k=r.handle=function(a){return typeof m===K||a&&m.event.triggered===a.type?void 0:m.event.dispatch.apply(k.elem,arguments)},k.elem=a),b=(b||"").match(E)||[""],h=b.length;while(h--)f=_.exec(b[h])||[],o=q=f[1],p=(f[2]||"").split(".").sort(),o&&(j=m.event.special[o]||{},o=(e?j.delegateType:j.bindType)||o,j=m.event.special[o]||{},l=m.extend({type:o,origType:q,data:d,handler:c,guid:c.guid,selector:e,needsContext:e&&m.expr.match.needsContext.test(e),namespace:p.join(".")},i),(n=g[o])||(n=g[o]=[],n.delegateCount=0,j.setup&&j.setup.call(a,d,p,k)!==!1||(a.addEventListener?a.addEventListener(o,k,!1):a.attachEvent&&a.attachEvent("on"+o,k))),j.add&&(j.add.call(a,l),l.handler.guid||(l.handler.guid=c.guid)),e?n.splice(n.delegateCount++,0,l):n.push(l),m.event.global[o]=!0);a=null}},remove:function(a,b,c,d,e){var f,g,h,i,j,k,l,n,o,p,q,r=m.hasData(a)&&m._data(a);if(r&&(k=r.events)){b=(b||"").match(E)||[""],j=b.length;while(j--)if(h=_.exec(b[j])||[],o=q=h[1],p=(h[2]||"").split(".").sort(),o){l=m.event.special[o]||{},o=(d?l.delegateType:l.bindType)||o,n=k[o]||[],h=h[2]&&new RegExp("(^|\\.)"+p.join("\\.(?:.*\\.|)")+"(\\.|$)"),i=f=n.length;while(f--)g=n[f],!e&&q!==g.origType||c&&c.guid!==g.guid||h&&!h.test(g.namespace)||d&&d!==g.selector&&("**"!==d||!g.selector)||(n.splice(f,1),g.selector&&n.delegateCount--,l.remove&&l.remove.call(a,g));i&&!n.length&&(l.teardown&&l.teardown.call(a,p,r.handle)!==!1||m.removeEvent(a,o,r.handle),delete k[o])}else for(o in k)m.event.remove(a,o+b[j],c,d,!0);m.isEmptyObject(k)&&(delete r.handle,m._removeData(a,"events"))}},trigger:function(b,c,d,e){var f,g,h,i,k,l,n,o=[d||y],p=j.call(b,"type")?b.type:b,q=j.call(b,"namespace")?b.namespace.split("."):[];if(h=l=d=d||y,3!==d.nodeType&&8!==d.nodeType&&!$.test(p+m.event.triggered)&&(p.indexOf(".")>=0&&(q=p.split("."),p=q.shift(),q.sort()),g=p.indexOf(":")<0&&"on"+p,b=b[m.expando]?b:new m.Event(p,"object"==typeof b&&b),b.isTrigger=e?2:3,b.namespace=q.join("."),b.namespace_re=b.namespace?new RegExp("(^|\\.)"+q.join("\\.(?:.*\\.|)")+"(\\.|$)"):null,b.result=void 0,b.target||(b.target=d),c=null==c?[b]:m.makeArray(c,[b]),k=m.event.special[p]||{},e||!k.trigger||k.trigger.apply(d,c)!==!1)){if(!e&&!k.noBubble&&!m.isWindow(d)){for(i=k.delegateType||p,$.test(i+p)||(h=h.parentNode);h;h=h.parentNode)o.push(h),l=h;l===(d.ownerDocument||y)&&o.push(l.defaultView||l.parentWindow||a)}n=0;while((h=o[n++])&&!b.isPropagationStopped())b.type=n>1?i:k.bindType||p,f=(m._data(h,"events")||{})[b.type]&&m._data(h,"handle"),f&&f.apply(h,c),f=g&&h[g],f&&f.apply&&m.acceptData(h)&&(b.result=f.apply(h,c),b.result===!1&&b.preventDefault());if(b.type=p,!e&&!b.isDefaultPrevented()&&(!k._default||k._default.apply(o.pop(),c)===!1)&&m.acceptData(d)&&g&&d[p]&&!m.isWindow(d)){l=d[g],l&&(d[g]=null),m.event.triggered=p;try{d[p]()}catch(r){}m.event.triggered=void 0,l&&(d[g]=l)}return b.result}},dispatch:function(a){a=m.event.fix(a);var b,c,e,f,g,h=[],i=d.call(arguments),j=(m._data(this,"events")||{})[a.type]||[],k=m.event.special[a.type]||{};if(i[0]=a,a.delegateTarget=this,!k.preDispatch||k.preDispatch.call(this,a)!==!1){h=m.event.handlers.call(this,a,j),b=0;while((f=h[b++])&&!a.isPropagationStopped()){a.currentTarget=f.elem,g=0;while((e=f.handlers[g++])&&!a.isImmediatePropagationStopped())(!a.namespace_re||a.namespace_re.test(e.namespace))&&(a.handleObj=e,a.data=e.data,c=((m.event.special[e.origType]||{}).handle||e.handler).apply(f.elem,i),void 0!==c&&(a.result=c)===!1&&(a.preventDefault(),a.stopPropagation()))}return k.postDispatch&&k.postDispatch.call(this,a),a.result}},handlers:function(a,b){var c,d,e,f,g=[],h=b.delegateCount,i=a.target;if(h&&i.nodeType&&(!a.button||"click"!==a.type))for(;i!=this;i=i.parentNode||this)if(1===i.nodeType&&(i.disabled!==!0||"click"!==a.type)){for(e=[],f=0;h>f;f++)d=b[f],c=d.selector+" ",void 0===e[c]&&(e[c]=d.needsContext?m(c,this).index(i)>=0:m.find(c,this,null,[i]).length),e[c]&&e.push(d);e.length&&g.push({elem:i,handlers:e})}return h<b.length&&g.push({elem:this,handlers:b.slice(h)}),g},fix:function(a){if(a[m.expando])return a;var b,c,d,e=a.type,f=a,g=this.fixHooks[e];g||(this.fixHooks[e]=g=Z.test(e)?this.mouseHooks:Y.test(e)?this.keyHooks:{}),d=g.props?this.props.concat(g.props):this.props,a=new m.Event(f),b=d.length;while(b--)c=d[b],a[c]=f[c];return a.target||(a.target=f.srcElement||y),3===a.target.nodeType&&(a.target=a.target.parentNode),a.metaKey=!!a.metaKey,g.filter?g.filter(a,f):a},props:"altKey bubbles cancelable ctrlKey currentTarget eventPhase metaKey relatedTarget shiftKey target timeStamp view which".split(" "),fixHooks:{},keyHooks:{props:"char charCode key keyCode".split(" "),filter:function(a,b){return null==a.which&&(a.which=null!=b.charCode?b.charCode:b.keyCode),a}},mouseHooks:{props:"button buttons clientX clientY fromElement offsetX offsetY pageX pageY screenX screenY toElement".split(" "),filter:function(a,b){var c,d,e,f=b.button,g=b.fromElement;return null==a.pageX&&null!=b.clientX&&(d=a.target.ownerDocument||y,e=d.documentElement,c=d.body,a.pageX=b.clientX+(e&&e.scrollLeft||c&&c.scrollLeft||0)-(e&&e.clientLeft||c&&c.clientLeft||0),a.pageY=b.clientY+(e&&e.scrollTop||c&&c.scrollTop||0)-(e&&e.clientTop||c&&c.clientTop||0)),!a.relatedTarget&&g&&(a.relatedTarget=g===a.target?b.toElement:g),a.which||void 0===f||(a.which=1&f?1:2&f?3:4&f?2:0),a}},special:{load:{noBubble:!0},focus:{trigger:function(){if(this!==ca()&&this.focus)try{return this.focus(),!1}catch(a){}},delegateType:"focusin"},blur:{trigger:function(){return this===ca()&&this.blur?(this.blur(),!1):void 0},delegateType:"focusout"},click:{trigger:function(){return m.nodeName(this,"input")&&"checkbox"===this.type&&this.click?(this.click(),!1):void 0},_default:function(a){return m.nodeName(a.target,"a")}},beforeunload:{postDispatch:function(a){void 0!==a.result&&a.originalEvent&&(a.originalEvent.returnValue=a.result)}}},simulate:function(a,b,c,d){var e=m.extend(new m.Event,c,{type:a,isSimulated:!0,originalEvent:{}});d?m.event.trigger(e,null,b):m.event.dispatch.call(b,e),e.isDefaultPrevented()&&c.preventDefault()}},m.removeEvent=y.removeEventListener?function(a,b,c){a.removeEventListener&&a.removeEventListener(b,c,!1)}:function(a,b,c){var d="on"+b;a.detachEvent&&(typeof a[d]===K&&(a[d]=null),a.detachEvent(d,c))},m.Event=function(a,b){return this instanceof m.Event?(a&&a.type?(this.originalEvent=a,this.type=a.type,this.isDefaultPrevented=a.defaultPrevented||void 0===a.defaultPrevented&&a.returnValue===!1?aa:ba):this.type=a,b&&m.extend(this,b),this.timeStamp=a&&a.timeStamp||m.now(),void(this[m.expando]=!0)):new m.Event(a,b)},m.Event.prototype={isDefaultPrevented:ba,isPropagationStopped:ba,isImmediatePropagationStopped:ba,preventDefault:function(){var a=this.originalEvent;this.isDefaultPrevented=aa,a&&(a.preventDefault?a.preventDefault():a.returnValue=!1)},stopPropagation:function(){var a=this.originalEvent;this.isPropagationStopped=aa,a&&(a.stopPropagation&&a.stopPropagation(),a.cancelBubble=!0)},stopImmediatePropagation:function(){var a=this.originalEvent;this.isImmediatePropagationStopped=aa,a&&a.stopImmediatePropagation&&a.stopImmediatePropagation(),this.stopPropagation()}},m.each({mouseenter:"mouseover",mouseleave:"mouseout",pointerenter:"pointerover",pointerleave:"pointerout"},function(a,b){m.event.special[a]={delegateType:b,bindType:b,handle:function(a){var c,d=this,e=a.relatedTarget,f=a.handleObj;return(!e||e!==d&&!m.contains(d,e))&&(a.type=f.origType,c=f.handler.apply(this,arguments),a.type=b),c}}}),k.submitBubbles||(m.event.special.submit={setup:function(){return m.nodeName(this,"form")?!1:void m.event.add(this,"click._submit keypress._submit",function(a){var b=a.target,c=m.nodeName(b,"input")||m.nodeName(b,"button")?b.form:void 0;c&&!m._data(c,"submitBubbles")&&(m.event.add(c,"submit._submit",function(a){a._submit_bubble=!0}),m._data(c,"submitBubbles",!0))})},postDispatch:function(a){a._submit_bubble&&(delete a._submit_bubble,this.parentNode&&!a.isTrigger&&m.event.simulate("submit",this.parentNode,a,!0))},teardown:function(){return m.nodeName(this,"form")?!1:void m.event.remove(this,"._submit")}}),k.changeBubbles||(m.event.special.change={setup:function(){return X.test(this.nodeName)?(("checkbox"===this.type||"radio"===this.type)&&(m.event.add(this,"propertychange._change",function(a){"checked"===a.originalEvent.propertyName&&(this._just_changed=!0)}),m.event.add(this,"click._change",function(a){this._just_changed&&!a.isTrigger&&(this._just_changed=!1),m.event.simulate("change",this,a,!0)})),!1):void m.event.add(this,"beforeactivate._change",function(a){var b=a.target;X.test(b.nodeName)&&!m._data(b,"changeBubbles")&&(m.event.add(b,"change._change",function(a){!this.parentNode||a.isSimulated||a.isTrigger||m.event.simulate("change",this.parentNode,a,!0)}),m._data(b,"changeBubbles",!0))})},handle:function(a){var b=a.target;return this!==b||a.isSimulated||a.isTrigger||"radio"!==b.type&&"checkbox"!==b.type?a.handleObj.handler.apply(this,arguments):void 0},teardown:function(){return m.event.remove(this,"._change"),!X.test(this.nodeName)}}),k.focusinBubbles||m.each({focus:"focusin",blur:"focusout"},function(a,b){var c=function(a){m.event.simulate(b,a.target,m.event.fix(a),!0)};m.event.special[b]={setup:function(){var d=this.ownerDocument||this,e=m._data(d,b);e||d.addEventListener(a,c,!0),m._data(d,b,(e||0)+1)},teardown:function(){var d=this.ownerDocument||this,e=m._data(d,b)-1;e?m._data(d,b,e):(d.removeEventListener(a,c,!0),m._removeData(d,b))}}}),m.fn.extend({on:function(a,b,c,d,e){var f,g;if("object"==typeof a){"string"!=typeof b&&(c=c||b,b=void 0);for(f in a)this.on(f,b,c,a[f],e);return this}if(null==c&&null==d?(d=b,c=b=void 0):null==d&&("string"==typeof b?(d=c,c=void 0):(d=c,c=b,b=void 0)),d===!1)d=ba;else if(!d)return this;return 1===e&&(g=d,d=function(a){return m().off(a),g.apply(this,arguments)},d.guid=g.guid||(g.guid=m.guid++)),this.each(function(){m.event.add(this,a,d,c,b)})},one:function(a,b,c,d){return this.on(a,b,c,d,1)},off:function(a,b,c){var d,e;if(a&&a.preventDefault&&a.handleObj)return d=a.handleObj,m(a.delegateTarget).off(d.namespace?d.origType+"."+d.namespace:d.origType,d.selector,d.handler),this;if("object"==typeof a){for(e in a)this.off(e,b,a[e]);return this}return(b===!1||"function"==typeof b)&&(c=b,b=void 0),c===!1&&(c=ba),this.each(function(){m.event.remove(this,a,c,b)})},trigger:function(a,b){return this.each(function(){m.event.trigger(a,b,this)})},triggerHandler:function(a,b){var c=this[0];return c?m.event.trigger(a,b,c,!0):void 0}});function da(a){var b=ea.split("|"),c=a.createDocumentFragment();if(c.createElement)while(b.length)c.createElement(b.pop());return c}var ea="abbr|article|aside|audio|bdi|canvas|data|datalist|details|figcaption|figure|footer|header|hgroup|mark|meter|nav|output|progress|section|summary|time|video",fa=/ jQuery\d+="(?:null|\d+)"/g,ga=new RegExp("<(?:"+ea+")[\\s/>]","i"),ha=/^\s+/,ia=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/gi,ja=/<([\w:]+)/,ka=/<tbody/i,la=/<|&#?\w+;/,ma=/<(?:script|style|link)/i,na=/checked\s*(?:[^=]|=\s*.checked.)/i,oa=/^$|\/(?:java|ecma)script/i,pa=/^true\/(.*)/,qa=/^\s*<!(?:\[CDATA\[|--)|(?:\]\]|--)>\s*$/g,ra={option:[1,"<select multiple='multiple'>","</select>"],legend:[1,"<fieldset>","</fieldset>"],area:[1,"<map>","</map>"],param:[1,"<object>","</object>"],thead:[1,"<table>","</table>"],tr:[2,"<table><tbody>","</tbody></table>"],col:[2,"<table><tbody></tbody><colgroup>","</colgroup></table>"],td:[3,"<table><tbody><tr>","</tr></tbody></table>"],_default:k.htmlSerialize?[0,"",""]:[1,"X<div>","</div>"]},sa=da(y),ta=sa.appendChild(y.createElement("div"));ra.optgroup=ra.option,ra.tbody=ra.tfoot=ra.colgroup=ra.caption=ra.thead,ra.th=ra.td;function ua(a,b){var c,d,e=0,f=typeof a.getElementsByTagName!==K?a.getElementsByTagName(b||"*"):typeof a.querySelectorAll!==K?a.querySelectorAll(b||"*"):void 0;if(!f)for(f=[],c=a.childNodes||a;null!=(d=c[e]);e++)!b||m.nodeName(d,b)?f.push(d):m.merge(f,ua(d,b));return void 0===b||b&&m.nodeName(a,b)?m.merge([a],f):f}function va(a){W.test(a.type)&&(a.defaultChecked=a.checked)}function wa(a,b){return m.nodeName(a,"table")&&m.nodeName(11!==b.nodeType?b:b.firstChild,"tr")?a.getElementsByTagName("tbody")[0]||a.appendChild(a.ownerDocument.createElement("tbody")):a}function xa(a){return a.type=(null!==m.find.attr(a,"type"))+"/"+a.type,a}function ya(a){var b=pa.exec(a.type);return b?a.type=b[1]:a.removeAttribute("type"),a}function za(a,b){for(var c,d=0;null!=(c=a[d]);d++)m._data(c,"globalEval",!b||m._data(b[d],"globalEval"))}function Aa(a,b){if(1===b.nodeType&&m.hasData(a)){var c,d,e,f=m._data(a),g=m._data(b,f),h=f.events;if(h){delete g.handle,g.events={};for(c in h)for(d=0,e=h[c].length;e>d;d++)m.event.add(b,c,h[c][d])}g.data&&(g.data=m.extend({},g.data))}}function Ba(a,b){var c,d,e;if(1===b.nodeType){if(c=b.nodeName.toLowerCase(),!k.noCloneEvent&&b[m.expando]){e=m._data(b);for(d in e.events)m.removeEvent(b,d,e.handle);b.removeAttribute(m.expando)}"script"===c&&b.text!==a.text?(xa(b).text=a.text,ya(b)):"object"===c?(b.parentNode&&(b.outerHTML=a.outerHTML),k.html5Clone&&a.innerHTML&&!m.trim(b.innerHTML)&&(b.innerHTML=a.innerHTML)):"input"===c&&W.test(a.type)?(b.defaultChecked=b.checked=a.checked,b.value!==a.value&&(b.value=a.value)):"option"===c?b.defaultSelected=b.selected=a.defaultSelected:("input"===c||"textarea"===c)&&(b.defaultValue=a.defaultValue)}}m.extend({clone:function(a,b,c){var d,e,f,g,h,i=m.contains(a.ownerDocument,a);if(k.html5Clone||m.isXMLDoc(a)||!ga.test("<"+a.nodeName+">")?f=a.cloneNode(!0):(ta.innerHTML=a.outerHTML,ta.removeChild(f=ta.firstChild)),!(k.noCloneEvent&&k.noCloneChecked||1!==a.nodeType&&11!==a.nodeType||m.isXMLDoc(a)))for(d=ua(f),h=ua(a),g=0;null!=(e=h[g]);++g)d[g]&&Ba(e,d[g]);if(b)if(c)for(h=h||ua(a),d=d||ua(f),g=0;null!=(e=h[g]);g++)Aa(e,d[g]);else Aa(a,f);return d=ua(f,"script"),d.length>0&&za(d,!i&&ua(a,"script")),d=h=e=null,f},buildFragment:function(a,b,c,d){for(var e,f,g,h,i,j,l,n=a.length,o=da(b),p=[],q=0;n>q;q++)if(f=a[q],f||0===f)if("object"===m.type(f))m.merge(p,f.nodeType?[f]:f);else if(la.test(f)){h=h||o.appendChild(b.createElement("div")),i=(ja.exec(f)||["",""])[1].toLowerCase(),l=ra[i]||ra._default,h.innerHTML=l[1]+f.replace(ia,"<$1></$2>")+l[2],e=l[0];while(e--)h=h.lastChild;if(!k.leadingWhitespace&&ha.test(f)&&p.push(b.createTextNode(ha.exec(f)[0])),!k.tbody){f="table"!==i||ka.test(f)?"<table>"!==l[1]||ka.test(f)?0:h:h.firstChild,e=f&&f.childNodes.length;while(e--)m.nodeName(j=f.childNodes[e],"tbody")&&!j.childNodes.length&&f.removeChild(j)}m.merge(p,h.childNodes),h.textContent="";while(h.firstChild)h.removeChild(h.firstChild);h=o.lastChild}else p.push(b.createTextNode(f));h&&o.removeChild(h),k.appendChecked||m.grep(ua(p,"input"),va),q=0;while(f=p[q++])if((!d||-1===m.inArray(f,d))&&(g=m.contains(f.ownerDocument,f),h=ua(o.appendChild(f),"script"),g&&za(h),c)){e=0;while(f=h[e++])oa.test(f.type||"")&&c.push(f)}return h=null,o},cleanData:function(a,b){for(var d,e,f,g,h=0,i=m.expando,j=m.cache,l=k.deleteExpando,n=m.event.special;null!=(d=a[h]);h++)if((b||m.acceptData(d))&&(f=d[i],g=f&&j[f])){if(g.events)for(e in g.events)n[e]?m.event.remove(d,e):m.removeEvent(d,e,g.handle);j[f]&&(delete j[f],l?delete d[i]:typeof d.removeAttribute!==K?d.removeAttribute(i):d[i]=null,c.push(f))}}}),m.fn.extend({text:function(a){return V(this,function(a){return void 0===a?m.text(this):this.empty().append((this[0]&&this[0].ownerDocument||y).createTextNode(a))},null,a,arguments.length)},append:function(){return this.domManip(arguments,function(a){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var b=wa(this,a);b.appendChild(a)}})},prepend:function(){return this.domManip(arguments,function(a){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var b=wa(this,a);b.insertBefore(a,b.firstChild)}})},before:function(){return this.domManip(arguments,function(a){this.parentNode&&this.parentNode.insertBefore(a,this)})},after:function(){return this.domManip(arguments,function(a){this.parentNode&&this.parentNode.insertBefore(a,this.nextSibling)})},remove:function(a,b){for(var c,d=a?m.filter(a,this):this,e=0;null!=(c=d[e]);e++)b||1!==c.nodeType||m.cleanData(ua(c)),c.parentNode&&(b&&m.contains(c.ownerDocument,c)&&za(ua(c,"script")),c.parentNode.removeChild(c));return this},empty:function(){for(var a,b=0;null!=(a=this[b]);b++){1===a.nodeType&&m.cleanData(ua(a,!1));while(a.firstChild)a.removeChild(a.firstChild);a.options&&m.nodeName(a,"select")&&(a.options.length=0)}return this},clone:function(a,b){return a=null==a?!1:a,b=null==b?a:b,this.map(function(){return m.clone(this,a,b)})},html:function(a){return V(this,function(a){var b=this[0]||{},c=0,d=this.length;if(void 0===a)return 1===b.nodeType?b.innerHTML.replace(fa,""):void 0;if(!("string"!=typeof a||ma.test(a)||!k.htmlSerialize&&ga.test(a)||!k.leadingWhitespace&&ha.test(a)||ra[(ja.exec(a)||["",""])[1].toLowerCase()])){a=a.replace(ia,"<$1></$2>");try{for(;d>c;c++)b=this[c]||{},1===b.nodeType&&(m.cleanData(ua(b,!1)),b.innerHTML=a);b=0}catch(e){}}b&&this.empty().append(a)},null,a,arguments.length)},replaceWith:function(){var a=arguments[0];return this.domManip(arguments,function(b){a=this.parentNode,m.cleanData(ua(this)),a&&a.replaceChild(b,this)}),a&&(a.length||a.nodeType)?this:this.remove()},detach:function(a){return this.remove(a,!0)},domManip:function(a,b){a=e.apply([],a);var c,d,f,g,h,i,j=0,l=this.length,n=this,o=l-1,p=a[0],q=m.isFunction(p);if(q||l>1&&"string"==typeof p&&!k.checkClone&&na.test(p))return this.each(function(c){var d=n.eq(c);q&&(a[0]=p.call(this,c,d.html())),d.domManip(a,b)});if(l&&(i=m.buildFragment(a,this[0].ownerDocument,!1,this),c=i.firstChild,1===i.childNodes.length&&(i=c),c)){for(g=m.map(ua(i,"script"),xa),f=g.length;l>j;j++)d=i,j!==o&&(d=m.clone(d,!0,!0),f&&m.merge(g,ua(d,"script"))),b.call(this[j],d,j);if(f)for(h=g[g.length-1].ownerDocument,m.map(g,ya),j=0;f>j;j++)d=g[j],oa.test(d.type||"")&&!m._data(d,"globalEval")&&m.contains(h,d)&&(d.src?m._evalUrl&&m._evalUrl(d.src):m.globalEval((d.text||d.textContent||d.innerHTML||"").replace(qa,"")));i=c=null}return this}}),m.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(a,b){m.fn[a]=function(a){for(var c,d=0,e=[],g=m(a),h=g.length-1;h>=d;d++)c=d===h?this:this.clone(!0),m(g[d])[b](c),f.apply(e,c.get());return this.pushStack(e)}});var Ca,Da={};function Ea(b,c){var d,e=m(c.createElement(b)).appendTo(c.body),f=a.getDefaultComputedStyle&&(d=a.getDefaultComputedStyle(e[0]))?d.display:m.css(e[0],"display");return e.detach(),f}function Fa(a){var b=y,c=Da[a];return c||(c=Ea(a,b),"none"!==c&&c||(Ca=(Ca||m("<iframe frameborder='0' width='0' height='0'/>")).appendTo(b.documentElement),b=(Ca[0].contentWindow||Ca[0].contentDocument).document,b.write(),b.close(),c=Ea(a,b),Ca.detach()),Da[a]=c),c}!function(){var a;k.shrinkWrapBlocks=function(){if(null!=a)return a;a=!1;var b,c,d;return c=y.getElementsByTagName("body")[0],c&&c.style?(b=y.createElement("div"),d=y.createElement("div"),d.style.cssText="position:absolute;border:0;width:0;height:0;top:0;left:-9999px",c.appendChild(d).appendChild(b),typeof b.style.zoom!==K&&(b.style.cssText="-webkit-box-sizing:content-box;-moz-box-sizing:content-box;box-sizing:content-box;display:block;margin:0;border:0;padding:1px;width:1px;zoom:1",b.appendChild(y.createElement("div")).style.width="5px",a=3!==b.offsetWidth),c.removeChild(d),a):void 0}}();var Ga=/^margin/,Ha=new RegExp("^("+S+")(?!px)[a-z%]+$","i"),Ia,Ja,Ka=/^(top|right|bottom|left)$/;a.getComputedStyle?(Ia=function(b){return b.ownerDocument.defaultView.opener?b.ownerDocument.defaultView.getComputedStyle(b,null):a.getComputedStyle(b,null)},Ja=function(a,b,c){var d,e,f,g,h=a.style;return c=c||Ia(a),g=c?c.getPropertyValue(b)||c[b]:void 0,c&&(""!==g||m.contains(a.ownerDocument,a)||(g=m.style(a,b)),Ha.test(g)&&Ga.test(b)&&(d=h.width,e=h.minWidth,f=h.maxWidth,h.minWidth=h.maxWidth=h.width=g,g=c.width,h.width=d,h.minWidth=e,h.maxWidth=f)),void 0===g?g:g+""}):y.documentElement.currentStyle&&(Ia=function(a){return a.currentStyle},Ja=function(a,b,c){var d,e,f,g,h=a.style;return c=c||Ia(a),g=c?c[b]:void 0,null==g&&h&&h[b]&&(g=h[b]),Ha.test(g)&&!Ka.test(b)&&(d=h.left,e=a.runtimeStyle,f=e&&e.left,f&&(e.left=a.currentStyle.left),h.left="fontSize"===b?"1em":g,g=h.pixelLeft+"px",h.left=d,f&&(e.left=f)),void 0===g?g:g+""||"auto"});function La(a,b){return{get:function(){var c=a();if(null!=c)return c?void delete this.get:(this.get=b).apply(this,arguments)}}}!function(){var b,c,d,e,f,g,h;if(b=y.createElement("div"),b.innerHTML=" <link/><table></table><a href='/a'>a</a><input type='checkbox'/>",d=b.getElementsByTagName("a")[0],c=d&&d.style){c.cssText="float:left;opacity:.5",k.opacity="0.5"===c.opacity,k.cssFloat=!!c.cssFloat,b.style.backgroundClip="content-box",b.cloneNode(!0).style.backgroundClip="",k.clearCloneStyle="content-box"===b.style.backgroundClip,k.boxSizing=""===c.boxSizing||""===c.MozBoxSizing||""===c.WebkitBoxSizing,m.extend(k,{reliableHiddenOffsets:function(){return null==g&&i(),g},boxSizingReliable:function(){return null==f&&i(),f},pixelPosition:function(){return null==e&&i(),e},reliableMarginRight:function(){return null==h&&i(),h}});function i(){var b,c,d,i;c=y.getElementsByTagName("body")[0],c&&c.style&&(b=y.createElement("div"),d=y.createElement("div"),d.style.cssText="position:absolute;border:0;width:0;height:0;top:0;left:-9999px",c.appendChild(d).appendChild(b),b.style.cssText="-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;display:block;margin-top:1%;top:1%;border:1px;padding:1px;width:4px;position:absolute",e=f=!1,h=!0,a.getComputedStyle&&(e="1%"!==(a.getComputedStyle(b,null)||{}).top,f="4px"===(a.getComputedStyle(b,null)||{width:"4px"}).width,i=b.appendChild(y.createElement("div")),i.style.cssText=b.style.cssText="-webkit-box-sizing:content-box;-moz-box-sizing:content-box;box-sizing:content-box;display:block;margin:0;border:0;padding:0",i.style.marginRight=i.style.width="0",b.style.width="1px",h=!parseFloat((a.getComputedStyle(i,null)||{}).marginRight),b.removeChild(i)),b.innerHTML="<table><tr><td></td><td>t</td></tr></table>",i=b.getElementsByTagName("td"),i[0].style.cssText="margin:0;border:0;padding:0;display:none",g=0===i[0].offsetHeight,g&&(i[0].style.display="",i[1].style.display="none",g=0===i[0].offsetHeight),c.removeChild(d))}}}(),m.swap=function(a,b,c,d){var e,f,g={};for(f in b)g[f]=a.style[f],a.style[f]=b[f];e=c.apply(a,d||[]);for(f in b)a.style[f]=g[f];return e};var Ma=/alpha\([^)]*\)/i,Na=/opacity\s*=\s*([^)]*)/,Oa=/^(none|table(?!-c[ea]).+)/,Pa=new RegExp("^("+S+")(.*)$","i"),Qa=new RegExp("^([+-])=("+S+")","i"),Ra={position:"absolute",visibility:"hidden",display:"block"},Sa={letterSpacing:"0",fontWeight:"400"},Ta=["Webkit","O","Moz","ms"];function Ua(a,b){if(b in a)return b;var c=b.charAt(0).toUpperCase()+b.slice(1),d=b,e=Ta.length;while(e--)if(b=Ta[e]+c,b in a)return b;return d}function Va(a,b){for(var c,d,e,f=[],g=0,h=a.length;h>g;g++)d=a[g],d.style&&(f[g]=m._data(d,"olddisplay"),c=d.style.display,b?(f[g]||"none"!==c||(d.style.display=""),""===d.style.display&&U(d)&&(f[g]=m._data(d,"olddisplay",Fa(d.nodeName)))):(e=U(d),(c&&"none"!==c||!e)&&m._data(d,"olddisplay",e?c:m.css(d,"display"))));for(g=0;h>g;g++)d=a[g],d.style&&(b&&"none"!==d.style.display&&""!==d.style.display||(d.style.display=b?f[g]||"":"none"));return a}function Wa(a,b,c){var d=Pa.exec(b);return d?Math.max(0,d[1]-(c||0))+(d[2]||"px"):b}function Xa(a,b,c,d,e){for(var f=c===(d?"border":"content")?4:"width"===b?1:0,g=0;4>f;f+=2)"margin"===c&&(g+=m.css(a,c+T[f],!0,e)),d?("content"===c&&(g-=m.css(a,"padding"+T[f],!0,e)),"margin"!==c&&(g-=m.css(a,"border"+T[f]+"Width",!0,e))):(g+=m.css(a,"padding"+T[f],!0,e),"padding"!==c&&(g+=m.css(a,"border"+T[f]+"Width",!0,e)));return g}function Ya(a,b,c){var d=!0,e="width"===b?a.offsetWidth:a.offsetHeight,f=Ia(a),g=k.boxSizing&&"border-box"===m.css(a,"boxSizing",!1,f);if(0>=e||null==e){if(e=Ja(a,b,f),(0>e||null==e)&&(e=a.style[b]),Ha.test(e))return e;d=g&&(k.boxSizingReliable()||e===a.style[b]),e=parseFloat(e)||0}return e+Xa(a,b,c||(g?"border":"content"),d,f)+"px"}m.extend({cssHooks:{opacity:{get:function(a,b){if(b){var c=Ja(a,"opacity");return""===c?"1":c}}}},cssNumber:{columnCount:!0,fillOpacity:!0,flexGrow:!0,flexShrink:!0,fontWeight:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,widows:!0,zIndex:!0,zoom:!0},cssProps:{"float":k.cssFloat?"cssFloat":"styleFloat"},style:function(a,b,c,d){if(a&&3!==a.nodeType&&8!==a.nodeType&&a.style){var e,f,g,h=m.camelCase(b),i=a.style;if(b=m.cssProps[h]||(m.cssProps[h]=Ua(i,h)),g=m.cssHooks[b]||m.cssHooks[h],void 0===c)return g&&"get"in g&&void 0!==(e=g.get(a,!1,d))?e:i[b];if(f=typeof c,"string"===f&&(e=Qa.exec(c))&&(c=(e[1]+1)*e[2]+parseFloat(m.css(a,b)),f="number"),null!=c&&c===c&&("number"!==f||m.cssNumber[h]||(c+="px"),k.clearCloneStyle||""!==c||0!==b.indexOf("background")||(i[b]="inherit"),!(g&&"set"in g&&void 0===(c=g.set(a,c,d)))))try{i[b]=c}catch(j){}}},css:function(a,b,c,d){var e,f,g,h=m.camelCase(b);return b=m.cssProps[h]||(m.cssProps[h]=Ua(a.style,h)),g=m.cssHooks[b]||m.cssHooks[h],g&&"get"in g&&(f=g.get(a,!0,c)),void 0===f&&(f=Ja(a,b,d)),"normal"===f&&b in Sa&&(f=Sa[b]),""===c||c?(e=parseFloat(f),c===!0||m.isNumeric(e)?e||0:f):f}}),m.each(["height","width"],function(a,b){m.cssHooks[b]={get:function(a,c,d){return c?Oa.test(m.css(a,"display"))&&0===a.offsetWidth?m.swap(a,Ra,function(){return Ya(a,b,d)}):Ya(a,b,d):void 0},set:function(a,c,d){var e=d&&Ia(a);return Wa(a,c,d?Xa(a,b,d,k.boxSizing&&"border-box"===m.css(a,"boxSizing",!1,e),e):0)}}}),k.opacity||(m.cssHooks.opacity={get:function(a,b){return Na.test((b&&a.currentStyle?a.currentStyle.filter:a.style.filter)||"")?.01*parseFloat(RegExp.$1)+"":b?"1":""},set:function(a,b){var c=a.style,d=a.currentStyle,e=m.isNumeric(b)?"alpha(opacity="+100*b+")":"",f=d&&d.filter||c.filter||"";c.zoom=1,(b>=1||""===b)&&""===m.trim(f.replace(Ma,""))&&c.removeAttribute&&(c.removeAttribute("filter"),""===b||d&&!d.filter)||(c.filter=Ma.test(f)?f.replace(Ma,e):f+" "+e)}}),m.cssHooks.marginRight=La(k.reliableMarginRight,function(a,b){return b?m.swap(a,{display:"inline-block"},Ja,[a,"marginRight"]):void 0}),m.each({margin:"",padding:"",border:"Width"},function(a,b){m.cssHooks[a+b]={expand:function(c){for(var d=0,e={},f="string"==typeof c?c.split(" "):[c];4>d;d++)e[a+T[d]+b]=f[d]||f[d-2]||f[0];return e}},Ga.test(a)||(m.cssHooks[a+b].set=Wa)}),m.fn.extend({css:function(a,b){return V(this,function(a,b,c){var d,e,f={},g=0;if(m.isArray(b)){for(d=Ia(a),e=b.length;e>g;g++)f[b[g]]=m.css(a,b[g],!1,d);return f}return void 0!==c?m.style(a,b,c):m.css(a,b)},a,b,arguments.length>1)},show:function(){return Va(this,!0)},hide:function(){return Va(this)},toggle:function(a){return"boolean"==typeof a?a?this.show():this.hide():this.each(function(){U(this)?m(this).show():m(this).hide()})}});function Za(a,b,c,d,e){ return new Za.prototype.init(a,b,c,d,e)}m.Tween=Za,Za.prototype={constructor:Za,init:function(a,b,c,d,e,f){this.elem=a,this.prop=c,this.easing=e||"swing",this.options=b,this.start=this.now=this.cur(),this.end=d,this.unit=f||(m.cssNumber[c]?"":"px")},cur:function(){var a=Za.propHooks[this.prop];return a&&a.get?a.get(this):Za.propHooks._default.get(this)},run:function(a){var b,c=Za.propHooks[this.prop];return this.options.duration?this.pos=b=m.easing[this.easing](a,this.options.duration*a,0,1,this.options.duration):this.pos=b=a,this.now=(this.end-this.start)*b+this.start,this.options.step&&this.options.step.call(this.elem,this.now,this),c&&c.set?c.set(this):Za.propHooks._default.set(this),this}},Za.prototype.init.prototype=Za.prototype,Za.propHooks={_default:{get:function(a){var b;return null==a.elem[a.prop]||a.elem.style&&null!=a.elem.style[a.prop]?(b=m.css(a.elem,a.prop,""),b&&"auto"!==b?b:0):a.elem[a.prop]},set:function(a){m.fx.step[a.prop]?m.fx.step[a.prop](a):a.elem.style&&(null!=a.elem.style[m.cssProps[a.prop]]||m.cssHooks[a.prop])?m.style(a.elem,a.prop,a.now+a.unit):a.elem[a.prop]=a.now}}},Za.propHooks.scrollTop=Za.propHooks.scrollLeft={set:function(a){a.elem.nodeType&&a.elem.parentNode&&(a.elem[a.prop]=a.now)}},m.easing={linear:function(a){return a},swing:function(a){return.5-Math.cos(a*Math.PI)/2}},m.fx=Za.prototype.init,m.fx.step={};var $a,_a,ab=/^(?:toggle|show|hide)$/,bb=new RegExp("^(?:([+-])=|)("+S+")([a-z%]*)$","i"),cb=/queueHooks$/,db=[ib],eb={"*":[function(a,b){var c=this.createTween(a,b),d=c.cur(),e=bb.exec(b),f=e&&e[3]||(m.cssNumber[a]?"":"px"),g=(m.cssNumber[a]||"px"!==f&&+d)&&bb.exec(m.css(c.elem,a)),h=1,i=20;if(g&&g[3]!==f){f=f||g[3],e=e||[],g=+d||1;do h=h||".5",g/=h,m.style(c.elem,a,g+f);while(h!==(h=c.cur()/d)&&1!==h&&--i)}return e&&(g=c.start=+g||+d||0,c.unit=f,c.end=e[1]?g+(e[1]+1)*e[2]:+e[2]),c}]};function fb(){return setTimeout(function(){$a=void 0}),$a=m.now()}function gb(a,b){var c,d={height:a},e=0;for(b=b?1:0;4>e;e+=2-b)c=T[e],d["margin"+c]=d["padding"+c]=a;return b&&(d.opacity=d.width=a),d}function hb(a,b,c){for(var d,e=(eb[b]||[]).concat(eb["*"]),f=0,g=e.length;g>f;f++)if(d=e[f].call(c,b,a))return d}function ib(a,b,c){var d,e,f,g,h,i,j,l,n=this,o={},p=a.style,q=a.nodeType&&U(a),r=m._data(a,"fxshow");c.queue||(h=m._queueHooks(a,"fx"),null==h.unqueued&&(h.unqueued=0,i=h.empty.fire,h.empty.fire=function(){h.unqueued||i()}),h.unqueued++,n.always(function(){n.always(function(){h.unqueued--,m.queue(a,"fx").length||h.empty.fire()})})),1===a.nodeType&&("height"in b||"width"in b)&&(c.overflow=[p.overflow,p.overflowX,p.overflowY],j=m.css(a,"display"),l="none"===j?m._data(a,"olddisplay")||Fa(a.nodeName):j,"inline"===l&&"none"===m.css(a,"float")&&(k.inlineBlockNeedsLayout&&"inline"!==Fa(a.nodeName)?p.zoom=1:p.display="inline-block")),c.overflow&&(p.overflow="hidden",k.shrinkWrapBlocks()||n.always(function(){p.overflow=c.overflow[0],p.overflowX=c.overflow[1],p.overflowY=c.overflow[2]}));for(d in b)if(e=b[d],ab.exec(e)){if(delete b[d],f=f||"toggle"===e,e===(q?"hide":"show")){if("show"!==e||!r||void 0===r[d])continue;q=!0}o[d]=r&&r[d]||m.style(a,d)}else j=void 0;if(m.isEmptyObject(o))"inline"===("none"===j?Fa(a.nodeName):j)&&(p.display=j);else{r?"hidden"in r&&(q=r.hidden):r=m._data(a,"fxshow",{}),f&&(r.hidden=!q),q?m(a).show():n.done(function(){m(a).hide()}),n.done(function(){var b;m._removeData(a,"fxshow");for(b in o)m.style(a,b,o[b])});for(d in o)g=hb(q?r[d]:0,d,n),d in r||(r[d]=g.start,q&&(g.end=g.start,g.start="width"===d||"height"===d?1:0))}}function jb(a,b){var c,d,e,f,g;for(c in a)if(d=m.camelCase(c),e=b[d],f=a[c],m.isArray(f)&&(e=f[1],f=a[c]=f[0]),c!==d&&(a[d]=f,delete a[c]),g=m.cssHooks[d],g&&"expand"in g){f=g.expand(f),delete a[d];for(c in f)c in a||(a[c]=f[c],b[c]=e)}else b[d]=e}function kb(a,b,c){var d,e,f=0,g=db.length,h=m.Deferred().always(function(){delete i.elem}),i=function(){if(e)return!1;for(var b=$a||fb(),c=Math.max(0,j.startTime+j.duration-b),d=c/j.duration||0,f=1-d,g=0,i=j.tweens.length;i>g;g++)j.tweens[g].run(f);return h.notifyWith(a,[j,f,c]),1>f&&i?c:(h.resolveWith(a,[j]),!1)},j=h.promise({elem:a,props:m.extend({},b),opts:m.extend(!0,{specialEasing:{}},c),originalProperties:b,originalOptions:c,startTime:$a||fb(),duration:c.duration,tweens:[],createTween:function(b,c){var d=m.Tween(a,j.opts,b,c,j.opts.specialEasing[b]||j.opts.easing);return j.tweens.push(d),d},stop:function(b){var c=0,d=b?j.tweens.length:0;if(e)return this;for(e=!0;d>c;c++)j.tweens[c].run(1);return b?h.resolveWith(a,[j,b]):h.rejectWith(a,[j,b]),this}}),k=j.props;for(jb(k,j.opts.specialEasing);g>f;f++)if(d=db[f].call(j,a,k,j.opts))return d;return m.map(k,hb,j),m.isFunction(j.opts.start)&&j.opts.start.call(a,j),m.fx.timer(m.extend(i,{elem:a,anim:j,queue:j.opts.queue})),j.progress(j.opts.progress).done(j.opts.done,j.opts.complete).fail(j.opts.fail).always(j.opts.always)}m.Animation=m.extend(kb,{tweener:function(a,b){m.isFunction(a)?(b=a,a=["*"]):a=a.split(" ");for(var c,d=0,e=a.length;e>d;d++)c=a[d],eb[c]=eb[c]||[],eb[c].unshift(b)},prefilter:function(a,b){b?db.unshift(a):db.push(a)}}),m.speed=function(a,b,c){var d=a&&"object"==typeof a?m.extend({},a):{complete:c||!c&&b||m.isFunction(a)&&a,duration:a,easing:c&&b||b&&!m.isFunction(b)&&b};return d.duration=m.fx.off?0:"number"==typeof d.duration?d.duration:d.duration in m.fx.speeds?m.fx.speeds[d.duration]:m.fx.speeds._default,(null==d.queue||d.queue===!0)&&(d.queue="fx"),d.old=d.complete,d.complete=function(){m.isFunction(d.old)&&d.old.call(this),d.queue&&m.dequeue(this,d.queue)},d},m.fn.extend({fadeTo:function(a,b,c,d){return this.filter(U).css("opacity",0).show().end().animate({opacity:b},a,c,d)},animate:function(a,b,c,d){var e=m.isEmptyObject(a),f=m.speed(b,c,d),g=function(){var b=kb(this,m.extend({},a),f);(e||m._data(this,"finish"))&&b.stop(!0)};return g.finish=g,e||f.queue===!1?this.each(g):this.queue(f.queue,g)},stop:function(a,b,c){var d=function(a){var b=a.stop;delete a.stop,b(c)};return"string"!=typeof a&&(c=b,b=a,a=void 0),b&&a!==!1&&this.queue(a||"fx",[]),this.each(function(){var b=!0,e=null!=a&&a+"queueHooks",f=m.timers,g=m._data(this);if(e)g[e]&&g[e].stop&&d(g[e]);else for(e in g)g[e]&&g[e].stop&&cb.test(e)&&d(g[e]);for(e=f.length;e--;)f[e].elem!==this||null!=a&&f[e].queue!==a||(f[e].anim.stop(c),b=!1,f.splice(e,1));(b||!c)&&m.dequeue(this,a)})},finish:function(a){return a!==!1&&(a=a||"fx"),this.each(function(){var b,c=m._data(this),d=c[a+"queue"],e=c[a+"queueHooks"],f=m.timers,g=d?d.length:0;for(c.finish=!0,m.queue(this,a,[]),e&&e.stop&&e.stop.call(this,!0),b=f.length;b--;)f[b].elem===this&&f[b].queue===a&&(f[b].anim.stop(!0),f.splice(b,1));for(b=0;g>b;b++)d[b]&&d[b].finish&&d[b].finish.call(this);delete c.finish})}}),m.each(["toggle","show","hide"],function(a,b){var c=m.fn[b];m.fn[b]=function(a,d,e){return null==a||"boolean"==typeof a?c.apply(this,arguments):this.animate(gb(b,!0),a,d,e)}}),m.each({slideDown:gb("show"),slideUp:gb("hide"),slideToggle:gb("toggle"),fadeIn:{opacity:"show"},fadeOut:{opacity:"hide"},fadeToggle:{opacity:"toggle"}},function(a,b){m.fn[a]=function(a,c,d){return this.animate(b,a,c,d)}}),m.timers=[],m.fx.tick=function(){var a,b=m.timers,c=0;for($a=m.now();c<b.length;c++)a=b[c],a()||b[c]!==a||b.splice(c--,1);b.length||m.fx.stop(),$a=void 0},m.fx.timer=function(a){m.timers.push(a),a()?m.fx.start():m.timers.pop()},m.fx.interval=13,m.fx.start=function(){_a||(_a=setInterval(m.fx.tick,m.fx.interval))},m.fx.stop=function(){clearInterval(_a),_a=null},m.fx.speeds={slow:600,fast:200,_default:400},m.fn.delay=function(a,b){return a=m.fx?m.fx.speeds[a]||a:a,b=b||"fx",this.queue(b,function(b,c){var d=setTimeout(b,a);c.stop=function(){clearTimeout(d)}})},function(){var a,b,c,d,e;b=y.createElement("div"),b.setAttribute("className","t"),b.innerHTML=" <link/><table></table><a href='/a'>a</a><input type='checkbox'/>",d=b.getElementsByTagName("a")[0],c=y.createElement("select"),e=c.appendChild(y.createElement("option")),a=b.getElementsByTagName("input")[0],d.style.cssText="top:1px",k.getSetAttribute="t"!==b.className,k.style=/top/.test(d.getAttribute("style")),k.hrefNormalized="/a"===d.getAttribute("href"),k.checkOn=!!a.value,k.optSelected=e.selected,k.enctype=!!y.createElement("form").enctype,c.disabled=!0,k.optDisabled=!e.disabled,a=y.createElement("input"),a.setAttribute("value",""),k.input=""===a.getAttribute("value"),a.value="t",a.setAttribute("type","radio"),k.radioValue="t"===a.value}();var lb=/\r/g;m.fn.extend({val:function(a){var b,c,d,e=this[0];{if(arguments.length)return d=m.isFunction(a),this.each(function(c){var e;1===this.nodeType&&(e=d?a.call(this,c,m(this).val()):a,null==e?e="":"number"==typeof e?e+="":m.isArray(e)&&(e=m.map(e,function(a){return null==a?"":a+""})),b=m.valHooks[this.type]||m.valHooks[this.nodeName.toLowerCase()],b&&"set"in b&&void 0!==b.set(this,e,"value")||(this.value=e))});if(e)return b=m.valHooks[e.type]||m.valHooks[e.nodeName.toLowerCase()],b&&"get"in b&&void 0!==(c=b.get(e,"value"))?c:(c=e.value,"string"==typeof c?c.replace(lb,""):null==c?"":c)}}}),m.extend({valHooks:{option:{get:function(a){var b=m.find.attr(a,"value");return null!=b?b:m.trim(m.text(a))}},select:{get:function(a){for(var b,c,d=a.options,e=a.selectedIndex,f="select-one"===a.type||0>e,g=f?null:[],h=f?e+1:d.length,i=0>e?h:f?e:0;h>i;i++)if(c=d[i],!(!c.selected&&i!==e||(k.optDisabled?c.disabled:null!==c.getAttribute("disabled"))||c.parentNode.disabled&&m.nodeName(c.parentNode,"optgroup"))){if(b=m(c).val(),f)return b;g.push(b)}return g},set:function(a,b){var c,d,e=a.options,f=m.makeArray(b),g=e.length;while(g--)if(d=e[g],m.inArray(m.valHooks.option.get(d),f)>=0)try{d.selected=c=!0}catch(h){d.scrollHeight}else d.selected=!1;return c||(a.selectedIndex=-1),e}}}}),m.each(["radio","checkbox"],function(){m.valHooks[this]={set:function(a,b){return m.isArray(b)?a.checked=m.inArray(m(a).val(),b)>=0:void 0}},k.checkOn||(m.valHooks[this].get=function(a){return null===a.getAttribute("value")?"on":a.value})});var mb,nb,ob=m.expr.attrHandle,pb=/^(?:checked|selected)$/i,qb=k.getSetAttribute,rb=k.input;m.fn.extend({attr:function(a,b){return V(this,m.attr,a,b,arguments.length>1)},removeAttr:function(a){return this.each(function(){m.removeAttr(this,a)})}}),m.extend({attr:function(a,b,c){var d,e,f=a.nodeType;if(a&&3!==f&&8!==f&&2!==f)return typeof a.getAttribute===K?m.prop(a,b,c):(1===f&&m.isXMLDoc(a)||(b=b.toLowerCase(),d=m.attrHooks[b]||(m.expr.match.bool.test(b)?nb:mb)),void 0===c?d&&"get"in d&&null!==(e=d.get(a,b))?e:(e=m.find.attr(a,b),null==e?void 0:e):null!==c?d&&"set"in d&&void 0!==(e=d.set(a,c,b))?e:(a.setAttribute(b,c+""),c):void m.removeAttr(a,b))},removeAttr:function(a,b){var c,d,e=0,f=b&&b.match(E);if(f&&1===a.nodeType)while(c=f[e++])d=m.propFix[c]||c,m.expr.match.bool.test(c)?rb&&qb||!pb.test(c)?a[d]=!1:a[m.camelCase("default-"+c)]=a[d]=!1:m.attr(a,c,""),a.removeAttribute(qb?c:d)},attrHooks:{type:{set:function(a,b){if(!k.radioValue&&"radio"===b&&m.nodeName(a,"input")){var c=a.value;return a.setAttribute("type",b),c&&(a.value=c),b}}}}}),nb={set:function(a,b,c){return b===!1?m.removeAttr(a,c):rb&&qb||!pb.test(c)?a.setAttribute(!qb&&m.propFix[c]||c,c):a[m.camelCase("default-"+c)]=a[c]=!0,c}},m.each(m.expr.match.bool.source.match(/\w+/g),function(a,b){var c=ob[b]||m.find.attr;ob[b]=rb&&qb||!pb.test(b)?function(a,b,d){var e,f;return d||(f=ob[b],ob[b]=e,e=null!=c(a,b,d)?b.toLowerCase():null,ob[b]=f),e}:function(a,b,c){return c?void 0:a[m.camelCase("default-"+b)]?b.toLowerCase():null}}),rb&&qb||(m.attrHooks.value={set:function(a,b,c){return m.nodeName(a,"input")?void(a.defaultValue=b):mb&&mb.set(a,b,c)}}),qb||(mb={set:function(a,b,c){var d=a.getAttributeNode(c);return d||a.setAttributeNode(d=a.ownerDocument.createAttribute(c)),d.value=b+="","value"===c||b===a.getAttribute(c)?b:void 0}},ob.id=ob.name=ob.coords=function(a,b,c){var d;return c?void 0:(d=a.getAttributeNode(b))&&""!==d.value?d.value:null},m.valHooks.button={get:function(a,b){var c=a.getAttributeNode(b);return c&&c.specified?c.value:void 0},set:mb.set},m.attrHooks.contenteditable={set:function(a,b,c){mb.set(a,""===b?!1:b,c)}},m.each(["width","height"],function(a,b){m.attrHooks[b]={set:function(a,c){return""===c?(a.setAttribute(b,"auto"),c):void 0}}})),k.style||(m.attrHooks.style={get:function(a){return a.style.cssText||void 0},set:function(a,b){return a.style.cssText=b+""}});var sb=/^(?:input|select|textarea|button|object)$/i,tb=/^(?:a|area)$/i;m.fn.extend({prop:function(a,b){return V(this,m.prop,a,b,arguments.length>1)},removeProp:function(a){return a=m.propFix[a]||a,this.each(function(){try{this[a]=void 0,delete this[a]}catch(b){}})}}),m.extend({propFix:{"for":"htmlFor","class":"className"},prop:function(a,b,c){var d,e,f,g=a.nodeType;if(a&&3!==g&&8!==g&&2!==g)return f=1!==g||!m.isXMLDoc(a),f&&(b=m.propFix[b]||b,e=m.propHooks[b]),void 0!==c?e&&"set"in e&&void 0!==(d=e.set(a,c,b))?d:a[b]=c:e&&"get"in e&&null!==(d=e.get(a,b))?d:a[b]},propHooks:{tabIndex:{get:function(a){var b=m.find.attr(a,"tabindex");return b?parseInt(b,10):sb.test(a.nodeName)||tb.test(a.nodeName)&&a.href?0:-1}}}}),k.hrefNormalized||m.each(["href","src"],function(a,b){m.propHooks[b]={get:function(a){return a.getAttribute(b,4)}}}),k.optSelected||(m.propHooks.selected={get:function(a){var b=a.parentNode;return b&&(b.selectedIndex,b.parentNode&&b.parentNode.selectedIndex),null}}),m.each(["tabIndex","readOnly","maxLength","cellSpacing","cellPadding","rowSpan","colSpan","useMap","frameBorder","contentEditable"],function(){m.propFix[this.toLowerCase()]=this}),k.enctype||(m.propFix.enctype="encoding");var ub=/[\t\r\n\f]/g;m.fn.extend({addClass:function(a){var b,c,d,e,f,g,h=0,i=this.length,j="string"==typeof a&&a;if(m.isFunction(a))return this.each(function(b){m(this).addClass(a.call(this,b,this.className))});if(j)for(b=(a||"").match(E)||[];i>h;h++)if(c=this[h],d=1===c.nodeType&&(c.className?(" "+c.className+" ").replace(ub," "):" ")){f=0;while(e=b[f++])d.indexOf(" "+e+" ")<0&&(d+=e+" ");g=m.trim(d),c.className!==g&&(c.className=g)}return this},removeClass:function(a){var b,c,d,e,f,g,h=0,i=this.length,j=0===arguments.length||"string"==typeof a&&a;if(m.isFunction(a))return this.each(function(b){m(this).removeClass(a.call(this,b,this.className))});if(j)for(b=(a||"").match(E)||[];i>h;h++)if(c=this[h],d=1===c.nodeType&&(c.className?(" "+c.className+" ").replace(ub," "):"")){f=0;while(e=b[f++])while(d.indexOf(" "+e+" ")>=0)d=d.replace(" "+e+" "," ");g=a?m.trim(d):"",c.className!==g&&(c.className=g)}return this},toggleClass:function(a,b){var c=typeof a;return"boolean"==typeof b&&"string"===c?b?this.addClass(a):this.removeClass(a):this.each(m.isFunction(a)?function(c){m(this).toggleClass(a.call(this,c,this.className,b),b)}:function(){if("string"===c){var b,d=0,e=m(this),f=a.match(E)||[];while(b=f[d++])e.hasClass(b)?e.removeClass(b):e.addClass(b)}else(c===K||"boolean"===c)&&(this.className&&m._data(this,"__className__",this.className),this.className=this.className||a===!1?"":m._data(this,"__className__")||"")})},hasClass:function(a){for(var b=" "+a+" ",c=0,d=this.length;d>c;c++)if(1===this[c].nodeType&&(" "+this[c].className+" ").replace(ub," ").indexOf(b)>=0)return!0;return!1}}),m.each("blur focus focusin focusout load resize scroll unload click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select submit keydown keypress keyup error contextmenu".split(" "),function(a,b){m.fn[b]=function(a,c){return arguments.length>0?this.on(b,null,a,c):this.trigger(b)}}),m.fn.extend({hover:function(a,b){return this.mouseenter(a).mouseleave(b||a)},bind:function(a,b,c){return this.on(a,null,b,c)},unbind:function(a,b){return this.off(a,null,b)},delegate:function(a,b,c,d){return this.on(b,a,c,d)},undelegate:function(a,b,c){return 1===arguments.length?this.off(a,"**"):this.off(b,a||"**",c)}});var vb=m.now(),wb=/\?/,xb=/(,)|(\[|{)|(}|])|"(?:[^"\\\r\n]|\\["\\\/bfnrt]|\\u[\da-fA-F]{4})*"\s*:?|true|false|null|-?(?!0\d)\d+(?:\.\d+|)(?:[eE][+-]?\d+|)/g;m.parseJSON=function(b){if(a.JSON&&a.JSON.parse)return a.JSON.parse(b+"");var c,d=null,e=m.trim(b+"");return e&&!m.trim(e.replace(xb,function(a,b,e,f){return c&&b&&(d=0),0===d?a:(c=e||b,d+=!f-!e,"")}))?Function("return "+e)():m.error("Invalid JSON: "+b)},m.parseXML=function(b){var c,d;if(!b||"string"!=typeof b)return null;try{a.DOMParser?(d=new DOMParser,c=d.parseFromString(b,"text/xml")):(c=new ActiveXObject("Microsoft.XMLDOM"),c.async="false",c.loadXML(b))}catch(e){c=void 0}return c&&c.documentElement&&!c.getElementsByTagName("parsererror").length||m.error("Invalid XML: "+b),c};var yb,zb,Ab=/#.*$/,Bb=/([?&])_=[^&]*/,Cb=/^(.*?):[ \t]*([^\r\n]*)\r?$/gm,Db=/^(?:about|app|app-storage|.+-extension|file|res|widget):$/,Eb=/^(?:GET|HEAD)$/,Fb=/^\/\//,Gb=/^([\w.+-]+:)(?:\/\/(?:[^\/?#]*@|)([^\/?#:]*)(?::(\d+)|)|)/,Hb={},Ib={},Jb="*/".concat("*");try{zb=location.href}catch(Kb){zb=y.createElement("a"),zb.href="",zb=zb.href}yb=Gb.exec(zb.toLowerCase())||[];function Lb(a){return function(b,c){"string"!=typeof b&&(c=b,b="*");var d,e=0,f=b.toLowerCase().match(E)||[];if(m.isFunction(c))while(d=f[e++])"+"===d.charAt(0)?(d=d.slice(1)||"*",(a[d]=a[d]||[]).unshift(c)):(a[d]=a[d]||[]).push(c)}}function Mb(a,b,c,d){var e={},f=a===Ib;function g(h){var i;return e[h]=!0,m.each(a[h]||[],function(a,h){var j=h(b,c,d);return"string"!=typeof j||f||e[j]?f?!(i=j):void 0:(b.dataTypes.unshift(j),g(j),!1)}),i}return g(b.dataTypes[0])||!e["*"]&&g("*")}function Nb(a,b){var c,d,e=m.ajaxSettings.flatOptions||{};for(d in b)void 0!==b[d]&&((e[d]?a:c||(c={}))[d]=b[d]);return c&&m.extend(!0,a,c),a}function Ob(a,b,c){var d,e,f,g,h=a.contents,i=a.dataTypes;while("*"===i[0])i.shift(),void 0===e&&(e=a.mimeType||b.getResponseHeader("Content-Type"));if(e)for(g in h)if(h[g]&&h[g].test(e)){i.unshift(g);break}if(i[0]in c)f=i[0];else{for(g in c){if(!i[0]||a.converters[g+" "+i[0]]){f=g;break}d||(d=g)}f=f||d}return f?(f!==i[0]&&i.unshift(f),c[f]):void 0}function Pb(a,b,c,d){var e,f,g,h,i,j={},k=a.dataTypes.slice();if(k[1])for(g in a.converters)j[g.toLowerCase()]=a.converters[g];f=k.shift();while(f)if(a.responseFields[f]&&(c[a.responseFields[f]]=b),!i&&d&&a.dataFilter&&(b=a.dataFilter(b,a.dataType)),i=f,f=k.shift())if("*"===f)f=i;else if("*"!==i&&i!==f){if(g=j[i+" "+f]||j["* "+f],!g)for(e in j)if(h=e.split(" "),h[1]===f&&(g=j[i+" "+h[0]]||j["* "+h[0]])){g===!0?g=j[e]:j[e]!==!0&&(f=h[0],k.unshift(h[1]));break}if(g!==!0)if(g&&a["throws"])b=g(b);else try{b=g(b)}catch(l){return{state:"parsererror",error:g?l:"No conversion from "+i+" to "+f}}}return{state:"success",data:b}}m.extend({active:0,lastModified:{},etag:{},ajaxSettings:{url:zb,type:"GET",isLocal:Db.test(yb[1]),global:!0,processData:!0,async:!0,contentType:"application/x-www-form-urlencoded; charset=UTF-8",accepts:{"*":Jb,text:"text/plain",html:"text/html",xml:"application/xml, text/xml",json:"application/json, text/javascript"},contents:{xml:/xml/,html:/html/,json:/json/},responseFields:{xml:"responseXML",text:"responseText",json:"responseJSON"},converters:{"* text":String,"text html":!0,"text json":m.parseJSON,"text xml":m.parseXML},flatOptions:{url:!0,context:!0}},ajaxSetup:function(a,b){return b?Nb(Nb(a,m.ajaxSettings),b):Nb(m.ajaxSettings,a)},ajaxPrefilter:Lb(Hb),ajaxTransport:Lb(Ib),ajax:function(a,b){"object"==typeof a&&(b=a,a=void 0),b=b||{};var c,d,e,f,g,h,i,j,k=m.ajaxSetup({},b),l=k.context||k,n=k.context&&(l.nodeType||l.jquery)?m(l):m.event,o=m.Deferred(),p=m.Callbacks("once memory"),q=k.statusCode||{},r={},s={},t=0,u="canceled",v={readyState:0,getResponseHeader:function(a){var b;if(2===t){if(!j){j={};while(b=Cb.exec(f))j[b[1].toLowerCase()]=b[2]}b=j[a.toLowerCase()]}return null==b?null:b},getAllResponseHeaders:function(){return 2===t?f:null},setRequestHeader:function(a,b){var c=a.toLowerCase();return t||(a=s[c]=s[c]||a,r[a]=b),this},overrideMimeType:function(a){return t||(k.mimeType=a),this},statusCode:function(a){var b;if(a)if(2>t)for(b in a)q[b]=[q[b],a[b]];else v.always(a[v.status]);return this},abort:function(a){var b=a||u;return i&&i.abort(b),x(0,b),this}};if(o.promise(v).complete=p.add,v.success=v.done,v.error=v.fail,k.url=((a||k.url||zb)+"").replace(Ab,"").replace(Fb,yb[1]+"//"),k.type=b.method||b.type||k.method||k.type,k.dataTypes=m.trim(k.dataType||"*").toLowerCase().match(E)||[""],null==k.crossDomain&&(c=Gb.exec(k.url.toLowerCase()),k.crossDomain=!(!c||c[1]===yb[1]&&c[2]===yb[2]&&(c[3]||("http:"===c[1]?"80":"443"))===(yb[3]||("http:"===yb[1]?"80":"443")))),k.data&&k.processData&&"string"!=typeof k.data&&(k.data=m.param(k.data,k.traditional)),Mb(Hb,k,b,v),2===t)return v;h=m.event&&k.global,h&&0===m.active++&&m.event.trigger("ajaxStart"),k.type=k.type.toUpperCase(),k.hasContent=!Eb.test(k.type),e=k.url,k.hasContent||(k.data&&(e=k.url+=(wb.test(e)?"&":"?")+k.data,delete k.data),k.cache===!1&&(k.url=Bb.test(e)?e.replace(Bb,"$1_="+vb++):e+(wb.test(e)?"&":"?")+"_="+vb++)),k.ifModified&&(m.lastModified[e]&&v.setRequestHeader("If-Modified-Since",m.lastModified[e]),m.etag[e]&&v.setRequestHeader("If-None-Match",m.etag[e])),(k.data&&k.hasContent&&k.contentType!==!1||b.contentType)&&v.setRequestHeader("Content-Type",k.contentType),v.setRequestHeader("Accept",k.dataTypes[0]&&k.accepts[k.dataTypes[0]]?k.accepts[k.dataTypes[0]]+("*"!==k.dataTypes[0]?", "+Jb+"; q=0.01":""):k.accepts["*"]);for(d in k.headers)v.setRequestHeader(d,k.headers[d]);if(k.beforeSend&&(k.beforeSend.call(l,v,k)===!1||2===t))return v.abort();u="abort";for(d in{success:1,error:1,complete:1})v[d](k[d]);if(i=Mb(Ib,k,b,v)){v.readyState=1,h&&n.trigger("ajaxSend",[v,k]),k.async&&k.timeout>0&&(g=setTimeout(function(){v.abort("timeout")},k.timeout));try{t=1,i.send(r,x)}catch(w){if(!(2>t))throw w;x(-1,w)}}else x(-1,"No Transport");function x(a,b,c,d){var j,r,s,u,w,x=b;2!==t&&(t=2,g&&clearTimeout(g),i=void 0,f=d||"",v.readyState=a>0?4:0,j=a>=200&&300>a||304===a,c&&(u=Ob(k,v,c)),u=Pb(k,u,v,j),j?(k.ifModified&&(w=v.getResponseHeader("Last-Modified"),w&&(m.lastModified[e]=w),w=v.getResponseHeader("etag"),w&&(m.etag[e]=w)),204===a||"HEAD"===k.type?x="nocontent":304===a?x="notmodified":(x=u.state,r=u.data,s=u.error,j=!s)):(s=x,(a||!x)&&(x="error",0>a&&(a=0))),v.status=a,v.statusText=(b||x)+"",j?o.resolveWith(l,[r,x,v]):o.rejectWith(l,[v,x,s]),v.statusCode(q),q=void 0,h&&n.trigger(j?"ajaxSuccess":"ajaxError",[v,k,j?r:s]),p.fireWith(l,[v,x]),h&&(n.trigger("ajaxComplete",[v,k]),--m.active||m.event.trigger("ajaxStop")))}return v},getJSON:function(a,b,c){return m.get(a,b,c,"json")},getScript:function(a,b){return m.get(a,void 0,b,"script")}}),m.each(["get","post"],function(a,b){m[b]=function(a,c,d,e){return m.isFunction(c)&&(e=e||d,d=c,c=void 0),m.ajax({url:a,type:b,dataType:e,data:c,success:d})}}),m._evalUrl=function(a){return m.ajax({url:a,type:"GET",dataType:"script",async:!1,global:!1,"throws":!0})},m.fn.extend({wrapAll:function(a){if(m.isFunction(a))return this.each(function(b){m(this).wrapAll(a.call(this,b))});if(this[0]){var b=m(a,this[0].ownerDocument).eq(0).clone(!0);this[0].parentNode&&b.insertBefore(this[0]),b.map(function(){var a=this;while(a.firstChild&&1===a.firstChild.nodeType)a=a.firstChild;return a}).append(this)}return this},wrapInner:function(a){return this.each(m.isFunction(a)?function(b){m(this).wrapInner(a.call(this,b))}:function(){var b=m(this),c=b.contents();c.length?c.wrapAll(a):b.append(a)})},wrap:function(a){var b=m.isFunction(a);return this.each(function(c){m(this).wrapAll(b?a.call(this,c):a)})},unwrap:function(){return this.parent().each(function(){m.nodeName(this,"body")||m(this).replaceWith(this.childNodes)}).end()}}),m.expr.filters.hidden=function(a){return a.offsetWidth<=0&&a.offsetHeight<=0||!k.reliableHiddenOffsets()&&"none"===(a.style&&a.style.display||m.css(a,"display"))},m.expr.filters.visible=function(a){return!m.expr.filters.hidden(a)};var Qb=/%20/g,Rb=/\[\]$/,Sb=/\r?\n/g,Tb=/^(?:submit|button|image|reset|file)$/i,Ub=/^(?:input|select|textarea|keygen)/i;function Vb(a,b,c,d){var e;if(m.isArray(b))m.each(b,function(b,e){c||Rb.test(a)?d(a,e):Vb(a+"["+("object"==typeof e?b:"")+"]",e,c,d)});else if(c||"object"!==m.type(b))d(a,b);else for(e in b)Vb(a+"["+e+"]",b[e],c,d)}m.param=function(a,b){var c,d=[],e=function(a,b){b=m.isFunction(b)?b():null==b?"":b,d[d.length]=encodeURIComponent(a)+"="+encodeURIComponent(b)};if(void 0===b&&(b=m.ajaxSettings&&m.ajaxSettings.traditional),m.isArray(a)||a.jquery&&!m.isPlainObject(a))m.each(a,function(){e(this.name,this.value)});else for(c in a)Vb(c,a[c],b,e);return d.join("&").replace(Qb,"+")},m.fn.extend({serialize:function(){return m.param(this.serializeArray())},serializeArray:function(){return this.map(function(){var a=m.prop(this,"elements");return a?m.makeArray(a):this}).filter(function(){var a=this.type;return this.name&&!m(this).is(":disabled")&&Ub.test(this.nodeName)&&!Tb.test(a)&&(this.checked||!W.test(a))}).map(function(a,b){var c=m(this).val();return null==c?null:m.isArray(c)?m.map(c,function(a){return{name:b.name,value:a.replace(Sb,"\r\n")}}):{name:b.name,value:c.replace(Sb,"\r\n")}}).get()}}),m.ajaxSettings.xhr=void 0!==a.ActiveXObject?function(){return!this.isLocal&&/^(get|post|head|put|delete|options)$/i.test(this.type)&&Zb()||$b()}:Zb;var Wb=0,Xb={},Yb=m.ajaxSettings.xhr();a.attachEvent&&a.attachEvent("onunload",function(){for(var a in Xb)Xb[a](void 0,!0)}),k.cors=!!Yb&&"withCredentials"in Yb,Yb=k.ajax=!!Yb,Yb&&m.ajaxTransport(function(a){if(!a.crossDomain||k.cors){var b;return{send:function(c,d){var e,f=a.xhr(),g=++Wb;if(f.open(a.type,a.url,a.async,a.username,a.password),a.xhrFields)for(e in a.xhrFields)f[e]=a.xhrFields[e];a.mimeType&&f.overrideMimeType&&f.overrideMimeType(a.mimeType),a.crossDomain||c["X-Requested-With"]||(c["X-Requested-With"]="XMLHttpRequest");for(e in c)void 0!==c[e]&&f.setRequestHeader(e,c[e]+"");f.send(a.hasContent&&a.data||null),b=function(c,e){var h,i,j;if(b&&(e||4===f.readyState))if(delete Xb[g],b=void 0,f.onreadystatechange=m.noop,e)4!==f.readyState&&f.abort();else{j={},h=f.status,"string"==typeof f.responseText&&(j.text=f.responseText);try{i=f.statusText}catch(k){i=""}h||!a.isLocal||a.crossDomain?1223===h&&(h=204):h=j.text?200:404}j&&d(h,i,j,f.getAllResponseHeaders())},a.async?4===f.readyState?setTimeout(b):f.onreadystatechange=Xb[g]=b:b()},abort:function(){b&&b(void 0,!0)}}}});function Zb(){try{return new a.XMLHttpRequest}catch(b){}}function $b(){try{return new a.ActiveXObject("Microsoft.XMLHTTP")}catch(b){}}m.ajaxSetup({accepts:{script:"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"},contents:{script:/(?:java|ecma)script/},converters:{"text script":function(a){return m.globalEval(a),a}}}),m.ajaxPrefilter("script",function(a){void 0===a.cache&&(a.cache=!1),a.crossDomain&&(a.type="GET",a.global=!1)}),m.ajaxTransport("script",function(a){if(a.crossDomain){var b,c=y.head||m("head")[0]||y.documentElement;return{send:function(d,e){b=y.createElement("script"),b.async=!0,a.scriptCharset&&(b.charset=a.scriptCharset),b.src=a.url,b.onload=b.onreadystatechange=function(a,c){(c||!b.readyState||/loaded|complete/.test(b.readyState))&&(b.onload=b.onreadystatechange=null,b.parentNode&&b.parentNode.removeChild(b),b=null,c||e(200,"success"))},c.insertBefore(b,c.firstChild)},abort:function(){b&&b.onload(void 0,!0)}}}});var _b=[],ac=/(=)\?(?=&|$)|\?\?/;m.ajaxSetup({jsonp:"callback",jsonpCallback:function(){var a=_b.pop()||m.expando+"_"+vb++;return this[a]=!0,a}}),m.ajaxPrefilter("json jsonp",function(b,c,d){var e,f,g,h=b.jsonp!==!1&&(ac.test(b.url)?"url":"string"==typeof b.data&&!(b.contentType||"").indexOf("application/x-www-form-urlencoded")&&ac.test(b.data)&&"data");return h||"jsonp"===b.dataTypes[0]?(e=b.jsonpCallback=m.isFunction(b.jsonpCallback)?b.jsonpCallback():b.jsonpCallback,h?b[h]=b[h].replace(ac,"$1"+e):b.jsonp!==!1&&(b.url+=(wb.test(b.url)?"&":"?")+b.jsonp+"="+e),b.converters["script json"]=function(){return g||m.error(e+" was not called"),g[0]},b.dataTypes[0]="json",f=a[e],a[e]=function(){g=arguments},d.always(function(){a[e]=f,b[e]&&(b.jsonpCallback=c.jsonpCallback,_b.push(e)),g&&m.isFunction(f)&&f(g[0]),g=f=void 0}),"script"):void 0}),m.parseHTML=function(a,b,c){if(!a||"string"!=typeof a)return null;"boolean"==typeof b&&(c=b,b=!1),b=b||y;var d=u.exec(a),e=!c&&[];return d?[b.createElement(d[1])]:(d=m.buildFragment([a],b,e),e&&e.length&&m(e).remove(),m.merge([],d.childNodes))};var bc=m.fn.load;m.fn.load=function(a,b,c){if("string"!=typeof a&&bc)return bc.apply(this,arguments);var d,e,f,g=this,h=a.indexOf(" ");return h>=0&&(d=m.trim(a.slice(h,a.length)),a=a.slice(0,h)),m.isFunction(b)?(c=b,b=void 0):b&&"object"==typeof b&&(f="POST"),g.length>0&&m.ajax({url:a,type:f,dataType:"html",data:b}).done(function(a){e=arguments,g.html(d?m("<div>").append(m.parseHTML(a)).find(d):a)}).complete(c&&function(a,b){g.each(c,e||[a.responseText,b,a])}),this},m.each(["ajaxStart","ajaxStop","ajaxComplete","ajaxError","ajaxSuccess","ajaxSend"],function(a,b){m.fn[b]=function(a){return this.on(b,a)}}),m.expr.filters.animated=function(a){return m.grep(m.timers,function(b){return a===b.elem}).length};var cc=a.document.documentElement;function dc(a){return m.isWindow(a)?a:9===a.nodeType?a.defaultView||a.parentWindow:!1}m.offset={setOffset:function(a,b,c){var d,e,f,g,h,i,j,k=m.css(a,"position"),l=m(a),n={};"static"===k&&(a.style.position="relative"),h=l.offset(),f=m.css(a,"top"),i=m.css(a,"left"),j=("absolute"===k||"fixed"===k)&&m.inArray("auto",[f,i])>-1,j?(d=l.position(),g=d.top,e=d.left):(g=parseFloat(f)||0,e=parseFloat(i)||0),m.isFunction(b)&&(b=b.call(a,c,h)),null!=b.top&&(n.top=b.top-h.top+g),null!=b.left&&(n.left=b.left-h.left+e),"using"in b?b.using.call(a,n):l.css(n)}},m.fn.extend({offset:function(a){if(arguments.length)return void 0===a?this:this.each(function(b){m.offset.setOffset(this,a,b)});var b,c,d={top:0,left:0},e=this[0],f=e&&e.ownerDocument;if(f)return b=f.documentElement,m.contains(b,e)?(typeof e.getBoundingClientRect!==K&&(d=e.getBoundingClientRect()),c=dc(f),{top:d.top+(c.pageYOffset||b.scrollTop)-(b.clientTop||0),left:d.left+(c.pageXOffset||b.scrollLeft)-(b.clientLeft||0)}):d},position:function(){if(this[0]){var a,b,c={top:0,left:0},d=this[0];return"fixed"===m.css(d,"position")?b=d.getBoundingClientRect():(a=this.offsetParent(),b=this.offset(),m.nodeName(a[0],"html")||(c=a.offset()),c.top+=m.css(a[0],"borderTopWidth",!0),c.left+=m.css(a[0],"borderLeftWidth",!0)),{top:b.top-c.top-m.css(d,"marginTop",!0),left:b.left-c.left-m.css(d,"marginLeft",!0)}}},offsetParent:function(){return this.map(function(){var a=this.offsetParent||cc;while(a&&!m.nodeName(a,"html")&&"static"===m.css(a,"position"))a=a.offsetParent;return a||cc})}}),m.each({scrollLeft:"pageXOffset",scrollTop:"pageYOffset"},function(a,b){var c=/Y/.test(b);m.fn[a]=function(d){return V(this,function(a,d,e){var f=dc(a);return void 0===e?f?b in f?f[b]:f.document.documentElement[d]:a[d]:void(f?f.scrollTo(c?m(f).scrollLeft():e,c?e:m(f).scrollTop()):a[d]=e)},a,d,arguments.length,null)}}),m.each(["top","left"],function(a,b){m.cssHooks[b]=La(k.pixelPosition,function(a,c){return c?(c=Ja(a,b),Ha.test(c)?m(a).position()[b]+"px":c):void 0})}),m.each({Height:"height",Width:"width"},function(a,b){m.each({padding:"inner"+a,content:b,"":"outer"+a},function(c,d){m.fn[d]=function(d,e){var f=arguments.length&&(c||"boolean"!=typeof d),g=c||(d===!0||e===!0?"margin":"border");return V(this,function(b,c,d){var e;return m.isWindow(b)?b.document.documentElement["client"+a]:9===b.nodeType?(e=b.documentElement,Math.max(b.body["scroll"+a],e["scroll"+a],b.body["offset"+a],e["offset"+a],e["client"+a])):void 0===d?m.css(b,c,g):m.style(b,c,d,g)},b,f?d:void 0,f,null)}})}),m.fn.size=function(){return this.length},m.fn.andSelf=m.fn.addBack,"function"==typeof define&&define.amd&&define("jquery",[],function(){return m});var ec=a.jQuery,fc=a.$;return m.noConflict=function(b){return a.$===m&&(a.$=fc),b&&a.jQuery===m&&(a.jQuery=ec),m},typeof b===K&&(a.jQuery=a.$=m),m}); jQuery.noConflict();
app/static/src/diagnostic/TestTypeResultForm_modules/NewParticleTestForm.js
SnowBeaver/Vision
import React from 'react'; import FormControl from 'react-bootstrap/lib/FormControl'; import FormGroup from 'react-bootstrap/lib/FormGroup'; import ControlLabel from 'react-bootstrap/lib/ControlLabel'; import Button from 'react-bootstrap/lib/Button'; import Panel from 'react-bootstrap/lib/Panel'; import {findDOMNode} from 'react-dom'; import {hashHistory} from 'react-router'; import {Link} from 'react-router'; import HelpBlock from 'react-bootstrap/lib/HelpBlock'; import {NotificationContainer, NotificationManager} from 'react-notifications'; const TextField = React.createClass({ render: function() { var label = (this.props.label != null) ? this.props.label: ""; var name = (this.props.name != null) ? this.props.name: ""; var value = (this.props.value != null) ? this.props.value: ""; return ( <FormGroup validationState={this.props.errors[name] ? 'error' : null}> <ControlLabel>{label}</ControlLabel> <FormControl type="text" placeholder={label} name={name} value={value} data-type={this.props["data-type"]} /> <HelpBlock className="warning">{this.props.errors[name]}</HelpBlock> <FormControl.Feedback /> </FormGroup> ); } }); var NewParticleTestForm = React.createClass({ getInitialState: function () { return { loading: false, errors: {}, fields: [ '_2um', '_5um', '_10um', '_15um', '_25um', '_50um', '_100um', 'nas1638', 'iso4406_1', 'iso4406_2', 'iso4406_3' ] } }, componentDidMount: function () { var source = '/api/v1.0/' + this.props.tableName + '/?test_result_id=' + this.props.testResultId; this.serverRequest = $.authorizedGet(source, function (result) { var res = (result['result']); if (res.length > 0) { var fields = this.state.fields; fields.push('id'); var data = res[0]; var state = {}; for (var i = 0; i < fields.length; i++) { var key = fields[i]; if (data.hasOwnProperty(key)) { state[key] = data[key]; } } this.setState(state); } }.bind(this), 'json'); }, _create: function () { var fields = this.state.fields; var data = {test_result_id: this.props.testResultId}; var url = '/api/v1.0/' + this.props.tableName + '/'; for (var i = 0; i < fields.length; i++) { var key = fields[i]; data[key] = this.state[key]; } if ('id' in this.state) { url += this.state['id']; delete data.id; } return $.authorizedAjax({ url: url, type: 'POST', dataType: 'json', contentType: 'application/json', data: JSON.stringify(data), beforeSend: function () { this.setState({loading: true}); }.bind(this) }) }, _onSubmit: function (e) { e.preventDefault(); // Do not propagate the submit event of the main form e.stopPropagation(); if (!this.is_valid()){ NotificationManager.error('Please correct the errors'); e.stopPropagation(); return false; } var xhr = this._create(); xhr.done(this._onSuccess) .fail(this._onError) .always(this.hideLoading) }, hideLoading: function () { this.setState({loading: false}); }, _onSuccess: function (data) { // this.setState(this.getInitialState()); NotificationManager.success('Test values have been saved successfully.'); if ($.isNumeric(data.result)) { this.setState({id: data.result}); } }, _onError: function (data) { var message = "Failed to create"; var res = data.responseJSON; if (res.message) { message = data.responseJSON.message; } if (res.error) { // We get list of errors if (data.status >= 500) { message = res.error.join(". "); } else if (res.error instanceof Object){ // We get object of errors with field names as key for (var field in res.error) { var errorMessage = res.error[field]; if (Array.isArray(errorMessage)) { errorMessage = errorMessage.join(". "); } res.error[field] = errorMessage; } this.setState({ errors: res.error }); } else { message = res.error; } } NotificationManager.error(message); }, _onChange: function (e) { var state = {}; if (e.target.type == 'checkbox') { state[e.target.name] = e.target.checked; } else if (e.target.type == 'select-one') { state[e.target.name] = e.target.value; } else { state[e.target.name] = e.target.value; } var errors = this._validate(e); state = this._updateFieldErrors(e.target.name, state, errors); this.setState(state); }, _validate: function (e) { var errors = []; var error; error = this._validateFieldType(e.target.value, e.target.getAttribute("data-type")); if (error){ errors.push(error); } return errors; }, _validateFieldType: function (value, type){ var error = ""; if (type != undefined && value){ var typePatterns = { "float": /^(-|\+?)[0-9]+(\.)?[0-9]*$/ }; if (!typePatterns[type].test(value)){ error = "Invalid " + type + " value"; } } return error; }, _updateFieldErrors: function (fieldName, state, errors){ // Clear existing errors related to the current field as it has been edited state.errors = this.state.errors; delete state.errors[fieldName]; // Update errors with new ones, if present if (Object.keys(errors).length){ state.errors[fieldName] = errors.join(". "); } return state; }, is_valid: function () { return (Object.keys(this.state.errors).length <= 0); }, _formGroupClass: function (field) { var className = "form-group "; if (field) { className += " has-error" } return className; }, render: function () { return ( <div className="form-container"> <form method="post" action="#" onSubmit={this._onSubmit} onChange={this._onChange}> <div className="row"> <div className="col-md-3"> <TextField label=">2um" name="_2um" value={this.state._2um} errors={this.state.errors} data-type="float"/> </div> <div className="col-md-3"> <TextField label=">5um" name="_5um" value={this.state._5um} errors={this.state.errors} data-type="float"/> </div> <div className="col-md-3"> <TextField label=">10um" name="_10um" value={this.state._10um} errors={this.state.errors} data-type="float"/> </div> <div className="col-md-3"> <TextField label=">15um" name="_15um" value={this.state._15um} errors={this.state.errors} data-type="float"/> </div> </div> <div className="row"> <div className="col-md-3"> <TextField label=">25um" name="_25um" value={this.state._25um} errors={this.state.errors} data-type="float"/> </div> <div className="col-md-3"> <TextField label=">50um" name="_50um" value={this.state._50um} errors={this.state.errors} data-type="float"/> </div> <div className="col-md-3"> <TextField label=">100um" name="_100um" value={this.state._100um} errors={this.state.errors} data-type="float"/> </div> <div className="col-md-3"> <TextField label="NAS1638" name="nas1638" value={this.state.nas1638} errors={this.state.errors} data-type="float"/> </div> </div> <div className="row"> <div className="col-md-6 pull-right" > <Panel header="ISO 4406"> </Panel> </div> </div> <div className="row"> <div className="col-md-2 pull-right"> <TextField label="iso4406-1" name="iso4406_1" value={this.state.iso4406_1} errors={this.state.errors} data-type="float"/> </div> <div className="col-md-2 pull-right"> <TextField label="iso4406-2" name="iso4406_2" value={this.state.iso4406_2} errors={this.state.errors} data-type="float"/> </div> <div className="col-md-2 pull-right"> <TextField label="iso4406-3" name="iso4406_3" value={this.state.iso4406_3} errors={this.state.errors} data-type="float"/> </div> </div> <div className="row"> <div className="col-md-12 "> <Button bsStyle="success" className="pull-right" type="submit">Save</Button> &nbsp; <Button bsStyle="danger" className="pull-right margin-right-xs" onClick={this.props.handleClose} >Cancel</Button> </div> </div> </form> </div> ); } }); export default NewParticleTestForm;
app/jsx/due_dates/DueDateTokenWrapper.js
venturehive/canvas-lms
/* * Copyright (C) 2015 - present Instructure, Inc. * * This file is part of Canvas. * * Canvas is free software: you can redistribute it and/or modify it under * the terms of the GNU Affero General Public License as published by the Free * Software Foundation, version 3 of the License. * * Canvas is distributed in the hope that it will be useful, but WITHOUT ANY * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR * A PARTICULAR PURPOSE. See the GNU Affero General Public License for more * details. * * You should have received a copy of the GNU Affero General Public License along * with this program. If not, see <http://www.gnu.org/licenses/>. */ import _ from 'underscore' import React from 'react' import PropTypes from 'prop-types' import ReactModal from 'react-modal' import OverrideStudentStore from 'jsx/due_dates/OverrideStudentStore' import Override from 'compiled/models/AssignmentOverride' import TokenInput, {Option as ComboboxOption} from 'react-tokeninput' import I18n from 'i18n!assignments' import $ from 'jquery' import SearchHelpers from 'jsx/shared/helpers/searchHelpers' import DisabledTokenInput from 'jsx/due_dates/DisabledTokenInput' var DueDateWrapperConsts = { MINIMUM_SEARCH_LENGTH: 3, MAXIMUM_STUDENTS_TO_SHOW: 7, MAXIMUM_GROUPS_TO_SHOW: 5, MAXIMUM_SECTIONS_TO_SHOW: 3, MS_TO_DEBOUNCE_SEARCH: 800, } var DueDateTokenWrapper = React.createClass({ propTypes: { tokens: PropTypes.array.isRequired, handleTokenAdd: PropTypes.func.isRequired, handleTokenRemove: PropTypes.func.isRequired, potentialOptions: PropTypes.array.isRequired, rowKey: PropTypes.string.isRequired, defaultSectionNamer: PropTypes.func.isRequired, currentlySearching: PropTypes.bool.isRequired, allStudentsFetched: PropTypes.bool.isRequired, disabled: PropTypes.bool.isRequired }, MINIMUM_SEARCH_LENGTH: DueDateWrapperConsts.MINIMUM_SEARCH_LENGTH, MAXIMUM_STUDENTS_TO_SHOW: DueDateWrapperConsts.MAXIMUM_STUDENTS_TO_SHOW, MAXIMUM_SECTIONS_TO_SHOW: DueDateWrapperConsts.MAXIMUM_SECTIONS_TO_SHOW, MAXIMUM_GROUPS_TO_SHOW: DueDateWrapperConsts.MAXIMUM_GROUPS_TO_SHOW, MS_TO_DEBOUNCE_SEARCH: DueDateWrapperConsts.MS_TO_DEBOUNCE_SEARCH, // This is useful for testing to make it so the debounce is not used // during testing or any other time when that might be a problem. removeTimingSafeties(){ this.safetiesOff = true; }, // ------------------- // Lifecycle // ------------------- getInitialState() { return { userInput: "", currentlyTyping: false } }, // ------------------- // Actions // ------------------- handleFocus() { // TODO: once react supports onFocusIn, remove this stuff and just // do it on DueDates' top-level <div /> like we do for onMouseEnter OverrideStudentStore.fetchStudentsForCourse() }, handleInput(userInput) { if (this.props.disabled) return; this.setState( { userInput: userInput, currentlyTyping: true },function(){ if (this.safetiesOff) { this.fetchStudents() } else { this.safeFetchStudents() } } ) }, safeFetchStudents: _.debounce( function() { this.fetchStudents() }, DueDateWrapperConsts.MS_TO_DEBOUNCE_SEARCH ), fetchStudents(){ if( this.isMounted() ){ this.setState({currentlyTyping: false}) } if ($.trim(this.state.userInput) !== '' && this.state.userInput.length >= this.MINIMUM_SEARCH_LENGTH) { OverrideStudentStore.fetchStudentsByName($.trim(this.state.userInput)) } }, handleTokenAdd(value, option) { if (this.props.disabled) return; var token = this.findMatchingOption(value, option) this.props.handleTokenAdd(token) this.clearUserInput() }, overrideTokenAriaLabel(tokenName) { return I18n.t('Currently assigned to %{tokenName}, click to remove', {tokenName: tokenName}); }, handleTokenRemove(token) { if (this.props.disabled) return; this.props.handleTokenRemove(token) }, suppressKeys(e){ var code = e.keyCode || e.which if (code === 13) { e.preventDefault() } }, clearUserInput(){ this.setState({userInput: ""}) }, // ------------------- // Helpers // ------------------- findMatchingOption(name, option){ if(option){ // Selection was made from dropdown, find by unique attributes return _.findWhere(this.props.potentialOptions, option.props.set_props) } else { // Search for best matching name return this.sortedMatches(name)[0] } }, sortedMatches(userInput){ var optsByMatch = _.groupBy(this.props.potentialOptions, (dropdownObj) => { if (SearchHelpers.exactMatchRegex(userInput).test(dropdownObj.name)) { return "exact" } if (SearchHelpers.startOfStringRegex(userInput).test(dropdownObj.name)) { return "start" } if (SearchHelpers.substringMatchRegex(userInput).test(dropdownObj.name)) { return "substring" } }); return _.union( optsByMatch.exact, optsByMatch.start, optsByMatch.substring ); }, filteredTags() { if (this.state.userInput === '') return this.props.potentialOptions return this.sortedMatches(this.state.userInput) }, filteredTagsForType(type){ var groupedTags = this.groupByTagType(this.filteredTags()) return groupedTags && groupedTags[type] || [] }, groupByTagType(options){ return _.groupBy(options, (opt) => { if (opt["course_section_id"]) { return "course_section" } else if (opt["group_id"]) { return "group" } else if (opt["noop_id"]){ return "noop" } else { return "student" } }) }, userSearchingThisInput(){ return this.state.userInput && $.trim(this.state.userInput) !== "" }, // ------------------- // Rendering // ------------------- rowIdentifier(){ // identifying for validations return "tokenInputFor" + this.props.rowKey }, currentlySearching(){ if(this.props.allStudentsFetched || $.trim(this.state.userInput) === ''){ return false } return this.props.currentlySearching || this.state.currentlyTyping }, // ---- options ---- optionsForMenu() { var options = this.promptText() ? _.union([this.promptOption()], this.optionsForAllTypes()) : this.optionsForAllTypes() return options }, optionsForAllTypes(){ return _.union( this.conditionalReleaseOptions(), this.sectionOptions(), this.groupOptions(), this.studentOptions() ) }, studentOptions(){ return this.optionsForType("student") }, groupOptions(){ return this.optionsForType("group") }, sectionOptions(){ return this.optionsForType("course_section") }, conditionalReleaseOptions(){ if (!ENV.CONDITIONAL_RELEASE_SERVICE_ENABLED) return [] var selectable = _.contains(this.filteredTagsForType('noop'), Override.conditionalRelease) return selectable ? [this.headerOption("conditional_release", Override.conditionalRelease)] : [] }, optionsForType(optionType){ var header = this.headerOption(optionType) var options = this.selectableOptions(optionType) return _.any(options) ? _.union([header], options) : [] }, headerOption(heading, set){ var headerText = { "student": I18n.t("Student"), "course_section": I18n.t("Course Section"), "group": I18n.t("Group"), "conditional_release": I18n.t("Mastery Paths"), }[heading] const canSelect = heading === 'conditional_release' return ( <ComboboxOption isFocusable={canSelect} className="ic-tokeninput-header" value={heading} key={heading} set_props={set} > {headerText} </ComboboxOption> ) }, selectableOptions(type){ var numberToShow = { "student": this.MAXIMUM_STUDENTS_TO_SHOW, "course_section": this.MAXIMUM_SECTIONS_TO_SHOW, "group": this.MAXIMUM_GROUPS_TO_SHOW, }[type] || 0 return _.chain(this.filteredTagsForType(type)) .take(numberToShow) .map((set, index) => this.selectableOption(set, index)) .value() }, selectableOption(set, index){ var displayName = set.name || this.props.defaultSectionNamer(set.course_section_id) return <ComboboxOption key={set.key || `${displayName}-${index}`} value={set.name} set_props={set}> {displayName} </ComboboxOption> }, // ---- prompt ---- promptOption(){ return ( <ComboboxOption value={this.promptText()} key={"promptText"}> <i>{this.promptText()}</i> {this.throbber()} </ComboboxOption> ) }, promptText(){ if (this.currentlySearching()){ return I18n.t("Searching") } if(this.state.userInput.length < this.MINIMUM_SEARCH_LENGTH && !this.props.allStudentsFetched || this.hidingValidMatches()){ return I18n.t("Continue typing to find additional sections or students.") } if(_.isEmpty(this.filteredTags())){ return I18n.t("No results found") } }, throbber(){ if(this.currentlySearching() && this.userSearchingThisInput()){ return ( <div className="tokenInputThrobber"/> ) } }, hidingValidMatches(){ var allSectionTags = this.filteredTagsForType("course_section") var hidingSections = allSectionTags && allSectionTags.length > this.MAXIMUM_SECTIONS_TO_SHOW var allStudentTags = this.filteredTagsForType("student") var hidingStudents = allStudentTags && allStudentTags.length > this.MAXIMUM_STUDENTS_TO_SHOW var allGroupTags = this.filteredTagsForType("group") var hidingGroups = allGroupTags && allGroupTags.length > this.MAXIMUM_GROUPS_TO_SHOW return hidingSections || hidingStudents || hidingGroups }, renderTokenInput() { if (this.props.disabled) { return <DisabledTokenInput tokens={_.pluck(this.props.tokens, "name")} ref="DisabledTokenInput"/>; } const ariaLabel = I18n.t( 'Add students by searching by name, course section or group.' + ' After entering text, navigate results by using the down arrow key.' + ' Select a result by using the Enter key.' ); return ( <div> <div id="ic-tokeninput-description" className = "screenreader-only"> { I18n.t('Use this list to remove assigned students. Add new students with combo box after list.') } </div> <TokenInput menuContent = {this.optionsForMenu()} selected = {this.props.tokens} onFocus = {this.handleFocus} onInput = {this.handleInput} onSelect = {this.handleTokenAdd} tokenAriaFunc = {this.overrideTokenAriaLabel} onRemove = {this.handleTokenRemove} combobox-aria-label = {ariaLabel} value = {true} showListOnFocus = {!this.props.disabled} ref = "TokenInput" /> </div> ); }, // ---- render ---- render() { return ( <div className = "ic-Form-control" data-row-identifier = {this.rowIdentifier()} onKeyDown = {this.suppressKeys}> <div id = "assign-to-label" className = "ic-Label" title = 'Assign to' aria-label = 'Assign to'> {I18n.t("Assign to")} </div> {this.renderTokenInput()} </div> ) } }) export default DueDateTokenWrapper
src/Parser/Warlock/Affliction/Modules/Items/Legendaries/StretensSleeplessShackles.js
hasseboulen/WoWAnalyzer
import React from 'react'; import Analyzer from 'Parser/Core/Analyzer'; import Enemies from 'Parser/Core/Modules/Enemies'; import Combatants from 'Parser/Core/Modules/Combatants'; import calculateEffectiveDamage from 'Parser/Core/calculateEffectiveDamage'; import ITEMS from 'common/ITEMS'; import ItemDamageDone from 'Main/ItemDamageDone'; import { UNSTABLE_AFFLICTION_DEBUFF_IDS } from '../../../Constants'; const DAMAGE_BONUS_PER_TARGET = 0.04; class StretensSleeplessShackles extends Analyzer { static dependencies = { enemies: Enemies, combatants: Combatants, }; bonusDmg = 0; on_initialized() { this.active = this.combatants.selected.hasWrists(ITEMS.STRETENS_SLEEPLESS_SHACKLES.id); } on_byPlayer_damage(event) { const enemies = this.enemies.getEntities(); const numberOfEnemiesWithUA = Object.keys(enemies) .map(x => enemies[x]) .filter(enemy => UNSTABLE_AFFLICTION_DEBUFF_IDS.some(uaId => enemy.hasBuff(uaId, event.timestamp))).length; this.bonusDmg += calculateEffectiveDamage(event, numberOfEnemiesWithUA * DAMAGE_BONUS_PER_TARGET); } item() { return { item: ITEMS.STRETENS_SLEEPLESS_SHACKLES, result: <ItemDamageDone amount={this.bonusDmg} />, }; } } export default StretensSleeplessShackles;
ajax/libs/react-cookie/0.2.4/react-cookie.min.js
Sneezry/cdnjs
(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 a(o,!0);if(i)return i(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){var cookie=require("cookie");var _rawCookies={};var _cookies={};if(typeof document!=="undefined"){setRawCookie(document.cookie)}function load(name,doNotParse){if(doNotParse){return _rawCookies[name]}return _cookies[name]}function save(name,val,opt){_cookies[name]=val;_rawCookies[name]=val;if(typeof val==="object"){_rawCookies[name]=JSON.stringify(val)}if(typeof document!=="undefined"){document.cookie=cookie.serialize(name,_rawCookies[name],opt)}}function remove(name){delete _rawCookies[name];delete _cookies[name];if(typeof document!=="undefined"){document.cookie=name+"=; expires=Thu, 01 Jan 1970 00:00:01 GMT;"}}function setRawCookie(rawCookie){if(!rawCookie){return}var rawCookies=cookie.parse(rawCookie);for(var key in rawCookies){_rawCookies[key]=rawCookies[key];try{_cookies[key]=JSON.parse(rawCookies[key])}catch(e){_cookies[key]=rawCookies[key]}}}var reactCookie={load:load,save:save,remove:remove,setRawCookie:setRawCookie};if(typeof window!=="undefined"){window["reactCookie"]=reactCookie}module.exports=reactCookie},{cookie:2}],2:[function(require,module,exports){var serialize=function(name,val,opt){opt=opt||{};var enc=opt.encode||encode;var pairs=[name+"="+enc(val)];if(null!=opt.maxAge){var maxAge=opt.maxAge-0;if(isNaN(maxAge))throw new Error("maxAge should be a Number");pairs.push("Max-Age="+maxAge)}if(opt.domain)pairs.push("Domain="+opt.domain);if(opt.path)pairs.push("Path="+opt.path);if(opt.expires)pairs.push("Expires="+opt.expires.toUTCString());if(opt.httpOnly)pairs.push("HttpOnly");if(opt.secure)pairs.push("Secure");return pairs.join("; ")};var parse=function(str,opt){opt=opt||{};var obj={};var pairs=str.split(/; */);var dec=opt.decode||decode;pairs.forEach(function(pair){var eq_idx=pair.indexOf("=");if(eq_idx<0){return}var key=pair.substr(0,eq_idx).trim();var val=pair.substr(++eq_idx,pair.length).trim();if('"'==val[0]){val=val.slice(1,-1)}if(undefined==obj[key]){try{obj[key]=dec(val)}catch(e){obj[key]=val}}});return obj};var encode=encodeURIComponent;var decode=decodeURIComponent;module.exports.serialize=serialize;module.exports.parse=parse},{}]},{},[1]);
source/components/Section/index.js
everydayhero/impact-board
import React from 'react' import css from 'cxsync' import * as styles from './styles' import connectTheme from '../../lib/connectTheme' const Section = ({ theme, id, className = {}, children }) => ( <section id={id} className={css({...styles.wrapper(theme), ...className})} > {children} </section> ) export default connectTheme(Section)
app/javascript/mastodon/features/ui/components/boost_modal.js
Chronister/mastodon
import React from 'react'; import ImmutablePropTypes from 'react-immutable-proptypes'; import PropTypes from 'prop-types'; import { defineMessages, injectIntl, FormattedMessage } from 'react-intl'; import Button from '../../../components/button'; import StatusContent from '../../../components/status_content'; import Avatar from '../../../components/avatar'; import RelativeTimestamp from '../../../components/relative_timestamp'; import DisplayName from '../../../components/display_name'; import ImmutablePureComponent from 'react-immutable-pure-component'; const messages = defineMessages({ reblog: { id: 'status.reblog', defaultMessage: 'Boost' }, }); export default @injectIntl class BoostModal extends ImmutablePureComponent { static contextTypes = { router: PropTypes.object, }; static propTypes = { status: ImmutablePropTypes.map.isRequired, onReblog: PropTypes.func.isRequired, onClose: PropTypes.func.isRequired, intl: PropTypes.object.isRequired, }; componentDidMount() { this.button.focus(); } handleReblog = () => { this.props.onReblog(this.props.status); this.props.onClose(); } handleAccountClick = (e) => { if (e.button === 0 && !(e.ctrlKey || e.metaKey)) { e.preventDefault(); this.props.onClose(); this.context.router.history.push(`/accounts/${this.props.status.getIn(['account', 'id'])}`); } } setRef = (c) => { this.button = c; } render () { const { status, intl } = this.props; return ( <div className='modal-root__modal boost-modal'> <div className='boost-modal__container'> <div className='status light'> <div className='boost-modal__status-header'> <div className='boost-modal__status-time'> <a href={status.get('url')} className='status__relative-time' target='_blank' rel='noopener'><RelativeTimestamp timestamp={status.get('created_at')} /></a> </div> <a onClick={this.handleAccountClick} href={status.getIn(['account', 'url'])} className='status__display-name'> <div className='status__avatar'> <Avatar account={status.get('account')} size={48} /> </div> <DisplayName account={status.get('account')} /> </a> </div> <StatusContent status={status} /> </div> </div> <div className='boost-modal__action-bar'> <div><FormattedMessage id='boost_modal.combo' defaultMessage='You can press {combo} to skip this next time' values={{ combo: <span>Shift + <i className='fa fa-retweet' /></span> }} /></div> <Button text={intl.formatMessage(messages.reblog)} onClick={this.handleReblog} ref={this.setRef} /> </div> </div> ); } }
src/client/statics/EmptyFeed.js
busyorg/busy
import React from 'react'; import { FormattedMessage } from 'react-intl'; const EmptyFeed = () => ( <div className="text-center"> <h3> <FormattedMessage id="feed_empty" defaultMessage="Oops! This feed empty." /> </h3> </div> ); export default EmptyFeed;
packages/expo-dev-menu/vendored/react-native-reanimated/src/createAnimatedComponent.js
exponentjs/exponent
import React from 'react'; import { findNodeHandle, Platform, StyleSheet } from 'react-native'; import ReanimatedEventEmitter from './ReanimatedEventEmitter'; import AnimatedEvent from './reanimated1/core/AnimatedEvent'; import AnimatedNode from './reanimated1/core/AnimatedNode'; import AnimatedValue from './reanimated1/core/AnimatedValue'; import { createOrReusePropsNode } from './reanimated1/core/AnimatedProps'; import WorkletEventHandler from './reanimated2/WorkletEventHandler'; import setAndForwardRef from './setAndForwardRef'; import './reanimated2/layoutReanimation/LayoutAnimationRepository'; import invariant from 'invariant'; import { adaptViewConfig } from './ConfigHelper'; import { RNRenderer } from './reanimated2/platform-specific/RNRenderer'; import { makeMutable, runOnUI } from './reanimated2/core'; import { DefaultEntering, DefaultExiting, DefaultLayout, } from './reanimated2/layoutReanimation/defaultAnimations/Default'; import { isJest, isChromeDebugger } from './reanimated2/PlatformChecker'; const NODE_MAPPING = new Map(); function listener(data) { const component = NODE_MAPPING.get(data.viewTag); component && component._updateFromNative(data.props); } function dummyListener() { // empty listener we use to assign to listener properties for which animated // event is used. } function hasAnimatedNodes(value) { if (value instanceof AnimatedNode) { return true; } if (Array.isArray(value)) { return value.some((item) => hasAnimatedNodes(item)); } if (value && typeof value === 'object') { return Object.keys(value).some((key) => hasAnimatedNodes(value[key])); } return false; } function flattenArray(array) { if (!Array.isArray(array)) { return [array]; } const resultArr = []; const _flattenArray = (arr) => { arr.forEach((item) => { if (Array.isArray(item)) { _flattenArray(item); } else { resultArr.push(item); } }); }; _flattenArray(array); return resultArr; } export default function createAnimatedComponent(Component, options = {}) { invariant( typeof Component !== 'function' || (Component.prototype && Component.prototype.isReactComponent), '`createAnimatedComponent` does not support stateless functional components; ' + 'use a class component instead.' ); class AnimatedComponent extends React.Component { _invokeAnimatedPropsCallbackOnMount = false; _styles = null; _viewTag = -1; constructor(props) { super(props); this._attachProps(this.props); if (isJest()) { this.animatedStyle = { value: {} }; } this.sv = makeMutable({}); } componentWillUnmount() { this._detachPropUpdater(); this._propsAnimated && this._propsAnimated.__detach(); this._detachNativeEvents(); this._detachStyles(); this.sv = null; } componentDidMount() { if (this._invokeAnimatedPropsCallbackOnMount) { this._invokeAnimatedPropsCallbackOnMount = false; this._animatedPropsCallback(); } this._propsAnimated && this._propsAnimated.setNativeView(this._component); this._attachNativeEvents(); this._attachPropUpdater(); this._attachAnimatedStyles(); } _getEventViewRef() { // Make sure to get the scrollable node for components that implement // `ScrollResponder.Mixin`. return this._component.getScrollableNode ? this._component.getScrollableNode() : this._component; } _attachNativeEvents() { const node = this._getEventViewRef(); const viewTag = findNodeHandle(options.setNativeProps ? this : node); for (const key in this.props) { const prop = this.props[key]; if (prop instanceof AnimatedEvent) { prop.attachEvent(node, key); } else if ( prop?.current && prop.current instanceof WorkletEventHandler ) { prop.current.registerForEvents(viewTag, key); } } } _detachNativeEvents() { const node = this._getEventViewRef(); for (const key in this.props) { const prop = this.props[key]; if (prop instanceof AnimatedEvent) { prop.detachEvent(node, key); } else if ( prop?.current && prop.current instanceof WorkletEventHandler ) { prop.current.unregisterFromEvents(); } } } _detachStyles() { if (Platform.OS === 'web') { for (const style of this._styles) { if (style?.viewsRef) { style.viewsRef.remove(this); } } } else if (this._viewTag !== -1) { for (const style of this._styles) { if (style?.viewDescriptors) { style.viewDescriptors.remove(this._viewTag); } } if (this.props.animatedProps?.viewDescriptors) { this.props.animatedProps.viewDescriptors.remove(this._viewTag); } } } _reattachNativeEvents(prevProps) { const node = this._getEventViewRef(); const attached = new Set(); const nextEvts = new Set(); let viewTag; for (const key in this.props) { const prop = this.props[key]; if (prop instanceof AnimatedEvent) { nextEvts.add(prop.__nodeID); } else if ( prop?.current && prop.current instanceof WorkletEventHandler ) { if (viewTag === undefined) { viewTag = prop.current.viewTag; } } } for (const key in prevProps) { const prop = this.props[key]; if (prop instanceof AnimatedEvent) { if (!nextEvts.has(prop.__nodeID)) { // event was in prev props but not in current props, we detach prop.detachEvent(node, key); } else { // event was in prev and is still in current props attached.add(prop.__nodeID); } } else if ( prop?.current && prop.current instanceof WorkletEventHandler && prop.current.reattachNeeded ) { prop.current.unregisterFromEvents(); } } for (const key in this.props) { const prop = this.props[key]; if (prop instanceof AnimatedEvent && !attached.has(prop.__nodeID)) { // not yet attached prop.attachEvent(node, key); } else if ( prop?.current && prop.current instanceof WorkletEventHandler && prop.current.reattachNeeded ) { prop.current.registerForEvents(viewTag, key); prop.current.reattachNeeded = false; } } } // The system is best designed when setNativeProps is implemented. It is // able to avoid re-rendering and directly set the attributes that changed. // However, setNativeProps can only be implemented on native components // If you want to animate a composite component, you need to re-render it. // In this case, we have a fallback that uses forceUpdate. _animatedPropsCallback = () => { if (this._component == null) { // AnimatedProps is created in will-mount because it's used in render. // But this callback may be invoked before mount in async mode, // In which case we should defer the setNativeProps() call. // React may throw away uncommitted work in async mode, // So a deferred call won't always be invoked. this._invokeAnimatedPropsCallbackOnMount = true; } else if (typeof this._component.setNativeProps !== 'function') { this.forceUpdate(); } else { this._component.setNativeProps(this._propsAnimated.__getValue()); } }; _attachProps(nextProps) { const oldPropsAnimated = this._propsAnimated; this._propsAnimated = createOrReusePropsNode( nextProps, this._animatedPropsCallback, oldPropsAnimated ); // If prop node has been reused we don't need to call into "__detach" if (oldPropsAnimated !== this._propsAnimated) { // When you call detach, it removes the element from the parent list // of children. If it goes to 0, then the parent also detaches itself // and so on. // An optimization is to attach the new elements and THEN detach the old // ones instead of detaching and THEN attaching. // This way the intermediate state isn't to go to 0 and trigger // this expensive recursive detaching to then re-attach everything on // the very next operation. oldPropsAnimated && oldPropsAnimated.__detach(); } } _updateFromNative(props) { if (options.setNativeProps) { options.setNativeProps(this._component, props); } else { // eslint-disable-next-line no-unused-expressions this._component.setNativeProps?.(props); } } _attachPropUpdater() { const viewTag = findNodeHandle(this); NODE_MAPPING.set(viewTag, this); if (NODE_MAPPING.size === 1) { ReanimatedEventEmitter.addListener('onReanimatedPropsChange', listener); } } _attachAnimatedStyles() { const styles = flattenArray(this.props.style); this._styles = styles; let viewTag, viewName; if (Platform.OS === 'web') { viewTag = findNodeHandle(this); viewName = null; } else { // hostInstance can be null for a component that doesn't render anything (render function returns null). Example: svg Stop: https://github.com/react-native-svg/react-native-svg/blob/develop/src/elements/Stop.tsx const hostInstance = RNRenderer.findHostInstance_DEPRECATED(this); if (!hostInstance) { throw new Error( 'Cannot find host instance for this component. Maybe it renders nothing?' ); } // we can access view tag in the same way it's accessed here https://github.com/facebook/react/blob/e3f4eb7272d4ca0ee49f27577156b57eeb07cf73/packages/react-native-renderer/src/ReactFabric.js#L146 viewTag = hostInstance?._nativeTag; /** * RN uses viewConfig for components for storing different properties of the component(example: https://github.com/facebook/react-native/blob/master/Libraries/Components/ScrollView/ScrollViewViewConfig.js#L16). * The name we're looking for is in the field named uiViewClassName. */ viewName = hostInstance?.viewConfig?.uiViewClassName; // update UI props whitelist for this view if ( hostInstance && this._hasReanimated2Props(styles) && hostInstance.viewConfig ) { adaptViewConfig(hostInstance.viewConfig); } } this._viewTag = viewTag; styles.forEach((style) => { if (style?.viewDescriptors) { style.viewDescriptors.add({ tag: viewTag, name: viewName }); if (isJest()) { /** * We need to connect Jest's TestObject instance whose contains just props object * with the updateProps() function where we update the properties of the component. * We can't update props object directly because TestObject contains a copy of props - look at render function: * const props = this._filterNonAnimatedProps(this.props); */ this.animatedStyle.value = { ...this.animatedStyle.value, ...style.initial.value, }; style.animatedStyle.current = this.animatedStyle; } } }); // attach animatedProps property if (this.props.animatedProps?.viewDescriptors) { this.props.animatedProps.viewDescriptors.add({ tag: viewTag, name: viewName, }); } } _hasReanimated2Props(flattenStyles) { if (this.props.animatedProps?.viewDescriptors) { return true; } if (this.props.style) { for (const style of flattenStyles) { // eslint-disable-next-line no-prototype-builtins if (style?.hasOwnProperty('viewDescriptors')) { return true; } } } return false; } _detachPropUpdater() { const viewTag = findNodeHandle(this); NODE_MAPPING.delete(viewTag); if (NODE_MAPPING.size === 0) { ReanimatedEventEmitter.removeAllListeners('onReanimatedPropsChange'); } } componentDidUpdate(prevProps) { this._attachProps(this.props); this._reattachNativeEvents(prevProps); this._propsAnimated && this._propsAnimated.setNativeView(this._component); this._attachAnimatedStyles(); } _setComponentRef = setAndForwardRef({ getForwardedRef: () => this.props.forwardedRef, setLocalRef: (ref) => { // TODO update config const tag = findNodeHandle(ref); if ( (this.props.layout || this.props.entering || this.props.exiting) && tag != null ) { let layout = this.props.layout ? this.props.layout : DefaultLayout; let entering = this.props.entering ? this.props.entering : DefaultEntering; let exiting = this.props.exiting ? this.props.exiting : DefaultExiting; if (layout.build) { layout = layout.build(); } if (entering.build) { entering = entering.build(); } if (exiting.build) { exiting = exiting.build(); } const config = { layout, entering, exiting, sv: this.sv, }; runOnUI(() => { 'worklet'; global.LayoutAnimationRepository.registerConfig(tag, config); })(); } if (ref !== this._component) { this._component = ref; } // TODO: Delete this after React Native also deletes this deprecation helper. if (ref != null && ref.getNode == null) { ref.getNode = () => { console.warn( '%s: Calling %s on the ref of an Animated component ' + 'is no longer necessary. You can now directly use the ref ' + 'instead. This method will be removed in a future release.', ref.constructor.name ?? '<<anonymous>>', 'getNode()' ); return ref; }; } }, }); _filterNonAnimatedStyle(inputStyle) { const style = {}; for (const key in inputStyle) { const value = inputStyle[key]; if (!hasAnimatedNodes(value)) { style[key] = value; } else if (value instanceof AnimatedValue) { // if any style in animated component is set directly to the `Value` we set those styles to the first value of `Value` node in order // to avoid flash of default styles when `Value` is being asynchrounously sent via bridge and initialized in the native side. style[key] = value._startingValue; } } return style; } _filterNonAnimatedProps(inputProps) { const props = {}; for (const key in inputProps) { const value = inputProps[key]; if (key === 'style') { const styles = flattenArray(value); const processedStyle = styles.map((style) => { if (style && style.viewDescriptors) { // this is how we recognize styles returned by useAnimatedStyle style.viewsRef.add(this); return style.initial.value; } else { return style; } }); props[key] = this._filterNonAnimatedStyle( StyleSheet.flatten(processedStyle) ); } else if (key === 'animatedProps') { Object.keys(value.initial.value).forEach((key) => { props[key] = value.initial.value[key]; value.viewsRef.add(this); }); } else if (value instanceof AnimatedEvent) { // we cannot filter out event listeners completely as some components // rely on having a callback registered in order to generate events // alltogether. Therefore we provide a dummy callback here to allow // native event dispatcher to hijack events. props[key] = dummyListener; } else if ( value?.current && value.current instanceof WorkletEventHandler ) { if (value.current.eventNames.length > 0) { value.current.eventNames.forEach((eventName) => { props[eventName] = value.current.listeners ? value.current.listeners[eventName] : dummyListener; }); } else { props[key] = dummyListener; } } else if (!(value instanceof AnimatedNode)) { if (key !== 'onGestureHandlerStateChange' || !isChromeDebugger()) { props[key] = value; } } else if (value instanceof AnimatedValue) { // if any prop in animated component is set directly to the `Value` we set those props to the first value of `Value` node in order // to avoid default values for a short moment when `Value` is being asynchrounously sent via bridge and initialized in the native side. props[key] = value._startingValue; } } return props; } render() { const props = this._filterNonAnimatedProps(this.props); if (isJest()) { props.animatedStyle = this.animatedStyle; } const platformProps = Platform.select({ web: {}, default: { collapsable: false }, }); return ( <Component {...props} ref={this._setComponentRef} {...platformProps} /> ); } } AnimatedComponent.displayName = `AnimatedComponent(${ Component.displayName || Component.name || 'Component' })`; return React.forwardRef(function AnimatedComponentWrapper(props, ref) { return ( <AnimatedComponent {...props} {...(ref == null ? null : { forwardedRef: ref })} /> ); }); }
src/components/Form/TextField.js
GovWizely/trade-event-search-app
import React from 'react'; import PropTypes from 'prop-types'; import './TextField.scss'; const TextField = ({ input, label = '', placeholder = null }) => ( <div className="explorer__form__group"> <div className="explorer__form__label-container"> <label htmlFor={input.name}>{label}</label> </div> <div className="explorer__form__input-container"> <input id={input.name} type="text" className="explorer__form__text" placeholder={placeholder} {...input} /> </div> </div> ); TextField.propTypes = { input: PropTypes.object.isRequired, label: PropTypes.string, placeholder: PropTypes.string, }; export default TextField;
ajax/libs/jquery/1.11.0/jquery.min.js
Ranks/cdnjs
/*! jQuery v1.11.0 | (c) 2005, 2014 jQuery Foundation, Inc. | jquery.org/license */ !function(a,b){"object"==typeof module&&"object"==typeof module.exports?module.exports=a.document?b(a,!0):function(a){if(!a.document)throw new Error("jQuery requires a window with a document");return b(a)}:b(a)}("undefined"!=typeof window?window:this,function(a,b){var c=[],d=c.slice,e=c.concat,f=c.push,g=c.indexOf,h={},i=h.toString,j=h.hasOwnProperty,k="".trim,l={},m="1.11.0",n=function(a,b){return new n.fn.init(a,b)},o=/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,p=/^-ms-/,q=/-([\da-z])/gi,r=function(a,b){return b.toUpperCase()};n.fn=n.prototype={jquery:m,constructor:n,selector:"",length:0,toArray:function(){return d.call(this)},get:function(a){return null!=a?0>a?this[a+this.length]:this[a]:d.call(this)},pushStack:function(a){var b=n.merge(this.constructor(),a);return b.prevObject=this,b.context=this.context,b},each:function(a,b){return n.each(this,a,b)},map:function(a){return this.pushStack(n.map(this,function(b,c){return a.call(b,c,b)}))},slice:function(){return this.pushStack(d.apply(this,arguments))},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},eq:function(a){var b=this.length,c=+a+(0>a?b:0);return this.pushStack(c>=0&&b>c?[this[c]]:[])},end:function(){return this.prevObject||this.constructor(null)},push:f,sort:c.sort,splice:c.splice},n.extend=n.fn.extend=function(){var a,b,c,d,e,f,g=arguments[0]||{},h=1,i=arguments.length,j=!1;for("boolean"==typeof g&&(j=g,g=arguments[h]||{},h++),"object"==typeof g||n.isFunction(g)||(g={}),h===i&&(g=this,h--);i>h;h++)if(null!=(e=arguments[h]))for(d in e)a=g[d],c=e[d],g!==c&&(j&&c&&(n.isPlainObject(c)||(b=n.isArray(c)))?(b?(b=!1,f=a&&n.isArray(a)?a:[]):f=a&&n.isPlainObject(a)?a:{},g[d]=n.extend(j,f,c)):void 0!==c&&(g[d]=c));return g},n.extend({expando:"jQuery"+(m+Math.random()).replace(/\D/g,""),isReady:!0,error:function(a){throw new Error(a)},noop:function(){},isFunction:function(a){return"function"===n.type(a)},isArray:Array.isArray||function(a){return"array"===n.type(a)},isWindow:function(a){return null!=a&&a==a.window},isNumeric:function(a){return a-parseFloat(a)>=0},isEmptyObject:function(a){var b;for(b in a)return!1;return!0},isPlainObject:function(a){var b;if(!a||"object"!==n.type(a)||a.nodeType||n.isWindow(a))return!1;try{if(a.constructor&&!j.call(a,"constructor")&&!j.call(a.constructor.prototype,"isPrototypeOf"))return!1}catch(c){return!1}if(l.ownLast)for(b in a)return j.call(a,b);for(b in a);return void 0===b||j.call(a,b)},type:function(a){return null==a?a+"":"object"==typeof a||"function"==typeof a?h[i.call(a)]||"object":typeof a},globalEval:function(b){b&&n.trim(b)&&(a.execScript||function(b){a.eval.call(a,b)})(b)},camelCase:function(a){return a.replace(p,"ms-").replace(q,r)},nodeName:function(a,b){return a.nodeName&&a.nodeName.toLowerCase()===b.toLowerCase()},each:function(a,b,c){var d,e=0,f=a.length,g=s(a);if(c){if(g){for(;f>e;e++)if(d=b.apply(a[e],c),d===!1)break}else for(e in a)if(d=b.apply(a[e],c),d===!1)break}else if(g){for(;f>e;e++)if(d=b.call(a[e],e,a[e]),d===!1)break}else for(e in a)if(d=b.call(a[e],e,a[e]),d===!1)break;return a},trim:k&&!k.call("\ufeff\xa0")?function(a){return null==a?"":k.call(a)}:function(a){return null==a?"":(a+"").replace(o,"")},makeArray:function(a,b){var c=b||[];return null!=a&&(s(Object(a))?n.merge(c,"string"==typeof a?[a]:a):f.call(c,a)),c},inArray:function(a,b,c){var d;if(b){if(g)return g.call(b,a,c);for(d=b.length,c=c?0>c?Math.max(0,d+c):c:0;d>c;c++)if(c in b&&b[c]===a)return c}return-1},merge:function(a,b){var c=+b.length,d=0,e=a.length;while(c>d)a[e++]=b[d++];if(c!==c)while(void 0!==b[d])a[e++]=b[d++];return a.length=e,a},grep:function(a,b,c){for(var d,e=[],f=0,g=a.length,h=!c;g>f;f++)d=!b(a[f],f),d!==h&&e.push(a[f]);return e},map:function(a,b,c){var d,f=0,g=a.length,h=s(a),i=[];if(h)for(;g>f;f++)d=b(a[f],f,c),null!=d&&i.push(d);else for(f in a)d=b(a[f],f,c),null!=d&&i.push(d);return e.apply([],i)},guid:1,proxy:function(a,b){var c,e,f;return"string"==typeof b&&(f=a[b],b=a,a=f),n.isFunction(a)?(c=d.call(arguments,2),e=function(){return a.apply(b||this,c.concat(d.call(arguments)))},e.guid=a.guid=a.guid||n.guid++,e):void 0},now:function(){return+new Date},support:l}),n.each("Boolean Number String Function Array Date RegExp Object Error".split(" "),function(a,b){h["[object "+b+"]"]=b.toLowerCase()});function s(a){var b=a.length,c=n.type(a);return"function"===c||n.isWindow(a)?!1:1===a.nodeType&&b?!0:"array"===c||0===b||"number"==typeof b&&b>0&&b-1 in a}var t=function(a){var b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s="sizzle"+-new Date,t=a.document,u=0,v=0,w=eb(),x=eb(),y=eb(),z=function(a,b){return a===b&&(j=!0),0},A="undefined",B=1<<31,C={}.hasOwnProperty,D=[],E=D.pop,F=D.push,G=D.push,H=D.slice,I=D.indexOf||function(a){for(var b=0,c=this.length;c>b;b++)if(this[b]===a)return b;return-1},J="checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|ismap|loop|multiple|open|readonly|required|scoped",K="[\\x20\\t\\r\\n\\f]",L="(?:\\\\.|[\\w-]|[^\\x00-\\xa0])+",M=L.replace("w","w#"),N="\\["+K+"*("+L+")"+K+"*(?:([*^$|!~]?=)"+K+"*(?:(['\"])((?:\\\\.|[^\\\\])*?)\\3|("+M+")|)|)"+K+"*\\]",O=":("+L+")(?:\\(((['\"])((?:\\\\.|[^\\\\])*?)\\3|((?:\\\\.|[^\\\\()[\\]]|"+N.replace(3,8)+")*)|.*)\\)|)",P=new RegExp("^"+K+"+|((?:^|[^\\\\])(?:\\\\.)*)"+K+"+$","g"),Q=new RegExp("^"+K+"*,"+K+"*"),R=new RegExp("^"+K+"*([>+~]|"+K+")"+K+"*"),S=new RegExp("="+K+"*([^\\]'\"]*?)"+K+"*\\]","g"),T=new RegExp(O),U=new RegExp("^"+M+"$"),V={ID:new RegExp("^#("+L+")"),CLASS:new RegExp("^\\.("+L+")"),TAG:new RegExp("^("+L.replace("w","w*")+")"),ATTR:new RegExp("^"+N),PSEUDO:new RegExp("^"+O),CHILD:new RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\("+K+"*(even|odd|(([+-]|)(\\d*)n|)"+K+"*(?:([+-]|)"+K+"*(\\d+)|))"+K+"*\\)|)","i"),bool:new RegExp("^(?:"+J+")$","i"),needsContext:new RegExp("^"+K+"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\("+K+"*((?:-\\d)?\\d*)"+K+"*\\)|)(?=[^-]|$)","i")},W=/^(?:input|select|textarea|button)$/i,X=/^h\d$/i,Y=/^[^{]+\{\s*\[native \w/,Z=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,$=/[+~]/,_=/'|\\/g,ab=new RegExp("\\\\([\\da-f]{1,6}"+K+"?|("+K+")|.)","ig"),bb=function(a,b,c){var d="0x"+b-65536;return d!==d||c?b:0>d?String.fromCharCode(d+65536):String.fromCharCode(d>>10|55296,1023&d|56320)};try{G.apply(D=H.call(t.childNodes),t.childNodes),D[t.childNodes.length].nodeType}catch(cb){G={apply:D.length?function(a,b){F.apply(a,H.call(b))}:function(a,b){var c=a.length,d=0;while(a[c++]=b[d++]);a.length=c-1}}}function db(a,b,d,e){var f,g,h,i,j,m,p,q,u,v;if((b?b.ownerDocument||b:t)!==l&&k(b),b=b||l,d=d||[],!a||"string"!=typeof a)return d;if(1!==(i=b.nodeType)&&9!==i)return[];if(n&&!e){if(f=Z.exec(a))if(h=f[1]){if(9===i){if(g=b.getElementById(h),!g||!g.parentNode)return d;if(g.id===h)return d.push(g),d}else if(b.ownerDocument&&(g=b.ownerDocument.getElementById(h))&&r(b,g)&&g.id===h)return d.push(g),d}else{if(f[2])return G.apply(d,b.getElementsByTagName(a)),d;if((h=f[3])&&c.getElementsByClassName&&b.getElementsByClassName)return G.apply(d,b.getElementsByClassName(h)),d}if(c.qsa&&(!o||!o.test(a))){if(q=p=s,u=b,v=9===i&&a,1===i&&"object"!==b.nodeName.toLowerCase()){m=ob(a),(p=b.getAttribute("id"))?q=p.replace(_,"\\$&"):b.setAttribute("id",q),q="[id='"+q+"'] ",j=m.length;while(j--)m[j]=q+pb(m[j]);u=$.test(a)&&mb(b.parentNode)||b,v=m.join(",")}if(v)try{return G.apply(d,u.querySelectorAll(v)),d}catch(w){}finally{p||b.removeAttribute("id")}}}return xb(a.replace(P,"$1"),b,d,e)}function eb(){var a=[];function b(c,e){return a.push(c+" ")>d.cacheLength&&delete b[a.shift()],b[c+" "]=e}return b}function fb(a){return a[s]=!0,a}function gb(a){var b=l.createElement("div");try{return!!a(b)}catch(c){return!1}finally{b.parentNode&&b.parentNode.removeChild(b),b=null}}function hb(a,b){var c=a.split("|"),e=a.length;while(e--)d.attrHandle[c[e]]=b}function ib(a,b){var c=b&&a,d=c&&1===a.nodeType&&1===b.nodeType&&(~b.sourceIndex||B)-(~a.sourceIndex||B);if(d)return d;if(c)while(c=c.nextSibling)if(c===b)return-1;return a?1:-1}function jb(a){return function(b){var c=b.nodeName.toLowerCase();return"input"===c&&b.type===a}}function kb(a){return function(b){var c=b.nodeName.toLowerCase();return("input"===c||"button"===c)&&b.type===a}}function lb(a){return fb(function(b){return b=+b,fb(function(c,d){var e,f=a([],c.length,b),g=f.length;while(g--)c[e=f[g]]&&(c[e]=!(d[e]=c[e]))})})}function mb(a){return a&&typeof a.getElementsByTagName!==A&&a}c=db.support={},f=db.isXML=function(a){var b=a&&(a.ownerDocument||a).documentElement;return b?"HTML"!==b.nodeName:!1},k=db.setDocument=function(a){var b,e=a?a.ownerDocument||a:t,g=e.defaultView;return e!==l&&9===e.nodeType&&e.documentElement?(l=e,m=e.documentElement,n=!f(e),g&&g!==g.top&&(g.addEventListener?g.addEventListener("unload",function(){k()},!1):g.attachEvent&&g.attachEvent("onunload",function(){k()})),c.attributes=gb(function(a){return a.className="i",!a.getAttribute("className")}),c.getElementsByTagName=gb(function(a){return a.appendChild(e.createComment("")),!a.getElementsByTagName("*").length}),c.getElementsByClassName=Y.test(e.getElementsByClassName)&&gb(function(a){return a.innerHTML="<div class='a'></div><div class='a i'></div>",a.firstChild.className="i",2===a.getElementsByClassName("i").length}),c.getById=gb(function(a){return m.appendChild(a).id=s,!e.getElementsByName||!e.getElementsByName(s).length}),c.getById?(d.find.ID=function(a,b){if(typeof b.getElementById!==A&&n){var c=b.getElementById(a);return c&&c.parentNode?[c]:[]}},d.filter.ID=function(a){var b=a.replace(ab,bb);return function(a){return a.getAttribute("id")===b}}):(delete d.find.ID,d.filter.ID=function(a){var b=a.replace(ab,bb);return function(a){var c=typeof a.getAttributeNode!==A&&a.getAttributeNode("id");return c&&c.value===b}}),d.find.TAG=c.getElementsByTagName?function(a,b){return typeof b.getElementsByTagName!==A?b.getElementsByTagName(a):void 0}:function(a,b){var c,d=[],e=0,f=b.getElementsByTagName(a);if("*"===a){while(c=f[e++])1===c.nodeType&&d.push(c);return d}return f},d.find.CLASS=c.getElementsByClassName&&function(a,b){return typeof b.getElementsByClassName!==A&&n?b.getElementsByClassName(a):void 0},p=[],o=[],(c.qsa=Y.test(e.querySelectorAll))&&(gb(function(a){a.innerHTML="<select t=''><option selected=''></option></select>",a.querySelectorAll("[t^='']").length&&o.push("[*^$]="+K+"*(?:''|\"\")"),a.querySelectorAll("[selected]").length||o.push("\\["+K+"*(?:value|"+J+")"),a.querySelectorAll(":checked").length||o.push(":checked")}),gb(function(a){var b=e.createElement("input");b.setAttribute("type","hidden"),a.appendChild(b).setAttribute("name","D"),a.querySelectorAll("[name=d]").length&&o.push("name"+K+"*[*^$|!~]?="),a.querySelectorAll(":enabled").length||o.push(":enabled",":disabled"),a.querySelectorAll("*,:x"),o.push(",.*:")})),(c.matchesSelector=Y.test(q=m.webkitMatchesSelector||m.mozMatchesSelector||m.oMatchesSelector||m.msMatchesSelector))&&gb(function(a){c.disconnectedMatch=q.call(a,"div"),q.call(a,"[s!='']:x"),p.push("!=",O)}),o=o.length&&new RegExp(o.join("|")),p=p.length&&new RegExp(p.join("|")),b=Y.test(m.compareDocumentPosition),r=b||Y.test(m.contains)?function(a,b){var c=9===a.nodeType?a.documentElement:a,d=b&&b.parentNode;return a===d||!(!d||1!==d.nodeType||!(c.contains?c.contains(d):a.compareDocumentPosition&&16&a.compareDocumentPosition(d)))}:function(a,b){if(b)while(b=b.parentNode)if(b===a)return!0;return!1},z=b?function(a,b){if(a===b)return j=!0,0;var d=!a.compareDocumentPosition-!b.compareDocumentPosition;return d?d:(d=(a.ownerDocument||a)===(b.ownerDocument||b)?a.compareDocumentPosition(b):1,1&d||!c.sortDetached&&b.compareDocumentPosition(a)===d?a===e||a.ownerDocument===t&&r(t,a)?-1:b===e||b.ownerDocument===t&&r(t,b)?1:i?I.call(i,a)-I.call(i,b):0:4&d?-1:1)}:function(a,b){if(a===b)return j=!0,0;var c,d=0,f=a.parentNode,g=b.parentNode,h=[a],k=[b];if(!f||!g)return a===e?-1:b===e?1:f?-1:g?1:i?I.call(i,a)-I.call(i,b):0;if(f===g)return ib(a,b);c=a;while(c=c.parentNode)h.unshift(c);c=b;while(c=c.parentNode)k.unshift(c);while(h[d]===k[d])d++;return d?ib(h[d],k[d]):h[d]===t?-1:k[d]===t?1:0},e):l},db.matches=function(a,b){return db(a,null,null,b)},db.matchesSelector=function(a,b){if((a.ownerDocument||a)!==l&&k(a),b=b.replace(S,"='$1']"),!(!c.matchesSelector||!n||p&&p.test(b)||o&&o.test(b)))try{var d=q.call(a,b);if(d||c.disconnectedMatch||a.document&&11!==a.document.nodeType)return d}catch(e){}return db(b,l,null,[a]).length>0},db.contains=function(a,b){return(a.ownerDocument||a)!==l&&k(a),r(a,b)},db.attr=function(a,b){(a.ownerDocument||a)!==l&&k(a);var e=d.attrHandle[b.toLowerCase()],f=e&&C.call(d.attrHandle,b.toLowerCase())?e(a,b,!n):void 0;return void 0!==f?f:c.attributes||!n?a.getAttribute(b):(f=a.getAttributeNode(b))&&f.specified?f.value:null},db.error=function(a){throw new Error("Syntax error, unrecognized expression: "+a)},db.uniqueSort=function(a){var b,d=[],e=0,f=0;if(j=!c.detectDuplicates,i=!c.sortStable&&a.slice(0),a.sort(z),j){while(b=a[f++])b===a[f]&&(e=d.push(f));while(e--)a.splice(d[e],1)}return i=null,a},e=db.getText=function(a){var b,c="",d=0,f=a.nodeType;if(f){if(1===f||9===f||11===f){if("string"==typeof a.textContent)return a.textContent;for(a=a.firstChild;a;a=a.nextSibling)c+=e(a)}else if(3===f||4===f)return a.nodeValue}else while(b=a[d++])c+=e(b);return c},d=db.selectors={cacheLength:50,createPseudo:fb,match:V,attrHandle:{},find:{},relative:{">":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(a){return a[1]=a[1].replace(ab,bb),a[3]=(a[4]||a[5]||"").replace(ab,bb),"~="===a[2]&&(a[3]=" "+a[3]+" "),a.slice(0,4)},CHILD:function(a){return a[1]=a[1].toLowerCase(),"nth"===a[1].slice(0,3)?(a[3]||db.error(a[0]),a[4]=+(a[4]?a[5]+(a[6]||1):2*("even"===a[3]||"odd"===a[3])),a[5]=+(a[7]+a[8]||"odd"===a[3])):a[3]&&db.error(a[0]),a},PSEUDO:function(a){var b,c=!a[5]&&a[2];return V.CHILD.test(a[0])?null:(a[3]&&void 0!==a[4]?a[2]=a[4]:c&&T.test(c)&&(b=ob(c,!0))&&(b=c.indexOf(")",c.length-b)-c.length)&&(a[0]=a[0].slice(0,b),a[2]=c.slice(0,b)),a.slice(0,3))}},filter:{TAG:function(a){var b=a.replace(ab,bb).toLowerCase();return"*"===a?function(){return!0}:function(a){return a.nodeName&&a.nodeName.toLowerCase()===b}},CLASS:function(a){var b=w[a+" "];return b||(b=new RegExp("(^|"+K+")"+a+"("+K+"|$)"))&&w(a,function(a){return b.test("string"==typeof a.className&&a.className||typeof a.getAttribute!==A&&a.getAttribute("class")||"")})},ATTR:function(a,b,c){return function(d){var e=db.attr(d,a);return null==e?"!="===b:b?(e+="","="===b?e===c:"!="===b?e!==c:"^="===b?c&&0===e.indexOf(c):"*="===b?c&&e.indexOf(c)>-1:"$="===b?c&&e.slice(-c.length)===c:"~="===b?(" "+e+" ").indexOf(c)>-1:"|="===b?e===c||e.slice(0,c.length+1)===c+"-":!1):!0}},CHILD:function(a,b,c,d,e){var f="nth"!==a.slice(0,3),g="last"!==a.slice(-4),h="of-type"===b;return 1===d&&0===e?function(a){return!!a.parentNode}:function(b,c,i){var j,k,l,m,n,o,p=f!==g?"nextSibling":"previousSibling",q=b.parentNode,r=h&&b.nodeName.toLowerCase(),t=!i&&!h;if(q){if(f){while(p){l=b;while(l=l[p])if(h?l.nodeName.toLowerCase()===r:1===l.nodeType)return!1;o=p="only"===a&&!o&&"nextSibling"}return!0}if(o=[g?q.firstChild:q.lastChild],g&&t){k=q[s]||(q[s]={}),j=k[a]||[],n=j[0]===u&&j[1],m=j[0]===u&&j[2],l=n&&q.childNodes[n];while(l=++n&&l&&l[p]||(m=n=0)||o.pop())if(1===l.nodeType&&++m&&l===b){k[a]=[u,n,m];break}}else if(t&&(j=(b[s]||(b[s]={}))[a])&&j[0]===u)m=j[1];else while(l=++n&&l&&l[p]||(m=n=0)||o.pop())if((h?l.nodeName.toLowerCase()===r:1===l.nodeType)&&++m&&(t&&((l[s]||(l[s]={}))[a]=[u,m]),l===b))break;return m-=e,m===d||m%d===0&&m/d>=0}}},PSEUDO:function(a,b){var c,e=d.pseudos[a]||d.setFilters[a.toLowerCase()]||db.error("unsupported pseudo: "+a);return e[s]?e(b):e.length>1?(c=[a,a,"",b],d.setFilters.hasOwnProperty(a.toLowerCase())?fb(function(a,c){var d,f=e(a,b),g=f.length;while(g--)d=I.call(a,f[g]),a[d]=!(c[d]=f[g])}):function(a){return e(a,0,c)}):e}},pseudos:{not:fb(function(a){var b=[],c=[],d=g(a.replace(P,"$1"));return d[s]?fb(function(a,b,c,e){var f,g=d(a,null,e,[]),h=a.length;while(h--)(f=g[h])&&(a[h]=!(b[h]=f))}):function(a,e,f){return b[0]=a,d(b,null,f,c),!c.pop()}}),has:fb(function(a){return function(b){return db(a,b).length>0}}),contains:fb(function(a){return function(b){return(b.textContent||b.innerText||e(b)).indexOf(a)>-1}}),lang:fb(function(a){return U.test(a||"")||db.error("unsupported lang: "+a),a=a.replace(ab,bb).toLowerCase(),function(b){var c;do if(c=n?b.lang:b.getAttribute("xml:lang")||b.getAttribute("lang"))return c=c.toLowerCase(),c===a||0===c.indexOf(a+"-");while((b=b.parentNode)&&1===b.nodeType);return!1}}),target:function(b){var c=a.location&&a.location.hash;return c&&c.slice(1)===b.id},root:function(a){return a===m},focus:function(a){return a===l.activeElement&&(!l.hasFocus||l.hasFocus())&&!!(a.type||a.href||~a.tabIndex)},enabled:function(a){return a.disabled===!1},disabled:function(a){return a.disabled===!0},checked:function(a){var b=a.nodeName.toLowerCase();return"input"===b&&!!a.checked||"option"===b&&!!a.selected},selected:function(a){return a.parentNode&&a.parentNode.selectedIndex,a.selected===!0},empty:function(a){for(a=a.firstChild;a;a=a.nextSibling)if(a.nodeType<6)return!1;return!0},parent:function(a){return!d.pseudos.empty(a)},header:function(a){return X.test(a.nodeName)},input:function(a){return W.test(a.nodeName)},button:function(a){var b=a.nodeName.toLowerCase();return"input"===b&&"button"===a.type||"button"===b},text:function(a){var b;return"input"===a.nodeName.toLowerCase()&&"text"===a.type&&(null==(b=a.getAttribute("type"))||"text"===b.toLowerCase())},first:lb(function(){return[0]}),last:lb(function(a,b){return[b-1]}),eq:lb(function(a,b,c){return[0>c?c+b:c]}),even:lb(function(a,b){for(var c=0;b>c;c+=2)a.push(c);return a}),odd:lb(function(a,b){for(var c=1;b>c;c+=2)a.push(c);return a}),lt:lb(function(a,b,c){for(var d=0>c?c+b:c;--d>=0;)a.push(d);return a}),gt:lb(function(a,b,c){for(var d=0>c?c+b:c;++d<b;)a.push(d);return a})}},d.pseudos.nth=d.pseudos.eq;for(b in{radio:!0,checkbox:!0,file:!0,password:!0,image:!0})d.pseudos[b]=jb(b);for(b in{submit:!0,reset:!0})d.pseudos[b]=kb(b);function nb(){}nb.prototype=d.filters=d.pseudos,d.setFilters=new nb;function ob(a,b){var c,e,f,g,h,i,j,k=x[a+" "];if(k)return b?0:k.slice(0);h=a,i=[],j=d.preFilter;while(h){(!c||(e=Q.exec(h)))&&(e&&(h=h.slice(e[0].length)||h),i.push(f=[])),c=!1,(e=R.exec(h))&&(c=e.shift(),f.push({value:c,type:e[0].replace(P," ")}),h=h.slice(c.length));for(g in d.filter)!(e=V[g].exec(h))||j[g]&&!(e=j[g](e))||(c=e.shift(),f.push({value:c,type:g,matches:e}),h=h.slice(c.length));if(!c)break}return b?h.length:h?db.error(a):x(a,i).slice(0)}function pb(a){for(var b=0,c=a.length,d="";c>b;b++)d+=a[b].value;return d}function qb(a,b,c){var d=b.dir,e=c&&"parentNode"===d,f=v++;return b.first?function(b,c,f){while(b=b[d])if(1===b.nodeType||e)return a(b,c,f)}:function(b,c,g){var h,i,j=[u,f];if(g){while(b=b[d])if((1===b.nodeType||e)&&a(b,c,g))return!0}else while(b=b[d])if(1===b.nodeType||e){if(i=b[s]||(b[s]={}),(h=i[d])&&h[0]===u&&h[1]===f)return j[2]=h[2];if(i[d]=j,j[2]=a(b,c,g))return!0}}}function rb(a){return a.length>1?function(b,c,d){var e=a.length;while(e--)if(!a[e](b,c,d))return!1;return!0}:a[0]}function sb(a,b,c,d,e){for(var f,g=[],h=0,i=a.length,j=null!=b;i>h;h++)(f=a[h])&&(!c||c(f,d,e))&&(g.push(f),j&&b.push(h));return g}function tb(a,b,c,d,e,f){return d&&!d[s]&&(d=tb(d)),e&&!e[s]&&(e=tb(e,f)),fb(function(f,g,h,i){var j,k,l,m=[],n=[],o=g.length,p=f||wb(b||"*",h.nodeType?[h]:h,[]),q=!a||!f&&b?p:sb(p,m,a,h,i),r=c?e||(f?a:o||d)?[]:g:q;if(c&&c(q,r,h,i),d){j=sb(r,n),d(j,[],h,i),k=j.length;while(k--)(l=j[k])&&(r[n[k]]=!(q[n[k]]=l))}if(f){if(e||a){if(e){j=[],k=r.length;while(k--)(l=r[k])&&j.push(q[k]=l);e(null,r=[],j,i)}k=r.length;while(k--)(l=r[k])&&(j=e?I.call(f,l):m[k])>-1&&(f[j]=!(g[j]=l))}}else r=sb(r===g?r.splice(o,r.length):r),e?e(null,g,r,i):G.apply(g,r)})}function ub(a){for(var b,c,e,f=a.length,g=d.relative[a[0].type],i=g||d.relative[" "],j=g?1:0,k=qb(function(a){return a===b},i,!0),l=qb(function(a){return I.call(b,a)>-1},i,!0),m=[function(a,c,d){return!g&&(d||c!==h)||((b=c).nodeType?k(a,c,d):l(a,c,d))}];f>j;j++)if(c=d.relative[a[j].type])m=[qb(rb(m),c)];else{if(c=d.filter[a[j].type].apply(null,a[j].matches),c[s]){for(e=++j;f>e;e++)if(d.relative[a[e].type])break;return tb(j>1&&rb(m),j>1&&pb(a.slice(0,j-1).concat({value:" "===a[j-2].type?"*":""})).replace(P,"$1"),c,e>j&&ub(a.slice(j,e)),f>e&&ub(a=a.slice(e)),f>e&&pb(a))}m.push(c)}return rb(m)}function vb(a,b){var c=b.length>0,e=a.length>0,f=function(f,g,i,j,k){var m,n,o,p=0,q="0",r=f&&[],s=[],t=h,v=f||e&&d.find.TAG("*",k),w=u+=null==t?1:Math.random()||.1,x=v.length;for(k&&(h=g!==l&&g);q!==x&&null!=(m=v[q]);q++){if(e&&m){n=0;while(o=a[n++])if(o(m,g,i)){j.push(m);break}k&&(u=w)}c&&((m=!o&&m)&&p--,f&&r.push(m))}if(p+=q,c&&q!==p){n=0;while(o=b[n++])o(r,s,g,i);if(f){if(p>0)while(q--)r[q]||s[q]||(s[q]=E.call(j));s=sb(s)}G.apply(j,s),k&&!f&&s.length>0&&p+b.length>1&&db.uniqueSort(j)}return k&&(u=w,h=t),r};return c?fb(f):f}g=db.compile=function(a,b){var c,d=[],e=[],f=y[a+" "];if(!f){b||(b=ob(a)),c=b.length;while(c--)f=ub(b[c]),f[s]?d.push(f):e.push(f);f=y(a,vb(e,d))}return f};function wb(a,b,c){for(var d=0,e=b.length;e>d;d++)db(a,b[d],c);return c}function xb(a,b,e,f){var h,i,j,k,l,m=ob(a);if(!f&&1===m.length){if(i=m[0]=m[0].slice(0),i.length>2&&"ID"===(j=i[0]).type&&c.getById&&9===b.nodeType&&n&&d.relative[i[1].type]){if(b=(d.find.ID(j.matches[0].replace(ab,bb),b)||[])[0],!b)return e;a=a.slice(i.shift().value.length)}h=V.needsContext.test(a)?0:i.length;while(h--){if(j=i[h],d.relative[k=j.type])break;if((l=d.find[k])&&(f=l(j.matches[0].replace(ab,bb),$.test(i[0].type)&&mb(b.parentNode)||b))){if(i.splice(h,1),a=f.length&&pb(i),!a)return G.apply(e,f),e;break}}}return g(a,m)(f,b,!n,e,$.test(a)&&mb(b.parentNode)||b),e}return c.sortStable=s.split("").sort(z).join("")===s,c.detectDuplicates=!!j,k(),c.sortDetached=gb(function(a){return 1&a.compareDocumentPosition(l.createElement("div"))}),gb(function(a){return a.innerHTML="<a href='#'></a>","#"===a.firstChild.getAttribute("href")})||hb("type|href|height|width",function(a,b,c){return c?void 0:a.getAttribute(b,"type"===b.toLowerCase()?1:2)}),c.attributes&&gb(function(a){return a.innerHTML="<input/>",a.firstChild.setAttribute("value",""),""===a.firstChild.getAttribute("value")})||hb("value",function(a,b,c){return c||"input"!==a.nodeName.toLowerCase()?void 0:a.defaultValue}),gb(function(a){return null==a.getAttribute("disabled")})||hb(J,function(a,b,c){var d;return c?void 0:a[b]===!0?b.toLowerCase():(d=a.getAttributeNode(b))&&d.specified?d.value:null}),db}(a);n.find=t,n.expr=t.selectors,n.expr[":"]=n.expr.pseudos,n.unique=t.uniqueSort,n.text=t.getText,n.isXMLDoc=t.isXML,n.contains=t.contains;var u=n.expr.match.needsContext,v=/^<(\w+)\s*\/?>(?:<\/\1>|)$/,w=/^.[^:#\[\.,]*$/;function x(a,b,c){if(n.isFunction(b))return n.grep(a,function(a,d){return!!b.call(a,d,a)!==c});if(b.nodeType)return n.grep(a,function(a){return a===b!==c});if("string"==typeof b){if(w.test(b))return n.filter(b,a,c);b=n.filter(b,a)}return n.grep(a,function(a){return n.inArray(a,b)>=0!==c})}n.filter=function(a,b,c){var d=b[0];return c&&(a=":not("+a+")"),1===b.length&&1===d.nodeType?n.find.matchesSelector(d,a)?[d]:[]:n.find.matches(a,n.grep(b,function(a){return 1===a.nodeType}))},n.fn.extend({find:function(a){var b,c=[],d=this,e=d.length;if("string"!=typeof a)return this.pushStack(n(a).filter(function(){for(b=0;e>b;b++)if(n.contains(d[b],this))return!0}));for(b=0;e>b;b++)n.find(a,d[b],c);return c=this.pushStack(e>1?n.unique(c):c),c.selector=this.selector?this.selector+" "+a:a,c},filter:function(a){return this.pushStack(x(this,a||[],!1))},not:function(a){return this.pushStack(x(this,a||[],!0))},is:function(a){return!!x(this,"string"==typeof a&&u.test(a)?n(a):a||[],!1).length}});var y,z=a.document,A=/^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]*))$/,B=n.fn.init=function(a,b){var c,d;if(!a)return this;if("string"==typeof a){if(c="<"===a.charAt(0)&&">"===a.charAt(a.length-1)&&a.length>=3?[null,a,null]:A.exec(a),!c||!c[1]&&b)return!b||b.jquery?(b||y).find(a):this.constructor(b).find(a);if(c[1]){if(b=b instanceof n?b[0]:b,n.merge(this,n.parseHTML(c[1],b&&b.nodeType?b.ownerDocument||b:z,!0)),v.test(c[1])&&n.isPlainObject(b))for(c in b)n.isFunction(this[c])?this[c](b[c]):this.attr(c,b[c]);return this}if(d=z.getElementById(c[2]),d&&d.parentNode){if(d.id!==c[2])return y.find(a);this.length=1,this[0]=d}return this.context=z,this.selector=a,this}return a.nodeType?(this.context=this[0]=a,this.length=1,this):n.isFunction(a)?"undefined"!=typeof y.ready?y.ready(a):a(n):(void 0!==a.selector&&(this.selector=a.selector,this.context=a.context),n.makeArray(a,this))};B.prototype=n.fn,y=n(z);var C=/^(?:parents|prev(?:Until|All))/,D={children:!0,contents:!0,next:!0,prev:!0};n.extend({dir:function(a,b,c){var d=[],e=a[b];while(e&&9!==e.nodeType&&(void 0===c||1!==e.nodeType||!n(e).is(c)))1===e.nodeType&&d.push(e),e=e[b];return d},sibling:function(a,b){for(var c=[];a;a=a.nextSibling)1===a.nodeType&&a!==b&&c.push(a);return c}}),n.fn.extend({has:function(a){var b,c=n(a,this),d=c.length;return this.filter(function(){for(b=0;d>b;b++)if(n.contains(this,c[b]))return!0})},closest:function(a,b){for(var c,d=0,e=this.length,f=[],g=u.test(a)||"string"!=typeof a?n(a,b||this.context):0;e>d;d++)for(c=this[d];c&&c!==b;c=c.parentNode)if(c.nodeType<11&&(g?g.index(c)>-1:1===c.nodeType&&n.find.matchesSelector(c,a))){f.push(c);break}return this.pushStack(f.length>1?n.unique(f):f)},index:function(a){return a?"string"==typeof a?n.inArray(this[0],n(a)):n.inArray(a.jquery?a[0]:a,this):this[0]&&this[0].parentNode?this.first().prevAll().length:-1},add:function(a,b){return this.pushStack(n.unique(n.merge(this.get(),n(a,b))))},addBack:function(a){return this.add(null==a?this.prevObject:this.prevObject.filter(a))}});function E(a,b){do a=a[b];while(a&&1!==a.nodeType);return a}n.each({parent:function(a){var b=a.parentNode;return b&&11!==b.nodeType?b:null},parents:function(a){return n.dir(a,"parentNode")},parentsUntil:function(a,b,c){return n.dir(a,"parentNode",c)},next:function(a){return E(a,"nextSibling")},prev:function(a){return E(a,"previousSibling")},nextAll:function(a){return n.dir(a,"nextSibling")},prevAll:function(a){return n.dir(a,"previousSibling")},nextUntil:function(a,b,c){return n.dir(a,"nextSibling",c)},prevUntil:function(a,b,c){return n.dir(a,"previousSibling",c)},siblings:function(a){return n.sibling((a.parentNode||{}).firstChild,a)},children:function(a){return n.sibling(a.firstChild)},contents:function(a){return n.nodeName(a,"iframe")?a.contentDocument||a.contentWindow.document:n.merge([],a.childNodes)}},function(a,b){n.fn[a]=function(c,d){var e=n.map(this,b,c);return"Until"!==a.slice(-5)&&(d=c),d&&"string"==typeof d&&(e=n.filter(d,e)),this.length>1&&(D[a]||(e=n.unique(e)),C.test(a)&&(e=e.reverse())),this.pushStack(e)}});var F=/\S+/g,G={};function H(a){var b=G[a]={};return n.each(a.match(F)||[],function(a,c){b[c]=!0}),b}n.Callbacks=function(a){a="string"==typeof a?G[a]||H(a):n.extend({},a);var b,c,d,e,f,g,h=[],i=!a.once&&[],j=function(l){for(c=a.memory&&l,d=!0,f=g||0,g=0,e=h.length,b=!0;h&&e>f;f++)if(h[f].apply(l[0],l[1])===!1&&a.stopOnFalse){c=!1;break}b=!1,h&&(i?i.length&&j(i.shift()):c?h=[]:k.disable())},k={add:function(){if(h){var d=h.length;!function f(b){n.each(b,function(b,c){var d=n.type(c);"function"===d?a.unique&&k.has(c)||h.push(c):c&&c.length&&"string"!==d&&f(c)})}(arguments),b?e=h.length:c&&(g=d,j(c))}return this},remove:function(){return h&&n.each(arguments,function(a,c){var d;while((d=n.inArray(c,h,d))>-1)h.splice(d,1),b&&(e>=d&&e--,f>=d&&f--)}),this},has:function(a){return a?n.inArray(a,h)>-1:!(!h||!h.length)},empty:function(){return h=[],e=0,this},disable:function(){return h=i=c=void 0,this},disabled:function(){return!h},lock:function(){return i=void 0,c||k.disable(),this},locked:function(){return!i},fireWith:function(a,c){return!h||d&&!i||(c=c||[],c=[a,c.slice?c.slice():c],b?i.push(c):j(c)),this},fire:function(){return k.fireWith(this,arguments),this},fired:function(){return!!d}};return k},n.extend({Deferred:function(a){var b=[["resolve","done",n.Callbacks("once memory"),"resolved"],["reject","fail",n.Callbacks("once memory"),"rejected"],["notify","progress",n.Callbacks("memory")]],c="pending",d={state:function(){return c},always:function(){return e.done(arguments).fail(arguments),this},then:function(){var a=arguments;return n.Deferred(function(c){n.each(b,function(b,f){var g=n.isFunction(a[b])&&a[b];e[f[1]](function(){var a=g&&g.apply(this,arguments);a&&n.isFunction(a.promise)?a.promise().done(c.resolve).fail(c.reject).progress(c.notify):c[f[0]+"With"](this===d?c.promise():this,g?[a]:arguments)})}),a=null}).promise()},promise:function(a){return null!=a?n.extend(a,d):d}},e={};return d.pipe=d.then,n.each(b,function(a,f){var g=f[2],h=f[3];d[f[1]]=g.add,h&&g.add(function(){c=h},b[1^a][2].disable,b[2][2].lock),e[f[0]]=function(){return e[f[0]+"With"](this===e?d:this,arguments),this},e[f[0]+"With"]=g.fireWith}),d.promise(e),a&&a.call(e,e),e},when:function(a){var b=0,c=d.call(arguments),e=c.length,f=1!==e||a&&n.isFunction(a.promise)?e:0,g=1===f?a:n.Deferred(),h=function(a,b,c){return function(e){b[a]=this,c[a]=arguments.length>1?d.call(arguments):e,c===i?g.notifyWith(b,c):--f||g.resolveWith(b,c)}},i,j,k;if(e>1)for(i=new Array(e),j=new Array(e),k=new Array(e);e>b;b++)c[b]&&n.isFunction(c[b].promise)?c[b].promise().done(h(b,k,c)).fail(g.reject).progress(h(b,j,i)):--f;return f||g.resolveWith(k,c),g.promise()}});var I;n.fn.ready=function(a){return n.ready.promise().done(a),this},n.extend({isReady:!1,readyWait:1,holdReady:function(a){a?n.readyWait++:n.ready(!0)},ready:function(a){if(a===!0?!--n.readyWait:!n.isReady){if(!z.body)return setTimeout(n.ready);n.isReady=!0,a!==!0&&--n.readyWait>0||(I.resolveWith(z,[n]),n.fn.trigger&&n(z).trigger("ready").off("ready"))}}});function J(){z.addEventListener?(z.removeEventListener("DOMContentLoaded",K,!1),a.removeEventListener("load",K,!1)):(z.detachEvent("onreadystatechange",K),a.detachEvent("onload",K))}function K(){(z.addEventListener||"load"===event.type||"complete"===z.readyState)&&(J(),n.ready())}n.ready.promise=function(b){if(!I)if(I=n.Deferred(),"complete"===z.readyState)setTimeout(n.ready);else if(z.addEventListener)z.addEventListener("DOMContentLoaded",K,!1),a.addEventListener("load",K,!1);else{z.attachEvent("onreadystatechange",K),a.attachEvent("onload",K);var c=!1;try{c=null==a.frameElement&&z.documentElement}catch(d){}c&&c.doScroll&&!function e(){if(!n.isReady){try{c.doScroll("left")}catch(a){return setTimeout(e,50)}J(),n.ready()}}()}return I.promise(b)};var L="undefined",M;for(M in n(l))break;l.ownLast="0"!==M,l.inlineBlockNeedsLayout=!1,n(function(){var a,b,c=z.getElementsByTagName("body")[0];c&&(a=z.createElement("div"),a.style.cssText="border:0;width:0;height:0;position:absolute;top:0;left:-9999px;margin-top:1px",b=z.createElement("div"),c.appendChild(a).appendChild(b),typeof b.style.zoom!==L&&(b.style.cssText="border:0;margin:0;width:1px;padding:1px;display:inline;zoom:1",(l.inlineBlockNeedsLayout=3===b.offsetWidth)&&(c.style.zoom=1)),c.removeChild(a),a=b=null)}),function(){var a=z.createElement("div");if(null==l.deleteExpando){l.deleteExpando=!0;try{delete a.test}catch(b){l.deleteExpando=!1}}a=null}(),n.acceptData=function(a){var b=n.noData[(a.nodeName+" ").toLowerCase()],c=+a.nodeType||1;return 1!==c&&9!==c?!1:!b||b!==!0&&a.getAttribute("classid")===b};var N=/^(?:\{[\w\W]*\}|\[[\w\W]*\])$/,O=/([A-Z])/g;function P(a,b,c){if(void 0===c&&1===a.nodeType){var d="data-"+b.replace(O,"-$1").toLowerCase();if(c=a.getAttribute(d),"string"==typeof c){try{c="true"===c?!0:"false"===c?!1:"null"===c?null:+c+""===c?+c:N.test(c)?n.parseJSON(c):c}catch(e){}n.data(a,b,c)}else c=void 0}return c}function Q(a){var b;for(b in a)if(("data"!==b||!n.isEmptyObject(a[b]))&&"toJSON"!==b)return!1;return!0}function R(a,b,d,e){if(n.acceptData(a)){var f,g,h=n.expando,i=a.nodeType,j=i?n.cache:a,k=i?a[h]:a[h]&&h;if(k&&j[k]&&(e||j[k].data)||void 0!==d||"string"!=typeof b)return k||(k=i?a[h]=c.pop()||n.guid++:h),j[k]||(j[k]=i?{}:{toJSON:n.noop}),("object"==typeof b||"function"==typeof b)&&(e?j[k]=n.extend(j[k],b):j[k].data=n.extend(j[k].data,b)),g=j[k],e||(g.data||(g.data={}),g=g.data),void 0!==d&&(g[n.camelCase(b)]=d),"string"==typeof b?(f=g[b],null==f&&(f=g[n.camelCase(b)])):f=g,f }}function S(a,b,c){if(n.acceptData(a)){var d,e,f=a.nodeType,g=f?n.cache:a,h=f?a[n.expando]:n.expando;if(g[h]){if(b&&(d=c?g[h]:g[h].data)){n.isArray(b)?b=b.concat(n.map(b,n.camelCase)):b in d?b=[b]:(b=n.camelCase(b),b=b in d?[b]:b.split(" ")),e=b.length;while(e--)delete d[b[e]];if(c?!Q(d):!n.isEmptyObject(d))return}(c||(delete g[h].data,Q(g[h])))&&(f?n.cleanData([a],!0):l.deleteExpando||g!=g.window?delete g[h]:g[h]=null)}}}n.extend({cache:{},noData:{"applet ":!0,"embed ":!0,"object ":"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"},hasData:function(a){return a=a.nodeType?n.cache[a[n.expando]]:a[n.expando],!!a&&!Q(a)},data:function(a,b,c){return R(a,b,c)},removeData:function(a,b){return S(a,b)},_data:function(a,b,c){return R(a,b,c,!0)},_removeData:function(a,b){return S(a,b,!0)}}),n.fn.extend({data:function(a,b){var c,d,e,f=this[0],g=f&&f.attributes;if(void 0===a){if(this.length&&(e=n.data(f),1===f.nodeType&&!n._data(f,"parsedAttrs"))){c=g.length;while(c--)d=g[c].name,0===d.indexOf("data-")&&(d=n.camelCase(d.slice(5)),P(f,d,e[d]));n._data(f,"parsedAttrs",!0)}return e}return"object"==typeof a?this.each(function(){n.data(this,a)}):arguments.length>1?this.each(function(){n.data(this,a,b)}):f?P(f,a,n.data(f,a)):void 0},removeData:function(a){return this.each(function(){n.removeData(this,a)})}}),n.extend({queue:function(a,b,c){var d;return a?(b=(b||"fx")+"queue",d=n._data(a,b),c&&(!d||n.isArray(c)?d=n._data(a,b,n.makeArray(c)):d.push(c)),d||[]):void 0},dequeue:function(a,b){b=b||"fx";var c=n.queue(a,b),d=c.length,e=c.shift(),f=n._queueHooks(a,b),g=function(){n.dequeue(a,b)};"inprogress"===e&&(e=c.shift(),d--),e&&("fx"===b&&c.unshift("inprogress"),delete f.stop,e.call(a,g,f)),!d&&f&&f.empty.fire()},_queueHooks:function(a,b){var c=b+"queueHooks";return n._data(a,c)||n._data(a,c,{empty:n.Callbacks("once memory").add(function(){n._removeData(a,b+"queue"),n._removeData(a,c)})})}}),n.fn.extend({queue:function(a,b){var c=2;return"string"!=typeof a&&(b=a,a="fx",c--),arguments.length<c?n.queue(this[0],a):void 0===b?this:this.each(function(){var c=n.queue(this,a,b);n._queueHooks(this,a),"fx"===a&&"inprogress"!==c[0]&&n.dequeue(this,a)})},dequeue:function(a){return this.each(function(){n.dequeue(this,a)})},clearQueue:function(a){return this.queue(a||"fx",[])},promise:function(a,b){var c,d=1,e=n.Deferred(),f=this,g=this.length,h=function(){--d||e.resolveWith(f,[f])};"string"!=typeof a&&(b=a,a=void 0),a=a||"fx";while(g--)c=n._data(f[g],a+"queueHooks"),c&&c.empty&&(d++,c.empty.add(h));return h(),e.promise(b)}});var T=/[+-]?(?:\d*\.|)\d+(?:[eE][+-]?\d+|)/.source,U=["Top","Right","Bottom","Left"],V=function(a,b){return a=b||a,"none"===n.css(a,"display")||!n.contains(a.ownerDocument,a)},W=n.access=function(a,b,c,d,e,f,g){var h=0,i=a.length,j=null==c;if("object"===n.type(c)){e=!0;for(h in c)n.access(a,b,h,c[h],!0,f,g)}else if(void 0!==d&&(e=!0,n.isFunction(d)||(g=!0),j&&(g?(b.call(a,d),b=null):(j=b,b=function(a,b,c){return j.call(n(a),c)})),b))for(;i>h;h++)b(a[h],c,g?d:d.call(a[h],h,b(a[h],c)));return e?a:j?b.call(a):i?b(a[0],c):f},X=/^(?:checkbox|radio)$/i;!function(){var a=z.createDocumentFragment(),b=z.createElement("div"),c=z.createElement("input");if(b.setAttribute("className","t"),b.innerHTML=" <link/><table></table><a href='/a'>a</a>",l.leadingWhitespace=3===b.firstChild.nodeType,l.tbody=!b.getElementsByTagName("tbody").length,l.htmlSerialize=!!b.getElementsByTagName("link").length,l.html5Clone="<:nav></:nav>"!==z.createElement("nav").cloneNode(!0).outerHTML,c.type="checkbox",c.checked=!0,a.appendChild(c),l.appendChecked=c.checked,b.innerHTML="<textarea>x</textarea>",l.noCloneChecked=!!b.cloneNode(!0).lastChild.defaultValue,a.appendChild(b),b.innerHTML="<input type='radio' checked='checked' name='t'/>",l.checkClone=b.cloneNode(!0).cloneNode(!0).lastChild.checked,l.noCloneEvent=!0,b.attachEvent&&(b.attachEvent("onclick",function(){l.noCloneEvent=!1}),b.cloneNode(!0).click()),null==l.deleteExpando){l.deleteExpando=!0;try{delete b.test}catch(d){l.deleteExpando=!1}}a=b=c=null}(),function(){var b,c,d=z.createElement("div");for(b in{submit:!0,change:!0,focusin:!0})c="on"+b,(l[b+"Bubbles"]=c in a)||(d.setAttribute(c,"t"),l[b+"Bubbles"]=d.attributes[c].expando===!1);d=null}();var Y=/^(?:input|select|textarea)$/i,Z=/^key/,$=/^(?:mouse|contextmenu)|click/,_=/^(?:focusinfocus|focusoutblur)$/,ab=/^([^.]*)(?:\.(.+)|)$/;function bb(){return!0}function cb(){return!1}function db(){try{return z.activeElement}catch(a){}}n.event={global:{},add:function(a,b,c,d,e){var f,g,h,i,j,k,l,m,o,p,q,r=n._data(a);if(r){c.handler&&(i=c,c=i.handler,e=i.selector),c.guid||(c.guid=n.guid++),(g=r.events)||(g=r.events={}),(k=r.handle)||(k=r.handle=function(a){return typeof n===L||a&&n.event.triggered===a.type?void 0:n.event.dispatch.apply(k.elem,arguments)},k.elem=a),b=(b||"").match(F)||[""],h=b.length;while(h--)f=ab.exec(b[h])||[],o=q=f[1],p=(f[2]||"").split(".").sort(),o&&(j=n.event.special[o]||{},o=(e?j.delegateType:j.bindType)||o,j=n.event.special[o]||{},l=n.extend({type:o,origType:q,data:d,handler:c,guid:c.guid,selector:e,needsContext:e&&n.expr.match.needsContext.test(e),namespace:p.join(".")},i),(m=g[o])||(m=g[o]=[],m.delegateCount=0,j.setup&&j.setup.call(a,d,p,k)!==!1||(a.addEventListener?a.addEventListener(o,k,!1):a.attachEvent&&a.attachEvent("on"+o,k))),j.add&&(j.add.call(a,l),l.handler.guid||(l.handler.guid=c.guid)),e?m.splice(m.delegateCount++,0,l):m.push(l),n.event.global[o]=!0);a=null}},remove:function(a,b,c,d,e){var f,g,h,i,j,k,l,m,o,p,q,r=n.hasData(a)&&n._data(a);if(r&&(k=r.events)){b=(b||"").match(F)||[""],j=b.length;while(j--)if(h=ab.exec(b[j])||[],o=q=h[1],p=(h[2]||"").split(".").sort(),o){l=n.event.special[o]||{},o=(d?l.delegateType:l.bindType)||o,m=k[o]||[],h=h[2]&&new RegExp("(^|\\.)"+p.join("\\.(?:.*\\.|)")+"(\\.|$)"),i=f=m.length;while(f--)g=m[f],!e&&q!==g.origType||c&&c.guid!==g.guid||h&&!h.test(g.namespace)||d&&d!==g.selector&&("**"!==d||!g.selector)||(m.splice(f,1),g.selector&&m.delegateCount--,l.remove&&l.remove.call(a,g));i&&!m.length&&(l.teardown&&l.teardown.call(a,p,r.handle)!==!1||n.removeEvent(a,o,r.handle),delete k[o])}else for(o in k)n.event.remove(a,o+b[j],c,d,!0);n.isEmptyObject(k)&&(delete r.handle,n._removeData(a,"events"))}},trigger:function(b,c,d,e){var f,g,h,i,k,l,m,o=[d||z],p=j.call(b,"type")?b.type:b,q=j.call(b,"namespace")?b.namespace.split("."):[];if(h=l=d=d||z,3!==d.nodeType&&8!==d.nodeType&&!_.test(p+n.event.triggered)&&(p.indexOf(".")>=0&&(q=p.split("."),p=q.shift(),q.sort()),g=p.indexOf(":")<0&&"on"+p,b=b[n.expando]?b:new n.Event(p,"object"==typeof b&&b),b.isTrigger=e?2:3,b.namespace=q.join("."),b.namespace_re=b.namespace?new RegExp("(^|\\.)"+q.join("\\.(?:.*\\.|)")+"(\\.|$)"):null,b.result=void 0,b.target||(b.target=d),c=null==c?[b]:n.makeArray(c,[b]),k=n.event.special[p]||{},e||!k.trigger||k.trigger.apply(d,c)!==!1)){if(!e&&!k.noBubble&&!n.isWindow(d)){for(i=k.delegateType||p,_.test(i+p)||(h=h.parentNode);h;h=h.parentNode)o.push(h),l=h;l===(d.ownerDocument||z)&&o.push(l.defaultView||l.parentWindow||a)}m=0;while((h=o[m++])&&!b.isPropagationStopped())b.type=m>1?i:k.bindType||p,f=(n._data(h,"events")||{})[b.type]&&n._data(h,"handle"),f&&f.apply(h,c),f=g&&h[g],f&&f.apply&&n.acceptData(h)&&(b.result=f.apply(h,c),b.result===!1&&b.preventDefault());if(b.type=p,!e&&!b.isDefaultPrevented()&&(!k._default||k._default.apply(o.pop(),c)===!1)&&n.acceptData(d)&&g&&d[p]&&!n.isWindow(d)){l=d[g],l&&(d[g]=null),n.event.triggered=p;try{d[p]()}catch(r){}n.event.triggered=void 0,l&&(d[g]=l)}return b.result}},dispatch:function(a){a=n.event.fix(a);var b,c,e,f,g,h=[],i=d.call(arguments),j=(n._data(this,"events")||{})[a.type]||[],k=n.event.special[a.type]||{};if(i[0]=a,a.delegateTarget=this,!k.preDispatch||k.preDispatch.call(this,a)!==!1){h=n.event.handlers.call(this,a,j),b=0;while((f=h[b++])&&!a.isPropagationStopped()){a.currentTarget=f.elem,g=0;while((e=f.handlers[g++])&&!a.isImmediatePropagationStopped())(!a.namespace_re||a.namespace_re.test(e.namespace))&&(a.handleObj=e,a.data=e.data,c=((n.event.special[e.origType]||{}).handle||e.handler).apply(f.elem,i),void 0!==c&&(a.result=c)===!1&&(a.preventDefault(),a.stopPropagation()))}return k.postDispatch&&k.postDispatch.call(this,a),a.result}},handlers:function(a,b){var c,d,e,f,g=[],h=b.delegateCount,i=a.target;if(h&&i.nodeType&&(!a.button||"click"!==a.type))for(;i!=this;i=i.parentNode||this)if(1===i.nodeType&&(i.disabled!==!0||"click"!==a.type)){for(e=[],f=0;h>f;f++)d=b[f],c=d.selector+" ",void 0===e[c]&&(e[c]=d.needsContext?n(c,this).index(i)>=0:n.find(c,this,null,[i]).length),e[c]&&e.push(d);e.length&&g.push({elem:i,handlers:e})}return h<b.length&&g.push({elem:this,handlers:b.slice(h)}),g},fix:function(a){if(a[n.expando])return a;var b,c,d,e=a.type,f=a,g=this.fixHooks[e];g||(this.fixHooks[e]=g=$.test(e)?this.mouseHooks:Z.test(e)?this.keyHooks:{}),d=g.props?this.props.concat(g.props):this.props,a=new n.Event(f),b=d.length;while(b--)c=d[b],a[c]=f[c];return a.target||(a.target=f.srcElement||z),3===a.target.nodeType&&(a.target=a.target.parentNode),a.metaKey=!!a.metaKey,g.filter?g.filter(a,f):a},props:"altKey bubbles cancelable ctrlKey currentTarget eventPhase metaKey relatedTarget shiftKey target timeStamp view which".split(" "),fixHooks:{},keyHooks:{props:"char charCode key keyCode".split(" "),filter:function(a,b){return null==a.which&&(a.which=null!=b.charCode?b.charCode:b.keyCode),a}},mouseHooks:{props:"button buttons clientX clientY fromElement offsetX offsetY pageX pageY screenX screenY toElement".split(" "),filter:function(a,b){var c,d,e,f=b.button,g=b.fromElement;return null==a.pageX&&null!=b.clientX&&(d=a.target.ownerDocument||z,e=d.documentElement,c=d.body,a.pageX=b.clientX+(e&&e.scrollLeft||c&&c.scrollLeft||0)-(e&&e.clientLeft||c&&c.clientLeft||0),a.pageY=b.clientY+(e&&e.scrollTop||c&&c.scrollTop||0)-(e&&e.clientTop||c&&c.clientTop||0)),!a.relatedTarget&&g&&(a.relatedTarget=g===a.target?b.toElement:g),a.which||void 0===f||(a.which=1&f?1:2&f?3:4&f?2:0),a}},special:{load:{noBubble:!0},focus:{trigger:function(){if(this!==db()&&this.focus)try{return this.focus(),!1}catch(a){}},delegateType:"focusin"},blur:{trigger:function(){return this===db()&&this.blur?(this.blur(),!1):void 0},delegateType:"focusout"},click:{trigger:function(){return n.nodeName(this,"input")&&"checkbox"===this.type&&this.click?(this.click(),!1):void 0},_default:function(a){return n.nodeName(a.target,"a")}},beforeunload:{postDispatch:function(a){void 0!==a.result&&(a.originalEvent.returnValue=a.result)}}},simulate:function(a,b,c,d){var e=n.extend(new n.Event,c,{type:a,isSimulated:!0,originalEvent:{}});d?n.event.trigger(e,null,b):n.event.dispatch.call(b,e),e.isDefaultPrevented()&&c.preventDefault()}},n.removeEvent=z.removeEventListener?function(a,b,c){a.removeEventListener&&a.removeEventListener(b,c,!1)}:function(a,b,c){var d="on"+b;a.detachEvent&&(typeof a[d]===L&&(a[d]=null),a.detachEvent(d,c))},n.Event=function(a,b){return this instanceof n.Event?(a&&a.type?(this.originalEvent=a,this.type=a.type,this.isDefaultPrevented=a.defaultPrevented||void 0===a.defaultPrevented&&(a.returnValue===!1||a.getPreventDefault&&a.getPreventDefault())?bb:cb):this.type=a,b&&n.extend(this,b),this.timeStamp=a&&a.timeStamp||n.now(),void(this[n.expando]=!0)):new n.Event(a,b)},n.Event.prototype={isDefaultPrevented:cb,isPropagationStopped:cb,isImmediatePropagationStopped:cb,preventDefault:function(){var a=this.originalEvent;this.isDefaultPrevented=bb,a&&(a.preventDefault?a.preventDefault():a.returnValue=!1)},stopPropagation:function(){var a=this.originalEvent;this.isPropagationStopped=bb,a&&(a.stopPropagation&&a.stopPropagation(),a.cancelBubble=!0)},stopImmediatePropagation:function(){this.isImmediatePropagationStopped=bb,this.stopPropagation()}},n.each({mouseenter:"mouseover",mouseleave:"mouseout"},function(a,b){n.event.special[a]={delegateType:b,bindType:b,handle:function(a){var c,d=this,e=a.relatedTarget,f=a.handleObj;return(!e||e!==d&&!n.contains(d,e))&&(a.type=f.origType,c=f.handler.apply(this,arguments),a.type=b),c}}}),l.submitBubbles||(n.event.special.submit={setup:function(){return n.nodeName(this,"form")?!1:void n.event.add(this,"click._submit keypress._submit",function(a){var b=a.target,c=n.nodeName(b,"input")||n.nodeName(b,"button")?b.form:void 0;c&&!n._data(c,"submitBubbles")&&(n.event.add(c,"submit._submit",function(a){a._submit_bubble=!0}),n._data(c,"submitBubbles",!0))})},postDispatch:function(a){a._submit_bubble&&(delete a._submit_bubble,this.parentNode&&!a.isTrigger&&n.event.simulate("submit",this.parentNode,a,!0))},teardown:function(){return n.nodeName(this,"form")?!1:void n.event.remove(this,"._submit")}}),l.changeBubbles||(n.event.special.change={setup:function(){return Y.test(this.nodeName)?(("checkbox"===this.type||"radio"===this.type)&&(n.event.add(this,"propertychange._change",function(a){"checked"===a.originalEvent.propertyName&&(this._just_changed=!0)}),n.event.add(this,"click._change",function(a){this._just_changed&&!a.isTrigger&&(this._just_changed=!1),n.event.simulate("change",this,a,!0)})),!1):void n.event.add(this,"beforeactivate._change",function(a){var b=a.target;Y.test(b.nodeName)&&!n._data(b,"changeBubbles")&&(n.event.add(b,"change._change",function(a){!this.parentNode||a.isSimulated||a.isTrigger||n.event.simulate("change",this.parentNode,a,!0)}),n._data(b,"changeBubbles",!0))})},handle:function(a){var b=a.target;return this!==b||a.isSimulated||a.isTrigger||"radio"!==b.type&&"checkbox"!==b.type?a.handleObj.handler.apply(this,arguments):void 0},teardown:function(){return n.event.remove(this,"._change"),!Y.test(this.nodeName)}}),l.focusinBubbles||n.each({focus:"focusin",blur:"focusout"},function(a,b){var c=function(a){n.event.simulate(b,a.target,n.event.fix(a),!0)};n.event.special[b]={setup:function(){var d=this.ownerDocument||this,e=n._data(d,b);e||d.addEventListener(a,c,!0),n._data(d,b,(e||0)+1)},teardown:function(){var d=this.ownerDocument||this,e=n._data(d,b)-1;e?n._data(d,b,e):(d.removeEventListener(a,c,!0),n._removeData(d,b))}}}),n.fn.extend({on:function(a,b,c,d,e){var f,g;if("object"==typeof a){"string"!=typeof b&&(c=c||b,b=void 0);for(f in a)this.on(f,b,c,a[f],e);return this}if(null==c&&null==d?(d=b,c=b=void 0):null==d&&("string"==typeof b?(d=c,c=void 0):(d=c,c=b,b=void 0)),d===!1)d=cb;else if(!d)return this;return 1===e&&(g=d,d=function(a){return n().off(a),g.apply(this,arguments)},d.guid=g.guid||(g.guid=n.guid++)),this.each(function(){n.event.add(this,a,d,c,b)})},one:function(a,b,c,d){return this.on(a,b,c,d,1)},off:function(a,b,c){var d,e;if(a&&a.preventDefault&&a.handleObj)return d=a.handleObj,n(a.delegateTarget).off(d.namespace?d.origType+"."+d.namespace:d.origType,d.selector,d.handler),this;if("object"==typeof a){for(e in a)this.off(e,b,a[e]);return this}return(b===!1||"function"==typeof b)&&(c=b,b=void 0),c===!1&&(c=cb),this.each(function(){n.event.remove(this,a,c,b)})},trigger:function(a,b){return this.each(function(){n.event.trigger(a,b,this)})},triggerHandler:function(a,b){var c=this[0];return c?n.event.trigger(a,b,c,!0):void 0}});function eb(a){var b=fb.split("|"),c=a.createDocumentFragment();if(c.createElement)while(b.length)c.createElement(b.pop());return c}var fb="abbr|article|aside|audio|bdi|canvas|data|datalist|details|figcaption|figure|footer|header|hgroup|mark|meter|nav|output|progress|section|summary|time|video",gb=/ jQuery\d+="(?:null|\d+)"/g,hb=new RegExp("<(?:"+fb+")[\\s/>]","i"),ib=/^\s+/,jb=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/gi,kb=/<([\w:]+)/,lb=/<tbody/i,mb=/<|&#?\w+;/,nb=/<(?:script|style|link)/i,ob=/checked\s*(?:[^=]|=\s*.checked.)/i,pb=/^$|\/(?:java|ecma)script/i,qb=/^true\/(.*)/,rb=/^\s*<!(?:\[CDATA\[|--)|(?:\]\]|--)>\s*$/g,sb={option:[1,"<select multiple='multiple'>","</select>"],legend:[1,"<fieldset>","</fieldset>"],area:[1,"<map>","</map>"],param:[1,"<object>","</object>"],thead:[1,"<table>","</table>"],tr:[2,"<table><tbody>","</tbody></table>"],col:[2,"<table><tbody></tbody><colgroup>","</colgroup></table>"],td:[3,"<table><tbody><tr>","</tr></tbody></table>"],_default:l.htmlSerialize?[0,"",""]:[1,"X<div>","</div>"]},tb=eb(z),ub=tb.appendChild(z.createElement("div"));sb.optgroup=sb.option,sb.tbody=sb.tfoot=sb.colgroup=sb.caption=sb.thead,sb.th=sb.td;function vb(a,b){var c,d,e=0,f=typeof a.getElementsByTagName!==L?a.getElementsByTagName(b||"*"):typeof a.querySelectorAll!==L?a.querySelectorAll(b||"*"):void 0;if(!f)for(f=[],c=a.childNodes||a;null!=(d=c[e]);e++)!b||n.nodeName(d,b)?f.push(d):n.merge(f,vb(d,b));return void 0===b||b&&n.nodeName(a,b)?n.merge([a],f):f}function wb(a){X.test(a.type)&&(a.defaultChecked=a.checked)}function xb(a,b){return n.nodeName(a,"table")&&n.nodeName(11!==b.nodeType?b:b.firstChild,"tr")?a.getElementsByTagName("tbody")[0]||a.appendChild(a.ownerDocument.createElement("tbody")):a}function yb(a){return a.type=(null!==n.find.attr(a,"type"))+"/"+a.type,a}function zb(a){var b=qb.exec(a.type);return b?a.type=b[1]:a.removeAttribute("type"),a}function Ab(a,b){for(var c,d=0;null!=(c=a[d]);d++)n._data(c,"globalEval",!b||n._data(b[d],"globalEval"))}function Bb(a,b){if(1===b.nodeType&&n.hasData(a)){var c,d,e,f=n._data(a),g=n._data(b,f),h=f.events;if(h){delete g.handle,g.events={};for(c in h)for(d=0,e=h[c].length;e>d;d++)n.event.add(b,c,h[c][d])}g.data&&(g.data=n.extend({},g.data))}}function Cb(a,b){var c,d,e;if(1===b.nodeType){if(c=b.nodeName.toLowerCase(),!l.noCloneEvent&&b[n.expando]){e=n._data(b);for(d in e.events)n.removeEvent(b,d,e.handle);b.removeAttribute(n.expando)}"script"===c&&b.text!==a.text?(yb(b).text=a.text,zb(b)):"object"===c?(b.parentNode&&(b.outerHTML=a.outerHTML),l.html5Clone&&a.innerHTML&&!n.trim(b.innerHTML)&&(b.innerHTML=a.innerHTML)):"input"===c&&X.test(a.type)?(b.defaultChecked=b.checked=a.checked,b.value!==a.value&&(b.value=a.value)):"option"===c?b.defaultSelected=b.selected=a.defaultSelected:("input"===c||"textarea"===c)&&(b.defaultValue=a.defaultValue)}}n.extend({clone:function(a,b,c){var d,e,f,g,h,i=n.contains(a.ownerDocument,a);if(l.html5Clone||n.isXMLDoc(a)||!hb.test("<"+a.nodeName+">")?f=a.cloneNode(!0):(ub.innerHTML=a.outerHTML,ub.removeChild(f=ub.firstChild)),!(l.noCloneEvent&&l.noCloneChecked||1!==a.nodeType&&11!==a.nodeType||n.isXMLDoc(a)))for(d=vb(f),h=vb(a),g=0;null!=(e=h[g]);++g)d[g]&&Cb(e,d[g]);if(b)if(c)for(h=h||vb(a),d=d||vb(f),g=0;null!=(e=h[g]);g++)Bb(e,d[g]);else Bb(a,f);return d=vb(f,"script"),d.length>0&&Ab(d,!i&&vb(a,"script")),d=h=e=null,f},buildFragment:function(a,b,c,d){for(var e,f,g,h,i,j,k,m=a.length,o=eb(b),p=[],q=0;m>q;q++)if(f=a[q],f||0===f)if("object"===n.type(f))n.merge(p,f.nodeType?[f]:f);else if(mb.test(f)){h=h||o.appendChild(b.createElement("div")),i=(kb.exec(f)||["",""])[1].toLowerCase(),k=sb[i]||sb._default,h.innerHTML=k[1]+f.replace(jb,"<$1></$2>")+k[2],e=k[0];while(e--)h=h.lastChild;if(!l.leadingWhitespace&&ib.test(f)&&p.push(b.createTextNode(ib.exec(f)[0])),!l.tbody){f="table"!==i||lb.test(f)?"<table>"!==k[1]||lb.test(f)?0:h:h.firstChild,e=f&&f.childNodes.length;while(e--)n.nodeName(j=f.childNodes[e],"tbody")&&!j.childNodes.length&&f.removeChild(j)}n.merge(p,h.childNodes),h.textContent="";while(h.firstChild)h.removeChild(h.firstChild);h=o.lastChild}else p.push(b.createTextNode(f));h&&o.removeChild(h),l.appendChecked||n.grep(vb(p,"input"),wb),q=0;while(f=p[q++])if((!d||-1===n.inArray(f,d))&&(g=n.contains(f.ownerDocument,f),h=vb(o.appendChild(f),"script"),g&&Ab(h),c)){e=0;while(f=h[e++])pb.test(f.type||"")&&c.push(f)}return h=null,o},cleanData:function(a,b){for(var d,e,f,g,h=0,i=n.expando,j=n.cache,k=l.deleteExpando,m=n.event.special;null!=(d=a[h]);h++)if((b||n.acceptData(d))&&(f=d[i],g=f&&j[f])){if(g.events)for(e in g.events)m[e]?n.event.remove(d,e):n.removeEvent(d,e,g.handle);j[f]&&(delete j[f],k?delete d[i]:typeof d.removeAttribute!==L?d.removeAttribute(i):d[i]=null,c.push(f))}}}),n.fn.extend({text:function(a){return W(this,function(a){return void 0===a?n.text(this):this.empty().append((this[0]&&this[0].ownerDocument||z).createTextNode(a))},null,a,arguments.length)},append:function(){return this.domManip(arguments,function(a){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var b=xb(this,a);b.appendChild(a)}})},prepend:function(){return this.domManip(arguments,function(a){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var b=xb(this,a);b.insertBefore(a,b.firstChild)}})},before:function(){return this.domManip(arguments,function(a){this.parentNode&&this.parentNode.insertBefore(a,this)})},after:function(){return this.domManip(arguments,function(a){this.parentNode&&this.parentNode.insertBefore(a,this.nextSibling)})},remove:function(a,b){for(var c,d=a?n.filter(a,this):this,e=0;null!=(c=d[e]);e++)b||1!==c.nodeType||n.cleanData(vb(c)),c.parentNode&&(b&&n.contains(c.ownerDocument,c)&&Ab(vb(c,"script")),c.parentNode.removeChild(c));return this},empty:function(){for(var a,b=0;null!=(a=this[b]);b++){1===a.nodeType&&n.cleanData(vb(a,!1));while(a.firstChild)a.removeChild(a.firstChild);a.options&&n.nodeName(a,"select")&&(a.options.length=0)}return this},clone:function(a,b){return a=null==a?!1:a,b=null==b?a:b,this.map(function(){return n.clone(this,a,b)})},html:function(a){return W(this,function(a){var b=this[0]||{},c=0,d=this.length;if(void 0===a)return 1===b.nodeType?b.innerHTML.replace(gb,""):void 0;if(!("string"!=typeof a||nb.test(a)||!l.htmlSerialize&&hb.test(a)||!l.leadingWhitespace&&ib.test(a)||sb[(kb.exec(a)||["",""])[1].toLowerCase()])){a=a.replace(jb,"<$1></$2>");try{for(;d>c;c++)b=this[c]||{},1===b.nodeType&&(n.cleanData(vb(b,!1)),b.innerHTML=a);b=0}catch(e){}}b&&this.empty().append(a)},null,a,arguments.length)},replaceWith:function(){var a=arguments[0];return this.domManip(arguments,function(b){a=this.parentNode,n.cleanData(vb(this)),a&&a.replaceChild(b,this)}),a&&(a.length||a.nodeType)?this:this.remove()},detach:function(a){return this.remove(a,!0)},domManip:function(a,b){a=e.apply([],a);var c,d,f,g,h,i,j=0,k=this.length,m=this,o=k-1,p=a[0],q=n.isFunction(p);if(q||k>1&&"string"==typeof p&&!l.checkClone&&ob.test(p))return this.each(function(c){var d=m.eq(c);q&&(a[0]=p.call(this,c,d.html())),d.domManip(a,b)});if(k&&(i=n.buildFragment(a,this[0].ownerDocument,!1,this),c=i.firstChild,1===i.childNodes.length&&(i=c),c)){for(g=n.map(vb(i,"script"),yb),f=g.length;k>j;j++)d=i,j!==o&&(d=n.clone(d,!0,!0),f&&n.merge(g,vb(d,"script"))),b.call(this[j],d,j);if(f)for(h=g[g.length-1].ownerDocument,n.map(g,zb),j=0;f>j;j++)d=g[j],pb.test(d.type||"")&&!n._data(d,"globalEval")&&n.contains(h,d)&&(d.src?n._evalUrl&&n._evalUrl(d.src):n.globalEval((d.text||d.textContent||d.innerHTML||"").replace(rb,"")));i=c=null}return this}}),n.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(a,b){n.fn[a]=function(a){for(var c,d=0,e=[],g=n(a),h=g.length-1;h>=d;d++)c=d===h?this:this.clone(!0),n(g[d])[b](c),f.apply(e,c.get());return this.pushStack(e)}});var Db,Eb={};function Fb(b,c){var d=n(c.createElement(b)).appendTo(c.body),e=a.getDefaultComputedStyle?a.getDefaultComputedStyle(d[0]).display:n.css(d[0],"display");return d.detach(),e}function Gb(a){var b=z,c=Eb[a];return c||(c=Fb(a,b),"none"!==c&&c||(Db=(Db||n("<iframe frameborder='0' width='0' height='0'/>")).appendTo(b.documentElement),b=(Db[0].contentWindow||Db[0].contentDocument).document,b.write(),b.close(),c=Fb(a,b),Db.detach()),Eb[a]=c),c}!function(){var a,b,c=z.createElement("div"),d="-webkit-box-sizing:content-box;-moz-box-sizing:content-box;box-sizing:content-box;display:block;padding:0;margin:0;border:0";c.innerHTML=" <link/><table></table><a href='/a'>a</a><input type='checkbox'/>",a=c.getElementsByTagName("a")[0],a.style.cssText="float:left;opacity:.5",l.opacity=/^0.5/.test(a.style.opacity),l.cssFloat=!!a.style.cssFloat,c.style.backgroundClip="content-box",c.cloneNode(!0).style.backgroundClip="",l.clearCloneStyle="content-box"===c.style.backgroundClip,a=c=null,l.shrinkWrapBlocks=function(){var a,c,e,f;if(null==b){if(a=z.getElementsByTagName("body")[0],!a)return;f="border:0;width:0;height:0;position:absolute;top:0;left:-9999px",c=z.createElement("div"),e=z.createElement("div"),a.appendChild(c).appendChild(e),b=!1,typeof e.style.zoom!==L&&(e.style.cssText=d+";width:1px;padding:1px;zoom:1",e.innerHTML="<div></div>",e.firstChild.style.width="5px",b=3!==e.offsetWidth),a.removeChild(c),a=c=e=null}return b}}();var Hb=/^margin/,Ib=new RegExp("^("+T+")(?!px)[a-z%]+$","i"),Jb,Kb,Lb=/^(top|right|bottom|left)$/;a.getComputedStyle?(Jb=function(a){return a.ownerDocument.defaultView.getComputedStyle(a,null)},Kb=function(a,b,c){var d,e,f,g,h=a.style;return c=c||Jb(a),g=c?c.getPropertyValue(b)||c[b]:void 0,c&&(""!==g||n.contains(a.ownerDocument,a)||(g=n.style(a,b)),Ib.test(g)&&Hb.test(b)&&(d=h.width,e=h.minWidth,f=h.maxWidth,h.minWidth=h.maxWidth=h.width=g,g=c.width,h.width=d,h.minWidth=e,h.maxWidth=f)),void 0===g?g:g+""}):z.documentElement.currentStyle&&(Jb=function(a){return a.currentStyle},Kb=function(a,b,c){var d,e,f,g,h=a.style;return c=c||Jb(a),g=c?c[b]:void 0,null==g&&h&&h[b]&&(g=h[b]),Ib.test(g)&&!Lb.test(b)&&(d=h.left,e=a.runtimeStyle,f=e&&e.left,f&&(e.left=a.currentStyle.left),h.left="fontSize"===b?"1em":g,g=h.pixelLeft+"px",h.left=d,f&&(e.left=f)),void 0===g?g:g+""||"auto"});function Mb(a,b){return{get:function(){var c=a();if(null!=c)return c?void delete this.get:(this.get=b).apply(this,arguments)}}}!function(){var b,c,d,e,f,g,h=z.createElement("div"),i="border:0;width:0;height:0;position:absolute;top:0;left:-9999px",j="-webkit-box-sizing:content-box;-moz-box-sizing:content-box;box-sizing:content-box;display:block;padding:0;margin:0;border:0";h.innerHTML=" <link/><table></table><a href='/a'>a</a><input type='checkbox'/>",b=h.getElementsByTagName("a")[0],b.style.cssText="float:left;opacity:.5",l.opacity=/^0.5/.test(b.style.opacity),l.cssFloat=!!b.style.cssFloat,h.style.backgroundClip="content-box",h.cloneNode(!0).style.backgroundClip="",l.clearCloneStyle="content-box"===h.style.backgroundClip,b=h=null,n.extend(l,{reliableHiddenOffsets:function(){if(null!=c)return c;var a,b,d,e=z.createElement("div"),f=z.getElementsByTagName("body")[0];if(f)return e.setAttribute("className","t"),e.innerHTML=" <link/><table></table><a href='/a'>a</a><input type='checkbox'/>",a=z.createElement("div"),a.style.cssText=i,f.appendChild(a).appendChild(e),e.innerHTML="<table><tr><td></td><td>t</td></tr></table>",b=e.getElementsByTagName("td"),b[0].style.cssText="padding:0;margin:0;border:0;display:none",d=0===b[0].offsetHeight,b[0].style.display="",b[1].style.display="none",c=d&&0===b[0].offsetHeight,f.removeChild(a),e=f=null,c},boxSizing:function(){return null==d&&k(),d},boxSizingReliable:function(){return null==e&&k(),e},pixelPosition:function(){return null==f&&k(),f},reliableMarginRight:function(){var b,c,d,e;if(null==g&&a.getComputedStyle){if(b=z.getElementsByTagName("body")[0],!b)return;c=z.createElement("div"),d=z.createElement("div"),c.style.cssText=i,b.appendChild(c).appendChild(d),e=d.appendChild(z.createElement("div")),e.style.cssText=d.style.cssText=j,e.style.marginRight=e.style.width="0",d.style.width="1px",g=!parseFloat((a.getComputedStyle(e,null)||{}).marginRight),b.removeChild(c)}return g}});function k(){var b,c,h=z.getElementsByTagName("body")[0];h&&(b=z.createElement("div"),c=z.createElement("div"),b.style.cssText=i,h.appendChild(b).appendChild(c),c.style.cssText="-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;position:absolute;display:block;padding:1px;border:1px;width:4px;margin-top:1%;top:1%",n.swap(h,null!=h.style.zoom?{zoom:1}:{},function(){d=4===c.offsetWidth}),e=!0,f=!1,g=!0,a.getComputedStyle&&(f="1%"!==(a.getComputedStyle(c,null)||{}).top,e="4px"===(a.getComputedStyle(c,null)||{width:"4px"}).width),h.removeChild(b),c=h=null)}}(),n.swap=function(a,b,c,d){var e,f,g={};for(f in b)g[f]=a.style[f],a.style[f]=b[f];e=c.apply(a,d||[]);for(f in b)a.style[f]=g[f];return e};var Nb=/alpha\([^)]*\)/i,Ob=/opacity\s*=\s*([^)]*)/,Pb=/^(none|table(?!-c[ea]).+)/,Qb=new RegExp("^("+T+")(.*)$","i"),Rb=new RegExp("^([+-])=("+T+")","i"),Sb={position:"absolute",visibility:"hidden",display:"block"},Tb={letterSpacing:0,fontWeight:400},Ub=["Webkit","O","Moz","ms"];function Vb(a,b){if(b in a)return b;var c=b.charAt(0).toUpperCase()+b.slice(1),d=b,e=Ub.length;while(e--)if(b=Ub[e]+c,b in a)return b;return d}function Wb(a,b){for(var c,d,e,f=[],g=0,h=a.length;h>g;g++)d=a[g],d.style&&(f[g]=n._data(d,"olddisplay"),c=d.style.display,b?(f[g]||"none"!==c||(d.style.display=""),""===d.style.display&&V(d)&&(f[g]=n._data(d,"olddisplay",Gb(d.nodeName)))):f[g]||(e=V(d),(c&&"none"!==c||!e)&&n._data(d,"olddisplay",e?c:n.css(d,"display"))));for(g=0;h>g;g++)d=a[g],d.style&&(b&&"none"!==d.style.display&&""!==d.style.display||(d.style.display=b?f[g]||"":"none"));return a}function Xb(a,b,c){var d=Qb.exec(b);return d?Math.max(0,d[1]-(c||0))+(d[2]||"px"):b}function Yb(a,b,c,d,e){for(var f=c===(d?"border":"content")?4:"width"===b?1:0,g=0;4>f;f+=2)"margin"===c&&(g+=n.css(a,c+U[f],!0,e)),d?("content"===c&&(g-=n.css(a,"padding"+U[f],!0,e)),"margin"!==c&&(g-=n.css(a,"border"+U[f]+"Width",!0,e))):(g+=n.css(a,"padding"+U[f],!0,e),"padding"!==c&&(g+=n.css(a,"border"+U[f]+"Width",!0,e)));return g}function Zb(a,b,c){var d=!0,e="width"===b?a.offsetWidth:a.offsetHeight,f=Jb(a),g=l.boxSizing()&&"border-box"===n.css(a,"boxSizing",!1,f);if(0>=e||null==e){if(e=Kb(a,b,f),(0>e||null==e)&&(e=a.style[b]),Ib.test(e))return e;d=g&&(l.boxSizingReliable()||e===a.style[b]),e=parseFloat(e)||0}return e+Yb(a,b,c||(g?"border":"content"),d,f)+"px"}n.extend({cssHooks:{opacity:{get:function(a,b){if(b){var c=Kb(a,"opacity");return""===c?"1":c}}}},cssNumber:{columnCount:!0,fillOpacity:!0,fontWeight:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,widows:!0,zIndex:!0,zoom:!0},cssProps:{"float":l.cssFloat?"cssFloat":"styleFloat"},style:function(a,b,c,d){if(a&&3!==a.nodeType&&8!==a.nodeType&&a.style){var e,f,g,h=n.camelCase(b),i=a.style;if(b=n.cssProps[h]||(n.cssProps[h]=Vb(i,h)),g=n.cssHooks[b]||n.cssHooks[h],void 0===c)return g&&"get"in g&&void 0!==(e=g.get(a,!1,d))?e:i[b];if(f=typeof c,"string"===f&&(e=Rb.exec(c))&&(c=(e[1]+1)*e[2]+parseFloat(n.css(a,b)),f="number"),null!=c&&c===c&&("number"!==f||n.cssNumber[h]||(c+="px"),l.clearCloneStyle||""!==c||0!==b.indexOf("background")||(i[b]="inherit"),!(g&&"set"in g&&void 0===(c=g.set(a,c,d)))))try{i[b]="",i[b]=c}catch(j){}}},css:function(a,b,c,d){var e,f,g,h=n.camelCase(b);return b=n.cssProps[h]||(n.cssProps[h]=Vb(a.style,h)),g=n.cssHooks[b]||n.cssHooks[h],g&&"get"in g&&(f=g.get(a,!0,c)),void 0===f&&(f=Kb(a,b,d)),"normal"===f&&b in Tb&&(f=Tb[b]),""===c||c?(e=parseFloat(f),c===!0||n.isNumeric(e)?e||0:f):f}}),n.each(["height","width"],function(a,b){n.cssHooks[b]={get:function(a,c,d){return c?0===a.offsetWidth&&Pb.test(n.css(a,"display"))?n.swap(a,Sb,function(){return Zb(a,b,d)}):Zb(a,b,d):void 0},set:function(a,c,d){var e=d&&Jb(a);return Xb(a,c,d?Yb(a,b,d,l.boxSizing()&&"border-box"===n.css(a,"boxSizing",!1,e),e):0)}}}),l.opacity||(n.cssHooks.opacity={get:function(a,b){return Ob.test((b&&a.currentStyle?a.currentStyle.filter:a.style.filter)||"")?.01*parseFloat(RegExp.$1)+"":b?"1":""},set:function(a,b){var c=a.style,d=a.currentStyle,e=n.isNumeric(b)?"alpha(opacity="+100*b+")":"",f=d&&d.filter||c.filter||"";c.zoom=1,(b>=1||""===b)&&""===n.trim(f.replace(Nb,""))&&c.removeAttribute&&(c.removeAttribute("filter"),""===b||d&&!d.filter)||(c.filter=Nb.test(f)?f.replace(Nb,e):f+" "+e)}}),n.cssHooks.marginRight=Mb(l.reliableMarginRight,function(a,b){return b?n.swap(a,{display:"inline-block"},Kb,[a,"marginRight"]):void 0}),n.each({margin:"",padding:"",border:"Width"},function(a,b){n.cssHooks[a+b]={expand:function(c){for(var d=0,e={},f="string"==typeof c?c.split(" "):[c];4>d;d++)e[a+U[d]+b]=f[d]||f[d-2]||f[0];return e}},Hb.test(a)||(n.cssHooks[a+b].set=Xb)}),n.fn.extend({css:function(a,b){return W(this,function(a,b,c){var d,e,f={},g=0;if(n.isArray(b)){for(d=Jb(a),e=b.length;e>g;g++)f[b[g]]=n.css(a,b[g],!1,d);return f}return void 0!==c?n.style(a,b,c):n.css(a,b) },a,b,arguments.length>1)},show:function(){return Wb(this,!0)},hide:function(){return Wb(this)},toggle:function(a){return"boolean"==typeof a?a?this.show():this.hide():this.each(function(){V(this)?n(this).show():n(this).hide()})}});function $b(a,b,c,d,e){return new $b.prototype.init(a,b,c,d,e)}n.Tween=$b,$b.prototype={constructor:$b,init:function(a,b,c,d,e,f){this.elem=a,this.prop=c,this.easing=e||"swing",this.options=b,this.start=this.now=this.cur(),this.end=d,this.unit=f||(n.cssNumber[c]?"":"px")},cur:function(){var a=$b.propHooks[this.prop];return a&&a.get?a.get(this):$b.propHooks._default.get(this)},run:function(a){var b,c=$b.propHooks[this.prop];return this.pos=b=this.options.duration?n.easing[this.easing](a,this.options.duration*a,0,1,this.options.duration):a,this.now=(this.end-this.start)*b+this.start,this.options.step&&this.options.step.call(this.elem,this.now,this),c&&c.set?c.set(this):$b.propHooks._default.set(this),this}},$b.prototype.init.prototype=$b.prototype,$b.propHooks={_default:{get:function(a){var b;return null==a.elem[a.prop]||a.elem.style&&null!=a.elem.style[a.prop]?(b=n.css(a.elem,a.prop,""),b&&"auto"!==b?b:0):a.elem[a.prop]},set:function(a){n.fx.step[a.prop]?n.fx.step[a.prop](a):a.elem.style&&(null!=a.elem.style[n.cssProps[a.prop]]||n.cssHooks[a.prop])?n.style(a.elem,a.prop,a.now+a.unit):a.elem[a.prop]=a.now}}},$b.propHooks.scrollTop=$b.propHooks.scrollLeft={set:function(a){a.elem.nodeType&&a.elem.parentNode&&(a.elem[a.prop]=a.now)}},n.easing={linear:function(a){return a},swing:function(a){return.5-Math.cos(a*Math.PI)/2}},n.fx=$b.prototype.init,n.fx.step={};var _b,ac,bc=/^(?:toggle|show|hide)$/,cc=new RegExp("^(?:([+-])=|)("+T+")([a-z%]*)$","i"),dc=/queueHooks$/,ec=[jc],fc={"*":[function(a,b){var c=this.createTween(a,b),d=c.cur(),e=cc.exec(b),f=e&&e[3]||(n.cssNumber[a]?"":"px"),g=(n.cssNumber[a]||"px"!==f&&+d)&&cc.exec(n.css(c.elem,a)),h=1,i=20;if(g&&g[3]!==f){f=f||g[3],e=e||[],g=+d||1;do h=h||".5",g/=h,n.style(c.elem,a,g+f);while(h!==(h=c.cur()/d)&&1!==h&&--i)}return e&&(g=c.start=+g||+d||0,c.unit=f,c.end=e[1]?g+(e[1]+1)*e[2]:+e[2]),c}]};function gc(){return setTimeout(function(){_b=void 0}),_b=n.now()}function hc(a,b){var c,d={height:a},e=0;for(b=b?1:0;4>e;e+=2-b)c=U[e],d["margin"+c]=d["padding"+c]=a;return b&&(d.opacity=d.width=a),d}function ic(a,b,c){for(var d,e=(fc[b]||[]).concat(fc["*"]),f=0,g=e.length;g>f;f++)if(d=e[f].call(c,b,a))return d}function jc(a,b,c){var d,e,f,g,h,i,j,k,m=this,o={},p=a.style,q=a.nodeType&&V(a),r=n._data(a,"fxshow");c.queue||(h=n._queueHooks(a,"fx"),null==h.unqueued&&(h.unqueued=0,i=h.empty.fire,h.empty.fire=function(){h.unqueued||i()}),h.unqueued++,m.always(function(){m.always(function(){h.unqueued--,n.queue(a,"fx").length||h.empty.fire()})})),1===a.nodeType&&("height"in b||"width"in b)&&(c.overflow=[p.overflow,p.overflowX,p.overflowY],j=n.css(a,"display"),k=Gb(a.nodeName),"none"===j&&(j=k),"inline"===j&&"none"===n.css(a,"float")&&(l.inlineBlockNeedsLayout&&"inline"!==k?p.zoom=1:p.display="inline-block")),c.overflow&&(p.overflow="hidden",l.shrinkWrapBlocks()||m.always(function(){p.overflow=c.overflow[0],p.overflowX=c.overflow[1],p.overflowY=c.overflow[2]}));for(d in b)if(e=b[d],bc.exec(e)){if(delete b[d],f=f||"toggle"===e,e===(q?"hide":"show")){if("show"!==e||!r||void 0===r[d])continue;q=!0}o[d]=r&&r[d]||n.style(a,d)}if(!n.isEmptyObject(o)){r?"hidden"in r&&(q=r.hidden):r=n._data(a,"fxshow",{}),f&&(r.hidden=!q),q?n(a).show():m.done(function(){n(a).hide()}),m.done(function(){var b;n._removeData(a,"fxshow");for(b in o)n.style(a,b,o[b])});for(d in o)g=ic(q?r[d]:0,d,m),d in r||(r[d]=g.start,q&&(g.end=g.start,g.start="width"===d||"height"===d?1:0))}}function kc(a,b){var c,d,e,f,g;for(c in a)if(d=n.camelCase(c),e=b[d],f=a[c],n.isArray(f)&&(e=f[1],f=a[c]=f[0]),c!==d&&(a[d]=f,delete a[c]),g=n.cssHooks[d],g&&"expand"in g){f=g.expand(f),delete a[d];for(c in f)c in a||(a[c]=f[c],b[c]=e)}else b[d]=e}function lc(a,b,c){var d,e,f=0,g=ec.length,h=n.Deferred().always(function(){delete i.elem}),i=function(){if(e)return!1;for(var b=_b||gc(),c=Math.max(0,j.startTime+j.duration-b),d=c/j.duration||0,f=1-d,g=0,i=j.tweens.length;i>g;g++)j.tweens[g].run(f);return h.notifyWith(a,[j,f,c]),1>f&&i?c:(h.resolveWith(a,[j]),!1)},j=h.promise({elem:a,props:n.extend({},b),opts:n.extend(!0,{specialEasing:{}},c),originalProperties:b,originalOptions:c,startTime:_b||gc(),duration:c.duration,tweens:[],createTween:function(b,c){var d=n.Tween(a,j.opts,b,c,j.opts.specialEasing[b]||j.opts.easing);return j.tweens.push(d),d},stop:function(b){var c=0,d=b?j.tweens.length:0;if(e)return this;for(e=!0;d>c;c++)j.tweens[c].run(1);return b?h.resolveWith(a,[j,b]):h.rejectWith(a,[j,b]),this}}),k=j.props;for(kc(k,j.opts.specialEasing);g>f;f++)if(d=ec[f].call(j,a,k,j.opts))return d;return n.map(k,ic,j),n.isFunction(j.opts.start)&&j.opts.start.call(a,j),n.fx.timer(n.extend(i,{elem:a,anim:j,queue:j.opts.queue})),j.progress(j.opts.progress).done(j.opts.done,j.opts.complete).fail(j.opts.fail).always(j.opts.always)}n.Animation=n.extend(lc,{tweener:function(a,b){n.isFunction(a)?(b=a,a=["*"]):a=a.split(" ");for(var c,d=0,e=a.length;e>d;d++)c=a[d],fc[c]=fc[c]||[],fc[c].unshift(b)},prefilter:function(a,b){b?ec.unshift(a):ec.push(a)}}),n.speed=function(a,b,c){var d=a&&"object"==typeof a?n.extend({},a):{complete:c||!c&&b||n.isFunction(a)&&a,duration:a,easing:c&&b||b&&!n.isFunction(b)&&b};return d.duration=n.fx.off?0:"number"==typeof d.duration?d.duration:d.duration in n.fx.speeds?n.fx.speeds[d.duration]:n.fx.speeds._default,(null==d.queue||d.queue===!0)&&(d.queue="fx"),d.old=d.complete,d.complete=function(){n.isFunction(d.old)&&d.old.call(this),d.queue&&n.dequeue(this,d.queue)},d},n.fn.extend({fadeTo:function(a,b,c,d){return this.filter(V).css("opacity",0).show().end().animate({opacity:b},a,c,d)},animate:function(a,b,c,d){var e=n.isEmptyObject(a),f=n.speed(b,c,d),g=function(){var b=lc(this,n.extend({},a),f);(e||n._data(this,"finish"))&&b.stop(!0)};return g.finish=g,e||f.queue===!1?this.each(g):this.queue(f.queue,g)},stop:function(a,b,c){var d=function(a){var b=a.stop;delete a.stop,b(c)};return"string"!=typeof a&&(c=b,b=a,a=void 0),b&&a!==!1&&this.queue(a||"fx",[]),this.each(function(){var b=!0,e=null!=a&&a+"queueHooks",f=n.timers,g=n._data(this);if(e)g[e]&&g[e].stop&&d(g[e]);else for(e in g)g[e]&&g[e].stop&&dc.test(e)&&d(g[e]);for(e=f.length;e--;)f[e].elem!==this||null!=a&&f[e].queue!==a||(f[e].anim.stop(c),b=!1,f.splice(e,1));(b||!c)&&n.dequeue(this,a)})},finish:function(a){return a!==!1&&(a=a||"fx"),this.each(function(){var b,c=n._data(this),d=c[a+"queue"],e=c[a+"queueHooks"],f=n.timers,g=d?d.length:0;for(c.finish=!0,n.queue(this,a,[]),e&&e.stop&&e.stop.call(this,!0),b=f.length;b--;)f[b].elem===this&&f[b].queue===a&&(f[b].anim.stop(!0),f.splice(b,1));for(b=0;g>b;b++)d[b]&&d[b].finish&&d[b].finish.call(this);delete c.finish})}}),n.each(["toggle","show","hide"],function(a,b){var c=n.fn[b];n.fn[b]=function(a,d,e){return null==a||"boolean"==typeof a?c.apply(this,arguments):this.animate(hc(b,!0),a,d,e)}}),n.each({slideDown:hc("show"),slideUp:hc("hide"),slideToggle:hc("toggle"),fadeIn:{opacity:"show"},fadeOut:{opacity:"hide"},fadeToggle:{opacity:"toggle"}},function(a,b){n.fn[a]=function(a,c,d){return this.animate(b,a,c,d)}}),n.timers=[],n.fx.tick=function(){var a,b=n.timers,c=0;for(_b=n.now();c<b.length;c++)a=b[c],a()||b[c]!==a||b.splice(c--,1);b.length||n.fx.stop(),_b=void 0},n.fx.timer=function(a){n.timers.push(a),a()?n.fx.start():n.timers.pop()},n.fx.interval=13,n.fx.start=function(){ac||(ac=setInterval(n.fx.tick,n.fx.interval))},n.fx.stop=function(){clearInterval(ac),ac=null},n.fx.speeds={slow:600,fast:200,_default:400},n.fn.delay=function(a,b){return a=n.fx?n.fx.speeds[a]||a:a,b=b||"fx",this.queue(b,function(b,c){var d=setTimeout(b,a);c.stop=function(){clearTimeout(d)}})},function(){var a,b,c,d,e=z.createElement("div");e.setAttribute("className","t"),e.innerHTML=" <link/><table></table><a href='/a'>a</a><input type='checkbox'/>",a=e.getElementsByTagName("a")[0],c=z.createElement("select"),d=c.appendChild(z.createElement("option")),b=e.getElementsByTagName("input")[0],a.style.cssText="top:1px",l.getSetAttribute="t"!==e.className,l.style=/top/.test(a.getAttribute("style")),l.hrefNormalized="/a"===a.getAttribute("href"),l.checkOn=!!b.value,l.optSelected=d.selected,l.enctype=!!z.createElement("form").enctype,c.disabled=!0,l.optDisabled=!d.disabled,b=z.createElement("input"),b.setAttribute("value",""),l.input=""===b.getAttribute("value"),b.value="t",b.setAttribute("type","radio"),l.radioValue="t"===b.value,a=b=c=d=e=null}();var mc=/\r/g;n.fn.extend({val:function(a){var b,c,d,e=this[0];{if(arguments.length)return d=n.isFunction(a),this.each(function(c){var e;1===this.nodeType&&(e=d?a.call(this,c,n(this).val()):a,null==e?e="":"number"==typeof e?e+="":n.isArray(e)&&(e=n.map(e,function(a){return null==a?"":a+""})),b=n.valHooks[this.type]||n.valHooks[this.nodeName.toLowerCase()],b&&"set"in b&&void 0!==b.set(this,e,"value")||(this.value=e))});if(e)return b=n.valHooks[e.type]||n.valHooks[e.nodeName.toLowerCase()],b&&"get"in b&&void 0!==(c=b.get(e,"value"))?c:(c=e.value,"string"==typeof c?c.replace(mc,""):null==c?"":c)}}}),n.extend({valHooks:{option:{get:function(a){var b=n.find.attr(a,"value");return null!=b?b:n.text(a)}},select:{get:function(a){for(var b,c,d=a.options,e=a.selectedIndex,f="select-one"===a.type||0>e,g=f?null:[],h=f?e+1:d.length,i=0>e?h:f?e:0;h>i;i++)if(c=d[i],!(!c.selected&&i!==e||(l.optDisabled?c.disabled:null!==c.getAttribute("disabled"))||c.parentNode.disabled&&n.nodeName(c.parentNode,"optgroup"))){if(b=n(c).val(),f)return b;g.push(b)}return g},set:function(a,b){var c,d,e=a.options,f=n.makeArray(b),g=e.length;while(g--)if(d=e[g],n.inArray(n.valHooks.option.get(d),f)>=0)try{d.selected=c=!0}catch(h){d.scrollHeight}else d.selected=!1;return c||(a.selectedIndex=-1),e}}}}),n.each(["radio","checkbox"],function(){n.valHooks[this]={set:function(a,b){return n.isArray(b)?a.checked=n.inArray(n(a).val(),b)>=0:void 0}},l.checkOn||(n.valHooks[this].get=function(a){return null===a.getAttribute("value")?"on":a.value})});var nc,oc,pc=n.expr.attrHandle,qc=/^(?:checked|selected)$/i,rc=l.getSetAttribute,sc=l.input;n.fn.extend({attr:function(a,b){return W(this,n.attr,a,b,arguments.length>1)},removeAttr:function(a){return this.each(function(){n.removeAttr(this,a)})}}),n.extend({attr:function(a,b,c){var d,e,f=a.nodeType;if(a&&3!==f&&8!==f&&2!==f)return typeof a.getAttribute===L?n.prop(a,b,c):(1===f&&n.isXMLDoc(a)||(b=b.toLowerCase(),d=n.attrHooks[b]||(n.expr.match.bool.test(b)?oc:nc)),void 0===c?d&&"get"in d&&null!==(e=d.get(a,b))?e:(e=n.find.attr(a,b),null==e?void 0:e):null!==c?d&&"set"in d&&void 0!==(e=d.set(a,c,b))?e:(a.setAttribute(b,c+""),c):void n.removeAttr(a,b))},removeAttr:function(a,b){var c,d,e=0,f=b&&b.match(F);if(f&&1===a.nodeType)while(c=f[e++])d=n.propFix[c]||c,n.expr.match.bool.test(c)?sc&&rc||!qc.test(c)?a[d]=!1:a[n.camelCase("default-"+c)]=a[d]=!1:n.attr(a,c,""),a.removeAttribute(rc?c:d)},attrHooks:{type:{set:function(a,b){if(!l.radioValue&&"radio"===b&&n.nodeName(a,"input")){var c=a.value;return a.setAttribute("type",b),c&&(a.value=c),b}}}}}),oc={set:function(a,b,c){return b===!1?n.removeAttr(a,c):sc&&rc||!qc.test(c)?a.setAttribute(!rc&&n.propFix[c]||c,c):a[n.camelCase("default-"+c)]=a[c]=!0,c}},n.each(n.expr.match.bool.source.match(/\w+/g),function(a,b){var c=pc[b]||n.find.attr;pc[b]=sc&&rc||!qc.test(b)?function(a,b,d){var e,f;return d||(f=pc[b],pc[b]=e,e=null!=c(a,b,d)?b.toLowerCase():null,pc[b]=f),e}:function(a,b,c){return c?void 0:a[n.camelCase("default-"+b)]?b.toLowerCase():null}}),sc&&rc||(n.attrHooks.value={set:function(a,b,c){return n.nodeName(a,"input")?void(a.defaultValue=b):nc&&nc.set(a,b,c)}}),rc||(nc={set:function(a,b,c){var d=a.getAttributeNode(c);return d||a.setAttributeNode(d=a.ownerDocument.createAttribute(c)),d.value=b+="","value"===c||b===a.getAttribute(c)?b:void 0}},pc.id=pc.name=pc.coords=function(a,b,c){var d;return c?void 0:(d=a.getAttributeNode(b))&&""!==d.value?d.value:null},n.valHooks.button={get:function(a,b){var c=a.getAttributeNode(b);return c&&c.specified?c.value:void 0},set:nc.set},n.attrHooks.contenteditable={set:function(a,b,c){nc.set(a,""===b?!1:b,c)}},n.each(["width","height"],function(a,b){n.attrHooks[b]={set:function(a,c){return""===c?(a.setAttribute(b,"auto"),c):void 0}}})),l.style||(n.attrHooks.style={get:function(a){return a.style.cssText||void 0},set:function(a,b){return a.style.cssText=b+""}});var tc=/^(?:input|select|textarea|button|object)$/i,uc=/^(?:a|area)$/i;n.fn.extend({prop:function(a,b){return W(this,n.prop,a,b,arguments.length>1)},removeProp:function(a){return a=n.propFix[a]||a,this.each(function(){try{this[a]=void 0,delete this[a]}catch(b){}})}}),n.extend({propFix:{"for":"htmlFor","class":"className"},prop:function(a,b,c){var d,e,f,g=a.nodeType;if(a&&3!==g&&8!==g&&2!==g)return f=1!==g||!n.isXMLDoc(a),f&&(b=n.propFix[b]||b,e=n.propHooks[b]),void 0!==c?e&&"set"in e&&void 0!==(d=e.set(a,c,b))?d:a[b]=c:e&&"get"in e&&null!==(d=e.get(a,b))?d:a[b]},propHooks:{tabIndex:{get:function(a){var b=n.find.attr(a,"tabindex");return b?parseInt(b,10):tc.test(a.nodeName)||uc.test(a.nodeName)&&a.href?0:-1}}}}),l.hrefNormalized||n.each(["href","src"],function(a,b){n.propHooks[b]={get:function(a){return a.getAttribute(b,4)}}}),l.optSelected||(n.propHooks.selected={get:function(a){var b=a.parentNode;return b&&(b.selectedIndex,b.parentNode&&b.parentNode.selectedIndex),null}}),n.each(["tabIndex","readOnly","maxLength","cellSpacing","cellPadding","rowSpan","colSpan","useMap","frameBorder","contentEditable"],function(){n.propFix[this.toLowerCase()]=this}),l.enctype||(n.propFix.enctype="encoding");var vc=/[\t\r\n\f]/g;n.fn.extend({addClass:function(a){var b,c,d,e,f,g,h=0,i=this.length,j="string"==typeof a&&a;if(n.isFunction(a))return this.each(function(b){n(this).addClass(a.call(this,b,this.className))});if(j)for(b=(a||"").match(F)||[];i>h;h++)if(c=this[h],d=1===c.nodeType&&(c.className?(" "+c.className+" ").replace(vc," "):" ")){f=0;while(e=b[f++])d.indexOf(" "+e+" ")<0&&(d+=e+" ");g=n.trim(d),c.className!==g&&(c.className=g)}return this},removeClass:function(a){var b,c,d,e,f,g,h=0,i=this.length,j=0===arguments.length||"string"==typeof a&&a;if(n.isFunction(a))return this.each(function(b){n(this).removeClass(a.call(this,b,this.className))});if(j)for(b=(a||"").match(F)||[];i>h;h++)if(c=this[h],d=1===c.nodeType&&(c.className?(" "+c.className+" ").replace(vc," "):"")){f=0;while(e=b[f++])while(d.indexOf(" "+e+" ")>=0)d=d.replace(" "+e+" "," ");g=a?n.trim(d):"",c.className!==g&&(c.className=g)}return this},toggleClass:function(a,b){var c=typeof a;return"boolean"==typeof b&&"string"===c?b?this.addClass(a):this.removeClass(a):this.each(n.isFunction(a)?function(c){n(this).toggleClass(a.call(this,c,this.className,b),b)}:function(){if("string"===c){var b,d=0,e=n(this),f=a.match(F)||[];while(b=f[d++])e.hasClass(b)?e.removeClass(b):e.addClass(b)}else(c===L||"boolean"===c)&&(this.className&&n._data(this,"__className__",this.className),this.className=this.className||a===!1?"":n._data(this,"__className__")||"")})},hasClass:function(a){for(var b=" "+a+" ",c=0,d=this.length;d>c;c++)if(1===this[c].nodeType&&(" "+this[c].className+" ").replace(vc," ").indexOf(b)>=0)return!0;return!1}}),n.each("blur focus focusin focusout load resize scroll unload click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select submit keydown keypress keyup error contextmenu".split(" "),function(a,b){n.fn[b]=function(a,c){return arguments.length>0?this.on(b,null,a,c):this.trigger(b)}}),n.fn.extend({hover:function(a,b){return this.mouseenter(a).mouseleave(b||a)},bind:function(a,b,c){return this.on(a,null,b,c)},unbind:function(a,b){return this.off(a,null,b)},delegate:function(a,b,c,d){return this.on(b,a,c,d)},undelegate:function(a,b,c){return 1===arguments.length?this.off(a,"**"):this.off(b,a||"**",c)}});var wc=n.now(),xc=/\?/,yc=/(,)|(\[|{)|(}|])|"(?:[^"\\\r\n]|\\["\\\/bfnrt]|\\u[\da-fA-F]{4})*"\s*:?|true|false|null|-?(?!0\d)\d+(?:\.\d+|)(?:[eE][+-]?\d+|)/g;n.parseJSON=function(b){if(a.JSON&&a.JSON.parse)return a.JSON.parse(b+"");var c,d=null,e=n.trim(b+"");return e&&!n.trim(e.replace(yc,function(a,b,e,f){return c&&b&&(d=0),0===d?a:(c=e||b,d+=!f-!e,"")}))?Function("return "+e)():n.error("Invalid JSON: "+b)},n.parseXML=function(b){var c,d;if(!b||"string"!=typeof b)return null;try{a.DOMParser?(d=new DOMParser,c=d.parseFromString(b,"text/xml")):(c=new ActiveXObject("Microsoft.XMLDOM"),c.async="false",c.loadXML(b))}catch(e){c=void 0}return c&&c.documentElement&&!c.getElementsByTagName("parsererror").length||n.error("Invalid XML: "+b),c};var zc,Ac,Bc=/#.*$/,Cc=/([?&])_=[^&]*/,Dc=/^(.*?):[ \t]*([^\r\n]*)\r?$/gm,Ec=/^(?:about|app|app-storage|.+-extension|file|res|widget):$/,Fc=/^(?:GET|HEAD)$/,Gc=/^\/\//,Hc=/^([\w.+-]+:)(?:\/\/(?:[^\/?#]*@|)([^\/?#:]*)(?::(\d+)|)|)/,Ic={},Jc={},Kc="*/".concat("*");try{Ac=location.href}catch(Lc){Ac=z.createElement("a"),Ac.href="",Ac=Ac.href}zc=Hc.exec(Ac.toLowerCase())||[];function Mc(a){return function(b,c){"string"!=typeof b&&(c=b,b="*");var d,e=0,f=b.toLowerCase().match(F)||[];if(n.isFunction(c))while(d=f[e++])"+"===d.charAt(0)?(d=d.slice(1)||"*",(a[d]=a[d]||[]).unshift(c)):(a[d]=a[d]||[]).push(c)}}function Nc(a,b,c,d){var e={},f=a===Jc;function g(h){var i;return e[h]=!0,n.each(a[h]||[],function(a,h){var j=h(b,c,d);return"string"!=typeof j||f||e[j]?f?!(i=j):void 0:(b.dataTypes.unshift(j),g(j),!1)}),i}return g(b.dataTypes[0])||!e["*"]&&g("*")}function Oc(a,b){var c,d,e=n.ajaxSettings.flatOptions||{};for(d in b)void 0!==b[d]&&((e[d]?a:c||(c={}))[d]=b[d]);return c&&n.extend(!0,a,c),a}function Pc(a,b,c){var d,e,f,g,h=a.contents,i=a.dataTypes;while("*"===i[0])i.shift(),void 0===e&&(e=a.mimeType||b.getResponseHeader("Content-Type"));if(e)for(g in h)if(h[g]&&h[g].test(e)){i.unshift(g);break}if(i[0]in c)f=i[0];else{for(g in c){if(!i[0]||a.converters[g+" "+i[0]]){f=g;break}d||(d=g)}f=f||d}return f?(f!==i[0]&&i.unshift(f),c[f]):void 0}function Qc(a,b,c,d){var e,f,g,h,i,j={},k=a.dataTypes.slice();if(k[1])for(g in a.converters)j[g.toLowerCase()]=a.converters[g];f=k.shift();while(f)if(a.responseFields[f]&&(c[a.responseFields[f]]=b),!i&&d&&a.dataFilter&&(b=a.dataFilter(b,a.dataType)),i=f,f=k.shift())if("*"===f)f=i;else if("*"!==i&&i!==f){if(g=j[i+" "+f]||j["* "+f],!g)for(e in j)if(h=e.split(" "),h[1]===f&&(g=j[i+" "+h[0]]||j["* "+h[0]])){g===!0?g=j[e]:j[e]!==!0&&(f=h[0],k.unshift(h[1]));break}if(g!==!0)if(g&&a["throws"])b=g(b);else try{b=g(b)}catch(l){return{state:"parsererror",error:g?l:"No conversion from "+i+" to "+f}}}return{state:"success",data:b}}n.extend({active:0,lastModified:{},etag:{},ajaxSettings:{url:Ac,type:"GET",isLocal:Ec.test(zc[1]),global:!0,processData:!0,async:!0,contentType:"application/x-www-form-urlencoded; charset=UTF-8",accepts:{"*":Kc,text:"text/plain",html:"text/html",xml:"application/xml, text/xml",json:"application/json, text/javascript"},contents:{xml:/xml/,html:/html/,json:/json/},responseFields:{xml:"responseXML",text:"responseText",json:"responseJSON"},converters:{"* text":String,"text html":!0,"text json":n.parseJSON,"text xml":n.parseXML},flatOptions:{url:!0,context:!0}},ajaxSetup:function(a,b){return b?Oc(Oc(a,n.ajaxSettings),b):Oc(n.ajaxSettings,a)},ajaxPrefilter:Mc(Ic),ajaxTransport:Mc(Jc),ajax:function(a,b){"object"==typeof a&&(b=a,a=void 0),b=b||{};var c,d,e,f,g,h,i,j,k=n.ajaxSetup({},b),l=k.context||k,m=k.context&&(l.nodeType||l.jquery)?n(l):n.event,o=n.Deferred(),p=n.Callbacks("once memory"),q=k.statusCode||{},r={},s={},t=0,u="canceled",v={readyState:0,getResponseHeader:function(a){var b;if(2===t){if(!j){j={};while(b=Dc.exec(f))j[b[1].toLowerCase()]=b[2]}b=j[a.toLowerCase()]}return null==b?null:b},getAllResponseHeaders:function(){return 2===t?f:null},setRequestHeader:function(a,b){var c=a.toLowerCase();return t||(a=s[c]=s[c]||a,r[a]=b),this},overrideMimeType:function(a){return t||(k.mimeType=a),this},statusCode:function(a){var b;if(a)if(2>t)for(b in a)q[b]=[q[b],a[b]];else v.always(a[v.status]);return this},abort:function(a){var b=a||u;return i&&i.abort(b),x(0,b),this}};if(o.promise(v).complete=p.add,v.success=v.done,v.error=v.fail,k.url=((a||k.url||Ac)+"").replace(Bc,"").replace(Gc,zc[1]+"//"),k.type=b.method||b.type||k.method||k.type,k.dataTypes=n.trim(k.dataType||"*").toLowerCase().match(F)||[""],null==k.crossDomain&&(c=Hc.exec(k.url.toLowerCase()),k.crossDomain=!(!c||c[1]===zc[1]&&c[2]===zc[2]&&(c[3]||("http:"===c[1]?"80":"443"))===(zc[3]||("http:"===zc[1]?"80":"443")))),k.data&&k.processData&&"string"!=typeof k.data&&(k.data=n.param(k.data,k.traditional)),Nc(Ic,k,b,v),2===t)return v;h=k.global,h&&0===n.active++&&n.event.trigger("ajaxStart"),k.type=k.type.toUpperCase(),k.hasContent=!Fc.test(k.type),e=k.url,k.hasContent||(k.data&&(e=k.url+=(xc.test(e)?"&":"?")+k.data,delete k.data),k.cache===!1&&(k.url=Cc.test(e)?e.replace(Cc,"$1_="+wc++):e+(xc.test(e)?"&":"?")+"_="+wc++)),k.ifModified&&(n.lastModified[e]&&v.setRequestHeader("If-Modified-Since",n.lastModified[e]),n.etag[e]&&v.setRequestHeader("If-None-Match",n.etag[e])),(k.data&&k.hasContent&&k.contentType!==!1||b.contentType)&&v.setRequestHeader("Content-Type",k.contentType),v.setRequestHeader("Accept",k.dataTypes[0]&&k.accepts[k.dataTypes[0]]?k.accepts[k.dataTypes[0]]+("*"!==k.dataTypes[0]?", "+Kc+"; q=0.01":""):k.accepts["*"]);for(d in k.headers)v.setRequestHeader(d,k.headers[d]);if(k.beforeSend&&(k.beforeSend.call(l,v,k)===!1||2===t))return v.abort();u="abort";for(d in{success:1,error:1,complete:1})v[d](k[d]);if(i=Nc(Jc,k,b,v)){v.readyState=1,h&&m.trigger("ajaxSend",[v,k]),k.async&&k.timeout>0&&(g=setTimeout(function(){v.abort("timeout")},k.timeout));try{t=1,i.send(r,x)}catch(w){if(!(2>t))throw w;x(-1,w)}}else x(-1,"No Transport");function x(a,b,c,d){var j,r,s,u,w,x=b;2!==t&&(t=2,g&&clearTimeout(g),i=void 0,f=d||"",v.readyState=a>0?4:0,j=a>=200&&300>a||304===a,c&&(u=Pc(k,v,c)),u=Qc(k,u,v,j),j?(k.ifModified&&(w=v.getResponseHeader("Last-Modified"),w&&(n.lastModified[e]=w),w=v.getResponseHeader("etag"),w&&(n.etag[e]=w)),204===a||"HEAD"===k.type?x="nocontent":304===a?x="notmodified":(x=u.state,r=u.data,s=u.error,j=!s)):(s=x,(a||!x)&&(x="error",0>a&&(a=0))),v.status=a,v.statusText=(b||x)+"",j?o.resolveWith(l,[r,x,v]):o.rejectWith(l,[v,x,s]),v.statusCode(q),q=void 0,h&&m.trigger(j?"ajaxSuccess":"ajaxError",[v,k,j?r:s]),p.fireWith(l,[v,x]),h&&(m.trigger("ajaxComplete",[v,k]),--n.active||n.event.trigger("ajaxStop")))}return v},getJSON:function(a,b,c){return n.get(a,b,c,"json")},getScript:function(a,b){return n.get(a,void 0,b,"script")}}),n.each(["get","post"],function(a,b){n[b]=function(a,c,d,e){return n.isFunction(c)&&(e=e||d,d=c,c=void 0),n.ajax({url:a,type:b,dataType:e,data:c,success:d})}}),n.each(["ajaxStart","ajaxStop","ajaxComplete","ajaxError","ajaxSuccess","ajaxSend"],function(a,b){n.fn[b]=function(a){return this.on(b,a)}}),n._evalUrl=function(a){return n.ajax({url:a,type:"GET",dataType:"script",async:!1,global:!1,"throws":!0})},n.fn.extend({wrapAll:function(a){if(n.isFunction(a))return this.each(function(b){n(this).wrapAll(a.call(this,b))});if(this[0]){var b=n(a,this[0].ownerDocument).eq(0).clone(!0);this[0].parentNode&&b.insertBefore(this[0]),b.map(function(){var a=this;while(a.firstChild&&1===a.firstChild.nodeType)a=a.firstChild;return a}).append(this)}return this},wrapInner:function(a){return this.each(n.isFunction(a)?function(b){n(this).wrapInner(a.call(this,b))}:function(){var b=n(this),c=b.contents();c.length?c.wrapAll(a):b.append(a)})},wrap:function(a){var b=n.isFunction(a);return this.each(function(c){n(this).wrapAll(b?a.call(this,c):a)})},unwrap:function(){return this.parent().each(function(){n.nodeName(this,"body")||n(this).replaceWith(this.childNodes)}).end()}}),n.expr.filters.hidden=function(a){return a.offsetWidth<=0&&a.offsetHeight<=0||!l.reliableHiddenOffsets()&&"none"===(a.style&&a.style.display||n.css(a,"display"))},n.expr.filters.visible=function(a){return!n.expr.filters.hidden(a)};var Rc=/%20/g,Sc=/\[\]$/,Tc=/\r?\n/g,Uc=/^(?:submit|button|image|reset|file)$/i,Vc=/^(?:input|select|textarea|keygen)/i;function Wc(a,b,c,d){var e;if(n.isArray(b))n.each(b,function(b,e){c||Sc.test(a)?d(a,e):Wc(a+"["+("object"==typeof e?b:"")+"]",e,c,d)});else if(c||"object"!==n.type(b))d(a,b);else for(e in b)Wc(a+"["+e+"]",b[e],c,d)}n.param=function(a,b){var c,d=[],e=function(a,b){b=n.isFunction(b)?b():null==b?"":b,d[d.length]=encodeURIComponent(a)+"="+encodeURIComponent(b)};if(void 0===b&&(b=n.ajaxSettings&&n.ajaxSettings.traditional),n.isArray(a)||a.jquery&&!n.isPlainObject(a))n.each(a,function(){e(this.name,this.value)});else for(c in a)Wc(c,a[c],b,e);return d.join("&").replace(Rc,"+")},n.fn.extend({serialize:function(){return n.param(this.serializeArray())},serializeArray:function(){return this.map(function(){var a=n.prop(this,"elements");return a?n.makeArray(a):this}).filter(function(){var a=this.type;return this.name&&!n(this).is(":disabled")&&Vc.test(this.nodeName)&&!Uc.test(a)&&(this.checked||!X.test(a))}).map(function(a,b){var c=n(this).val();return null==c?null:n.isArray(c)?n.map(c,function(a){return{name:b.name,value:a.replace(Tc,"\r\n")}}):{name:b.name,value:c.replace(Tc,"\r\n")}}).get()}}),n.ajaxSettings.xhr=void 0!==a.ActiveXObject?function(){return!this.isLocal&&/^(get|post|head|put|delete|options)$/i.test(this.type)&&$c()||_c()}:$c;var Xc=0,Yc={},Zc=n.ajaxSettings.xhr();a.ActiveXObject&&n(a).on("unload",function(){for(var a in Yc)Yc[a](void 0,!0)}),l.cors=!!Zc&&"withCredentials"in Zc,Zc=l.ajax=!!Zc,Zc&&n.ajaxTransport(function(a){if(!a.crossDomain||l.cors){var b;return{send:function(c,d){var e,f=a.xhr(),g=++Xc;if(f.open(a.type,a.url,a.async,a.username,a.password),a.xhrFields)for(e in a.xhrFields)f[e]=a.xhrFields[e];a.mimeType&&f.overrideMimeType&&f.overrideMimeType(a.mimeType),a.crossDomain||c["X-Requested-With"]||(c["X-Requested-With"]="XMLHttpRequest");for(e in c)void 0!==c[e]&&f.setRequestHeader(e,c[e]+"");f.send(a.hasContent&&a.data||null),b=function(c,e){var h,i,j;if(b&&(e||4===f.readyState))if(delete Yc[g],b=void 0,f.onreadystatechange=n.noop,e)4!==f.readyState&&f.abort();else{j={},h=f.status,"string"==typeof f.responseText&&(j.text=f.responseText);try{i=f.statusText}catch(k){i=""}h||!a.isLocal||a.crossDomain?1223===h&&(h=204):h=j.text?200:404}j&&d(h,i,j,f.getAllResponseHeaders())},a.async?4===f.readyState?setTimeout(b):f.onreadystatechange=Yc[g]=b:b()},abort:function(){b&&b(void 0,!0)}}}});function $c(){try{return new a.XMLHttpRequest}catch(b){}}function _c(){try{return new a.ActiveXObject("Microsoft.XMLHTTP")}catch(b){}}n.ajaxSetup({accepts:{script:"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"},contents:{script:/(?:java|ecma)script/},converters:{"text script":function(a){return n.globalEval(a),a}}}),n.ajaxPrefilter("script",function(a){void 0===a.cache&&(a.cache=!1),a.crossDomain&&(a.type="GET",a.global=!1)}),n.ajaxTransport("script",function(a){if(a.crossDomain){var b,c=z.head||n("head")[0]||z.documentElement;return{send:function(d,e){b=z.createElement("script"),b.async=!0,a.scriptCharset&&(b.charset=a.scriptCharset),b.src=a.url,b.onload=b.onreadystatechange=function(a,c){(c||!b.readyState||/loaded|complete/.test(b.readyState))&&(b.onload=b.onreadystatechange=null,b.parentNode&&b.parentNode.removeChild(b),b=null,c||e(200,"success"))},c.insertBefore(b,c.firstChild)},abort:function(){b&&b.onload(void 0,!0)}}}});var ad=[],bd=/(=)\?(?=&|$)|\?\?/;n.ajaxSetup({jsonp:"callback",jsonpCallback:function(){var a=ad.pop()||n.expando+"_"+wc++;return this[a]=!0,a}}),n.ajaxPrefilter("json jsonp",function(b,c,d){var e,f,g,h=b.jsonp!==!1&&(bd.test(b.url)?"url":"string"==typeof b.data&&!(b.contentType||"").indexOf("application/x-www-form-urlencoded")&&bd.test(b.data)&&"data");return h||"jsonp"===b.dataTypes[0]?(e=b.jsonpCallback=n.isFunction(b.jsonpCallback)?b.jsonpCallback():b.jsonpCallback,h?b[h]=b[h].replace(bd,"$1"+e):b.jsonp!==!1&&(b.url+=(xc.test(b.url)?"&":"?")+b.jsonp+"="+e),b.converters["script json"]=function(){return g||n.error(e+" was not called"),g[0]},b.dataTypes[0]="json",f=a[e],a[e]=function(){g=arguments},d.always(function(){a[e]=f,b[e]&&(b.jsonpCallback=c.jsonpCallback,ad.push(e)),g&&n.isFunction(f)&&f(g[0]),g=f=void 0}),"script"):void 0}),n.parseHTML=function(a,b,c){if(!a||"string"!=typeof a)return null;"boolean"==typeof b&&(c=b,b=!1),b=b||z;var d=v.exec(a),e=!c&&[];return d?[b.createElement(d[1])]:(d=n.buildFragment([a],b,e),e&&e.length&&n(e).remove(),n.merge([],d.childNodes))};var cd=n.fn.load;n.fn.load=function(a,b,c){if("string"!=typeof a&&cd)return cd.apply(this,arguments);var d,e,f,g=this,h=a.indexOf(" ");return h>=0&&(d=a.slice(h,a.length),a=a.slice(0,h)),n.isFunction(b)?(c=b,b=void 0):b&&"object"==typeof b&&(f="POST"),g.length>0&&n.ajax({url:a,type:f,dataType:"html",data:b}).done(function(a){e=arguments,g.html(d?n("<div>").append(n.parseHTML(a)).find(d):a)}).complete(c&&function(a,b){g.each(c,e||[a.responseText,b,a])}),this},n.expr.filters.animated=function(a){return n.grep(n.timers,function(b){return a===b.elem}).length};var dd=a.document.documentElement;function ed(a){return n.isWindow(a)?a:9===a.nodeType?a.defaultView||a.parentWindow:!1}n.offset={setOffset:function(a,b,c){var d,e,f,g,h,i,j,k=n.css(a,"position"),l=n(a),m={};"static"===k&&(a.style.position="relative"),h=l.offset(),f=n.css(a,"top"),i=n.css(a,"left"),j=("absolute"===k||"fixed"===k)&&n.inArray("auto",[f,i])>-1,j?(d=l.position(),g=d.top,e=d.left):(g=parseFloat(f)||0,e=parseFloat(i)||0),n.isFunction(b)&&(b=b.call(a,c,h)),null!=b.top&&(m.top=b.top-h.top+g),null!=b.left&&(m.left=b.left-h.left+e),"using"in b?b.using.call(a,m):l.css(m)}},n.fn.extend({offset:function(a){if(arguments.length)return void 0===a?this:this.each(function(b){n.offset.setOffset(this,a,b)});var b,c,d={top:0,left:0},e=this[0],f=e&&e.ownerDocument;if(f)return b=f.documentElement,n.contains(b,e)?(typeof e.getBoundingClientRect!==L&&(d=e.getBoundingClientRect()),c=ed(f),{top:d.top+(c.pageYOffset||b.scrollTop)-(b.clientTop||0),left:d.left+(c.pageXOffset||b.scrollLeft)-(b.clientLeft||0)}):d},position:function(){if(this[0]){var a,b,c={top:0,left:0},d=this[0];return"fixed"===n.css(d,"position")?b=d.getBoundingClientRect():(a=this.offsetParent(),b=this.offset(),n.nodeName(a[0],"html")||(c=a.offset()),c.top+=n.css(a[0],"borderTopWidth",!0),c.left+=n.css(a[0],"borderLeftWidth",!0)),{top:b.top-c.top-n.css(d,"marginTop",!0),left:b.left-c.left-n.css(d,"marginLeft",!0)}}},offsetParent:function(){return this.map(function(){var a=this.offsetParent||dd;while(a&&!n.nodeName(a,"html")&&"static"===n.css(a,"position"))a=a.offsetParent;return a||dd})}}),n.each({scrollLeft:"pageXOffset",scrollTop:"pageYOffset"},function(a,b){var c=/Y/.test(b);n.fn[a]=function(d){return W(this,function(a,d,e){var f=ed(a);return void 0===e?f?b in f?f[b]:f.document.documentElement[d]:a[d]:void(f?f.scrollTo(c?n(f).scrollLeft():e,c?e:n(f).scrollTop()):a[d]=e)},a,d,arguments.length,null)}}),n.each(["top","left"],function(a,b){n.cssHooks[b]=Mb(l.pixelPosition,function(a,c){return c?(c=Kb(a,b),Ib.test(c)?n(a).position()[b]+"px":c):void 0})}),n.each({Height:"height",Width:"width"},function(a,b){n.each({padding:"inner"+a,content:b,"":"outer"+a},function(c,d){n.fn[d]=function(d,e){var f=arguments.length&&(c||"boolean"!=typeof d),g=c||(d===!0||e===!0?"margin":"border");return W(this,function(b,c,d){var e;return n.isWindow(b)?b.document.documentElement["client"+a]:9===b.nodeType?(e=b.documentElement,Math.max(b.body["scroll"+a],e["scroll"+a],b.body["offset"+a],e["offset"+a],e["client"+a])):void 0===d?n.css(b,c,g):n.style(b,c,d,g)},b,f?d:void 0,f,null)}})}),n.fn.size=function(){return this.length},n.fn.andSelf=n.fn.addBack,"function"==typeof define&&define.amd&&define("jquery",[],function(){return n});var fd=a.jQuery,gd=a.$;return n.noConflict=function(b){return a.$===n&&(a.$=gd),b&&a.jQuery===n&&(a.jQuery=fd),n},typeof b===L&&(a.jQuery=a.$=n),n});
src/app/component/provider-image/provider-image.story.js
all3dp/printing-engine-client
import React from 'react' import {storiesOf} from '@storybook/react' import {action} from '@storybook/addon-actions' import ProviderImage from '.' storiesOf('ProviderImage', module) .add('default', () => <ProviderImage src="http://placehold.it/200x200" alt="placeholder image" />) .add('inline', () => ( <ProviderImage inline src="http://placehold.it/200x200" alt="placeholder image" /> )) .add('size: s', () => ( <ProviderImage size="s" src="http://placehold.it/200x200" alt="placeholder image" /> )) .add('onClick', () => ( <ProviderImage inline onClick={action('onClick')} src="http://placehold.it/200x200" alt="placeholder image" /> ))
src/svg-icons/maps/local-cafe.js
kasra-co/material-ui
import React from 'react'; import pure from 'recompose/pure'; import SvgIcon from '../../SvgIcon'; let MapsLocalCafe = (props) => ( <SvgIcon {...props}> <path d="M20 3H4v10c0 2.21 1.79 4 4 4h6c2.21 0 4-1.79 4-4v-3h2c1.11 0 2-.89 2-2V5c0-1.11-.89-2-2-2zm0 5h-2V5h2v3zM2 21h18v-2H2v2z"/> </SvgIcon> ); MapsLocalCafe = pure(MapsLocalCafe); MapsLocalCafe.displayName = 'MapsLocalCafe'; MapsLocalCafe.muiName = 'SvgIcon'; export default MapsLocalCafe;
app/javascript/mastodon/components/autosuggest_emoji.js
gol-cha/mastodon
import React from 'react'; import PropTypes from 'prop-types'; import unicodeMapping from '../features/emoji/emoji_unicode_mapping_light'; import { assetHost } from 'mastodon/utils/config'; export default class AutosuggestEmoji extends React.PureComponent { static propTypes = { emoji: PropTypes.object.isRequired, }; render () { const { emoji } = this.props; let url; if (emoji.custom) { url = emoji.imageUrl; } else { const mapping = unicodeMapping[emoji.native] || unicodeMapping[emoji.native.replace(/\uFE0F$/, '')]; if (!mapping) { return null; } url = `${assetHost}/emoji/${mapping.filename}.svg`; } return ( <div className='autosuggest-emoji'> <img className='emojione' src={url} alt={emoji.native || emoji.colons} /> {emoji.colons} </div> ); } }
app/javascript/mastodon/features/compose/components/text_icon_button.js
masto-donte-com-br/mastodon
import React from 'react'; import PropTypes from 'prop-types'; const iconStyle = { height: null, lineHeight: '27px', width: `${18 * 1.28571429}px`, }; export default class TextIconButton extends React.PureComponent { static propTypes = { label: PropTypes.string.isRequired, title: PropTypes.string, active: PropTypes.bool, onClick: PropTypes.func.isRequired, ariaControls: PropTypes.string, }; handleClick = (e) => { e.preventDefault(); this.props.onClick(); } render () { const { label, title, active, ariaControls } = this.props; return ( <button title={title} aria-label={title} className={`text-icon-button ${active ? 'active' : ''}`} aria-expanded={active} onClick={this.handleClick} aria-controls={ariaControls} style={iconStyle} > {label} </button> ); } }
src/browser/components/Radio.js
TheoMer/este
// @flow import type { CheckboxProps } from './Checkbox'; import Checkbox from './Checkbox'; import React from 'react'; export type RadioProps = CheckboxProps & { selected: any, }; const defaultSvgIconChecked = ( <svg viewBox="7 9 70 70"> <path d="M45,24c11.579,0,21,9.42,21,21c0,11.579-9.421,21-21,21c-11.58,0-21-9.421-21-21C24,33.42,33.42,24,45,24 M45,20c-13.807,0-25,11.193-25,25c0,13.807,11.193,25,25,25c13.807,0,25-11.193,25-25C70,31.193,58.807,20,45,20L45,20z" fill="#000" /> <circle cx="45" cy="45" r="16.77" /> </svg> ); const defaultSvgIconUnchecked = ( <svg viewBox="7 9 70 70"> <path d="M45,24c11.579,0,21,9.42,21,21c0,11.579-9.421,21-21,21c-11.58,0-21-9.421-21-21C24,33.42,33.42,24,45,24 M45,20c-13.807,0-25,11.193-25,25s11.193,25,25,25s25-11.193,25-25S58.807,20,45,20L45,20z" /> </svg> ); const Radio = ( { onChange, selected, svgIconChecked = defaultSvgIconChecked, svgIconUnchecked = defaultSvgIconUnchecked, value, ...props }: RadioProps, ) => ( <Checkbox inline={true} // eslint-disable-line react/jsx-boolean-value onChange={() => onChange && onChange({ value: selected })} svgIconChecked={svgIconChecked} svgIconUnchecked={svgIconUnchecked} value={value === selected} {...props} /> ); export default Radio;
docusaurus/src/components/HomepageFeatures.js
CatLabInteractive/charon
import React from 'react'; import clsx from 'clsx'; import styles from './HomepageFeatures.module.css'; /* const FeatureList = [ { title: 'Easy to Use', Svg: require('../../static/img/undraw_docusaurus_mountain.svg').default, description: ( <> Docusaurus was designed from the ground up to be easily installed and used to get your website up and running quickly. </> ), }, { title: 'Focus on What Matters', Svg: require('../../static/img/undraw_docusaurus_tree.svg').default, description: ( <> Docusaurus lets you focus on your docs, and we&apos;ll do the chores. Go ahead and move your docs into the <code>docs</code> directory. </> ), }, { title: 'Powered by React', Svg: require('../../static/img/undraw_docusaurus_react.svg').default, description: ( <> Extend or customize your website layout by reusing React. Docusaurus can be extended while reusing the same header and footer. </> ), }, ];*/ function Feature({Svg, title, description}) { return ( <div className={clsx('col col--4')}> <div className="text--center"> <Svg className={styles.featureSvg} alt={title} /> </div> <div className="text--center padding-horiz--md"> <h3>{title}</h3> <p>{description}</p> </div> </div> ); } export default function HomepageFeatures() { return ( <section className={styles.features}> <div className="container"> <div className="row"> </div> </div> </section> ); }
src/alert/AlertMessage.spec.js
MeXaaR/mx-react-toaster
import React from 'react' import renderer from 'react-test-renderer' import {shallow} from 'enzyme' import AlertMessage from './AlertMessage' jest.useFakeTimers() describe('AlertMessage', () => { test('should render the given message', () => { const props = { message: 'Some important message' } const component = renderer.create( <AlertMessage {...props} /> ) const tree = component.toJSON() expect(tree).toMatchSnapshot() }) test('should render the given icon if any', () => { const props = { icon: <div>Icon</div> } const component = renderer.create( <AlertMessage {...props} /> ) const tree = component.toJSON() expect(tree).toMatchSnapshot() }) test('should use the given theme', () => { const props = { theme: 'light' } const component = renderer.create( <AlertMessage {...props} /> ) const tree = component.toJSON() expect(tree).toMatchSnapshot() }) test('should change the icon based on the given type prop', () => { const props = { type: 'info' } let component = renderer.create( <AlertMessage {...props} /> ) let tree = component.toJSON() expect(tree).toMatchSnapshot() props.type = 'error' component = renderer.create( <AlertMessage {...props} /> ) tree = component.toJSON() expect(tree).toMatchSnapshot() props.type = 'success' component = renderer.create( <AlertMessage {...props} /> ) tree = component.toJSON() expect(tree).toMatchSnapshot() }) describe('_removeItself', async () => { test('should call the given onRemoveAlert function after the given time', () => { const props = { onRemoveAlert: jest.fn(), time: 3 } const component = renderer.create( <AlertMessage {...props} /> ) component.toJSON() setTimeout(() => { expect(props.onRemoveAlert).toHaveBeenCalled() }, props.time) jest.runOnlyPendingTimers() }) test('should call the default onRemoveAlert', () => { const props = { time: 3 } const wrapper = shallow(<AlertMessage {...props} />) const instance = wrapper.instance() expect(typeof (instance.props.onRemoveAlert)).toBe('function') expect(instance.props.onRemoveAlert()).toBe(undefined) }) }) })
src/components/Iconfont/Iconfont.js
fishmankkk/mircowater2.0
import React from 'react' import PropTypes from 'prop-types' import './iconfont.less' const Iconfont = ({ type, colorful }) => { if (colorful) { return (<span dangerouslySetInnerHTML={{ __html: `<svg class="colorful-icon" aria-hidden="true"><use xlink:href="#${type.startsWith('#') ? type.replace(/#/, '') : type}"></use></svg>`, }} />) } return <i className={`antdadmin icon-${type}`} /> } Iconfont.propTypes = { type: PropTypes.string, colorful: PropTypes.bool, } export default Iconfont
studyAnimate/__tests__/index.android.js
yeeFlame/animate-for-RN
import 'react-native'; import React from 'react'; import Index from '../index.android.js'; // Note: test renderer must be required after react-native. import renderer from 'react-test-renderer'; it('renders correctly', () => { const tree = renderer.create( <Index /> ); });
src/docs/components/video/VideoExamplesDoc.js
grommet/grommet-docs
// (C) Copyright 2014-2016 Hewlett Packard Enterprise Development LP import React, { Component } from 'react'; import Video from 'grommet/components/Video'; import InteractiveExample from '../../../components/InteractiveExample'; Video.displayName = 'Video'; const PROPS_SCHEMA = { allowFullScreen: { value: true }, autoPlay: { value: true }, full: { value: true }, fit: { options: ['cover', 'contain'] }, loop: { value: true }, muted: { value: true }, showControls: { value: true, initial: true }, poster: { value: '/img/mobile_first.jpg' }, shareLink: { value: 'http://grommet.io' }, shareText: { value: 'Sample share text' }, size: { options: ['small', 'medium', 'large'] }, timeline: { value: [ {label: 'Chapter 1', time: 0}, {label: 'Chapter 2', time: 10}, {label: 'Chapter 3', time: 20} ] }, title: { value: 'Sample Title' } }; export default class ImageExamplesDoc extends Component { constructor () { super(); this.state = { elementProps: {} }; } render () { const { elementProps } = this.state; if ('true' === elementProps.full) { elementProps.full = true; } else if ('false' === elementProps.full) { elementProps.full = false; } const element = ( <Video {...elementProps}> <source src="/video/test.mp4" type='video/mp4'/> </Video> ); return ( <InteractiveExample contextLabel='Video' contextPath='/docs/video' preamble={`import Video from 'grommet/components/Video';`} propsSchema={PROPS_SCHEMA} element={element} onChange={elementProps => this.setState({ elementProps })} /> ); } };
tests/format/flow-repo/more_react/InitializedFields.js
rattrayalex/prettier
/** * @providesModule InitializedFields.react */ var React = require('react'); /** This is a regression test for a bug where we forgot to mark the fields of * react classes as initialized, when the class was created with createClass(). * This would manifest as complaining that metric requires an annotation */ var App = React.createClass({ metrics: [1,2,3], }); module.exports = App;
src/common/ZulipButton.js
saketkumar95/zulip-mobile
/* @flow */ import React from 'react'; import { StyleSheet, Text, View, ActivityIndicator } from 'react-native'; import { FormattedMessage } from 'react-intl'; import type { StyleObj } from 'react-native/Libraries/StyleSheet/StyleSheetTypes'; import { BRAND_COLOR } from '../styles'; import Touchable from './Touchable'; import Icon from '../common/Icons'; const styles = StyleSheet.create({ buttonContent: { flexDirection: 'row', alignItems: 'center', justifyContent: 'center', height: 44 }, frame: { height: 44, justifyContent: 'center', borderRadius: 5, marginTop: 5, marginBottom: 5, }, primaryFrame: { backgroundColor: BRAND_COLOR, }, secondaryFrame: { borderWidth: 1.5, borderColor: BRAND_COLOR, }, touchTarget: { flex: 1, alignSelf: 'stretch', justifyContent: 'center', alignItems: 'center', borderRadius: 5 }, text: { color: '#FFFFFF', fontSize: 16, }, primaryText: { color: 'white', }, secondaryText: { color: BRAND_COLOR, }, icon: { marginRight: 8, }, primaryIcon: { color: 'white', }, secondaryIcon: { color: BRAND_COLOR, } }); const ButtonInProgress = ({ frameStyle }) => ( <View style={frameStyle}> <ActivityIndicator color="white" /> </View> ); const ButtonNormal = ({ frameStyle, touchTargetStyle, textStyle, text, onPress, icon, iconStyle }) => ( <View style={frameStyle}> <Touchable style={touchTargetStyle} onPress={onPress}> <View style={styles.buttonContent}> {icon && <Icon name={icon} style={iconStyle} size={25} />} <Text style={textStyle}> <FormattedMessage id={text} defaultMessage={text} /> </Text> </View> </Touchable> </View> ); export default class ZulipButton extends React.PureComponent { props: { style?: StyleObj, progress?: boolean, text: string, icon?: string, secondary: boolean, onPress: () => void | Promise<any>, }; static defaultProps: { secondary: false, }; render() { const { style, text, secondary, progress, onPress, icon } = this.props; const frameStyle = [ styles.frame, secondary ? styles.secondaryFrame : styles.primaryFrame, style, ]; const textStyle = [styles.text, secondary ? styles.secondaryText : styles.primaryText]; const iconStyle = [styles.icon, secondary ? styles.secondaryIcon : styles.primaryIcon]; if (progress) { return <ButtonInProgress frameStyle={frameStyle} />; } return ( <ButtonNormal frameStyle={frameStyle} touchTargetStyle={styles.touchTarget} text={text} onPress={onPress} textStyle={textStyle} icon={icon} iconStyle={iconStyle} /> ); } }
src/svg-icons/content/backspace.js
kittyjumbalaya/material-components-web
import React from 'react'; import pure from 'recompose/pure'; import SvgIcon from '../../SvgIcon'; let ContentBackspace = (props) => ( <SvgIcon {...props}> <path d="M22 3H7c-.69 0-1.23.35-1.59.88L0 12l5.41 8.11c.36.53.9.89 1.59.89h15c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zm-3 12.59L17.59 17 14 13.41 10.41 17 9 15.59 12.59 12 9 8.41 10.41 7 14 10.59 17.59 7 19 8.41 15.41 12 19 15.59z"/> </SvgIcon> ); ContentBackspace = pure(ContentBackspace); ContentBackspace.displayName = 'ContentBackspace'; ContentBackspace.muiName = 'SvgIcon'; export default ContentBackspace;
app/modules/Home/components/Title/index.js
saitodisse/tab-site
import React from 'react'; import styles from './styles.css'; function Title(props) { return ( <h1 style={{color: props.color}} className={styles.title}> {props.children} </h1> ); } Title.propTypes = { color: React.PropTypes.string.isRequired, children: React.PropTypes.any.isRequired }; export default Title;
app/components/NavigationBar/index.js
aoshmyanskaya/tko
import React from 'react'; import UIElementsFolder from './UIElementsFolder'; import UINavItem from './UINavItem'; import { translations } from './translations'; class NavigationBar extends React.Component { render() { return ( <div className={"menubar menubar-inverse " + (this.props.expanded ? 'menubar-expanded' : '')}> <UIElementsFolder title={translations.users} expanded={this.props.expanded}> <UINavItem uiOrder="First" href="/users/sub_1">{translations.users_sub_1}</UINavItem> <UINavItem uiOrder="Mid" href="/users/sub_2">{translations.users_sub_2}</UINavItem> </UIElementsFolder> <UIElementsFolder title={translations.devices} expanded={this.props.expanded}> <UINavItem uiOrder="First" href="/devices/sub_1">{translations.devices_sub_1}</UINavItem> <UINavItem uiOrder="Mid" href="/devices/sub_2">{translations.devices_sub_2}</UINavItem> </UIElementsFolder> <UIElementsFolder title={translations.reports} expanded={this.props.expanded}> <UINavItem uiOrder="First" href="/reports/sub_1">{translations.reports_sub_1}</UINavItem> </UIElementsFolder> <UIElementsFolder title={translations.help} expanded={this.props.expanded}> <UINavItem uiOrder="First" href="/help/sub_1">{translations.help_sub_1}</UINavItem> <UINavItem uiOrder="Mid" href="/help/sub_2">{translations.help_sub_2}</UINavItem> </UIElementsFolder> </div> ) } } export default NavigationBar;
lawyer_athens/js/js_F3QhuD3dyHq7XK0wCXz8bzkfGN3qZvLYsYtmGrTr24w.js
mikeusry/cainlaw
(function ($) { /** * A progressbar object. Initialized with the given id. Must be inserted into * the DOM afterwards through progressBar.element. * * method is the function which will perform the HTTP request to get the * progress bar state. Either "GET" or "POST". * * e.g. pb = new progressBar('myProgressBar'); * some_element.appendChild(pb.element); */ Drupal.progressBar = function (id, updateCallback, method, errorCallback) { var pb = this; this.id = id; this.method = method || 'GET'; this.updateCallback = updateCallback; this.errorCallback = errorCallback; // The WAI-ARIA setting aria-live="polite" will announce changes after users // have completed their current activity and not interrupt the screen reader. this.element = $('<div class="progress" aria-live="polite"></div>').attr('id', id); this.element.html('<div class="bar"><div class="filled"></div></div>' + '<div class="percentage"></div>' + '<div class="message">&nbsp;</div>'); }; /** * Set the percentage and status message for the progressbar. */ Drupal.progressBar.prototype.setProgress = function (percentage, message) { if (percentage >= 0 && percentage <= 100) { $('div.filled', this.element).css('width', percentage + '%'); $('div.percentage', this.element).html(percentage + '%'); } $('div.message', this.element).html(message); if (this.updateCallback) { this.updateCallback(percentage, message, this); } }; /** * Start monitoring progress via Ajax. */ Drupal.progressBar.prototype.startMonitoring = function (uri, delay) { this.delay = delay; this.uri = uri; this.sendPing(); }; /** * Stop monitoring progress via Ajax. */ Drupal.progressBar.prototype.stopMonitoring = function () { clearTimeout(this.timer); // This allows monitoring to be stopped from within the callback. this.uri = null; }; /** * Request progress data from server. */ Drupal.progressBar.prototype.sendPing = function () { if (this.timer) { clearTimeout(this.timer); } if (this.uri) { var pb = this; // When doing a post request, you need non-null data. Otherwise a // HTTP 411 or HTTP 406 (with Apache mod_security) error may result. $.ajax({ type: this.method, url: this.uri, data: '', dataType: 'json', success: function (progress) { // Display errors. if (progress.status == 0) { pb.displayError(progress.data); return; } // Update display. pb.setProgress(progress.percentage, progress.message); // Schedule next timer. pb.timer = setTimeout(function () { pb.sendPing(); }, pb.delay); }, error: function (xmlhttp) { pb.displayError(Drupal.ajaxError(xmlhttp, pb.uri)); } }); } }; /** * Display errors on the page. */ Drupal.progressBar.prototype.displayError = function (string) { var error = $('<div class="messages error"></div>').html(string); $(this.element).before(error).hide(); if (this.errorCallback) { this.errorCallback(this); } }; })(jQuery); ; /** * @file * * Implement a modal form. * * @see modal.inc for documentation. * * This javascript relies on the CTools ajax responder. */ (function ($) { // Make sure our objects are defined. Drupal.CTools = Drupal.CTools || {}; Drupal.CTools.Modal = Drupal.CTools.Modal || {}; /** * Display the modal * * @todo -- document the settings. */ Drupal.CTools.Modal.show = function(choice) { var opts = {}; if (choice && typeof choice == 'string' && Drupal.settings[choice]) { // This notation guarantees we are actually copying it. $.extend(true, opts, Drupal.settings[choice]); } else if (choice) { $.extend(true, opts, choice); } var defaults = { modalTheme: 'CToolsModalDialog', throbberTheme: 'CToolsModalThrobber', animation: 'show', animationSpeed: 'fast', modalSize: { type: 'scale', width: .8, height: .8, addWidth: 0, addHeight: 0, // How much to remove from the inner content to make space for the // theming. contentRight: 25, contentBottom: 45 }, modalOptions: { opacity: .55, background: '#fff' } }; var settings = {}; $.extend(true, settings, defaults, Drupal.settings.CToolsModal, opts); if (Drupal.CTools.Modal.currentSettings && Drupal.CTools.Modal.currentSettings != settings) { Drupal.CTools.Modal.modal.remove(); Drupal.CTools.Modal.modal = null; } Drupal.CTools.Modal.currentSettings = settings; var resize = function(e) { // When creating the modal, it actually exists only in a theoretical // place that is not in the DOM. But once the modal exists, it is in the // DOM so the context must be set appropriately. var context = e ? document : Drupal.CTools.Modal.modal; if (Drupal.CTools.Modal.currentSettings.modalSize.type == 'scale') { var width = $(window).width() * Drupal.CTools.Modal.currentSettings.modalSize.width; var height = $(window).height() * Drupal.CTools.Modal.currentSettings.modalSize.height; } else { var width = Drupal.CTools.Modal.currentSettings.modalSize.width; var height = Drupal.CTools.Modal.currentSettings.modalSize.height; } // Use the additionol pixels for creating the width and height. $('div.ctools-modal-content', context).css({ 'width': width + Drupal.CTools.Modal.currentSettings.modalSize.addWidth + 'px', 'height': height + Drupal.CTools.Modal.currentSettings.modalSize.addHeight + 'px' }); $('div.ctools-modal-content .modal-content', context).css({ 'width': (width - Drupal.CTools.Modal.currentSettings.modalSize.contentRight) + 'px', 'height': (height - Drupal.CTools.Modal.currentSettings.modalSize.contentBottom) + 'px' }); } if (!Drupal.CTools.Modal.modal) { Drupal.CTools.Modal.modal = $(Drupal.theme(settings.modalTheme)); if (settings.modalSize.type == 'scale') { $(window).bind('resize', resize); } } resize(); $('span.modal-title', Drupal.CTools.Modal.modal).html(Drupal.CTools.Modal.currentSettings.loadingText); Drupal.CTools.Modal.modalContent(Drupal.CTools.Modal.modal, settings.modalOptions, settings.animation, settings.animationSpeed); $('#modalContent .modal-content').html(Drupal.theme(settings.throbberTheme)); }; /** * Hide the modal */ Drupal.CTools.Modal.dismiss = function() { if (Drupal.CTools.Modal.modal) { Drupal.CTools.Modal.unmodalContent(Drupal.CTools.Modal.modal); } }; /** * Provide the HTML to create the modal dialog. */ Drupal.theme.prototype.CToolsModalDialog = function () { var html = '' html += ' <div id="ctools-modal">' html += ' <div class="ctools-modal-content">' // panels-modal-content html += ' <div class="modal-header">'; html += ' <a class="close" href="#">'; html += Drupal.CTools.Modal.currentSettings.closeText + Drupal.CTools.Modal.currentSettings.closeImage; html += ' </a>'; html += ' <span id="modal-title" class="modal-title">&nbsp;</span>'; html += ' </div>'; html += ' <div id="modal-content" class="modal-content">'; html += ' </div>'; html += ' </div>'; html += ' </div>'; return html; } /** * Provide the HTML to create the throbber. */ Drupal.theme.prototype.CToolsModalThrobber = function () { var html = ''; html += ' <div id="modal-throbber">'; html += ' <div class="modal-throbber-wrapper">'; html += Drupal.CTools.Modal.currentSettings.throbber; html += ' </div>'; html += ' </div>'; return html; }; /** * Figure out what settings string to use to display a modal. */ Drupal.CTools.Modal.getSettings = function (object) { var match = $(object).attr('class').match(/ctools-modal-(\S+)/); if (match) { return match[1]; } } /** * Click function for modals that can be cached. */ Drupal.CTools.Modal.clickAjaxCacheLink = function () { Drupal.CTools.Modal.show(Drupal.CTools.Modal.getSettings(this)); return Drupal.CTools.AJAX.clickAJAXCacheLink.apply(this); }; /** * Handler to prepare the modal for the response */ Drupal.CTools.Modal.clickAjaxLink = function () { Drupal.CTools.Modal.show(Drupal.CTools.Modal.getSettings(this)); return false; }; /** * Submit responder to do an AJAX submit on all modal forms. */ Drupal.CTools.Modal.submitAjaxForm = function(e) { var $form = $(this); var url = $form.attr('action'); setTimeout(function() { Drupal.CTools.AJAX.ajaxSubmit($form, url); }, 1); return false; } /** * Bind links that will open modals to the appropriate function. */ Drupal.behaviors.ZZCToolsModal = { attach: function(context) { // Bind links // Note that doing so in this order means that the two classes can be // used together safely. /* * @todo remimplement the warm caching feature $('a.ctools-use-modal-cache', context).once('ctools-use-modal', function() { $(this).click(Drupal.CTools.Modal.clickAjaxCacheLink); Drupal.CTools.AJAX.warmCache.apply(this); }); */ $('area.ctools-use-modal, a.ctools-use-modal', context).once('ctools-use-modal', function() { var $this = $(this); $this.click(Drupal.CTools.Modal.clickAjaxLink); // Create a drupal ajax object var element_settings = {}; if ($this.attr('href')) { element_settings.url = $this.attr('href'); element_settings.event = 'click'; element_settings.progress = { type: 'throbber' }; } var base = $this.attr('href'); Drupal.ajax[base] = new Drupal.ajax(base, this, element_settings); }); // Bind buttons $('input.ctools-use-modal, button.ctools-use-modal', context).once('ctools-use-modal', function() { var $this = $(this); $this.click(Drupal.CTools.Modal.clickAjaxLink); var button = this; var element_settings = {}; // AJAX submits specified in this manner automatically submit to the // normal form action. element_settings.url = Drupal.CTools.Modal.findURL(this); element_settings.event = 'click'; var base = $this.attr('id'); Drupal.ajax[base] = new Drupal.ajax(base, this, element_settings); // Make sure changes to settings are reflected in the URL. $('.' + $(button).attr('id') + '-url').change(function() { Drupal.ajax[base].options.url = Drupal.CTools.Modal.findURL(button); }); }); // Bind our custom event to the form submit $('#modal-content form', context).once('ctools-use-modal', function() { var $this = $(this); var element_settings = {}; element_settings.url = $this.attr('action'); element_settings.event = 'submit'; element_settings.progress = { 'type': 'throbber' } var base = $this.attr('id'); Drupal.ajax[base] = new Drupal.ajax(base, this, element_settings); Drupal.ajax[base].form = $this; $('input[type=submit], button', this).click(function(event) { Drupal.ajax[base].element = this; this.form.clk = this; // An empty event means we were triggered via .click() and // in jquery 1.4 this won't trigger a submit. if (event.bubbles == undefined) { $(this.form).trigger('submit'); return false; } }); }); // Bind a click handler to allow elements with the 'ctools-close-modal' // class to close the modal. $('.ctools-close-modal', context).once('ctools-close-modal') .click(function() { Drupal.CTools.Modal.dismiss(); return false; }); } }; // The following are implementations of AJAX responder commands. /** * AJAX responder command to place HTML within the modal. */ Drupal.CTools.Modal.modal_display = function(ajax, response, status) { if ($('#modalContent').length == 0) { Drupal.CTools.Modal.show(Drupal.CTools.Modal.getSettings(ajax.element)); } $('#modal-title').html(response.title); // Simulate an actual page load by scrolling to the top after adding the // content. This is helpful for allowing users to see error messages at the // top of a form, etc. $('#modal-content').html(response.output).scrollTop(0); Drupal.attachBehaviors(); } /** * AJAX responder command to dismiss the modal. */ Drupal.CTools.Modal.modal_dismiss = function(command) { Drupal.CTools.Modal.dismiss(); $('link.ctools-temporary-css').remove(); } /** * Display loading */ //Drupal.CTools.AJAX.commands.modal_loading = function(command) { Drupal.CTools.Modal.modal_loading = function(command) { Drupal.CTools.Modal.modal_display({ output: Drupal.theme(Drupal.CTools.Modal.currentSettings.throbberTheme), title: Drupal.CTools.Modal.currentSettings.loadingText }); } /** * Find a URL for an AJAX button. * * The URL for this gadget will be composed of the values of items by * taking the ID of this item and adding -url and looking for that * class. They need to be in the form in order since we will * concat them all together using '/'. */ Drupal.CTools.Modal.findURL = function(item) { var url = ''; var url_class = '.' + $(item).attr('id') + '-url'; $(url_class).each( function() { var $this = $(this); if (url && $this.val()) { url += '/'; } url += $this.val(); }); return url; }; /** * modalContent * @param content string to display in the content box * @param css obj of css attributes * @param animation (fadeIn, slideDown, show) * @param speed (valid animation speeds slow, medium, fast or # in ms) */ Drupal.CTools.Modal.modalContent = function(content, css, animation, speed) { // If our animation isn't set, make it just show/pop if (!animation) { animation = 'show'; } else { // If our animation isn't "fadeIn" or "slideDown" then it always is show if (animation != 'fadeIn' && animation != 'slideDown') { animation = 'show'; } } if (!speed) { speed = 'fast'; } // Build our base attributes and allow them to be overriden css = jQuery.extend({ position: 'absolute', left: '0px', margin: '0px', background: '#000', opacity: '.55' }, css); // Add opacity handling for IE. css.filter = 'alpha(opacity=' + (100 * css.opacity) + ')'; content.hide(); // if we already ahve a modalContent, remove it if ( $('#modalBackdrop')) $('#modalBackdrop').remove(); if ( $('#modalContent')) $('#modalContent').remove(); // position code lifted from http://www.quirksmode.org/viewport/compatibility.html if (self.pageYOffset) { // all except Explorer var wt = self.pageYOffset; } else if (document.documentElement && document.documentElement.scrollTop) { // Explorer 6 Strict var wt = document.documentElement.scrollTop; } else if (document.body) { // all other Explorers var wt = document.body.scrollTop; } // Get our dimensions // Get the docHeight and (ugly hack) add 50 pixels to make sure we dont have a *visible* border below our div var docHeight = $(document).height() + 50; var docWidth = $(document).width(); var winHeight = $(window).height(); var winWidth = $(window).width(); if( docHeight < winHeight ) docHeight = winHeight; // Create our divs $('body').append('<div id="modalBackdrop" style="z-index: 1000; display: none;"></div><div id="modalContent" style="z-index: 1001; position: absolute;">' + $(content).html() + '</div>'); // Keyboard and focus event handler ensures focus stays on modal elements only modalEventHandler = function( event ) { target = null; if ( event ) { //Mozilla target = event.target; } else { //IE event = window.event; target = event.srcElement; } var parents = $(target).parents().get(); for (var i = 0; i < parents.length; ++i) { var position = $(parents[i]).css('position'); if (position == 'absolute' || position == 'fixed') { return true; } } if( $(target).filter('*:visible').parents('#modalContent').size()) { // allow the event only if target is a visible child node of #modalContent return true; } if ( $('#modalContent')) $('#modalContent').get(0).focus(); return false; }; $('body').bind( 'focus', modalEventHandler ); $('body').bind( 'keypress', modalEventHandler ); // Create our content div, get the dimensions, and hide it var modalContent = $('#modalContent').css('top','-1000px'); var mdcTop = wt + ( winHeight / 2 ) - ( modalContent.outerHeight() / 2); var mdcLeft = ( winWidth / 2 ) - ( modalContent.outerWidth() / 2); $('#modalBackdrop').css(css).css('top', 0).css('height', docHeight + 'px').css('width', docWidth + 'px').show(); modalContent.css({top: mdcTop + 'px', left: mdcLeft + 'px'}).hide()[animation](speed); // Bind a click for closing the modalContent modalContentClose = function(){close(); return false;}; $('.close').bind('click', modalContentClose); // Bind a keypress on escape for closing the modalContent modalEventEscapeCloseHandler = function(event) { if (event.keyCode == 27) { close(); return false; } }; $(document).bind('keydown', modalEventEscapeCloseHandler); // Close the open modal content and backdrop function close() { // Unbind the events $(window).unbind('resize', modalContentResize); $('body').unbind( 'focus', modalEventHandler); $('body').unbind( 'keypress', modalEventHandler ); $('.close').unbind('click', modalContentClose); $('body').unbind('keypress', modalEventEscapeCloseHandler); $(document).trigger('CToolsDetachBehaviors', $('#modalContent')); // Set our animation parameters and use them if ( animation == 'fadeIn' ) animation = 'fadeOut'; if ( animation == 'slideDown' ) animation = 'slideUp'; if ( animation == 'show' ) animation = 'hide'; // Close the content modalContent.hide()[animation](speed); // Remove the content $('#modalContent').remove(); $('#modalBackdrop').remove(); }; // Move and resize the modalBackdrop and modalContent on resize of the window modalContentResize = function(){ // Get our heights var docHeight = $(document).height(); var docWidth = $(document).width(); var winHeight = $(window).height(); var winWidth = $(window).width(); if( docHeight < winHeight ) docHeight = winHeight; // Get where we should move content to var modalContent = $('#modalContent'); var mdcTop = ( winHeight / 2 ) - ( modalContent.outerHeight() / 2); var mdcLeft = ( winWidth / 2 ) - ( modalContent.outerWidth() / 2); // Apply the changes $('#modalBackdrop').css('height', docHeight + 'px').css('width', docWidth + 'px').show(); modalContent.css('top', mdcTop + 'px').css('left', mdcLeft + 'px').show(); }; $(window).bind('resize', modalContentResize); $('#modalContent').focus(); }; /** * unmodalContent * @param content (The jQuery object to remove) * @param animation (fadeOut, slideUp, show) * @param speed (valid animation speeds slow, medium, fast or # in ms) */ Drupal.CTools.Modal.unmodalContent = function(content, animation, speed) { // If our animation isn't set, make it just show/pop if (!animation) { var animation = 'show'; } else { // If our animation isn't "fade" then it always is show if (( animation != 'fadeOut' ) && ( animation != 'slideUp')) animation = 'show'; } // Set a speed if we dont have one if ( !speed ) var speed = 'fast'; // Unbind the events we bound $(window).unbind('resize', modalContentResize); $('body').unbind('focus', modalEventHandler); $('body').unbind('keypress', modalEventHandler); $('.close').unbind('click', modalContentClose); $(document).trigger('CToolsDetachBehaviors', $('#modalContent')); // jQuery magic loop through the instances and run the animations or removal. content.each(function(){ if ( animation == 'fade' ) { $('#modalContent').fadeOut(speed, function() { $('#modalBackdrop').fadeOut(speed, function() { $(this).remove(); }); $(this).remove(); }); } else { if ( animation == 'slide' ) { $('#modalContent').slideUp(speed,function() { $('#modalBackdrop').slideUp(speed, function() { $(this).remove(); }); $(this).remove(); }); } else { $('#modalContent').remove(); $('#modalBackdrop').remove(); } } }); }; $(function() { Drupal.ajax.prototype.commands.modal_display = Drupal.CTools.Modal.modal_display; Drupal.ajax.prototype.commands.modal_dismiss = Drupal.CTools.Modal.modal_dismiss; }); })(jQuery); ; /** * Provide the HTML to create the modal dialog. */ Drupal.theme.prototype.ModalFormsPopup = function () { var html = ''; html += '<div id="ctools-modal" class="popups-box">'; html += ' <div class="ctools-modal-content modal-forms-modal-content">'; html += ' <div class="popups-container">'; html += ' <div class="modal-header popups-title">'; html += ' <span id="modal-title" class="modal-title"></span>'; html += ' <span class="popups-close close">' + Drupal.CTools.Modal.currentSettings.closeText + '</span>'; html += ' <div class="clear-block"></div>'; html += ' </div>'; html += ' <div class="modal-scroll"><div id="modal-content" class="modal-content popups-body"></div></div>'; html += ' </div>'; html += ' </div>'; html += '</div>'; return html; } ; (function ($) { Drupal.viewsSlideshow = Drupal.viewsSlideshow || {}; /** * Views Slideshow Controls */ Drupal.viewsSlideshowControls = Drupal.viewsSlideshowControls || {}; /** * Implement the play hook for controls. */ Drupal.viewsSlideshowControls.play = function (options) { // Route the control call to the correct control type. // Need to use try catch so we don't have to check to make sure every part // of the object is defined. try { if (typeof Drupal.settings.viewsSlideshowControls[options.slideshowID].top.type != "undefined" && typeof Drupal[Drupal.settings.viewsSlideshowControls[options.slideshowID].top.type].play == 'function') { Drupal[Drupal.settings.viewsSlideshowControls[options.slideshowID].top.type].play(options); } } catch(err) { // Don't need to do anything on error. } try { if (typeof Drupal.settings.viewsSlideshowControls[options.slideshowID].bottom.type != "undefined" && typeof Drupal[Drupal.settings.viewsSlideshowControls[options.slideshowID].bottom.type].play == 'function') { Drupal[Drupal.settings.viewsSlideshowControls[options.slideshowID].bottom.type].play(options); } } catch(err) { // Don't need to do anything on error. } }; /** * Implement the pause hook for controls. */ Drupal.viewsSlideshowControls.pause = function (options) { // Route the control call to the correct control type. // Need to use try catch so we don't have to check to make sure every part // of the object is defined. try { if (typeof Drupal.settings.viewsSlideshowControls[options.slideshowID].top.type != "undefined" && typeof Drupal[Drupal.settings.viewsSlideshowControls[options.slideshowID].top.type].pause == 'function') { Drupal[Drupal.settings.viewsSlideshowControls[options.slideshowID].top.type].pause(options); } } catch(err) { // Don't need to do anything on error. } try { if (typeof Drupal.settings.viewsSlideshowControls[options.slideshowID].bottom.type != "undefined" && typeof Drupal[Drupal.settings.viewsSlideshowControls[options.slideshowID].bottom.type].pause == 'function') { Drupal[Drupal.settings.viewsSlideshowControls[options.slideshowID].bottom.type].pause(options); } } catch(err) { // Don't need to do anything on error. } }; /** * Views Slideshow Text Controls */ // Add views slieshow api calls for views slideshow text controls. Drupal.behaviors.viewsSlideshowControlsText = { attach: function (context) { // Process previous link $('.views_slideshow_controls_text_previous:not(.views-slideshow-controls-text-previous-processed)', context).addClass('views-slideshow-controls-text-previous-processed').each(function() { var uniqueID = $(this).attr('id').replace('views_slideshow_controls_text_previous_', ''); $(this).click(function() { Drupal.viewsSlideshow.action({ "action": 'previousSlide', "slideshowID": uniqueID }); return false; }); }); // Process next link $('.views_slideshow_controls_text_next:not(.views-slideshow-controls-text-next-processed)', context).addClass('views-slideshow-controls-text-next-processed').each(function() { var uniqueID = $(this).attr('id').replace('views_slideshow_controls_text_next_', ''); $(this).click(function() { Drupal.viewsSlideshow.action({ "action": 'nextSlide', "slideshowID": uniqueID }); return false; }); }); // Process pause link $('.views_slideshow_controls_text_pause:not(.views-slideshow-controls-text-pause-processed)', context).addClass('views-slideshow-controls-text-pause-processed').each(function() { var uniqueID = $(this).attr('id').replace('views_slideshow_controls_text_pause_', ''); $(this).click(function() { if (Drupal.settings.viewsSlideshow[uniqueID].paused) { Drupal.viewsSlideshow.action({ "action": 'play', "slideshowID": uniqueID, "force": true }); } else { Drupal.viewsSlideshow.action({ "action": 'pause', "slideshowID": uniqueID, "force": true }); } return false; }); }); } }; Drupal.viewsSlideshowControlsText = Drupal.viewsSlideshowControlsText || {}; /** * Implement the pause hook for text controls. */ Drupal.viewsSlideshowControlsText.pause = function (options) { var pauseText = Drupal.theme.prototype['viewsSlideshowControlsPause'] ? Drupal.theme('viewsSlideshowControlsPause') : ''; $('#views_slideshow_controls_text_pause_' + options.slideshowID + ' a').text(pauseText); }; /** * Implement the play hook for text controls. */ Drupal.viewsSlideshowControlsText.play = function (options) { var playText = Drupal.theme.prototype['viewsSlideshowControlsPlay'] ? Drupal.theme('viewsSlideshowControlsPlay') : ''; $('#views_slideshow_controls_text_pause_' + options.slideshowID + ' a').text(playText); }; // Theme the resume control. Drupal.theme.prototype.viewsSlideshowControlsPause = function () { return Drupal.t('Resume'); }; // Theme the pause control. Drupal.theme.prototype.viewsSlideshowControlsPlay = function () { return Drupal.t('Pause'); }; /** * Views Slideshow Pager */ Drupal.viewsSlideshowPager = Drupal.viewsSlideshowPager || {}; /** * Implement the transitionBegin hook for pagers. */ Drupal.viewsSlideshowPager.transitionBegin = function (options) { // Route the pager call to the correct pager type. // Need to use try catch so we don't have to check to make sure every part // of the object is defined. try { if (typeof Drupal.settings.viewsSlideshowPager[options.slideshowID].top.type != "undefined" && typeof Drupal[Drupal.settings.viewsSlideshowPager[options.slideshowID].top.type].transitionBegin == 'function') { Drupal[Drupal.settings.viewsSlideshowPager[options.slideshowID].top.type].transitionBegin(options); } } catch(err) { // Don't need to do anything on error. } try { if (typeof Drupal.settings.viewsSlideshowPager[options.slideshowID].bottom.type != "undefined" && typeof Drupal[Drupal.settings.viewsSlideshowPager[options.slideshowID].bottom.type].transitionBegin == 'function') { Drupal[Drupal.settings.viewsSlideshowPager[options.slideshowID].bottom.type].transitionBegin(options); } } catch(err) { // Don't need to do anything on error. } }; /** * Implement the goToSlide hook for pagers. */ Drupal.viewsSlideshowPager.goToSlide = function (options) { // Route the pager call to the correct pager type. // Need to use try catch so we don't have to check to make sure every part // of the object is defined. try { if (typeof Drupal.settings.viewsSlideshowPager[options.slideshowID].top.type != "undefined" && typeof Drupal[Drupal.settings.viewsSlideshowPager[options.slideshowID].top.type].goToSlide == 'function') { Drupal[Drupal.settings.viewsSlideshowPager[options.slideshowID].top.type].goToSlide(options); } } catch(err) { // Don't need to do anything on error. } try { if (typeof Drupal.settings.viewsSlideshowPager[options.slideshowID].bottom.type != "undefined" && typeof Drupal[Drupal.settings.viewsSlideshowPager[options.slideshowID].bottom.type].goToSlide == 'function') { Drupal[Drupal.settings.viewsSlideshowPager[options.slideshowID].bottom.type].goToSlide(options); } } catch(err) { // Don't need to do anything on error. } }; /** * Implement the previousSlide hook for pagers. */ Drupal.viewsSlideshowPager.previousSlide = function (options) { // Route the pager call to the correct pager type. // Need to use try catch so we don't have to check to make sure every part // of the object is defined. try { if (typeof Drupal.settings.viewsSlideshowPager[options.slideshowID].top.type != "undefined" && typeof Drupal[Drupal.settings.viewsSlideshowPager[options.slideshowID].top.type].previousSlide == 'function') { Drupal[Drupal.settings.viewsSlideshowPager[options.slideshowID].top.type].previousSlide(options); } } catch(err) { // Don't need to do anything on error. } try { if (typeof Drupal.settings.viewsSlideshowPager[options.slideshowID].bottom.type != "undefined" && typeof Drupal[Drupal.settings.viewsSlideshowPager[options.slideshowID].bottom.type].previousSlide == 'function') { Drupal[Drupal.settings.viewsSlideshowPager[options.slideshowID].bottom.type].previousSlide(options); } } catch(err) { // Don't need to do anything on error. } }; /** * Implement the nextSlide hook for pagers. */ Drupal.viewsSlideshowPager.nextSlide = function (options) { // Route the pager call to the correct pager type. // Need to use try catch so we don't have to check to make sure every part // of the object is defined. try { if (typeof Drupal.settings.viewsSlideshowPager[options.slideshowID].top.type != "undefined" && typeof Drupal[Drupal.settings.viewsSlideshowPager[options.slideshowID].top.type].nextSlide == 'function') { Drupal[Drupal.settings.viewsSlideshowPager[options.slideshowID].top.type].nextSlide(options); } } catch(err) { // Don't need to do anything on error. } try { if (typeof Drupal.settings.viewsSlideshowPager[options.slideshowID].bottom.type != "undefined" && typeof Drupal[Drupal.settings.viewsSlideshowPager[options.slideshowID].bottom.type].nextSlide == 'function') { Drupal[Drupal.settings.viewsSlideshowPager[options.slideshowID].bottom.type].nextSlide(options); } } catch(err) { // Don't need to do anything on error. } }; /** * Views Slideshow Pager Fields */ // Add views slieshow api calls for views slideshow pager fields. Drupal.behaviors.viewsSlideshowPagerFields = { attach: function (context) { // Process pause on hover. $('.views_slideshow_pager_field:not(.views-slideshow-pager-field-processed)', context).addClass('views-slideshow-pager-field-processed').each(function() { // Parse out the location and unique id from the full id. var pagerInfo = $(this).attr('id').split('_'); var location = pagerInfo[2]; pagerInfo.splice(0, 3); var uniqueID = pagerInfo.join('_'); // Add the activate and pause on pager hover event to each pager item. if (Drupal.settings.viewsSlideshowPagerFields[uniqueID][location].activatePauseOnHover) { $(this).children().each(function(index, pagerItem) { var mouseIn = function() { Drupal.viewsSlideshow.action({ "action": 'goToSlide', "slideshowID": uniqueID, "slideNum": index }); Drupal.viewsSlideshow.action({ "action": 'pause', "slideshowID": uniqueID }); } var mouseOut = function() { Drupal.viewsSlideshow.action({ "action": 'play', "slideshowID": uniqueID }); } if (jQuery.fn.hoverIntent) { $(pagerItem).hoverIntent(mouseIn, mouseOut); } else { $(pagerItem).hover(mouseIn, mouseOut); } }); } else { $(this).children().each(function(index, pagerItem) { $(pagerItem).click(function() { Drupal.viewsSlideshow.action({ "action": 'goToSlide', "slideshowID": uniqueID, "slideNum": index }); }); }); } }); } }; Drupal.viewsSlideshowPagerFields = Drupal.viewsSlideshowPagerFields || {}; /** * Implement the transitionBegin hook for pager fields pager. */ Drupal.viewsSlideshowPagerFields.transitionBegin = function (options) { for (pagerLocation in Drupal.settings.viewsSlideshowPager[options.slideshowID]) { // Remove active class from pagers $('[id^="views_slideshow_pager_field_item_' + pagerLocation + '_' + options.slideshowID + '"]').removeClass('active'); // Add active class to active pager. $('#views_slideshow_pager_field_item_'+ pagerLocation + '_' + options.slideshowID + '_' + options.slideNum).addClass('active'); } }; /** * Implement the goToSlide hook for pager fields pager. */ Drupal.viewsSlideshowPagerFields.goToSlide = function (options) { for (pagerLocation in Drupal.settings.viewsSlideshowPager[options.slideshowID]) { // Remove active class from pagers $('[id^="views_slideshow_pager_field_item_' + pagerLocation + '_' + options.slideshowID + '"]').removeClass('active'); // Add active class to active pager. $('#views_slideshow_pager_field_item_' + pagerLocation + '_' + options.slideshowID + '_' + options.slideNum).addClass('active'); } }; /** * Implement the previousSlide hook for pager fields pager. */ Drupal.viewsSlideshowPagerFields.previousSlide = function (options) { for (pagerLocation in Drupal.settings.viewsSlideshowPager[options.slideshowID]) { // Get the current active pager. var pagerNum = $('[id^="views_slideshow_pager_field_item_' + pagerLocation + '_' + options.slideshowID + '"].active').attr('id').replace('views_slideshow_pager_field_item_' + pagerLocation + '_' + options.slideshowID + '_', ''); // If we are on the first pager then activate the last pager. // Otherwise activate the previous pager. if (pagerNum == 0) { pagerNum = $('[id^="views_slideshow_pager_field_item_' + pagerLocation + '_' + options.slideshowID + '"]').length() - 1; } else { pagerNum--; } // Remove active class from pagers $('[id^="views_slideshow_pager_field_item_' + pagerLocation + '_' + options.slideshowID + '"]').removeClass('active'); // Add active class to active pager. $('#views_slideshow_pager_field_item_' + pagerLocation + '_' + options.slideshowID + '_' + pagerNum).addClass('active'); } }; /** * Implement the nextSlide hook for pager fields pager. */ Drupal.viewsSlideshowPagerFields.nextSlide = function (options) { for (pagerLocation in Drupal.settings.viewsSlideshowPager[options.slideshowID]) { // Get the current active pager. var pagerNum = $('[id^="views_slideshow_pager_field_item_' + pagerLocation + '_' + options.slideshowID + '"].active').attr('id').replace('views_slideshow_pager_field_item_' + pagerLocation + '_' + options.slideshowID + '_', ''); var totalPagers = $('[id^="views_slideshow_pager_field_item_' + pagerLocation + '_' + options.slideshowID + '"]').length(); // If we are on the last pager then activate the first pager. // Otherwise activate the next pager. pagerNum++; if (pagerNum == totalPagers) { pagerNum = 0; } // Remove active class from pagers $('[id^="views_slideshow_pager_field_item_' + pagerLocation + '_' + options.slideshowID + '"]').removeClass('active'); // Add active class to active pager. $('#views_slideshow_pager_field_item_' + pagerLocation + '_' + options.slideshowID + '_' + slideNum).addClass('active'); } }; /** * Views Slideshow Slide Counter */ Drupal.viewsSlideshowSlideCounter = Drupal.viewsSlideshowSlideCounter || {}; /** * Implement the transitionBegin for the slide counter. */ Drupal.viewsSlideshowSlideCounter.transitionBegin = function (options) { $('#views_slideshow_slide_counter_' + options.slideshowID + ' .num').text(options.slideNum + 1); }; /** * This is used as a router to process actions for the slideshow. */ Drupal.viewsSlideshow.action = function (options) { // Set default values for our return status. var status = { 'value': true, 'text': '' } // If an action isn't specified return false. if (typeof options.action == 'undefined' || options.action == '') { status.value = false; status.text = Drupal.t('There was no action specified.'); return error; } // If we are using pause or play switch paused state accordingly. if (options.action == 'pause') { Drupal.settings.viewsSlideshow[options.slideshowID].paused = 1; // If the calling method is forcing a pause then mark it as such. if (options.force) { Drupal.settings.viewsSlideshow[options.slideshowID].pausedForce = 1; } } else if (options.action == 'play') { // If the slideshow isn't forced pause or we are forcing a play then play // the slideshow. // Otherwise return telling the calling method that it was forced paused. if (!Drupal.settings.viewsSlideshow[options.slideshowID].pausedForce || options.force) { Drupal.settings.viewsSlideshow[options.slideshowID].paused = 0; Drupal.settings.viewsSlideshow[options.slideshowID].pausedForce = 0; } else { status.value = false; status.text += ' ' + Drupal.t('This slideshow is forced paused.'); return status; } } // We use a switch statement here mainly just to limit the type of actions // that are available. switch (options.action) { case "goToSlide": case "transitionBegin": case "transitionEnd": // The three methods above require a slide number. Checking if it is // defined and it is a number that is an integer. if (typeof options.slideNum == 'undefined' || typeof options.slideNum !== 'number' || parseInt(options.slideNum) != (options.slideNum - 0)) { status.value = false; status.text = Drupal.t('An invalid integer was specified for slideNum.'); } case "pause": case "play": case "nextSlide": case "previousSlide": // Grab our list of methods. var methods = Drupal.settings.viewsSlideshow[options.slideshowID]['methods']; // if the calling method specified methods that shouldn't be called then // exclude calling them. var excludeMethodsObj = {}; if (typeof options.excludeMethods !== 'undefined') { // We need to turn the excludeMethods array into an object so we can use the in // function. for (var i=0; i < excludeMethods.length; i++) { excludeMethodsObj[excludeMethods[i]] = ''; } } // Call every registered method and don't call excluded ones. for (i = 0; i < methods[options.action].length; i++) { if (Drupal[methods[options.action][i]] != undefined && typeof Drupal[methods[options.action][i]][options.action] == 'function' && !(methods[options.action][i] in excludeMethodsObj)) { Drupal[methods[options.action][i]][options.action](options); } } break; // If it gets here it's because it's an invalid action. default: status.value = false; status.text = Drupal.t('An invalid action "!action" was specified.', { "!action": options.action }); } return status; }; })(jQuery); ; (function ($) { Drupal.behaviors.textarea = { attach: function (context, settings) { $('.form-textarea-wrapper.resizable', context).once('textarea', function () { var staticOffset = null; var textarea = $(this).addClass('resizable-textarea').find('textarea'); var grippie = $('<div class="grippie"></div>').mousedown(startDrag); grippie.insertAfter(textarea); function startDrag(e) { staticOffset = textarea.height() - e.pageY; textarea.css('opacity', 0.25); $(document).mousemove(performDrag).mouseup(endDrag); return false; } function performDrag(e) { textarea.height(Math.max(32, staticOffset + e.pageY) + 'px'); return false; } function endDrag(e) { $(document).unbind('mousemove', performDrag).unbind('mouseup', endDrag); textarea.css('opacity', 1); } }); } }; })(jQuery); ; /** * JavaScript behaviors for the front-end display of webforms. */ (function ($) { Drupal.behaviors.webform = Drupal.behaviors.webform || {}; Drupal.behaviors.webform.attach = function(context) { // Calendar datepicker behavior. Drupal.webform.datepicker(context); }; Drupal.webform = Drupal.webform || {}; Drupal.webform.datepicker = function(context) { $('div.webform-datepicker').each(function() { var $webformDatepicker = $(this); var $calendar = $webformDatepicker.find('input.webform-calendar'); // Ensure the page we're on actually contains a datepicker. if ($calendar.length == 0) { return; } var startDate = $calendar[0].className.replace(/.*webform-calendar-start-(\d{4}-\d{2}-\d{2}).*/, '$1').split('-'); var endDate = $calendar[0].className.replace(/.*webform-calendar-end-(\d{4}-\d{2}-\d{2}).*/, '$1').split('-'); var firstDay = $calendar[0].className.replace(/.*webform-calendar-day-(\d).*/, '$1'); // Convert date strings into actual Date objects. startDate = new Date(startDate[0], startDate[1] - 1, startDate[2]); endDate = new Date(endDate[0], endDate[1] - 1, endDate[2]); // Ensure that start comes before end for datepicker. if (startDate > endDate) { var laterDate = startDate; startDate = endDate; endDate = laterDate; } var startYear = startDate.getFullYear(); var endYear = endDate.getFullYear(); // Set up the jQuery datepicker element. $calendar.datepicker({ dateFormat: 'yy-mm-dd', yearRange: startYear + ':' + endYear, firstDay: parseInt(firstDay), minDate: startDate, maxDate: endDate, onSelect: function(dateText, inst) { var date = dateText.split('-'); $webformDatepicker.find('select.year, input.year').val(+date[0]); $webformDatepicker.find('select.month').val(+date[1]); $webformDatepicker.find('select.day').val(+date[2]); }, beforeShow: function(input, inst) { // Get the select list values. var year = $webformDatepicker.find('select.year, input.year').val(); var month = $webformDatepicker.find('select.month').val(); var day = $webformDatepicker.find('select.day').val(); // If empty, default to the current year/month/day in the popup. var today = new Date(); year = year ? year : today.getFullYear(); month = month ? month : today.getMonth() + 1; day = day ? day : today.getDate(); // Make sure that the default year fits in the available options. year = (year < startYear || year > endYear) ? startYear : year; // jQuery UI Datepicker will read the input field and base its date off // of that, even though in our case the input field is a button. $(input).val(year + '-' + month + '-' + day); } }); // Prevent the calendar button from submitting the form. $calendar.click(function(event) { $(this).focus(); event.preventDefault(); }); }); } })(jQuery); ; /* * jQuery FlexSlider v2.2.0 * Copyright 2012 WooThemes * Contributing Author: Tyler Smith */(function(e){e.flexslider=function(t,n){var r=e(t);r.vars=e.extend({},e.flexslider.defaults,n);var i=r.vars.namespace,s=window.navigator&&window.navigator.msPointerEnabled&&window.MSGesture,o=("ontouchstart"in window||s||window.DocumentTouch&&document instanceof DocumentTouch)&&r.vars.touch,u="click touchend MSPointerUp",a="",f,l=r.vars.direction==="vertical",c=r.vars.reverse,h=r.vars.itemWidth>0,p=r.vars.animation==="fade",d=r.vars.asNavFor!=="",v={},m=!0;e.data(t,"flexslider",r);v={init:function(){r.animating=!1;r.currentSlide=parseInt(r.vars.startAt?r.vars.startAt:0);isNaN(r.currentSlide)&&(r.currentSlide=0);r.animatingTo=r.currentSlide;r.atEnd=r.currentSlide===0||r.currentSlide===r.last;r.containerSelector=r.vars.selector.substr(0,r.vars.selector.search(" "));r.slides=e(r.vars.selector,r);r.container=e(r.containerSelector,r);r.count=r.slides.length;r.syncExists=e(r.vars.sync).length>0;r.vars.animation==="slide"&&(r.vars.animation="swing");r.prop=l?"top":"marginLeft";r.args={};r.manualPause=!1;r.stopped=!1;r.started=!1;r.startTimeout=null;r.transitions=!r.vars.video&&!p&&r.vars.useCSS&&function(){var e=document.createElement("div"),t=["perspectiveProperty","WebkitPerspective","MozPerspective","OPerspective","msPerspective"];for(var n in t)if(e.style[t[n]]!==undefined){r.pfx=t[n].replace("Perspective","").toLowerCase();r.prop="-"+r.pfx+"-transform";return!0}return!1}();r.vars.controlsContainer!==""&&(r.controlsContainer=e(r.vars.controlsContainer).length>0&&e(r.vars.controlsContainer));r.vars.manualControls!==""&&(r.manualControls=e(r.vars.manualControls).length>0&&e(r.vars.manualControls));if(r.vars.randomize){r.slides.sort(function(){return Math.round(Math.random())-.5});r.container.empty().append(r.slides)}r.doMath();r.setup("init");r.vars.controlNav&&v.controlNav.setup();r.vars.directionNav&&v.directionNav.setup();r.vars.keyboard&&(e(r.containerSelector).length===1||r.vars.multipleKeyboard)&&e(document).bind("keyup",function(e){var t=e.keyCode;if(!r.animating&&(t===39||t===37)){var n=t===39?r.getTarget("next"):t===37?r.getTarget("prev"):!1;r.flexAnimate(n,r.vars.pauseOnAction)}});r.vars.mousewheel&&r.bind("mousewheel",function(e,t,n,i){e.preventDefault();var s=t<0?r.getTarget("next"):r.getTarget("prev");r.flexAnimate(s,r.vars.pauseOnAction)});r.vars.pausePlay&&v.pausePlay.setup();r.vars.slideshow&&r.vars.pauseInvisible&&v.pauseInvisible.init();if(r.vars.slideshow){r.vars.pauseOnHover&&r.hover(function(){!r.manualPlay&&!r.manualPause&&r.pause()},function(){!r.manualPause&&!r.manualPlay&&!r.stopped&&r.play()});if(!r.vars.pauseInvisible||!v.pauseInvisible.isHidden())r.vars.initDelay>0?r.startTimeout=setTimeout(r.play,r.vars.initDelay):r.play()}d&&v.asNav.setup();o&&r.vars.touch&&v.touch();(!p||p&&r.vars.smoothHeight)&&e(window).bind("resize orientationchange focus",v.resize);r.find("img").attr("draggable","false");setTimeout(function(){r.vars.start(r)},200)},asNav:{setup:function(){r.asNav=!0;r.animatingTo=Math.floor(r.currentSlide/r.move);r.currentItem=r.currentSlide;r.slides.removeClass(i+"active-slide").eq(r.currentItem).addClass(i+"active-slide");if(!s)r.slides.click(function(t){t.preventDefault();var n=e(this),s=n.index(),o=n.offset().left-e(r).scrollLeft();if(o<=0&&n.hasClass(i+"active-slide"))r.flexAnimate(r.getTarget("prev"),!0);else if(!e(r.vars.asNavFor).data("flexslider").animating&&!n.hasClass(i+"active-slide")){r.direction=r.currentItem<s?"next":"prev";r.flexAnimate(s,r.vars.pauseOnAction,!1,!0,!0)}});else{t._slider=r;r.slides.each(function(){var t=this;t._gesture=new MSGesture;t._gesture.target=t;t.addEventListener("MSPointerDown",function(e){e.preventDefault();e.currentTarget._gesture&&e.currentTarget._gesture.addPointer(e.pointerId)},!1);t.addEventListener("MSGestureTap",function(t){t.preventDefault();var n=e(this),i=n.index();if(!e(r.vars.asNavFor).data("flexslider").animating&&!n.hasClass("active")){r.direction=r.currentItem<i?"next":"prev";r.flexAnimate(i,r.vars.pauseOnAction,!1,!0,!0)}})})}}},controlNav:{setup:function(){r.manualControls?v.controlNav.setupManual():v.controlNav.setupPaging()},setupPaging:function(){var t=r.vars.controlNav==="thumbnails"?"control-thumbs":"control-paging",n=1,s,o;r.controlNavScaffold=e('<ol class="'+i+"control-nav "+i+t+'"></ol>');if(r.pagingCount>1)for(var f=0;f<r.pagingCount;f++){o=r.slides.eq(f);s=r.vars.controlNav==="thumbnails"?'<img src="'+o.attr("data-thumb")+'"/>':"<a>"+n+"</a>";if("thumbnails"===r.vars.controlNav&&!0===r.vars.thumbCaptions){var l=o.attr("data-thumbcaption");""!=l&&undefined!=l&&(s+='<span class="'+i+'caption">'+l+"</span>")}r.controlNavScaffold.append("<li>"+s+"</li>");n++}r.controlsContainer?e(r.controlsContainer).append(r.controlNavScaffold):r.append(r.controlNavScaffold);v.controlNav.set();v.controlNav.active();r.controlNavScaffold.delegate("a, img",u,function(t){t.preventDefault();if(a===""||a===t.type){var n=e(this),s=r.controlNav.index(n);if(!n.hasClass(i+"active")){r.direction=s>r.currentSlide?"next":"prev";r.flexAnimate(s,r.vars.pauseOnAction)}}a===""&&(a=t.type);v.setToClearWatchedEvent()})},setupManual:function(){r.controlNav=r.manualControls;v.controlNav.active();r.controlNav.bind(u,function(t){t.preventDefault();if(a===""||a===t.type){var n=e(this),s=r.controlNav.index(n);if(!n.hasClass(i+"active")){s>r.currentSlide?r.direction="next":r.direction="prev";r.flexAnimate(s,r.vars.pauseOnAction)}}a===""&&(a=t.type);v.setToClearWatchedEvent()})},set:function(){var t=r.vars.controlNav==="thumbnails"?"img":"a";r.controlNav=e("."+i+"control-nav li "+t,r.controlsContainer?r.controlsContainer:r)},active:function(){r.controlNav.removeClass(i+"active").eq(r.animatingTo).addClass(i+"active")},update:function(t,n){r.pagingCount>1&&t==="add"?r.controlNavScaffold.append(e("<li><a>"+r.count+"</a></li>")):r.pagingCount===1?r.controlNavScaffold.find("li").remove():r.controlNav.eq(n).closest("li").remove();v.controlNav.set();r.pagingCount>1&&r.pagingCount!==r.controlNav.length?r.update(n,t):v.controlNav.active()}},directionNav:{setup:function(){var t=e('<ul class="'+i+'direction-nav"><li><a class="'+i+'prev" href="#">'+r.vars.prevText+'</a></li><li><a class="'+i+'next" href="#">'+r.vars.nextText+"</a></li></ul>");if(r.controlsContainer){e(r.controlsContainer).append(t);r.directionNav=e("."+i+"direction-nav li a",r.controlsContainer)}else{r.append(t);r.directionNav=e("."+i+"direction-nav li a",r)}v.directionNav.update();r.directionNav.bind(u,function(t){t.preventDefault();var n;if(a===""||a===t.type){n=e(this).hasClass(i+"next")?r.getTarget("next"):r.getTarget("prev");r.flexAnimate(n,r.vars.pauseOnAction)}a===""&&(a=t.type);v.setToClearWatchedEvent()})},update:function(){var e=i+"disabled";r.pagingCount===1?r.directionNav.addClass(e).attr("tabindex","-1"):r.vars.animationLoop?r.directionNav.removeClass(e).removeAttr("tabindex"):r.animatingTo===0?r.directionNav.removeClass(e).filter("."+i+"prev").addClass(e).attr("tabindex","-1"):r.animatingTo===r.last?r.directionNav.removeClass(e).filter("."+i+"next").addClass(e).attr("tabindex","-1"):r.directionNav.removeClass(e).removeAttr("tabindex")}},pausePlay:{setup:function(){var t=e('<div class="'+i+'pauseplay"><a></a></div>');if(r.controlsContainer){r.controlsContainer.append(t);r.pausePlay=e("."+i+"pauseplay a",r.controlsContainer)}else{r.append(t);r.pausePlay=e("."+i+"pauseplay a",r)}v.pausePlay.update(r.vars.slideshow?i+"pause":i+"play");r.pausePlay.bind(u,function(t){t.preventDefault();if(a===""||a===t.type)if(e(this).hasClass(i+"pause")){r.manualPause=!0;r.manualPlay=!1;r.pause()}else{r.manualPause=!1;r.manualPlay=!0;r.play()}a===""&&(a=t.type);v.setToClearWatchedEvent()})},update:function(e){e==="play"?r.pausePlay.removeClass(i+"pause").addClass(i+"play").html(r.vars.playText):r.pausePlay.removeClass(i+"play").addClass(i+"pause").html(r.vars.pauseText)}},touch:function(){var e,n,i,o,u,a,f=!1,d=0,v=0,m=0;if(!s){t.addEventListener("touchstart",g,!1);function g(s){if(r.animating)s.preventDefault();else if(window.navigator.msPointerEnabled||s.touches.length===1){r.pause();o=l?r.h:r.w;a=Number(new Date);d=s.touches[0].pageX;v=s.touches[0].pageY;i=h&&c&&r.animatingTo===r.last?0:h&&c?r.limit-(r.itemW+r.vars.itemMargin)*r.move*r.animatingTo:h&&r.currentSlide===r.last?r.limit:h?(r.itemW+r.vars.itemMargin)*r.move*r.currentSlide:c?(r.last-r.currentSlide+r.cloneOffset)*o:(r.currentSlide+r.cloneOffset)*o;e=l?v:d;n=l?d:v;t.addEventListener("touchmove",y,!1);t.addEventListener("touchend",b,!1)}}function y(t){d=t.touches[0].pageX;v=t.touches[0].pageY;u=l?e-v:e-d;f=l?Math.abs(u)<Math.abs(d-n):Math.abs(u)<Math.abs(v-n);var s=500;if(!f||Number(new Date)-a>s){t.preventDefault();if(!p&&r.transitions){r.vars.animationLoop||(u/=r.currentSlide===0&&u<0||r.currentSlide===r.last&&u>0?Math.abs(u)/o+2:1);r.setProps(i+u,"setTouch")}}}function b(s){t.removeEventListener("touchmove",y,!1);if(r.animatingTo===r.currentSlide&&!f&&u!==null){var l=c?-u:u,h=l>0?r.getTarget("next"):r.getTarget("prev");r.canAdvance(h)&&(Number(new Date)-a<550&&Math.abs(l)>50||Math.abs(l)>o/2)?r.flexAnimate(h,r.vars.pauseOnAction):p||r.flexAnimate(r.currentSlide,r.vars.pauseOnAction,!0)}t.removeEventListener("touchend",b,!1);e=null;n=null;u=null;i=null}}else{t.style.msTouchAction="none";t._gesture=new MSGesture;t._gesture.target=t;t.addEventListener("MSPointerDown",w,!1);t._slider=r;t.addEventListener("MSGestureChange",E,!1);t.addEventListener("MSGestureEnd",S,!1);function w(e){e.stopPropagation();if(r.animating)e.preventDefault();else{r.pause();t._gesture.addPointer(e.pointerId);m=0;o=l?r.h:r.w;a=Number(new Date);i=h&&c&&r.animatingTo===r.last?0:h&&c?r.limit-(r.itemW+r.vars.itemMargin)*r.move*r.animatingTo:h&&r.currentSlide===r.last?r.limit:h?(r.itemW+r.vars.itemMargin)*r.move*r.currentSlide:c?(r.last-r.currentSlide+r.cloneOffset)*o:(r.currentSlide+r.cloneOffset)*o}}function E(e){e.stopPropagation();var n=e.target._slider;if(!n)return;var r=-e.translationX,s=-e.translationY;m+=l?s:r;u=m;f=l?Math.abs(m)<Math.abs(-r):Math.abs(m)<Math.abs(-s);if(e.detail===e.MSGESTURE_FLAG_INERTIA){setImmediate(function(){t._gesture.stop()});return}if(!f||Number(new Date)-a>500){e.preventDefault();if(!p&&n.transitions){n.vars.animationLoop||(u=m/(n.currentSlide===0&&m<0||n.currentSlide===n.last&&m>0?Math.abs(m)/o+2:1));n.setProps(i+u,"setTouch")}}}function S(t){t.stopPropagation();var r=t.target._slider;if(!r)return;if(r.animatingTo===r.currentSlide&&!f&&u!==null){var s=c?-u:u,l=s>0?r.getTarget("next"):r.getTarget("prev");r.canAdvance(l)&&(Number(new Date)-a<550&&Math.abs(s)>50||Math.abs(s)>o/2)?r.flexAnimate(l,r.vars.pauseOnAction):p||r.flexAnimate(r.currentSlide,r.vars.pauseOnAction,!0)}e=null;n=null;u=null;i=null;m=0}}},resize:function(){if(!r.animating&&r.is(":visible")){h||r.doMath();if(p)v.smoothHeight();else if(h){r.slides.width(r.computedW);r.update(r.pagingCount);r.setProps()}else if(l){r.viewport.height(r.h);r.setProps(r.h,"setTotal")}else{r.vars.smoothHeight&&v.smoothHeight();r.newSlides.width(r.computedW);r.setProps(r.computedW,"setTotal")}}},smoothHeight:function(e){if(!l||p){var t=p?r:r.viewport;e?t.animate({height:r.slides.eq(r.animatingTo).height()},e):t.height(r.slides.eq(r.animatingTo).height())}},sync:function(t){var n=e(r.vars.sync).data("flexslider"),i=r.animatingTo;switch(t){case"animate":n.flexAnimate(i,r.vars.pauseOnAction,!1,!0);break;case"play":!n.playing&&!n.asNav&&n.play();break;case"pause":n.pause()}},pauseInvisible:{visProp:null,init:function(){var e=["webkit","moz","ms","o"];if("hidden"in document)return"hidden";for(var t=0;t<e.length;t++)e[t]+"Hidden"in document&&(v.pauseInvisible.visProp=e[t]+"Hidden");if(v.pauseInvisible.visProp){var n=v.pauseInvisible.visProp.replace(/[H|h]idden/,"")+"visibilitychange";document.addEventListener(n,function(){v.pauseInvisible.isHidden()?r.startTimeout?clearTimeout(r.startTimeout):r.pause():r.started?r.play():r.vars.initDelay>0?setTimeout(r.play,r.vars.initDelay):r.play()})}},isHidden:function(){return document[v.pauseInvisible.visProp]||!1}},setToClearWatchedEvent:function(){clearTimeout(f);f=setTimeout(function(){a=""},3e3)}};r.flexAnimate=function(t,n,s,u,a){!r.vars.animationLoop&&t!==r.currentSlide&&(r.direction=t>r.currentSlide?"next":"prev");d&&r.pagingCount===1&&(r.direction=r.currentItem<t?"next":"prev");if(!r.animating&&(r.canAdvance(t,a)||s)&&r.is(":visible")){if(d&&u){var f=e(r.vars.asNavFor).data("flexslider");r.atEnd=t===0||t===r.count-1;f.flexAnimate(t,!0,!1,!0,a);r.direction=r.currentItem<t?"next":"prev";f.direction=r.direction;if(Math.ceil((t+1)/r.visible)-1===r.currentSlide||t===0){r.currentItem=t;r.slides.removeClass(i+"active-slide").eq(t).addClass(i+"active-slide");return!1}r.currentItem=t;r.slides.removeClass(i+"active-slide").eq(t).addClass(i+"active-slide");t=Math.floor(t/r.visible)}r.animating=!0;r.animatingTo=t;n&&r.pause();r.vars.before(r);r.syncExists&&!a&&v.sync("animate");r.vars.controlNav&&v.controlNav.active();h||r.slides.removeClass(i+"active-slide").eq(t).addClass(i+"active-slide");r.atEnd=t===0||t===r.last;r.vars.directionNav&&v.directionNav.update();if(t===r.last){r.vars.end(r);r.vars.animationLoop||r.pause()}if(!p){var m=l?r.slides.filter(":first").height():r.computedW,g,y,b;if(h){g=r.vars.itemMargin;b=(r.itemW+g)*r.move*r.animatingTo;y=b>r.limit&&r.visible!==1?r.limit:b}else r.currentSlide===0&&t===r.count-1&&r.vars.animationLoop&&r.direction!=="next"?y=c?(r.count+r.cloneOffset)*m:0:r.currentSlide===r.last&&t===0&&r.vars.animationLoop&&r.direction!=="prev"?y=c?0:(r.count+1)*m:y=c?(r.count-1-t+r.cloneOffset)*m:(t+r.cloneOffset)*m;r.setProps(y,"",r.vars.animationSpeed);if(r.transitions){if(!r.vars.animationLoop||!r.atEnd){r.animating=!1;r.currentSlide=r.animatingTo}r.container.unbind("webkitTransitionEnd transitionend");r.container.bind("webkitTransitionEnd transitionend",function(){r.wrapup(m)})}else r.container.animate(r.args,r.vars.animationSpeed,r.vars.easing,function(){r.wrapup(m)})}else if(!o){r.slides.eq(r.currentSlide).css({zIndex:1}).animate({opacity:0},r.vars.animationSpeed,r.vars.easing);r.slides.eq(t).css({zIndex:2}).animate({opacity:1},r.vars.animationSpeed,r.vars.easing,r.wrapup)}else{r.slides.eq(r.currentSlide).css({opacity:0,zIndex:1});r.slides.eq(t).css({opacity:1,zIndex:2});r.wrapup(m)}r.vars.smoothHeight&&v.smoothHeight(r.vars.animationSpeed)}};r.wrapup=function(e){!p&&!h&&(r.currentSlide===0&&r.animatingTo===r.last&&r.vars.animationLoop?r.setProps(e,"jumpEnd"):r.currentSlide===r.last&&r.animatingTo===0&&r.vars.animationLoop&&r.setProps(e,"jumpStart"));r.animating=!1;r.currentSlide=r.animatingTo;r.vars.after(r)};r.animateSlides=function(){!r.animating&&m&&r.flexAnimate(r.getTarget("next"))};r.pause=function(){clearInterval(r.animatedSlides);r.animatedSlides=null;r.playing=!1;r.vars.pausePlay&&v.pausePlay.update("play");r.syncExists&&v.sync("pause")};r.play=function(){r.playing&&clearInterval(r.animatedSlides);r.animatedSlides=r.animatedSlides||setInterval(r.animateSlides,r.vars.slideshowSpeed);r.started=r.playing=!0;r.vars.pausePlay&&v.pausePlay.update("pause");r.syncExists&&v.sync("play")};r.stop=function(){r.pause();r.stopped=!0};r.canAdvance=function(e,t){var n=d?r.pagingCount-1:r.last;return t?!0:d&&r.currentItem===r.count-1&&e===0&&r.direction==="prev"?!0:d&&r.currentItem===0&&e===r.pagingCount-1&&r.direction!=="next"?!1:e===r.currentSlide&&!d?!1:r.vars.animationLoop?!0:r.atEnd&&r.currentSlide===0&&e===n&&r.direction!=="next"?!1:r.atEnd&&r.currentSlide===n&&e===0&&r.direction==="next"?!1:!0};r.getTarget=function(e){r.direction=e;return e==="next"?r.currentSlide===r.last?0:r.currentSlide+1:r.currentSlide===0?r.last:r.currentSlide-1};r.setProps=function(e,t,n){var i=function(){var n=e?e:(r.itemW+r.vars.itemMargin)*r.move*r.animatingTo,i=function(){if(h)return t==="setTouch"?e:c&&r.animatingTo===r.last?0:c?r.limit-(r.itemW+r.vars.itemMargin)*r.move*r.animatingTo:r.animatingTo===r.last?r.limit:n;switch(t){case"setTotal":return c?(r.count-1-r.currentSlide+r.cloneOffset)*e:(r.currentSlide+r.cloneOffset)*e;case"setTouch":return c?e:e;case"jumpEnd":return c?e:r.count*e;case"jumpStart":return c?r.count*e:e;default:return e}}();return i*-1+"px"}();if(r.transitions){i=l?"translate3d(0,"+i+",0)":"translate3d("+i+",0,0)";n=n!==undefined?n/1e3+"s":"0s";r.container.css("-"+r.pfx+"-transition-duration",n)}r.args[r.prop]=i;(r.transitions||n===undefined)&&r.container.css(r.args)};r.setup=function(t){if(!p){var n,s;if(t==="init"){r.viewport=e('<div class="'+i+'viewport"></div>').css({overflow:"hidden",position:"relative"}).appendTo(r).append(r.container);r.cloneCount=0;r.cloneOffset=0;if(c){s=e.makeArray(r.slides).reverse();r.slides=e(s);r.container.empty().append(r.slides)}}if(r.vars.animationLoop&&!h){r.cloneCount=2;r.cloneOffset=1;t!=="init"&&r.container.find(".clone").remove();r.container.append(r.slides.first().clone().addClass("clone").attr("aria-hidden","true")).prepend(r.slides.last().clone().addClass("clone").attr("aria-hidden","true"))}r.newSlides=e(r.vars.selector,r);n=c?r.count-1-r.currentSlide+r.cloneOffset:r.currentSlide+r.cloneOffset;if(l&&!h){r.container.height((r.count+r.cloneCount)*200+"%").css("position","absolute").width("100%");setTimeout(function(){r.newSlides.css({display:"block"});r.doMath();r.viewport.height(r.h);r.setProps(n*r.h,"init")},t==="init"?100:0)}else{r.container.width((r.count+r.cloneCount)*200+"%");r.setProps(n*r.computedW,"init");setTimeout(function(){r.doMath();r.newSlides.css({width:r.computedW,"float":"left",display:"block"});r.vars.smoothHeight&&v.smoothHeight()},t==="init"?100:0)}}else{r.slides.css({width:"100%","float":"left",marginRight:"-100%",position:"relative"});t==="init"&&(o?r.slides.css({opacity:0,display:"block",webkitTransition:"opacity "+r.vars.animationSpeed/1e3+"s ease",zIndex:1}).eq(r.currentSlide).css({opacity:1,zIndex:2}):r.slides.css({opacity:0,display:"block",zIndex:1}).eq(r.currentSlide).css({zIndex:2}).animate({opacity:1},r.vars.animationSpeed,r.vars.easing));r.vars.smoothHeight&&v.smoothHeight()}h||r.slides.removeClass(i+"active-slide").eq(r.currentSlide).addClass(i+"active-slide")};r.doMath=function(){var e=r.slides.first(),t=r.vars.itemMargin,n=r.vars.minItems,i=r.vars.maxItems;r.w=r.viewport===undefined?r.width():r.viewport.width();r.h=e.height();r.boxPadding=e.outerWidth()-e.width();if(h){r.itemT=r.vars.itemWidth+t;r.minW=n?n*r.itemT:r.w;r.maxW=i?i*r.itemT-t:r.w;r.itemW=r.minW>r.w?(r.w-t*(n-1))/n:r.maxW<r.w?(r.w-t*(i-1))/i:r.vars.itemWidth>r.w?r.w:r.vars.itemWidth;r.visible=Math.floor(r.w/r.itemW);r.move=r.vars.move>0&&r.vars.move<r.visible?r.vars.move:r.visible;r.pagingCount=Math.ceil((r.count-r.visible)/r.move+1);r.last=r.pagingCount-1;r.limit=r.pagingCount===1?0:r.vars.itemWidth>r.w?r.itemW*(r.count-1)+t*(r.count-1):(r.itemW+t)*r.count-r.w-t}else{r.itemW=r.w;r.pagingCount=r.count;r.last=r.count-1}r.computedW=r.itemW-r.boxPadding};r.update=function(e,t){r.doMath();if(!h){e<r.currentSlide?r.currentSlide+=1:e<=r.currentSlide&&e!==0&&(r.currentSlide-=1);r.animatingTo=r.currentSlide}if(r.vars.controlNav&&!r.manualControls)if(t==="add"&&!h||r.pagingCount>r.controlNav.length)v.controlNav.update("add");else if(t==="remove"&&!h||r.pagingCount<r.controlNav.length){if(h&&r.currentSlide>r.last){r.currentSlide-=1;r.animatingTo-=1}v.controlNav.update("remove",r.last)}r.vars.directionNav&&v.directionNav.update()};r.addSlide=function(t,n){var i=e(t);r.count+=1;r.last=r.count-1;l&&c?n!==undefined?r.slides.eq(r.count-n).after(i):r.container.prepend(i):n!==undefined?r.slides.eq(n).before(i):r.container.append(i);r.update(n,"add");r.slides=e(r.vars.selector+":not(.clone)",r);r.setup();r.vars.added(r)};r.removeSlide=function(t){var n=isNaN(t)?r.slides.index(e(t)):t;r.count-=1;r.last=r.count-1;isNaN(t)?e(t,r.slides).remove():l&&c?r.slides.eq(r.last).remove():r.slides.eq(t).remove();r.doMath();r.update(n,"remove");r.slides=e(r.vars.selector+":not(.clone)",r);r.setup();r.vars.removed(r)};v.init()};e(window).blur(function(e){focused=!1}).focus(function(e){focused=!0});e.flexslider.defaults={namespace:"flex-",selector:".slides > li",animation:"fade",easing:"swing",direction:"horizontal",reverse:!1,animationLoop:!0,smoothHeight:!1,startAt:0,slideshow:!0,slideshowSpeed:7e3,animationSpeed:600,initDelay:0,randomize:!1,thumbCaptions:!1,pauseOnAction:!0,pauseOnHover:!1,pauseInvisible:!0,useCSS:!0,touch:!0,video:!1,controlNav:!0,directionNav:!0,prevText:"Previous",nextText:"Next",keyboard:!0,multipleKeyboard:!1,mousewheel:!1,pausePlay:!1,pauseText:"Pause",playText:"Play",controlsContainer:"",manualControls:"",sync:"",asNavFor:"",itemWidth:0,itemMargin:0,minItems:1,maxItems:0,move:0,allowOneSlide:!0,start:function(){},before:function(){},after:function(){},end:function(){},added:function(){},removed:function(){}};e.fn.flexslider=function(t){t===undefined&&(t={});if(typeof t=="object")return this.each(function(){var n=e(this),r=t.selector?t.selector:".slides > li",i=n.find(r);if(i.length===1&&t.allowOneSlide===!0||i.length===0){i.fadeIn(400);t.start&&t.start(n)}else n.data("flexslider")===undefined&&new e.flexslider(this,t)});var n=e(this).data("flexslider");switch(t){case"play":n.play();break;case"pause":n.pause();break;case"stop":n.stop();break;case"next":n.flexAnimate(n.getTarget("next"),!0);break;case"prev":case"previous":n.flexAnimate(n.getTarget("prev"),!0);break;default:typeof t=="number"&&n.flexAnimate(t,!0)}}})(jQuery);; /** * hoverIntent r6 // 2011.02.26 // jQuery 1.5.1+ * <http://cherne.net/brian/resources/jquery.hoverIntent.html> * * @param f onMouseOver function || An object with configuration options * @param g onMouseOut function || Nothing (use configuration options object) * @author Brian Cherne brian(at)cherne(dot)net */ (function($){$.fn.hoverIntent=function(f,g){var cfg={sensitivity:7,interval:100,timeout:0};cfg=$.extend(cfg,g?{over:f,out:g}:f);var cX,cY,pX,pY;var track=function(ev){cX=ev.pageX;cY=ev.pageY};var compare=function(ev,ob){ob.hoverIntent_t=clearTimeout(ob.hoverIntent_t);if((Math.abs(pX-cX)+Math.abs(pY-cY))<cfg.sensitivity){$(ob).unbind("mousemove",track);ob.hoverIntent_s=1;return cfg.over.apply(ob,[ev])}else{pX=cX;pY=cY;ob.hoverIntent_t=setTimeout(function(){compare(ev,ob)},cfg.interval)}};var delay=function(ev,ob){ob.hoverIntent_t=clearTimeout(ob.hoverIntent_t);ob.hoverIntent_s=0;return cfg.out.apply(ob,[ev])};var handleHover=function(e){var ev=jQuery.extend({},e);var ob=this;if(ob.hoverIntent_t){ob.hoverIntent_t=clearTimeout(ob.hoverIntent_t)}if(e.type=="mouseenter"){pX=ev.pageX;pY=ev.pageY;$(ob).bind("mousemove",track);if(ob.hoverIntent_s!=1){ob.hoverIntent_t=setTimeout(function(){compare(ev,ob)},cfg.interval)}}else{$(ob).unbind("mousemove",track);if(ob.hoverIntent_s==1){ob.hoverIntent_t=setTimeout(function(){delay(ev,ob)},cfg.timeout)}}};return this.bind('mouseenter',handleHover).bind('mouseleave',handleHover)}})(jQuery);; /* * sf-Smallscreen v1.0b - Provides small-screen compatibility for the jQuery Superfish plugin. * * Developer's note: * Built as a part of the Superfish project for Drupal (http://drupal.org/project/superfish) * Found any bug? have any cool ideas? contact me right away! http://drupal.org/user/619294/contact * * jQuery version: 1.3.x or higher. * * Dual licensed under the MIT and GPL licenses: * http://www.opensource.org/licenses/mit-license.php * http://www.gnu.org/licenses/gpl.html */ (function($){ $.fn.sfsmallscreen = function(options){ options = $.extend({ mode: 'inactive', breakpoint: 768, useragent: '', title: '', addSelected: true, menuClasses: true, hyperlinkClasses: true, excludeClass_menu: '', excludeClass_hyperlink: '', includeClass_menu: '', includeClass_hyperlink: '' }, options); // We need to clean up the menu from anything unnecessary. function refine(menu){ if ($('.sf-megamenu', menu).length > 0){ var refined = menu.clone(); refined.find('div.sf-megamenu-column > ol').each(function(){ $(this).replaceWith('<ul>' + $(this).html() + '</ul>'); }); refined.find('div.sf-megamenu-column').each(function(){ $(this).replaceWith($(this).html()); }).end().find('.sf-megamenu-wrapper > ol').each(function(){ $(this).replaceWith($(this).html()); }).end().find('li.sf-megamenu-wrapper').each(function(){ $(this).replaceWith($(this).html()); }); } else { var refined = menu.clone(); } refined.find('.sf-smallscreen-remove').each(function(){ $(this).replaceWith($(this).html()); }).end().find('.sf-sub-indicator, .sf-description').each(function(){ $(this).remove(); }); return refined; } // Currently the only available reaction is converting the menu into a <select> element; // In the next version there will be another reaction that will create a "compact" version of // the menu, using <ul> element hence easy to style with CSS and so on and so forth. function toSelect(menu, level){ var items = ''; $(menu).children('li').each(function(){ var list = $(this); list.children('a, span').each(function(){ var item = $(this), path = item.is('a') ? item.attr('href') : '', itemClone = item.clone(), classes = (options.hyperlinkClasses) ? ((options.excludeClass_hyperlink && itemClone.hasClass(options.excludeClass_hyperlink)) ? itemClone.removeClass(options.excludeClass_hyperlink).attr('class') : itemClone.attr('class')) : '', classes = (options.includeClass_hyperlink && !itemClone.hasClass(options.includeClass_hyperlink)) ? ((options.hyperlinkClasses) ? itemClone.addClass(options.includeClass_hyperlink).attr('class') : options.includeClass_hyperlink) : classes, classes = (classes) ? ' class="' + classes + '"' : '', disable = item.is('span') ? ' disabled="disabled"' : '', subIndicator = 1 < level ? Array(level).join('-') + ' ' : ''; items += '<option value="' + path + '"' + classes + disable + '>' + subIndicator + $.trim(item.text()) +'</option>'; list.find('> ul').each(function(){ items += toSelect(this, level + 1); }); }); }); return items; } // Create the new version, hide the original. function convert(menu){ var menuClone = menu.clone(), classes = (options.menuClasses) ? ((options.excludeClass_menu && menuClone.hasClass(options.excludeClass_menu)) ? menuClone.removeClass(options.excludeClass_menu).attr('class') : menuClone.attr('class')) : '', classes = (options.includeClass_menu && !menuClone.hasClass(options.includeClass_menu)) ? ((options.menuClasses) ? menuClone.addClass(options.includeClass_menu).attr('class') : options.includeClass_menu) : classes, classes = (classes) ? ' class="' + classes + '"' : ''; if ($('#' + menu.attr('id') + '-select').length == 0){ var selectList = $('<select' + classes + ' id="' + menu.attr('id') + '-select"/>'), refinedMenu = refine(menu); newMenu = toSelect(refinedMenu, 1); selectList.append('<option>' + options.title + '</option>').append(newMenu).change(function(){ window.location = selectList.val(); }); if (options.addSelected) { selectList.find('.active').attr("selected", !0); } menu.before(selectList).hide(); } } // Turn everything back to normal. function turnBack(menu){ var id = '#' + menu.attr('id'); $(id + '-select').remove(); $(id).show(); } // Return original object to support chaining. return this.each(function(){ var menu = $(this), mode = options.mode; // The rest is crystal clear, isn't it? :) switch (mode){ case 'always_active' : convert(menu); break; case 'window_width' : if ($(window).width() < options.breakpoint){ convert(menu); } var timer; $(window).resize(function(){ clearTimeout(timer); timer = setTimeout(function(){ if ($(window).width() < options.breakpoint){ convert(menu); } else { turnBack(menu); } }, 100); }); break; case 'useragent_custom' : if (options.useragent != ''){ var ua = RegExp(options.useragent, 'i'); if (navigator.userAgent.match(ua)){ convert(menu); } } break; case 'useragent_predefined' : if (navigator.userAgent.match(/(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od|ad)|iris|kindle|lge |maemo|midp|mmp|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows (ce|phone)|xda|xiino/i)){ convert(menu); } break; } }); }; })(jQuery);; /* * Supposition v0.2 - an optional enhancer for Superfish jQuery menu widget. * * Copyright (c) 2008 Joel Birch - based mostly on work by Jesse Klaasse and credit goes largely to him. * Special thanks to Karl Swedberg for valuable input. * * Dual licensed under the MIT and GPL licenses: * http://www.opensource.org/licenses/mit-license.php * http://www.gnu.org/licenses/gpl.html */ /* * This is not the original jQuery Supersubs plugin. * Please refer to the README for more information. */ (function($){ $.fn.supposition = function(){ var $w = $(window), /*do this once instead of every onBeforeShow call*/ _offset = function(dir) { return window[dir == 'y' ? 'pageYOffset' : 'pageXOffset'] || document.documentElement && document.documentElement[dir=='y' ? 'scrollTop' : 'scrollLeft'] || document.body[dir=='y' ? 'scrollTop' : 'scrollLeft']; }, onHide = function(){ this.css({bottom:''}); }, onBeforeShow = function(){ this.each(function(){ var $u = $(this); $u.css('display','block'); var menuWidth = $u.width(), menuParentWidth = $u.closest('li').outerWidth(true), menuParentLeft = $u.closest('li').offset().left, totalRight = $w.width() + _offset('x'), menuRight = $u.offset().left + menuWidth, exactMenuWidth = (menuRight > (menuParentWidth + menuParentLeft)) ? menuWidth - (menuRight - (menuParentWidth + menuParentLeft)) : menuWidth; if ($u.parents('.sf-js-enabled').hasClass('rtl')) { if (menuParentLeft < exactMenuWidth) { $u.css('left', menuParentWidth + 'px'); $u.css('right', 'auto'); } } else { if (menuRight > totalRight && menuParentLeft > menuWidth) { $u.css('right', menuParentWidth + 'px'); $u.css('left', 'auto'); } } var windowHeight = $w.height(), offsetTop = $u.offset().top, menuParentShadow = ($u.closest('.sf-menu').hasClass('sf-shadow') && $u.css('padding-bottom').length > 0) ? parseInt($u.css('padding-bottom').slice(0,-2)) : 0, menuParentHeight = ($u.closest('.sf-menu').hasClass('sf-vertical')) ? '-' + menuParentShadow : $u.parent().outerHeight(true) - menuParentShadow, menuHeight = $u.height(), baseline = windowHeight + _offset('y'); var expandUp = ((offsetTop + menuHeight > baseline) && (offsetTop > menuHeight)); if (expandUp) { $u.css('bottom', menuParentHeight + 'px'); $u.css('top', 'auto'); } $u.css('display','none'); }); }; return this.each(function() { var o = $.fn.superfish.o[this.serial]; /* get this menu's options */ /* if callbacks already set, store them */ var _onBeforeShow = o.onBeforeShow, _onHide = o.onHide; $.extend($.fn.superfish.o[this.serial],{ onBeforeShow: function() { onBeforeShow.call(this); /* fire our Supposition callback */ _onBeforeShow.call(this); /* fire stored callbacks */ }, onHide: function() { onHide.call(this); /* fire our Supposition callback */ _onHide.call(this); /* fire stored callbacks */ } }); }); }; })(jQuery);; /* * Superfish v1.4.8 - jQuery menu widget * Copyright (c) 2008 Joel Birch * * Dual licensed under the MIT and GPL licenses: * http://www.opensource.org/licenses/mit-license.php * http://www.gnu.org/licenses/gpl.html * * CHANGELOG: http://users.tpg.com.au/j_birch/plugins/superfish/changelog.txt */ /* * This is not the original jQuery Supersubs plugin. * Please refer to the README for more information. */ (function($){ $.fn.superfish = function(op){ var sf = $.fn.superfish, c = sf.c, $arrow = $(['<span class="',c.arrowClass,'"> &#187;</span>'].join('')), over = function(){ var $$ = $(this), menu = getMenu($$); clearTimeout(menu.sfTimer); $$.showSuperfishUl().siblings().hideSuperfishUl(); }, out = function(){ var $$ = $(this), menu = getMenu($$), o = sf.op; clearTimeout(menu.sfTimer); menu.sfTimer=setTimeout(function(){ o.retainPath=($.inArray($$[0],o.$path)>-1); $$.hideSuperfishUl(); if (o.$path.length && $$.parents(['li.',o.hoverClass].join('')).length<1){over.call(o.$path);} },o.delay); }, getMenu = function($menu){ var menu = $menu.parents(['ul.',c.menuClass,':first'].join(''))[0]; sf.op = sf.o[menu.serial]; return menu; }, addArrow = function($a){ $a.addClass(c.anchorClass).append($arrow.clone()); }; return this.each(function() { var s = this.serial = sf.o.length; var o = $.extend({},sf.defaults,op); o.$path = $('li.'+o.pathClass,this).slice(0,o.pathLevels).each(function(){ $(this).addClass([o.hoverClass,c.bcClass].join(' ')) .filter('li:has(ul)').removeClass(o.pathClass); }); sf.o[s] = sf.op = o; $('li:has(ul)',this)[($.fn.hoverIntent && !o.disableHI) ? 'hoverIntent' : 'hover'](over,out).each(function() { if (o.autoArrows) addArrow( $('>a:first-child',this) ); }) .not('.'+c.bcClass) .hideSuperfishUl(); var $a = $('a',this); $a.each(function(i){ var $li = $a.eq(i).parents('li'); $a.eq(i).focus(function(){over.call($li);}).blur(function(){out.call($li);}); }); o.onInit.call(this); }).each(function() { var menuClasses = [c.menuClass]; if (sf.op.dropShadows && !($.browser.msie && $.browser.version < 7)) menuClasses.push(c.shadowClass); $(this).addClass(menuClasses.join(' ')); }); }; var sf = $.fn.superfish; sf.o = []; sf.op = {}; sf.IE7fix = function(){ var o = sf.op; if ($.browser.msie && $.browser.version > 6 && o.dropShadows && o.animation.opacity!=undefined) this.toggleClass(sf.c.shadowClass+'-off'); }; sf.c = { bcClass: 'sf-breadcrumb', menuClass: 'sf-js-enabled', anchorClass: 'sf-with-ul', arrowClass: 'sf-sub-indicator', shadowClass: 'sf-shadow' }; sf.defaults = { hoverClass: 'sfHover', pathClass: 'overideThisToUse', pathLevels: 1, delay: 800, animation: {opacity:'show'}, speed: 'normal', autoArrows: true, dropShadows: true, disableHI: false, // true disables hoverIntent detection onInit: function(){}, // callback functions onBeforeShow: function(){}, onShow: function(){}, onHide: function(){} }; $.fn.extend({ hideSuperfishUl : function(){ var o = sf.op, not = (o.retainPath===true) ? o.$path : ''; o.retainPath = false; var $ul = $(['li.',o.hoverClass].join(''),this).add(this).not(not).removeClass(o.hoverClass) .find('>ul').addClass('sf-hidden'); o.onHide.call($ul); return this; }, showSuperfishUl : function(){ var o = sf.op, sh = sf.c.shadowClass+'-off', $ul = this.addClass(o.hoverClass) .find('>ul.sf-hidden').hide().removeClass('sf-hidden'); sf.IE7fix.call($ul); o.onBeforeShow.call($ul); $ul.animate(o.animation,o.speed,function(){ sf.IE7fix.call($ul); o.onShow.call($ul); }); return this; } }); })(jQuery);; /* * Supersubs v0.2b - jQuery plugin * Copyright (c) 2008 Joel Birch * * Dual licensed under the MIT and GPL licenses: * http://www.opensource.org/licenses/mit-license.php * http://www.gnu.org/licenses/gpl.html * * This plugin automatically adjusts submenu widths of suckerfish-style menus to that of * their longest list item children. If you use this, please expect bugs and report them * to the jQuery Google Group with the word 'Superfish' in the subject line. * */ /* * This is not the original jQuery Supersubs plugin. * Please refer to the README for more information. */ (function($){ // $ will refer to jQuery within this closure $.fn.supersubs = function(options){ var opts = $.extend({}, $.fn.supersubs.defaults, options); // return original object to support chaining return this.each(function() { // cache selections var $$ = $(this); // support metadata var o = $.meta ? $.extend({}, opts, $$.data()) : opts; // get the font size of menu. // .css('fontSize') returns various results cross-browser, so measure an em dash instead var fontsize = $('<li id="menu-fontsize">&#8212;</li>').css({ 'padding' : 0, 'position' : 'absolute', 'top' : '-99999em', 'width' : 'auto' }).appendTo($$).width(); //clientWidth is faster, but was incorrect here // remove em dash $('#menu-fontsize').remove(); // Jump on level if it's a "NavBar" if ($$.hasClass('sf-navbar')) { $$ = $('li > ul', $$); } // cache all ul elements $ULs = $$.find('ul:not(.sf-megamenu)'); // loop through each ul in menu $ULs.each(function(i) { // cache this ul var $ul = $ULs.eq(i); // get all (li) children of this ul var $LIs = $ul.children(); // get all anchor grand-children var $As = $LIs.children('a'); // force content to one line and save current float property var liFloat = $LIs.css('white-space','nowrap').css('float'); // remove width restrictions and floats so elements remain vertically stacked var emWidth = $ul.add($LIs).add($As).css({ 'float' : 'none', 'width' : 'auto' }) // this ul will now be shrink-wrapped to longest li due to position:absolute // so save its width as ems. Clientwidth is 2 times faster than .width() - thanks Dan Switzer .end().end()[0].clientWidth / fontsize; // add more width to ensure lines don't turn over at certain sizes in various browsers emWidth += o.extraWidth; // restrict to at least minWidth and at most maxWidth if (emWidth > o.maxWidth) { emWidth = o.maxWidth; } else if (emWidth < o.minWidth) { emWidth = o.minWidth; } emWidth += 'em'; // set ul to width in ems $ul.css('width',emWidth); // restore li floats to avoid IE bugs // set li width to full width of this ul // revert white-space to normal $LIs.css({ 'float' : liFloat, 'width' : '100%', 'white-space' : 'normal' }) // update offset position of descendant ul to reflect new width of parent .each(function(){ var $childUl = $('>ul',this); var offsetDirection = $childUl.css('left')!==undefined ? 'left' : 'right'; $childUl.css(offsetDirection,emWidth); }); }); }); }; // expose defaults $.fn.supersubs.defaults = { minWidth: 9, // requires em unit. maxWidth: 25, // requires em unit. extraWidth: 0 // extra width can ensure lines don't sometimes turn over due to slight browser differences in how they round-off values }; })(jQuery); // plugin code ends; /** * @file * The Superfish Drupal Behavior to apply the Superfish jQuery plugin to lists. */ (function ($) { Drupal.behaviors.superfish = { attach: function (context, settings) { // Take a look at each list to apply Superfish to. $.each(settings.superfish || {}, function(index, options) { // Process all Superfish lists. $('#superfish-' + options.id, context).once('superfish', function() { var list = $(this); // Check if we are to apply the Supersubs plug-in to it. if (options.plugins || false) { if (options.plugins.supersubs || false) { list.supersubs(options.plugins.supersubs); } } // Apply Superfish to the list. list.superfish(options.sf); // Check if we are to apply any other plug-in to it. if (options.plugins || false) { if (options.plugins.touchscreen || false) { list.sftouchscreen(options.plugins.touchscreen); } if (options.plugins.smallscreen || false) { list.sfsmallscreen(options.plugins.smallscreen); } if (options.plugins.supposition || false) { list.supposition(); } if (options.plugins.bgiframe || false) { list.find('ul').bgIframe({opacity:false}); } } }); }); } }; })(jQuery);;
blueocean-material-icons/src/js/components/svg-icons/device/signal-wifi-4-bar.js
kzantow/blueocean-plugin
import React from 'react'; import SvgIcon from '../../SvgIcon'; const DeviceSignalWifi4Bar = (props) => ( <SvgIcon {...props}> <path d="M12.01 21.49L23.64 7c-.45-.34-4.93-4-11.64-4C5.28 3 .81 6.66.36 7l11.63 14.49.01.01.01-.01z"/> </SvgIcon> ); DeviceSignalWifi4Bar.displayName = 'DeviceSignalWifi4Bar'; DeviceSignalWifi4Bar.muiName = 'SvgIcon'; export default DeviceSignalWifi4Bar;
SSBW/Tareas/Tarea9/restaurantes2/node_modules/react-bootstrap/es/Row.js
jmanday/Master
import _extends from 'babel-runtime/helpers/extends'; import _objectWithoutProperties from 'babel-runtime/helpers/objectWithoutProperties'; import _classCallCheck from 'babel-runtime/helpers/classCallCheck'; import _possibleConstructorReturn from 'babel-runtime/helpers/possibleConstructorReturn'; import _inherits from 'babel-runtime/helpers/inherits'; import classNames from 'classnames'; import React from 'react'; import elementType from 'react-prop-types/lib/elementType'; import { bsClass, getClassSet, splitBsProps } from './utils/bootstrapUtils'; var propTypes = { componentClass: elementType }; var defaultProps = { componentClass: 'div' }; var Row = function (_React$Component) { _inherits(Row, _React$Component); function Row() { _classCallCheck(this, Row); return _possibleConstructorReturn(this, _React$Component.apply(this, arguments)); } Row.prototype.render = function render() { var _props = this.props, Component = _props.componentClass, className = _props.className, props = _objectWithoutProperties(_props, ['componentClass', 'className']); var _splitBsProps = splitBsProps(props), bsProps = _splitBsProps[0], elementProps = _splitBsProps[1]; var classes = getClassSet(bsProps); return React.createElement(Component, _extends({}, elementProps, { className: classNames(className, classes) })); }; return Row; }(React.Component); Row.propTypes = propTypes; Row.defaultProps = defaultProps; export default bsClass('row', Row);
src/js/HomePage.js
mtford90/brio
import React from 'react'; import location from './location'; import {homePageSelected} from './util'; export default class HomePage extends React.Component { constructor(props) { super(props) } render() { let hash = window.location.hash, isSelected = homePageSelected(), style = isSelected ? {} : {'display': 'none'}; return ( <div className="page home-page" data-path="/" data-selected={isSelected} style={style}> {this.props.children} </div> ) } componentDidMount() { this.hashChange = () => {this.forceUpdate()}; $(window).on('hashchange', this.hashChange); } componentWillUnmount() { $(window).off('hashchange', this.hashChange); } }
app/javascript/components/collections/CollectionCardThumbnail.js
nulib/avalon
/* * Copyright 2011-2020, The Trustees of Indiana University and Northwestern * University. 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 * * Unless required by applicable law or agreed to in writing, software distributed * under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR * CONDITIONS OF ANY KIND, either express or implied. See the License for the * specific language governing permissions and limitations under the License. * --- END LICENSE_HEADER BLOCK --- */ import React from 'react'; const CollectionCardThumbnail = ({ children }) => ( <div className="document-thumbnail">{children}</div> ); export default CollectionCardThumbnail;
node_modules/react-icons/fa/adn.js
bairrada97/festival
import React from 'react' import Icon from 'react-icon-base' const FaAdn = props => ( <Icon viewBox="0 0 40 40" {...props}> <g><path d="m20.1 13.9l4.5 6.8h-8.9z m8.2 11.8h2.1l-10.3-15.4-10.2 15.4h2.1l2.3-3.6h11.7z m9-5.7q0 4.7-2.3 8.6t-6.3 6.2-8.6 2.3-8.6-2.3-6.2-6.2-2.3-8.6 2.3-8.6 6.2-6.2 8.6-2.3 8.6 2.3 6.3 6.2 2.3 8.6z"/></g> </Icon> ) export default FaAdn
packages/ringcentral-widgets-docs/src/app/pages/Components/CallingSettingsAlert/index.js
ringcentral/ringcentral-js-widget
import React from 'react'; import { parse } from 'react-docgen'; import CodeExample from '../../../components/CodeExample'; import ComponentHeader from '../../../components/ComponentHeader'; import PropTypeDescription from '../../../components/PropTypeDescription'; import Demo from './Demo'; // eslint-disable-next-line import demoCode from '!raw-loader!./Demo'; // eslint-disable-next-line import componentCode from '!raw-loader!ringcentral-widgets/components/AlertRenderer/CallingSettingsAlert'; const CallingSettingsAlertPage = () => { const info = parse(componentCode); return ( <div> <ComponentHeader name="CallingSettingsAlert" description={info.description} /> <CodeExample code={demoCode} title="CallingSettingsAlert Example"> <Demo /> </CodeExample> <PropTypeDescription componentInfo={info} /> </div> ); }; export default CallingSettingsAlertPage;
app/core/organisms/PrivateRoute/index.js
codejunkienick/starter-lapis
import React from 'react'; import { Route, Redirect } from 'react-router-dom'; import { connect } from 'react-redux'; type Props = { component: React$Element, isAuthenticated: boolean }; type RouteProps = { location: any }; const PrivateRoute = ({ component, isAuthenticated, ...rest }: Props) => <Route {...rest} render={(props: RouteProps) => isAuthenticated ? React.createElement(component, props) : <Redirect to={{ pathname: '/', state: { from: props.location } }} />} />; export default connect(state => ({ isAuthenticated: state.getIn(['user', 'authenticated']) }))(PrivateRoute);
node_modules/babel-core/external-helpers.min.js
madslonnberg/blog
!function(e){var r=e.babelHelpers={};r.inherits=function(e,r){if("function"!=typeof r&&null!==r)throw new TypeError("Super expression must either be null or a function, not "+typeof r);e.prototype=Object.create(r&&r.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),r&&(Object.setPrototypeOf?Object.setPrototypeOf(e,r):e.__proto__=r)},r.defaults=function(e,r){for(var t=Object.getOwnPropertyNames(r),n=0;n<t.length;n++){var o=t[n],i=Object.getOwnPropertyDescriptor(r,o);i&&i.configurable&&void 0===e[o]&&Object.defineProperty(e,o,i)}return e},r.createClass=function(){function e(e,r){for(var t=0;t<r.length;t++){var n=r[t];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(r,t,n){return t&&e(r.prototype,t),n&&e(r,n),r}}(),r.createDecoratedClass=function(){function e(e,r,t){for(var n=0;n<r.length;n++){var o=r[n],i=o.decorators,a=o.key;if(delete o.key,delete o.decorators,o.enumerable=o.enumerable||!1,o.configurable=!0,("value"in o||o.initializer)&&(o.writable=!0),i){for(var l=0;l<i.length;l++){var u=i[l];if("function"!=typeof u)throw new TypeError("The decorator for method "+o.key+" is of the invalid type "+typeof u);o=u(e,a,o)||o}if(void 0!==o.initializer){t[a]=o;continue}}Object.defineProperty(e,a,o)}}return function(r,t,n,o,i){return t&&e(r.prototype,t,o),n&&e(r,n,i),r}}(),r.createDecoratedObject=function(e){for(var r={},t=0;t<e.length;t++){var n=e[t],o=n.decorators,i=n.key;if(delete n.key,delete n.decorators,n.enumerable=!0,n.configurable=!0,("value"in n||n.initializer)&&(n.writable=!0),o)for(var a=0;a<o.length;a++){var l=o[a];if("function"!=typeof l)throw new TypeError("The decorator for method "+n.key+" is of the invalid type "+typeof l);n=l(r,i,n)||n}n.initializer&&(n.value=n.initializer.call(r)),Object.defineProperty(r,i,n)}return r},r.defineDecoratedPropertyDescriptor=function(e,r,t){var n=t[r];if(n){var o={};for(var i in n)o[i]=n[i];o.value=o.initializer?o.initializer.call(e):void 0,Object.defineProperty(e,r,o)}},r.taggedTemplateLiteral=function(e,r){return Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(r)}}))},r.taggedTemplateLiteralLoose=function(e,r){return e.raw=r,e},r.toArray=function(e){return Array.isArray(e)?e:Array.from(e)},r.toConsumableArray=function(e){if(Array.isArray(e)){for(var r=0,t=Array(e.length);r<e.length;r++)t[r]=e[r];return t}return Array.from(e)},r.slicedToArray=function(){function e(e,r){var t=[],n=!0,o=!1,i=void 0;try{for(var a,l=e[Symbol.iterator]();!(n=(a=l.next()).done)&&(t.push(a.value),!r||t.length!==r);n=!0);}catch(u){o=!0,i=u}finally{try{!n&&l["return"]&&l["return"]()}finally{if(o)throw i}}return t}return function(r,t){if(Array.isArray(r))return r;if(Symbol.iterator in Object(r))return e(r,t);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),r.slicedToArrayLoose=function(e,r){if(Array.isArray(e))return e;if(Symbol.iterator in Object(e)){for(var t,n=[],o=e[Symbol.iterator]();!(t=o.next()).done&&(n.push(t.value),!r||n.length!==r););return n}throw new TypeError("Invalid attempt to destructure non-iterable instance")},r.objectWithoutProperties=function(e,r){var t={};for(var n in e)r.indexOf(n)>=0||Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t},r.hasOwn=Object.prototype.hasOwnProperty,r.slice=Array.prototype.slice,r.bind=Function.prototype.bind,r.defineProperty=function(e,r,t){return r in e?Object.defineProperty(e,r,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[r]=t,e},r.asyncToGenerator=function(e){return function(){var r=e.apply(this,arguments);return new Promise(function(e,t){function n(n,a){try{var l=r[n](a),u=l.value}catch(f){return void t(f)}l.done?e(u):Promise.resolve(u).then(o,i)}var o=n.bind(null,"next"),i=n.bind(null,"throw");o()})}},r.interopExportWildcard=function(e,r){var t=r({},e);return delete t["default"],t},r.interopRequireWildcard=function(e){if(e&&e.__esModule)return e;var r={};if(null!=e)for(var t in e)Object.prototype.hasOwnProperty.call(e,t)&&(r[t]=e[t]);return r["default"]=e,r},r.interopRequireDefault=function(e){return e&&e.__esModule?e:{"default":e}},r._typeof=function(e){return e&&e.constructor===Symbol?"symbol":typeof e},r._extends=Object.assign||function(e){for(var r=1;r<arguments.length;r++){var t=arguments[r];for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])}return e},r.get=function t(e,r,n){null===e&&(e=Function.prototype);var o=Object.getOwnPropertyDescriptor(e,r);if(void 0===o){var i=Object.getPrototypeOf(e);return null===i?void 0:t(i,r,n)}if("value"in o)return o.value;var a=o.get;if(void 0!==a)return a.call(n)},r.set=function n(e,r,t,o){var i=Object.getOwnPropertyDescriptor(e,r);if(void 0===i){var a=Object.getPrototypeOf(e);null!==a&&n(a,r,t,o)}else if("value"in i&&i.writable)i.value=t;else{var l=i.set;void 0!==l&&l.call(o,t)}return t},r.newArrowCheck=function(e,r){if(e!==r)throw new TypeError("Cannot instantiate an arrow function")},r.classCallCheck=function(e,r){if(!(e instanceof r))throw new TypeError("Cannot call a class as a function")},r.objectDestructuringEmpty=function(e){if(null==e)throw new TypeError("Cannot destructure undefined")},r.temporalUndefined={},r.temporalAssertDefined=function(e,r,t){if(e===t)throw new ReferenceError(r+" is not defined - temporal dead zone");return!0},r.selfGlobal="undefined"==typeof e?self:e,r.typeofReactElement="function"==typeof Symbol&&Symbol["for"]&&Symbol["for"]("react.element")||60103,r.defaultProps=function(e,r){if(e)for(var t in e)"undefined"==typeof r[t]&&(r[t]=e[t]);return r},r._instanceof=function(e,r){return null!=r&&r[Symbol.hasInstance]?r[Symbol.hasInstance](e):e instanceof r},r.interopRequire=function(e){return e&&e.__esModule?e["default"]:e}}("undefined"==typeof global?self:global);
examples/samples/monitoring.ios.js
MacKentoch/react-native-beacons-manager
/* eslint-disable */ import Beacons from 'react-native-beacons-manager'; import moment from 'moment'; const TIME_FORMAT = 'MM/DD/YYYY HH:mm:ss'; class beaconMonitoringOnly extends Component { // will be set as a reference to "regionDidEnter" event: regionDidEnterEvent = null; // will be set as a reference to "regionDidExit" event: regionDidExitEvent = null; // will be set as a reference to "authorizationStatusDidChange" event: authStateDidRangeEvent = null; state = { // region information uuid: '7b44b47b-52a1-5381-90c2-f09b6838c5d4', identifier: 'some id', regionEnterDatasource: new ListView.DataSource({rowHasChanged: (r1, r2) => r1 !== r2}).cloneWithRows([]), regionExitDatasource: new ListView.DataSource({rowHasChanged: (r1, r2) => r1 !== r2}).cloneWithRows([]) }; componentWillMount() { const { identifier, uuid } = this.state; // // ONLY non component state aware here in componentWillMount // // OPTIONAL: listen to authorization change this.authStateDidRangeEvent = Beacons.BeaconsEventEmitter.addListener( 'authorizationStatusDidChange', (info) => console.log('authorizationStatusDidChange: ', info) ); // MANDATORY: you have to request ALWAYS Authorization (not only when in use) when monitoring // you also have to add "Privacy - Location Always Usage Description" in your "Info.plist" file // otherwise monitoring won't work Beacons.requestAlwaysAuthorization(); Beacons.shouldDropEmptyRanges(true); // Define a region which can be identifier + uuid, // identifier + uuid + major or identifier + uuid + major + minor // (minor and major properties are numbers) const region = { identifier, uuid }; // Monitor for beacons inside the region Beacons .startMonitoringForRegion(region) // or like < v1.0.7: .startRangingBeaconsInRegion(identifier, uuid) .then(() => console.log('Beacons monitoring started succesfully')) .catch(error => console.log(`Beacons monitoring not started, error: ${error}`)); // update location to ba able to monitor: Beacons.startUpdatingLocation(); } componentDidMount() { // // component state aware here - attach events // // monitoring: this.regionDidEnterEvent = Beacons.BeaconsEventEmitter.addListener( 'regionDidEnter', (data) => { console.log('monitoring - regionDidEnter data: ', data); const time = moment().format(TIME_FORMAT); this.setState({ regionEnterDatasource: this.state.rangingDataSource.cloneWithRows([{ identifier:data.identifier, uuid:data.uuid, minor:data.minor, major:data.major, time }]) }); } ); this.regionDidExitEvent = Beacons.BeaconsEventEmitter.addListener( 'regionDidExit', ({ identifier, uuid, minor, major }) => { console.log('monitoring - regionDidExit data: ', { identifier, uuid, minor, major }); const time = moment().format(TIME_FORMAT); this.setState({ regionExitDatasource: this.state.rangingDataSource.cloneWithRows([{ identifier, uuid, minor, major, time }]) }); } ); } componentWillUnMount() { // stop monitoring beacons: Beacons .stopMonitoringForRegion(region) .then(() => console.log('Beacons monitoring stopped succesfully')) .catch(error => console.log(`Beacons monitoring not stopped, error: ${error}`)); // stop updating locationManager: Beacons.stopUpdatingLocation(); // remove auth state event we registered at componentDidMount: this.authStateDidRangeEvent.remove(); // remove monitiring events we registered at componentDidMount:: this.regionDidEnterEvent.remove(); this.regionDidExitEvent.remove(); } render() { const { bluetoothState, regionEnterDatasource, regionExitDatasource } = this.state; return ( <View style={styles.container}> <Text style={styles.headline}> monitoring enter information: </Text> <ListView dataSource={ regionEnterDatasource } enableEmptySections={ true } renderRow={this.renderMonitoringEnterRow} /> <Text style={styles.headline}> monitoring exit information: </Text> <ListView dataSource={ regionExitDatasource } enableEmptySections={ true } renderRow={this.renderMonitoringLeaveRow} /> </View> ); } renderMonitoringEnterRow = ({ identifier, uuid, minor, major, time }) => { return ( <View style={styles.row}> <Text style={styles.smallText}> Identifier: {identifier ? identifier : 'NA'} </Text> <Text style={styles.smallText}> UUID: {uuid ? uuid : 'NA'} </Text> <Text style={styles.smallText}> Major: {major ? major : ''} </Text> <Text style={styles.smallText}> Minor: { minor ? minor : ''} </Text> <Text style={styles.smallText}> time: { time ? time : 'NA'} </Text> </View> ); } renderMonitoringLeaveRow = ({ identifier, uuid, minor, major, time }) => { return ( <View style={styles.row}> <Text style={styles.smallText}> Identifier: {identifier ? identifier : 'NA'} </Text> <Text style={styles.smallText}> UUID: {uuid ? uuid : 'NA'} </Text> <Text style={styles.smallText}> Major: {major ? major : ''} </Text> <Text style={styles.smallText}> Minor: { minor ? minor : ''} </Text> <Text style={styles.smallText}> time: { time ? time : 'NA'} </Text> </View> ); } }
ajax/libs/mediaelement/1.1.5/jquery.js
viskin/cdnjs
/*! * jQuery JavaScript Library v1.4.4 * http://jquery.com/ * * Copyright 2010, John Resig * Dual licensed under the MIT or GPL Version 2 licenses. * http://jquery.org/license * * Includes Sizzle.js * http://sizzlejs.com/ * Copyright 2010, The Dojo Foundation * Released under the MIT, BSD, and GPL Licenses. * * Date: Thu Nov 11 19:04:53 2010 -0500 */ (function(E,B){function ka(a,b,d){if(d===B&&a.nodeType===1){d=a.getAttribute("data-"+b);if(typeof d==="string"){try{d=d==="true"?true:d==="false"?false:d==="null"?null:!c.isNaN(d)?parseFloat(d):Ja.test(d)?c.parseJSON(d):d}catch(e){}c.data(a,b,d)}else d=B}return d}function U(){return false}function ca(){return true}function la(a,b,d){d[0].type=a;return c.event.handle.apply(b,d)}function Ka(a){var b,d,e,f,h,l,k,o,x,r,A,C=[];f=[];h=c.data(this,this.nodeType?"events":"__events__");if(typeof h==="function")h= h.events;if(!(a.liveFired===this||!h||!h.live||a.button&&a.type==="click")){if(a.namespace)A=RegExp("(^|\\.)"+a.namespace.split(".").join("\\.(?:.*\\.)?")+"(\\.|$)");a.liveFired=this;var J=h.live.slice(0);for(k=0;k<J.length;k++){h=J[k];h.origType.replace(X,"")===a.type?f.push(h.selector):J.splice(k--,1)}f=c(a.target).closest(f,a.currentTarget);o=0;for(x=f.length;o<x;o++){r=f[o];for(k=0;k<J.length;k++){h=J[k];if(r.selector===h.selector&&(!A||A.test(h.namespace))){l=r.elem;e=null;if(h.preType==="mouseenter"|| h.preType==="mouseleave"){a.type=h.preType;e=c(a.relatedTarget).closest(h.selector)[0]}if(!e||e!==l)C.push({elem:l,handleObj:h,level:r.level})}}}o=0;for(x=C.length;o<x;o++){f=C[o];if(d&&f.level>d)break;a.currentTarget=f.elem;a.data=f.handleObj.data;a.handleObj=f.handleObj;A=f.handleObj.origHandler.apply(f.elem,arguments);if(A===false||a.isPropagationStopped()){d=f.level;if(A===false)b=false;if(a.isImmediatePropagationStopped())break}}return b}}function Y(a,b){return(a&&a!=="*"?a+".":"")+b.replace(La, "`").replace(Ma,"&")}function ma(a,b,d){if(c.isFunction(b))return c.grep(a,function(f,h){return!!b.call(f,h,f)===d});else if(b.nodeType)return c.grep(a,function(f){return f===b===d});else if(typeof b==="string"){var e=c.grep(a,function(f){return f.nodeType===1});if(Na.test(b))return c.filter(b,e,!d);else b=c.filter(b,e)}return c.grep(a,function(f){return c.inArray(f,b)>=0===d})}function na(a,b){var d=0;b.each(function(){if(this.nodeName===(a[d]&&a[d].nodeName)){var e=c.data(a[d++]),f=c.data(this, e);if(e=e&&e.events){delete f.handle;f.events={};for(var h in e)for(var l in e[h])c.event.add(this,h,e[h][l],e[h][l].data)}}})}function Oa(a,b){b.src?c.ajax({url:b.src,async:false,dataType:"script"}):c.globalEval(b.text||b.textContent||b.innerHTML||"");b.parentNode&&b.parentNode.removeChild(b)}function oa(a,b,d){var e=b==="width"?a.offsetWidth:a.offsetHeight;if(d==="border")return e;c.each(b==="width"?Pa:Qa,function(){d||(e-=parseFloat(c.css(a,"padding"+this))||0);if(d==="margin")e+=parseFloat(c.css(a, "margin"+this))||0;else e-=parseFloat(c.css(a,"border"+this+"Width"))||0});return e}function da(a,b,d,e){if(c.isArray(b)&&b.length)c.each(b,function(f,h){d||Ra.test(a)?e(a,h):da(a+"["+(typeof h==="object"||c.isArray(h)?f:"")+"]",h,d,e)});else if(!d&&b!=null&&typeof b==="object")c.isEmptyObject(b)?e(a,""):c.each(b,function(f,h){da(a+"["+f+"]",h,d,e)});else e(a,b)}function S(a,b){var d={};c.each(pa.concat.apply([],pa.slice(0,b)),function(){d[this]=a});return d}function qa(a){if(!ea[a]){var b=c("<"+ a+">").appendTo("body"),d=b.css("display");b.remove();if(d==="none"||d==="")d="block";ea[a]=d}return ea[a]}function fa(a){return c.isWindow(a)?a:a.nodeType===9?a.defaultView||a.parentWindow:false}var t=E.document,c=function(){function a(){if(!b.isReady){try{t.documentElement.doScroll("left")}catch(j){setTimeout(a,1);return}b.ready()}}var b=function(j,s){return new b.fn.init(j,s)},d=E.jQuery,e=E.$,f,h=/^(?:[^<]*(<[\w\W]+>)[^>]*$|#([\w\-]+)$)/,l=/\S/,k=/^\s+/,o=/\s+$/,x=/\W/,r=/\d/,A=/^<(\w+)\s*\/?>(?:<\/\1>)?$/, C=/^[\],:{}\s]*$/,J=/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g,w=/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,I=/(?:^|:|,)(?:\s*\[)+/g,L=/(webkit)[ \/]([\w.]+)/,g=/(opera)(?:.*version)?[ \/]([\w.]+)/,i=/(msie) ([\w.]+)/,n=/(mozilla)(?:.*? rv:([\w.]+))?/,m=navigator.userAgent,p=false,q=[],u,y=Object.prototype.toString,F=Object.prototype.hasOwnProperty,M=Array.prototype.push,N=Array.prototype.slice,O=String.prototype.trim,D=Array.prototype.indexOf,R={};b.fn=b.prototype={init:function(j, s){var v,z,H;if(!j)return this;if(j.nodeType){this.context=this[0]=j;this.length=1;return this}if(j==="body"&&!s&&t.body){this.context=t;this[0]=t.body;this.selector="body";this.length=1;return this}if(typeof j==="string")if((v=h.exec(j))&&(v[1]||!s))if(v[1]){H=s?s.ownerDocument||s:t;if(z=A.exec(j))if(b.isPlainObject(s)){j=[t.createElement(z[1])];b.fn.attr.call(j,s,true)}else j=[H.createElement(z[1])];else{z=b.buildFragment([v[1]],[H]);j=(z.cacheable?z.fragment.cloneNode(true):z.fragment).childNodes}return b.merge(this, j)}else{if((z=t.getElementById(v[2]))&&z.parentNode){if(z.id!==v[2])return f.find(j);this.length=1;this[0]=z}this.context=t;this.selector=j;return this}else if(!s&&!x.test(j)){this.selector=j;this.context=t;j=t.getElementsByTagName(j);return b.merge(this,j)}else return!s||s.jquery?(s||f).find(j):b(s).find(j);else if(b.isFunction(j))return f.ready(j);if(j.selector!==B){this.selector=j.selector;this.context=j.context}return b.makeArray(j,this)},selector:"",jquery:"1.4.4",length:0,size:function(){return this.length}, toArray:function(){return N.call(this,0)},get:function(j){return j==null?this.toArray():j<0?this.slice(j)[0]:this[j]},pushStack:function(j,s,v){var z=b();b.isArray(j)?M.apply(z,j):b.merge(z,j);z.prevObject=this;z.context=this.context;if(s==="find")z.selector=this.selector+(this.selector?" ":"")+v;else if(s)z.selector=this.selector+"."+s+"("+v+")";return z},each:function(j,s){return b.each(this,j,s)},ready:function(j){b.bindReady();if(b.isReady)j.call(t,b);else q&&q.push(j);return this},eq:function(j){return j=== -1?this.slice(j):this.slice(j,+j+1)},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},slice:function(){return this.pushStack(N.apply(this,arguments),"slice",N.call(arguments).join(","))},map:function(j){return this.pushStack(b.map(this,function(s,v){return j.call(s,v,s)}))},end:function(){return this.prevObject||b(null)},push:M,sort:[].sort,splice:[].splice};b.fn.init.prototype=b.fn;b.extend=b.fn.extend=function(){var j,s,v,z,H,G=arguments[0]||{},K=1,Q=arguments.length,ga=false; if(typeof G==="boolean"){ga=G;G=arguments[1]||{};K=2}if(typeof G!=="object"&&!b.isFunction(G))G={};if(Q===K){G=this;--K}for(;K<Q;K++)if((j=arguments[K])!=null)for(s in j){v=G[s];z=j[s];if(G!==z)if(ga&&z&&(b.isPlainObject(z)||(H=b.isArray(z)))){if(H){H=false;v=v&&b.isArray(v)?v:[]}else v=v&&b.isPlainObject(v)?v:{};G[s]=b.extend(ga,v,z)}else if(z!==B)G[s]=z}return G};b.extend({noConflict:function(j){E.$=e;if(j)E.jQuery=d;return b},isReady:false,readyWait:1,ready:function(j){j===true&&b.readyWait--; if(!b.readyWait||j!==true&&!b.isReady){if(!t.body)return setTimeout(b.ready,1);b.isReady=true;if(!(j!==true&&--b.readyWait>0))if(q){var s=0,v=q;for(q=null;j=v[s++];)j.call(t,b);b.fn.trigger&&b(t).trigger("ready").unbind("ready")}}},bindReady:function(){if(!p){p=true;if(t.readyState==="complete")return setTimeout(b.ready,1);if(t.addEventListener){t.addEventListener("DOMContentLoaded",u,false);E.addEventListener("load",b.ready,false)}else if(t.attachEvent){t.attachEvent("onreadystatechange",u);E.attachEvent("onload", b.ready);var j=false;try{j=E.frameElement==null}catch(s){}t.documentElement.doScroll&&j&&a()}}},isFunction:function(j){return b.type(j)==="function"},isArray:Array.isArray||function(j){return b.type(j)==="array"},isWindow:function(j){return j&&typeof j==="object"&&"setInterval"in j},isNaN:function(j){return j==null||!r.test(j)||isNaN(j)},type:function(j){return j==null?String(j):R[y.call(j)]||"object"},isPlainObject:function(j){if(!j||b.type(j)!=="object"||j.nodeType||b.isWindow(j))return false;if(j.constructor&& !F.call(j,"constructor")&&!F.call(j.constructor.prototype,"isPrototypeOf"))return false;for(var s in j);return s===B||F.call(j,s)},isEmptyObject:function(j){for(var s in j)return false;return true},error:function(j){throw j;},parseJSON:function(j){if(typeof j!=="string"||!j)return null;j=b.trim(j);if(C.test(j.replace(J,"@").replace(w,"]").replace(I,"")))return E.JSON&&E.JSON.parse?E.JSON.parse(j):(new Function("return "+j))();else b.error("Invalid JSON: "+j)},noop:function(){},globalEval:function(j){if(j&& l.test(j)){var s=t.getElementsByTagName("head")[0]||t.documentElement,v=t.createElement("script");v.type="text/javascript";if(b.support.scriptEval)v.appendChild(t.createTextNode(j));else v.text=j;s.insertBefore(v,s.firstChild);s.removeChild(v)}},nodeName:function(j,s){return j.nodeName&&j.nodeName.toUpperCase()===s.toUpperCase()},each:function(j,s,v){var z,H=0,G=j.length,K=G===B||b.isFunction(j);if(v)if(K)for(z in j){if(s.apply(j[z],v)===false)break}else for(;H<G;){if(s.apply(j[H++],v)===false)break}else if(K)for(z in j){if(s.call(j[z], z,j[z])===false)break}else for(v=j[0];H<G&&s.call(v,H,v)!==false;v=j[++H]);return j},trim:O?function(j){return j==null?"":O.call(j)}:function(j){return j==null?"":j.toString().replace(k,"").replace(o,"")},makeArray:function(j,s){var v=s||[];if(j!=null){var z=b.type(j);j.length==null||z==="string"||z==="function"||z==="regexp"||b.isWindow(j)?M.call(v,j):b.merge(v,j)}return v},inArray:function(j,s){if(s.indexOf)return s.indexOf(j);for(var v=0,z=s.length;v<z;v++)if(s[v]===j)return v;return-1},merge:function(j, s){var v=j.length,z=0;if(typeof s.length==="number")for(var H=s.length;z<H;z++)j[v++]=s[z];else for(;s[z]!==B;)j[v++]=s[z++];j.length=v;return j},grep:function(j,s,v){var z=[],H;v=!!v;for(var G=0,K=j.length;G<K;G++){H=!!s(j[G],G);v!==H&&z.push(j[G])}return z},map:function(j,s,v){for(var z=[],H,G=0,K=j.length;G<K;G++){H=s(j[G],G,v);if(H!=null)z[z.length]=H}return z.concat.apply([],z)},guid:1,proxy:function(j,s,v){if(arguments.length===2)if(typeof s==="string"){v=j;j=v[s];s=B}else if(s&&!b.isFunction(s)){v= s;s=B}if(!s&&j)s=function(){return j.apply(v||this,arguments)};if(j)s.guid=j.guid=j.guid||s.guid||b.guid++;return s},access:function(j,s,v,z,H,G){var K=j.length;if(typeof s==="object"){for(var Q in s)b.access(j,Q,s[Q],z,H,v);return j}if(v!==B){z=!G&&z&&b.isFunction(v);for(Q=0;Q<K;Q++)H(j[Q],s,z?v.call(j[Q],Q,H(j[Q],s)):v,G);return j}return K?H(j[0],s):B},now:function(){return(new Date).getTime()},uaMatch:function(j){j=j.toLowerCase();j=L.exec(j)||g.exec(j)||i.exec(j)||j.indexOf("compatible")<0&&n.exec(j)|| [];return{browser:j[1]||"",version:j[2]||"0"}},browser:{}});b.each("Boolean Number String Function Array Date RegExp Object".split(" "),function(j,s){R["[object "+s+"]"]=s.toLowerCase()});m=b.uaMatch(m);if(m.browser){b.browser[m.browser]=true;b.browser.version=m.version}if(b.browser.webkit)b.browser.safari=true;if(D)b.inArray=function(j,s){return D.call(s,j)};if(!/\s/.test("\u00a0")){k=/^[\s\xA0]+/;o=/[\s\xA0]+$/}f=b(t);if(t.addEventListener)u=function(){t.removeEventListener("DOMContentLoaded",u, false);b.ready()};else if(t.attachEvent)u=function(){if(t.readyState==="complete"){t.detachEvent("onreadystatechange",u);b.ready()}};return E.jQuery=E.$=b}();(function(){c.support={};var a=t.documentElement,b=t.createElement("script"),d=t.createElement("div"),e="script"+c.now();d.style.display="none";d.innerHTML=" <link/><table></table><a href='/a' style='color:red;float:left;opacity:.55;'>a</a><input type='checkbox'/>";var f=d.getElementsByTagName("*"),h=d.getElementsByTagName("a")[0],l=t.createElement("select"), k=l.appendChild(t.createElement("option"));if(!(!f||!f.length||!h)){c.support={leadingWhitespace:d.firstChild.nodeType===3,tbody:!d.getElementsByTagName("tbody").length,htmlSerialize:!!d.getElementsByTagName("link").length,style:/red/.test(h.getAttribute("style")),hrefNormalized:h.getAttribute("href")==="/a",opacity:/^0.55$/.test(h.style.opacity),cssFloat:!!h.style.cssFloat,checkOn:d.getElementsByTagName("input")[0].value==="on",optSelected:k.selected,deleteExpando:true,optDisabled:false,checkClone:false, scriptEval:false,noCloneEvent:true,boxModel:null,inlineBlockNeedsLayout:false,shrinkWrapBlocks:false,reliableHiddenOffsets:true};l.disabled=true;c.support.optDisabled=!k.disabled;b.type="text/javascript";try{b.appendChild(t.createTextNode("window."+e+"=1;"))}catch(o){}a.insertBefore(b,a.firstChild);if(E[e]){c.support.scriptEval=true;delete E[e]}try{delete b.test}catch(x){c.support.deleteExpando=false}a.removeChild(b);if(d.attachEvent&&d.fireEvent){d.attachEvent("onclick",function r(){c.support.noCloneEvent= false;d.detachEvent("onclick",r)});d.cloneNode(true).fireEvent("onclick")}d=t.createElement("div");d.innerHTML="<input type='radio' name='radiotest' checked='checked'/>";a=t.createDocumentFragment();a.appendChild(d.firstChild);c.support.checkClone=a.cloneNode(true).cloneNode(true).lastChild.checked;c(function(){var r=t.createElement("div");r.style.width=r.style.paddingLeft="1px";t.body.appendChild(r);c.boxModel=c.support.boxModel=r.offsetWidth===2;if("zoom"in r.style){r.style.display="inline";r.style.zoom= 1;c.support.inlineBlockNeedsLayout=r.offsetWidth===2;r.style.display="";r.innerHTML="<div style='width:4px;'></div>";c.support.shrinkWrapBlocks=r.offsetWidth!==2}r.innerHTML="<table><tr><td style='padding:0;display:none'></td><td>t</td></tr></table>";var A=r.getElementsByTagName("td");c.support.reliableHiddenOffsets=A[0].offsetHeight===0;A[0].style.display="";A[1].style.display="none";c.support.reliableHiddenOffsets=c.support.reliableHiddenOffsets&&A[0].offsetHeight===0;r.innerHTML="";t.body.removeChild(r).style.display= "none"});a=function(r){var A=t.createElement("div");r="on"+r;var C=r in A;if(!C){A.setAttribute(r,"return;");C=typeof A[r]==="function"}return C};c.support.submitBubbles=a("submit");c.support.changeBubbles=a("change");a=b=d=f=h=null}})();var ra={},Ja=/^(?:\{.*\}|\[.*\])$/;c.extend({cache:{},uuid:0,expando:"jQuery"+c.now(),noData:{embed:true,object:"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000",applet:true},data:function(a,b,d){if(c.acceptData(a)){a=a==E?ra:a;var e=a.nodeType,f=e?a[c.expando]:null,h= c.cache;if(!(e&&!f&&typeof b==="string"&&d===B)){if(e)f||(a[c.expando]=f=++c.uuid);else h=a;if(typeof b==="object")if(e)h[f]=c.extend(h[f],b);else c.extend(h,b);else if(e&&!h[f])h[f]={};a=e?h[f]:h;if(d!==B)a[b]=d;return typeof b==="string"?a[b]:a}}},removeData:function(a,b){if(c.acceptData(a)){a=a==E?ra:a;var d=a.nodeType,e=d?a[c.expando]:a,f=c.cache,h=d?f[e]:e;if(b){if(h){delete h[b];d&&c.isEmptyObject(h)&&c.removeData(a)}}else if(d&&c.support.deleteExpando)delete a[c.expando];else if(a.removeAttribute)a.removeAttribute(c.expando); else if(d)delete f[e];else for(var l in a)delete a[l]}},acceptData:function(a){if(a.nodeName){var b=c.noData[a.nodeName.toLowerCase()];if(b)return!(b===true||a.getAttribute("classid")!==b)}return true}});c.fn.extend({data:function(a,b){var d=null;if(typeof a==="undefined"){if(this.length){var e=this[0].attributes,f;d=c.data(this[0]);for(var h=0,l=e.length;h<l;h++){f=e[h].name;if(f.indexOf("data-")===0){f=f.substr(5);ka(this[0],f,d[f])}}}return d}else if(typeof a==="object")return this.each(function(){c.data(this, a)});var k=a.split(".");k[1]=k[1]?"."+k[1]:"";if(b===B){d=this.triggerHandler("getData"+k[1]+"!",[k[0]]);if(d===B&&this.length){d=c.data(this[0],a);d=ka(this[0],a,d)}return d===B&&k[1]?this.data(k[0]):d}else return this.each(function(){var o=c(this),x=[k[0],b];o.triggerHandler("setData"+k[1]+"!",x);c.data(this,a,b);o.triggerHandler("changeData"+k[1]+"!",x)})},removeData:function(a){return this.each(function(){c.removeData(this,a)})}});c.extend({queue:function(a,b,d){if(a){b=(b||"fx")+"queue";var e= c.data(a,b);if(!d)return e||[];if(!e||c.isArray(d))e=c.data(a,b,c.makeArray(d));else e.push(d);return e}},dequeue:function(a,b){b=b||"fx";var d=c.queue(a,b),e=d.shift();if(e==="inprogress")e=d.shift();if(e){b==="fx"&&d.unshift("inprogress");e.call(a,function(){c.dequeue(a,b)})}}});c.fn.extend({queue:function(a,b){if(typeof a!=="string"){b=a;a="fx"}if(b===B)return c.queue(this[0],a);return this.each(function(){var d=c.queue(this,a,b);a==="fx"&&d[0]!=="inprogress"&&c.dequeue(this,a)})},dequeue:function(a){return this.each(function(){c.dequeue(this, a)})},delay:function(a,b){a=c.fx?c.fx.speeds[a]||a:a;b=b||"fx";return this.queue(b,function(){var d=this;setTimeout(function(){c.dequeue(d,b)},a)})},clearQueue:function(a){return this.queue(a||"fx",[])}});var sa=/[\n\t]/g,ha=/\s+/,Sa=/\r/g,Ta=/^(?:href|src|style)$/,Ua=/^(?:button|input)$/i,Va=/^(?:button|input|object|select|textarea)$/i,Wa=/^a(?:rea)?$/i,ta=/^(?:radio|checkbox)$/i;c.props={"for":"htmlFor","class":"className",readonly:"readOnly",maxlength:"maxLength",cellspacing:"cellSpacing",rowspan:"rowSpan", colspan:"colSpan",tabindex:"tabIndex",usemap:"useMap",frameborder:"frameBorder"};c.fn.extend({attr:function(a,b){return c.access(this,a,b,true,c.attr)},removeAttr:function(a){return this.each(function(){c.attr(this,a,"");this.nodeType===1&&this.removeAttribute(a)})},addClass:function(a){if(c.isFunction(a))return this.each(function(x){var r=c(this);r.addClass(a.call(this,x,r.attr("class")))});if(a&&typeof a==="string")for(var b=(a||"").split(ha),d=0,e=this.length;d<e;d++){var f=this[d];if(f.nodeType=== 1)if(f.className){for(var h=" "+f.className+" ",l=f.className,k=0,o=b.length;k<o;k++)if(h.indexOf(" "+b[k]+" ")<0)l+=" "+b[k];f.className=c.trim(l)}else f.className=a}return this},removeClass:function(a){if(c.isFunction(a))return this.each(function(o){var x=c(this);x.removeClass(a.call(this,o,x.attr("class")))});if(a&&typeof a==="string"||a===B)for(var b=(a||"").split(ha),d=0,e=this.length;d<e;d++){var f=this[d];if(f.nodeType===1&&f.className)if(a){for(var h=(" "+f.className+" ").replace(sa," "), l=0,k=b.length;l<k;l++)h=h.replace(" "+b[l]+" "," ");f.className=c.trim(h)}else f.className=""}return this},toggleClass:function(a,b){var d=typeof a,e=typeof b==="boolean";if(c.isFunction(a))return this.each(function(f){var h=c(this);h.toggleClass(a.call(this,f,h.attr("class"),b),b)});return this.each(function(){if(d==="string")for(var f,h=0,l=c(this),k=b,o=a.split(ha);f=o[h++];){k=e?k:!l.hasClass(f);l[k?"addClass":"removeClass"](f)}else if(d==="undefined"||d==="boolean"){this.className&&c.data(this, "__className__",this.className);this.className=this.className||a===false?"":c.data(this,"__className__")||""}})},hasClass:function(a){a=" "+a+" ";for(var b=0,d=this.length;b<d;b++)if((" "+this[b].className+" ").replace(sa," ").indexOf(a)>-1)return true;return false},val:function(a){if(!arguments.length){var b=this[0];if(b){if(c.nodeName(b,"option")){var d=b.attributes.value;return!d||d.specified?b.value:b.text}if(c.nodeName(b,"select")){var e=b.selectedIndex;d=[];var f=b.options;b=b.type==="select-one"; if(e<0)return null;var h=b?e:0;for(e=b?e+1:f.length;h<e;h++){var l=f[h];if(l.selected&&(c.support.optDisabled?!l.disabled:l.getAttribute("disabled")===null)&&(!l.parentNode.disabled||!c.nodeName(l.parentNode,"optgroup"))){a=c(l).val();if(b)return a;d.push(a)}}return d}if(ta.test(b.type)&&!c.support.checkOn)return b.getAttribute("value")===null?"on":b.value;return(b.value||"").replace(Sa,"")}return B}var k=c.isFunction(a);return this.each(function(o){var x=c(this),r=a;if(this.nodeType===1){if(k)r= a.call(this,o,x.val());if(r==null)r="";else if(typeof r==="number")r+="";else if(c.isArray(r))r=c.map(r,function(C){return C==null?"":C+""});if(c.isArray(r)&&ta.test(this.type))this.checked=c.inArray(x.val(),r)>=0;else if(c.nodeName(this,"select")){var A=c.makeArray(r);c("option",this).each(function(){this.selected=c.inArray(c(this).val(),A)>=0});if(!A.length)this.selectedIndex=-1}else this.value=r}})}});c.extend({attrFn:{val:true,css:true,html:true,text:true,data:true,width:true,height:true,offset:true}, attr:function(a,b,d,e){if(!a||a.nodeType===3||a.nodeType===8)return B;if(e&&b in c.attrFn)return c(a)[b](d);e=a.nodeType!==1||!c.isXMLDoc(a);var f=d!==B;b=e&&c.props[b]||b;var h=Ta.test(b);if((b in a||a[b]!==B)&&e&&!h){if(f){b==="type"&&Ua.test(a.nodeName)&&a.parentNode&&c.error("type property can't be changed");if(d===null)a.nodeType===1&&a.removeAttribute(b);else a[b]=d}if(c.nodeName(a,"form")&&a.getAttributeNode(b))return a.getAttributeNode(b).nodeValue;if(b==="tabIndex")return(b=a.getAttributeNode("tabIndex"))&& b.specified?b.value:Va.test(a.nodeName)||Wa.test(a.nodeName)&&a.href?0:B;return a[b]}if(!c.support.style&&e&&b==="style"){if(f)a.style.cssText=""+d;return a.style.cssText}f&&a.setAttribute(b,""+d);if(!a.attributes[b]&&a.hasAttribute&&!a.hasAttribute(b))return B;a=!c.support.hrefNormalized&&e&&h?a.getAttribute(b,2):a.getAttribute(b);return a===null?B:a}});var X=/\.(.*)$/,ia=/^(?:textarea|input|select)$/i,La=/\./g,Ma=/ /g,Xa=/[^\w\s.|`]/g,Ya=function(a){return a.replace(Xa,"\\$&")},ua={focusin:0,focusout:0}; c.event={add:function(a,b,d,e){if(!(a.nodeType===3||a.nodeType===8)){if(c.isWindow(a)&&a!==E&&!a.frameElement)a=E;if(d===false)d=U;else if(!d)return;var f,h;if(d.handler){f=d;d=f.handler}if(!d.guid)d.guid=c.guid++;if(h=c.data(a)){var l=a.nodeType?"events":"__events__",k=h[l],o=h.handle;if(typeof k==="function"){o=k.handle;k=k.events}else if(!k){a.nodeType||(h[l]=h=function(){});h.events=k={}}if(!o)h.handle=o=function(){return typeof c!=="undefined"&&!c.event.triggered?c.event.handle.apply(o.elem, arguments):B};o.elem=a;b=b.split(" ");for(var x=0,r;l=b[x++];){h=f?c.extend({},f):{handler:d,data:e};if(l.indexOf(".")>-1){r=l.split(".");l=r.shift();h.namespace=r.slice(0).sort().join(".")}else{r=[];h.namespace=""}h.type=l;if(!h.guid)h.guid=d.guid;var A=k[l],C=c.event.special[l]||{};if(!A){A=k[l]=[];if(!C.setup||C.setup.call(a,e,r,o)===false)if(a.addEventListener)a.addEventListener(l,o,false);else a.attachEvent&&a.attachEvent("on"+l,o)}if(C.add){C.add.call(a,h);if(!h.handler.guid)h.handler.guid= d.guid}A.push(h);c.event.global[l]=true}a=null}}},global:{},remove:function(a,b,d,e){if(!(a.nodeType===3||a.nodeType===8)){if(d===false)d=U;var f,h,l=0,k,o,x,r,A,C,J=a.nodeType?"events":"__events__",w=c.data(a),I=w&&w[J];if(w&&I){if(typeof I==="function"){w=I;I=I.events}if(b&&b.type){d=b.handler;b=b.type}if(!b||typeof b==="string"&&b.charAt(0)==="."){b=b||"";for(f in I)c.event.remove(a,f+b)}else{for(b=b.split(" ");f=b[l++];){r=f;k=f.indexOf(".")<0;o=[];if(!k){o=f.split(".");f=o.shift();x=RegExp("(^|\\.)"+ c.map(o.slice(0).sort(),Ya).join("\\.(?:.*\\.)?")+"(\\.|$)")}if(A=I[f])if(d){r=c.event.special[f]||{};for(h=e||0;h<A.length;h++){C=A[h];if(d.guid===C.guid){if(k||x.test(C.namespace)){e==null&&A.splice(h--,1);r.remove&&r.remove.call(a,C)}if(e!=null)break}}if(A.length===0||e!=null&&A.length===1){if(!r.teardown||r.teardown.call(a,o)===false)c.removeEvent(a,f,w.handle);delete I[f]}}else for(h=0;h<A.length;h++){C=A[h];if(k||x.test(C.namespace)){c.event.remove(a,r,C.handler,h);A.splice(h--,1)}}}if(c.isEmptyObject(I)){if(b= w.handle)b.elem=null;delete w.events;delete w.handle;if(typeof w==="function")c.removeData(a,J);else c.isEmptyObject(w)&&c.removeData(a)}}}}},trigger:function(a,b,d,e){var f=a.type||a;if(!e){a=typeof a==="object"?a[c.expando]?a:c.extend(c.Event(f),a):c.Event(f);if(f.indexOf("!")>=0){a.type=f=f.slice(0,-1);a.exclusive=true}if(!d){a.stopPropagation();c.event.global[f]&&c.each(c.cache,function(){this.events&&this.events[f]&&c.event.trigger(a,b,this.handle.elem)})}if(!d||d.nodeType===3||d.nodeType=== 8)return B;a.result=B;a.target=d;b=c.makeArray(b);b.unshift(a)}a.currentTarget=d;(e=d.nodeType?c.data(d,"handle"):(c.data(d,"__events__")||{}).handle)&&e.apply(d,b);e=d.parentNode||d.ownerDocument;try{if(!(d&&d.nodeName&&c.noData[d.nodeName.toLowerCase()]))if(d["on"+f]&&d["on"+f].apply(d,b)===false){a.result=false;a.preventDefault()}}catch(h){}if(!a.isPropagationStopped()&&e)c.event.trigger(a,b,e,true);else if(!a.isDefaultPrevented()){var l;e=a.target;var k=f.replace(X,""),o=c.nodeName(e,"a")&&k=== "click",x=c.event.special[k]||{};if((!x._default||x._default.call(d,a)===false)&&!o&&!(e&&e.nodeName&&c.noData[e.nodeName.toLowerCase()])){try{if(e[k]){if(l=e["on"+k])e["on"+k]=null;c.event.triggered=true;e[k]()}}catch(r){}if(l)e["on"+k]=l;c.event.triggered=false}}},handle:function(a){var b,d,e,f;d=[];var h=c.makeArray(arguments);a=h[0]=c.event.fix(a||E.event);a.currentTarget=this;b=a.type.indexOf(".")<0&&!a.exclusive;if(!b){e=a.type.split(".");a.type=e.shift();d=e.slice(0).sort();e=RegExp("(^|\\.)"+ d.join("\\.(?:.*\\.)?")+"(\\.|$)")}a.namespace=a.namespace||d.join(".");f=c.data(this,this.nodeType?"events":"__events__");if(typeof f==="function")f=f.events;d=(f||{})[a.type];if(f&&d){d=d.slice(0);f=0;for(var l=d.length;f<l;f++){var k=d[f];if(b||e.test(k.namespace)){a.handler=k.handler;a.data=k.data;a.handleObj=k;k=k.handler.apply(this,h);if(k!==B){a.result=k;if(k===false){a.preventDefault();a.stopPropagation()}}if(a.isImmediatePropagationStopped())break}}}return a.result},props:"altKey attrChange attrName bubbles button cancelable charCode clientX clientY ctrlKey currentTarget data detail eventPhase fromElement handler keyCode layerX layerY metaKey newValue offsetX offsetY pageX pageY prevValue relatedNode relatedTarget screenX screenY shiftKey srcElement target toElement view wheelDelta which".split(" "), fix:function(a){if(a[c.expando])return a;var b=a;a=c.Event(b);for(var d=this.props.length,e;d;){e=this.props[--d];a[e]=b[e]}if(!a.target)a.target=a.srcElement||t;if(a.target.nodeType===3)a.target=a.target.parentNode;if(!a.relatedTarget&&a.fromElement)a.relatedTarget=a.fromElement===a.target?a.toElement:a.fromElement;if(a.pageX==null&&a.clientX!=null){b=t.documentElement;d=t.body;a.pageX=a.clientX+(b&&b.scrollLeft||d&&d.scrollLeft||0)-(b&&b.clientLeft||d&&d.clientLeft||0);a.pageY=a.clientY+(b&&b.scrollTop|| d&&d.scrollTop||0)-(b&&b.clientTop||d&&d.clientTop||0)}if(a.which==null&&(a.charCode!=null||a.keyCode!=null))a.which=a.charCode!=null?a.charCode:a.keyCode;if(!a.metaKey&&a.ctrlKey)a.metaKey=a.ctrlKey;if(!a.which&&a.button!==B)a.which=a.button&1?1:a.button&2?3:a.button&4?2:0;return a},guid:1E8,proxy:c.proxy,special:{ready:{setup:c.bindReady,teardown:c.noop},live:{add:function(a){c.event.add(this,Y(a.origType,a.selector),c.extend({},a,{handler:Ka,guid:a.handler.guid}))},remove:function(a){c.event.remove(this, Y(a.origType,a.selector),a)}},beforeunload:{setup:function(a,b,d){if(c.isWindow(this))this.onbeforeunload=d},teardown:function(a,b){if(this.onbeforeunload===b)this.onbeforeunload=null}}}};c.removeEvent=t.removeEventListener?function(a,b,d){a.removeEventListener&&a.removeEventListener(b,d,false)}:function(a,b,d){a.detachEvent&&a.detachEvent("on"+b,d)};c.Event=function(a){if(!this.preventDefault)return new c.Event(a);if(a&&a.type){this.originalEvent=a;this.type=a.type}else this.type=a;this.timeStamp= c.now();this[c.expando]=true};c.Event.prototype={preventDefault:function(){this.isDefaultPrevented=ca;var a=this.originalEvent;if(a)if(a.preventDefault)a.preventDefault();else a.returnValue=false},stopPropagation:function(){this.isPropagationStopped=ca;var a=this.originalEvent;if(a){a.stopPropagation&&a.stopPropagation();a.cancelBubble=true}},stopImmediatePropagation:function(){this.isImmediatePropagationStopped=ca;this.stopPropagation()},isDefaultPrevented:U,isPropagationStopped:U,isImmediatePropagationStopped:U}; var va=function(a){var b=a.relatedTarget;try{for(;b&&b!==this;)b=b.parentNode;if(b!==this){a.type=a.data;c.event.handle.apply(this,arguments)}}catch(d){}},wa=function(a){a.type=a.data;c.event.handle.apply(this,arguments)};c.each({mouseenter:"mouseover",mouseleave:"mouseout"},function(a,b){c.event.special[a]={setup:function(d){c.event.add(this,b,d&&d.selector?wa:va,a)},teardown:function(d){c.event.remove(this,b,d&&d.selector?wa:va)}}});if(!c.support.submitBubbles)c.event.special.submit={setup:function(){if(this.nodeName.toLowerCase()!== "form"){c.event.add(this,"click.specialSubmit",function(a){var b=a.target,d=b.type;if((d==="submit"||d==="image")&&c(b).closest("form").length){a.liveFired=B;return la("submit",this,arguments)}});c.event.add(this,"keypress.specialSubmit",function(a){var b=a.target,d=b.type;if((d==="text"||d==="password")&&c(b).closest("form").length&&a.keyCode===13){a.liveFired=B;return la("submit",this,arguments)}})}else return false},teardown:function(){c.event.remove(this,".specialSubmit")}};if(!c.support.changeBubbles){var V, xa=function(a){var b=a.type,d=a.value;if(b==="radio"||b==="checkbox")d=a.checked;else if(b==="select-multiple")d=a.selectedIndex>-1?c.map(a.options,function(e){return e.selected}).join("-"):"";else if(a.nodeName.toLowerCase()==="select")d=a.selectedIndex;return d},Z=function(a,b){var d=a.target,e,f;if(!(!ia.test(d.nodeName)||d.readOnly)){e=c.data(d,"_change_data");f=xa(d);if(a.type!=="focusout"||d.type!=="radio")c.data(d,"_change_data",f);if(!(e===B||f===e))if(e!=null||f){a.type="change";a.liveFired= B;return c.event.trigger(a,b,d)}}};c.event.special.change={filters:{focusout:Z,beforedeactivate:Z,click:function(a){var b=a.target,d=b.type;if(d==="radio"||d==="checkbox"||b.nodeName.toLowerCase()==="select")return Z.call(this,a)},keydown:function(a){var b=a.target,d=b.type;if(a.keyCode===13&&b.nodeName.toLowerCase()!=="textarea"||a.keyCode===32&&(d==="checkbox"||d==="radio")||d==="select-multiple")return Z.call(this,a)},beforeactivate:function(a){a=a.target;c.data(a,"_change_data",xa(a))}},setup:function(){if(this.type=== "file")return false;for(var a in V)c.event.add(this,a+".specialChange",V[a]);return ia.test(this.nodeName)},teardown:function(){c.event.remove(this,".specialChange");return ia.test(this.nodeName)}};V=c.event.special.change.filters;V.focus=V.beforeactivate}t.addEventListener&&c.each({focus:"focusin",blur:"focusout"},function(a,b){function d(e){e=c.event.fix(e);e.type=b;return c.event.trigger(e,null,e.target)}c.event.special[b]={setup:function(){ua[b]++===0&&t.addEventListener(a,d,true)},teardown:function(){--ua[b]=== 0&&t.removeEventListener(a,d,true)}}});c.each(["bind","one"],function(a,b){c.fn[b]=function(d,e,f){if(typeof d==="object"){for(var h in d)this[b](h,e,d[h],f);return this}if(c.isFunction(e)||e===false){f=e;e=B}var l=b==="one"?c.proxy(f,function(o){c(this).unbind(o,l);return f.apply(this,arguments)}):f;if(d==="unload"&&b!=="one")this.one(d,e,f);else{h=0;for(var k=this.length;h<k;h++)c.event.add(this[h],d,l,e)}return this}});c.fn.extend({unbind:function(a,b){if(typeof a==="object"&&!a.preventDefault)for(var d in a)this.unbind(d, a[d]);else{d=0;for(var e=this.length;d<e;d++)c.event.remove(this[d],a,b)}return this},delegate:function(a,b,d,e){return this.live(b,d,e,a)},undelegate:function(a,b,d){return arguments.length===0?this.unbind("live"):this.die(b,null,d,a)},trigger:function(a,b){return this.each(function(){c.event.trigger(a,b,this)})},triggerHandler:function(a,b){if(this[0]){var d=c.Event(a);d.preventDefault();d.stopPropagation();c.event.trigger(d,b,this[0]);return d.result}},toggle:function(a){for(var b=arguments,d= 1;d<b.length;)c.proxy(a,b[d++]);return this.click(c.proxy(a,function(e){var f=(c.data(this,"lastToggle"+a.guid)||0)%d;c.data(this,"lastToggle"+a.guid,f+1);e.preventDefault();return b[f].apply(this,arguments)||false}))},hover:function(a,b){return this.mouseenter(a).mouseleave(b||a)}});var ya={focus:"focusin",blur:"focusout",mouseenter:"mouseover",mouseleave:"mouseout"};c.each(["live","die"],function(a,b){c.fn[b]=function(d,e,f,h){var l,k=0,o,x,r=h||this.selector;h=h?this:c(this.context);if(typeof d=== "object"&&!d.preventDefault){for(l in d)h[b](l,e,d[l],r);return this}if(c.isFunction(e)){f=e;e=B}for(d=(d||"").split(" ");(l=d[k++])!=null;){o=X.exec(l);x="";if(o){x=o[0];l=l.replace(X,"")}if(l==="hover")d.push("mouseenter"+x,"mouseleave"+x);else{o=l;if(l==="focus"||l==="blur"){d.push(ya[l]+x);l+=x}else l=(ya[l]||l)+x;if(b==="live"){x=0;for(var A=h.length;x<A;x++)c.event.add(h[x],"live."+Y(l,r),{data:e,selector:r,handler:f,origType:l,origHandler:f,preType:o})}else h.unbind("live."+Y(l,r),f)}}return this}}); c.each("blur focus focusin focusout load resize scroll unload click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select submit keydown keypress keyup error".split(" "),function(a,b){c.fn[b]=function(d,e){if(e==null){e=d;d=null}return arguments.length>0?this.bind(b,d,e):this.trigger(b)};if(c.attrFn)c.attrFn[b]=true});E.attachEvent&&!E.addEventListener&&c(E).bind("unload",function(){for(var a in c.cache)if(c.cache[a].handle)try{c.event.remove(c.cache[a].handle.elem)}catch(b){}}); (function(){function a(g,i,n,m,p,q){p=0;for(var u=m.length;p<u;p++){var y=m[p];if(y){var F=false;for(y=y[g];y;){if(y.sizcache===n){F=m[y.sizset];break}if(y.nodeType===1&&!q){y.sizcache=n;y.sizset=p}if(y.nodeName.toLowerCase()===i){F=y;break}y=y[g]}m[p]=F}}}function b(g,i,n,m,p,q){p=0;for(var u=m.length;p<u;p++){var y=m[p];if(y){var F=false;for(y=y[g];y;){if(y.sizcache===n){F=m[y.sizset];break}if(y.nodeType===1){if(!q){y.sizcache=n;y.sizset=p}if(typeof i!=="string"){if(y===i){F=true;break}}else if(k.filter(i, [y]).length>0){F=y;break}}y=y[g]}m[p]=F}}}var d=/((?:\((?:\([^()]+\)|[^()]+)+\)|\[(?:\[[^\[\]]*\]|['"][^'"]*['"]|[^\[\]'"]+)+\]|\\.|[^ >+~,(\[\\]+)+|[>+~])(\s*,\s*)?((?:.|\r|\n)*)/g,e=0,f=Object.prototype.toString,h=false,l=true;[0,0].sort(function(){l=false;return 0});var k=function(g,i,n,m){n=n||[];var p=i=i||t;if(i.nodeType!==1&&i.nodeType!==9)return[];if(!g||typeof g!=="string")return n;var q,u,y,F,M,N=true,O=k.isXML(i),D=[],R=g;do{d.exec("");if(q=d.exec(R)){R=q[3];D.push(q[1]);if(q[2]){F=q[3]; break}}}while(q);if(D.length>1&&x.exec(g))if(D.length===2&&o.relative[D[0]])u=L(D[0]+D[1],i);else for(u=o.relative[D[0]]?[i]:k(D.shift(),i);D.length;){g=D.shift();if(o.relative[g])g+=D.shift();u=L(g,u)}else{if(!m&&D.length>1&&i.nodeType===9&&!O&&o.match.ID.test(D[0])&&!o.match.ID.test(D[D.length-1])){q=k.find(D.shift(),i,O);i=q.expr?k.filter(q.expr,q.set)[0]:q.set[0]}if(i){q=m?{expr:D.pop(),set:C(m)}:k.find(D.pop(),D.length===1&&(D[0]==="~"||D[0]==="+")&&i.parentNode?i.parentNode:i,O);u=q.expr?k.filter(q.expr, q.set):q.set;if(D.length>0)y=C(u);else N=false;for(;D.length;){q=M=D.pop();if(o.relative[M])q=D.pop();else M="";if(q==null)q=i;o.relative[M](y,q,O)}}else y=[]}y||(y=u);y||k.error(M||g);if(f.call(y)==="[object Array]")if(N)if(i&&i.nodeType===1)for(g=0;y[g]!=null;g++){if(y[g]&&(y[g]===true||y[g].nodeType===1&&k.contains(i,y[g])))n.push(u[g])}else for(g=0;y[g]!=null;g++)y[g]&&y[g].nodeType===1&&n.push(u[g]);else n.push.apply(n,y);else C(y,n);if(F){k(F,p,n,m);k.uniqueSort(n)}return n};k.uniqueSort=function(g){if(w){h= l;g.sort(w);if(h)for(var i=1;i<g.length;i++)g[i]===g[i-1]&&g.splice(i--,1)}return g};k.matches=function(g,i){return k(g,null,null,i)};k.matchesSelector=function(g,i){return k(i,null,null,[g]).length>0};k.find=function(g,i,n){var m;if(!g)return[];for(var p=0,q=o.order.length;p<q;p++){var u,y=o.order[p];if(u=o.leftMatch[y].exec(g)){var F=u[1];u.splice(1,1);if(F.substr(F.length-1)!=="\\"){u[1]=(u[1]||"").replace(/\\/g,"");m=o.find[y](u,i,n);if(m!=null){g=g.replace(o.match[y],"");break}}}}m||(m=i.getElementsByTagName("*")); return{set:m,expr:g}};k.filter=function(g,i,n,m){for(var p,q,u=g,y=[],F=i,M=i&&i[0]&&k.isXML(i[0]);g&&i.length;){for(var N in o.filter)if((p=o.leftMatch[N].exec(g))!=null&&p[2]){var O,D,R=o.filter[N];D=p[1];q=false;p.splice(1,1);if(D.substr(D.length-1)!=="\\"){if(F===y)y=[];if(o.preFilter[N])if(p=o.preFilter[N](p,F,n,y,m,M)){if(p===true)continue}else q=O=true;if(p)for(var j=0;(D=F[j])!=null;j++)if(D){O=R(D,p,j,F);var s=m^!!O;if(n&&O!=null)if(s)q=true;else F[j]=false;else if(s){y.push(D);q=true}}if(O!== B){n||(F=y);g=g.replace(o.match[N],"");if(!q)return[];break}}}if(g===u)if(q==null)k.error(g);else break;u=g}return F};k.error=function(g){throw"Syntax error, unrecognized expression: "+g;};var o=k.selectors={order:["ID","NAME","TAG"],match:{ID:/#((?:[\w\u00c0-\uFFFF\-]|\\.)+)/,CLASS:/\.((?:[\w\u00c0-\uFFFF\-]|\\.)+)/,NAME:/\[name=['"]*((?:[\w\u00c0-\uFFFF\-]|\\.)+)['"]*\]/,ATTR:/\[\s*((?:[\w\u00c0-\uFFFF\-]|\\.)+)\s*(?:(\S?=)\s*(['"]*)(.*?)\3|)\s*\]/,TAG:/^((?:[\w\u00c0-\uFFFF\*\-]|\\.)+)/,CHILD:/:(only|nth|last|first)-child(?:\((even|odd|[\dn+\-]*)\))?/, POS:/:(nth|eq|gt|lt|first|last|even|odd)(?:\((\d*)\))?(?=[^\-]|$)/,PSEUDO:/:((?:[\w\u00c0-\uFFFF\-]|\\.)+)(?:\((['"]?)((?:\([^\)]+\)|[^\(\)]*)+)\2\))?/},leftMatch:{},attrMap:{"class":"className","for":"htmlFor"},attrHandle:{href:function(g){return g.getAttribute("href")}},relative:{"+":function(g,i){var n=typeof i==="string",m=n&&!/\W/.test(i);n=n&&!m;if(m)i=i.toLowerCase();m=0;for(var p=g.length,q;m<p;m++)if(q=g[m]){for(;(q=q.previousSibling)&&q.nodeType!==1;);g[m]=n||q&&q.nodeName.toLowerCase()=== i?q||false:q===i}n&&k.filter(i,g,true)},">":function(g,i){var n,m=typeof i==="string",p=0,q=g.length;if(m&&!/\W/.test(i))for(i=i.toLowerCase();p<q;p++){if(n=g[p]){n=n.parentNode;g[p]=n.nodeName.toLowerCase()===i?n:false}}else{for(;p<q;p++)if(n=g[p])g[p]=m?n.parentNode:n.parentNode===i;m&&k.filter(i,g,true)}},"":function(g,i,n){var m,p=e++,q=b;if(typeof i==="string"&&!/\W/.test(i)){m=i=i.toLowerCase();q=a}q("parentNode",i,p,g,m,n)},"~":function(g,i,n){var m,p=e++,q=b;if(typeof i==="string"&&!/\W/.test(i)){m= i=i.toLowerCase();q=a}q("previousSibling",i,p,g,m,n)}},find:{ID:function(g,i,n){if(typeof i.getElementById!=="undefined"&&!n)return(g=i.getElementById(g[1]))&&g.parentNode?[g]:[]},NAME:function(g,i){if(typeof i.getElementsByName!=="undefined"){for(var n=[],m=i.getElementsByName(g[1]),p=0,q=m.length;p<q;p++)m[p].getAttribute("name")===g[1]&&n.push(m[p]);return n.length===0?null:n}},TAG:function(g,i){return i.getElementsByTagName(g[1])}},preFilter:{CLASS:function(g,i,n,m,p,q){g=" "+g[1].replace(/\\/g, "")+" ";if(q)return g;q=0;for(var u;(u=i[q])!=null;q++)if(u)if(p^(u.className&&(" "+u.className+" ").replace(/[\t\n]/g," ").indexOf(g)>=0))n||m.push(u);else if(n)i[q]=false;return false},ID:function(g){return g[1].replace(/\\/g,"")},TAG:function(g){return g[1].toLowerCase()},CHILD:function(g){if(g[1]==="nth"){var i=/(-?)(\d*)n((?:\+|-)?\d*)/.exec(g[2]==="even"&&"2n"||g[2]==="odd"&&"2n+1"||!/\D/.test(g[2])&&"0n+"+g[2]||g[2]);g[2]=i[1]+(i[2]||1)-0;g[3]=i[3]-0}g[0]=e++;return g},ATTR:function(g,i,n, m,p,q){i=g[1].replace(/\\/g,"");if(!q&&o.attrMap[i])g[1]=o.attrMap[i];if(g[2]==="~=")g[4]=" "+g[4]+" ";return g},PSEUDO:function(g,i,n,m,p){if(g[1]==="not")if((d.exec(g[3])||"").length>1||/^\w/.test(g[3]))g[3]=k(g[3],null,null,i);else{g=k.filter(g[3],i,n,true^p);n||m.push.apply(m,g);return false}else if(o.match.POS.test(g[0])||o.match.CHILD.test(g[0]))return true;return g},POS:function(g){g.unshift(true);return g}},filters:{enabled:function(g){return g.disabled===false&&g.type!=="hidden"},disabled:function(g){return g.disabled=== true},checked:function(g){return g.checked===true},selected:function(g){return g.selected===true},parent:function(g){return!!g.firstChild},empty:function(g){return!g.firstChild},has:function(g,i,n){return!!k(n[3],g).length},header:function(g){return/h\d/i.test(g.nodeName)},text:function(g){return"text"===g.type},radio:function(g){return"radio"===g.type},checkbox:function(g){return"checkbox"===g.type},file:function(g){return"file"===g.type},password:function(g){return"password"===g.type},submit:function(g){return"submit"=== g.type},image:function(g){return"image"===g.type},reset:function(g){return"reset"===g.type},button:function(g){return"button"===g.type||g.nodeName.toLowerCase()==="button"},input:function(g){return/input|select|textarea|button/i.test(g.nodeName)}},setFilters:{first:function(g,i){return i===0},last:function(g,i,n,m){return i===m.length-1},even:function(g,i){return i%2===0},odd:function(g,i){return i%2===1},lt:function(g,i,n){return i<n[3]-0},gt:function(g,i,n){return i>n[3]-0},nth:function(g,i,n){return n[3]- 0===i},eq:function(g,i,n){return n[3]-0===i}},filter:{PSEUDO:function(g,i,n,m){var p=i[1],q=o.filters[p];if(q)return q(g,n,i,m);else if(p==="contains")return(g.textContent||g.innerText||k.getText([g])||"").indexOf(i[3])>=0;else if(p==="not"){i=i[3];n=0;for(m=i.length;n<m;n++)if(i[n]===g)return false;return true}else k.error("Syntax error, unrecognized expression: "+p)},CHILD:function(g,i){var n=i[1],m=g;switch(n){case "only":case "first":for(;m=m.previousSibling;)if(m.nodeType===1)return false;if(n=== "first")return true;m=g;case "last":for(;m=m.nextSibling;)if(m.nodeType===1)return false;return true;case "nth":n=i[2];var p=i[3];if(n===1&&p===0)return true;var q=i[0],u=g.parentNode;if(u&&(u.sizcache!==q||!g.nodeIndex)){var y=0;for(m=u.firstChild;m;m=m.nextSibling)if(m.nodeType===1)m.nodeIndex=++y;u.sizcache=q}m=g.nodeIndex-p;return n===0?m===0:m%n===0&&m/n>=0}},ID:function(g,i){return g.nodeType===1&&g.getAttribute("id")===i},TAG:function(g,i){return i==="*"&&g.nodeType===1||g.nodeName.toLowerCase()=== i},CLASS:function(g,i){return(" "+(g.className||g.getAttribute("class"))+" ").indexOf(i)>-1},ATTR:function(g,i){var n=i[1];n=o.attrHandle[n]?o.attrHandle[n](g):g[n]!=null?g[n]:g.getAttribute(n);var m=n+"",p=i[2],q=i[4];return n==null?p==="!=":p==="="?m===q:p==="*="?m.indexOf(q)>=0:p==="~="?(" "+m+" ").indexOf(q)>=0:!q?m&&n!==false:p==="!="?m!==q:p==="^="?m.indexOf(q)===0:p==="$="?m.substr(m.length-q.length)===q:p==="|="?m===q||m.substr(0,q.length+1)===q+"-":false},POS:function(g,i,n,m){var p=o.setFilters[i[2]]; if(p)return p(g,n,i,m)}}},x=o.match.POS,r=function(g,i){return"\\"+(i-0+1)},A;for(A in o.match){o.match[A]=RegExp(o.match[A].source+/(?![^\[]*\])(?![^\(]*\))/.source);o.leftMatch[A]=RegExp(/(^(?:.|\r|\n)*?)/.source+o.match[A].source.replace(/\\(\d+)/g,r))}var C=function(g,i){g=Array.prototype.slice.call(g,0);if(i){i.push.apply(i,g);return i}return g};try{Array.prototype.slice.call(t.documentElement.childNodes,0)}catch(J){C=function(g,i){var n=0,m=i||[];if(f.call(g)==="[object Array]")Array.prototype.push.apply(m, g);else if(typeof g.length==="number")for(var p=g.length;n<p;n++)m.push(g[n]);else for(;g[n];n++)m.push(g[n]);return m}}var w,I;if(t.documentElement.compareDocumentPosition)w=function(g,i){if(g===i){h=true;return 0}if(!g.compareDocumentPosition||!i.compareDocumentPosition)return g.compareDocumentPosition?-1:1;return g.compareDocumentPosition(i)&4?-1:1};else{w=function(g,i){var n,m,p=[],q=[];n=g.parentNode;m=i.parentNode;var u=n;if(g===i){h=true;return 0}else if(n===m)return I(g,i);else if(n){if(!m)return 1}else return-1; for(;u;){p.unshift(u);u=u.parentNode}for(u=m;u;){q.unshift(u);u=u.parentNode}n=p.length;m=q.length;for(u=0;u<n&&u<m;u++)if(p[u]!==q[u])return I(p[u],q[u]);return u===n?I(g,q[u],-1):I(p[u],i,1)};I=function(g,i,n){if(g===i)return n;for(g=g.nextSibling;g;){if(g===i)return-1;g=g.nextSibling}return 1}}k.getText=function(g){for(var i="",n,m=0;g[m];m++){n=g[m];if(n.nodeType===3||n.nodeType===4)i+=n.nodeValue;else if(n.nodeType!==8)i+=k.getText(n.childNodes)}return i};(function(){var g=t.createElement("div"), i="script"+(new Date).getTime(),n=t.documentElement;g.innerHTML="<a name='"+i+"'/>";n.insertBefore(g,n.firstChild);if(t.getElementById(i)){o.find.ID=function(m,p,q){if(typeof p.getElementById!=="undefined"&&!q)return(p=p.getElementById(m[1]))?p.id===m[1]||typeof p.getAttributeNode!=="undefined"&&p.getAttributeNode("id").nodeValue===m[1]?[p]:B:[]};o.filter.ID=function(m,p){var q=typeof m.getAttributeNode!=="undefined"&&m.getAttributeNode("id");return m.nodeType===1&&q&&q.nodeValue===p}}n.removeChild(g); n=g=null})();(function(){var g=t.createElement("div");g.appendChild(t.createComment(""));if(g.getElementsByTagName("*").length>0)o.find.TAG=function(i,n){var m=n.getElementsByTagName(i[1]);if(i[1]==="*"){for(var p=[],q=0;m[q];q++)m[q].nodeType===1&&p.push(m[q]);m=p}return m};g.innerHTML="<a href='#'></a>";if(g.firstChild&&typeof g.firstChild.getAttribute!=="undefined"&&g.firstChild.getAttribute("href")!=="#")o.attrHandle.href=function(i){return i.getAttribute("href",2)};g=null})();t.querySelectorAll&& function(){var g=k,i=t.createElement("div");i.innerHTML="<p class='TEST'></p>";if(!(i.querySelectorAll&&i.querySelectorAll(".TEST").length===0)){k=function(m,p,q,u){p=p||t;m=m.replace(/\=\s*([^'"\]]*)\s*\]/g,"='$1']");if(!u&&!k.isXML(p))if(p.nodeType===9)try{return C(p.querySelectorAll(m),q)}catch(y){}else if(p.nodeType===1&&p.nodeName.toLowerCase()!=="object"){var F=p.getAttribute("id"),M=F||"__sizzle__";F||p.setAttribute("id",M);try{return C(p.querySelectorAll("#"+M+" "+m),q)}catch(N){}finally{F|| p.removeAttribute("id")}}return g(m,p,q,u)};for(var n in g)k[n]=g[n];i=null}}();(function(){var g=t.documentElement,i=g.matchesSelector||g.mozMatchesSelector||g.webkitMatchesSelector||g.msMatchesSelector,n=false;try{i.call(t.documentElement,"[test!='']:sizzle")}catch(m){n=true}if(i)k.matchesSelector=function(p,q){q=q.replace(/\=\s*([^'"\]]*)\s*\]/g,"='$1']");if(!k.isXML(p))try{if(n||!o.match.PSEUDO.test(q)&&!/!=/.test(q))return i.call(p,q)}catch(u){}return k(q,null,null,[p]).length>0}})();(function(){var g= t.createElement("div");g.innerHTML="<div class='test e'></div><div class='test'></div>";if(!(!g.getElementsByClassName||g.getElementsByClassName("e").length===0)){g.lastChild.className="e";if(g.getElementsByClassName("e").length!==1){o.order.splice(1,0,"CLASS");o.find.CLASS=function(i,n,m){if(typeof n.getElementsByClassName!=="undefined"&&!m)return n.getElementsByClassName(i[1])};g=null}}})();k.contains=t.documentElement.contains?function(g,i){return g!==i&&(g.contains?g.contains(i):true)}:t.documentElement.compareDocumentPosition? function(g,i){return!!(g.compareDocumentPosition(i)&16)}:function(){return false};k.isXML=function(g){return(g=(g?g.ownerDocument||g:0).documentElement)?g.nodeName!=="HTML":false};var L=function(g,i){for(var n,m=[],p="",q=i.nodeType?[i]:i;n=o.match.PSEUDO.exec(g);){p+=n[0];g=g.replace(o.match.PSEUDO,"")}g=o.relative[g]?g+"*":g;n=0;for(var u=q.length;n<u;n++)k(g,q[n],m);return k.filter(p,m)};c.find=k;c.expr=k.selectors;c.expr[":"]=c.expr.filters;c.unique=k.uniqueSort;c.text=k.getText;c.isXMLDoc=k.isXML; c.contains=k.contains})();var Za=/Until$/,$a=/^(?:parents|prevUntil|prevAll)/,ab=/,/,Na=/^.[^:#\[\.,]*$/,bb=Array.prototype.slice,cb=c.expr.match.POS;c.fn.extend({find:function(a){for(var b=this.pushStack("","find",a),d=0,e=0,f=this.length;e<f;e++){d=b.length;c.find(a,this[e],b);if(e>0)for(var h=d;h<b.length;h++)for(var l=0;l<d;l++)if(b[l]===b[h]){b.splice(h--,1);break}}return b},has:function(a){var b=c(a);return this.filter(function(){for(var d=0,e=b.length;d<e;d++)if(c.contains(this,b[d]))return true})}, not:function(a){return this.pushStack(ma(this,a,false),"not",a)},filter:function(a){return this.pushStack(ma(this,a,true),"filter",a)},is:function(a){return!!a&&c.filter(a,this).length>0},closest:function(a,b){var d=[],e,f,h=this[0];if(c.isArray(a)){var l,k={},o=1;if(h&&a.length){e=0;for(f=a.length;e<f;e++){l=a[e];k[l]||(k[l]=c.expr.match.POS.test(l)?c(l,b||this.context):l)}for(;h&&h.ownerDocument&&h!==b;){for(l in k){e=k[l];if(e.jquery?e.index(h)>-1:c(h).is(e))d.push({selector:l,elem:h,level:o})}h= h.parentNode;o++}}return d}l=cb.test(a)?c(a,b||this.context):null;e=0;for(f=this.length;e<f;e++)for(h=this[e];h;)if(l?l.index(h)>-1:c.find.matchesSelector(h,a)){d.push(h);break}else{h=h.parentNode;if(!h||!h.ownerDocument||h===b)break}d=d.length>1?c.unique(d):d;return this.pushStack(d,"closest",a)},index:function(a){if(!a||typeof a==="string")return c.inArray(this[0],a?c(a):this.parent().children());return c.inArray(a.jquery?a[0]:a,this)},add:function(a,b){var d=typeof a==="string"?c(a,b||this.context): c.makeArray(a),e=c.merge(this.get(),d);return this.pushStack(!d[0]||!d[0].parentNode||d[0].parentNode.nodeType===11||!e[0]||!e[0].parentNode||e[0].parentNode.nodeType===11?e:c.unique(e))},andSelf:function(){return this.add(this.prevObject)}});c.each({parent:function(a){return(a=a.parentNode)&&a.nodeType!==11?a:null},parents:function(a){return c.dir(a,"parentNode")},parentsUntil:function(a,b,d){return c.dir(a,"parentNode",d)},next:function(a){return c.nth(a,2,"nextSibling")},prev:function(a){return c.nth(a, 2,"previousSibling")},nextAll:function(a){return c.dir(a,"nextSibling")},prevAll:function(a){return c.dir(a,"previousSibling")},nextUntil:function(a,b,d){return c.dir(a,"nextSibling",d)},prevUntil:function(a,b,d){return c.dir(a,"previousSibling",d)},siblings:function(a){return c.sibling(a.parentNode.firstChild,a)},children:function(a){return c.sibling(a.firstChild)},contents:function(a){return c.nodeName(a,"iframe")?a.contentDocument||a.contentWindow.document:c.makeArray(a.childNodes)}},function(a, b){c.fn[a]=function(d,e){var f=c.map(this,b,d);Za.test(a)||(e=d);if(e&&typeof e==="string")f=c.filter(e,f);f=this.length>1?c.unique(f):f;if((this.length>1||ab.test(e))&&$a.test(a))f=f.reverse();return this.pushStack(f,a,bb.call(arguments).join(","))}});c.extend({filter:function(a,b,d){if(d)a=":not("+a+")";return b.length===1?c.find.matchesSelector(b[0],a)?[b[0]]:[]:c.find.matches(a,b)},dir:function(a,b,d){var e=[];for(a=a[b];a&&a.nodeType!==9&&(d===B||a.nodeType!==1||!c(a).is(d));){a.nodeType===1&& e.push(a);a=a[b]}return e},nth:function(a,b,d){b=b||1;for(var e=0;a;a=a[d])if(a.nodeType===1&&++e===b)break;return a},sibling:function(a,b){for(var d=[];a;a=a.nextSibling)a.nodeType===1&&a!==b&&d.push(a);return d}});var za=/ jQuery\d+="(?:\d+|null)"/g,$=/^\s+/,Aa=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/ig,Ba=/<([\w:]+)/,db=/<tbody/i,eb=/<|&#?\w+;/,Ca=/<(?:script|object|embed|option|style)/i,Da=/checked\s*(?:[^=]|=\s*.checked.)/i,fb=/\=([^="'>\s]+\/)>/g,P={option:[1, "<select multiple='multiple'>","</select>"],legend:[1,"<fieldset>","</fieldset>"],thead:[1,"<table>","</table>"],tr:[2,"<table><tbody>","</tbody></table>"],td:[3,"<table><tbody><tr>","</tr></tbody></table>"],col:[2,"<table><tbody></tbody><colgroup>","</colgroup></table>"],area:[1,"<map>","</map>"],_default:[0,"",""]};P.optgroup=P.option;P.tbody=P.tfoot=P.colgroup=P.caption=P.thead;P.th=P.td;if(!c.support.htmlSerialize)P._default=[1,"div<div>","</div>"];c.fn.extend({text:function(a){if(c.isFunction(a))return this.each(function(b){var d= c(this);d.text(a.call(this,b,d.text()))});if(typeof a!=="object"&&a!==B)return this.empty().append((this[0]&&this[0].ownerDocument||t).createTextNode(a));return c.text(this)},wrapAll:function(a){if(c.isFunction(a))return this.each(function(d){c(this).wrapAll(a.call(this,d))});if(this[0]){var b=c(a,this[0].ownerDocument).eq(0).clone(true);this[0].parentNode&&b.insertBefore(this[0]);b.map(function(){for(var d=this;d.firstChild&&d.firstChild.nodeType===1;)d=d.firstChild;return d}).append(this)}return this}, wrapInner:function(a){if(c.isFunction(a))return this.each(function(b){c(this).wrapInner(a.call(this,b))});return this.each(function(){var b=c(this),d=b.contents();d.length?d.wrapAll(a):b.append(a)})},wrap:function(a){return this.each(function(){c(this).wrapAll(a)})},unwrap:function(){return this.parent().each(function(){c.nodeName(this,"body")||c(this).replaceWith(this.childNodes)}).end()},append:function(){return this.domManip(arguments,true,function(a){this.nodeType===1&&this.appendChild(a)})}, prepend:function(){return this.domManip(arguments,true,function(a){this.nodeType===1&&this.insertBefore(a,this.firstChild)})},before:function(){if(this[0]&&this[0].parentNode)return this.domManip(arguments,false,function(b){this.parentNode.insertBefore(b,this)});else if(arguments.length){var a=c(arguments[0]);a.push.apply(a,this.toArray());return this.pushStack(a,"before",arguments)}},after:function(){if(this[0]&&this[0].parentNode)return this.domManip(arguments,false,function(b){this.parentNode.insertBefore(b, this.nextSibling)});else if(arguments.length){var a=this.pushStack(this,"after",arguments);a.push.apply(a,c(arguments[0]).toArray());return a}},remove:function(a,b){for(var d=0,e;(e=this[d])!=null;d++)if(!a||c.filter(a,[e]).length){if(!b&&e.nodeType===1){c.cleanData(e.getElementsByTagName("*"));c.cleanData([e])}e.parentNode&&e.parentNode.removeChild(e)}return this},empty:function(){for(var a=0,b;(b=this[a])!=null;a++)for(b.nodeType===1&&c.cleanData(b.getElementsByTagName("*"));b.firstChild;)b.removeChild(b.firstChild); return this},clone:function(a){var b=this.map(function(){if(!c.support.noCloneEvent&&!c.isXMLDoc(this)){var d=this.outerHTML,e=this.ownerDocument;if(!d){d=e.createElement("div");d.appendChild(this.cloneNode(true));d=d.innerHTML}return c.clean([d.replace(za,"").replace(fb,'="$1">').replace($,"")],e)[0]}else return this.cloneNode(true)});if(a===true){na(this,b);na(this.find("*"),b.find("*"))}return b},html:function(a){if(a===B)return this[0]&&this[0].nodeType===1?this[0].innerHTML.replace(za,""):null; else if(typeof a==="string"&&!Ca.test(a)&&(c.support.leadingWhitespace||!$.test(a))&&!P[(Ba.exec(a)||["",""])[1].toLowerCase()]){a=a.replace(Aa,"<$1></$2>");try{for(var b=0,d=this.length;b<d;b++)if(this[b].nodeType===1){c.cleanData(this[b].getElementsByTagName("*"));this[b].innerHTML=a}}catch(e){this.empty().append(a)}}else c.isFunction(a)?this.each(function(f){var h=c(this);h.html(a.call(this,f,h.html()))}):this.empty().append(a);return this},replaceWith:function(a){if(this[0]&&this[0].parentNode){if(c.isFunction(a))return this.each(function(b){var d= c(this),e=d.html();d.replaceWith(a.call(this,b,e))});if(typeof a!=="string")a=c(a).detach();return this.each(function(){var b=this.nextSibling,d=this.parentNode;c(this).remove();b?c(b).before(a):c(d).append(a)})}else return this.pushStack(c(c.isFunction(a)?a():a),"replaceWith",a)},detach:function(a){return this.remove(a,true)},domManip:function(a,b,d){var e,f,h,l=a[0],k=[];if(!c.support.checkClone&&arguments.length===3&&typeof l==="string"&&Da.test(l))return this.each(function(){c(this).domManip(a, b,d,true)});if(c.isFunction(l))return this.each(function(x){var r=c(this);a[0]=l.call(this,x,b?r.html():B);r.domManip(a,b,d)});if(this[0]){e=l&&l.parentNode;e=c.support.parentNode&&e&&e.nodeType===11&&e.childNodes.length===this.length?{fragment:e}:c.buildFragment(a,this,k);h=e.fragment;if(f=h.childNodes.length===1?h=h.firstChild:h.firstChild){b=b&&c.nodeName(f,"tr");f=0;for(var o=this.length;f<o;f++)d.call(b?c.nodeName(this[f],"table")?this[f].getElementsByTagName("tbody")[0]||this[f].appendChild(this[f].ownerDocument.createElement("tbody")): this[f]:this[f],f>0||e.cacheable||this.length>1?h.cloneNode(true):h)}k.length&&c.each(k,Oa)}return this}});c.buildFragment=function(a,b,d){var e,f,h;b=b&&b[0]?b[0].ownerDocument||b[0]:t;if(a.length===1&&typeof a[0]==="string"&&a[0].length<512&&b===t&&!Ca.test(a[0])&&(c.support.checkClone||!Da.test(a[0]))){f=true;if(h=c.fragments[a[0]])if(h!==1)e=h}if(!e){e=b.createDocumentFragment();c.clean(a,b,e,d)}if(f)c.fragments[a[0]]=h?e:1;return{fragment:e,cacheable:f}};c.fragments={};c.each({appendTo:"append", prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(a,b){c.fn[a]=function(d){var e=[];d=c(d);var f=this.length===1&&this[0].parentNode;if(f&&f.nodeType===11&&f.childNodes.length===1&&d.length===1){d[b](this[0]);return this}else{f=0;for(var h=d.length;f<h;f++){var l=(f>0?this.clone(true):this).get();c(d[f])[b](l);e=e.concat(l)}return this.pushStack(e,a,d.selector)}}});c.extend({clean:function(a,b,d,e){b=b||t;if(typeof b.createElement==="undefined")b=b.ownerDocument|| b[0]&&b[0].ownerDocument||t;for(var f=[],h=0,l;(l=a[h])!=null;h++){if(typeof l==="number")l+="";if(l){if(typeof l==="string"&&!eb.test(l))l=b.createTextNode(l);else if(typeof l==="string"){l=l.replace(Aa,"<$1></$2>");var k=(Ba.exec(l)||["",""])[1].toLowerCase(),o=P[k]||P._default,x=o[0],r=b.createElement("div");for(r.innerHTML=o[1]+l+o[2];x--;)r=r.lastChild;if(!c.support.tbody){x=db.test(l);k=k==="table"&&!x?r.firstChild&&r.firstChild.childNodes:o[1]==="<table>"&&!x?r.childNodes:[];for(o=k.length- 1;o>=0;--o)c.nodeName(k[o],"tbody")&&!k[o].childNodes.length&&k[o].parentNode.removeChild(k[o])}!c.support.leadingWhitespace&&$.test(l)&&r.insertBefore(b.createTextNode($.exec(l)[0]),r.firstChild);l=r.childNodes}if(l.nodeType)f.push(l);else f=c.merge(f,l)}}if(d)for(h=0;f[h];h++)if(e&&c.nodeName(f[h],"script")&&(!f[h].type||f[h].type.toLowerCase()==="text/javascript"))e.push(f[h].parentNode?f[h].parentNode.removeChild(f[h]):f[h]);else{f[h].nodeType===1&&f.splice.apply(f,[h+1,0].concat(c.makeArray(f[h].getElementsByTagName("script")))); d.appendChild(f[h])}return f},cleanData:function(a){for(var b,d,e=c.cache,f=c.event.special,h=c.support.deleteExpando,l=0,k;(k=a[l])!=null;l++)if(!(k.nodeName&&c.noData[k.nodeName.toLowerCase()]))if(d=k[c.expando]){if((b=e[d])&&b.events)for(var o in b.events)f[o]?c.event.remove(k,o):c.removeEvent(k,o,b.handle);if(h)delete k[c.expando];else k.removeAttribute&&k.removeAttribute(c.expando);delete e[d]}}});var Ea=/alpha\([^)]*\)/i,gb=/opacity=([^)]*)/,hb=/-([a-z])/ig,ib=/([A-Z])/g,Fa=/^-?\d+(?:px)?$/i, jb=/^-?\d/,kb={position:"absolute",visibility:"hidden",display:"block"},Pa=["Left","Right"],Qa=["Top","Bottom"],W,Ga,aa,lb=function(a,b){return b.toUpperCase()};c.fn.css=function(a,b){if(arguments.length===2&&b===B)return this;return c.access(this,a,b,true,function(d,e,f){return f!==B?c.style(d,e,f):c.css(d,e)})};c.extend({cssHooks:{opacity:{get:function(a,b){if(b){var d=W(a,"opacity","opacity");return d===""?"1":d}else return a.style.opacity}}},cssNumber:{zIndex:true,fontWeight:true,opacity:true, zoom:true,lineHeight:true},cssProps:{"float":c.support.cssFloat?"cssFloat":"styleFloat"},style:function(a,b,d,e){if(!(!a||a.nodeType===3||a.nodeType===8||!a.style)){var f,h=c.camelCase(b),l=a.style,k=c.cssHooks[h];b=c.cssProps[h]||h;if(d!==B){if(!(typeof d==="number"&&isNaN(d)||d==null)){if(typeof d==="number"&&!c.cssNumber[h])d+="px";if(!k||!("set"in k)||(d=k.set(a,d))!==B)try{l[b]=d}catch(o){}}}else{if(k&&"get"in k&&(f=k.get(a,false,e))!==B)return f;return l[b]}}},css:function(a,b,d){var e,f=c.camelCase(b), h=c.cssHooks[f];b=c.cssProps[f]||f;if(h&&"get"in h&&(e=h.get(a,true,d))!==B)return e;else if(W)return W(a,b,f)},swap:function(a,b,d){var e={},f;for(f in b){e[f]=a.style[f];a.style[f]=b[f]}d.call(a);for(f in b)a.style[f]=e[f]},camelCase:function(a){return a.replace(hb,lb)}});c.curCSS=c.css;c.each(["height","width"],function(a,b){c.cssHooks[b]={get:function(d,e,f){var h;if(e){if(d.offsetWidth!==0)h=oa(d,b,f);else c.swap(d,kb,function(){h=oa(d,b,f)});if(h<=0){h=W(d,b,b);if(h==="0px"&&aa)h=aa(d,b,b); if(h!=null)return h===""||h==="auto"?"0px":h}if(h<0||h==null){h=d.style[b];return h===""||h==="auto"?"0px":h}return typeof h==="string"?h:h+"px"}},set:function(d,e){if(Fa.test(e)){e=parseFloat(e);if(e>=0)return e+"px"}else return e}}});if(!c.support.opacity)c.cssHooks.opacity={get:function(a,b){return gb.test((b&&a.currentStyle?a.currentStyle.filter:a.style.filter)||"")?parseFloat(RegExp.$1)/100+"":b?"1":""},set:function(a,b){var d=a.style;d.zoom=1;var e=c.isNaN(b)?"":"alpha(opacity="+b*100+")",f= d.filter||"";d.filter=Ea.test(f)?f.replace(Ea,e):d.filter+" "+e}};if(t.defaultView&&t.defaultView.getComputedStyle)Ga=function(a,b,d){var e;d=d.replace(ib,"-$1").toLowerCase();if(!(b=a.ownerDocument.defaultView))return B;if(b=b.getComputedStyle(a,null)){e=b.getPropertyValue(d);if(e===""&&!c.contains(a.ownerDocument.documentElement,a))e=c.style(a,d)}return e};if(t.documentElement.currentStyle)aa=function(a,b){var d,e,f=a.currentStyle&&a.currentStyle[b],h=a.style;if(!Fa.test(f)&&jb.test(f)){d=h.left; e=a.runtimeStyle.left;a.runtimeStyle.left=a.currentStyle.left;h.left=b==="fontSize"?"1em":f||0;f=h.pixelLeft+"px";h.left=d;a.runtimeStyle.left=e}return f===""?"auto":f};W=Ga||aa;if(c.expr&&c.expr.filters){c.expr.filters.hidden=function(a){var b=a.offsetHeight;return a.offsetWidth===0&&b===0||!c.support.reliableHiddenOffsets&&(a.style.display||c.css(a,"display"))==="none"};c.expr.filters.visible=function(a){return!c.expr.filters.hidden(a)}}var mb=c.now(),nb=/<script\b[^<]*(?:(?!<\/script>)<[^<]*)*<\/script>/gi, ob=/^(?:select|textarea)/i,pb=/^(?:color|date|datetime|email|hidden|month|number|password|range|search|tel|text|time|url|week)$/i,qb=/^(?:GET|HEAD)$/,Ra=/\[\]$/,T=/\=\?(&|$)/,ja=/\?/,rb=/([?&])_=[^&]*/,sb=/^(\w+:)?\/\/([^\/?#]+)/,tb=/%20/g,ub=/#.*$/,Ha=c.fn.load;c.fn.extend({load:function(a,b,d){if(typeof a!=="string"&&Ha)return Ha.apply(this,arguments);else if(!this.length)return this;var e=a.indexOf(" ");if(e>=0){var f=a.slice(e,a.length);a=a.slice(0,e)}e="GET";if(b)if(c.isFunction(b)){d=b;b=null}else if(typeof b=== "object"){b=c.param(b,c.ajaxSettings.traditional);e="POST"}var h=this;c.ajax({url:a,type:e,dataType:"html",data:b,complete:function(l,k){if(k==="success"||k==="notmodified")h.html(f?c("<div>").append(l.responseText.replace(nb,"")).find(f):l.responseText);d&&h.each(d,[l.responseText,k,l])}});return this},serialize:function(){return c.param(this.serializeArray())},serializeArray:function(){return this.map(function(){return this.elements?c.makeArray(this.elements):this}).filter(function(){return this.name&& !this.disabled&&(this.checked||ob.test(this.nodeName)||pb.test(this.type))}).map(function(a,b){var d=c(this).val();return d==null?null:c.isArray(d)?c.map(d,function(e){return{name:b.name,value:e}}):{name:b.name,value:d}}).get()}});c.each("ajaxStart ajaxStop ajaxComplete ajaxError ajaxSuccess ajaxSend".split(" "),function(a,b){c.fn[b]=function(d){return this.bind(b,d)}});c.extend({get:function(a,b,d,e){if(c.isFunction(b)){e=e||d;d=b;b=null}return c.ajax({type:"GET",url:a,data:b,success:d,dataType:e})}, getScript:function(a,b){return c.get(a,null,b,"script")},getJSON:function(a,b,d){return c.get(a,b,d,"json")},post:function(a,b,d,e){if(c.isFunction(b)){e=e||d;d=b;b={}}return c.ajax({type:"POST",url:a,data:b,success:d,dataType:e})},ajaxSetup:function(a){c.extend(c.ajaxSettings,a)},ajaxSettings:{url:location.href,global:true,type:"GET",contentType:"application/x-www-form-urlencoded",processData:true,async:true,xhr:function(){return new E.XMLHttpRequest},accepts:{xml:"application/xml, text/xml",html:"text/html", script:"text/javascript, application/javascript",json:"application/json, text/javascript",text:"text/plain",_default:"*/*"}},ajax:function(a){var b=c.extend(true,{},c.ajaxSettings,a),d,e,f,h=b.type.toUpperCase(),l=qb.test(h);b.url=b.url.replace(ub,"");b.context=a&&a.context!=null?a.context:b;if(b.data&&b.processData&&typeof b.data!=="string")b.data=c.param(b.data,b.traditional);if(b.dataType==="jsonp"){if(h==="GET")T.test(b.url)||(b.url+=(ja.test(b.url)?"&":"?")+(b.jsonp||"callback")+"=?");else if(!b.data|| !T.test(b.data))b.data=(b.data?b.data+"&":"")+(b.jsonp||"callback")+"=?";b.dataType="json"}if(b.dataType==="json"&&(b.data&&T.test(b.data)||T.test(b.url))){d=b.jsonpCallback||"jsonp"+mb++;if(b.data)b.data=(b.data+"").replace(T,"="+d+"$1");b.url=b.url.replace(T,"="+d+"$1");b.dataType="script";var k=E[d];E[d]=function(m){if(c.isFunction(k))k(m);else{E[d]=B;try{delete E[d]}catch(p){}}f=m;c.handleSuccess(b,w,e,f);c.handleComplete(b,w,e,f);r&&r.removeChild(A)}}if(b.dataType==="script"&&b.cache===null)b.cache= false;if(b.cache===false&&l){var o=c.now(),x=b.url.replace(rb,"$1_="+o);b.url=x+(x===b.url?(ja.test(b.url)?"&":"?")+"_="+o:"")}if(b.data&&l)b.url+=(ja.test(b.url)?"&":"?")+b.data;b.global&&c.active++===0&&c.event.trigger("ajaxStart");o=(o=sb.exec(b.url))&&(o[1]&&o[1].toLowerCase()!==location.protocol||o[2].toLowerCase()!==location.host);if(b.dataType==="script"&&h==="GET"&&o){var r=t.getElementsByTagName("head")[0]||t.documentElement,A=t.createElement("script");if(b.scriptCharset)A.charset=b.scriptCharset; A.src=b.url;if(!d){var C=false;A.onload=A.onreadystatechange=function(){if(!C&&(!this.readyState||this.readyState==="loaded"||this.readyState==="complete")){C=true;c.handleSuccess(b,w,e,f);c.handleComplete(b,w,e,f);A.onload=A.onreadystatechange=null;r&&A.parentNode&&r.removeChild(A)}}}r.insertBefore(A,r.firstChild);return B}var J=false,w=b.xhr();if(w){b.username?w.open(h,b.url,b.async,b.username,b.password):w.open(h,b.url,b.async);try{if(b.data!=null&&!l||a&&a.contentType)w.setRequestHeader("Content-Type", b.contentType);if(b.ifModified){c.lastModified[b.url]&&w.setRequestHeader("If-Modified-Since",c.lastModified[b.url]);c.etag[b.url]&&w.setRequestHeader("If-None-Match",c.etag[b.url])}o||w.setRequestHeader("X-Requested-With","XMLHttpRequest");w.setRequestHeader("Accept",b.dataType&&b.accepts[b.dataType]?b.accepts[b.dataType]+", */*; q=0.01":b.accepts._default)}catch(I){}if(b.beforeSend&&b.beforeSend.call(b.context,w,b)===false){b.global&&c.active--===1&&c.event.trigger("ajaxStop");w.abort();return false}b.global&& c.triggerGlobal(b,"ajaxSend",[w,b]);var L=w.onreadystatechange=function(m){if(!w||w.readyState===0||m==="abort"){J||c.handleComplete(b,w,e,f);J=true;if(w)w.onreadystatechange=c.noop}else if(!J&&w&&(w.readyState===4||m==="timeout")){J=true;w.onreadystatechange=c.noop;e=m==="timeout"?"timeout":!c.httpSuccess(w)?"error":b.ifModified&&c.httpNotModified(w,b.url)?"notmodified":"success";var p;if(e==="success")try{f=c.httpData(w,b.dataType,b)}catch(q){e="parsererror";p=q}if(e==="success"||e==="notmodified")d|| c.handleSuccess(b,w,e,f);else c.handleError(b,w,e,p);d||c.handleComplete(b,w,e,f);m==="timeout"&&w.abort();if(b.async)w=null}};try{var g=w.abort;w.abort=function(){w&&Function.prototype.call.call(g,w);L("abort")}}catch(i){}b.async&&b.timeout>0&&setTimeout(function(){w&&!J&&L("timeout")},b.timeout);try{w.send(l||b.data==null?null:b.data)}catch(n){c.handleError(b,w,null,n);c.handleComplete(b,w,e,f)}b.async||L();return w}},param:function(a,b){var d=[],e=function(h,l){l=c.isFunction(l)?l():l;d[d.length]= encodeURIComponent(h)+"="+encodeURIComponent(l)};if(b===B)b=c.ajaxSettings.traditional;if(c.isArray(a)||a.jquery)c.each(a,function(){e(this.name,this.value)});else for(var f in a)da(f,a[f],b,e);return d.join("&").replace(tb,"+")}});c.extend({active:0,lastModified:{},etag:{},handleError:function(a,b,d,e){a.error&&a.error.call(a.context,b,d,e);a.global&&c.triggerGlobal(a,"ajaxError",[b,a,e])},handleSuccess:function(a,b,d,e){a.success&&a.success.call(a.context,e,d,b);a.global&&c.triggerGlobal(a,"ajaxSuccess", [b,a])},handleComplete:function(a,b,d){a.complete&&a.complete.call(a.context,b,d);a.global&&c.triggerGlobal(a,"ajaxComplete",[b,a]);a.global&&c.active--===1&&c.event.trigger("ajaxStop")},triggerGlobal:function(a,b,d){(a.context&&a.context.url==null?c(a.context):c.event).trigger(b,d)},httpSuccess:function(a){try{return!a.status&&location.protocol==="file:"||a.status>=200&&a.status<300||a.status===304||a.status===1223}catch(b){}return false},httpNotModified:function(a,b){var d=a.getResponseHeader("Last-Modified"), e=a.getResponseHeader("Etag");if(d)c.lastModified[b]=d;if(e)c.etag[b]=e;return a.status===304},httpData:function(a,b,d){var e=a.getResponseHeader("content-type")||"",f=b==="xml"||!b&&e.indexOf("xml")>=0;a=f?a.responseXML:a.responseText;f&&a.documentElement.nodeName==="parsererror"&&c.error("parsererror");if(d&&d.dataFilter)a=d.dataFilter(a,b);if(typeof a==="string")if(b==="json"||!b&&e.indexOf("json")>=0)a=c.parseJSON(a);else if(b==="script"||!b&&e.indexOf("javascript")>=0)c.globalEval(a);return a}}); if(E.ActiveXObject)c.ajaxSettings.xhr=function(){if(E.location.protocol!=="file:")try{return new E.XMLHttpRequest}catch(a){}try{return new E.ActiveXObject("Microsoft.XMLHTTP")}catch(b){}};c.support.ajax=!!c.ajaxSettings.xhr();var ea={},vb=/^(?:toggle|show|hide)$/,wb=/^([+\-]=)?([\d+.\-]+)(.*)$/,ba,pa=[["height","marginTop","marginBottom","paddingTop","paddingBottom"],["width","marginLeft","marginRight","paddingLeft","paddingRight"],["opacity"]];c.fn.extend({show:function(a,b,d){if(a||a===0)return this.animate(S("show", 3),a,b,d);else{d=0;for(var e=this.length;d<e;d++){a=this[d];b=a.style.display;if(!c.data(a,"olddisplay")&&b==="none")b=a.style.display="";b===""&&c.css(a,"display")==="none"&&c.data(a,"olddisplay",qa(a.nodeName))}for(d=0;d<e;d++){a=this[d];b=a.style.display;if(b===""||b==="none")a.style.display=c.data(a,"olddisplay")||""}return this}},hide:function(a,b,d){if(a||a===0)return this.animate(S("hide",3),a,b,d);else{a=0;for(b=this.length;a<b;a++){d=c.css(this[a],"display");d!=="none"&&c.data(this[a],"olddisplay", d)}for(a=0;a<b;a++)this[a].style.display="none";return this}},_toggle:c.fn.toggle,toggle:function(a,b,d){var e=typeof a==="boolean";if(c.isFunction(a)&&c.isFunction(b))this._toggle.apply(this,arguments);else a==null||e?this.each(function(){var f=e?a:c(this).is(":hidden");c(this)[f?"show":"hide"]()}):this.animate(S("toggle",3),a,b,d);return this},fadeTo:function(a,b,d,e){return this.filter(":hidden").css("opacity",0).show().end().animate({opacity:b},a,d,e)},animate:function(a,b,d,e){var f=c.speed(b, d,e);if(c.isEmptyObject(a))return this.each(f.complete);return this[f.queue===false?"each":"queue"](function(){var h=c.extend({},f),l,k=this.nodeType===1,o=k&&c(this).is(":hidden"),x=this;for(l in a){var r=c.camelCase(l);if(l!==r){a[r]=a[l];delete a[l];l=r}if(a[l]==="hide"&&o||a[l]==="show"&&!o)return h.complete.call(this);if(k&&(l==="height"||l==="width")){h.overflow=[this.style.overflow,this.style.overflowX,this.style.overflowY];if(c.css(this,"display")==="inline"&&c.css(this,"float")==="none")if(c.support.inlineBlockNeedsLayout)if(qa(this.nodeName)=== "inline")this.style.display="inline-block";else{this.style.display="inline";this.style.zoom=1}else this.style.display="inline-block"}if(c.isArray(a[l])){(h.specialEasing=h.specialEasing||{})[l]=a[l][1];a[l]=a[l][0]}}if(h.overflow!=null)this.style.overflow="hidden";h.curAnim=c.extend({},a);c.each(a,function(A,C){var J=new c.fx(x,h,A);if(vb.test(C))J[C==="toggle"?o?"show":"hide":C](a);else{var w=wb.exec(C),I=J.cur()||0;if(w){var L=parseFloat(w[2]),g=w[3]||"px";if(g!=="px"){c.style(x,A,(L||1)+g);I=(L|| 1)/J.cur()*I;c.style(x,A,I+g)}if(w[1])L=(w[1]==="-="?-1:1)*L+I;J.custom(I,L,g)}else J.custom(I,C,"")}});return true})},stop:function(a,b){var d=c.timers;a&&this.queue([]);this.each(function(){for(var e=d.length-1;e>=0;e--)if(d[e].elem===this){b&&d[e](true);d.splice(e,1)}});b||this.dequeue();return this}});c.each({slideDown:S("show",1),slideUp:S("hide",1),slideToggle:S("toggle",1),fadeIn:{opacity:"show"},fadeOut:{opacity:"hide"},fadeToggle:{opacity:"toggle"}},function(a,b){c.fn[a]=function(d,e,f){return this.animate(b, d,e,f)}});c.extend({speed:function(a,b,d){var e=a&&typeof a==="object"?c.extend({},a):{complete:d||!d&&b||c.isFunction(a)&&a,duration:a,easing:d&&b||b&&!c.isFunction(b)&&b};e.duration=c.fx.off?0:typeof e.duration==="number"?e.duration:e.duration in c.fx.speeds?c.fx.speeds[e.duration]:c.fx.speeds._default;e.old=e.complete;e.complete=function(){e.queue!==false&&c(this).dequeue();c.isFunction(e.old)&&e.old.call(this)};return e},easing:{linear:function(a,b,d,e){return d+e*a},swing:function(a,b,d,e){return(-Math.cos(a* Math.PI)/2+0.5)*e+d}},timers:[],fx:function(a,b,d){this.options=b;this.elem=a;this.prop=d;if(!b.orig)b.orig={}}});c.fx.prototype={update:function(){this.options.step&&this.options.step.call(this.elem,this.now,this);(c.fx.step[this.prop]||c.fx.step._default)(this)},cur:function(){if(this.elem[this.prop]!=null&&(!this.elem.style||this.elem.style[this.prop]==null))return this.elem[this.prop];var a=parseFloat(c.css(this.elem,this.prop));return a&&a>-1E4?a:0},custom:function(a,b,d){function e(l){return f.step(l)} var f=this,h=c.fx;this.startTime=c.now();this.start=a;this.end=b;this.unit=d||this.unit||"px";this.now=this.start;this.pos=this.state=0;e.elem=this.elem;if(e()&&c.timers.push(e)&&!ba)ba=setInterval(h.tick,h.interval)},show:function(){this.options.orig[this.prop]=c.style(this.elem,this.prop);this.options.show=true;this.custom(this.prop==="width"||this.prop==="height"?1:0,this.cur());c(this.elem).show()},hide:function(){this.options.orig[this.prop]=c.style(this.elem,this.prop);this.options.hide=true; this.custom(this.cur(),0)},step:function(a){var b=c.now(),d=true;if(a||b>=this.options.duration+this.startTime){this.now=this.end;this.pos=this.state=1;this.update();this.options.curAnim[this.prop]=true;for(var e in this.options.curAnim)if(this.options.curAnim[e]!==true)d=false;if(d){if(this.options.overflow!=null&&!c.support.shrinkWrapBlocks){var f=this.elem,h=this.options;c.each(["","X","Y"],function(k,o){f.style["overflow"+o]=h.overflow[k]})}this.options.hide&&c(this.elem).hide();if(this.options.hide|| this.options.show)for(var l in this.options.curAnim)c.style(this.elem,l,this.options.orig[l]);this.options.complete.call(this.elem)}return false}else{a=b-this.startTime;this.state=a/this.options.duration;b=this.options.easing||(c.easing.swing?"swing":"linear");this.pos=c.easing[this.options.specialEasing&&this.options.specialEasing[this.prop]||b](this.state,a,0,1,this.options.duration);this.now=this.start+(this.end-this.start)*this.pos;this.update()}return true}};c.extend(c.fx,{tick:function(){for(var a= c.timers,b=0;b<a.length;b++)a[b]()||a.splice(b--,1);a.length||c.fx.stop()},interval:13,stop:function(){clearInterval(ba);ba=null},speeds:{slow:600,fast:200,_default:400},step:{opacity:function(a){c.style(a.elem,"opacity",a.now)},_default:function(a){if(a.elem.style&&a.elem.style[a.prop]!=null)a.elem.style[a.prop]=(a.prop==="width"||a.prop==="height"?Math.max(0,a.now):a.now)+a.unit;else a.elem[a.prop]=a.now}}});if(c.expr&&c.expr.filters)c.expr.filters.animated=function(a){return c.grep(c.timers,function(b){return a=== b.elem}).length};var xb=/^t(?:able|d|h)$/i,Ia=/^(?:body|html)$/i;c.fn.offset="getBoundingClientRect"in t.documentElement?function(a){var b=this[0],d;if(a)return this.each(function(l){c.offset.setOffset(this,a,l)});if(!b||!b.ownerDocument)return null;if(b===b.ownerDocument.body)return c.offset.bodyOffset(b);try{d=b.getBoundingClientRect()}catch(e){}var f=b.ownerDocument,h=f.documentElement;if(!d||!c.contains(h,b))return d||{top:0,left:0};b=f.body;f=fa(f);return{top:d.top+(f.pageYOffset||c.support.boxModel&& h.scrollTop||b.scrollTop)-(h.clientTop||b.clientTop||0),left:d.left+(f.pageXOffset||c.support.boxModel&&h.scrollLeft||b.scrollLeft)-(h.clientLeft||b.clientLeft||0)}}:function(a){var b=this[0];if(a)return this.each(function(x){c.offset.setOffset(this,a,x)});if(!b||!b.ownerDocument)return null;if(b===b.ownerDocument.body)return c.offset.bodyOffset(b);c.offset.initialize();var d,e=b.offsetParent,f=b.ownerDocument,h=f.documentElement,l=f.body;d=(f=f.defaultView)?f.getComputedStyle(b,null):b.currentStyle; for(var k=b.offsetTop,o=b.offsetLeft;(b=b.parentNode)&&b!==l&&b!==h;){if(c.offset.supportsFixedPosition&&d.position==="fixed")break;d=f?f.getComputedStyle(b,null):b.currentStyle;k-=b.scrollTop;o-=b.scrollLeft;if(b===e){k+=b.offsetTop;o+=b.offsetLeft;if(c.offset.doesNotAddBorder&&!(c.offset.doesAddBorderForTableAndCells&&xb.test(b.nodeName))){k+=parseFloat(d.borderTopWidth)||0;o+=parseFloat(d.borderLeftWidth)||0}e=b.offsetParent}if(c.offset.subtractsBorderForOverflowNotVisible&&d.overflow!=="visible"){k+= parseFloat(d.borderTopWidth)||0;o+=parseFloat(d.borderLeftWidth)||0}d=d}if(d.position==="relative"||d.position==="static"){k+=l.offsetTop;o+=l.offsetLeft}if(c.offset.supportsFixedPosition&&d.position==="fixed"){k+=Math.max(h.scrollTop,l.scrollTop);o+=Math.max(h.scrollLeft,l.scrollLeft)}return{top:k,left:o}};c.offset={initialize:function(){var a=t.body,b=t.createElement("div"),d,e,f,h=parseFloat(c.css(a,"marginTop"))||0;c.extend(b.style,{position:"absolute",top:0,left:0,margin:0,border:0,width:"1px", height:"1px",visibility:"hidden"});b.innerHTML="<div style='position:absolute;top:0;left:0;margin:0;border:5px solid #000;padding:0;width:1px;height:1px;'><div></div></div><table style='position:absolute;top:0;left:0;margin:0;border:5px solid #000;padding:0;width:1px;height:1px;' cellpadding='0' cellspacing='0'><tr><td></td></tr></table>";a.insertBefore(b,a.firstChild);d=b.firstChild;e=d.firstChild;f=d.nextSibling.firstChild.firstChild;this.doesNotAddBorder=e.offsetTop!==5;this.doesAddBorderForTableAndCells= f.offsetTop===5;e.style.position="fixed";e.style.top="20px";this.supportsFixedPosition=e.offsetTop===20||e.offsetTop===15;e.style.position=e.style.top="";d.style.overflow="hidden";d.style.position="relative";this.subtractsBorderForOverflowNotVisible=e.offsetTop===-5;this.doesNotIncludeMarginInBodyOffset=a.offsetTop!==h;a.removeChild(b);c.offset.initialize=c.noop},bodyOffset:function(a){var b=a.offsetTop,d=a.offsetLeft;c.offset.initialize();if(c.offset.doesNotIncludeMarginInBodyOffset){b+=parseFloat(c.css(a, "marginTop"))||0;d+=parseFloat(c.css(a,"marginLeft"))||0}return{top:b,left:d}},setOffset:function(a,b,d){var e=c.css(a,"position");if(e==="static")a.style.position="relative";var f=c(a),h=f.offset(),l=c.css(a,"top"),k=c.css(a,"left"),o=e==="absolute"&&c.inArray("auto",[l,k])>-1;e={};var x={};if(o)x=f.position();l=o?x.top:parseInt(l,10)||0;k=o?x.left:parseInt(k,10)||0;if(c.isFunction(b))b=b.call(a,d,h);if(b.top!=null)e.top=b.top-h.top+l;if(b.left!=null)e.left=b.left-h.left+k;"using"in b?b.using.call(a, e):f.css(e)}};c.fn.extend({position:function(){if(!this[0])return null;var a=this[0],b=this.offsetParent(),d=this.offset(),e=Ia.test(b[0].nodeName)?{top:0,left:0}:b.offset();d.top-=parseFloat(c.css(a,"marginTop"))||0;d.left-=parseFloat(c.css(a,"marginLeft"))||0;e.top+=parseFloat(c.css(b[0],"borderTopWidth"))||0;e.left+=parseFloat(c.css(b[0],"borderLeftWidth"))||0;return{top:d.top-e.top,left:d.left-e.left}},offsetParent:function(){return this.map(function(){for(var a=this.offsetParent||t.body;a&&!Ia.test(a.nodeName)&& c.css(a,"position")==="static";)a=a.offsetParent;return a})}});c.each(["Left","Top"],function(a,b){var d="scroll"+b;c.fn[d]=function(e){var f=this[0],h;if(!f)return null;if(e!==B)return this.each(function(){if(h=fa(this))h.scrollTo(!a?e:c(h).scrollLeft(),a?e:c(h).scrollTop());else this[d]=e});else return(h=fa(f))?"pageXOffset"in h?h[a?"pageYOffset":"pageXOffset"]:c.support.boxModel&&h.document.documentElement[d]||h.document.body[d]:f[d]}});c.each(["Height","Width"],function(a,b){var d=b.toLowerCase(); c.fn["inner"+b]=function(){return this[0]?parseFloat(c.css(this[0],d,"padding")):null};c.fn["outer"+b]=function(e){return this[0]?parseFloat(c.css(this[0],d,e?"margin":"border")):null};c.fn[d]=function(e){var f=this[0];if(!f)return e==null?null:this;if(c.isFunction(e))return this.each(function(l){var k=c(this);k[d](e.call(this,l,k[d]()))});if(c.isWindow(f))return f.document.compatMode==="CSS1Compat"&&f.document.documentElement["client"+b]||f.document.body["client"+b];else if(f.nodeType===9)return Math.max(f.documentElement["client"+ b],f.body["scroll"+b],f.documentElement["scroll"+b],f.body["offset"+b],f.documentElement["offset"+b]);else if(e===B){f=c.css(f,d);var h=parseFloat(f);return c.isNaN(h)?f:h}else return this.css(d,typeof e==="string"?e:e+"px")}})})(window);
ajax/libs/yui/3.5.1/event-focus/event-focus-debug.js
dc-js/cdnjs
YUI.add('event-focus', function(Y) { /** * Adds bubbling and delegation support to DOM events focus and blur. * * @module event * @submodule event-focus */ var Event = Y.Event, YLang = Y.Lang, isString = YLang.isString, arrayIndex = Y.Array.indexOf, useActivate = YLang.isFunction( Y.DOM.create('<p onbeforeactivate=";"/>').onbeforeactivate); function define(type, proxy, directEvent) { var nodeDataKey = '_' + type + 'Notifiers'; Y.Event.define(type, { _attach: function (el, notifier, delegate) { if (Y.DOM.isWindow(el)) { return Event._attach([type, function (e) { notifier.fire(e); }, el]); } else { return Event._attach( [proxy, this._proxy, el, this, notifier, delegate], { capture: true }); } }, _proxy: function (e, notifier, delegate) { var target = e.target, currentTarget = e.currentTarget, notifiers = target.getData(nodeDataKey), yuid = Y.stamp(currentTarget._node), defer = (useActivate || target !== currentTarget), directSub; notifier.currentTarget = (delegate) ? target : currentTarget; notifier.container = (delegate) ? currentTarget : null; // Maintain a list to handle subscriptions from nested // containers div#a>div#b>input #a.on(focus..) #b.on(focus..), // use one focus or blur subscription that fires notifiers from // #b then #a to emulate bubble sequence. if (!notifiers) { notifiers = {}; target.setData(nodeDataKey, notifiers); // only subscribe to the element's focus if the target is // not the current target ( if (defer) { directSub = Event._attach( [directEvent, this._notify, target._node]).sub; directSub.once = true; } } else { // In old IE, defer is always true. In capture-phase browsers, // The delegate subscriptions will be encountered first, which // will establish the notifiers data and direct subscription // on the node. If there is also a direct subscription to the // node's focus/blur, it should not call _notify because the // direct subscription from the delegate sub(s) exists, which // will call _notify. So this avoids _notify being called // twice, unnecessarily. defer = true; } if (!notifiers[yuid]) { notifiers[yuid] = []; } notifiers[yuid].push(notifier); if (!defer) { this._notify(e); } }, _notify: function (e, container) { var currentTarget = e.currentTarget, notifierData = currentTarget.getData(nodeDataKey), axisNodes = currentTarget.ancestors(), doc = currentTarget.get('ownerDocument'), delegates = [], // Used to escape loops when there are no more // notifiers to consider count = notifierData ? Y.Object.keys(notifierData).length : 0, target, notifiers, notifier, yuid, match, tmp, i, len, sub, ret; // clear the notifications list (mainly for delegation) currentTarget.clearData(nodeDataKey); // Order the delegate subs by their placement in the parent axis axisNodes.push(currentTarget); // document.get('ownerDocument') returns null // which we'll use to prevent having duplicate Nodes in the list if (doc) { axisNodes.unshift(doc); } // ancestors() returns the Nodes from top to bottom axisNodes._nodes.reverse(); // Store the count for step 2 tmp = count; axisNodes.some(function (node) { var yuid = Y.stamp(node), notifiers = notifierData[yuid], i, len; if (notifiers) { count--; for (i = 0, len = notifiers.length; i < len; ++i) { if (notifiers[i].handle.sub.filter) { delegates.push(notifiers[i]); } } } return !count; }); count = tmp; // Walk up the parent axis, notifying direct subscriptions and // testing delegate filters. while (count && (target = axisNodes.shift())) { yuid = Y.stamp(target); notifiers = notifierData[yuid]; if (notifiers) { for (i = 0, len = notifiers.length; i < len; ++i) { notifier = notifiers[i]; sub = notifier.handle.sub; match = true; e.currentTarget = target; if (sub.filter) { match = sub.filter.apply(target, [target, e].concat(sub.args || [])); // No longer necessary to test against this // delegate subscription for the nodes along // the parent axis. delegates.splice( arrayIndex(delegates, notifier), 1); } if (match) { // undefined for direct subs e.container = notifier.container; ret = notifier.fire(e); } if (ret === false || e.stopped === 2) { break; } } delete notifiers[yuid]; count--; } if (e.stopped !== 2) { // delegates come after subs targeting this specific node // because they would not normally report until they'd // bubbled to the container node. for (i = 0, len = delegates.length; i < len; ++i) { notifier = delegates[i]; sub = notifier.handle.sub; if (sub.filter.apply(target, [target, e].concat(sub.args || []))) { e.container = notifier.container; e.currentTarget = target; ret = notifier.fire(e); } if (ret === false || e.stopped === 2) { break; } } } if (e.stopped) { break; } } }, on: function (node, sub, notifier) { sub.handle = this._attach(node._node, notifier); }, detach: function (node, sub) { sub.handle.detach(); }, delegate: function (node, sub, notifier, filter) { if (isString(filter)) { sub.filter = function (target) { return Y.Selector.test(target._node, filter, node === target ? null : node._node); }; } sub.handle = this._attach(node._node, notifier, true); }, detachDelegate: function (node, sub) { sub.handle.detach(); } }, true); } // For IE, we need to defer to focusin rather than focus because // `el.focus(); doSomething();` executes el.onbeforeactivate, el.onactivate, // el.onfocusin, doSomething, then el.onfocus. All others support capture // phase focus, which executes before doSomething. To guarantee consistent // behavior for this use case, IE's direct subscriptions are made against // focusin so subscribers will be notified before js following el.focus() is // executed. if (useActivate) { // name capture phase direct subscription define("focus", "beforeactivate", "focusin"); define("blur", "beforedeactivate", "focusout"); } else { define("focus", "focus", "focus"); define("blur", "blur", "blur"); } }, '@VERSION@' ,{requires:['event-synthetic']});
src/app/index.js
lpan/htn-challenge
import React from 'react'; import ReactDOM from 'react-dom'; import { Provider } from 'react-redux'; // import global css import 'react-select/dist/react-select.css'; import './app.global.css'; import store from './store'; import Routes from './Routes'; import { AppContainer } from 'react-hot-loader'; // eslint-disable-line const render = (Component) => { ReactDOM.render( <AppContainer> <Provider store={store}> <Component /> </Provider> </AppContainer>, document.getElementById('app'), ); }; render(Routes); // Hot Module Replacement API if (module.hot) { module.hot.accept('./Routes', () => { render(Routes); }); }
dist/vendor.0835815cbf3a7d085573.bundle.js
cherurg/audaily
webpackJsonp([1],[function(e,t,r){"use strict";var n=r(465);r.d(t,"assertPlatform",function(){return n._20}),r.d(t,"destroyPlatform",function(){return n._21}),r.d(t,"getPlatform",function(){return n._22}),r.d(t,"createPlatform",function(){return n._23}),r.d(t,"ApplicationRef",function(){return n.z}),r.d(t,"enableProdMode",function(){return n._24}),r.d(t,"isDevMode",function(){return n.B}),r.d(t,"createPlatformFactory",function(){return n.G}),r.d(t,"PlatformRef",function(){return n._25}),r.d(t,"APP_ID",function(){return n._26}),r.d(t,"PACKAGE_ROOT_URL",function(){return n.W}),r.d(t,"APP_BOOTSTRAP_LISTENER",function(){return n._27}),r.d(t,"PLATFORM_INITIALIZER",function(){return n.E}),r.d(t,"ApplicationInitStatus",function(){return n._28}),r.d(t,"APP_INITIALIZER",function(){return n._29}),r.d(t,"DebugElement",function(){return n._30}),r.d(t,"DebugNode",function(){return n._31}),r.d(t,"asNativeElements",function(){return n._32}),r.d(t,"getDebugNode",function(){return n.A}),r.d(t,"Testability",function(){return n.J}),r.d(t,"TestabilityRegistry",function(){return n._33}),r.d(t,"setTestabilityGetter",function(){return n.w}),r.d(t,"TRANSLATIONS",function(){return n._16}),r.d(t,"TRANSLATIONS_FORMAT",function(){return n.V}),r.d(t,"LOCALE_ID",function(){return n.f}),r.d(t,"ApplicationModule",function(){return n.K}),r.d(t,"wtfCreateScope",function(){return n._34}),r.d(t,"wtfLeave",function(){return n._35}),r.d(t,"wtfStartTimeRange",function(){return n._36}),r.d(t,"wtfEndTimeRange",function(){return n._37}),r.d(t,"Type",function(){return n._11}),r.d(t,"EventEmitter",function(){return n.b}),r.d(t,"ErrorHandler",function(){return n.I}),r.d(t,"AnimationTransitionEvent",function(){return n._38}),r.d(t,"AnimationPlayer",function(){return n._39}),r.d(t,"Sanitizer",function(){return n.F}),r.d(t,"SecurityContext",function(){return n.D}),r.d(t,"Attribute",function(){return n.q}),r.d(t,"ContentChild",function(){return n._40}),r.d(t,"ContentChildren",function(){return n._41}),r.d(t,"Query",function(){return n._1}),r.d(t,"ViewChild",function(){return n._42}),r.d(t,"ViewChildren",function(){return n._43}),r.d(t,"ANALYZE_FOR_ENTRY_COMPONENTS",function(){return n.N}),r.d(t,"Component",function(){return n._2}),r.d(t,"Directive",function(){return n.g}),r.d(t,"HostBinding",function(){return n.Z}),r.d(t,"HostListener",function(){return n._0}),r.d(t,"Input",function(){return n.l}),r.d(t,"Output",function(){return n.Y}),r.d(t,"Pipe",function(){return n.t}),r.d(t,"OnDestroy",function(){return n._44}),r.d(t,"AfterContentInit",function(){return n._45}),r.d(t,"AfterViewChecked",function(){return n._46}),r.d(t,"AfterViewInit",function(){return n._47}),r.d(t,"DoCheck",function(){return n._48}),r.d(t,"OnChanges",function(){return n._49}),r.d(t,"AfterContentChecked",function(){return n._50}),r.d(t,"OnInit",function(){return n._51}),r.d(t,"CUSTOM_ELEMENTS_SCHEMA",function(){return n._15}),r.d(t,"NO_ERRORS_SCHEMA",function(){return n._14}),r.d(t,"NgModule",function(){return n.u}),r.d(t,"ViewEncapsulation",function(){return n.y}),r.d(t,"Class",function(){return n._52}),r.d(t,"forwardRef",function(){return n._53}),r.d(t,"resolveForwardRef",function(){return n.X}),r.d(t,"Injector",function(){return n.T}),r.d(t,"ReflectiveInjector",function(){return n._17}),r.d(t,"ResolvedReflectiveFactory",function(){return n._54}),r.d(t,"ReflectiveKey",function(){return n._55}),r.d(t,"OpaqueToken",function(){return n.a}),r.d(t,"NgZone",function(){return n.x}),r.d(t,"RenderComponentType",function(){return n.O}),r.d(t,"Renderer",function(){return n.k}),r.d(t,"RootRenderer",function(){return n.C}),r.d(t,"COMPILER_OPTIONS",function(){return n._18}),r.d(t,"CompilerFactory",function(){return n._19}),r.d(t,"ModuleWithComponentFactories",function(){return n._12}),r.d(t,"Compiler",function(){return n._13}),r.d(t,"ComponentFactory",function(){return n.R}),r.d(t,"ComponentRef",function(){return n._56}),r.d(t,"ComponentFactoryResolver",function(){return n.Q}),r.d(t,"ElementRef",function(){return n.j}),r.d(t,"NgModuleFactory",function(){return n.S}),r.d(t,"NgModuleRef",function(){return n._57}),r.d(t,"NgModuleFactoryLoader",function(){return n._58}),r.d(t,"getModuleFactory",function(){return n._59}),r.d(t,"QueryList",function(){return n.P}),r.d(t,"SystemJsNgModuleLoader",function(){return n._60}),r.d(t,"SystemJsNgModuleLoaderConfig",function(){return n._61}),r.d(t,"TemplateRef",function(){return n.n}),r.d(t,"ViewContainerRef",function(){return n.m}),r.d(t,"EmbeddedViewRef",function(){return n._62}),r.d(t,"ViewRef",function(){return n._63}),r.d(t,"ChangeDetectionStrategy",function(){return n.M}),r.d(t,"ChangeDetectorRef",function(){return n.o}),r.d(t,"CollectionChangeRecord",function(){return n._64}),r.d(t,"DefaultIterableDiffer",function(){return n._65}),r.d(t,"IterableDiffers",function(){return n.h}),r.d(t,"KeyValueChangeRecord",function(){return n._66}),r.d(t,"KeyValueDiffers",function(){return n.i}),r.d(t,"SimpleChange",function(){return n.U}),r.d(t,"WrappedValue",function(){return n.s}),r.d(t,"platformCore",function(){return n.H}),r.d(t,"__core_private__",function(){return n.r}),r.d(t,"AUTO_STYLE",function(){return n.v}),r.d(t,"AnimationEntryMetadata",function(){return n._67}),r.d(t,"AnimationStateMetadata",function(){return n._68}),r.d(t,"AnimationStateDeclarationMetadata",function(){return n._3}),r.d(t,"AnimationStateTransitionMetadata",function(){return n._4}),r.d(t,"AnimationMetadata",function(){return n._69}),r.d(t,"AnimationKeyframesSequenceMetadata",function(){return n._6}),r.d(t,"AnimationStyleMetadata",function(){return n._5}),r.d(t,"AnimationAnimateMetadata",function(){return n._7}),r.d(t,"AnimationWithStepsMetadata",function(){return n._8}),r.d(t,"AnimationSequenceMetadata",function(){return n._70}),r.d(t,"AnimationGroupMetadata",function(){return n._9}),r.d(t,"animate",function(){return n._71}),r.d(t,"group",function(){return n._72}),r.d(t,"sequence",function(){return n._73}),r.d(t,"style",function(){return n._74}),r.d(t,"state",function(){return n._75}),r.d(t,"keyframes",function(){return n._76}),r.d(t,"transition",function(){return n._77}),r.d(t,"trigger",function(){return n._78}),r.d(t,"Inject",function(){return n.e}),r.d(t,"Optional",function(){return n.d}),r.d(t,"Injectable",function(){return n.c}),r.d(t,"Self",function(){return n._10}),r.d(t,"SkipSelf",function(){return n.L}),r.d(t,"Host",function(){return n.p})},,function(e,t,r){"use strict";(function(e){function isPresent(e){return void 0!==e&&null!==e}function isBlank(e){return void 0===e||null===e}function isStrictStringMap(e){return"object"==typeof e&&null!==e&&Object.getPrototypeOf(e)===o}function stringify(e){if("string"==typeof e)return e;if(void 0===e||null===e)return""+e;if(e.overriddenName)return e.overriddenName;if(e.name)return e.name;var t=e.toString(),r=t.indexOf("\n");return r===-1?t:t.substring(0,r)}function normalizeBlank(e){return isBlank(e)?null:e}function normalizeBool(e){return!isBlank(e)&&e}function isJsObject(e){return null!==e&&("function"==typeof e||"object"==typeof e)}function getSymbolIterator(){if(isBlank(s))if(isPresent(n.Symbol)&&isPresent(Symbol.iterator))s=Symbol.iterator;else for(var e=Object.getOwnPropertyNames(Map.prototype),t=0;t<e.length;++t){var r=e[t];"entries"!==r&&"size"!==r&&Map.prototype[r]===Map.prototype.entries&&(s=r)}return s}function isPrimitive(e){return!isJsObject(e)}function escapeRegExp(e){return e.replace(/([.*+?^=!:${}()|[\]\/\\])/g,"\\$1")}t.a=isPresent,t.b=isBlank,t.e=isStrictStringMap,t.k=stringify,r.d(t,"i",function(){return a}),t.h=normalizeBlank,t.g=normalizeBool,t.c=isJsObject,t.d=getSymbolIterator,t.f=isPrimitive,t.j=escapeRegExp;var n;n="undefined"==typeof window?"undefined"!=typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope?self:e:window;var i=n;i.assert=function(e){};var o=Object.getPrototypeOf({}),a=function(){function NumberWrapper(){}return NumberWrapper.parseIntAutoRadix=function(e){var t=parseInt(e);if(isNaN(t))throw new Error("Invalid integer literal when parsing "+e);return t},NumberWrapper.parseInt=function(e,t){if(10==t){if(/^(\-|\+)?[0-9]+$/.test(e))return parseInt(e,t)}else if(16==t){if(/^(\-|\+)?[0-9ABCDEFabcdef]+$/.test(e))return parseInt(e,t)}else{var r=parseInt(e,t);if(!isNaN(r))return r}throw new Error("Invalid integer literal when parsing "+e+" in base "+t)},NumberWrapper.isNumeric=function(e){return!isNaN(e-parseFloat(e))},NumberWrapper}(),s=null}).call(t,r(28))},function(e,t,r){"use strict";(function(e){function scheduleMicroTask(e){Zone.current.scheduleMicroTask("scheduleMicrotask",e)}function getTypeNameForDebugging(e){return e.name||typeof e}function isPresent(e){return void 0!==e&&null!==e}function isBlank(e){return void 0===e||null===e}function stringify(e){if("string"==typeof e)return e;if(void 0===e||null===e)return""+e;if(e.overriddenName)return e.overriddenName;if(e.name)return e.name;var t=e.toString(),r=t.indexOf("\n");return r===-1?t:t.substring(0,r)}function looseIdentical(e,t){return e===t||"number"==typeof e&&"number"==typeof t&&isNaN(e)&&isNaN(t)}function isJsObject(e){return null!==e&&("function"==typeof e||"object"==typeof e)}function print(e){console.log(e)}function warn(e){console.warn(e)}function getSymbolIterator(){if(isBlank(o))if(isPresent(n.Symbol)&&isPresent(Symbol.iterator))o=Symbol.iterator;else for(var e=Object.getOwnPropertyNames(Map.prototype),t=0;t<e.length;++t){var r=e[t];"entries"!==r&&"size"!==r&&Map.prototype[r]===Map.prototype.entries&&(o=r)}return o}function isPrimitive(e){return!isJsObject(e)}t.l=scheduleMicroTask,r.d(t,"a",function(){return i}),t.j=getTypeNameForDebugging,t.d=isPresent,t.c=isBlank,t.b=stringify,t.i=looseIdentical,t.e=isJsObject,t.g=print,t.h=warn,t.f=getSymbolIterator,t.k=isPrimitive;var n;n="undefined"==typeof window?"undefined"!=typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope?self:e:window;var i=n;i.assert=function(e){};var o=(Object.getPrototypeOf({}),function(){function NumberWrapper(){}return NumberWrapper.parseIntAutoRadix=function(e){var t=parseInt(e);if(isNaN(t))throw new Error("Invalid integer literal when parsing "+e);return t},NumberWrapper.parseInt=function(e,t){if(10==t){if(/^(\-|\+)?[0-9]+$/.test(e))return parseInt(e,t)}else if(16==t){if(/^(\-|\+)?[0-9ABCDEFabcdef]+$/.test(e))return parseInt(e,t)}else{var r=parseInt(e,t);if(!isNaN(r))return r}throw new Error("Invalid integer literal when parsing "+e+" in base "+t)},NumberWrapper.isNumeric=function(e){return!isNaN(e-parseFloat(e))},NumberWrapper}(),null)}).call(t,r(28))},,,function(e,t,r){"use strict";var n=r(61),i=r(717),o=r(243),a=function(){function Observable(e){this._isScalar=!1,e&&(this._subscribe=e)}return Observable.prototype.lift=function(e){var t=new Observable;return t.source=this,t.operator=e,t},Observable.prototype.subscribe=function(e,t,r){var n=this.operator,o=i.toSubscriber(e,t,r);if(n?n.call(o,this):o.add(this._subscribe(o)),o.syncErrorThrowable&&(o.syncErrorThrowable=!1,o.syncErrorThrown))throw o.syncErrorValue;return o},Observable.prototype.forEach=function(e,t){var r=this;if(t||(n.root.Rx&&n.root.Rx.config&&n.root.Rx.config.Promise?t=n.root.Rx.config.Promise:n.root.Promise&&(t=n.root.Promise)),!t)throw new Error("no Promise impl found");return new t(function(t,n){var i=r.subscribe(function(t){if(i)try{e(t)}catch(e){n(e),i.unsubscribe()}else e(t)},n,t)})},Observable.prototype._subscribe=function(e){return this.source.subscribe(e)},Observable.prototype[o.$$observable]=function(){return this},Observable.create=function(e){return new Observable(e)},Observable}();t.Observable=a},,function(e,t,r){"use strict";function replaceVarInExpression(e,t,r){var n=new oe(e,t);return r.visitExpression(n,null)}function findReadVarNames(e){var t=new ae;return t.visitAllStatements(e,null),t.varNames}function variable(e,t){return void 0===t&&(t=null),new w(e,t)}function importExpr(e,t){return void 0===t&&(t=null),new R(e,null,t)}function importType(e,t,i){return void 0===t&&(t=null),void 0===i&&(i=null),r.i(n.a)(e)?new l(e,t,i):null}function literalArr(e,t){return void 0===t&&(t=null),new F(e,t)}function literalMap(e,t){return void 0===t&&(t=null),new B(e,t)}function not(e){return new N(e)}function fn(e,t,r){return void 0===r&&(r=null),new k(e,t,r)}function literal(e,t){return void 0===t&&(t=null),new O(e,t)}var n=r(2);r.d(t,"d",function(){return i}),r.d(t,"P",function(){return s}),r.d(t,"Q",function(){return a}),r.d(t,"J",function(){return l}),r.d(t,"A",function(){return p}),r.d(t,"q",function(){return f}),r.d(t,"m",function(){return h}),r.d(t,"p",function(){return d}),r.d(t,"M",function(){return m}),r.d(t,"L",function(){return v}),r.d(t,"H",function(){return y}),r.d(t,"F",function(){return u}),r.d(t,"w",function(){return _}),r.d(t,"y",function(){return g}),r.d(t,"x",function(){return w}),r.d(t,"B",function(){return b}),r.d(t,"u",function(){return O}),r.d(t,"R",function(){return R}),r.d(t,"l",function(){return D}),r.d(t,"G",function(){return V}),r.d(t,"n",function(){return U}),r.d(t,"K",function(){return W}),r.d(t,"h",function(){return H}),r.d(t,"r",function(){return A}),r.d(t,"O",function(){return G}),r.d(t,"E",function(){return z}),r.d(t,"I",function(){return K}),r.d(t,"k",function(){return Q}),r.d(t,"o",function(){return X}),r.d(t,"s",function(){return Z}),r.d(t,"D",function(){return $}),r.d(t,"t",function(){return Y}),r.d(t,"i",function(){return ee}),r.d(t,"z",function(){return ne}),t.C=replaceVarInExpression,t.N=findReadVarNames,t.e=variable,t.b=importExpr,t.c=importType,t.g=literalArr,t.f=literalMap,t.v=not,t.j=fn,t.a=literal;var i,o=this&&this.__extends||function(e,t){function __(){this.constructor=e}for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r]);e.prototype=null===t?Object.create(t):(__.prototype=t.prototype,new __)};!function(e){e[e.Const=0]="Const"}(i||(i={}));var a,s=function(){function Type(e){void 0===e&&(e=null),this.modifiers=e,e||(this.modifiers=[])}return Type.prototype.hasModifier=function(e){return this.modifiers.indexOf(e)!==-1},Type}();!function(e){e[e.Dynamic=0]="Dynamic",e[e.Bool=1]="Bool",e[e.String=2]="String",e[e.Int=3]="Int",e[e.Number=4]="Number",e[e.Function=5]="Function"}(a||(a={}));var u,c=function(e){function BuiltinType(t,r){void 0===r&&(r=null),e.call(this,r),this.name=t}return o(BuiltinType,e),BuiltinType.prototype.visitType=function(e,t){return e.visitBuiltintType(this,t)},BuiltinType}(s),l=function(e){function ExternalType(t,r,n){void 0===r&&(r=null),void 0===n&&(n=null),e.call(this,n),this.value=t,this.typeParams=r}return o(ExternalType,e),ExternalType.prototype.visitType=function(e,t){return e.visitExternalType(this,t)},ExternalType}(s),p=function(e){function ArrayType(t,r){void 0===r&&(r=null),e.call(this,r),this.of=t}return o(ArrayType,e),ArrayType.prototype.visitType=function(e,t){return e.visitArrayType(this,t)},ArrayType}(s),f=function(e){function MapType(t,r){void 0===r&&(r=null),e.call(this,r),this.valueType=t}return o(MapType,e),MapType.prototype.visitType=function(e,t){return e.visitMapType(this,t)},MapType}(s),h=new c(a.Dynamic),d=new c(a.Bool),m=(new c(a.Int),new c(a.Number)),v=new c(a.String),y=new c(a.Function);!function(e){e[e.Equals=0]="Equals",e[e.NotEquals=1]="NotEquals",e[e.Identical=2]="Identical",e[e.NotIdentical=3]="NotIdentical",e[e.Minus=4]="Minus",e[e.Plus=5]="Plus",e[e.Divide=6]="Divide",e[e.Multiply=7]="Multiply",e[e.Modulo=8]="Modulo",e[e.And=9]="And",e[e.Or=10]="Or",e[e.Lower=11]="Lower",e[e.LowerEquals=12]="LowerEquals",e[e.Bigger=13]="Bigger",e[e.BiggerEquals=14]="BiggerEquals"}(u||(u={}));var g,_=function(){function Expression(e){this.type=e}return Expression.prototype.prop=function(e){return new L(this,e)},Expression.prototype.key=function(e,t){return void 0===t&&(t=null),new j(this,e,t)},Expression.prototype.callMethod=function(e,t){return new P(this,e,t)},Expression.prototype.callFn=function(e){return new x(this,e)},Expression.prototype.instantiate=function(e,t){return void 0===t&&(t=null),new T(this,e,t)},Expression.prototype.conditional=function(e,t){return void 0===t&&(t=null),new M(this,e,t)},Expression.prototype.equals=function(e){return new V(u.Equals,this,e)},Expression.prototype.notEquals=function(e){return new V(u.NotEquals,this,e)},Expression.prototype.identical=function(e){return new V(u.Identical,this,e)},Expression.prototype.notIdentical=function(e){return new V(u.NotIdentical,this,e)},Expression.prototype.minus=function(e){return new V(u.Minus,this,e)},Expression.prototype.plus=function(e){return new V(u.Plus,this,e)},Expression.prototype.divide=function(e){return new V(u.Divide,this,e)},Expression.prototype.multiply=function(e){return new V(u.Multiply,this,e)},Expression.prototype.modulo=function(e){return new V(u.Modulo,this,e)},Expression.prototype.and=function(e){return new V(u.And,this,e)},Expression.prototype.or=function(e){return new V(u.Or,this,e)},Expression.prototype.lower=function(e){return new V(u.Lower,this,e)},Expression.prototype.lowerEquals=function(e){return new V(u.LowerEquals,this,e)},Expression.prototype.bigger=function(e){return new V(u.Bigger,this,e)},Expression.prototype.biggerEquals=function(e){return new V(u.BiggerEquals,this,e)},Expression.prototype.isBlank=function(){return this.equals(H)},Expression.prototype.cast=function(e){return new I(this,e)},Expression.prototype.toStmt=function(){return new K(this)},Expression}();!function(e){e[e.This=0]="This",e[e.Super=1]="Super",e[e.CatchError=2]="CatchError",e[e.CatchStack=3]="CatchStack"}(g||(g={}));var b,w=function(e){function ReadVarExpr(t,r){void 0===r&&(r=null),e.call(this,r),"string"==typeof t?(this.name=t,this.builtin=null):(this.name=null,this.builtin=t)}return o(ReadVarExpr,e),ReadVarExpr.prototype.visitExpression=function(e,t){return e.visitReadVarExpr(this,t)},ReadVarExpr.prototype.set=function(e){return new C(this.name,e)},ReadVarExpr}(_),C=function(e){function WriteVarExpr(t,r,n){void 0===n&&(n=null),e.call(this,n||r.type),this.name=t,this.value=r}return o(WriteVarExpr,e),WriteVarExpr.prototype.visitExpression=function(e,t){return e.visitWriteVarExpr(this,t)},WriteVarExpr.prototype.toDeclStmt=function(e,t){return void 0===e&&(e=null),void 0===t&&(t=null),new z(this.name,this.value,e,t)},WriteVarExpr}(_),E=function(e){function WriteKeyExpr(t,r,n,i){void 0===i&&(i=null),e.call(this,i||n.type),this.receiver=t,this.index=r,this.value=n}return o(WriteKeyExpr,e),WriteKeyExpr.prototype.visitExpression=function(e,t){return e.visitWriteKeyExpr(this,t)},WriteKeyExpr}(_),S=function(e){function WritePropExpr(t,r,n,i){void 0===i&&(i=null),e.call(this,i||n.type),this.receiver=t,this.name=r,this.value=n}return o(WritePropExpr,e),WritePropExpr.prototype.visitExpression=function(e,t){return e.visitWritePropExpr(this,t)},WritePropExpr}(_);!function(e){e[e.ConcatArray=0]="ConcatArray",e[e.SubscribeObservable=1]="SubscribeObservable",e[e.Bind=2]="Bind"}(b||(b={}));var A,P=function(e){function InvokeMethodExpr(t,r,n,i){void 0===i&&(i=null),e.call(this,i),this.receiver=t,this.args=n,"string"==typeof r?(this.name=r,this.builtin=null):(this.name=null,this.builtin=r)}return o(InvokeMethodExpr,e),InvokeMethodExpr.prototype.visitExpression=function(e,t){return e.visitInvokeMethodExpr(this,t)},InvokeMethodExpr}(_),x=function(e){function InvokeFunctionExpr(t,r,n){void 0===n&&(n=null),e.call(this,n),this.fn=t,this.args=r}return o(InvokeFunctionExpr,e),InvokeFunctionExpr.prototype.visitExpression=function(e,t){return e.visitInvokeFunctionExpr(this,t)},InvokeFunctionExpr}(_),T=function(e){function InstantiateExpr(t,r,n){e.call(this,n),this.classExpr=t,this.args=r}return o(InstantiateExpr,e),InstantiateExpr.prototype.visitExpression=function(e,t){return e.visitInstantiateExpr(this,t)},InstantiateExpr}(_),O=function(e){function LiteralExpr(t,r){void 0===r&&(r=null),e.call(this,r),this.value=t}return o(LiteralExpr,e),LiteralExpr.prototype.visitExpression=function(e,t){return e.visitLiteralExpr(this,t)},LiteralExpr}(_),R=function(e){function ExternalExpr(t,r,n){void 0===r&&(r=null),void 0===n&&(n=null),e.call(this,r),this.value=t,this.typeParams=n}return o(ExternalExpr,e),ExternalExpr.prototype.visitExpression=function(e,t){return e.visitExternalExpr(this,t)},ExternalExpr}(_),M=function(e){function ConditionalExpr(t,r,n,i){void 0===n&&(n=null),void 0===i&&(i=null),e.call(this,i||r.type),this.condition=t,this.falseCase=n,this.trueCase=r}return o(ConditionalExpr,e),ConditionalExpr.prototype.visitExpression=function(e,t){return e.visitConditionalExpr(this,t)},ConditionalExpr}(_),N=function(e){function NotExpr(t){e.call(this,d),this.condition=t}return o(NotExpr,e),NotExpr.prototype.visitExpression=function(e,t){return e.visitNotExpr(this,t)},NotExpr}(_),I=function(e){function CastExpr(t,r){e.call(this,r),this.value=t}return o(CastExpr,e),CastExpr.prototype.visitExpression=function(e,t){return e.visitCastExpr(this,t)},CastExpr}(_),D=function(){function FnParam(e,t){void 0===t&&(t=null),this.name=e,this.type=t}return FnParam}(),k=function(e){function FunctionExpr(t,r,n){void 0===n&&(n=null),e.call(this,n),this.params=t,this.statements=r}return o(FunctionExpr,e),FunctionExpr.prototype.visitExpression=function(e,t){return e.visitFunctionExpr(this,t)},FunctionExpr.prototype.toDeclStmt=function(e,t){return void 0===t&&(t=null),new q(e,this.params,this.statements,this.type,t)},FunctionExpr}(_),V=function(e){function BinaryOperatorExpr(t,r,n,i){void 0===i&&(i=null),e.call(this,i||r.type),this.operator=t,this.rhs=n,this.lhs=r}return o(BinaryOperatorExpr,e),BinaryOperatorExpr.prototype.visitExpression=function(e,t){return e.visitBinaryOperatorExpr(this,t)},BinaryOperatorExpr}(_),L=function(e){function ReadPropExpr(t,r,n){void 0===n&&(n=null),e.call(this,n),this.receiver=t,this.name=r}return o(ReadPropExpr,e),ReadPropExpr.prototype.visitExpression=function(e,t){return e.visitReadPropExpr(this,t)},ReadPropExpr.prototype.set=function(e){return new S(this.receiver,this.name,e)},ReadPropExpr}(_),j=function(e){function ReadKeyExpr(t,r,n){void 0===n&&(n=null),e.call(this,n),this.receiver=t,this.index=r}return o(ReadKeyExpr,e),ReadKeyExpr.prototype.visitExpression=function(e,t){return e.visitReadKeyExpr(this,t)},ReadKeyExpr.prototype.set=function(e){return new E(this.receiver,this.index,e)},ReadKeyExpr}(_),F=function(e){function LiteralArrayExpr(t,r){void 0===r&&(r=null),e.call(this,r),this.entries=t}return o(LiteralArrayExpr,e),LiteralArrayExpr.prototype.visitExpression=function(e,t){return e.visitLiteralArrayExpr(this,t)},LiteralArrayExpr}(_),B=function(e){function LiteralMapExpr(t,i){void 0===i&&(i=null),e.call(this,i),this.entries=t,this.valueType=null,r.i(n.a)(i)&&(this.valueType=i.valueType)}return o(LiteralMapExpr,e),LiteralMapExpr.prototype.visitExpression=function(e,t){return e.visitLiteralMapExpr(this,t)},LiteralMapExpr}(_),U=new w(g.This),W=new w(g.Super),H=(new w(g.CatchError),new w(g.CatchStack),new O(null,null));!function(e){e[e.Final=0]="Final",e[e.Private=1]="Private"}(A||(A={}));var G=function(){function Statement(e){void 0===e&&(e=null),this.modifiers=e,e||(this.modifiers=[])}return Statement.prototype.hasModifier=function(e){return this.modifiers.indexOf(e)!==-1},Statement}(),z=function(e){function DeclareVarStmt(t,r,n,i){void 0===n&&(n=null),void 0===i&&(i=null),e.call(this,i),this.name=t,this.value=r,this.type=n||r.type}return o(DeclareVarStmt,e),DeclareVarStmt.prototype.visitStatement=function(e,t){return e.visitDeclareVarStmt(this,t)},DeclareVarStmt}(G),q=function(e){function DeclareFunctionStmt(t,r,n,i,o){void 0===i&&(i=null),void 0===o&&(o=null),e.call(this,o),this.name=t,this.params=r,this.statements=n,this.type=i}return o(DeclareFunctionStmt,e),DeclareFunctionStmt.prototype.visitStatement=function(e,t){return e.visitDeclareFunctionStmt(this,t)},DeclareFunctionStmt}(G),K=function(e){function ExpressionStatement(t){e.call(this),this.expr=t}return o(ExpressionStatement,e),ExpressionStatement.prototype.visitStatement=function(e,t){return e.visitExpressionStmt(this,t)},ExpressionStatement}(G),Q=function(e){function ReturnStatement(t){e.call(this),this.value=t}return o(ReturnStatement,e),ReturnStatement.prototype.visitStatement=function(e,t){return e.visitReturnStmt(this,t)},ReturnStatement}(G),J=function(){function AbstractClassPart(e,t){void 0===e&&(e=null),this.type=e,this.modifiers=t,t||(this.modifiers=[])}return AbstractClassPart.prototype.hasModifier=function(e){return this.modifiers.indexOf(e)!==-1},AbstractClassPart}(),X=function(e){function ClassField(t,r,n){void 0===r&&(r=null),void 0===n&&(n=null),e.call(this,r,n),this.name=t}return o(ClassField,e),ClassField}(J),Z=function(e){function ClassMethod(t,r,n,i,o){void 0===i&&(i=null),void 0===o&&(o=null),e.call(this,i,o),this.name=t,this.params=r,this.body=n}return o(ClassMethod,e),ClassMethod}(J),$=function(e){function ClassGetter(t,r,n,i){void 0===n&&(n=null),void 0===i&&(i=null),e.call(this,n,i),this.name=t,this.body=r}return o(ClassGetter,e),ClassGetter}(J),Y=function(e){function ClassStmt(t,r,n,i,o,a,s){void 0===s&&(s=null),e.call(this,s),this.name=t,this.parent=r,this.fields=n,this.getters=i,this.constructorMethod=o,this.methods=a}return o(ClassStmt,e),ClassStmt.prototype.visitStatement=function(e,t){return e.visitDeclareClassStmt(this,t)},ClassStmt}(G),ee=function(e){function IfStmt(t,r,n){void 0===n&&(n=[]),e.call(this),this.condition=t,this.trueCase=r,this.falseCase=n}return o(IfStmt,e),IfStmt.prototype.visitStatement=function(e,t){return e.visitIfStmt(this,t)},IfStmt}(G),te=(function(e){function CommentStmt(t){e.call(this),this.comment=t}return o(CommentStmt,e),CommentStmt.prototype.visitStatement=function(e,t){return e.visitCommentStmt(this,t)},CommentStmt}(G),function(e){function TryCatchStmt(t,r){e.call(this),this.bodyStmts=t,this.catchStmts=r}return o(TryCatchStmt,e),TryCatchStmt.prototype.visitStatement=function(e,t){return e.visitTryCatchStmt(this,t)},TryCatchStmt}(G)),re=function(e){function ThrowStmt(t){e.call(this),this.error=t}return o(ThrowStmt,e),ThrowStmt.prototype.visitStatement=function(e,t){return e.visitThrowStmt(this,t)},ThrowStmt}(G),ne=function(){function ExpressionTransformer(){}return ExpressionTransformer.prototype.visitReadVarExpr=function(e,t){return e},ExpressionTransformer.prototype.visitWriteVarExpr=function(e,t){return new C(e.name,e.value.visitExpression(this,t))},ExpressionTransformer.prototype.visitWriteKeyExpr=function(e,t){return new E(e.receiver.visitExpression(this,t),e.index.visitExpression(this,t),e.value.visitExpression(this,t))},ExpressionTransformer.prototype.visitWritePropExpr=function(e,t){return new S(e.receiver.visitExpression(this,t),e.name,e.value.visitExpression(this,t))},ExpressionTransformer.prototype.visitInvokeMethodExpr=function(e,t){var r=e.builtin||e.name;return new P(e.receiver.visitExpression(this,t),r,this.visitAllExpressions(e.args,t),e.type)},ExpressionTransformer.prototype.visitInvokeFunctionExpr=function(e,t){return new x(e.fn.visitExpression(this,t),this.visitAllExpressions(e.args,t),e.type)},ExpressionTransformer.prototype.visitInstantiateExpr=function(e,t){return new T(e.classExpr.visitExpression(this,t),this.visitAllExpressions(e.args,t),e.type)},ExpressionTransformer.prototype.visitLiteralExpr=function(e,t){return e},ExpressionTransformer.prototype.visitExternalExpr=function(e,t){return e},ExpressionTransformer.prototype.visitConditionalExpr=function(e,t){return new M(e.condition.visitExpression(this,t),e.trueCase.visitExpression(this,t),e.falseCase.visitExpression(this,t))},ExpressionTransformer.prototype.visitNotExpr=function(e,t){return new N(e.condition.visitExpression(this,t))},ExpressionTransformer.prototype.visitCastExpr=function(e,t){return new I(e.value.visitExpression(this,t),t)},ExpressionTransformer.prototype.visitFunctionExpr=function(e,t){return e},ExpressionTransformer.prototype.visitBinaryOperatorExpr=function(e,t){return new V(e.operator,e.lhs.visitExpression(this,t),e.rhs.visitExpression(this,t),e.type)},ExpressionTransformer.prototype.visitReadPropExpr=function(e,t){return new L(e.receiver.visitExpression(this,t),e.name,e.type)},ExpressionTransformer.prototype.visitReadKeyExpr=function(e,t){return new j(e.receiver.visitExpression(this,t),e.index.visitExpression(this,t),e.type)},ExpressionTransformer.prototype.visitLiteralArrayExpr=function(e,t){return new F(this.visitAllExpressions(e.entries,t))},ExpressionTransformer.prototype.visitLiteralMapExpr=function(e,t){var r=this,n=e.entries.map(function(e){return[e[0],e[1].visitExpression(r,t)]});return new B(n)},ExpressionTransformer.prototype.visitAllExpressions=function(e,t){var r=this;return e.map(function(e){return e.visitExpression(r,t)})},ExpressionTransformer.prototype.visitDeclareVarStmt=function(e,t){return new z(e.name,e.value.visitExpression(this,t),e.type,e.modifiers)},ExpressionTransformer.prototype.visitDeclareFunctionStmt=function(e,t){return e},ExpressionTransformer.prototype.visitExpressionStmt=function(e,t){return new K(e.expr.visitExpression(this,t))},ExpressionTransformer.prototype.visitReturnStmt=function(e,t){return new Q(e.value.visitExpression(this,t))},ExpressionTransformer.prototype.visitDeclareClassStmt=function(e,t){return e},ExpressionTransformer.prototype.visitIfStmt=function(e,t){return new ee(e.condition.visitExpression(this,t),this.visitAllStatements(e.trueCase,t),this.visitAllStatements(e.falseCase,t))},ExpressionTransformer.prototype.visitTryCatchStmt=function(e,t){return new te(this.visitAllStatements(e.bodyStmts,t),this.visitAllStatements(e.catchStmts,t))},ExpressionTransformer.prototype.visitThrowStmt=function(e,t){return new re(e.error.visitExpression(this,t))},ExpressionTransformer.prototype.visitCommentStmt=function(e,t){return e},ExpressionTransformer.prototype.visitAllStatements=function(e,t){var r=this;return e.map(function(e){return e.visitStatement(r,t)})},ExpressionTransformer}(),ie=function(){function RecursiveExpressionVisitor(){}return RecursiveExpressionVisitor.prototype.visitReadVarExpr=function(e,t){return e},RecursiveExpressionVisitor.prototype.visitWriteVarExpr=function(e,t){return e.value.visitExpression(this,t),e},RecursiveExpressionVisitor.prototype.visitWriteKeyExpr=function(e,t){return e.receiver.visitExpression(this,t),e.index.visitExpression(this,t),e.value.visitExpression(this,t),e},RecursiveExpressionVisitor.prototype.visitWritePropExpr=function(e,t){return e.receiver.visitExpression(this,t),e.value.visitExpression(this,t),e},RecursiveExpressionVisitor.prototype.visitInvokeMethodExpr=function(e,t){return e.receiver.visitExpression(this,t),this.visitAllExpressions(e.args,t),e},RecursiveExpressionVisitor.prototype.visitInvokeFunctionExpr=function(e,t){return e.fn.visitExpression(this,t),this.visitAllExpressions(e.args,t),e},RecursiveExpressionVisitor.prototype.visitInstantiateExpr=function(e,t){return e.classExpr.visitExpression(this,t),this.visitAllExpressions(e.args,t),e},RecursiveExpressionVisitor.prototype.visitLiteralExpr=function(e,t){return e},RecursiveExpressionVisitor.prototype.visitExternalExpr=function(e,t){return e},RecursiveExpressionVisitor.prototype.visitConditionalExpr=function(e,t){return e.condition.visitExpression(this,t),e.trueCase.visitExpression(this,t),e.falseCase.visitExpression(this,t),e},RecursiveExpressionVisitor.prototype.visitNotExpr=function(e,t){return e.condition.visitExpression(this,t),e},RecursiveExpressionVisitor.prototype.visitCastExpr=function(e,t){return e.value.visitExpression(this,t),e},RecursiveExpressionVisitor.prototype.visitFunctionExpr=function(e,t){return e},RecursiveExpressionVisitor.prototype.visitBinaryOperatorExpr=function(e,t){return e.lhs.visitExpression(this,t),e.rhs.visitExpression(this,t),e},RecursiveExpressionVisitor.prototype.visitReadPropExpr=function(e,t){return e.receiver.visitExpression(this,t),e},RecursiveExpressionVisitor.prototype.visitReadKeyExpr=function(e,t){return e.receiver.visitExpression(this,t),e.index.visitExpression(this,t),e},RecursiveExpressionVisitor.prototype.visitLiteralArrayExpr=function(e,t){return this.visitAllExpressions(e.entries,t),e},RecursiveExpressionVisitor.prototype.visitLiteralMapExpr=function(e,t){ var r=this;return e.entries.forEach(function(e){return e[1].visitExpression(r,t)}),e},RecursiveExpressionVisitor.prototype.visitAllExpressions=function(e,t){var r=this;e.forEach(function(e){return e.visitExpression(r,t)})},RecursiveExpressionVisitor.prototype.visitDeclareVarStmt=function(e,t){return e.value.visitExpression(this,t),e},RecursiveExpressionVisitor.prototype.visitDeclareFunctionStmt=function(e,t){return e},RecursiveExpressionVisitor.prototype.visitExpressionStmt=function(e,t){return e.expr.visitExpression(this,t),e},RecursiveExpressionVisitor.prototype.visitReturnStmt=function(e,t){return e.value.visitExpression(this,t),e},RecursiveExpressionVisitor.prototype.visitDeclareClassStmt=function(e,t){return e},RecursiveExpressionVisitor.prototype.visitIfStmt=function(e,t){return e.condition.visitExpression(this,t),this.visitAllStatements(e.trueCase,t),this.visitAllStatements(e.falseCase,t),e},RecursiveExpressionVisitor.prototype.visitTryCatchStmt=function(e,t){return this.visitAllStatements(e.bodyStmts,t),this.visitAllStatements(e.catchStmts,t),e},RecursiveExpressionVisitor.prototype.visitThrowStmt=function(e,t){return e.error.visitExpression(this,t),e},RecursiveExpressionVisitor.prototype.visitCommentStmt=function(e,t){return e},RecursiveExpressionVisitor.prototype.visitAllStatements=function(e,t){var r=this;e.forEach(function(e){return e.visitStatement(r,t)})},RecursiveExpressionVisitor}(),oe=function(e){function _ReplaceVariableTransformer(t,r){e.call(this),this._varName=t,this._newValue=r}return o(_ReplaceVariableTransformer,e),_ReplaceVariableTransformer.prototype.visitReadVarExpr=function(e,t){return e.name==this._varName?this._newValue:e},_ReplaceVariableTransformer}(ne),ae=function(e){function _VariableFinder(){e.apply(this,arguments),this.varNames=new Set}return o(_VariableFinder,e),_VariableFinder.prototype.visitReadVarExpr=function(e,t){return this.varNames.add(e.name),null},_VariableFinder}(ie)},,,,,function(e,t,r){"use strict";function resolveIdentifier(e){return new i.a({name:e.name,moduleUrl:e.moduleUrl,reference:o.A.resolveIdentifier(e.name,e.moduleUrl,e.runtime)})}function identifierToken(e){return new i.b({identifier:e})}function resolveIdentifierToken(e){return identifierToken(resolveIdentifier(e))}function resolveEnumIdentifier(e,t){var r=o.A.resolveEnum(e.reference,t);return new i.a({name:e.name+"."+t,moduleUrl:e.moduleUrl,reference:r})}var n=r(0),i=r(17),o=r(14),a=r(23);r.d(t,"b",function(){return p}),t.d=resolveIdentifier,t.c=identifierToken,t.a=resolveIdentifierToken,t.e=resolveEnumIdentifier;var s=r.i(a.c)("core","linker/view"),u=r.i(a.c)("core","linker/view_utils"),c=r.i(a.c)("core","change_detection/change_detection"),l=r.i(a.c)("core","animation/animation_style_util"),p=function(){function Identifiers(){}return Identifiers.ANALYZE_FOR_ENTRY_COMPONENTS={name:"ANALYZE_FOR_ENTRY_COMPONENTS",moduleUrl:r.i(a.c)("core","metadata/di"),runtime:n.ANALYZE_FOR_ENTRY_COMPONENTS},Identifiers.ViewUtils={name:"ViewUtils",moduleUrl:r.i(a.c)("core","linker/view_utils"),runtime:o.a.ViewUtils},Identifiers.AppView={name:"AppView",moduleUrl:s,runtime:o.b},Identifiers.DebugAppView={name:"DebugAppView",moduleUrl:s,runtime:o.c},Identifiers.AppElement={name:"AppElement",moduleUrl:r.i(a.c)("core","linker/element"),runtime:o.d},Identifiers.ElementRef={name:"ElementRef",moduleUrl:r.i(a.c)("core","linker/element_ref"),runtime:n.ElementRef},Identifiers.ViewContainerRef={name:"ViewContainerRef",moduleUrl:r.i(a.c)("core","linker/view_container_ref"),runtime:n.ViewContainerRef},Identifiers.ChangeDetectorRef={name:"ChangeDetectorRef",moduleUrl:r.i(a.c)("core","change_detection/change_detector_ref"),runtime:n.ChangeDetectorRef},Identifiers.RenderComponentType={name:"RenderComponentType",moduleUrl:r.i(a.c)("core","render/api"),runtime:n.RenderComponentType},Identifiers.QueryList={name:"QueryList",moduleUrl:r.i(a.c)("core","linker/query_list"),runtime:n.QueryList},Identifiers.TemplateRef={name:"TemplateRef",moduleUrl:r.i(a.c)("core","linker/template_ref"),runtime:n.TemplateRef},Identifiers.TemplateRef_={name:"TemplateRef_",moduleUrl:r.i(a.c)("core","linker/template_ref"),runtime:o.e},Identifiers.CodegenComponentFactoryResolver={name:"CodegenComponentFactoryResolver",moduleUrl:r.i(a.c)("core","linker/component_factory_resolver"),runtime:o.f},Identifiers.ComponentFactoryResolver={name:"ComponentFactoryResolver",moduleUrl:r.i(a.c)("core","linker/component_factory_resolver"),runtime:n.ComponentFactoryResolver},Identifiers.ComponentFactory={name:"ComponentFactory",runtime:n.ComponentFactory,moduleUrl:r.i(a.c)("core","linker/component_factory")},Identifiers.NgModuleFactory={name:"NgModuleFactory",runtime:n.NgModuleFactory,moduleUrl:r.i(a.c)("core","linker/ng_module_factory")},Identifiers.NgModuleInjector={name:"NgModuleInjector",runtime:o.g,moduleUrl:r.i(a.c)("core","linker/ng_module_factory")},Identifiers.RegisterModuleFactoryFn={name:"registerModuleFactory",runtime:o.h,moduleUrl:r.i(a.c)("core","linker/ng_module_factory_loader")},Identifiers.ValueUnwrapper={name:"ValueUnwrapper",moduleUrl:c,runtime:o.i},Identifiers.Injector={name:"Injector",moduleUrl:r.i(a.c)("core","di/injector"),runtime:n.Injector},Identifiers.ViewEncapsulation={name:"ViewEncapsulation",moduleUrl:r.i(a.c)("core","metadata/view"),runtime:n.ViewEncapsulation},Identifiers.ViewType={name:"ViewType",moduleUrl:r.i(a.c)("core","linker/view_type"),runtime:o.j},Identifiers.ChangeDetectionStrategy={name:"ChangeDetectionStrategy",moduleUrl:c,runtime:n.ChangeDetectionStrategy},Identifiers.StaticNodeDebugInfo={name:"StaticNodeDebugInfo",moduleUrl:r.i(a.c)("core","linker/debug_context"),runtime:o.k},Identifiers.DebugContext={name:"DebugContext",moduleUrl:r.i(a.c)("core","linker/debug_context"),runtime:o.l},Identifiers.Renderer={name:"Renderer",moduleUrl:r.i(a.c)("core","render/api"),runtime:n.Renderer},Identifiers.SimpleChange={name:"SimpleChange",moduleUrl:c,runtime:n.SimpleChange},Identifiers.UNINITIALIZED={name:"UNINITIALIZED",moduleUrl:c,runtime:o.m},Identifiers.ChangeDetectorStatus={name:"ChangeDetectorStatus",moduleUrl:c,runtime:o.n},Identifiers.checkBinding={name:"checkBinding",moduleUrl:u,runtime:o.a.checkBinding},Identifiers.flattenNestedViewRenderNodes={name:"flattenNestedViewRenderNodes",moduleUrl:u,runtime:o.a.flattenNestedViewRenderNodes},Identifiers.devModeEqual={name:"devModeEqual",moduleUrl:c,runtime:o.o},Identifiers.interpolate={name:"interpolate",moduleUrl:u,runtime:o.a.interpolate},Identifiers.castByValue={name:"castByValue",moduleUrl:u,runtime:o.a.castByValue},Identifiers.EMPTY_ARRAY={name:"EMPTY_ARRAY",moduleUrl:u,runtime:o.a.EMPTY_ARRAY},Identifiers.EMPTY_MAP={name:"EMPTY_MAP",moduleUrl:u,runtime:o.a.EMPTY_MAP},Identifiers.pureProxies=[null,{name:"pureProxy1",moduleUrl:u,runtime:o.a.pureProxy1},{name:"pureProxy2",moduleUrl:u,runtime:o.a.pureProxy2},{name:"pureProxy3",moduleUrl:u,runtime:o.a.pureProxy3},{name:"pureProxy4",moduleUrl:u,runtime:o.a.pureProxy4},{name:"pureProxy5",moduleUrl:u,runtime:o.a.pureProxy5},{name:"pureProxy6",moduleUrl:u,runtime:o.a.pureProxy6},{name:"pureProxy7",moduleUrl:u,runtime:o.a.pureProxy7},{name:"pureProxy8",moduleUrl:u,runtime:o.a.pureProxy8},{name:"pureProxy9",moduleUrl:u,runtime:o.a.pureProxy9},{name:"pureProxy10",moduleUrl:u,runtime:o.a.pureProxy10}],Identifiers.SecurityContext={name:"SecurityContext",moduleUrl:r.i(a.c)("core","security"),runtime:n.SecurityContext},Identifiers.AnimationKeyframe={name:"AnimationKeyframe",moduleUrl:r.i(a.c)("core","animation/animation_keyframe"),runtime:o.p},Identifiers.AnimationStyles={name:"AnimationStyles",moduleUrl:r.i(a.c)("core","animation/animation_styles"),runtime:o.q},Identifiers.NoOpAnimationPlayer={name:"NoOpAnimationPlayer",moduleUrl:r.i(a.c)("core","animation/animation_player"),runtime:o.r},Identifiers.AnimationGroupPlayer={name:"AnimationGroupPlayer",moduleUrl:r.i(a.c)("core","animation/animation_group_player"),runtime:o.s},Identifiers.AnimationSequencePlayer={name:"AnimationSequencePlayer",moduleUrl:r.i(a.c)("core","animation/animation_sequence_player"),runtime:o.t},Identifiers.prepareFinalAnimationStyles={name:"prepareFinalAnimationStyles",moduleUrl:l,runtime:o.u},Identifiers.balanceAnimationKeyframes={name:"balanceAnimationKeyframes",moduleUrl:l,runtime:o.v},Identifiers.clearStyles={name:"clearStyles",moduleUrl:l,runtime:o.w},Identifiers.renderStyles={name:"renderStyles",moduleUrl:l,runtime:o.x},Identifiers.collectAndResolveStyles={name:"collectAndResolveStyles",moduleUrl:l,runtime:o.y},Identifiers.LOCALE_ID={name:"LOCALE_ID",moduleUrl:r.i(a.c)("core","i18n/tokens"),runtime:n.LOCALE_ID},Identifiers.TRANSLATIONS_FORMAT={name:"TRANSLATIONS_FORMAT",moduleUrl:r.i(a.c)("core","i18n/tokens"),runtime:n.TRANSLATIONS_FORMAT},Identifiers.setBindingDebugInfo={name:"setBindingDebugInfo",moduleUrl:u,runtime:o.a.setBindingDebugInfo},Identifiers.setBindingDebugInfoForChanges={name:"setBindingDebugInfoForChanges",moduleUrl:u,runtime:o.a.setBindingDebugInfoForChanges},Identifiers.AnimationTransition={name:"AnimationTransition",moduleUrl:r.i(a.c)("core","animation/animation_transition"),runtime:o.z},Identifiers}()},function(e,t,r){"use strict";var n=r(0);r.d(t,"H",function(){return i}),r.d(t,"n",function(){return o}),r.d(t,"G",function(){return a}),r.d(t,"J",function(){return s}),r.d(t,"I",function(){return u}),r.d(t,"d",function(){return c}),r.d(t,"f",function(){return l}),r.d(t,"b",function(){return p}),r.d(t,"c",function(){return f}),r.d(t,"g",function(){return h}),r.d(t,"h",function(){return d}),r.d(t,"j",function(){return m}),r.d(t,"a",function(){return v}),r.d(t,"l",function(){return y}),r.d(t,"k",function(){return g}),r.d(t,"o",function(){return _}),r.d(t,"m",function(){return b}),r.d(t,"i",function(){return w}),r.d(t,"e",function(){return C}),r.d(t,"B",function(){return E}),r.d(t,"A",function(){return S}),r.d(t,"L",function(){return A}),r.d(t,"M",function(){return P}),r.d(t,"r",function(){return x}),r.d(t,"t",function(){return T}),r.d(t,"s",function(){return O}),r.d(t,"p",function(){return R}),r.d(t,"q",function(){return M}),r.d(t,"C",function(){return N}),r.d(t,"D",function(){return I}),r.d(t,"E",function(){return D}),r.d(t,"F",function(){return k}),r.d(t,"u",function(){return V}),r.d(t,"v",function(){return L}),r.d(t,"w",function(){return j}),r.d(t,"y",function(){return F}),r.d(t,"x",function(){return B}),r.d(t,"K",function(){return U}),r.d(t,"z",function(){return W});var i=n.__core_private__.isDefaultChangeDetectionStrategy,o=n.__core_private__.ChangeDetectorStatus,a=n.__core_private__.LifecycleHooks,s=n.__core_private__.LIFECYCLE_HOOKS_VALUES,u=n.__core_private__.ReflectorReader,c=n.__core_private__.AppElement,l=n.__core_private__.CodegenComponentFactoryResolver,p=n.__core_private__.AppView,f=n.__core_private__.DebugAppView,h=n.__core_private__.NgModuleInjector,d=n.__core_private__.registerModuleFactory,m=n.__core_private__.ViewType,v=n.__core_private__.view_utils,y=n.__core_private__.DebugContext,g=n.__core_private__.StaticNodeDebugInfo,_=n.__core_private__.devModeEqual,b=n.__core_private__.UNINITIALIZED,w=n.__core_private__.ValueUnwrapper,C=n.__core_private__.TemplateRef_,E=(n.__core_private__.RenderDebugInfo,n.__core_private__.Console),S=n.__core_private__.reflector,A=n.__core_private__.Reflector,P=n.__core_private__.ReflectionCapabilities,x=n.__core_private__.NoOpAnimationPlayer,T=(n.__core_private__.AnimationPlayer,n.__core_private__.AnimationSequencePlayer),O=n.__core_private__.AnimationGroupPlayer,R=n.__core_private__.AnimationKeyframe,M=n.__core_private__.AnimationStyles,N=n.__core_private__.ANY_STATE,I=n.__core_private__.DEFAULT_STATE,D=n.__core_private__.EMPTY_STATE,k=n.__core_private__.FILL_STYLE_FLAG,V=n.__core_private__.prepareFinalAnimationStyles,L=n.__core_private__.balanceAnimationKeyframes,j=n.__core_private__.clearStyles,F=n.__core_private__.collectAndResolveStyles,B=n.__core_private__.renderStyles,U=(n.__core_private__.ViewMetadata,n.__core_private__.ComponentStillLoadingError),W=n.__core_private__.AnimationTransition},function(e,t,r){"use strict";function getDOM(){return n}function setRootDomAdapter(e){n||(n=e)}t.a=getDOM,t.c=setRootDomAdapter,r.d(t,"b",function(){return i});var n=null,i=function(){function DomAdapter(){this.resourceLoaderType=null}return Object.defineProperty(DomAdapter.prototype,"attrToPropMap",{get:function(){return this._attrToPropMap},set:function(e){this._attrToPropMap=e},enumerable:!0,configurable:!0}),DomAdapter}()},,function(e,t,r){"use strict";function unimplemented(){throw new Error("unimplemented")}function createHostComponentMeta(e){var t=a.a.parse(e.selector)[0].getMatchingElementTemplate();return R.create({type:new P({reference:Object,name:e.type.name+"_Host",moduleUrl:e.type.moduleUrl,isHost:!0}),template:new O({encapsulation:n.ViewEncapsulation.None,template:t,templateUrl:"",styles:[],styleUrls:[],ngContentSelectors:[],animations:[]}),changeDetection:n.ChangeDetectionStrategy.Default,inputs:[],outputs:[],host:{},isComponent:!0,selector:"*",providers:[],viewProviders:[],queries:[],viewQueries:[]})}function removeIdentifierDuplicates(e){var t=new Map;return e.forEach(function(e){t.get(e.identifier.reference)||t.set(e.identifier.reference,e)}),i.b.values(t)}function _normalizeArray(e){return e||[]}function isStaticSymbol(e){return"object"==typeof e&&null!==e&&e.name&&e.filePath}var n=r(0),i=r(18),o=r(2),a=r(174),s=r(23);r.d(t,"r",function(){return l}),r.d(t,"g",function(){return f}),r.d(t,"s",function(){return h}),r.d(t,"m",function(){return m}),r.d(t,"k",function(){return v}),r.d(t,"l",function(){return y}),r.d(t,"j",function(){return g}),r.d(t,"h",function(){return _}),r.d(t,"i",function(){return b}),r.d(t,"a",function(){return w}),r.d(t,"c",function(){return C}),r.d(t,"d",function(){return E}),r.d(t,"v",function(){return S}),r.d(t,"b",function(){return A}),r.d(t,"e",function(){return P}),r.d(t,"y",function(){return x}),r.d(t,"o",function(){return T}),r.d(t,"p",function(){return O}),r.d(t,"q",function(){return R}),t.n=createHostComponentMeta,r.d(t,"w",function(){return M}),r.d(t,"t",function(){return N}),r.d(t,"u",function(){return I}),t.f=removeIdentifierDuplicates,t.z=isStaticSymbol,r.d(t,"x",function(){return D});var u=this&&this.__extends||function(e,t){function __(){this.constructor=e}for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r]);e.prototype=null===t?Object.create(t):(__.prototype=t.prototype,new __)},c=/^(?:(?:\[([^\]]+)\])|(?:\(([^\)]+)\)))|(\@[-\w]+)$/,l=(new Object,function(){function CompileMetadataWithIdentifier(){}return Object.defineProperty(CompileMetadataWithIdentifier.prototype,"identifier",{get:function(){return unimplemented()},enumerable:!0,configurable:!0}),CompileMetadataWithIdentifier}(),function(){function CompileAnimationEntryMetadata(e,t){void 0===e&&(e=null),void 0===t&&(t=null),this.name=e,this.definitions=t}return CompileAnimationEntryMetadata}()),p=function(){function CompileAnimationStateMetadata(){}return CompileAnimationStateMetadata}(),f=function(e){function CompileAnimationStateDeclarationMetadata(t,r){e.call(this),this.stateNameExpr=t,this.styles=r}return u(CompileAnimationStateDeclarationMetadata,e),CompileAnimationStateDeclarationMetadata}(p),h=function(e){function CompileAnimationStateTransitionMetadata(t,r){e.call(this),this.stateChangeExpr=t,this.steps=r}return u(CompileAnimationStateTransitionMetadata,e),CompileAnimationStateTransitionMetadata}(p),d=function(){function CompileAnimationMetadata(){}return CompileAnimationMetadata}(),m=function(e){function CompileAnimationKeyframesSequenceMetadata(t){void 0===t&&(t=[]),e.call(this),this.steps=t}return u(CompileAnimationKeyframesSequenceMetadata,e),CompileAnimationKeyframesSequenceMetadata}(d),v=function(e){function CompileAnimationStyleMetadata(t,r){void 0===r&&(r=null),e.call(this),this.offset=t,this.styles=r}return u(CompileAnimationStyleMetadata,e),CompileAnimationStyleMetadata}(d),y=function(e){function CompileAnimationAnimateMetadata(t,r){void 0===t&&(t=0),void 0===r&&(r=null),e.call(this),this.timings=t,this.styles=r}return u(CompileAnimationAnimateMetadata,e),CompileAnimationAnimateMetadata}(d),g=function(e){function CompileAnimationWithStepsMetadata(t){void 0===t&&(t=null),e.call(this),this.steps=t}return u(CompileAnimationWithStepsMetadata,e),CompileAnimationWithStepsMetadata}(d),_=function(e){function CompileAnimationSequenceMetadata(t){void 0===t&&(t=null),e.call(this,t)}return u(CompileAnimationSequenceMetadata,e),CompileAnimationSequenceMetadata}(g),b=function(e){function CompileAnimationGroupMetadata(t){void 0===t&&(t=null),e.call(this,t)}return u(CompileAnimationGroupMetadata,e),CompileAnimationGroupMetadata}(g),w=function(){function CompileIdentifierMetadata(e){var t=void 0===e?{}:e,r=t.reference,n=t.name,i=t.moduleUrl,o=t.prefix,a=t.value;this.reference=r,this.name=n,this.prefix=o,this.moduleUrl=i,this.value=a}return Object.defineProperty(CompileIdentifierMetadata.prototype,"identifier",{get:function(){return this},enumerable:!0,configurable:!0}),CompileIdentifierMetadata}(),C=function(){function CompileDiDependencyMetadata(e){var t=void 0===e?{}:e,n=t.isAttribute,i=t.isSelf,a=t.isHost,s=t.isSkipSelf,u=t.isOptional,c=t.isValue,l=t.query,p=t.viewQuery,f=t.token,h=t.value;this.isAttribute=r.i(o.g)(n),this.isSelf=r.i(o.g)(i),this.isHost=r.i(o.g)(a),this.isSkipSelf=r.i(o.g)(s),this.isOptional=r.i(o.g)(u),this.isValue=r.i(o.g)(c),this.query=l,this.viewQuery=p,this.token=f,this.value=h}return CompileDiDependencyMetadata}(),E=function(){function CompileProviderMetadata(e){var t=e.token,n=e.useClass,i=e.useValue,a=e.useExisting,s=e.useFactory,u=e.deps,c=e.multi;this.token=t,this.useClass=n,this.useValue=i,this.useExisting=a,this.useFactory=s,this.deps=r.i(o.h)(u),this.multi=r.i(o.g)(c)}return CompileProviderMetadata}(),S=function(e){function CompileFactoryMetadata(t){var r=t.reference,n=t.name,i=t.moduleUrl,o=t.prefix,a=t.diDeps,s=t.value;e.call(this,{reference:r,name:n,prefix:o,moduleUrl:i,value:s}),this.diDeps=_normalizeArray(a)}return u(CompileFactoryMetadata,e),CompileFactoryMetadata}(w),A=function(){function CompileTokenMetadata(e){var t=e.value,n=e.identifier,i=e.identifierIsInstance;this.value=t,this.identifier=n,this.identifierIsInstance=r.i(o.g)(i)}return Object.defineProperty(CompileTokenMetadata.prototype,"reference",{get:function(){return r.i(o.a)(this.identifier)?this.identifier.reference:this.value},enumerable:!0,configurable:!0}),Object.defineProperty(CompileTokenMetadata.prototype,"name",{get:function(){return r.i(o.a)(this.value)?r.i(s.a)(this.value):this.identifier.name},enumerable:!0,configurable:!0}),CompileTokenMetadata}(),P=function(e){function CompileTypeMetadata(t){var n=void 0===t?{}:t,i=n.reference,a=n.name,s=n.moduleUrl,u=n.prefix,c=n.isHost,l=n.value,p=n.diDeps,f=n.lifecycleHooks;e.call(this,{reference:i,name:a,moduleUrl:s,prefix:u,value:l}),this.isHost=r.i(o.g)(c),this.diDeps=_normalizeArray(p),this.lifecycleHooks=_normalizeArray(f)}return u(CompileTypeMetadata,e),CompileTypeMetadata}(w),x=function(){function CompileQueryMetadata(e){var t=void 0===e?{}:e,n=t.selectors,i=t.descendants,a=t.first,s=t.propertyName,u=t.read;this.selectors=n,this.descendants=r.i(o.g)(i),this.first=r.i(o.g)(a),this.propertyName=s,this.read=u}return CompileQueryMetadata}(),T=function(){function CompileStylesheetMetadata(e){var t=void 0===e?{}:e,r=t.moduleUrl,n=t.styles,i=t.styleUrls;this.moduleUrl=r,this.styles=_normalizeArray(n),this.styleUrls=_normalizeArray(i)}return CompileStylesheetMetadata}(),O=function(){function CompileTemplateMetadata(e){var t=void 0===e?{}:e,n=t.encapsulation,a=t.template,s=t.templateUrl,u=t.styles,c=t.styleUrls,l=t.externalStylesheets,p=t.animations,f=t.ngContentSelectors,h=t.interpolation;if(this.encapsulation=n,this.template=a,this.templateUrl=s,this.styles=_normalizeArray(u),this.styleUrls=_normalizeArray(c),this.externalStylesheets=_normalizeArray(l),this.animations=r.i(o.a)(p)?i.a.flatten(p):[],this.ngContentSelectors=f||[],r.i(o.a)(h)&&2!=h.length)throw new Error("'interpolation' should have a start and an end symbol.");this.interpolation=h}return CompileTemplateMetadata}(),R=function(){function CompileDirectiveMetadata(e){var t=void 0===e?{}:e,r=t.type,n=t.isComponent,i=t.selector,o=t.exportAs,a=t.changeDetection,s=t.inputs,u=t.outputs,c=t.hostListeners,l=t.hostProperties,p=t.hostAttributes,f=t.providers,h=t.viewProviders,d=t.queries,m=t.viewQueries,v=t.entryComponents,y=t.template;this.type=r,this.isComponent=n,this.selector=i,this.exportAs=o,this.changeDetection=a,this.inputs=s,this.outputs=u,this.hostListeners=c,this.hostProperties=l,this.hostAttributes=p,this.providers=_normalizeArray(f),this.viewProviders=_normalizeArray(h),this.queries=_normalizeArray(d),this.viewQueries=_normalizeArray(m),this.entryComponents=_normalizeArray(v),this.template=y}return CompileDirectiveMetadata.create=function(e){var t=void 0===e?{}:e,n=t.type,i=t.isComponent,a=t.selector,u=t.exportAs,l=t.changeDetection,p=t.inputs,f=t.outputs,h=t.host,d=t.providers,m=t.viewProviders,v=t.queries,y=t.viewQueries,g=t.entryComponents,_=t.template,b={},w={},C={};r.i(o.a)(h)&&Object.keys(h).forEach(function(e){var t=h[e],n=e.match(c);null===n?C[e]=t:r.i(o.a)(n[1])?w[n[1]]=t:r.i(o.a)(n[2])&&(b[n[2]]=t)});var E={};r.i(o.a)(p)&&p.forEach(function(e){var t=r.i(s.b)(e,[e,e]);E[t[0]]=t[1]});var S={};return r.i(o.a)(f)&&f.forEach(function(e){var t=r.i(s.b)(e,[e,e]);S[t[0]]=t[1]}),new CompileDirectiveMetadata({type:n,isComponent:r.i(o.g)(i),selector:a,exportAs:u,changeDetection:l,inputs:E,outputs:S,hostListeners:b,hostProperties:w,hostAttributes:C,providers:d,viewProviders:m,queries:v,viewQueries:y,entryComponents:g,template:_})},Object.defineProperty(CompileDirectiveMetadata.prototype,"identifier",{get:function(){return this.type},enumerable:!0,configurable:!0}),CompileDirectiveMetadata}(),M=function(){function CompilePipeMetadata(e){var t=void 0===e?{}:e,n=t.type,i=t.name,a=t.pure;this.type=n,this.name=i,this.pure=r.i(o.g)(a)}return Object.defineProperty(CompilePipeMetadata.prototype,"identifier",{get:function(){return this.type},enumerable:!0,configurable:!0}),CompilePipeMetadata}(),N=function(){function CompileNgModuleMetadata(e){var t=void 0===e?{}:e,r=t.type,n=t.providers,i=t.declaredDirectives,o=t.exportedDirectives,a=t.declaredPipes,s=t.exportedPipes,u=t.entryComponents,c=t.bootstrapComponents,l=t.importedModules,p=t.exportedModules,f=t.schemas,h=t.transitiveModule,d=t.id;this.type=r,this.declaredDirectives=_normalizeArray(i),this.exportedDirectives=_normalizeArray(o),this.declaredPipes=_normalizeArray(a),this.exportedPipes=_normalizeArray(s),this.providers=_normalizeArray(n),this.entryComponents=_normalizeArray(u),this.bootstrapComponents=_normalizeArray(c),this.importedModules=_normalizeArray(l),this.exportedModules=_normalizeArray(p),this.schemas=_normalizeArray(f),this.id=d,this.transitiveModule=h}return Object.defineProperty(CompileNgModuleMetadata.prototype,"identifier",{get:function(){return this.type},enumerable:!0,configurable:!0}),CompileNgModuleMetadata}(),I=function(){function TransitiveCompileNgModuleMetadata(e,t,r,n,i){var o=this;this.modules=e,this.providers=t,this.entryComponents=r,this.directives=n,this.pipes=i,this.directivesSet=new Set,this.pipesSet=new Set,n.forEach(function(e){return o.directivesSet.add(e.type.reference)}),i.forEach(function(e){return o.pipesSet.add(e.type.reference)})}return TransitiveCompileNgModuleMetadata}(),D=function(){function ProviderMeta(e,t){var r=t.useClass,n=t.useValue,i=t.useExisting,o=t.useFactory,a=t.deps,s=t.multi;this.token=e,this.useClass=r,this.useValue=n,this.useExisting=i,this.useFactory=o,this.dependencies=a,this.multi=!!s}return ProviderMeta}()},function(e,t,r){"use strict";function _flattenArray(e,t){if(r.i(n.a)(e))for(var i=0;i<e.length;i++){var o=e[i];Array.isArray(o)?_flattenArray(o,t):t.push(o)}return t}var n=r(2);r.d(t,"b",function(){return o}),r.d(t,"c",function(){return a}),r.d(t,"a",function(){return s});var i=function(){try{if((new Map).values().next)return function(e,t){return t?Array.from(e.values()):Array.from(e.keys())}}catch(e){}return function(e,t){var r=new Array(e.size),n=0;return e.forEach(function(e,i){r[n]=t?e:i,n++}),r}}(),o=function(){function MapWrapper(){}return MapWrapper.createFromStringMap=function(e){var t=new Map;for(var r in e)t.set(r,e[r]);return t},MapWrapper.keys=function(e){return i(e,!1)},MapWrapper.values=function(e){return i(e,!0)},MapWrapper}(),a=function(){function StringMapWrapper(){}return StringMapWrapper.merge=function(e,t){for(var r={},n=0,i=Object.keys(e);n<i.length;n++){var o=i[n];r[o]=e[o]}for(var a=0,s=Object.keys(t);a<s.length;a++){var o=s[a];r[o]=t[o]}return r},StringMapWrapper.equals=function(e,t){var r=Object.keys(e),n=Object.keys(t);if(r.length!=n.length)return!1;for(var i=0;i<r.length;i++){var o=r[i];if(e[o]!==t[o])return!1}return!0},StringMapWrapper}(),s=function(){function ListWrapper(){}return ListWrapper.createFixedSize=function(e){return new Array(e)},ListWrapper.createGrowableSize=function(e){return new Array(e)},ListWrapper.clone=function(e){return e.slice(0)},ListWrapper.forEachWithIndex=function(e,t){for(var r=0;r<e.length;r++)t(e[r],r)},ListWrapper.first=function(e){return e?e[0]:null},ListWrapper.last=function(e){return e&&0!=e.length?e[e.length-1]:null},ListWrapper.indexOf=function(e,t,r){return void 0===r&&(r=0),e.indexOf(t,r)},ListWrapper.contains=function(e,t){return e.indexOf(t)!==-1},ListWrapper.reversed=function(e){var t=ListWrapper.clone(e);return t.reverse()},ListWrapper.concat=function(e,t){return e.concat(t)},ListWrapper.insert=function(e,t,r){e.splice(t,0,r)},ListWrapper.removeAt=function(e,t){var r=e[t];return e.splice(t,1),r},ListWrapper.removeAll=function(e,t){for(var r=0;r<t.length;++r){var n=e.indexOf(t[r]);e.splice(n,1)}},ListWrapper.remove=function(e,t){var r=e.indexOf(t);return r>-1&&(e.splice(r,1),!0)},ListWrapper.clear=function(e){e.length=0},ListWrapper.isEmpty=function(e){return 0==e.length},ListWrapper.fill=function(e,t,r,n){void 0===r&&(r=0),void 0===n&&(n=null),e.fill(t,r,null===n?e.length:n)},ListWrapper.equals=function(e,t){if(e.length!=t.length)return!1;for(var r=0;r<e.length;++r)if(e[r]!==t[r])return!1;return!0},ListWrapper.slice=function(e,t,r){return void 0===t&&(t=0),void 0===r&&(r=null),e.slice(t,null===r?void 0:r)},ListWrapper.splice=function(e,t,r){return e.splice(t,r)},ListWrapper.sort=function(e,t){r.i(n.a)(t)?e.sort(t):e.sort()},ListWrapper.toString=function(e){return e.toString()},ListWrapper.toJSON=function(e){return JSON.stringify(e)},ListWrapper.maximum=function(e,t){if(0==e.length)return null;for(var i=null,o=-(1/0),a=0;a<e.length;a++){var s=e[a];if(!r.i(n.b)(s)){var u=t(s);u>o&&(i=s,o=u)}}return i},ListWrapper.flatten=function(e){var t=[];return _flattenArray(e,t),t},ListWrapper.addAll=function(e,t){for(var r=0;r<t.length;r++)e.push(t[r])},ListWrapper}()},function(e,t,r){"use strict";function _flattenArray(e,t){if(r.i(n.d)(e))for(var i=0;i<e.length;i++){var o=e[i];Array.isArray(o)?_flattenArray(o,t):t.push(o)}return t}function isListLikeIterable(e){return!!r.i(n.e)(e)&&(Array.isArray(e)||!(e instanceof Map)&&r.i(n.f)()in e)}function areIterablesEqual(e,t,i){for(var o=e[r.i(n.f)()](),a=t[r.i(n.f)()]();;){var s=o.next(),u=a.next();if(s.done&&u.done)return!0;if(s.done||u.done)return!1;if(!i(s.value,u.value))return!1}}function iterateListLike(e,t){if(Array.isArray(e))for(var i=0;i<e.length;i++)t(e[i]);else for(var o=e[r.i(n.f)()](),a=void 0;!(a=o.next()).done;)t(a.value)}var n=r(3);r.d(t,"b",function(){return o}),r.d(t,"f",function(){return a}),r.d(t,"a",function(){return s}),t.c=isListLikeIterable,t.e=areIterablesEqual,t.d=iterateListLike;var i=function(){try{if((new Map).values().next)return function(e,t){return t?Array.from(e.values()):Array.from(e.keys())}}catch(e){}return function(e,t){var r=new Array(e.size),n=0;return e.forEach(function(e,i){r[n]=t?e:i,n++}),r}}(),o=function(){function MapWrapper(){}return MapWrapper.createFromStringMap=function(e){var t=new Map;for(var r in e)t.set(r,e[r]);return t},MapWrapper.keys=function(e){return i(e,!1)},MapWrapper.values=function(e){return i(e,!0)},MapWrapper}(),a=function(){function StringMapWrapper(){}return StringMapWrapper.merge=function(e,t){for(var r={},n=0,i=Object.keys(e);n<i.length;n++){var o=i[n];r[o]=e[o]}for(var a=0,s=Object.keys(t);a<s.length;a++){var o=s[a];r[o]=t[o]}return r},StringMapWrapper.equals=function(e,t){var r=Object.keys(e),n=Object.keys(t);if(r.length!=n.length)return!1;for(var i=0;i<r.length;i++){var o=r[i];if(e[o]!==t[o])return!1}return!0},StringMapWrapper}(),s=function(){function ListWrapper(){}return ListWrapper.createFixedSize=function(e){return new Array(e)},ListWrapper.createGrowableSize=function(e){return new Array(e)},ListWrapper.clone=function(e){return e.slice(0)},ListWrapper.forEachWithIndex=function(e,t){for(var r=0;r<e.length;r++)t(e[r],r)},ListWrapper.first=function(e){return e?e[0]:null},ListWrapper.last=function(e){return e&&0!=e.length?e[e.length-1]:null},ListWrapper.indexOf=function(e,t,r){return void 0===r&&(r=0),e.indexOf(t,r)},ListWrapper.contains=function(e,t){return e.indexOf(t)!==-1},ListWrapper.reversed=function(e){var t=ListWrapper.clone(e);return t.reverse()},ListWrapper.concat=function(e,t){return e.concat(t)},ListWrapper.insert=function(e,t,r){e.splice(t,0,r)},ListWrapper.removeAt=function(e,t){var r=e[t];return e.splice(t,1),r},ListWrapper.removeAll=function(e,t){for(var r=0;r<t.length;++r){var n=e.indexOf(t[r]);e.splice(n,1)}},ListWrapper.remove=function(e,t){var r=e.indexOf(t);return r>-1&&(e.splice(r,1),!0)},ListWrapper.clear=function(e){e.length=0},ListWrapper.isEmpty=function(e){return 0==e.length},ListWrapper.fill=function(e,t,r,n){void 0===r&&(r=0),void 0===n&&(n=null),e.fill(t,r,null===n?e.length:n)},ListWrapper.equals=function(e,t){if(e.length!=t.length)return!1;for(var r=0;r<e.length;++r)if(e[r]!==t[r])return!1;return!0},ListWrapper.slice=function(e,t,r){return void 0===t&&(t=0),void 0===r&&(r=null),e.slice(t,null===r?void 0:r)},ListWrapper.splice=function(e,t,r){return e.splice(t,r)},ListWrapper.sort=function(e,t){r.i(n.d)(t)?e.sort(t):e.sort()},ListWrapper.toString=function(e){return e.toString()},ListWrapper.toJSON=function(e){return JSON.stringify(e)},ListWrapper.maximum=function(e,t){if(0==e.length)return null;for(var i=null,o=-(1/0),a=0;a<e.length;a++){var s=e[a];if(!r.i(n.c)(s)){var u=t(s);u>o&&(i=s,o=u)}}return i},ListWrapper.flatten=function(e){var t=[];return _flattenArray(e,t),t},ListWrapper.addAll=function(e,t){for(var r=0;r<t.length;r++)e.push(t[r])},ListWrapper}()},,,function(e,t,r){"use strict";(function(e){function getTypeNameForDebugging(e){return e.name||typeof e}function isPresent(e){return void 0!==e&&null!==e}function isBlank(e){return void 0===e||null===e}function isDate(e){return e instanceof Date&&!isNaN(e.valueOf())}function stringify(e){if("string"==typeof e)return e;if(void 0===e||null===e)return""+e;if(e.overriddenName)return e.overriddenName;if(e.name)return e.name;var t=e.toString(),r=t.indexOf("\n");return r===-1?t:t.substring(0,r)}function isJsObject(e){return null!==e&&("function"==typeof e||"object"==typeof e)}function getSymbolIterator(){if(isBlank(a))if(isPresent(n.Symbol)&&isPresent(Symbol.iterator))a=Symbol.iterator;else for(var e=Object.getOwnPropertyNames(Map.prototype),t=0;t<e.length;++t){var r=e[t];"entries"!==r&&"size"!==r&&Map.prototype[r]===Map.prototype.entries&&(a=r)}return a}t.e=getTypeNameForDebugging,t.a=isPresent,t.b=isBlank,t.h=isDate,t.f=stringify,r.d(t,"g",function(){return o}),t.c=isJsObject,t.d=getSymbolIterator;var n;n="undefined"==typeof window?"undefined"!=typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope?self:e:window;var i=n;i.assert=function(e){};var o=(Object.getPrototypeOf({}),function(){function NumberWrapper(){}return NumberWrapper.parseIntAutoRadix=function(e){var t=parseInt(e);if(isNaN(t))throw new Error("Invalid integer literal when parsing "+e);return t},NumberWrapper.parseInt=function(e,t){if(10==t){if(/^(\-|\+)?[0-9]+$/.test(e))return parseInt(e,t); }else if(16==t){if(/^(\-|\+)?[0-9ABCDEFabcdef]+$/.test(e))return parseInt(e,t)}else{var r=parseInt(e,t);if(!isNaN(r))return r}throw new Error("Invalid integer literal when parsing "+e+" in base "+t)},NumberWrapper.isNumeric=function(e){return!isNaN(e-parseFloat(e))},NumberWrapper}()),a=null}).call(t,r(28))},function(e,t,r){"use strict";function splitAtColon(e,t){return _splitAt(e,":",t)}function splitAtPeriod(e,t){return _splitAt(e,".",t)}function _splitAt(e,t,r){var n=e.indexOf(t);return n==-1?r:[e.slice(0,n).trim(),e.slice(n+1).trim()]}function sanitizeIdentifier(e){return e.replace(/\W/g,"_")}function visitValue(e,t,i){return Array.isArray(e)?t.visitArray(e,i):r.i(n.e)(e)?t.visitStringMap(e,i):r.i(n.b)(e)||r.i(n.f)(e)?t.visitPrimitive(e,i):t.visitOther(e,i)}function assetUrl(e,t,r){return void 0===t&&(t=null),void 0===r&&(r="src"),null==t?"asset:@angular/lib/"+e+"/index":"asset:@angular/lib/"+e+"/src/"+t}function createDiTokenExpression(e){return r.i(n.a)(e.value)?i.a(e.value):e.identifierIsInstance?i.b(e.identifier).instantiate([],i.c(e.identifier,[],[i.d.Const])):i.b(e.identifier)}var n=r(2),i=r(8);r.d(t,"h",function(){return o}),t.b=splitAtColon,t.d=splitAtPeriod,t.a=sanitizeIdentifier,t.e=visitValue,r.d(t,"i",function(){return a}),t.c=assetUrl,t.f=createDiTokenExpression,r.d(t,"g",function(){return s});var o="",a=function(){function ValueTransformer(){}return ValueTransformer.prototype.visitArray=function(e,t){var r=this;return e.map(function(e){return visitValue(e,r,t)})},ValueTransformer.prototype.visitStringMap=function(e,t){var r=this,n={};return Object.keys(e).forEach(function(i){n[i]=visitValue(e[i],r,t)}),n},ValueTransformer.prototype.visitPrimitive=function(e,t){return e},ValueTransformer.prototype.visitOther=function(e,t){return e},ValueTransformer}(),s=function(){function SyncAsyncResult(e,t){void 0===t&&(t=null),this.syncResult=e,this.asyncResult=t,t||(this.asyncResult=Promise.resolve(e))}return SyncAsyncResult}()},function(e,t,r){"use strict";(function(e){function isPresent(e){return void 0!==e&&null!==e}function isBlank(e){return void 0===e||null===e}function looseIdentical(e,t){return e===t||"number"==typeof e&&"number"==typeof t&&isNaN(e)&&isNaN(t)}function normalizeBool(e){return!isBlank(e)&&e}function isJsObject(e){return null!==e&&("function"==typeof e||"object"==typeof e)}function getSymbolIterator(){if(isBlank(i))if(isPresent(r.Symbol)&&isPresent(Symbol.iterator))i=Symbol.iterator;else for(var e=Object.getOwnPropertyNames(Map.prototype),t=0;t<e.length;++t){var n=e[t];"entries"!==n&&"size"!==n&&Map.prototype[n]===Map.prototype.entries&&(i=n)}return i}function isPrimitive(e){return!isJsObject(e)}t.a=isPresent,t.b=isBlank,t.f=looseIdentical,t.g=normalizeBool,t.c=isJsObject,t.d=getSymbolIterator,t.e=isPrimitive;var r;r="undefined"==typeof window?"undefined"!=typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope?self:e:window;var n=r;n.assert=function(e){};var i=(Object.getPrototypeOf({}),function(){function NumberWrapper(){}return NumberWrapper.parseIntAutoRadix=function(e){var t=parseInt(e);if(isNaN(t))throw new Error("Invalid integer literal when parsing "+e);return t},NumberWrapper.parseInt=function(e,t){if(10==t){if(/^(\-|\+)?[0-9]+$/.test(e))return parseInt(e,t)}else if(16==t){if(/^(\-|\+)?[0-9ABCDEFabcdef]+$/.test(e))return parseInt(e,t)}else{var r=parseInt(e,t);if(!isNaN(r))return r}throw new Error("Invalid integer literal when parsing "+e+" in base "+t)},NumberWrapper.isNumeric=function(e){return!isNaN(e-parseFloat(e))},NumberWrapper}(),null)}).call(t,r(28))},,,function(e,t,r){"use strict";var n=this&&this.__extends||function(e,t){function __(){this.constructor=e}for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r]);e.prototype=null===t?Object.create(t):(__.prototype=t.prototype,new __)},i=r(387),o=r(239),a=r(377),s=r(244),u=function(e){function Subscriber(t,r,n){switch(e.call(this),this.syncErrorValue=null,this.syncErrorThrown=!1,this.syncErrorThrowable=!1,this.isStopped=!1,arguments.length){case 0:this.destination=a.empty;break;case 1:if(!t){this.destination=a.empty;break}if("object"==typeof t){t instanceof Subscriber?(this.destination=t,this.destination.add(this)):(this.syncErrorThrowable=!0,this.destination=new c(this,t));break}default:this.syncErrorThrowable=!0,this.destination=new c(this,t,r,n)}}return n(Subscriber,e),Subscriber.prototype[s.$$rxSubscriber]=function(){return this},Subscriber.create=function(e,t,r){var n=new Subscriber(e,t,r);return n.syncErrorThrowable=!1,n},Subscriber.prototype.next=function(e){this.isStopped||this._next(e)},Subscriber.prototype.error=function(e){this.isStopped||(this.isStopped=!0,this._error(e))},Subscriber.prototype.complete=function(){this.isStopped||(this.isStopped=!0,this._complete())},Subscriber.prototype.unsubscribe=function(){this.closed||(this.isStopped=!0,e.prototype.unsubscribe.call(this))},Subscriber.prototype._next=function(e){this.destination.next(e)},Subscriber.prototype._error=function(e){this.destination.error(e),this.unsubscribe()},Subscriber.prototype._complete=function(){this.destination.complete(),this.unsubscribe()},Subscriber}(o.Subscription);t.Subscriber=u;var c=function(e){function SafeSubscriber(t,r,n,o){e.call(this),this._parent=t;var a,s=this;i.isFunction(r)?a=r:r&&(s=r,a=r.next,n=r.error,o=r.complete,i.isFunction(s.unsubscribe)&&this.add(s.unsubscribe.bind(s)),s.unsubscribe=this.unsubscribe.bind(this)),this._context=s,this._next=a,this._error=n,this._complete=o}return n(SafeSubscriber,e),SafeSubscriber.prototype.next=function(e){if(!this.isStopped&&this._next){var t=this._parent;t.syncErrorThrowable?this.__tryOrSetError(t,this._next,e)&&this.unsubscribe():this.__tryOrUnsub(this._next,e)}},SafeSubscriber.prototype.error=function(e){if(!this.isStopped){var t=this._parent;if(this._error)t.syncErrorThrowable?(this.__tryOrSetError(t,this._error,e),this.unsubscribe()):(this.__tryOrUnsub(this._error,e),this.unsubscribe());else{if(!t.syncErrorThrowable)throw this.unsubscribe(),e;t.syncErrorValue=e,t.syncErrorThrown=!0,this.unsubscribe()}}},SafeSubscriber.prototype.complete=function(){if(!this.isStopped){var e=this._parent;this._complete?e.syncErrorThrowable?(this.__tryOrSetError(e,this._complete),this.unsubscribe()):(this.__tryOrUnsub(this._complete),this.unsubscribe()):this.unsubscribe()}},SafeSubscriber.prototype.__tryOrUnsub=function(e,t){try{e.call(this._context,t)}catch(e){throw this.unsubscribe(),e}},SafeSubscriber.prototype.__tryOrSetError=function(e,t,r){try{t.call(this._context,r)}catch(t){return e.syncErrorValue=t,e.syncErrorThrown=!0,!0}return!1},SafeSubscriber.prototype._unsubscribe=function(){var e=this._parent;this._context=null,this._parent=null,e.unsubscribe()},SafeSubscriber}(u)},,function(e,t,r){"use strict";function unimplemented(){throw new Error("unimplemented")}t.a=unimplemented,r.d(t,"b",function(){return i}),r.d(t,"c",function(){return o});var n=this&&this.__extends||function(e,t){function __(){this.constructor=e}for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r]);e.prototype=null===t?Object.create(t):(__.prototype=t.prototype,new __)},i=function(e){function BaseError(t){var r=e.call(this,t);this._nativeError=r}return n(BaseError,e),Object.defineProperty(BaseError.prototype,"message",{get:function(){return this._nativeError.message},set:function(e){this._nativeError.message=e},enumerable:!0,configurable:!0}),Object.defineProperty(BaseError.prototype,"name",{get:function(){return this._nativeError.name},enumerable:!0,configurable:!0}),Object.defineProperty(BaseError.prototype,"stack",{get:function(){return this._nativeError.stack},set:function(e){this._nativeError.stack=e},enumerable:!0,configurable:!0}),BaseError.prototype.toString=function(){return this._nativeError.toString()},BaseError}(Error),o=function(e){function WrappedError(t,r){e.call(this,t+" caused by: "+(r instanceof Error?r.message:r)),this.originalError=r}return n(WrappedError,e),Object.defineProperty(WrappedError.prototype,"stack",{get:function(){return(this.originalError instanceof Error?this.originalError:this._nativeError).stack},enumerable:!0,configurable:!0}),WrappedError}(i)},function(e,t,r){"use strict";(function(e){function isPresent(e){return void 0!==e&&null!==e}function isBlank(e){return void 0===e||null===e}function stringify(e){if("string"==typeof e)return e;if(void 0===e||null===e)return""+e;if(e.overriddenName)return e.overriddenName;if(e.name)return e.name;var t=e.toString(),r=t.indexOf("\n");return r===-1?t:t.substring(0,r)}function isJsObject(e){return null!==e&&("function"==typeof e||"object"==typeof e)}function setValueOnPath(e,t,r){for(var n=t.split("."),i=e;n.length>1;){var o=n.shift();i=i.hasOwnProperty(o)&&isPresent(i[o])?i[o]:i[o]={}}void 0!==i&&null!==i||(i={}),i[n.shift()]=r}function getSymbolIterator(){if(isBlank(o))if(isPresent(n.Symbol)&&isPresent(Symbol.iterator))o=Symbol.iterator;else for(var e=Object.getOwnPropertyNames(Map.prototype),t=0;t<e.length;++t){var r=e[t];"entries"!==r&&"size"!==r&&Map.prototype[r]===Map.prototype.entries&&(o=r)}return o}r.d(t,"d",function(){return i}),t.a=isPresent,t.b=isBlank,t.g=stringify,t.e=isJsObject,t.c=setValueOnPath,t.f=getSymbolIterator;var n;n="undefined"==typeof window?"undefined"!=typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope?self:e:window;var i=n;i.assert=function(e){};var o=(Object.getPrototypeOf({}),function(){function NumberWrapper(){}return NumberWrapper.parseIntAutoRadix=function(e){var t=parseInt(e);if(isNaN(t))throw new Error("Invalid integer literal when parsing "+e);return t},NumberWrapper.parseInt=function(e,t){if(10==t){if(/^(\-|\+)?[0-9]+$/.test(e))return parseInt(e,t)}else if(16==t){if(/^(\-|\+)?[0-9ABCDEFabcdef]+$/.test(e))return parseInt(e,t)}else{var r=parseInt(e,t);if(!isNaN(r))return r}throw new Error("Invalid integer literal when parsing "+e+" in base "+t)},NumberWrapper.isNumeric=function(e){return!isNaN(e-parseFloat(e))},NumberWrapper}(),null)}).call(t,r(28))},,,function(e,t,r){"use strict";var n=r(129),i=r(183),o=r(128),a=r(468),s=r(186),u=r(185),c=r(184);r.d(t,"b",function(){return n.a}),r.d(t,"c",function(){return n.b}),r.d(t,"d",function(){return n.c}),r.d(t,"e",function(){return n.f}),r.d(t,"h",function(){return n.e}),r.d(t,"j",function(){return n.d}),r.d(t,"k",function(){return i.b}),r.d(t,"i",function(){return i.a}),r.d(t,"g",function(){return o.b}),r.d(t,"f",function(){return a.a}),r.d(t,"l",function(){return s.c}),r.d(t,"m",function(){return u.a}),r.d(t,"a",function(){return c.a})},,,function(e,t,r){"use strict";var n=r(0);r.d(t,"a",function(){return i});var i=new n.OpaqueToken("NgValueAccessor")},function(e,t,r){"use strict";function isEmptyInputValue(e){return null==e||"string"==typeof e&&0===e.length}function _convertToPromise(e){return r.i(s.a)(e)?e:i.toPromise.call(e)}function _executeValidators(e,t){return t.map(function(t){return t(e)})}function _executeAsyncValidators(e,t){return t.map(function(t){return t(e)})}function _mergeErrors(e){var t=e.reduce(function(e,t){return r.i(a.a)(t)?o.a.merge(e,t):e},{});return 0===Object.keys(t).length?null:t}var n=r(0),i=r(713),o=(r.n(i),r(80)),a=r(24),s=r(314);r.d(t,"b",function(){return u}),r.d(t,"c",function(){return c}),r.d(t,"a",function(){return l});var u=new n.OpaqueToken("NgValidators"),c=new n.OpaqueToken("NgAsyncValidators"),l=function(){function Validators(){}return Validators.required=function(e){return isEmptyInputValue(e.value)?{required:!0}:null},Validators.minLength=function(e){return function(t){if(isEmptyInputValue(t.value))return null;var r="string"==typeof t.value?t.value.length:0;return r<e?{minlength:{requiredLength:e,actualLength:r}}:null}},Validators.maxLength=function(e){return function(t){var r="string"==typeof t.value?t.value.length:0;return r>e?{maxlength:{requiredLength:e,actualLength:r}}:null}},Validators.pattern=function(e){return function(t){if(isEmptyInputValue(t.value))return null;var r=new RegExp("^"+e+"$"),n=t.value;return r.test(n)?null:{pattern:{requiredPattern:"^"+e+"$",actualValue:n}}}},Validators.nullValidator=function(e){return null},Validators.compose=function(e){if(!e)return null;var t=e.filter(a.a);return 0==t.length?null:function(e){return _mergeErrors(_executeValidators(e,t))}},Validators.composeAsync=function(e){if(!e)return null;var t=e.filter(a.a);return 0==t.length?null:function(e){var r=_executeAsyncValidators(e,t).map(_convertToPromise);return Promise.all(r).then(_mergeErrors)}},Validators}()},,,,function(e,t,r){"use strict";var n=r(260);r.d(t,"b",function(){return i}),r.d(t,"a",function(){return o});var i=function(){function InterpolationConfig(e,t){this.start=e,this.end=t}return InterpolationConfig.fromArray=function(e){return e?(r.i(n.a)("interpolation",e),new InterpolationConfig(e[0],e[1])):o},InterpolationConfig}(),o=new i("{{","}}")},function(e,t,r){"use strict";var n=r(2);r.d(t,"c",function(){return o}),r.d(t,"b",function(){return a}),r.d(t,"d",function(){return s}),r.d(t,"e",function(){return i}),r.d(t,"a",function(){return u});var i,o=function(){function ParseLocation(e,t,r,n){this.file=e,this.offset=t,this.line=r,this.col=n}return ParseLocation.prototype.toString=function(){return r.i(n.a)(this.offset)?this.file.url+"@"+this.line+":"+this.col:this.file.url},ParseLocation}(),a=function(){function ParseSourceFile(e,t){this.content=e,this.url=t}return ParseSourceFile}(),s=function(){function ParseSourceSpan(e,t,r){void 0===r&&(r=null),this.start=e,this.end=t,this.details=r}return ParseSourceSpan.prototype.toString=function(){return this.start.file.content.substring(this.start.offset,this.end.offset)},ParseSourceSpan}();!function(e){e[e.WARNING=0]="WARNING",e[e.FATAL=1]="FATAL"}(i||(i={}));var u=function(){function ParseError(e,t,r){void 0===r&&(r=i.FATAL),this.span=e,this.msg=t,this.level=r}return ParseError.prototype.toString=function(){var e=this.span.start.file.content,t=this.span.start.offset,i="",o="";if(r.i(n.a)(t)){t>e.length-1&&(t=e.length-1);for(var a=t,s=0,u=0;s<100&&t>0&&(t--,s++,"\n"!=e[t]||3!=++u););for(s=0,u=0;s<100&&a<e.length-1&&(a++,s++,"\n"!=e[a]||3!=++u););var c=e.substring(t,this.span.start.offset)+"[ERROR ->]"+e.substring(this.span.start.offset,a+1);i=' ("'+c+'")'}return this.span.details&&(o=", "+this.span.details),""+this.msg+i+": "+this.span.start+o},ParseError}()},function(e,t,r){"use strict";var n=r(196);r.d(t,"a",function(){return o});var i=this&&this.__extends||function(e,t){function __(){this.constructor=e}for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r]);e.prototype=null===t?Object.create(t):(__.prototype=t.prototype,new __)},o=function(e){function ControlContainer(){e.apply(this,arguments)}return i(ControlContainer,e),Object.defineProperty(ControlContainer.prototype,"formDirective",{get:function(){return null},enumerable:!0,configurable:!0}),Object.defineProperty(ControlContainer.prototype,"path",{get:function(){return null},enumerable:!0,configurable:!0}),ControlContainer}(n.a)},function(e,t,r){"use strict";(function(e){function isPresent(e){return void 0!==e&&null!==e}function isBlank(e){return void 0===e||null===e}function isJsObject(e){return null!==e&&("function"==typeof e||"object"==typeof e)}function getSymbolIterator(){if(isBlank(o))if(isPresent(n.Symbol)&&isPresent(Symbol.iterator))o=Symbol.iterator;else for(var e=Object.getOwnPropertyNames(Map.prototype),t=0;t<e.length;++t){var r=e[t];"entries"!==r&&"size"!==r&&Map.prototype[r]===Map.prototype.entries&&(o=r)}return o}r.d(t,"e",function(){return i}),t.a=isPresent,t.b=isBlank,t.c=isJsObject,t.d=getSymbolIterator;var n;n="undefined"==typeof window?"undefined"!=typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope?self:e:window;var i=n;i.assert=function(e){};var o=(Object.getPrototypeOf({}),function(){function NumberWrapper(){}return NumberWrapper.parseIntAutoRadix=function(e){var t=parseInt(e);if(isNaN(t))throw new Error("Invalid integer literal when parsing "+e);return t},NumberWrapper.parseInt=function(e,t){if(10==t){if(/^(\-|\+)?[0-9]+$/.test(e))return parseInt(e,t)}else if(16==t){if(/^(\-|\+)?[0-9ABCDEFabcdef]+$/.test(e))return parseInt(e,t)}else{var r=parseInt(e,t);if(!isNaN(r))return r}throw new Error("Invalid integer literal when parsing "+e+" in base "+t)},NumberWrapper.isNumeric=function(e){return!isNaN(e-parseFloat(e))},NumberWrapper}(),null)}).call(t,r(28))},function(e,t,r){"use strict";r.d(t,"a",function(){return i}),r.d(t,"b",function(){return o});var n=this&&this.__extends||function(e,t){function __(){this.constructor=e}for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r]);e.prototype=null===t?Object.create(t):(__.prototype=t.prototype,new __)},i="primary",o=function(e){function NavigationCancelingError(t){e.call(this,t),this.message=t,this.stack=new Error(t).stack}return n(NavigationCancelingError,e),NavigationCancelingError.prototype.toString=function(){return this.message},NavigationCancelingError}(Error)},function(e,t,r){"use strict";function shallowEqualArrays(e,t){if(e.length!==t.length)return!1;for(var r=0;r<e.length;++r)if(!shallowEqual(e[r],t[r]))return!1;return!0}function shallowEqual(e,t){var r=Object.keys(e),n=Object.keys(t);if(r.length!=n.length)return!1;for(var i,o=0;o<r.length;o++)if(i=r[o],e[i]!==t[i])return!1;return!0}function flatten(e){for(var t=[],r=0;r<e.length;++r)for(var n=0;n<e[r].length;++n)t.push(e[r][n]);return t}function last(e){return e.length>0?e[e.length-1]:null}function merge(e,t){var r={};for(var n in e)e.hasOwnProperty(n)&&(r[n]=e[n]);for(var n in t)t.hasOwnProperty(n)&&(r[n]=t[n]);return r}function forEach(e,t){for(var r in e)e.hasOwnProperty(r)&&t(e[r],r)}function waitForMap(e,t){var n=[],i={};if(forEach(e,function(e,r){r===p.a&&n.push(c.map.call(t(r,e),function(e){return i[r]=e,e}))}),forEach(e,function(e,r){r!==p.a&&n.push(c.map.call(t(r,e),function(e){return i[r]=e,e}))}),n.length>0){var s=a.concatAll.call(o.of.apply(void 0,n)),l=u.last.call(s);return c.map.call(l,function(){return i})}return r.i(o.of)(i)}function andObservables(e){var t=l.mergeAll.call(e);return s.every.call(t,function(e){return e===!0})}function wrapIntoObservable(e){return e instanceof n.Observable?e:e instanceof Promise?r.i(i.fromPromise)(e):r.i(o.of)(e)}var n=r(6),i=(r.n(n),r(156)),o=(r.n(i),r(71)),a=(r.n(o),r(383)),s=(r.n(a),r(385)),u=(r.n(s),r(710)),c=(r.n(u),r(112)),l=(r.n(c),r(157)),p=(r.n(l),r(45));t.h=shallowEqualArrays,t.d=shallowEqual,t.a=flatten,t.i=last,t.g=merge,t.c=forEach,t.e=waitForMap,t.f=andObservables,t.b=wrapIntoObservable},,,,,function(e,t,r){"use strict";var n=r(420),i=r(22);r.d(t,"a",function(){return a});var o=this&&this.__extends||function(e,t){function __(){this.constructor=e}for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r]);e.prototype=null===t?Object.create(t):(__.prototype=t.prototype,new __)},a=function(e){function InvalidPipeArgumentError(t,n){e.call(this,"Invalid argument '"+n+"' for pipe '"+r.i(i.f)(t)+"'")}return o(InvalidPipeArgumentError,e),InvalidPipeArgumentError}(n.a)},function(e,t,r){"use strict";function visitAll(e,t,r){void 0===r&&(r=null);var n=[],i=e.visit?function(t){return e.visit(t,r)||t.visit(e,r)}:function(t){return t.visit(e,r)};return t.forEach(function(e){var t=i(e);t&&n.push(t)}),n}r.d(t,"d",function(){return n}),r.d(t,"b",function(){return i}),r.d(t,"c",function(){return o}),r.d(t,"f",function(){return a}),r.d(t,"e",function(){return s}),r.d(t,"a",function(){return u}),t.g=visitAll;var n=function(){function Text(e,t){this.value=e,this.sourceSpan=t}return Text.prototype.visit=function(e,t){return e.visitText(this,t)},Text}(),i=function(){function Expansion(e,t,r,n,i){this.switchValue=e,this.type=t,this.cases=r,this.sourceSpan=n,this.switchValueSourceSpan=i}return Expansion.prototype.visit=function(e,t){return e.visitExpansion(this,t)},Expansion}(),o=function(){function ExpansionCase(e,t,r,n,i){this.value=e,this.expression=t,this.sourceSpan=r,this.valueSourceSpan=n,this.expSourceSpan=i}return ExpansionCase.prototype.visit=function(e,t){return e.visitExpansionCase(this,t)},ExpansionCase}(),a=function(){function Attribute(e,t,r,n){this.name=e,this.value=t,this.sourceSpan=r,this.valueSpan=n}return Attribute.prototype.visit=function(e,t){return e.visitAttribute(this,t)},Attribute}(),s=function(){function Element(e,t,r,n,i,o){this.name=e,this.attrs=t,this.children=r,this.sourceSpan=n,this.startSourceSpan=i,this.endSourceSpan=o}return Element.prototype.visit=function(e,t){return e.visitElement(this,t)},Element}(),u=function(){function Comment(e,t){this.value=e,this.sourceSpan=t}return Comment.prototype.visit=function(e,t){return e.visitComment(this,t)},Comment}()},function(e,t,r){"use strict";function templateVisitAll(e,t,r){void 0===r&&(r=null);var n=[],i=e.visit?function(t){return e.visit(t,r)||t.visit(e,r)}:function(t){return t.visit(e,r)};return t.forEach(function(e){var t=i(e);t&&n.push(t)}),n}r.d(t,"e",function(){return i}),r.d(t,"d",function(){return o}),r.d(t,"f",function(){return a}),r.d(t,"k",function(){return s}),r.d(t,"m",function(){return u}),r.d(t,"n",function(){return c}),r.d(t,"j",function(){return l}),r.d(t,"i",function(){return p}),r.d(t,"h",function(){return f}),r.d(t,"p",function(){return h}),r.d(t,"o",function(){return d}),r.d(t,"b",function(){return m}),r.d(t,"a",function(){return n}),r.d(t,"g",function(){return y}),r.d(t,"l",function(){return v}),t.c=templateVisitAll;var n,i=function(){function TextAst(e,t,r){this.value=e,this.ngContentIndex=t,this.sourceSpan=r}return TextAst.prototype.visit=function(e,t){return e.visitText(this,t)},TextAst}(),o=function(){function BoundTextAst(e,t,r){this.value=e,this.ngContentIndex=t,this.sourceSpan=r}return BoundTextAst.prototype.visit=function(e,t){return e.visitBoundText(this,t)},BoundTextAst}(),a=function(){function AttrAst(e,t,r){this.name=e,this.value=t,this.sourceSpan=r}return AttrAst.prototype.visit=function(e,t){return e.visitAttr(this,t)},AttrAst}(),s=function(){function BoundElementPropertyAst(e,t,r,n,i,o){this.name=e,this.type=t,this.securityContext=r,this.value=n,this.unit=i,this.sourceSpan=o}return BoundElementPropertyAst.prototype.visit=function(e,t){return e.visitElementProperty(this,t)},Object.defineProperty(BoundElementPropertyAst.prototype,"isAnimation",{get:function(){return this.type===v.Animation},enumerable:!0,configurable:!0}),BoundElementPropertyAst}(),u=function(){function BoundEventAst(e,t,r,n,i){this.name=e,this.target=t,this.phase=r,this.handler=n,this.sourceSpan=i}return BoundEventAst.prototype.visit=function(e,t){return e.visitEvent(this,t)},Object.defineProperty(BoundEventAst.prototype,"fullName",{get:function(){return this.target?this.target+":"+this.name:this.name},enumerable:!0,configurable:!0}),Object.defineProperty(BoundEventAst.prototype,"isAnimation",{get:function(){return!!this.phase},enumerable:!0,configurable:!0}),BoundEventAst}(),c=function(){function ReferenceAst(e,t,r){this.name=e,this.value=t,this.sourceSpan=r}return ReferenceAst.prototype.visit=function(e,t){return e.visitReference(this,t)},ReferenceAst}(),l=function(){function VariableAst(e,t,r){this.name=e,this.value=t,this.sourceSpan=r}return VariableAst.prototype.visit=function(e,t){return e.visitVariable(this,t)},VariableAst}(),p=function(){function ElementAst(e,t,r,n,i,o,a,s,u,c,l,p){this.name=e,this.attrs=t,this.inputs=r,this.outputs=n,this.references=i,this.directives=o,this.providers=a,this.hasViewContainer=s,this.children=u,this.ngContentIndex=c,this.sourceSpan=l,this.endSourceSpan=p}return ElementAst.prototype.visit=function(e,t){return e.visitElement(this,t)},ElementAst}(),f=function(){function EmbeddedTemplateAst(e,t,r,n,i,o,a,s,u,c){this.attrs=e,this.outputs=t,this.references=r,this.variables=n,this.directives=i,this.providers=o,this.hasViewContainer=a,this.children=s,this.ngContentIndex=u,this.sourceSpan=c}return EmbeddedTemplateAst.prototype.visit=function(e,t){return e.visitEmbeddedTemplate(this,t)},EmbeddedTemplateAst}(),h=function(){function BoundDirectivePropertyAst(e,t,r,n){this.directiveName=e,this.templateName=t,this.value=r,this.sourceSpan=n}return BoundDirectivePropertyAst.prototype.visit=function(e,t){return e.visitDirectiveProperty(this,t)},BoundDirectivePropertyAst}(),d=function(){function DirectiveAst(e,t,r,n,i){this.directive=e,this.inputs=t,this.hostProperties=r,this.hostEvents=n,this.sourceSpan=i}return DirectiveAst.prototype.visit=function(e,t){return e.visitDirective(this,t)},DirectiveAst}(),m=function(){function ProviderAst(e,t,r,n,i,o,a){this.token=e,this.multiProvider=t,this.eager=r,this.providers=n,this.providerType=i,this.lifecycleHooks=o,this.sourceSpan=a}return ProviderAst.prototype.visit=function(e,t){return null},ProviderAst}();!function(e){e[e.PublicService=0]="PublicService",e[e.PrivateService=1]="PrivateService",e[e.Component=2]="Component",e[e.Directive=3]="Directive",e[e.Builtin=4]="Builtin"}(n||(n={}));var v,y=function(){function NgContentAst(e,t,r){this.index=e,this.ngContentIndex=t,this.sourceSpan=r}return NgContentAst.prototype.visit=function(e,t){return e.visitNgContent(this,t)},NgContentAst}();!function(e){e[e.Property=0]="Property",e[e.Attribute=1]="Attribute",e[e.Class=2]="Class",e[e.Style=3]="Style",e[e.Animation=4]="Animation"}(v||(v={}))},function(e,t,r){"use strict";function controlPath(e,t){return t.path.concat([e])}function setUpControl(e,t){e||_throwError(t,"Cannot find control with"),t.valueAccessor||_throwError(t,"No value accessor for form control with"),e.validator=i.a.compose([e.validator,t.validator]),e.asyncValidator=i.a.composeAsync([e.asyncValidator,t.asyncValidator]),t.valueAccessor.writeValue(e.value),t.valueAccessor.registerOnChange(function(r){t.viewToModelUpdate(r),e.markAsDirty(),e.setValue(r,{emitModelToViewChange:!1})}),t.valueAccessor.registerOnTouched(function(){return e.markAsTouched()}),e.registerOnChange(function(e,r){t.valueAccessor.writeValue(e),r&&t.viewToModelUpdate(e)}),t.valueAccessor.setDisabledState&&e.registerOnDisabledChange(function(e){t.valueAccessor.setDisabledState(e)}),t._rawValidators.forEach(function(t){t.registerOnValidatorChange&&t.registerOnValidatorChange(function(){return e.updateValueAndValidity()})}),t._rawAsyncValidators.forEach(function(t){t.registerOnValidatorChange&&t.registerOnValidatorChange(function(){return e.updateValueAndValidity()})})}function cleanUpControl(e,t){t.valueAccessor.registerOnChange(function(){return _noControlError(t)}),t.valueAccessor.registerOnTouched(function(){return _noControlError(t)}),t._rawValidators.forEach(function(e){return e.registerOnValidatorChange(null)}),t._rawAsyncValidators.forEach(function(e){return e.registerOnValidatorChange(null)}),e&&e._clearChangeFns()}function setUpFormContainer(e,t){r.i(n.b)(e)&&_throwError(t,"Cannot find control with"),e.validator=i.a.compose([e.validator,t.validator]),e.asyncValidator=i.a.composeAsync([e.asyncValidator,t.asyncValidator])}function _noControlError(e){return _throwError(e,"There is no FormControl instance attached to form control element with")}function _throwError(e,t){var r;throw r=e.path.length>1?"path: '"+e.path.join(" -> ")+"'":e.path[0]?"name: '"+e.path+"'":"unspecified name attribute",new Error(t+" "+r)}function composeValidators(e){return r.i(n.a)(e)?i.a.compose(e.map(s.a)):null}function composeAsyncValidators(e){return r.i(n.a)(e)?i.a.composeAsync(e.map(s.b)):null}function isPropertyUpdated(e,t){if(!e.hasOwnProperty("model"))return!1;var i=e.model;return!!i.isFirstChange()||!r.i(n.f)(t,i.currentValue)}function isBuiltInAccessor(e){return f.some(function(t){return e.constructor===t})}function selectValueAccessor(e,t){if(!t)return null;var r,n,i;return t.forEach(function(t){t.constructor===a.a?r=t:isBuiltInAccessor(t)?(n&&_throwError(e,"More than one built-in value accessor matches form control with"),n=t):(i&&_throwError(e,"More than one custom value accessor matches form control with"),i=t)}),i?i:n?n:r?r:(_throwError(e,"No valid value accessor for form control with"),null)}var n=r(24),i=r(37),o=r(134),a=r(135),s=r(484),u=r(199),c=r(96),l=r(138),p=r(139);t.a=controlPath,t.d=setUpControl,t.h=cleanUpControl,t.e=setUpFormContainer,t.b=composeValidators,t.c=composeAsyncValidators,t.g=isPropertyUpdated,t.f=selectValueAccessor;var f=[o.a,u.a,l.a,p.a,c.a]},function(e,t,r){"use strict";r.d(t,"b",function(){return n}),r.d(t,"c",function(){return i}),r.d(t,"a",function(){return o}),r.d(t,"e",function(){return a}),r.d(t,"d",function(){return s});var n;!function(e){e[e.Get=0]="Get",e[e.Post=1]="Post",e[e.Put=2]="Put",e[e.Delete=3]="Delete",e[e.Options=4]="Options",e[e.Head=5]="Head",e[e.Patch=6]="Patch"}(n||(n={}));var i;!function(e){e[e.Unsent=0]="Unsent",e[e.Open=1]="Open",e[e.HeadersReceived=2]="HeadersReceived",e[e.Loading=3]="Loading",e[e.Done=4]="Done",e[e.Cancelled=5]="Cancelled"}(i||(i={}));var o;!function(e){e[e.Basic=0]="Basic",e[e.Cors=1]="Cors",e[e.Default=2]="Default",e[e.Error=3]="Error",e[e.Opaque=4]="Opaque"}(o||(o={}));var a;!function(e){e[e.NONE=0]="NONE",e[e.JSON=1]="JSON",e[e.FORM=2]="FORM",e[e.FORM_DATA=3]="FORM_DATA",e[e.TEXT=4]="TEXT",e[e.BLOB=5]="BLOB",e[e.ARRAY_BUFFER=6]="ARRAY_BUFFER"}(a||(a={}));var s;!function(e){e[e.Text=0]="Text",e[e.Json=1]="Json",e[e.ArrayBuffer=2]="ArrayBuffer",e[e.Blob=3]="Blob"}(s||(s={}))},,,,,,function(e,t,r){"use strict";(function(e){if(t.root="object"==typeof window&&window.window===window&&window||"object"==typeof self&&self.self===self&&self||"object"==typeof e&&e.global===e&&e,!t.root)throw new Error("RxJS could not find any global context (window, self, global)")}).call(t,r(28))},function(e,t,r){"use strict";function unimplemented(){throw new Error("unimplemented")}var n=r(196);r.d(t,"a",function(){return o});var i=this&&this.__extends||function(e,t){function __(){this.constructor=e}for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r]);e.prototype=null===t?Object.create(t):(__.prototype=t.prototype,new __)},o=function(e){function NgControl(){e.apply(this,arguments),this._parent=null,this.name=null,this.valueAccessor=null,this._rawValidators=[],this._rawAsyncValidators=[]}return i(NgControl,e),Object.defineProperty(NgControl.prototype,"validator",{get:function(){return unimplemented()},enumerable:!0,configurable:!0}),Object.defineProperty(NgControl.prototype,"asyncValidator",{get:function(){return unimplemented()},enumerable:!0,configurable:!0}),NgControl}(n.a)},function(e,t,r){"use strict";function createEmptyUrlTree(){return new o(new a([],{}),{},null)}function containsTree(e,t,r){return r?equalSegmentGroups(e.root,t.root):containsSegmentGroup(e.root,t.root)}function equalSegmentGroups(e,t){if(!equalPath(e.segments,t.segments))return!1;if(e.numberOfChildren!==t.numberOfChildren)return!1;for(var r in t.children){if(!e.children[r])return!1;if(!equalSegmentGroups(e.children[r],t.children[r]))return!1}return!0}function containsSegmentGroup(e,t){return containsSegmentGroupHelper(e,t,t.segments)}function containsSegmentGroupHelper(e,t,r){if(e.segments.length>r.length){var i=e.segments.slice(0,r.length);return!!equalPath(i,r)&&!t.hasChildren()}if(e.segments.length===r.length){if(!equalPath(e.segments,r))return!1;for(var o in t.children){if(!e.children[o])return!1;if(!containsSegmentGroup(e.children[o],t.children[o]))return!1}return!0}var i=r.slice(0,e.segments.length),a=r.slice(e.segments.length);return!!equalPath(e.segments,i)&&(!!e.children[n.a]&&containsSegmentGroupHelper(e.children[n.a],t,a))}function equalPath(e,t){if(e.length!==t.length)return!1;for(var r=0;r<e.length;++r)if(e[r].path!==t[r].path)return!1;return!0}function mapChildrenIntoArray(e,t){var o=[];return r.i(i.c)(e.children,function(e,r){r===n.a&&(o=o.concat(t(e,r)))}),r.i(i.c)(e.children,function(e,r){r!==n.a&&(o=o.concat(t(e,r)))}),o}function serializePaths(e){return e.segments.map(function(e){return serializePath(e)}).join("/")}function serializeSegment(e,t){if(e.hasChildren()&&t){var o=e.children[n.a]?serializeSegment(e.children[n.a],!1):"",a=[];return r.i(i.c)(e.children,function(e,t){t!==n.a&&a.push(t+":"+serializeSegment(e,!1))}),a.length>0?o+"("+a.join("//")+")":""+o}if(e.hasChildren()&&!t){var s=mapChildrenIntoArray(e,function(t,r){return r===n.a?[serializeSegment(e.children[n.a],!1)]:[r+":"+serializeSegment(t,!1)]; });return serializePaths(e)+"/("+s.join("//")+")"}return serializePaths(e)}function encode(e){return encodeURIComponent(e)}function decode(e){return decodeURIComponent(e)}function serializePath(e){return""+encode(e.path)+serializeParams(e.parameters)}function serializeParams(e){return pairs(e).map(function(e){return";"+encode(e.first)+"="+encode(e.second)}).join("")}function serializeQueryParams(e){var t=pairs(e).map(function(e){return encode(e.first)+"="+encode(e.second)});return t.length>0?"?"+t.join("&"):""}function pairs(e){var t=[];for(var r in e)e.hasOwnProperty(r)&&t.push(new l(r,e[r]));return t}function matchSegments(e){p.lastIndex=0;var t=e.match(p);return t?t[0]:""}function matchQueryParams(e){f.lastIndex=0;var t=e.match(p);return t?t[0]:""}function matchUrlQueryParamValue(e){h.lastIndex=0;var t=e.match(h);return t?t[0]:""}var n=r(45),i=r(46);t.e=createEmptyUrlTree,t.f=containsTree,r.d(t,"b",function(){return o}),r.d(t,"a",function(){return a}),r.d(t,"c",function(){return s}),t.d=mapChildrenIntoArray,r.d(t,"g",function(){return u}),r.d(t,"h",function(){return c});var o=function(){function UrlTree(e,t,r){this.root=e,this.queryParams=t,this.fragment=r}return UrlTree.prototype.toString=function(){return(new c).serialize(this)},UrlTree}(),a=function(){function UrlSegmentGroup(e,t){var n=this;this.segments=e,this.children=t,this.parent=null,r.i(i.c)(t,function(e,t){return e.parent=n})}return UrlSegmentGroup.prototype.hasChildren=function(){return this.numberOfChildren>0},Object.defineProperty(UrlSegmentGroup.prototype,"numberOfChildren",{get:function(){return Object.keys(this.children).length},enumerable:!0,configurable:!0}),UrlSegmentGroup.prototype.toString=function(){return serializePaths(this)},UrlSegmentGroup}(),s=function(){function UrlSegment(e,t){this.path=e,this.parameters=t}return UrlSegment.prototype.toString=function(){return serializePath(this)},UrlSegment}(),u=function(){function UrlSerializer(){}return UrlSerializer}(),c=function(){function DefaultUrlSerializer(){}return DefaultUrlSerializer.prototype.parse=function(e){var t=new d(e);return new o(t.parseRootSegment(),t.parseQueryParams(),t.parseFragment())},DefaultUrlSerializer.prototype.serialize=function(e){var t="/"+serializeSegment(e.root,!0),r=serializeQueryParams(e.queryParams),n=null!==e.fragment&&void 0!==e.fragment?"#"+encodeURI(e.fragment):"";return""+t+r+n},DefaultUrlSerializer}(),l=function(){function Pair(e,t){this.first=e,this.second=t}return Pair}(),p=/^[^\/\(\)\?;=&#]+/,f=/^[^=\?&#]+/,h=/^[^\?&#]+/,d=function(){function UrlParser(e){this.url=e,this.remaining=e}return UrlParser.prototype.peekStartsWith=function(e){return this.remaining.startsWith(e)},UrlParser.prototype.capture=function(e){if(!this.remaining.startsWith(e))throw new Error('Expected "'+e+'".');this.remaining=this.remaining.substring(e.length)},UrlParser.prototype.parseRootSegment=function(){return this.remaining.startsWith("/")&&this.capture("/"),""===this.remaining||this.remaining.startsWith("?")||this.remaining.startsWith("#")?new a([],{}):new a([],this.parseChildren())},UrlParser.prototype.parseChildren=function(){if(0==this.remaining.length)return{};this.peekStartsWith("/")&&this.capture("/");var e=[];for(this.peekStartsWith("(")||e.push(this.parseSegments());this.peekStartsWith("/")&&!this.peekStartsWith("//")&&!this.peekStartsWith("/(");)this.capture("/"),e.push(this.parseSegments());var t={};this.peekStartsWith("/(")&&(this.capture("/"),t=this.parseParens(!0));var r={};return this.peekStartsWith("(")&&(r=this.parseParens(!1)),(e.length>0||Object.keys(t).length>0)&&(r[n.a]=new a(e,t)),r},UrlParser.prototype.parseSegments=function(){var e=matchSegments(this.remaining);if(""===e&&this.peekStartsWith(";"))throw new Error("Empty path url segment cannot have parameters: '"+this.remaining+"'.");this.capture(e);var t={};return this.peekStartsWith(";")&&(t=this.parseMatrixParams()),new s(decode(e),t)},UrlParser.prototype.parseQueryParams=function(){var e={};if(this.peekStartsWith("?"))for(this.capture("?"),this.parseQueryParam(e);this.remaining.length>0&&this.peekStartsWith("&");)this.capture("&"),this.parseQueryParam(e);return e},UrlParser.prototype.parseFragment=function(){return this.peekStartsWith("#")?decodeURI(this.remaining.substring(1)):null},UrlParser.prototype.parseMatrixParams=function(){for(var e={};this.remaining.length>0&&this.peekStartsWith(";");)this.capture(";"),this.parseParam(e);return e},UrlParser.prototype.parseParam=function(e){var t=matchSegments(this.remaining);if(t){this.capture(t);var r="";if(this.peekStartsWith("=")){this.capture("=");var n=matchSegments(this.remaining);n&&(r=n,this.capture(r))}e[decode(t)]=decode(r)}},UrlParser.prototype.parseQueryParam=function(e){var t=matchQueryParams(this.remaining);if(t){this.capture(t);var r="";if(this.peekStartsWith("=")){this.capture("=");var n=matchUrlQueryParamValue(this.remaining);n&&(r=n,this.capture(r))}e[decode(t)]=decode(r)}},UrlParser.prototype.parseParens=function(e){var t={};for(this.capture("(");!this.peekStartsWith(")")&&this.remaining.length>0;){var r=matchSegments(this.remaining),i=this.remaining[r.length];if("/"!==i&&")"!==i&&";"!==i)throw new Error("Cannot parse url '"+this.url+"'");var o=void 0;r.indexOf(":")>-1?(o=r.substr(0,r.indexOf(":")),this.capture(o),this.capture(":")):e&&(o=n.a);var s=this.parseChildren();t[o]=1===Object.keys(s).length?s[n.a]:new a([],s),this.peekStartsWith("//")&&this.capture("//")}return this.capture(")"),t},UrlParser}()},,,,,,,,function(e,t,r){"use strict";var n=r(379);t.of=n.ArrayObservable.of},function(e,t,r){"use strict";var n=r(421),i=r(115),o=r(413),a=r(252),s=r(256);r.d(t,"PlatformLocation",function(){return n.a}),r.d(t,"LocationStrategy",function(){return n.b}),r.d(t,"APP_BASE_HREF",function(){return n.c}),r.d(t,"HashLocationStrategy",function(){return n.d}),r.d(t,"PathLocationStrategy",function(){return n.e}),r.d(t,"Location",function(){return n.f}),r.d(t,"NgLocalization",function(){return i.b}),r.d(t,"CommonModule",function(){return o.a}),r.d(t,"NgClass",function(){return a.b}),r.d(t,"NgFor",function(){return a.c}),r.d(t,"NgIf",function(){return a.d}),r.d(t,"NgPlural",function(){return a.e}),r.d(t,"NgPluralCase",function(){return a.f}),r.d(t,"NgStyle",function(){return a.g}),r.d(t,"NgSwitch",function(){return a.h}),r.d(t,"NgSwitchCase",function(){return a.i}),r.d(t,"NgSwitchDefault",function(){return a.j}),r.d(t,"NgTemplateOutlet",function(){return a.k}),r.d(t,"LowerCasePipe",function(){return s.b}),r.d(t,"DatePipe",function(){return s.c}),r.d(t,"I18nPluralPipe",function(){return s.d}),r.d(t,"I18nSelectPipe",function(){return s.e}),r.d(t,"JsonPipe",function(){return s.f}),r.d(t,"AsyncPipe",function(){return s.g}),r.d(t,"CurrencyPipe",function(){return s.h}),r.d(t,"DecimalPipe",function(){return s.i}),r.d(t,"PercentPipe",function(){return s.j}),r.d(t,"SlicePipe",function(){return s.k}),r.d(t,"UpperCasePipe",function(){return s.l})},function(e,t,r){"use strict";var n=r(512);r.d(t,"RouterLink",function(){return n.a}),r.d(t,"RouterLinkWithHref",function(){return n.b}),r.d(t,"RouterLinkActive",function(){return n.c}),r.d(t,"RouterOutlet",function(){return n.d}),r.d(t,"NavigationCancel",function(){return n.e}),r.d(t,"NavigationEnd",function(){return n.f}),r.d(t,"NavigationError",function(){return n.g}),r.d(t,"Router",function(){return n.h}),r.d(t,"RoutesRecognized",function(){return n.i}),r.d(t,"NavigationStart",function(){return n.j}),r.d(t,"RouterModule",function(){return n.k}),r.d(t,"provideRoutes",function(){return n.l}),r.d(t,"RouterOutletMap",function(){return n.m}),r.d(t,"PreloadAllModules",function(){return n.n}),r.d(t,"PreloadingStrategy",function(){return n.o}),r.d(t,"NoPreloading",function(){return n.p}),r.d(t,"ActivatedRoute",function(){return n.q}),r.d(t,"ActivatedRouteSnapshot",function(){return n.r}),r.d(t,"RouterState",function(){return n.s}),r.d(t,"RouterStateSnapshot",function(){return n.t}),r.d(t,"PRIMARY_OUTLET",function(){return n.u}),r.d(t,"DefaultUrlSerializer",function(){return n.v}),r.d(t,"UrlSegment",function(){return n.w}),r.d(t,"UrlSerializer",function(){return n.x}),r.d(t,"UrlTree",function(){return n.y}),r.d(t,"__router_private__",function(){return n.z})},function(e,t,r){"use strict";function unimplemented(){throw new Error("unimplemented")}var n=r(0),i=r(13);r.d(t,"a",function(){return o});var o=function(){function CompilerConfig(e){var t=void 0===e?{}:e,r=t.renderTypes,i=void 0===r?new a:r,o=t.defaultEncapsulation,s=void 0===o?n.ViewEncapsulation.Emulated:o,u=t.genDebugInfo,c=t.logBindingUpdate,l=t.useJit,p=void 0===l||l;this.renderTypes=i,this.defaultEncapsulation=s,this._genDebugInfo=u,this._logBindingUpdate=c,this.useJit=p}return Object.defineProperty(CompilerConfig.prototype,"genDebugInfo",{get:function(){return void 0===this._genDebugInfo?r.i(n.isDevMode)():this._genDebugInfo},enumerable:!0,configurable:!0}),Object.defineProperty(CompilerConfig.prototype,"logBindingUpdate",{get:function(){return void 0===this._logBindingUpdate?r.i(n.isDevMode)():this._logBindingUpdate},enumerable:!0,configurable:!0}),CompilerConfig}(),a=(function(){function RenderTypes(){}return Object.defineProperty(RenderTypes.prototype,"renderer",{get:function(){return unimplemented()},enumerable:!0,configurable:!0}),Object.defineProperty(RenderTypes.prototype,"renderText",{get:function(){return unimplemented()},enumerable:!0,configurable:!0}),Object.defineProperty(RenderTypes.prototype,"renderElement",{get:function(){return unimplemented()},enumerable:!0,configurable:!0}),Object.defineProperty(RenderTypes.prototype,"renderComment",{get:function(){return unimplemented()},enumerable:!0,configurable:!0}),Object.defineProperty(RenderTypes.prototype,"renderNode",{get:function(){return unimplemented()},enumerable:!0,configurable:!0}),Object.defineProperty(RenderTypes.prototype,"renderEvent",{get:function(){return unimplemented()},enumerable:!0,configurable:!0}),RenderTypes}(),function(){function DefaultRenderTypes(){this.renderText=null,this.renderElement=null,this.renderComment=null,this.renderNode=null,this.renderEvent=null}return Object.defineProperty(DefaultRenderTypes.prototype,"renderer",{get:function(){return r.i(i.d)(i.b.Renderer)},enumerable:!0,configurable:!0}),DefaultRenderTypes}())},function(e,t,r){"use strict";function lastOnStack(e,t){return e.length>0&&e[e.length-1]===t}var n=r(18),i=r(2),o=r(42),a=r(52),s=r(41),u=r(441),c=r(76);r.d(t,"a",function(){return f}),r.d(t,"b",function(){return h});var l=this&&this.__extends||function(e,t){function __(){this.constructor=e}for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r]);e.prototype=null===t?Object.create(t):(__.prototype=t.prototype,new __)},p=function(e){function TreeError(t,r,n){e.call(this,r,n),this.elementName=t}return l(TreeError,e),TreeError.create=function(e,t,r){return new TreeError(e,t,r)},TreeError}(o.a),f=function(){function ParseTreeResult(e,t){this.rootNodes=e,this.errors=t}return ParseTreeResult}(),h=function(){function Parser(e){this.getTagDefinition=e}return Parser.prototype.parse=function(e,t,r,n){void 0===r&&(r=!1),void 0===n&&(n=s.a);var i=u.a(e,t,this.getTagDefinition,r,n),o=new d(i.tokens,this.getTagDefinition).build();return new f(o.rootNodes,i.errors.concat(o.errors))},Parser}(),d=function(){function _TreeBuilder(e,t){this.tokens=e,this.getTagDefinition=t,this._index=-1,this._rootNodes=[],this._errors=[],this._elementStack=[],this._advance()}return _TreeBuilder.prototype.build=function(){for(;this._peek.type!==u.b.EOF;)this._peek.type===u.b.TAG_OPEN_START?this._consumeStartTag(this._advance()):this._peek.type===u.b.TAG_CLOSE?this._consumeEndTag(this._advance()):this._peek.type===u.b.CDATA_START?(this._closeVoidElement(),this._consumeCdata(this._advance())):this._peek.type===u.b.COMMENT_START?(this._closeVoidElement(),this._consumeComment(this._advance())):this._peek.type===u.b.TEXT||this._peek.type===u.b.RAW_TEXT||this._peek.type===u.b.ESCAPABLE_RAW_TEXT?(this._closeVoidElement(),this._consumeText(this._advance())):this._peek.type===u.b.EXPANSION_FORM_START?this._consumeExpansion(this._advance()):this._advance();return new f(this._rootNodes,this._errors)},_TreeBuilder.prototype._advance=function(){var e=this._peek;return this._index<this.tokens.length-1&&this._index++,this._peek=this.tokens[this._index],e},_TreeBuilder.prototype._advanceIf=function(e){return this._peek.type===e?this._advance():null},_TreeBuilder.prototype._consumeCdata=function(e){this._consumeText(this._advance()),this._advanceIf(u.b.CDATA_END)},_TreeBuilder.prototype._consumeComment=function(e){var t=this._advanceIf(u.b.RAW_TEXT);this._advanceIf(u.b.COMMENT_END);var n=r.i(i.a)(t)?t.parts[0].trim():null;this._addToParent(new a.a(n,e.sourceSpan))},_TreeBuilder.prototype._consumeExpansion=function(e){for(var t=this._advance(),r=this._advance(),n=[];this._peek.type===u.b.EXPANSION_CASE_VALUE;){var i=this._parseExpansionCase();if(!i)return;n.push(i)}if(this._peek.type!==u.b.EXPANSION_FORM_END)return void this._errors.push(p.create(null,this._peek.sourceSpan,"Invalid ICU message. Missing '}'."));var s=new o.d(e.sourceSpan.start,this._peek.sourceSpan.end);this._addToParent(new a.b(t.parts[0],r.parts[0],n,s,t.sourceSpan)),this._advance()},_TreeBuilder.prototype._parseExpansionCase=function(){var e=this._advance();if(this._peek.type!==u.b.EXPANSION_CASE_EXP_START)return this._errors.push(p.create(null,this._peek.sourceSpan,"Invalid ICU message. Missing '{'.")),null;var t=this._advance(),r=this._collectExpansionExpTokens(t);if(!r)return null;var n=this._advance();r.push(new u.c(u.b.EOF,[],n.sourceSpan));var i=new _TreeBuilder(r,this.getTagDefinition).build();if(i.errors.length>0)return this._errors=this._errors.concat(i.errors),null;var s=new o.d(e.sourceSpan.start,n.sourceSpan.end),c=new o.d(t.sourceSpan.start,n.sourceSpan.end);return new a.c(e.parts[0],i.rootNodes,s,e.sourceSpan,c)},_TreeBuilder.prototype._collectExpansionExpTokens=function(e){for(var t=[],r=[u.b.EXPANSION_CASE_EXP_START];;){if(this._peek.type!==u.b.EXPANSION_FORM_START&&this._peek.type!==u.b.EXPANSION_CASE_EXP_START||r.push(this._peek.type),this._peek.type===u.b.EXPANSION_CASE_EXP_END){if(!lastOnStack(r,u.b.EXPANSION_CASE_EXP_START))return this._errors.push(p.create(null,e.sourceSpan,"Invalid ICU message. Missing '}'.")),null;if(r.pop(),0==r.length)return t}if(this._peek.type===u.b.EXPANSION_FORM_END){if(!lastOnStack(r,u.b.EXPANSION_FORM_START))return this._errors.push(p.create(null,e.sourceSpan,"Invalid ICU message. Missing '}'.")),null;r.pop()}if(this._peek.type===u.b.EOF)return this._errors.push(p.create(null,e.sourceSpan,"Invalid ICU message. Missing '}'.")),null;t.push(this._advance())}},_TreeBuilder.prototype._consumeText=function(e){var t=e.parts[0];if(t.length>0&&"\n"==t[0]){var n=this._getParentElement();r.i(i.a)(n)&&0==n.children.length&&this.getTagDefinition(n.name).ignoreFirstLf&&(t=t.substring(1))}t.length>0&&this._addToParent(new a.d(t,e.sourceSpan))},_TreeBuilder.prototype._closeVoidElement=function(){if(this._elementStack.length>0){var e=n.a.last(this._elementStack);this.getTagDefinition(e.name).isVoid&&this._elementStack.pop()}},_TreeBuilder.prototype._consumeStartTag=function(e){for(var t=e.parts[0],n=e.parts[1],i=[];this._peek.type===u.b.ATTR_NAME;)i.push(this._consumeAttr(this._advance()));var s=this._getElementFullName(t,n,this._getParentElement()),l=!1;if(this._peek.type===u.b.TAG_OPEN_END_VOID){this._advance(),l=!0;var f=this.getTagDefinition(s);f.canSelfClose||null!==r.i(c.c)(s)||f.isVoid||this._errors.push(p.create(s,e.sourceSpan,'Only void and foreign elements can be self closed "'+e.parts[1]+'"'))}else this._peek.type===u.b.TAG_OPEN_END&&(this._advance(),l=!1);var h=this._peek.sourceSpan.start,d=new o.d(e.sourceSpan.start,h),m=new a.e(s,i,[],d,d,null);this._pushElement(m),l&&(this._popElement(s),m.endSourceSpan=d)},_TreeBuilder.prototype._pushElement=function(e){if(this._elementStack.length>0){var t=n.a.last(this._elementStack);this.getTagDefinition(t.name).isClosedByChild(e.name)&&this._elementStack.pop()}var o=this.getTagDefinition(e.name),s=this._getParentElementSkippingContainers(),u=s.parent,c=s.container;if(r.i(i.a)(u)&&o.requireExtraParent(u.name)){var l=new a.e(o.parentToAdd,[],[],e.sourceSpan,e.startSourceSpan,e.endSourceSpan);this._insertBeforeContainer(u,c,l)}this._addToParent(e),this._elementStack.push(e)},_TreeBuilder.prototype._consumeEndTag=function(e){var t=this._getElementFullName(e.parts[0],e.parts[1],this._getParentElement());this._getParentElement()&&(this._getParentElement().endSourceSpan=e.sourceSpan),this.getTagDefinition(t).isVoid?this._errors.push(p.create(t,e.sourceSpan,'Void elements do not have end tags "'+e.parts[1]+'"')):this._popElement(t)||this._errors.push(p.create(t,e.sourceSpan,'Unexpected closing tag "'+e.parts[1]+'"'))},_TreeBuilder.prototype._popElement=function(e){for(var t=this._elementStack.length-1;t>=0;t--){var r=this._elementStack[t];if(r.name==e)return n.a.splice(this._elementStack,t,this._elementStack.length-t),!0;if(!this.getTagDefinition(r.name).closedByParent)return!1}return!1},_TreeBuilder.prototype._consumeAttr=function(e){var t,n=r.i(c.d)(e.parts[0],e.parts[1]),i=e.sourceSpan.end,s="";if(this._peek.type===u.b.ATTR_VALUE){var l=this._advance();s=l.parts[0],i=l.sourceSpan.end,t=l.sourceSpan}return new a.f(n,s,new o.d(e.sourceSpan.start,i),t)},_TreeBuilder.prototype._getParentElement=function(){return this._elementStack.length>0?n.a.last(this._elementStack):null},_TreeBuilder.prototype._getParentElementSkippingContainers=function(){for(var e=null,t=this._elementStack.length-1;t>=0;t--){if("ng-container"!==this._elementStack[t].name)return{parent:this._elementStack[t],container:e};e=this._elementStack[t]}return{parent:n.a.last(this._elementStack),container:e}},_TreeBuilder.prototype._addToParent=function(e){var t=this._getParentElement();r.i(i.a)(t)?t.children.push(e):this._rootNodes.push(e)},_TreeBuilder.prototype._insertBeforeContainer=function(e,t,r){if(t){if(e){var n=e.children.indexOf(t);e.children[n]=r}else this._rootNodes.push(r);r.children.push(t),this._elementStack.splice(this._elementStack.indexOf(t),0,r)}else this._addToParent(r),this._elementStack.push(r)},_TreeBuilder.prototype._getElementFullName=function(e,t,n){return r.i(i.b)(e)&&(e=this.getTagDefinition(t).implicitNamespacePrefix,r.i(i.b)(e)&&r.i(i.a)(n)&&(e=r.i(c.c)(n.name))),r.i(c.d)(e,t)},_TreeBuilder}()},function(e,t,r){"use strict";function splitNsName(e){if(":"!=e[0])return[null,e];var t=e.indexOf(":",1);if(t==-1)throw new Error('Unsupported format "'+e+'" expecting ":namespace:name"');return[e.slice(1,t),e.slice(t+1)]}function getNsPrefix(e){return null===e?null:splitNsName(e)[0]}function mergeNsAndName(e,t){return e?":"+e+":"+t:t}r.d(t,"a",function(){return n}),t.e=splitNsName,t.c=getNsPrefix,t.d=mergeNsAndName,r.d(t,"b",function(){return i});var n;!function(e){e[e.RAW_TEXT=0]="RAW_TEXT",e[e.ESCAPABLE_RAW_TEXT=1]="ESCAPABLE_RAW_TEXT",e[e.PARSABLE_DATA=2]="PARSABLE_DATA"}(n||(n={}));var i={Aacute:"Á",aacute:"á",Acirc:"Â",acirc:"â",acute:"´",AElig:"Æ",aelig:"æ",Agrave:"À",agrave:"à",alefsym:"ℵ",Alpha:"Α",alpha:"α",amp:"&",and:"∧",ang:"∠",apos:"'",Aring:"Å",aring:"å",asymp:"≈",Atilde:"Ã",atilde:"ã",Auml:"Ä",auml:"ä",bdquo:"„",Beta:"Β",beta:"β",brvbar:"¦",bull:"•",cap:"∩",Ccedil:"Ç",ccedil:"ç",cedil:"¸",cent:"¢",Chi:"Χ",chi:"χ",circ:"ˆ",clubs:"♣",cong:"≅",copy:"©",crarr:"↵",cup:"∪",curren:"¤",dagger:"†",Dagger:"‡",darr:"↓",dArr:"⇓",deg:"°",Delta:"Δ",delta:"δ",diams:"♦",divide:"÷",Eacute:"É",eacute:"é",Ecirc:"Ê",ecirc:"ê",Egrave:"È",egrave:"è",empty:"∅",emsp:" ",ensp:" ",Epsilon:"Ε",epsilon:"ε",equiv:"≡",Eta:"Η",eta:"η",ETH:"Ð",eth:"ð",Euml:"Ë",euml:"ë",euro:"€",exist:"∃",fnof:"ƒ",forall:"∀",frac12:"½",frac14:"¼",frac34:"¾",frasl:"⁄",Gamma:"Γ",gamma:"γ",ge:"≥",gt:">",harr:"↔",hArr:"⇔",hearts:"♥",hellip:"…",Iacute:"Í",iacute:"í",Icirc:"Î",icirc:"î",iexcl:"¡",Igrave:"Ì",igrave:"ì",image:"ℑ",infin:"∞",int:"∫",Iota:"Ι",iota:"ι",iquest:"¿",isin:"∈",Iuml:"Ï",iuml:"ï",Kappa:"Κ",kappa:"κ",Lambda:"Λ",lambda:"λ",lang:"⟨",laquo:"«",larr:"←",lArr:"⇐",lceil:"⌈",ldquo:"“",le:"≤",lfloor:"⌊",lowast:"∗",loz:"◊",lrm:"‎",lsaquo:"‹",lsquo:"‘",lt:"<",macr:"¯",mdash:"—",micro:"µ",middot:"·",minus:"−",Mu:"Μ",mu:"μ",nabla:"∇",nbsp:" ",ndash:"–",ne:"≠",ni:"∋",not:"¬",notin:"∉",nsub:"⊄",Ntilde:"Ñ",ntilde:"ñ",Nu:"Ν",nu:"ν",Oacute:"Ó",oacute:"ó",Ocirc:"Ô",ocirc:"ô",OElig:"Œ",oelig:"œ",Ograve:"Ò",ograve:"ò",oline:"‾",Omega:"Ω",omega:"ω",Omicron:"Ο",omicron:"ο",oplus:"⊕",or:"∨",ordf:"ª",ordm:"º",Oslash:"Ø",oslash:"ø",Otilde:"Õ",otilde:"õ",otimes:"⊗",Ouml:"Ö",ouml:"ö",para:"¶",permil:"‰",perp:"⊥",Phi:"Φ",phi:"φ",Pi:"Π",pi:"π",piv:"ϖ",plusmn:"±",pound:"£",prime:"′",Prime:"″",prod:"∏",prop:"∝",Psi:"Ψ",psi:"ψ",quot:'"',radic:"√",rang:"⟩",raquo:"»",rarr:"→",rArr:"⇒",rceil:"⌉",rdquo:"”",real:"ℜ",reg:"®",rfloor:"⌋",Rho:"Ρ",rho:"ρ",rlm:"‏",rsaquo:"›",rsquo:"’",sbquo:"‚",Scaron:"Š",scaron:"š",sdot:"⋅",sect:"§",shy:"­",Sigma:"Σ",sigma:"σ",sigmaf:"ς",sim:"∼",spades:"♠",sub:"⊂",sube:"⊆",sum:"∑",sup:"⊃",sup1:"¹",sup2:"²",sup3:"³",supe:"⊇",szlig:"ß",Tau:"Τ",tau:"τ",there4:"∴",Theta:"Θ",theta:"θ",thetasym:"ϑ",thinsp:" ",THORN:"Þ",thorn:"þ",tilde:"˜",times:"×",trade:"™",Uacute:"Ú",uacute:"ú",uarr:"↑",uArr:"⇑",Ucirc:"Û",ucirc:"û",Ugrave:"Ù",ugrave:"ù",uml:"¨",upsih:"ϒ",Upsilon:"Υ",upsilon:"υ",Uuml:"Ü",uuml:"ü",weierp:"℘",Xi:"Ξ",xi:"ξ",Yacute:"Ý",yacute:"ý",yen:"¥",yuml:"ÿ",Yuml:"Ÿ",Zeta:"Ζ",zeta:"ζ",zwj:"‍",zwnj:"‌"}},function(e,t,r){"use strict";function _enumExpression(e,t){return o.b(r.i(i.e)(e,t))}var n=r(0),i=r(13),o=r(8),a=r(14);r.d(t,"f",function(){return s}),r.d(t,"h",function(){return u}),r.d(t,"g",function(){return c}),r.d(t,"e",function(){return l}),r.d(t,"c",function(){return p}),r.d(t,"b",function(){return f}),r.d(t,"a",function(){return h}),r.d(t,"d",function(){return d});var s=function(){function ViewTypeEnum(){}return ViewTypeEnum.fromValue=function(e){var t=r.i(i.d)(i.b.ViewType);switch(e){case a.j.HOST:return _enumExpression(t,"HOST");case a.j.COMPONENT:return _enumExpression(t,"COMPONENT");case a.j.EMBEDDED:return _enumExpression(t,"EMBEDDED");default:throw Error("Inavlid ViewType value: "+e)}},ViewTypeEnum}(),u=function(){function ViewEncapsulationEnum(){}return ViewEncapsulationEnum.fromValue=function(e){var t=r.i(i.d)(i.b.ViewEncapsulation);switch(e){case n.ViewEncapsulation.Emulated:return _enumExpression(t,"Emulated");case n.ViewEncapsulation.Native:return _enumExpression(t,"Native");case n.ViewEncapsulation.None:return _enumExpression(t,"None");default:throw Error("Inavlid ViewEncapsulation value: "+e)}},ViewEncapsulationEnum}(),c=(function(){function ChangeDetectionStrategyEnum(){}return ChangeDetectionStrategyEnum.fromValue=function(e){var t=r.i(i.d)(i.b.ChangeDetectionStrategy);switch(e){case n.ChangeDetectionStrategy.OnPush:return _enumExpression(t,"OnPush");case n.ChangeDetectionStrategy.Default:return _enumExpression(t,"Default");default:throw Error("Inavlid ChangeDetectionStrategy value: "+e)}},ChangeDetectionStrategyEnum}(),function(){function ChangeDetectorStatusEnum(){}return ChangeDetectorStatusEnum.fromValue=function(e){var t=r.i(i.d)(i.b.ChangeDetectorStatus);switch(e){case a.n.CheckOnce:return _enumExpression(t,"CheckOnce");case a.n.Checked:return _enumExpression(t,"Checked");case a.n.CheckAlways:return _enumExpression(t,"CheckAlways");case a.n.Detached:return _enumExpression(t,"Detached");case a.n.Errored:return _enumExpression(t,"Errored");case a.n.Destroyed:return _enumExpression(t,"Destroyed");default:throw Error("Inavlid ChangeDetectorStatus value: "+e)}},ChangeDetectorStatusEnum}()),l=function(){function ViewConstructorVars(){}return ViewConstructorVars.viewUtils=o.e("viewUtils"),ViewConstructorVars.parentInjector=o.e("parentInjector"),ViewConstructorVars.declarationEl=o.e("declarationEl"),ViewConstructorVars}(),p=function(){function ViewProperties(){}return ViewProperties.renderer=o.n.prop("renderer"),ViewProperties.projectableNodes=o.n.prop("projectableNodes"),ViewProperties.viewUtils=o.n.prop("viewUtils"),ViewProperties}(),f=function(){function EventHandlerVars(){}return EventHandlerVars.event=o.e("$event"),EventHandlerVars}(),h=function(){function InjectMethodVars(){}return InjectMethodVars.token=o.e("token"),InjectMethodVars.requestNodeIndex=o.e("requestNodeIndex"),InjectMethodVars.notFoundResult=o.e("notFoundResult"),InjectMethodVars}(),d=function(){function DetectChangesVars(){}return DetectChangesVars.throwOnChange=o.e("throwOnChange"),DetectChangesVars.changes=o.e("changes"),DetectChangesVars.changed=o.e("changed"),DetectChangesVars.valUnwrapper=o.e("valUnwrapper"),DetectChangesVars}()},function(e,t,r){"use strict";function extractAnnotation(e){return"function"==typeof e&&e.hasOwnProperty("annotation")&&(e=e.annotation),e}function applyParams(e,t){if(e===Object||e===String||e===Function||e===Number||e===Array)throw new Error("Can not use native "+r.i(n.b)(e)+" as constructor");if("function"==typeof e)return e;if(Array.isArray(e)){var i=e,a=i.length-1,s=e[a];if("function"!=typeof s)throw new Error("Last position of Class method array must be Function in key "+t+" was '"+r.i(n.b)(s)+"'");if(a!=s.length)throw new Error("Number of annotations ("+a+") does not match number of arguments ("+s.length+") in the function: "+r.i(n.b)(s));for(var u=[],c=0,l=i.length-1;c<l;c++){var p=[];u.push(p);var f=i[c];if(Array.isArray(f))for(var h=0;h<f.length;h++)p.push(extractAnnotation(f[h]));else"function"==typeof f?p.push(extractAnnotation(f)):p.push(f)}return o.defineMetadata("parameters",u,s),s}throw new Error("Only Function or Array is supported in Class definition for key '"+t+"' is '"+r.i(n.b)(e)+"'")}function Class(e){var t=applyParams(e.hasOwnProperty("constructor")?e.constructor:void 0,"constructor"),a=t.prototype;if(e.hasOwnProperty("extends")){if("function"!=typeof e.extends)throw new Error("Class definition 'extends' property must be a constructor function was: "+r.i(n.b)(e.extends));t.prototype=a=Object.create(e.extends.prototype)}for(var s in e)"extends"!==s&&"prototype"!==s&&e.hasOwnProperty(s)&&(a[s]=applyParams(e[s],s));this&&this.annotations instanceof Array&&o.defineMetadata("annotations",this.annotations,t);var u=t.name;return u&&"constructor"!==u||(t.overriddenName="class"+i++),t}function makeDecorator(e,t,r,n){function DecoratorFactory(e){if(!o||!o.getMetadata)throw"reflect-metadata shim is required when using class decorators";if(this instanceof DecoratorFactory)return i.call(this,e),this;var t=new DecoratorFactory(e),r="function"==typeof this&&Array.isArray(this.annotations)?this.annotations:[];r.push(t);var a=function(e){var r=o.getOwnMetadata("annotations",e)||[];return r.push(t),o.defineMetadata("annotations",r,e),e};return a.annotations=r,a.Class=Class,n&&n(a),a}void 0===n&&(n=null);var i=makeMetadataCtor([t]);return r&&(DecoratorFactory.prototype=Object.create(r.prototype)),DecoratorFactory.prototype.toString=function(){return"@"+e},DecoratorFactory.annotationCls=DecoratorFactory,DecoratorFactory}function makeMetadataCtor(e){return function(){for(var t=this,r=[],n=0;n<arguments.length;n++)r[n-0]=arguments[n];e.forEach(function(e,n){var i=r[n];if(Array.isArray(e))t[e[0]]=void 0===i?e[1]:i;else for(var o in e)t[o]=i&&i.hasOwnProperty(o)?i[o]:e[o]})}}function makeParamDecorator(e,t,r){function ParamDecoratorFactory(){function ParamDecorator(e,t,n){for(var i=o.getMetadata("parameters",e)||[];i.length<=n;)i.push(null);return i[n]=i[n]||[],i[n].push(r),o.defineMetadata("parameters",i,e),e}for(var e=[],t=0;t<arguments.length;t++)e[t-0]=arguments[t];if(this instanceof ParamDecoratorFactory)return n.apply(this,e),this;var r=new((i=ParamDecoratorFactory).bind.apply(i,[void 0].concat(e)));return ParamDecorator.annotation=r,ParamDecorator;var i}var n=makeMetadataCtor(t);return r&&(ParamDecoratorFactory.prototype=Object.create(r.prototype)),ParamDecoratorFactory.prototype.toString=function(){return"@"+e},ParamDecoratorFactory.annotationCls=ParamDecoratorFactory,ParamDecoratorFactory}function makePropDecorator(e,t,r){function PropDecoratorFactory(){for(var e=[],t=0;t<arguments.length;t++)e[t-0]=arguments[t];if(this instanceof PropDecoratorFactory)return n.apply(this,e),this;var r=new((i=PropDecoratorFactory).bind.apply(i,[void 0].concat(e)));return function(e,t){var n=o.getOwnMetadata("propMetadata",e.constructor)||{};n[t]=n.hasOwnProperty(t)&&n[t]||[],n[t].unshift(r),o.defineMetadata("propMetadata",n,e.constructor)};var i}var n=makeMetadataCtor(t);return r&&(PropDecoratorFactory.prototype=Object.create(r.prototype)),PropDecoratorFactory.prototype.toString=function(){return"@"+e},PropDecoratorFactory.annotationCls=PropDecoratorFactory,PropDecoratorFactory}var n=r(3);t.d=Class,t.c=makeDecorator,t.a=makeParamDecorator,t.b=makePropDecorator;var i=0,o=n.a.Reflect},function(e,t,r){"use strict";var n=r(86),i=(r.n(n),r(6));r.n(i);r.d(t,"a",function(){return a});var o=this&&this.__extends||function(e,t){function __(){this.constructor=e}for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r]);e.prototype=null===t?Object.create(t):(__.prototype=t.prototype,new __)},a=function(e){function EventEmitter(t){void 0===t&&(t=!1),e.call(this),this.__isAsync=t}return o(EventEmitter,e),EventEmitter.prototype.emit=function(t){e.prototype.next.call(this,t)},EventEmitter.prototype.subscribe=function(t,r,n){var i,o=function(e){return null},a=function(){return null};return t&&"object"==typeof t?(i=this.__isAsync?function(e){setTimeout(function(){return t.next(e)})}:function(e){t.next(e)},t.error&&(o=this.__isAsync?function(e){setTimeout(function(){return t.error(e)})}:function(e){t.error(e)}),t.complete&&(a=this.__isAsync?function(){setTimeout(function(){return t.complete()})}:function(){t.complete()})):(i=this.__isAsync?function(e){setTimeout(function(){return t(e)})}:function(e){t(e)},r&&(o=this.__isAsync?function(e){setTimeout(function(){return r(e)})}:function(e){r(e)}),n&&(a=this.__isAsync?function(){setTimeout(function(){return n()})}:function(){n()})),e.prototype.subscribe.call(this,i,o,a)},EventEmitter}(n.Subject)},function(e,t,r){"use strict";function _flattenArray(e,t){if(r.i(n.a)(e))for(var i=0;i<e.length;i++){var o=e[i];Array.isArray(o)?_flattenArray(o,t):t.push(o)}return t}var n=r(24);r.d(t,"c",function(){return o}),r.d(t,"a",function(){return a}),r.d(t,"b",function(){return s});var i=function(){try{if((new Map).values().next)return function(e,t){return t?Array.from(e.values()):Array.from(e.keys())}}catch(e){}return function(e,t){var r=new Array(e.size),n=0;return e.forEach(function(e,i){r[n]=t?e:i,n++}),r}}(),o=function(){function MapWrapper(){}return MapWrapper.createFromStringMap=function(e){var t=new Map;for(var r in e)t.set(r,e[r]);return t},MapWrapper.keys=function(e){return i(e,!1)},MapWrapper.values=function(e){return i(e,!0)},MapWrapper}(),a=function(){function StringMapWrapper(){}return StringMapWrapper.merge=function(e,t){for(var r={},n=0,i=Object.keys(e);n<i.length;n++){var o=i[n];r[o]=e[o]}for(var a=0,s=Object.keys(t);a<s.length;a++){var o=s[a];r[o]=t[o]}return r},StringMapWrapper.equals=function(e,t){var r=Object.keys(e),n=Object.keys(t);if(r.length!=n.length)return!1;for(var i=0;i<r.length;i++){var o=r[i];if(e[o]!==t[o])return!1}return!0},StringMapWrapper}(),s=function(){function ListWrapper(){}return ListWrapper.createFixedSize=function(e){return new Array(e)},ListWrapper.createGrowableSize=function(e){return new Array(e)},ListWrapper.clone=function(e){return e.slice(0)},ListWrapper.forEachWithIndex=function(e,t){for(var r=0;r<e.length;r++)t(e[r],r)},ListWrapper.first=function(e){return e?e[0]:null},ListWrapper.last=function(e){return e&&0!=e.length?e[e.length-1]:null},ListWrapper.indexOf=function(e,t,r){return void 0===r&&(r=0),e.indexOf(t,r)},ListWrapper.contains=function(e,t){return e.indexOf(t)!==-1},ListWrapper.reversed=function(e){var t=ListWrapper.clone(e);return t.reverse()},ListWrapper.concat=function(e,t){return e.concat(t)},ListWrapper.insert=function(e,t,r){e.splice(t,0,r)},ListWrapper.removeAt=function(e,t){var r=e[t];return e.splice(t,1),r},ListWrapper.removeAll=function(e,t){ for(var r=0;r<t.length;++r){var n=e.indexOf(t[r]);e.splice(n,1)}},ListWrapper.remove=function(e,t){var r=e.indexOf(t);return r>-1&&(e.splice(r,1),!0)},ListWrapper.clear=function(e){e.length=0},ListWrapper.isEmpty=function(e){return 0==e.length},ListWrapper.fill=function(e,t,r,n){void 0===r&&(r=0),void 0===n&&(n=null),e.fill(t,r,null===n?e.length:n)},ListWrapper.equals=function(e,t){if(e.length!=t.length)return!1;for(var r=0;r<e.length;++r)if(e[r]!==t[r])return!1;return!0},ListWrapper.slice=function(e,t,r){return void 0===t&&(t=0),void 0===r&&(r=null),e.slice(t,null===r?void 0:r)},ListWrapper.splice=function(e,t,r){return e.splice(t,r)},ListWrapper.sort=function(e,t){r.i(n.a)(t)?e.sort(t):e.sort()},ListWrapper.toString=function(e){return e.toString()},ListWrapper.toJSON=function(e){return JSON.stringify(e)},ListWrapper.maximum=function(e,t){if(0==e.length)return null;for(var i=null,o=-(1/0),a=0;a<e.length;a++){var s=e[a];if(!r.i(n.b)(s)){var u=t(s);u>o&&(i=s,o=u)}}return i},ListWrapper.flatten=function(e){var t=[];return _flattenArray(e,t),t},ListWrapper.addAll=function(e,t){for(var r=0;r<t.length;r++)e.push(t[r])},ListWrapper}()},function(e,t,r){"use strict";var n=r(0);r.d(t,"c",function(){return i}),r.d(t,"a",function(){return o}),r.d(t,"b",function(){return a});var i=new n.OpaqueToken("EventManagerPlugins"),o=function(){function EventManager(e,t){var r=this;this._zone=t,e.forEach(function(e){return e.manager=r}),this._plugins=e.slice().reverse()}return EventManager.prototype.addEventListener=function(e,t,r){var n=this._findPluginFor(t);return n.addEventListener(e,t,r)},EventManager.prototype.addGlobalEventListener=function(e,t,r){var n=this._findPluginFor(t);return n.addGlobalEventListener(e,t,r)},EventManager.prototype.getZone=function(){return this._zone},EventManager.prototype._findPluginFor=function(e){for(var t=this._plugins,r=0;r<t.length;r++){var n=t[r];if(n.supports(e))return n}throw new Error("No event manager plugin found for event "+e)},EventManager.decorators=[{type:n.Injectable}],EventManager.ctorParameters=[{type:Array,decorators:[{type:n.Inject,args:[i]}]},{type:n.NgZone}],EventManager}(),a=function(){function EventManagerPlugin(){}return EventManagerPlugin.prototype.supports=function(e){return!1},EventManagerPlugin.prototype.addEventListener=function(e,t,r){throw"not implemented"},EventManagerPlugin.prototype.addGlobalEventListener=function(e,t,r){throw"not implemented"},EventManagerPlugin}()},function(e,t,r){"use strict";function createEmptyState(e,t){var r=createEmptyStateSnapshot(e,t),a=new n.BehaviorSubject([new o.c("",{})]),u=new n.BehaviorSubject({}),p=new n.BehaviorSubject({}),f=new n.BehaviorSubject({}),h=new n.BehaviorSubject(""),d=new l(a,u,f,h,p,i.a,t,r.root);return d.snapshot=r.root,new c(new s.b(d,[]),r)}function createEmptyStateSnapshot(e,t){var r={},n={},o={},a="",u=new f([],r,o,a,n,i.a,t,null,e.root,-1,p.empty);return new h("",new s.b(u,[]))}function setRouterStateSnapshot(e,t){t.value._routerState=e,t.children.forEach(function(t){return setRouterStateSnapshot(e,t)})}function serializeNode(e){var t=e.children.length>0?" { "+e.children.map(serializeNode).join(", ")+" } ":"";return""+e.value+t}function advanceActivatedRoute(e){e.snapshot?(r.i(a.d)(e.snapshot.queryParams,e._futureSnapshot.queryParams)||e.queryParams.next(e._futureSnapshot.queryParams),e.snapshot.fragment!==e._futureSnapshot.fragment&&e.fragment.next(e._futureSnapshot.fragment),r.i(a.d)(e.snapshot.params,e._futureSnapshot.params)||(e.params.next(e._futureSnapshot.params),e.data.next(e._futureSnapshot.data)),r.i(a.h)(e.snapshot.url,e._futureSnapshot.url)||e.url.next(e._futureSnapshot.url),e.snapshot=e._futureSnapshot):(e.snapshot=e._futureSnapshot,e.data.next(e._futureSnapshot.data))}var n=r(237),i=(r.n(n),r(45)),o=r(63),a=r(46),s=r(214);r.d(t,"a",function(){return c}),t.f=createEmptyState,r.d(t,"b",function(){return l}),r.d(t,"c",function(){return p}),r.d(t,"d",function(){return f}),r.d(t,"e",function(){return h}),t.g=advanceActivatedRoute;var u=this&&this.__extends||function(e,t){function __(){this.constructor=e}for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r]);e.prototype=null===t?Object.create(t):(__.prototype=t.prototype,new __)},c=function(e){function RouterState(t,r){e.call(this,t),this.snapshot=r,setRouterStateSnapshot(this,t)}return u(RouterState,e),RouterState.prototype.toString=function(){return this.snapshot.toString()},RouterState}(s.a),l=function(){function ActivatedRoute(e,t,r,n,i,o,a,s){this.url=e,this.params=t,this.queryParams=r,this.fragment=n,this.data=i,this.outlet=o,this.component=a,this._futureSnapshot=s}return Object.defineProperty(ActivatedRoute.prototype,"routeConfig",{get:function(){return this._futureSnapshot.routeConfig},enumerable:!0,configurable:!0}),Object.defineProperty(ActivatedRoute.prototype,"root",{get:function(){return this._routerState.root},enumerable:!0,configurable:!0}),Object.defineProperty(ActivatedRoute.prototype,"parent",{get:function(){return this._routerState.parent(this)},enumerable:!0,configurable:!0}),Object.defineProperty(ActivatedRoute.prototype,"firstChild",{get:function(){return this._routerState.firstChild(this)},enumerable:!0,configurable:!0}),Object.defineProperty(ActivatedRoute.prototype,"children",{get:function(){return this._routerState.children(this)},enumerable:!0,configurable:!0}),Object.defineProperty(ActivatedRoute.prototype,"pathFromRoot",{get:function(){return this._routerState.pathFromRoot(this)},enumerable:!0,configurable:!0}),ActivatedRoute.prototype.toString=function(){return this.snapshot?this.snapshot.toString():"Future("+this._futureSnapshot+")"},ActivatedRoute}(),p=function(){function InheritedResolve(e,t){this.parent=e,this.current=t,this.resolvedData={}}return Object.defineProperty(InheritedResolve.prototype,"flattenedResolvedData",{get:function(){return this.parent?r.i(a.g)(this.parent.flattenedResolvedData,this.resolvedData):this.resolvedData},enumerable:!0,configurable:!0}),Object.defineProperty(InheritedResolve,"empty",{get:function(){return new InheritedResolve(null,{})},enumerable:!0,configurable:!0}),InheritedResolve}(),f=function(){function ActivatedRouteSnapshot(e,t,r,n,i,o,a,s,u,c,l){this.url=e,this.params=t,this.queryParams=r,this.fragment=n,this.data=i,this.outlet=o,this.component=a,this._routeConfig=s,this._urlSegment=u,this._lastPathIndex=c,this._resolve=l}return Object.defineProperty(ActivatedRouteSnapshot.prototype,"routeConfig",{get:function(){return this._routeConfig},enumerable:!0,configurable:!0}),Object.defineProperty(ActivatedRouteSnapshot.prototype,"root",{get:function(){return this._routerState.root},enumerable:!0,configurable:!0}),Object.defineProperty(ActivatedRouteSnapshot.prototype,"parent",{get:function(){return this._routerState.parent(this)},enumerable:!0,configurable:!0}),Object.defineProperty(ActivatedRouteSnapshot.prototype,"firstChild",{get:function(){return this._routerState.firstChild(this)},enumerable:!0,configurable:!0}),Object.defineProperty(ActivatedRouteSnapshot.prototype,"children",{get:function(){return this._routerState.children(this)},enumerable:!0,configurable:!0}),Object.defineProperty(ActivatedRouteSnapshot.prototype,"pathFromRoot",{get:function(){return this._routerState.pathFromRoot(this)},enumerable:!0,configurable:!0}),ActivatedRouteSnapshot.prototype.toString=function(){var e=this.url.map(function(e){return e.toString()}).join("/"),t=this._routeConfig?this._routeConfig.path:"";return"Route(url:'"+e+"', path:'"+t+"')"},ActivatedRouteSnapshot}(),h=function(e){function RouterStateSnapshot(t,r){e.call(this,r),this.url=t,setRouterStateSnapshot(this,r)}return u(RouterStateSnapshot,e),RouterStateSnapshot.prototype.toString=function(){return serializeNode(this._root)},RouterStateSnapshot}(s.a)},,,,function(e,t,r){"use strict";var n=this&&this.__extends||function(e,t){function __(){this.constructor=e}for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r]);e.prototype=null===t?Object.create(t):(__.prototype=t.prototype,new __)},i=r(6),o=r(27),a=r(239),s=r(386),u=r(695),c=r(244),l=function(e){function SubjectSubscriber(t){e.call(this,t),this.destination=t}return n(SubjectSubscriber,e),SubjectSubscriber}(o.Subscriber);t.SubjectSubscriber=l;var p=function(e){function Subject(){e.call(this),this.observers=[],this.closed=!1,this.isStopped=!1,this.hasError=!1,this.thrownError=null}return n(Subject,e),Subject.prototype[c.$$rxSubscriber]=function(){return new l(this)},Subject.prototype.lift=function(e){var t=new f(this,this);return t.operator=e,t},Subject.prototype.next=function(e){if(this.closed)throw new s.ObjectUnsubscribedError;if(!this.isStopped)for(var t=this.observers,r=t.length,n=t.slice(),i=0;i<r;i++)n[i].next(e)},Subject.prototype.error=function(e){if(this.closed)throw new s.ObjectUnsubscribedError;this.hasError=!0,this.thrownError=e,this.isStopped=!0;for(var t=this.observers,r=t.length,n=t.slice(),i=0;i<r;i++)n[i].error(e);this.observers.length=0},Subject.prototype.complete=function(){if(this.closed)throw new s.ObjectUnsubscribedError;this.isStopped=!0;for(var e=this.observers,t=e.length,r=e.slice(),n=0;n<t;n++)r[n].complete();this.observers.length=0},Subject.prototype.unsubscribe=function(){this.isStopped=!0,this.closed=!0,this.observers=null},Subject.prototype._subscribe=function(e){if(this.closed)throw new s.ObjectUnsubscribedError;return this.hasError?(e.error(this.thrownError),a.Subscription.EMPTY):this.isStopped?(e.complete(),a.Subscription.EMPTY):(this.observers.push(e),new u.SubjectSubscription(this,e))},Subject.prototype.asObservable=function(){var e=new i.Observable;return e.source=this,e},Subject.create=function(e,t){return new f(e,t)},Subject}(i.Observable);t.Subject=p;var f=function(e){function AnonymousSubject(t,r){e.call(this),this.destination=t,this.source=r}return n(AnonymousSubject,e),AnonymousSubject.prototype.next=function(e){var t=this.destination;t&&t.next&&t.next(e)},AnonymousSubject.prototype.error=function(e){var t=this.destination;t&&t.error&&this.destination.error(e)},AnonymousSubject.prototype.complete=function(){var e=this.destination;e&&e.complete&&this.destination.complete()},AnonymousSubject.prototype._subscribe=function(e){var t=this.source;return t?this.source.subscribe(e):a.Subscription.EMPTY},AnonymousSubject}(p);t.AnonymousSubject=f},function(e,t,r){"use strict";function mergeMap(e,t,r){return void 0===r&&(r=Number.POSITIVE_INFINITY),"number"==typeof t&&(r=t,t=null),this.lift(new a(e,t,r))}var n=this&&this.__extends||function(e,t){function __(){this.constructor=e}for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r]);e.prototype=null===t?Object.create(t):(__.prototype=t.prototype,new __)},i=r(248),o=r(238);t.mergeMap=mergeMap;var a=function(){function MergeMapOperator(e,t,r){void 0===r&&(r=Number.POSITIVE_INFINITY),this.project=e,this.resultSelector=t,this.concurrent=r}return MergeMapOperator.prototype.call=function(e,t){return t._subscribe(new s(e,this.project,this.resultSelector,this.concurrent))},MergeMapOperator}();t.MergeMapOperator=a;var s=function(e){function MergeMapSubscriber(t,r,n,i){void 0===i&&(i=Number.POSITIVE_INFINITY),e.call(this,t),this.project=r,this.resultSelector=n,this.concurrent=i,this.hasCompleted=!1,this.buffer=[],this.active=0,this.index=0}return n(MergeMapSubscriber,e),MergeMapSubscriber.prototype._next=function(e){this.active<this.concurrent?this._tryNext(e):this.buffer.push(e)},MergeMapSubscriber.prototype._tryNext=function(e){var t,r=this.index++;try{t=this.project(e,r)}catch(e){return void this.destination.error(e)}this.active++,this._innerSub(t,e,r)},MergeMapSubscriber.prototype._innerSub=function(e,t,r){this.add(i.subscribeToResult(this,e,t,r))},MergeMapSubscriber.prototype._complete=function(){this.hasCompleted=!0,0===this.active&&0===this.buffer.length&&this.destination.complete()},MergeMapSubscriber.prototype.notifyNext=function(e,t,r,n,i){this.resultSelector?this._notifyResultSelector(e,t,r,n):this.destination.next(t)},MergeMapSubscriber.prototype._notifyResultSelector=function(e,t,r,n){var i;try{i=this.resultSelector(e,t,r,n)}catch(e){return void this.destination.error(e)}this.destination.next(i)},MergeMapSubscriber.prototype.notifyComplete=function(e){var t=this.buffer;this.remove(e),this.active--,t.length>0?this._next(t.shift()):0===this.active&&this.hasCompleted&&this.destination.complete()},MergeMapSubscriber}(o.OuterSubscriber);t.MergeMapSubscriber=s},function(e,t,r){"use strict";var n=r(489);r.d(t,"BrowserXhr",function(){return n.a}),r.d(t,"JSONPBackend",function(){return n.b}),r.d(t,"JSONPConnection",function(){return n.c}),r.d(t,"CookieXSRFStrategy",function(){return n.d}),r.d(t,"XHRBackend",function(){return n.e}),r.d(t,"XHRConnection",function(){return n.f}),r.d(t,"BaseRequestOptions",function(){return n.g}),r.d(t,"RequestOptions",function(){return n.h}),r.d(t,"BaseResponseOptions",function(){return n.i}),r.d(t,"ResponseOptions",function(){return n.j}),r.d(t,"ReadyState",function(){return n.k}),r.d(t,"RequestMethod",function(){return n.l}),r.d(t,"ResponseContentType",function(){return n.m}),r.d(t,"ResponseType",function(){return n.n}),r.d(t,"Headers",function(){return n.o}),r.d(t,"Http",function(){return n.p}),r.d(t,"Jsonp",function(){return n.q}),r.d(t,"HttpModule",function(){return n.r}),r.d(t,"JsonpModule",function(){return n.s}),r.d(t,"Connection",function(){return n.t}),r.d(t,"ConnectionBackend",function(){return n.u}),r.d(t,"XSRFStrategy",function(){return n.v}),r.d(t,"Request",function(){return n.w}),r.d(t,"Response",function(){return n.x}),r.d(t,"QueryEncoder",function(){return n.y}),r.d(t,"URLSearchParams",function(){return n.z})},function(e,t,r){"use strict";var n=r(504);r.d(t,"BrowserModule",function(){return n.a}),r.d(t,"platformBrowser",function(){return n.b}),r.d(t,"Title",function(){return n.c}),r.d(t,"disableDebugTools",function(){return n.d}),r.d(t,"enableDebugTools",function(){return n.e}),r.d(t,"AnimationDriver",function(){return n.f}),r.d(t,"By",function(){return n.g}),r.d(t,"NgProbeToken",function(){return n.h}),r.d(t,"DOCUMENT",function(){return n.i}),r.d(t,"EVENT_MANAGER_PLUGINS",function(){return n.j}),r.d(t,"EventManager",function(){return n.k}),r.d(t,"HAMMER_GESTURE_CONFIG",function(){return n.l}),r.d(t,"HammerGestureConfig",function(){return n.m}),r.d(t,"DomSanitizer",function(){return n.n}),r.d(t,"__platform_browser_private__",function(){return n.o})},function(e,t,r){"use strict";r.d(t,"a",function(){return n});var n=function(){function ElementSchemaRegistry(){}return ElementSchemaRegistry}()},function(e,t,r){"use strict";function getUrlScheme(e){var t=_split(e);return t&&t[o.Scheme]||""}function _buildFromEncodedParts(e,t,n,o,a,s,u){var c=[];return r.i(i.a)(e)&&c.push(e+":"),r.i(i.a)(n)&&(c.push("//"),r.i(i.a)(t)&&c.push(t+"@"),c.push(n),r.i(i.a)(o)&&c.push(":"+o)),r.i(i.a)(a)&&c.push(a),r.i(i.a)(s)&&c.push("?"+s),r.i(i.a)(u)&&c.push("#"+u),c.join("")}function _split(e){return e.match(c)}function _removeDotSegments(e){if("/"==e)return"/";for(var t="/"==e[0]?"/":"",r="/"===e[e.length-1]?"/":"",n=e.split("/"),i=[],o=0,a=0;a<n.length;a++){var s=n[a];switch(s){case"":case".":break;case"..":i.length>0?i.pop():o++;break;default:i.push(s)}}if(""==t){for(;o-- >0;)i.unshift("..");0===i.length&&i.push(".")}return t+i.join("/")+r}function _joinAndCanonicalizePath(e){var t=e[o.Path];return t=r.i(i.b)(t)?"":_removeDotSegments(t),e[o.Path]=t,_buildFromEncodedParts(e[o.Scheme],e[o.UserInfo],e[o.Domain],e[o.Port],t,e[o.QueryData],e[o.Fragment])}function _resolveUrl(e,t){var n=_split(encodeURI(t)),a=_split(e);if(r.i(i.a)(n[o.Scheme]))return _joinAndCanonicalizePath(n);n[o.Scheme]=a[o.Scheme];for(var s=o.Scheme;s<=o.Port;s++)r.i(i.b)(n[s])&&(n[s]=a[s]);if("/"==n[o.Path][0])return _joinAndCanonicalizePath(n);var u=a[o.Path];r.i(i.b)(u)&&(u="/");var c=u.lastIndexOf("/");return u=u.substring(0,c+1)+n[o.Path],n[o.Path]=u,_joinAndCanonicalizePath(n)}var n=r(0),i=r(2);r.d(t,"c",function(){return s}),r.d(t,"a",function(){return u}),t.b=getUrlScheme;var o,a="asset:",s={provide:n.PACKAGE_ROOT_URL,useValue:"/"},u=function(){function UrlResolver(e){void 0===e&&(e=null),this._packagePrefix=e}return UrlResolver.prototype.resolve=function(e,t){var n=t;r.i(i.a)(e)&&e.length>0&&(n=_resolveUrl(e,n));var s=_split(n),u=this._packagePrefix;if(r.i(i.a)(u)&&r.i(i.a)(s)&&"package"==s[o.Scheme]){var c=s[o.Path];if(this._packagePrefix!==a)return u=u.replace(/\/+$/,""),c=c.replace(/^\/+/,""),u+"/"+c;var l=c.split(/\//);n="asset:"+l[0]+"/lib/"+l.slice(1).join("/")}return n},UrlResolver.decorators=[{type:n.Injectable}],UrlResolver.ctorParameters=[{type:void 0,decorators:[{type:n.Inject,args:[n.PACKAGE_ROOT_URL]}]}],UrlResolver}(),c=new RegExp("^(?:([^:/?#.]+):)?(?://(?:([^/?#]*)@)?([\\w\\d\\-\\u0100-\\uffff.%]*)(?::([0-9]+))?)?([^?#]+)?(?:\\?([^#]*))?(?:#(.*))?$");!function(e){e[e.Scheme=1]="Scheme",e[e.UserInfo=2]="UserInfo",e[e.Domain=3]="Domain",e[e.Port=4]="Port",e[e.Path=5]="Path",e[e.QueryData=6]="QueryData",e[e.Fragment=7]="Fragment"}(o||(o={}))},function(e,t,r){"use strict";function getPropertyInView(e,t,i){if(t===i)return e;for(var a=o.n,s=t;s!==i&&r.i(n.a)(s.declarationElement.view);)s=s.declarationElement.view,a=a.prop("parent");if(s!==i)throw new Error("Internal error: Could not calculate a property in a parent view: "+e);return e.visitExpression(new u(a,i),null)}function injectFromViewParentInjector(e,t){var n=[r.i(a.f)(e)];return t&&n.push(o.h),o.n.prop("parentInjector").callMethod("get",n)}function getViewFactoryName(e,t){return"viewFactory_"+e.type.name+t}function createFlatArray(e){for(var t=[],r=o.g([]),n=0;n<e.length;n++){var i=e[n];i.type instanceof o.A?(t.length>0&&(r=r.callMethod(o.B.ConcatArray,[o.g(t)]),t=[]),r=r.callMethod(o.B.ConcatArray,[i])):t.push(i)}return t.length>0&&(r=r.callMethod(o.B.ConcatArray,[o.g(t)])),r}function createPureProxy(e,t,n,a){a.fields.push(new o.o(n.name,null));var s=t<i.b.pureProxies.length?i.b.pureProxies[t]:null;if(!s)throw new Error("Unsupported number of argument for pure functions: "+t);a.createMethod.addStmt(o.n.prop(n.name).set(o.b(r.i(i.d)(s)).callFn([e])).toStmt())}var n=r(2),i=r(13),o=r(8),a=r(23);t.a=getPropertyInView,t.b=injectFromViewParentInjector,t.d=getViewFactoryName,t.e=createFlatArray,t.c=createPureProxy;var s=this&&this.__extends||function(e,t){function __(){this.constructor=e}for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r]);e.prototype=null===t?Object.create(t):(__.prototype=t.prototype,new __)},u=function(e){function _ReplaceViewTransformer(t,r){e.call(this),this._viewExpr=t,this._view=r}return s(_ReplaceViewTransformer,e),_ReplaceViewTransformer.prototype._isThis=function(e){return e instanceof o.x&&e.builtin===o.y.This},_ReplaceViewTransformer.prototype.visitReadVarExpr=function(e,t){return this._isThis(e)?this._viewExpr:e},_ReplaceViewTransformer.prototype.visitReadPropExpr=function(t,r){return this._isThis(t.receiver)&&(this._view.fields.some(function(e){return e.name==t.name})||this._view.getters.some(function(e){return e.name==t.name}))?this._viewExpr.cast(this._view.classType).prop(t.name):e.prototype.visitReadPropExpr.call(this,t,r)},_ReplaceViewTransformer}(o.z)},function(e,t,r){"use strict";function _throwError(){throw new Error("Runtime compiler is not loaded")}var n=r(33),i=r(29),o=r(3);r.d(t,"c",function(){return s}),r.d(t,"d",function(){return u}),r.d(t,"b",function(){return c}),r.d(t,"e",function(){return l}),r.d(t,"a",function(){return p});var a=this&&this.__extends||function(e,t){function __(){this.constructor=e}for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r]);e.prototype=null===t?Object.create(t):(__.prototype=t.prototype,new __)},s=function(e){function ComponentStillLoadingError(t){e.call(this,"Can't compile synchronously as "+r.i(o.b)(t)+" is still being loaded!"),this.compType=t}return a(ComponentStillLoadingError,e),ComponentStillLoadingError}(i.b),u=function(){function ModuleWithComponentFactories(e,t){this.ngModuleFactory=e,this.componentFactories=t}return ModuleWithComponentFactories}(),c=function(){function Compiler(){}return Compiler.prototype.compileModuleSync=function(e){throw _throwError()},Compiler.prototype.compileModuleAsync=function(e){throw _throwError()},Compiler.prototype.compileModuleAndAllComponentsSync=function(e){throw _throwError()},Compiler.prototype.compileModuleAndAllComponentsAsync=function(e){throw _throwError()},Compiler.prototype.clearCache=function(){},Compiler.prototype.clearCacheFor=function(e){},Compiler}(),l=new n.a("compilerOptions"),p=function(){function CompilerFactory(){}return CompilerFactory}()},function(e,t,r){"use strict";var n=r(43),i=r(54);r.d(t,"a",function(){return a});var o=this&&this.__extends||function(e,t){function __(){this.constructor=e}for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r]);e.prototype=null===t?Object.create(t):(__.prototype=t.prototype,new __)},a=function(e){function AbstractFormGroupDirective(){e.apply(this,arguments)}return o(AbstractFormGroupDirective,e),AbstractFormGroupDirective.prototype.ngOnInit=function(){this._checkParentType(),this.formDirective.addFormGroup(this)},AbstractFormGroupDirective.prototype.ngOnDestroy=function(){this.formDirective&&this.formDirective.removeFormGroup(this)},Object.defineProperty(AbstractFormGroupDirective.prototype,"control",{get:function(){return this.formDirective.getFormGroup(this)},enumerable:!0,configurable:!0}),Object.defineProperty(AbstractFormGroupDirective.prototype,"path",{get:function(){return r.i(i.a)(this.name,this._parent)},enumerable:!0,configurable:!0}),Object.defineProperty(AbstractFormGroupDirective.prototype,"formDirective",{get:function(){return this._parent?this._parent.formDirective:null},enumerable:!0,configurable:!0}),Object.defineProperty(AbstractFormGroupDirective.prototype,"validator",{get:function(){return r.i(i.b)(this._validators)},enumerable:!0,configurable:!0}),Object.defineProperty(AbstractFormGroupDirective.prototype,"asyncValidator",{get:function(){return r.i(i.c)(this._asyncValidators)},enumerable:!0,configurable:!0}),AbstractFormGroupDirective.prototype._checkParentType=function(){},AbstractFormGroupDirective}(n.a)},function(e,t,r){"use strict";var n=r(0),i=r(79),o=r(80),a=r(24),s=r(140),u=r(37),c=r(43),l=r(54);r.d(t,"a",function(){return d});var p=this&&this.__extends||function(e,t){function __(){this.constructor=e}for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r]);e.prototype=null===t?Object.create(t):(__.prototype=t.prototype,new __)},f={provide:c.a,useExisting:r.i(n.forwardRef)(function(){return d})},h=Promise.resolve(null),d=function(e){function NgForm(t,n){e.call(this),this._submitted=!1,this.ngSubmit=new i.a,this.form=new s.a({},r.i(l.b)(t),r.i(l.c)(n))}return p(NgForm,e),Object.defineProperty(NgForm.prototype,"submitted",{get:function(){return this._submitted},enumerable:!0,configurable:!0}),Object.defineProperty(NgForm.prototype,"formDirective",{get:function(){return this},enumerable:!0,configurable:!0}),Object.defineProperty(NgForm.prototype,"control",{get:function(){return this.form},enumerable:!0,configurable:!0}),Object.defineProperty(NgForm.prototype,"path",{get:function(){return[]},enumerable:!0,configurable:!0}),Object.defineProperty(NgForm.prototype,"controls",{get:function(){return this.form.controls},enumerable:!0,configurable:!0}),NgForm.prototype.addControl=function(e){var t=this;h.then(function(){var n=t._findContainer(e.path);e._control=n.registerControl(e.name,e.control),r.i(l.d)(e.control,e),e.control.updateValueAndValidity({emitEvent:!1})})},NgForm.prototype.getControl=function(e){return this.form.get(e.path)},NgForm.prototype.removeControl=function(e){var t=this;h.then(function(){var n=t._findContainer(e.path);r.i(a.a)(n)&&n.removeControl(e.name)})},NgForm.prototype.addFormGroup=function(e){var t=this;h.then(function(){var n=t._findContainer(e.path),i=new s.a({});r.i(l.e)(i,e),n.registerControl(e.name,i),i.updateValueAndValidity({emitEvent:!1})})},NgForm.prototype.removeFormGroup=function(e){var t=this;h.then(function(){var n=t._findContainer(e.path);r.i(a.a)(n)&&n.removeControl(e.name)})},NgForm.prototype.getFormGroup=function(e){return this.form.get(e.path)},NgForm.prototype.updateModel=function(e,t){var r=this;h.then(function(){var n=r.form.get(e.path);n.setValue(t)})},NgForm.prototype.setValue=function(e){this.control.setValue(e)},NgForm.prototype.onSubmit=function(e){return this._submitted=!0,this.ngSubmit.emit(e),!1},NgForm.prototype.onReset=function(){this.resetForm()},NgForm.prototype.resetForm=function(e){void 0===e&&(e=void 0),this.form.reset(e),this._submitted=!1},NgForm.prototype._findContainer=function(e){return e.pop(),o.b.isEmpty(e)?this.form:this.form.get(e)},NgForm.decorators=[{type:n.Directive,args:[{selector:"form:not([ngNoForm]):not([formGroup]),ngForm,[ngForm]",providers:[f],host:{"(submit)":"onSubmit($event)","(reset)":"onReset()"},outputs:["ngSubmit"],exportAs:"ngForm"}]}],NgForm.ctorParameters=[{type:Array,decorators:[{type:n.Optional},{type:n.Self},{type:n.Inject,args:[u.b]}]},{type:Array,decorators:[{type:n.Optional},{type:n.Self},{type:n.Inject,args:[u.c]}]}],NgForm}(c.a)},function(e,t,r){"use strict";var n=r(0),i=r(80),o=r(36),a=r(62);r.d(t,"b",function(){return u}),r.d(t,"a",function(){return c});var s={provide:o.a,useExisting:r.i(n.forwardRef)(function(){return c}),multi:!0},u=function(){function RadioControlRegistry(){this._accessors=[]}return RadioControlRegistry.prototype.add=function(e,t){this._accessors.push([e,t])},RadioControlRegistry.prototype.remove=function(e){for(var t=-1,r=0;r<this._accessors.length;++r)this._accessors[r][1]===e&&(t=r);i.b.removeAt(this._accessors,t)},RadioControlRegistry.prototype.select=function(e){var t=this;this._accessors.forEach(function(r){t._isSameGroup(r,e)&&r[1]!==e&&r[1].fireUncheck(e.value)})},RadioControlRegistry.prototype._isSameGroup=function(e,t){return!!e[0].control&&(e[0]._parent===t._control._parent&&e[1].name===t.name)},RadioControlRegistry.decorators=[{type:n.Injectable}],RadioControlRegistry.ctorParameters=[],RadioControlRegistry}(),c=function(){function RadioControlValueAccessor(e,t,r,n){this._renderer=e,this._elementRef=t,this._registry=r,this._injector=n,this.onChange=function(){},this.onTouched=function(){}}return RadioControlValueAccessor.prototype.ngOnInit=function(){this._control=this._injector.get(a.a),this._checkName(),this._registry.add(this._control,this)},RadioControlValueAccessor.prototype.ngOnDestroy=function(){this._registry.remove(this)},RadioControlValueAccessor.prototype.writeValue=function(e){this._state=e===this.value,this._renderer.setElementProperty(this._elementRef.nativeElement,"checked",this._state)},RadioControlValueAccessor.prototype.registerOnChange=function(e){var t=this;this._fn=e,this.onChange=function(){e(t.value),t._registry.select(t)}},RadioControlValueAccessor.prototype.fireUncheck=function(e){this.writeValue(e)},RadioControlValueAccessor.prototype.registerOnTouched=function(e){this.onTouched=e},RadioControlValueAccessor.prototype.setDisabledState=function(e){this._renderer.setElementProperty(this._elementRef.nativeElement,"disabled",e)},RadioControlValueAccessor.prototype._checkName=function(){this.name&&this.formControlName&&this.name!==this.formControlName&&this._throwNameError(),!this.name&&this.formControlName&&(this.name=this.formControlName)},RadioControlValueAccessor.prototype._throwNameError=function(){throw new Error('\n If you define both a name and a formControlName attribute on your radio button, their values\n must match. Ex: <input type="radio" formControlName="food" name="food">\n ')},RadioControlValueAccessor.decorators=[{type:n.Directive,args:[{selector:"input[type=radio][formControlName],input[type=radio][formControl],input[type=radio][ngModel]",host:{"(change)":"onChange()","(blur)":"onTouched()"},providers:[s]}]}],RadioControlValueAccessor.ctorParameters=[{type:n.Renderer},{type:n.ElementRef},{type:u},{type:n.Injector}],RadioControlValueAccessor.propDecorators={name:[{type:n.Input}],formControlName:[{type:n.Input}],value:[{type:n.Input}]},RadioControlValueAccessor}()},function(e,t,r){"use strict";var n=r(0),i=r(79),o=r(80),a=r(37),s=r(43),u=r(137),c=r(54);r.d(t,"a",function(){return f});var l=this&&this.__extends||function(e,t){function __(){this.constructor=e}for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r]);e.prototype=null===t?Object.create(t):(__.prototype=t.prototype,new __)},p={provide:s.a,useExisting:r.i(n.forwardRef)(function(){return f})},f=function(e){function FormGroupDirective(t,r){e.call(this),this._validators=t,this._asyncValidators=r,this._submitted=!1,this.directives=[],this.form=null,this.ngSubmit=new i.a}return l(FormGroupDirective,e),FormGroupDirective.prototype.ngOnChanges=function(e){this._checkFormPresent(),e.hasOwnProperty("form")&&(this._updateValidators(),this._updateDomValue(),this._updateRegistrations())},Object.defineProperty(FormGroupDirective.prototype,"submitted",{get:function(){return this._submitted},enumerable:!0,configurable:!0}),Object.defineProperty(FormGroupDirective.prototype,"formDirective",{get:function(){return this},enumerable:!0,configurable:!0}),Object.defineProperty(FormGroupDirective.prototype,"control",{get:function(){return this.form},enumerable:!0,configurable:!0}),Object.defineProperty(FormGroupDirective.prototype,"path",{get:function(){return[]},enumerable:!0,configurable:!0}),FormGroupDirective.prototype.addControl=function(e){var t=this.form.get(e.path);return r.i(c.d)(t,e),t.updateValueAndValidity({emitEvent:!1}),this.directives.push(e),t},FormGroupDirective.prototype.getControl=function(e){return this.form.get(e.path)},FormGroupDirective.prototype.removeControl=function(e){o.b.remove(this.directives,e)},FormGroupDirective.prototype.addFormGroup=function(e){var t=this.form.get(e.path);r.i(c.e)(t,e),t.updateValueAndValidity({emitEvent:!1})},FormGroupDirective.prototype.removeFormGroup=function(e){},FormGroupDirective.prototype.getFormGroup=function(e){return this.form.get(e.path)},FormGroupDirective.prototype.addFormArray=function(e){var t=this.form.get(e.path);r.i(c.e)(t,e),t.updateValueAndValidity({emitEvent:!1})},FormGroupDirective.prototype.removeFormArray=function(e){},FormGroupDirective.prototype.getFormArray=function(e){return this.form.get(e.path)},FormGroupDirective.prototype.updateModel=function(e,t){var r=this.form.get(e.path);r.setValue(t)},FormGroupDirective.prototype.onSubmit=function(e){return this._submitted=!0,this.ngSubmit.emit(e),!1},FormGroupDirective.prototype.onReset=function(){this.resetForm()},FormGroupDirective.prototype.resetForm=function(e){void 0===e&&(e=void 0),this.form.reset(e),this._submitted=!1},FormGroupDirective.prototype._updateDomValue=function(){var e=this;this.directives.forEach(function(t){var n=e.form.get(t.path);t._control!==n&&(r.i(c.h)(t._control,t),n&&r.i(c.d)(n,t),t._control=n)}),this.form._updateTreeValidity({emitEvent:!1})},FormGroupDirective.prototype._updateRegistrations=function(){var e=this;this.form._registerOnCollectionChange(function(){return e._updateDomValue()}),this._oldForm&&this._oldForm._registerOnCollectionChange(function(){}),this._oldForm=this.form},FormGroupDirective.prototype._updateValidators=function(){var e=r.i(c.b)(this._validators);this.form.validator=a.a.compose([this.form.validator,e]);var t=r.i(c.c)(this._asyncValidators);this.form.asyncValidator=a.a.composeAsync([this.form.asyncValidator,t])},FormGroupDirective.prototype._checkFormPresent=function(){this.form||u.a.missingFormException()},FormGroupDirective.decorators=[{type:n.Directive,args:[{selector:"[formGroup]",providers:[p],host:{"(submit)":"onSubmit($event)","(reset)":"onReset()"},exportAs:"ngForm"}]}],FormGroupDirective.ctorParameters=[{type:Array,decorators:[{type:n.Optional},{type:n.Self},{type:n.Inject,args:[a.b]}]},{type:Array,decorators:[{type:n.Optional},{type:n.Self},{type:n.Inject,args:[a.c]}]}],FormGroupDirective.propDecorators={form:[{type:n.Input,args:["formGroup"]}],ngSubmit:[{type:n.Output}]},FormGroupDirective}(s.a)},function(e,t,r){"use strict";function _hasInvalidParent(e){return!(e instanceof f||e instanceof c.a||e instanceof d); }var n=r(0),i=r(37),o=r(94),a=r(43),s=r(137),u=r(54),c=r(97);r.d(t,"a",function(){return f}),r.d(t,"b",function(){return d});var l=this&&this.__extends||function(e,t){function __(){this.constructor=e}for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r]);e.prototype=null===t?Object.create(t):(__.prototype=t.prototype,new __)},p={provide:a.a,useExisting:r.i(n.forwardRef)(function(){return f})},f=function(e){function FormGroupName(t,r,n){e.call(this),this._parent=t,this._validators=r,this._asyncValidators=n}return l(FormGroupName,e),FormGroupName.prototype._checkParentType=function(){_hasInvalidParent(this._parent)&&s.a.groupParentException()},FormGroupName.decorators=[{type:n.Directive,args:[{selector:"[formGroupName]",providers:[p]}]}],FormGroupName.ctorParameters=[{type:a.a,decorators:[{type:n.Optional},{type:n.Host},{type:n.SkipSelf}]},{type:Array,decorators:[{type:n.Optional},{type:n.Self},{type:n.Inject,args:[i.b]}]},{type:Array,decorators:[{type:n.Optional},{type:n.Self},{type:n.Inject,args:[i.c]}]}],FormGroupName.propDecorators={name:[{type:n.Input,args:["formGroupName"]}]},FormGroupName}(o.a),h={provide:a.a,useExisting:r.i(n.forwardRef)(function(){return d})},d=function(e){function FormArrayName(t,r,n){e.call(this),this._parent=t,this._validators=r,this._asyncValidators=n}return l(FormArrayName,e),FormArrayName.prototype.ngOnInit=function(){this._checkParentType(),this.formDirective.addFormArray(this)},FormArrayName.prototype.ngOnDestroy=function(){this.formDirective&&this.formDirective.removeFormArray(this)},Object.defineProperty(FormArrayName.prototype,"control",{get:function(){return this.formDirective.getFormArray(this)},enumerable:!0,configurable:!0}),Object.defineProperty(FormArrayName.prototype,"formDirective",{get:function(){return this._parent?this._parent.formDirective:null},enumerable:!0,configurable:!0}),Object.defineProperty(FormArrayName.prototype,"path",{get:function(){return r.i(u.a)(this.name,this._parent)},enumerable:!0,configurable:!0}),Object.defineProperty(FormArrayName.prototype,"validator",{get:function(){return r.i(u.b)(this._validators)},enumerable:!0,configurable:!0}),Object.defineProperty(FormArrayName.prototype,"asyncValidator",{get:function(){return r.i(u.c)(this._asyncValidators)},enumerable:!0,configurable:!0}),FormArrayName.prototype._checkParentType=function(){_hasInvalidParent(this._parent)&&s.a.arrayParentException()},FormArrayName.decorators=[{type:n.Directive,args:[{selector:"[formArrayName]",providers:[h]}]}],FormArrayName.ctorParameters=[{type:a.a,decorators:[{type:n.Optional},{type:n.Host},{type:n.SkipSelf}]},{type:Array,decorators:[{type:n.Optional},{type:n.Self},{type:n.Inject,args:[i.b]}]},{type:Array,decorators:[{type:n.Optional},{type:n.Self},{type:n.Inject,args:[i.c]}]}],FormArrayName.propDecorators={name:[{type:n.Input,args:["formArrayName"]}]},FormArrayName}(a.a)},function(e,t,r){"use strict";var n=r(487);r.d(t,"a",function(){return i});var i=function(){function Headers(e){var t=this;if(this._headers=new Map,this._normalizedNames=new Map,e)return e instanceof Headers?void e._headers.forEach(function(e,r){e.forEach(function(e){return t.append(r,e)})}):void Object.keys(e).forEach(function(r){var n=Array.isArray(e[r])?e[r]:[e[r]];t.delete(r),n.forEach(function(e){return t.append(r,e)})})}return Headers.fromResponseHeaderString=function(e){var t=new Headers;return e.split("\n").forEach(function(e){var r=e.indexOf(":");if(r>0){var n=e.slice(0,r),i=e.slice(r+1).trim();t.set(n,i)}}),t},Headers.prototype.append=function(e,t){var r=this.getAll(e);null===r?this.set(e,t):r.push(t)},Headers.prototype.delete=function(e){var t=e.toLowerCase();this._normalizedNames.delete(t),this._headers.delete(t)},Headers.prototype.forEach=function(e){var t=this;this._headers.forEach(function(r,n){return e(r,t._normalizedNames.get(n),t._headers)})},Headers.prototype.get=function(e){var t=this.getAll(e);return null===t?null:t.length>0?t[0]:null},Headers.prototype.has=function(e){return this._headers.has(e.toLowerCase())},Headers.prototype.keys=function(){return n.a.values(this._normalizedNames)},Headers.prototype.set=function(e,t){Array.isArray(t)?t.length&&this._headers.set(e.toLowerCase(),[t.join(",")]):this._headers.set(e.toLowerCase(),[t]),this.mayBeSetNormalizedName(e)},Headers.prototype.values=function(){return n.a.values(this._headers)},Headers.prototype.toJSON=function(){var e=this,t={};return this._headers.forEach(function(r,n){var i=[];r.forEach(function(e){return i.push.apply(i,e.split(","))}),t[e._normalizedNames.get(n)]=i}),t},Headers.prototype.getAll=function(e){return this.has(e)?this._headers.get(e.toLowerCase()):null},Headers.prototype.entries=function(){throw new Error('"entries" method is not implemented on Headers class')},Headers.prototype.mayBeSetNormalizedName=function(e){var t=e.toLowerCase();this._normalizedNames.has(t)||this._normalizedNames.set(t,e)},Headers}()},function(e,t,r){"use strict";r.d(t,"a",function(){return n}),r.d(t,"c",function(){return i}),r.d(t,"b",function(){return o});var n=function(){function ConnectionBackend(){}return ConnectionBackend}(),i=function(){function Connection(){}return Connection}(),o=function(){function XSRFStrategy(){}return XSRFStrategy}()},function(e,t,r){"use strict";function defaultErrorHandler(e){throw e}function parentLoadedConfig(e){for(var t=e.parent;t;){var r=t._routeConfig;if(r&&r._loadedConfig)return r._loadedConfig;if(r&&r.component)return null;t=t.parent}return null}function closestLoadedConfig(e){if(!e)return null;for(var t=e.parent;t;){var r=t._routeConfig;if(r&&r._loadedConfig)return r._loadedConfig;t=t.parent}return null}function nodeChildrenAsMap(e){return e?e.children.reduce(function(e,t){return e[t.value.outlet]=t,e},{}):{}}function getOutlet(e,t){var r=e._outlets[t.outlet];if(!r){var n=t.component.name;throw t.outlet===w.a?new Error("Cannot find primary outlet to load '"+n+"'"):new Error("Cannot find the outlet "+t.outlet+" to load '"+n+"'")}return r}var n=r(0),i=r(86),o=(r.n(i),r(240)),a=(r.n(o),r(71)),s=(r.n(a),r(384)),u=(r.n(s),r(385)),c=(r.n(u),r(112)),l=(r.n(c),r(157)),p=(r.n(l),r(87)),f=(r.n(p),r(712)),h=(r.n(f),r(508)),d=r(509),m=r(510),v=r(511),y=r(514),g=r(102),_=r(145),b=r(82),w=r(45),C=r(63),E=r(46);r.d(t,"f",function(){return S}),r.d(t,"b",function(){return A}),r.d(t,"c",function(){return P}),r.d(t,"d",function(){return x}),r.d(t,"e",function(){return T}),r.d(t,"a",function(){return O});var S=function(){function NavigationStart(e,t){this.id=e,this.url=t}return NavigationStart.prototype.toString=function(){return"NavigationStart(id: "+this.id+", url: '"+this.url+"')"},NavigationStart}(),A=function(){function NavigationEnd(e,t,r){this.id=e,this.url=t,this.urlAfterRedirects=r}return NavigationEnd.prototype.toString=function(){return"NavigationEnd(id: "+this.id+", url: '"+this.url+"', urlAfterRedirects: '"+this.urlAfterRedirects+"')"},NavigationEnd}(),P=function(){function NavigationCancel(e,t,r){this.id=e,this.url=t,this.reason=r}return NavigationCancel.prototype.toString=function(){return"NavigationCancel(id: "+this.id+", url: '"+this.url+"')"},NavigationCancel}(),x=function(){function NavigationError(e,t,r){this.id=e,this.url=t,this.error=r}return NavigationError.prototype.toString=function(){return"NavigationError(id: "+this.id+", url: '"+this.url+"', error: "+this.error+")"},NavigationError}(),T=function(){function RoutesRecognized(e,t,r,n){this.id=e,this.url=t,this.urlAfterRedirects=r,this.state=n}return RoutesRecognized.prototype.toString=function(){return"RoutesRecognized(id: "+this.id+", url: '"+this.url+"', urlAfterRedirects: '"+this.urlAfterRedirects+"', state: "+this.state+")"},RoutesRecognized}(),O=function(){function Router(e,t,n,o,a,s,u,c){this.rootComponentType=e,this.urlSerializer=t,this.outletMap=n,this.location=o,this.injector=a,this.config=c,this.navigationId=0,this.errorHandler=defaultErrorHandler,this.navigated=!1,this.resetConfig(c),this.routerEvents=new i.Subject,this.currentUrlTree=r.i(C.e)(),this.configLoader=new g.b(s,u),this.currentRouterState=r.i(b.f)(this.currentUrlTree,this.rootComponentType)}return Router.prototype.resetRootComponentType=function(e){this.rootComponentType=e,this.currentRouterState.root.component=this.rootComponentType},Router.prototype.initialNavigation=function(){this.setUpLocationChangeListener(),this.navigateByUrl(this.location.path(!0),{replaceUrl:!0})},Router.prototype.setUpLocationChangeListener=function(){var e=this;this.locationSubscription=this.location.subscribe(Zone.current.wrap(function(t){var r=e.urlSerializer.parse(t.url);return e.currentUrlTree.toString()!==r.toString()?e.scheduleNavigation(r,{skipLocationChange:t.pop,replaceUrl:!0}):null}))},Object.defineProperty(Router.prototype,"routerState",{get:function(){return this.currentRouterState},enumerable:!0,configurable:!0}),Object.defineProperty(Router.prototype,"url",{get:function(){return this.serializeUrl(this.currentUrlTree)},enumerable:!0,configurable:!0}),Object.defineProperty(Router.prototype,"events",{get:function(){return this.routerEvents},enumerable:!0,configurable:!0}),Router.prototype.resetConfig=function(e){r.i(d.a)(e),this.config=e},Router.prototype.ngOnDestroy=function(){this.dispose()},Router.prototype.dispose=function(){this.locationSubscription.unsubscribe()},Router.prototype.createUrlTree=function(e,t){var n=void 0===t?{}:t,i=n.relativeTo,o=n.queryParams,a=n.fragment,s=n.preserveQueryParams,u=n.preserveFragment,c=i?i:this.routerState.root,l=s?this.currentUrlTree.queryParams:o,p=u?this.currentUrlTree.fragment:a;return r.i(v.a)(c,this.currentUrlTree,e,l,p)},Router.prototype.navigateByUrl=function(e,t){if(void 0===t&&(t={skipLocationChange:!1}),e instanceof C.b)return this.scheduleNavigation(e,t);var r=this.urlSerializer.parse(e);return this.scheduleNavigation(r,t)},Router.prototype.navigate=function(e,t){return void 0===t&&(t={skipLocationChange:!1}),this.scheduleNavigation(this.createUrlTree(e,t),t)},Router.prototype.serializeUrl=function(e){return this.urlSerializer.serialize(e)},Router.prototype.parseUrl=function(e){return this.urlSerializer.parse(e)},Router.prototype.isActive=function(e,t){if(e instanceof C.b)return r.i(C.f)(this.currentUrlTree,e,t);var n=this.urlSerializer.parse(e);return r.i(C.f)(this.currentUrlTree,n,t)},Router.prototype.scheduleNavigation=function(e,t){var r=this,n=++this.navigationId;return this.routerEvents.next(new S(n,this.serializeUrl(e))),Promise.resolve().then(function(i){return r.runNavigate(e,t.skipLocationChange,t.replaceUrl,n)})},Router.prototype.runNavigate=function(e,t,n,i){var o=this;return i!==this.navigationId?(this.location.go(this.urlSerializer.serialize(this.currentUrlTree)),this.routerEvents.next(new P(i,this.serializeUrl(e),"Navigation ID "+i+" is not equal to the current navigation id "+this.navigationId)),Promise.resolve(!1)):new Promise(function(s,u){var l,f,d,v,g=o.currentRouterState,_=o.currentUrlTree,b=r.i(h.a)(o.injector,o.configLoader,e,o.config),C=p.mergeMap.call(b,function(e){return v=e,r.i(y.a)(o.rootComponentType,o.config,v,o.serializeUrl(v))}),E=c.map.call(C,function(t){return o.routerEvents.next(new T(i,o.serializeUrl(e),o.serializeUrl(v),t)),t}),S=c.map.call(E,function(e){return r.i(m.a)(e,o.currentRouterState)}),O=c.map.call(S,function(e){l=e,d=new N(l.snapshot,o.currentRouterState.snapshot,o.injector),d.traverse(o.outletMap)}),R=p.mergeMap.call(O,function(){return d.checkGuards()}),M=p.mergeMap.call(R,function(e){return e?c.map.call(d.resolveData(),function(){return e}):r.i(a.of)(e)});M.forEach(function(e){if(!e||i!==o.navigationId)return void(f=!1);if(o.currentUrlTree=v,o.currentRouterState=l,!t){var r=o.urlSerializer.serialize(v);o.location.isCurrentPathEqualTo(r)||n?o.location.replaceState(r):o.location.go(r)}new I(l,g).activate(o.outletMap),f=!0}).then(function(){o.navigated=!0,f?(o.routerEvents.next(new A(i,o.serializeUrl(e),o.serializeUrl(v))),s(!0)):(o.routerEvents.next(new P(i,o.serializeUrl(e),"")),s(!1))},function(t){if(t instanceof w.b)o.navigated=!0,o.routerEvents.next(new P(i,o.serializeUrl(e),t.message)),s(!1);else{o.routerEvents.next(new x(i,o.serializeUrl(e),t));try{s(o.errorHandler(t))}catch(e){u(e)}}i===o.navigationId&&(o.currentRouterState=g,o.currentUrlTree=_,o.location.replaceState(o.serializeUrl(_)))})})},Router}(),R=function(){function CanActivate(e){this.path=e}return Object.defineProperty(CanActivate.prototype,"route",{get:function(){return this.path[this.path.length-1]},enumerable:!0,configurable:!0}),CanActivate}(),M=function(){function CanDeactivate(e,t){this.component=e,this.route=t}return CanDeactivate}(),N=function(){function PreActivation(e,t,r){this.future=e,this.curr=t,this.injector=r,this.checks=[]}return PreActivation.prototype.traverse=function(e){var t=this.future._root,r=this.curr?this.curr._root:null;this.traverseChildRoutes(t,r,e,[t.value])},PreActivation.prototype.checkGuards=function(){var e=this;if(0===this.checks.length)return r.i(a.of)(!0);var t=r.i(o.from)(this.checks),n=c.map.call(t,function(t){if(t instanceof R)return r.i(E.f)(r.i(o.from)([e.runCanActivateChild(t.path),e.runCanActivate(t.route)]));if(t instanceof M){var n=t;return e.runCanDeactivate(n.component,n.route)}throw new Error("Cannot be reached")}),i=l.mergeAll.call(n);return u.every.call(i,function(e){return e===!0})},PreActivation.prototype.resolveData=function(){var e=this;if(0===this.checks.length)return r.i(a.of)(null);var t=r.i(o.from)(this.checks),n=s.concatMap.call(t,function(t){return t instanceof R?e.runResolve(t.route):r.i(a.of)(null)});return f.reduce.call(n,function(e,t){return e})},PreActivation.prototype.traverseChildRoutes=function(e,t,n,i){var o=this,a=nodeChildrenAsMap(t);e.children.forEach(function(e){o.traverseRoutes(e,a[e.value.outlet],n,i.concat([e.value])),delete a[e.value.outlet]}),r.i(E.c)(a,function(e,t){return o.deactivateOutletAndItChildren(e,n._outlets[t])})},PreActivation.prototype.traverseRoutes=function(e,t,n,i){var o=e.value,a=t?t.value:null,s=n?n._outlets[e.value.outlet]:null;a&&o._routeConfig===a._routeConfig?(r.i(E.d)(o.params,a.params)?o.data=a.data:this.checks.push(new M(s.component,a),new R(i)),o.component?this.traverseChildRoutes(e,t,s?s.outletMap:null,i):this.traverseChildRoutes(e,t,n,i)):(a&&(a.component?this.deactivateOutletAndItChildren(a,s):this.deactivateOutletMap(n)),this.checks.push(new R(i)),o.component?this.traverseChildRoutes(e,null,s?s.outletMap:null,i):this.traverseChildRoutes(e,null,n,i))},PreActivation.prototype.deactivateOutletAndItChildren=function(e,t){t&&t.isActivated&&(this.deactivateOutletMap(t.outletMap),this.checks.push(new M(t.component,e)))},PreActivation.prototype.deactivateOutletMap=function(e){var t=this;r.i(E.c)(e._outlets,function(e){e.isActivated&&t.deactivateOutletAndItChildren(e.activatedRoute.snapshot,e)})},PreActivation.prototype.runCanActivate=function(e){var t=this,n=e._routeConfig?e._routeConfig.canActivate:null;if(!n||0===n.length)return r.i(a.of)(!0);var i=c.map.call(r.i(o.from)(n),function(n){var i=t.getToken(n,e);return i.canActivate?r.i(E.b)(i.canActivate(e,t.future)):r.i(E.b)(i(e,t.future))});return r.i(E.f)(i)},PreActivation.prototype.runCanActivateChild=function(e){var t=this,n=e[e.length-1],i=e.slice(0,e.length-1).reverse().map(function(e){return t.extractCanActivateChild(e)}).filter(function(e){return null!==e});return r.i(E.f)(c.map.call(r.i(o.from)(i),function(e){var i=c.map.call(r.i(o.from)(e.guards),function(e){var i=t.getToken(e,e.node);return i.canActivateChild?r.i(E.b)(i.canActivateChild(n,t.future)):r.i(E.b)(i(n,t.future))});return r.i(E.f)(i)}))},PreActivation.prototype.extractCanActivateChild=function(e){var t=e._routeConfig?e._routeConfig.canActivateChild:null;return t&&0!==t.length?{node:e,guards:t}:null},PreActivation.prototype.runCanDeactivate=function(e,t){var n=this,i=t&&t._routeConfig?t._routeConfig.canDeactivate:null;if(!i||0===i.length)return r.i(a.of)(!0);var s=c.map.call(r.i(o.from)(i),function(i){var o=n.getToken(i,t);return o.canDeactivate?r.i(E.b)(o.canDeactivate(e,t,n.curr)):r.i(E.b)(o(e,t,n.curr))}),p=l.mergeAll.call(s);return u.every.call(p,function(e){return e===!0})},PreActivation.prototype.runResolve=function(e){var t=e._resolve;return c.map.call(this.resolveNode(t.current,e),function(n){return t.resolvedData=n,e.data=r.i(E.g)(e.data,t.flattenedResolvedData),null})},PreActivation.prototype.resolveNode=function(e,t){var n=this;return r.i(E.e)(e,function(e,i){var o=n.getToken(i,t);return o.resolve?r.i(E.b)(o.resolve(t,n.future)):r.i(E.b)(o(t,n.future))})},PreActivation.prototype.getToken=function(e,t){var r=closestLoadedConfig(t),n=r?r.injector:this.injector;return n.get(e)},PreActivation}(),I=function(){function ActivateRoutes(e,t){this.futureState=e,this.currState=t}return ActivateRoutes.prototype.activate=function(e){var t=this.futureState._root,n=this.currState?this.currState._root:null;r.i(b.g)(this.futureState.root),this.activateChildRoutes(t,n,e)},ActivateRoutes.prototype.activateChildRoutes=function(e,t,n){var i=this,o=nodeChildrenAsMap(t);e.children.forEach(function(e){i.activateRoutes(e,o[e.value.outlet],n),delete o[e.value.outlet]}),r.i(E.c)(o,function(e,t){return i.deactivateOutletAndItChildren(n._outlets[t])})},ActivateRoutes.prototype.activateRoutes=function(e,t,n){var i=e.value,o=t?t.value:null;if(i===o)if(r.i(b.g)(i),i.component){var a=getOutlet(n,e.value);this.activateChildRoutes(e,t,a.outletMap)}else this.activateChildRoutes(e,t,n);else{if(o)if(o.component){var a=getOutlet(n,e.value);this.deactivateOutletAndItChildren(a)}else this.deactivateOutletMap(n);if(i.component){r.i(b.g)(i);var a=getOutlet(n,e.value),s=new _.a;this.placeComponentIntoOutlet(s,i,a),this.activateChildRoutes(e,null,s)}else r.i(b.g)(i),this.activateChildRoutes(e,null,n)}},ActivateRoutes.prototype.placeComponentIntoOutlet=function(e,t,r){var i=[{provide:b.b,useValue:t},{provide:_.a,useValue:e}],o=parentLoadedConfig(t.snapshot),a=null,s=null;o&&(a=o.factoryResolver,s=o.injector,i.push({provide:n.ComponentFactoryResolver,useValue:a})),r.activate(t,a,s,n.ReflectiveInjector.resolve(i),e)},ActivateRoutes.prototype.deactivateOutletAndItChildren=function(e){e&&e.isActivated&&(this.deactivateOutletMap(e.outletMap),e.deactivate())},ActivateRoutes.prototype.deactivateOutletMap=function(e){var t=this;r.i(E.c)(e._outlets,function(e){return t.deactivateOutletAndItChildren(e)})},ActivateRoutes}()},function(e,t,r){"use strict";var n=r(0),i=r(156),o=(r.n(i),r(71)),a=(r.n(o),r(112)),s=(r.n(a),r(87)),u=(r.n(s),r(46));r.d(t,"c",function(){return c}),r.d(t,"a",function(){return l}),r.d(t,"b",function(){return p});var c=new n.OpaqueToken("ROUTES"),l=function(){function LoadedRouterConfig(e,t,r){this.routes=e,this.injector=t,this.factoryResolver=r}return LoadedRouterConfig}(),p=function(){function RouterConfigLoader(e,t){this.loader=e,this.compiler=t}return RouterConfigLoader.prototype.load=function(e,t){return a.map.call(this.loadModuleFactory(t),function(t){var n=t.create(e);return new l(r.i(u.a)(n.injector.get(c)),n.injector,n.componentFactoryResolver)})},RouterConfigLoader.prototype.loadModuleFactory=function(e){var t=this;if("string"==typeof e)return r.i(i.fromPromise)(this.loader.load(e));var a=this.compiler instanceof n.Compiler;return s.mergeMap.call(r.i(u.b)(e()),function(e){return a?r.i(o.of)(e):r.i(i.fromPromise)(t.compiler.compileModuleAsync(e))})},RouterConfigLoader}()},,,,,,,,,,function(e,t,r){"use strict";function map(e,t){if("function"!=typeof e)throw new TypeError("argument is not a function. Are you looking for `mapTo()`?");return this.lift(new o(e,t))}var n=this&&this.__extends||function(e,t){function __(){this.constructor=e}for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r]);e.prototype=null===t?Object.create(t):(__.prototype=t.prototype,new __)},i=r(27);t.map=map;var o=function(){function MapOperator(e,t){this.project=e,this.thisArg=t}return MapOperator.prototype.call=function(e,t){return t._subscribe(new a(e,this.project,this.thisArg))},MapOperator}();t.MapOperator=o;var a=function(e){function MapSubscriber(t,r,n){e.call(this,t),this.project=r,this.count=0,this.thisArg=n||this}return n(MapSubscriber,e),MapSubscriber.prototype._next=function(e){var t;try{t=this.project.call(this.thisArg,e,this.count++)}catch(e){return void this.destination.error(e)}this.destination.next(t)},MapSubscriber}(i.Subscriber)},,function(e,t,r){"use strict";function __export(e){for(var r in e)t.hasOwnProperty(r)||(t[r]=e[r])}__export(r(533))},function(e,t,r){"use strict";function getPluralCategory(e,t,r){var n="="+e;return t.indexOf(n)>-1?n:r.getPluralCategory(e)}function getPluralCase(e,t){"string"==typeof t&&(t=parseInt(t,10));var r=t,n=r.toString().replace(/^[^.]*\.?/,""),o=Math.floor(Math.abs(r)),a=n.length,s=parseInt(n,10),u=parseInt(r.toString().replace(/^[^.]*\.?|0+$/g,""),10)||0,c=e.split("-")[0].toLowerCase();switch(c){case"af":case"asa":case"az":case"bem":case"bez":case"bg":case"brx":case"ce":case"cgg":case"chr":case"ckb":case"ee":case"el":case"eo":case"es":case"eu":case"fo":case"fur":case"gsw":case"ha":case"haw":case"hu":case"jgo":case"jmc":case"ka":case"kk":case"kkj":case"kl":case"ks":case"ksb":case"ky":case"lb":case"lg":case"mas":case"mgo":case"ml":case"mn":case"nb":case"nd":case"ne":case"nn":case"nnh":case"nyn":case"om":case"or":case"os":case"ps":case"rm":case"rof":case"rwk":case"saq":case"seh":case"sn":case"so":case"sq":case"ta":case"te":case"teo":case"tk":case"tr":case"ug":case"uz":case"vo":case"vun":case"wae":case"xog":return 1===r?i.One:i.Other;case"agq":case"bas":case"cu":case"dav":case"dje":case"dua":case"dyo":case"ebu":case"ewo":case"guz":case"kam":case"khq":case"ki":case"kln":case"kok":case"ksf":case"lrc":case"lu":case"luo":case"luy":case"mer":case"mfe":case"mgh":case"mua":case"mzn":case"nmg":case"nus":case"qu":case"rn":case"rw":case"sbp":case"twq":case"vai":case"yav":case"yue":case"zgh":case"ak":case"ln":case"mg":case"pa":case"ti":return r===Math.floor(r)&&r>=0&&r<=1?i.One:i.Other;case"am":case"as":case"bn":case"fa":case"gu":case"hi":case"kn":case"mr":case"zu":return 0===o||1===r?i.One:i.Other;case"ar":return 0===r?i.Zero:1===r?i.One:2===r?i.Two:r%100===Math.floor(r%100)&&r%100>=3&&r%100<=10?i.Few:r%100===Math.floor(r%100)&&r%100>=11&&r%100<=99?i.Many:i.Other;case"ast":case"ca":case"de":case"en":case"et":case"fi":case"fy":case"gl":case"it":case"nl":case"sv":case"sw":case"ur":case"yi":return 1===o&&0===a?i.One:i.Other;case"be":return r%10===1&&r%100!==11?i.One:r%10===Math.floor(r%10)&&r%10>=2&&r%10<=4&&!(r%100>=12&&r%100<=14)?i.Few:r%10===0||r%10===Math.floor(r%10)&&r%10>=5&&r%10<=9||r%100===Math.floor(r%100)&&r%100>=11&&r%100<=14?i.Many:i.Other;case"br":return r%10===1&&r%100!==11&&r%100!==71&&r%100!==91?i.One:r%10===2&&r%100!==12&&r%100!==72&&r%100!==92?i.Two:r%10===Math.floor(r%10)&&(r%10>=3&&r%10<=4||r%10===9)&&!(r%100>=10&&r%100<=19||r%100>=70&&r%100<=79||r%100>=90&&r%100<=99)?i.Few:0!==r&&r%1e6===0?i.Many:i.Other;case"bs":case"hr":case"sr":return 0===a&&o%10===1&&o%100!==11||s%10===1&&s%100!==11?i.One:0===a&&o%10===Math.floor(o%10)&&o%10>=2&&o%10<=4&&!(o%100>=12&&o%100<=14)||s%10===Math.floor(s%10)&&s%10>=2&&s%10<=4&&!(s%100>=12&&s%100<=14)?i.Few:i.Other;case"cs":case"sk":return 1===o&&0===a?i.One:o===Math.floor(o)&&o>=2&&o<=4&&0===a?i.Few:0!==a?i.Many:i.Other;case"cy":return 0===r?i.Zero:1===r?i.One:2===r?i.Two:3===r?i.Few:6===r?i.Many:i.Other;case"da":return 1===r||0!==u&&(0===o||1===o)?i.One:i.Other;case"dsb":case"hsb":return 0===a&&o%100===1||s%100===1?i.One:0===a&&o%100===2||s%100===2?i.Two:0===a&&o%100===Math.floor(o%100)&&o%100>=3&&o%100<=4||s%100===Math.floor(s%100)&&s%100>=3&&s%100<=4?i.Few:i.Other;case"ff":case"fr":case"hy":case"kab":return 0===o||1===o?i.One:i.Other;case"fil":return 0===a&&(1===o||2===o||3===o)||0===a&&o%10!==4&&o%10!==6&&o%10!==9||0!==a&&s%10!==4&&s%10!==6&&s%10!==9?i.One:i.Other;case"ga":return 1===r?i.One:2===r?i.Two:r===Math.floor(r)&&r>=3&&r<=6?i.Few:r===Math.floor(r)&&r>=7&&r<=10?i.Many:i.Other;case"gd":return 1===r||11===r?i.One:2===r||12===r?i.Two:r===Math.floor(r)&&(r>=3&&r<=10||r>=13&&r<=19)?i.Few:i.Other;case"gv":return 0===a&&o%10===1?i.One:0===a&&o%10===2?i.Two:0!==a||o%100!==0&&o%100!==20&&o%100!==40&&o%100!==60&&o%100!==80?0!==a?i.Many:i.Other:i.Few;case"he":return 1===o&&0===a?i.One:2===o&&0===a?i.Two:0!==a||r>=0&&r<=10||r%10!==0?i.Other:i.Many;case"is":return 0===u&&o%10===1&&o%100!==11||0!==u?i.One:i.Other;case"ksh":return 0===r?i.Zero:1===r?i.One:i.Other;case"kw":case"naq":case"se":case"smn":return 1===r?i.One:2===r?i.Two:i.Other;case"lag":return 0===r?i.Zero:0!==o&&1!==o||0===r?i.Other:i.One;case"lt":return r%10!==1||r%100>=11&&r%100<=19?r%10===Math.floor(r%10)&&r%10>=2&&r%10<=9&&!(r%100>=11&&r%100<=19)?i.Few:0!==s?i.Many:i.Other:i.One;case"lv":case"prg":return r%10===0||r%100===Math.floor(r%100)&&r%100>=11&&r%100<=19||2===a&&s%100===Math.floor(s%100)&&s%100>=11&&s%100<=19?i.Zero:r%10===1&&r%100!==11||2===a&&s%10===1&&s%100!==11||2!==a&&s%10===1?i.One:i.Other;case"mk":return 0===a&&o%10===1||s%10===1?i.One:i.Other;case"mt":return 1===r?i.One:0===r||r%100===Math.floor(r%100)&&r%100>=2&&r%100<=10?i.Few:r%100===Math.floor(r%100)&&r%100>=11&&r%100<=19?i.Many:i.Other;case"pl":return 1===o&&0===a?i.One:0===a&&o%10===Math.floor(o%10)&&o%10>=2&&o%10<=4&&!(o%100>=12&&o%100<=14)?i.Few:0===a&&1!==o&&o%10===Math.floor(o%10)&&o%10>=0&&o%10<=1||0===a&&o%10===Math.floor(o%10)&&o%10>=5&&o%10<=9||0===a&&o%100===Math.floor(o%100)&&o%100>=12&&o%100<=14?i.Many:i.Other;case"pt":return r===Math.floor(r)&&r>=0&&r<=2&&2!==r?i.One:i.Other;case"ro":return 1===o&&0===a?i.One:0!==a||0===r||1!==r&&r%100===Math.floor(r%100)&&r%100>=1&&r%100<=19?i.Few:i.Other;case"ru":case"uk":return 0===a&&o%10===1&&o%100!==11?i.One:0===a&&o%10===Math.floor(o%10)&&o%10>=2&&o%10<=4&&!(o%100>=12&&o%100<=14)?i.Few:0===a&&o%10===0||0===a&&o%10===Math.floor(o%10)&&o%10>=5&&o%10<=9||0===a&&o%100===Math.floor(o%100)&&o%100>=11&&o%100<=14?i.Many:i.Other;case"shi":return 0===o||1===r?i.One:r===Math.floor(r)&&r>=2&&r<=10?i.Few:i.Other;case"si":return 0===r||1===r||0===o&&1===s?i.One:i.Other;case"sl":return 0===a&&o%100===1?i.One:0===a&&o%100===2?i.Two:0===a&&o%100===Math.floor(o%100)&&o%100>=3&&o%100<=4||0!==a?i.Few:i.Other;case"tzm":return r===Math.floor(r)&&r>=0&&r<=1||r===Math.floor(r)&&r>=11&&r<=99?i.One:i.Other;default:return i.Other}}var n=r(0);r.d(t,"b",function(){return a}),t.a=getPluralCategory,r.d(t,"c",function(){return s});var i,o=this&&this.__extends||function(e,t){function __(){this.constructor=e}for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r]);e.prototype=null===t?Object.create(t):(__.prototype=t.prototype,new __)},a=function(){function NgLocalization(){}return NgLocalization}(),s=function(e){function NgLocaleLocalization(t){e.call(this),this._locale=t}return o(NgLocaleLocalization,e),NgLocaleLocalization.prototype.getPluralCategory=function(e){var t=getPluralCase(this._locale,e);switch(t){case i.Zero:return"zero";case i.One:return"one";case i.Two:return"two";case i.Few:return"few";case i.Many:return"many";default:return"other"}},NgLocaleLocalization.decorators=[{type:n.Injectable}],NgLocaleLocalization.ctorParameters=[{type:void 0,decorators:[{type:n.Inject,args:[n.LOCALE_ID]}]}],NgLocaleLocalization}(a);!function(e){e[e.Zero=0]="Zero",e[e.One=1]="One",e[e.Two=2]="Two",e[e.Few=3]="Few",e[e.Many=4]="Many",e[e.Other=5]="Other"}(i||(i={}))},function(e,t,r){"use strict";var n=r(0);r.d(t,"a",function(){return i}),r.d(t,"b",function(){return o});var i=function(){function LocationStrategy(){}return LocationStrategy}(),o=new n.OpaqueToken("appBaseHref")},function(e,t,r){"use strict";var n=(r(53),r(122),r(74),r(17),r(443),r(275),r(91),r(173)),i=r(435);r(163),r(172),r(170),r(41),r(90),r(264),r(162),r(119),r(120),r(167),r(121),r(169),r(118),r(447),r(272),r(42),r(276),r(174),r(175),r(123);r.d(t,"a",function(){return n.a}),r.d(t,"b",function(){return i.a})},function(e,t,r){"use strict";function detectChangesInternalMethod(e,t){var n=a.e("changed"),i=[n.set(a.n.prop(p)).toDeclStmt(),a.n.prop(p).set(a.a(!1)).toStmt()],s=[];if(e.genChanges){var u=[];e.ngOnChanges&&u.push(a.n.prop(c).callMethod("ngOnChanges",[a.n.prop(l)]).toStmt()),t&&u.push(a.b(r.i(o.d)(o.b.setBindingDebugInfoForChanges)).callFn([m.prop("renderer"),v,a.n.prop(l)]).toStmt()),u.push(y),s.push(new a.i(n,u))}return e.ngOnInit&&s.push(new a.i(m.prop("numberOfChecks").identical(new a.u(0)),[a.n.prop(c).callMethod("ngOnInit",[]).toStmt()])),e.ngDoCheck&&s.push(a.n.prop(c).callMethod("ngDoCheck",[]).toStmt()),s.length>0&&i.push(new a.i(a.v(h),s)),i.push(new a.k(n)),new a.s("detectChangesInternal",[new a.l(m.name,a.c(r.i(o.d)(o.b.AppView),[a.m])),new a.l(v.name,a.m),new a.l(h.name,a.p)],i,a.p)}function checkInputMethod(e,t,n){var i=[a.n.prop(p).set(a.a(!0)).toStmt(),a.n.prop(c).prop(e).set(f).toStmt()];n.genChanges&&i.push(a.n.prop(l).key(a.a(e)).set(a.b(r.i(o.d)(o.b.SimpleChange)).instantiate([t,f])).toStmt()),i.push(t.set(f).toStmt());var s=[new a.i(d.or(a.b(r.i(o.d)(o.b.checkBinding)).callFn([h,t,f])),i)];return new a.s("check_"+e,[new a.l(f.name,a.m),new a.l(h.name,a.p),new a.l(d.name,a.p)],s)}var n=r(0),i=r(74),o=r(13),a=r(8),s=r(14);r.d(t,"a",function(){return g});var u=function(){function DirectiveWrapperCompileResult(e,t){this.statements=e,this.dirWrapperClassVar=t}return DirectiveWrapperCompileResult}(),c="context",l="changes",p="changed",f=a.e("currValue"),h=a.e("throwOnChange"),d=a.e("forceUpdate"),m=a.e("view"),v=a.e("el"),y=a.n.prop(l).set(a.f([])).toStmt(),g=function(){function DirectiveWrapperCompiler(e){this.compilerConfig=e}return DirectiveWrapperCompiler.dirWrapperClassName=function(e){return"Wrapper_"+e.name},DirectiveWrapperCompiler.prototype.compile=function(e){for(var t=[],n=0;n<e.type.diDeps.length;n++)t.push("p"+n);var i=e.type.lifecycleHooks,f={genChanges:i.indexOf(s.G.OnChanges)!==-1||this.compilerConfig.logBindingUpdate,ngOnChanges:i.indexOf(s.G.OnChanges)!==-1,ngOnInit:i.indexOf(s.G.OnInit)!==-1,ngDoCheck:i.indexOf(s.G.DoCheck)!==-1},h=[new a.o(c,a.c(e.type)),new a.o(p,a.p)],d=[a.n.prop(p).set(a.a(!1)).toStmt()];f.genChanges&&(h.push(new a.o(l,new a.q(a.m))),d.push(y));var m=[];Object.keys(e.inputs).forEach(function(e,t){var n="_"+e;h.push(new a.o(n,null,[a.r.Private])),d.push(a.n.prop(n).set(a.b(r.i(o.d)(o.b.UNINITIALIZED))).toStmt()),m.push(checkInputMethod(e,a.n.prop(n),f))}),m.push(detectChangesInternalMethod(f,this.compilerConfig.genDebugInfo)),d.push(a.n.prop(c).set(a.b(e.type).instantiate(t.map(function(e){return a.e(e)}))).toStmt());var v=new a.s(null,t.map(function(e){return new a.l(e,a.m)}),d),g=DirectiveWrapperCompiler.dirWrapperClassName(e.type),_=new a.t(g,null,h,[],v,m);return new u([_],g)},DirectiveWrapperCompiler.decorators=[{type:n.Injectable}],DirectiveWrapperCompiler.ctorParameters=[{type:i.a}],DirectiveWrapperCompiler}()},function(e,t,r){"use strict";function newCharacterToken(e,t){return new c(e,a.Character,t,String.fromCharCode(t))}function newIdentifierToken(e,t){return new c(e,a.Identifier,0,t)}function newKeywordToken(e,t){return new c(e,a.Keyword,0,t)}function newOperatorToken(e,t){return new c(e,a.Operator,0,t)}function newStringToken(e,t){return new c(e,a.String,0,t)}function newNumberToken(e,t){return new c(e,a.Number,t,"")}function newErrorToken(e,t){return new c(e,a.Error,0,t)}function isIdentifierStart(e){return i.H<=e&&e<=i.I||i.J<=e&&e<=i.K||e==i.L||e==i.M}function isIdentifier(e){if(0==e.length)return!1;var t=new p(e);if(!isIdentifierStart(t.peek))return!1;for(t.advance();t.peek!==i.a;){if(!isIdentifierPart(t.peek))return!1;t.advance()}return!0}function isIdentifierPart(e){return i.N(e)||i.c(e)||e==i.L||e==i.M}function isExponentStart(e){return e==i.O||e==i.P}function isExponentSign(e){return e==i.r||e==i.q}function isQuote(e){return e===i.n||e===i.o||e===i.Q}function unescape(e){switch(e){case i.R:return i.S;case i.T:return i.U;case i.V:return i.W;case i.X:return i.Y;case i.Z:return i._0;default:return e}}var n=r(0),i=r(161),o=r(2);r.d(t,"e",function(){return a}),r.d(t,"c",function(){return u}),r.d(t,"d",function(){return l}),t.a=isIdentifier,t.b=isQuote;var a;!function(e){ e[e.Character=0]="Character",e[e.Identifier=1]="Identifier",e[e.Keyword=2]="Keyword",e[e.String=3]="String",e[e.Operator=4]="Operator",e[e.Number=5]="Number",e[e.Error=6]="Error"}(a||(a={}));var s=["var","let","null","undefined","true","false","if","else","this"],u=function(){function Lexer(){}return Lexer.prototype.tokenize=function(e){for(var t=new p(e),r=[],n=t.scanToken();null!=n;)r.push(n),n=t.scanToken();return r},Lexer.decorators=[{type:n.Injectable}],Lexer.ctorParameters=[],Lexer}(),c=function(){function Token(e,t,r,n){this.index=e,this.type=t,this.numValue=r,this.strValue=n}return Token.prototype.isCharacter=function(e){return this.type==a.Character&&this.numValue==e},Token.prototype.isNumber=function(){return this.type==a.Number},Token.prototype.isString=function(){return this.type==a.String},Token.prototype.isOperator=function(e){return this.type==a.Operator&&this.strValue==e},Token.prototype.isIdentifier=function(){return this.type==a.Identifier},Token.prototype.isKeyword=function(){return this.type==a.Keyword},Token.prototype.isKeywordLet=function(){return this.type==a.Keyword&&"let"==this.strValue},Token.prototype.isKeywordNull=function(){return this.type==a.Keyword&&"null"==this.strValue},Token.prototype.isKeywordUndefined=function(){return this.type==a.Keyword&&"undefined"==this.strValue},Token.prototype.isKeywordTrue=function(){return this.type==a.Keyword&&"true"==this.strValue},Token.prototype.isKeywordFalse=function(){return this.type==a.Keyword&&"false"==this.strValue},Token.prototype.isKeywordThis=function(){return this.type==a.Keyword&&"this"==this.strValue},Token.prototype.isError=function(){return this.type==a.Error},Token.prototype.toNumber=function(){return this.type==a.Number?this.numValue:-1},Token.prototype.toString=function(){switch(this.type){case a.Character:case a.Identifier:case a.Keyword:case a.Operator:case a.String:case a.Error:return this.strValue;case a.Number:return this.numValue.toString();default:return null}},Token}(),l=new c(-1,a.Character,0,""),p=function(){function _Scanner(e){this.input=e,this.peek=0,this.index=-1,this.length=e.length,this.advance()}return _Scanner.prototype.advance=function(){this.peek=++this.index>=this.length?i.a:this.input.charCodeAt(this.index)},_Scanner.prototype.scanToken=function(){for(var e=this.input,t=this.length,r=this.peek,n=this.index;r<=i.b;){if(++n>=t){r=i.a;break}r=e.charCodeAt(n)}if(this.peek=r,this.index=n,n>=t)return null;if(isIdentifierStart(r))return this.scanIdentifier();if(i.c(r))return this.scanNumber(n);var o=n;switch(r){case i.d:return this.advance(),i.c(this.peek)?this.scanNumber(o):newCharacterToken(o,i.d);case i.e:case i.f:case i.g:case i.h:case i.i:case i.j:case i.k:case i.l:case i.m:return this.scanCharacter(o,r);case i.n:case i.o:return this.scanString();case i.p:case i.q:case i.r:case i.s:case i.t:case i.u:case i.v:return this.scanOperator(o,String.fromCharCode(r));case i.w:return this.scanComplexOperator(o,"?",i.d,".");case i.x:case i.y:return this.scanComplexOperator(o,String.fromCharCode(r),i.z,"=");case i.A:case i.z:return this.scanComplexOperator(o,String.fromCharCode(r),i.z,"=",i.z,"=");case i.B:return this.scanComplexOperator(o,"&",i.B,"&");case i.C:return this.scanComplexOperator(o,"|",i.C,"|");case i.D:for(;i.E(this.peek);)this.advance();return this.scanToken()}return this.advance(),this.error("Unexpected character ["+String.fromCharCode(r)+"]",0)},_Scanner.prototype.scanCharacter=function(e,t){return this.advance(),newCharacterToken(e,t)},_Scanner.prototype.scanOperator=function(e,t){return this.advance(),newOperatorToken(e,t)},_Scanner.prototype.scanComplexOperator=function(e,t,n,i,a,s){this.advance();var u=t;return this.peek==n&&(this.advance(),u+=i),r.i(o.a)(a)&&this.peek==a&&(this.advance(),u+=s),newOperatorToken(e,u)},_Scanner.prototype.scanIdentifier=function(){var e=this.index;for(this.advance();isIdentifierPart(this.peek);)this.advance();var t=this.input.substring(e,this.index);return s.indexOf(t)>-1?newKeywordToken(e,t):newIdentifierToken(e,t)},_Scanner.prototype.scanNumber=function(e){var t=this.index===e;for(this.advance();;){if(i.c(this.peek));else if(this.peek==i.d)t=!1;else{if(!isExponentStart(this.peek))break;if(this.advance(),isExponentSign(this.peek)&&this.advance(),!i.c(this.peek))return this.error("Invalid exponent",-1);t=!1}this.advance()}var r=this.input.substring(e,this.index),n=t?o.i.parseIntAutoRadix(r):parseFloat(r);return newNumberToken(e,n)},_Scanner.prototype.scanString=function(){var e=this.index,t=this.peek;this.advance();for(var r="",n=this.index,a=this.input;this.peek!=t;)if(this.peek==i.F){r+=a.substring(n,this.index),this.advance();var s=void 0;if(this.peek==i.G){var u=a.substring(this.index+1,this.index+5);try{s=o.i.parseInt(u,16)}catch(e){return this.error("Invalid unicode escape [\\u"+u+"]",0)}for(var c=0;c<5;c++)this.advance()}else s=unescape(this.peek),this.advance();r+=String.fromCharCode(s),n=this.index}else{if(this.peek==i.a)return this.error("Unterminated quote",0);this.advance()}var l=a.substring(n,this.index);return this.advance(),newStringToken(e,r+l)},_Scanner.prototype.error=function(e,t){var r=this.index+t;return newErrorToken(r,"Lexer Error: "+e+" at column "+r+" in expression ["+this.input+"]")},_Scanner}()},function(e,t,r){"use strict";function _createInterpolateRegExp(e){var t=r.i(o.j)(e.start)+"([\\s\\S]*?)"+r.i(o.j)(e.end);return new RegExp(t,"g")}var n=r(0),i=r(161),o=r(2),a=r(41),s=r(164),u=r(119);r.d(t,"a",function(){return p});var c=function(){function SplitInterpolation(e,t,r){this.strings=e,this.expressions=t,this.offsets=r}return SplitInterpolation}(),l=function(){function TemplateBindingParseResult(e,t,r){this.templateBindings=e,this.warnings=t,this.errors=r}return TemplateBindingParseResult}(),p=function(){function Parser(e){this._lexer=e,this.errors=[]}return Parser.prototype.parseAction=function(e,t,r){void 0===r&&(r=a.a),this._checkNoInterpolation(e,t,r);var n=this._stripComments(e),i=this._lexer.tokenize(this._stripComments(e)),o=new f(e,t,i,n.length,!0,this.errors,e.length-n.length).parseChain();return new s.a(o,e,t,this.errors)},Parser.prototype.parseBinding=function(e,t,r){void 0===r&&(r=a.a);var n=this._parseBindingAst(e,t,r);return new s.a(n,e,t,this.errors)},Parser.prototype.parseSimpleBinding=function(e,t,r){void 0===r&&(r=a.a);var n=this._parseBindingAst(e,t,r);return h.check(n)||this._reportError("Host binding expression can only contain field access and constants",e,t),new s.a(n,e,t,this.errors)},Parser.prototype._reportError=function(e,t,r,n){this.errors.push(new s.b(e,t,r,n))},Parser.prototype._parseBindingAst=function(e,t,n){var i=this._parseQuote(e,t);if(r.i(o.a)(i))return i;this._checkNoInterpolation(e,t,n);var a=this._stripComments(e),s=this._lexer.tokenize(a);return new f(e,t,s,a.length,!1,this.errors,e.length-a.length).parseChain()},Parser.prototype._parseQuote=function(e,t){if(r.i(o.b)(e))return null;var n=e.indexOf(":");if(n==-1)return null;var i=e.substring(0,n).trim();if(!r.i(u.a)(i))return null;var a=e.substring(n+1);return new s.c(new s.d(0,e.length),i,a,t)},Parser.prototype.parseTemplateBindings=function(e,t){var r=this._lexer.tokenize(e);return new f(e,t,r,e.length,!1,this.errors,0).parseTemplateBindings()},Parser.prototype.parseInterpolation=function(e,t,n){void 0===n&&(n=a.a);var i=this.splitInterpolation(e,t,n);if(null==i)return null;for(var u=[],c=0;c<i.expressions.length;++c){var l=i.expressions[c],p=this._stripComments(l),h=this._lexer.tokenize(this._stripComments(i.expressions[c])),d=new f(e,t,h,p.length,!1,this.errors,i.offsets[c]+(l.length-p.length)).parseChain();u.push(d)}return new s.a(new s.e(new s.d(0,r.i(o.b)(e)?0:e.length),i.strings,u),e,t,this.errors)},Parser.prototype.splitInterpolation=function(e,t,r){void 0===r&&(r=a.a);var n=_createInterpolateRegExp(r),i=e.split(n);if(i.length<=1)return null;for(var o=[],s=[],u=[],l=0,p=0;p<i.length;p++){var f=i[p];p%2===0?(o.push(f),l+=f.length):f.trim().length>0?(l+=r.start.length,s.push(f),u.push(l),l+=f.length+r.end.length):this._reportError("Blank expressions are not allowed in interpolated strings",e,"at column "+this._findInterpolationErrorColumn(i,p,r)+" in",t)}return new c(o,s,u)},Parser.prototype.wrapLiteralPrimitive=function(e,t){return new s.a(new s.f(new s.d(0,r.i(o.b)(e)?0:e.length),e),e,t,this.errors)},Parser.prototype._stripComments=function(e){var t=this._commentStart(e);return r.i(o.a)(t)?e.substring(0,t).trim():e},Parser.prototype._commentStart=function(e){for(var t=null,n=0;n<e.length-1;n++){var a=e.charCodeAt(n),s=e.charCodeAt(n+1);if(a===i.t&&s==i.t&&r.i(o.b)(t))return n;t===a?t=null:r.i(o.b)(t)&&r.i(u.b)(a)&&(t=a)}return null},Parser.prototype._checkNoInterpolation=function(e,t,r){var n=_createInterpolateRegExp(r),i=e.split(n);i.length>1&&this._reportError("Got interpolation ("+r.start+r.end+") where expression was expected",e,"at column "+this._findInterpolationErrorColumn(i,1,r)+" in",t)},Parser.prototype._findInterpolationErrorColumn=function(e,t,r){for(var n="",i=0;i<t;i++)n+=i%2===0?e[i]:""+r.start+e[i]+r.end;return n.length},Parser.decorators=[{type:n.Injectable}],Parser.ctorParameters=[{type:u.c}],Parser}(),f=function(){function _ParseAST(e,t,r,n,i,o,a){this.input=e,this.location=t,this.tokens=r,this.inputLength=n,this.parseAction=i,this.errors=o,this.offset=a,this.rparensExpected=0,this.rbracketsExpected=0,this.rbracesExpected=0,this.index=0}return _ParseAST.prototype.peek=function(e){var t=this.index+e;return t<this.tokens.length?this.tokens[t]:u.d},Object.defineProperty(_ParseAST.prototype,"next",{get:function(){return this.peek(0)},enumerable:!0,configurable:!0}),Object.defineProperty(_ParseAST.prototype,"inputIndex",{get:function(){return this.index<this.tokens.length?this.next.index+this.offset:this.inputLength+this.offset},enumerable:!0,configurable:!0}),_ParseAST.prototype.span=function(e){return new s.d(e,this.inputIndex)},_ParseAST.prototype.advance=function(){this.index++},_ParseAST.prototype.optionalCharacter=function(e){return!!this.next.isCharacter(e)&&(this.advance(),!0)},_ParseAST.prototype.peekKeywordLet=function(){return this.next.isKeywordLet()},_ParseAST.prototype.expectCharacter=function(e){this.optionalCharacter(e)||this.error("Missing expected "+String.fromCharCode(e))},_ParseAST.prototype.optionalOperator=function(e){return!!this.next.isOperator(e)&&(this.advance(),!0)},_ParseAST.prototype.expectOperator=function(e){this.optionalOperator(e)||this.error("Missing expected operator "+e)},_ParseAST.prototype.expectIdentifierOrKeyword=function(){var e=this.next;return e.isIdentifier()||e.isKeyword()?(this.advance(),e.toString()):(this.error("Unexpected token "+e+", expected identifier or keyword"),"")},_ParseAST.prototype.expectIdentifierOrKeywordOrString=function(){var e=this.next;return e.isIdentifier()||e.isKeyword()||e.isString()?(this.advance(),e.toString()):(this.error("Unexpected token "+e+", expected identifier, keyword, or string"),"")},_ParseAST.prototype.parseChain=function(){for(var e=[],t=this.inputIndex;this.index<this.tokens.length;){var r=this.parsePipe();if(e.push(r),this.optionalCharacter(i.m))for(this.parseAction||this.error("Binding expression cannot contain chained expression");this.optionalCharacter(i.m););else this.index<this.tokens.length&&this.error("Unexpected token '"+this.next+"'")}return 0==e.length?new s.g(this.span(t)):1==e.length?e[0]:new s.h(this.span(t),e)},_ParseAST.prototype.parsePipe=function(){var e=this.parseExpression();if(this.optionalOperator("|")){this.parseAction&&this.error("Cannot have a pipe in an action expression");do{for(var t=this.expectIdentifierOrKeyword(),r=[];this.optionalCharacter(i.l);)r.push(this.parseExpression());e=new s.i(this.span(e.span.start-this.offset),e,t,r)}while(this.optionalOperator("|"))}return e},_ParseAST.prototype.parseExpression=function(){return this.parseConditional()},_ParseAST.prototype.parseConditional=function(){var e=this.inputIndex,t=this.parseLogicalOr();if(this.optionalOperator("?")){var r=this.parsePipe(),n=void 0;if(this.optionalCharacter(i.l))n=this.parsePipe();else{var o=this.inputIndex,a=this.input.substring(e,o);this.error("Conditional expression "+a+" requires all 3 expressions"),n=new s.g(this.span(e))}return new s.j(this.span(e),t,r,n)}return t},_ParseAST.prototype.parseLogicalOr=function(){for(var e=this.parseLogicalAnd();this.optionalOperator("||");){var t=this.parseLogicalAnd();e=new s.k(this.span(e.span.start),"||",e,t)}return e},_ParseAST.prototype.parseLogicalAnd=function(){for(var e=this.parseEquality();this.optionalOperator("&&");){var t=this.parseEquality();e=new s.k(this.span(e.span.start),"&&",e,t)}return e},_ParseAST.prototype.parseEquality=function(){for(var e=this.parseRelational();this.next.type==u.e.Operator;){var t=this.next.strValue;switch(t){case"==":case"===":case"!=":case"!==":this.advance();var r=this.parseRelational();e=new s.k(this.span(e.span.start),t,e,r);continue}break}return e},_ParseAST.prototype.parseRelational=function(){for(var e=this.parseAdditive();this.next.type==u.e.Operator;){var t=this.next.strValue;switch(t){case"<":case">":case"<=":case">=":this.advance();var r=this.parseAdditive();e=new s.k(this.span(e.span.start),t,e,r);continue}break}return e},_ParseAST.prototype.parseAdditive=function(){for(var e=this.parseMultiplicative();this.next.type==u.e.Operator;){var t=this.next.strValue;switch(t){case"+":case"-":this.advance();var r=this.parseMultiplicative();e=new s.k(this.span(e.span.start),t,e,r);continue}break}return e},_ParseAST.prototype.parseMultiplicative=function(){for(var e=this.parsePrefix();this.next.type==u.e.Operator;){var t=this.next.strValue;switch(t){case"*":case"%":case"/":this.advance();var r=this.parsePrefix();e=new s.k(this.span(e.span.start),t,e,r);continue}break}return e},_ParseAST.prototype.parsePrefix=function(){if(this.next.type==u.e.Operator){var e=this.inputIndex,t=this.next.strValue,r=void 0;switch(t){case"+":return this.advance(),this.parsePrefix();case"-":return this.advance(),r=this.parsePrefix(),new s.k(this.span(e),t,new s.f(new s.d(e,e),0),r);case"!":return this.advance(),r=this.parsePrefix(),new s.l(this.span(e),r)}}return this.parseCallChain()},_ParseAST.prototype.parseCallChain=function(){for(var e=this.parsePrimary();;)if(this.optionalCharacter(i.d))e=this.parseAccessMemberOrMethodCall(e,!1);else if(this.optionalOperator("?."))e=this.parseAccessMemberOrMethodCall(e,!0);else if(this.optionalCharacter(i.i)){this.rbracketsExpected++;var t=this.parsePipe();if(this.rbracketsExpected--,this.expectCharacter(i.j),this.optionalOperator("=")){var r=this.parseConditional();e=new s.m(this.span(e.span.start),e,t,r)}else e=new s.n(this.span(e.span.start),e,t)}else{if(!this.optionalCharacter(i.e))return e;this.rparensExpected++;var n=this.parseCallArguments();this.rparensExpected--,this.expectCharacter(i.f),e=new s.o(this.span(e.span.start),e,n)}},_ParseAST.prototype.parsePrimary=function(){var e=this.inputIndex;if(this.optionalCharacter(i.e)){this.rparensExpected++;var t=this.parsePipe();return this.rparensExpected--,this.expectCharacter(i.f),t}if(this.next.isKeywordNull())return this.advance(),new s.f(this.span(e),null);if(this.next.isKeywordUndefined())return this.advance(),new s.f(this.span(e),void 0);if(this.next.isKeywordTrue())return this.advance(),new s.f(this.span(e),!0);if(this.next.isKeywordFalse())return this.advance(),new s.f(this.span(e),!1);if(this.next.isKeywordThis())return this.advance(),new s.p(this.span(e));if(this.optionalCharacter(i.i)){this.rbracketsExpected++;var r=this.parseExpressionList(i.j);return this.rbracketsExpected--,this.expectCharacter(i.j),new s.q(this.span(e),r)}if(this.next.isCharacter(i.g))return this.parseLiteralMap();if(this.next.isIdentifier())return this.parseAccessMemberOrMethodCall(new s.p(this.span(e)),!1);if(this.next.isNumber()){var n=this.next.toNumber();return this.advance(),new s.f(this.span(e),n)}if(this.next.isString()){var o=this.next.toString();return this.advance(),new s.f(this.span(e),o)}return this.index>=this.tokens.length?(this.error("Unexpected end of expression: "+this.input),new s.g(this.span(e))):(this.error("Unexpected token "+this.next),new s.g(this.span(e)))},_ParseAST.prototype.parseExpressionList=function(e){var t=[];if(!this.next.isCharacter(e))do t.push(this.parsePipe());while(this.optionalCharacter(i.k));return t},_ParseAST.prototype.parseLiteralMap=function(){var e=[],t=[],r=this.inputIndex;if(this.expectCharacter(i.g),!this.optionalCharacter(i.h)){this.rbracesExpected++;do{var n=this.expectIdentifierOrKeywordOrString();e.push(n),this.expectCharacter(i.l),t.push(this.parsePipe())}while(this.optionalCharacter(i.k));this.rbracesExpected--,this.expectCharacter(i.h)}return new s.r(this.span(r),e,t)},_ParseAST.prototype.parseAccessMemberOrMethodCall=function(e,t){void 0===t&&(t=!1);var r=e.span.start,n=this.expectIdentifierOrKeyword();if(this.optionalCharacter(i.e)){this.rparensExpected++;var o=this.parseCallArguments();this.expectCharacter(i.f),this.rparensExpected--;var a=this.span(r);return t?new s.s(a,e,n,o):new s.t(a,e,n,o)}if(t)return this.optionalOperator("=")?(this.error("The '?.' operator cannot be used in the assignment"),new s.g(this.span(r))):new s.u(this.span(r),e,n);if(this.optionalOperator("=")){if(!this.parseAction)return this.error("Bindings cannot contain assignments"),new s.g(this.span(r));var u=this.parseConditional();return new s.v(this.span(r),e,n,u)}return new s.w(this.span(r),e,n)},_ParseAST.prototype.parseCallArguments=function(){if(this.next.isCharacter(i.f))return[];var e=[];do e.push(this.parsePipe());while(this.optionalCharacter(i.k));return e},_ParseAST.prototype.expectTemplateBindingKey=function(){var e="",t=!1;do e+=this.expectIdentifierOrKeywordOrString(),t=this.optionalOperator("-"),t&&(e+="-");while(t);return e.toString()},_ParseAST.prototype.parseTemplateBindings=function(){for(var e=[],t=null,r=[];this.index<this.tokens.length;){var n=this.peekKeywordLet();n&&this.advance();var o=this.expectTemplateBindingKey();n||(null==t?t=o:o=t+o[0].toUpperCase()+o.substring(1)),this.optionalCharacter(i.l);var a=null,c=null;if(n)a=this.optionalOperator("=")?this.expectTemplateBindingKey():"$implicit";else if(this.next!==u.d&&!this.peekKeywordLet()){var p=this.inputIndex,f=this.parsePipe(),h=this.input.substring(p,this.inputIndex);c=new s.a(f,h,this.location,this.errors)}e.push(new s.x(o,n,a,c)),this.optionalCharacter(i.m)||this.optionalCharacter(i.k)}return new l(e,r,this.errors)},_ParseAST.prototype.error=function(e,t){void 0===t&&(t=null),this.errors.push(new s.b(e,this.input,this.locationText(t),this.location)),this.skip()},_ParseAST.prototype.locationText=function(e){return void 0===e&&(e=null),r.i(o.b)(e)&&(e=this.index),e<this.tokens.length?"at column "+(this.tokens[e].index+1)+" in":"at the end of the expression"},_ParseAST.prototype.skip=function(){for(var e=this.next;this.index<this.tokens.length&&!e.isCharacter(i.m)&&(this.rparensExpected<=0||!e.isCharacter(i.f))&&(this.rbracesExpected<=0||!e.isCharacter(i.h))&&(this.rbracketsExpected<=0||!e.isCharacter(i.j));)this.next.isError()&&this.errors.push(new s.b(this.next.toString(),this.input,this.locationText(),this.location)),this.advance(),e=this.next},_ParseAST}(),h=function(){function SimpleExpressionChecker(){this.simple=!0}return SimpleExpressionChecker.check=function(e){var t=new SimpleExpressionChecker;return e.visit(t),t.simple},SimpleExpressionChecker.prototype.visitImplicitReceiver=function(e,t){},SimpleExpressionChecker.prototype.visitInterpolation=function(e,t){this.simple=!1},SimpleExpressionChecker.prototype.visitLiteralPrimitive=function(e,t){},SimpleExpressionChecker.prototype.visitPropertyRead=function(e,t){},SimpleExpressionChecker.prototype.visitPropertyWrite=function(e,t){this.simple=!1},SimpleExpressionChecker.prototype.visitSafePropertyRead=function(e,t){this.simple=!1},SimpleExpressionChecker.prototype.visitMethodCall=function(e,t){this.simple=!1},SimpleExpressionChecker.prototype.visitSafeMethodCall=function(e,t){this.simple=!1},SimpleExpressionChecker.prototype.visitFunctionCall=function(e,t){this.simple=!1},SimpleExpressionChecker.prototype.visitLiteralArray=function(e,t){this.visitAll(e.expressions)},SimpleExpressionChecker.prototype.visitLiteralMap=function(e,t){this.visitAll(e.values)},SimpleExpressionChecker.prototype.visitBinary=function(e,t){this.simple=!1},SimpleExpressionChecker.prototype.visitPrefixNot=function(e,t){this.simple=!1},SimpleExpressionChecker.prototype.visitConditional=function(e,t){this.simple=!1},SimpleExpressionChecker.prototype.visitPipe=function(e,t){this.simple=!1},SimpleExpressionChecker.prototype.visitKeyedRead=function(e,t){this.simple=!1},SimpleExpressionChecker.prototype.visitKeyedWrite=function(e,t){this.simple=!1},SimpleExpressionChecker.prototype.visitAll=function(e){var t=this;return e.map(function(e){return e.visit(t)})},SimpleExpressionChecker.prototype.visitChain=function(e,t){this.simple=!1},SimpleExpressionChecker.prototype.visitQuote=function(e,t){this.simple=!1},SimpleExpressionChecker}()},function(e,t,r){"use strict";var n=r(0),i=r(168),o=r(41),a=r(75);r.d(t,"b",function(){return u}),r.d(t,"a",function(){return a.a});var s=this&&this.__extends||function(e,t){function __(){this.constructor=e}for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r]);e.prototype=null===t?Object.create(t):(__.prototype=t.prototype,new __)},u=function(e){function HtmlParser(){e.call(this,i.a)}return s(HtmlParser,e),HtmlParser.prototype.parse=function(t,r,n,i){return void 0===n&&(n=!1),void 0===i&&(i=o.a),e.prototype.parse.call(this,t,r,n,i)},HtmlParser.decorators=[{type:n.Injectable}],HtmlParser.ctorParameters=[],HtmlParser}(a.b)},function(e,t,r){"use strict";function splitClasses(e){return e.trim().split(/\s+/g)}function createElementCssSelector(e,t){var n=new _.a,i=r.i(d.e)(e)[1];n.setElement(i);for(var o=0;o<t.length;o++){var a=t[o][0],s=r.i(d.e)(a)[1],u=t[o][1];if(n.addAttribute(s,u),a.toLowerCase()==B){var c=splitClasses(u);c.forEach(function(e){return n.addClassName(e)})}}return n}function _isAnimationLabel(e){return"@"==e[0]}function _isEmptyTextNode(e){return e instanceof l.d&&0==e.value.trim().length}var n=r(0),i=r(17),o=r(164),a=r(120),s=r(2),u=r(263),c=r(13),l=r(52),p=r(121),f=r(440),h=r(41),d=r(76),m=r(42),v=r(14),y=r(274),g=r(90),_=r(174),b=r(277),w=r(23),C=r(53),E=r(278);r.d(t,"a",function(){return J});var S=this&&this.__extends||function(e,t){function __(){this.constructor=e}for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r]);e.prototype=null===t?Object.create(t):(__.prototype=t.prototype,new __)},A=/^(?:(?:(?:(bind-)|(let-)|(ref-|#)|(on-)|(bindon-)|(@))(.+))|\[\(([^\)]+)\)\]|\[([^\]]+)\]|\(([^\)]+)\))$/,P=1,x=2,T=3,O=4,R=5,M=6,N=7,I=8,D=9,k=10,V="animate-",L="template",j="template",F="*",B="class",U=".",W="attr",H="class",G="style",z=_.a.parse("*")[0],q=new n.OpaqueToken("TemplateTransforms"),K=function(e){function TemplateParseError(t,r,n){e.call(this,r,t,n)}return S(TemplateParseError,e),TemplateParseError}(m.a),Q=function(){function TemplateParseResult(e,t){this.templateAst=e,this.errors=t}return TemplateParseResult}(),J=function(){function TemplateParser(e,t,r,n,i){this._exprParser=e,this._schemaRegistry=t,this._htmlParser=r,this._console=n,this.transforms=i}return TemplateParser.prototype.parse=function(e,t,r,n,i,o){var a=this.tryParse(e,t,r,n,i,o),s=a.errors.filter(function(e){return e.level===m.e.WARNING}),u=a.errors.filter(function(e){return e.level===m.e.FATAL});if(s.length>0&&this._console.warn("Template parse warnings:\n"+s.join("\n")),u.length>0){var c=u.join("\n");throw new Error("Template parse errors:\n"+c)}return a.templateAst},TemplateParser.prototype.tryParse=function(e,t,r,n,i,o){return this.tryParseHtml(this.expandHtml(this._htmlParser.parse(t,o,!0,this.getInterpolationConfig(e))),e,t,r,n,i,o)},TemplateParser.prototype.tryParseHtml=function(e,t,n,o,a,u,c){var p,f=e.errors;if(e.rootNodes.length>0){var h=r.i(i.f)(o),d=r.i(i.f)(a),m=new y.a(t,e.rootNodes[0].sourceSpan),v=new X(m,h,d,u,this._exprParser,this._schemaRegistry);p=l.g(v,e.rootNodes,te),f.push.apply(f,v.errors.concat(m.errors))}else p=[];return this._assertNoReferenceDuplicationOnTemplate(p,f),f.length>0?new Q(p,f):(r.i(s.a)(this.transforms)&&this.transforms.forEach(function(e){p=r.i(C.c)(e,p)}),new Q(p,f))},TemplateParser.prototype.expandHtml=function(e,t){void 0===t&&(t=!1);var n=e.errors;if(0==n.length||t){var i=r.i(f.a)(e.rootNodes);n.push.apply(n,i.errors),e=new p.a(i.nodes,n)}return e},TemplateParser.prototype.getInterpolationConfig=function(e){if(e.template)return h.b.fromArray(e.template.interpolation)},TemplateParser.prototype._assertNoReferenceDuplicationOnTemplate=function(e,t){var r=[];e.filter(function(e){return!!e.references}).forEach(function(e){return e.references.forEach(function(e){var n=e.name;if(r.indexOf(n)<0)r.push(n);else{var i=new K('Reference "#'+n+'" is defined several times',e.sourceSpan,m.e.FATAL);t.push(i)}})})},TemplateParser.decorators=[{type:n.Injectable}],TemplateParser.ctorParameters=[{type:a.a},{type:g.a},{type:u.a},{type:v.B},{type:Array,decorators:[{type:n.Optional},{type:n.Inject,args:[q]}]}],TemplateParser}(),X=function(){function TemplateParseVisitor(e,t,r,n,i,o){var a=this;this.providerViewContext=e,this._schemas=n,this._exprParser=i,this._schemaRegistry=o,this.selectorMatcher=new _.b,this.errors=[],this.directivesIndex=new Map,this.ngContentCount=0,this.pipesByName=new Map;var s=e.component.template;s&&s.interpolation&&(this._interpolationConfig={start:s.interpolation[0],end:s.interpolation[1]}),t.forEach(function(e,t){var r=_.a.parse(e.selector);a.selectorMatcher.addSelectables(r,e),a.directivesIndex.set(e,t)}),r.forEach(function(e){return a.pipesByName.set(e.name,e)})}return TemplateParseVisitor.prototype._reportError=function(e,t,r){void 0===r&&(r=m.e.FATAL),this.errors.push(new K(e,t,r))},TemplateParseVisitor.prototype._reportParserErrors=function(e,t){for(var r=0,n=e;r<n.length;r++){var i=n[r];this._reportError(i.message,t)}},TemplateParseVisitor.prototype._parseInterpolation=function(e,t){var n=t.start.toString();try{var i=this._exprParser.parseInterpolation(e,n,this._interpolationConfig);if(i&&this._reportParserErrors(i.errors,t),this._checkPipes(i,t),r.i(s.a)(i)&&i.ast.expressions.length>v.a.MAX_INTERPOLATION_VALUES)throw new Error("Only support at most "+v.a.MAX_INTERPOLATION_VALUES+" interpolation values!");return i}catch(e){return this._reportError(""+e,t),this._exprParser.wrapLiteralPrimitive("ERROR",n)}},TemplateParseVisitor.prototype._parseAction=function(e,t){var r=t.start.toString();try{var n=this._exprParser.parseAction(e,r,this._interpolationConfig);return n&&this._reportParserErrors(n.errors,t),!n||n.ast instanceof o.g?(this._reportError("Empty expressions are not allowed",t),this._exprParser.wrapLiteralPrimitive("ERROR",r)):(this._checkPipes(n,t),n)}catch(e){return this._reportError(""+e,t),this._exprParser.wrapLiteralPrimitive("ERROR",r)}},TemplateParseVisitor.prototype._parseBinding=function(e,t){var r=t.start.toString();try{var n=this._exprParser.parseBinding(e,r,this._interpolationConfig);return n&&this._reportParserErrors(n.errors,t),this._checkPipes(n,t),n}catch(e){return this._reportError(""+e,t),this._exprParser.wrapLiteralPrimitive("ERROR",r)}},TemplateParseVisitor.prototype._parseTemplateBindings=function(e,t){var n=this,i=t.start.toString();try{var o=this._exprParser.parseTemplateBindings(e,i);return this._reportParserErrors(o.errors,t),o.templateBindings.forEach(function(e){r.i(s.a)(e.expression)&&n._checkPipes(e.expression,t)}),o.warnings.forEach(function(e){n._reportError(e,t,m.e.WARNING)}),o.templateBindings}catch(e){return this._reportError(""+e,t),[]}},TemplateParseVisitor.prototype._checkPipes=function(e,t){var n=this;if(r.i(s.a)(e)){var i=new ne;e.visit(i),i.pipes.forEach(function(e){n.pipesByName.has(e)||n._reportError("The pipe '"+e+"' could not be found",t)})}},TemplateParseVisitor.prototype.visitExpansion=function(e,t){return null},TemplateParseVisitor.prototype.visitExpansionCase=function(e,t){return null},TemplateParseVisitor.prototype.visitText=function(e,t){var n=t.findNgContentIndex(z),i=this._parseInterpolation(e.value,e.sourceSpan);return r.i(s.a)(i)?new C.d(i,n,e.sourceSpan):new C.e(e.value,n,e.sourceSpan)},TemplateParseVisitor.prototype.visitAttribute=function(e,t){return new C.f(e.name,e.value,e.sourceSpan)},TemplateParseVisitor.prototype.visitComment=function(e,t){return null},TemplateParseVisitor.prototype.visitElement=function(e,t){var n=this,i=e.name,o=r.i(E.a)(e);if(o.type===E.b.SCRIPT||o.type===E.b.STYLE)return null;if(o.type===E.b.STYLESHEET&&r.i(b.a)(o.hrefAttr))return null;var a=[],u=[],c=[],p=[],f=[],h=[],m=[],v=[],g=[],w=!1,S=[],A=r.i(d.e)(i.toLowerCase())[1],P=A==L;e.attrs.forEach(function(e){var t=n._parseAttr(P,e,a,u,f,h,c,p),r=n._parseInlineTemplateBinding(e,v,m,g);r&&w&&n._reportError("Can't have multiple template bindings on one element. Use only one attribute named 'template' or prefixed with *",e.sourceSpan),t||r||(S.push(n.visitAttribute(e,null)),a.push([e.name,e.value])),r&&(w=!0)});var x=createElementCssSelector(i,a),T=this._parseDirectives(this.selectorMatcher,x),O=T.directives,R=T.matchElement,M=[],N=this._createDirectiveAsts(P,e.name,O,u,c,e.sourceSpan,M),I=this._createElementPropertyAsts(e.name,u,N).concat(f),D=t.isTemplateElement||w,k=new y.b(this.providerViewContext,t.providerContext,D,N,S,M,e.sourceSpan),V=l.g(o.nonBindable?re:this,e.children,ee.create(P,N,P?t.providerContext:k));k.afterElement();var j,F=r.i(s.a)(o.projectAs)?_.a.parse(o.projectAs)[0]:x,B=t.findNgContentIndex(F);if(o.type===E.b.NG_CONTENT)e.children&&!e.children.every(_isEmptyTextNode)&&this._reportError("<ng-content> element cannot have content.",e.sourceSpan),j=new C.g(this.ngContentCount++,w?null:B,e.sourceSpan);else if(P)this._assertAllEventsPublishedByDirectives(N,h),this._assertNoComponentsNorElementBindingsOnTemplate(N,I,e.sourceSpan),j=new C.h(S,h,M,p,k.transformedDirectiveAsts,k.transformProviders,k.transformedHasViewContainer,V,w?null:B,e.sourceSpan);else{this._assertElementExists(R,e),this._assertOnlyOneComponent(N,e.sourceSpan);var U=w?null:t.findNgContentIndex(F);j=new C.i(i,S,I,h,M,k.transformedDirectiveAsts,k.transformProviders,k.transformedHasViewContainer,V,w?null:U,e.sourceSpan,e.endSourceSpan),this._findComponentDirectives(N).forEach(function(e){return n._validateElementAnimationInputOutputs(e.hostProperties,e.hostEvents,e.directive.template)});var W=k.viewContext.component.template;this._validateElementAnimationInputOutputs(I,h,W)}if(w){var H=createElementCssSelector(L,v),G=this._parseDirectives(this.selectorMatcher,H).directives,z=this._createDirectiveAsts(!0,e.name,G,m,[],e.sourceSpan,[]),q=this._createElementPropertyAsts(e.name,m,z);this._assertNoComponentsNorElementBindingsOnTemplate(z,q,e.sourceSpan);var K=new y.b(this.providerViewContext,t.providerContext,t.isTemplateElement,z,[],[],e.sourceSpan);K.afterElement(),j=new C.h([],[],[],g,K.transformedDirectiveAsts,K.transformProviders,K.transformedHasViewContainer,[j],B,e.sourceSpan)}return j},TemplateParseVisitor.prototype._validateElementAnimationInputOutputs=function(e,t,r){var n=this,i=new Set;r.animations.forEach(function(e){i.add(e.name)});var o=e.filter(function(e){return e.isAnimation});o.forEach(function(e){var t=e.name;i.has(t)||n._reportError("Couldn't find an animation entry for \""+t+'"',e.sourceSpan)}),t.forEach(function(e){if(e.isAnimation){var t=o.find(function(t){return t.name==e.name});t||n._reportError("Unable to listen on (@"+e.name+"."+e.phase+") because the animation trigger [@"+e.name+"] isn't being used on the same element",e.sourceSpan)}})},TemplateParseVisitor.prototype._parseInlineTemplateBinding=function(e,t,n,i){var o=null;if(this._normalizeAttributeName(e.name)==j)o=e.value;else if(e.name.startsWith(F)){var a=e.name.substring(F.length);o=0==e.value.length?a:a+" "+e.value}if(r.i(s.a)(o)){for(var u=this._parseTemplateBindings(o,e.sourceSpan),c=0;c<u.length;c++){var l=u[c]; l.keyIsVar?i.push(new C.j(l.key,l.name,e.sourceSpan)):r.i(s.a)(l.expression)?this._parsePropertyAst(l.key,l.expression,e.sourceSpan,t,n):(t.push([l.key,""]),this._parseLiteralAttr(l.key,null,e.sourceSpan,n))}return!0}return!1},TemplateParseVisitor.prototype._parseAttr=function(e,t,n,i,o,a,u,c){var l=this._normalizeAttributeName(t.name),p=t.value,f=t.sourceSpan,h=l.match(A),d=!1;if(null!==h)if(d=!0,r.i(s.a)(h[P]))this._parsePropertyOrAnimation(h[N],p,f,n,i,o);else if(h[x])if(e){var v=h[N];this._parseVariable(v,p,f,c)}else this._reportError('"let-" is only supported on template elements.',f);else if(h[T]){var v=h[N];this._parseReference(v,p,f,u)}else h[O]?this._parseEventOrAnimationEvent(h[N],p,f,n,a):h[R]?(this._parsePropertyOrAnimation(h[N],p,f,n,i,o),this._parseAssignmentEvent(h[N],p,f,n,a)):h[M]?(_isAnimationLabel(l)&&r.i(s.a)(p)&&p.length>0&&this._reportError('Assigning animation triggers via @prop="exp" attributes with an expression is invalid. Use property bindings (e.g. [@prop]="exp") or use an attribute without a value (e.g. @prop) instead.',f,m.e.FATAL),this._parseAnimation(h[N],p,f,n,o)):h[I]?(this._parsePropertyOrAnimation(h[I],p,f,n,i,o),this._parseAssignmentEvent(h[I],p,f,n,a)):h[D]?this._parsePropertyOrAnimation(h[D],p,f,n,i,o):h[k]&&this._parseEventOrAnimationEvent(h[k],p,f,n,a);else d=this._parsePropertyInterpolation(l,p,f,n,i);return d||this._parseLiteralAttr(l,p,f,i),d},TemplateParseVisitor.prototype._normalizeAttributeName=function(e){return/^data-/i.test(e)?e.substring(5):e},TemplateParseVisitor.prototype._parseVariable=function(e,t,r,n){e.indexOf("-")>-1&&this._reportError('"-" is not allowed in variable names',r),n.push(new C.j(e,t,r))},TemplateParseVisitor.prototype._parseReference=function(e,t,r,n){e.indexOf("-")>-1&&this._reportError('"-" is not allowed in reference names',r),n.push(new Y(e,t,r))},TemplateParseVisitor.prototype._parsePropertyOrAnimation=function(e,t,r,n,i,o){var a=V.length,s=_isAnimationLabel(e),u=1;e.substring(0,a)==V&&(s=!0,u=a),s?this._parseAnimation(e.substr(u),t,r,n,o):this._parsePropertyAst(e,this._parseBinding(t,r),r,n,i)},TemplateParseVisitor.prototype._parseAnimation=function(e,t,i,o,a){r.i(s.a)(t)&&0!=t.length||(t="null");var u=this._parseBinding(t,i);o.push([e,u.source]),a.push(new C.k(e,C.l.Animation,n.SecurityContext.NONE,u,null,i))},TemplateParseVisitor.prototype._parsePropertyInterpolation=function(e,t,n,i,o){var a=this._parseInterpolation(t,n);return!!r.i(s.a)(a)&&(this._parsePropertyAst(e,a,n,i,o),!0)},TemplateParseVisitor.prototype._parsePropertyAst=function(e,t,r,n,i){n.push([e,t.source]),i.push(new $(e,t,!1,r))},TemplateParseVisitor.prototype._parseAssignmentEvent=function(e,t,r,n,i){this._parseEventOrAnimationEvent(e+"Change",t+"=$event",r,n,i)},TemplateParseVisitor.prototype._parseEventOrAnimationEvent=function(e,t,r,n,i){_isAnimationLabel(e)?(e=e.substr(1),this._parseAnimationEvent(e,t,r,i)):this._parseEvent(e,t,r,n,i)},TemplateParseVisitor.prototype._parseAnimationEvent=function(e,t,n,i){var o=r.i(w.d)(e,[e,""]),a=o[0],s=o[1].toLowerCase();if(s)switch(s){case"start":case"done":var u=this._parseAction(t,n);i.push(new C.m(a,null,s,u,n));break;default:this._reportError('The provided animation output phase value "'+s+'" for "@'+a+'" is not supported (use start or done)',n)}else this._reportError("The animation trigger output event (@"+a+") is missing its phase value name (start or done are currently supported)",n)},TemplateParseVisitor.prototype._parseEvent=function(e,t,n,i,o){var a=r.i(w.b)(e,[null,e]),s=a[0],u=a[1],c=this._parseAction(t,n);i.push([e,c.source]),o.push(new C.m(u,s,null,c,n))},TemplateParseVisitor.prototype._parseLiteralAttr=function(e,t,r,n){n.push(new $(e,this._exprParser.wrapLiteralPrimitive(t,""),!0,r))},TemplateParseVisitor.prototype._parseDirectives=function(e,t){var r=this,n=new Array(this.directivesIndex.size),i=!1;return e.match(t,function(e,t){n[r.directivesIndex.get(t)]=t,i=i||e.hasElementSelector()}),{directives:n.filter(function(e){return!!e}),matchElement:i}},TemplateParseVisitor.prototype._createDirectiveAsts=function(e,t,n,i,o,a,s){var u=this,l=new Set,p=null,f=n.map(function(e){var n=new m.d(a.start,a.end,"Directive "+e.type.name);e.isComponent&&(p=e);var f=[],h=[],d=[];return u._createDirectiveHostPropertyAsts(t,e.hostProperties,n,f),u._createDirectiveHostEventAsts(e.hostListeners,n,h),u._createDirectivePropertyAsts(e.inputs,i,d),o.forEach(function(t){(0===t.value.length&&e.isComponent||e.exportAs==t.value)&&(s.push(new C.n(t.name,r.i(c.c)(e.type),t.sourceSpan)),l.add(t.name))}),new C.o(e,d,f,h,n)});return o.forEach(function(t){if(t.value.length>0)l.has(t.name)||u._reportError('There is no directive with "exportAs" set to "'+t.value+'"',t.sourceSpan);else if(!p){var n=null;e&&(n=r.i(c.a)(c.b.TemplateRef)),s.push(new C.n(t.name,n,t.sourceSpan))}}),f},TemplateParseVisitor.prototype._createDirectiveHostPropertyAsts=function(e,t,r,n){var i=this;t&&Object.keys(t).forEach(function(o){var a=t[o];if("string"==typeof a){var s=i._parseBinding(a,r);n.push(i._createElementPropertyAst(e,o,s,r))}else i._reportError('Value of the host property binding "'+o+'" needs to be a string representing an expression but got "'+a+'" ('+typeof a+")",r)})},TemplateParseVisitor.prototype._createDirectiveHostEventAsts=function(e,t,r){var n=this;e&&Object.keys(e).forEach(function(i){var o=e[i];"string"==typeof o?n._parseEventOrAnimationEvent(i,o,t,[],r):n._reportError('Value of the host listener "'+i+'" needs to be a string representing an expression but got "'+o+'" ('+typeof o+")",t)})},TemplateParseVisitor.prototype._createDirectivePropertyAsts=function(e,t,r){if(e){var n=new Map;t.forEach(function(e){var t=n.get(e.name);t&&!t.isLiteral||n.set(e.name,e)}),Object.keys(e).forEach(function(t){var i=e[t],o=n.get(i);o&&r.push(new C.p(t,o.name,o.expression,o.sourceSpan))})}},TemplateParseVisitor.prototype._createElementPropertyAsts=function(e,t,r){var n=this,i=[],o=new Map;return r.forEach(function(e){e.inputs.forEach(function(e){o.set(e.templateName,e)})}),t.forEach(function(t){t.isLiteral||o.get(t.name)||i.push(n._createElementPropertyAst(e,t.name,t.expression,t.sourceSpan))}),i},TemplateParseVisitor.prototype._createElementPropertyAst=function(e,t,i,o){var a,s,u,c=null,l=t.split(U);if(1===l.length){var p=l[0];if(_isAnimationLabel(p))s=p.substr(1),a=C.l.Animation,u=n.SecurityContext.NONE;else if(s=this._schemaRegistry.getMappedPropName(p),u=this._schemaRegistry.securityContext(e,s),a=C.l.Property,this._validatePropertyOrAttributeName(s,o,!1),!this._schemaRegistry.hasProperty(e,s,this._schemas)){var f="Can't bind to '"+s+"' since it isn't a known property of '"+e+"'.";e.indexOf("-")>-1&&(f+="\n1. If '"+e+"' is an Angular component and it has '"+s+"' input, then verify that it is part of this module."+("\n2. If '"+e+"' is a Web Component then add \"CUSTOM_ELEMENTS_SCHEMA\" to the '@NgModule.schemas' of this component to suppress this message.\n")),this._reportError(f,o)}}else if(l[0]==W){s=l[1],this._validatePropertyOrAttributeName(s,o,!0);var h=this._schemaRegistry.getMappedPropName(s);u=this._schemaRegistry.securityContext(e,h);var m=s.indexOf(":");if(m>-1){var v=s.substring(0,m),y=s.substring(m+1);s=r.i(d.d)(v,y)}a=C.l.Attribute}else l[0]==H?(s=l[1],a=C.l.Class,u=n.SecurityContext.NONE):l[0]==G?(c=l.length>2?l[2]:null,s=l[1],a=C.l.Style,u=n.SecurityContext.STYLE):(this._reportError("Invalid property name '"+t+"'",o),a=null,u=null);return new C.k(s,a,u,i,c,o)},TemplateParseVisitor.prototype._validatePropertyOrAttributeName=function(e,t,r){var n=r?this._schemaRegistry.validateAttribute(e):this._schemaRegistry.validateProperty(e);n.error&&this._reportError(n.msg,t,m.e.FATAL)},TemplateParseVisitor.prototype._findComponentDirectives=function(e){return e.filter(function(e){return e.directive.isComponent})},TemplateParseVisitor.prototype._findComponentDirectiveNames=function(e){return this._findComponentDirectives(e).map(function(e){return e.directive.type.name})},TemplateParseVisitor.prototype._assertOnlyOneComponent=function(e,t){var r=this._findComponentDirectiveNames(e);r.length>1&&this._reportError("More than one component: "+r.join(","),t)},TemplateParseVisitor.prototype._assertElementExists=function(e,t){var r=t.name.replace(/^:xhtml:/,"");if(!e&&!this._schemaRegistry.hasElement(r,this._schemas)){var n="'"+r+"' is not a known element:\n"+("1. If '"+r+"' is an Angular component, then verify that it is part of this module.\n")+("2. If '"+r+"' is a Web Component then add \"CUSTOM_ELEMENTS_SCHEMA\" to the '@NgModule.schemas' of this component to suppress this message.");this._reportError(n,t.sourceSpan)}},TemplateParseVisitor.prototype._assertNoComponentsNorElementBindingsOnTemplate=function(e,t,r){var n=this,i=this._findComponentDirectiveNames(e);i.length>0&&this._reportError("Components on an embedded template: "+i.join(","),r),t.forEach(function(e){n._reportError("Property binding "+e.name+' not used by any directive on an embedded template. Make sure that the property name is spelled correctly and all directives are listed in the "directives" section.',r)})},TemplateParseVisitor.prototype._assertAllEventsPublishedByDirectives=function(e,t){var n=this,i=new Set;e.forEach(function(e){Object.keys(e.directive.outputs).forEach(function(t){var r=e.directive.outputs[t];i.add(r)})}),t.forEach(function(e){!r.i(s.a)(e.target)&&i.has(e.name)||n._reportError("Event binding "+e.fullName+' not emitted by any directive on an embedded template. Make sure that the event name is spelled correctly and all directives are listed in the "directives" section.',e.sourceSpan)})},TemplateParseVisitor}(),Z=function(){function NonBindableVisitor(){}return NonBindableVisitor.prototype.visitElement=function(e,t){var n=r.i(E.a)(e);if(n.type===E.b.SCRIPT||n.type===E.b.STYLE||n.type===E.b.STYLESHEET)return null;var i=e.attrs.map(function(e){return[e.name,e.value]}),o=createElementCssSelector(e.name,i),a=t.findNgContentIndex(o),s=l.g(this,e.children,te);return new C.i(e.name,l.g(this,e.attrs),[],[],[],[],[],!1,s,a,e.sourceSpan,e.endSourceSpan)},NonBindableVisitor.prototype.visitComment=function(e,t){return null},NonBindableVisitor.prototype.visitAttribute=function(e,t){return new C.f(e.name,e.value,e.sourceSpan)},NonBindableVisitor.prototype.visitText=function(e,t){var r=t.findNgContentIndex(z);return new C.e(e.value,r,e.sourceSpan)},NonBindableVisitor.prototype.visitExpansion=function(e,t){return e},NonBindableVisitor.prototype.visitExpansionCase=function(e,t){return e},NonBindableVisitor}(),$=function(){function BoundElementOrDirectiveProperty(e,t,r,n){this.name=e,this.expression=t,this.isLiteral=r,this.sourceSpan=n}return BoundElementOrDirectiveProperty}(),Y=function(){function ElementOrDirectiveRef(e,t,r){this.name=e,this.value=t,this.sourceSpan=r}return ElementOrDirectiveRef}(),ee=function(){function ElementContext(e,t,r,n){this.isTemplateElement=e,this._ngContentIndexMatcher=t,this._wildcardNgContentIndex=r,this.providerContext=n}return ElementContext.create=function(e,t,r){var n=new _.b,i=null,o=t.find(function(e){return e.directive.isComponent});if(o)for(var a=o.directive.template.ngContentSelectors,s=0;s<a.length;s++){var u=a[s];"*"===u?i=s:n.addSelectables(_.a.parse(a[s]),s)}return new ElementContext(e,n,i,r)},ElementContext.prototype.findNgContentIndex=function(e){var t=[];return this._ngContentIndexMatcher.match(e,function(e,r){t.push(r)}),t.sort(),r.i(s.a)(this._wildcardNgContentIndex)&&t.push(this._wildcardNgContentIndex),t.length>0?t[0]:null},ElementContext}(),te=new ee(!0,new _.b,null,null),re=new Z,ne=function(e){function PipeCollector(){e.apply(this,arguments),this.pipes=new Set}return S(PipeCollector,e),PipeCollector.prototype.visitPipe=function(e,t){return this.pipes.add(e.name),e.exp.visit(this),this.visitAll(e.args,t),null},PipeCollector}(o.y)},function(e,t,r){"use strict";var n=r(0),i=r(74),o=r(280),a=r(282),s=r(454),u=r(455),c=r(177);r.d(t,"d",function(){return p}),r.d(t,"b",function(){return c.a}),r.d(t,"c",function(){return c.b}),r.d(t,"a",function(){return c.c});var l=function(){function ViewCompileResult(e,t,r){this.statements=e,this.viewFactoryVar=t,this.dependencies=r}return ViewCompileResult}(),p=function(){function ViewCompiler(e){this._genConfig=e}return ViewCompiler.prototype.compileComponent=function(e,t,n,i,c){var p=[],f=new a.a(e,this._genConfig,i,n,c,0,o.a.createNull(),[]),h=[];return r.i(u.a)(f,t,p),r.i(s.a)(f,t),r.i(u.b)(f,h),new l(h,f.viewFactory.name,p)},ViewCompiler.decorators=[{type:n.Injectable}],ViewCompiler.ctorParameters=[{type:i.a}],ViewCompiler}()},function(e,t,r){"use strict";function _appIdRandomProviderFactory(){return""+_randomChar()+_randomChar()+_randomChar()}function _randomChar(){return String.fromCharCode(97+Math.floor(25*Math.random()))}var n=r(33);r.d(t,"a",function(){return i}),r.d(t,"d",function(){return o}),r.d(t,"b",function(){return a}),r.d(t,"c",function(){return s}),r.d(t,"e",function(){return u});var i=new n.a("AppId"),o={provide:i,useFactory:_appIdRandomProviderFactory,deps:[]},a=new n.a("Platform Initializer"),s=new n.a("appBootstrapListener"),u=new n.a("Application Packages Root URL")},function(e,t,r){"use strict";var n=r(181),i=r(289),o=r(290),a=r(291),s=r(126),u=r(464),c=r(127);r.d(t,"b",function(){return f}),r.d(t,"c",function(){return h}),r.d(t,"j",function(){return s.e}),r.d(t,"h",function(){return s.d}),r.d(t,"a",function(){return s.b}),r.d(t,"g",function(){return u.a}),r.d(t,"i",function(){return c.a}),r.d(t,"f",function(){return c.b}),r.d(t,"k",function(){return n.b}),r.d(t,"l",function(){return n.c}),r.d(t,"m",function(){return i.b}),r.d(t,"d",function(){return o.a}),r.d(t,"e",function(){return a.a});var l=[new i.a],p=[new n.a],f=new o.a(p),h=new a.a(l)},function(e,t,r){"use strict";function devModeEqual(e,t){return r.i(n.c)(e)&&r.i(n.c)(t)?r.i(n.e)(e,t,devModeEqual):!(r.i(n.c)(e)||r.i(i.k)(e)||r.i(n.c)(t)||r.i(i.k)(t))||r.i(i.i)(e,t)}var n=r(19),i=r(3);r.d(t,"a",function(){return o}),t.b=devModeEqual,r.d(t,"d",function(){return a}),r.d(t,"c",function(){return s}),r.d(t,"e",function(){return u});var o={toString:function(){return"CD_INIT_VALUE"}},a=function(){function WrappedValue(e){this.wrapped=e}return WrappedValue.wrap=function(e){return new WrappedValue(e)},WrappedValue}(),s=function(){function ValueUnwrapper(){this.hasWrappedValue=!1}return ValueUnwrapper.prototype.unwrap=function(e){return e instanceof a?(this.hasWrappedValue=!0,e.wrapped):e},ValueUnwrapper.prototype.reset=function(){this.hasWrappedValue=!1},ValueUnwrapper}(),u=function(){function SimpleChange(e,t){this.previousValue=e,this.currentValue=t}return SimpleChange.prototype.isFirstChange=function(){return this.previousValue===o},SimpleChange}()},function(e,t,r){"use strict";function isDefaultChangeDetectionStrategy(e){return r.i(n.c)(e)||e===i.Default}var n=r(3);r.d(t,"a",function(){return i}),r.d(t,"b",function(){return o}),t.c=isDefaultChangeDetectionStrategy;var i;!function(e){e[e.OnPush=0]="OnPush",e[e.Default=1]="Default"}(i||(i={}));var o;!function(e){e[e.CheckOnce=0]="CheckOnce",e[e.Checked=1]="Checked",e[e.CheckAlways=2]="CheckAlways",e[e.Detached=3]="Detached",e[e.Errored=4]="Errored",e[e.Destroyed=5]="Destroyed"}(o||(o={}))},function(e,t,r){"use strict";var n=r(29),i=r(3);r.d(t,"a",function(){return a}),r.d(t,"b",function(){return u});var o=new Object,a=o,s=function(){function _NullInjector(){}return _NullInjector.prototype.get=function(e,t){if(void 0===t&&(t=o),t===o)throw new Error("No provider for "+r.i(i.b)(e)+"!");return t},_NullInjector}(),u=function(){function Injector(){}return Injector.prototype.get=function(e,t){return r.i(n.a)()},Injector.THROW_IF_NOT_FOUND=o,Injector.NULL=new s,Injector}()},function(e,t,r){"use strict";var n=r(78);r.d(t,"b",function(){return i}),r.d(t,"c",function(){return o}),r.d(t,"a",function(){return a}),r.d(t,"d",function(){return s}),r.d(t,"f",function(){return u}),r.d(t,"e",function(){return c});var i=r.i(n.a)("Inject",[["token",void 0]]),o=r.i(n.a)("Optional",[]),a=r.i(n.a)("Injectable",[]),s=r.i(n.a)("Self",[]),u=r.i(n.a)("SkipSelf",[]),c=r.i(n.a)("Host",[])},function(e,t,r){"use strict";var n=r(29),i=r(3);r.d(t,"a",function(){return u}),r.d(t,"b",function(){return c});var o=this&&this.__extends||function(e,t){function __(){this.constructor=e}for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r]);e.prototype=null===t?Object.create(t):(__.prototype=t.prototype,new __)},a=function(e){function NoComponentFactoryError(t){e.call(this,"No component factory found for "+r.i(i.b)(t)),this.component=t}return o(NoComponentFactoryError,e),NoComponentFactoryError}(n.b),s=function(){function _NullComponentFactoryResolver(){}return _NullComponentFactoryResolver.prototype.resolveComponentFactory=function(e){throw new a(e)},_NullComponentFactoryResolver}(),u=function(){function ComponentFactoryResolver(){}return ComponentFactoryResolver.NULL=new s,ComponentFactoryResolver}(),c=function(){function CodegenComponentFactoryResolver(e,t){this._parent=t,this._factories=new Map;for(var r=0;r<e.length;r++){var n=e[r];this._factories.set(n.componentType,n)}}return CodegenComponentFactoryResolver.prototype.resolveComponentFactory=function(e){var t=this._factories.get(e);return t||(t=this._parent.resolveComponentFactory(e)),t},CodegenComponentFactoryResolver}()},function(e,t,r){"use strict";r.d(t,"a",function(){return n});var n;!function(e){e[e.HOST=0]="HOST",e[e.COMPONENT=1]="COMPONENT",e[e.EMBEDDED=2]="EMBEDDED"}(n||(n={}))},function(e,t,r){"use strict";function flattenNestedViewRenderNodes(e){return _flattenNestedViewRenderNodes(e,[])}function _flattenNestedViewRenderNodes(e,t){for(var n=0;n<e.length;n++){var i=e[n];if(i instanceof l.a){var o=i;if(t.push(o.nativeElement),r.i(s.d)(o.nestedViews))for(var a=0;a<o.nestedViews.length;a++)_flattenNestedViewRenderNodes(o.nestedViews[a].rootNodesOrAppElements,t)}else t.push(i)}return t}function ensureSlotCount(e,t){var r;if(e)if(e.length<t){var n=e.length;r=new Array(t);for(var i=0;i<t;i++)r[i]=i<n?e[i]:h}else r=e;else r=h;return r}function interpolate(e,t,r,n,i,o,a,s,u,c,l,p,f,h,d,m,v,y,g,_){switch(e){case 1:return t+_toStringWithNull(r)+n;case 2:return t+_toStringWithNull(r)+n+_toStringWithNull(i)+o;case 3:return t+_toStringWithNull(r)+n+_toStringWithNull(i)+o+_toStringWithNull(a)+s;case 4:return t+_toStringWithNull(r)+n+_toStringWithNull(i)+o+_toStringWithNull(a)+s+_toStringWithNull(u)+c;case 5:return t+_toStringWithNull(r)+n+_toStringWithNull(i)+o+_toStringWithNull(a)+s+_toStringWithNull(u)+c+_toStringWithNull(l)+p;case 6:return t+_toStringWithNull(r)+n+_toStringWithNull(i)+o+_toStringWithNull(a)+s+_toStringWithNull(u)+c+_toStringWithNull(l)+p+_toStringWithNull(f)+h;case 7:return t+_toStringWithNull(r)+n+_toStringWithNull(i)+o+_toStringWithNull(a)+s+_toStringWithNull(u)+c+_toStringWithNull(l)+p+_toStringWithNull(f)+h+_toStringWithNull(d)+m;case 8:return t+_toStringWithNull(r)+n+_toStringWithNull(i)+o+_toStringWithNull(a)+s+_toStringWithNull(u)+c+_toStringWithNull(l)+p+_toStringWithNull(f)+h+_toStringWithNull(d)+m+_toStringWithNull(v)+y;case 9:return t+_toStringWithNull(r)+n+_toStringWithNull(i)+o+_toStringWithNull(a)+s+_toStringWithNull(u)+c+_toStringWithNull(l)+p+_toStringWithNull(f)+h+_toStringWithNull(d)+m+_toStringWithNull(v)+y+_toStringWithNull(g)+_;default:throw new Error("Does not support more than 9 expressions")}}function _toStringWithNull(e){return null!=e?e.toString():""}function checkBinding(e,t,n){if(e){if(!r.i(i.a)(t,n))throw new p.a(t,n);return!1}return!r.i(s.i)(t,n)}function castByValue(e,t){return e}function pureProxy1(e){var t,n=o.a;return function(i){return r.i(s.i)(n,i)||(n=i,t=e(i)),t}}function pureProxy2(e){var t,n=o.a,i=o.a;return function(o,a){return r.i(s.i)(n,o)&&r.i(s.i)(i,a)||(n=o,i=a,t=e(o,a)),t}}function pureProxy3(e){var t,n=o.a,i=o.a,a=o.a;return function(o,u,c){return r.i(s.i)(n,o)&&r.i(s.i)(i,u)&&r.i(s.i)(a,c)||(n=o,i=u,a=c,t=e(o,u,c)),t}}function pureProxy4(e){var t,n,i,a,u;return n=i=a=u=o.a,function(o,c,l,p){return r.i(s.i)(n,o)&&r.i(s.i)(i,c)&&r.i(s.i)(a,l)&&r.i(s.i)(u,p)||(n=o,i=c,a=l,u=p,t=e(o,c,l,p)),t}}function pureProxy5(e){var t,n,i,a,u,c;return n=i=a=u=c=o.a,function(o,l,p,f,h){return r.i(s.i)(n,o)&&r.i(s.i)(i,l)&&r.i(s.i)(a,p)&&r.i(s.i)(u,f)&&r.i(s.i)(c,h)||(n=o,i=l,a=p,u=f,c=h,t=e(o,l,p,f,h)),t}}function pureProxy6(e){var t,n,i,a,u,c,l;return n=i=a=u=c=l=o.a,function(o,p,f,h,d,m){return r.i(s.i)(n,o)&&r.i(s.i)(i,p)&&r.i(s.i)(a,f)&&r.i(s.i)(u,h)&&r.i(s.i)(c,d)&&r.i(s.i)(l,m)||(n=o,i=p,a=f,u=h,c=d,l=m,t=e(o,p,f,h,d,m)),t}}function pureProxy7(e){var t,n,i,a,u,c,l,p;return n=i=a=u=c=l=p=o.a,function(o,f,h,d,m,v,y){return r.i(s.i)(n,o)&&r.i(s.i)(i,f)&&r.i(s.i)(a,h)&&r.i(s.i)(u,d)&&r.i(s.i)(c,m)&&r.i(s.i)(l,v)&&r.i(s.i)(p,y)||(n=o,i=f,a=h,u=d,c=m,l=v,p=y,t=e(o,f,h,d,m,v,y)),t}}function pureProxy8(e){var t,n,i,a,u,c,l,p,f;return n=i=a=u=c=l=p=f=o.a,function(o,h,d,m,v,y,g,_){return r.i(s.i)(n,o)&&r.i(s.i)(i,h)&&r.i(s.i)(a,d)&&r.i(s.i)(u,m)&&r.i(s.i)(c,v)&&r.i(s.i)(l,y)&&r.i(s.i)(p,g)&&r.i(s.i)(f,_)||(n=o,i=h,a=d,u=m,c=v,l=y,p=g,f=_,t=e(o,h,d,m,v,y,g,_)),t}}function pureProxy9(e){var t,n,i,a,u,c,l,p,f,h;return n=i=a=u=c=l=p=f=h=o.a,function(o,d,m,v,y,g,_,b,w){return r.i(s.i)(n,o)&&r.i(s.i)(i,d)&&r.i(s.i)(a,m)&&r.i(s.i)(u,v)&&r.i(s.i)(c,y)&&r.i(s.i)(l,g)&&r.i(s.i)(p,_)&&r.i(s.i)(f,b)&&r.i(s.i)(h,w)||(n=o,i=d,a=m,u=v,c=y,l=g,p=_,f=b,h=w,t=e(o,d,m,v,y,g,_,b,w)),t}}function pureProxy10(e){var t,n,i,a,u,c,l,p,f,h,d;return n=i=a=u=c=l=p=f=h=d=o.a,function(o,m,v,y,g,_,b,w,C,E){return r.i(s.i)(n,o)&&r.i(s.i)(i,m)&&r.i(s.i)(a,v)&&r.i(s.i)(u,y)&&r.i(s.i)(c,g)&&r.i(s.i)(l,_)&&r.i(s.i)(p,b)&&r.i(s.i)(f,w)&&r.i(s.i)(h,C)&&r.i(s.i)(d,E)||(n=o,i=m,a=v,u=y,c=g,l=_,p=b,f=w,h=C,d=E,t=e(o,m,v,y,g,_,b,w,C,E)),t}}function setBindingDebugInfoForChanges(e,t,r){Object.keys(r).forEach(function(n){setBindingDebugInfo(e,t,n,r[n].currentValue)})}function setBindingDebugInfo(e,t,r,n){try{e.setBindingDebugInfo(t,"ng-reflect-"+camelCaseToDashCase(r),n?n.toString():null)}catch(n){e.setBindingDebugInfo(t,"ng-reflect-"+camelCaseToDashCase(r),"[ERROR] Exception while trying to serialize the value")}}function camelCaseToDashCase(e){return e.replace(y,function(){for(var e=[],t=0;t<arguments.length;t++)e[t-0]=arguments[t];return"-"+e[1].toLowerCase()})}var n=r(124),i=r(125),o=r(126),a=r(33),s=r(3),u=r(191),c=r(310),l=r(188),p=r(299);r.d(t,"ViewUtils",function(){return f}),t.flattenNestedViewRenderNodes=flattenNestedViewRenderNodes,t.ensureSlotCount=ensureSlotCount,r.d(t,"MAX_INTERPOLATION_VALUES",function(){return d}),t.interpolate=interpolate,t.checkBinding=checkBinding,t.castByValue=castByValue,r.d(t,"EMPTY_ARRAY",function(){return m}),r.d(t,"EMPTY_MAP",function(){return v}),t.pureProxy1=pureProxy1,t.pureProxy2=pureProxy2,t.pureProxy3=pureProxy3,t.pureProxy4=pureProxy4,t.pureProxy5=pureProxy5,t.pureProxy6=pureProxy6,t.pureProxy7=pureProxy7,t.pureProxy8=pureProxy8,t.pureProxy9=pureProxy9,t.pureProxy10=pureProxy10,t.setBindingDebugInfoForChanges=setBindingDebugInfoForChanges,t.setBindingDebugInfo=setBindingDebugInfo;var f=function(){function ViewUtils(e,t,r){this._renderer=e,this._appId=t,this._nextCompTypeId=0,this.sanitizer=r}return ViewUtils.prototype.createRenderComponentType=function(e,t,r,n,i){return new u.a(this._appId+"-"+this._nextCompTypeId++,e,t,r,n,i)},ViewUtils.prototype.renderComponent=function(e){return this._renderer.renderComponent(e)},ViewUtils.decorators=[{type:a.b}],ViewUtils.ctorParameters=[{type:u.b},{type:void 0,decorators:[{type:a.c,args:[n.a]}]},{type:c.a}],ViewUtils}(),h=[],d=9,m=[],v={},y=/([A-Z])/g},function(e,t,r){"use strict";function noopScope(e,t){return null}var n=r(479);r.d(t,"a",function(){return o}),r.d(t,"b",function(){return a}),r.d(t,"c",function(){return s}),r.d(t,"d",function(){return u});var i=r.i(n.a)(),o=i?n.b:function(e,t){return noopScope},a=i?n.c:function(e,t){return t},s=i?n.d:function(e,t){return null},u=i?n.e:function(e){return null}},function(e,t,r){"use strict";var n=r(0),i=r(36);r.d(t,"a",function(){return a});var o={provide:i.a,useExisting:r.i(n.forwardRef)(function(){return a}),multi:!0},a=function(){function CheckboxControlValueAccessor(e,t){this._renderer=e,this._elementRef=t,this.onChange=function(e){},this.onTouched=function(){}}return CheckboxControlValueAccessor.prototype.writeValue=function(e){this._renderer.setElementProperty(this._elementRef.nativeElement,"checked",e)},CheckboxControlValueAccessor.prototype.registerOnChange=function(e){this.onChange=e},CheckboxControlValueAccessor.prototype.registerOnTouched=function(e){this.onTouched=e},CheckboxControlValueAccessor.prototype.setDisabledState=function(e){this._renderer.setElementProperty(this._elementRef.nativeElement,"disabled",e)},CheckboxControlValueAccessor.decorators=[{type:n.Directive,args:[{selector:"input[type=checkbox][formControlName],input[type=checkbox][formControl],input[type=checkbox][ngModel]",host:{"(change)":"onChange($event.target.checked)","(blur)":"onTouched()"},providers:[o]}]}],CheckboxControlValueAccessor.ctorParameters=[{type:n.Renderer},{type:n.ElementRef}],CheckboxControlValueAccessor}()},function(e,t,r){"use strict";var n=r(0),i=r(24),o=r(36);r.d(t,"a",function(){return s});var a={provide:o.a,useExisting:r.i(n.forwardRef)(function(){return s}),multi:!0},s=function(){function DefaultValueAccessor(e,t){this._renderer=e,this._elementRef=t,this.onChange=function(e){},this.onTouched=function(){}}return DefaultValueAccessor.prototype.writeValue=function(e){var t=r.i(i.b)(e)?"":e;this._renderer.setElementProperty(this._elementRef.nativeElement,"value",t)},DefaultValueAccessor.prototype.registerOnChange=function(e){this.onChange=e},DefaultValueAccessor.prototype.registerOnTouched=function(e){this.onTouched=e},DefaultValueAccessor.prototype.setDisabledState=function(e){this._renderer.setElementProperty(this._elementRef.nativeElement,"disabled",e)},DefaultValueAccessor.decorators=[{type:n.Directive,args:[{selector:"input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]",host:{"(input)":"onChange($event.target.value)","(blur)":"onTouched()"},providers:[a]}]}],DefaultValueAccessor.ctorParameters=[{type:n.Renderer},{type:n.ElementRef}],DefaultValueAccessor}()},function(e,t,r){"use strict";var n=r(0),i=r(37),o=r(94),a=r(43),s=r(95),u=r(312);r.d(t,"a",function(){return p});var c=this&&this.__extends||function(e,t){function __(){this.constructor=e}for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r]);e.prototype=null===t?Object.create(t):(__.prototype=t.prototype,new __)},l={provide:a.a,useExisting:r.i(n.forwardRef)(function(){return p})},p=function(e){function NgModelGroup(t,r,n){e.call(this),this._parent=t,this._validators=r,this._asyncValidators=n}return c(NgModelGroup,e),NgModelGroup.prototype._checkParentType=function(){this._parent instanceof NgModelGroup||this._parent instanceof s.a||u.a.modelGroupParentException()},NgModelGroup.decorators=[{type:n.Directive,args:[{selector:"[ngModelGroup]",providers:[l],exportAs:"ngModelGroup"}]}],NgModelGroup.ctorParameters=[{type:a.a,decorators:[{type:n.Host},{type:n.SkipSelf}]},{type:Array,decorators:[{type:n.Optional},{type:n.Self},{type:n.Inject,args:[i.b]}]},{type:Array,decorators:[{type:n.Optional},{type:n.Self},{type:n.Inject,args:[i.c]}]}],NgModelGroup.propDecorators={name:[{type:n.Input,args:["ngModelGroup"]}]},NgModelGroup}(o.a)},function(e,t,r){"use strict";var n=r(311);r.d(t,"a",function(){return i});var i=function(){function ReactiveErrors(){}return ReactiveErrors.controlParentException=function(){throw new Error("formControlName must be used with a parent formGroup directive. You'll want to add a formGroup\n directive and pass it an existing FormGroup instance (you can create one in your class).\n\n Example:\n\n "+n.a.formControlName)},ReactiveErrors.ngModelGroupException=function(){throw new Error('formControlName cannot be used with an ngModelGroup parent. It is only compatible with parents\n that also have a "form" prefix: formGroupName, formArrayName, or formGroup.\n\n Option 1: Update the parent to be formGroupName (reactive form strategy)\n\n '+n.a.formGroupName+"\n\n Option 2: Use ngModel instead of formControlName (template-driven strategy)\n\n "+n.a.ngModelGroup)},ReactiveErrors.missingFormException=function(){throw new Error("formGroup expects a FormGroup instance. Please pass one in.\n\n Example:\n\n "+n.a.formControlName)},ReactiveErrors.groupParentException=function(){throw new Error("formGroupName must be used with a parent formGroup directive. You'll want to add a formGroup\n directive and pass it an existing FormGroup instance (you can create one in your class).\n\n Example:\n\n "+n.a.formGroupName)},ReactiveErrors.arrayParentException=function(){throw new Error("formArrayName must be used with a parent formGroup directive. You'll want to add a formGroup\n directive and pass it an existing FormGroup instance (you can create one in your class).\n\n Example:\n\n "+n.a.formArrayName)},ReactiveErrors.disabledAttrWarning=function(){console.warn("\n It looks like you're using the disabled attribute with a reactive form directive. If you set disabled to true\n when you set up this control in your component class, the disabled attribute will actually be set in the DOM for\n you. We recommend using this approach to avoid 'changed after checked' errors.\n \n Example: \n form = new FormGroup({\n first: new FormControl({value: 'Nancy', disabled: true}, Validators.required),\n last: new FormControl('Drew', Validators.required)\n });\n ")},ReactiveErrors}()},function(e,t,r){"use strict";function _buildValueString(e,t){return r.i(o.b)(e)?""+t:(r.i(o.e)(t)||(t="Object"),(e+": "+t).slice(0,50))}function _extractId(e){return e.split(":")[0]}var n=r(0),i=r(80),o=r(24),a=r(36);r.d(t,"a",function(){return u}),r.d(t,"b",function(){return c});var s={provide:a.a,useExisting:r.i(n.forwardRef)(function(){return u}),multi:!0},u=function(){function SelectControlValueAccessor(e,t){this._renderer=e,this._elementRef=t,this._optionMap=new Map,this._idCounter=0,this.onChange=function(e){},this.onTouched=function(){}}return SelectControlValueAccessor.prototype.writeValue=function(e){this.value=e;var t=_buildValueString(this._getOptionId(e),e);this._renderer.setElementProperty(this._elementRef.nativeElement,"value",t)},SelectControlValueAccessor.prototype.registerOnChange=function(e){var t=this;this.onChange=function(r){t.value=r,e(t._getOptionValue(r))}},SelectControlValueAccessor.prototype.registerOnTouched=function(e){this.onTouched=e},SelectControlValueAccessor.prototype.setDisabledState=function(e){this._renderer.setElementProperty(this._elementRef.nativeElement,"disabled",e)},SelectControlValueAccessor.prototype._registerOption=function(){return(this._idCounter++).toString()},SelectControlValueAccessor.prototype._getOptionId=function(e){for(var t=0,n=i.c.keys(this._optionMap);t<n.length;t++){var a=n[t];if(r.i(o.f)(this._optionMap.get(a),e))return a}return null},SelectControlValueAccessor.prototype._getOptionValue=function(e){var t=this._optionMap.get(_extractId(e));return r.i(o.a)(t)?t:e},SelectControlValueAccessor.decorators=[{type:n.Directive,args:[{selector:"select:not([multiple])[formControlName],select:not([multiple])[formControl],select:not([multiple])[ngModel]",host:{"(change)":"onChange($event.target.value)","(blur)":"onTouched()"},providers:[s]}]}],SelectControlValueAccessor.ctorParameters=[{type:n.Renderer},{type:n.ElementRef}],SelectControlValueAccessor}(),c=function(){function NgSelectOption(e,t,n){this._element=e,this._renderer=t,this._select=n,r.i(o.a)(this._select)&&(this.id=this._select._registerOption())}return Object.defineProperty(NgSelectOption.prototype,"ngValue",{set:function(e){null!=this._select&&(this._select._optionMap.set(this.id,e),this._setElementValue(_buildValueString(this.id,e)), this._select.writeValue(this._select.value))},enumerable:!0,configurable:!0}),Object.defineProperty(NgSelectOption.prototype,"value",{set:function(e){this._setElementValue(e),r.i(o.a)(this._select)&&this._select.writeValue(this._select.value)},enumerable:!0,configurable:!0}),NgSelectOption.prototype._setElementValue=function(e){this._renderer.setElementProperty(this._element.nativeElement,"value",e)},NgSelectOption.prototype.ngOnDestroy=function(){r.i(o.a)(this._select)&&(this._select._optionMap.delete(this.id),this._select.writeValue(this._select.value))},NgSelectOption.decorators=[{type:n.Directive,args:[{selector:"option"}]}],NgSelectOption.ctorParameters=[{type:n.ElementRef},{type:n.Renderer},{type:u,decorators:[{type:n.Optional},{type:n.Host}]}],NgSelectOption.propDecorators={ngValue:[{type:n.Input,args:["ngValue"]}],value:[{type:n.Input,args:["value"]}]},NgSelectOption}()},function(e,t,r){"use strict";function _buildValueString(e,t){return r.i(o.b)(e)?""+t:("string"==typeof t&&(t="'"+t+"'"),r.i(o.e)(t)||(t="Object"),(e+": "+t).slice(0,50))}function _extractId(e){return e.split(":")[0]}var n=r(0),i=r(80),o=r(24),a=r(36);r.d(t,"a",function(){return u}),r.d(t,"b",function(){return c});var s={provide:a.a,useExisting:r.i(n.forwardRef)(function(){return u}),multi:!0},u=(function(){function HTMLCollection(){}return HTMLCollection}(),function(){function SelectMultipleControlValueAccessor(e,t){this._renderer=e,this._elementRef=t,this._optionMap=new Map,this._idCounter=0,this.onChange=function(e){},this.onTouched=function(){}}return SelectMultipleControlValueAccessor.prototype.writeValue=function(e){var t=this;if(this.value=e,null!=e){var r=e,n=r.map(function(e){return t._getOptionId(e)});this._optionMap.forEach(function(e,t){e._setSelected(n.indexOf(t.toString())>-1)})}},SelectMultipleControlValueAccessor.prototype.registerOnChange=function(e){var t=this;this.onChange=function(r){var n=[];if(r.hasOwnProperty("selectedOptions"))for(var i=r.selectedOptions,o=0;o<i.length;o++){var a=i.item(o),s=t._getOptionValue(a.value);n.push(s)}else for(var i=r.options,o=0;o<i.length;o++){var a=i.item(o);if(a.selected){var s=t._getOptionValue(a.value);n.push(s)}}e(n)}},SelectMultipleControlValueAccessor.prototype.registerOnTouched=function(e){this.onTouched=e},SelectMultipleControlValueAccessor.prototype.setDisabledState=function(e){this._renderer.setElementProperty(this._elementRef.nativeElement,"disabled",e)},SelectMultipleControlValueAccessor.prototype._registerOption=function(e){var t=(this._idCounter++).toString();return this._optionMap.set(t,e),t},SelectMultipleControlValueAccessor.prototype._getOptionId=function(e){for(var t=0,n=i.c.keys(this._optionMap);t<n.length;t++){var a=n[t];if(r.i(o.f)(this._optionMap.get(a)._value,e))return a}return null},SelectMultipleControlValueAccessor.prototype._getOptionValue=function(e){var t=this._optionMap.get(_extractId(e));return r.i(o.a)(t)?t._value:e},SelectMultipleControlValueAccessor.decorators=[{type:n.Directive,args:[{selector:"select[multiple][formControlName],select[multiple][formControl],select[multiple][ngModel]",host:{"(change)":"onChange($event.target)","(blur)":"onTouched()"},providers:[s]}]}],SelectMultipleControlValueAccessor.ctorParameters=[{type:n.Renderer},{type:n.ElementRef}],SelectMultipleControlValueAccessor}()),c=function(){function NgSelectMultipleOption(e,t,n){this._element=e,this._renderer=t,this._select=n,r.i(o.a)(this._select)&&(this.id=this._select._registerOption(this))}return Object.defineProperty(NgSelectMultipleOption.prototype,"ngValue",{set:function(e){null!=this._select&&(this._value=e,this._setElementValue(_buildValueString(this.id,e)),this._select.writeValue(this._select.value))},enumerable:!0,configurable:!0}),Object.defineProperty(NgSelectMultipleOption.prototype,"value",{set:function(e){r.i(o.a)(this._select)?(this._value=e,this._setElementValue(_buildValueString(this.id,e)),this._select.writeValue(this._select.value)):this._setElementValue(e)},enumerable:!0,configurable:!0}),NgSelectMultipleOption.prototype._setElementValue=function(e){this._renderer.setElementProperty(this._element.nativeElement,"value",e)},NgSelectMultipleOption.prototype._setSelected=function(e){this._renderer.setElementProperty(this._element.nativeElement,"selected",e)},NgSelectMultipleOption.prototype.ngOnDestroy=function(){r.i(o.a)(this._select)&&(this._select._optionMap.delete(this.id),this._select.writeValue(this._select.value))},NgSelectMultipleOption.decorators=[{type:n.Directive,args:[{selector:"option"}]}],NgSelectMultipleOption.ctorParameters=[{type:n.ElementRef},{type:n.Renderer},{type:u,decorators:[{type:n.Optional},{type:n.Host}]}],NgSelectMultipleOption.propDecorators={ngValue:[{type:n.Input,args:["ngValue"]}],value:[{type:n.Input,args:["value"]}]},NgSelectMultipleOption}()},function(e,t,r){"use strict";function _find(e,t,n){return r.i(a.b)(t)?null:(t instanceof Array||(t=t.split(n)),t instanceof Array&&0===t.length?null:t.reduce(function(e,t){return e instanceof m?e.controls[t]||null:e instanceof v?e.at(t)||null:null},e))}function toObservable(e){return r.i(s.a)(e)?r.i(n.fromPromise)(e):e}function coerceToValidator(e){return Array.isArray(e)?r.i(i.b)(e):e}function coerceToAsyncValidator(e){return Array.isArray(e)?r.i(i.c)(e):e}var n=r(156),i=(r.n(n),r(54)),o=r(79),a=r(24),s=r(314);r.d(t,"d",function(){return h}),r.d(t,"b",function(){return d}),r.d(t,"a",function(){return m}),r.d(t,"c",function(){return v});var u=this&&this.__extends||function(e,t){function __(){this.constructor=e}for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r]);e.prototype=null===t?Object.create(t):(__.prototype=t.prototype,new __)},c="VALID",l="INVALID",p="PENDING",f="DISABLED",h=function(){function AbstractControl(e,t){this.validator=e,this.asyncValidator=t,this._onCollectionChange=function(){},this._pristine=!0,this._touched=!1,this._onDisabledChange=[]}return Object.defineProperty(AbstractControl.prototype,"value",{get:function(){return this._value},enumerable:!0,configurable:!0}),Object.defineProperty(AbstractControl.prototype,"status",{get:function(){return this._status},enumerable:!0,configurable:!0}),Object.defineProperty(AbstractControl.prototype,"valid",{get:function(){return this._status===c},enumerable:!0,configurable:!0}),Object.defineProperty(AbstractControl.prototype,"invalid",{get:function(){return this._status===l},enumerable:!0,configurable:!0}),Object.defineProperty(AbstractControl.prototype,"pending",{get:function(){return this._status==p},enumerable:!0,configurable:!0}),Object.defineProperty(AbstractControl.prototype,"disabled",{get:function(){return this._status===f},enumerable:!0,configurable:!0}),Object.defineProperty(AbstractControl.prototype,"enabled",{get:function(){return this._status!==f},enumerable:!0,configurable:!0}),Object.defineProperty(AbstractControl.prototype,"errors",{get:function(){return this._errors},enumerable:!0,configurable:!0}),Object.defineProperty(AbstractControl.prototype,"pristine",{get:function(){return this._pristine},enumerable:!0,configurable:!0}),Object.defineProperty(AbstractControl.prototype,"dirty",{get:function(){return!this.pristine},enumerable:!0,configurable:!0}),Object.defineProperty(AbstractControl.prototype,"touched",{get:function(){return this._touched},enumerable:!0,configurable:!0}),Object.defineProperty(AbstractControl.prototype,"untouched",{get:function(){return!this._touched},enumerable:!0,configurable:!0}),Object.defineProperty(AbstractControl.prototype,"valueChanges",{get:function(){return this._valueChanges},enumerable:!0,configurable:!0}),Object.defineProperty(AbstractControl.prototype,"statusChanges",{get:function(){return this._statusChanges},enumerable:!0,configurable:!0}),AbstractControl.prototype.setValidators=function(e){this.validator=coerceToValidator(e)},AbstractControl.prototype.setAsyncValidators=function(e){this.asyncValidator=coerceToAsyncValidator(e)},AbstractControl.prototype.clearValidators=function(){this.validator=null},AbstractControl.prototype.clearAsyncValidators=function(){this.asyncValidator=null},AbstractControl.prototype.markAsTouched=function(e){var t=(void 0===e?{}:e).onlySelf;t=r.i(a.g)(t),this._touched=!0,r.i(a.a)(this._parent)&&!t&&this._parent.markAsTouched({onlySelf:t})},AbstractControl.prototype.markAsUntouched=function(e){var t=(void 0===e?{}:e).onlySelf;this._touched=!1,this._forEachChild(function(e){e.markAsUntouched({onlySelf:!0})}),r.i(a.a)(this._parent)&&!t&&this._parent._updateTouched({onlySelf:t})},AbstractControl.prototype.markAsDirty=function(e){var t=(void 0===e?{}:e).onlySelf;t=r.i(a.g)(t),this._pristine=!1,r.i(a.a)(this._parent)&&!t&&this._parent.markAsDirty({onlySelf:t})},AbstractControl.prototype.markAsPristine=function(e){var t=(void 0===e?{}:e).onlySelf;this._pristine=!0,this._forEachChild(function(e){e.markAsPristine({onlySelf:!0})}),r.i(a.a)(this._parent)&&!t&&this._parent._updatePristine({onlySelf:t})},AbstractControl.prototype.markAsPending=function(e){var t=(void 0===e?{}:e).onlySelf;t=r.i(a.g)(t),this._status=p,r.i(a.a)(this._parent)&&!t&&this._parent.markAsPending({onlySelf:t})},AbstractControl.prototype.disable=function(e){var t=void 0===e?{}:e,n=t.onlySelf,i=t.emitEvent;i=!r.i(a.a)(i)||i,this._status=f,this._errors=null,this._forEachChild(function(e){e.disable({onlySelf:!0})}),this._updateValue(),i&&(this._valueChanges.emit(this._value),this._statusChanges.emit(this._status)),this._updateAncestors(n),this._onDisabledChange.forEach(function(e){return e(!0)})},AbstractControl.prototype.enable=function(e){var t=void 0===e?{}:e,r=t.onlySelf,n=t.emitEvent;this._status=c,this._forEachChild(function(e){e.enable({onlySelf:!0})}),this.updateValueAndValidity({onlySelf:!0,emitEvent:n}),this._updateAncestors(r),this._onDisabledChange.forEach(function(e){return e(!1)})},AbstractControl.prototype._updateAncestors=function(e){r.i(a.a)(this._parent)&&!e&&(this._parent.updateValueAndValidity(),this._parent._updatePristine(),this._parent._updateTouched())},AbstractControl.prototype.setParent=function(e){this._parent=e},AbstractControl.prototype.updateValueAndValidity=function(e){var t=void 0===e?{}:e,n=t.onlySelf,i=t.emitEvent;n=r.i(a.g)(n),i=!r.i(a.a)(i)||i,this._setInitialStatus(),this._updateValue(),this.enabled&&(this._errors=this._runValidator(),this._status=this._calculateStatus(),this._status!==c&&this._status!==p||this._runAsyncValidator(i)),i&&(this._valueChanges.emit(this._value),this._statusChanges.emit(this._status)),r.i(a.a)(this._parent)&&!n&&this._parent.updateValueAndValidity({onlySelf:n,emitEvent:i})},AbstractControl.prototype._updateTreeValidity=function(e){var t=(void 0===e?{emitEvent:!0}:e).emitEvent;this._forEachChild(function(e){return e._updateTreeValidity({emitEvent:t})}),this.updateValueAndValidity({onlySelf:!0,emitEvent:t})},AbstractControl.prototype._setInitialStatus=function(){this._status=this._allControlsDisabled()?f:c},AbstractControl.prototype._runValidator=function(){return r.i(a.a)(this.validator)?this.validator(this):null},AbstractControl.prototype._runAsyncValidator=function(e){var t=this;if(r.i(a.a)(this.asyncValidator)){this._status=p,this._cancelExistingSubscription();var n=toObservable(this.asyncValidator(this));this._asyncValidationSubscription=n.subscribe({next:function(r){return t.setErrors(r,{emitEvent:e})}})}},AbstractControl.prototype._cancelExistingSubscription=function(){r.i(a.a)(this._asyncValidationSubscription)&&this._asyncValidationSubscription.unsubscribe()},AbstractControl.prototype.setErrors=function(e,t){var n=(void 0===t?{}:t).emitEvent;n=!r.i(a.a)(n)||n,this._errors=e,this._updateControlsErrors(n)},AbstractControl.prototype.get=function(e){return _find(this,e,".")},AbstractControl.prototype.getError=function(e,t){void 0===t&&(t=null);var n=r.i(a.a)(t)&&t.length>0?this.get(t):this;return r.i(a.a)(n)&&r.i(a.a)(n._errors)?n._errors[e]:null},AbstractControl.prototype.hasError=function(e,t){return void 0===t&&(t=null),r.i(a.a)(this.getError(e,t))},Object.defineProperty(AbstractControl.prototype,"root",{get:function(){for(var e=this;r.i(a.a)(e._parent);)e=e._parent;return e},enumerable:!0,configurable:!0}),AbstractControl.prototype._updateControlsErrors=function(e){this._status=this._calculateStatus(),e&&this._statusChanges.emit(this._status),r.i(a.a)(this._parent)&&this._parent._updateControlsErrors(e)},AbstractControl.prototype._initObservables=function(){this._valueChanges=new o.a,this._statusChanges=new o.a},AbstractControl.prototype._calculateStatus=function(){return this._allControlsDisabled()?f:r.i(a.a)(this._errors)?l:this._anyControlsHaveStatus(p)?p:this._anyControlsHaveStatus(l)?l:c},AbstractControl.prototype._anyControlsHaveStatus=function(e){return this._anyControls(function(t){return t.status===e})},AbstractControl.prototype._anyControlsDirty=function(){return this._anyControls(function(e){return e.dirty})},AbstractControl.prototype._anyControlsTouched=function(){return this._anyControls(function(e){return e.touched})},AbstractControl.prototype._updatePristine=function(e){var t=(void 0===e?{}:e).onlySelf;this._pristine=!this._anyControlsDirty(),r.i(a.a)(this._parent)&&!t&&this._parent._updatePristine({onlySelf:t})},AbstractControl.prototype._updateTouched=function(e){var t=(void 0===e?{}:e).onlySelf;this._touched=this._anyControlsTouched(),r.i(a.a)(this._parent)&&!t&&this._parent._updateTouched({onlySelf:t})},AbstractControl.prototype._isBoxedValue=function(e){return"object"==typeof e&&null!==e&&2===Object.keys(e).length&&"value"in e&&"disabled"in e},AbstractControl.prototype._registerOnCollectionChange=function(e){this._onCollectionChange=e},AbstractControl}(),d=function(e){function FormControl(t,r,n){void 0===t&&(t=null),void 0===r&&(r=null),void 0===n&&(n=null),e.call(this,coerceToValidator(r),coerceToAsyncValidator(n)),this._onChange=[],this._applyFormState(t),this.updateValueAndValidity({onlySelf:!0,emitEvent:!1}),this._initObservables()}return u(FormControl,e),FormControl.prototype.setValue=function(e,t){var n=this,i=void 0===t?{}:t,o=i.onlySelf,s=i.emitEvent,u=i.emitModelToViewChange,c=i.emitViewToModelChange;u=!r.i(a.a)(u)||u,c=!r.i(a.a)(c)||c,this._value=e,this._onChange.length&&u&&this._onChange.forEach(function(e){return e(n._value,c)}),this.updateValueAndValidity({onlySelf:o,emitEvent:s})},FormControl.prototype.patchValue=function(e,t){void 0===t&&(t={}),this.setValue(e,t)},FormControl.prototype.reset=function(e,t){void 0===e&&(e=null);var r=(void 0===t?{}:t).onlySelf;this._applyFormState(e),this.markAsPristine({onlySelf:r}),this.markAsUntouched({onlySelf:r}),this.setValue(this._value,{onlySelf:r})},FormControl.prototype._updateValue=function(){},FormControl.prototype._anyControls=function(e){return!1},FormControl.prototype._allControlsDisabled=function(){return this.disabled},FormControl.prototype.registerOnChange=function(e){this._onChange.push(e)},FormControl.prototype._clearChangeFns=function(){this._onChange=[],this._onDisabledChange=[],this._onCollectionChange=function(){}},FormControl.prototype.registerOnDisabledChange=function(e){this._onDisabledChange.push(e)},FormControl.prototype._forEachChild=function(e){},FormControl.prototype._applyFormState=function(e){this._isBoxedValue(e)?(this._value=e.value,e.disabled?this.disable({onlySelf:!0,emitEvent:!1}):this.enable({onlySelf:!0,emitEvent:!1})):this._value=e},FormControl}(h),m=function(e){function FormGroup(t,r,n){void 0===r&&(r=null),void 0===n&&(n=null),e.call(this,r,n),this.controls=t,this._initObservables(),this._setUpControls(),this.updateValueAndValidity({onlySelf:!0,emitEvent:!1})}return u(FormGroup,e),FormGroup.prototype.registerControl=function(e,t){return this.controls[e]?this.controls[e]:(this.controls[e]=t,t.setParent(this),t._registerOnCollectionChange(this._onCollectionChange),t)},FormGroup.prototype.addControl=function(e,t){this.registerControl(e,t),this.updateValueAndValidity(),this._onCollectionChange()},FormGroup.prototype.removeControl=function(e){this.controls[e]&&this.controls[e]._registerOnCollectionChange(function(){}),delete this.controls[e],this.updateValueAndValidity(),this._onCollectionChange()},FormGroup.prototype.setControl=function(e,t){this.controls[e]&&this.controls[e]._registerOnCollectionChange(function(){}),delete this.controls[e],t&&this.registerControl(e,t),this.updateValueAndValidity(),this._onCollectionChange()},FormGroup.prototype.contains=function(e){return this.controls.hasOwnProperty(e)&&this.controls[e].enabled},FormGroup.prototype.setValue=function(e,t){var r=this,n=(void 0===t?{}:t).onlySelf;this._checkAllValuesPresent(e),Object.keys(e).forEach(function(t){r._throwIfControlMissing(t),r.controls[t].setValue(e[t],{onlySelf:!0})}),this.updateValueAndValidity({onlySelf:n})},FormGroup.prototype.patchValue=function(e,t){var r=this,n=(void 0===t?{}:t).onlySelf;Object.keys(e).forEach(function(t){r.controls[t]&&r.controls[t].patchValue(e[t],{onlySelf:!0})}),this.updateValueAndValidity({onlySelf:n})},FormGroup.prototype.reset=function(e,t){void 0===e&&(e={});var r=(void 0===t?{}:t).onlySelf;this._forEachChild(function(t,r){t.reset(e[r],{onlySelf:!0})}),this.updateValueAndValidity({onlySelf:r}),this._updatePristine({onlySelf:r}),this._updateTouched({onlySelf:r})},FormGroup.prototype.getRawValue=function(){return this._reduceChildren({},function(e,t,r){return e[r]=t.value,e})},FormGroup.prototype._throwIfControlMissing=function(e){if(!Object.keys(this.controls).length)throw new Error("\n There are no form controls registered with this group yet. If you're using ngModel,\n you may want to check next tick (e.g. use setTimeout).\n ");if(!this.controls[e])throw new Error("Cannot find form control with name: "+e+".")},FormGroup.prototype._forEachChild=function(e){var t=this;Object.keys(this.controls).forEach(function(r){return e(t.controls[r],r)})},FormGroup.prototype._setUpControls=function(){var e=this;this._forEachChild(function(t){t.setParent(e),t._registerOnCollectionChange(e._onCollectionChange)})},FormGroup.prototype._updateValue=function(){this._value=this._reduceValue()},FormGroup.prototype._anyControls=function(e){var t=this,r=!1;return this._forEachChild(function(n,i){r=r||t.contains(i)&&e(n)}),r},FormGroup.prototype._reduceValue=function(){var e=this;return this._reduceChildren({},function(t,r,n){return(r.enabled||e.disabled)&&(t[n]=r.value),t})},FormGroup.prototype._reduceChildren=function(e,t){var r=e;return this._forEachChild(function(e,n){r=t(r,e,n)}),r},FormGroup.prototype._allControlsDisabled=function(){for(var e=0,t=Object.keys(this.controls);e<t.length;e++){var r=t[e];if(this.controls[r].enabled)return!1}return Object.keys(this.controls).length>0||this.disabled},FormGroup.prototype._checkAllValuesPresent=function(e){this._forEachChild(function(t,r){if(void 0===e[r])throw new Error("Must supply a value for form control with name: '"+r+"'.")})},FormGroup}(h),v=function(e){function FormArray(t,r,n){void 0===r&&(r=null),void 0===n&&(n=null),e.call(this,r,n),this.controls=t,this._initObservables(),this._setUpControls(),this.updateValueAndValidity({onlySelf:!0,emitEvent:!1})}return u(FormArray,e),FormArray.prototype.at=function(e){return this.controls[e]},FormArray.prototype.push=function(e){this.controls.push(e),this._registerControl(e),this.updateValueAndValidity(),this._onCollectionChange()},FormArray.prototype.insert=function(e,t){this.controls.splice(e,0,t),this._registerControl(t),this.updateValueAndValidity(),this._onCollectionChange()},FormArray.prototype.removeAt=function(e){this.controls[e]&&this.controls[e]._registerOnCollectionChange(function(){}),this.controls.splice(e,1),this.updateValueAndValidity(),this._onCollectionChange()},FormArray.prototype.setControl=function(e,t){this.controls[e]&&this.controls[e]._registerOnCollectionChange(function(){}),this.controls.splice(e,1),t&&(this.controls.splice(e,0,t),this._registerControl(t)),this.updateValueAndValidity(),this._onCollectionChange()},Object.defineProperty(FormArray.prototype,"length",{get:function(){return this.controls.length},enumerable:!0,configurable:!0}),FormArray.prototype.setValue=function(e,t){var r=this,n=(void 0===t?{}:t).onlySelf;this._checkAllValuesPresent(e),e.forEach(function(e,t){r._throwIfControlMissing(t),r.at(t).setValue(e,{onlySelf:!0})}),this.updateValueAndValidity({onlySelf:n})},FormArray.prototype.patchValue=function(e,t){var r=this,n=(void 0===t?{}:t).onlySelf;e.forEach(function(e,t){r.at(t)&&r.at(t).patchValue(e,{onlySelf:!0})}),this.updateValueAndValidity({onlySelf:n})},FormArray.prototype.reset=function(e,t){void 0===e&&(e=[]);var r=(void 0===t?{}:t).onlySelf;this._forEachChild(function(t,r){t.reset(e[r],{onlySelf:!0})}),this.updateValueAndValidity({onlySelf:r}),this._updatePristine({onlySelf:r}),this._updateTouched({onlySelf:r})},FormArray.prototype.getRawValue=function(){return this.controls.map(function(e){return e.value})},FormArray.prototype._throwIfControlMissing=function(e){if(!this.controls.length)throw new Error("\n There are no form controls registered with this array yet. If you're using ngModel,\n you may want to check next tick (e.g. use setTimeout).\n ");if(!this.at(e))throw new Error("Cannot find form control at index "+e)},FormArray.prototype._forEachChild=function(e){this.controls.forEach(function(t,r){e(t,r)})},FormArray.prototype._updateValue=function(){var e=this;this._value=this.controls.filter(function(t){return t.enabled||e.disabled}).map(function(e){return e.value})},FormArray.prototype._anyControls=function(e){return this.controls.some(function(t){return t.enabled&&e(t)})},FormArray.prototype._setUpControls=function(){var e=this;this._forEachChild(function(t){return e._registerControl(t)})},FormArray.prototype._checkAllValuesPresent=function(e){this._forEachChild(function(t,r){if(void 0===e[r])throw new Error("Must supply a value for form control at index: "+r+".")})},FormArray.prototype._allControlsDisabled=function(){for(var e=0,t=this.controls;e<t.length;e++){var r=t[e];if(r.enabled)return!1}return this.controls.length>0||this.disabled},FormArray.prototype._registerControl=function(e){e.setParent(this),e._registerOnCollectionChange(this._onCollectionChange)},FormArray}(h)},function(e,t,r){"use strict";var n=r(0),i=r(44),o=r(55),a=r(99);r.d(t,"a",function(){return u}),r.d(t,"b",function(){return c});var s=this&&this.__extends||function(e,t){function __(){this.constructor=e}for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r]);e.prototype=null===t?Object.create(t):(__.prototype=t.prototype,new __)},u=function(){function ResponseOptions(e){var t=void 0===e?{}:e,n=t.body,o=t.status,a=t.headers,s=t.statusText,u=t.type,c=t.url;this.body=r.i(i.a)(n)?n:null,this.status=r.i(i.a)(o)?o:null,this.headers=r.i(i.a)(a)?a:null,this.statusText=r.i(i.a)(s)?s:null,this.type=r.i(i.a)(u)?u:null,this.url=r.i(i.a)(c)?c:null}return ResponseOptions.prototype.merge=function(e){return new ResponseOptions({body:r.i(i.a)(e)&&r.i(i.a)(e.body)?e.body:this.body,status:r.i(i.a)(e)&&r.i(i.a)(e.status)?e.status:this.status,headers:r.i(i.a)(e)&&r.i(i.a)(e.headers)?e.headers:this.headers,statusText:r.i(i.a)(e)&&r.i(i.a)(e.statusText)?e.statusText:this.statusText,type:r.i(i.a)(e)&&r.i(i.a)(e.type)?e.type:this.type,url:r.i(i.a)(e)&&r.i(i.a)(e.url)?e.url:this.url})},ResponseOptions}(),c=function(e){function BaseResponseOptions(){e.call(this,{status:200,statusText:"Ok",type:o.a.Default,headers:new a.a})}return s(BaseResponseOptions,e),BaseResponseOptions.decorators=[{type:n.Injectable}],BaseResponseOptions.ctorParameters=[],BaseResponseOptions}(u)},function(e,t,r){"use strict";function normalizeMethodName(e){if("string"!=typeof e)return e;switch(e.toUpperCase()){case"GET":return n.b.Get;case"POST":return n.b.Post;case"PUT":return n.b.Put;case"DELETE":return n.b.Delete;case"OPTIONS":return n.b.Options;case"HEAD":return n.b.Head;case"PATCH":return n.b.Patch}throw new Error('Invalid request method. The method "'+e+'" is not supported.')}function getResponseURL(e){return"responseURL"in e?e.responseURL:/^X-Request-URL:/m.test(e.getAllResponseHeaders())?e.getResponseHeader("X-Request-URL"):void 0}function stringToArrayBuffer(e){for(var t=new Uint16Array(e.length),r=0,n=e.length;r<n;r++)t[r]=e.charCodeAt(r);return t.buffer}var n=r(55),i=r(44);t.e=normalizeMethodName,r.d(t,"d",function(){return o}),t.c=getResponseURL,t.b=stringToArrayBuffer,r.d(t,"a",function(){return i.c});var o=function(e){return e>=200&&e<300}},function(e,t,r){"use strict";function paramParser(e){void 0===e&&(e="");var t=new Map;if(e.length>0){var r=e.split("&");r.forEach(function(e){var r=e.indexOf("="),n=r==-1?[e,""]:[e.slice(0,r),e.slice(r+1)],i=n[0],o=n[1],a=t.get(i)||[];a.push(o),t.set(i,a)})}return t}function standardEncoding(e){return encodeURIComponent(e).replace(/%40/gi,"@").replace(/%3A/gi,":").replace(/%24/gi,"$").replace(/%2C/gi,",").replace(/%3B/gi,";").replace(/%2B/gi,"+").replace(/%3D/gi,"=").replace(/%3F/gi,"?").replace(/%2F/gi,"/")}r.d(t,"b",function(){return n}),r.d(t,"a",function(){return i});var n=function(){function QueryEncoder(){}return QueryEncoder.prototype.encodeKey=function(e){return standardEncoding(e)},QueryEncoder.prototype.encodeValue=function(e){return standardEncoding(e)},QueryEncoder}(),i=function(){function URLSearchParams(e,t){void 0===e&&(e=""),void 0===t&&(t=new n),this.rawParams=e,this.queryEncoder=t,this.paramsMap=paramParser(e)}return URLSearchParams.prototype.clone=function(){var e=new URLSearchParams("",this.queryEncoder);return e.appendAll(this),e},URLSearchParams.prototype.has=function(e){return this.paramsMap.has(e)},URLSearchParams.prototype.get=function(e){var t=this.paramsMap.get(e);return Array.isArray(t)?t[0]:null},URLSearchParams.prototype.getAll=function(e){return this.paramsMap.get(e)||[]},URLSearchParams.prototype.set=function(e,t){if(void 0===t||null===t)return void this.delete(e);var r=this.paramsMap.get(e)||[];r.length=0,r.push(t),this.paramsMap.set(e,r)},URLSearchParams.prototype.setAll=function(e){var t=this;e.paramsMap.forEach(function(e,r){var n=t.paramsMap.get(r)||[];n.length=0,n.push(e[0]),t.paramsMap.set(r,n)})},URLSearchParams.prototype.append=function(e,t){if(void 0!==t&&null!==t){var r=this.paramsMap.get(e)||[];r.push(t),this.paramsMap.set(e,r)}},URLSearchParams.prototype.appendAll=function(e){var t=this;e.paramsMap.forEach(function(e,r){for(var n=t.paramsMap.get(r)||[],i=0;i<e.length;++i)n.push(e[i]);t.paramsMap.set(r,n)})},URLSearchParams.prototype.replaceAll=function(e){var t=this;e.paramsMap.forEach(function(e,r){var n=t.paramsMap.get(r)||[];n.length=0;for(var i=0;i<e.length;++i)n.push(e[i]);t.paramsMap.set(r,n)})},URLSearchParams.prototype.toString=function(){var e=this,t=[];return this.paramsMap.forEach(function(r,n){r.forEach(function(r){return t.push(e.queryEncoder.encodeKey(n)+"="+e.queryEncoder.encodeValue(r))})}),t.join("&")},URLSearchParams.prototype.delete=function(e){this.paramsMap.delete(e)},URLSearchParams}()},function(e,t,r){"use strict";var n=r(0);r.d(t,"a",function(){return i});var i=new n.OpaqueToken("DocumentToken")},function(e,t,r){"use strict";r.d(t,"a",function(){return n});var n=function(){function RouterOutletMap(){this._outlets={}}return RouterOutletMap.prototype.registerOutlet=function(e,t){this._outlets[e]=t},RouterOutletMap.prototype.removeOutlet=function(e){this._outlets[e]=void 0},RouterOutletMap}()},,,,,,,,,,,function(e,t,r){"use strict";var n=r(381);t.fromPromise=n.PromiseObservable.create},function(e,t,r){"use strict";function mergeAll(e){return void 0===e&&(e=Number.POSITIVE_INFINITY),this.lift(new a(e))}var n=this&&this.__extends||function(e,t){function __(){this.constructor=e}for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r]);e.prototype=null===t?Object.create(t):(__.prototype=t.prototype,new __)},i=r(238),o=r(248);t.mergeAll=mergeAll;var a=function(){function MergeAllOperator(e){this.concurrent=e}return MergeAllOperator.prototype.call=function(e,t){return t._subscribe(new s(e,this.concurrent))},MergeAllOperator}();t.MergeAllOperator=a;var s=function(e){function MergeAllSubscriber(t,r){e.call(this,t),this.concurrent=r,this.hasCompleted=!1,this.buffer=[],this.active=0}return n(MergeAllSubscriber,e),MergeAllSubscriber.prototype._next=function(e){this.active<this.concurrent?(this.active++,this.add(o.subscribeToResult(this,e))):this.buffer.push(e)},MergeAllSubscriber.prototype._complete=function(){this.hasCompleted=!0,0===this.active&&0===this.buffer.length&&this.destination.complete()},MergeAllSubscriber.prototype.notifyComplete=function(e){var t=this.buffer;this.remove(e),this.active--,t.length>0?this._next(t.shift()):0===this.active&&this.hasCompleted&&this.destination.complete()},MergeAllSubscriber}(i.OuterSubscriber);t.MergeAllSubscriber=s},function(e,t,r){"use strict";var n=r(491);r.d(t,"RESOURCE_CACHE_PROVIDER",function(){return n.a}),r.d(t,"platformBrowserDynamic",function(){return n.b}),r.d(t,"__platform_browser_dynamic_private__",function(){return n.c})},function(e,t,r){"use strict";function _stripBaseHref(e,t){return e.length>0&&t.startsWith(e)?t.substring(e.length):t}function _stripIndexHtml(e){return/\/index.html$/g.test(e)?e.substring(0,e.length-11):e}var n=r(0),i=r(116);r.d(t,"a",function(){return o});var o=function(){function Location(e){var t=this;this._subject=new n.EventEmitter,this._platformStrategy=e;var r=this._platformStrategy.getBaseHref();this._baseHref=Location.stripTrailingSlash(_stripIndexHtml(r)),this._platformStrategy.onPopState(function(e){t._subject.emit({url:t.path(!0),pop:!0,type:e.type})})}return Location.prototype.path=function(e){return void 0===e&&(e=!1),this.normalize(this._platformStrategy.path(e))},Location.prototype.isCurrentPathEqualTo=function(e,t){return void 0===t&&(t=""),this.path()==this.normalize(e+Location.normalizeQueryParams(t))},Location.prototype.normalize=function(e){return Location.stripTrailingSlash(_stripBaseHref(this._baseHref,_stripIndexHtml(e)))},Location.prototype.prepareExternalUrl=function(e){return e.length>0&&!e.startsWith("/")&&(e="/"+e),this._platformStrategy.prepareExternalUrl(e)},Location.prototype.go=function(e,t){void 0===t&&(t=""),this._platformStrategy.pushState(null,"",e,t)},Location.prototype.replaceState=function(e,t){void 0===t&&(t=""),this._platformStrategy.replaceState(null,"",e,t)},Location.prototype.forward=function(){this._platformStrategy.forward()},Location.prototype.back=function(){this._platformStrategy.back()},Location.prototype.subscribe=function(e,t,r){return void 0===t&&(t=null),void 0===r&&(r=null),this._subject.subscribe({next:e,error:t,complete:r})},Location.normalizeQueryParams=function(e){return e.length>0&&"?"!=e.substring(0,1)?"?"+e:e},Location.joinWithSlash=function(e,t){if(0==e.length)return t;if(0==t.length)return e;var r=0;return e.endsWith("/")&&r++,t.startsWith("/")&&r++,2==r?e+t.substring(1):1==r?e+t:e+"/"+t},Location.stripTrailingSlash=function(e){return/\/$/g.test(e)&&(e=e.substring(0,e.length-1)),e},Location.decorators=[{type:n.Injectable}],Location.ctorParameters=[{type:i.a}],Location}()},function(e,t,r){"use strict";r.d(t,"a",function(){return n});var n=function(){function PlatformLocation(){}return Object.defineProperty(PlatformLocation.prototype,"pathname",{get:function(){return null},enumerable:!0,configurable:!0}),Object.defineProperty(PlatformLocation.prototype,"search",{get:function(){return null},enumerable:!0,configurable:!0}),Object.defineProperty(PlatformLocation.prototype,"hash",{get:function(){return null},enumerable:!0,configurable:!0}),PlatformLocation}()},function(e,t,r){"use strict";function isWhitespace(e){return e>=i&&e<=c||e==re}function isDigit(e){return M<=e&&e<=N}function isAsciiLetter(e){return e>=H&&e<=$||e>=I&&e<=L}function isAsciiHexDigit(e){return e>=H&&e<=z||e>=I&&e<=k||isDigit(e)}r.d(t,"a",function(){return n}),r.d(t,"Y",function(){return i}),r.d(t,"S",function(){return o}),r.d(t,"_0",function(){return a}),r.d(t,"U",function(){return s}),r.d(t,"W",function(){return u}),r.d(t,"b",function(){return c}),r.d(t,"A",function(){return l}),r.d(t,"o",function(){return p}),r.d(t,"p",function(){ return f}),r.d(t,"M",function(){return h}),r.d(t,"u",function(){return d}),r.d(t,"B",function(){return m}),r.d(t,"n",function(){return v}),r.d(t,"e",function(){return y}),r.d(t,"f",function(){return g}),r.d(t,"s",function(){return _}),r.d(t,"q",function(){return b}),r.d(t,"k",function(){return w}),r.d(t,"r",function(){return C}),r.d(t,"d",function(){return E}),r.d(t,"t",function(){return S}),r.d(t,"l",function(){return A}),r.d(t,"m",function(){return P}),r.d(t,"x",function(){return x}),r.d(t,"z",function(){return T}),r.d(t,"y",function(){return O}),r.d(t,"w",function(){return R}),r.d(t,"_3",function(){return M}),r.d(t,"_4",function(){return N}),r.d(t,"J",function(){return I}),r.d(t,"P",function(){return D}),r.d(t,"_2",function(){return V}),r.d(t,"K",function(){return L}),r.d(t,"i",function(){return j}),r.d(t,"F",function(){return F}),r.d(t,"j",function(){return B}),r.d(t,"v",function(){return U}),r.d(t,"L",function(){return W}),r.d(t,"H",function(){return H}),r.d(t,"O",function(){return G}),r.d(t,"T",function(){return z}),r.d(t,"R",function(){return q}),r.d(t,"V",function(){return K}),r.d(t,"X",function(){return Q}),r.d(t,"G",function(){return J}),r.d(t,"Z",function(){return X}),r.d(t,"_1",function(){return Z}),r.d(t,"I",function(){return $}),r.d(t,"g",function(){return Y}),r.d(t,"C",function(){return ee}),r.d(t,"h",function(){return te}),r.d(t,"D",function(){return re}),r.d(t,"Q",function(){return ne}),t.E=isWhitespace,t.c=isDigit,t.N=isAsciiLetter,t._5=isAsciiHexDigit;var n=0,i=9,o=10,a=11,s=12,u=13,c=32,l=33,p=34,f=35,h=36,d=37,m=38,v=39,y=40,g=41,_=42,b=43,w=44,C=45,E=46,S=47,A=58,P=59,x=60,T=61,O=62,R=63,M=48,N=57,I=65,D=69,k=70,V=88,L=90,j=91,F=92,B=93,U=94,W=95,H=97,G=101,z=102,q=110,K=114,Q=116,J=117,X=118,Z=120,$=122,Y=123,ee=124,te=125,re=160,ne=96},function(e,t,r){"use strict";function _cloneDirectiveWithTemplate(e,t){return new i.q({type:e.type,isComponent:e.isComponent,selector:e.selector,exportAs:e.exportAs,changeDetection:e.changeDetection,inputs:e.inputs,outputs:e.outputs,hostListeners:e.hostListeners,hostProperties:e.hostProperties,hostAttributes:e.hostAttributes,providers:e.providers,viewProviders:e.viewProviders,queries:e.queries,viewQueries:e.viewQueries,entryComponents:e.entryComponents,template:t})}var n=r(0),i=r(17),o=r(74),a=r(18),s=r(2),u=r(52),c=r(121),l=r(41),p=r(173),f=r(277),h=r(278),d=r(91),m=r(23);r.d(t,"a",function(){return v});var v=function(){function DirectiveNormalizer(e,t,r,n){this._resourceLoader=e,this._urlResolver=t,this._htmlParser=r,this._config=n,this._resourceLoaderCache=new Map}return DirectiveNormalizer.prototype.clearCache=function(){this._resourceLoaderCache.clear()},DirectiveNormalizer.prototype.clearCacheFor=function(e){var t=this;e.isComponent&&(this._resourceLoaderCache.delete(e.template.templateUrl),e.template.externalStylesheets.forEach(function(e){t._resourceLoaderCache.delete(e.moduleUrl)}))},DirectiveNormalizer.prototype._fetch=function(e){var t=this._resourceLoaderCache.get(e);return t||(t=this._resourceLoader.get(e),this._resourceLoaderCache.set(e,t)),t},DirectiveNormalizer.prototype.normalizeDirective=function(e){var t=this;if(!e.isComponent)return new m.g(e,Promise.resolve(e));var n,i=null;if(r.i(s.a)(e.template.template))i=this.normalizeTemplateSync(e.type,e.template),n=Promise.resolve(i);else{if(!e.template.templateUrl)throw new Error("No template specified for component "+e.type.name);n=this.normalizeTemplateAsync(e.type,e.template)}if(i&&0===i.styleUrls.length){var o=_cloneDirectiveWithTemplate(e,i);return new m.g(o,Promise.resolve(o))}return new m.g(null,n.then(function(e){return t.normalizeExternalStylesheets(e)}).then(function(t){return _cloneDirectiveWithTemplate(e,t)}))},DirectiveNormalizer.prototype.normalizeTemplateSync=function(e,t){return this.normalizeLoadedTemplate(e,t,t.template,e.moduleUrl)},DirectiveNormalizer.prototype.normalizeTemplateAsync=function(e,t){var r=this,n=this._urlResolver.resolve(e.moduleUrl,t.templateUrl);return this._fetch(n).then(function(i){return r.normalizeLoadedTemplate(e,t,i,n)})},DirectiveNormalizer.prototype.normalizeLoadedTemplate=function(e,t,o,a){var c=l.b.fromArray(t.interpolation),p=this._htmlParser.parse(o,e.name,!1,c);if(p.errors.length>0){var f=p.errors.join("\n");throw new Error("Template parse errors:\n"+f)}var h=this.normalizeStylesheet(new i.o({styles:t.styles,styleUrls:t.styleUrls,moduleUrl:e.moduleUrl})),d=new y;u.g(d,p.rootNodes);var m=this.normalizeStylesheet(new i.o({styles:d.styles,styleUrls:d.styleUrls,moduleUrl:a})),v=t.encapsulation;r.i(s.b)(v)&&(v=this._config.defaultEncapsulation);var g=h.styles.concat(m.styles),_=h.styleUrls.concat(m.styleUrls);return v===n.ViewEncapsulation.Emulated&&0===g.length&&0===_.length&&(v=n.ViewEncapsulation.None),new i.p({encapsulation:v,template:o,templateUrl:a,styles:g,styleUrls:_,externalStylesheets:t.externalStylesheets,ngContentSelectors:d.ngContentSelectors,animations:t.animations,interpolation:t.interpolation})},DirectiveNormalizer.prototype.normalizeExternalStylesheets=function(e){return this._loadMissingExternalStylesheets(e.styleUrls).then(function(t){return new i.p({encapsulation:e.encapsulation,template:e.template,templateUrl:e.templateUrl,styles:e.styles,styleUrls:e.styleUrls,externalStylesheets:t,ngContentSelectors:e.ngContentSelectors,animations:e.animations,interpolation:e.interpolation})})},DirectiveNormalizer.prototype._loadMissingExternalStylesheets=function(e,t){var r=this;return void 0===t&&(t=new Map),Promise.all(e.filter(function(e){return!t.has(e)}).map(function(e){return r._fetch(e).then(function(n){var o=r.normalizeStylesheet(new i.o({styles:[n],moduleUrl:e}));return t.set(e,o),r._loadMissingExternalStylesheets(o.styleUrls,t)})})).then(function(e){return a.b.values(t)})},DirectiveNormalizer.prototype.normalizeStylesheet=function(e){var t=this,n=e.styleUrls.filter(f.a).map(function(r){return t._urlResolver.resolve(e.moduleUrl,r)}),o=e.styles.map(function(i){var o=r.i(f.b)(t._urlResolver,e.moduleUrl,i);return n.push.apply(n,o.styleUrls),o.style});return new i.o({styles:o,styleUrls:n,moduleUrl:e.moduleUrl})},DirectiveNormalizer.decorators=[{type:n.Injectable}],DirectiveNormalizer.ctorParameters=[{type:p.a},{type:d.a},{type:c.b},{type:o.a}],DirectiveNormalizer}(),y=function(){function TemplatePreparseVisitor(){this.ngContentSelectors=[],this.styles=[],this.styleUrls=[],this.ngNonBindableStackCount=0}return TemplatePreparseVisitor.prototype.visitElement=function(e,t){var n=r.i(h.a)(e);switch(n.type){case h.b.NG_CONTENT:0===this.ngNonBindableStackCount&&this.ngContentSelectors.push(n.selectAttr);break;case h.b.STYLE:var i="";e.children.forEach(function(e){e instanceof u.d&&(i+=e.value)}),this.styles.push(i);break;case h.b.STYLESHEET:this.styleUrls.push(n.hrefAttr)}return n.nonBindable&&this.ngNonBindableStackCount++,u.g(this,e.children),n.nonBindable&&this.ngNonBindableStackCount--,null},TemplatePreparseVisitor.prototype.visitComment=function(e,t){return null},TemplatePreparseVisitor.prototype.visitAttribute=function(e,t){return null},TemplatePreparseVisitor.prototype.visitText=function(e,t){return null},TemplatePreparseVisitor.prototype.visitExpansion=function(e,t){return null},TemplatePreparseVisitor.prototype.visitExpansionCase=function(e,t){return null},TemplatePreparseVisitor}()},function(e,t,r){"use strict";function isDirectiveMetadata(e){return e instanceof n.Directive}var n=r(0),i=r(18),o=r(2),a=r(14),s=r(23);r.d(t,"a",function(){return u});var u=function(){function DirectiveResolver(e){void 0===e&&(e=a.A),this._reflector=e}return DirectiveResolver.prototype.resolve=function(e,t){void 0===t&&(t=!0);var i=this._reflector.annotations(r.i(n.resolveForwardRef)(e));if(i){var a=i.find(isDirectiveMetadata);if(a){var s=this._reflector.propMetadata(e);return this._mergeWithPropertyMetadata(a,s,e)}}if(t)throw new Error("No Directive annotation found on "+r.i(o.k)(e));return null},DirectiveResolver.prototype._mergeWithPropertyMetadata=function(e,t,r){var i=[],o=[],a={},s={};return Object.keys(t).forEach(function(e){t[e].forEach(function(t){if(t instanceof n.Input)t.bindingPropertyName?i.push(e+": "+t.bindingPropertyName):i.push(e);else if(t instanceof n.Output){var r=t;r.bindingPropertyName?o.push(e+": "+r.bindingPropertyName):o.push(e)}else if(t instanceof n.HostBinding){var u=t;if(u.hostPropertyName){var c=u.hostPropertyName[0];if("("===c)throw new Error("@HostBinding can not bind to events. Use @HostListener instead.");if("["===c)throw new Error("@HostBinding parameter should be a property name, 'class.<name>', or 'attr.<name>'.");a["["+u.hostPropertyName+"]"]=e}else a["["+e+"]"]=e}else if(t instanceof n.HostListener){var l=t,p=l.args||[];a["("+l.eventName+")"]=e+"("+p.join(",")+")"}else t instanceof n.Query&&(s[e]=t)})}),this._merge(e,i,o,a,s,r)},DirectiveResolver.prototype._extractPublicName=function(e){return r.i(s.b)(e,[null,e])[1].trim()},DirectiveResolver.prototype._merge=function(e,t,a,s,u,c){var l=this,p=t;if(e.inputs){var f=e.inputs.map(function(e){return l._extractPublicName(e)});t.forEach(function(e){var t=l._extractPublicName(e);if(f.indexOf(t)>-1)throw new Error("Input '"+t+"' defined multiple times in '"+r.i(o.k)(c)+"'")}),p.unshift.apply(p,e.inputs)}var h=a;if(e.outputs){var d=e.outputs.map(function(e){return l._extractPublicName(e)});a.forEach(function(e){var t=l._extractPublicName(e);if(d.indexOf(t)>-1)throw new Error("Output event '"+t+"' defined multiple times in '"+r.i(o.k)(c)+"'")}),h.unshift.apply(h,e.outputs)}var m=e.host?i.c.merge(e.host,s):s,v=e.queries?i.c.merge(e.queries,u):u;return e instanceof n.Component?new n.Component({selector:e.selector,inputs:p,outputs:h,host:m,exportAs:e.exportAs,moduleId:e.moduleId,queries:v,changeDetection:e.changeDetection,providers:e.providers,viewProviders:e.viewProviders,entryComponents:e.entryComponents,template:e.template,templateUrl:e.templateUrl,styles:e.styles,styleUrls:e.styleUrls,encapsulation:e.encapsulation,animations:e.animations,interpolation:e.interpolation}):new n.Directive({selector:e.selector,inputs:p,outputs:h,host:m,exportAs:e.exportAs,queries:v,providers:e.providers})},DirectiveResolver.decorators=[{type:n.Injectable}],DirectiveResolver.ctorParameters=[{type:a.I}],DirectiveResolver}()},function(e,t,r){"use strict";var n=r(2);r.d(t,"b",function(){return o}),r.d(t,"d",function(){return a}),r.d(t,"c",function(){return u}),r.d(t,"g",function(){return c}),r.d(t,"p",function(){return l}),r.d(t,"h",function(){return p}),r.d(t,"j",function(){return f}),r.d(t,"w",function(){return h}),r.d(t,"v",function(){return d}),r.d(t,"u",function(){return m}),r.d(t,"n",function(){return v}),r.d(t,"m",function(){return y}),r.d(t,"i",function(){return g}),r.d(t,"f",function(){return _}),r.d(t,"q",function(){return b}),r.d(t,"r",function(){return w}),r.d(t,"e",function(){return C}),r.d(t,"k",function(){return E}),r.d(t,"l",function(){return S}),r.d(t,"t",function(){return A}),r.d(t,"s",function(){return P}),r.d(t,"o",function(){return x}),r.d(t,"a",function(){return T}),r.d(t,"x",function(){return O}),r.d(t,"y",function(){return R});var i=this&&this.__extends||function(e,t){function __(){this.constructor=e}for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r]);e.prototype=null===t?Object.create(t):(__.prototype=t.prototype,new __)},o=function(){function ParserError(e,t,r,n){this.input=t,this.errLocation=r,this.ctxLocation=n,this.message="Parser Error: "+e+" "+r+" ["+t+"] in "+n}return ParserError}(),a=function(){function ParseSpan(e,t){this.start=e,this.end=t}return ParseSpan}(),s=function(){function AST(e){this.span=e}return AST.prototype.visit=function(e,t){return void 0===t&&(t=null),null},AST.prototype.toString=function(){return"AST"},AST}(),u=function(e){function Quote(t,r,n,i){e.call(this,t),this.prefix=r,this.uninterpretedExpression=n,this.location=i}return i(Quote,e),Quote.prototype.visit=function(e,t){return void 0===t&&(t=null),e.visitQuote(this,t)},Quote.prototype.toString=function(){return"Quote"},Quote}(s),c=function(e){function EmptyExpr(){e.apply(this,arguments)}return i(EmptyExpr,e),EmptyExpr.prototype.visit=function(e,t){void 0===t&&(t=null)},EmptyExpr}(s),l=function(e){function ImplicitReceiver(){e.apply(this,arguments)}return i(ImplicitReceiver,e),ImplicitReceiver.prototype.visit=function(e,t){return void 0===t&&(t=null),e.visitImplicitReceiver(this,t)},ImplicitReceiver}(s),p=function(e){function Chain(t,r){e.call(this,t),this.expressions=r}return i(Chain,e),Chain.prototype.visit=function(e,t){return void 0===t&&(t=null),e.visitChain(this,t)},Chain}(s),f=function(e){function Conditional(t,r,n,i){e.call(this,t),this.condition=r,this.trueExp=n,this.falseExp=i}return i(Conditional,e),Conditional.prototype.visit=function(e,t){return void 0===t&&(t=null),e.visitConditional(this,t)},Conditional}(s),h=function(e){function PropertyRead(t,r,n){e.call(this,t),this.receiver=r,this.name=n}return i(PropertyRead,e),PropertyRead.prototype.visit=function(e,t){return void 0===t&&(t=null),e.visitPropertyRead(this,t)},PropertyRead}(s),d=function(e){function PropertyWrite(t,r,n,i){e.call(this,t),this.receiver=r,this.name=n,this.value=i}return i(PropertyWrite,e),PropertyWrite.prototype.visit=function(e,t){return void 0===t&&(t=null),e.visitPropertyWrite(this,t)},PropertyWrite}(s),m=function(e){function SafePropertyRead(t,r,n){e.call(this,t),this.receiver=r,this.name=n}return i(SafePropertyRead,e),SafePropertyRead.prototype.visit=function(e,t){return void 0===t&&(t=null),e.visitSafePropertyRead(this,t)},SafePropertyRead}(s),v=function(e){function KeyedRead(t,r,n){e.call(this,t),this.obj=r,this.key=n}return i(KeyedRead,e),KeyedRead.prototype.visit=function(e,t){return void 0===t&&(t=null),e.visitKeyedRead(this,t)},KeyedRead}(s),y=function(e){function KeyedWrite(t,r,n,i){e.call(this,t),this.obj=r,this.key=n,this.value=i}return i(KeyedWrite,e),KeyedWrite.prototype.visit=function(e,t){return void 0===t&&(t=null),e.visitKeyedWrite(this,t)},KeyedWrite}(s),g=function(e){function BindingPipe(t,r,n,i){e.call(this,t),this.exp=r,this.name=n,this.args=i}return i(BindingPipe,e),BindingPipe.prototype.visit=function(e,t){return void 0===t&&(t=null),e.visitPipe(this,t)},BindingPipe}(s),_=function(e){function LiteralPrimitive(t,r){e.call(this,t),this.value=r}return i(LiteralPrimitive,e),LiteralPrimitive.prototype.visit=function(e,t){return void 0===t&&(t=null),e.visitLiteralPrimitive(this,t)},LiteralPrimitive}(s),b=function(e){function LiteralArray(t,r){e.call(this,t),this.expressions=r}return i(LiteralArray,e),LiteralArray.prototype.visit=function(e,t){return void 0===t&&(t=null),e.visitLiteralArray(this,t)},LiteralArray}(s),w=function(e){function LiteralMap(t,r,n){e.call(this,t),this.keys=r,this.values=n}return i(LiteralMap,e),LiteralMap.prototype.visit=function(e,t){return void 0===t&&(t=null),e.visitLiteralMap(this,t)},LiteralMap}(s),C=function(e){function Interpolation(t,r,n){e.call(this,t),this.strings=r,this.expressions=n}return i(Interpolation,e),Interpolation.prototype.visit=function(e,t){return void 0===t&&(t=null),e.visitInterpolation(this,t)},Interpolation}(s),E=function(e){function Binary(t,r,n,i){e.call(this,t),this.operation=r,this.left=n,this.right=i}return i(Binary,e),Binary.prototype.visit=function(e,t){return void 0===t&&(t=null),e.visitBinary(this,t)},Binary}(s),S=function(e){function PrefixNot(t,r){e.call(this,t),this.expression=r}return i(PrefixNot,e),PrefixNot.prototype.visit=function(e,t){return void 0===t&&(t=null),e.visitPrefixNot(this,t)},PrefixNot}(s),A=function(e){function MethodCall(t,r,n,i){e.call(this,t),this.receiver=r,this.name=n,this.args=i}return i(MethodCall,e),MethodCall.prototype.visit=function(e,t){return void 0===t&&(t=null),e.visitMethodCall(this,t)},MethodCall}(s),P=function(e){function SafeMethodCall(t,r,n,i){e.call(this,t),this.receiver=r,this.name=n,this.args=i}return i(SafeMethodCall,e),SafeMethodCall.prototype.visit=function(e,t){return void 0===t&&(t=null),e.visitSafeMethodCall(this,t)},SafeMethodCall}(s),x=function(e){function FunctionCall(t,r,n){e.call(this,t),this.target=r,this.args=n}return i(FunctionCall,e),FunctionCall.prototype.visit=function(e,t){return void 0===t&&(t=null),e.visitFunctionCall(this,t)},FunctionCall}(s),T=function(e){function ASTWithSource(t,i,o,s){e.call(this,new a(0,r.i(n.b)(i)?0:i.length)),this.ast=t,this.source=i,this.location=o,this.errors=s}return i(ASTWithSource,e),ASTWithSource.prototype.visit=function(e,t){return void 0===t&&(t=null),this.ast.visit(e,t)},ASTWithSource.prototype.toString=function(){return this.source+" in "+this.location},ASTWithSource}(s),O=function(){function TemplateBinding(e,t,r,n){this.key=e,this.keyIsVar=t,this.name=r,this.expression=n}return TemplateBinding}(),R=function(){function RecursiveAstVisitor(){}return RecursiveAstVisitor.prototype.visitBinary=function(e,t){return e.left.visit(this),e.right.visit(this),null},RecursiveAstVisitor.prototype.visitChain=function(e,t){return this.visitAll(e.expressions,t)},RecursiveAstVisitor.prototype.visitConditional=function(e,t){return e.condition.visit(this),e.trueExp.visit(this),e.falseExp.visit(this),null},RecursiveAstVisitor.prototype.visitPipe=function(e,t){return e.exp.visit(this),this.visitAll(e.args,t),null},RecursiveAstVisitor.prototype.visitFunctionCall=function(e,t){return e.target.visit(this),this.visitAll(e.args,t),null},RecursiveAstVisitor.prototype.visitImplicitReceiver=function(e,t){return null},RecursiveAstVisitor.prototype.visitInterpolation=function(e,t){return this.visitAll(e.expressions,t)},RecursiveAstVisitor.prototype.visitKeyedRead=function(e,t){return e.obj.visit(this),e.key.visit(this),null},RecursiveAstVisitor.prototype.visitKeyedWrite=function(e,t){return e.obj.visit(this),e.key.visit(this),e.value.visit(this),null},RecursiveAstVisitor.prototype.visitLiteralArray=function(e,t){return this.visitAll(e.expressions,t)},RecursiveAstVisitor.prototype.visitLiteralMap=function(e,t){return this.visitAll(e.values,t)},RecursiveAstVisitor.prototype.visitLiteralPrimitive=function(e,t){return null},RecursiveAstVisitor.prototype.visitMethodCall=function(e,t){return e.receiver.visit(this),this.visitAll(e.args,t)},RecursiveAstVisitor.prototype.visitPrefixNot=function(e,t){return e.expression.visit(this),null},RecursiveAstVisitor.prototype.visitPropertyRead=function(e,t){return e.receiver.visit(this),null},RecursiveAstVisitor.prototype.visitPropertyWrite=function(e,t){return e.receiver.visit(this),e.value.visit(this),null},RecursiveAstVisitor.prototype.visitSafePropertyRead=function(e,t){return e.receiver.visit(this),null},RecursiveAstVisitor.prototype.visitSafeMethodCall=function(e,t){return e.receiver.visit(this),this.visitAll(e.args,t)},RecursiveAstVisitor.prototype.visitAll=function(e,t){var r=this;return e.forEach(function(e){return e.visit(r,t)}),null},RecursiveAstVisitor.prototype.visitQuote=function(e,t){return null},RecursiveAstVisitor}();(function(){function AstTransformer(){}return AstTransformer.prototype.visitImplicitReceiver=function(e,t){return e},AstTransformer.prototype.visitInterpolation=function(e,t){return new C(e.span,e.strings,this.visitAll(e.expressions))},AstTransformer.prototype.visitLiteralPrimitive=function(e,t){return new _(e.span,e.value)},AstTransformer.prototype.visitPropertyRead=function(e,t){return new h(e.span,e.receiver.visit(this),e.name)},AstTransformer.prototype.visitPropertyWrite=function(e,t){return new d(e.span,e.receiver.visit(this),e.name,e.value)},AstTransformer.prototype.visitSafePropertyRead=function(e,t){return new m(e.span,e.receiver.visit(this),e.name)},AstTransformer.prototype.visitMethodCall=function(e,t){return new A(e.span,e.receiver.visit(this),e.name,this.visitAll(e.args))},AstTransformer.prototype.visitSafeMethodCall=function(e,t){return new P(e.span,e.receiver.visit(this),e.name,this.visitAll(e.args))},AstTransformer.prototype.visitFunctionCall=function(e,t){return new x(e.span,e.target.visit(this),this.visitAll(e.args))},AstTransformer.prototype.visitLiteralArray=function(e,t){return new b(e.span,this.visitAll(e.expressions))},AstTransformer.prototype.visitLiteralMap=function(e,t){return new w(e.span,e.keys,this.visitAll(e.values))},AstTransformer.prototype.visitBinary=function(e,t){return new E(e.span,e.operation,e.left.visit(this),e.right.visit(this))},AstTransformer.prototype.visitPrefixNot=function(e,t){return new S(e.span,e.expression.visit(this))},AstTransformer.prototype.visitConditional=function(e,t){return new f(e.span,e.condition.visit(this),e.trueExp.visit(this),e.falseExp.visit(this))},AstTransformer.prototype.visitPipe=function(e,t){return new g(e.span,e.exp.visit(this),e.name,this.visitAll(e.args))},AstTransformer.prototype.visitKeyedRead=function(e,t){return new v(e.span,e.obj.visit(this),e.key.visit(this))},AstTransformer.prototype.visitKeyedWrite=function(e,t){return new y(e.span,e.obj.visit(this),e.key.visit(this),e.value.visit(this))},AstTransformer.prototype.visitAll=function(e){for(var t=new Array(e.length),r=0;r<e.length;++r)t[r]=e[r].visit(this);return t},AstTransformer.prototype.visitChain=function(e,t){return new p(e.span,this.visitAll(e.expressions))},AstTransformer.prototype.visitQuote=function(e,t){return new u(e.span,e.prefix,e.uninterpretedExpression,e.location)},AstTransformer})()},function(e,t,r){"use strict";function digestMessage(e){return sha1(serializeNodes(e.nodes).join("")+("["+e.meaning+"]"))}function serializeNodes(e){return e.map(function(e){return e.visit(i,null)})}function sha1(e){var t=utf8Encode(e),r=stringToWords32(t),n=8*t.length,i=new Array(80),o=[1732584193,4023233417,2562383102,271733878,3285377520],a=o[0],s=o[1],u=o[2],c=o[3],l=o[4];r[n>>5]|=128<<24-n%32,r[(n+64>>9<<4)+15]=n;for(var p=0;p<r.length;p+=16){for(var f=[a,s,u,c,l],h=f[0],d=f[1],m=f[2],v=f[3],y=f[4],g=0;g<80;g++){g<16?i[g]=r[p+g]:i[g]=rol32(i[g-3]^i[g-8]^i[g-14]^i[g-16],1);var _=fk(g,s,u,c),b=_[0],w=_[1],C=[rol32(a,5),b,l,w,i[g]].reduce(add32);P=[c,u,rol32(s,30),a,C],l=P[0],c=P[1],u=P[2],s=P[3],a=P[4]}x=[add32(a,h),add32(s,d),add32(u,m),add32(c,v),add32(l,y)],a=x[0],s=x[1],u=x[2],c=x[3],l=x[4]}for(var E=words32ToString([a,s,u,c,l]),S="",p=0;p<E.length;p++){var A=E.charCodeAt(p);S+=(A>>>4&15).toString(16)+(15&A).toString(16)}return S.toLowerCase();var P,x}function utf8Encode(e){for(var t="",r=0;r<e.length;r++){var n=decodeSurrogatePairs(e,r);n<=127?t+=String.fromCharCode(n):n<=2047?t+=String.fromCharCode(192|n>>>6,128|63&n):n<=65535?t+=String.fromCharCode(224|n>>>12,128|n>>>6&63,128|63&n):n<=2097151&&(t+=String.fromCharCode(240|n>>>18,128|n>>>12&63,128|n>>>6&63,128|63&n))}return t}function decodeSurrogatePairs(e,t){if(t<0||t>=e.length)throw new Error("index="+t+' is out of range in "'+e+'"');var r,n=e.charCodeAt(t);return n>=55296&&n<=57343&&e.length>t+1&&(r=e.charCodeAt(t+1),r>=56320&&r<=57343)?1024*(n-55296)+r-56320+65536:n}function stringToWords32(e){for(var t=Array(e.length>>>2),r=0;r<t.length;r++)t[r]=0;for(var r=0;r<e.length;r++)t[r>>>2]|=(255&e.charCodeAt(r))<<8*(3-r&3);return t}function words32ToString(e){for(var t="",r=0;r<4*e.length;r++)t+=String.fromCharCode(e[r>>>2]>>>8*(3-r&3)&255);return t}function fk(e,t,r,n){return e<20?[t&r|~t&n,1518500249]:e<40?[t^r^n,1859775393]:e<60?[t&r|t&n|r&n,2400959708]:[t^r^n,3395469782]}function add32(e,t){var r=(65535&e)+(65535&t),n=(e>>16)+(t>>16)+(r>>16);return n<<16|65535&r}function rol32(e,t){return e<<t|e>>>32-t}t.a=digestMessage;var n=function(){function _SerializerVisitor(){}return _SerializerVisitor.prototype.visitText=function(e,t){return e.value},_SerializerVisitor.prototype.visitContainer=function(e,t){var r=this;return"["+e.children.map(function(e){return e.visit(r)}).join(", ")+"]"},_SerializerVisitor.prototype.visitIcu=function(e,t){var r=this,n=Object.keys(e.cases).map(function(t){return t+" {"+e.cases[t].visit(r)+"}"});return"{"+e.expression+", "+e.type+", "+n.join(", ")+"}"},_SerializerVisitor.prototype.visitTagPlaceholder=function(e,t){var r=this;return e.isVoid?'<ph tag name="'+e.startName+'"/>':'<ph tag name="'+e.startName+'">'+e.children.map(function(e){return e.visit(r)}).join(", ")+'</ph name="'+e.closeName+'">'},_SerializerVisitor.prototype.visitPlaceholder=function(e,t){return'<ph name="'+e.name+'">'+e.value+"</ph>"},_SerializerVisitor.prototype.visitIcuPlaceholder=function(e,t){return'<ph icu name="'+e.name+'">'+e.value.visit(this)+"</ph>"},_SerializerVisitor}(),i=new n},function(e,t,r){"use strict";var n=r(42);r.d(t,"a",function(){return o});var i=this&&this.__extends||function(e,t){function __(){this.constructor=e}for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r]);e.prototype=null===t?Object.create(t):(__.prototype=t.prototype,new __)},o=function(e){function I18nError(t,r){e.call(this,t,r)}return i(I18nError,e),I18nError}(n.a)},function(e,t,r){"use strict";function getTransitiveModules(e,t,r,n){return void 0===r&&(r=[]),void 0===n&&(n=new Set),e.forEach(function(e){if(!n.has(e.type.reference)){n.add(e.type.reference);var i=t?e.importedModules.concat(e.exportedModules):e.exportedModules;getTransitiveModules(i,t,r,n),r.push(e)}}),r}function flattenArray(e,t){if(void 0===t&&(t=[]),e)for(var i=0;i<e.length;i++){var o=r.i(n.resolveForwardRef)(e[i]);Array.isArray(o)?flattenArray(o,t):t.push(o)}return t}function isValidType(e){return o.z(e)||e instanceof n.Type}function staticTypeModuleUrl(e){return o.z(e)?e.filePath:null}function componentModuleUrl(e,t,n){if(o.z(t))return staticTypeModuleUrl(t);var i=n.moduleId;if("string"==typeof i){var a=r.i(d.b)(i);return a?i:"package:"+i+m.h}if(null!==i&&void 0!==i)throw new Error('moduleId should be a string in "'+r.i(s.k)(t)+"\". See https://goo.gl/wIDDiL for more information.\nIf you're using Webpack you should inline the template and the styles, see https://goo.gl/X2J8zc.");return e.importUri(t)}function convertToCompileValue(e,t){return r.i(m.e)(e,new g,t)}var n=r(0),i=r(260),o=r(17),a=r(163),s=r(2),u=r(13),c=r(439),l=r(170),p=r(172),f=r(14),h=r(90),d=r(91),m=r(23);r.d(t,"a",function(){return y});var v=this&&this.__extends||function(e,t){function __(){this.constructor=e}for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r]);e.prototype=null===t?Object.create(t):(__.prototype=t.prototype,new __)},y=function(){function CompileMetadataResolver(e,t,r,n,i){void 0===i&&(i=f.A),this._ngModuleResolver=e,this._directiveResolver=t,this._pipeResolver=r,this._schemaRegistry=n,this._reflector=i,this._directiveCache=new Map,this._pipeCache=new Map,this._ngModuleCache=new Map,this._ngModuleOfTypes=new Map,this._anonymousTypes=new Map,this._anonymousTypeIndex=0}return CompileMetadataResolver.prototype.sanitizeTokenName=function(e){var t=r.i(s.k)(e);if(t.indexOf("(")>=0){var n=this._anonymousTypes.get(e);n||(this._anonymousTypes.set(e,this._anonymousTypeIndex++),n=this._anonymousTypes.get(e)),t="anonymous_token_"+n+"_"}return r.i(m.a)(t)},CompileMetadataResolver.prototype.clearCacheFor=function(e){this._directiveCache.delete(e),this._pipeCache.delete(e),this._ngModuleOfTypes.delete(e),this._ngModuleCache.clear()},CompileMetadataResolver.prototype.clearCache=function(){this._directiveCache.clear(),this._pipeCache.clear(),this._ngModuleCache.clear(),this._ngModuleOfTypes.clear()},CompileMetadataResolver.prototype.getAnimationEntryMetadata=function(e){var t=this,r=e.definitions.map(function(e){return t.getAnimationStateMetadata(e)});return new o.r(e.name,r)},CompileMetadataResolver.prototype.getAnimationStateMetadata=function(e){if(e instanceof n.AnimationStateDeclarationMetadata){var t=this.getAnimationStyleMetadata(e.styles);return new o.g(e.stateNameExpr,t)}return e instanceof n.AnimationStateTransitionMetadata?new o.s(e.stateChangeExpr,this.getAnimationMetadata(e.steps)):null},CompileMetadataResolver.prototype.getAnimationStyleMetadata=function(e){return new o.k(e.offset,e.styles)},CompileMetadataResolver.prototype.getAnimationMetadata=function(e){var t=this;if(e instanceof n.AnimationStyleMetadata)return this.getAnimationStyleMetadata(e);if(e instanceof n.AnimationKeyframesSequenceMetadata)return new o.m(e.steps.map(function(e){return t.getAnimationStyleMetadata(e)}));if(e instanceof n.AnimationAnimateMetadata){var r=this.getAnimationMetadata(e.styles);return new o.l(e.timings,r)}if(e instanceof n.AnimationWithStepsMetadata){var i=e.steps.map(function(e){return t.getAnimationMetadata(e)});return e instanceof n.AnimationGroupMetadata?new o.i(i):new o.h(i)}return null},CompileMetadataResolver.prototype.getDirectiveMetadata=function(e,t){var a=this;void 0===t&&(t=!0),e=r.i(n.resolveForwardRef)(e);var u=this._directiveCache.get(e);if(!u){var c=this._directiveResolver.resolve(e,t);if(!c)return null;var l=null,p=null,f=[],h=staticTypeModuleUrl(e),d=[],m=c.selector;if(c instanceof n.Component){r.i(i.b)("styles",c.styles),r.i(i.b)("styleUrls",c.styleUrls),r.i(i.a)("interpolation",c.interpolation);var v=c.animations?c.animations.map(function(e){return a.getAnimationEntryMetadata(e)}):null;l=new o.p({encapsulation:c.encapsulation,template:c.template,templateUrl:c.templateUrl,styles:c.styles,styleUrls:c.styleUrls,animations:v,interpolation:c.interpolation}),p=c.changeDetection,c.viewProviders&&(f=this.getProvidersMetadata(c.viewProviders,d,'viewProviders for "'+r.i(s.k)(e)+'"')),h=componentModuleUrl(this._reflector,e,c),c.entryComponents&&(d=flattenArray(c.entryComponents).map(function(e){return a.getTypeMetadata(e,staticTypeModuleUrl(e))}).concat(d)),m||(m=this._schemaRegistry.getDefaultComponentElementName())}else if(!m)throw new Error("Directive "+r.i(s.k)(e)+" has no selector, please add it!");var y=[];r.i(s.a)(c.providers)&&(y=this.getProvidersMetadata(c.providers,d,'providers for "'+r.i(s.k)(e)+'"'));var g=[],_=[];r.i(s.a)(c.queries)&&(g=this.getQueriesMetadata(c.queries,!1,e),_=this.getQueriesMetadata(c.queries,!0,e)),u=o.q.create({selector:m,exportAs:c.exportAs,isComponent:!!l,type:this.getTypeMetadata(e,h),template:l,changeDetection:p,inputs:c.inputs,outputs:c.outputs,host:c.host,providers:y,viewProviders:f,queries:g,viewQueries:_,entryComponents:d}),this._directiveCache.set(e,u)}return u},CompileMetadataResolver.prototype.getNgModuleMetadata=function(e,t){var i=this;void 0===t&&(t=!0),e=r.i(n.resolveForwardRef)(e);var a=this._ngModuleCache.get(e);if(!a){var u=this._ngModuleResolver.resolve(e,t);if(!u)return null;var c=[],l=[],p=[],f=[],h=[],d=[],m=[],v=[],y=[],g=[];u.imports&&flattenArray(u.imports).forEach(function(t){var n;if(isValidType(t))n=t;else if(t&&t.ngModule){var o=t;n=o.ngModule,o.providers&&m.push.apply(m,i.getProvidersMetadata(o.providers,v,"provider for the NgModule '"+r.i(s.k)(n)+"'"))}if(!n)throw new Error("Unexpected value '"+r.i(s.k)(t)+"' imported by the module '"+r.i(s.k)(e)+"'");var a=i.getNgModuleMetadata(n,!1);if(null===a)throw new Error("Unexpected "+i._getTypeDescriptor(t)+" '"+r.i(s.k)(t)+"' imported by the module '"+r.i(s.k)(e)+"'");h.push(a)}),u.exports&&flattenArray(u.exports).forEach(function(t){if(!isValidType(t))throw new Error("Unexpected value '"+r.i(s.k)(t)+"' exported by the module '"+r.i(s.k)(e)+"'");var n,o,a;if(n=i.getDirectiveMetadata(t,!1))l.push(n);else if(o=i.getPipeMetadata(t,!1))f.push(o);else{if(!(a=i.getNgModuleMetadata(t,!1)))throw new Error("Unexpected "+i._getTypeDescriptor(t)+" '"+r.i(s.k)(t)+"' exported by the module '"+r.i(s.k)(e)+"'");d.push(a)}});var _=this._getTransitiveNgModuleMetadata(h,d);if(u.declarations&&flattenArray(u.declarations).forEach(function(t){if(!isValidType(t))throw new Error("Unexpected value '"+r.i(s.k)(t)+"' declared by the module '"+r.i(s.k)(e)+"'");var n,o;if(n=i.getDirectiveMetadata(t,!1))i._addDirectiveToModule(n,e,_,c,!0);else{if(!(o=i.getPipeMetadata(t,!1)))throw new Error("Unexpected "+i._getTypeDescriptor(t)+" '"+r.i(s.k)(t)+"' declared by the module '"+r.i(s.k)(e)+"'");i._addPipeToModule(o,e,_,p,!0)}}),u.providers&&m.push.apply(m,this.getProvidersMetadata(u.providers,v,"provider for the NgModule '"+r.i(s.k)(e)+"'")),u.entryComponents&&v.push.apply(v,flattenArray(u.entryComponents).map(function(e){return i.getTypeMetadata(e,staticTypeModuleUrl(e))})),u.bootstrap){var b=flattenArray(u.bootstrap).map(function(t){ if(!isValidType(t))throw new Error("Unexpected value '"+r.i(s.k)(t)+"' used in the bootstrap property of module '"+r.i(s.k)(e)+"'");return i.getTypeMetadata(t,staticTypeModuleUrl(t))});y.push.apply(y,b)}v.push.apply(v,y),u.schemas&&g.push.apply(g,flattenArray(u.schemas)),(w=_.entryComponents).push.apply(w,v),(C=_.providers).push.apply(C,m),a=new o.t({type:this.getTypeMetadata(e,staticTypeModuleUrl(e)),providers:m,entryComponents:v,bootstrapComponents:y,schemas:g,declaredDirectives:c,exportedDirectives:l,declaredPipes:p,exportedPipes:f,importedModules:h,exportedModules:d,transitiveModule:_,id:u.id}),_.modules.push(a),this._verifyModule(a),this._ngModuleCache.set(e,a)}return a;var w,C},CompileMetadataResolver.prototype._verifyModule=function(e){e.exportedDirectives.forEach(function(t){if(!e.transitiveModule.directivesSet.has(t.type.reference))throw new Error("Can't export directive "+r.i(s.k)(t.type.reference)+" from "+r.i(s.k)(e.type.reference)+" as it was neither declared nor imported!")}),e.exportedPipes.forEach(function(t){if(!e.transitiveModule.pipesSet.has(t.type.reference))throw new Error("Can't export pipe "+r.i(s.k)(t.type.reference)+" from "+r.i(s.k)(e.type.reference)+" as it was neither declared nor imported!")})},CompileMetadataResolver.prototype._getTypeDescriptor=function(e){return null!==this._directiveResolver.resolve(e,!1)?"directive":null!==this._pipeResolver.resolve(e,!1)?"pipe":null!==this._ngModuleResolver.resolve(e,!1)?"module":e.provide?"provider":"value"},CompileMetadataResolver.prototype._addTypeToModule=function(e,t){var n=this._ngModuleOfTypes.get(e);if(n&&n!==t)throw new Error("Type "+r.i(s.k)(e)+" is part of the declarations of 2 modules: "+r.i(s.k)(n)+" and "+r.i(s.k)(t)+"! "+("Please consider moving "+r.i(s.k)(e)+" to a higher module that imports "+r.i(s.k)(n)+" and "+r.i(s.k)(t)+". ")+("You can also create a new NgModule that exports and includes "+r.i(s.k)(e)+" then import that NgModule in "+r.i(s.k)(n)+" and "+r.i(s.k)(t)+"."));this._ngModuleOfTypes.set(e,t)},CompileMetadataResolver.prototype._getTransitiveNgModuleMetadata=function(e,t){var r=getTransitiveModules(e.concat(t),!0),n=flattenArray(r.map(function(e){return e.providers})),i=flattenArray(r.map(function(e){return e.entryComponents})),a=getTransitiveModules(e,!1),s=flattenArray(a.map(function(e){return e.exportedDirectives})),u=flattenArray(a.map(function(e){return e.exportedPipes}));return new o.u(r,n,i,s,u)},CompileMetadataResolver.prototype._addDirectiveToModule=function(e,t,r,n,i){return void 0===i&&(i=!1),!(!i&&r.directivesSet.has(e.type.reference))&&(r.directivesSet.add(e.type.reference),r.directives.push(e),n.push(e),this._addTypeToModule(e.type.reference,t),!0)},CompileMetadataResolver.prototype._addPipeToModule=function(e,t,r,n,i){return void 0===i&&(i=!1),!(!i&&r.pipesSet.has(e.type.reference))&&(r.pipesSet.add(e.type.reference),r.pipes.push(e),n.push(e),this._addTypeToModule(e.type.reference,t),!0)},CompileMetadataResolver.prototype.getTypeMetadata=function(e,t,i){return void 0===i&&(i=null),e=r.i(n.resolveForwardRef)(e),new o.e({name:this.sanitizeTokenName(e),moduleUrl:t,reference:e,diDeps:this.getDependenciesMetadata(e,i),lifecycleHooks:f.J.filter(function(t){return r.i(c.a)(t,e)})})},CompileMetadataResolver.prototype.getFactoryMetadata=function(e,t,i){return void 0===i&&(i=null),e=r.i(n.resolveForwardRef)(e),new o.v({name:this.sanitizeTokenName(e),moduleUrl:t,reference:e,diDeps:this.getDependenciesMetadata(e,i)})},CompileMetadataResolver.prototype.getPipeMetadata=function(e,t){void 0===t&&(t=!0),e=r.i(n.resolveForwardRef)(e);var i=this._pipeCache.get(e);if(!i){var a=this._pipeResolver.resolve(e,t);if(!a)return null;i=new o.w({type:this.getTypeMetadata(e,staticTypeModuleUrl(e)),name:a.name,pure:a.pure}),this._pipeCache.set(e,i)}return i},CompileMetadataResolver.prototype.getDependenciesMetadata=function(e,t){var i=this,a=!1,u=t||this._reflector.parameters(e)||[],c=u.map(function(t){var u=!1,c=!1,l=!1,p=!1,f=!1,h=null,d=null,m=null;return Array.isArray(t)?t.forEach(function(e){e instanceof n.Host?c=!0:e instanceof n.Self?l=!0:e instanceof n.SkipSelf?p=!0:e instanceof n.Optional?f=!0:e instanceof n.Attribute?(u=!0,m=e.attributeName):e instanceof n.Query?e.isViewQuery?d=e:h=e:e instanceof n.Inject?m=e.token:isValidType(e)&&r.i(s.b)(m)&&(m=e)}):m=t,r.i(s.b)(m)?(a=!0,null):new o.c({isAttribute:u,isHost:c,isSelf:l,isSkipSelf:p,isOptional:f,query:h?i.getQueryMetadata(h,null,e):null,viewQuery:d?i.getQueryMetadata(d,null,e):null,token:i.getTokenMetadata(m)})});if(a){var l=c.map(function(e){return e?r.i(s.k)(e.token):"?"}).join(", ");throw new Error("Can't resolve all parameters for "+r.i(s.k)(e)+": ("+l+").")}return c},CompileMetadataResolver.prototype.getTokenMetadata=function(e){e=r.i(n.resolveForwardRef)(e);var t;return t="string"==typeof e?new o.b({value:e}):new o.b({identifier:new o.a({reference:e,name:this.sanitizeTokenName(e),moduleUrl:staticTypeModuleUrl(e)})})},CompileMetadataResolver.prototype.getProvidersMetadata=function(e,t,i){var a=this,c=[];return e.forEach(function(l,p){l=r.i(n.resolveForwardRef)(l),l&&"object"==typeof l&&l.hasOwnProperty("provide")&&(l=new o.x(l.provide,l));var f;if(Array.isArray(l))f=a.getProvidersMetadata(l,t,i);else if(l instanceof o.x){var h=a.getTokenMetadata(l.token);h.reference===r.i(u.a)(u.b.ANALYZE_FOR_ENTRY_COMPONENTS).reference?t.push.apply(t,a._getEntryComponentsFromProvider(l)):f=a.getProviderMetadata(l)}else{if(!isValidType(l)){var d=e.reduce(function(e,t,n){return n<p?e.push(""+r.i(s.k)(t)):n==p?e.push("?"+r.i(s.k)(t)+"?"):n==p+1&&e.push("..."),e},[]).join(", ");throw new Error("Invalid "+(i?i:"provider")+" - only instances of Provider and Type are allowed, got: ["+d+"]")}f=a.getTypeMetadata(l,staticTypeModuleUrl(l))}f&&c.push(f)}),c},CompileMetadataResolver.prototype._getEntryComponentsFromProvider=function(e){var t=this,r=[],n=[];if(e.useFactory||e.useExisting||e.useClass)throw new Error("The ANALYZE_FOR_ENTRY_COMPONENTS token only supports useValue!");if(!e.multi)throw new Error("The ANALYZE_FOR_ENTRY_COMPONENTS token only supports 'multi = true'!");return convertToCompileValue(e.useValue,n),n.forEach(function(e){var n=t.getDirectiveMetadata(e.reference,!1);n&&r.push(n.type)}),r},CompileMetadataResolver.prototype.getProviderMetadata=function(e){var t,r=null,n=null;return e.useClass?(r=this.getTypeMetadata(e.useClass,staticTypeModuleUrl(e.useClass),e.dependencies),t=r.diDeps):e.useFactory&&(n=this.getFactoryMetadata(e.useFactory,staticTypeModuleUrl(e.useFactory),e.dependencies),t=n.diDeps),new o.d({token:this.getTokenMetadata(e.token),useClass:r,useValue:convertToCompileValue(e.useValue,[]),useFactory:n,useExisting:e.useExisting?this.getTokenMetadata(e.useExisting):null,deps:t,multi:e.multi})},CompileMetadataResolver.prototype.getQueriesMetadata=function(e,t,r){var n=this,i=[];return Object.keys(e).forEach(function(o){var a=e[o];a.isViewQuery===t&&i.push(n.getQueryMetadata(a,o,r))}),i},CompileMetadataResolver.prototype._queryVarBindings=function(e){return e.split(/\s*,\s*/)},CompileMetadataResolver.prototype.getQueryMetadata=function(e,t,n){var i,a=this;if("string"==typeof e.selector)i=this._queryVarBindings(e.selector).map(function(e){return a.getTokenMetadata(e)});else{if(!e.selector)throw new Error("Can't construct a query for the property \""+t+'" of "'+r.i(s.k)(n)+"\" since the query selector wasn't defined.");i=[this.getTokenMetadata(e.selector)]}return new o.y({selectors:i,first:e.first,descendants:e.descendants,propertyName:t,read:e.read?this.getTokenMetadata(e.read):null})},CompileMetadataResolver.decorators=[{type:n.Injectable}],CompileMetadataResolver.ctorParameters=[{type:l.a},{type:a.a},{type:p.a},{type:h.a},{type:f.I}],CompileMetadataResolver}(),g=function(e){function _CompileValueConverter(){e.apply(this,arguments)}return v(_CompileValueConverter,e),_CompileValueConverter.prototype.visitOther=function(e,t){var r;return r=o.z(e)?new o.a({name:e.name,moduleUrl:e.filePath,reference:e}):new o.a({reference:e}),t.push(r),r},_CompileValueConverter}(m.i)},function(e,t,r){"use strict";function getHtmlTagDefinition(e){return o[e.toLowerCase()]||a}var n=r(76);t.a=getHtmlTagDefinition;var i=function(){function HtmlTagDefinition(e){var t=this,r=void 0===e?{}:e,i=r.closedByChildren,o=r.requiredParents,a=r.implicitNamespacePrefix,s=r.contentType,u=void 0===s?n.a.PARSABLE_DATA:s,c=r.closedByParent,l=void 0!==c&&c,p=r.isVoid,f=void 0!==p&&p,h=r.ignoreFirstLf,d=void 0!==h&&h;this.closedByChildren={},this.closedByParent=!1,this.canSelfClose=!1,i&&i.length>0&&i.forEach(function(e){return t.closedByChildren[e]=!0}),this.isVoid=f,this.closedByParent=l||f,o&&o.length>0&&(this.requiredParents={},this.parentToAdd=o[0],o.forEach(function(e){return t.requiredParents[e]=!0})),this.implicitNamespacePrefix=a,this.contentType=u,this.ignoreFirstLf=d}return HtmlTagDefinition.prototype.requireExtraParent=function(e){if(!this.requiredParents)return!1;if(!e)return!0;var t=e.toLowerCase();return 1!=this.requiredParents[t]&&"template"!=t},HtmlTagDefinition.prototype.isClosedByChild=function(e){return this.isVoid||e.toLowerCase()in this.closedByChildren},HtmlTagDefinition}(),o={base:new i({isVoid:!0}),meta:new i({isVoid:!0}),area:new i({isVoid:!0}),embed:new i({isVoid:!0}),link:new i({isVoid:!0}),img:new i({isVoid:!0}),input:new i({isVoid:!0}),param:new i({isVoid:!0}),hr:new i({isVoid:!0}),br:new i({isVoid:!0}),source:new i({isVoid:!0}),track:new i({isVoid:!0}),wbr:new i({isVoid:!0}),p:new i({closedByChildren:["address","article","aside","blockquote","div","dl","fieldset","footer","form","h1","h2","h3","h4","h5","h6","header","hgroup","hr","main","nav","ol","p","pre","section","table","ul"],closedByParent:!0}),thead:new i({closedByChildren:["tbody","tfoot"]}),tbody:new i({closedByChildren:["tbody","tfoot"],closedByParent:!0}),tfoot:new i({closedByChildren:["tbody"],closedByParent:!0}),tr:new i({closedByChildren:["tr"],requiredParents:["tbody","tfoot","thead"],closedByParent:!0}),td:new i({closedByChildren:["td","th"],closedByParent:!0}),th:new i({closedByChildren:["td","th"],closedByParent:!0}),col:new i({requiredParents:["colgroup"],isVoid:!0}),svg:new i({implicitNamespacePrefix:"svg"}),math:new i({implicitNamespacePrefix:"math"}),li:new i({closedByChildren:["li"],closedByParent:!0}),dt:new i({closedByChildren:["dt","dd"]}),dd:new i({closedByChildren:["dt","dd"],closedByParent:!0}),rb:new i({closedByChildren:["rb","rt","rtc","rp"],closedByParent:!0}),rt:new i({closedByChildren:["rb","rt","rtc","rp"],closedByParent:!0}),rtc:new i({closedByChildren:["rb","rtc","rp"],closedByParent:!0}),rp:new i({closedByChildren:["rb","rt","rtc","rp"],closedByParent:!0}),optgroup:new i({closedByChildren:["optgroup"],closedByParent:!0}),option:new i({closedByChildren:["option","optgroup"],closedByParent:!0}),pre:new i({ignoreFirstLf:!0}),listing:new i({ignoreFirstLf:!0}),style:new i({contentType:n.a.RAW_TEXT}),script:new i({contentType:n.a.RAW_TEXT}),title:new i({contentType:n.a.ESCAPABLE_RAW_TEXT}),textarea:new i({contentType:n.a.ESCAPABLE_RAW_TEXT,ignoreFirstLf:!0})},a=new i},function(e,t,r){"use strict";var n=r(0),i=r(17),o=r(2),a=r(13),s=r(8),u=r(273),c=r(42),l=r(14),p=r(274),f=r(23);r.d(t,"a",function(){return m});var h=function(){function ComponentFactoryDependency(e,t){this.comp=e,this.placeholder=t}return ComponentFactoryDependency}(),d=function(){function NgModuleCompileResult(e,t,r){this.statements=e,this.ngModuleFactoryVar=t,this.dependencies=r}return NgModuleCompileResult}(),m=function(){function NgModuleCompiler(){}return NgModuleCompiler.prototype.compile=function(e,t){var n=r.i(o.a)(e.type.moduleUrl)?"in NgModule "+e.type.name+" in "+e.type.moduleUrl:"in NgModule "+e.type.name,u=new c.b("",n),l=new c.d(new c.c(u,null,null,null),new c.c(u,null,null,null)),f=[],m=[],y=e.transitiveModule.entryComponents.map(function(t){var r=new i.a({name:t.name});return e.bootstrapComponents.indexOf(t)>-1&&m.push(r),f.push(new h(t,r)),r}),g=new v(e,y,m,l),_=new p.c(e,t,l);_.parse().forEach(function(e){return g.addProvider(e)});var b=g.build(),w=e.type.name+"NgFactory",C=s.e(w).set(s.b(r.i(a.d)(a.b.NgModuleFactory)).instantiate([s.e(b.name),s.b(e.type)],s.c(r.i(a.d)(a.b.NgModuleFactory),[s.c(e.type)],[s.d.Const]))).toDeclStmt(null,[s.r.Final]),E=[b,C];if(e.id){var S=s.b(r.i(a.d)(a.b.RegisterModuleFactoryFn)).callFn([s.a(e.id),s.e(w)]).toStmt();E.push(S)}return new d(E,w,f)},NgModuleCompiler.decorators=[{type:n.Injectable}],NgModuleCompiler.ctorParameters=[],NgModuleCompiler}(),v=function(){function _InjectorBuilder(e,t,r,n){this._ngModuleMeta=e,this._entryComponentFactories=t,this._bootstrapComponentFactories=r,this._sourceSpan=n,this._tokens=[],this._instances=new Map,this._fields=[],this._createStmts=[],this._destroyStmts=[],this._getters=[]}return _InjectorBuilder.prototype.addProvider=function(e){var t=this,r=e.providers.map(function(e){return t._getProviderValue(e)}),n="_"+e.token.name+"_"+this._instances.size,i=this._createProviderProperty(n,e,r,e.multiProvider,e.eager);e.lifecycleHooks.indexOf(l.G.OnDestroy)!==-1&&this._destroyStmts.push(i.callMethod("ngOnDestroy",[]).toStmt()),this._tokens.push(e.token),this._instances.set(e.token.reference,i)},_InjectorBuilder.prototype.build=function(){var e=this,t=this._tokens.map(function(t){var n=e._instances.get(t.reference);return new s.i(g.token.identical(r.i(f.f)(t)),[new s.k(n)])}),n=[new s.s("createInternal",[],this._createStmts.concat(new s.k(this._instances.get(this._ngModuleMeta.type.reference))),s.c(this._ngModuleMeta.type)),new s.s("getInternal",[new s.l(g.token.name,s.m),new s.l(g.notFoundResult.name,s.m)],t.concat([new s.k(g.notFoundResult)]),s.m),new s.s("destroyInternal",[],this._destroyStmts)],i=new s.s(null,[new s.l(y.parent.name,s.c(r.i(a.d)(a.b.Injector)))],[s.K.callFn([s.e(y.parent.name),s.g(this._entryComponentFactories.map(function(e){return s.b(e)})),s.g(this._bootstrapComponentFactories.map(function(e){return s.b(e)}))]).toStmt()]),o=this._ngModuleMeta.type.name+"Injector";return new s.t(o,s.b(r.i(a.d)(a.b.NgModuleInjector),[s.c(this._ngModuleMeta.type)]),this._fields,this._getters,i,n)},_InjectorBuilder.prototype._getProviderValue=function(e){var t,n=this;if(r.i(o.a)(e.useExisting))t=this._getDependency(new i.c({token:e.useExisting}));else if(r.i(o.a)(e.useFactory)){var a=e.deps||e.useFactory.diDeps,c=a.map(function(e){return n._getDependency(e)});t=s.b(e.useFactory).callFn(c)}else if(r.i(o.a)(e.useClass)){var a=e.deps||e.useClass.diDeps,c=a.map(function(e){return n._getDependency(e)});t=s.b(e.useClass).instantiate(c,s.c(e.useClass))}else t=r.i(u.a)(e.useValue);return t},_InjectorBuilder.prototype._createProviderProperty=function(e,t,r,n,i){var o,a;if(n?(o=s.g(r),a=new s.A(s.m)):(o=r[0],a=r[0].type),a||(a=s.m),i)this._fields.push(new s.o(e,a)),this._createStmts.push(s.n.prop(e).set(o).toStmt());else{var u="_"+e;this._fields.push(new s.o(u,a));var c=[new s.i(s.n.prop(u).isBlank(),[s.n.prop(u).set(o).toStmt()]),new s.k(s.n.prop(u))];this._getters.push(new s.D(e,c,a))}return s.n.prop(e)},_InjectorBuilder.prototype._getDependency=function(e){var t=null;if(e.isValue&&(t=s.a(e.value)),e.isSkipSelf||(!e.token||e.token.reference!==r.i(a.a)(a.b.Injector).reference&&e.token.reference!==r.i(a.a)(a.b.ComponentFactoryResolver).reference||(t=s.n),t||(t=this._instances.get(e.token.reference))),!t){var n=[r.i(f.f)(e.token)];e.isOptional&&n.push(s.h),t=y.parent.callMethod("get",n)}return t},_InjectorBuilder}(),y=function(){function InjectorProps(){}return InjectorProps.parent=s.n.prop("parent"),InjectorProps}(),g=function(){function InjectMethodVars(){}return InjectMethodVars.token=s.e("token"),InjectMethodVars.notFoundResult=s.e("notFoundResult"),InjectMethodVars}()},function(e,t,r){"use strict";function _isNgModuleMetadata(e){return e instanceof n.NgModule}var n=r(0),i=r(2),o=r(14);r.d(t,"a",function(){return a});var a=function(){function NgModuleResolver(e){void 0===e&&(e=o.A),this._reflector=e}return NgModuleResolver.prototype.resolve=function(e,t){void 0===t&&(t=!0);var n=this._reflector.annotations(e).find(_isNgModuleMetadata);if(r.i(i.a)(n))return n;if(t)throw new Error("No NgModule metadata found for '"+r.i(i.k)(e)+"'.");return null},NgModuleResolver.decorators=[{type:n.Injectable}],NgModuleResolver.ctorParameters=[{type:o.I}],NgModuleResolver}()},function(e,t,r){"use strict";function escapeIdentifier(e,t,i){if(void 0===i&&(i=!0),r.i(n.b)(e))return null;var s=e.replace(o,function(){for(var e=[],r=0;r<arguments.length;r++)e[r-0]=arguments[r];return"$"==e[0]?t?"\\$":"$":"\n"==e[0]?"\\n":"\r"==e[0]?"\\r":"\\"+e[0]}),u=i||!a.test(s);return u?"'"+s+"'":s}function _createIndent(e){for(var t="",r=0;r<e;r++)t+=" ";return t}var n=r(2),i=r(8);r.d(t,"b",function(){return s}),r.d(t,"c",function(){return u}),r.d(t,"a",function(){return l}),r.d(t,"d",function(){return p});var o=/'|\\|\n|\r|\$/g,a=/^[$A-Z_][0-9A-Z_$]*$/i,s=i.e("error"),u=i.e("stack"),c=(function(){function OutputEmitter(){}return OutputEmitter}(),function(){function _EmittedLine(e){this.indent=e,this.parts=[]}return _EmittedLine}()),l=function(){function EmitterVisitorContext(e,t){this._exportedVars=e,this._indent=t,this._classes=[],this._lines=[new c(t)]}return EmitterVisitorContext.createRoot=function(e){return new EmitterVisitorContext(e,0)},Object.defineProperty(EmitterVisitorContext.prototype,"_currentLine",{get:function(){return this._lines[this._lines.length-1]},enumerable:!0,configurable:!0}),EmitterVisitorContext.prototype.isExportedVar=function(e){return this._exportedVars.indexOf(e)!==-1},EmitterVisitorContext.prototype.println=function(e){void 0===e&&(e=""),this.print(e,!0)},EmitterVisitorContext.prototype.lineIsEmpty=function(){return 0===this._currentLine.parts.length},EmitterVisitorContext.prototype.print=function(e,t){void 0===t&&(t=!1),e.length>0&&this._currentLine.parts.push(e),t&&this._lines.push(new c(this._indent))},EmitterVisitorContext.prototype.removeEmptyLastLine=function(){this.lineIsEmpty()&&this._lines.pop()},EmitterVisitorContext.prototype.incIndent=function(){this._indent++,this._currentLine.indent=this._indent},EmitterVisitorContext.prototype.decIndent=function(){this._indent--,this._currentLine.indent=this._indent},EmitterVisitorContext.prototype.pushClass=function(e){this._classes.push(e)},EmitterVisitorContext.prototype.popClass=function(){return this._classes.pop()},Object.defineProperty(EmitterVisitorContext.prototype,"currentClass",{get:function(){return this._classes.length>0?this._classes[this._classes.length-1]:null},enumerable:!0,configurable:!0}),EmitterVisitorContext.prototype.toSource=function(){var e=this._lines;return 0===e[e.length-1].parts.length&&(e=e.slice(0,e.length-1)),e.map(function(e){return e.parts.length>0?_createIndent(e.indent)+e.parts.join(""):""}).join("\n")},EmitterVisitorContext}(),p=function(){function AbstractEmitterVisitor(e){this._escapeDollarInStrings=e}return AbstractEmitterVisitor.prototype.visitExpressionStmt=function(e,t){return e.expr.visitExpression(this,t),t.println(";"),null},AbstractEmitterVisitor.prototype.visitReturnStmt=function(e,t){return t.print("return "),e.value.visitExpression(this,t),t.println(";"),null},AbstractEmitterVisitor.prototype.visitIfStmt=function(e,t){t.print("if ("),e.condition.visitExpression(this,t),t.print(") {");var i=r.i(n.a)(e.falseCase)&&e.falseCase.length>0;return e.trueCase.length<=1&&!i?(t.print(" "),this.visitAllStatements(e.trueCase,t),t.removeEmptyLastLine(),t.print(" ")):(t.println(),t.incIndent(),this.visitAllStatements(e.trueCase,t),t.decIndent(),i&&(t.println("} else {"),t.incIndent(),this.visitAllStatements(e.falseCase,t),t.decIndent())),t.println("}"),null},AbstractEmitterVisitor.prototype.visitThrowStmt=function(e,t){return t.print("throw "),e.error.visitExpression(this,t),t.println(";"),null},AbstractEmitterVisitor.prototype.visitCommentStmt=function(e,t){var r=e.comment.split("\n");return r.forEach(function(e){t.println("// "+e)}),null},AbstractEmitterVisitor.prototype.visitWriteVarExpr=function(e,t){var r=t.lineIsEmpty();return r||t.print("("),t.print(e.name+" = "),e.value.visitExpression(this,t),r||t.print(")"),null},AbstractEmitterVisitor.prototype.visitWriteKeyExpr=function(e,t){var r=t.lineIsEmpty();return r||t.print("("),e.receiver.visitExpression(this,t),t.print("["),e.index.visitExpression(this,t),t.print("] = "),e.value.visitExpression(this,t),r||t.print(")"),null},AbstractEmitterVisitor.prototype.visitWritePropExpr=function(e,t){var r=t.lineIsEmpty();return r||t.print("("),e.receiver.visitExpression(this,t),t.print("."+e.name+" = "),e.value.visitExpression(this,t),r||t.print(")"),null},AbstractEmitterVisitor.prototype.visitInvokeMethodExpr=function(e,t){e.receiver.visitExpression(this,t);var i=e.name;return r.i(n.a)(e.builtin)&&(i=this.getBuiltinMethodName(e.builtin),r.i(n.b)(i))?null:(t.print("."+i+"("),this.visitAllExpressions(e.args,t,","),t.print(")"),null)},AbstractEmitterVisitor.prototype.visitInvokeFunctionExpr=function(e,t){return e.fn.visitExpression(this,t),t.print("("),this.visitAllExpressions(e.args,t,","),t.print(")"),null},AbstractEmitterVisitor.prototype.visitReadVarExpr=function(e,t){var o=e.name;if(r.i(n.a)(e.builtin))switch(e.builtin){case i.y.Super:o="super";break;case i.y.This:o="this";break;case i.y.CatchError:o=s.name;break;case i.y.CatchStack:o=u.name;break;default:throw new Error("Unknown builtin variable "+e.builtin)}return t.print(o),null},AbstractEmitterVisitor.prototype.visitInstantiateExpr=function(e,t){return t.print("new "),e.classExpr.visitExpression(this,t),t.print("("),this.visitAllExpressions(e.args,t,","),t.print(")"),null},AbstractEmitterVisitor.prototype.visitLiteralExpr=function(e,t,i){void 0===i&&(i="null");var o=e.value;return"string"==typeof o?t.print(escapeIdentifier(o,this._escapeDollarInStrings)):r.i(n.b)(o)?t.print(i):t.print(""+o),null},AbstractEmitterVisitor.prototype.visitConditionalExpr=function(e,t){return t.print("("),e.condition.visitExpression(this,t),t.print("? "),e.trueCase.visitExpression(this,t),t.print(": "),e.falseCase.visitExpression(this,t),t.print(")"),null},AbstractEmitterVisitor.prototype.visitNotExpr=function(e,t){return t.print("!"),e.condition.visitExpression(this,t),null},AbstractEmitterVisitor.prototype.visitBinaryOperatorExpr=function(e,t){var r;switch(e.operator){case i.F.Equals:r="==";break;case i.F.Identical:r="===";break;case i.F.NotEquals:r="!=";break;case i.F.NotIdentical:r="!==";break;case i.F.And:r="&&";break;case i.F.Or:r="||";break;case i.F.Plus:r="+";break;case i.F.Minus:r="-";break;case i.F.Divide:r="/";break;case i.F.Multiply:r="*";break;case i.F.Modulo:r="%";break;case i.F.Lower:r="<";break;case i.F.LowerEquals:r="<=";break;case i.F.Bigger:r=">";break;case i.F.BiggerEquals:r=">=";break;default:throw new Error("Unknown operator "+e.operator)}return t.print("("),e.lhs.visitExpression(this,t),t.print(" "+r+" "),e.rhs.visitExpression(this,t),t.print(")"),null},AbstractEmitterVisitor.prototype.visitReadPropExpr=function(e,t){return e.receiver.visitExpression(this,t),t.print("."),t.print(e.name),null},AbstractEmitterVisitor.prototype.visitReadKeyExpr=function(e,t){return e.receiver.visitExpression(this,t),t.print("["),e.index.visitExpression(this,t),t.print("]"),null},AbstractEmitterVisitor.prototype.visitLiteralArrayExpr=function(e,t){var r=e.entries.length>1;return t.print("[",r),t.incIndent(),this.visitAllExpressions(e.entries,t,",",r),t.decIndent(),t.print("]",r),null},AbstractEmitterVisitor.prototype.visitLiteralMapExpr=function(e,t){var r=this,n=e.entries.length>1;return t.print("{",n),t.incIndent(),this.visitAllObjects(function(e){t.print(escapeIdentifier(e[0],r._escapeDollarInStrings,!1)+": "),e[1].visitExpression(r,t)},e.entries,t,",",n),t.decIndent(),t.print("}",n),null},AbstractEmitterVisitor.prototype.visitAllExpressions=function(e,t,r,n){var i=this;void 0===n&&(n=!1),this.visitAllObjects(function(e){return e.visitExpression(i,t)},e,t,r,n)},AbstractEmitterVisitor.prototype.visitAllObjects=function(e,t,r,n,i){void 0===i&&(i=!1);for(var o=0;o<t.length;o++)o>0&&r.print(n,i),e(t[o]);i&&r.println()},AbstractEmitterVisitor.prototype.visitAllStatements=function(e,t){var r=this;e.forEach(function(e){return e.visitStatement(r,t)})},AbstractEmitterVisitor}()},function(e,t,r){"use strict";function _isPipeMetadata(e){return e instanceof n.Pipe}var n=r(0),i=r(2),o=r(14);r.d(t,"a",function(){return a});var a=function(){function PipeResolver(e){void 0===e&&(e=o.A),this._reflector=e}return PipeResolver.prototype.resolve=function(e,t){void 0===t&&(t=!0);var o=this._reflector.annotations(r.i(n.resolveForwardRef)(e));if(r.i(i.a)(o)){var a=o.find(_isPipeMetadata);if(r.i(i.a)(a))return a}if(t)throw new Error("No Pipe decorator found on "+r.i(i.k)(e));return null},PipeResolver.decorators=[{type:n.Injectable}],PipeResolver.ctorParameters=[{type:o.I}],PipeResolver}()},function(e,t,r){"use strict";r.d(t,"a",function(){return n});var n=function(){function ResourceLoader(){}return ResourceLoader.prototype.get=function(e){return null},ResourceLoader}()},function(e,t,r){"use strict";var n=r(168);r.d(t,"a",function(){return o}),r.d(t,"b",function(){return a});var i=new RegExp("(\\:not\\()|([-\\w]+)|(?:\\.([-\\w]+))|(?:\\[([-\\w*]+)(?:=([^\\]]*))?\\])|(\\))|(\\s*,\\s*)","g"),o=function(){function CssSelector(){this.element=null,this.classNames=[],this.attrs=[],this.notSelectors=[]}return CssSelector.parse=function(e){var t,r=[],n=function(e,t){t.notSelectors.length>0&&!t.element&&0==t.classNames.length&&0==t.attrs.length&&(t.element="*"),e.push(t)},o=new CssSelector,a=o,s=!1;for(i.lastIndex=0;t=i.exec(e);){if(t[1]){if(s)throw new Error("Nesting :not is not allowed in a selector");s=!0,a=new CssSelector,o.notSelectors.push(a)}if(t[2]&&a.setElement(t[2]),t[3]&&a.addClassName(t[3]),t[4]&&a.addAttribute(t[4],t[5]),t[6]&&(s=!1,a=o),t[7]){if(s)throw new Error("Multiple selectors in :not are not supported");n(r,o),o=a=new CssSelector}}return n(r,o),r},CssSelector.prototype.isElementSelector=function(){return this.hasElementSelector()&&0==this.classNames.length&&0==this.attrs.length&&0===this.notSelectors.length},CssSelector.prototype.hasElementSelector=function(){return!!this.element},CssSelector.prototype.setElement=function(e){void 0===e&&(e=null),this.element=e},CssSelector.prototype.getMatchingElementTemplate=function(){for(var e=this.element||"div",t=this.classNames.length>0?' class="'+this.classNames.join(" ")+'"':"",i="",o=0;o<this.attrs.length;o+=2){var a=this.attrs[o],s=""!==this.attrs[o+1]?'="'+this.attrs[o+1]+'"':"";i+=" "+a+s}return r.i(n.a)(e).isVoid?"<"+e+t+i+"/>":"<"+e+t+i+"></"+e+">"},CssSelector.prototype.addAttribute=function(e,t){void 0===t&&(t=""),this.attrs.push(e,t&&t.toLowerCase()||"")},CssSelector.prototype.addClassName=function(e){this.classNames.push(e.toLowerCase())},CssSelector.prototype.toString=function(){var e=this.element||"";if(this.classNames&&this.classNames.forEach(function(t){return e+="."+t}),this.attrs)for(var t=0;t<this.attrs.length;t+=2){var r=this.attrs[t],n=this.attrs[t+1];e+="["+r+(n?"="+n:"")+"]"}return this.notSelectors.forEach(function(t){return e+=":not("+t+")"}),e},CssSelector}(),a=function(){function SelectorMatcher(){this._elementMap={},this._elementPartialMap={},this._classMap={},this._classPartialMap={},this._attrValueMap={},this._attrValuePartialMap={},this._listContexts=[]}return SelectorMatcher.createNotMatcher=function(e){var t=new SelectorMatcher;return t.addSelectables(e,null),t},SelectorMatcher.prototype.addSelectables=function(e,t){var r=null;e.length>1&&(r=new s(e),this._listContexts.push(r));for(var n=0;n<e.length;n++)this._addSelectable(e[n],t,r)},SelectorMatcher.prototype._addSelectable=function(e,t,r){var n=this,i=e.element,o=e.classNames,a=e.attrs,s=new u(e,t,r);if(i){var c=0===a.length&&0===o.length;c?this._addTerminal(n._elementMap,i,s):n=this._addPartial(n._elementPartialMap,i)}if(o)for(var l=0;l<o.length;l++){var c=0===a.length&&l===o.length-1,p=o[l];c?this._addTerminal(n._classMap,p,s):n=this._addPartial(n._classPartialMap,p)}if(a)for(var l=0;l<a.length;l+=2){var c=l===a.length-2,f=a[l],h=a[l+1];if(c){var d=n._attrValueMap,m=d[f];m||(m={},d[f]=m),this._addTerminal(m,h,s)}else{var v=n._attrValuePartialMap,y=v[f];y||(y={},v[f]=y),n=this._addPartial(y,h)}}},SelectorMatcher.prototype._addTerminal=function(e,t,r){var n=e[t];n||(n=[],e[t]=n),n.push(r)},SelectorMatcher.prototype._addPartial=function(e,t){var r=e[t];return r||(r=new SelectorMatcher,e[t]=r),r},SelectorMatcher.prototype.match=function(e,t){for(var r=!1,n=e.element,i=e.classNames,o=e.attrs,a=0;a<this._listContexts.length;a++)this._listContexts[a].alreadyMatched=!1;if(r=this._matchTerminal(this._elementMap,n,e,t)||r,r=this._matchPartial(this._elementPartialMap,n,e,t)||r,i)for(var a=0;a<i.length;a++){var s=i[a];r=this._matchTerminal(this._classMap,s,e,t)||r,r=this._matchPartial(this._classPartialMap,s,e,t)||r}if(o)for(var a=0;a<o.length;a+=2){var u=o[a],c=o[a+1],l=this._attrValueMap[u];c&&(r=this._matchTerminal(l,"",e,t)||r),r=this._matchTerminal(l,c,e,t)||r;var p=this._attrValuePartialMap[u];c&&(r=this._matchPartial(p,"",e,t)||r),r=this._matchPartial(p,c,e,t)||r}return r},SelectorMatcher.prototype._matchTerminal=function(e,t,r,n){if(!e||"string"!=typeof t)return!1;var i=e[t],o=e["*"];if(o&&(i=i.concat(o)),!i)return!1;for(var a,s=!1,u=0;u<i.length;u++)a=i[u],s=a.finalize(r,n)||s;return s},SelectorMatcher.prototype._matchPartial=function(e,t,r,n){if(!e||"string"!=typeof t)return!1;var i=e[t];return!!i&&i.match(r,n)},SelectorMatcher}(),s=function(){function SelectorListContext(e){this.selectors=e,this.alreadyMatched=!1}return SelectorListContext}(),u=function(){function SelectorContext(e,t,r){this.selector=e,this.cbContext=t,this.listContext=r,this.notSelectors=e.notSelectors}return SelectorContext.prototype.finalize=function(e,t){var r=!0;if(this.notSelectors.length>0&&(!this.listContext||!this.listContext.alreadyMatched)){var n=a.createNotMatcher(this.notSelectors);r=!n.match(e,null)}return!r||!t||this.listContext&&this.listContext.alreadyMatched||(this.listContext&&(this.listContext.alreadyMatched=!0),t(this.selector,this.cbContext)),r},SelectorContext}()},function(e,t,r){"use strict";function getStylesVarName(e){var t="styles";return e&&(t+="_"+e.type.name),t}var n=r(0),i=r(17),o=r(8),a=r(449),s=r(91);r.d(t,"a",function(){return d});var u="%COMP%",c="_nghost-"+u,l="_ngcontent-"+u,p=function(){function StylesCompileDependency(e,t,r){this.moduleUrl=e,this.isShimmed=t,this.valuePlaceholder=r}return StylesCompileDependency}(),f=function(){function StylesCompileResult(e,t){this.componentStylesheet=e,this.externalStylesheets=t}return StylesCompileResult}(),h=function(){function CompiledStylesheet(e,t,r,n,i){this.statements=e,this.stylesVar=t,this.dependencies=r,this.isShimmed=n,this.meta=i}return CompiledStylesheet}(),d=function(){function StyleCompiler(e){this._urlResolver=e,this._shadowCss=new a.a}return StyleCompiler.prototype.compileComponent=function(e){var t=this,r=[],n=this._compileStyles(e,new i.o({styles:e.template.styles,styleUrls:e.template.styleUrls,moduleUrl:e.type.moduleUrl}),!0);return e.template.externalStylesheets.forEach(function(n){var i=t._compileStyles(e,n,!1);r.push(i)}),new f(n,r)},StyleCompiler.prototype._compileStyles=function(e,t,r){for(var a=this,s=e.template.encapsulation===n.ViewEncapsulation.Emulated,u=t.styles.map(function(e){return o.a(a._shimIfNeeded(e,s))}),c=[],l=0;l<t.styleUrls.length;l++){var f=new i.a({name:getStylesVarName(null)});c.push(new p(t.styleUrls[l],s,f)),u.push(new o.R(f))}var d=getStylesVarName(r?e:null),m=o.e(d).set(o.g(u,new o.A(o.m,[o.d.Const]))).toDeclStmt(null,[o.r.Final]);return new h([m],d,c,s,t)},StyleCompiler.prototype._shimIfNeeded=function(e,t){return t?this._shadowCss.shimCssText(e,l,c):e},StyleCompiler.decorators=[{type:n.Injectable}],StyleCompiler.ctorParameters=[{type:s.a}],StyleCompiler}()},function(e,t,r){"use strict";var n=r(18),i=r(2),o=r(8);r.d(t,"a",function(){return u});var a=function(){function _DebugState(e,t){ this.nodeIndex=e,this.sourceAst=t}return _DebugState}(),s=new a(null,null),u=function(){function CompileMethod(e){this._view=e,this._newState=s,this._currState=s,this._bodyStatements=[],this._debugEnabled=this._view.genConfig.genDebugInfo}return CompileMethod.prototype._updateDebugContextIfNeeded=function(){if(this._newState.nodeIndex!==this._currState.nodeIndex||this._newState.sourceAst!==this._currState.sourceAst){var e=this._updateDebugContext(this._newState);r.i(i.a)(e)&&this._bodyStatements.push(e.toStmt())}},CompileMethod.prototype._updateDebugContext=function(e){if(this._currState=this._newState=e,this._debugEnabled){var t=r.i(i.a)(e.sourceAst)?e.sourceAst.sourceSpan.start:null;return o.n.callMethod("debug",[o.a(e.nodeIndex),r.i(i.a)(t)?o.a(t.line):o.h,r.i(i.a)(t)?o.a(t.col):o.h])}return null},CompileMethod.prototype.resetDebugInfoExpr=function(e,t){var r=this._updateDebugContext(new a(e,t));return r||o.h},CompileMethod.prototype.resetDebugInfo=function(e,t){this._newState=new a(e,t)},CompileMethod.prototype.addStmt=function(e){this._updateDebugContextIfNeeded(),this._bodyStatements.push(e)},CompileMethod.prototype.addStmts=function(e){this._updateDebugContextIfNeeded(),n.a.addAll(this._bodyStatements,e)},CompileMethod.prototype.finish=function(){return this._bodyStatements},CompileMethod.prototype.isEmpty=function(){return 0===this._bodyStatements.length},CompileMethod}()},function(e,t,r){"use strict";r.d(t,"c",function(){return n}),r.d(t,"a",function(){return i}),r.d(t,"b",function(){return o});var n=function(){function ViewFactoryDependency(e,t){this.comp=e,this.placeholder=t}return ViewFactoryDependency}(),i=function(){function ComponentFactoryDependency(e,t){this.comp=e,this.placeholder=t}return ComponentFactoryDependency}(),o=function(){function DirectiveWrapperDependency(e,t){this.dir=e,this.placeholder=t}return DirectiveWrapperDependency}()},function(e,t,r){"use strict";var n=r(3);r.d(t,"b",function(){return i}),r.d(t,"a",function(){return o});var i=function(){function AnimationPlayer(){}return Object.defineProperty(AnimationPlayer.prototype,"parentPlayer",{get:function(){throw new Error("NOT IMPLEMENTED: Base Class")},set:function(e){throw new Error("NOT IMPLEMENTED: Base Class")},enumerable:!0,configurable:!0}),AnimationPlayer}(),o=function(){function NoOpAnimationPlayer(){var e=this;this._onDoneFns=[],this._onStartFns=[],this._started=!1,this.parentPlayer=null,r.i(n.l)(function(){return e._onFinish()})}return NoOpAnimationPlayer.prototype._onFinish=function(){this._onDoneFns.forEach(function(e){return e()}),this._onDoneFns=[]},NoOpAnimationPlayer.prototype.onStart=function(e){this._onStartFns.push(e)},NoOpAnimationPlayer.prototype.onDone=function(e){this._onDoneFns.push(e)},NoOpAnimationPlayer.prototype.hasStarted=function(){return this._started},NoOpAnimationPlayer.prototype.init=function(){},NoOpAnimationPlayer.prototype.play=function(){this.hasStarted()||(this._onStartFns.forEach(function(e){return e()}),this._onStartFns=[]),this._started=!0},NoOpAnimationPlayer.prototype.pause=function(){},NoOpAnimationPlayer.prototype.restart=function(){},NoOpAnimationPlayer.prototype.finish=function(){this._onFinish()},NoOpAnimationPlayer.prototype.destroy=function(){},NoOpAnimationPlayer.prototype.reset=function(){},NoOpAnimationPlayer.prototype.setPosition=function(e){},NoOpAnimationPlayer.prototype.getPosition=function(){return 0},NoOpAnimationPlayer}()},function(e,t,r){"use strict";var n=r(194),i=r(33);r.d(t,"b",function(){return o}),r.d(t,"a",function(){return a});var o=new i.a("Application Initializer"),a=function(){function ApplicationInitStatus(e){var t=this;this._done=!1;var i=[];if(e)for(var o=0;o<e.length;o++){var a=e[o]();r.i(n.a)(a)&&i.push(a)}this._donePromise=Promise.all(i).then(function(){t._done=!0}),0===i.length&&(this._done=!0)}return Object.defineProperty(ApplicationInitStatus.prototype,"done",{get:function(){return this._done},enumerable:!0,configurable:!0}),Object.defineProperty(ApplicationInitStatus.prototype,"donePromise",{get:function(){return this._donePromise},enumerable:!0,configurable:!0}),ApplicationInitStatus.decorators=[{type:i.b}],ApplicationInitStatus.ctorParameters=[{type:Array,decorators:[{type:i.c,args:[o]},{type:i.d}]}],ApplicationInitStatus}()},function(e,t,r){"use strict";function enableProdMode(){if(w)throw new Error("Cannot enable prod mode after platform setup.");b=!1}function isDevMode(){return w=!0,b}function createPlatform(e){if(g&&!g.destroyed)throw new Error("There can be only one platform. Destroy the previous one to create a new one.");g=e.get(C);var t=e.get(c.b,null);return t&&t.forEach(function(e){return e()}),g}function createPlatformFactory(e,t,r){void 0===r&&(r=[]);var n=new p.a("Platform: "+t);return function(t){return void 0===t&&(t=[]),getPlatform()||(e?e(r.concat(t).concat({provide:n,useValue:!0})):createPlatform(p.f.resolveAndCreate(r.concat(t).concat({provide:n,useValue:!0})))),assertPlatform(n)}}function assertPlatform(e){var t=getPlatform();if(!t)throw new Error("No platform exists!");if(!t.injector.get(e,null))throw new Error("A platform with a different configuration has been created. Please destroy it first.");return t}function destroyPlatform(){g&&!g.destroyed&&g.destroy()}function getPlatform(){return g&&!g.destroyed?g:null}function _callAndReportToErrorHandler(e,t){try{var n=t();return r.i(s.a)(n)?n.catch(function(t){throw e.handleError(t),t}):n}catch(t){throw e.handleError(t),t}}var n=r(294),i=r(19),o=r(29),a=r(3),s=r(194),u=r(179),c=r(124),l=r(182),p=r(33),f=r(93),h=r(296),d=r(130),m=r(133),v=r(192),y=r(195);t.k=enableProdMode,t.f=isDevMode,t.j=createPlatform,t.c=createPlatformFactory,t.g=assertPlatform,t.h=destroyPlatform,t.i=getPlatform,r.d(t,"b",function(){return C}),r.d(t,"a",function(){return E}),r.d(t,"e",function(){return S}),r.d(t,"d",function(){return A});var g,_=this&&this.__extends||function(e,t){function __(){this.constructor=e}for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r]);e.prototype=null===t?Object.create(t):(__.prototype=t.prototype,new __)},b=!0,w=!1,C=function(){function PlatformRef(){}return PlatformRef.prototype.bootstrapModuleFactory=function(e){throw r.i(o.a)()},PlatformRef.prototype.bootstrapModule=function(e,t){throw void 0===t&&(t=[]),r.i(o.a)()},Object.defineProperty(PlatformRef.prototype,"injector",{get:function(){throw r.i(o.a)()},enumerable:!0,configurable:!0}),Object.defineProperty(PlatformRef.prototype,"destroyed",{get:function(){throw r.i(o.a)()},enumerable:!0,configurable:!0}),PlatformRef}(),E=function(e){function PlatformRef_(t){e.call(this),this._injector=t,this._modules=[],this._destroyListeners=[],this._destroyed=!1}return _(PlatformRef_,e),PlatformRef_.prototype.onDestroy=function(e){this._destroyListeners.push(e)},Object.defineProperty(PlatformRef_.prototype,"injector",{get:function(){return this._injector},enumerable:!0,configurable:!0}),Object.defineProperty(PlatformRef_.prototype,"destroyed",{get:function(){return this._destroyed},enumerable:!0,configurable:!0}),PlatformRef_.prototype.destroy=function(){if(this._destroyed)throw new Error("The platform has already been destroyed!");this._modules.slice().forEach(function(e){return e.destroy()}),this._destroyListeners.forEach(function(e){return e()}),this._destroyed=!0},PlatformRef_.prototype.bootstrapModuleFactory=function(e){return this._bootstrapModuleFactoryWithZone(e,null)},PlatformRef_.prototype._bootstrapModuleFactoryWithZone=function(e,t){var r=this;return t||(t=new y.a({enableLongStackTrace:isDevMode()})),t.run(function(){var o=p.f.resolveAndCreate([{provide:y.a,useValue:t}],r.injector),a=e.create(o),s=a.injector.get(n.a,null);if(!s)throw new Error("No ErrorHandler. Is platform module (BrowserModule) included?");return a.onDestroy(function(){return i.a.remove(r._modules,a)}),t.onError.subscribe({next:function(e){s.handleError(e)}}),_callAndReportToErrorHandler(s,function(){var e=a.injector.get(u.a);return e.donePromise.then(function(){return r._moduleDoBootstrap(a),a})})})},PlatformRef_.prototype.bootstrapModule=function(e,t){return void 0===t&&(t=[]),this._bootstrapModuleWithZone(e,t,null)},PlatformRef_.prototype._bootstrapModuleWithZone=function(e,t,r,n){var i=this;void 0===t&&(t=[]);var o=this.injector.get(f.a),a=o.createCompiler(Array.isArray(t)?t:[t]);return n?a.compileModuleAndAllComponentsAsync(e).then(function(e){var t=e.ngModuleFactory,o=e.componentFactories;return n(o),i._bootstrapModuleFactoryWithZone(t,r)}):a.compileModuleAsync(e).then(function(e){return i._bootstrapModuleFactoryWithZone(e,r)})},PlatformRef_.prototype._moduleDoBootstrap=function(e){var t=e.injector.get(S);if(e.bootstrapFactories.length>0)e.bootstrapFactories.forEach(function(e){return t.bootstrap(e)});else{if(!e.instance.ngDoBootstrap)throw new Error("The module "+r.i(a.b)(e.instance.constructor)+' was bootstrapped, but it does not declare "@NgModule.bootstrap" components nor a "ngDoBootstrap" method. Please define one of these.');e.instance.ngDoBootstrap(t)}},PlatformRef_.decorators=[{type:p.b}],PlatformRef_.ctorParameters=[{type:p.g}],PlatformRef_}(C),S=function(){function ApplicationRef(){}return Object.defineProperty(ApplicationRef.prototype,"componentTypes",{get:function(){return r.i(o.a)()},enumerable:!0,configurable:!0}),Object.defineProperty(ApplicationRef.prototype,"components",{get:function(){return r.i(o.a)()},enumerable:!0,configurable:!0}),ApplicationRef}(),A=function(e){function ApplicationRef_(t,r,n,i,o,a,s,u){var c=this;e.call(this),this._zone=t,this._console=r,this._injector=n,this._exceptionHandler=i,this._componentFactoryResolver=o,this._initStatus=a,this._testabilityRegistry=s,this._testability=u,this._bootstrapListeners=[],this._rootComponents=[],this._rootComponentTypes=[],this._changeDetectorRefs=[],this._runningTick=!1,this._enforceNoNewChanges=!1,this._enforceNoNewChanges=isDevMode(),this._zone.onMicrotaskEmpty.subscribe({next:function(){c._zone.run(function(){c.tick()})}})}return _(ApplicationRef_,e),ApplicationRef_.prototype.registerChangeDetector=function(e){this._changeDetectorRefs.push(e)},ApplicationRef_.prototype.unregisterChangeDetector=function(e){i.a.remove(this._changeDetectorRefs,e)},ApplicationRef_.prototype.bootstrap=function(e){var t=this;if(!this._initStatus.done)throw new Error("Cannot bootstrap as there are still asynchronous initializers running. Bootstrap components in the `ngDoBootstrap` method of the root module.");var r;r=e instanceof h.a?e:this._componentFactoryResolver.resolveComponentFactory(e),this._rootComponentTypes.push(r.componentType);var n=r.create(this._injector,[],r.selector);n.onDestroy(function(){t._unloadComponent(n)});var i=n.injector.get(v.a,null);return i&&n.injector.get(v.b).registerApplication(n.location.nativeElement,i),this._loadComponent(n),isDevMode()&&this._console.log("Angular 2 is running in the development mode. Call enableProdMode() to enable the production mode."),n},ApplicationRef_.prototype._loadComponent=function(e){this._changeDetectorRefs.push(e.changeDetectorRef),this.tick(),this._rootComponents.push(e);var t=this._injector.get(c.c,[]).concat(this._bootstrapListeners);t.forEach(function(t){return t(e)})},ApplicationRef_.prototype._unloadComponent=function(e){this._rootComponents.indexOf(e)!=-1&&(this.unregisterChangeDetector(e.changeDetectorRef),i.a.remove(this._rootComponents,e))},ApplicationRef_.prototype.tick=function(){if(this._runningTick)throw new Error("ApplicationRef.tick is called recursively");var e=ApplicationRef_._tickScope();try{this._runningTick=!0,this._changeDetectorRefs.forEach(function(e){return e.detectChanges()}),this._enforceNoNewChanges&&this._changeDetectorRefs.forEach(function(e){return e.checkNoChanges()})}finally{this._runningTick=!1,r.i(m.b)(e)}},ApplicationRef_.prototype.ngOnDestroy=function(){this._rootComponents.slice().forEach(function(e){return e.destroy()})},Object.defineProperty(ApplicationRef_.prototype,"componentTypes",{get:function(){return this._rootComponentTypes},enumerable:!0,configurable:!0}),Object.defineProperty(ApplicationRef_.prototype,"components",{get:function(){return this._rootComponents},enumerable:!0,configurable:!0}),ApplicationRef_._tickScope=r.i(m.a)("ApplicationRef#tick()"),ApplicationRef_.decorators=[{type:p.b}],ApplicationRef_.ctorParameters=[{type:y.a},{type:l.a},{type:p.g},{type:n.a},{type:d.a},{type:u.a},{type:v.b,decorators:[{type:p.d}]},{type:v.a,decorators:[{type:p.d}]}],ApplicationRef_}(S)},function(e,t,r){"use strict";function getPreviousIndex(e,t,r){var n=e.previousIndex;if(null===n)return n;var i=0;return r&&n<r.length&&(i=r[n]),n+t+i}var n=r(19),i=r(3);r.d(t,"a",function(){return o}),r.d(t,"c",function(){return s}),r.d(t,"b",function(){return u});var o=function(){function DefaultIterableDifferFactory(){}return DefaultIterableDifferFactory.prototype.supports=function(e){return r.i(n.c)(e)},DefaultIterableDifferFactory.prototype.create=function(e,t){return new s(t)},DefaultIterableDifferFactory}(),a=function(e,t){return t},s=function(){function DefaultIterableDiffer(e){this._trackByFn=e,this._length=null,this._collection=null,this._linkedRecords=null,this._unlinkedRecords=null,this._previousItHead=null,this._itHead=null,this._itTail=null,this._additionsHead=null,this._additionsTail=null,this._movesHead=null,this._movesTail=null,this._removalsHead=null,this._removalsTail=null,this._identityChangesHead=null,this._identityChangesTail=null,this._trackByFn=this._trackByFn||a}return Object.defineProperty(DefaultIterableDiffer.prototype,"collection",{get:function(){return this._collection},enumerable:!0,configurable:!0}),Object.defineProperty(DefaultIterableDiffer.prototype,"length",{get:function(){return this._length},enumerable:!0,configurable:!0}),DefaultIterableDiffer.prototype.forEachItem=function(e){var t;for(t=this._itHead;null!==t;t=t._next)e(t)},DefaultIterableDiffer.prototype.forEachOperation=function(e){for(var t=this._itHead,r=this._removalsHead,n=0,i=null;t||r;){var o=!r||t&&t.currentIndex<getPreviousIndex(r,n,i)?t:r,a=getPreviousIndex(o,n,i),s=o.currentIndex;if(o===r)n--,r=r._nextRemoved;else if(t=t._next,null==o.previousIndex)n++;else{i||(i=[]);var u=a-n,c=s-n;if(u!=c){for(var l=0;l<u;l++){var p=l<i.length?i[l]:i[l]=0,f=p+l;c<=f&&f<u&&(i[l]=p+1)}var h=o.previousIndex;i[h]=c-u}}a!==s&&e(o,a,s)}},DefaultIterableDiffer.prototype.forEachPreviousItem=function(e){var t;for(t=this._previousItHead;null!==t;t=t._nextPrevious)e(t)},DefaultIterableDiffer.prototype.forEachAddedItem=function(e){var t;for(t=this._additionsHead;null!==t;t=t._nextAdded)e(t)},DefaultIterableDiffer.prototype.forEachMovedItem=function(e){var t;for(t=this._movesHead;null!==t;t=t._nextMoved)e(t)},DefaultIterableDiffer.prototype.forEachRemovedItem=function(e){var t;for(t=this._removalsHead;null!==t;t=t._nextRemoved)e(t)},DefaultIterableDiffer.prototype.forEachIdentityChange=function(e){var t;for(t=this._identityChangesHead;null!==t;t=t._nextIdentityChange)e(t)},DefaultIterableDiffer.prototype.diff=function(e){if(r.i(i.c)(e)&&(e=[]),!r.i(n.c)(e))throw new Error("Error trying to diff '"+e+"'");return this.check(e)?this:null},DefaultIterableDiffer.prototype.onDestroy=function(){},DefaultIterableDiffer.prototype.check=function(e){var t=this;this._reset();var o,a,s,u=this._itHead,c=!1;if(Array.isArray(e)){var l=e;this._length=e.length;for(var p=0;p<this._length;p++)a=l[p],s=this._trackByFn(p,a),null!==u&&r.i(i.i)(u.trackById,s)?(c&&(u=this._verifyReinsertion(u,a,s,p)),r.i(i.i)(u.item,a)||this._addIdentityChange(u,a)):(u=this._mismatch(u,a,s,p),c=!0),u=u._next}else o=0,r.i(n.d)(e,function(e){s=t._trackByFn(o,e),null!==u&&r.i(i.i)(u.trackById,s)?(c&&(u=t._verifyReinsertion(u,e,s,o)),r.i(i.i)(u.item,e)||t._addIdentityChange(u,e)):(u=t._mismatch(u,e,s,o),c=!0),u=u._next,o++}),this._length=o;return this._truncate(u),this._collection=e,this.isDirty},Object.defineProperty(DefaultIterableDiffer.prototype,"isDirty",{get:function(){return null!==this._additionsHead||null!==this._movesHead||null!==this._removalsHead||null!==this._identityChangesHead},enumerable:!0,configurable:!0}),DefaultIterableDiffer.prototype._reset=function(){if(this.isDirty){var e,t;for(e=this._previousItHead=this._itHead;null!==e;e=e._next)e._nextPrevious=e._next;for(e=this._additionsHead;null!==e;e=e._nextAdded)e.previousIndex=e.currentIndex;for(this._additionsHead=this._additionsTail=null,e=this._movesHead;null!==e;e=t)e.previousIndex=e.currentIndex,t=e._nextMoved;this._movesHead=this._movesTail=null,this._removalsHead=this._removalsTail=null,this._identityChangesHead=this._identityChangesTail=null}},DefaultIterableDiffer.prototype._mismatch=function(e,t,n,o){var a;return null===e?a=this._itTail:(a=e._prev,this._remove(e)),e=null===this._linkedRecords?null:this._linkedRecords.get(n,o),null!==e?(r.i(i.i)(e.item,t)||this._addIdentityChange(e,t),this._moveAfter(e,a,o)):(e=null===this._unlinkedRecords?null:this._unlinkedRecords.get(n),null!==e?(r.i(i.i)(e.item,t)||this._addIdentityChange(e,t),this._reinsertAfter(e,a,o)):e=this._addAfter(new u(t,n),a,o)),e},DefaultIterableDiffer.prototype._verifyReinsertion=function(e,t,r,n){var i=null===this._unlinkedRecords?null:this._unlinkedRecords.get(r);return null!==i?e=this._reinsertAfter(i,e._prev,n):e.currentIndex!=n&&(e.currentIndex=n,this._addToMoves(e,n)),e},DefaultIterableDiffer.prototype._truncate=function(e){for(;null!==e;){var t=e._next;this._addToRemovals(this._unlink(e)),e=t}null!==this._unlinkedRecords&&this._unlinkedRecords.clear(),null!==this._additionsTail&&(this._additionsTail._nextAdded=null),null!==this._movesTail&&(this._movesTail._nextMoved=null),null!==this._itTail&&(this._itTail._next=null),null!==this._removalsTail&&(this._removalsTail._nextRemoved=null),null!==this._identityChangesTail&&(this._identityChangesTail._nextIdentityChange=null)},DefaultIterableDiffer.prototype._reinsertAfter=function(e,t,r){null!==this._unlinkedRecords&&this._unlinkedRecords.remove(e);var n=e._prevRemoved,i=e._nextRemoved;return null===n?this._removalsHead=i:n._nextRemoved=i,null===i?this._removalsTail=n:i._prevRemoved=n,this._insertAfter(e,t,r),this._addToMoves(e,r),e},DefaultIterableDiffer.prototype._moveAfter=function(e,t,r){return this._unlink(e),this._insertAfter(e,t,r),this._addToMoves(e,r),e},DefaultIterableDiffer.prototype._addAfter=function(e,t,r){return this._insertAfter(e,t,r),null===this._additionsTail?this._additionsTail=this._additionsHead=e:this._additionsTail=this._additionsTail._nextAdded=e,e},DefaultIterableDiffer.prototype._insertAfter=function(e,t,r){var n=null===t?this._itHead:t._next;return e._next=n,e._prev=t,null===n?this._itTail=e:n._prev=e,null===t?this._itHead=e:t._next=e,null===this._linkedRecords&&(this._linkedRecords=new l),this._linkedRecords.put(e),e.currentIndex=r,e},DefaultIterableDiffer.prototype._remove=function(e){return this._addToRemovals(this._unlink(e))},DefaultIterableDiffer.prototype._unlink=function(e){null!==this._linkedRecords&&this._linkedRecords.remove(e);var t=e._prev,r=e._next;return null===t?this._itHead=r:t._next=r,null===r?this._itTail=t:r._prev=t,e},DefaultIterableDiffer.prototype._addToMoves=function(e,t){return e.previousIndex===t?e:(null===this._movesTail?this._movesTail=this._movesHead=e:this._movesTail=this._movesTail._nextMoved=e,e)},DefaultIterableDiffer.prototype._addToRemovals=function(e){return null===this._unlinkedRecords&&(this._unlinkedRecords=new l),this._unlinkedRecords.put(e),e.currentIndex=null,e._nextRemoved=null,null===this._removalsTail?(this._removalsTail=this._removalsHead=e,e._prevRemoved=null):(e._prevRemoved=this._removalsTail,this._removalsTail=this._removalsTail._nextRemoved=e),e},DefaultIterableDiffer.prototype._addIdentityChange=function(e,t){return e.item=t,null===this._identityChangesTail?this._identityChangesTail=this._identityChangesHead=e:this._identityChangesTail=this._identityChangesTail._nextIdentityChange=e,e},DefaultIterableDiffer.prototype.toString=function(){var e=[];this.forEachItem(function(t){return e.push(t)});var t=[];this.forEachPreviousItem(function(e){return t.push(e)});var r=[];this.forEachAddedItem(function(e){return r.push(e)});var n=[];this.forEachMovedItem(function(e){return n.push(e)});var i=[];this.forEachRemovedItem(function(e){return i.push(e)});var o=[];return this.forEachIdentityChange(function(e){return o.push(e)}),"collection: "+e.join(", ")+"\nprevious: "+t.join(", ")+"\nadditions: "+r.join(", ")+"\nmoves: "+n.join(", ")+"\nremovals: "+i.join(", ")+"\nidentityChanges: "+o.join(", ")+"\n"},DefaultIterableDiffer}(),u=function(){function CollectionChangeRecord(e,t){this.item=e,this.trackById=t,this.currentIndex=null,this.previousIndex=null,this._nextPrevious=null,this._prev=null,this._next=null,this._prevDup=null,this._nextDup=null,this._prevRemoved=null,this._nextRemoved=null,this._nextAdded=null,this._nextMoved=null,this._nextIdentityChange=null}return CollectionChangeRecord.prototype.toString=function(){return this.previousIndex===this.currentIndex?r.i(i.b)(this.item):r.i(i.b)(this.item)+"["+r.i(i.b)(this.previousIndex)+"->"+r.i(i.b)(this.currentIndex)+"]"},CollectionChangeRecord}(),c=function(){function _DuplicateItemRecordList(){this._head=null,this._tail=null}return _DuplicateItemRecordList.prototype.add=function(e){null===this._head?(this._head=this._tail=e,e._nextDup=null,e._prevDup=null):(this._tail._nextDup=e,e._prevDup=this._tail,e._nextDup=null,this._tail=e)},_DuplicateItemRecordList.prototype.get=function(e,t){var n;for(n=this._head;null!==n;n=n._nextDup)if((null===t||t<n.currentIndex)&&r.i(i.i)(n.trackById,e))return n;return null},_DuplicateItemRecordList.prototype.remove=function(e){var t=e._prevDup,r=e._nextDup;return null===t?this._head=r:t._nextDup=r,null===r?this._tail=t:r._prevDup=t,null===this._head},_DuplicateItemRecordList}(),l=function(){function _DuplicateMap(){this.map=new Map}return _DuplicateMap.prototype.put=function(e){var t=e.trackById,r=this.map.get(t);r||(r=new c,this.map.set(t,r)),r.add(e)},_DuplicateMap.prototype.get=function(e,t){void 0===t&&(t=null);var r=e,n=this.map.get(r);return n?n.get(e,t):null},_DuplicateMap.prototype.remove=function(e){var t=e.trackById,r=this.map.get(t);return r.remove(e)&&this.map.delete(t),e},Object.defineProperty(_DuplicateMap.prototype,"isEmpty",{get:function(){return 0===this.map.size},enumerable:!0,configurable:!0}),_DuplicateMap.prototype.clear=function(){this.map.clear()},_DuplicateMap.prototype.toString=function(){return"_DuplicateMap("+r.i(i.b)(this.map)+")"},_DuplicateMap}()},function(e,t,r){"use strict";var n=r(33),i=r(3);r.d(t,"a",function(){return o});var o=function(){function Console(){}return Console.prototype.log=function(e){r.i(i.g)(e)},Console.prototype.warn=function(e){r.i(i.h)(e)},Console.decorators=[{type:n.b}],Console.ctorParameters=[],Console}()},function(e,t,r){"use strict";function forwardRef(e){return e.__forward_ref__=forwardRef,e.toString=function(){return r.i(n.b)(this())},e}function resolveForwardRef(e){return"function"==typeof e&&e.hasOwnProperty("__forward_ref__")&&e.__forward_ref__===forwardRef?e():e}var n=r(3);t.b=forwardRef,t.a=resolveForwardRef},function(e,t,r){"use strict";var n=r(129);r.d(t,"a",function(){return i});var i=function(){function OpaqueToken(e){this._desc=e}return OpaqueToken.prototype.toString=function(){return"Token "+this._desc},OpaqueToken.decorators=[{type:n.a}],OpaqueToken.ctorParameters=[null],OpaqueToken}()},function(e,t,r){"use strict";var n=r(3),i=r(183);r.d(t,"a",function(){return o});var o=function(){function ReflectiveKey(e,t){if(this.token=e,this.id=t,!e)throw new Error("Token must be defined!")}return Object.defineProperty(ReflectiveKey.prototype,"displayName",{get:function(){return r.i(n.b)(this.token)},enumerable:!0,configurable:!0}),ReflectiveKey.get=function(e){return s.get(r.i(i.a)(e))},Object.defineProperty(ReflectiveKey,"numberOfKeys",{get:function(){return s.numberOfKeys},enumerable:!0,configurable:!0}),ReflectiveKey}(),a=function(){function KeyRegistry(){this._allKeys=new Map}return KeyRegistry.prototype.get=function(e){if(e instanceof o)return e;if(this._allKeys.has(e))return this._allKeys.get(e);var t=new o(e,o.numberOfKeys);return this._allKeys.set(e,t),t},Object.defineProperty(KeyRegistry.prototype,"numberOfKeys",{get:function(){return this._allKeys.size},enumerable:!0,configurable:!0}),KeyRegistry}(),s=new a},function(e,t,r){"use strict";function resolveReflectiveFactory(e){var t,n;if(r.i(i.d)(e.useClass)){var a=r.i(s.a)(e.useClass);t=o.a.factory(a),n=_dependenciesFor(a)}else r.i(i.d)(e.useExisting)?(t=function(e){return e},n=[p.fromKey(l.a.get(e.useExisting))]):r.i(i.d)(e.useFactory)?(t=e.useFactory,n=constructDependencies(e.useFactory,e.deps)):(t=function(){return e.useValue},n=f);return new d(t,n)}function resolveReflectiveProvider(e){return new h(l.a.get(e.provide),[resolveReflectiveFactory(e)],e.multi)}function resolveReflectiveProviders(e){var t=_normalizeProviders(e,[]),r=t.map(resolveReflectiveProvider);return n.b.values(mergeResolvedReflectiveProviders(r,new Map))}function mergeResolvedReflectiveProviders(e,t){for(var o=0;o<e.length;o++){var a=e[o],s=t.get(a.key.id);if(r.i(i.d)(s)){if(a.multiProvider!==s.multiProvider)throw new c.a(s,a);if(a.multiProvider)for(var u=0;u<a.resolvedFactories.length;u++)s.resolvedFactories.push(a.resolvedFactories[u]);else t.set(a.key.id,a)}else{var l;l=a.multiProvider?new h(a.key,n.a.clone(a.resolvedFactories),a.multiProvider):a,t.set(a.key.id,l)}}return t}function _normalizeProviders(e,t){return e.forEach(function(e){if(e instanceof a.a)t.push({provide:e,useClass:e});else if(e&&"object"==typeof e&&void 0!==e.provide)t.push(e);else{if(!(e instanceof Array))throw new c.b(e);_normalizeProviders(e,t)}}),t}function constructDependencies(e,t){if(t){var r=t.map(function(e){return[e]});return t.map(function(t){return _extractToken(e,t,r)})}return _dependenciesFor(e)}function _dependenciesFor(e){var t=o.a.parameters(e);if(!t)return[];if(t.some(i.c))throw new c.c(e,t);return t.map(function(r){return _extractToken(e,r,t)})}function _extractToken(e,t,n){var o=[],l=null,p=!1;if(!Array.isArray(t))return t instanceof u.b?_createDependency(t.token,p,null,null,o):_createDependency(t,p,null,null,o);for(var f=null,h=null,d=0;d<t.length;++d){var m=t[d];m instanceof a.a?l=m:m instanceof u.b?l=m.token:m instanceof u.c?p=!0:m instanceof u.d?h=m:m instanceof u.e?h=m:m instanceof u.f&&(f=m)}if(l=r.i(s.a)(l),r.i(i.d)(l))return _createDependency(l,p,f,h,o);throw new c.c(e,n)}function _createDependency(e,t,r,n,i){return new p(l.a.get(e),t,r,n,i)}var n=r(19),i=r(3),o=r(189),a=r(193),s=r(183),u=r(129),c=r(293),l=r(185);r.d(t,"c",function(){return d}),t.a=resolveReflectiveProviders,t.b=constructDependencies;var p=function(){function ReflectiveDependency(e,t,r,n,i){this.key=e,this.optional=t,this.lowerBoundVisibility=r,this.upperBoundVisibility=n,this.properties=i}return ReflectiveDependency.fromKey=function(e){return new ReflectiveDependency(e,!1,null,null,[])},ReflectiveDependency}(),f=[],h=function(){function ResolvedReflectiveProvider_(e,t,r){this.key=e,this.resolvedFactories=t,this.multiProvider=r}return Object.defineProperty(ResolvedReflectiveProvider_.prototype,"resolvedFactory",{get:function(){return this.resolvedFactories[0]},enumerable:!0,configurable:!0}),ResolvedReflectiveProvider_}(),d=function(){function ResolvedReflectiveFactory(e,t){this.factory=e,this.dependencies=t}return ResolvedReflectiveFactory}()},function(e,t,r){"use strict";var n=r(86),i=(r.n(n),r(6));r.n(i);r.d(t,"a",function(){return a});var o=this&&this.__extends||function(e,t){function __(){this.constructor=e}for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r]);e.prototype=null===t?Object.create(t):(__.prototype=t.prototype,new __)},a=function(e){function EventEmitter(t){void 0===t&&(t=!1),e.call(this),this.__isAsync=t}return o(EventEmitter,e),EventEmitter.prototype.emit=function(t){e.prototype.next.call(this,t)},EventEmitter.prototype.subscribe=function(t,r,n){var i,o=function(e){return null},a=function(){return null};return t&&"object"==typeof t?(i=this.__isAsync?function(e){setTimeout(function(){return t.next(e)})}:function(e){t.next(e)},t.error&&(o=this.__isAsync?function(e){setTimeout(function(){return t.error(e)})}:function(e){t.error(e)}),t.complete&&(a=this.__isAsync?function(){setTimeout(function(){return t.complete()})}:function(){t.complete()})):(i=this.__isAsync?function(e){setTimeout(function(){return t(e)})}:function(e){t(e)},r&&(o=this.__isAsync?function(e){setTimeout(function(){return r(e)})}:function(e){r(e)}),n&&(a=this.__isAsync?function(){setTimeout(function(){return n()})}:function(){n()})),e.prototype.subscribe.call(this,i,o,a)},EventEmitter}(n.Subject)},function(e,t,r){"use strict";var n=r(19),i=r(3),o=r(298),a=r(303),s=r(131);r.d(t,"a",function(){return u});var u=function(){function AppElement(e,t,r,n){this.index=e,this.parentIndex=t,this.parentView=r,this.nativeElement=n,this.nestedViews=null,this.componentView=null}return Object.defineProperty(AppElement.prototype,"elementRef",{get:function(){return new o.a(this.nativeElement)},enumerable:!0,configurable:!0}),Object.defineProperty(AppElement.prototype,"vcRef",{get:function(){return new a.a(this)},enumerable:!0,configurable:!0}),AppElement.prototype.initComponent=function(e,t,r){this.component=e,this.componentConstructorViewQueries=t,this.componentView=r},Object.defineProperty(AppElement.prototype,"parentInjector",{get:function(){return this.parentView.injector(this.parentIndex)},enumerable:!0,configurable:!0}),Object.defineProperty(AppElement.prototype,"injector",{get:function(){return this.parentView.injector(this.index)},enumerable:!0,configurable:!0}),AppElement.prototype.mapNestedViews=function(e,t){var n=[];return r.i(i.d)(this.nestedViews)&&this.nestedViews.forEach(function(r){r.clazz===e&&n.push(t(r))}),n},AppElement.prototype.moveView=function(e,t){var o=this.nestedViews.indexOf(e);if(e.type===s.a.COMPONENT)throw new Error("Component views can't be moved!");var a=this.nestedViews;null==a&&(a=[],this.nestedViews=a),n.a.removeAt(a,o),n.a.insert(a,t,e);var u;if(t>0){var c=a[t-1];u=c.lastRootNode}else u=this.nativeElement;r.i(i.d)(u)&&e.renderer.attachViewAfter(u,e.flatRootNodes),e.markContentChildAsMoved(this)},AppElement.prototype.attachView=function(e,t){if(e.type===s.a.COMPONENT)throw new Error("Component views can't be moved!");var o=this.nestedViews;null==o&&(o=[],this.nestedViews=o),n.a.insert(o,t,e);var a;if(t>0){var u=o[t-1];a=u.lastRootNode}else a=this.nativeElement;r.i(i.d)(a)&&e.renderer.attachViewAfter(a,e.flatRootNodes),e.addToContentChildren(this)},AppElement.prototype.detachView=function(e){var t=n.a.removeAt(this.nestedViews,e);if(t.type===s.a.COMPONENT)throw new Error("Component views can't be moved!");return t.detach(),t.removeFromContentChildren(this),t},AppElement}()},function(e,t,r){"use strict";var n=r(308),i=r(309);r.d(t,"a",function(){return o}),r.d(t,"b",function(){return i.a});var o=new i.a(new n.a)},function(e,t,r){"use strict";r.d(t,"a",function(){return n});var n=function(){function ReflectorReader(){}return ReflectorReader}()},function(e,t,r){"use strict";var n=r(29);r.d(t,"a",function(){return i}),r.d(t,"c",function(){return o}),r.d(t,"d",function(){return a}),r.d(t,"b",function(){return s});var i=function(){function RenderComponentType(e,t,r,n,i,o){this.id=e,this.templateUrl=t,this.slotCount=r,this.encapsulation=n,this.styles=i,this.animations=o}return RenderComponentType}(),o=function(){function RenderDebugInfo(){}return Object.defineProperty(RenderDebugInfo.prototype,"injector",{get:function(){return r.i(n.a)()},enumerable:!0,configurable:!0}),Object.defineProperty(RenderDebugInfo.prototype,"component",{get:function(){return r.i(n.a)()},enumerable:!0,configurable:!0}),Object.defineProperty(RenderDebugInfo.prototype,"providerTokens",{get:function(){return r.i(n.a)()},enumerable:!0,configurable:!0}),Object.defineProperty(RenderDebugInfo.prototype,"references",{get:function(){return r.i(n.a)()},enumerable:!0,configurable:!0}),Object.defineProperty(RenderDebugInfo.prototype,"context",{ get:function(){return r.i(n.a)()},enumerable:!0,configurable:!0}),Object.defineProperty(RenderDebugInfo.prototype,"source",{get:function(){return r.i(n.a)()},enumerable:!0,configurable:!0}),RenderDebugInfo}(),a=function(){function Renderer(){}return Renderer}(),s=function(){function RootRenderer(){}return RootRenderer}()},function(e,t,r){"use strict";function setTestabilityGetter(e){l=e}var n=r(33),i=r(19),o=r(3),a=r(195);r.d(t,"a",function(){return s}),r.d(t,"b",function(){return u}),t.c=setTestabilityGetter;var s=function(){function Testability(e){this._ngZone=e,this._pendingCount=0,this._isZoneStable=!0,this._didWork=!1,this._callbacks=[],this._watchAngularEvents()}return Testability.prototype._watchAngularEvents=function(){var e=this;this._ngZone.onUnstable.subscribe({next:function(){e._didWork=!0,e._isZoneStable=!1}}),this._ngZone.runOutsideAngular(function(){e._ngZone.onStable.subscribe({next:function(){a.a.assertNotInAngularZone(),r.i(o.l)(function(){e._isZoneStable=!0,e._runCallbacksIfReady()})}})})},Testability.prototype.increasePendingRequestCount=function(){return this._pendingCount+=1,this._didWork=!0,this._pendingCount},Testability.prototype.decreasePendingRequestCount=function(){if(this._pendingCount-=1,this._pendingCount<0)throw new Error("pending async requests below zero");return this._runCallbacksIfReady(),this._pendingCount},Testability.prototype.isStable=function(){return this._isZoneStable&&0==this._pendingCount&&!this._ngZone.hasPendingMacrotasks},Testability.prototype._runCallbacksIfReady=function(){var e=this;this.isStable()?r.i(o.l)(function(){for(;0!==e._callbacks.length;)e._callbacks.pop()(e._didWork);e._didWork=!1}):this._didWork=!0},Testability.prototype.whenStable=function(e){this._callbacks.push(e),this._runCallbacksIfReady()},Testability.prototype.getPendingRequestCount=function(){return this._pendingCount},Testability.prototype.findBindings=function(e,t,r){return[]},Testability.prototype.findProviders=function(e,t,r){return[]},Testability.decorators=[{type:n.b}],Testability.ctorParameters=[{type:a.a}],Testability}(),u=function(){function TestabilityRegistry(){this._applications=new Map,l.addToWindow(this)}return TestabilityRegistry.prototype.registerApplication=function(e,t){this._applications.set(e,t)},TestabilityRegistry.prototype.getTestability=function(e){return this._applications.get(e)},TestabilityRegistry.prototype.getAllTestabilities=function(){return i.b.values(this._applications)},TestabilityRegistry.prototype.getAllRootElements=function(){return i.b.keys(this._applications)},TestabilityRegistry.prototype.findTestabilityInTree=function(e,t){return void 0===t&&(t=!0),l.findTestabilityInTree(this,e,t)},TestabilityRegistry.decorators=[{type:n.b}],TestabilityRegistry.ctorParameters=[],TestabilityRegistry}(),c=function(){function _NoopGetTestability(){}return _NoopGetTestability.prototype.addToWindow=function(e){},_NoopGetTestability.prototype.findTestabilityInTree=function(e,t,r){return null},_NoopGetTestability}(),l=new c},function(e,t,r){"use strict";r.d(t,"a",function(){return n});var n=Function},function(e,t,r){"use strict";function isPromise(e){return!!e&&"function"==typeof e.then}t.a=isPromise},function(e,t,r){"use strict";var n=r(187);r.d(t,"a",function(){return i});var i=function(){function NgZone(e){var t=e.enableLongStackTrace,r=void 0!==t&&t;if(this._hasPendingMicrotasks=!1,this._hasPendingMacrotasks=!1,this._isStable=!0,this._nesting=0,this._onUnstable=new n.a(!1),this._onMicrotaskEmpty=new n.a(!1),this._onStable=new n.a(!1),this._onErrorEvents=new n.a(!1),"undefined"==typeof Zone)throw new Error("Angular requires Zone.js prolyfill.");Zone.assertZonePatched(),this.outer=this.inner=Zone.current,Zone.wtfZoneSpec&&(this.inner=this.inner.fork(Zone.wtfZoneSpec)),r&&Zone.longStackTraceZoneSpec&&(this.inner=this.inner.fork(Zone.longStackTraceZoneSpec)),this.forkInnerZoneWithAngularBehavior()}return NgZone.isInAngularZone=function(){return Zone.current.get("isAngularZone")===!0},NgZone.assertInAngularZone=function(){if(!NgZone.isInAngularZone())throw new Error("Expected to be in Angular Zone, but it is not!")},NgZone.assertNotInAngularZone=function(){if(NgZone.isInAngularZone())throw new Error("Expected to not be in Angular Zone, but it is!")},NgZone.prototype.run=function(e){return this.inner.run(e)},NgZone.prototype.runGuarded=function(e){return this.inner.runGuarded(e)},NgZone.prototype.runOutsideAngular=function(e){return this.outer.run(e)},Object.defineProperty(NgZone.prototype,"onUnstable",{get:function(){return this._onUnstable},enumerable:!0,configurable:!0}),Object.defineProperty(NgZone.prototype,"onMicrotaskEmpty",{get:function(){return this._onMicrotaskEmpty},enumerable:!0,configurable:!0}),Object.defineProperty(NgZone.prototype,"onStable",{get:function(){return this._onStable},enumerable:!0,configurable:!0}),Object.defineProperty(NgZone.prototype,"onError",{get:function(){return this._onErrorEvents},enumerable:!0,configurable:!0}),Object.defineProperty(NgZone.prototype,"isStable",{get:function(){return this._isStable},enumerable:!0,configurable:!0}),Object.defineProperty(NgZone.prototype,"hasPendingMicrotasks",{get:function(){return this._hasPendingMicrotasks},enumerable:!0,configurable:!0}),Object.defineProperty(NgZone.prototype,"hasPendingMacrotasks",{get:function(){return this._hasPendingMacrotasks},enumerable:!0,configurable:!0}),NgZone.prototype.checkStable=function(){var e=this;if(0==this._nesting&&!this._hasPendingMicrotasks&&!this._isStable)try{this._nesting++,this._onMicrotaskEmpty.emit(null)}finally{if(this._nesting--,!this._hasPendingMicrotasks)try{this.runOutsideAngular(function(){return e._onStable.emit(null)})}finally{this._isStable=!0}}},NgZone.prototype.forkInnerZoneWithAngularBehavior=function(){var e=this;this.inner=this.inner.fork({name:"angular",properties:{isAngularZone:!0},onInvokeTask:function(t,r,n,i,o,a){try{return e.onEnter(),t.invokeTask(n,i,o,a)}finally{e.onLeave()}},onInvoke:function(t,r,n,i,o,a,s){try{return e.onEnter(),t.invoke(n,i,o,a,s)}finally{e.onLeave()}},onHasTask:function(t,r,n,i){t.hasTask(n,i),r===n&&("microTask"==i.change?e.setHasMicrotask(i.microTask):"macroTask"==i.change&&e.setHasMacrotask(i.macroTask))},onHandleError:function(t,r,n,i){return t.handleError(n,i),e.triggerError(i),!1}})},NgZone.prototype.onEnter=function(){this._nesting++,this._isStable&&(this._isStable=!1,this._onUnstable.emit(null))},NgZone.prototype.onLeave=function(){this._nesting--,this.checkStable()},NgZone.prototype.setHasMicrotask=function(e){this._hasPendingMicrotasks=e,this.checkStable()},NgZone.prototype.setHasMacrotask=function(e){this._hasPendingMacrotasks=e},NgZone.prototype.triggerError=function(e){this._onErrorEvents.emit(e)},NgZone}()},function(e,t,r){"use strict";var n=r(24);r.d(t,"a",function(){return i});var i=function(){function AbstractControlDirective(){}return Object.defineProperty(AbstractControlDirective.prototype,"control",{get:function(){throw new Error("unimplemented")},enumerable:!0,configurable:!0}),Object.defineProperty(AbstractControlDirective.prototype,"value",{get:function(){return r.i(n.a)(this.control)?this.control.value:null},enumerable:!0,configurable:!0}),Object.defineProperty(AbstractControlDirective.prototype,"valid",{get:function(){return r.i(n.a)(this.control)?this.control.valid:null},enumerable:!0,configurable:!0}),Object.defineProperty(AbstractControlDirective.prototype,"invalid",{get:function(){return r.i(n.a)(this.control)?this.control.invalid:null},enumerable:!0,configurable:!0}),Object.defineProperty(AbstractControlDirective.prototype,"pending",{get:function(){return r.i(n.a)(this.control)?this.control.pending:null},enumerable:!0,configurable:!0}),Object.defineProperty(AbstractControlDirective.prototype,"errors",{get:function(){return r.i(n.a)(this.control)?this.control.errors:null},enumerable:!0,configurable:!0}),Object.defineProperty(AbstractControlDirective.prototype,"pristine",{get:function(){return r.i(n.a)(this.control)?this.control.pristine:null},enumerable:!0,configurable:!0}),Object.defineProperty(AbstractControlDirective.prototype,"dirty",{get:function(){return r.i(n.a)(this.control)?this.control.dirty:null},enumerable:!0,configurable:!0}),Object.defineProperty(AbstractControlDirective.prototype,"touched",{get:function(){return r.i(n.a)(this.control)?this.control.touched:null},enumerable:!0,configurable:!0}),Object.defineProperty(AbstractControlDirective.prototype,"untouched",{get:function(){return r.i(n.a)(this.control)?this.control.untouched:null},enumerable:!0,configurable:!0}),Object.defineProperty(AbstractControlDirective.prototype,"disabled",{get:function(){return r.i(n.a)(this.control)?this.control.disabled:null},enumerable:!0,configurable:!0}),Object.defineProperty(AbstractControlDirective.prototype,"enabled",{get:function(){return r.i(n.a)(this.control)?this.control.enabled:null},enumerable:!0,configurable:!0}),Object.defineProperty(AbstractControlDirective.prototype,"statusChanges",{get:function(){return r.i(n.a)(this.control)?this.control.statusChanges:null},enumerable:!0,configurable:!0}),Object.defineProperty(AbstractControlDirective.prototype,"valueChanges",{get:function(){return r.i(n.a)(this.control)?this.control.valueChanges:null},enumerable:!0,configurable:!0}),Object.defineProperty(AbstractControlDirective.prototype,"path",{get:function(){return null},enumerable:!0,configurable:!0}),AbstractControlDirective.prototype.reset=function(e){void 0===e&&(e=void 0),r.i(n.a)(this.control)&&this.control.reset(e)},AbstractControlDirective}()},function(e,t,r){"use strict";var n=r(0),i=r(24),o=r(43),a=r(62);r.d(t,"a",function(){return l}),r.d(t,"b",function(){return p});var s=this&&this.__extends||function(e,t){function __(){this.constructor=e}for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r]);e.prototype=null===t?Object.create(t):(__.prototype=t.prototype,new __)},u=function(){function AbstractControlStatus(e){this._cd=e}return Object.defineProperty(AbstractControlStatus.prototype,"ngClassUntouched",{get:function(){return!!r.i(i.a)(this._cd.control)&&this._cd.control.untouched},enumerable:!0,configurable:!0}),Object.defineProperty(AbstractControlStatus.prototype,"ngClassTouched",{get:function(){return!!r.i(i.a)(this._cd.control)&&this._cd.control.touched},enumerable:!0,configurable:!0}),Object.defineProperty(AbstractControlStatus.prototype,"ngClassPristine",{get:function(){return!!r.i(i.a)(this._cd.control)&&this._cd.control.pristine},enumerable:!0,configurable:!0}),Object.defineProperty(AbstractControlStatus.prototype,"ngClassDirty",{get:function(){return!!r.i(i.a)(this._cd.control)&&this._cd.control.dirty},enumerable:!0,configurable:!0}),Object.defineProperty(AbstractControlStatus.prototype,"ngClassValid",{get:function(){return!!r.i(i.a)(this._cd.control)&&this._cd.control.valid},enumerable:!0,configurable:!0}),Object.defineProperty(AbstractControlStatus.prototype,"ngClassInvalid",{get:function(){return!!r.i(i.a)(this._cd.control)&&this._cd.control.invalid},enumerable:!0,configurable:!0}),AbstractControlStatus}(),c={"[class.ng-untouched]":"ngClassUntouched","[class.ng-touched]":"ngClassTouched","[class.ng-pristine]":"ngClassPristine","[class.ng-dirty]":"ngClassDirty","[class.ng-valid]":"ngClassValid","[class.ng-invalid]":"ngClassInvalid"},l=function(e){function NgControlStatus(t){e.call(this,t)}return s(NgControlStatus,e),NgControlStatus.decorators=[{type:n.Directive,args:[{selector:"[formControlName],[ngModel],[formControl]",host:c}]}],NgControlStatus.ctorParameters=[{type:a.a,decorators:[{type:n.Self}]}],NgControlStatus}(u),p=function(e){function NgControlStatusGroup(t){e.call(this,t)}return s(NgControlStatusGroup,e),NgControlStatusGroup.decorators=[{type:n.Directive,args:[{selector:"[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]",host:c}]}],NgControlStatusGroup.ctorParameters=[{type:o.a,decorators:[{type:n.Self}]}],NgControlStatusGroup}(u)},function(e,t,r){"use strict";var n=r(0),i=r(79),o=r(140),a=r(37),s=r(94),u=r(43),c=r(36),l=r(62),p=r(95),f=r(136),h=r(54),d=r(312);r.d(t,"a",function(){return g});var m=this&&this.__extends||function(e,t){function __(){this.constructor=e}for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r]);e.prototype=null===t?Object.create(t):(__.prototype=t.prototype,new __)},v={provide:l.a,useExisting:r.i(n.forwardRef)(function(){return g})},y=Promise.resolve(null),g=function(e){function NgModel(t,n,a,s){e.call(this),this._control=new o.b,this._registered=!1,this.update=new i.a,this._parent=t,this._rawValidators=n||[],this._rawAsyncValidators=a||[],this.valueAccessor=r.i(h.f)(this,s)}return m(NgModel,e),NgModel.prototype.ngOnChanges=function(e){this._checkForErrors(),this._registered||this._setUpControl(),"isDisabled"in e&&this._updateDisabled(e),r.i(h.g)(e,this.viewModel)&&(this._updateValue(this.model),this.viewModel=this.model)},NgModel.prototype.ngOnDestroy=function(){this.formDirective&&this.formDirective.removeControl(this)},Object.defineProperty(NgModel.prototype,"control",{get:function(){return this._control},enumerable:!0,configurable:!0}),Object.defineProperty(NgModel.prototype,"path",{get:function(){return this._parent?r.i(h.a)(this.name,this._parent):[this.name]},enumerable:!0,configurable:!0}),Object.defineProperty(NgModel.prototype,"formDirective",{get:function(){return this._parent?this._parent.formDirective:null},enumerable:!0,configurable:!0}),Object.defineProperty(NgModel.prototype,"validator",{get:function(){return r.i(h.b)(this._rawValidators)},enumerable:!0,configurable:!0}),Object.defineProperty(NgModel.prototype,"asyncValidator",{get:function(){return r.i(h.c)(this._rawAsyncValidators)},enumerable:!0,configurable:!0}),NgModel.prototype.viewToModelUpdate=function(e){this.viewModel=e,this.update.emit(e)},NgModel.prototype._setUpControl=function(){this._isStandalone()?this._setUpStandalone():this.formDirective.addControl(this),this._registered=!0},NgModel.prototype._isStandalone=function(){return!this._parent||this.options&&this.options.standalone},NgModel.prototype._setUpStandalone=function(){r.i(h.d)(this._control,this),this._control.updateValueAndValidity({emitEvent:!1})},NgModel.prototype._checkForErrors=function(){this._isStandalone()||this._checkParentType(),this._checkName()},NgModel.prototype._checkParentType=function(){!(this._parent instanceof f.a)&&this._parent instanceof s.a?d.a.formGroupNameException():this._parent instanceof f.a||this._parent instanceof p.a||d.a.modelParentException()},NgModel.prototype._checkName=function(){this.options&&this.options.name&&(this.name=this.options.name),this._isStandalone()||this.name||d.a.missingNameException()},NgModel.prototype._updateValue=function(e){var t=this;y.then(function(){t.control.setValue(e,{emitViewToModelChange:!1})})},NgModel.prototype._updateDisabled=function(e){var t=this,r=e.isDisabled.currentValue,n=""===r||r&&"false"!==r;y.then(function(){n&&!t.control.disabled?t.control.disable():!n&&t.control.disabled&&t.control.enable()})},NgModel.decorators=[{type:n.Directive,args:[{selector:"[ngModel]:not([formControlName]):not([formControl])",providers:[v],exportAs:"ngModel"}]}],NgModel.ctorParameters=[{type:u.a,decorators:[{type:n.Optional},{type:n.Host}]},{type:Array,decorators:[{type:n.Optional},{type:n.Self},{type:n.Inject,args:[a.b]}]},{type:Array,decorators:[{type:n.Optional},{type:n.Self},{type:n.Inject,args:[a.c]}]},{type:Array,decorators:[{type:n.Optional},{type:n.Self},{type:n.Inject,args:[c.a]}]}],NgModel.propDecorators={name:[{type:n.Input}],isDisabled:[{type:n.Input,args:["disabled"]}],model:[{type:n.Input,args:["ngModel"]}],options:[{type:n.Input,args:["ngModelOptions"]}],update:[{type:n.Output,args:["ngModelChange"]}]},NgModel}(l.a)},function(e,t,r){"use strict";var n=r(0),i=r(24),o=r(36);r.d(t,"a",function(){return s});var a={provide:o.a,useExisting:r.i(n.forwardRef)(function(){return s}),multi:!0},s=function(){function NumberValueAccessor(e,t){this._renderer=e,this._elementRef=t,this.onChange=function(e){},this.onTouched=function(){}}return NumberValueAccessor.prototype.writeValue=function(e){var t=r.i(i.b)(e)?"":e;this._renderer.setElementProperty(this._elementRef.nativeElement,"value",t)},NumberValueAccessor.prototype.registerOnChange=function(e){this.onChange=function(t){e(""==t?null:parseFloat(t))}},NumberValueAccessor.prototype.registerOnTouched=function(e){this.onTouched=e},NumberValueAccessor.prototype.setDisabledState=function(e){this._renderer.setElementProperty(this._elementRef.nativeElement,"disabled",e)},NumberValueAccessor.decorators=[{type:n.Directive,args:[{selector:"input[type=number][formControlName],input[type=number][formControl],input[type=number][ngModel]",host:{"(change)":"onChange($event.target.value)","(input)":"onChange($event.target.value)","(blur)":"onTouched()"},providers:[a]}]}],NumberValueAccessor.ctorParameters=[{type:n.Renderer},{type:n.ElementRef}],NumberValueAccessor}()},function(e,t,r){"use strict";var n=r(0),i=r(79),o=r(37),a=r(36),s=r(62),u=r(137),c=r(54);r.d(t,"a",function(){return f});var l=this&&this.__extends||function(e,t){function __(){this.constructor=e}for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r]);e.prototype=null===t?Object.create(t):(__.prototype=t.prototype,new __)},p={provide:s.a,useExisting:r.i(n.forwardRef)(function(){return f})},f=function(e){function FormControlDirective(t,n,o){e.call(this),this.update=new i.a,this._rawValidators=t||[],this._rawAsyncValidators=n||[],this.valueAccessor=r.i(c.f)(this,o)}return l(FormControlDirective,e),Object.defineProperty(FormControlDirective.prototype,"isDisabled",{set:function(e){u.a.disabledAttrWarning()},enumerable:!0,configurable:!0}),FormControlDirective.prototype.ngOnChanges=function(e){this._isControlChanged(e)&&(r.i(c.d)(this.form,this),this.control.disabled&&this.valueAccessor.setDisabledState&&this.valueAccessor.setDisabledState(!0),this.form.updateValueAndValidity({emitEvent:!1})),r.i(c.g)(e,this.viewModel)&&(this.form.setValue(this.model),this.viewModel=this.model)},Object.defineProperty(FormControlDirective.prototype,"path",{get:function(){return[]},enumerable:!0,configurable:!0}),Object.defineProperty(FormControlDirective.prototype,"validator",{get:function(){return r.i(c.b)(this._rawValidators)},enumerable:!0,configurable:!0}),Object.defineProperty(FormControlDirective.prototype,"asyncValidator",{get:function(){return r.i(c.c)(this._rawAsyncValidators)},enumerable:!0,configurable:!0}),Object.defineProperty(FormControlDirective.prototype,"control",{get:function(){return this.form},enumerable:!0,configurable:!0}),FormControlDirective.prototype.viewToModelUpdate=function(e){this.viewModel=e,this.update.emit(e)},FormControlDirective.prototype._isControlChanged=function(e){return e.hasOwnProperty("form")},FormControlDirective.decorators=[{type:n.Directive,args:[{selector:"[formControl]",providers:[p],exportAs:"ngForm"}]}],FormControlDirective.ctorParameters=[{type:Array,decorators:[{type:n.Optional},{type:n.Self},{type:n.Inject,args:[o.b]}]},{type:Array,decorators:[{type:n.Optional},{type:n.Self},{type:n.Inject,args:[o.c]}]},{type:Array,decorators:[{type:n.Optional},{type:n.Self},{type:n.Inject,args:[a.a]}]}],FormControlDirective.propDecorators={form:[{type:n.Input,args:["formControl"]}],model:[{type:n.Input,args:["ngModel"]}],update:[{type:n.Output,args:["ngModelChange"]}],isDisabled:[{type:n.Input,args:["disabled"]}]},FormControlDirective}(s.a)},function(e,t,r){"use strict";var n=r(0),i=r(79),o=r(37),a=r(94),s=r(43),u=r(36),c=r(62),l=r(137),p=r(54),f=r(97),h=r(98);r.d(t,"a",function(){return v});var d=this&&this.__extends||function(e,t){function __(){this.constructor=e}for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r]);e.prototype=null===t?Object.create(t):(__.prototype=t.prototype,new __)},m={provide:c.a,useExisting:r.i(n.forwardRef)(function(){return v})},v=function(e){function FormControlName(t,n,o,a){e.call(this),this._added=!1,this.update=new i.a,this._parent=t,this._rawValidators=n||[],this._rawAsyncValidators=o||[],this.valueAccessor=r.i(p.f)(this,a)}return d(FormControlName,e),Object.defineProperty(FormControlName.prototype,"isDisabled",{set:function(e){l.a.disabledAttrWarning()},enumerable:!0,configurable:!0}),FormControlName.prototype.ngOnChanges=function(e){this._added||this._setUpControl(),r.i(p.g)(e,this.viewModel)&&(this.viewModel=this.model,this.formDirective.updateModel(this,this.model))},FormControlName.prototype.ngOnDestroy=function(){this.formDirective&&this.formDirective.removeControl(this)},FormControlName.prototype.viewToModelUpdate=function(e){this.viewModel=e,this.update.emit(e)},Object.defineProperty(FormControlName.prototype,"path",{get:function(){return r.i(p.a)(this.name,this._parent)},enumerable:!0,configurable:!0}),Object.defineProperty(FormControlName.prototype,"formDirective",{get:function(){return this._parent?this._parent.formDirective:null},enumerable:!0,configurable:!0}),Object.defineProperty(FormControlName.prototype,"validator",{get:function(){return r.i(p.b)(this._rawValidators)},enumerable:!0,configurable:!0}),Object.defineProperty(FormControlName.prototype,"asyncValidator",{get:function(){return r.i(p.c)(this._rawAsyncValidators)},enumerable:!0,configurable:!0}),Object.defineProperty(FormControlName.prototype,"control",{get:function(){return this._control},enumerable:!0,configurable:!0}),FormControlName.prototype._checkParentType=function(){!(this._parent instanceof h.a)&&this._parent instanceof a.a?l.a.ngModelGroupException():this._parent instanceof h.a||this._parent instanceof f.a||this._parent instanceof h.b||l.a.controlParentException()},FormControlName.prototype._setUpControl=function(){this._checkParentType(),this._control=this.formDirective.addControl(this),this.control.disabled&&this.valueAccessor.setDisabledState&&this.valueAccessor.setDisabledState(!0),this._added=!0},FormControlName.decorators=[{type:n.Directive,args:[{selector:"[formControlName]",providers:[m]}]}],FormControlName.ctorParameters=[{type:s.a,decorators:[{type:n.Optional},{type:n.Host},{type:n.SkipSelf}]},{type:Array,decorators:[{type:n.Optional},{type:n.Self},{type:n.Inject,args:[o.b]}]},{type:Array,decorators:[{type:n.Optional},{type:n.Self},{type:n.Inject,args:[o.c]}]},{type:Array,decorators:[{type:n.Optional},{type:n.Self},{type:n.Inject,args:[u.a]}]}],FormControlName.propDecorators={name:[{type:n.Input,args:["formControlName"]}],model:[{type:n.Input,args:["ngModel"]}],update:[{type:n.Output,args:["ngModelChange"]}],isDisabled:[{type:n.Input,args:["disabled"]}]},FormControlName}(c.a)},function(e,t,r){"use strict";var n=r(0),i=r(24),o=r(37);r.d(t,"a",function(){return s}),r.d(t,"b",function(){return c}),r.d(t,"c",function(){return p}),r.d(t,"d",function(){return h});var a={provide:o.b,useExisting:r.i(n.forwardRef)(function(){return s}),multi:!0},s=function(){function RequiredValidator(){}return Object.defineProperty(RequiredValidator.prototype,"required",{get:function(){return this._required},set:function(e){this._required=r.i(i.a)(e)&&""+e!="false",this._onChange&&this._onChange()},enumerable:!0,configurable:!0}),RequiredValidator.prototype.validate=function(e){return this.required?o.a.required(e):null},RequiredValidator.prototype.registerOnValidatorChange=function(e){this._onChange=e},RequiredValidator.decorators=[{type:n.Directive,args:[{selector:"[required][formControlName],[required][formControl],[required][ngModel]",providers:[a],host:{"[attr.required]":'required? "" : null'}}]}],RequiredValidator.ctorParameters=[],RequiredValidator.propDecorators={required:[{type:n.Input}]},RequiredValidator}(),u={provide:o.b,useExisting:r.i(n.forwardRef)(function(){return c}),multi:!0},c=function(){function MinLengthValidator(){}return MinLengthValidator.prototype._createValidator=function(){this._validator=o.a.minLength(parseInt(this.minlength,10))},MinLengthValidator.prototype.ngOnChanges=function(e){e.minlength&&(this._createValidator(),this._onChange&&this._onChange())},MinLengthValidator.prototype.validate=function(e){return r.i(i.a)(this.minlength)?this._validator(e):null},MinLengthValidator.prototype.registerOnValidatorChange=function(e){this._onChange=e},MinLengthValidator.decorators=[{type:n.Directive,args:[{selector:"[minlength][formControlName],[minlength][formControl],[minlength][ngModel]",providers:[u],host:{"[attr.minlength]":"minlength? minlength : null"}}]}],MinLengthValidator.ctorParameters=[],MinLengthValidator.propDecorators={minlength:[{type:n.Input}]},MinLengthValidator}(),l={provide:o.b,useExisting:r.i(n.forwardRef)(function(){return p}),multi:!0},p=function(){function MaxLengthValidator(){}return MaxLengthValidator.prototype._createValidator=function(){this._validator=o.a.maxLength(parseInt(this.maxlength,10))},MaxLengthValidator.prototype.ngOnChanges=function(e){e.maxlength&&(this._createValidator(),this._onChange&&this._onChange())},MaxLengthValidator.prototype.validate=function(e){return r.i(i.a)(this.maxlength)?this._validator(e):null},MaxLengthValidator.prototype.registerOnValidatorChange=function(e){this._onChange=e},MaxLengthValidator.decorators=[{type:n.Directive,args:[{selector:"[maxlength][formControlName],[maxlength][formControl],[maxlength][ngModel]",providers:[l],host:{"[attr.maxlength]":"maxlength? maxlength : null"}}]}],MaxLengthValidator.ctorParameters=[],MaxLengthValidator.propDecorators={maxlength:[{type:n.Input}]},MaxLengthValidator}(),f={provide:o.b,useExisting:r.i(n.forwardRef)(function(){return h}),multi:!0},h=function(){function PatternValidator(){}return PatternValidator.prototype._createValidator=function(){this._validator=o.a.pattern(this.pattern)},PatternValidator.prototype.ngOnChanges=function(e){e.pattern&&(this._createValidator(),this._onChange&&this._onChange())},PatternValidator.prototype.validate=function(e){return r.i(i.a)(this.pattern)?this._validator(e):null},PatternValidator.prototype.registerOnValidatorChange=function(e){this._onChange=e},PatternValidator.decorators=[{type:n.Directive,args:[{selector:"[pattern][formControlName],[pattern][formControl],[pattern][ngModel]",providers:[f],host:{"[attr.pattern]":"pattern? pattern : null"}}]}],PatternValidator.ctorParameters=[],PatternValidator.propDecorators={pattern:[{type:n.Input}]},PatternValidator}()},function(e,t,r){"use strict";var n=r(0);r.d(t,"a",function(){return i});var i=function(){function BrowserXhr(){}return BrowserXhr.prototype.build=function(){return new XMLHttpRequest},BrowserXhr.decorators=[{type:n.Injectable}],BrowserXhr.ctorParameters=[],BrowserXhr}()},function(e,t,r){"use strict";var n=r(0),i=r(44),o=r(55),a=r(99),s=r(142),u=r(143);r.d(t,"a",function(){return l}),r.d(t,"b",function(){return p});var c=this&&this.__extends||function(e,t){function __(){this.constructor=e}for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r]);e.prototype=null===t?Object.create(t):(__.prototype=t.prototype,new __)},l=function(){function RequestOptions(e){var t=void 0===e?{}:e,n=t.method,o=t.headers,a=t.body,c=t.url,l=t.search,p=t.withCredentials,f=t.responseType;this.method=r.i(i.a)(n)?r.i(s.e)(n):null,this.headers=r.i(i.a)(o)?o:null,this.body=r.i(i.a)(a)?a:null,this.url=r.i(i.a)(c)?c:null,this.search=r.i(i.a)(l)?"string"==typeof l?new u.a(l):l:null,this.withCredentials=r.i(i.a)(p)?p:null,this.responseType=r.i(i.a)(f)?f:null}return RequestOptions.prototype.merge=function(e){return new RequestOptions({method:e&&r.i(i.a)(e.method)?e.method:this.method,headers:e&&r.i(i.a)(e.headers)?e.headers:this.headers,body:e&&r.i(i.a)(e.body)?e.body:this.body,url:e&&r.i(i.a)(e.url)?e.url:this.url,search:e&&r.i(i.a)(e.search)?"string"==typeof e.search?new u.a(e.search):e.search.clone():this.search,withCredentials:e&&r.i(i.a)(e.withCredentials)?e.withCredentials:this.withCredentials,responseType:e&&r.i(i.a)(e.responseType)?e.responseType:this.responseType})},RequestOptions}(),p=function(e){function BaseRequestOptions(){e.call(this,{method:o.b.Get,headers:new a.a})}return c(BaseRequestOptions,e),BaseRequestOptions.decorators=[{type:n.Injectable}],BaseRequestOptions.ctorParameters=[],BaseRequestOptions}(l)},function(e,t,r){"use strict";var n=r(318);r.d(t,"a",function(){return o});var i=this&&this.__extends||function(e,t){function __(){this.constructor=e}for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r]);e.prototype=null===t?Object.create(t):(__.prototype=t.prototype,new __)},o=function(e){function Response(t){e.call(this),this._body=t.body,this.status=t.status,this.ok=this.status>=200&&this.status<=299,this.statusText=t.statusText,this.headers=t.headers,this.type=t.type,this.url=t.url}return i(Response,e),Response.prototype.toString=function(){return"Response with status: "+this.status+" "+this.statusText+" for URL: "+this.url},Response}(n.a)},function(e,t,r){"use strict";var n=r(331);r.d(t,"a",function(){return o});var i=function(){function _NoOpAnimationDriver(){}return _NoOpAnimationDriver.prototype.animate=function(e,t,r,i,o,a){return new n.a},_NoOpAnimationDriver}(),o=function(){function AnimationDriver(){}return AnimationDriver.NOOP=new i,AnimationDriver}()},function(e,t,r){"use strict";function inspectNativeElement(e){return r.i(n.getDebugNode)(e)}function _createConditionalRootRenderer(e,t){return r.i(n.isDevMode)()?_createRootRenderer(e,t):e}function _createRootRenderer(e,t){return r.i(a.a)().setGlobalVar(c,inspectNativeElement),r.i(a.a)().setGlobalVar(l,i.b.merge(u,_ngProbeTokensToMap(t||[]))),new o.b(e)}function _ngProbeTokensToMap(e){return e.reduce(function(e,t){return e[t.name]=t.token,e},{})}var n=r(0),i=r(211),o=r(331),a=r(15),s=r(208);r.d(t,"b",function(){return p}),r.d(t,"a",function(){return f});var u={ApplicationRef:n.ApplicationRef,NgZone:n.NgZone},c="ng.probe",l="ng.coreTokens",p=function(){function NgProbeToken(e,t){this.name=e,this.token=t}return NgProbeToken}(),f=[{provide:n.RootRenderer,useFactory:_createConditionalRootRenderer,deps:[s.a,[p,new n.Optional]]}];[{provide:n.RootRenderer,useFactory:_createRootRenderer,deps:[s.a,[p,new n.Optional]]}]},function(e,t,r){"use strict";function moveNodesAfterSibling(e,t){var n=r.i(a.a)().parentElement(e);if(t.length>0&&r.i(i.a)(n)){var o=r.i(a.a)().nextSibling(e);if(r.i(i.a)(o))for(var s=0;s<t.length;s++)r.i(a.a)().insertBefore(o,t[s]);else for(var s=0;s<t.length;s++)r.i(a.a)().appendChild(n,t[s])}}function appendNodes(e,t){for(var n=0;n<t.length;n++)r.i(a.a)().appendChild(e,t[n])}function decoratePreventDefault(e){return function(t){var n=e(t);n===!1&&r.i(a.a)().preventDefault(t)}}function _shimContentAttribute(e){return w.replace(g,e)}function _shimHostAttribute(e){return b.replace(g,e)}function _flattenStyles(e,t,r){for(var n=0;n<t.length;n++){var i=t[n];Array.isArray(i)?_flattenStyles(e,i,r):(i=i.replace(g,e),r.push(i))}return r}function splitNamespace(e){if(":"!=e[0])return[null,e];var t=e.match(C);return[t[1],t[2]]}var n=r(0),i=r(30),o=r(206),a=r(15),s=r(144),u=r(81),c=r(210),l=r(330);r.d(t,"a",function(){return m}),r.d(t,"b",function(){return v});var p=this&&this.__extends||function(e,t){function __(){this.constructor=e}for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r]);e.prototype=null===t?Object.create(t):(__.prototype=t.prototype,new __)},f={xlink:"http://www.w3.org/1999/xlink",svg:"http://www.w3.org/2000/svg",xhtml:"http://www.w3.org/1999/xhtml"},h="template bindings={}",d=/^template bindings=(.*)$/,m=function(){function DomRootRenderer(e,t,r,n){this.document=e,this.eventManager=t,this.sharedStylesHost=r,this.animationDriver=n,this.registeredComponents=new Map}return DomRootRenderer.prototype.renderComponent=function(e){var t=this.registeredComponents.get(e.id);return t||(t=new y(this,e,this.animationDriver),this.registeredComponents.set(e.id,t)),t},DomRootRenderer}(),v=function(e){function DomRootRenderer_(t,r,n,i){e.call(this,t,r,n,i)}return p(DomRootRenderer_,e),DomRootRenderer_.decorators=[{type:n.Injectable}],DomRootRenderer_.ctorParameters=[{type:void 0,decorators:[{type:n.Inject,args:[s.a]}]},{type:u.a},{type:c.a},{type:o.a}],DomRootRenderer_}(m),y=function(){function DomRenderer(e,t,r){this._rootRenderer=e,this.componentProto=t,this._animationDriver=r, this._styles=_flattenStyles(t.id,t.styles,[]),t.encapsulation!==n.ViewEncapsulation.Native&&this._rootRenderer.sharedStylesHost.addStyles(this._styles),this.componentProto.encapsulation===n.ViewEncapsulation.Emulated?(this._contentAttr=_shimContentAttribute(t.id),this._hostAttr=_shimHostAttribute(t.id)):(this._contentAttr=null,this._hostAttr=null)}return DomRenderer.prototype.selectRootElement=function(e,t){var n;if("string"==typeof e){if(n=r.i(a.a)().querySelector(this._rootRenderer.document,e),r.i(i.b)(n))throw new Error('The selector "'+e+'" did not match any elements')}else n=e;return r.i(a.a)().clearNodes(n),n},DomRenderer.prototype.createElement=function(e,t,n){var o=splitNamespace(t),s=r.i(i.a)(o[0])?r.i(a.a)().createElementNS(f[o[0]],o[1]):r.i(a.a)().createElement(o[1]);return r.i(i.a)(this._contentAttr)&&r.i(a.a)().setAttribute(s,this._contentAttr,""),r.i(i.a)(e)&&r.i(a.a)().appendChild(e,s),s},DomRenderer.prototype.createViewRoot=function(e){var t;if(this.componentProto.encapsulation===n.ViewEncapsulation.Native){t=r.i(a.a)().createShadowRoot(e),this._rootRenderer.sharedStylesHost.addHost(t);for(var o=0;o<this._styles.length;o++)r.i(a.a)().appendChild(t,r.i(a.a)().createStyleElement(this._styles[o]))}else r.i(i.a)(this._hostAttr)&&r.i(a.a)().setAttribute(e,this._hostAttr,""),t=e;return t},DomRenderer.prototype.createTemplateAnchor=function(e,t){var n=r.i(a.a)().createComment(h);return r.i(i.a)(e)&&r.i(a.a)().appendChild(e,n),n},DomRenderer.prototype.createText=function(e,t,n){var o=r.i(a.a)().createTextNode(t);return r.i(i.a)(e)&&r.i(a.a)().appendChild(e,o),o},DomRenderer.prototype.projectNodes=function(e,t){r.i(i.b)(e)||appendNodes(e,t)},DomRenderer.prototype.attachViewAfter=function(e,t){moveNodesAfterSibling(e,t)},DomRenderer.prototype.detachView=function(e){for(var t=0;t<e.length;t++)r.i(a.a)().remove(e[t])},DomRenderer.prototype.destroyView=function(e,t){this.componentProto.encapsulation===n.ViewEncapsulation.Native&&r.i(i.a)(e)&&this._rootRenderer.sharedStylesHost.removeHost(r.i(a.a)().getShadowRoot(e))},DomRenderer.prototype.listen=function(e,t,r){return this._rootRenderer.eventManager.addEventListener(e,t,decoratePreventDefault(r))},DomRenderer.prototype.listenGlobal=function(e,t,r){return this._rootRenderer.eventManager.addGlobalEventListener(e,t,decoratePreventDefault(r))},DomRenderer.prototype.setElementProperty=function(e,t,n){r.i(a.a)().setProperty(e,t,n)},DomRenderer.prototype.setElementAttribute=function(e,t,n){var o,s=splitNamespace(t);r.i(i.a)(s[0])&&(t=s[0]+":"+s[1],o=f[s[0]]),r.i(i.a)(n)?r.i(i.a)(o)?r.i(a.a)().setAttributeNS(e,o,t,n):r.i(a.a)().setAttribute(e,t,n):r.i(i.a)(o)?r.i(a.a)().removeAttributeNS(e,o,s[1]):r.i(a.a)().removeAttribute(e,t)},DomRenderer.prototype.setBindingDebugInfo=function(e,t,n){var i=r.i(l.b)(t);if(r.i(a.a)().isCommentNode(e)){var o=r.i(a.a)().getText(e).replace(/\n/g,"").match(d),s=JSON.parse(o[1]);s[i]=n,r.i(a.a)().setText(e,h.replace("{}",JSON.stringify(s,null,2)))}else this.setElementAttribute(e,t,n)},DomRenderer.prototype.setElementClass=function(e,t,n){n?r.i(a.a)().addClass(e,t):r.i(a.a)().removeClass(e,t)},DomRenderer.prototype.setElementStyle=function(e,t,n){r.i(i.a)(n)?r.i(a.a)().setStyle(e,t,r.i(i.g)(n)):r.i(a.a)().removeStyle(e,t)},DomRenderer.prototype.invokeElementMethod=function(e,t,n){r.i(a.a)().invoke(e,t,n)},DomRenderer.prototype.setText=function(e,t){r.i(a.a)().setText(e,t)},DomRenderer.prototype.animate=function(e,t,r,n,i,o){return this._animationDriver.animate(e,t,r,n,i,o)},DomRenderer}(),g=/%COMP%/g,_="%COMP%",b="_nghost-"+_,w="_ngcontent-"+_,C=/^:([^:]+):(.+)$/},function(e,t,r){"use strict";var n=r(0),i=r(30),o=r(500);r.d(t,"b",function(){return s}),r.d(t,"c",function(){return u}),r.d(t,"a",function(){return c});var a=this&&this.__extends||function(e,t){function __(){this.constructor=e}for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r]);e.prototype=null===t?Object.create(t):(__.prototype=t.prototype,new __)},s=new n.OpaqueToken("HammerGestureConfig"),u=function(){function HammerGestureConfig(){this.events=[],this.overrides={}}return HammerGestureConfig.prototype.buildHammer=function(e){var t=new Hammer(e);t.get("pinch").set({enable:!0}),t.get("rotate").set({enable:!0});for(var r in this.overrides)t.get(r).set(this.overrides[r]);return t},HammerGestureConfig.decorators=[{type:n.Injectable}],HammerGestureConfig.ctorParameters=[],HammerGestureConfig}(),c=function(e){function HammerGesturesPlugin(t){e.call(this),this._config=t}return a(HammerGesturesPlugin,e),HammerGesturesPlugin.prototype.supports=function(t){if(!e.prototype.supports.call(this,t)&&!this.isCustomEvent(t))return!1;if(!r.i(i.a)(window.Hammer))throw new Error("Hammer.js is not loaded, can not bind "+t+" event");return!0},HammerGesturesPlugin.prototype.addEventListener=function(e,t,r){var n=this,i=this.manager.getZone();return t=t.toLowerCase(),i.runOutsideAngular(function(){var o=n._config.buildHammer(e),a=function(e){i.runGuarded(function(){r(e)})};return o.on(t,a),function(){o.off(t,a)}})},HammerGesturesPlugin.prototype.isCustomEvent=function(e){return this._config.events.indexOf(e)>-1},HammerGesturesPlugin.decorators=[{type:n.Injectable}],HammerGesturesPlugin.ctorParameters=[{type:u,decorators:[{type:n.Inject,args:[s]}]}],HammerGesturesPlugin}(o.a)},function(e,t,r){"use strict";var n=r(0),i=r(15),o=r(144);r.d(t,"b",function(){return s}),r.d(t,"a",function(){return u});var a=this&&this.__extends||function(e,t){function __(){this.constructor=e}for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r]);e.prototype=null===t?Object.create(t):(__.prototype=t.prototype,new __)},s=function(){function SharedStylesHost(){this._styles=[],this._stylesSet=new Set}return SharedStylesHost.prototype.addStyles=function(e){var t=this,r=[];e.forEach(function(e){t._stylesSet.has(e)||(t._stylesSet.add(e),t._styles.push(e),r.push(e))}),this.onStylesAdded(r)},SharedStylesHost.prototype.onStylesAdded=function(e){},SharedStylesHost.prototype.getAllStyles=function(){return this._styles},SharedStylesHost.decorators=[{type:n.Injectable}],SharedStylesHost.ctorParameters=[],SharedStylesHost}(),u=function(e){function DomSharedStylesHost(t){e.call(this),this._hostNodes=new Set,this._hostNodes.add(t.head)}return a(DomSharedStylesHost,e),DomSharedStylesHost.prototype._addStylesToHost=function(e,t){for(var n=0;n<e.length;n++){var o=e[n];r.i(i.a)().appendChild(t,r.i(i.a)().createStyleElement(o))}},DomSharedStylesHost.prototype.addHost=function(e){this._addStylesToHost(this._styles,e),this._hostNodes.add(e)},DomSharedStylesHost.prototype.removeHost=function(e){this._hostNodes.delete(e)},DomSharedStylesHost.prototype.onStylesAdded=function(e){var t=this;this._hostNodes.forEach(function(r){t._addStylesToHost(e,r)})},DomSharedStylesHost.decorators=[{type:n.Injectable}],DomSharedStylesHost.ctorParameters=[{type:void 0,decorators:[{type:n.Inject,args:[o.a]}]}],DomSharedStylesHost}(s)},function(e,t,r){"use strict";function _flattenArray(e,t){if(r.i(n.a)(e))for(var i=0;i<e.length;i++){var o=e[i];Array.isArray(o)?_flattenArray(o,t):t.push(o)}return t}var n=r(30);r.d(t,"b",function(){return o}),r.d(t,"a",function(){return a});var i=function(){try{if((new Map).values().next)return function(e,t){return t?Array.from(e.values()):Array.from(e.keys())}}catch(e){}return function(e,t){var r=new Array(e.size),n=0;return e.forEach(function(e,i){r[n]=t?e:i,n++}),r}}(),o=(function(){function MapWrapper(){}return MapWrapper.createFromStringMap=function(e){var t=new Map;for(var r in e)t.set(r,e[r]);return t},MapWrapper.keys=function(e){return i(e,!1)},MapWrapper.values=function(e){return i(e,!0)},MapWrapper}(),function(){function StringMapWrapper(){}return StringMapWrapper.merge=function(e,t){for(var r={},n=0,i=Object.keys(e);n<i.length;n++){var o=i[n];r[o]=e[o]}for(var a=0,s=Object.keys(t);a<s.length;a++){var o=s[a];r[o]=t[o]}return r},StringMapWrapper.equals=function(e,t){var r=Object.keys(e),n=Object.keys(t);if(r.length!=n.length)return!1;for(var i=0;i<r.length;i++){var o=r[i];if(e[o]!==t[o])return!1}return!0},StringMapWrapper}()),a=function(){function ListWrapper(){}return ListWrapper.createFixedSize=function(e){return new Array(e)},ListWrapper.createGrowableSize=function(e){return new Array(e)},ListWrapper.clone=function(e){return e.slice(0)},ListWrapper.forEachWithIndex=function(e,t){for(var r=0;r<e.length;r++)t(e[r],r)},ListWrapper.first=function(e){return e?e[0]:null},ListWrapper.last=function(e){return e&&0!=e.length?e[e.length-1]:null},ListWrapper.indexOf=function(e,t,r){return void 0===r&&(r=0),e.indexOf(t,r)},ListWrapper.contains=function(e,t){return e.indexOf(t)!==-1},ListWrapper.reversed=function(e){var t=ListWrapper.clone(e);return t.reverse()},ListWrapper.concat=function(e,t){return e.concat(t)},ListWrapper.insert=function(e,t,r){e.splice(t,0,r)},ListWrapper.removeAt=function(e,t){var r=e[t];return e.splice(t,1),r},ListWrapper.removeAll=function(e,t){for(var r=0;r<t.length;++r){var n=e.indexOf(t[r]);e.splice(n,1)}},ListWrapper.remove=function(e,t){var r=e.indexOf(t);return r>-1&&(e.splice(r,1),!0)},ListWrapper.clear=function(e){e.length=0},ListWrapper.isEmpty=function(e){return 0==e.length},ListWrapper.fill=function(e,t,r,n){void 0===r&&(r=0),void 0===n&&(n=null),e.fill(t,r,null===n?e.length:n)},ListWrapper.equals=function(e,t){if(e.length!=t.length)return!1;for(var r=0;r<e.length;++r)if(e[r]!==t[r])return!1;return!0},ListWrapper.slice=function(e,t,r){return void 0===t&&(t=0),void 0===r&&(r=null),e.slice(t,null===r?void 0:r)},ListWrapper.splice=function(e,t,r){return e.splice(t,r)},ListWrapper.sort=function(e,t){r.i(n.a)(t)?e.sort(t):e.sort()},ListWrapper.toString=function(e){return e.toString()},ListWrapper.toJSON=function(e){return JSON.stringify(e)},ListWrapper.maximum=function(e,t){if(0==e.length)return null;for(var i=null,o=-(1/0),a=0;a<e.length;a++){var s=e[a];if(!r.i(n.b)(s)){var u=t(s);u>o&&(i=s,o=u)}}return i},ListWrapper.flatten=function(e){var t=[];return _flattenArray(e,t),t},ListWrapper.addAll=function(e,t){for(var r=0;r<t.length;r++)e.push(t[r])},ListWrapper}()},function(e,t,r){"use strict";function sanitizeUrl(e){return e=String(e),e.match(o)||e.match(a)?e:(r.i(n.isDevMode)()&&r.i(i.a)().log("WARNING: sanitizing unsafe URL value "+e+" (see http://g.co/ng/security#xss)"),"unsafe:"+e)}function sanitizeSrcset(e){return e=String(e),e.split(",").map(function(e){return sanitizeUrl(e.trim())}).join(", ")}var n=r(0),i=r(15);t.a=sanitizeUrl,t.b=sanitizeSrcset;var o=/^(?:(?:https?|mailto|ftp|tel|file):|[^&:\/?#]*(?:[\/?#]|$))/gi,a=/^data:(?:image\/(?:bmp|gif|jpeg|jpg|png|tiff|webp)|video\/(?:mpeg|mp4|ogg|webm)|audio\/(?:mp3|oga|ogg|opus));base64,[a-z0-9+\/]+=*$/i},function(e,t,r){"use strict";function toBool(e){return""===e||!!e}var n=r(72),i=r(0),o=r(101),a=r(82);r.d(t,"a",function(){return s}),r.d(t,"b",function(){return u});var s=function(){function RouterLink(e,t,r){this.router=e,this.route=t,this.locationStrategy=r,this.commands=[]}return Object.defineProperty(RouterLink.prototype,"routerLink",{set:function(e){Array.isArray(e)?this.commands=e:this.commands=[e]},enumerable:!0,configurable:!0}),RouterLink.prototype.onClick=function(e,t,r){return!(0===e&&!t&&!r)||(this.router.navigateByUrl(this.urlTree),!1)},Object.defineProperty(RouterLink.prototype,"urlTree",{get:function(){return this.router.createUrlTree(this.commands,{relativeTo:this.route,queryParams:this.queryParams,fragment:this.fragment,preserveQueryParams:toBool(this.preserveQueryParams),preserveFragment:toBool(this.preserveFragment)})},enumerable:!0,configurable:!0}),RouterLink.decorators=[{type:i.Directive,args:[{selector:":not(a)[routerLink]"}]}],RouterLink.ctorParameters=[{type:o.a},{type:a.b},{type:n.LocationStrategy}],RouterLink.propDecorators={queryParams:[{type:i.Input}],fragment:[{type:i.Input}],preserveQueryParams:[{type:i.Input}],preserveFragment:[{type:i.Input}],routerLink:[{type:i.Input}],onClick:[{type:i.HostListener,args:["click",["$event.button","$event.ctrlKey","$event.metaKey"]]}]},RouterLink}(),u=function(){function RouterLinkWithHref(e,t,r){var n=this;this.router=e,this.route=t,this.locationStrategy=r,this.commands=[],this.subscription=e.events.subscribe(function(e){e instanceof o.b&&n.updateTargetUrlAndHref()})}return Object.defineProperty(RouterLinkWithHref.prototype,"routerLink",{set:function(e){Array.isArray(e)?this.commands=e:this.commands=[e]},enumerable:!0,configurable:!0}),RouterLinkWithHref.prototype.ngOnChanges=function(e){this.updateTargetUrlAndHref()},RouterLinkWithHref.prototype.ngOnDestroy=function(){this.subscription.unsubscribe()},RouterLinkWithHref.prototype.onClick=function(e,t,r){return!(0===e&&!t&&!r)||("string"==typeof this.target&&"_self"!=this.target||(this.router.navigateByUrl(this.urlTree),!1))},RouterLinkWithHref.prototype.updateTargetUrlAndHref=function(){this.href=this.locationStrategy.prepareExternalUrl(this.router.serializeUrl(this.urlTree))},Object.defineProperty(RouterLinkWithHref.prototype,"urlTree",{get:function(){return this.router.createUrlTree(this.commands,{relativeTo:this.route,queryParams:this.queryParams,fragment:this.fragment,preserveQueryParams:toBool(this.preserveQueryParams),preserveFragment:toBool(this.preserveFragment)})},enumerable:!0,configurable:!0}),RouterLinkWithHref.decorators=[{type:i.Directive,args:[{selector:"a[routerLink]"}]}],RouterLinkWithHref.ctorParameters=[{type:o.a},{type:a.b},{type:n.LocationStrategy}],RouterLinkWithHref.propDecorators={target:[{type:i.Input}],queryParams:[{type:i.Input}],fragment:[{type:i.Input}],routerLinkOptions:[{type:i.Input}],preserveQueryParams:[{type:i.Input}],preserveFragment:[{type:i.Input}],href:[{type:i.HostBinding}],routerLink:[{type:i.Input}],onClick:[{type:i.HostListener,args:["click",["$event.button","$event.ctrlKey","$event.metaKey"]]}]},RouterLinkWithHref}()},function(e,t,r){"use strict";function findNode(e,t){if(e===t.value)return t;for(var r=0,n=t.children;r<n.length;r++){var i=n[r],o=findNode(e,i);if(o)return o}return null}function findPath(e,t,r){if(r.push(t),e===t.value)return r;for(var n=0,i=t.children;n<i.length;n++){var o=i[n],a=r.slice(0),s=findPath(e,o,a);if(s.length>0)return s}return[]}r.d(t,"a",function(){return n}),r.d(t,"b",function(){return i});var n=function(){function Tree(e){this._root=e}return Object.defineProperty(Tree.prototype,"root",{get:function(){return this._root.value},enumerable:!0,configurable:!0}),Tree.prototype.parent=function(e){var t=this.pathFromRoot(e);return t.length>1?t[t.length-2]:null},Tree.prototype.children=function(e){var t=findNode(e,this._root);return t?t.children.map(function(e){return e.value}):[]},Tree.prototype.firstChild=function(e){var t=findNode(e,this._root);return t&&t.children.length>0?t.children[0].value:null},Tree.prototype.siblings=function(e){var t=findPath(e,this._root,[]);if(t.length<2)return[];var r=t[t.length-2].children.map(function(e){return e.value});return r.filter(function(t){return t!==e})},Tree.prototype.pathFromRoot=function(e){return findPath(e,this._root,[]).map(function(e){return e.value})},Tree}(),i=function(){function TreeNode(e,t){this.value=e,this.children=t}return TreeNode.prototype.toString=function(){return"TreeNode("+this.value+")"},TreeNode}()},,,,,,,,,,,,,,,,,,,,,,,function(e,t,r){"use strict";var n=this&&this.__extends||function(e,t){function __(){this.constructor=e}for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r]);e.prototype=null===t?Object.create(t):(__.prototype=t.prototype,new __)},i=r(86),o=r(386),a=function(e){function BehaviorSubject(t){e.call(this),this._value=t}return n(BehaviorSubject,e),Object.defineProperty(BehaviorSubject.prototype,"value",{get:function(){return this.getValue()},enumerable:!0,configurable:!0}),BehaviorSubject.prototype._subscribe=function(t){var r=e.prototype._subscribe.call(this,t);return r&&!r.closed&&t.next(this._value),r},BehaviorSubject.prototype.getValue=function(){if(this.hasError)throw this.thrownError;if(this.closed)throw new o.ObjectUnsubscribedError;return this._value},BehaviorSubject.prototype.next=function(t){e.prototype.next.call(this,this._value=t)},BehaviorSubject}(i.Subject);t.BehaviorSubject=a},function(e,t,r){"use strict";var n=this&&this.__extends||function(e,t){function __(){this.constructor=e}for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r]);e.prototype=null===t?Object.create(t):(__.prototype=t.prototype,new __)},i=r(27),o=function(e){function OuterSubscriber(){e.apply(this,arguments)}return n(OuterSubscriber,e),OuterSubscriber.prototype.notifyNext=function(e,t,r,n,i){this.destination.next(t)},OuterSubscriber.prototype.notifyError=function(e,t){this.destination.error(e)},OuterSubscriber.prototype.notifyComplete=function(e){this.destination.complete()},OuterSubscriber}(i.Subscriber);t.OuterSubscriber=o},function(e,t,r){"use strict";var n=r(247),i=r(715),o=r(387),a=r(389),s=r(246),u=r(714),c=function(){function Subscription(e){this.closed=!1,e&&(this._unsubscribe=e)}return Subscription.prototype.unsubscribe=function(){var e,t=!1;if(!this.closed){this.closed=!0;var r=this,c=r._unsubscribe,l=r._subscriptions;if(this._subscriptions=null,o.isFunction(c)){var p=a.tryCatch(c).call(this);p===s.errorObject&&(t=!0,(e=e||[]).push(s.errorObject.e))}if(n.isArray(l))for(var f=-1,h=l.length;++f<h;){var d=l[f];if(i.isObject(d)){var p=a.tryCatch(d.unsubscribe).call(d);if(p===s.errorObject){t=!0,e=e||[];var m=s.errorObject.e;m instanceof u.UnsubscriptionError?e=e.concat(m.errors):e.push(m)}}}if(t)throw new u.UnsubscriptionError(e)}},Subscription.prototype.add=function(e){if(!e||e===Subscription.EMPTY)return Subscription.EMPTY;if(e===this)return this;var t=e;switch(typeof e){case"function":t=new Subscription(e);case"object":if(t.closed||"function"!=typeof t.unsubscribe)break;this.closed?t.unsubscribe():(this._subscriptions||(this._subscriptions=[])).push(t);break;default:throw new Error("unrecognized teardown "+e+" added to Subscription.")}return t},Subscription.prototype.remove=function(e){if(null!=e&&e!==this&&e!==Subscription.EMPTY){var t=this._subscriptions;if(t){var r=t.indexOf(e);r!==-1&&t.splice(r,1)}}},Subscription.EMPTY=function(e){return e.closed=!0,e}(new Subscription),Subscription}();t.Subscription=c},function(e,t,r){"use strict";var n=r(703);t.from=n.FromObservable.create},function(e,t,r){"use strict";function _catch(e){var t=new a(e),r=this.lift(t);return t.caught=r}var n=this&&this.__extends||function(e,t){function __(){this.constructor=e}for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r]);e.prototype=null===t?Object.create(t):(__.prototype=t.prototype,new __)},i=r(238),o=r(248);t._catch=_catch;var a=function(){function CatchOperator(e){this.selector=e}return CatchOperator.prototype.call=function(e,t){return t._subscribe(new s(e,this.selector,this.caught))},CatchOperator}(),s=function(e){function CatchSubscriber(t,r,n){e.call(this,t),this.selector=r,this.caught=n}return n(CatchSubscriber,e),CatchSubscriber.prototype.error=function(e){if(!this.isStopped){var t=void 0;try{t=this.selector(e,this.caught)}catch(e){return void this.destination.error(e)}this.unsubscribe(),this.destination.remove(this),o.subscribeToResult(this,t)}},CatchSubscriber}(i.OuterSubscriber)},function(e,t,r){"use strict";var n=r(61),i=n.root.Symbol;if("function"==typeof i)i.iterator?t.$$iterator=i.iterator:"function"==typeof i.for&&(t.$$iterator=i.for("iterator"));else if(n.root.Set&&"function"==typeof(new n.root.Set)["@@iterator"])t.$$iterator="@@iterator";else if(n.root.Map)for(var o=Object.getOwnPropertyNames(n.root.Map.prototype),a=0;a<o.length;++a){var s=o[a];if("entries"!==s&&"size"!==s&&n.root.Map.prototype[s]===n.root.Map.prototype.entries){t.$$iterator=s;break}}else t.$$iterator="@@iterator"},function(e,t,r){"use strict";function getSymbolObservable(e){var t,r=e.Symbol;return"function"==typeof r?r.observable?t=r.observable:(t=r("observable"),r.observable=t):t="@@observable",t}var n=r(61);t.getSymbolObservable=getSymbolObservable,t.$$observable=getSymbolObservable(n.root)},function(e,t,r){"use strict";var n=r(61),i=n.root.Symbol;t.$$rxSubscriber="function"==typeof i&&"function"==typeof i.for?i.for("rxSubscriber"):"@@rxSubscriber"},function(e,t){"use strict";var r=this&&this.__extends||function(e,t){function __(){this.constructor=e}for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r]);e.prototype=null===t?Object.create(t):(__.prototype=t.prototype,new __)},n=function(e){function EmptyError(){var t=e.call(this,"no elements in sequence");this.name=t.name="EmptyError",this.stack=t.stack,this.message=t.message}return r(EmptyError,e),EmptyError}(Error);t.EmptyError=n},function(e,t){"use strict";t.errorObject={e:{}}},function(e,t){"use strict";t.isArray=Array.isArray||function(e){return e&&"number"==typeof e.length}},function(e,t,r){"use strict";function subscribeToResult(e,t,r,l){var p=new u.InnerSubscriber(e,r,l);if(p.closed)return null;if(t instanceof a.Observable)return t._isScalar?(p.next(t.value),p.complete(),null):t.subscribe(p);if(i.isArray(t)){for(var f=0,h=t.length;f<h&&!p.closed;f++)p.next(t[f]);p.closed||p.complete()}else{if(o.isPromise(t))return t.then(function(e){p.closed||(p.next(e),p.complete())},function(e){return p.error(e)}).then(null,function(e){n.root.setTimeout(function(){throw e})}),p;if("function"==typeof t[s.$$iterator])for(var d=t[s.$$iterator]();;){var m=d.next();if(m.done){p.complete();break}if(p.next(m.value),p.closed)break}else if("function"==typeof t[c.$$observable]){var v=t[c.$$observable]();if("function"==typeof v.subscribe)return v.subscribe(new u.InnerSubscriber(e,r,l));p.error(new Error("invalid observable"))}else p.error(new TypeError("unknown type returned"))}return null}var n=r(61),i=r(247),o=r(388),a=r(6),s=r(242),u=r(693),c=r(243);t.subscribeToResult=subscribeToResult},function(e,t,r){"use strict";var n=r(486);r.d(t,"AbstractControlDirective",function(){return n.a}),r.d(t,"AbstractFormGroupDirective",function(){return n.b}),r.d(t,"CheckboxControlValueAccessor",function(){return n.c}),r.d(t,"ControlContainer",function(){return n.d}),r.d(t,"NG_VALUE_ACCESSOR",function(){return n.e}),r.d(t,"DefaultValueAccessor",function(){return n.f}),r.d(t,"NgControl",function(){return n.g}),r.d(t,"NgControlStatus",function(){return n.h}),r.d(t,"NgControlStatusGroup",function(){return n.i}),r.d(t,"NgForm",function(){return n.j}),r.d(t,"NgModel",function(){return n.k}),r.d(t,"NgModelGroup",function(){return n.l}),r.d(t,"RadioControlValueAccessor",function(){return n.m}),r.d(t,"FormControlDirective",function(){return n.n}),r.d(t,"FormControlName",function(){return n.o}),r.d(t,"FormGroupDirective",function(){return n.p}),r.d(t,"FormArrayName",function(){return n.q}),r.d(t,"FormGroupName",function(){return n.r}),r.d(t,"NgSelectOption",function(){return n.s}),r.d(t,"SelectControlValueAccessor",function(){return n.t}),r.d(t,"SelectMultipleControlValueAccessor",function(){return n.u}),r.d(t,"MaxLengthValidator",function(){return n.v}),r.d(t,"MinLengthValidator",function(){return n.w}),r.d(t,"PatternValidator",function(){return n.x}),r.d(t,"RequiredValidator",function(){return n.y}),r.d(t,"FormBuilder",function(){return n.z}),r.d(t,"AbstractControl",function(){return n.A}),r.d(t,"FormArray",function(){return n.B}),r.d(t,"FormControl",function(){return n.C}),r.d(t,"FormGroup",function(){return n.D}),r.d(t,"NG_ASYNC_VALIDATORS",function(){return n.E}),r.d(t,"NG_VALIDATORS",function(){return n.F}),r.d(t,"Validators",function(){return n.G}),r.d(t,"FormsModule",function(){return n.H}),r.d(t,"ReactiveFormsModule",function(){return n.I})},,function(e,t,r){"use strict";var n=r(6),i=r(112);n.Observable.prototype.map=i.map},function(e,t,r){"use strict";var n=r(414),i=r(415),o=r(416),a=r(417),s=r(418),u=r(253),c=r(419);r.d(t,"a",function(){return l}),r.d(t,"b",function(){return n.a}),r.d(t,"c",function(){return i.a}),r.d(t,"d",function(){return o.a}),r.d(t,"e",function(){return a.a}),r.d(t,"f",function(){return a.b}),r.d(t,"g",function(){return s.a}),r.d(t,"h",function(){return u.b}),r.d(t,"i",function(){return u.c}),r.d(t,"j",function(){return u.d}),r.d(t,"k",function(){return c.a});var l=[n.a,i.a,o.a,c.a,s.a,u.b,u.c,u.d,a.a,a.b]},function(e,t,r){"use strict";var n=r(0),i=r(254);r.d(t,"a",function(){return a}),r.d(t,"b",function(){return s}),r.d(t,"c",function(){return u}),r.d(t,"d",function(){return c});var o={},a=function(){function SwitchView(e,t){this._viewContainerRef=e,this._templateRef=t}return SwitchView.prototype.create=function(){this._viewContainerRef.createEmbeddedView(this._templateRef)},SwitchView.prototype.destroy=function(){this._viewContainerRef.clear()},SwitchView}(),s=function(){function NgSwitch(){this._useDefault=!1,this._valueViews=new Map,this._activeViews=[]}return Object.defineProperty(NgSwitch.prototype,"ngSwitch",{set:function(e){var t=this._valueViews.get(e);if(t)this._useDefault=!1;else{if(this._useDefault)return;this._useDefault=!0,t=this._valueViews.get(o)}this._emptyAllActiveViews(),this._activateViews(t),this._switchValue=e},enumerable:!0,configurable:!0}),NgSwitch.prototype._onCaseValueChanged=function(e,t,r){this._deregisterView(e,r),this._registerView(t,r),e===this._switchValue?(r.destroy(),i.b.remove(this._activeViews,r)):t===this._switchValue&&(this._useDefault&&(this._useDefault=!1,this._emptyAllActiveViews()),r.create(),this._activeViews.push(r)),0!==this._activeViews.length||this._useDefault||(this._useDefault=!0,this._activateViews(this._valueViews.get(o)))},NgSwitch.prototype._emptyAllActiveViews=function(){for(var e=this._activeViews,t=0;t<e.length;t++)e[t].destroy();this._activeViews=[]},NgSwitch.prototype._activateViews=function(e){if(e){for(var t=0;t<e.length;t++)e[t].create();this._activeViews=e}},NgSwitch.prototype._registerView=function(e,t){var r=this._valueViews.get(e);r||(r=[],this._valueViews.set(e,r)),r.push(t)},NgSwitch.prototype._deregisterView=function(e,t){if(e!==o){var r=this._valueViews.get(e);1==r.length?this._valueViews.delete(e):i.b.remove(r,t)}},NgSwitch.decorators=[{type:n.Directive,args:[{selector:"[ngSwitch]"}]}],NgSwitch.ctorParameters=[],NgSwitch.propDecorators={ngSwitch:[{type:n.Input}]},NgSwitch}(),u=function(){function NgSwitchCase(e,t,r){this._value=o,this._switch=r,this._view=new a(e,t)}return Object.defineProperty(NgSwitchCase.prototype,"ngSwitchCase",{set:function(e){this._switch._onCaseValueChanged(this._value,e,this._view),this._value=e},enumerable:!0,configurable:!0}),NgSwitchCase.decorators=[{type:n.Directive,args:[{selector:"[ngSwitchCase]"}]}],NgSwitchCase.ctorParameters=[{type:n.ViewContainerRef},{type:n.TemplateRef},{type:s,decorators:[{type:n.Host}]}],NgSwitchCase.propDecorators={ngSwitchCase:[{type:n.Input}]},NgSwitchCase}(),c=function(){function NgSwitchDefault(e,t,r){r._registerView(o,new a(e,t))}return NgSwitchDefault.decorators=[{type:n.Directive,args:[{selector:"[ngSwitchDefault]"}]}],NgSwitchDefault.ctorParameters=[{type:n.ViewContainerRef},{type:n.TemplateRef},{type:s,decorators:[{type:n.Host}]}],NgSwitchDefault}()},function(e,t,r){"use strict";function _flattenArray(e,t){if(r.i(n.a)(e))for(var i=0;i<e.length;i++){var o=e[i];Array.isArray(o)?_flattenArray(o,t):t.push(o)}return t}function isListLikeIterable(e){return!!r.i(n.c)(e)&&(Array.isArray(e)||!(e instanceof Map)&&r.i(n.d)()in e)}var n=r(22);r.d(t,"b",function(){return o}),t.a=isListLikeIterable;var i=function(){try{if((new Map).values().next)return function(e,t){return t?Array.from(e.values()):Array.from(e.keys())}}catch(e){}return function(e,t){var r=new Array(e.size),n=0;return e.forEach(function(e,i){r[n]=t?e:i,n++}),r}}(),o=(function(){function MapWrapper(){}return MapWrapper.createFromStringMap=function(e){var t=new Map;for(var r in e)t.set(r,e[r]);return t},MapWrapper.keys=function(e){return i(e,!1)},MapWrapper.values=function(e){return i(e,!0)},MapWrapper}(),function(){function StringMapWrapper(){}return StringMapWrapper.merge=function(e,t){for(var r={},n=0,i=Object.keys(e);n<i.length;n++){var o=i[n];r[o]=e[o]}for(var a=0,s=Object.keys(t);a<s.length;a++){var o=s[a];r[o]=t[o]}return r},StringMapWrapper.equals=function(e,t){var r=Object.keys(e),n=Object.keys(t);if(r.length!=n.length)return!1;for(var i=0;i<r.length;i++){var o=r[i];if(e[o]!==t[o])return!1}return!0},StringMapWrapper}(),function(){function ListWrapper(){}return ListWrapper.createFixedSize=function(e){return new Array(e)},ListWrapper.createGrowableSize=function(e){return new Array(e)},ListWrapper.clone=function(e){return e.slice(0)},ListWrapper.forEachWithIndex=function(e,t){for(var r=0;r<e.length;r++)t(e[r],r)},ListWrapper.first=function(e){return e?e[0]:null},ListWrapper.last=function(e){return e&&0!=e.length?e[e.length-1]:null},ListWrapper.indexOf=function(e,t,r){return void 0===r&&(r=0),e.indexOf(t,r)},ListWrapper.contains=function(e,t){return e.indexOf(t)!==-1},ListWrapper.reversed=function(e){var t=ListWrapper.clone(e);return t.reverse()},ListWrapper.concat=function(e,t){return e.concat(t)},ListWrapper.insert=function(e,t,r){e.splice(t,0,r)},ListWrapper.removeAt=function(e,t){var r=e[t];return e.splice(t,1),r},ListWrapper.removeAll=function(e,t){for(var r=0;r<t.length;++r){var n=e.indexOf(t[r]);e.splice(n,1)}},ListWrapper.remove=function(e,t){var r=e.indexOf(t);return r>-1&&(e.splice(r,1),!0)},ListWrapper.clear=function(e){e.length=0},ListWrapper.isEmpty=function(e){return 0==e.length},ListWrapper.fill=function(e,t,r,n){void 0===r&&(r=0),void 0===n&&(n=null),e.fill(t,r,null===n?e.length:n)},ListWrapper.equals=function(e,t){if(e.length!=t.length)return!1;for(var r=0;r<e.length;++r)if(e[r]!==t[r])return!1;return!0},ListWrapper.slice=function(e,t,r){return void 0===t&&(t=0),void 0===r&&(r=null),e.slice(t,null===r?void 0:r)},ListWrapper.splice=function(e,t,r){return e.splice(t,r)},ListWrapper.sort=function(e,t){r.i(n.a)(t)?e.sort(t):e.sort()},ListWrapper.toString=function(e){return e.toString()},ListWrapper.toJSON=function(e){return JSON.stringify(e)},ListWrapper.maximum=function(e,t){if(0==e.length)return null;for(var i=null,o=-(1/0),a=0;a<e.length;a++){var s=e[a];if(!r.i(n.b)(s)){var u=t(s);u>o&&(i=s,o=u)}}return i},ListWrapper.flatten=function(e){var t=[];return _flattenArray(e,t),t},ListWrapper.addAll=function(e,t){for(var r=0;r<t.length;r++)e.push(t[r])},ListWrapper}())},function(e,t,r){"use strict";function digitModifier(e){return function(t,r){var n=e(t,r);return 1==n.length?"0"+n:n}}function hourClockExtracter(e){return function(t,r){var n=e(t,r);return n.split(" ")[1]}}function hourExtracter(e){return function(t,r){var n=e(t,r);return n.split(" ")[0]}}function intlDateFormat(e,t,r){return new Intl.DateTimeFormat(t,r).format(e).replace(/[\u200e\u200f]/g,"")}function timeZoneGetter(e){var t={hour:"2-digit",hour12:!1,timeZoneName:e};return function(e,r){var n=intlDateFormat(e,r,t);return n?n.substring(3):""}}function hour12Modify(e,t){return e.hour12=t,e}function digitCondition(e,t){var r={};return r[e]=2==t?"2-digit":"numeric",r}function nameCondition(e,t){var r={};return r[e]=t<4?"short":"long",r}function combine(e){var t={};return e.forEach(function(e){Object.assign(t,e)}),t}function datePartGetterFactory(e){return function(t,r){return intlDateFormat(t,r,e)}}function dateFormatter(e,t,r){var n,i,c="",l=[];if(a[e])return a[e](t,r);if(u.has(e))l=u.get(e);else{for(o.exec(e);e;)n=o.exec(e),n?(l=concat(l,n,1),e=l.pop()):(l.push(e),e=null);u.set(e,l)}return l.forEach(function(e){i=s[e],c+=i?i(t,r):"''"===e?"'":e.replace(/(^'|'$)/g,"").replace(/''/g,"'")}),c}function concat(e,t,r){return e.concat(c.call(t,r))}r.d(t,"b",function(){return n}),r.d(t,"c",function(){return i}),r.d(t,"a",function(){return l});var n;!function(e){e[e.Decimal=0]="Decimal",e[e.Percent=1]="Percent",e[e.Currency=2]="Currency"}(n||(n={}));var i=function(){function NumberFormatter(){}return NumberFormatter.format=function(e,t,r,i){var o=void 0===i?{}:i,a=o.minimumIntegerDigits,s=o.minimumFractionDigits,u=o.maximumFractionDigits,c=o.currency,l=o.currencyAsSymbol,p=void 0!==l&&l,f={minimumIntegerDigits:a,minimumFractionDigits:s,maximumFractionDigits:u,style:n[r].toLowerCase()};return r==n.Currency&&(f.currency=c,f.currencyDisplay=p?"symbol":"code"), new Intl.NumberFormat(t,f).format(e)},NumberFormatter}(),o=/((?:[^yMLdHhmsazZEwGjJ']+)|(?:'(?:[^']|'')*')|(?:E+|y+|M+|L+|d+|H+|h+|J+|j+|m+|s+|a|z|Z|G+|w+))(.*)/,a={yMMMdjms:datePartGetterFactory(combine([digitCondition("year",1),nameCondition("month",3),digitCondition("day",1),digitCondition("hour",1),digitCondition("minute",1),digitCondition("second",1)])),yMdjm:datePartGetterFactory(combine([digitCondition("year",1),digitCondition("month",1),digitCondition("day",1),digitCondition("hour",1),digitCondition("minute",1)])),yMMMMEEEEd:datePartGetterFactory(combine([digitCondition("year",1),nameCondition("month",4),nameCondition("weekday",4),digitCondition("day",1)])),yMMMMd:datePartGetterFactory(combine([digitCondition("year",1),nameCondition("month",4),digitCondition("day",1)])),yMMMd:datePartGetterFactory(combine([digitCondition("year",1),nameCondition("month",3),digitCondition("day",1)])),yMd:datePartGetterFactory(combine([digitCondition("year",1),digitCondition("month",1),digitCondition("day",1)])),jms:datePartGetterFactory(combine([digitCondition("hour",1),digitCondition("second",1),digitCondition("minute",1)])),jm:datePartGetterFactory(combine([digitCondition("hour",1),digitCondition("minute",1)]))},s={yyyy:datePartGetterFactory(digitCondition("year",4)),yy:datePartGetterFactory(digitCondition("year",2)),y:datePartGetterFactory(digitCondition("year",1)),MMMM:datePartGetterFactory(nameCondition("month",4)),MMM:datePartGetterFactory(nameCondition("month",3)),MM:datePartGetterFactory(digitCondition("month",2)),M:datePartGetterFactory(digitCondition("month",1)),LLLL:datePartGetterFactory(nameCondition("month",4)),dd:datePartGetterFactory(digitCondition("day",2)),d:datePartGetterFactory(digitCondition("day",1)),HH:digitModifier(hourExtracter(datePartGetterFactory(hour12Modify(digitCondition("hour",2),!1)))),H:hourExtracter(datePartGetterFactory(hour12Modify(digitCondition("hour",1),!1))),hh:digitModifier(hourExtracter(datePartGetterFactory(hour12Modify(digitCondition("hour",2),!0)))),h:hourExtracter(datePartGetterFactory(hour12Modify(digitCondition("hour",1),!0))),jj:datePartGetterFactory(digitCondition("hour",2)),j:datePartGetterFactory(digitCondition("hour",1)),mm:digitModifier(datePartGetterFactory(digitCondition("minute",2))),m:datePartGetterFactory(digitCondition("minute",1)),ss:digitModifier(datePartGetterFactory(digitCondition("second",2))),s:datePartGetterFactory(digitCondition("second",1)),sss:datePartGetterFactory(digitCondition("second",3)),EEEE:datePartGetterFactory(nameCondition("weekday",4)),EEE:datePartGetterFactory(nameCondition("weekday",3)),EE:datePartGetterFactory(nameCondition("weekday",2)),E:datePartGetterFactory(nameCondition("weekday",1)),a:hourClockExtracter(datePartGetterFactory(hour12Modify(digitCondition("hour",1),!0))),Z:timeZoneGetter("short"),z:timeZoneGetter("long"),ww:datePartGetterFactory({}),w:datePartGetterFactory({}),G:datePartGetterFactory(nameCondition("era",1)),GG:datePartGetterFactory(nameCondition("era",2)),GGG:datePartGetterFactory(nameCondition("era",3)),GGGG:datePartGetterFactory(nameCondition("era",4))},u=new Map,c=[].slice,l=function(){function DateFormatter(){}return DateFormatter.format=function(e,t,r){return dateFormatter(r,e,t)},DateFormatter}()},function(e,t,r){"use strict";var n=r(424),i=r(425),o=r(426),a=r(427),s=r(428),u=r(429),c=r(430),l=r(431),p=r(432);r.d(t,"a",function(){return f}),r.d(t,"g",function(){return n.a}),r.d(t,"h",function(){return c.c}),r.d(t,"c",function(){return i.a}),r.d(t,"i",function(){return c.a}),r.d(t,"d",function(){return o.a}),r.d(t,"e",function(){return a.a}),r.d(t,"f",function(){return s.a}),r.d(t,"b",function(){return u.a}),r.d(t,"j",function(){return c.b}),r.d(t,"k",function(){return l.a}),r.d(t,"l",function(){return p.a});var f=[n.a,p.a,u.a,s.a,l.a,c.a,c.b,c.c,i.a,o.a,a.a]},function(e,t,r){"use strict";r.d(t,"b",function(){return a}),r.d(t,"d",function(){return s}),r.d(t,"h",function(){return u}),r.d(t,"g",function(){return c}),r.d(t,"a",function(){return l}),r.d(t,"c",function(){return p}),r.d(t,"i",function(){return f}),r.d(t,"e",function(){return h}),r.d(t,"j",function(){return d}),r.d(t,"f",function(){return m});var n=this&&this.__extends||function(e,t){function __(){this.constructor=e}for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r]);e.prototype=null===t?Object.create(t):(__.prototype=t.prototype,new __)},i=function(){function AnimationAst(){this.startTime=0,this.playTime=0}return AnimationAst}(),o=function(e){function AnimationStateAst(){e.apply(this,arguments)}return n(AnimationStateAst,e),AnimationStateAst}(i),a=function(e){function AnimationEntryAst(t,r,n){e.call(this),this.name=t,this.stateDeclarations=r,this.stateTransitions=n}return n(AnimationEntryAst,e),AnimationEntryAst.prototype.visit=function(e,t){return e.visitAnimationEntry(this,t)},AnimationEntryAst}(i),s=function(e){function AnimationStateDeclarationAst(t,r){e.call(this),this.stateName=t,this.styles=r}return n(AnimationStateDeclarationAst,e),AnimationStateDeclarationAst.prototype.visit=function(e,t){return e.visitAnimationStateDeclaration(this,t)},AnimationStateDeclarationAst}(o),u=function(){function AnimationStateTransitionExpression(e,t){this.fromState=e,this.toState=t}return AnimationStateTransitionExpression}(),c=function(e){function AnimationStateTransitionAst(t,r){e.call(this),this.stateChanges=t,this.animation=r}return n(AnimationStateTransitionAst,e),AnimationStateTransitionAst.prototype.visit=function(e,t){return e.visitAnimationStateTransition(this,t)},AnimationStateTransitionAst}(o),l=function(e){function AnimationStepAst(t,r,n,i,o){e.call(this),this.startingStyles=t,this.keyframes=r,this.duration=n,this.delay=i,this.easing=o}return n(AnimationStepAst,e),AnimationStepAst.prototype.visit=function(e,t){return e.visitAnimationStep(this,t)},AnimationStepAst}(i),p=function(e){function AnimationStylesAst(t){e.call(this),this.styles=t}return n(AnimationStylesAst,e),AnimationStylesAst.prototype.visit=function(e,t){return e.visitAnimationStyles(this,t)},AnimationStylesAst}(i),f=function(e){function AnimationKeyframeAst(t,r){e.call(this),this.offset=t,this.styles=r}return n(AnimationKeyframeAst,e),AnimationKeyframeAst.prototype.visit=function(e,t){return e.visitAnimationKeyframe(this,t)},AnimationKeyframeAst}(i),h=function(e){function AnimationWithStepsAst(t){e.call(this),this.steps=t}return n(AnimationWithStepsAst,e),AnimationWithStepsAst}(i),d=function(e){function AnimationGroupAst(t){e.call(this,t)}return n(AnimationGroupAst,e),AnimationGroupAst.prototype.visit=function(e,t){return e.visitAnimationGroup(this,t)},AnimationGroupAst}(h),m=function(e){function AnimationSequenceAst(t){e.call(this,t)}return n(AnimationSequenceAst,e),AnimationSequenceAst.prototype.visit=function(e,t){return e.visitAnimationSequence(this,t)},AnimationSequenceAst}(h)},function(e,t,r){"use strict";function _compareToAnimationStateExpr(e,t){var r=o.a(a.E);switch(t){case a.E:return e.equals(r);case a.C:return o.a(!0);default:return e.equals(o.a(t))}}function _isEndStateAnimateStep(e){if(e instanceof s.a&&e.duration>0&&2==e.keyframes.length){var t=_getStylesArray(e.keyframes[0])[0],r=_getStylesArray(e.keyframes[1])[0];return 0===Object.keys(t).length&&0===Object.keys(r).length}return!1}function _getStylesArray(e){return e.styles.styles}var n=r(2),i=r(13),o=r(8),a=r(14),s=r(257);r.d(t,"a",function(){return c});var u=function(){function AnimationEntryCompileResult(e,t,r){this.name=e,this.statements=t,this.fnExp=r}return AnimationEntryCompileResult}(),c=function(){function AnimationCompiler(){}return AnimationCompiler.prototype.compile=function(e,t){return t.map(function(t){var r=e+"_"+t.name,n=new E(t.name,r);return n.build(t)})},AnimationCompiler}(),l=o.e("element"),p=o.e("defaultStateStyles"),f=o.e("view"),h=f.prop("animationContext"),d=f.prop("renderer"),m=o.e("currentState"),v=o.e("nextState"),y=o.e("player"),g=o.e("totalTime"),_=o.e("startStateStyles"),b=o.e("endStateStyles"),w=o.e("collectedStyles"),C=o.f([]),E=function(){function _AnimationBuilder(e,t){this.animationName=e,this._fnVarName=t+"_factory",this._statesMapVarName=t+"_states",this._statesMapVar=o.e(this._statesMapVarName)}return _AnimationBuilder.prototype.visitAnimationStyles=function(e,t){var n=[];return t.isExpectingFirstStyleStep&&(n.push(_),t.isExpectingFirstStyleStep=!1),e.styles.forEach(function(e){var t=Object.keys(e).map(function(t){return[t,o.a(e[t])]});n.push(o.f(t))}),o.b(r.i(i.d)(i.b.AnimationStyles)).instantiate([o.b(r.i(i.d)(i.b.collectAndResolveStyles)).callFn([w,o.g(n)])])},_AnimationBuilder.prototype.visitAnimationKeyframe=function(e,t){return o.b(r.i(i.d)(i.b.AnimationKeyframe)).instantiate([o.a(e.offset),e.styles.visit(this,t)])},_AnimationBuilder.prototype.visitAnimationStep=function(e,t){var r=this;if(t.endStateAnimateStep===e)return this._visitEndStateAnimation(e,t);var n=e.startingStyles.visit(this,t),i=e.keyframes.map(function(e){return e.visit(r,t)});return this._callAnimateMethod(e,n,o.g(i),t)},_AnimationBuilder.prototype._visitEndStateAnimation=function(e,t){var n=this,a=e.startingStyles.visit(this,t),s=e.keyframes.map(function(e){return e.visit(n,t)}),u=o.b(r.i(i.d)(i.b.balanceAnimationKeyframes)).callFn([w,b,o.g(s)]);return this._callAnimateMethod(e,a,u,t)},_AnimationBuilder.prototype._callAnimateMethod=function(e,t,r,n){return n.totalTransitionTime+=e.duration+e.delay,d.callMethod("animate",[l,t,r,o.a(e.duration),o.a(e.delay),o.a(e.easing)])},_AnimationBuilder.prototype.visitAnimationSequence=function(e,t){var n=this,a=e.steps.map(function(e){return e.visit(n,t)});return o.b(r.i(i.d)(i.b.AnimationSequencePlayer)).instantiate([o.g(a)])},_AnimationBuilder.prototype.visitAnimationGroup=function(e,t){var n=this,a=e.steps.map(function(e){return e.visit(n,t)});return o.b(r.i(i.d)(i.b.AnimationGroupPlayer)).instantiate([o.g(a)])},_AnimationBuilder.prototype.visitAnimationStateDeclaration=function(e,t){var r={};_getStylesArray(e).forEach(function(e){Object.keys(e).forEach(function(t){r[t]=e[t]})}),t.stateMap.registerState(e.stateName,r)},_AnimationBuilder.prototype.visitAnimationStateTransition=function(e,t){var r=e.animation.steps,n=r[r.length-1];_isEndStateAnimateStep(n)&&(t.endStateAnimateStep=n),t.totalTransitionTime=0,t.isExpectingFirstStyleStep=!0;var i=[];e.stateChanges.forEach(function(e){i.push(_compareToAnimationStateExpr(m,e.fromState).and(_compareToAnimationStateExpr(v,e.toState))),e.fromState!=a.C&&t.stateMap.registerState(e.fromState),e.toState!=a.C&&t.stateMap.registerState(e.toState)});var s=e.animation.visit(this,t),u=i.reduce(function(e,t){return e.or(t)}),c=y.equals(o.h).and(u),l=y.set(s).toStmt(),p=g.set(o.a(t.totalTransitionTime)).toStmt();return new o.i(c,[l,p])},_AnimationBuilder.prototype.visitAnimationEntry=function(e,t){var n=this;e.stateDeclarations.forEach(function(e){return e.visit(n,t)}),t.stateMap.registerState(a.D,{});var s=[];s.push(h.callMethod("cancelActiveAnimation",[l,o.a(this.animationName),v.equals(o.a(a.E))]).toStmt()),s.push(w.set(C).toDeclStmt()),s.push(y.set(o.h).toDeclStmt()),s.push(g.set(o.a(0)).toDeclStmt()),s.push(p.set(this._statesMapVar.key(o.a(a.D))).toDeclStmt()),s.push(_.set(this._statesMapVar.key(m)).toDeclStmt()),s.push(new o.i(_.equals(o.h),[_.set(p).toStmt()])),s.push(b.set(this._statesMapVar.key(v)).toDeclStmt()),s.push(new o.i(b.equals(o.h),[b.set(p).toStmt()]));var u=o.b(r.i(i.d)(i.b.renderStyles));return s.push(u.callFn([l,d,o.b(r.i(i.d)(i.b.clearStyles)).callFn([_])]).toStmt()),e.stateTransitions.forEach(function(e){return s.push(e.visit(n,t))}),s.push(new o.i(y.equals(o.h),[y.set(o.b(r.i(i.d)(i.b.NoOpAnimationPlayer)).instantiate([])).toStmt()])),s.push(y.callMethod("onDone",[o.j([],[u.callFn([l,d,o.b(r.i(i.d)(i.b.prepareFinalAnimationStyles)).callFn([_,b])]).toStmt()])]).toStmt()),s.push(h.callMethod("queueAnimation",[l,o.a(this.animationName),y]).toStmt()),s.push(new o.k(o.b(r.i(i.d)(i.b.AnimationTransition)).instantiate([y,m,v,g]))),o.j([new o.l(f.name,o.c(r.i(i.d)(i.b.AppView),[o.m])),new o.l(l.name,o.m),new o.l(m.name,o.m),new o.l(v.name,o.m)],s,o.c(r.i(i.d)(i.b.AnimationTransition)))},_AnimationBuilder.prototype.build=function(e){var t=new S,i=e.visit(this,t).toDeclStmt(this._fnVarName),a=o.e(this._fnVarName),s=[];Object.keys(t.stateMap.states).forEach(function(e){var i=t.stateMap.states[e],a=C;if(r.i(n.a)(i)){var u=[];Object.keys(i).forEach(function(e){u.push([e,o.a(i[e])])}),a=o.f(u)}s.push([e,a])});var c=this._statesMapVar.set(o.f(s)).toDeclStmt(),l=[c,i];return new u(this.animationName,l,a)},_AnimationBuilder}(),S=function(){function _AnimationBuilderContext(){this.stateMap=new A,this.endStateAnimateStep=null,this.isExpectingFirstStyleStep=!1,this.totalTransitionTime=0}return _AnimationBuilderContext}(),A=function(){function _AnimationBuilderStateMap(){this._states={}}return Object.defineProperty(_AnimationBuilderStateMap.prototype,"states",{get:function(){return this._states},enumerable:!0,configurable:!0}),_AnimationBuilderStateMap.prototype.registerState=function(e,t){void 0===t&&(t=null);var r=this._states[e];r||(this._states[e]=t)},_AnimationBuilderStateMap}()},function(e,t,r){"use strict";function _parseAnimationDeclarationStates(e,t){var r=[];e.styles.styles.forEach(function(e){"object"==typeof e&&null!==e?r.push(e):t.push(new d("State based animations cannot contain references to other states"))});var n=new u.c(r),i=e.stateNameExpr.split(/\s*,\s*/);return i.map(function(e){return new u.d(e,n)})}function _parseAnimationStateTransition(e,t,r){var n=new c.a,i=[],o=e.stateChangeExpr.split(/\s*,\s*/);o.forEach(function(e){i.push.apply(i,_parseAnimationTransitionExpr(e,r))});var a=_normalizeAnimationEntry(e.steps),s=_normalizeStyleSteps(a,t,r),l=_parseTransitionAnimation(s,0,n,t,r);0==r.length&&_fillAnimationAstStartingKeyframes(l,n,r);var p=l instanceof u.e?l:new u.f([l]);return new u.g(i,p)}function _parseAnimationAlias(e,t){switch(e){case":enter":return"void => *";case":leave":return"* => void";default:return t.push(new d('the transition alias value "'+e+'" is not supported')),"* => *"}}function _parseAnimationTransitionExpr(e,t){var n=[];":"==e[0]&&(e=_parseAnimationAlias(e,t));var i=e.match(/^(\*|[-\w]+)\s*(<?[=-]>)\s*(\*|[-\w]+)$/);if(!r.i(o.a)(i)||i.length<4)return t.push(new d("the provided "+e+" is not of a supported format")),n;var a=i[1],c=i[2],l=i[3];n.push(new u.h(a,l));var p=a==s.C&&l==s.C;return"<"!=c[0]||p||n.push(new u.h(l,a)),n}function _normalizeAnimationEntry(e){return Array.isArray(e)?new n.h(e):e}function _normalizeStyleMetadata(e,t,r){var n=[];return e.styles.forEach(function(e){"string"==typeof e?i.a.addAll(n,_resolveStylesFromState(e,t,r)):n.push(e)}),n}function _normalizeStyleSteps(e,t,r){var i=_normalizeStyleStepEntry(e,t,r);return e instanceof n.i?new n.i(i):new n.h(i)}function _mergeAnimationStyles(e,t){if("object"==typeof t&&null!==t&&e.length>0){var r=e.length-1,n=e[r];if("object"==typeof n&&null!==n)return void(e[r]=i.c.merge(n,t))}e.push(t)}function _normalizeStyleStepEntry(e,t,i){var a;if(!(e instanceof n.j))return[e];a=e.steps;var s,u=[];return a.forEach(function(e){if(e instanceof n.k)r.i(o.a)(s)||(s=[]),_normalizeStyleMetadata(e,t,i).forEach(function(e){_mergeAnimationStyles(s,e)});else{if(r.i(o.a)(s)&&(u.push(new n.k(0,s)),s=null),e instanceof n.l){var a=e.styles;a instanceof n.k?a.styles=_normalizeStyleMetadata(a,t,i):a instanceof n.m&&a.steps.forEach(function(e){e.styles=_normalizeStyleMetadata(e,t,i)})}else if(e instanceof n.j){var c=_normalizeStyleStepEntry(e,t,i);e=e instanceof n.i?new n.i(c):new n.h(c)}u.push(e)}}),r.i(o.a)(s)&&u.push(new n.k(0,s)),u}function _resolveStylesFromState(e,t,n){var i=[];if(":"!=e[0])n.push(new d('Animation states via styles must be prefixed with a ":"'));else{var a=e.substring(1),s=t[a];r.i(o.a)(s)?s.styles.forEach(function(e){"object"==typeof e&&null!==e&&i.push(e)}):n.push(new d('Unable to apply styles due to missing a state: "'+a+'"'))}return i}function _parseAnimationKeyframes(e,t,n,a,c){var l=e.steps.length,h=0;e.steps.forEach(function(e){return h+=r.i(o.a)(e.offset)?1:0}),h>0&&h<l&&(c.push(new d("Not all style() entries contain an offset for the provided keyframe()")),h=l);var m=l-1,v=0==h?1/m:0,y=[],g=0,_=!1,b=0;e.steps.forEach(function(e){var t=e.offset,n={};e.styles.forEach(function(e){Object.keys(e).forEach(function(t){"offset"!=t&&(n[t]=e[t])})}),r.i(o.a)(t)?_=_||t<b:t=g==m?f:v*g,y.push([t,n]),b=t,g++}),_&&i.a.sort(y,function(e,t){return e[0]<=t[0]?-1:1});var w=y[0];w[0]!=p&&i.a.insert(y,0,w=[p,{}]);var C=w[1];m=y.length-1;var E=y[m];E[0]!=f&&(y.push(E=[f,{}]),m++);for(var S=E[1],A=1;A<=m;A++){var P=y[A],x=P[1];Object.keys(x).forEach(function(e){r.i(o.a)(C[e])||(C[e]=s.F)})}for(var T=function(e){var t=y[e],n=t[1];Object.keys(n).forEach(function(e){r.i(o.a)(S[e])||(S[e]=n[e])})},A=m-1;A>=0;A--)T(A);return y.map(function(e){return new u.i(e[0],new u.c([e[1]]))})}function _parseTransitionAnimation(e,t,a,s,c){var l,p=0,h=t;if(e instanceof n.j){var d,m=0,v=[],y=e instanceof n.i;if(e.steps.forEach(function(e){var l=y?h:t;if(e instanceof n.k)return e.styles.forEach(function(e){var t=e;Object.keys(t).forEach(function(e){a.insertAtTime(e,l,t[e])})}),void(d=e.styles);var f=_parseTransitionAnimation(e,l,a,s,c);if(r.i(o.a)(d)){if(e instanceof n.j){var g=new u.c(d);v.push(new u.a(g,[],0,0,""))}else{var _=f;i.a.addAll(_.startingStyles.styles,d)}d=null}var b=f.playTime;t+=b,p+=b,m=Math.max(b,m),v.push(f)}),r.i(o.a)(d)){var g=new u.c(d);v.push(new u.a(g,[],0,0,""))}y?(l=new u.j(v),p=m,t=h+p):l=new u.f(v)}else if(e instanceof n.l){var _,b=_parseTimeExpression(e.timings,c),w=e.styles;if(w instanceof n.m)_=_parseAnimationKeyframes(w,t,a,s,c);else{var C=w,E=f,S=new u.c(C.styles),A=new u.i(E,S);_=[A]}l=new u.a(new u.c([]),_,b.duration,b.delay,b.easing),p=b.duration+b.delay,t+=p,_.forEach(function(e){return e.styles.styles.forEach(function(e){return Object.keys(e).forEach(function(r){a.insertAtTime(r,t,e[r])})})})}else l=new u.a(null,[],0,0,"");return l.playTime=p,l.startTime=h,l}function _fillAnimationAstStartingKeyframes(e,t,r){if(e instanceof u.a&&e.keyframes.length>0){var n=e.keyframes;if(1==n.length){var i=n[0],o=_createStartKeyframeFromEndKeyframe(i,e.startTime,e.playTime,t,r);e.keyframes=[o,i]}}else e instanceof u.e&&e.steps.forEach(function(e){return _fillAnimationAstStartingKeyframes(e,t,r)})}function _parseTimeExpression(e,t){var n,i=/^([\.\d]+)(m?s)(?:\s+([\.\d]+)(m?s))?(?:\s+([-a-z]+(?:\(.+?\))?))?/i,a=0,s=null;if("string"==typeof e){var u=e.match(i);if(null===u)return t.push(new d('The provided timing value "'+e+'" is invalid.')),new y(0,0,null);var c=parseFloat(u[1]),l=u[2];"s"==l&&(c*=h),n=Math.floor(c);var p=u[3],f=u[4];if(r.i(o.a)(p)){var m=parseFloat(p);r.i(o.a)(f)&&"s"==f&&(m*=h),a=Math.floor(m)}var v=u[5];r.i(o.b)(v)||(s=v)}else n=e;return new y(n,a,s)}function _createStartKeyframeFromEndKeyframe(e,t,n,i,a){var c={},l=t+n;return e.styles.styles.forEach(function(e){Object.keys(e).forEach(function(n){var u=e[n];if("offset"!=n){var p,f,h,m=i.indexOfAtOrBeforeTime(n,t);r.i(o.a)(m)?(p=i.getByIndex(n,m),h=p.value,f=i.getByIndex(n,m+1)):h=s.F,r.i(o.a)(f)&&!f.matches(l,u)&&a.push(new d('The animated CSS property "'+n+'" unexpectedly changes between steps "'+p.time+'ms" and "'+l+'ms" at "'+f.time+'ms"')),c[n]=h}})}),new u.i(p,new u.c([c]))}var n=r(17),i=r(18),o=r(2),a=r(42),s=r(14),u=r(257),c=r(434);r.d(t,"a",function(){return v});var l=this&&this.__extends||function(e,t){function __(){this.constructor=e}for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r]);e.prototype=null===t?Object.create(t):(__.prototype=t.prototype,new __)},p=0,f=1,h=1e3,d=function(e){function AnimationParseError(t){e.call(this,null,t)}return l(AnimationParseError,e),AnimationParseError.prototype.toString=function(){return""+this.msg},AnimationParseError}(a.a),m=function(){function AnimationEntryParseResult(e,t){this.ast=e,this.errors=t}return AnimationEntryParseResult}(),v=function(){function AnimationParser(){}return AnimationParser.prototype.parseComponent=function(e){var t=this,r=[],n=e.type.name,i=new Set,o=e.template.animations.map(function(e){var o=t.parseEntry(e),a=o.ast,s=a.name;if(i.has(s)?o.errors.push(new d('The animation trigger "'+s+'" has already been registered for the '+n+" component")):i.add(s),o.errors.length>0){var u='- Unable to parse the animation sequence for "'+s+'" on the '+n+" component due to the following errors:";o.errors.forEach(function(e){u+="\n-- "+e.msg}),r.push(u)}return a});if(r.length>0){var a=r.join("\n");throw new Error("Animation parse errors:\n"+a)}return o},AnimationParser.prototype.parseEntry=function(e){var t=[],r={},i=[],o=[];e.definitions.forEach(function(e){e instanceof n.g?_parseAnimationDeclarationStates(e,t).forEach(function(e){o.push(e),r[e.stateName]=e.styles}):i.push(e)});var a=i.map(function(e){return _parseAnimationStateTransition(e,r,t)}),s=new u.b(e.name,o,a);return new m(s,t)},AnimationParser}(),y=function(){function _AnimationTimings(e,t,r){this.duration=e,this.delay=t,this.easing=r}return _AnimationTimings}()},function(e,t,r){"use strict";function assertArrayOfStrings(e,t){if(r.i(n.isDevMode)()&&!r.i(i.b)(t)){if(!Array.isArray(t))throw new Error("Expected '"+e+"' to be an array of strings.");for(var o=0;o<t.length;o+=1)if("string"!=typeof t[o])throw new Error("Expected '"+e+"' to be an array of strings.")}}function assertInterpolationSymbols(e,t){if(r.i(i.a)(t)&&(!Array.isArray(t)||2!=t.length))throw new Error("Expected '"+e+"' to be an array, [start, end].");if(r.i(n.isDevMode)()&&!r.i(i.b)(t)){var a=t[0],s=t[1];o.forEach(function(e){if(e.test(a)||e.test(s))throw new Error("['"+a+"', '"+s+"'] contains unusable interpolation symbol.")})}}var n=r(0),i=r(2);t.b=assertArrayOfStrings,t.a=assertInterpolationSymbols;var o=[/^\s*$/,/[<>]/,/^[{}]$/,/&(#|[a-z])/i,/^\/\//]},function(e,t,r){"use strict";function extractMessages(e,t,r,n){var i=new d(r,n);return i.extract(e,t)}function mergeTranslations(e,t,r,n,i){var o=new d(n,i);return o.merge(e,t,r)}function _isOpeningComment(e){return e instanceof n.a&&e.value&&e.value.startsWith("i18n")}function _isClosingComment(e){return e instanceof n.a&&e.value&&"/i18n"===e.value}function _getI18nAttr(e){return e.attrs.find(function(e){return e.name===l})||null}function _splitMeaningAndDesc(e){if(!e)return["",""];var t=e.indexOf("|");return t==-1?["",e]:[e.slice(0,t),e.slice(t+1)]}var n=r(52),i=r(75),o=r(165),a=r(262),s=r(436),u=r(166);t.a=extractMessages,t.b=mergeTranslations;var c,l="i18n",p="i18n-",f=/^i18n:?/,h=function(){function ExtractionResult(e,t){this.messages=e,this.errors=t}return ExtractionResult}();!function(e){e[e.Extract=0]="Extract",e[e.Merge=1]="Merge"}(c||(c={}));var d=function(){function _Visitor(e,t){this._implicitTags=e,this._implicitAttrs=t}return _Visitor.prototype.extract=function(e,t){var r=this;return this._init(c.Extract,t),e.forEach(function(e){return e.visit(r,null)}),this._inI18nBlock&&this._reportError(e[e.length-1],"Unclosed block"),new h(this._messages,this._errors)},_Visitor.prototype.merge=function(e,t,r){this._init(c.Merge,r),this._translations=t;var o=new n.e("wrapper",[],e,null,null,null),a=o.visit(this,null);return this._inI18nBlock&&this._reportError(e[e.length-1],"Unclosed block"),new i.a(a.children,this._errors)},_Visitor.prototype.visitExpansionCase=function(e,t){var r=n.g(this,e.expression,t);if(this._mode===c.Merge)return new n.c(e.value,r,e.sourceSpan,e.valueSourceSpan,e.expSourceSpan)},_Visitor.prototype.visitExpansion=function(e,t){this._mayBeAddBlockChildren(e);var r=this._inIcu;this._inIcu||(this._isInTranslatableSection&&this._addMessage([e]),this._inIcu=!0);var i=n.g(this,e.cases,t);return this._mode===c.Merge&&(e=new n.b(e.switchValue,e.type,i,e.sourceSpan,e.switchValueSourceSpan)),this._inIcu=r,e},_Visitor.prototype.visitComment=function(e,t){var r=_isOpeningComment(e);if(r&&this._isInTranslatableSection)return void this._reportError(e,"Could not start a block inside a translatable section");var i=_isClosingComment(e);if(i&&!this._inI18nBlock)return void this._reportError(e,"Trying to close an unopened block");if(!this._inI18nNode&&!this._inIcu)if(this._inI18nBlock){if(i){if(this._depth==this._blockStartDepth){this._closeTranslatableSection(e,this._blockChildren),this._inI18nBlock=!1;var o=this._addMessage(this._blockChildren,this._blockMeaningAndDesc),a=this._translateMessage(e,o);return n.g(this,a)}return void this._reportError(e,"I18N blocks should not cross element boundaries")}}else r&&(this._inI18nBlock=!0,this._blockStartDepth=this._depth,this._blockChildren=[],this._blockMeaningAndDesc=e.value.replace(f,"").trim(),this._openTranslatableSection(e))},_Visitor.prototype.visitText=function(e,t){return this._isInTranslatableSection&&this._mayBeAddBlockChildren(e),e},_Visitor.prototype.visitElement=function(e,t){var r=this;this._mayBeAddBlockChildren(e),this._depth++;var i,o=this._inI18nNode,a=this._inImplicitNode,s=_getI18nAttr(e),u=this._implicitTags.some(function(t){return e.name===t})&&!this._inIcu&&!this._isInTranslatableSection,l=!a&&u;if(this._inImplicitNode=this._inImplicitNode||u,this._isInTranslatableSection||this._inIcu)(s||l)&&this._reportError(e,"Could not mark an element as translatable inside a translatable section"),this._mode==c.Extract&&n.g(this,e.children),this._mode==c.Merge&&(i=[],e.children.forEach(function(e){var n=e.visit(r,t);n&&!r._isInTranslatableSection&&(i=i.concat(n))}));else{if(s){this._inI18nNode=!0;var p=this._addMessage(e.children,s.value);i=this._translateMessage(e,p)}else if(l){this._inI18nNode=!0;var p=this._addMessage(e.children);i=this._translateMessage(e,p)}if(this._mode==c.Extract){var f=s||l;f&&this._openTranslatableSection(e),n.g(this,e.children),f&&this._closeTranslatableSection(e,e.children)}this._mode!==c.Merge||s||l||(i=[],e.children.forEach(function(e){var n=e.visit(r,t);n&&!r._isInTranslatableSection&&(i=i.concat(n))}))}if(this._visitAttributesOf(e),this._depth--,this._inI18nNode=o,this._inImplicitNode=a,this._mode===c.Merge){var h=this._translateAttributes(e);return new n.e(e.name,h,i,e.sourceSpan,e.startSourceSpan,e.endSourceSpan)}},_Visitor.prototype.visitAttribute=function(e,t){throw new Error("unreachable code")},_Visitor.prototype._init=function(e,t){this._mode=e,this._inI18nBlock=!1,this._inI18nNode=!1,this._depth=0,this._inIcu=!1,this._msgCountAtSectionStart=void 0,this._errors=[],this._messages=[],this._inImplicitNode=!1,this._createI18nMessage=r.i(s.a)(t)},_Visitor.prototype._visitAttributesOf=function(e){var t=this,r={},n=this._implicitAttrs[e.name]||[];e.attrs.filter(function(e){return e.name.startsWith(p)}).forEach(function(e){return r[e.name.slice(p.length)]=e.value}),e.attrs.forEach(function(e){e.name in r?t._addMessage([e],r[e.name]):n.some(function(t){return e.name===t})&&t._addMessage([e])})},_Visitor.prototype._addMessage=function(e,t){if(!(0==e.length||1==e.length&&e[0]instanceof n.f&&!e[0].value)){var r=_splitMeaningAndDesc(t),i=r[0],o=r[1],a=this._createI18nMessage(e,i,o);return this._messages.push(a),a}},_Visitor.prototype._translateMessage=function(e,t){if(t&&this._mode===c.Merge){var n=r.i(o.a)(t),i=this._translations.get(n);if(i)return i;this._reportError(e,'Translation unavailable for message id="'+n+'"')}return[]},_Visitor.prototype._translateAttributes=function(e){var t=this,i=e.attrs,a={};i.forEach(function(e){e.name.startsWith(p)&&(a[e.name.slice(p.length)]=_splitMeaningAndDesc(e.value)[0])});var s=[];return i.forEach(function(i){if(i.name!==l&&!i.name.startsWith(p))if(i.value&&""!=i.value&&a.hasOwnProperty(i.name)){var u=a[i.name],c=t._createI18nMessage([i],u,""),f=r.i(o.a)(c),h=t._translations.get(f);if(h)if(h[0]instanceof n.d){var d=h[0].value;s.push(new n.f(i.name,d,i.sourceSpan))}else t._reportError(e,'Unexpected translation for attribute "'+i.name+'" (id="'+f+'")');else t._reportError(e,'Translation unavailable for attribute "'+i.name+'" (id="'+f+'")')}else s.push(i)}),s},_Visitor.prototype._mayBeAddBlockChildren=function(e){this._inI18nBlock&&!this._inIcu&&this._depth==this._blockStartDepth&&this._blockChildren.push(e)},_Visitor.prototype._openTranslatableSection=function(e){this._isInTranslatableSection?this._reportError(e,"Unexpected section start"):this._msgCountAtSectionStart=this._messages.length},Object.defineProperty(_Visitor.prototype,"_isInTranslatableSection",{get:function(){return void 0!==this._msgCountAtSectionStart},enumerable:!0,configurable:!0}),_Visitor.prototype._closeTranslatableSection=function(e,t){if(!this._isInTranslatableSection)return void this._reportError(e,"Unexpected section end");var r=this._msgCountAtSectionStart,i=t.reduce(function(e,t){return e+(t instanceof n.a?0:1)},0);if(1==i)for(var o=this._messages.length-1;o>=r;o--){var s=this._messages[o].nodes;if(!(1==s.length&&s[0]instanceof a.f)){this._messages.splice(o,1);break}}this._msgCountAtSectionStart=void 0},_Visitor.prototype._reportError=function(e,t){this._errors.push(new u.a(e.sourceSpan,t))},_Visitor}()},function(e,t,r){"use strict";r.d(t,"a",function(){return n}),r.d(t,"f",function(){return i}),r.d(t,"d",function(){return o}),r.d(t,"c",function(){return a}),r.d(t,"b",function(){return s}),r.d(t,"g",function(){return u}),r.d(t,"e",function(){return c});var n=function(){function Message(e,t,r,n,i){this.nodes=e,this.placeholders=t,this.placeholderToMsgIds=r,this.meaning=n,this.description=i}return Message}(),i=function(){function Text(e,t){this.value=e,this.sourceSpan=t}return Text.prototype.visit=function(e,t){return e.visitText(this,t)},Text}(),o=function(){function Container(e,t){this.children=e,this.sourceSpan=t}return Container.prototype.visit=function(e,t){return e.visitContainer(this,t)},Container}(),a=function(){function Icu(e,t,r,n){this.expression=e,this.type=t,this.cases=r,this.sourceSpan=n}return Icu.prototype.visit=function(e,t){return e.visitIcu(this,t)},Icu}(),s=function(){function TagPlaceholder(e,t,r,n,i,o,a){this.tag=e,this.attrs=t,this.startName=r,this.closeName=n,this.children=i,this.isVoid=o,this.sourceSpan=a}return TagPlaceholder.prototype.visit=function(e,t){return e.visitTagPlaceholder(this,t)},TagPlaceholder}(),u=function(){function Placeholder(e,t,r){void 0===t&&(t=""),this.value=e,this.name=t,this.sourceSpan=r}return Placeholder.prototype.visit=function(e,t){return e.visitPlaceholder(this,t)},Placeholder}(),c=function(){function IcuPlaceholder(e,t,r){void 0===t&&(t=""),this.value=e,this.name=t,this.sourceSpan=r}return IcuPlaceholder.prototype.visit=function(e,t){return e.visitIcuPlaceholder(this,t)},IcuPlaceholder}()},function(e,t,r){"use strict";var n=r(41),i=r(75),o=r(261),a=r(265),s=r(267),u=r(268),c=r(270),l=r(438);r.d(t,"a",function(){return p});var p=function(){function I18NHtmlParser(e,t,r){this._htmlParser=e,this._translations=t,this._translationsFormat=r}return I18NHtmlParser.prototype.parse=function(e,t,s,u){void 0===s&&(s=!1),void 0===u&&(u=n.a);var c=this._htmlParser.parse(e,t,s,u);if(!this._translations||""===this._translations)return c;var p=new a.a(this._htmlParser,[],{}),f=p.updateFromTemplate(e,t,u);if(f&&f.length)return new i.a(c.rootNodes,c.errors.concat(f));var h=this._createSerializer(u),d=l.a.load(this._translations,t,p,h);return r.i(o.b)(c.rootNodes,d,u,[],{})},I18NHtmlParser.prototype._createSerializer=function(e){var t=(this._translationsFormat||"xlf").toLowerCase();switch(t){case"xmb":return new u.a;case"xtb":return new c.a(this._htmlParser,e);case"xliff":case"xlf":default:return new s.a(this._htmlParser,e)}},I18NHtmlParser}()},function(e,t,r){"use strict";var n=r(263);r(265),r(267),r(268),r(270);r.d(t,"a",function(){return n.a})},function(e,t,r){"use strict";var n=r(165),i=r(261);r.d(t,"a",function(){return o});var o=function(){function MessageBundle(e,t,r){this._htmlParser=e,this._implicitTags=t,this._implicitAttrs=r,this._messageMap={}}return MessageBundle.prototype.updateFromTemplate=function(e,t,o){var a=this,s=this._htmlParser.parse(e,t,!0,o);if(s.errors.length)return s.errors;var u=r.i(i.a)(s.rootNodes,o,this._implicitTags,this._implicitAttrs);return u.errors.length?u.errors:void u.messages.forEach(function(e){ a._messageMap[r.i(n.a)(e)]=e})},MessageBundle.prototype.getMessageMap=function(){return this._messageMap},MessageBundle.prototype.write=function(e){return e.write(this._messageMap)},MessageBundle}()},function(e,t,r){"use strict";function extractPlaceholders(e){var t=e.getMessageMap(),r={};return Object.keys(t).forEach(function(e){r[e]=t[e].placeholders}),r}function extractPlaceholderToIds(e){var t=e.getMessageMap(),r={};return Object.keys(t).forEach(function(e){r[e]=t[e].placeholderToMsgIds}),r}t.a=extractPlaceholders,t.b=extractPlaceholderToIds},function(e,t,r){"use strict";function getCtypeForTag(e){switch(e.toLowerCase()){case"br":return"lb";case"img":return"image";default:return"x-"+e}}var n=r(18),i=r(52),o=r(271),a=r(166),s=r(266),u=r(269);r.d(t,"a",function(){return v});var c="1.2",l="urn:oasis:names:tc:xliff:document:1.2",p="en",f="x",h="source",d="target",m="trans-unit",v=function(){function Xliff(e,t){this._htmlParser=e,this._interpolationConfig=t}return Xliff.prototype.write=function(e){var t=new y,r=[];Object.keys(e).forEach(function(n){var i=e[n],o=new u.a(m,{id:n,datatype:"html"});o.children.push(new u.b(8),new u.a(h,{},t.serialize(i.nodes)),new u.b(8),new u.a(d)),i.description&&o.children.push(new u.b(8),new u.a("note",{priority:"1",from:"description"},[new u.c(i.description)])),i.meaning&&o.children.push(new u.b(8),new u.a("note",{priority:"1",from:"meaning"},[new u.c(i.meaning)])),o.children.push(new u.b(6)),r.push(new u.b(6),o)});var n=new u.a("body",{},r.concat([new u.b(4)])),i=new u.a("file",{"source-language":p,datatype:"plaintext",original:"ng2.template"},[new u.b(4),n,new u.b(2)]),o=new u.a("xliff",{version:c,xmlns:l},[new u.b(2),i,new u.b]);return u.d([new u.e({version:"1.0",encoding:"UTF-8"}),new u.b,o,new u.b])},Xliff.prototype.load=function(e,t,r){var n=this,i=(new o.a).parse(e,t);if(i.errors.length)throw new Error("xtb parse errors:\n"+i.errors.join("\n"));var a=(new g).parse(i.rootNodes,r),s=a.messages,u=a.errors;if(u.length)throw new Error("xtb parse errors:\n"+u.join("\n"));var c={},l=[];if(Object.keys(s).forEach(function(e){var r=n._htmlParser.parse(s[e],t,!0,n._interpolationConfig);l.push.apply(l,r.errors),c[e]=r.rootNodes}),l.length)throw new Error("xtb parse errors:\n"+l.join("\n"));return c},Xliff}(),y=function(){function _WriteVisitor(){}return _WriteVisitor.prototype.visitText=function(e,t){return[new u.c(e.value)]},_WriteVisitor.prototype.visitContainer=function(e,t){var r=this,n=[];return e.children.forEach(function(e){return n.push.apply(n,e.visit(r))}),n},_WriteVisitor.prototype.visitIcu=function(e,t){if(this._isInIcu)throw new Error("xliff does not support nested ICU messages");this._isInIcu=!0;var r=[];return this._isInIcu=!1,r},_WriteVisitor.prototype.visitTagPlaceholder=function(e,t){var r=getCtypeForTag(e.tag),n=new u.a(f,{id:e.startName,ctype:r});if(e.isVoid)return[n];var i=new u.a(f,{id:e.closeName,ctype:r});return[n].concat(this.serialize(e.children),[i])},_WriteVisitor.prototype.visitPlaceholder=function(e,t){return[new u.a(f,{id:e.name})]},_WriteVisitor.prototype.visitIcuPlaceholder=function(e,t){return[new u.a(f,{id:e.name})]},_WriteVisitor.prototype.serialize=function(e){var t=this;return this._isInIcu=!1,n.a.flatten(e.map(function(e){return e.visit(t)}))},_WriteVisitor}(),g=function(){function _LoadVisitor(){}return _LoadVisitor.prototype.parse=function(e,t){var n=this;this._messageNodes=[],this._translatedMessages={},this._msgId="",this._target=[],this._errors=[],i.g(this,e,null);var o=t.getMessageMap(),a=r.i(s.a)(t),u=r.i(s.b)(t);return this._messageNodes.filter(function(e){return o.hasOwnProperty(e[0])}).sort(function(e,t){return 0==Object.keys(o[e[0]].placeholderToMsgIds).length?-1:0==Object.keys(o[t[0]].placeholderToMsgIds).length?1:0}).forEach(function(e){var t=e[0];n._placeholders=a[t]||{},n._placeholderToIds=u[t]||{},n._translatedMessages[t]=i.g(n,e[1]).join("")}),{messages:this._translatedMessages,errors:this._errors}},_LoadVisitor.prototype.visitElement=function(e,t){switch(e.name){case m:this._target=null;var r=e.attrs.find(function(e){return"id"===e.name});r?this._msgId=r.value:this._addError(e,"<"+m+'> misses the "id" attribute'),i.g(this,e.children,null),null!==this._msgId&&this._messageNodes.push([this._msgId,this._target]);break;case h:break;case d:this._target=e.children;break;case f:var n=e.attrs.find(function(e){return"id"===e.name});if(n){var o=n.value;if(this._placeholders.hasOwnProperty(o))return this._placeholders[o];if(this._placeholderToIds.hasOwnProperty(o)&&this._translatedMessages.hasOwnProperty(this._placeholderToIds[o]))return this._translatedMessages[this._placeholderToIds[o]];this._addError(e,'The placeholder "'+o+'" does not exists in the source message')}else this._addError(e,"<"+f+'> misses the "id" attribute');break;default:i.g(this,e.children,null)}},_LoadVisitor.prototype.visitAttribute=function(e,t){throw new Error("unreachable code")},_LoadVisitor.prototype.visitText=function(e,t){return e.value},_LoadVisitor.prototype.visitComment=function(e,t){return""},_LoadVisitor.prototype.visitExpansion=function(e,t){throw new Error("unreachable code")},_LoadVisitor.prototype.visitExpansionCase=function(e,t){throw new Error("unreachable code")},_LoadVisitor.prototype._addError=function(e,t){this._errors.push(new a.a(e.sourceSpan,t))},_LoadVisitor}()},function(e,t,r){"use strict";var n=r(18),i=r(269);r.d(t,"a",function(){return l});var o="messagebundle",a="msg",s="ph",u="ex",c='<!ELEMENT messagebundle (msg)*>\n<!ATTLIST messagebundle class CDATA #IMPLIED>\n\n<!ELEMENT msg (#PCDATA|ph|source)*>\n<!ATTLIST msg id CDATA #IMPLIED>\n<!ATTLIST msg seq CDATA #IMPLIED>\n<!ATTLIST msg name CDATA #IMPLIED>\n<!ATTLIST msg desc CDATA #IMPLIED>\n<!ATTLIST msg meaning CDATA #IMPLIED>\n<!ATTLIST msg obsolete (obsolete) #IMPLIED>\n<!ATTLIST msg xml:space (default|preserve) "default">\n<!ATTLIST msg is_hidden CDATA #IMPLIED>\n\n<!ELEMENT source (#PCDATA)>\n\n<!ELEMENT ph (#PCDATA|ex)*>\n<!ATTLIST ph name CDATA #REQUIRED>\n\n<!ELEMENT ex (#PCDATA)>',l=function(){function Xmb(){}return Xmb.prototype.write=function(e){var t=new p,r=new i.a(o);return Object.keys(e).forEach(function(n){var o=e[n],s={id:n};o.description&&(s.desc=o.description),o.meaning&&(s.meaning=o.meaning),r.children.push(new i.b(2),new i.a(a,s,t.serialize(o.nodes)))}),r.children.push(new i.b),i.d([new i.e({version:"1.0",encoding:"UTF-8"}),new i.b,new i.f(o,c),new i.b,r,new i.b])},Xmb.prototype.load=function(e,t,r){throw new Error("Unsupported")},Xmb}(),p=function(){function _Visitor(){}return _Visitor.prototype.visitText=function(e,t){return[new i.c(e.value)]},_Visitor.prototype.visitContainer=function(e,t){var r=this,n=[];return e.children.forEach(function(e){return n.push.apply(n,e.visit(r))}),n},_Visitor.prototype.visitIcu=function(e,t){var r=this,n=[new i.c("{"+e.expression+", "+e.type+", ")];return Object.keys(e.cases).forEach(function(t){n.push.apply(n,[new i.c(t+" {")].concat(e.cases[t].visit(r),[new i.c("} ")]))}),n.push(new i.c("}")),n},_Visitor.prototype.visitTagPlaceholder=function(e,t){var r=new i.a(u,{},[new i.c("<"+e.tag+">")]),n=new i.a(s,{name:e.startName},[r]);if(e.isVoid)return[n];var o=new i.a(u,{},[new i.c("</"+e.tag+">")]),a=new i.a(s,{name:e.closeName},[o]);return[n].concat(this.serialize(e.children),[a])},_Visitor.prototype.visitPlaceholder=function(e,t){return[new i.a(s,{name:e.name})]},_Visitor.prototype.visitIcuPlaceholder=function(e,t){return[new i.a(s,{name:e.name})]},_Visitor.prototype.serialize=function(e){var t=this;return n.a.flatten(e.map(function(e){return e.visit(t)}))},_Visitor}()},function(e,t,r){"use strict";function serialize(e){return e.map(function(e){return e.visit(o)}).join("")}function _escapeXml(e){return p.reduce(function(e,t){return e.replace(t[0],t[1])},e)}t.d=serialize,r.d(t,"e",function(){return a}),r.d(t,"f",function(){return s}),r.d(t,"a",function(){return u}),r.d(t,"c",function(){return c}),r.d(t,"b",function(){return l});var n=this&&this.__extends||function(e,t){function __(){this.constructor=e}for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r]);e.prototype=null===t?Object.create(t):(__.prototype=t.prototype,new __)},i=function(){function _Visitor(){}return _Visitor.prototype.visitTag=function(e){var t=this,r=this._serializeAttributes(e.attrs);if(0==e.children.length)return"<"+e.name+r+"/>";var n=e.children.map(function(e){return e.visit(t)});return"<"+e.name+r+">"+n.join("")+"</"+e.name+">"},_Visitor.prototype.visitText=function(e){return e.value},_Visitor.prototype.visitDeclaration=function(e){return"<?xml"+this._serializeAttributes(e.attrs)+" ?>"},_Visitor.prototype._serializeAttributes=function(e){var t=Object.keys(e).map(function(t){return t+'="'+e[t]+'"'}).join(" ");return t.length>0?" "+t:""},_Visitor.prototype.visitDoctype=function(e){return"<!DOCTYPE "+e.rootTag+" [\n"+e.dtd+"\n]>"},_Visitor}(),o=new i,a=function(){function Declaration(e){var t=this;this.attrs={},Object.keys(e).forEach(function(r){t.attrs[r]=_escapeXml(e[r])})}return Declaration.prototype.visit=function(e){return e.visitDeclaration(this)},Declaration}(),s=function(){function Doctype(e,t){this.rootTag=e,this.dtd=t}return Doctype.prototype.visit=function(e){return e.visitDoctype(this)},Doctype}(),u=function(){function Tag(e,t,r){var n=this;void 0===t&&(t={}),void 0===r&&(r=[]),this.name=e,this.children=r,this.attrs={},Object.keys(t).forEach(function(e){n.attrs[e]=_escapeXml(t[e])})}return Tag.prototype.visit=function(e){return e.visitTag(this)},Tag}(),c=function(){function Text(e){this.value=_escapeXml(e)}return Text.prototype.visit=function(e){return e.visitText(this)},Text}(),l=function(e){function CR(t){void 0===t&&(t=0),e.call(this,"\n"+new Array(t+1).join(" "))}return n(CR,e),CR}(c),p=[[/&/g,"&amp;"],[/"/g,"&quot;"],[/'/g,"&apos;"],[/</g,"&lt;"],[/>/g,"&gt;"]]},function(e,t,r){"use strict";var n=r(52),i=r(271),o=r(166),a=r(266);r.d(t,"a",function(){return l});var s="translationbundle",u="translation",c="ph",l=function(){function Xtb(e,t){this._htmlParser=e,this._interpolationConfig=t}return Xtb.prototype.write=function(e){throw new Error("Unsupported")},Xtb.prototype.load=function(e,t,r){var n=this,o=(new i.a).parse(e,t);if(o.errors.length)throw new Error("xtb parse errors:\n"+o.errors.join("\n"));var a=(new p).parse(o.rootNodes,r),s=a.messages,u=a.errors;if(u.length)throw new Error("xtb parse errors:\n"+u.join("\n"));var c={},l=[];if(Object.keys(s).forEach(function(e){var r=n._htmlParser.parse(s[e],t,!0,n._interpolationConfig);l.push.apply(l,r.errors),c[e]=r.rootNodes}),l.length)throw new Error("xtb parse errors:\n"+l.join("\n"));return c},Xtb}(),p=function(){function _Visitor(){}return _Visitor.prototype.parse=function(e,t){var i=this;this._messageNodes=[],this._translatedMessages={},this._bundleDepth=0,this._translationDepth=0,this._errors=[],n.g(this,e,null);var o=t.getMessageMap(),s=r.i(a.a)(t),u=r.i(a.b)(t);return this._messageNodes.filter(function(e){return o.hasOwnProperty(e[0])}).sort(function(e,t){return 0==Object.keys(o[e[0]].placeholderToMsgIds).length?-1:0==Object.keys(o[t[0]].placeholderToMsgIds).length?1:0}).forEach(function(e){var t=e[0];i._placeholders=s[t]||{},i._placeholderToIds=u[t]||{},i._translatedMessages[t]=n.g(i,e[1]).join("")}),{messages:this._translatedMessages,errors:this._errors}},_Visitor.prototype.visitElement=function(e,t){switch(e.name){case s:this._bundleDepth++,this._bundleDepth>1&&this._addError(e,"<"+s+"> elements can not be nested"),n.g(this,e.children,null),this._bundleDepth--;break;case u:this._translationDepth++,this._translationDepth>1&&this._addError(e,"<"+u+"> elements can not be nested");var r=e.attrs.find(function(e){return"id"===e.name});r?this._messageNodes.push([r.value,e.children]):this._addError(e,"<"+u+'> misses the "id" attribute'),this._translationDepth--;break;case c:var i=e.attrs.find(function(e){return"name"===e.name});if(i){var o=i.value;if(this._placeholders.hasOwnProperty(o))return this._placeholders[o];if(this._placeholderToIds.hasOwnProperty(o)&&this._translatedMessages.hasOwnProperty(this._placeholderToIds[o]))return this._translatedMessages[this._placeholderToIds[o]];this._addError(e,'The placeholder "'+o+'" does not exists in the source message')}else this._addError(e,"<"+c+'> misses the "name" attribute');break;default:this._addError(e,"Unexpected tag")}},_Visitor.prototype.visitAttribute=function(e,t){throw new Error("unreachable code")},_Visitor.prototype.visitText=function(e,t){return e.value},_Visitor.prototype.visitComment=function(e,t){return""},_Visitor.prototype.visitExpansion=function(e,t){var r=this;e.cases.map(function(e){return e.visit(r,null)});return"{"+e.switchValue+", "+e.type+", strCases.join(' ')}"},_Visitor.prototype.visitExpansionCase=function(e,t){return e.value+" {"+n.g(this,e.expression,null)+"}"},_Visitor.prototype._addError=function(e,t){this._errors.push(new o.a(e.sourceSpan,t))},_Visitor}()},function(e,t,r){"use strict";var n=r(75),i=r(442);r.d(t,"a",function(){return a});var o=this&&this.__extends||function(e,t){function __(){this.constructor=e}for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r]);e.prototype=null===t?Object.create(t):(__.prototype=t.prototype,new __)},a=function(e){function XmlParser(){e.call(this,i.a)}return o(XmlParser,e),XmlParser.prototype.parse=function(t,r,n){return void 0===n&&(n=!1),e.prototype.parse.call(this,t,r,n,null)},XmlParser}(n.b)},function(e,t,r){"use strict";function debugOutputAstAsTypeScript(e){var t=new u(s),r=i.a.createRoot([]),n=Array.isArray(e)?e:[e];return n.forEach(function(e){if(e instanceof o.O)e.visitStatement(t,r);else if(e instanceof o.w)e.visitExpression(t,r);else{if(!(e instanceof o.P))throw new Error("Don't know how to print debug info for "+e);e.visitType(t,r)}}),r.toSource()}var n=r(2),i=r(171),o=r(8);t.a=debugOutputAstAsTypeScript;var a=this&&this.__extends||function(e,t){function __(){this.constructor=e}for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r]);e.prototype=null===t?Object.create(t):(__.prototype=t.prototype,new __)},s="asset://debug/lib",u=(function(){function TypeScriptEmitter(e){this._importGenerator=e}return TypeScriptEmitter.prototype.emitStatements=function(e,t,r){var n=this,o=new u(e),a=i.a.createRoot(r);o.visitAllStatements(t,a);var s=[];return o.importsWithPrefixes.forEach(function(t,r){s.push("imp"+("ort * as "+t+" from '"+n._importGenerator.getImportPath(e,r)+"';"))}),s.push(a.toSource()),s.join("\n")},TypeScriptEmitter}(),function(e){function _TsEmitterVisitor(t){e.call(this,!1),this._moduleUrl=t,this.importsWithPrefixes=new Map}return a(_TsEmitterVisitor,e),_TsEmitterVisitor.prototype.visitType=function(e,t,i){void 0===i&&(i="any"),r.i(n.a)(e)?e.visitType(this,t):t.print(i)},_TsEmitterVisitor.prototype.visitLiteralExpr=function(t,r){e.prototype.visitLiteralExpr.call(this,t,r,"(null as any)")},_TsEmitterVisitor.prototype.visitLiteralArrayExpr=function(t,r){0===t.entries.length&&r.print("(");var n=e.prototype.visitLiteralArrayExpr.call(this,t,r);return 0===t.entries.length&&r.print(" as any[])"),n},_TsEmitterVisitor.prototype.visitExternalExpr=function(e,t){return this._visitIdentifier(e.value,e.typeParams,t),null},_TsEmitterVisitor.prototype.visitDeclareVarStmt=function(e,t){return t.isExportedVar(e.name)&&t.print("export "),e.hasModifier(o.r.Final)?t.print("const"):t.print("var"),t.print(" "+e.name+":"),this.visitType(e.type,t),t.print(" = "),e.value.visitExpression(this,t),t.println(";"),null},_TsEmitterVisitor.prototype.visitCastExpr=function(e,t){return t.print("(<"),e.type.visitType(this,t),t.print(">"),e.value.visitExpression(this,t),t.print(")"),null},_TsEmitterVisitor.prototype.visitDeclareClassStmt=function(e,t){var i=this;return t.pushClass(e),t.isExportedVar(e.name)&&t.print("export "),t.print("class "+e.name),r.i(n.a)(e.parent)&&(t.print(" extends "),e.parent.visitExpression(this,t)),t.println(" {"),t.incIndent(),e.fields.forEach(function(e){return i._visitClassField(e,t)}),r.i(n.a)(e.constructorMethod)&&this._visitClassConstructor(e,t),e.getters.forEach(function(e){return i._visitClassGetter(e,t)}),e.methods.forEach(function(e){return i._visitClassMethod(e,t)}),t.decIndent(),t.println("}"),t.popClass(),null},_TsEmitterVisitor.prototype._visitClassField=function(e,t){e.hasModifier(o.r.Private)&&t.print("/*private*/ "),t.print(e.name),t.print(":"),this.visitType(e.type,t),t.println(";")},_TsEmitterVisitor.prototype._visitClassGetter=function(e,t){e.hasModifier(o.r.Private)&&t.print("private "),t.print("get "+e.name+"()"),t.print(":"),this.visitType(e.type,t),t.println(" {"),t.incIndent(),this.visitAllStatements(e.body,t),t.decIndent(),t.println("}")},_TsEmitterVisitor.prototype._visitClassConstructor=function(e,t){t.print("constructor("),this._visitParams(e.constructorMethod.params,t),t.println(") {"),t.incIndent(),this.visitAllStatements(e.constructorMethod.body,t),t.decIndent(),t.println("}")},_TsEmitterVisitor.prototype._visitClassMethod=function(e,t){e.hasModifier(o.r.Private)&&t.print("private "),t.print(e.name+"("),this._visitParams(e.params,t),t.print("):"),this.visitType(e.type,t,"void"),t.println(" {"),t.incIndent(),this.visitAllStatements(e.body,t),t.decIndent(),t.println("}")},_TsEmitterVisitor.prototype.visitFunctionExpr=function(e,t){return t.print("("),this._visitParams(e.params,t),t.print("):"),this.visitType(e.type,t,"void"),t.println(" => {"),t.incIndent(),this.visitAllStatements(e.statements,t),t.decIndent(),t.print("}"),null},_TsEmitterVisitor.prototype.visitDeclareFunctionStmt=function(e,t){return t.isExportedVar(e.name)&&t.print("export "),t.print("function "+e.name+"("),this._visitParams(e.params,t),t.print("):"),this.visitType(e.type,t,"void"),t.println(" {"),t.incIndent(),this.visitAllStatements(e.statements,t),t.decIndent(),t.println("}"),null},_TsEmitterVisitor.prototype.visitTryCatchStmt=function(e,t){t.println("try {"),t.incIndent(),this.visitAllStatements(e.bodyStmts,t),t.decIndent(),t.println("} catch ("+i.b.name+") {"),t.incIndent();var r=[i.c.set(i.b.prop("stack")).toDeclStmt(null,[o.r.Final])].concat(e.catchStmts);return this.visitAllStatements(r,t),t.decIndent(),t.println("}"),null},_TsEmitterVisitor.prototype.visitBuiltintType=function(e,t){var r;switch(e.name){case o.Q.Bool:r="boolean";break;case o.Q.Dynamic:r="any";break;case o.Q.Function:r="Function";break;case o.Q.Number:r="number";break;case o.Q.Int:r="number";break;case o.Q.String:r="string";break;default:throw new Error("Unsupported builtin type "+e.name)}return t.print(r),null},_TsEmitterVisitor.prototype.visitExternalType=function(e,t){return this._visitIdentifier(e.value,e.typeParams,t),null},_TsEmitterVisitor.prototype.visitArrayType=function(e,t){return this.visitType(e.of,t),t.print("[]"),null},_TsEmitterVisitor.prototype.visitMapType=function(e,t){return t.print("{[key: string]:"),this.visitType(e.valueType,t),t.print("}"),null},_TsEmitterVisitor.prototype.getBuiltinMethodName=function(e){var t;switch(e){case o.B.ConcatArray:t="concat";break;case o.B.SubscribeObservable:t="subscribe";break;case o.B.Bind:t="bind";break;default:throw new Error("Unknown builtin method: "+e)}return t},_TsEmitterVisitor.prototype._visitParams=function(e,t){var r=this;this.visitAllObjects(function(e){t.print(e.name),t.print(":"),r.visitType(e.type,t)},e,t,",")},_TsEmitterVisitor.prototype._visitIdentifier=function(e,t,i){var o=this;if(r.i(n.b)(e.name))throw new Error("Internal error: unknown identifier "+e);if(r.i(n.a)(e.moduleUrl)&&e.moduleUrl!=this._moduleUrl){var a=this.importsWithPrefixes.get(e.moduleUrl);r.i(n.b)(a)&&(a="import"+this.importsWithPrefixes.size,this.importsWithPrefixes.set(e.moduleUrl,a)),i.print(a+".")}e.reference&&e.reference.members?(i.print(e.reference.name),i.print("."),i.print(e.reference.members.join("."))):i.print(e.name),r.i(n.a)(t)&&t.length>0&&(i.print("<"),this.visitAllObjects(function(e){return e.visitType(o,i)},t,i,","),i.print(">"))},_TsEmitterVisitor}(i.d))},function(e,t,r){"use strict";function convertValueToOutputAst(e,t){return void 0===t&&(t=null),r.i(i.e)(e,new a,t)}var n=r(17),i=r(23),o=r(8);t.a=convertValueToOutputAst;var a=function(){function _ValueOutputAstTransformer(){}return _ValueOutputAstTransformer.prototype.visitArray=function(e,t){var n=this;return o.g(e.map(function(e){return r.i(i.e)(e,n,null)}),t)},_ValueOutputAstTransformer.prototype.visitStringMap=function(e,t){var n=this,a=[];return Object.keys(e).forEach(function(t){a.push([t,r.i(i.e)(e[t],n,null)])}),o.f(a,t)},_ValueOutputAstTransformer.prototype.visitPrimitive=function(e,t){return o.a(e,t)},_ValueOutputAstTransformer.prototype.visitOther=function(e,t){if(e instanceof n.a)return o.b(e);if(e instanceof o.w)return e;throw new Error("Illegal state: Don't now how to compile value "+e)},_ValueOutputAstTransformer}()},function(e,t,r){"use strict";function _transformProvider(e,t){var r=t.useExisting,i=t.useValue,o=t.deps;return new n.d({token:e.token,useClass:e.useClass,useExisting:r,useFactory:e.useFactory,useValue:i,deps:o,multi:e.multi})}function _transformProviderAst(e,t){var r=t.eager,n=t.providers;return new u.b(e.token,e.multiProvider,e.eager||r,n,e.providerType,e.lifecycleHooks,e.sourceSpan)}function _normalizeProviders(e,t,i,a){return void 0===a&&(a=null),a||(a=[]),r.i(o.a)(e)&&e.forEach(function(e){if(Array.isArray(e))_normalizeProviders(e,t,i,a);else{var s=void 0;e instanceof n.d?s=e:e instanceof n.e?s=new n.d({token:new n.b({identifier:e}),useClass:e}):i.push(new l("Unknown provider type "+e,t)),r.i(o.a)(s)&&a.push(s)}}),a}function _resolveProvidersFromDirectives(e,t,r){var i=new Map;e.forEach(function(e){var o=new n.d({token:new n.b({identifier:e.type}),useClass:e.type});_resolveProviders([o],e.isComponent?u.a.Component:u.a.Directive,!0,t,r,i)});var o=e.filter(function(e){return e.isComponent}).concat(e.filter(function(e){return!e.isComponent}));return o.forEach(function(e){_resolveProviders(_normalizeProviders(e.providers,t,r),u.a.PublicService,!1,t,r,i),_resolveProviders(_normalizeProviders(e.viewProviders,t,r),u.a.PrivateService,!1,t,r,i)}),i}function _resolveProviders(e,t,a,s,c,p){e.forEach(function(e){var f=p.get(e.token.reference);if(r.i(o.a)(f)&&f.multiProvider!==e.multi&&c.push(new l("Mixing multi and non multi provider is not possible for token "+f.token.name,s)),f)e.multi||i.a.clear(f.providers),f.providers.push(e);else{var h=e.token.identifier&&e.token.identifier instanceof n.e?e.token.identifier.lifecycleHooks:[];f=new u.b(e.token,e.multi,a||h.length>0,[e],t,h,s),p.set(e.token.reference,f)}})}function _getViewQueries(e){var t=new Map;return r.i(o.a)(e.viewQueries)&&e.viewQueries.forEach(function(e){return _addQueryToTokenMap(t,e)}),e.type.diDeps.forEach(function(e){r.i(o.a)(e.viewQuery)&&_addQueryToTokenMap(t,e.viewQuery)}),t}function _getContentQueries(e){var t=new Map;return e.forEach(function(e){r.i(o.a)(e.queries)&&e.queries.forEach(function(e){return _addQueryToTokenMap(t,e)}),e.type.diDeps.forEach(function(e){r.i(o.a)(e.query)&&_addQueryToTokenMap(t,e.query)})}),t}function _addQueryToTokenMap(e,t){t.selectors.forEach(function(r){var n=e.get(r.reference);n||(n=[],e.set(r.reference,n)),n.push(t)})}var n=r(17),i=r(18),o=r(2),a=r(13),s=r(42),u=r(53);r.d(t,"a",function(){return p}),r.d(t,"b",function(){return f}),r.d(t,"c",function(){return h});var c=this&&this.__extends||function(e,t){function __(){this.constructor=e}for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r]);e.prototype=null===t?Object.create(t):(__.prototype=t.prototype,new __)},l=function(e){function ProviderError(t,r){e.call(this,r,t)}return c(ProviderError,e),ProviderError}(s.a),p=function(){function ProviderViewContext(e,t){var n=this;this.component=e,this.sourceSpan=t,this.errors=[],this.viewQueries=_getViewQueries(e),this.viewProviders=new Map,_normalizeProviders(e.viewProviders,t,this.errors).forEach(function(e){r.i(o.b)(n.viewProviders.get(e.token.reference))&&n.viewProviders.set(e.token.reference,!0)})}return ProviderViewContext}(),f=function(){function ProviderElementContext(e,t,s,u,c,l,p){var f=this;this.viewContext=e,this._parent=t,this._isViewRoot=s,this._directiveAsts=u,this._sourceSpan=p,this._transformedProviders=new Map,this._seenProviders=new Map,this._hasViewContainer=!1,this._attrs={},c.forEach(function(e){return f._attrs[e.name]=e.value});var h=u.map(function(e){return e.directive});this._allProviders=_resolveProvidersFromDirectives(h,p,e.errors),this._contentQueries=_getContentQueries(h);var d=new Map;i.b.values(this._allProviders).forEach(function(e){f._addQueryReadsTo(e.token,d)}),l.forEach(function(e){f._addQueryReadsTo(new n.b({value:e.name}),d)}),r.i(o.a)(d.get(r.i(a.a)(a.b.ViewContainerRef).reference))&&(this._hasViewContainer=!0),i.b.values(this._allProviders).forEach(function(e){var t=e.eager||r.i(o.a)(d.get(e.token.reference));t&&f._getOrCreateLocalProvider(e.providerType,e.token,!0)})}return ProviderElementContext.prototype.afterElement=function(){var e=this;i.b.values(this._allProviders).forEach(function(t){e._getOrCreateLocalProvider(t.providerType,t.token,!1)})},Object.defineProperty(ProviderElementContext.prototype,"transformProviders",{get:function(){return i.b.values(this._transformedProviders)},enumerable:!0,configurable:!0}),Object.defineProperty(ProviderElementContext.prototype,"transformedDirectiveAsts",{get:function(){var e=this.transformProviders.map(function(e){return e.token.identifier}),t=i.a.clone(this._directiveAsts);return i.a.sort(t,function(t,r){return e.indexOf(t.directive.type)-e.indexOf(r.directive.type)}),t},enumerable:!0,configurable:!0}),Object.defineProperty(ProviderElementContext.prototype,"transformedHasViewContainer",{get:function(){return this._hasViewContainer},enumerable:!0,configurable:!0}),ProviderElementContext.prototype._addQueryReadsTo=function(e,t){this._getQueriesFor(e).forEach(function(n){var i=n.read||e;r.i(o.b)(t.get(i.reference))&&t.set(i.reference,!0)})},ProviderElementContext.prototype._getQueriesFor=function(e){for(var t,n=[],a=this,s=0;null!==a;)t=a._contentQueries.get(e.reference),r.i(o.a)(t)&&i.a.addAll(n,t.filter(function(e){return e.descendants||s<=1})),a._directiveAsts.length>0&&s++,a=a._parent;return t=this.viewContext.viewQueries.get(e.reference),r.i(o.a)(t)&&i.a.addAll(n,t),n},ProviderElementContext.prototype._getOrCreateLocalProvider=function(e,t,i){var a=this,s=this._allProviders.get(t.reference);if(!s||(e===u.a.Directive||e===u.a.PublicService)&&s.providerType===u.a.PrivateService||(e===u.a.PrivateService||e===u.a.PublicService)&&s.providerType===u.a.Builtin)return null;var c=this._transformedProviders.get(t.reference);if(r.i(o.a)(c))return c;if(r.i(o.a)(this._seenProviders.get(t.reference)))return this.viewContext.errors.push(new l("Cannot instantiate cyclic dependency! "+t.name,this._sourceSpan)),null;this._seenProviders.set(t.reference,!0);var p=s.providers.map(function(e){var t,u=e.useValue,c=e.useExisting;if(r.i(o.a)(e.useExisting)){var l=a._getDependency(s.providerType,new n.c({token:e.useExisting}),i);r.i(o.a)(l.token)?c=l.token:(c=null,u=l.value)}else if(r.i(o.a)(e.useFactory)){var p=e.deps||e.useFactory.diDeps;t=p.map(function(e){return a._getDependency(s.providerType,e,i)})}else if(r.i(o.a)(e.useClass)){var p=e.deps||e.useClass.diDeps;t=p.map(function(e){return a._getDependency(s.providerType,e,i)})}return _transformProvider(e,{useExisting:c,useValue:u,deps:t})});return c=_transformProviderAst(s,{eager:i,providers:p}),this._transformedProviders.set(t.reference,c),c},ProviderElementContext.prototype._getLocalDependency=function(e,t,i){if(void 0===i&&(i=null),t.isAttribute){var s=this._attrs[t.token.value];return new n.c({isValue:!0,value:r.i(o.h)(s)})}if(r.i(o.a)(t.query)||r.i(o.a)(t.viewQuery))return t;if(r.i(o.a)(t.token)){if(e===u.a.Directive||e===u.a.Component){if(t.token.reference===r.i(a.a)(a.b.Renderer).reference||t.token.reference===r.i(a.a)(a.b.ElementRef).reference||t.token.reference===r.i(a.a)(a.b.ChangeDetectorRef).reference||t.token.reference===r.i(a.a)(a.b.TemplateRef).reference)return t;t.token.reference===r.i(a.a)(a.b.ViewContainerRef).reference&&(this._hasViewContainer=!0)}if(t.token.reference===r.i(a.a)(a.b.Injector).reference)return t;if(r.i(o.a)(this._getOrCreateLocalProvider(e,t.token,i)))return t}return null},ProviderElementContext.prototype._getDependency=function(e,t,i){void 0===i&&(i=null);var a=this,s=i,c=null;if(t.isSkipSelf||(c=this._getLocalDependency(e,t,i)),t.isSelf)!c&&t.isOptional&&(c=new n.c({isValue:!0,value:null}));else{for(;!c&&r.i(o.a)(a._parent);){var p=a;a=a._parent,p._isViewRoot&&(s=!1),c=a._getLocalDependency(u.a.PublicService,t,s)}c||(c=!t.isHost||this.viewContext.component.type.isHost||this.viewContext.component.type.reference===t.token.reference||r.i(o.a)(this.viewContext.viewProviders.get(t.token.reference))?t:t.isOptional?c=new n.c({isValue:!0,value:null}):null)}return c||this.viewContext.errors.push(new l("No provider for "+t.token.name,this._sourceSpan)),c},ProviderElementContext}(),h=function(){function NgModuleProviderAnalyzer(e,t,r){var i=this;this._transformedProviders=new Map,this._seenProviders=new Map,this._errors=[],this._allProviders=new Map;var o=e.transitiveModule.modules.map(function(e){return e.type});o.forEach(function(e){var t=new n.d({token:new n.b({identifier:e}),useClass:e});_resolveProviders([t],u.a.PublicService,!0,r,i._errors,i._allProviders)}),_resolveProviders(_normalizeProviders(e.transitiveModule.providers.concat(t),r,this._errors),u.a.PublicService,!1,r,this._errors,this._allProviders)}return NgModuleProviderAnalyzer.prototype.parse=function(){var e=this;if(i.b.values(this._allProviders).forEach(function(t){e._getOrCreateLocalProvider(t.token,t.eager)}),this._errors.length>0){var t=this._errors.join("\n");throw new Error("Provider parse errors:\n"+t)}return i.b.values(this._transformedProviders)},NgModuleProviderAnalyzer.prototype._getOrCreateLocalProvider=function(e,t){var i=this,a=this._allProviders.get(e.reference);if(!a)return null;var s=this._transformedProviders.get(e.reference);if(r.i(o.a)(s))return s;if(r.i(o.a)(this._seenProviders.get(e.reference)))return this._errors.push(new l("Cannot instantiate cyclic dependency! "+e.name,a.sourceSpan)),null;this._seenProviders.set(e.reference,!0);var u=a.providers.map(function(e){var s,u=e.useValue,c=e.useExisting;if(r.i(o.a)(e.useExisting)){var l=i._getDependency(new n.c({token:e.useExisting}),t,a.sourceSpan);r.i(o.a)(l.token)?c=l.token:(c=null,u=l.value)}else if(r.i(o.a)(e.useFactory)){var p=e.deps||e.useFactory.diDeps;s=p.map(function(e){return i._getDependency(e,t,a.sourceSpan)})}else if(r.i(o.a)(e.useClass)){var p=e.deps||e.useClass.diDeps;s=p.map(function(e){return i._getDependency(e,t,a.sourceSpan)})}return _transformProvider(e,{useExisting:c,useValue:u,deps:s})});return s=_transformProviderAst(a,{eager:t,providers:u}),this._transformedProviders.set(e.reference,s),s},NgModuleProviderAnalyzer.prototype._getDependency=function(e,t,i){void 0===t&&(t=null);var s=!1;!e.isSkipSelf&&r.i(o.a)(e.token)&&(e.token.reference===r.i(a.a)(a.b.Injector).reference||e.token.reference===r.i(a.a)(a.b.ComponentFactoryResolver).reference?s=!0:r.i(o.a)(this._getOrCreateLocalProvider(e.token,t))&&(s=!0));var u=e;return e.isSelf&&!s&&(e.isOptional?u=new n.c({isValue:!0,value:null}):this._errors.push(new l("No provider for "+e.token.name,i))),u},NgModuleProviderAnalyzer}()},function(e,t,r){"use strict";function assertComponent(e){if(!e.isComponent)throw new Error("Could not compile '"+e.type.name+"' because it is not a component.")}var n=r(0),i=r(258),o=r(259),a=r(17),s=r(74),u=r(162),c=r(118),l=r(2),p=r(167),f=r(169),h=r(8),d=r(445),m=r(446),v=r(14),y=r(175),g=r(122),_=r(23),b=r(123);r.d(t,"a",function(){return w});var w=function(){function RuntimeCompiler(e,t,r,n,a,s,u,c,l){this._injector=e,this._metadataResolver=t,this._templateNormalizer=r,this._templateParser=n,this._styleCompiler=a,this._viewCompiler=s,this._ngModuleCompiler=u,this._directiveWrapperCompiler=c,this._compilerConfig=l,this._compiledTemplateCache=new Map,this._compiledHostTemplateCache=new Map,this._compiledDirectiveWrapperCache=new Map, this._compiledNgModuleCache=new Map,this._animationParser=new o.a,this._animationCompiler=new i.a}return Object.defineProperty(RuntimeCompiler.prototype,"injector",{get:function(){return this._injector},enumerable:!0,configurable:!0}),RuntimeCompiler.prototype.compileModuleSync=function(e){return this._compileModuleAndComponents(e,!0).syncResult},RuntimeCompiler.prototype.compileModuleAsync=function(e){return this._compileModuleAndComponents(e,!1).asyncResult},RuntimeCompiler.prototype.compileModuleAndAllComponentsSync=function(e){return this._compileModuleAndAllComponents(e,!0).syncResult},RuntimeCompiler.prototype.compileModuleAndAllComponentsAsync=function(e){return this._compileModuleAndAllComponents(e,!1).asyncResult},RuntimeCompiler.prototype._compileModuleAndComponents=function(e,t){var r=this._compileComponents(e,t),n=this._compileModule(e);return new _.g(n,r.then(function(){return n}))},RuntimeCompiler.prototype._compileModuleAndAllComponents=function(e,t){var r=this,i=this._compileComponents(e,t),o=this._compileModule(e),a=this._metadataResolver.getNgModuleMetadata(e),s=[],u=new Set;a.transitiveModule.modules.forEach(function(e){e.declaredDirectives.forEach(function(t){if(t.isComponent){var n=r._createCompiledHostTemplate(t.type.reference,e);u.add(n),s.push(n.proxyComponentFactory)}})});var c=new n.ModuleWithComponentFactories(o,s),l=function(){return u.forEach(function(e){r._compileTemplate(e)}),c},p=t?Promise.resolve(l()):i.then(l);return new _.g(c,p)},RuntimeCompiler.prototype._compileModule=function(e){var t=this,i=this._compiledNgModuleCache.get(e);if(!i){var o=this._metadataResolver.getNgModuleMetadata(e),s=[this._metadataResolver.getProviderMetadata(new a.x(n.Compiler,{useFactory:function(){return new E(t,o.type.reference)}}))],u=this._ngModuleCompiler.compile(o,s);u.dependencies.forEach(function(e){e.placeholder.reference=t._assertComponentKnown(e.comp.reference,!0).proxyComponentFactory,e.placeholder.name="compFactory_"+e.comp.name}),i=this._compilerConfig.useJit?r.i(m.a)("/"+o.type.name+"/module.ngfactory.js",u.statements,u.ngModuleFactoryVar):r.i(d.a)(u.statements,u.ngModuleFactoryVar),this._compiledNgModuleCache.set(o.type.reference,i)}return i},RuntimeCompiler.prototype._compileComponents=function(e,t){var r=this,n=new Set,i=[],o=this._metadataResolver.getNgModuleMetadata(e),a=new Map;o.transitiveModule.modules.forEach(function(e){e.declaredDirectives.forEach(function(t){a.set(t.type.reference,e),r._compileDirectiveWrapper(t,e),t.isComponent&&n.add(r._createCompiledTemplate(t,e))})}),o.transitiveModule.modules.forEach(function(e){e.declaredDirectives.forEach(function(e){e.isComponent&&e.entryComponents.forEach(function(e){var t=a.get(e.reference);n.add(r._createCompiledHostTemplate(e.reference,t))})}),e.entryComponents.forEach(function(e){var t=a.get(e.reference);n.add(r._createCompiledHostTemplate(e.reference,t))})}),n.forEach(function(e){if(e.loading){if(t)throw new v.K(e.compType.reference);i.push(e.loading)}});var s=function(){n.forEach(function(e){r._compileTemplate(e)})};return t?(s(),Promise.resolve(null)):Promise.all(i).then(s)},RuntimeCompiler.prototype.clearCacheFor=function(e){this._compiledNgModuleCache.delete(e),this._metadataResolver.clearCacheFor(e),this._compiledHostTemplateCache.delete(e);var t=this._compiledTemplateCache.get(e);t&&(this._templateNormalizer.clearCacheFor(t.normalizedCompMeta),this._compiledTemplateCache.delete(e))},RuntimeCompiler.prototype.clearCache=function(){this._metadataResolver.clearCache(),this._compiledTemplateCache.clear(),this._compiledHostTemplateCache.clear(),this._templateNormalizer.clearCache(),this._compiledNgModuleCache.clear()},RuntimeCompiler.prototype._createCompiledHostTemplate=function(e,t){if(!t)throw new Error("Component "+r.i(l.k)(e)+" is not part of any NgModule or the module has not been imported into your module.");var n=this._compiledHostTemplateCache.get(e);if(!n){var i=this._metadataResolver.getDirectiveMetadata(e);assertComponent(i);var o=r.i(a.n)(i);n=new C(!0,i.selector,i.type,t,[i],this._templateNormalizer.normalizeDirective(o)),this._compiledHostTemplateCache.set(e,n)}return n},RuntimeCompiler.prototype._createCompiledTemplate=function(e,t){var r=this._compiledTemplateCache.get(e.type.reference);return r||(assertComponent(e),r=new C(!1,e.selector,e.type,t,t.transitiveModule.directives,this._templateNormalizer.normalizeDirective(e)),this._compiledTemplateCache.set(e.type.reference,r)),r},RuntimeCompiler.prototype._assertComponentKnown=function(e,t){var n=t?this._compiledHostTemplateCache.get(e):this._compiledTemplateCache.get(e);if(!n)throw new Error("Illegal state: Compiled view for component "+r.i(l.k)(e)+" does not exist!");return n},RuntimeCompiler.prototype._assertComponentLoaded=function(e,t){var n=this._assertComponentKnown(e,t);if(n.loading)throw new Error("Illegal state: CompiledTemplate for "+r.i(l.k)(e)+" (isHost: "+t+") is still loading!");return n},RuntimeCompiler.prototype._assertDirectiveWrapper=function(e){var t=this._compiledDirectiveWrapperCache.get(e);if(!t)throw new Error("Illegal state: Directive wrapper for "+r.i(l.k)(e)+" has not been compiled!");return t},RuntimeCompiler.prototype._compileDirectiveWrapper=function(e,t){var n,i=this._directiveWrapperCompiler.compile(e),o=i.statements;n=this._compilerConfig.useJit?r.i(m.a)("/"+t.type.name+"/"+e.type.name+"/wrapper.ngfactory.js",o,i.dirWrapperClassVar):r.i(d.a)(o,i.dirWrapperClassVar),this._compiledDirectiveWrapperCache.set(e.type.reference,n)},RuntimeCompiler.prototype._compileTemplate=function(e){var t=this;if(!e.isCompiled){var n=e.normalizedCompMeta,i=new Map,o=this._styleCompiler.compileComponent(n);o.externalStylesheets.forEach(function(e){i.set(e.meta.moduleUrl,e)}),this._resolveStylesCompileResult(o.componentStylesheet,i);var a=e.viewComponentTypes.map(function(e){return t._assertComponentLoaded(e,!1).normalizedCompMeta}),s=this._animationParser.parseComponent(n),u=this._templateParser.parse(n,n.template.template,e.viewDirectives.concat(a),e.viewPipes,e.schemas,n.type.name),c=this._animationCompiler.compile(n.type.name,s),l=this._viewCompiler.compileComponent(n,u,h.e(o.componentStylesheet.stylesVar),e.viewPipes,c);l.dependencies.forEach(function(e){var r;if(e instanceof b.a){var n=e;r=t._assertComponentLoaded(n.comp.reference,!1),n.placeholder.reference=r.proxyViewFactory,n.placeholder.name="viewFactory_"+n.comp.name}else if(e instanceof b.b){var i=e;r=t._assertComponentLoaded(i.comp.reference,!0),i.placeholder.reference=r.proxyComponentFactory,i.placeholder.name="compFactory_"+i.comp.name}else if(e instanceof b.c){var o=e;o.placeholder.reference=t._assertDirectiveWrapper(o.dir.reference)}});var p=o.componentStylesheet.statements.concat(l.statements);c.forEach(function(e){e.statements.forEach(function(e){p.push(e)})});var f;f=this._compilerConfig.useJit?r.i(m.a)("/"+e.ngModule.type.name+"/"+e.compType.name+"/"+(e.isHost?"host":"component")+".ngfactory.js",p,l.viewFactoryVar):r.i(d.a)(p,l.viewFactoryVar),e.compiled(f)}},RuntimeCompiler.prototype._resolveStylesCompileResult=function(e,t){var r=this;e.dependencies.forEach(function(e,n){var i=t.get(e.moduleUrl),o=r._resolveAndEvalStylesCompileResult(i,t);e.valuePlaceholder.reference=o,e.valuePlaceholder.name="importedStyles"+n})},RuntimeCompiler.prototype._resolveAndEvalStylesCompileResult=function(e,t){return this._resolveStylesCompileResult(e,t),this._compilerConfig.useJit?r.i(m.a)("/"+e.meta.moduleUrl+".css.js",e.statements,e.stylesVar):r.i(d.a)(e.statements,e.stylesVar)},RuntimeCompiler.decorators=[{type:n.Injectable}],RuntimeCompiler.ctorParameters=[{type:n.Injector},{type:p.a},{type:u.a},{type:g.a},{type:y.a},{type:b.d},{type:f.a},{type:c.a},{type:s.a}],RuntimeCompiler}(),C=function(){function CompiledTemplate(e,t,i,o,a,s){var u=this;this.isHost=e,this.compType=i,this.ngModule=o,this._viewFactory=null,this.loading=null,this._normalizedCompMeta=null,this.isCompiled=!1,this.isCompiledWithDeps=!1,this.viewComponentTypes=[],this.viewDirectives=[],this.viewPipes=o.transitiveModule.pipes,this.schemas=o.schemas,a.forEach(function(e){e.isComponent?u.viewComponentTypes.push(e.type.reference):u.viewDirectives.push(e)}),this.proxyViewFactory=function(){for(var e=[],t=0;t<arguments.length;t++)e[t-0]=arguments[t];if(!u._viewFactory)throw new Error("Illegal state: CompiledTemplate for "+r.i(l.k)(u.compType)+" is not compiled yet!");return u._viewFactory.apply(null,e)},this.proxyComponentFactory=e?new n.ComponentFactory(t,this.proxyViewFactory,i.reference):null,s.syncResult?this._normalizedCompMeta=s.syncResult:this.loading=s.asyncResult.then(function(e){u._normalizedCompMeta=e,u.loading=null})}return Object.defineProperty(CompiledTemplate.prototype,"normalizedCompMeta",{get:function(){if(this.loading)throw new Error("Template is still loading for "+this.compType.name+"!");return this._normalizedCompMeta},enumerable:!0,configurable:!0}),CompiledTemplate.prototype.compiled=function(e){this._viewFactory=e,this.isCompiled=!0},CompiledTemplate.prototype.depsCompiled=function(){this.isCompiledWithDeps=!0},CompiledTemplate}(),E=function(){function ModuleBoundCompiler(e,t){this._delegate=e,this._ngModule=t}return Object.defineProperty(ModuleBoundCompiler.prototype,"_injector",{get:function(){return this._delegate.injector},enumerable:!0,configurable:!0}),ModuleBoundCompiler.prototype.compileModuleSync=function(e){return this._delegate.compileModuleSync(e)},ModuleBoundCompiler.prototype.compileModuleAsync=function(e){return this._delegate.compileModuleAsync(e)},ModuleBoundCompiler.prototype.compileModuleAndAllComponentsSync=function(e){return this._delegate.compileModuleAndAllComponentsSync(e)},ModuleBoundCompiler.prototype.compileModuleAndAllComponentsAsync=function(e){return this._delegate.compileModuleAndAllComponentsAsync(e)},ModuleBoundCompiler.prototype.clearCache=function(){this._delegate.clearCache()},ModuleBoundCompiler.prototype.clearCacheFor=function(e){this._delegate.clearCacheFor(e)},ModuleBoundCompiler}()},function(e,t,r){"use strict";var n=r(0),i=r(448),o=r(90);r.d(t,"a",function(){return h});var a=this&&this.__extends||function(e,t){function __(){this.constructor=e}for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r]);e.prototype=null===t?Object.create(t):(__.prototype=t.prototype,new __)},s="boolean",u="number",c="string",l="object",p=["[Element]|textContent,%classList,className,id,innerHTML,*beforecopy,*beforecut,*beforepaste,*copy,*cut,*paste,*search,*selectstart,*webkitfullscreenchange,*webkitfullscreenerror,*wheel,outerHTML,#scrollLeft,#scrollTop","[HTMLElement]^[Element]|accessKey,contentEditable,dir,!draggable,!hidden,innerText,lang,*abort,*beforecopy,*beforecut,*beforepaste,*blur,*cancel,*canplay,*canplaythrough,*change,*click,*close,*contextmenu,*copy,*cuechange,*cut,*dblclick,*drag,*dragend,*dragenter,*dragleave,*dragover,*dragstart,*drop,*durationchange,*emptied,*ended,*error,*focus,*input,*invalid,*keydown,*keypress,*keyup,*load,*loadeddata,*loadedmetadata,*loadstart,*message,*mousedown,*mouseenter,*mouseleave,*mousemove,*mouseout,*mouseover,*mouseup,*mousewheel,*mozfullscreenchange,*mozfullscreenerror,*mozpointerlockchange,*mozpointerlockerror,*paste,*pause,*play,*playing,*progress,*ratechange,*reset,*resize,*scroll,*search,*seeked,*seeking,*select,*selectstart,*show,*stalled,*submit,*suspend,*timeupdate,*toggle,*volumechange,*waiting,*webglcontextcreationerror,*webglcontextlost,*webglcontextrestored,*webkitfullscreenchange,*webkitfullscreenerror,*wheel,outerText,!spellcheck,%style,#tabIndex,title,!translate","abbr,address,article,aside,b,bdi,bdo,cite,code,dd,dfn,dt,em,figcaption,figure,footer,header,i,kbd,main,mark,nav,noscript,rb,rp,rt,rtc,ruby,s,samp,section,small,strong,sub,sup,u,var,wbr^[HTMLElement]|accessKey,contentEditable,dir,!draggable,!hidden,innerText,lang,*abort,*beforecopy,*beforecut,*beforepaste,*blur,*cancel,*canplay,*canplaythrough,*change,*click,*close,*contextmenu,*copy,*cuechange,*cut,*dblclick,*drag,*dragend,*dragenter,*dragleave,*dragover,*dragstart,*drop,*durationchange,*emptied,*ended,*error,*focus,*input,*invalid,*keydown,*keypress,*keyup,*load,*loadeddata,*loadedmetadata,*loadstart,*message,*mousedown,*mouseenter,*mouseleave,*mousemove,*mouseout,*mouseover,*mouseup,*mousewheel,*mozfullscreenchange,*mozfullscreenerror,*mozpointerlockchange,*mozpointerlockerror,*paste,*pause,*play,*playing,*progress,*ratechange,*reset,*resize,*scroll,*search,*seeked,*seeking,*select,*selectstart,*show,*stalled,*submit,*suspend,*timeupdate,*toggle,*volumechange,*waiting,*webglcontextcreationerror,*webglcontextlost,*webglcontextrestored,*webkitfullscreenchange,*webkitfullscreenerror,*wheel,outerText,!spellcheck,%style,#tabIndex,title,!translate","media^[HTMLElement]|!autoplay,!controls,%crossOrigin,#currentTime,!defaultMuted,#defaultPlaybackRate,!disableRemotePlayback,!loop,!muted,*encrypted,#playbackRate,preload,src,%srcObject,#volume",":svg:^[HTMLElement]|*abort,*blur,*cancel,*canplay,*canplaythrough,*change,*click,*close,*contextmenu,*cuechange,*dblclick,*drag,*dragend,*dragenter,*dragleave,*dragover,*dragstart,*drop,*durationchange,*emptied,*ended,*error,*focus,*input,*invalid,*keydown,*keypress,*keyup,*load,*loadeddata,*loadedmetadata,*loadstart,*mousedown,*mouseenter,*mouseleave,*mousemove,*mouseout,*mouseover,*mouseup,*mousewheel,*pause,*play,*playing,*progress,*ratechange,*reset,*resize,*scroll,*seeked,*seeking,*select,*show,*stalled,*submit,*suspend,*timeupdate,*toggle,*volumechange,*waiting,%style,#tabIndex",":svg:graphics^:svg:|",":svg:animation^:svg:|*begin,*end,*repeat",":svg:geometry^:svg:|",":svg:componentTransferFunction^:svg:|",":svg:gradient^:svg:|",":svg:textContent^:svg:graphics|",":svg:textPositioning^:svg:textContent|","a^[HTMLElement]|charset,coords,download,hash,host,hostname,href,hreflang,name,password,pathname,ping,port,protocol,referrerPolicy,rel,rev,search,shape,target,text,type,username","area^[HTMLElement]|alt,coords,hash,host,hostname,href,!noHref,password,pathname,ping,port,protocol,referrerPolicy,search,shape,target,username","audio^media|","br^[HTMLElement]|clear","base^[HTMLElement]|href,target","body^[HTMLElement]|aLink,background,bgColor,link,*beforeunload,*blur,*error,*focus,*hashchange,*languagechange,*load,*message,*offline,*online,*pagehide,*pageshow,*popstate,*rejectionhandled,*resize,*scroll,*storage,*unhandledrejection,*unload,text,vLink","button^[HTMLElement]|!autofocus,!disabled,formAction,formEnctype,formMethod,!formNoValidate,formTarget,name,type,value","canvas^[HTMLElement]|#height,#width","content^[HTMLElement]|select","dl^[HTMLElement]|!compact","datalist^[HTMLElement]|","details^[HTMLElement]|!open","dialog^[HTMLElement]|!open,returnValue","dir^[HTMLElement]|!compact","div^[HTMLElement]|align","embed^[HTMLElement]|align,height,name,src,type,width","fieldset^[HTMLElement]|!disabled,name","font^[HTMLElement]|color,face,size","form^[HTMLElement]|acceptCharset,action,autocomplete,encoding,enctype,method,name,!noValidate,target","frame^[HTMLElement]|frameBorder,longDesc,marginHeight,marginWidth,name,!noResize,scrolling,src","frameset^[HTMLElement]|cols,*beforeunload,*blur,*error,*focus,*hashchange,*languagechange,*load,*message,*offline,*online,*pagehide,*pageshow,*popstate,*rejectionhandled,*resize,*scroll,*storage,*unhandledrejection,*unload,rows","hr^[HTMLElement]|align,color,!noShade,size,width","head^[HTMLElement]|","h1,h2,h3,h4,h5,h6^[HTMLElement]|align","html^[HTMLElement]|version","iframe^[HTMLElement]|align,!allowFullscreen,frameBorder,height,longDesc,marginHeight,marginWidth,name,referrerPolicy,%sandbox,scrolling,src,srcdoc,width","img^[HTMLElement]|align,alt,border,%crossOrigin,#height,#hspace,!isMap,longDesc,lowsrc,name,referrerPolicy,sizes,src,srcset,useMap,#vspace,#width","input^[HTMLElement]|accept,align,alt,autocapitalize,autocomplete,!autofocus,!checked,!defaultChecked,defaultValue,dirName,!disabled,%files,formAction,formEnctype,formMethod,!formNoValidate,formTarget,#height,!incremental,!indeterminate,max,#maxLength,min,#minLength,!multiple,name,pattern,placeholder,!readOnly,!required,selectionDirection,#selectionEnd,#selectionStart,#size,src,step,type,useMap,value,%valueAsDate,#valueAsNumber,#width","keygen^[HTMLElement]|!autofocus,challenge,!disabled,keytype,name","li^[HTMLElement]|type,#value","label^[HTMLElement]|htmlFor","legend^[HTMLElement]|align","link^[HTMLElement]|as,charset,%crossOrigin,!disabled,href,hreflang,integrity,media,rel,%relList,rev,%sizes,target,type","map^[HTMLElement]|name","marquee^[HTMLElement]|behavior,bgColor,direction,height,#hspace,#loop,#scrollAmount,#scrollDelay,!trueSpeed,#vspace,width","menu^[HTMLElement]|!compact","meta^[HTMLElement]|content,httpEquiv,name,scheme","meter^[HTMLElement]|#high,#low,#max,#min,#optimum,#value","ins,del^[HTMLElement]|cite,dateTime","ol^[HTMLElement]|!compact,!reversed,#start,type","object^[HTMLElement]|align,archive,border,code,codeBase,codeType,data,!declare,height,#hspace,name,standby,type,useMap,#vspace,width","optgroup^[HTMLElement]|!disabled,label","option^[HTMLElement]|!defaultSelected,!disabled,label,!selected,text,value","output^[HTMLElement]|defaultValue,%htmlFor,name,value","p^[HTMLElement]|align","param^[HTMLElement]|name,type,value,valueType","picture^[HTMLElement]|","pre^[HTMLElement]|#width","progress^[HTMLElement]|#max,#value","q,blockquote,cite^[HTMLElement]|","script^[HTMLElement]|!async,charset,%crossOrigin,!defer,event,htmlFor,integrity,src,text,type","select^[HTMLElement]|!autofocus,!disabled,#length,!multiple,name,!required,#selectedIndex,#size,value","shadow^[HTMLElement]|","source^[HTMLElement]|media,sizes,src,srcset,type","span^[HTMLElement]|","style^[HTMLElement]|!disabled,media,type","caption^[HTMLElement]|align","th,td^[HTMLElement]|abbr,align,axis,bgColor,ch,chOff,#colSpan,headers,height,!noWrap,#rowSpan,scope,vAlign,width","col,colgroup^[HTMLElement]|align,ch,chOff,#span,vAlign,width","table^[HTMLElement]|align,bgColor,border,%caption,cellPadding,cellSpacing,frame,rules,summary,%tFoot,%tHead,width","tr^[HTMLElement]|align,bgColor,ch,chOff,vAlign","tfoot,thead,tbody^[HTMLElement]|align,ch,chOff,vAlign","template^[HTMLElement]|","textarea^[HTMLElement]|autocapitalize,!autofocus,#cols,defaultValue,dirName,!disabled,#maxLength,#minLength,name,placeholder,!readOnly,!required,#rows,selectionDirection,#selectionEnd,#selectionStart,value,wrap","title^[HTMLElement]|text","track^[HTMLElement]|!default,kind,label,src,srclang","ul^[HTMLElement]|!compact,type","unknown^[HTMLElement]|","video^media|#height,poster,#width",":svg:a^:svg:graphics|",":svg:animate^:svg:animation|",":svg:animateMotion^:svg:animation|",":svg:animateTransform^:svg:animation|",":svg:circle^:svg:geometry|",":svg:clipPath^:svg:graphics|",":svg:cursor^:svg:|",":svg:defs^:svg:graphics|",":svg:desc^:svg:|",":svg:discard^:svg:|",":svg:ellipse^:svg:geometry|",":svg:feBlend^:svg:|",":svg:feColorMatrix^:svg:|",":svg:feComponentTransfer^:svg:|",":svg:feComposite^:svg:|",":svg:feConvolveMatrix^:svg:|",":svg:feDiffuseLighting^:svg:|",":svg:feDisplacementMap^:svg:|",":svg:feDistantLight^:svg:|",":svg:feDropShadow^:svg:|",":svg:feFlood^:svg:|",":svg:feFuncA^:svg:componentTransferFunction|",":svg:feFuncB^:svg:componentTransferFunction|",":svg:feFuncG^:svg:componentTransferFunction|",":svg:feFuncR^:svg:componentTransferFunction|",":svg:feGaussianBlur^:svg:|",":svg:feImage^:svg:|",":svg:feMerge^:svg:|",":svg:feMergeNode^:svg:|",":svg:feMorphology^:svg:|",":svg:feOffset^:svg:|",":svg:fePointLight^:svg:|",":svg:feSpecularLighting^:svg:|",":svg:feSpotLight^:svg:|",":svg:feTile^:svg:|",":svg:feTurbulence^:svg:|",":svg:filter^:svg:|",":svg:foreignObject^:svg:graphics|",":svg:g^:svg:graphics|",":svg:image^:svg:graphics|",":svg:line^:svg:geometry|",":svg:linearGradient^:svg:gradient|",":svg:mpath^:svg:|",":svg:marker^:svg:|",":svg:mask^:svg:|",":svg:metadata^:svg:|",":svg:path^:svg:geometry|",":svg:pattern^:svg:|",":svg:polygon^:svg:geometry|",":svg:polyline^:svg:geometry|",":svg:radialGradient^:svg:gradient|",":svg:rect^:svg:geometry|",":svg:svg^:svg:graphics|#currentScale,#zoomAndPan",":svg:script^:svg:|type",":svg:set^:svg:animation|",":svg:stop^:svg:|",":svg:style^:svg:|!disabled,media,title,type",":svg:switch^:svg:graphics|",":svg:symbol^:svg:|",":svg:tspan^:svg:textPositioning|",":svg:text^:svg:textPositioning|",":svg:textPath^:svg:textContent|",":svg:title^:svg:|",":svg:use^:svg:graphics|",":svg:view^:svg:|#zoomAndPan","data^[HTMLElement]|value","menuitem^[HTMLElement]|type,label,icon,!disabled,!checked,radiogroup,!default","summary^[HTMLElement]|","time^[HTMLElement]|dateTime"],f={class:"className",formaction:"formAction",innerHtml:"innerHTML",readonly:"readOnly",tabindex:"tabIndex"},h=function(e){function DomElementSchemaRegistry(){var t=this;e.call(this),this._schema={},p.forEach(function(e){var r={},n=e.split("|"),i=n[0],o=n[1],a=o.split(","),p=i.split("^"),f=p[0],h=p[1];f.split(",").forEach(function(e){return t._schema[e.toLowerCase()]=r});var d=h&&t._schema[h.toLowerCase()];d&&Object.keys(d).forEach(function(e){r[e]=d[e]}),a.forEach(function(e){if(e.length>0)switch(e[0]){case"*":break;case"!":r[e.substring(1)]=s;break;case"#":r[e.substring(1)]=u;break;case"%":r[e.substring(1)]=l;break;default:r[e]=c}})})}return a(DomElementSchemaRegistry,e),DomElementSchemaRegistry.prototype.hasProperty=function(e,t,r){if(r.some(function(e){return e.name===n.NO_ERRORS_SCHEMA.name}))return!0;if(e.indexOf("-")>-1){if("ng-container"===e||"ng-content"===e)return!1;if(r.some(function(e){return e.name===n.CUSTOM_ELEMENTS_SCHEMA.name}))return!0}var i=this._schema[e.toLowerCase()]||this._schema.unknown;return!!i[t]},DomElementSchemaRegistry.prototype.hasElement=function(e,t){if(t.some(function(e){return e.name===n.NO_ERRORS_SCHEMA.name}))return!0;if(e.indexOf("-")>-1){if("ng-container"===e||"ng-content"===e)return!0;if(t.some(function(e){return e.name===n.CUSTOM_ELEMENTS_SCHEMA.name}))return!0}return!!this._schema[e.toLowerCase()]},DomElementSchemaRegistry.prototype.securityContext=function(e,t){e=e.toLowerCase(),t=t.toLowerCase();var r=i.a[e+"|"+t];return r?r:(r=i.a["*|"+t],r?r:n.SecurityContext.NONE)},DomElementSchemaRegistry.prototype.getMappedPropName=function(e){return f[e]||e},DomElementSchemaRegistry.prototype.getDefaultComponentElementName=function(){return"ng-component"},DomElementSchemaRegistry.prototype.validateProperty=function(e){if(e.toLowerCase().startsWith("on")){var t="Binding to event property '"+e+"' is disallowed for security reasons, "+("please use ("+e.slice(2)+")=...")+("\nIf '"+e+"' is a directive input, make sure the directive is imported by the")+" current module.";return{error:!0,msg:t}}return{error:!1}},DomElementSchemaRegistry.prototype.validateAttribute=function(e){if(e.toLowerCase().startsWith("on")){var t="Binding to event attribute '"+e+"' is disallowed for security reasons, "+("please use ("+e.slice(2)+")=...");return{error:!0,msg:t}}return{error:!1}},DomElementSchemaRegistry.decorators=[{type:n.Injectable}],DomElementSchemaRegistry.ctorParameters=[],DomElementSchemaRegistry}(o.a)},function(e,t,r){"use strict";function isStyleUrlResolvable(e){if(r.i(n.b)(e)||0===e.length||"/"==e[0])return!1;var t=e.match(a);return null===t||"package"==t[1]||"asset"==t[1]}function extractStyleUrls(e,t,r){var n=[],a=r.replace(o,function(){for(var r=[],i=0;i<arguments.length;i++)r[i-0]=arguments[i];var o=r[1]||r[2];return isStyleUrlResolvable(o)?(n.push(e.resolve(t,o)),""):r[0]});return new i(a,n)}var n=r(2);t.a=isStyleUrlResolvable,t.b=extractStyleUrls;var i=function(){function StyleWithImports(e,t){this.style=e,this.styleUrls=t}return StyleWithImports}(),o=/@import\s+(?:url\()?\s*(?:(?:['"]([^'"]*))|([^;\)\s]*))[^;]*;?/g,a=/^([^:\/?#]+):/},function(e,t,r){"use strict";function preparseElement(e){var t=null,v=null,y=null,g=!1,_=null;e.attrs.forEach(function(e){var r=e.name.toLowerCase();r==o?t=e.value:r==c?v=e.value:r==u?y=e.value:e.name==h?g=!0:e.name==d&&e.value.length>0&&(_=e.value)}),t=normalizeNgContentSelect(t);var b=e.name.toLowerCase(),w=i.OTHER;return r.i(n.e)(b)[1]==a?w=i.NG_CONTENT:b==p?w=i.STYLE:b==f?w=i.SCRIPT:b==s&&y==l&&(w=i.STYLESHEET),new m(w,t,v,g,_)}function normalizeNgContentSelect(e){return null===e||0===e.length?"*":e}var n=r(76);t.a=preparseElement,r.d(t,"b",function(){return i});var i,o="select",a="ng-content",s="link",u="rel",c="href",l="stylesheet",p="style",f="script",h="ngNonBindable",d="ngProjectAs";!function(e){e[e.NG_CONTENT=0]="NG_CONTENT",e[e.STYLE=1]="STYLE",e[e.STYLESHEET=2]="STYLESHEET",e[e.SCRIPT=3]="SCRIPT",e[e.OTHER=4]="OTHER"}(i||(i={}));var m=function(){function PreparsedElement(e,t,r,n,i){this.type=e,this.selectAttr=t,this.hrefAttr=r,this.nonBindable=n,this.projectAs=i}return PreparsedElement}()},function(e,t,r){"use strict";r.d(t,"a",function(){return n});var n=function(){function CompileBinding(e,t){this.node=e,this.sourceAst=t}return CompileBinding}()},function(e,t,r){"use strict";function createInjectInternalCondition(e,t,n,i){var o;return o=t>0?u.a(e).lowerEquals(d.a.requestNodeIndex).and(d.a.requestNodeIndex.lowerEquals(u.a(e+t))):u.a(e).identical(d.a.requestNodeIndex),new u.i(d.a.token.identical(r.i(p.f)(n.token)).and(o),[new u.k(i)])}function createProviderProperty(e,t,r,n,i,o){var a,s,c=o.view;if(n?(a=u.g(r),s=new u.A(u.m)):(a=r[0],s=r[0].type),s||(s=u.m),i)c.fields.push(new u.o(e,s)),c.createMethod.addStmt(u.n.prop(e).set(a).toStmt());else{var l="_"+e;c.fields.push(new u.o(l,s));var p=new f.a(c);p.resetDebugInfo(o.nodeIndex,o.sourceAst),p.addStmt(new u.i(u.n.prop(l).isBlank(),[u.n.prop(l).set(a).toStmt()])),p.addStmt(new u.k(u.n.prop(l))),c.getters.push(new u.D(e,p.finish(),s))}return u.n.prop(e)}var n=r(17),i=r(118),o=r(18),a=r(2),s=r(13),u=r(8),c=r(273),l=r(53),p=r(23),f=r(176),h=r(281),d=r(77),m=r(177),v=r(92);r.d(t,"b",function(){return g}),r.d(t,"a",function(){return _});var y=this&&this.__extends||function(e,t){function __(){this.constructor=e}for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r]);e.prototype=null===t?Object.create(t):(__.prototype=t.prototype,new __)},g=function(){function CompileNode(e,t,r,n,i){this.parent=e,this.view=t,this.nodeIndex=r,this.renderNode=n,this.sourceAst=i}return CompileNode.prototype.isNull=function(){return!this.renderNode},CompileNode.prototype.isRootElement=function(){return this.view!=this.parent.view},CompileNode}(),_=function(e){function CompileElement(t,n,i,o,c,l,p,f,h,d,m,v){var y=this;e.call(this,t,n,i,o,c),this.component=l,this._directives=p,this._resolvedProvidersArray=f,this.hasViewContainer=h,this.hasEmbeddedView=d,this._targetDependencies=v,this._compViewExpr=null,this.instances=new Map,this.directiveWrapperInstance=new Map,this._queryCount=0,this._queries=new Map,this._componentConstructorViewQueryLists=[],this.contentNodesByNgContentIndex=null,this.referenceTokens={},m.forEach(function(e){return y.referenceTokens[e.name]=e.value}),this.elementRef=u.b(r.i(s.d)(s.b.ElementRef)).instantiate([this.renderNode]),this.instances.set(r.i(s.a)(s.b.ElementRef).reference,this.elementRef),this.injector=u.n.callMethod("injector",[u.a(this.nodeIndex)]),this.instances.set(r.i(s.a)(s.b.Injector).reference,this.injector),this.instances.set(r.i(s.a)(s.b.Renderer).reference,u.n.prop("renderer")),(this.hasViewContainer||this.hasEmbeddedView||r.i(a.a)(this.component))&&this._createAppElement(),this.component&&this._createComponentFactoryResolver()}return y(CompileElement,e),CompileElement.createNull=function(){return new CompileElement(null,null,null,null,null,null,[],[],!1,!1,[],[])},CompileElement.prototype._createAppElement=function(){var e="_appEl_"+this.nodeIndex,t=this.isRootElement()?null:this.parent.nodeIndex;this.view.fields.push(new u.o(e,u.c(r.i(s.d)(s.b.AppElement)),[u.r.Private]));var n=u.n.prop(e).set(u.b(r.i(s.d)(s.b.AppElement)).instantiate([u.a(this.nodeIndex),u.a(t),u.n,this.renderNode])).toStmt();this.view.createMethod.addStmt(n),this.appElement=u.n.prop(e),this.instances.set(r.i(s.a)(s.b.AppElement).reference,this.appElement)},CompileElement.prototype._createComponentFactoryResolver=function(){var e=this,t=this.component.entryComponents.map(function(t){var r=new n.a({name:t.name});return e._targetDependencies.push(new m.a(t,r)),r});if(t&&0!==t.length){var i=u.b(r.i(s.d)(s.b.CodegenComponentFactoryResolver)).instantiate([u.g(t.map(function(e){return u.b(e)})),r.i(v.b)(r.i(s.a)(s.b.ComponentFactoryResolver),!1)]),o=new n.d({token:r.i(s.a)(s.b.ComponentFactoryResolver),useValue:i});this._resolvedProvidersArray.unshift(new l.b(o.token,!1,!0,[o],l.a.PrivateService,[],this.sourceAst.sourceSpan))}},CompileElement.prototype.setComponentView=function(e){this._compViewExpr=e,this.contentNodesByNgContentIndex=new Array(this.component.template.ngContentSelectors.length);for(var t=0;t<this.contentNodesByNgContentIndex.length;t++)this.contentNodesByNgContentIndex[t]=[]},CompileElement.prototype.setEmbeddedView=function(e){if(this.embeddedView=e,r.i(a.a)(e)){var t=u.b(r.i(s.d)(s.b.TemplateRef_)).instantiate([this.appElement,this.embeddedView.viewFactory]),i=new n.d({token:r.i(s.a)(s.b.TemplateRef),useValue:t});this._resolvedProvidersArray.unshift(new l.b(i.token,!1,!0,[i],l.a.Builtin,[],this.sourceAst.sourceSpan))}},CompileElement.prototype.beforeChildren=function(){var e=this;this.hasViewContainer&&this.instances.set(r.i(s.a)(s.b.ViewContainerRef).reference,this.appElement.prop("vcRef")),this._resolvedProviders=new Map,this._resolvedProvidersArray.forEach(function(t){return e._resolvedProviders.set(t.token.reference,t)}),o.b.values(this._resolvedProviders).forEach(function(t){var o=t.providerType===l.a.Component||t.providerType===l.a.Directive,s=t.providers.map(function(s){if(r.i(a.a)(s.useExisting))return e._getDependency(t.providerType,new n.c({token:s.useExisting}));if(r.i(a.a)(s.useFactory)){var l=s.deps||s.useFactory.diDeps,p=l.map(function(r){return e._getDependency(t.providerType,r)});return u.b(s.useFactory).callFn(p)}if(r.i(a.a)(s.useClass)){var l=s.deps||s.useClass.diDeps,p=l.map(function(r){return e._getDependency(t.providerType,r)});if(o){var f=new n.a({name:i.a.dirWrapperClassName(s.useClass)});return e._targetDependencies.push(new m.b(s.useClass,f)),u.b(f).instantiate(p,u.c(f))}return u.b(s.useClass).instantiate(p,u.c(s.useClass))}return r.i(c.a)(s.useValue)}),p="_"+t.token.name+"_"+e.nodeIndex+"_"+e.instances.size,f=createProviderProperty(p,t,s,t.multiProvider,t.eager,e);o?(e.directiveWrapperInstance.set(t.token.reference,f),e.instances.set(t.token.reference,f.prop("context"))):e.instances.set(t.token.reference,f)});for(var t=0;t<this._directives.length;t++){var p=this._directives[t],f=this.instances.get(r.i(s.c)(p.type).reference);p.queries.forEach(function(t){e._addQuery(t,f)})}var h=[];if(o.b.values(this._resolvedProviders).forEach(function(t){var r=e._getQueriesFor(t.token);o.a.addAll(h,r.map(function(e){return new b(e,t.token)}))}),Object.keys(this.referenceTokens).forEach(function(t){var i,s=e.referenceTokens[t];i=r.i(a.a)(s)?e.instances.get(s.reference):e.renderNode,e.view.locals.set(t,i);var u=new n.b({value:t});o.a.addAll(h,e._getQueriesFor(u).map(function(e){return new b(e,u)}))}),h.forEach(function(t){var n;if(r.i(a.a)(t.read.identifier))n=e.instances.get(t.read.reference);else{var i=e.referenceTokens[t.read.value];n=r.i(a.a)(i)?e.instances.get(i.reference):e.elementRef}r.i(a.a)(n)&&t.query.addValue(n,e.view)}),r.i(a.a)(this.component)){var d=r.i(a.a)(this.component)?u.g(this._componentConstructorViewQueryLists):u.h,v=r.i(a.a)(this.getComponent())?this.getComponent():u.h;this.view.createMethod.addStmt(this.appElement.callMethod("initComponent",[v,d,this._compViewExpr]).toStmt())}},CompileElement.prototype.afterChildren=function(e){var t=this;o.b.values(this._resolvedProviders).forEach(function(r){var n=t.instances.get(r.token.reference),i=r.providerType===l.a.PrivateService?0:e;t.view.injectorGetMethod.addStmt(createInjectInternalCondition(t.nodeIndex,i,r,n))}),o.b.values(this._queries).forEach(function(e){return e.forEach(function(e){return e.afterChildren(t.view.createMethod,t.view.updateContentQueriesMethod); })})},CompileElement.prototype.addContentNode=function(e,t){this.contentNodesByNgContentIndex[e].push(t)},CompileElement.prototype.getComponent=function(){return r.i(a.a)(this.component)?this.instances.get(r.i(s.c)(this.component.type).reference):null},CompileElement.prototype.getProviderTokens=function(){return o.b.values(this._resolvedProviders).map(function(e){return r.i(p.f)(e.token)})},CompileElement.prototype._getQueriesFor=function(e){for(var t,n=[],i=this,s=0;!i.isNull();)t=i._queries.get(e.reference),r.i(a.a)(t)&&o.a.addAll(n,t.filter(function(e){return e.meta.descendants||s<=1})),i._directives.length>0&&s++,i=i.parent;return t=this.view.componentView.viewQueries.get(e.reference),r.i(a.a)(t)&&o.a.addAll(n,t),n},CompileElement.prototype._addQuery=function(e,t){var n="_query_"+e.selectors[0].name+"_"+this.nodeIndex+"_"+this._queryCount++,i=r.i(h.a)(e,t,n,this.view),o=new h.b(e,i,t,this.view);return r.i(h.c)(this._queries,o),o},CompileElement.prototype._getLocalDependency=function(e,t){var n=null;if(!n&&r.i(a.a)(t.query)&&(n=this._addQuery(t.query,null).queryList),!n&&r.i(a.a)(t.viewQuery)&&(n=r.i(h.a)(t.viewQuery,null,"_viewQuery_"+t.viewQuery.selectors[0].name+"_"+this.nodeIndex+"_"+this._componentConstructorViewQueryLists.length,this.view),this._componentConstructorViewQueryLists.push(n)),r.i(a.a)(t.token)){if(!n&&t.token.reference===r.i(s.a)(s.b.ChangeDetectorRef).reference)return e===l.a.Component?this._compViewExpr.prop("ref"):r.i(v.a)(u.n.prop("ref"),this.view,this.view.componentView);if(!n){var i=this._resolvedProviders.get(t.token.reference);if(i&&(e===l.a.Directive||e===l.a.PublicService)&&i.providerType===l.a.PrivateService)return null;n=this.instances.get(t.token.reference)}}return n},CompileElement.prototype._getDependency=function(e,t){var i=this,o=null;for(t.isValue&&(o=u.a(t.value)),o||t.isSkipSelf||(o=this._getLocalDependency(e,t));!o&&!i.parent.isNull();)i=i.parent,o=i._getLocalDependency(l.a.PublicService,new n.c({token:t.token}));return o||(o=r.i(v.b)(t.token,t.isOptional)),o||(o=u.h),r.i(v.a)(o,this.view,i.view)},CompileElement}(g),b=function(){function _QueryWithRead(e,t){this.query=e,this.read=e.meta.read||t}return _QueryWithRead}()},function(e,t,r){"use strict";function createQueryValues(e){return n.a.flatten(e.values.map(function(e){return e instanceof u?mapNestedViews(e.view.declarationElement.appElement,e.view,createQueryValues(e)):e}))}function mapNestedViews(e,t,r){var n=r.map(function(e){return a.C(a.n.name,a.e("nestedView"),e)});return e.callMethod("mapNestedViews",[a.e(t.className),a.j([new a.l("nestedView",t.classType)],[new a.k(a.g(n))],a.m)])}function createQueryList(e,t,n,i){i.fields.push(new a.o(n,a.c(r.i(o.d)(o.b.QueryList),[a.m])));var s=a.n.prop(n);return i.createMethod.addStmt(a.n.prop(n).set(a.b(r.i(o.d)(o.b.QueryList),[a.m]).instantiate([])).toStmt()),s}function addQueryToTokenMap(e,t){t.meta.selectors.forEach(function(r){var n=e.get(r.reference);n||(n=[],e.set(r.reference,n)),n.push(t)})}var n=r(18),i=r(2),o=r(13),a=r(8),s=r(92);r.d(t,"b",function(){return c}),t.a=createQueryList,t.c=addQueryToTokenMap;var u=function(){function ViewQueryValues(e,t){this.view=e,this.values=t}return ViewQueryValues}(),c=function(){function CompileQuery(e,t,r,n){this.meta=e,this.queryList=t,this.ownerDirectiveExpression=r,this.view=n,this._values=new u(n,[])}return CompileQuery.prototype.addValue=function(e,t){for(var n=t,o=[];r.i(i.a)(n)&&n!==this.view;){var a=n.declarationElement;o.unshift(a),n=a.view}var c=r.i(s.a)(this.queryList,t,this.view),l=this._values;o.forEach(function(e){var t=l.values.length>0?l.values[l.values.length-1]:null;if(t instanceof u&&t.view===e.embeddedView)l=t;else{var r=new u(e.embeddedView,[]);l.values.push(r),l=r}}),l.values.push(e),o.length>0&&t.dirtyParentQueriesMethod.addStmt(c.callMethod("setDirty",[]).toStmt())},CompileQuery.prototype._isStatic=function(){return!this._values.values.some(function(e){return e instanceof u})},CompileQuery.prototype.afterChildren=function(e,t){var n=createQueryValues(this._values),o=[this.queryList.callMethod("reset",[a.g(n)]).toStmt()];if(r.i(i.a)(this.ownerDirectiveExpression)){var s=this.meta.first?this.queryList.prop("first"):this.queryList;o.push(this.ownerDirectiveExpression.prop(this.meta.propertyName).set(s).toStmt())}this.meta.first||o.push(this.queryList.callMethod("notifyOnChanges",[]).toStmt()),this.meta.first&&this._isStatic()?e.addStmts(o):t.addStmt(new a.i(this.queryList.prop("dirty"),o))},CompileQuery}()},function(e,t,r){"use strict";function getViewType(e,t){return t>0?u.j.EMBEDDED:e.type.isHost?u.j.HOST:u.j.COMPONENT}var n=r(17),i=r(18),o=r(2),a=r(13),s=r(8),u=r(14),c=r(176),l=r(450),p=r(281),f=r(77),h=r(92);r.d(t,"a",function(){return d});var d=function(){function CompileView(e,t,a,l,f,d,m,v){var y=this;this.component=e,this.genConfig=t,this.pipeMetas=a,this.styles=l,this.animations=f,this.viewIndex=d,this.declarationElement=m,this.templateVariableBindings=v,this.nodes=[],this.rootNodesOrAppElements=[],this.bindings=[],this.classStatements=[],this.eventHandlerMethods=[],this.fields=[],this.getters=[],this.disposables=[],this.subscriptions=[],this.purePipes=new Map,this.pipes=[],this.locals=new Map,this.literalArrayCount=0,this.literalMapCount=0,this.pipeCount=0,this.createMethod=new c.a(this),this.animationBindingsMethod=new c.a(this),this.injectorGetMethod=new c.a(this),this.updateContentQueriesMethod=new c.a(this),this.dirtyParentQueriesMethod=new c.a(this),this.updateViewQueriesMethod=new c.a(this),this.detectChangesInInputsMethod=new c.a(this),this.detectChangesRenderPropertiesMethod=new c.a(this),this.afterContentLifecycleCallbacksMethod=new c.a(this),this.afterViewLifecycleCallbacksMethod=new c.a(this),this.destroyMethod=new c.a(this),this.detachMethod=new c.a(this),this.viewType=getViewType(e,d),this.className="_View_"+e.type.name+d,this.classType=s.c(new n.a({name:this.className})),this.viewFactory=s.e(r.i(h.d)(e,d)),this.viewType===u.j.COMPONENT||this.viewType===u.j.HOST?this.componentView=this:this.componentView=this.declarationElement.view.componentView,this.componentContext=r.i(h.a)(s.n.prop("context"),this,this.componentView);var g=new Map;if(this.viewType===u.j.COMPONENT){var _=s.n.prop("context");i.a.forEachWithIndex(this.component.viewQueries,function(e,t){var n="_viewQuery_"+e.selectors[0].name+"_"+t,i=r.i(p.a)(e,_,n,y),o=new p.b(e,i,_,y);r.i(p.c)(g,o)});var b=0;this.component.type.diDeps.forEach(function(e){if(r.i(o.a)(e.viewQuery)){var t=s.n.prop("declarationAppElement").prop("componentConstructorViewQueries").key(s.a(b++)),n=new p.b(e.viewQuery,t,null,y);r.i(p.c)(g,n)}})}this.viewQueries=g,v.forEach(function(e){y.locals.set(e[1],s.n.prop("context").prop(e[0]))}),this.declarationElement.isNull()||this.declarationElement.setEmbeddedView(this)}return CompileView.prototype.callPipe=function(e,t,r){return l.a.call(this,e,[t].concat(r))},CompileView.prototype.getLocal=function(e){if(e==f.b.event.name)return f.b.event;for(var t=this,n=t.locals.get(e);!n&&r.i(o.a)(t.declarationElement.view);)t=t.declarationElement.view,n=t.locals.get(e);return r.i(o.a)(n)?r.i(h.a)(n,this,t):null},CompileView.prototype.createLiteralArray=function(e){if(0===e.length)return s.b(r.i(a.d)(a.b.EMPTY_ARRAY));for(var t=s.n.prop("_arr_"+this.literalArrayCount++),n=[],i=[],o=0;o<e.length;o++){var u="p"+o;n.push(new s.l(u)),i.push(s.e(u))}return r.i(h.c)(s.j(n,[new s.k(s.g(i))],new s.A(s.m)),e.length,t,this),t.callFn(e)},CompileView.prototype.createLiteralMap=function(e){if(0===e.length)return s.b(r.i(a.d)(a.b.EMPTY_MAP));for(var t=s.n.prop("_map_"+this.literalMapCount++),n=[],i=[],o=[],u=0;u<e.length;u++){var c="p"+u;n.push(new s.l(c)),i.push([e[u][0],s.e(c)]),o.push(e[u][1])}return r.i(h.c)(s.j(n,[new s.k(s.f(i))],new s.q(s.m)),e.length,t,this),t.callFn(o)},CompileView.prototype.afterNodes=function(){var e=this;i.b.values(this.viewQueries).forEach(function(t){return t.forEach(function(t){return t.afterChildren(e.createMethod,e.updateViewQueriesMethod)})})},CompileView}()},function(e,t,r){"use strict";function convertCdExpressionToIr(e,t,r,n,i){var o=new c(e,t,n,i),a=r.visit(o,s.Expression);return new u(a,o.needsValueUnwrapper,o.temporaryCount)}function convertCdStatementToIr(e,t,r,n){var i=new c(e,t,null,n),o=[];return flattenStatements(r.visit(i,s.Statement),o),prependTemporaryDecls(i.temporaryCount,n,o),o}function temporaryName(e,t){return"tmp_"+e+"_"+t}function temporaryDeclaration(e,t){return new a.E(temporaryName(e,t),a.h)}function prependTemporaryDecls(e,t,r){for(var n=e-1;n>=0;n--)r.unshift(temporaryDeclaration(t,n))}function ensureStatementMode(e,t){if(e!==s.Statement)throw new Error("Expected a statement, but saw "+t)}function ensureExpressionMode(e,t){if(e!==s.Expression)throw new Error("Expected an expression, but saw "+t)}function convertToStatementIfNeeded(e,t){return e===s.Statement?t.toStmt():t}function flattenStatements(e,t){Array.isArray(e)?e.forEach(function(e){return flattenStatements(e,t)}):t.push(e)}var n=r(164),i=r(2),o=r(13),a=r(8);t.b=convertCdExpressionToIr,t.a=convertCdStatementToIr,t.c=temporaryDeclaration;var s,u=function(){function ExpressionWithWrappedValueInfo(e,t,r){this.expression=e,this.needsValueUnwrapper=t,this.temporaryCount=r}return ExpressionWithWrappedValueInfo}();!function(e){e[e.Statement=0]="Statement",e[e.Expression=1]="Expression"}(s||(s={}));var c=function(){function _AstToIrVisitor(e,t,r,n){this._nameResolver=e,this._implicitReceiver=t,this._valueUnwrapper=r,this.bindingIndex=n,this._nodeMap=new Map,this._resultMap=new Map,this._currentTemporary=0,this.needsValueUnwrapper=!1,this.temporaryCount=0}return _AstToIrVisitor.prototype.visitBinary=function(e,t){var r;switch(e.operation){case"+":r=a.F.Plus;break;case"-":r=a.F.Minus;break;case"*":r=a.F.Multiply;break;case"/":r=a.F.Divide;break;case"%":r=a.F.Modulo;break;case"&&":r=a.F.And;break;case"||":r=a.F.Or;break;case"==":r=a.F.Equals;break;case"!=":r=a.F.NotEquals;break;case"===":r=a.F.Identical;break;case"!==":r=a.F.NotIdentical;break;case"<":r=a.F.Lower;break;case">":r=a.F.Bigger;break;case"<=":r=a.F.LowerEquals;break;case">=":r=a.F.BiggerEquals;break;default:throw new Error("Unsupported operation "+e.operation)}return convertToStatementIfNeeded(t,new a.G(r,this.visit(e.left,s.Expression),this.visit(e.right,s.Expression)))},_AstToIrVisitor.prototype.visitChain=function(e,t){return ensureStatementMode(t,e),this.visitAll(e.expressions,t)},_AstToIrVisitor.prototype.visitConditional=function(e,t){var r=this.visit(e.condition,s.Expression);return convertToStatementIfNeeded(t,r.conditional(this.visit(e.trueExp,s.Expression),this.visit(e.falseExp,s.Expression)))},_AstToIrVisitor.prototype.visitPipe=function(e,t){var r=this.visit(e.exp,s.Expression),n=this.visitAll(e.args,s.Expression),i=this._nameResolver.callPipe(e.name,r,n);return this.needsValueUnwrapper=!0,convertToStatementIfNeeded(t,this._valueUnwrapper.callMethod("unwrap",[i]))},_AstToIrVisitor.prototype.visitFunctionCall=function(e,t){return convertToStatementIfNeeded(t,this.visit(e.target,s.Expression).callFn(this.visitAll(e.args,s.Expression)))},_AstToIrVisitor.prototype.visitImplicitReceiver=function(e,t){return ensureExpressionMode(t,e),this._implicitReceiver},_AstToIrVisitor.prototype.visitInterpolation=function(e,t){ensureExpressionMode(t,e);for(var n=[a.a(e.expressions.length)],i=0;i<e.strings.length-1;i++)n.push(a.a(e.strings[i])),n.push(this.visit(e.expressions[i],s.Expression));return n.push(a.a(e.strings[e.strings.length-1])),a.b(r.i(o.d)(o.b.interpolate)).callFn(n)},_AstToIrVisitor.prototype.visitKeyedRead=function(e,t){return convertToStatementIfNeeded(t,this.visit(e.obj,s.Expression).key(this.visit(e.key,s.Expression)))},_AstToIrVisitor.prototype.visitKeyedWrite=function(e,t){var r=this.visit(e.obj,s.Expression),n=this.visit(e.key,s.Expression),i=this.visit(e.value,s.Expression);return convertToStatementIfNeeded(t,r.key(n).set(i))},_AstToIrVisitor.prototype.visitLiteralArray=function(e,t){return convertToStatementIfNeeded(t,this._nameResolver.createLiteralArray(this.visitAll(e.expressions,t)))},_AstToIrVisitor.prototype.visitLiteralMap=function(e,t){for(var r=[],n=0;n<e.keys.length;n++)r.push([e.keys[n],this.visit(e.values[n],s.Expression)]);return convertToStatementIfNeeded(t,this._nameResolver.createLiteralMap(r))},_AstToIrVisitor.prototype.visitLiteralPrimitive=function(e,t){return convertToStatementIfNeeded(t,a.a(e.value))},_AstToIrVisitor.prototype.visitMethodCall=function(e,t){var n=this.leftMostSafeNode(e);if(n)return this.convertSafeAccess(e,n,t);var o=this.visitAll(e.args,s.Expression),a=null,u=this.visit(e.receiver,s.Expression);if(u===this._implicitReceiver){var c=this._nameResolver.getLocal(e.name);r.i(i.a)(c)&&(a=c.callFn(o))}return r.i(i.b)(a)&&(a=u.callMethod(e.name,o)),convertToStatementIfNeeded(t,a)},_AstToIrVisitor.prototype.visitPrefixNot=function(e,t){return convertToStatementIfNeeded(t,a.v(this.visit(e.expression,s.Expression)))},_AstToIrVisitor.prototype.visitPropertyRead=function(e,t){var n=this.leftMostSafeNode(e);if(n)return this.convertSafeAccess(e,n,t);var o=null,a=this.visit(e.receiver,s.Expression);return a===this._implicitReceiver&&(o=this._nameResolver.getLocal(e.name)),r.i(i.b)(o)&&(o=a.prop(e.name)),convertToStatementIfNeeded(t,o)},_AstToIrVisitor.prototype.visitPropertyWrite=function(e,t){var n=this.visit(e.receiver,s.Expression);if(n===this._implicitReceiver){var o=this._nameResolver.getLocal(e.name);if(r.i(i.a)(o))throw new Error("Cannot assign to a reference or variable!")}return convertToStatementIfNeeded(t,n.prop(e.name).set(this.visit(e.value,s.Expression)))},_AstToIrVisitor.prototype.visitSafePropertyRead=function(e,t){return this.convertSafeAccess(e,this.leftMostSafeNode(e),t)},_AstToIrVisitor.prototype.visitSafeMethodCall=function(e,t){return this.convertSafeAccess(e,this.leftMostSafeNode(e),t)},_AstToIrVisitor.prototype.visitAll=function(e,t){var r=this;return e.map(function(e){return r.visit(e,t)})},_AstToIrVisitor.prototype.visitQuote=function(e,t){throw new Error("Quotes are not supported for evaluation!")},_AstToIrVisitor.prototype.visit=function(e,t){var r=this._resultMap.get(e);return r?r:(this._nodeMap.get(e)||e).visit(this,t)},_AstToIrVisitor.prototype.convertSafeAccess=function(e,t,r){var i,o=this.visit(t.receiver,s.Expression);this.needsTemporary(t.receiver)&&(i=this.allocateTemporary(),o=i.set(o),this._resultMap.set(t.receiver,i));var u=o.isBlank();t instanceof n.s?this._nodeMap.set(t,new n.t(t.span,t.receiver,t.name,t.args)):this._nodeMap.set(t,new n.w(t.span,t.receiver,t.name));var c=this.visit(e,s.Expression);return this._nodeMap.delete(t),i&&this.releaseTemporary(i),convertToStatementIfNeeded(r,u.conditional(a.a(null),c))},_AstToIrVisitor.prototype.leftMostSafeNode=function(e){var t=this,r=function(e,r){return(t._nodeMap.get(r)||r).visit(e)};return e.visit({visitBinary:function(e){return null},visitChain:function(e){return null},visitConditional:function(e){return null},visitFunctionCall:function(e){return null},visitImplicitReceiver:function(e){return null},visitInterpolation:function(e){return null},visitKeyedRead:function(e){return r(this,e.obj)},visitKeyedWrite:function(e){return null},visitLiteralArray:function(e){return null},visitLiteralMap:function(e){return null},visitLiteralPrimitive:function(e){return null},visitMethodCall:function(e){return r(this,e.receiver)},visitPipe:function(e){return null},visitPrefixNot:function(e){return null},visitPropertyRead:function(e){return r(this,e.receiver)},visitPropertyWrite:function(e){return null},visitQuote:function(e){return null},visitSafeMethodCall:function(e){return r(this,e.receiver)||e},visitSafePropertyRead:function(e){return r(this,e.receiver)||e}})},_AstToIrVisitor.prototype.needsTemporary=function(e){var t=this,r=function(e,r){return r&&(t._nodeMap.get(r)||r).visit(e)},n=function(e,t){return t.some(function(t){return r(e,t)})};return e.visit({visitBinary:function(e){return r(this,e.left)||r(this,e.right)},visitChain:function(e){return!1},visitConditional:function(e){return r(this,e.condition)||r(this,e.trueExp)||r(this,e.falseExp)},visitFunctionCall:function(e){return!0},visitImplicitReceiver:function(e){return!1},visitInterpolation:function(e){return n(this,e.expressions)},visitKeyedRead:function(e){return!1},visitKeyedWrite:function(e){return!1},visitLiteralArray:function(e){return!0},visitLiteralMap:function(e){return!0},visitLiteralPrimitive:function(e){return!1},visitMethodCall:function(e){return!0},visitPipe:function(e){return!0},visitPrefixNot:function(e){return r(this,e.expression)},visitPropertyRead:function(e){return!1},visitPropertyWrite:function(e){return!1},visitQuote:function(e){return!1},visitSafeMethodCall:function(e){return!0},visitSafePropertyRead:function(e){return!1}})},_AstToIrVisitor.prototype.allocateTemporary=function(){var e=this._currentTemporary++;return this.temporaryCount=Math.max(this._currentTemporary,this.temporaryCount),new a.x(temporaryName(this.bindingIndex,e))},_AstToIrVisitor.prototype.releaseTemporary=function(e){if(this._currentTemporary--,e.name!=temporaryName(this.bindingIndex,this._currentTemporary))throw new Error("Temporary "+e.name+" released out of order")},_AstToIrVisitor}()},function(e,t,r){"use strict";r.d(t,"a",function(){return n}),r.d(t,"b",function(){return i}),r.d(t,"c",function(){return o}),r.d(t,"d",function(){return a});var n="true",i="*",o="*",a="void"},function(e,t,r){"use strict";var n=r(3);r.d(t,"a",function(){return i});var i=function(){function AnimationGroupPlayer(e){var t=this;this._players=e,this._onDoneFns=[],this._onStartFns=[],this._finished=!1,this._started=!1,this.parentPlayer=null;var i=0,o=this._players.length;0==o?r.i(n.l)(function(){return t._onFinish()}):this._players.forEach(function(e){e.parentPlayer=t,e.onDone(function(){++i>=o&&t._onFinish()})})}return AnimationGroupPlayer.prototype._onFinish=function(){this._finished||(this._finished=!0,r.i(n.d)(this.parentPlayer)||this.destroy(),this._onDoneFns.forEach(function(e){return e()}),this._onDoneFns=[])},AnimationGroupPlayer.prototype.init=function(){this._players.forEach(function(e){return e.init()})},AnimationGroupPlayer.prototype.onStart=function(e){this._onStartFns.push(e)},AnimationGroupPlayer.prototype.onDone=function(e){this._onDoneFns.push(e)},AnimationGroupPlayer.prototype.hasStarted=function(){return this._started},AnimationGroupPlayer.prototype.play=function(){r.i(n.d)(this.parentPlayer)||this.init(),this.hasStarted()||(this._onStartFns.forEach(function(e){return e()}),this._onStartFns=[],this._started=!0),this._players.forEach(function(e){return e.play()})},AnimationGroupPlayer.prototype.pause=function(){this._players.forEach(function(e){return e.pause()})},AnimationGroupPlayer.prototype.restart=function(){this._players.forEach(function(e){return e.restart()})},AnimationGroupPlayer.prototype.finish=function(){this._onFinish(),this._players.forEach(function(e){return e.finish()})},AnimationGroupPlayer.prototype.destroy=function(){this._onFinish(),this._players.forEach(function(e){return e.destroy()})},AnimationGroupPlayer.prototype.reset=function(){this._players.forEach(function(e){return e.reset()})},AnimationGroupPlayer.prototype.setPosition=function(e){this._players.forEach(function(t){t.setPosition(e)})},AnimationGroupPlayer.prototype.getPosition=function(){var e=0;return this._players.forEach(function(t){var r=t.getPosition();e=Math.min(r,e)}),e},AnimationGroupPlayer}()},function(e,t,r){"use strict";function queueAnimation(e){n.push(e)}function triggerQueuedAnimations(){for(var e=0;e<n.length;e++){var t=n[e];t.play()}n=[]}t.b=queueAnimation,t.a=triggerQueuedAnimations;var n=[]},function(e,t,r){"use strict";r.d(t,"a",function(){return n});var n=function(){function AnimationTransitionEvent(e){var t=e.fromState,r=e.toState,n=e.totalTime,i=e.phaseName;this.fromState=t,this.toState=r,this.totalTime=n,this.phaseName=i}return AnimationTransitionEvent}()},function(e,t,r){"use strict";function animate(e,t){void 0===t&&(t=null);var i=t;if(!r.i(n.d)(i)){var o={};i=new f([o],1)}return new h(e,i)}function group(e){return new v(e)}function sequence(e){return new m(e)}function style(e){var t,i=null;return"string"==typeof e?t=[e]:(t=Array.isArray(e)?e:[e],t.forEach(function(e){var t=e.offset;r.i(n.d)(t)&&(i=null==i?parseFloat(t):i)})),new f(t,i)}function state(e,t){return new u(e,t)}function keyframes(e){return new p(e)}function transition(e,t){var r=Array.isArray(t)?new m(t):t;return new c(e,r)}function trigger(e,t){return new a(e,t)}var n=r(3);r.d(t,"a",function(){return o}),r.d(t,"i",function(){return a}),r.d(t,"j",function(){return s}),r.d(t,"b",function(){return u}),r.d(t,"c",function(){return c}),r.d(t,"k",function(){return l}),r.d(t,"e",function(){return p}),r.d(t,"d",function(){return f}),r.d(t,"f",function(){return h}),r.d(t,"g",function(){return d}),r.d(t,"l",function(){return m}),r.d(t,"h",function(){return v}),t.m=animate,t.n=group,t.o=sequence,t.p=style,t.q=state,t.r=keyframes,t.s=transition,t.t=trigger;var i=this&&this.__extends||function(e,t){function __(){this.constructor=e}for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r]);e.prototype=null===t?Object.create(t):(__.prototype=t.prototype,new __)},o="*",a=function(){function AnimationEntryMetadata(e,t){this.name=e,this.definitions=t}return AnimationEntryMetadata}(),s=function(){function AnimationStateMetadata(){}return AnimationStateMetadata}(),u=function(e){function AnimationStateDeclarationMetadata(t,r){e.call(this),this.stateNameExpr=t,this.styles=r}return i(AnimationStateDeclarationMetadata,e),AnimationStateDeclarationMetadata}(s),c=function(e){function AnimationStateTransitionMetadata(t,r){e.call(this),this.stateChangeExpr=t,this.steps=r}return i(AnimationStateTransitionMetadata,e),AnimationStateTransitionMetadata}(s),l=function(){function AnimationMetadata(){}return AnimationMetadata}(),p=function(e){function AnimationKeyframesSequenceMetadata(t){e.call(this),this.steps=t}return i(AnimationKeyframesSequenceMetadata,e),AnimationKeyframesSequenceMetadata}(l),f=function(e){function AnimationStyleMetadata(t,r){void 0===r&&(r=null),e.call(this),this.styles=t,this.offset=r}return i(AnimationStyleMetadata,e),AnimationStyleMetadata}(l),h=function(e){function AnimationAnimateMetadata(t,r){e.call(this),this.timings=t,this.styles=r}return i(AnimationAnimateMetadata,e),AnimationAnimateMetadata}(l),d=function(e){function AnimationWithStepsMetadata(){e.call(this)}return i(AnimationWithStepsMetadata,e),Object.defineProperty(AnimationWithStepsMetadata.prototype,"steps",{get:function(){throw new Error("NOT IMPLEMENTED: Base Class")},enumerable:!0,configurable:!0}),AnimationWithStepsMetadata}(l),m=function(e){function AnimationSequenceMetadata(t){e.call(this),this._steps=t}return i(AnimationSequenceMetadata,e),Object.defineProperty(AnimationSequenceMetadata.prototype,"steps",{get:function(){return this._steps},enumerable:!0,configurable:!0}),AnimationSequenceMetadata}(d),v=function(e){function AnimationGroupMetadata(t){e.call(this),this._steps=t}return i(AnimationGroupMetadata,e),Object.defineProperty(AnimationGroupMetadata.prototype,"steps",{get:function(){return this._steps},enumerable:!0,configurable:!0}),AnimationGroupMetadata}(d)},function(e,t,r){"use strict";var n=r(3);r.d(t,"a",function(){return i}),r.d(t,"b",function(){return a});var i=function(){function DefaultKeyValueDifferFactory(){}return DefaultKeyValueDifferFactory.prototype.supports=function(e){return e instanceof Map||r.i(n.e)(e)},DefaultKeyValueDifferFactory.prototype.create=function(e){return new o},DefaultKeyValueDifferFactory}(),o=function(){function DefaultKeyValueDiffer(){this._records=new Map,this._mapHead=null,this._previousMapHead=null,this._changesHead=null,this._changesTail=null,this._additionsHead=null,this._additionsTail=null,this._removalsHead=null,this._removalsTail=null}return Object.defineProperty(DefaultKeyValueDiffer.prototype,"isDirty",{get:function(){return null!==this._additionsHead||null!==this._changesHead||null!==this._removalsHead},enumerable:!0,configurable:!0}),DefaultKeyValueDiffer.prototype.forEachItem=function(e){var t;for(t=this._mapHead;null!==t;t=t._next)e(t)},DefaultKeyValueDiffer.prototype.forEachPreviousItem=function(e){var t;for(t=this._previousMapHead;null!==t;t=t._nextPrevious)e(t)},DefaultKeyValueDiffer.prototype.forEachChangedItem=function(e){var t;for(t=this._changesHead;null!==t;t=t._nextChanged)e(t)},DefaultKeyValueDiffer.prototype.forEachAddedItem=function(e){var t;for(t=this._additionsHead;null!==t;t=t._nextAdded)e(t)},DefaultKeyValueDiffer.prototype.forEachRemovedItem=function(e){var t;for(t=this._removalsHead;null!==t;t=t._nextRemoved)e(t)},DefaultKeyValueDiffer.prototype.diff=function(e){if(e){if(!(e instanceof Map||r.i(n.e)(e)))throw new Error("Error trying to diff '"+e+"'")}else e=new Map;return this.check(e)?this:null},DefaultKeyValueDiffer.prototype.onDestroy=function(){},DefaultKeyValueDiffer.prototype.check=function(e){var t=this;this._reset();var r=this._records,n=this._mapHead,i=null,o=null,s=!1;return this._forEach(e,function(e,u){var c;n&&u===n.key?(c=n,t._maybeAddToChanges(c,e)):(s=!0,null!==n&&(t._removeFromSeq(i,n),t._addToRemovals(n)),r.has(u)?(c=r.get(u),t._maybeAddToChanges(c,e)):(c=new a(u),r.set(u,c),c.currentValue=e,t._addToAdditions(c))),s&&(t._isInRemovals(c)&&t._removeFromRemovals(c),null==o?t._mapHead=c:o._next=c),i=n,o=c,n=n&&n._next}),this._truncate(i,n),this.isDirty},DefaultKeyValueDiffer.prototype._reset=function(){if(this.isDirty){var e=void 0;for(e=this._previousMapHead=this._mapHead;null!==e;e=e._next)e._nextPrevious=e._next;for(e=this._changesHead;null!==e;e=e._nextChanged)e.previousValue=e.currentValue;for(e=this._additionsHead;null!=e;e=e._nextAdded)e.previousValue=e.currentValue;this._changesHead=this._changesTail=null,this._additionsHead=this._additionsTail=null,this._removalsHead=this._removalsTail=null}},DefaultKeyValueDiffer.prototype._truncate=function(e,t){for(;null!==t;){null===e?this._mapHead=null:e._next=null;var r=t._next;this._addToRemovals(t),e=t,t=r}for(var n=this._removalsHead;null!==n;n=n._nextRemoved)n.previousValue=n.currentValue,n.currentValue=null,this._records.delete(n.key)},DefaultKeyValueDiffer.prototype._maybeAddToChanges=function(e,t){r.i(n.i)(t,e.currentValue)||(e.previousValue=e.currentValue,e.currentValue=t,this._addToChanges(e))},DefaultKeyValueDiffer.prototype._isInRemovals=function(e){return e===this._removalsHead||null!==e._nextRemoved||null!==e._prevRemoved},DefaultKeyValueDiffer.prototype._addToRemovals=function(e){null===this._removalsHead?this._removalsHead=this._removalsTail=e:(this._removalsTail._nextRemoved=e,e._prevRemoved=this._removalsTail,this._removalsTail=e)},DefaultKeyValueDiffer.prototype._removeFromSeq=function(e,t){var r=t._next;null===e?this._mapHead=r:e._next=r,t._next=null},DefaultKeyValueDiffer.prototype._removeFromRemovals=function(e){var t=e._prevRemoved,r=e._nextRemoved;null===t?this._removalsHead=r:t._nextRemoved=r,null===r?this._removalsTail=t:r._prevRemoved=t,e._prevRemoved=e._nextRemoved=null},DefaultKeyValueDiffer.prototype._addToAdditions=function(e){null===this._additionsHead?this._additionsHead=this._additionsTail=e:(this._additionsTail._nextAdded=e,this._additionsTail=e)},DefaultKeyValueDiffer.prototype._addToChanges=function(e){null===this._changesHead?this._changesHead=this._changesTail=e:(this._changesTail._nextChanged=e,this._changesTail=e)},DefaultKeyValueDiffer.prototype.toString=function(){var e,t=[],i=[],o=[],a=[],s=[];for(e=this._mapHead;null!==e;e=e._next)t.push(r.i(n.b)(e));for(e=this._previousMapHead;null!==e;e=e._nextPrevious)i.push(r.i(n.b)(e));for(e=this._changesHead;null!==e;e=e._nextChanged)o.push(r.i(n.b)(e));for(e=this._additionsHead;null!==e;e=e._nextAdded)a.push(r.i(n.b)(e));for(e=this._removalsHead;null!==e;e=e._nextRemoved)s.push(r.i(n.b)(e));return"map: "+t.join(", ")+"\nprevious: "+i.join(", ")+"\nadditions: "+a.join(", ")+"\nchanges: "+o.join(", ")+"\nremovals: "+s.join(", ")+"\n"},DefaultKeyValueDiffer.prototype._forEach=function(e,t){e instanceof Map?e.forEach(t):Object.keys(e).forEach(function(r){return t(e[r],r)})},DefaultKeyValueDiffer}(),a=function(){function KeyValueChangeRecord(e){this.key=e,this.previousValue=null,this.currentValue=null,this._nextPrevious=null,this._next=null,this._nextAdded=null,this._nextRemoved=null,this._prevRemoved=null,this._nextChanged=null}return KeyValueChangeRecord.prototype.toString=function(){return r.i(n.i)(this.previousValue,this.currentValue)?r.i(n.b)(this.key):r.i(n.b)(this.key)+"["+r.i(n.b)(this.previousValue)+"->"+r.i(n.b)(this.currentValue)+"]"},KeyValueChangeRecord}()},function(e,t,r){"use strict";var n=r(33),i=r(19),o=r(3);r.d(t,"a",function(){return a});var a=function(){function IterableDiffers(e){this.factories=e}return IterableDiffers.create=function(e,t){if(r.i(o.d)(t)){var n=i.a.clone(t.factories);return e=e.concat(n),new IterableDiffers(e)}return new IterableDiffers(e)},IterableDiffers.extend=function(e){return{provide:IterableDiffers,useFactory:function(t){if(!t)throw new Error("Cannot extend IterableDiffers without a parent injector");return IterableDiffers.create(e,t)},deps:[[IterableDiffers,new n.e,new n.d]]}},IterableDiffers.prototype.find=function(e){var t=this.factories.find(function(t){return t.supports(e)});if(r.i(o.d)(t))return t;throw new Error("Cannot find a differ supporting object '"+e+"' of type '"+r.i(o.j)(e)+"'")},IterableDiffers}()},function(e,t,r){"use strict";var n=r(33),i=r(19),o=r(3);r.d(t,"a",function(){return a});var a=function(){function KeyValueDiffers(e){this.factories=e}return KeyValueDiffers.create=function(e,t){if(r.i(o.d)(t)){var n=i.a.clone(t.factories);return e=e.concat(n),new KeyValueDiffers(e)}return new KeyValueDiffers(e)},KeyValueDiffers.extend=function(e){return{provide:KeyValueDiffers,useFactory:function(t){if(!t)throw new Error("Cannot extend KeyValueDiffers without a parent injector");return KeyValueDiffers.create(e,t)},deps:[[KeyValueDiffers,new n.e,new n.d]]}},KeyValueDiffers.prototype.find=function(e){var t=this.factories.find(function(t){return t.supports(e)});if(r.i(o.d)(t))return t;throw new Error("Cannot find a differ supporting object '"+e+"'")},KeyValueDiffers}()},function(e,t,r){"use strict";function asNativeElements(e){return e.map(function(e){return e.nativeElement})}function _queryElementChildren(e,t,r){e.childNodes.forEach(function(e){e instanceof u&&(t(e)&&r.push(e),_queryElementChildren(e,t,r))})}function _queryNodeChildren(e,t,r){e instanceof u&&e.childNodes.forEach(function(e){t(e)&&r.push(e),e instanceof u&&_queryNodeChildren(e,t,r)})}function getDebugNode(e){return c.get(e)}function indexDebugNode(e){c.set(e.nativeNode,e)}function removeDebugNodeFromIndex(e){c.delete(e.nativeNode)}var n=r(19),i=r(3);r.d(t,"f",function(){return a}),r.d(t,"d",function(){return s}),r.d(t,"a",function(){return u}),t.g=asNativeElements,t.c=getDebugNode,t.b=indexDebugNode,t.e=removeDebugNodeFromIndex;var o=this&&this.__extends||function(e,t){function __(){this.constructor=e}for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r]);e.prototype=null===t?Object.create(t):(__.prototype=t.prototype,new __)},a=function(){function EventListener(e,t){this.name=e,this.callback=t}return EventListener}(),s=function(){function DebugNode(e,t,n){this._debugInfo=n,this.nativeNode=e,r.i(i.d)(t)&&t instanceof u?t.addChild(this):this.parent=null,this.listeners=[]}return Object.defineProperty(DebugNode.prototype,"injector",{get:function(){return r.i(i.d)(this._debugInfo)?this._debugInfo.injector:null},enumerable:!0,configurable:!0}),Object.defineProperty(DebugNode.prototype,"componentInstance",{get:function(){return r.i(i.d)(this._debugInfo)?this._debugInfo.component:null},enumerable:!0,configurable:!0}),Object.defineProperty(DebugNode.prototype,"context",{get:function(){return r.i(i.d)(this._debugInfo)?this._debugInfo.context:null},enumerable:!0,configurable:!0}),Object.defineProperty(DebugNode.prototype,"references",{get:function(){return r.i(i.d)(this._debugInfo)?this._debugInfo.references:null; },enumerable:!0,configurable:!0}),Object.defineProperty(DebugNode.prototype,"providerTokens",{get:function(){return r.i(i.d)(this._debugInfo)?this._debugInfo.providerTokens:null},enumerable:!0,configurable:!0}),Object.defineProperty(DebugNode.prototype,"source",{get:function(){return r.i(i.d)(this._debugInfo)?this._debugInfo.source:null},enumerable:!0,configurable:!0}),DebugNode}(),u=function(e){function DebugElement(t,r,n){e.call(this,t,r,n),this.properties={},this.attributes={},this.classes={},this.styles={},this.childNodes=[],this.nativeElement=t}return o(DebugElement,e),DebugElement.prototype.addChild=function(e){r.i(i.d)(e)&&(this.childNodes.push(e),e.parent=this)},DebugElement.prototype.removeChild=function(e){var t=this.childNodes.indexOf(e);t!==-1&&(e.parent=null,this.childNodes.splice(t,1))},DebugElement.prototype.insertChildrenAfter=function(e,t){var o=this.childNodes.indexOf(e);if(o!==-1){var a=this.childNodes.slice(0,o+1),s=this.childNodes.slice(o+1);this.childNodes=n.a.concat(n.a.concat(a,t),s);for(var u=0;u<t.length;++u){var c=t[u];r.i(i.d)(c.parent)&&c.parent.removeChild(c),c.parent=this}}},DebugElement.prototype.query=function(e){var t=this.queryAll(e);return t.length>0?t[0]:null},DebugElement.prototype.queryAll=function(e){var t=[];return _queryElementChildren(this,e,t),t},DebugElement.prototype.queryAllNodes=function(e){var t=[];return _queryNodeChildren(this,e,t),t},Object.defineProperty(DebugElement.prototype,"children",{get:function(){var e=[];return this.childNodes.forEach(function(t){t instanceof DebugElement&&e.push(t)}),e},enumerable:!0,configurable:!0}),DebugElement.prototype.triggerEventHandler=function(e,t){this.listeners.forEach(function(r){r.name==e&&r.callback(t)})},DebugElement}(s),c=new Map},function(e,t,r){"use strict";function findFirstClosedCycle(e){for(var t=[],r=0;r<e.length;++r){if(n.a.contains(t,e[r]))return t.push(e[r]),t;t.push(e[r])}return t}function constructResolvingPath(e){if(e.length>1){var t=findFirstClosedCycle(n.a.reversed(e)),i=t.map(function(e){return r.i(o.b)(e.token)});return" ("+i.join(" -> ")+")"}return""}var n=r(19),i=r(29),o=r(3);r.d(t,"f",function(){return s}),r.d(t,"h",function(){return u}),r.d(t,"e",function(){return c}),r.d(t,"g",function(){return l}),r.d(t,"b",function(){return p}),r.d(t,"c",function(){return f}),r.d(t,"d",function(){return h}),r.d(t,"a",function(){return d});var a=this&&this.__extends||function(e,t){function __(){this.constructor=e}for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r]);e.prototype=null===t?Object.create(t):(__.prototype=t.prototype,new __)},s=function(e){function AbstractProviderError(t,r,n){e.call(this,"DI Error"),this.keys=[r],this.injectors=[t],this.constructResolvingMessage=n,this.message=this.constructResolvingMessage(this.keys)}return a(AbstractProviderError,e),AbstractProviderError.prototype.addKey=function(e,t){this.injectors.push(e),this.keys.push(t),this.message=this.constructResolvingMessage(this.keys)},AbstractProviderError}(i.b),u=function(e){function NoProviderError(t,i){e.call(this,t,i,function(e){var t=r.i(o.b)(n.a.first(e).token);return"No provider for "+t+"!"+constructResolvingPath(e)})}return a(NoProviderError,e),NoProviderError}(s),c=function(e){function CyclicDependencyError(t,r){e.call(this,t,r,function(e){return"Cannot instantiate cyclic dependency!"+constructResolvingPath(e)})}return a(CyclicDependencyError,e),CyclicDependencyError}(s),l=function(e){function InstantiationError(t,r,n,i){e.call(this,"DI Error",r),this.keys=[i],this.injectors=[t]}return a(InstantiationError,e),InstantiationError.prototype.addKey=function(e,t){this.injectors.push(e),this.keys.push(t)},Object.defineProperty(InstantiationError.prototype,"message",{get:function(){var e=r.i(o.b)(n.a.first(this.keys).token);return this.originalError.message+": Error during instantiation of "+e+"!"+constructResolvingPath(this.keys)+"."},enumerable:!0,configurable:!0}),Object.defineProperty(InstantiationError.prototype,"causeKey",{get:function(){return this.keys[0]},enumerable:!0,configurable:!0}),InstantiationError}(i.c),p=function(e){function InvalidProviderError(t){e.call(this,"Invalid provider - only instances of Provider and Type are allowed, got: "+t)}return a(InvalidProviderError,e),InvalidProviderError}(i.b),f=function(e){function NoAnnotationError(t,r){e.call(this,NoAnnotationError._genMessage(t,r))}return a(NoAnnotationError,e),NoAnnotationError._genMessage=function(e,t){for(var n=[],i=0,a=t.length;i<a;i++){var s=t[i];s&&0!=s.length?n.push(s.map(o.b).join(" ")):n.push("?")}return"Cannot resolve all parameters for '"+r.i(o.b)(e)+"'("+n.join(", ")+"). Make sure that all the parameters are decorated with Inject or have valid type annotations and that '"+r.i(o.b)(e)+"' is decorated with Injectable."},NoAnnotationError}(i.b),h=function(e){function OutOfBoundsError(t){e.call(this,"Index "+t+" is out-of-bounds.")}return a(OutOfBoundsError,e),OutOfBoundsError}(i.b),d=function(e){function MixingMultiProvidersWithRegularProvidersError(t,r){e.call(this,"Cannot mix multi providers and regular providers, got: "+t.toString()+" "+r.toString())}return a(MixingMultiProvidersWithRegularProvidersError,e),MixingMultiProvidersWithRegularProvidersError}(i.b)},function(e,t,r){"use strict";r.d(t,"a",function(){return n});var n=function(){function ErrorHandler(e){void 0===e&&(e=!0),this._console=console,this.rethrowError=e}return ErrorHandler.prototype.handleError=function(e){var t=this._findOriginalError(e),r=this._findOriginalStack(e),n=this._findContext(e);if(this._console.error("EXCEPTION: "+this._extractMessage(e)),t&&this._console.error("ORIGINAL EXCEPTION: "+this._extractMessage(t)),r&&(this._console.error("ORIGINAL STACKTRACE:"),this._console.error(r)),n&&(this._console.error("ERROR CONTEXT:"),this._console.error(n)),this.rethrowError)throw e},ErrorHandler.prototype._extractMessage=function(e){return e instanceof Error?e.message:e.toString()},ErrorHandler.prototype._findContext=function(e){return e?e.context?e.context:this._findContext(e.originalError):null},ErrorHandler.prototype._findOriginalError=function(e){for(var t=e.originalError;t&&t.originalError;)t=t.originalError;return t},ErrorHandler.prototype._findOriginalStack=function(e){if(!(e instanceof Error))return null;for(var t=e,r=t.stack;t instanceof Error&&t.originalError;)t=t.originalError,t instanceof Error&&t.stack&&(r=t.stack);return r},ErrorHandler}()},function(e,t,r){"use strict";var n=r(184);r.d(t,"a",function(){return i}),r.d(t,"c",function(){return o}),r.d(t,"b",function(){return a});var i=new n.a("LocaleId"),o=new n.a("Translations"),a=new n.a("TranslationsFormat")},function(e,t,r){"use strict";var n=r(29),i=r(132);r.d(t,"b",function(){return a}),r.d(t,"a",function(){return c});var o=this&&this.__extends||function(e,t){function __(){this.constructor=e}for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r]);e.prototype=null===t?Object.create(t):(__.prototype=t.prototype,new __)},a=function(){function ComponentRef(){}return Object.defineProperty(ComponentRef.prototype,"location",{get:function(){return r.i(n.a)()},enumerable:!0,configurable:!0}),Object.defineProperty(ComponentRef.prototype,"injector",{get:function(){return r.i(n.a)()},enumerable:!0,configurable:!0}),Object.defineProperty(ComponentRef.prototype,"instance",{get:function(){return r.i(n.a)()},enumerable:!0,configurable:!0}),Object.defineProperty(ComponentRef.prototype,"hostView",{get:function(){return r.i(n.a)()},enumerable:!0,configurable:!0}),Object.defineProperty(ComponentRef.prototype,"changeDetectorRef",{get:function(){return r.i(n.a)()},enumerable:!0,configurable:!0}),Object.defineProperty(ComponentRef.prototype,"componentType",{get:function(){return r.i(n.a)()},enumerable:!0,configurable:!0}),ComponentRef}(),s=function(e){function ComponentRef_(t,r){e.call(this),this._hostElement=t,this._componentType=r}return o(ComponentRef_,e),Object.defineProperty(ComponentRef_.prototype,"location",{get:function(){return this._hostElement.elementRef},enumerable:!0,configurable:!0}),Object.defineProperty(ComponentRef_.prototype,"injector",{get:function(){return this._hostElement.injector},enumerable:!0,configurable:!0}),Object.defineProperty(ComponentRef_.prototype,"instance",{get:function(){return this._hostElement.component},enumerable:!0,configurable:!0}),Object.defineProperty(ComponentRef_.prototype,"hostView",{get:function(){return this._hostElement.parentView.ref},enumerable:!0,configurable:!0}),Object.defineProperty(ComponentRef_.prototype,"changeDetectorRef",{get:function(){return this._hostElement.parentView.ref},enumerable:!0,configurable:!0}),Object.defineProperty(ComponentRef_.prototype,"componentType",{get:function(){return this._componentType},enumerable:!0,configurable:!0}),ComponentRef_.prototype.destroy=function(){this._hostElement.parentView.destroy()},ComponentRef_.prototype.onDestroy=function(e){this.hostView.onDestroy(e)},ComponentRef_}(a),u=new Object,c=function(){function ComponentFactory(e,t,r){this.selector=e,this._viewFactory=t,this._componentType=r}return Object.defineProperty(ComponentFactory.prototype,"componentType",{get:function(){return this._componentType},enumerable:!0,configurable:!0}),ComponentFactory.prototype.create=function(e,t,r){void 0===t&&(t=null),void 0===r&&(r=null);var n=e.get(i.ViewUtils);t||(t=[]);var o=this._viewFactory(n,e,null),a=o.create(u,t,r);return new s(a,this._componentType)},ComponentFactory}()},function(e,t,r){"use strict";var n=r(3),i=r(131);r.d(t,"b",function(){return o}),r.d(t,"a",function(){return a});var o=function(){function StaticNodeDebugInfo(e,t,r){this.providerTokens=e,this.componentToken=t,this.refTokens=r}return StaticNodeDebugInfo}(),a=function(){function DebugContext(e,t,r,n){this._view=e,this._nodeIndex=t,this._tplRow=r,this._tplCol=n}return Object.defineProperty(DebugContext.prototype,"_staticNodeInfo",{get:function(){return r.i(n.d)(this._nodeIndex)?this._view.staticNodeDebugInfos[this._nodeIndex]:null},enumerable:!0,configurable:!0}),Object.defineProperty(DebugContext.prototype,"context",{get:function(){return this._view.context},enumerable:!0,configurable:!0}),Object.defineProperty(DebugContext.prototype,"component",{get:function(){var e=this._staticNodeInfo;return r.i(n.d)(e)&&r.i(n.d)(e.componentToken)?this.injector.get(e.componentToken):null},enumerable:!0,configurable:!0}),Object.defineProperty(DebugContext.prototype,"componentRenderElement",{get:function(){for(var e=this._view;r.i(n.d)(e.declarationAppElement)&&e.type!==i.a.COMPONENT;)e=e.declarationAppElement.parentView;return r.i(n.d)(e.declarationAppElement)?e.declarationAppElement.nativeElement:null},enumerable:!0,configurable:!0}),Object.defineProperty(DebugContext.prototype,"injector",{get:function(){return this._view.injector(this._nodeIndex)},enumerable:!0,configurable:!0}),Object.defineProperty(DebugContext.prototype,"renderNode",{get:function(){return r.i(n.d)(this._nodeIndex)&&this._view.allNodes?this._view.allNodes[this._nodeIndex]:null},enumerable:!0,configurable:!0}),Object.defineProperty(DebugContext.prototype,"providerTokens",{get:function(){var e=this._staticNodeInfo;return r.i(n.d)(e)?e.providerTokens:null},enumerable:!0,configurable:!0}),Object.defineProperty(DebugContext.prototype,"source",{get:function(){return this._view.componentType.templateUrl+":"+this._tplRow+":"+this._tplCol},enumerable:!0,configurable:!0}),Object.defineProperty(DebugContext.prototype,"references",{get:function(){var e=this,t={},i=this._staticNodeInfo;if(r.i(n.d)(i)){var o=i.refTokens;Object.keys(o).forEach(function(i){var a,s=o[i];a=r.i(n.c)(s)?e._view.allNodes?e._view.allNodes[e._nodeIndex]:null:e._view.injectorGet(s,e._nodeIndex,null),t[i]=a})}return t},enumerable:!0,configurable:!0}),DebugContext}()},function(e,t,r){"use strict";r.d(t,"a",function(){return n});var n=function(){function ElementRef(e){this.nativeElement=e}return ElementRef}()},function(e,t,r){"use strict";var n=r(126),i=r(29);r.d(t,"a",function(){return a}),r.d(t,"c",function(){return s}),r.d(t,"b",function(){return u});var o=this&&this.__extends||function(e,t){function __(){this.constructor=e}for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r]);e.prototype=null===t?Object.create(t):(__.prototype=t.prototype,new __)},a=function(e){function ExpressionChangedAfterItHasBeenCheckedError(t,r){var i="Expression has changed after it was checked. Previous value: '"+t+"'. Current value: '"+r+"'.";t===n.a&&(i+=" It seems like the view has been created after its parent and its children have been dirty checked. Has it been created in a change detection hook ?"),e.call(this,i)}return o(ExpressionChangedAfterItHasBeenCheckedError,e),ExpressionChangedAfterItHasBeenCheckedError}(i.b),s=function(e){function ViewWrappedError(t,r){e.call(this,"Error in "+r.source,t),this.context=r}return o(ViewWrappedError,e),ViewWrappedError}(i.c),u=function(e){function ViewDestroyedError(t){e.call(this,"Attempt to use a destroyed view: "+t)}return o(ViewDestroyedError,e),ViewDestroyedError}(i.b)},function(e,t,r){"use strict";var n=r(128),i=r(29),o=r(3),a=r(130);r.d(t,"c",function(){return u}),r.d(t,"b",function(){return c}),r.d(t,"a",function(){return p});var s=this&&this.__extends||function(e,t){function __(){this.constructor=e}for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r]);e.prototype=null===t?Object.create(t):(__.prototype=t.prototype,new __)},u=function(){function NgModuleRef(){}return Object.defineProperty(NgModuleRef.prototype,"injector",{get:function(){return r.i(i.a)()},enumerable:!0,configurable:!0}),Object.defineProperty(NgModuleRef.prototype,"componentFactoryResolver",{get:function(){return r.i(i.a)()},enumerable:!0,configurable:!0}),Object.defineProperty(NgModuleRef.prototype,"instance",{get:function(){return r.i(i.a)()},enumerable:!0,configurable:!0}),NgModuleRef}(),c=function(){function NgModuleFactory(e,t){this._injectorClass=e,this._moduleType=t}return Object.defineProperty(NgModuleFactory.prototype,"moduleType",{get:function(){return this._moduleType},enumerable:!0,configurable:!0}),NgModuleFactory.prototype.create=function(e){e||(e=n.b.NULL);var t=new this._injectorClass(e);return t.create(),t},NgModuleFactory}(),l=new Object,p=function(e){function NgModuleInjector(t,r,n){e.call(this,r,t.get(a.a,a.a.NULL)),this.parent=t,this.bootstrapFactories=n,this._destroyListeners=[],this._destroyed=!1}return s(NgModuleInjector,e),NgModuleInjector.prototype.create=function(){this.instance=this.createInternal()},NgModuleInjector.prototype.get=function(e,t){if(void 0===t&&(t=n.a),e===n.b||e===a.a)return this;var r=this.getInternal(e,l);return r===l?this.parent.get(e,t):r},Object.defineProperty(NgModuleInjector.prototype,"injector",{get:function(){return this},enumerable:!0,configurable:!0}),Object.defineProperty(NgModuleInjector.prototype,"componentFactoryResolver",{get:function(){return this},enumerable:!0,configurable:!0}),NgModuleInjector.prototype.destroy=function(){if(this._destroyed)throw new Error("The ng module "+r.i(o.b)(this.instance.constructor)+" has already been destroyed.");this._destroyed=!0,this.destroyInternal(),this._destroyListeners.forEach(function(e){return e()})},NgModuleInjector.prototype.onDestroy=function(e){this._destroyListeners.push(e)},NgModuleInjector}(a.b)},function(e,t,r){"use strict";function registerModuleFactory(e,t){var r=i.get(e);if(r)throw new Error("Duplicate module registered for "+e+" - "+r.moduleType.name+" vs "+t.moduleType.name);i.set(e,t)}function getModuleFactory(e){var t=i.get(e);if(!t)throw new Error("No module with ID "+e+" loaded");return t}r.d(t,"b",function(){return n}),t.a=registerModuleFactory,t.c=getModuleFactory;var n=function(){function NgModuleFactoryLoader(){}return NgModuleFactoryLoader}(),i=new Map},function(e,t,r){"use strict";r.d(t,"b",function(){return i}),r.d(t,"a",function(){return o});var n=this&&this.__extends||function(e,t){function __(){this.constructor=e}for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r]);e.prototype=null===t?Object.create(t):(__.prototype=t.prototype,new __)},i=function(){function TemplateRef(){}return Object.defineProperty(TemplateRef.prototype,"elementRef",{get:function(){return null},enumerable:!0,configurable:!0}),TemplateRef}(),o=function(e){function TemplateRef_(t,r){e.call(this),this._appElement=t,this._viewFactory=r}return n(TemplateRef_,e),TemplateRef_.prototype.createEmbeddedView=function(e){var t=this._viewFactory(this._appElement.parentView.viewUtils,this._appElement.parentInjector,this._appElement);return t.create(e||{},null,null),t.ref},Object.defineProperty(TemplateRef_.prototype,"elementRef",{get:function(){return this._appElement.elementRef},enumerable:!0,configurable:!0}),TemplateRef_}(i)},function(e,t,r){"use strict";var n=r(19),i=r(29),o=r(3),a=r(133);r.d(t,"b",function(){return s}),r.d(t,"a",function(){return u});var s=function(){function ViewContainerRef(){}return Object.defineProperty(ViewContainerRef.prototype,"element",{get:function(){return r.i(i.a)()},enumerable:!0,configurable:!0}),Object.defineProperty(ViewContainerRef.prototype,"injector",{get:function(){return r.i(i.a)()},enumerable:!0,configurable:!0}),Object.defineProperty(ViewContainerRef.prototype,"parentInjector",{get:function(){return r.i(i.a)()},enumerable:!0,configurable:!0}),Object.defineProperty(ViewContainerRef.prototype,"length",{get:function(){return r.i(i.a)()},enumerable:!0,configurable:!0}),ViewContainerRef}(),u=function(){function ViewContainerRef_(e){this._element=e,this._createComponentInContainerScope=r.i(a.a)("ViewContainerRef#createComponent()"),this._insertScope=r.i(a.a)("ViewContainerRef#insert()"),this._removeScope=r.i(a.a)("ViewContainerRef#remove()"),this._detachScope=r.i(a.a)("ViewContainerRef#detach()")}return ViewContainerRef_.prototype.get=function(e){return this._element.nestedViews[e].ref},Object.defineProperty(ViewContainerRef_.prototype,"length",{get:function(){var e=this._element.nestedViews;return r.i(o.d)(e)?e.length:0},enumerable:!0,configurable:!0}),Object.defineProperty(ViewContainerRef_.prototype,"element",{get:function(){return this._element.elementRef},enumerable:!0,configurable:!0}),Object.defineProperty(ViewContainerRef_.prototype,"injector",{get:function(){return this._element.injector},enumerable:!0,configurable:!0}),Object.defineProperty(ViewContainerRef_.prototype,"parentInjector",{get:function(){return this._element.parentInjector},enumerable:!0,configurable:!0}),ViewContainerRef_.prototype.createEmbeddedView=function(e,t,r){void 0===t&&(t=null),void 0===r&&(r=-1);var n=e.createEmbeddedView(t);return this.insert(n,r),n},ViewContainerRef_.prototype.createComponent=function(e,t,n,i){void 0===t&&(t=-1),void 0===n&&(n=null),void 0===i&&(i=null);var o=this._createComponentInContainerScope(),s=n||this._element.parentInjector,u=e.create(s,i);return this.insert(u.hostView,t),r.i(a.b)(o,u)},ViewContainerRef_.prototype.insert=function(e,t){void 0===t&&(t=-1);var n=this._insertScope();t==-1&&(t=this.length);var i=e;return this._element.attachView(i.internalView,t),r.i(a.b)(n,i)},ViewContainerRef_.prototype.move=function(e,t){var n=this._insertScope();if(t!=-1){var i=e;return this._element.moveView(i.internalView,t),r.i(a.b)(n,i)}},ViewContainerRef_.prototype.indexOf=function(e){return n.a.indexOf(this._element.nestedViews,e.internalView)},ViewContainerRef_.prototype.remove=function(e){void 0===e&&(e=-1);var t=this._removeScope();e==-1&&(e=this.length-1);var n=this._element.detachView(e);n.destroy(),r.i(a.b)(t)},ViewContainerRef_.prototype.detach=function(e){void 0===e&&(e=-1);var t=this._detachScope();e==-1&&(e=this.length-1);var n=this._element.detachView(e);return r.i(a.b)(t,n.ref)},ViewContainerRef_.prototype.clear=function(){for(var e=this.length-1;e>=0;e--)this.remove(e)},ViewContainerRef_}()},function(e,t,r){"use strict";var n=r(286),i=r(127),o=r(29);r.d(t,"c",function(){return s}),r.d(t,"b",function(){return u}),r.d(t,"a",function(){return c});var a=this&&this.__extends||function(e,t){function __(){this.constructor=e}for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r]);e.prototype=null===t?Object.create(t):(__.prototype=t.prototype,new __)},s=function(){function ViewRef(){}return Object.defineProperty(ViewRef.prototype,"destroyed",{get:function(){return r.i(o.a)()},enumerable:!0,configurable:!0}),ViewRef}(),u=function(e){function EmbeddedViewRef(){e.apply(this,arguments)}return a(EmbeddedViewRef,e),Object.defineProperty(EmbeddedViewRef.prototype,"context",{get:function(){return r.i(o.a)()},enumerable:!0,configurable:!0}),Object.defineProperty(EmbeddedViewRef.prototype,"rootNodes",{get:function(){return r.i(o.a)()},enumerable:!0,configurable:!0}),EmbeddedViewRef}(s),c=function(){function ViewRef_(e){this._view=e,this._view=e,this._originalMode=this._view.cdMode}return Object.defineProperty(ViewRef_.prototype,"internalView",{get:function(){return this._view},enumerable:!0,configurable:!0}),Object.defineProperty(ViewRef_.prototype,"rootNodes",{get:function(){return this._view.flatRootNodes},enumerable:!0,configurable:!0}),Object.defineProperty(ViewRef_.prototype,"context",{get:function(){return this._view.context},enumerable:!0,configurable:!0}),Object.defineProperty(ViewRef_.prototype,"destroyed",{get:function(){return this._view.destroyed},enumerable:!0,configurable:!0}),ViewRef_.prototype.markForCheck=function(){this._view.markPathToRootAsCheckOnce()},ViewRef_.prototype.detach=function(){this._view.cdMode=i.b.Detached},ViewRef_.prototype.detectChanges=function(){this._view.detectChanges(!1),r.i(n.a)()},ViewRef_.prototype.checkNoChanges=function(){this._view.detectChanges(!0)},ViewRef_.prototype.reattach=function(){this._view.cdMode=this._originalMode,this.markForCheck()},ViewRef_.prototype.onDestroy=function(e){this._view.disposables.push(e)},ViewRef_.prototype.destroy=function(){this._view.destroy()},ViewRef_}()},function(e,t,r){"use strict";var n=r(475),i=r(476),o=r(306),a=r(477),s=r(307);r.d(t,"d",function(){return n.a}),r.d(t,"o",function(){return n.d}),r.d(t,"p",function(){return n.e}),r.d(t,"k",function(){return n.c}),r.d(t,"q",function(){return n.f}),r.d(t,"r",function(){return n.g}),r.d(t,"g",function(){return n.b}),r.d(t,"l",function(){return i.g}),r.d(t,"b",function(){return i.a}),r.d(t,"i",function(){return i.e}),r.d(t,"j",function(){return i.f}),r.d(t,"c",function(){return i.b}),r.d(t,"h",function(){return i.d}),r.d(t,"e",function(){return i.c}),r.d(t,"s",function(){return o.c}),r.d(t,"t",function(){return o.d}),r.d(t,"u",function(){return o.e}),r.d(t,"v",function(){return o.f}),r.d(t,"w",function(){return o.g}),r.d(t,"x",function(){return o.h}),r.d(t,"y",function(){return o.i}),r.d(t,"z",function(){return o.j}),r.d(t,"n",function(){return a.c}),r.d(t,"m",function(){return a.b}),r.d(t,"a",function(){return a.a}),r.d(t,"f",function(){return s.b})},function(e,t,r){"use strict";r.d(t,"a",function(){return n}),r.d(t,"b",function(){return i}),r.d(t,"h",function(){return o}),r.d(t,"j",function(){return a}),r.d(t,"g",function(){return s}),r.d(t,"c",function(){return u}),r.d(t,"d",function(){return c}),r.d(t,"i",function(){return l}),r.d(t,"f",function(){return p}),r.d(t,"e",function(){return f});var n;!function(e){e[e.OnInit=0]="OnInit",e[e.OnDestroy=1]="OnDestroy",e[e.DoCheck=2]="DoCheck",e[e.OnChanges=3]="OnChanges",e[e.AfterContentInit=4]="AfterContentInit",e[e.AfterContentChecked=5]="AfterContentChecked",e[e.AfterViewInit=6]="AfterViewInit",e[e.AfterViewChecked=7]="AfterViewChecked"}(n||(n={}));var i=[n.OnInit,n.OnDestroy,n.DoCheck,n.OnChanges,n.AfterContentInit,n.AfterContentChecked,n.AfterViewInit,n.AfterViewChecked],o=function(){function OnChanges(){}return OnChanges}(),a=function(){function OnInit(){}return OnInit}(),s=function(){function DoCheck(){}return DoCheck}(),u=function(){function OnDestroy(){}return OnDestroy}(),c=function(){function AfterContentInit(){}return AfterContentInit}(),l=function(){function AfterContentChecked(){}return AfterContentChecked}(),p=function(){function AfterViewInit(){}return AfterViewInit}(),f=function(){function AfterViewChecked(){}return AfterViewChecked}()},function(e,t,r){"use strict";r.d(t,"b",function(){return n}),r.d(t,"a",function(){return i});var n;!function(e){e[e.Emulated=0]="Emulated",e[e.Native=1]="Native",e[e.None=2]="None"}(n||(n={}));var i=function(){function ViewMetadata(e){var t=void 0===e?{}:e,r=t.templateUrl,n=t.template,i=t.encapsulation,o=t.styles,a=t.styleUrls,s=t.animations,u=t.interpolation;this.templateUrl=r,this.template=n,this.styleUrls=a,this.styles=o,this.encapsulation=i,this.animations=s,this.interpolation=u}return ViewMetadata}()},function(e,t,r){"use strict";function convertTsickleDecoratorIntoMetadata(e){return e?e.map(function(e){var t=e.type,r=t.annotationCls,n=e.args?e.args:[];return new(r.bind.apply(r,[void 0].concat(n)))}):[]}var n=r(3),i=r(193);r.d(t,"a",function(){return o});var o=function(){function ReflectionCapabilities(e){this._reflect=e||n.a.Reflect}return ReflectionCapabilities.prototype.isReflectionEnabled=function(){return!0},ReflectionCapabilities.prototype.factory=function(e){return function(){for(var t=[],r=0;r<arguments.length;r++)t[r-0]=arguments[r];return new(e.bind.apply(e,[void 0].concat(t)))}},ReflectionCapabilities.prototype._zipTypesAndAnnotations=function(e,t){var i;i="undefined"==typeof e?new Array(t.length):new Array(e.length);for(var o=0;o<i.length;o++)"undefined"==typeof e?i[o]=[]:e[o]!=Object?i[o]=[e[o]]:i[o]=[],t&&r.i(n.d)(t[o])&&(i[o]=i[o].concat(t[o]));return i},ReflectionCapabilities.prototype.parameters=function(e){if(e.parameters)return e.parameters;if(e.ctorParameters){var t=e.ctorParameters,i=t.map(function(e){return e&&e.type}),o=t.map(function(e){return e&&convertTsickleDecoratorIntoMetadata(e.decorators)});return this._zipTypesAndAnnotations(i,o)}if(r.i(n.d)(this._reflect)&&r.i(n.d)(this._reflect.getMetadata)){var o=this._reflect.getMetadata("parameters",e),i=this._reflect.getMetadata("design:paramtypes",e);if(i||o)return this._zipTypesAndAnnotations(i,o)}return new Array(e.length).fill(void 0)},ReflectionCapabilities.prototype.annotations=function(e){if(e.annotations){var t=e.annotations;return"function"==typeof t&&t.annotations&&(t=t.annotations),t}if(e.decorators)return convertTsickleDecoratorIntoMetadata(e.decorators);if(this._reflect&&this._reflect.getMetadata){var t=this._reflect.getMetadata("annotations",e);if(t)return t}return[]},ReflectionCapabilities.prototype.propMetadata=function(e){if(e.propMetadata){var t=e.propMetadata;return"function"==typeof t&&t.propMetadata&&(t=t.propMetadata),t}if(e.propDecorators){var r=e.propDecorators,n={};return Object.keys(r).forEach(function(e){n[e]=convertTsickleDecoratorIntoMetadata(r[e])}),n}if(this._reflect&&this._reflect.getMetadata){var t=this._reflect.getMetadata("propMetadata",e);if(t)return t}return{}},ReflectionCapabilities.prototype.hasLifecycleHook=function(e,t){return e instanceof i.a&&t in e.prototype},ReflectionCapabilities.prototype.getter=function(e){return new Function("o","return o."+e+";")},ReflectionCapabilities.prototype.setter=function(e){return new Function("o","v","return o."+e+" = v;")},ReflectionCapabilities.prototype.method=function(e){var t="if (!o."+e+") throw new Error('\""+e+"\" is undefined');\n return o."+e+".apply(o, args);";return new Function("o","args",t)},ReflectionCapabilities.prototype.importUri=function(e){return"object"==typeof e&&e.filePath?e.filePath:"./"+r.i(n.b)(e)},ReflectionCapabilities.prototype.resolveIdentifier=function(e,t,r){return r},ReflectionCapabilities.prototype.resolveEnum=function(e,t){return e[t]},ReflectionCapabilities}()},function(e,t,r){"use strict";var n=r(190);r.d(t,"a",function(){return o});var i=this&&this.__extends||function(e,t){function __(){this.constructor=e}for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r]);e.prototype=null===t?Object.create(t):(__.prototype=t.prototype,new __)},o=function(e){function Reflector(t){e.call(this),this.reflectionCapabilities=t}return i(Reflector,e),Reflector.prototype.updateCapabilities=function(e){this.reflectionCapabilities=e},Reflector.prototype.factory=function(e){return this.reflectionCapabilities.factory(e)},Reflector.prototype.parameters=function(e){return this.reflectionCapabilities.parameters(e)},Reflector.prototype.annotations=function(e){return this.reflectionCapabilities.annotations(e)},Reflector.prototype.propMetadata=function(e){return this.reflectionCapabilities.propMetadata(e)},Reflector.prototype.hasLifecycleHook=function(e,t){return this.reflectionCapabilities.hasLifecycleHook(e,t)},Reflector.prototype.getter=function(e){return this.reflectionCapabilities.getter(e)},Reflector.prototype.setter=function(e){return this.reflectionCapabilities.setter(e)},Reflector.prototype.method=function(e){return this.reflectionCapabilities.method(e)},Reflector.prototype.importUri=function(e){return this.reflectionCapabilities.importUri(e)},Reflector.prototype.resolveIdentifier=function(e,t,r){return this.reflectionCapabilities.resolveIdentifier(e,t,r)},Reflector.prototype.resolveEnum=function(e,t){return this.reflectionCapabilities.resolveEnum(e,t)},Reflector}(n.a)},function(e,t,r){"use strict";r.d(t,"b",function(){return n}),r.d(t,"a",function(){return i});var n;!function(e){e[e.NONE=0]="NONE",e[e.HTML=1]="HTML",e[e.STYLE=2]="STYLE",e[e.SCRIPT=3]="SCRIPT",e[e.URL=4]="URL",e[e.RESOURCE_URL=5]="RESOURCE_URL"}(n||(n={}));var i=function(){function Sanitizer(){}return Sanitizer}()},function(e,t,r){"use strict";r.d(t,"a",function(){return n});var n={formControlName:'\n <div [formGroup]="myGroup">\n <input formControlName="firstName">\n </div>\n\n In your class:\n\n this.myGroup = new FormGroup({\n firstName: new FormControl()\n });',formGroupName:'\n <div [formGroup]="myGroup">\n <div formGroupName="person">\n <input formControlName="firstName">\n </div>\n </div>\n\n In your class:\n\n this.myGroup = new FormGroup({\n person: new FormGroup({ firstName: new FormControl() })\n });',formArrayName:'\n <div [formGroup]="myGroup">\n <div formArrayName="cities">\n <div *ngFor="let city of cityArray.controls; let i=index">\n <input [formControlName]="i">\n </div>\n </div>\n </div>\n\n In your class:\n\n this.cityArray = new FormArray([new FormControl(\'SF\')]);\n this.myGroup = new FormGroup({\n cities: this.cityArray\n });',ngModelGroup:'\n <form>\n <div ngModelGroup="person">\n <input [(ngModel)]="person.name" name="firstName">\n </div>\n </form>',ngModelWithFormGroup:'\n <div [formGroup]="myGroup">\n <input formControlName="firstName">\n <input [(ngModel)]="showMoreControls" [ngModelOptions]="{standalone: true}">\n </div>\n '}},function(e,t,r){"use strict";var n=r(311);r.d(t,"a",function(){return i});var i=function(){function TemplateDrivenErrors(){}return TemplateDrivenErrors.modelParentException=function(){throw new Error('\n ngModel cannot be used to register form controls with a parent formGroup directive. Try using\n formGroup\'s partner directive "formControlName" instead. Example:\n\n '+n.a.formControlName+"\n\n Or, if you'd like to avoid registering this form control, indicate that it's standalone in ngModelOptions:\n\n Example:\n\n "+n.a.ngModelWithFormGroup)},TemplateDrivenErrors.formGroupNameException=function(){throw new Error("\n ngModel cannot be used to register form controls with a parent formGroupName or formArrayName directive.\n\n Option 1: Use formControlName instead of ngModel (reactive strategy):\n\n "+n.a.formGroupName+"\n\n Option 2: Update ngModel's parent be ngModelGroup (template-driven strategy):\n\n "+n.a.ngModelGroup)},TemplateDrivenErrors.missingNameException=function(){throw new Error('If ngModel is used within a form tag, either the name attribute must be set or the form\n control must be defined as \'standalone\' in ngModelOptions.\n\n Example 1: <input [(ngModel)]="person.firstName" name="first">\n Example 2: <input [(ngModel)]="person.firstName" [ngModelOptions]="{standalone: true}">'); },TemplateDrivenErrors.modelGroupParentException=function(){throw new Error("\n ngModelGroup cannot be used with a parent formGroup directive.\n\n Option 1: Use formGroupName instead of ngModelGroup (reactive strategy):\n\n "+n.a.formGroupName+"\n\n Option 2: Use a regular form tag instead of the formGroup directive (template-driven strategy):\n\n "+n.a.ngModelGroup)},TemplateDrivenErrors}()},function(e,t,r){"use strict";var n=r(0),i=r(24),o=r(140);r.d(t,"a",function(){return a});var a=function(){function FormBuilder(){}return FormBuilder.prototype.group=function(e,t){void 0===t&&(t=null);var n=this._reduceControls(e),a=r.i(i.a)(t)?t.validator:null,s=r.i(i.a)(t)?t.asyncValidator:null;return new o.a(n,a,s)},FormBuilder.prototype.control=function(e,t,r){return void 0===t&&(t=null),void 0===r&&(r=null),new o.b(e,t,r)},FormBuilder.prototype.array=function(e,t,r){var n=this;void 0===t&&(t=null),void 0===r&&(r=null);var i=e.map(function(e){return n._createControl(e)});return new o.c(i,t,r)},FormBuilder.prototype._reduceControls=function(e){var t=this,r={};return Object.keys(e).forEach(function(n){r[n]=t._createControl(e[n])}),r},FormBuilder.prototype._createControl=function(e){if(e instanceof o.b||e instanceof o.a||e instanceof o.c)return e;if(Array.isArray(e)){var t=e[0],r=e.length>1?e[1]:null,n=e.length>2?e[2]:null;return this.control(t,r,n)}return this.control(e)},FormBuilder.decorators=[{type:n.Injectable}],FormBuilder.ctorParameters=[],FormBuilder}()},function(e,t,r){"use strict";var n=r(0);r.d(t,"a",function(){return i});var i=n.__core_private__.isPromise},function(e,t,r){"use strict";function _getJsonpConnections(){return null===s&&(s=i.e[a]={}),s}var n=r(0),i=r(44);r.d(t,"a",function(){return u});var o=0,a="__ng_jsonp__",s=null,u=function(){function BrowserJsonp(){}return BrowserJsonp.prototype.build=function(e){var t=document.createElement("script");return t.src=e,t},BrowserJsonp.prototype.nextRequestID=function(){return"__req"+o++},BrowserJsonp.prototype.requestCallback=function(e){return a+"."+e+".finished"},BrowserJsonp.prototype.exposeConnection=function(e,t){var r=_getJsonpConnections();r[e]=t},BrowserJsonp.prototype.removeConnection=function(e){var t=_getJsonpConnections();t[e]=null},BrowserJsonp.prototype.send=function(e){document.body.appendChild(e)},BrowserJsonp.prototype.cleanup=function(e){e.parentNode&&e.parentNode.removeChild(e)},BrowserJsonp.decorators=[{type:n.Injectable}],BrowserJsonp.ctorParameters=[],BrowserJsonp}()},function(e,t,r){"use strict";var n=r(0),i=r(6),o=(r.n(i),r(141)),a=r(55),s=r(44),u=r(100),c=r(205),l=r(315);r.d(t,"c",function(){return d}),r.d(t,"a",function(){return v}),r.d(t,"b",function(){return y});var p=this&&this.__extends||function(e,t){function __(){this.constructor=e}for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r]);e.prototype=null===t?Object.create(t):(__.prototype=t.prototype,new __)},f="JSONP injected script did not invoke callback.",h="JSONP requests must use GET request method.",d=function(){function JSONPConnection(){}return JSONPConnection}(),m=function(e){function JSONPConnection_(t,n,u){var l=this;if(e.call(this),this._dom=n,this.baseResponseOptions=u,this._finished=!1,t.method!==a.b.Get)throw new TypeError(h);this.request=t,this.response=new i.Observable(function(e){l.readyState=a.c.Loading;var i=l._id=n.nextRequestID();n.exposeConnection(i,l);var p=n.requestCallback(l._id),h=t.url;h.indexOf("=JSONP_CALLBACK&")>-1?h=h.replace("=JSONP_CALLBACK&","="+p+"&"):h.lastIndexOf("=JSONP_CALLBACK")===h.length-"=JSONP_CALLBACK".length&&(h=h.substring(0,h.length-"=JSONP_CALLBACK".length)+("="+p));var d=l._script=n.build(h),m=function(t){if(l.readyState!==a.c.Cancelled){if(l.readyState=a.c.Done,n.cleanup(d),!l._finished){var i=new o.a({body:f,type:a.a.Error,url:h});return r.i(s.a)(u)&&(i=u.merge(i)),void e.error(new c.a(i))}var p=new o.a({body:l._responseData,url:h});r.i(s.a)(l.baseResponseOptions)&&(p=l.baseResponseOptions.merge(p)),e.next(new c.a(p)),e.complete()}},v=function(t){if(l.readyState!==a.c.Cancelled){l.readyState=a.c.Done,n.cleanup(d);var i=new o.a({body:t.message,type:a.a.Error});r.i(s.a)(u)&&(i=u.merge(i)),e.error(new c.a(i))}};return d.addEventListener("load",m),d.addEventListener("error",v),n.send(d),function(){l.readyState=a.c.Cancelled,d.removeEventListener("load",m),d.removeEventListener("error",v),r.i(s.a)(d)&&l._dom.cleanup(d)}})}return p(JSONPConnection_,e),JSONPConnection_.prototype.finished=function(e){this._finished=!0,this._dom.removeConnection(this._id),this.readyState!==a.c.Cancelled&&(this._responseData=e)},JSONPConnection_}(d),v=function(e){function JSONPBackend(){e.apply(this,arguments)}return p(JSONPBackend,e),JSONPBackend}(u.a),y=function(e){function JSONPBackend_(t,r){e.call(this),this._browserJSONP=t,this._baseResponseOptions=r}return p(JSONPBackend_,e),JSONPBackend_.prototype.createConnection=function(e){return new m(e,this._browserJSONP,this._baseResponseOptions)},JSONPBackend_.decorators=[{type:n.Injectable}],JSONPBackend_.ctorParameters=[{type:l.a},{type:o.a}],JSONPBackend_}(v)},function(e,t,r){"use strict";var n=r(0),i=r(89),o=r(6),a=(r.n(o),r(141)),s=r(55),u=r(44),c=r(99),l=r(142),p=r(100),f=r(205),h=r(203);r.d(t,"c",function(){return m}),r.d(t,"a",function(){return v}),r.d(t,"b",function(){return y});var d=/^\)\]\}',?\n/,m=function(){function XHRConnection(e,t,n){var i=this;this.request=e,this.response=new o.Observable(function(o){var p=t.build();p.open(s.b[e.method].toUpperCase(),e.url),r.i(u.a)(e.withCredentials)&&(p.withCredentials=e.withCredentials);var h=function(){var e=void 0===p.response?p.responseText:p.response;"string"==typeof e&&(e=e.replace(d,""));var t=c.a.fromResponseHeaderString(p.getAllResponseHeaders()),i=r.i(l.c)(p),s=1223===p.status?204:p.status;0===s&&(s=e?200:0);var h=p.statusText||"OK",m=new a.a({body:e,status:s,headers:t,statusText:h,url:i});r.i(u.a)(n)&&(m=n.merge(m));var v=new f.a(m);return v.ok=r.i(l.d)(s),v.ok?(o.next(v),void o.complete()):void o.error(v)},m=function(e){var t=new a.a({body:e,type:s.a.Error,status:p.status,statusText:p.statusText});r.i(u.a)(n)&&(t=n.merge(t)),o.error(new f.a(t))};if(i.setDetectedContentType(e,p),r.i(u.a)(e.headers)&&e.headers.forEach(function(e,t){return p.setRequestHeader(t,e.join(","))}),r.i(u.a)(e.responseType)&&r.i(u.a)(p.responseType))switch(e.responseType){case s.d.ArrayBuffer:p.responseType="arraybuffer";break;case s.d.Json:p.responseType="json";break;case s.d.Text:p.responseType="text";break;case s.d.Blob:p.responseType="blob";break;default:throw new Error("The selected responseType is not supported")}return p.addEventListener("load",h),p.addEventListener("error",m),p.send(i.request.getBody()),function(){p.removeEventListener("load",h),p.removeEventListener("error",m),p.abort()}})}return XHRConnection.prototype.setDetectedContentType=function(e,t){if(!r.i(u.a)(e.headers)||!r.i(u.a)(e.headers.get("Content-Type")))switch(e.contentType){case s.e.NONE:break;case s.e.JSON:t.setRequestHeader("content-type","application/json");break;case s.e.FORM:t.setRequestHeader("content-type","application/x-www-form-urlencoded;charset=UTF-8");break;case s.e.TEXT:t.setRequestHeader("content-type","text/plain");break;case s.e.BLOB:var n=e.blob();n.type&&t.setRequestHeader("content-type",n.type)}},XHRConnection}(),v=function(){function CookieXSRFStrategy(e,t){void 0===e&&(e="XSRF-TOKEN"),void 0===t&&(t="X-XSRF-TOKEN"),this._cookieName=e,this._headerName=t}return CookieXSRFStrategy.prototype.configureRequest=function(e){var t=i.__platform_browser_private__.getDOM().getCookie(this._cookieName);t&&!e.headers.has(this._headerName)&&e.headers.set(this._headerName,t)},CookieXSRFStrategy}(),y=function(){function XHRBackend(e,t,r){this._browserXHR=e,this._baseResponseOptions=t,this._xsrfStrategy=r}return XHRBackend.prototype.createConnection=function(e){return this._xsrfStrategy.configureRequest(e),new m(e,this._browserXHR,this._baseResponseOptions)},XHRBackend.decorators=[{type:n.Injectable}],XHRBackend.ctorParameters=[{type:h.a},{type:a.a},{type:p.b}],XHRBackend}()},function(e,t,r){"use strict";var n=r(142),i=r(143);r.d(t,"a",function(){return o});var o=function(){function Body(){}return Body.prototype.json=function(){return"string"==typeof this._body?JSON.parse(this._body):this._body instanceof ArrayBuffer?JSON.parse(this.text()):this._body},Body.prototype.text=function(){return this._body instanceof i.a?this._body.toString():this._body instanceof ArrayBuffer?String.fromCharCode.apply(null,new Uint16Array(this._body)):null===this._body?"":r.i(n.a)(this._body)?JSON.stringify(this._body,null,2):this._body.toString()},Body.prototype.arrayBuffer=function(){return this._body instanceof ArrayBuffer?this._body:r.i(n.b)(this.text())},Body.prototype.blob=function(){if(this._body instanceof Blob)return this._body;if(this._body instanceof ArrayBuffer)return new Blob([this._body]);throw new Error("The request body isn't either a blob or an array buffer")},Body}()},function(e,t,r){"use strict";function httpRequest(e,t){return e.createConnection(t).response}function mergeOptions(e,t,n,a){var s=e;return r.i(i.a)(t)?s.merge(new o.a({method:t.method||n,url:t.url||a,search:t.search,headers:t.headers,body:t.body,withCredentials:t.withCredentials,responseType:t.responseType})):r.i(i.a)(n)?s.merge(new o.a({method:n,url:a})):s.merge(new o.a({url:a}))}var n=r(0),i=r(44),o=r(204),a=r(55),s=r(100),u=r(320);r.d(t,"a",function(){return l}),r.d(t,"b",function(){return p});var c=this&&this.__extends||function(e,t){function __(){this.constructor=e}for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r]);e.prototype=null===t?Object.create(t):(__.prototype=t.prototype,new __)},l=function(){function Http(e,t){this._backend=e,this._defaultOptions=t}return Http.prototype.request=function(e,t){var r;if("string"==typeof e)r=httpRequest(this._backend,new u.a(mergeOptions(this._defaultOptions,t,a.b.Get,e)));else{if(!(e instanceof u.a))throw new Error("First argument must be a url string or Request instance.");r=httpRequest(this._backend,e)}return r},Http.prototype.get=function(e,t){return this.request(new u.a(mergeOptions(this._defaultOptions,t,a.b.Get,e)))},Http.prototype.post=function(e,t,r){return this.request(new u.a(mergeOptions(this._defaultOptions.merge(new o.a({body:t})),r,a.b.Post,e)))},Http.prototype.put=function(e,t,r){return this.request(new u.a(mergeOptions(this._defaultOptions.merge(new o.a({body:t})),r,a.b.Put,e)))},Http.prototype.delete=function(e,t){return this.request(new u.a(mergeOptions(this._defaultOptions,t,a.b.Delete,e)))},Http.prototype.patch=function(e,t,r){return this.request(new u.a(mergeOptions(this._defaultOptions.merge(new o.a({body:t})),r,a.b.Patch,e)))},Http.prototype.head=function(e,t){return this.request(new u.a(mergeOptions(this._defaultOptions,t,a.b.Head,e)))},Http.prototype.options=function(e,t){return this.request(new u.a(mergeOptions(this._defaultOptions,t,a.b.Options,e)))},Http.decorators=[{type:n.Injectable}],Http.ctorParameters=[{type:s.a},{type:o.a}],Http}(),p=function(e){function Jsonp(t,r){e.call(this,t,r)}return c(Jsonp,e),Jsonp.prototype.request=function(e,t){var r;if("string"==typeof e&&(e=new u.a(mergeOptions(this._defaultOptions,t,a.b.Get,e))),!(e instanceof u.a))throw new Error("First argument must be a url string or Request instance.");if(e.method!==a.b.Get)throw new Error("JSONP requests must use GET request method.");return r=httpRequest(this._backend,e)},Jsonp.decorators=[{type:n.Injectable}],Jsonp.ctorParameters=[{type:s.a},{type:o.a}],Jsonp}(l)},function(e,t,r){"use strict";var n=r(44),i=r(318),o=r(55),a=r(99),s=r(142),u=r(143);r.d(t,"a",function(){return l});var c=this&&this.__extends||function(e,t){function __(){this.constructor=e}for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r]);e.prototype=null===t?Object.create(t):(__.prototype=t.prototype,new __)},l=function(e){function Request(t){e.call(this);var i=t.url;if(this.url=t.url,r.i(n.a)(t.search)){var o=t.search.toString();if(o.length>0){var u="?";this.url.indexOf("?")!=-1&&(u="&"==this.url[this.url.length-1]?"":"&"),this.url=i+u+o}}this._body=t.body,this.method=r.i(s.e)(t.method),this.headers=new a.a(t.headers),this.contentType=this.detectContentType(),this.withCredentials=t.withCredentials,this.responseType=t.responseType}return c(Request,e),Request.prototype.detectContentType=function(){switch(this.headers.get("content-type")){case"application/json":return o.e.JSON;case"application/x-www-form-urlencoded":return o.e.FORM;case"multipart/form-data":return o.e.FORM_DATA;case"text/plain":case"text/html":return o.e.TEXT;case"application/octet-stream":return o.e.BLOB;default:return this.detectContentTypeFromBody()}},Request.prototype.detectContentTypeFromBody=function(){return null==this._body?o.e.NONE:this._body instanceof u.a?o.e.FORM:this._body instanceof h?o.e.FORM_DATA:this._body instanceof d?o.e.BLOB:this._body instanceof m?o.e.ARRAY_BUFFER:this._body&&"object"==typeof this._body?o.e.JSON:o.e.TEXT},Request.prototype.getBody=function(){switch(this.contentType){case o.e.JSON:return this.text();case o.e.FORM:return this.text();case o.e.FORM_DATA:return this._body;case o.e.TEXT:return this.text();case o.e.BLOB:return this.blob();case o.e.ARRAY_BUFFER:return this.arrayBuffer();default:return null}},Request}(i.a),p=function(){},f="object"==typeof window?window:p,h=f.FormData||p,d=f.Blob||p,m=f.ArrayBuffer||p},function(e,t,r){"use strict";var n=r(117),i=r(0),o=r(493),a=r(322);r.d(t,"a",function(){return s});var s=[o.a,{provide:i.COMPILER_OPTIONS,useValue:{providers:[{provide:n.a,useClass:a.a}]},multi:!0}]},function(e,t,r){"use strict";var n=r(117),i=r(0);r.d(t,"a",function(){return a});var o=this&&this.__extends||function(e,t){function __(){this.constructor=e}for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r]);e.prototype=null===t?Object.create(t):(__.prototype=t.prototype,new __)},a=function(e){function ResourceLoaderImpl(){e.apply(this,arguments)}return o(ResourceLoaderImpl,e),ResourceLoaderImpl.prototype.get=function(e){var t,r,n=new Promise(function(e,n){t=e,r=n}),i=new XMLHttpRequest;return i.open("GET",e,!0),i.responseType="text",i.onload=function(){var n=i.response||i.responseText,o=1223===i.status?204:i.status;0===o&&(o=n?200:0),200<=o&&o<=300?t(n):r("Failed to load "+e)},i.onerror=function(){r("Failed to load "+e)},i.send(),n},ResourceLoaderImpl.decorators=[{type:i.Injectable}],ResourceLoaderImpl.ctorParameters=[],ResourceLoaderImpl}(n.a)},function(e,t,r){"use strict";function initDomAdapter(){s.a.makeCurrent(),c.a.init()}function errorHandler(){return new i.ErrorHandler}function _document(){return r.i(f.a)().defaultDoc()}function _resolveDefaultAnimationDriver(){return r.i(f.a)().supportsWebAnimation()?new a.a:o.a.NOOP}var n=r(72),i=r(0),o=r(206),a=r(501),s=r(324),u=r(325),c=r(326),l=r(327),p=r(207),f=r(15),h=r(208),d=r(144),m=r(328),v=r(81),y=r(209),g=r(329),_=r(210),b=r(332);r.d(t,"b",function(){return w}),r.d(t,"c",function(){return C}),r.d(t,"e",function(){return E}),t.a=initDomAdapter,r.d(t,"d",function(){return S});var w=[{provide:i.PLATFORM_INITIALIZER,useValue:initDomAdapter,multi:!0},{provide:n.PlatformLocation,useClass:u.a}],C=[{provide:i.Sanitizer,useExisting:b.a},{provide:b.a,useClass:b.b}],E=r.i(i.createPlatformFactory)(i.platformCore,"browser",w),S=function(){function BrowserModule(e){if(e)throw new Error("BrowserModule has already been loaded. If you need access to common directives such as NgIf and NgFor from a lazy loaded module, import CommonModule instead.")}return BrowserModule.decorators=[{type:i.NgModule,args:[{providers:[C,{provide:i.ErrorHandler,useFactory:errorHandler,deps:[]},{provide:d.a,useFactory:_document,deps:[]},{provide:v.c,useClass:m.a,multi:!0},{provide:v.c,useClass:g.a,multi:!0},{provide:v.c,useClass:y.a,multi:!0},{provide:y.b,useClass:y.c},{provide:h.a,useClass:h.b},{provide:i.RootRenderer,useExisting:h.a},{provide:_.b,useExisting:_.a},{provide:o.a,useFactory:_resolveDefaultAnimationDriver},_.a,i.Testability,v.a,p.a,l.a],exports:[n.CommonModule,i.ApplicationModule]}]}],BrowserModule.ctorParameters=[{type:BrowserModule,decorators:[{type:i.Optional},{type:i.SkipSelf}]}],BrowserModule}()},function(e,t,r){"use strict";function getBaseElementHref(){return h||(h=document.querySelector("base"))?h.getAttribute("href"):null}function relativePath(e){return a||(a=document.createElement("a")),a.setAttribute("href",e),"/"===a.pathname.charAt(0)?a.pathname:"/"+a.pathname}function parseCookieValue(e,t){t=encodeURIComponent(t);for(var r=0,n=e.split(";");r<n.length;r++){var i=n[r],o=i.indexOf("="),a=o==-1?[i,""]:[i.slice(0,o),i.slice(o+1)],s=a[0],u=a[1];if(s.trim()===t)return decodeURIComponent(u)}return null}var n=r(15),i=r(30),o=r(495);r.d(t,"a",function(){return f});var a,s=this&&this.__extends||function(e,t){function __(){this.constructor=e}for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r]);e.prototype=null===t?Object.create(t):(__.prototype=t.prototype,new __)},u={class:"className",innerHtml:"innerHTML",readonly:"readOnly",tabindex:"tabIndex"},c=3,l={"\b":"Backspace","\t":"Tab","":"Delete","":"Escape",Del:"Delete",Esc:"Escape",Left:"ArrowLeft",Right:"ArrowRight",Up:"ArrowUp",Down:"ArrowDown",Menu:"ContextMenu",Scroll:"ScrollLock",Win:"OS"},p={A:"1",B:"2",C:"3",D:"4",E:"5",F:"6",G:"7",H:"8",I:"9",J:"*",K:"+",M:"-",N:".",O:"/","`":"0","":"NumLock"},f=function(e){function BrowserDomAdapter(){e.apply(this,arguments)}return s(BrowserDomAdapter,e),BrowserDomAdapter.prototype.parse=function(e){throw new Error("parse not implemented")},BrowserDomAdapter.makeCurrent=function(){r.i(n.c)(new BrowserDomAdapter)},BrowserDomAdapter.prototype.hasProperty=function(e,t){return t in e},BrowserDomAdapter.prototype.setProperty=function(e,t,r){e[t]=r},BrowserDomAdapter.prototype.getProperty=function(e,t){return e[t]},BrowserDomAdapter.prototype.invoke=function(e,t,r){(n=e)[t].apply(n,r);var n},BrowserDomAdapter.prototype.logError=function(e){(window.console.error||window.console.log)(e)},BrowserDomAdapter.prototype.log=function(e){window.console.log(e)},BrowserDomAdapter.prototype.logGroup=function(e){window.console.group&&window.console.group(e),this.logError(e)},BrowserDomAdapter.prototype.logGroupEnd=function(){window.console.groupEnd&&window.console.groupEnd()},Object.defineProperty(BrowserDomAdapter.prototype,"attrToPropMap",{get:function(){return u},enumerable:!0,configurable:!0}),BrowserDomAdapter.prototype.query=function(e){return document.querySelector(e)},BrowserDomAdapter.prototype.querySelector=function(e,t){return e.querySelector(t)},BrowserDomAdapter.prototype.querySelectorAll=function(e,t){return e.querySelectorAll(t)},BrowserDomAdapter.prototype.on=function(e,t,r){e.addEventListener(t,r,!1)},BrowserDomAdapter.prototype.onAndCancel=function(e,t,r){return e.addEventListener(t,r,!1),function(){e.removeEventListener(t,r,!1)}},BrowserDomAdapter.prototype.dispatchEvent=function(e,t){e.dispatchEvent(t)},BrowserDomAdapter.prototype.createMouseEvent=function(e){var t=document.createEvent("MouseEvent");return t.initEvent(e,!0,!0),t},BrowserDomAdapter.prototype.createEvent=function(e){var t=document.createEvent("Event");return t.initEvent(e,!0,!0),t},BrowserDomAdapter.prototype.preventDefault=function(e){e.preventDefault(),e.returnValue=!1},BrowserDomAdapter.prototype.isPrevented=function(e){return e.defaultPrevented||r.i(i.a)(e.returnValue)&&!e.returnValue},BrowserDomAdapter.prototype.getInnerHTML=function(e){return e.innerHTML},BrowserDomAdapter.prototype.getTemplateContent=function(e){return"content"in e&&e instanceof HTMLTemplateElement?e.content:null},BrowserDomAdapter.prototype.getOuterHTML=function(e){return e.outerHTML},BrowserDomAdapter.prototype.nodeName=function(e){return e.nodeName},BrowserDomAdapter.prototype.nodeValue=function(e){return e.nodeValue},BrowserDomAdapter.prototype.type=function(e){return e.type},BrowserDomAdapter.prototype.content=function(e){return this.hasProperty(e,"content")?e.content:e},BrowserDomAdapter.prototype.firstChild=function(e){return e.firstChild},BrowserDomAdapter.prototype.nextSibling=function(e){return e.nextSibling},BrowserDomAdapter.prototype.parentElement=function(e){return e.parentNode},BrowserDomAdapter.prototype.childNodes=function(e){return e.childNodes},BrowserDomAdapter.prototype.childNodesAsList=function(e){for(var t=e.childNodes,r=new Array(t.length),n=0;n<t.length;n++)r[n]=t[n];return r},BrowserDomAdapter.prototype.clearNodes=function(e){for(;e.firstChild;)e.removeChild(e.firstChild)},BrowserDomAdapter.prototype.appendChild=function(e,t){e.appendChild(t)},BrowserDomAdapter.prototype.removeChild=function(e,t){e.removeChild(t)},BrowserDomAdapter.prototype.replaceChild=function(e,t,r){e.replaceChild(t,r)},BrowserDomAdapter.prototype.remove=function(e){return e.parentNode&&e.parentNode.removeChild(e),e},BrowserDomAdapter.prototype.insertBefore=function(e,t){e.parentNode.insertBefore(t,e)},BrowserDomAdapter.prototype.insertAllBefore=function(e,t){t.forEach(function(t){return e.parentNode.insertBefore(t,e)})},BrowserDomAdapter.prototype.insertAfter=function(e,t){e.parentNode.insertBefore(t,e.nextSibling)},BrowserDomAdapter.prototype.setInnerHTML=function(e,t){e.innerHTML=t},BrowserDomAdapter.prototype.getText=function(e){return e.textContent},BrowserDomAdapter.prototype.setText=function(e,t){e.textContent=t},BrowserDomAdapter.prototype.getValue=function(e){return e.value},BrowserDomAdapter.prototype.setValue=function(e,t){e.value=t},BrowserDomAdapter.prototype.getChecked=function(e){return e.checked},BrowserDomAdapter.prototype.setChecked=function(e,t){e.checked=t},BrowserDomAdapter.prototype.createComment=function(e){return document.createComment(e)},BrowserDomAdapter.prototype.createTemplate=function(e){var t=document.createElement("template");return t.innerHTML=e,t},BrowserDomAdapter.prototype.createElement=function(e,t){return void 0===t&&(t=document),t.createElement(e)},BrowserDomAdapter.prototype.createElementNS=function(e,t,r){return void 0===r&&(r=document),r.createElementNS(e,t)},BrowserDomAdapter.prototype.createTextNode=function(e,t){return void 0===t&&(t=document),t.createTextNode(e)},BrowserDomAdapter.prototype.createScriptTag=function(e,t,r){void 0===r&&(r=document);var n=r.createElement("SCRIPT");return n.setAttribute(e,t),n},BrowserDomAdapter.prototype.createStyleElement=function(e,t){void 0===t&&(t=document);var r=t.createElement("style");return this.appendChild(r,this.createTextNode(e)),r},BrowserDomAdapter.prototype.createShadowRoot=function(e){return e.createShadowRoot()},BrowserDomAdapter.prototype.getShadowRoot=function(e){return e.shadowRoot},BrowserDomAdapter.prototype.getHost=function(e){return e.host},BrowserDomAdapter.prototype.clone=function(e){return e.cloneNode(!0)},BrowserDomAdapter.prototype.getElementsByClassName=function(e,t){return e.getElementsByClassName(t)},BrowserDomAdapter.prototype.getElementsByTagName=function(e,t){return e.getElementsByTagName(t)},BrowserDomAdapter.prototype.classList=function(e){return Array.prototype.slice.call(e.classList,0)},BrowserDomAdapter.prototype.addClass=function(e,t){e.classList.add(t)},BrowserDomAdapter.prototype.removeClass=function(e,t){e.classList.remove(t)},BrowserDomAdapter.prototype.hasClass=function(e,t){return e.classList.contains(t)},BrowserDomAdapter.prototype.setStyle=function(e,t,r){e.style[t]=r},BrowserDomAdapter.prototype.removeStyle=function(e,t){e.style[t]=""},BrowserDomAdapter.prototype.getStyle=function(e,t){return e.style[t]},BrowserDomAdapter.prototype.hasStyle=function(e,t,r){void 0===r&&(r=null);var n=this.getStyle(e,t)||"";return r?n==r:n.length>0},BrowserDomAdapter.prototype.tagName=function(e){return e.tagName},BrowserDomAdapter.prototype.attributeMap=function(e){for(var t=new Map,r=e.attributes,n=0;n<r.length;n++){var i=r[n];t.set(i.name,i.value)}return t},BrowserDomAdapter.prototype.hasAttribute=function(e,t){return e.hasAttribute(t)},BrowserDomAdapter.prototype.hasAttributeNS=function(e,t,r){return e.hasAttributeNS(t,r)},BrowserDomAdapter.prototype.getAttribute=function(e,t){return e.getAttribute(t)},BrowserDomAdapter.prototype.getAttributeNS=function(e,t,r){return e.getAttributeNS(t,r)},BrowserDomAdapter.prototype.setAttribute=function(e,t,r){e.setAttribute(t,r)},BrowserDomAdapter.prototype.setAttributeNS=function(e,t,r,n){e.setAttributeNS(t,r,n)},BrowserDomAdapter.prototype.removeAttribute=function(e,t){e.removeAttribute(t)},BrowserDomAdapter.prototype.removeAttributeNS=function(e,t,r){e.removeAttributeNS(t,r)},BrowserDomAdapter.prototype.templateAwareRoot=function(e){return this.isTemplateElement(e)?this.content(e):e},BrowserDomAdapter.prototype.createHtmlDocument=function(){return document.implementation.createHTMLDocument("fakeTitle")},BrowserDomAdapter.prototype.defaultDoc=function(){return document},BrowserDomAdapter.prototype.getBoundingClientRect=function(e){try{return e.getBoundingClientRect()}catch(e){return{top:0,bottom:0,left:0,right:0,width:0,height:0}}},BrowserDomAdapter.prototype.getTitle=function(){return document.title},BrowserDomAdapter.prototype.setTitle=function(e){document.title=e||""},BrowserDomAdapter.prototype.elementMatches=function(e,t){return e instanceof HTMLElement&&(e.matches&&e.matches(t)||e.msMatchesSelector&&e.msMatchesSelector(t)||e.webkitMatchesSelector&&e.webkitMatchesSelector(t))},BrowserDomAdapter.prototype.isTemplateElement=function(e){return e instanceof HTMLElement&&"TEMPLATE"==e.nodeName},BrowserDomAdapter.prototype.isTextNode=function(e){return e.nodeType===Node.TEXT_NODE},BrowserDomAdapter.prototype.isCommentNode=function(e){return e.nodeType===Node.COMMENT_NODE},BrowserDomAdapter.prototype.isElementNode=function(e){return e.nodeType===Node.ELEMENT_NODE},BrowserDomAdapter.prototype.hasShadowRoot=function(e){return r.i(i.a)(e.shadowRoot)&&e instanceof HTMLElement},BrowserDomAdapter.prototype.isShadowRoot=function(e){return e instanceof DocumentFragment},BrowserDomAdapter.prototype.importIntoDoc=function(e){return document.importNode(this.templateAwareRoot(e),!0)},BrowserDomAdapter.prototype.adoptNode=function(e){return document.adoptNode(e)},BrowserDomAdapter.prototype.getHref=function(e){return e.href},BrowserDomAdapter.prototype.getEventKey=function(e){var t=e.key;if(r.i(i.b)(t)){if(t=e.keyIdentifier,r.i(i.b)(t))return"Unidentified";t.startsWith("U+")&&(t=String.fromCharCode(parseInt(t.substring(2),16)),e.location===c&&p.hasOwnProperty(t)&&(t=p[t]))}return l[t]||t},BrowserDomAdapter.prototype.getGlobalEventTarget=function(e){return"window"===e?window:"document"===e?document:"body"===e?document.body:void 0},BrowserDomAdapter.prototype.getHistory=function(){return window.history},BrowserDomAdapter.prototype.getLocation=function(){return window.location},BrowserDomAdapter.prototype.getBaseHref=function(){var e=getBaseElementHref();return r.i(i.b)(e)?null:relativePath(e)},BrowserDomAdapter.prototype.resetBaseElement=function(){h=null},BrowserDomAdapter.prototype.getUserAgent=function(){return window.navigator.userAgent},BrowserDomAdapter.prototype.setData=function(e,t,r){this.setAttribute(e,"data-"+t,r)},BrowserDomAdapter.prototype.getData=function(e,t){return this.getAttribute(e,"data-"+t)},BrowserDomAdapter.prototype.getComputedStyle=function(e){return getComputedStyle(e)},BrowserDomAdapter.prototype.setGlobalVar=function(e,t){r.i(i.c)(i.d,e,t)},BrowserDomAdapter.prototype.supportsWebAnimation=function(){return"function"==typeof Element.prototype.animate},BrowserDomAdapter.prototype.performanceNow=function(){return window.performance&&window.performance.now?window.performance.now():(new Date).getTime()},BrowserDomAdapter.prototype.supportsCookies=function(){return!0},BrowserDomAdapter.prototype.getCookie=function(e){return parseCookieValue(document.cookie,e)},BrowserDomAdapter.prototype.setCookie=function(e,t){document.cookie=encodeURIComponent(e)+"="+encodeURIComponent(t)},BrowserDomAdapter}(o.a),h=null},function(e,t,r){"use strict";var n=r(72),i=r(0),o=r(15),a=r(496);r.d(t,"a",function(){return u});var s=this&&this.__extends||function(e,t){function __(){this.constructor=e}for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r]);e.prototype=null===t?Object.create(t):(__.prototype=t.prototype,new __)},u=function(e){function BrowserPlatformLocation(){e.call(this),this._init()}return s(BrowserPlatformLocation,e),BrowserPlatformLocation.prototype._init=function(){this._location=r.i(o.a)().getLocation(),this._history=r.i(o.a)().getHistory()},Object.defineProperty(BrowserPlatformLocation.prototype,"location",{get:function(){return this._location},enumerable:!0,configurable:!0}),BrowserPlatformLocation.prototype.getBaseHrefFromDOM=function(){return r.i(o.a)().getBaseHref()},BrowserPlatformLocation.prototype.onPopState=function(e){r.i(o.a)().getGlobalEventTarget("window").addEventListener("popstate",e,!1)},BrowserPlatformLocation.prototype.onHashChange=function(e){r.i(o.a)().getGlobalEventTarget("window").addEventListener("hashchange",e,!1)},Object.defineProperty(BrowserPlatformLocation.prototype,"pathname",{get:function(){return this._location.pathname},set:function(e){this._location.pathname=e},enumerable:!0,configurable:!0}),Object.defineProperty(BrowserPlatformLocation.prototype,"search",{get:function(){return this._location.search},enumerable:!0,configurable:!0}),Object.defineProperty(BrowserPlatformLocation.prototype,"hash",{get:function(){return this._location.hash},enumerable:!0,configurable:!0}),BrowserPlatformLocation.prototype.pushState=function(e,t,n){r.i(a.a)()?this._history.pushState(e,t,n):this._location.hash=n},BrowserPlatformLocation.prototype.replaceState=function(e,t,n){r.i(a.a)()?this._history.replaceState(e,t,n):this._location.hash=n},BrowserPlatformLocation.prototype.forward=function(){this._history.forward()},BrowserPlatformLocation.prototype.back=function(){this._history.back()},BrowserPlatformLocation.decorators=[{type:i.Injectable}],BrowserPlatformLocation.ctorParameters=[],BrowserPlatformLocation}(n.PlatformLocation)},function(e,t,r){"use strict";var n=r(0),i=r(15),o=r(211),a=r(30);r.d(t,"a",function(){return s});var s=function(){function BrowserGetTestability(){}return BrowserGetTestability.init=function(){r.i(n.setTestabilityGetter)(new BrowserGetTestability)},BrowserGetTestability.prototype.addToWindow=function(e){a.d.getAngularTestability=function(t,r){void 0===r&&(r=!0);var n=e.findTestabilityInTree(t,r);if(null==n)throw new Error("Could not find testability for element.");return n},a.d.getAllAngularTestabilities=function(){return e.getAllTestabilities()},a.d.getAllAngularRootElements=function(){return e.getAllRootElements()};var t=function(e){var t=a.d.getAllAngularTestabilities(),r=t.length,n=!1,i=function(t){n=n||t,r--,0==r&&e(n)};t.forEach(function(e){e.whenStable(i)})};a.d.frameworkStabilizers||(a.d.frameworkStabilizers=o.a.createGrowableSize(0)),a.d.frameworkStabilizers.push(t)},BrowserGetTestability.prototype.findTestabilityInTree=function(e,t,n){if(null==t)return null;var o=e.getTestability(t);return r.i(a.a)(o)?o:n?r.i(i.a)().isShadowRoot(t)?this.findTestabilityInTree(e,r.i(i.a)().getHost(t),!0):this.findTestabilityInTree(e,r.i(i.a)().parentElement(t),!0):null},BrowserGetTestability}()},function(e,t,r){"use strict";var n=r(15);r.d(t,"a",function(){return i});var i=function(){function Title(){}return Title.prototype.getTitle=function(){return r.i(n.a)().getTitle()},Title.prototype.setTitle=function(e){r.i(n.a)().setTitle(e)},Title}()},function(e,t,r){"use strict";var n=r(0),i=r(15),o=r(81);r.d(t,"a",function(){return s});var a=this&&this.__extends||function(e,t){function __(){this.constructor=e}for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r]);e.prototype=null===t?Object.create(t):(__.prototype=t.prototype,new __)},s=function(e){function DomEventsPlugin(){e.apply(this,arguments)}return a(DomEventsPlugin,e),DomEventsPlugin.prototype.supports=function(e){return!0},DomEventsPlugin.prototype.addEventListener=function(e,t,n){var o=this.manager.getZone(),a=function(e){return o.runGuarded(function(){return n(e)})};return this.manager.getZone().runOutsideAngular(function(){ return r.i(i.a)().onAndCancel(e,t,a)})},DomEventsPlugin.prototype.addGlobalEventListener=function(e,t,n){var o=r.i(i.a)().getGlobalEventTarget(e),a=this.manager.getZone(),s=function(e){return a.runGuarded(function(){return n(e)})};return this.manager.getZone().runOutsideAngular(function(){return r.i(i.a)().onAndCancel(o,t,s)})},DomEventsPlugin.decorators=[{type:n.Injectable}],DomEventsPlugin.ctorParameters=[],DomEventsPlugin}(o.b)},function(e,t,r){"use strict";var n=r(0),i=r(211),o=r(30),a=r(15),s=r(81);r.d(t,"a",function(){return p});var u=this&&this.__extends||function(e,t){function __(){this.constructor=e}for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r]);e.prototype=null===t?Object.create(t):(__.prototype=t.prototype,new __)},c=["alt","control","meta","shift"],l={alt:function(e){return e.altKey},control:function(e){return e.ctrlKey},meta:function(e){return e.metaKey},shift:function(e){return e.shiftKey}},p=function(e){function KeyEventsPlugin(){e.call(this)}return u(KeyEventsPlugin,e),KeyEventsPlugin.prototype.supports=function(e){return r.i(o.a)(KeyEventsPlugin.parseEventName(e))},KeyEventsPlugin.prototype.addEventListener=function(e,t,n){var i=KeyEventsPlugin.parseEventName(t),o=KeyEventsPlugin.eventCallback(e,i.fullKey,n,this.manager.getZone());return this.manager.getZone().runOutsideAngular(function(){return r.i(a.a)().onAndCancel(e,i.domEventName,o)})},KeyEventsPlugin.parseEventName=function(e){var t=e.toLowerCase().split("."),r=t.shift();if(0===t.length||"keydown"!==r&&"keyup"!==r)return null;var n=KeyEventsPlugin._normalizeKey(t.pop()),o="";if(c.forEach(function(e){i.a.contains(t,e)&&(i.a.remove(t,e),o+=e+".")}),o+=n,0!=t.length||0===n.length)return null;var a={};return a.domEventName=r,a.fullKey=o,a},KeyEventsPlugin.getEventFullKey=function(e){var t="",n=r.i(a.a)().getEventKey(e);return n=n.toLowerCase()," "===n?n="space":"."===n&&(n="dot"),c.forEach(function(r){if(r!=n){var i=l[r];i(e)&&(t+=r+".")}}),t+=n},KeyEventsPlugin.eventCallback=function(e,t,r,n){return function(e){KeyEventsPlugin.getEventFullKey(e)===t&&n.runGuarded(function(){return r(e)})}},KeyEventsPlugin._normalizeKey=function(e){switch(e){case"esc":return"escape";default:return e}},KeyEventsPlugin.decorators=[{type:n.Injectable}],KeyEventsPlugin.ctorParameters=[],KeyEventsPlugin}(s.b)},function(e,t,r){"use strict";function camelCaseToDashCase(e){return e.replace(n,function(){for(var e=[],t=0;t<arguments.length;t++)e[t-0]=arguments[t];return"-"+e[1].toLowerCase()})}function dashCaseToCamelCase(e){return e.replace(i,function(){for(var e=[],t=0;t<arguments.length;t++)e[t-0]=arguments[t];return e[1].toUpperCase()})}t.b=camelCaseToDashCase,t.a=dashCaseToCamelCase;var n=/([A-Z])/g,i=/-([a-z])/g},function(e,t,r){"use strict";var n=r(0);r.d(t,"b",function(){return i}),r.d(t,"a",function(){return o});var i=(n.__core_private__.RenderDebugInfo,n.__core_private__.ReflectionCapabilities,n.__core_private__.DebugDomRootRenderer),o=(n.__core_private__.reflector,n.__core_private__.NoOpAnimationPlayer);n.__core_private__.AnimationPlayer,n.__core_private__.AnimationSequencePlayer,n.__core_private__.AnimationGroupPlayer,n.__core_private__.AnimationKeyframe,n.__core_private__.AnimationStyles,n.__core_private__.prepareFinalAnimationStyles,n.__core_private__.balanceAnimationKeyframes,n.__core_private__.clearStyles,n.__core_private__.collectAndResolveStyles},function(e,t,r){"use strict";var n=r(0),i=r(506),o=r(507),a=r(212);r.d(t,"a",function(){return u}),r.d(t,"b",function(){return c});var s=this&&this.__extends||function(e,t){function __(){this.constructor=e}for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r]);e.prototype=null===t?Object.create(t):(__.prototype=t.prototype,new __)},u=function(){function DomSanitizer(){}return DomSanitizer}(),c=function(e){function DomSanitizerImpl(){e.apply(this,arguments)}return s(DomSanitizerImpl,e),DomSanitizerImpl.prototype.sanitize=function(e,t){if(null==t)return null;switch(e){case n.SecurityContext.NONE:return t;case n.SecurityContext.HTML:return t instanceof p?t.changingThisBreaksApplicationSecurity:(this.checkNotSafeValue(t,"HTML"),r.i(i.a)(String(t)));case n.SecurityContext.STYLE:return t instanceof f?t.changingThisBreaksApplicationSecurity:(this.checkNotSafeValue(t,"Style"),r.i(o.a)(t));case n.SecurityContext.SCRIPT:if(t instanceof h)return t.changingThisBreaksApplicationSecurity;throw this.checkNotSafeValue(t,"Script"),new Error("unsafe value used in a script context");case n.SecurityContext.URL:return t instanceof m||t instanceof d?t.changingThisBreaksApplicationSecurity:(this.checkNotSafeValue(t,"URL"),r.i(a.a)(String(t)));case n.SecurityContext.RESOURCE_URL:if(t instanceof m)return t.changingThisBreaksApplicationSecurity;throw this.checkNotSafeValue(t,"ResourceURL"),new Error("unsafe value used in a resource URL context (see http://g.co/ng/security#xss)");default:throw new Error("Unexpected SecurityContext "+e+" (see http://g.co/ng/security#xss)")}},DomSanitizerImpl.prototype.checkNotSafeValue=function(e,t){if(e instanceof l)throw new Error("Required a safe "+t+", got a "+e.getTypeName()+" (see http://g.co/ng/security#xss)")},DomSanitizerImpl.prototype.bypassSecurityTrustHtml=function(e){return new p(e)},DomSanitizerImpl.prototype.bypassSecurityTrustStyle=function(e){return new f(e)},DomSanitizerImpl.prototype.bypassSecurityTrustScript=function(e){return new h(e)},DomSanitizerImpl.prototype.bypassSecurityTrustUrl=function(e){return new d(e)},DomSanitizerImpl.prototype.bypassSecurityTrustResourceUrl=function(e){return new m(e)},DomSanitizerImpl.decorators=[{type:n.Injectable}],DomSanitizerImpl.ctorParameters=[],DomSanitizerImpl}(u),l=function(){function SafeValueImpl(e){this.changingThisBreaksApplicationSecurity=e}return SafeValueImpl.prototype.toString=function(){return"SafeValue must use [property]=binding: "+this.changingThisBreaksApplicationSecurity+" (see http://g.co/ng/security#xss)"},SafeValueImpl}(),p=function(e){function SafeHtmlImpl(){e.apply(this,arguments)}return s(SafeHtmlImpl,e),SafeHtmlImpl.prototype.getTypeName=function(){return"HTML"},SafeHtmlImpl}(l),f=function(e){function SafeStyleImpl(){e.apply(this,arguments)}return s(SafeStyleImpl,e),SafeStyleImpl.prototype.getTypeName=function(){return"Style"},SafeStyleImpl}(l),h=function(e){function SafeScriptImpl(){e.apply(this,arguments)}return s(SafeScriptImpl,e),SafeScriptImpl.prototype.getTypeName=function(){return"Script"},SafeScriptImpl}(l),d=function(e){function SafeUrlImpl(){e.apply(this,arguments)}return s(SafeUrlImpl,e),SafeUrlImpl.prototype.getTypeName=function(){return"URL"},SafeUrlImpl}(l),m=function(e){function SafeResourceUrlImpl(){e.apply(this,arguments)}return s(SafeResourceUrlImpl,e),SafeResourceUrlImpl.prototype.getTypeName=function(){return"ResourceURL"},SafeResourceUrlImpl}(l)},function(e,t,r){"use strict";var n=r(0),i=r(101),o=r(213);r.d(t,"a",function(){return a});var a=function(){function RouterLinkActive(e,t,r){var n=this;this.router=e,this.element=t,this.renderer=r,this.classes=[],this.routerLinkActiveOptions={exact:!1},this.subscription=e.events.subscribe(function(e){e instanceof i.b&&n.update()})}return RouterLinkActive.prototype.ngAfterContentInit=function(){var e=this;this.links.changes.subscribe(function(t){return e.update()}),this.linksWithHrefs.changes.subscribe(function(t){return e.update()}),this.update()},Object.defineProperty(RouterLinkActive.prototype,"routerLinkActive",{set:function(e){Array.isArray(e)?this.classes=e:this.classes=e.split(" ")},enumerable:!0,configurable:!0}),RouterLinkActive.prototype.ngOnChanges=function(e){this.update()},RouterLinkActive.prototype.ngOnDestroy=function(){this.subscription.unsubscribe()},RouterLinkActive.prototype.update=function(){var e=this;if(this.links&&this.linksWithHrefs&&this.router.navigated){var t=this.hasActiveLink();this.classes.forEach(function(r){return e.renderer.setElementClass(e.element.nativeElement,r,t)})}},RouterLinkActive.prototype.isLinkActive=function(e){var t=this;return function(r){return e.isActive(r.urlTree,t.routerLinkActiveOptions.exact)}},RouterLinkActive.prototype.hasActiveLink=function(){return this.links.some(this.isLinkActive(this.router))||this.linksWithHrefs.some(this.isLinkActive(this.router))},RouterLinkActive.decorators=[{type:n.Directive,args:[{selector:"[routerLinkActive]"}]}],RouterLinkActive.ctorParameters=[{type:i.a},{type:n.ElementRef},{type:n.Renderer}],RouterLinkActive.propDecorators={links:[{type:n.ContentChildren,args:[o.a,{descendants:!0}]}],linksWithHrefs:[{type:n.ContentChildren,args:[o.b,{descendants:!0}]}],routerLinkActiveOptions:[{type:n.Input}],routerLinkActive:[{type:n.Input}]},RouterLinkActive}()},function(e,t,r){"use strict";var n=r(0),i=r(145),o=r(45);r.d(t,"a",function(){return a});var a=function(){function RouterOutlet(e,t,r,i){this.parentOutletMap=e,this.location=t,this.resolver=r,this.name=i,this.activateEvents=new n.EventEmitter,this.deactivateEvents=new n.EventEmitter,e.registerOutlet(i?i:o.a,this)}return RouterOutlet.prototype.ngOnDestroy=function(){this.parentOutletMap.removeOutlet(this.name?this.name:o.a)},Object.defineProperty(RouterOutlet.prototype,"isActivated",{get:function(){return!!this.activated},enumerable:!0,configurable:!0}),Object.defineProperty(RouterOutlet.prototype,"component",{get:function(){if(!this.activated)throw new Error("Outlet is not activated");return this.activated.instance},enumerable:!0,configurable:!0}),Object.defineProperty(RouterOutlet.prototype,"activatedRoute",{get:function(){if(!this.activated)throw new Error("Outlet is not activated");return this._activatedRoute},enumerable:!0,configurable:!0}),RouterOutlet.prototype.deactivate=function(){if(this.activated){var e=this.component;this.activated.destroy(),this.activated=null,this.deactivateEvents.emit(e)}},RouterOutlet.prototype.activate=function(e,t,r,i,o){this.outletMap=o,this._activatedRoute=e;var a,s=e._futureSnapshot,u=s._routeConfig.component;a=t?t.resolveComponentFactory(u):this.resolver.resolveComponentFactory(u);var c=r?r:this.location.parentInjector,l=n.ReflectiveInjector.fromResolvedProviders(i,c);this.activated=this.location.createComponent(a,this.location.length,l,[]),this.activated.changeDetectorRef.detectChanges(),this.activateEvents.emit(this.activated.instance)},RouterOutlet.decorators=[{type:n.Directive,args:[{selector:"router-outlet"}]}],RouterOutlet.ctorParameters=[{type:i.a},{type:n.ViewContainerRef},{type:n.ComponentFactoryResolver},{type:void 0,decorators:[{type:n.Attribute,args:["name"]}]}],RouterOutlet.propDecorators={activateEvents:[{type:n.Output,args:["activate"]}],deactivateEvents:[{type:n.Output,args:["deactivate"]}]},RouterOutlet}()},function(e,t,r){"use strict";function provideLocationStrategy(e,t,r){return void 0===r&&(r={}),r.useHash?new n.HashLocationStrategy(e,t):new n.PathLocationStrategy(e,t)}function provideForRootGuard(e){if(e)throw new Error("RouterModule.forRoot() called twice. Lazy loaded modules should use RouterModule.forChild() instead.");return"guarded"}function provideRoutes(e){return[{provide:i.ANALYZE_FOR_ENTRY_COMPONENTS,multi:!0,useValue:e},{provide:c.c,multi:!0,useValue:e}]}function setupRouter(e,t,n,i,o,a,s,c,l){void 0===l&&(l={});var p=new u.a(null,t,n,i,o,a,s,r.i(d.a)(c));return l.errorHandler&&(p.errorHandler=l.errorHandler),l.enableTracing&&p.events.subscribe(function(e){console.group("Router Event: "+e.constructor.name),console.log(e.toString()),console.log(e),console.groupEnd()}),p}function rootRoute(e){return e.routerState.root}function initialRouterNavigation(e,t,r,n){return function(){e.resetRootComponentType(t.componentTypes[0]),r.setUpPreloading(),n.initialNavigation===!1?e.setUpLocationChangeListener():e.initialNavigation()}}function provideRouterInitializer(){return{provide:i.APP_BOOTSTRAP_LISTENER,multi:!0,useFactory:initialRouterNavigation,deps:[u.a,i.ApplicationRef,p.a,v]}}var n=r(72),i=r(0),o=r(213),a=r(333),s=r(334),u=r(101),c=r(102),l=r(145),p=r(336),f=r(82),h=r(63),d=r(46);r.d(t,"a",function(){return g}),r.d(t,"b",function(){return _}),t.c=provideRoutes;var m=[s.a,o.a,o.b,a.a],v=new i.OpaqueToken("ROUTER_CONFIGURATION"),y=new i.OpaqueToken("ROUTER_FORROOT_GUARD"),g=({provide:n.LocationStrategy,useClass:n.PathLocationStrategy},{provide:n.LocationStrategy,useClass:n.HashLocationStrategy},[n.Location,{provide:h.g,useClass:h.h},{provide:u.a,useFactory:setupRouter,deps:[i.ApplicationRef,h.g,l.a,n.Location,i.Injector,i.NgModuleFactoryLoader,i.Compiler,c.c,v]},l.a,{provide:f.b,useFactory:rootRoute,deps:[u.a]},{provide:i.NgModuleFactoryLoader,useClass:i.SystemJsNgModuleLoader},p.a,p.b,p.c,{provide:v,useValue:{enableTracing:!1}}]),_=function(){function RouterModule(e){}return RouterModule.forRoot=function(e,t){return{ngModule:RouterModule,providers:[g,provideRoutes(e),{provide:y,useFactory:provideForRootGuard,deps:[[u.a,new i.Optional,new i.SkipSelf]]},{provide:v,useValue:t?t:{}},{provide:n.LocationStrategy,useFactory:provideLocationStrategy,deps:[n.PlatformLocation,[new i.Inject(n.APP_BASE_HREF),new i.Optional],v]},{provide:p.d,useExisting:t&&t.preloadingStrategy?t.preloadingStrategy:p.b},provideRouterInitializer()]}},RouterModule.forChild=function(e){return{ngModule:RouterModule,providers:[provideRoutes(e)]}},RouterModule.decorators=[{type:i.NgModule,args:[{declarations:m,exports:m}]}],RouterModule.ctorParameters=[{type:void 0,decorators:[{type:i.Optional},{type:i.Inject,args:[y]}]}],RouterModule}()},function(e,t,r){"use strict";var n=r(0),i=r(240),o=(r.n(i),r(71)),a=(r.n(o),r(241)),s=(r.n(a),r(384)),u=(r.n(s),r(708)),c=(r.n(u),r(157)),l=(r.n(c),r(87)),p=(r.n(l),r(101)),f=r(102);r.d(t,"d",function(){return h}),r.d(t,"c",function(){return d}),r.d(t,"b",function(){return m}),r.d(t,"a",function(){return v});var h=function(){function PreloadingStrategy(){}return PreloadingStrategy}(),d=function(){function PreloadAllModules(){}return PreloadAllModules.prototype.preload=function(e,t){return a._catch.call(t(),function(){return r.i(o.of)(null)})},PreloadAllModules}(),m=function(){function NoPreloading(){}return NoPreloading.prototype.preload=function(e,t){return r.i(o.of)(null)},NoPreloading}(),v=function(){function RouterPreloader(e,t,r,n,i){this.router=e,this.injector=n,this.preloadingStrategy=i,this.loader=new f.b(t,r)}return RouterPreloader.prototype.setUpPreloading=function(){var e=this,t=u.filter.call(this.router.events,function(e){return e instanceof p.b});this.subscription=s.concatMap.call(t,function(){return e.preload()}).subscribe(function(e){})},RouterPreloader.prototype.preload=function(){return this.processRoutes(this.injector,this.router.config)},RouterPreloader.prototype.ngOnDestroy=function(){this.subscription.unsubscribe()},RouterPreloader.prototype.processRoutes=function(e,t){for(var n=[],o=0,a=t;o<a.length;o++){var s=a[o];if(s.loadChildren&&!s.canLoad&&s._loadedConfig){var u=s._loadedConfig;n.push(this.processRoutes(u.injector,u.routes))}else s.loadChildren&&!s.canLoad?n.push(this.preloadConfig(e,s)):s.children&&n.push(this.processRoutes(e,s.children))}return c.mergeAll.call(r.i(i.from)(n))},RouterPreloader.prototype.preloadConfig=function(e,t){var r=this;return this.preloadingStrategy.preload(t,function(){var n=r.loader.load(e,t.loadChildren);return l.mergeMap.call(n,function(e){var n=t;return n._loadedConfig=e,r.processRoutes(e.injector,e.routes)})})},RouterPreloader.decorators=[{type:n.Injectable}],RouterPreloader.ctorParameters=[{type:p.a},{type:n.NgModuleFactoryLoader},{type:n.Compiler},{type:n.Injector},{type:h}],RouterPreloader}()},,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,function(e,t){"use strict";t.empty={closed:!0,next:function(e){},error:function(e){throw e},complete:function(){}}},,function(e,t,r){"use strict";var n=this&&this.__extends||function(e,t){function __(){this.constructor=e}for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r]);e.prototype=null===t?Object.create(t):(__.prototype=t.prototype,new __)},i=r(6),o=r(382),a=r(380),s=r(716),u=function(e){function ArrayObservable(t,r){e.call(this),this.array=t,this.scheduler=r,r||1!==t.length||(this._isScalar=!0,this.value=t[0])}return n(ArrayObservable,e),ArrayObservable.create=function(e,t){return new ArrayObservable(e,t)},ArrayObservable.of=function(){for(var e=[],t=0;t<arguments.length;t++)e[t-0]=arguments[t];var r=e[e.length-1];s.isScheduler(r)?e.pop():r=null;var n=e.length;return n>1?new ArrayObservable(e,r):1===n?new o.ScalarObservable(e[0],r):new a.EmptyObservable(r)},ArrayObservable.dispatch=function(e){var t=e.array,r=e.index,n=e.count,i=e.subscriber;return r>=n?void i.complete():(i.next(t[r]),void(i.closed||(e.index=r+1,this.schedule(e))))},ArrayObservable.prototype._subscribe=function(e){var t=0,r=this.array,n=r.length,i=this.scheduler;if(i)return i.schedule(ArrayObservable.dispatch,0,{array:r,index:t,count:n,subscriber:e});for(var o=0;o<n&&!e.closed;o++)e.next(r[o]);e.complete()},ArrayObservable}(i.Observable);t.ArrayObservable=u},function(e,t,r){"use strict";var n=this&&this.__extends||function(e,t){function __(){this.constructor=e}for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r]);e.prototype=null===t?Object.create(t):(__.prototype=t.prototype,new __)},i=r(6),o=function(e){function EmptyObservable(t){e.call(this),this.scheduler=t}return n(EmptyObservable,e),EmptyObservable.create=function(e){return new EmptyObservable(e)},EmptyObservable.dispatch=function(e){var t=e.subscriber;t.complete()},EmptyObservable.prototype._subscribe=function(e){var t=this.scheduler;return t?t.schedule(EmptyObservable.dispatch,0,{subscriber:e}):void e.complete()},EmptyObservable}(i.Observable);t.EmptyObservable=o},function(e,t,r){"use strict";function dispatchNext(e){var t=e.value,r=e.subscriber;r.closed||(r.next(t),r.complete())}function dispatchError(e){var t=e.err,r=e.subscriber;r.closed||r.error(t)}var n=this&&this.__extends||function(e,t){function __(){this.constructor=e}for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r]);e.prototype=null===t?Object.create(t):(__.prototype=t.prototype,new __)},i=r(61),o=r(6),a=function(e){function PromiseObservable(t,r){e.call(this),this.promise=t,this.scheduler=r}return n(PromiseObservable,e),PromiseObservable.create=function(e,t){return new PromiseObservable(e,t)},PromiseObservable.prototype._subscribe=function(e){var t=this,r=this.promise,n=this.scheduler;if(null==n)this._isScalar?e.closed||(e.next(this.value),e.complete()):r.then(function(r){t.value=r,t._isScalar=!0,e.closed||(e.next(r),e.complete())},function(t){e.closed||e.error(t)}).then(null,function(e){i.root.setTimeout(function(){throw e})});else if(this._isScalar){if(!e.closed)return n.schedule(dispatchNext,0,{value:this.value,subscriber:e})}else r.then(function(r){t.value=r,t._isScalar=!0,e.closed||e.add(n.schedule(dispatchNext,0,{value:r,subscriber:e}))},function(t){e.closed||e.add(n.schedule(dispatchError,0,{err:t,subscriber:e}))}).then(null,function(e){i.root.setTimeout(function(){throw e})})},PromiseObservable}(o.Observable);t.PromiseObservable=a},function(e,t,r){"use strict";var n=this&&this.__extends||function(e,t){function __(){this.constructor=e}for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r]);e.prototype=null===t?Object.create(t):(__.prototype=t.prototype,new __)},i=r(6),o=function(e){function ScalarObservable(t,r){e.call(this),this.value=t,this.scheduler=r,this._isScalar=!0,r&&(this._isScalar=!1)}return n(ScalarObservable,e),ScalarObservable.create=function(e,t){return new ScalarObservable(e,t)},ScalarObservable.dispatch=function(e){var t=e.done,r=e.value,n=e.subscriber;return t?void n.complete():(n.next(r),void(n.closed||(e.done=!0,this.schedule(e))))},ScalarObservable.prototype._subscribe=function(e){var t=this.value,r=this.scheduler;return r?r.schedule(ScalarObservable.dispatch,0,{done:!1,value:t,subscriber:e}):(e.next(t),void(e.closed||e.complete()))},ScalarObservable}(i.Observable);t.ScalarObservable=o},function(e,t,r){"use strict";function concatAll(){return this.lift(new n.MergeAllOperator(1))}var n=r(157);t.concatAll=concatAll},function(e,t,r){"use strict";function concatMap(e,t){return this.lift(new n.MergeMapOperator(e,t,1))}var n=r(87);t.concatMap=concatMap},function(e,t,r){"use strict";function every(e,t){return this.lift(new o(e,t,this))}var n=this&&this.__extends||function(e,t){function __(){this.constructor=e}for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r]);e.prototype=null===t?Object.create(t):(__.prototype=t.prototype,new __)},i=r(27);t.every=every;var o=function(){function EveryOperator(e,t,r){this.predicate=e,this.thisArg=t,this.source=r}return EveryOperator.prototype.call=function(e,t){return t._subscribe(new a(e,this.predicate,this.thisArg,this.source))},EveryOperator}(),a=function(e){function EverySubscriber(t,r,n,i){e.call(this,t),this.predicate=r,this.thisArg=n,this.source=i,this.index=0,this.thisArg=n||this}return n(EverySubscriber,e),EverySubscriber.prototype.notifyComplete=function(e){this.destination.next(e),this.destination.complete()},EverySubscriber.prototype._next=function(e){var t=!1;try{t=this.predicate.call(this.thisArg,e,this.index++,this.source)}catch(e){return void this.destination.error(e)}t||this.notifyComplete(!1)},EverySubscriber.prototype._complete=function(){this.notifyComplete(!0)},EverySubscriber}(i.Subscriber)},function(e,t){"use strict";var r=this&&this.__extends||function(e,t){function __(){this.constructor=e}for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r]);e.prototype=null===t?Object.create(t):(__.prototype=t.prototype,new __)},n=function(e){function ObjectUnsubscribedError(){var t=e.call(this,"object unsubscribed");this.name=t.name="ObjectUnsubscribedError",this.stack=t.stack,this.message=t.message}return r(ObjectUnsubscribedError,e),ObjectUnsubscribedError}(Error);t.ObjectUnsubscribedError=n},function(e,t){"use strict";function isFunction(e){return"function"==typeof e}t.isFunction=isFunction},function(e,t){"use strict";function isPromise(e){return e&&"function"!=typeof e.subscribe&&"function"==typeof e.then}t.isPromise=isPromise},function(e,t,r){"use strict";function tryCatcher(){try{return n.apply(this,arguments)}catch(e){return i.errorObject.e=e,i.errorObject}}function tryCatch(e){return n=e,tryCatcher}var n,i=r(246);t.tryCatch=tryCatch},function(e,t){function webpackEmptyContext(e){throw new Error("Cannot find module '"+e+"'.")}webpackEmptyContext.keys=function(){return[]},webpackEmptyContext.resolve=webpackEmptyContext,e.exports=webpackEmptyContext,webpackEmptyContext.id=390},,,,,,,,,,,,,,,,,,,,function(e,t,r){"use strict";var n=r(6),i=r(87);n.Observable.prototype.mergeMap=i.mergeMap,n.Observable.prototype.flatMap=i.mergeMap},,,function(e,t,r){"use strict";var n=r(0),i=r(252),o=r(115),a=r(256);r.d(t,"a",function(){return s});var s=function(){function CommonModule(){}return CommonModule.decorators=[{type:n.NgModule,args:[{declarations:[i.a,a.a],exports:[i.a,a.a],providers:[{provide:o.b,useClass:o.c}]}]}],CommonModule.ctorParameters=[],CommonModule}()},function(e,t,r){"use strict";var n=r(0),i=r(254),o=r(22);r.d(t,"a",function(){return a});var a=function(){function NgClass(e,t,r,n){this._iterableDiffers=e,this._keyValueDiffers=t,this._ngEl=r,this._renderer=n,this._initialClasses=[]}return Object.defineProperty(NgClass.prototype,"klass",{set:function(e){this._applyInitialClasses(!0),this._initialClasses="string"==typeof e?e.split(/\s+/):[],this._applyInitialClasses(!1),this._applyClasses(this._rawClass,!1)},enumerable:!0,configurable:!0}),Object.defineProperty(NgClass.prototype,"ngClass",{set:function(e){this._cleanupClasses(this._rawClass),this._iterableDiffer=null,this._keyValueDiffer=null,this._rawClass="string"==typeof e?e.split(/\s+/):e,this._rawClass&&(r.i(i.a)(this._rawClass)?this._iterableDiffer=this._iterableDiffers.find(this._rawClass).create(null):this._keyValueDiffer=this._keyValueDiffers.find(this._rawClass).create(null))},enumerable:!0,configurable:!0}),NgClass.prototype.ngDoCheck=function(){if(this._iterableDiffer){var e=this._iterableDiffer.diff(this._rawClass);e&&this._applyIterableChanges(e)}else if(this._keyValueDiffer){var e=this._keyValueDiffer.diff(this._rawClass);e&&this._applyKeyValueChanges(e)}},NgClass.prototype._cleanupClasses=function(e){this._applyClasses(e,!0),this._applyInitialClasses(!1)},NgClass.prototype._applyKeyValueChanges=function(e){var t=this;e.forEachAddedItem(function(e){return t._toggleClass(e.key,e.currentValue)}),e.forEachChangedItem(function(e){return t._toggleClass(e.key,e.currentValue)}),e.forEachRemovedItem(function(e){e.previousValue&&t._toggleClass(e.key,!1)})},NgClass.prototype._applyIterableChanges=function(e){var t=this;e.forEachAddedItem(function(e){return t._toggleClass(e.item,!0)}),e.forEachRemovedItem(function(e){return t._toggleClass(e.item,!1)})},NgClass.prototype._applyInitialClasses=function(e){var t=this;this._initialClasses.forEach(function(r){return t._toggleClass(r,!e)})},NgClass.prototype._applyClasses=function(e,t){var n=this;e&&(Array.isArray(e)||e instanceof Set?e.forEach(function(e){return n._toggleClass(e,!t)}):Object.keys(e).forEach(function(i){r.i(o.a)(e[i])&&n._toggleClass(i,!t)}))},NgClass.prototype._toggleClass=function(e,t){var r=this;e=e.trim(),e&&e.split(/\s+/g).forEach(function(e){r._renderer.setElementClass(r._ngEl.nativeElement,e,t)})},NgClass.decorators=[{type:n.Directive,args:[{selector:"[ngClass]"}]}],NgClass.ctorParameters=[{type:n.IterableDiffers},{type:n.KeyValueDiffers},{type:n.ElementRef},{type:n.Renderer}],NgClass.propDecorators={klass:[{type:n.Input,args:["class"]}],ngClass:[{type:n.Input}]},NgClass}()},function(e,t,r){"use strict";var n=r(0),i=r(22);r.d(t,"a",function(){return a});var o=function(){function NgForRow(e,t,r){this.$implicit=e,this.index=t,this.count=r}return Object.defineProperty(NgForRow.prototype,"first",{get:function(){return 0===this.index},enumerable:!0,configurable:!0}),Object.defineProperty(NgForRow.prototype,"last",{get:function(){return this.index===this.count-1},enumerable:!0,configurable:!0}),Object.defineProperty(NgForRow.prototype,"even",{get:function(){return this.index%2===0},enumerable:!0,configurable:!0}),Object.defineProperty(NgForRow.prototype,"odd",{get:function(){return!this.even},enumerable:!0,configurable:!0}),NgForRow}(),a=function(){function NgFor(e,t,r,n){this._viewContainer=e,this._template=t,this._differs=r,this._cdr=n,this._differ=null}return Object.defineProperty(NgFor.prototype,"ngForTemplate",{set:function(e){e&&(this._template=e)},enumerable:!0,configurable:!0}),NgFor.prototype.ngOnChanges=function(e){if("ngForOf"in e){var t=e.ngForOf.currentValue;if(!this._differ&&t)try{this._differ=this._differs.find(t).create(this._cdr,this.ngForTrackBy)}catch(e){throw new Error("Cannot find a differ supporting object '"+t+"' of type '"+r.i(i.e)(t)+"'. NgFor only supports binding to Iterables such as Arrays.")}}},NgFor.prototype.ngDoCheck=function(){if(this._differ){var e=this._differ.diff(this.ngForOf);e&&this._applyChanges(e)}},NgFor.prototype._applyChanges=function(e){var t=this,r=[];e.forEachOperation(function(e,n,i){if(null==e.previousIndex){var a=t._viewContainer.createEmbeddedView(t._template,new o(null,null,null),i),u=new s(e,a);r.push(u)}else if(null==i)t._viewContainer.remove(n);else{var a=t._viewContainer.get(n);t._viewContainer.move(a,i);var u=new s(e,a);r.push(u)}});for(var n=0;n<r.length;n++)this._perViewChange(r[n].view,r[n].record);for(var n=0,i=this._viewContainer.length;n<i;n++){var a=this._viewContainer.get(n);a.context.index=n,a.context.count=i}e.forEachIdentityChange(function(e){var r=t._viewContainer.get(e.currentIndex);r.context.$implicit=e.item})},NgFor.prototype._perViewChange=function(e,t){e.context.$implicit=t.item},NgFor.decorators=[{type:n.Directive,args:[{selector:"[ngFor][ngForOf]"}]}],NgFor.ctorParameters=[{type:n.ViewContainerRef},{type:n.TemplateRef},{type:n.IterableDiffers},{type:n.ChangeDetectorRef}],NgFor.propDecorators={ngForOf:[{type:n.Input}],ngForTrackBy:[{type:n.Input}],ngForTemplate:[{type:n.Input}]},NgFor}(),s=function(){function RecordViewTuple(e,t){this.record=e,this.view=t}return RecordViewTuple}()},function(e,t,r){"use strict";var n=r(0);r.d(t,"a",function(){return i});var i=function(){function NgIf(e,t){this._viewContainer=e,this._template=t,this._hasView=!1}return Object.defineProperty(NgIf.prototype,"ngIf",{set:function(e){e&&!this._hasView?(this._hasView=!0,this._viewContainer.createEmbeddedView(this._template)):!e&&this._hasView&&(this._hasView=!1,this._viewContainer.clear())},enumerable:!0,configurable:!0}),NgIf.decorators=[{type:n.Directive,args:[{selector:"[ngIf]"}]}],NgIf.ctorParameters=[{type:n.ViewContainerRef},{type:n.TemplateRef}],NgIf.propDecorators={ngIf:[{type:n.Input}]},NgIf}()},function(e,t,r){"use strict";var n=r(0),i=r(115),o=r(253);r.d(t,"a",function(){return a}),r.d(t,"b",function(){return s});var a=function(){function NgPlural(e){this._localization=e,this._caseViews={}}return Object.defineProperty(NgPlural.prototype,"ngPlural",{set:function(e){this._switchValue=e,this._updateView()},enumerable:!0,configurable:!0}),NgPlural.prototype.addCase=function(e,t){this._caseViews[e]=t},NgPlural.prototype._updateView=function(){this._clearViews();var e=Object.keys(this._caseViews),t=r.i(i.a)(this._switchValue,e,this._localization);this._activateView(this._caseViews[t])},NgPlural.prototype._clearViews=function(){this._activeView&&this._activeView.destroy()},NgPlural.prototype._activateView=function(e){e&&(this._activeView=e,this._activeView.create())},NgPlural.decorators=[{type:n.Directive,args:[{selector:"[ngPlural]"}]}],NgPlural.ctorParameters=[{type:i.b}],NgPlural.propDecorators={ngPlural:[{type:n.Input}]},NgPlural}(),s=function(){function NgPluralCase(e,t,r,n){this.value=e,n.addCase(e,new o.a(r,t))}return NgPluralCase.decorators=[{type:n.Directive,args:[{selector:"[ngPluralCase]"}]}],NgPluralCase.ctorParameters=[{type:void 0,decorators:[{type:n.Attribute,args:["ngPluralCase"]}]},{type:n.TemplateRef},{type:n.ViewContainerRef},{type:a,decorators:[{type:n.Host}]}],NgPluralCase}()},function(e,t,r){"use strict";var n=r(0);r.d(t,"a",function(){return i});var i=function(){function NgStyle(e,t,r){this._differs=e,this._ngEl=t,this._renderer=r}return Object.defineProperty(NgStyle.prototype,"ngStyle",{set:function(e){this._ngStyle=e,!this._differ&&e&&(this._differ=this._differs.find(e).create(null))},enumerable:!0,configurable:!0}),NgStyle.prototype.ngDoCheck=function(){if(this._differ){var e=this._differ.diff(this._ngStyle);e&&this._applyChanges(e)}},NgStyle.prototype._applyChanges=function(e){var t=this;e.forEachRemovedItem(function(e){return t._setStyle(e.key,null)}),e.forEachAddedItem(function(e){return t._setStyle(e.key,e.currentValue)}),e.forEachChangedItem(function(e){return t._setStyle(e.key,e.currentValue)})},NgStyle.prototype._setStyle=function(e,t){var r=e.split("."),n=r[0],i=r[1];t=t&&i?""+t+i:t,this._renderer.setElementStyle(this._ngEl.nativeElement,n,t)},NgStyle.decorators=[{type:n.Directive,args:[{selector:"[ngStyle]"}]}],NgStyle.ctorParameters=[{type:n.KeyValueDiffers},{type:n.ElementRef},{type:n.Renderer}],NgStyle.propDecorators={ngStyle:[{type:n.Input}]},NgStyle}()},function(e,t,r){"use strict";var n=r(0);r.d(t,"a",function(){return i});var i=function(){function NgTemplateOutlet(e){this._viewContainerRef=e}return Object.defineProperty(NgTemplateOutlet.prototype,"ngOutletContext",{set:function(e){this._context=e},enumerable:!0,configurable:!0}),Object.defineProperty(NgTemplateOutlet.prototype,"ngTemplateOutlet",{set:function(e){this._templateRef=e},enumerable:!0,configurable:!0}),NgTemplateOutlet.prototype.ngOnChanges=function(e){this._viewRef&&this._viewContainerRef.remove(this._viewContainerRef.indexOf(this._viewRef)),this._templateRef&&(this._viewRef=this._viewContainerRef.createEmbeddedView(this._templateRef,this._context))},NgTemplateOutlet.decorators=[{type:n.Directive,args:[{selector:"[ngTemplateOutlet]"}]}],NgTemplateOutlet.ctorParameters=[{type:n.ViewContainerRef}],NgTemplateOutlet.propDecorators={ngOutletContext:[{type:n.Input}],ngTemplateOutlet:[{type:n.Input}]},NgTemplateOutlet}()},function(e,t,r){"use strict";r.d(t,"a",function(){return i; });var n=this&&this.__extends||function(e,t){function __(){this.constructor=e}for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r]);e.prototype=null===t?Object.create(t):(__.prototype=t.prototype,new __)},i=function(e){function BaseError(t){var r=e.call(this,t);this._nativeError=r}return n(BaseError,e),Object.defineProperty(BaseError.prototype,"message",{get:function(){return this._nativeError.message},set:function(e){this._nativeError.message=e},enumerable:!0,configurable:!0}),Object.defineProperty(BaseError.prototype,"name",{get:function(){return this._nativeError.name},enumerable:!0,configurable:!0}),Object.defineProperty(BaseError.prototype,"stack",{get:function(){return this._nativeError.stack},set:function(e){this._nativeError.stack=e},enumerable:!0,configurable:!0}),BaseError.prototype.toString=function(){return this._nativeError.toString()},BaseError}(Error);(function(e){function WrappedError(t,r){e.call(this,t+" caused by: "+(r instanceof Error?r.message:r)),this.originalError=r}return n(WrappedError,e),Object.defineProperty(WrappedError.prototype,"stack",{get:function(){return(this.originalError instanceof Error?this.originalError:this._nativeError).stack},enumerable:!0,configurable:!0}),WrappedError})(i)},function(e,t,r){"use strict";var n=r(160),i=r(116),o=r(422),a=r(423),s=r(159);r.d(t,"a",function(){return n.a}),r.d(t,"b",function(){return i.a}),r.d(t,"c",function(){return i.b}),r.d(t,"d",function(){return o.a}),r.d(t,"e",function(){return a.a}),r.d(t,"f",function(){return s.a})},function(e,t,r){"use strict";var n=r(0),i=r(22),o=r(159),a=r(116),s=r(160);r.d(t,"a",function(){return c});var u=this&&this.__extends||function(e,t){function __(){this.constructor=e}for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r]);e.prototype=null===t?Object.create(t):(__.prototype=t.prototype,new __)},c=function(e){function HashLocationStrategy(t,n){e.call(this),this._platformLocation=t,this._baseHref="",r.i(i.a)(n)&&(this._baseHref=n)}return u(HashLocationStrategy,e),HashLocationStrategy.prototype.onPopState=function(e){this._platformLocation.onPopState(e),this._platformLocation.onHashChange(e)},HashLocationStrategy.prototype.getBaseHref=function(){return this._baseHref},HashLocationStrategy.prototype.path=function(e){void 0===e&&(e=!1);var t=this._platformLocation.hash;return r.i(i.a)(t)||(t="#"),t.length>0?t.substring(1):t},HashLocationStrategy.prototype.prepareExternalUrl=function(e){var t=o.a.joinWithSlash(this._baseHref,e);return t.length>0?"#"+t:t},HashLocationStrategy.prototype.pushState=function(e,t,r,n){var i=this.prepareExternalUrl(r+o.a.normalizeQueryParams(n));0==i.length&&(i=this._platformLocation.pathname),this._platformLocation.pushState(e,t,i)},HashLocationStrategy.prototype.replaceState=function(e,t,r,n){var i=this.prepareExternalUrl(r+o.a.normalizeQueryParams(n));0==i.length&&(i=this._platformLocation.pathname),this._platformLocation.replaceState(e,t,i)},HashLocationStrategy.prototype.forward=function(){this._platformLocation.forward()},HashLocationStrategy.prototype.back=function(){this._platformLocation.back()},HashLocationStrategy.decorators=[{type:n.Injectable}],HashLocationStrategy.ctorParameters=[{type:s.a},{type:void 0,decorators:[{type:n.Optional},{type:n.Inject,args:[a.b]}]}],HashLocationStrategy}(a.a)},function(e,t,r){"use strict";var n=r(0),i=r(22),o=r(159),a=r(116),s=r(160);r.d(t,"a",function(){return c});var u=this&&this.__extends||function(e,t){function __(){this.constructor=e}for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r]);e.prototype=null===t?Object.create(t):(__.prototype=t.prototype,new __)},c=function(e){function PathLocationStrategy(t,n){if(e.call(this),this._platformLocation=t,r.i(i.b)(n)&&(n=this._platformLocation.getBaseHrefFromDOM()),r.i(i.b)(n))throw new Error("No base href set. Please provide a value for the APP_BASE_HREF token or add a base element to the document.");this._baseHref=n}return u(PathLocationStrategy,e),PathLocationStrategy.prototype.onPopState=function(e){this._platformLocation.onPopState(e),this._platformLocation.onHashChange(e)},PathLocationStrategy.prototype.getBaseHref=function(){return this._baseHref},PathLocationStrategy.prototype.prepareExternalUrl=function(e){return o.a.joinWithSlash(this._baseHref,e)},PathLocationStrategy.prototype.path=function(e){void 0===e&&(e=!1);var t=this._platformLocation.pathname+o.a.normalizeQueryParams(this._platformLocation.search),r=this._platformLocation.hash;return r&&e?""+t+r:t},PathLocationStrategy.prototype.pushState=function(e,t,r,n){var i=this.prepareExternalUrl(r+o.a.normalizeQueryParams(n));this._platformLocation.pushState(e,t,i)},PathLocationStrategy.prototype.replaceState=function(e,t,r,n){var i=this.prepareExternalUrl(r+o.a.normalizeQueryParams(n));this._platformLocation.replaceState(e,t,i)},PathLocationStrategy.prototype.forward=function(){this._platformLocation.forward()},PathLocationStrategy.prototype.back=function(){this._platformLocation.back()},PathLocationStrategy.decorators=[{type:n.Injectable}],PathLocationStrategy.ctorParameters=[{type:s.a},{type:void 0,decorators:[{type:n.Optional},{type:n.Inject,args:[a.b]}]}],PathLocationStrategy}(a.a)},function(e,t,r){"use strict";var n=r(0),i=r(433),o=r(51);r.d(t,"a",function(){return l});var a=function(){function ObservableStrategy(){}return ObservableStrategy.prototype.createSubscription=function(e,t){return e.subscribe({next:t,error:function(e){throw e}})},ObservableStrategy.prototype.dispose=function(e){e.unsubscribe()},ObservableStrategy.prototype.onDestroy=function(e){e.unsubscribe()},ObservableStrategy}(),s=function(){function PromiseStrategy(){}return PromiseStrategy.prototype.createSubscription=function(e,t){return e.then(t,function(e){throw e})},PromiseStrategy.prototype.dispose=function(e){},PromiseStrategy.prototype.onDestroy=function(e){},PromiseStrategy}(),u=new s,c=new a,l=function(){function AsyncPipe(e){this._ref=e,this._latestValue=null,this._latestReturnedValue=null,this._subscription=null,this._obj=null,this._strategy=null}return AsyncPipe.prototype.ngOnDestroy=function(){this._subscription&&this._dispose()},AsyncPipe.prototype.transform=function(e){return this._obj?e!==this._obj?(this._dispose(),this.transform(e)):this._latestValue===this._latestReturnedValue?this._latestReturnedValue:(this._latestReturnedValue=this._latestValue,n.WrappedValue.wrap(this._latestValue)):(e&&this._subscribe(e),this._latestReturnedValue=this._latestValue,this._latestValue)},AsyncPipe.prototype._subscribe=function(e){var t=this;this._obj=e,this._strategy=this._selectStrategy(e),this._subscription=this._strategy.createSubscription(e,function(r){return t._updateLatestValue(e,r)})},AsyncPipe.prototype._selectStrategy=function(e){if(r.i(i.a)(e))return u;if(e.subscribe)return c;throw new o.a(AsyncPipe,e)},AsyncPipe.prototype._dispose=function(){this._strategy.dispose(this._subscription),this._latestValue=null,this._latestReturnedValue=null,this._subscription=null,this._obj=null},AsyncPipe.prototype._updateLatestValue=function(e,t){e===this._obj&&(this._latestValue=t,this._ref.markForCheck())},AsyncPipe.decorators=[{type:n.Pipe,args:[{name:"async",pure:!1}]}],AsyncPipe.ctorParameters=[{type:n.ChangeDetectorRef}],AsyncPipe}()},function(e,t,r){"use strict";var n=r(0),i=r(255),o=r(22),a=r(51);r.d(t,"a",function(){return s});var s=function(){function DatePipe(e){this._locale=e}return DatePipe.prototype.transform=function(e,t){if(void 0===t&&(t="mediumDate"),r.i(o.b)(e))return null;if(!this.supports(e))throw new a.a(DatePipe,e);return o.g.isNumeric(e)&&(e=parseFloat(e)),i.a.format(new Date(e),this._locale,DatePipe._ALIASES[t]||t)},DatePipe.prototype.supports=function(e){return r.i(o.h)(e)||o.g.isNumeric(e)||"string"==typeof e&&r.i(o.h)(new Date(e))},DatePipe._ALIASES={medium:"yMMMdjms",short:"yMdjm",fullDate:"yMMMMEEEEd",longDate:"yMMMMd",mediumDate:"yMMMd",shortDate:"yMd",mediumTime:"jms",shortTime:"jm"},DatePipe.decorators=[{type:n.Pipe,args:[{name:"date",pure:!0}]}],DatePipe.ctorParameters=[{type:void 0,decorators:[{type:n.Inject,args:[n.LOCALE_ID]}]}],DatePipe}()},function(e,t,r){"use strict";var n=r(0),i=r(22),o=r(115),a=r(51);r.d(t,"a",function(){return u});var s=/#/g,u=function(){function I18nPluralPipe(e){this._localization=e}return I18nPluralPipe.prototype.transform=function(e,t){if(r.i(i.b)(e))return"";if("object"!=typeof t||null===t)throw new a.a(I18nPluralPipe,t);var n=r.i(o.a)(e,Object.keys(t),this._localization);return t[n].replace(s,e.toString())},I18nPluralPipe.decorators=[{type:n.Pipe,args:[{name:"i18nPlural",pure:!0}]}],I18nPluralPipe.ctorParameters=[{type:o.b}],I18nPluralPipe}()},function(e,t,r){"use strict";var n=r(0),i=r(22),o=r(51);r.d(t,"a",function(){return a});var a=function(){function I18nSelectPipe(){}return I18nSelectPipe.prototype.transform=function(e,t){if(r.i(i.b)(e))return"";if("object"!=typeof t||null===t)throw new o.a(I18nSelectPipe,t);return t[e]||""},I18nSelectPipe.decorators=[{type:n.Pipe,args:[{name:"i18nSelect",pure:!0}]}],I18nSelectPipe.ctorParameters=[],I18nSelectPipe}()},function(e,t,r){"use strict";var n=r(0);r.d(t,"a",function(){return i});var i=function(){function JsonPipe(){}return JsonPipe.prototype.transform=function(e){return JSON.stringify(e,null,2)},JsonPipe.decorators=[{type:n.Pipe,args:[{name:"json",pure:!1}]}],JsonPipe.ctorParameters=[],JsonPipe}()},function(e,t,r){"use strict";var n=r(0),i=r(22),o=r(51);r.d(t,"a",function(){return a});var a=function(){function LowerCasePipe(){}return LowerCasePipe.prototype.transform=function(e){if(r.i(i.b)(e))return e;if("string"!=typeof e)throw new o.a(LowerCasePipe,e);return e.toLowerCase()},LowerCasePipe.decorators=[{type:n.Pipe,args:[{name:"lowercase"}]}],LowerCasePipe.ctorParameters=[],LowerCasePipe}()},function(e,t,r){"use strict";function formatNumber(e,t,n,u,c,l,p){if(void 0===l&&(l=null),void 0===p&&(p=!1),r.i(o.b)(n))return null;if(n="string"==typeof n&&o.g.isNumeric(n)?+n:n,"number"!=typeof n)throw new a.a(e,n);var f,h,d;if(u!==i.b.Currency&&(f=1,h=0,d=3),c){var m=c.match(s);if(null===m)throw new Error(c+" is not a valid digit info for number pipes");r.i(o.a)(m[1])&&(f=o.g.parseIntAutoRadix(m[1])),r.i(o.a)(m[3])&&(h=o.g.parseIntAutoRadix(m[3])),r.i(o.a)(m[5])&&(d=o.g.parseIntAutoRadix(m[5]))}return i.c.format(n,t,u,{minimumIntegerDigits:f,minimumFractionDigits:h,maximumFractionDigits:d,currency:l,currencyAsSymbol:p})}var n=r(0),i=r(255),o=r(22),a=r(51);r.d(t,"a",function(){return u}),r.d(t,"b",function(){return c}),r.d(t,"c",function(){return l});var s=/^(\d+)?\.((\d+)(-(\d+))?)?$/,u=function(){function DecimalPipe(e){this._locale=e}return DecimalPipe.prototype.transform=function(e,t){return void 0===t&&(t=null),formatNumber(DecimalPipe,this._locale,e,i.b.Decimal,t)},DecimalPipe.decorators=[{type:n.Pipe,args:[{name:"number"}]}],DecimalPipe.ctorParameters=[{type:void 0,decorators:[{type:n.Inject,args:[n.LOCALE_ID]}]}],DecimalPipe}(),c=function(){function PercentPipe(e){this._locale=e}return PercentPipe.prototype.transform=function(e,t){return void 0===t&&(t=null),formatNumber(PercentPipe,this._locale,e,i.b.Percent,t)},PercentPipe.decorators=[{type:n.Pipe,args:[{name:"percent"}]}],PercentPipe.ctorParameters=[{type:void 0,decorators:[{type:n.Inject,args:[n.LOCALE_ID]}]}],PercentPipe}(),l=function(){function CurrencyPipe(e){this._locale=e}return CurrencyPipe.prototype.transform=function(e,t,r,n){return void 0===t&&(t="USD"),void 0===r&&(r=!1),void 0===n&&(n=null),formatNumber(CurrencyPipe,this._locale,e,i.b.Currency,n,t,r)},CurrencyPipe.decorators=[{type:n.Pipe,args:[{name:"currency"}]}],CurrencyPipe.ctorParameters=[{type:void 0,decorators:[{type:n.Inject,args:[n.LOCALE_ID]}]}],CurrencyPipe}()},function(e,t,r){"use strict";var n=r(0),i=r(22),o=r(51);r.d(t,"a",function(){return a});var a=function(){function SlicePipe(){}return SlicePipe.prototype.transform=function(e,t,n){if(r.i(i.b)(e))return e;if(!this.supports(e))throw new o.a(SlicePipe,e);return e.slice(t,n)},SlicePipe.prototype.supports=function(e){return"string"==typeof e||Array.isArray(e)},SlicePipe.decorators=[{type:n.Pipe,args:[{name:"slice",pure:!1}]}],SlicePipe.ctorParameters=[],SlicePipe}()},function(e,t,r){"use strict";var n=r(0),i=r(22),o=r(51);r.d(t,"a",function(){return a});var a=function(){function UpperCasePipe(){}return UpperCasePipe.prototype.transform=function(e){if(r.i(i.b)(e))return e;if("string"!=typeof e)throw new o.a(UpperCasePipe,e);return e.toUpperCase()},UpperCasePipe.decorators=[{type:n.Pipe,args:[{name:"uppercase"}]}],UpperCasePipe.ctorParameters=[],UpperCasePipe}()},function(e,t,r){"use strict";var n=r(0);r.d(t,"a",function(){return i});var i=n.__core_private__.isPromise},function(e,t,r){"use strict";var n=r(18),i=r(2);r.d(t,"a",function(){return a});var o=function(){function StylesCollectionEntry(e,t){this.time=e,this.value=t}return StylesCollectionEntry.prototype.matches=function(e,t){return e==this.time&&t==this.value},StylesCollectionEntry}(),a=function(){function StylesCollection(){this.styles={}}return StylesCollection.prototype.insertAtTime=function(e,t,a){var s=new o(t,a),u=this.styles[e];r.i(i.a)(u)||(u=this.styles[e]=[]);for(var c=0,l=u.length-1;l>=0;l--)if(u[l].time<=t){c=l+1;break}n.a.insert(u,c,s)},StylesCollection.prototype.getByIndex=function(e,t){var n=this.styles[e];return r.i(i.a)(n)?t>=n.length?null:n[t]:null},StylesCollection.prototype.indexOfAtOrBeforeTime=function(e,t){var n=this.styles[e];if(r.i(i.a)(n))for(var o=n.length-1;o>=0;o--)if(n[o].time<=t)return o;return null},StylesCollection}()},function(e,t,r){"use strict";function _initReflector(){v.A.reflectionCapabilities=new v.M}function _mergeOptions(e){return{useDebug:_lastDefined(e.map(function(e){return e.useDebug})),useJit:_lastDefined(e.map(function(e){return e.useJit})),defaultEncapsulation:_lastDefined(e.map(function(e){return e.defaultEncapsulation})),providers:_mergeArrays(e.map(function(e){return e.providers}))}}function _lastDefined(e){for(var t=e.length-1;t>=0;t--)if(void 0!==e[t])return e[t]}function _mergeArrays(e){var t=[];return e.forEach(function(e){return e&&t.push.apply(t,e)}),t}var n=r(0),i=r(74),o=r(162),a=r(163),s=r(118),u=r(119),c=r(120),l=r(264),p=r(167),f=r(121),h=r(169),d=r(170),m=r(172),v=r(14),y=r(173),g=r(275),_=r(276),b=r(90),w=r(175),C=r(122),E=r(91),S=r(123);r.d(t,"a",function(){return T});var A={get:function(e){throw new Error("No ResourceLoader implementation has been provided. Can't read the url \""+e+'"')}},P=[{provide:v.L,useValue:v.A},{provide:v.I,useExisting:v.L},{provide:y.a,useValue:A},v.B,u.c,c.a,f.b,{provide:l.a,useFactory:function(e,t,r){return new l.a(e,t,r)},deps:[f.b,[new n.Optional,new n.Inject(n.TRANSLATIONS)],[new n.Optional,new n.Inject(n.TRANSLATIONS_FORMAT)]]},C.a,o.a,p.a,E.c,w.a,S.d,h.a,s.a,{provide:i.a,useValue:new i.a},g.a,{provide:n.Compiler,useExisting:g.a},_.a,{provide:b.a,useExisting:_.a},E.a,a.a,m.a,d.a],x=function(){function RuntimeCompilerFactory(e){this._defaultOptions=[{useDebug:r.i(n.isDevMode)(),useJit:!0,defaultEncapsulation:n.ViewEncapsulation.Emulated}].concat(e)}return RuntimeCompilerFactory.prototype.createCompiler=function(e){void 0===e&&(e=[]);var t=_mergeOptions(this._defaultOptions.concat(e)),r=n.ReflectiveInjector.resolveAndCreate([P,{provide:i.a,useFactory:function(){return new i.a({genDebugInfo:t.useDebug,useJit:t.useJit,defaultEncapsulation:t.defaultEncapsulation,logBindingUpdate:t.useDebug})},deps:[]},t.providers]);return r.get(n.Compiler)},RuntimeCompilerFactory.decorators=[{type:n.Injectable}],RuntimeCompilerFactory.ctorParameters=[{type:Array,decorators:[{type:n.Inject,args:[n.COMPILER_OPTIONS]}]}],RuntimeCompilerFactory}(),T=r.i(n.createPlatformFactory)(n.platformCore,"coreDynamic",[{provide:n.COMPILER_OPTIONS,useValue:{},multi:!0},{provide:n.CompilerFactory,useClass:x},{provide:n.PLATFORM_INITIALIZER,useValue:_initReflector,multi:!0}])},function(e,t,r){"use strict";function createI18nMessageFactory(e){var t=new p(l,e);return function(e,r,n){return t.toI18nMessage(e,r,n)}}function _extractPlaceholderName(e){return e.split(f)[1]}var n=r(119),i=r(120),o=r(52),a=r(168),s=r(165),u=r(262),c=r(437);t.a=createI18nMessageFactory;var l=new i.a(new n.c),p=function(){function _I18nVisitor(e,t){this._expressionParser=e,this._interpolationConfig=t}return _I18nVisitor.prototype.toI18nMessage=function(e,t,r){this._isIcu=1==e.length&&e[0]instanceof o.b,this._icuDepth=0,this._placeholderRegistry=new c.a,this._placeholderToContent={},this._placeholderToIds={};var n=o.g(this,e,{});return new u.a(n,this._placeholderToContent,this._placeholderToIds,t,r)},_I18nVisitor.prototype.visitElement=function(e,t){var n=o.g(this,e.children),i={};e.attrs.forEach(function(e){i[e.name]=e.value});var s=r.i(a.a)(e.name).isVoid,c=this._placeholderRegistry.getStartTagPlaceholderName(e.name,i,s);this._placeholderToContent[c]=e.sourceSpan.toString();var l="";return s||(l=this._placeholderRegistry.getCloseTagPlaceholderName(e.name),this._placeholderToContent[l]="</"+e.name+">"),new u.b(e.name,i,c,l,n,s,e.sourceSpan)},_I18nVisitor.prototype.visitAttribute=function(e,t){return this._visitTextWithInterpolation(e.value,e.sourceSpan)},_I18nVisitor.prototype.visitText=function(e,t){return this._visitTextWithInterpolation(e.value,e.sourceSpan)},_I18nVisitor.prototype.visitComment=function(e,t){return null},_I18nVisitor.prototype.visitExpansion=function(e,t){var n=this;this._icuDepth++;var i={},o=new u.c(e.switchValue,e.type,i,e.sourceSpan);if(e.cases.forEach(function(e){i[e.value]=new u.d(e.expression.map(function(e){return e.visit(n,{})}),e.expSourceSpan)}),this._icuDepth--,this._isIcu||this._icuDepth>0)return o;var a=this._placeholderRegistry.getPlaceholderName("ICU",e.sourceSpan.toString()),c=new _I18nVisitor(this._expressionParser,this._interpolationConfig);return this._placeholderToIds[a]=r.i(s.a)(c.toI18nMessage([e],"","")),new u.e(o,a,e.sourceSpan)},_I18nVisitor.prototype.visitExpansionCase=function(e,t){throw new Error("Unreachable code")},_I18nVisitor.prototype._visitTextWithInterpolation=function(e,t){var r=this._expressionParser.splitInterpolation(e,t.start.toString(),this._interpolationConfig);if(!r)return new u.f(e,t);for(var n=[],i=new u.d(n,t),o=this._interpolationConfig,a=o.start,s=o.end,c=0;c<r.strings.length-1;c++){var l=r.expressions[c],p=_extractPlaceholderName(l)||"INTERPOLATION",f=this._placeholderRegistry.getPlaceholderName(p,l);r.strings[c].length&&n.push(new u.f(r.strings[c],t)),n.push(new u.g(l,f,t)),this._placeholderToContent[f]=a+l+s}var h=r.strings.length-1;return r.strings[h].length&&n.push(new u.f(r.strings[h],t)),i},_I18nVisitor}(),f=/\/\/[\s\S]*i18n[\s\S]*\([\s\S]*ph[\s\S]*=[\s\S]*"([\s\S]*?)"[\s\S]*\)/g},function(e,t,r){"use strict";r.d(t,"a",function(){return i});var n={A:"LINK",B:"BOLD_TEXT",BR:"LINE_BREAK",EM:"EMPHASISED_TEXT",H1:"HEADING_LEVEL1",H2:"HEADING_LEVEL2",H3:"HEADING_LEVEL3",H4:"HEADING_LEVEL4",H5:"HEADING_LEVEL5",H6:"HEADING_LEVEL6",HR:"HORIZONTAL_RULE",I:"ITALIC_TEXT",LI:"LIST_ITEM",LINK:"MEDIA_LINK",OL:"ORDERED_LIST",P:"PARAGRAPH",Q:"QUOTATION",S:"STRIKETHROUGH_TEXT",SMALL:"SMALL_TEXT",SUB:"SUBSTRIPT",SUP:"SUPERSCRIPT",TBODY:"TABLE_BODY",TD:"TABLE_CELL",TFOOT:"TABLE_FOOTER",TH:"TABLE_HEADER_CELL",THEAD:"TABLE_HEADER",TR:"TABLE_ROW",TT:"MONOSPACED_TEXT",U:"UNDERLINED_TEXT",UL:"UNORDERED_LIST"},i=function(){function PlaceholderRegistry(){this._placeHolderNameCounts={},this._signatureToName={}}return PlaceholderRegistry.prototype.getStartTagPlaceholderName=function(e,t,r){var i=this._hashTag(e,t,r);if(this._signatureToName[i])return this._signatureToName[i];var o=e.toUpperCase(),a=n[o]||"TAG_"+o,s=this._generateUniqueName(r?a:"START_"+a);return this._signatureToName[i]=s,s},PlaceholderRegistry.prototype.getCloseTagPlaceholderName=function(e){var t=this._hashClosingTag(e);if(this._signatureToName[t])return this._signatureToName[t];var r=e.toUpperCase(),i=n[r]||"TAG_"+r,o=this._generateUniqueName("CLOSE_"+i);return this._signatureToName[t]=o,o},PlaceholderRegistry.prototype.getPlaceholderName=function(e,t){var r=e.toUpperCase(),n="PH: "+r+"="+t;if(this._signatureToName[n])return this._signatureToName[n];var i=this._generateUniqueName(r);return this._signatureToName[n]=i,i},PlaceholderRegistry.prototype._hashTag=function(e,t,r){var n="<"+e,i=Object.keys(t).sort().map(function(e){return" "+e+"="+t[e]}).join(""),o=r?"/>":"></"+e+">";return n+i+o},PlaceholderRegistry.prototype._hashClosingTag=function(e){return this._hashTag("/"+e,{},!1)},PlaceholderRegistry.prototype._generateUniqueName=function(e){var t=e,r=this._placeHolderNameCounts[t];return r?(t+="_"+r,r++):r=1,this._placeHolderNameCounts[e]=r,t},PlaceholderRegistry}()},function(e,t,r){"use strict";r.d(t,"a",function(){return n});var n=function(){function TranslationBundle(e){void 0===e&&(e={}),this._messageMap=e}return TranslationBundle.load=function(e,t,r,n){return new TranslationBundle(n.load(e,t,r))},TranslationBundle.prototype.get=function(e){return this._messageMap[e]},TranslationBundle.prototype.has=function(e){return e in this._messageMap},TranslationBundle}()},function(e,t,r){"use strict";function hasLifecycleHook(e,t){return n.A.hasLifecycleHook(t,getHookName(e))}function getHookName(e){switch(e){case n.G.OnInit:return"ngOnInit";case n.G.OnDestroy:return"ngOnDestroy";case n.G.DoCheck:return"ngDoCheck";case n.G.OnChanges:return"ngOnChanges";case n.G.AfterContentInit:return"ngAfterContentInit";case n.G.AfterContentChecked:return"ngAfterContentChecked";case n.G.AfterViewInit:return"ngAfterViewInit";case n.G.AfterViewChecked:return"ngAfterViewChecked"}}var n=r(14);t.a=hasLifecycleHook},function(e,t,r){"use strict";function expandNodes(e){var t=new c;return new s(i.g(t,e),t.isExpanded,t.errors)}function _expandPluralForm(e,t){var r=e.cases.map(function(e){a.indexOf(e.value)!=-1||e.value.match(/^=\d+$/)||t.push(new u(e.valueSourceSpan,'Plural cases should be "=<number>" or one of '+a.join(", ")));var r=expandNodes(e.expression);return t.push.apply(t,r.errors),new i.e("template",[new i.f("ngPluralCase",""+e.value,e.valueSourceSpan)],r.nodes,e.sourceSpan,e.sourceSpan,e.sourceSpan)}),n=new i.f("[ngPlural]",e.switchValue,e.switchValueSourceSpan);return new i.e("ng-container",[n],r,e.sourceSpan,e.sourceSpan,e.sourceSpan)}function _expandDefaultForm(e,t){var r=e.cases.map(function(e){var r=expandNodes(e.expression);return t.push.apply(t,r.errors),new i.e("template",[new i.f("ngSwitchCase",""+e.value,e.valueSourceSpan)],r.nodes,e.sourceSpan,e.sourceSpan,e.sourceSpan)}),n=new i.f("[ngSwitch]",e.switchValue,e.switchValueSourceSpan);return new i.e("ng-container",[n],r,e.sourceSpan,e.sourceSpan,e.sourceSpan)}var n=r(42),i=r(52);t.a=expandNodes;var o=this&&this.__extends||function(e,t){function __(){this.constructor=e}for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r]);e.prototype=null===t?Object.create(t):(__.prototype=t.prototype,new __)},a=["zero","one","two","few","many","other"],s=function(){function ExpansionResult(e,t,r){this.nodes=e,this.expanded=t,this.errors=r}return ExpansionResult}(),u=function(e){function ExpansionError(t,r){e.call(this,t,r)}return o(ExpansionError,e),ExpansionError}(n.a),c=function(){function _Expander(){this.isExpanded=!1,this.errors=[]}return _Expander.prototype.visitElement=function(e,t){return new i.e(e.name,e.attrs,i.g(this,e.children),e.sourceSpan,e.startSourceSpan,e.endSourceSpan)},_Expander.prototype.visitAttribute=function(e,t){return e},_Expander.prototype.visitText=function(e,t){return e},_Expander.prototype.visitComment=function(e,t){return e},_Expander.prototype.visitExpansion=function(e,t){return this.isExpanded=!0,"plural"==e.type?_expandPluralForm(e,this.errors):_expandDefaultForm(e,this.errors)},_Expander.prototype.visitExpansionCase=function(e,t){throw new Error("Should not be reached")},_Expander}()},function(e,t,r){"use strict";function tokenize(e,t,r,n,a){return void 0===n&&(n=!1),void 0===a&&(a=o.a),new d(new i.b(e,t),r,n,a).tokenize()}function _unexpectedCharacterErrorMsg(e){var t=e===n.a?"EOF":String.fromCharCode(e);return'Unexpected character "'+t+'"'}function _unknownEntityErrorMsg(e){return'Unknown entity "'+e+'" - use the "&#<decimal>;" or "&#x<hex>;" syntax'}function isNotWhitespace(e){return!n.E(e)||e===n.a}function isNameEnd(e){return n.E(e)||e===n.y||e===n.t||e===n.n||e===n.o||e===n.z}function isPrefixEnd(e){return(e<n.H||n.I<e)&&(e<n.J||n.K<e)&&(e<n._3||e>n._4)}function isDigitEntityEnd(e){return e==n.m||e==n.a||!n._5(e)}function isNamedEntityEnd(e){return e==n.m||e==n.a||!n.N(e)}function isExpansionFormStart(e,t,r){var i=!!r&&e.indexOf(r.start,t)==t;return e.charCodeAt(t)==n.g&&!i}function isExpansionCaseStart(e){return e===n.z||n.N(e)}function compareCharCodeCaseInsensitive(e,t){return toUpperCaseCharCode(e)==toUpperCaseCharCode(t)}function toUpperCaseCharCode(e){return e>=n.H&&e<=n.I?e-n.H+n.J:e}function mergeTextTokens(e){for(var t,r=[],n=0;n<e.length;n++){var i=e[n];t&&t.type==s.TEXT&&i.type==s.TEXT?(t.parts[0]+=i.parts[0],t.sourceSpan.end=i.sourceSpan.end):(t=i,r.push(t))}return r}var n=r(161),i=r(42),o=r(41),a=r(76);r.d(t,"b",function(){return s}),r.d(t,"c",function(){return c}),t.a=tokenize;var s,u=this&&this.__extends||function(e,t){function __(){this.constructor=e}for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r]);e.prototype=null===t?Object.create(t):(__.prototype=t.prototype,new __)};!function(e){e[e.TAG_OPEN_START=0]="TAG_OPEN_START",e[e.TAG_OPEN_END=1]="TAG_OPEN_END",e[e.TAG_OPEN_END_VOID=2]="TAG_OPEN_END_VOID",e[e.TAG_CLOSE=3]="TAG_CLOSE",e[e.TEXT=4]="TEXT",e[e.ESCAPABLE_RAW_TEXT=5]="ESCAPABLE_RAW_TEXT",e[e.RAW_TEXT=6]="RAW_TEXT",e[e.COMMENT_START=7]="COMMENT_START",e[e.COMMENT_END=8]="COMMENT_END",e[e.CDATA_START=9]="CDATA_START",e[e.CDATA_END=10]="CDATA_END",e[e.ATTR_NAME=11]="ATTR_NAME",e[e.ATTR_VALUE=12]="ATTR_VALUE",e[e.DOC_TYPE=13]="DOC_TYPE",e[e.EXPANSION_FORM_START=14]="EXPANSION_FORM_START",e[e.EXPANSION_CASE_VALUE=15]="EXPANSION_CASE_VALUE",e[e.EXPANSION_CASE_EXP_START=16]="EXPANSION_CASE_EXP_START",e[e.EXPANSION_CASE_EXP_END=17]="EXPANSION_CASE_EXP_END",e[e.EXPANSION_FORM_END=18]="EXPANSION_FORM_END",e[e.EOF=19]="EOF"}(s||(s={}));var c=function(){function Token(e,t,r){this.type=e,this.parts=t,this.sourceSpan=r}return Token}(),l=function(e){function TokenError(t,r,n){e.call(this,n,t),this.tokenType=r}return u(TokenError,e),TokenError}(i.a),p=function(){function TokenizeResult(e,t){this.tokens=e,this.errors=t}return TokenizeResult}(),f=/\r\n?/g,h=function(){function _ControlFlowError(e){this.error=e}return _ControlFlowError}(),d=function(){function _Tokenizer(e,t,r,n){void 0===n&&(n=o.a),this._file=e,this._getTagDefinition=t,this._tokenizeIcu=r,this._interpolationConfig=n,this._peek=-1,this._nextPeek=-1,this._index=-1,this._line=0,this._column=-1,this._expansionCaseStack=[],this._inInterpolation=!1,this.tokens=[],this.errors=[],this._input=e.content,this._length=e.content.length,this._advance()}return _Tokenizer.prototype._processCarriageReturns=function(e){return e.replace(f,"\n")},_Tokenizer.prototype.tokenize=function(){for(;this._peek!==n.a;){var e=this._getLocation();try{this._attemptCharCode(n.x)?this._attemptCharCode(n.A)?this._attemptCharCode(n.i)?this._consumeCdata(e):this._attemptCharCode(n.r)?this._consumeComment(e):this._consumeDocType(e):this._attemptCharCode(n.t)?this._consumeTagClose(e):this._consumeTagOpen(e):this._tokenizeIcu&&this._tokenizeExpansionForm()||this._consumeText()}catch(e){if(!(e instanceof h))throw e;this.errors.push(e.error)}}return this._beginToken(s.EOF),this._endToken([]),new p(mergeTextTokens(this.tokens),this.errors)},_Tokenizer.prototype._tokenizeExpansionForm=function(){if(isExpansionFormStart(this._input,this._index,this._interpolationConfig))return this._consumeExpansionFormStart(),!0;if(isExpansionCaseStart(this._peek)&&this._isInExpansionForm())return this._consumeExpansionCaseStart(),!0;if(this._peek===n.h){if(this._isInExpansionCase())return this._consumeExpansionCaseEnd(),!0;if(this._isInExpansionForm())return this._consumeExpansionFormEnd(),!0}return!1},_Tokenizer.prototype._getLocation=function(){return new i.c(this._file,this._index,this._line,this._column)},_Tokenizer.prototype._getSpan=function(e,t){return void 0===e&&(e=this._getLocation()),void 0===t&&(t=this._getLocation()),new i.d(e,t)},_Tokenizer.prototype._beginToken=function(e,t){void 0===t&&(t=this._getLocation()),this._currentTokenStart=t,this._currentTokenType=e},_Tokenizer.prototype._endToken=function(e,t){void 0===t&&(t=this._getLocation());var r=new c(this._currentTokenType,e,new i.d(this._currentTokenStart,t));return this.tokens.push(r),this._currentTokenStart=null,this._currentTokenType=null,r},_Tokenizer.prototype._createError=function(e,t){this._isInExpansionForm()&&(e+=' (Do you have an unescaped "{" in your template? Use "{{ \'{\' }}") to escape it.)');var r=new l(e,this._currentTokenType,t);return this._currentTokenStart=null,this._currentTokenType=null,new h(r)},_Tokenizer.prototype._advance=function(){if(this._index>=this._length)throw this._createError(_unexpectedCharacterErrorMsg(n.a),this._getSpan());this._peek===n.S?(this._line++,this._column=0):this._peek!==n.S&&this._peek!==n.W&&this._column++,this._index++,this._peek=this._index>=this._length?n.a:this._input.charCodeAt(this._index),this._nextPeek=this._index+1>=this._length?n.a:this._input.charCodeAt(this._index+1)},_Tokenizer.prototype._attemptCharCode=function(e){return this._peek===e&&(this._advance(),!0)},_Tokenizer.prototype._attemptCharCodeCaseInsensitive=function(e){return!!compareCharCodeCaseInsensitive(this._peek,e)&&(this._advance(),!0)},_Tokenizer.prototype._requireCharCode=function(e){var t=this._getLocation();if(!this._attemptCharCode(e))throw this._createError(_unexpectedCharacterErrorMsg(this._peek),this._getSpan(t,t))},_Tokenizer.prototype._attemptStr=function(e){var t=e.length;if(this._index+t>this._length)return!1;for(var r=this._savePosition(),n=0;n<t;n++)if(!this._attemptCharCode(e.charCodeAt(n)))return this._restorePosition(r),!1;return!0},_Tokenizer.prototype._attemptStrCaseInsensitive=function(e){for(var t=0;t<e.length;t++)if(!this._attemptCharCodeCaseInsensitive(e.charCodeAt(t)))return!1;return!0},_Tokenizer.prototype._requireStr=function(e){var t=this._getLocation();if(!this._attemptStr(e))throw this._createError(_unexpectedCharacterErrorMsg(this._peek),this._getSpan(t))},_Tokenizer.prototype._attemptCharCodeUntilFn=function(e){for(;!e(this._peek);)this._advance()},_Tokenizer.prototype._requireCharCodeUntilFn=function(e,t){var r=this._getLocation();if(this._attemptCharCodeUntilFn(e),this._index-r.offset<t)throw this._createError(_unexpectedCharacterErrorMsg(this._peek),this._getSpan(r,r))},_Tokenizer.prototype._attemptUntilChar=function(e){for(;this._peek!==e;)this._advance()},_Tokenizer.prototype._readChar=function(e){if(e&&this._peek===n.B)return this._decodeEntity();var t=this._index;return this._advance(),this._input[t]},_Tokenizer.prototype._decodeEntity=function(){var e=this._getLocation();if(this._advance(),!this._attemptCharCode(n.p)){var t=this._savePosition();if(this._attemptCharCodeUntilFn(isNamedEntityEnd),this._peek!=n.m)return this._restorePosition(t),"&";this._advance();var r=this._input.substring(e.offset+1,this._index-1),i=a.b[r];if(!i)throw this._createError(_unknownEntityErrorMsg(r),this._getSpan(e));return i}var o=this._attemptCharCode(n._1)||this._attemptCharCode(n._2),s=this._getLocation().offset;if(this._attemptCharCodeUntilFn(isDigitEntityEnd),this._peek!=n.m)throw this._createError(_unexpectedCharacterErrorMsg(this._peek),this._getSpan());this._advance();var u=this._input.substring(s,this._index-1);try{var c=parseInt(u,o?16:10);return String.fromCharCode(c)}catch(t){var l=this._input.substring(e.offset+1,this._index-1);throw this._createError(_unknownEntityErrorMsg(l),this._getSpan(e))}},_Tokenizer.prototype._consumeRawText=function(e,t,r){var n,i=this._getLocation();this._beginToken(e?s.ESCAPABLE_RAW_TEXT:s.RAW_TEXT,i);for(var o=[];;){if(n=this._getLocation(),this._attemptCharCode(t)&&r())break;for(this._index>n.offset&&o.push(this._input.substring(n.offset,this._index));this._peek!==t;)o.push(this._readChar(e)); }return this._endToken([this._processCarriageReturns(o.join(""))],n)},_Tokenizer.prototype._consumeComment=function(e){var t=this;this._beginToken(s.COMMENT_START,e),this._requireCharCode(n.r),this._endToken([]);var r=this._consumeRawText(!1,n.r,function(){return t._attemptStr("->")});this._beginToken(s.COMMENT_END,r.sourceSpan.end),this._endToken([])},_Tokenizer.prototype._consumeCdata=function(e){var t=this;this._beginToken(s.CDATA_START,e),this._requireStr("CDATA["),this._endToken([]);var r=this._consumeRawText(!1,n.j,function(){return t._attemptStr("]>")});this._beginToken(s.CDATA_END,r.sourceSpan.end),this._endToken([])},_Tokenizer.prototype._consumeDocType=function(e){this._beginToken(s.DOC_TYPE,e),this._attemptUntilChar(n.y),this._advance(),this._endToken([this._input.substring(e.offset+2,this._index-1)])},_Tokenizer.prototype._consumePrefixAndName=function(){for(var e=this._index,t=null;this._peek!==n.l&&!isPrefixEnd(this._peek);)this._advance();var r;this._peek===n.l?(this._advance(),t=this._input.substring(e,this._index-1),r=this._index):r=e,this._requireCharCodeUntilFn(isNameEnd,this._index===r?1:0);var i=this._input.substring(r,this._index);return[t,i]},_Tokenizer.prototype._consumeTagOpen=function(e){var t,r,i=this._savePosition();try{if(!n.N(this._peek))throw this._createError(_unexpectedCharacterErrorMsg(this._peek),this._getSpan());var o=this._index;for(this._consumeTagOpenStart(e),t=this._input.substring(o,this._index),r=t.toLowerCase(),this._attemptCharCodeUntilFn(isNotWhitespace);this._peek!==n.t&&this._peek!==n.y;)this._consumeAttributeName(),this._attemptCharCodeUntilFn(isNotWhitespace),this._attemptCharCode(n.z)&&(this._attemptCharCodeUntilFn(isNotWhitespace),this._consumeAttributeValue()),this._attemptCharCodeUntilFn(isNotWhitespace);this._consumeTagOpenEnd()}catch(t){if(t instanceof h)return this._restorePosition(i),this._beginToken(s.TEXT,e),void this._endToken(["<"]);throw t}var u=this._getTagDefinition(t).contentType;u===a.a.RAW_TEXT?this._consumeRawTextWithTagClose(r,!1):u===a.a.ESCAPABLE_RAW_TEXT&&this._consumeRawTextWithTagClose(r,!0)},_Tokenizer.prototype._consumeRawTextWithTagClose=function(e,t){var r=this,i=this._consumeRawText(t,n.x,function(){return!!r._attemptCharCode(n.t)&&(r._attemptCharCodeUntilFn(isNotWhitespace),!!r._attemptStrCaseInsensitive(e)&&(r._attemptCharCodeUntilFn(isNotWhitespace),r._attemptCharCode(n.y)))});this._beginToken(s.TAG_CLOSE,i.sourceSpan.end),this._endToken([null,e])},_Tokenizer.prototype._consumeTagOpenStart=function(e){this._beginToken(s.TAG_OPEN_START,e);var t=this._consumePrefixAndName();this._endToken(t)},_Tokenizer.prototype._consumeAttributeName=function(){this._beginToken(s.ATTR_NAME);var e=this._consumePrefixAndName();this._endToken(e)},_Tokenizer.prototype._consumeAttributeValue=function(){this._beginToken(s.ATTR_VALUE);var e;if(this._peek===n.n||this._peek===n.o){var t=this._peek;this._advance();for(var r=[];this._peek!==t;)r.push(this._readChar(!0));e=r.join(""),this._advance()}else{var i=this._index;this._requireCharCodeUntilFn(isNameEnd,1),e=this._input.substring(i,this._index)}this._endToken([this._processCarriageReturns(e)])},_Tokenizer.prototype._consumeTagOpenEnd=function(){var e=this._attemptCharCode(n.t)?s.TAG_OPEN_END_VOID:s.TAG_OPEN_END;this._beginToken(e),this._requireCharCode(n.y),this._endToken([])},_Tokenizer.prototype._consumeTagClose=function(e){this._beginToken(s.TAG_CLOSE,e),this._attemptCharCodeUntilFn(isNotWhitespace);var t=this._consumePrefixAndName();this._attemptCharCodeUntilFn(isNotWhitespace),this._requireCharCode(n.y),this._endToken(t)},_Tokenizer.prototype._consumeExpansionFormStart=function(){this._beginToken(s.EXPANSION_FORM_START,this._getLocation()),this._requireCharCode(n.g),this._endToken([]),this._expansionCaseStack.push(s.EXPANSION_FORM_START),this._beginToken(s.RAW_TEXT,this._getLocation());var e=this._readUntil(n.k);this._endToken([e],this._getLocation()),this._requireCharCode(n.k),this._attemptCharCodeUntilFn(isNotWhitespace),this._beginToken(s.RAW_TEXT,this._getLocation());var t=this._readUntil(n.k);this._endToken([t],this._getLocation()),this._requireCharCode(n.k),this._attemptCharCodeUntilFn(isNotWhitespace)},_Tokenizer.prototype._consumeExpansionCaseStart=function(){this._beginToken(s.EXPANSION_CASE_VALUE,this._getLocation());var e=this._readUntil(n.g).trim();this._endToken([e],this._getLocation()),this._attemptCharCodeUntilFn(isNotWhitespace),this._beginToken(s.EXPANSION_CASE_EXP_START,this._getLocation()),this._requireCharCode(n.g),this._endToken([],this._getLocation()),this._attemptCharCodeUntilFn(isNotWhitespace),this._expansionCaseStack.push(s.EXPANSION_CASE_EXP_START)},_Tokenizer.prototype._consumeExpansionCaseEnd=function(){this._beginToken(s.EXPANSION_CASE_EXP_END,this._getLocation()),this._requireCharCode(n.h),this._endToken([],this._getLocation()),this._attemptCharCodeUntilFn(isNotWhitespace),this._expansionCaseStack.pop()},_Tokenizer.prototype._consumeExpansionFormEnd=function(){this._beginToken(s.EXPANSION_FORM_END,this._getLocation()),this._requireCharCode(n.h),this._endToken([]),this._expansionCaseStack.pop()},_Tokenizer.prototype._consumeText=function(){var e=this._getLocation();this._beginToken(s.TEXT,e);var t=[];do this._interpolationConfig&&this._attemptStr(this._interpolationConfig.start)?(t.push(this._interpolationConfig.start),this._inInterpolation=!0):this._interpolationConfig&&this._attemptStr(this._interpolationConfig.end)&&this._inInterpolation?(t.push(this._interpolationConfig.end),this._inInterpolation=!1):t.push(this._readChar(!0));while(!this._isTextEnd());this._endToken([this._processCarriageReturns(t.join(""))])},_Tokenizer.prototype._isTextEnd=function(){if(this._peek===n.x||this._peek===n.a)return!0;if(this._tokenizeIcu&&!this._inInterpolation){if(isExpansionFormStart(this._input,this._index,this._interpolationConfig))return!0;if(this._peek===n.h&&this._isInExpansionCase())return!0}return!1},_Tokenizer.prototype._savePosition=function(){return[this._peek,this._index,this._column,this._line,this.tokens.length]},_Tokenizer.prototype._readUntil=function(e){var t=this._index;return this._attemptUntilChar(e),this._input.substring(t,this._index)},_Tokenizer.prototype._restorePosition=function(e){this._peek=e[0],this._index=e[1],this._column=e[2],this._line=e[3];var t=e[4];t<this.tokens.length&&(this.tokens=this.tokens.slice(0,t))},_Tokenizer.prototype._isInExpansionCase=function(){return this._expansionCaseStack.length>0&&this._expansionCaseStack[this._expansionCaseStack.length-1]===s.EXPANSION_CASE_EXP_START},_Tokenizer.prototype._isInExpansionForm=function(){return this._expansionCaseStack.length>0&&this._expansionCaseStack[this._expansionCaseStack.length-1]===s.EXPANSION_FORM_START},_Tokenizer}()},function(e,t,r){"use strict";function getXmlTagDefinition(e){return o}var n=r(76);t.a=getXmlTagDefinition;var i=function(){function XmlTagDefinition(){this.closedByParent=!1,this.contentType=n.a.PARSABLE_DATA,this.isVoid=!1,this.ignoreFirstLf=!1,this.canSelfClose=!0}return XmlTagDefinition.prototype.requireExtraParent=function(e){return!1},XmlTagDefinition.prototype.isClosedByChild=function(e){return!1},XmlTagDefinition}(),o=new i},function(e,t,r){"use strict";function analyzeModules(e,t){var r=new Map,n=[];return e.forEach(function(e){var i=t.getNgModuleMetadata(e);n.push(i),i.declaredDirectives.forEach(function(e){r.set(e.type.reference,i)})}),new l(r,n)}function _resolveViewStatements(e){return e.dependencies.forEach(function(e){if(e instanceof u.a){var t=e;t.placeholder.moduleUrl=_ngfactoryModuleUrl(t.comp.moduleUrl)}else if(e instanceof u.b){var r=e;r.placeholder.name=_componentFactoryName(r.comp),r.placeholder.moduleUrl=_ngfactoryModuleUrl(r.comp.moduleUrl)}else if(e instanceof u.c){var n=e;n.placeholder.moduleUrl=_ngfactoryModuleUrl(n.dir.moduleUrl)}}),e.statements}function _resolveStyleStatements(e,t){return e.dependencies.forEach(function(e){e.valuePlaceholder.moduleUrl=_stylesModuleUrl(e.moduleUrl,e.isShimmed,t)}),e.statements}function _ngfactoryModuleUrl(e){var t=_splitTypescriptSuffix(e);return t[0]+".ngfactory"+t[1]}function _componentFactoryName(e){return e.name+"NgFactory"}function _stylesModuleUrl(e,t,r){return t?e+".shim"+r:""+e+r}function _assertComponent(e){if(!e.isComponent)throw new Error("Could not compile '"+e.type.name+"' because it is not a component.")}function _splitTypescriptSuffix(e){if(e.endsWith(".d.ts"))return[e.slice(0,-5),".ts"];var t=e.lastIndexOf(".");return t!==-1?[e.substring(0,t),e.substring(t)]:[e,""]}var n=r(258),i=r(259),o=r(17),a=r(13),s=r(8),u=r(123),c=function(){function SourceModule(e,t){this.moduleUrl=e,this.source=t}return SourceModule}(),l=function(){function NgModulesSummary(e,t){this.ngModuleByDirective=e,this.ngModules=t}return NgModulesSummary}();(function(){function OfflineCompiler(e,t,r,o,a,s,u,c,l,p){this._metadataResolver=e,this._directiveNormalizer=t,this._templateParser=r,this._styleCompiler=o,this._viewCompiler=a,this._dirWrapperCompiler=s,this._ngModuleCompiler=u,this._outputEmitter=c,this._localeId=l,this._translationFormat=p,this._animationParser=new i.a,this._animationCompiler=new n.a}return OfflineCompiler.prototype.analyzeModules=function(e){return analyzeModules(e,this._metadataResolver)},OfflineCompiler.prototype.clearCache=function(){this._directiveNormalizer.clearCache(),this._metadataResolver.clearCache()},OfflineCompiler.prototype.compile=function(e,t,r,n){var i=this,o=_splitTypescriptSuffix(e)[1],a=[],s=[],u=[];return s.push.apply(s,n.map(function(e){return i._compileModule(e,a)})),s.push.apply(s,r.map(function(e){return i._compileDirectiveWrapper(e,a)})),Promise.all(r.map(function(e){var r=i._metadataResolver.getDirectiveMetadata(e);if(!r.isComponent)return Promise.resolve(null);var n=t.ngModuleByDirective.get(e);if(!n)throw new Error("Cannot determine the module for component "+r.type.name+"!");return Promise.all([r].concat(n.transitiveModule.directives).map(function(e){return i._directiveNormalizer.normalizeDirective(e).asyncResult})).then(function(e){var t=e[0],r=e.slice(1);_assertComponent(t);var c=i._styleCompiler.compileComponent(t);c.externalStylesheets.forEach(function(e){u.push(i._codgenStyles(e,o))}),s.push(i._compileComponentFactory(t,o,a),i._compileComponent(t,r,n.transitiveModule.pipes,n.schemas,c.componentStylesheet,o,a))})})).then(function(){return a.length>0&&u.unshift(i._codegenSourceModule(_ngfactoryModuleUrl(e),a,s)),u})},OfflineCompiler.prototype._compileModule=function(e,t){var n=this._metadataResolver.getNgModuleMetadata(e),i=[];this._localeId&&i.push(new o.d({token:r.i(a.a)(a.b.LOCALE_ID),useValue:this._localeId})),this._translationFormat&&i.push(new o.d({token:r.i(a.a)(a.b.TRANSLATIONS_FORMAT),useValue:this._translationFormat}));var s=this._ngModuleCompiler.compile(n,i);return s.dependencies.forEach(function(e){e.placeholder.name=_componentFactoryName(e.comp),e.placeholder.moduleUrl=_ngfactoryModuleUrl(e.comp.moduleUrl)}),t.push.apply(t,s.statements),s.ngModuleFactoryVar},OfflineCompiler.prototype._compileDirectiveWrapper=function(e,t){var r=this._metadataResolver.getDirectiveMetadata(e),n=this._dirWrapperCompiler.compile(r);return t.push.apply(t,n.statements),n.dirWrapperClassVar},OfflineCompiler.prototype._compileComponentFactory=function(e,t,n){var i=r.i(o.n)(e),u=this._compileComponent(i,[e],[],[],null,t,n),c=_componentFactoryName(e.type);return n.push(s.e(c).set(s.b(r.i(a.d)(a.b.ComponentFactory),[s.c(e.type)]).instantiate([s.a(e.selector),s.e(u),s.b(e.type)],s.c(r.i(a.d)(a.b.ComponentFactory),[s.c(e.type)],[s.d.Const]))).toDeclStmt(null,[s.r.Final])),c},OfflineCompiler.prototype._compileComponent=function(e,t,r,n,i,o,a){var u=this._animationParser.parseComponent(e),c=this._templateParser.parse(e,e.template.template,t,r,n,e.type.name),l=i?s.e(i.stylesVar):s.g([]),p=this._animationCompiler.compile(e.type.name,u),f=this._viewCompiler.compileComponent(e,c,l,r,p);return i&&a.push.apply(a,_resolveStyleStatements(i,o)),p.forEach(function(e){e.statements.forEach(function(e){a.push(e)})}),a.push.apply(a,_resolveViewStatements(f)),f.viewFactoryVar},OfflineCompiler.prototype._codgenStyles=function(e,t){return _resolveStyleStatements(e,t),this._codegenSourceModule(_stylesModuleUrl(e.meta.moduleUrl,e.isShimmed,t),e.statements,[e.stylesVar])},OfflineCompiler.prototype._codegenSourceModule=function(e,t,r){return new c(e,this._outputEmitter.emitStatements(e,t,r))},OfflineCompiler})()},function(e,t,r){"use strict";var n=r(2),i=r(171),o=r(8);r.d(t,"a",function(){return s});var a=this&&this.__extends||function(e,t){function __(){this.constructor=e}for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r]);e.prototype=null===t?Object.create(t):(__.prototype=t.prototype,new __)},s=function(e){function AbstractJsEmitterVisitor(){e.call(this,!1)}return a(AbstractJsEmitterVisitor,e),AbstractJsEmitterVisitor.prototype.visitDeclareClassStmt=function(e,t){var i=this;return t.pushClass(e),this._visitClassConstructor(e,t),r.i(n.a)(e.parent)&&(t.print(e.name+".prototype = Object.create("),e.parent.visitExpression(this,t),t.println(".prototype);")),e.getters.forEach(function(r){return i._visitClassGetter(e,r,t)}),e.methods.forEach(function(r){return i._visitClassMethod(e,r,t)}),t.popClass(),null},AbstractJsEmitterVisitor.prototype._visitClassConstructor=function(e,t){t.print("function "+e.name+"("),r.i(n.a)(e.constructorMethod)&&this._visitParams(e.constructorMethod.params,t),t.println(") {"),t.incIndent(),r.i(n.a)(e.constructorMethod)&&e.constructorMethod.body.length>0&&(t.println("var self = this;"),this.visitAllStatements(e.constructorMethod.body,t)),t.decIndent(),t.println("}")},AbstractJsEmitterVisitor.prototype._visitClassGetter=function(e,t,r){r.println("Object.defineProperty("+e.name+".prototype, '"+t.name+"', { get: function() {"),r.incIndent(),t.body.length>0&&(r.println("var self = this;"),this.visitAllStatements(t.body,r)),r.decIndent(),r.println("}});")},AbstractJsEmitterVisitor.prototype._visitClassMethod=function(e,t,r){r.print(e.name+".prototype."+t.name+" = function("),this._visitParams(t.params,r),r.println(") {"),r.incIndent(),t.body.length>0&&(r.println("var self = this;"),this.visitAllStatements(t.body,r)),r.decIndent(),r.println("};")},AbstractJsEmitterVisitor.prototype.visitReadVarExpr=function(t,r){if(t.builtin===o.y.This)r.print("self");else{if(t.builtin===o.y.Super)throw new Error("'super' needs to be handled at a parent ast node, not at the variable level!");e.prototype.visitReadVarExpr.call(this,t,r)}return null},AbstractJsEmitterVisitor.prototype.visitDeclareVarStmt=function(e,t){return t.print("var "+e.name+" = "),e.value.visitExpression(this,t),t.println(";"),null},AbstractJsEmitterVisitor.prototype.visitCastExpr=function(e,t){return e.value.visitExpression(this,t),null},AbstractJsEmitterVisitor.prototype.visitInvokeFunctionExpr=function(t,r){var n=t.fn;return n instanceof o.x&&n.builtin===o.y.Super?(r.currentClass.parent.visitExpression(this,r),r.print(".call(this"),t.args.length>0&&(r.print(", "),this.visitAllExpressions(t.args,r,",")),r.print(")")):e.prototype.visitInvokeFunctionExpr.call(this,t,r),null},AbstractJsEmitterVisitor.prototype.visitFunctionExpr=function(e,t){return t.print("function("),this._visitParams(e.params,t),t.println(") {"),t.incIndent(),this.visitAllStatements(e.statements,t),t.decIndent(),t.print("}"),null},AbstractJsEmitterVisitor.prototype.visitDeclareFunctionStmt=function(e,t){return t.print("function "+e.name+"("),this._visitParams(e.params,t),t.println(") {"),t.incIndent(),this.visitAllStatements(e.statements,t),t.decIndent(),t.println("}"),null},AbstractJsEmitterVisitor.prototype.visitTryCatchStmt=function(e,t){t.println("try {"),t.incIndent(),this.visitAllStatements(e.bodyStmts,t),t.decIndent(),t.println("} catch ("+i.b.name+") {"),t.incIndent();var r=[i.c.set(i.b.prop("stack")).toDeclStmt(null,[o.r.Final])].concat(e.catchStmts);return this.visitAllStatements(r,t),t.decIndent(),t.println("}"),null},AbstractJsEmitterVisitor.prototype._visitParams=function(e,t){this.visitAllObjects(function(e){return t.print(e.name)},e,t,",")},AbstractJsEmitterVisitor.prototype.getBuiltinMethodName=function(e){var t;switch(e){case o.B.ConcatArray:t="concat";break;case o.B.SubscribeObservable:t="subscribe";break;case o.B.Bind:t="bind";break;default:throw new Error("Unknown builtin method: "+e)}return t},AbstractJsEmitterVisitor}(i.d)},function(e,t,r){"use strict";function interpretStatements(e,t){var n=e.concat([new o.k(o.e(t))]),a=new s(null,null,null,new Map),u=new c,l=u.visitAllStatements(n,a);return r.i(i.a)(l)?l.value:null}function _executeFunctionStatements(e,t,n,o,a){for(var s=o.createChildWihtLocalVars(),u=0;u<e.length;u++)s.vars.set(e[u],t[u]);var c=a.visitAllStatements(n,s);return r.i(i.a)(c)?c.value:null}function createDynamicClass(e,t,r){var n={};e.getters.forEach(function(i){n[i.name]={configurable:!1,get:function(){var n=new s(t,this,e.name,t.vars);return _executeFunctionStatements([],[],i.body,n,r)}}}),e.methods.forEach(function(i){var o=i.params.map(function(e){return e.name});n[i.name]={writable:!1,configurable:!1,value:function(){for(var n=[],a=0;a<arguments.length;a++)n[a-0]=arguments[a];var u=new s(t,this,e.name,t.vars);return _executeFunctionStatements(o,n,i.body,u,r)}}});var i=e.constructorMethod.params.map(function(e){return e.name}),o=function(){for(var n=this,o=[],a=0;a<arguments.length;a++)o[a-0]=arguments[a];var u=new s(t,this,e.name,t.vars);e.fields.forEach(function(e){n[e.name]=void 0}),_executeFunctionStatements(i,o,e.constructorMethod.body,u,r)},a=e.parent?e.parent.visitExpression(r,t):Object;return o.prototype=Object.create(a.prototype,n),o}function _declareFn(e,t,r,n){return function(){for(var i=[],o=0;o<arguments.length;o++)i[o-0]=arguments[o];return _executeFunctionStatements(e,i,t,r,n)}}var n=r(18),i=r(2),o=r(8),a=r(272);t.a=interpretStatements;var s=function(){function _ExecutionContext(e,t,r,n){this.parent=e,this.instance=t,this.className=r,this.vars=n}return _ExecutionContext.prototype.createChildWihtLocalVars=function(){return new _ExecutionContext(this,this.instance,this.className,new Map)},_ExecutionContext}(),u=function(){function ReturnValue(e){this.value=e}return ReturnValue}(),c=function(){function StatementInterpreter(){}return StatementInterpreter.prototype.debugAst=function(e){return r.i(a.a)(e)},StatementInterpreter.prototype.visitDeclareVarStmt=function(e,t){return t.vars.set(e.name,e.value.visitExpression(this,t)),null},StatementInterpreter.prototype.visitWriteVarExpr=function(e,t){for(var r=e.value.visitExpression(this,t),n=t;null!=n;){if(n.vars.has(e.name))return n.vars.set(e.name,r),r;n=n.parent}throw new Error("Not declared variable "+e.name)},StatementInterpreter.prototype.visitReadVarExpr=function(e,t){var n=e.name;if(r.i(i.a)(e.builtin))switch(e.builtin){case o.y.Super:return t.instance.__proto__;case o.y.This:return t.instance;case o.y.CatchError:n=l;break;case o.y.CatchStack:n=p;break;default:throw new Error("Unknown builtin variable "+e.builtin)}for(var a=t;null!=a;){if(a.vars.has(n))return a.vars.get(n);a=a.parent}throw new Error("Not declared variable "+n)},StatementInterpreter.prototype.visitWriteKeyExpr=function(e,t){var r=e.receiver.visitExpression(this,t),n=e.index.visitExpression(this,t),i=e.value.visitExpression(this,t);return r[n]=i,i},StatementInterpreter.prototype.visitWritePropExpr=function(e,t){var r=e.receiver.visitExpression(this,t),n=e.value.visitExpression(this,t);return r[e.name]=n,n},StatementInterpreter.prototype.visitInvokeMethodExpr=function(e,t){var a,s=e.receiver.visitExpression(this,t),u=this.visitAllExpressions(e.args,t);if(r.i(i.a)(e.builtin))switch(e.builtin){case o.B.ConcatArray:a=n.a.concat(s,u[0]);break;case o.B.SubscribeObservable:a=s.subscribe({next:u[0]});break;case o.B.Bind:a=s.bind(u[0]);break;default:throw new Error("Unknown builtin method "+e.builtin)}else a=s[e.name].apply(s,u);return a},StatementInterpreter.prototype.visitInvokeFunctionExpr=function(e,t){var r=this.visitAllExpressions(e.args,t),n=e.fn;if(n instanceof o.x&&n.builtin===o.y.Super)return t.instance.constructor.prototype.constructor.apply(t.instance,r),null;var i=e.fn.visitExpression(this,t);return i.apply(null,r)},StatementInterpreter.prototype.visitReturnStmt=function(e,t){return new u(e.value.visitExpression(this,t))},StatementInterpreter.prototype.visitDeclareClassStmt=function(e,t){var r=createDynamicClass(e,t,this);return t.vars.set(e.name,r),null},StatementInterpreter.prototype.visitExpressionStmt=function(e,t){return e.expr.visitExpression(this,t)},StatementInterpreter.prototype.visitIfStmt=function(e,t){var n=e.condition.visitExpression(this,t);return n?this.visitAllStatements(e.trueCase,t):r.i(i.a)(e.falseCase)?this.visitAllStatements(e.falseCase,t):null},StatementInterpreter.prototype.visitTryCatchStmt=function(e,t){try{return this.visitAllStatements(e.bodyStmts,t)}catch(n){var r=t.createChildWihtLocalVars();return r.vars.set(l,n),r.vars.set(p,n.stack),this.visitAllStatements(e.catchStmts,r)}},StatementInterpreter.prototype.visitThrowStmt=function(e,t){throw e.error.visitExpression(this,t)},StatementInterpreter.prototype.visitCommentStmt=function(e,t){return null},StatementInterpreter.prototype.visitInstantiateExpr=function(e,t){var r=this.visitAllExpressions(e.args,t),n=e.classExpr.visitExpression(this,t);return new(n.bind.apply(n,[void 0].concat(r)))},StatementInterpreter.prototype.visitLiteralExpr=function(e,t){return e.value},StatementInterpreter.prototype.visitExternalExpr=function(e,t){return e.value.reference},StatementInterpreter.prototype.visitConditionalExpr=function(e,t){return e.condition.visitExpression(this,t)?e.trueCase.visitExpression(this,t):r.i(i.a)(e.falseCase)?e.falseCase.visitExpression(this,t):null},StatementInterpreter.prototype.visitNotExpr=function(e,t){return!e.condition.visitExpression(this,t)},StatementInterpreter.prototype.visitCastExpr=function(e,t){return e.value.visitExpression(this,t)},StatementInterpreter.prototype.visitFunctionExpr=function(e,t){var r=e.params.map(function(e){return e.name});return _declareFn(r,e.statements,t,this)},StatementInterpreter.prototype.visitDeclareFunctionStmt=function(e,t){var r=e.params.map(function(e){return e.name});return t.vars.set(e.name,_declareFn(r,e.statements,t,this)),null},StatementInterpreter.prototype.visitBinaryOperatorExpr=function(e,t){var r=this,n=function(){return e.lhs.visitExpression(r,t)},i=function(){return e.rhs.visitExpression(r,t)};switch(e.operator){case o.F.Equals:return n()==i();case o.F.Identical:return n()===i();case o.F.NotEquals:return n()!=i();case o.F.NotIdentical:return n()!==i();case o.F.And:return n()&&i();case o.F.Or:return n()||i();case o.F.Plus:return n()+i();case o.F.Minus:return n()-i();case o.F.Divide:return n()/i();case o.F.Multiply:return n()*i();case o.F.Modulo:return n()%i();case o.F.Lower:return n()<i();case o.F.LowerEquals:return n()<=i();case o.F.Bigger:return n()>i();case o.F.BiggerEquals:return n()>=i();default:throw new Error("Unknown operator "+e.operator)}},StatementInterpreter.prototype.visitReadPropExpr=function(e,t){var r,n=e.receiver.visitExpression(this,t);return r=n[e.name]},StatementInterpreter.prototype.visitReadKeyExpr=function(e,t){var r=e.receiver.visitExpression(this,t),n=e.index.visitExpression(this,t);return r[n]},StatementInterpreter.prototype.visitLiteralArrayExpr=function(e,t){return this.visitAllExpressions(e.entries,t)},StatementInterpreter.prototype.visitLiteralMapExpr=function(e,t){var r=this,n={};return e.entries.forEach(function(e){return n[e[0]]=e[1].visitExpression(r,t)}),n},StatementInterpreter.prototype.visitAllExpressions=function(e,t){var r=this;return e.map(function(e){return e.visitExpression(r,t)})},StatementInterpreter.prototype.visitAllStatements=function(e,t){for(var r=0;r<e.length;r++){var n=e[r],i=n.visitStatement(this,t);if(i instanceof u)return i}return null},StatementInterpreter}(),l="error",p="stack"},function(e,t,r){"use strict";function evalExpression(e,t,r,n){var i=r+"\nreturn "+t+"\n//# sourceURL="+e,o=[],a=[];for(var s in n)o.push(s),a.push(n[s]);return(new(Function.bind.apply(Function,[void 0].concat(o.concat(i))))).apply(void 0,a)}function jitStatements(e,t,r){var n=new u,i=o.a.createRoot([r]);return n.visitAllStatements(t,i),evalExpression(e,r,i.toSource(),n.getArgs())}var n=r(2),i=r(23),o=r(171),a=r(444);t.a=jitStatements;var s=this&&this.__extends||function(e,t){function __(){this.constructor=e}for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r]);e.prototype=null===t?Object.create(t):(__.prototype=t.prototype,new __)},u=function(e){function JitEmitterVisitor(){e.apply(this,arguments),this._evalArgNames=[],this._evalArgValues=[]}return s(JitEmitterVisitor,e),JitEmitterVisitor.prototype.getArgs=function(){for(var e={},t=0;t<this._evalArgNames.length;t++)e[this._evalArgNames[t]]=this._evalArgValues[t];return e},JitEmitterVisitor.prototype.visitExternalExpr=function(e,t){var o=e.value.reference,a=this._evalArgValues.indexOf(o);if(a===-1){a=this._evalArgValues.length,this._evalArgValues.push(o);var s=r.i(n.a)(e.value.name)?r.i(i.a)(e.value.name):"val";this._evalArgNames.push(r.i(i.a)("jit_"+s+a))}return t.print(this._evalArgNames[a]),null},JitEmitterVisitor}(a.a)},function(e,t,r){"use strict";var n=/asset:([^\/]+)\/([^\/]+)\/(.+)/,i=(function(){function ImportGenerator(){}return ImportGenerator.parseAssetUrl=function(e){return i.parse(e)},ImportGenerator}(),function(){function AssetUrl(e,t,r){this.packageName=e,this.firstLevelDir=t,this.modulePath=r}return AssetUrl.parse=function(e,t){void 0===t&&(t=!0);var r=e.match(n);if(null!==r)return new AssetUrl(r[1],r[2],r[3]);if(t)return null;throw new Error("Url "+e+" is not a valid asset: url")},AssetUrl}())},function(e,t,r){"use strict";function registerContext(e,t){for(var r=0,n=t;r<n.length;r++){var o=n[r];i[o.toLowerCase()]=e}}var n=r(0);r.d(t,"a",function(){return i});var i={};registerContext(n.SecurityContext.HTML,["iframe|srcdoc","*|innerHTML","*|outerHTML"]),registerContext(n.SecurityContext.STYLE,["*|style"]),registerContext(n.SecurityContext.URL,["*|formAction","area|href","area|ping","audio|src","a|href","a|ping","blockquote|cite","body|background","del|cite","form|action","img|src","img|srcset","input|src","ins|cite","q|cite","source|src","source|srcset","track|src","video|poster","video|src"]),registerContext(n.SecurityContext.RESOURCE_URL,["applet|code","applet|codebase","base|href","embed|src","frame|src","head|profile","html|manifest","iframe|src","link|href","media|src","object|codebase","object|data","script|src"])},function(e,t,r){"use strict";function stripComments(e){return e.replace(b,"")}function extractSourceMappingUrl(e){var t=e.match(w);return t?t[0]:""}function processRules(e,t){var r=escapeBlocks(e),n=0;return r.escapedString.replace(C,function(){for(var e=[],i=0;i<arguments.length;i++)e[i-0]=arguments[i];var o=e[2],a="",s=e[4],u="";s&&s.startsWith("{"+P)&&(a=r.blocks[n++],s=s.substring(P.length+1),u="{");var c=t(new x(o,a));return""+e[1]+c.selector+e[3]+u+c.content+s})}function escapeBlocks(e){for(var t=e.split(E),r=[],n=[],i=0,o=[],a=0;a<t.length;a++){var s=t[a];s==A&&i--,i>0?o.push(s):(o.length>0&&(n.push(o.join("")),r.push(P),o=[]),r.push(s)),s==S&&i++}return o.length>0&&(n.push(o.join("")),r.push(P)),new T(r.join(""),n)}r.d(t,"a",function(){return n});var n=function(){function ShadowCss(){this.strictStyling=!0}return ShadowCss.prototype.shimCssText=function(e,t,r){void 0===r&&(r="");var n=extractSourceMappingUrl(e);return e=stripComments(e),e=this._insertDirectives(e),this._scopeCssText(e,t,r)+n},ShadowCss.prototype._insertDirectives=function(e){return e=this._insertPolyfillDirectivesInCssText(e),this._insertPolyfillRulesInCssText(e)},ShadowCss.prototype._insertPolyfillDirectivesInCssText=function(e){return e.replace(i,function(){for(var e=[],t=0;t<arguments.length;t++)e[t-0]=arguments[t];return e[2]+"{"})},ShadowCss.prototype._insertPolyfillRulesInCssText=function(e){return e.replace(o,function(){for(var e=[],t=0;t<arguments.length;t++)e[t-0]=arguments[t];var r=e[0].replace(e[1],"").replace(e[2],"");return e[4]+r})},ShadowCss.prototype._scopeCssText=function(e,t,r){var n=this._extractUnscopedRulesFromCssText(e);return e=this._insertPolyfillHostInCssText(e),e=this._convertColonHost(e),e=this._convertColonHostContext(e),e=this._convertShadowDOMSelectors(e),t&&(e=this._scopeSelectors(e,t,r)),e=e+"\n"+n,e.trim()},ShadowCss.prototype._extractUnscopedRulesFromCssText=function(e){var t,r="";for(a.lastIndex=0;null!==(t=a.exec(e));){var n=t[0].replace(t[2],"").replace(t[1],t[4]);r+=n+"\n\n"}return r},ShadowCss.prototype._convertColonHost=function(e){return this._convertColonRule(e,l,this._colonHostPartReplacer)},ShadowCss.prototype._convertColonHostContext=function(e){return this._convertColonRule(e,p,this._colonHostContextPartReplacer)},ShadowCss.prototype._convertColonRule=function(e,t,r){return e.replace(t,function(){for(var e=[],t=0;t<arguments.length;t++)e[t-0]=arguments[t];if(e[2]){for(var n=e[2].split(","),i=[],o=0;o<n.length;o++){var a=n[o].trim();if(!a)break;i.push(r(f,a,e[3]))}return i.join(",")}return f+e[3]})},ShadowCss.prototype._colonHostContextPartReplacer=function(e,t,r){return t.indexOf(s)>-1?this._colonHostPartReplacer(e,t,r):e+t+r+", "+t+" "+e+r},ShadowCss.prototype._colonHostPartReplacer=function(e,t,r){return e+t.replace(s,"")+r},ShadowCss.prototype._convertShadowDOMSelectors=function(e){return d.reduce(function(e,t){return e.replace(t," ")},e)},ShadowCss.prototype._scopeSelectors=function(e,t,r){var n=this;return processRules(e,function(e){var i=e.selector,o=e.content;return"@"!=e.selector[0]?i=n._scopeSelector(e.selector,t,r,n.strictStyling):(e.selector.startsWith("@media")||e.selector.startsWith("@supports")||e.selector.startsWith("@page")||e.selector.startsWith("@document"))&&(o=n._scopeSelectors(e.content,t,r)),new x(i,o)})},ShadowCss.prototype._scopeSelector=function(e,t,r,n){var i=this;return e.split(",").map(function(e){return e.trim().split(m)}).map(function(e){var o=e[0],a=e.slice(1),s=function(e){return i._selectorNeedsScoping(e,t)?n?i._applyStrictSelectorScope(e,t,r):i._applySelectorScope(e,t,r):e};return[s(o)].concat(a).join(" ")}).join(", ")},ShadowCss.prototype._selectorNeedsScoping=function(e,t){var r=this._makeScopeMatcher(t);return!r.test(e)},ShadowCss.prototype._makeScopeMatcher=function(e){var t=/\[/g,r=/\]/g;return e=e.replace(t,"\\[").replace(r,"\\]"),new RegExp("^("+e+")"+v,"m")},ShadowCss.prototype._applySelectorScope=function(e,t,r){return this._applySimpleSelectorScope(e,t,r)},ShadowCss.prototype._applySimpleSelectorScope=function(e,t,r){if(y.lastIndex=0,y.test(e)){var n=this.strictStyling?"["+r+"]":t;return e.replace(h,function(e,t){return":"===t[0]?n+t:t+n}).replace(y,n+" ")}return t+" "+e},ShadowCss.prototype._applyStrictSelectorScope=function(e,t,r){var n=this,i=/\[is=([^\]]*)\]/g;t=t.replace(i,function(e){for(var t=[],r=1;r<arguments.length;r++)t[r-1]=arguments[r];return t[0]});var o="["+t+"]",a=function(e){var i=e.trim();if(!i)return"";if(e.indexOf(f)>-1)i=n._applySimpleSelectorScope(e,t,r);else{var a=e.replace(y,"");if(a.length>0){var s=a.match(/([^:]*)(:*)(.*)/);null!==s&&(i=s[1]+o+s[2]+s[3])}}return i},s=0,u=[];e=e.replace(/\[[^\]]*\]/g,function(e){var t="__attr_sel_"+s+"__";return u.push(e),s++,t});for(var c,l="",p=0,h=/( |>|\+|~(?!=))\s*/g,d=e.indexOf(f);null!==(c=h.exec(e));){var m=c[1],v=e.slice(p,c.index).trim(),g=p>=d?a(v):v;l+=g+" "+m+" ",p=h.lastIndex}return l+=a(e.substring(p)),l.replace(/__attr_sel_(\d+)__/g,function(e,t){return u[+t]})},ShadowCss.prototype._insertPolyfillHostInCssText=function(e){return e.replace(_,u).replace(g,s)},ShadowCss}(),i=/polyfill-next-selector[^}]*content:[\s]*?(['"])(.*?)\1[;\s]*}([^{]*?){/gim,o=/(polyfill-rule)[^}]*(content:[\s]*(['"])(.*?)\3)[;\s]*[^}]*}/gim,a=/(polyfill-unscoped-rule)[^}]*(content:[\s]*(['"])(.*?)\3)[;\s]*[^}]*}/gim,s="-shadowcsshost",u="-shadowcsscontext",c=")(?:\\(((?:\\([^)(]*\\)|[^)(]*)+?)\\))?([^,{]*)",l=new RegExp("("+s+c,"gim"),p=new RegExp("("+u+c,"gim"),f=s+"-no-combinator",h=/-shadowcsshost-no-combinator([^\s]*)/,d=[/::shadow/g,/::content/g,/\/shadow-deep\//g,/\/shadow\//g],m=/(?:>>>)|(?:\/deep\/)/g,v="([>\\s~+[.,{:][\\s\\S]*)?$",y=/-shadowcsshost/gim,g=/:host/gim,_=/:host-context/gim,b=/\/\*\s*[\s\S]*?\*\//g,w=/\/\*\s*#\s*sourceMappingURL=[\s\S]+?\*\//,C=/(\s*)([^;\{\}]+?)(\s*)((?:{%BLOCK%}?\s*;?)|(?:\s*;))/g,E=/([{}])/g,S="{",A="}",P="%BLOCK%",x=function(){ function CssRule(e,t){this.selector=e,this.content=t}return CssRule}(),T=function(){function StringWithEscapedBlocks(e,t){this.escapedString=e,this.blocks=t}return StringWithEscapedBlocks}()},function(e,t,r){"use strict";function _findPipeMeta(e,t){for(var r=null,n=e.pipeMetas.length-1;n>=0;n--){var i=e.pipeMetas[n];if(i.name==t){r=i;break}}if(!r)throw new Error("Illegal state: Could not find pipe "+t+" although the parser should have detected this error!");return r}var n=r(13),i=r(8),o=r(92);r.d(t,"a",function(){return a});var a=function(){function CompilePipe(e,t){var a=this;this.view=e,this.meta=t,this._purePipeProxyCount=0,this.instance=i.n.prop("_pipe_"+t.name+"_"+e.pipeCount++);var s=this.meta.type.diDeps.map(function(e){return e.token.reference===r.i(n.a)(n.b.ChangeDetectorRef).reference?r.i(o.a)(i.n.prop("ref"),a.view,a.view.componentView):r.i(o.b)(e.token,!1)});this.view.fields.push(new i.o(this.instance.name,i.c(this.meta.type))),this.view.createMethod.resetDebugInfo(null,null),this.view.createMethod.addStmt(i.n.prop(this.instance.name).set(i.b(this.meta.type).instantiate(s)).toStmt())}return CompilePipe.call=function(e,t,r){var n,i=e.componentView,o=_findPipeMeta(i,t);return o.pure?(n=i.purePipes.get(t),n||(n=new CompilePipe(i,o),i.purePipes.set(t,n),i.pipes.push(n))):(n=new CompilePipe(e,o),e.pipes.push(n)),n._call(e,r)},Object.defineProperty(CompilePipe.prototype,"pure",{get:function(){return this.meta.pure},enumerable:!0,configurable:!0}),CompilePipe.prototype._call=function(e,t){if(this.meta.pure){var a=i.n.prop(this.instance.name+"_"+this._purePipeProxyCount++),s=r.i(o.a)(this.instance,e,this.view);return r.i(o.c)(s.prop("transform").callMethod(i.B.Bind,[s]),t.length,a,e),i.b(r.i(n.d)(n.b.castByValue)).callFn([a,s.prop("transform")]).callFn(t)}return r.i(o.a)(this.instance,e,this.view).callMethod("transform",t)},CompilePipe}()},function(e,t,r){"use strict";function collectEventListeners(e,t,n){var o=[];return e.forEach(function(e){n.view.bindings.push(new a.a(n,e));var t=l.getOrCreate(n,e.target,e.name,e.phase,o);t.addAction(e,null,null)}),t.forEach(function(e){var t=n.instances.get(r.i(i.c)(e.directive.type).reference);e.hostEvents.forEach(function(r){n.view.bindings.push(new a.a(n,r));var i=l.getOrCreate(n,r.target,r.name,r.phase,o);i.addAction(r,e.directive,t)})}),o.forEach(function(e){return e.finishMethod()}),o}function bindDirectiveOutputs(e,t,r){Object.keys(e.directive.outputs).forEach(function(n){var i=e.directive.outputs[n];r.filter(function(e){return e.eventName==i}).forEach(function(e){e.listenToDirective(t,n)})})}function bindRenderOutputs(e){e.forEach(function(e){e.isAnimation||e.listenToRenderer()})}function convertStmtIntoExpression(e){return e instanceof o.I?e.expr:e instanceof o.k?e.value:null}function sanitizeEventName(e){return e.replace(/[^a-zA-Z_]/g,"_")}var n=r(2),i=r(13),o=r(8),a=r(279),s=r(176),u=r(77),c=r(283);t.a=collectEventListeners,t.c=bindDirectiveOutputs,t.b=bindRenderOutputs;var l=function(){function CompileEventListener(e,t,r,n,i){this.compileElement=e,this.eventTarget=t,this.eventName=r,this.eventPhase=n,this._hasComponentHostListener=!1,this._actionResultExprs=[],this._method=new s.a(e.view),this._methodName="_handle_"+sanitizeEventName(r)+"_"+e.nodeIndex+"_"+i,this._eventParam=new o.l(u.b.event.name,o.c(this.compileElement.view.genConfig.renderTypes.renderEvent))}return CompileEventListener.getOrCreate=function(e,t,r,n,i){var o=i.find(function(e){return e.eventTarget==t&&e.eventName==r&&e.eventPhase==n});return o||(o=new CompileEventListener(e,t,r,n,i.length),i.push(o)),o},Object.defineProperty(CompileEventListener.prototype,"methodName",{get:function(){return this._methodName},enumerable:!0,configurable:!0}),Object.defineProperty(CompileEventListener.prototype,"isAnimation",{get:function(){return!!this.eventPhase},enumerable:!0,configurable:!0}),CompileEventListener.prototype.addAction=function(e,t,i){r.i(n.a)(t)&&t.isComponent&&(this._hasComponentHostListener=!0),this._method.resetDebugInfo(this.compileElement.nodeIndex,e);var a=i||this.compileElement.view.componentContext,s=r.i(c.a)(this.compileElement.view,a,e.handler,this.compileElement.nodeIndex),u=s.length-1;if(u>=0){var l=s[u],p=convertStmtIntoExpression(l),f=o.e("pd_"+this._actionResultExprs.length);this._actionResultExprs.push(f),r.i(n.a)(p)&&(s[u]=f.set(p.cast(o.m).notIdentical(o.a(!1))).toDeclStmt(null,[o.r.Final]))}this._method.addStmts(s)},CompileEventListener.prototype.finishMethod=function(){var e=this._hasComponentHostListener?this.compileElement.appElement.prop("componentView"):o.n,t=o.a(!0);this._actionResultExprs.forEach(function(e){t=t.and(e)});var r=[e.callMethod("markPathToRootAsCheckOnce",[]).toStmt()].concat(this._method.finish()).concat([new o.k(t)]);this.compileElement.view.eventHandlerMethods.push(new o.s(this._methodName,[this._eventParam],r,o.p,[o.r.Private]))},CompileEventListener.prototype.listenToRenderer=function(){var e,t=o.n.callMethod("eventHandler",[o.n.prop(this._methodName).callMethod(o.B.Bind,[o.n])]);e=r.i(n.a)(this.eventTarget)?u.c.renderer.callMethod("listenGlobal",[o.a(this.eventTarget),o.a(this.eventName),t]):u.c.renderer.callMethod("listen",[this.compileElement.renderNode,o.a(this.eventName),t]);var i=o.e("disposable_"+this.compileElement.view.disposables.length);this.compileElement.view.disposables.push(i),this.compileElement.view.createMethod.addStmt(i.set(e).toDeclStmt(o.H,[o.r.Private]))},CompileEventListener.prototype.listenToAnimation=function(e){var t="start"==this.eventPhase?"onStart":"onDone";return e.callMethod(t,[o.n.prop(this.methodName).callMethod(o.B.Bind,[o.n])]).toStmt()},CompileEventListener.prototype.listenToDirective=function(e,t){var r=o.e("subscription_"+this.compileElement.view.subscriptions.length);this.compileElement.view.subscriptions.push(r);var n=o.n.callMethod("eventHandler",[o.n.prop(this._methodName).callMethod(o.B.Bind,[o.n])]);this.compileElement.view.createMethod.addStmt(r.set(e.prop(t).callMethod(o.B.SubscribeObservable,[n])).toDeclStmt(null,[o.r.Final]))},CompileEventListener}()},function(e,t,r){"use strict";function bindDirectiveAfterContentLifecycleCallbacks(e,t,r){var o=r.view,s=e.type.lifecycleHooks,u=o.afterContentLifecycleCallbacksMethod;u.resetDebugInfo(r.nodeIndex,r.sourceAst),s.indexOf(i.G.AfterContentInit)!==-1&&u.addStmt(new n.i(a,[t.callMethod("ngAfterContentInit",[]).toStmt()])),s.indexOf(i.G.AfterContentChecked)!==-1&&u.addStmt(t.callMethod("ngAfterContentChecked",[]).toStmt())}function bindDirectiveAfterViewLifecycleCallbacks(e,t,r){var o=r.view,s=e.type.lifecycleHooks,u=o.afterViewLifecycleCallbacksMethod;u.resetDebugInfo(r.nodeIndex,r.sourceAst),s.indexOf(i.G.AfterViewInit)!==-1&&u.addStmt(new n.i(a,[t.callMethod("ngAfterViewInit",[]).toStmt()])),s.indexOf(i.G.AfterViewChecked)!==-1&&u.addStmt(t.callMethod("ngAfterViewChecked",[]).toStmt())}function bindInjectableDestroyLifecycleCallbacks(e,t,r){var n=r.view.destroyMethod;n.resetDebugInfo(r.nodeIndex,r.sourceAst),e.lifecycleHooks.indexOf(i.G.OnDestroy)!==-1&&n.addStmt(t.callMethod("ngOnDestroy",[]).toStmt())}function bindPipeDestroyLifecycleCallbacks(e,t,r){var n=r.destroyMethod;e.type.lifecycleHooks.indexOf(i.G.OnDestroy)!==-1&&n.addStmt(t.callMethod("ngOnDestroy",[]).toStmt())}var n=r(8),i=r(14),o=r(77);t.b=bindDirectiveAfterContentLifecycleCallbacks,t.c=bindDirectiveAfterViewLifecycleCallbacks,t.d=bindInjectableDestroyLifecycleCallbacks,t.a=bindPipeDestroyLifecycleCallbacks;var a=n.n.prop("numberOfChecks").identical(new n.u(0));n.v(o.d.throwOnChange)},function(e,t,r){"use strict";function createBindFieldExpr(e){return a.n.prop("_expr_"+e)}function createCurrValueExpr(e){return a.e("currVal_"+e)}function evalCdAst(e,t,n,i,o,s){var u=r.i(p.b)(e,i,n,l.d.valUnwrapper,s);if(!u.expression)return null;if(u.temporaryCount)for(var c=0;c<u.temporaryCount;c++)o.addStmt(r.i(p.c)(s,c));if(u.needsValueUnwrapper){var h=l.d.valUnwrapper.callMethod("reset",[]).toStmt();o.addStmt(h)}return o.addStmt(t.set(u.expression).toDeclStmt(null,[a.r.Final])),new f(u.needsValueUnwrapper?l.d.valUnwrapper.prop("hasWrappedValue"):null)}function bind(e,t,n,i,s,u,c,p){var f=evalCdAst(e,t,i,s,c,p);if(f){e.fields.push(new a.o(n.name,null,[a.r.Private])),e.createMethod.addStmt(a.n.prop(n.name).set(a.b(r.i(o.d)(o.b.UNINITIALIZED))).toStmt());var h=a.b(r.i(o.d)(o.b.checkBinding)).callFn([l.d.throwOnChange,n,t]);f.forceUpdate&&(h=f.forceUpdate.or(h)),c.addStmt(new a.i(h,u.concat([a.n.prop(n.name).set(t).toStmt()])))}}function bindRenderText(e,t,r){var n=r.bindings.length;r.bindings.push(new c.a(t,e));var i=createCurrValueExpr(n),o=createBindFieldExpr(n);r.detectChangesRenderPropertiesMethod.resetDebugInfo(t.nodeIndex,e),bind(r,i,o,e.value,r.componentContext,[a.n.prop("renderer").callMethod("setText",[t.renderNode,i]).toStmt()],r.detectChangesRenderPropertiesMethod,n)}function bindAndWriteToRenderer(e,t,n,l,p){var f=n.view,h=n.renderNode;e.forEach(function(e){var d=f.bindings.length;f.bindings.push(new c.a(n,e)),f.detectChangesRenderPropertiesMethod.resetDebugInfo(n.nodeIndex,e);var m=createBindFieldExpr(d),v=createCurrValueExpr(d),y=sanitizedValue(e,m),g=sanitizedValue(e,v),_=[],b=f.detectChangesRenderPropertiesMethod;switch(e.type){case u.l.Property:f.genConfig.logBindingUpdate&&_.push(logBindingUpdateStmt(h,e.name,g)),_.push(a.n.prop("renderer").callMethod("setElementProperty",[h,a.a(e.name),g]).toStmt());break;case u.l.Attribute:g=g.isBlank().conditional(a.h,g.callMethod("toString",[])),_.push(a.n.prop("renderer").callMethod("setElementAttribute",[h,a.a(e.name),g]).toStmt());break;case u.l.Class:_.push(a.n.prop("renderer").callMethod("setElementClass",[h,a.a(e.name),g]).toStmt());break;case u.l.Style:var w=g.callMethod("toString",[]);r.i(i.a)(e.unit)&&(w=w.plus(a.a(e.unit))),g=g.isBlank().conditional(a.h,w),_.push(a.n.prop("renderer").callMethod("setElementStyle",[h,a.a(e.name),g]).toStmt());break;case u.l.Animation:b=f.animationBindingsMethod;var C=[],E=e.name,S=l?n.appElement.prop("componentView"):a.n,A=S.prop("componentType").prop("animations").key(a.a(E)),P=a.a(s.E),x=a.b(r.i(o.d)(o.b.UNINITIALIZED)),T=a.e("animationTransition_"+E);_.push(T.set(A.callFn([a.n,h,y.equals(x).conditional(P,y),g.equals(x).conditional(P,g)])).toDeclStmt()),C.push(T.set(A.callFn([a.n,h,y,P])).toDeclStmt()),p.forEach(function(e){if(e.isAnimation&&e.eventName===E){var t=e.listenToAnimation(T);_.push(t),C.push(t)}}),f.detachMethod.addStmts(C)}bind(f,v,m,e.value,t,_,b,f.bindings.length)})}function sanitizedValue(e,t){var i;switch(e.securityContext){case n.SecurityContext.NONE:return t;case n.SecurityContext.HTML:i="HTML";break;case n.SecurityContext.STYLE:i="STYLE";break;case n.SecurityContext.SCRIPT:i="SCRIPT";break;case n.SecurityContext.URL:i="URL";break;case n.SecurityContext.RESOURCE_URL:i="RESOURCE_URL";break;default:throw new Error("internal error, unexpected SecurityContext "+e.securityContext+".")}var s=l.c.viewUtils.prop("sanitizer"),u=[a.b(r.i(o.d)(o.b.SecurityContext)).prop(i),t];return s.callMethod("sanitize",u)}function bindRenderInputs(e,t,r){bindAndWriteToRenderer(e,t.view.componentContext,t,!1,r)}function bindDirectiveHostProps(e,t,r,n){bindAndWriteToRenderer(e.hostProperties,t,r,!0,n)}function bindDirectiveInputs(e,t,n){var i=n.view,o=i.detectChangesInInputsMethod;o.resetDebugInfo(n.nodeIndex,n.sourceAst),e.inputs.forEach(function(e){var r=i.bindings.length;i.bindings.push(new c.a(n,e)),o.resetDebugInfo(n.nodeIndex,e);var s=createCurrValueExpr(r),u=evalCdAst(i,s,e.value,i.componentContext,o,r);u&&o.addStmt(t.callMethod("check_"+e.directiveName,[s,l.d.throwOnChange,u.forceUpdate||a.a(!1)]).toStmt())});var u=e.directive.isComponent&&!r.i(s.H)(e.directive.changeDetection),p=t.callMethod("detectChangesInternal",[a.n,n.renderNode,l.d.throwOnChange]),f=u?new a.i(p,[n.appElement.prop("componentView").callMethod("markAsCheckOnce",[]).toStmt()]):p.toStmt();o.addStmt(f)}function logBindingUpdateStmt(e,t,n){return a.b(r.i(o.d)(o.b.setBindingDebugInfo)).callFn([a.n.prop("renderer"),e,a.a(t),n]).toStmt()}var n=r(0),i=r(2),o=r(13),a=r(8),s=r(14),u=r(53),c=r(279),l=r(77),p=r(283);t.a=bindRenderText,t.b=bindRenderInputs,t.d=bindDirectiveHostProps,t.c=bindDirectiveInputs;var f=function(){function EvalResult(e){this.forceUpdate=e}return EvalResult}()},function(e,t,r){"use strict";function bindView(e,t){var i=new s(e);r.i(n.c)(i,t),e.pipes.forEach(function(e){r.i(o.a)(e.meta,e.instance,e.view)})}var n=r(53),i=r(451),o=r(452),a=r(453);t.a=bindView;var s=function(){function ViewBinderVisitor(e){this.view=e,this._nodeIndex=0}return ViewBinderVisitor.prototype.visitBoundText=function(e,t){var n=this.view.nodes[this._nodeIndex++];return r.i(a.a)(e,n,this.view),null},ViewBinderVisitor.prototype.visitText=function(e,t){return this._nodeIndex++,null},ViewBinderVisitor.prototype.visitNgContent=function(e,t){return null},ViewBinderVisitor.prototype.visitElement=function(e,t){var s=this.view.nodes[this._nodeIndex++],u=[];return r.i(i.a)(e.outputs,e.directives,s).forEach(function(e){u.push(e)}),r.i(a.b)(e.inputs,s,u),r.i(i.b)(u),e.directives.forEach(function(e){var t=s.instances.get(e.directive.type.reference),n=s.directiveWrapperInstance.get(e.directive.type.reference);r.i(a.c)(e,n,s),r.i(a.d)(e,t,s,u),r.i(i.c)(e,t,u)}),r.i(n.c)(this,e.children,s),e.directives.forEach(function(e){var t=s.instances.get(e.directive.type.reference);r.i(o.b)(e.directive,t,s),r.i(o.c)(e.directive,t,s)}),e.providers.forEach(function(e){var t=s.instances.get(e.token.reference);r.i(o.d)(e,t,s)}),null},ViewBinderVisitor.prototype.visitEmbeddedTemplate=function(e,t){var n=this.view.nodes[this._nodeIndex++],s=r.i(i.a)(e.outputs,e.directives,n);return e.directives.forEach(function(e){var t=n.instances.get(e.directive.type.reference),u=n.directiveWrapperInstance.get(e.directive.type.reference);r.i(a.c)(e,u,n),r.i(i.c)(e,t,s),r.i(o.b)(e.directive,t,n),r.i(o.c)(e.directive,t,n)}),e.providers.forEach(function(e){var t=n.instances.get(e.token.reference);r.i(o.d)(e,t,n)}),bindView(n.embeddedView,e.children),null},ViewBinderVisitor.prototype.visitAttr=function(e,t){return null},ViewBinderVisitor.prototype.visitDirective=function(e,t){return null},ViewBinderVisitor.prototype.visitEvent=function(e,t){return null},ViewBinderVisitor.prototype.visitReference=function(e,t){return null},ViewBinderVisitor.prototype.visitVariable=function(e,t){return null},ViewBinderVisitor.prototype.visitDirectiveProperty=function(e,t){return null},ViewBinderVisitor.prototype.visitElementProperty=function(e,t){return null},ViewBinderVisitor}()},function(e,t,r){"use strict";function buildView(e,t,n){var i=new E(e,n);return r.i(l.c)(i,t,e.declarationElement.isNull()?e.declarationElement:e.declarationElement.parent),i.nestedViewCount}function finishView(e,t){e.afterNodes(),createViewTopLevelStmts(e,t),e.nodes.forEach(function(e){e instanceof f.a&&e.hasEmbeddedView&&finishView(e.embeddedView,t)})}function _getOuterContainerOrSelf(e){for(var t=e.view;_isNgContainer(e.parent,t);)e=e.parent;return e}function _getOuterContainerParentOrSelf(e){for(var t=e.view;_isNgContainer(e,t);)e=e.parent;return e}function _isNgContainer(e,t){return!e.isNull()&&e.sourceAst.name===b&&e.view===t}function _mergeHtmlAndDirectiveAttrs(e,t){var n={};return Object.keys(e).forEach(function(t){n[t]=e[t]}),t.forEach(function(e){Object.keys(e.hostAttributes).forEach(function(t){var i=e.hostAttributes[t],o=n[t];n[t]=r.i(a.a)(o)?mergeAttributeValue(t,o,i):i})}),mapToKeyValueArray(n)}function _readHtmlAttrs(e){var t={};return e.forEach(function(e){t[e.name]=e.value}),t}function mergeAttributeValue(e,t,r){return e==g||e==_?t+" "+r:r}function mapToKeyValueArray(e){var t=[];return Object.keys(e).forEach(function(r){t.push([r,e[r]])}),o.a.sort(t),t}function createViewTopLevelStmts(e,t){var n=u.h;e.genConfig.genDebugInfo&&(n=u.e("nodeDebugInfos_"+e.component.type.name+e.viewIndex),t.push(n.set(u.g(e.nodes.map(createStaticNodeDebugInfo),new u.A(new u.J(r.i(s.d)(s.b.StaticNodeDebugInfo)),[u.d.Const]))).toDeclStmt(null,[u.r.Final])));var i=u.e("renderType_"+e.component.type.name);0===e.viewIndex&&t.push(i.set(u.h).toDeclStmt(u.c(r.i(s.d)(s.b.RenderComponentType))));var o=createViewClass(e,i,n);t.push(o),t.push(createViewFactory(e,o,i))}function createStaticNodeDebugInfo(e){var t=e instanceof f.a?e:null,n=[],i=u.h,o=[];return r.i(a.a)(t)&&(n=t.getProviderTokens(),r.i(a.a)(t.component)&&(i=r.i(p.f)(r.i(s.c)(t.component.type))),Object.keys(t.referenceTokens).forEach(function(e){var n=t.referenceTokens[e];o.push([e,r.i(a.a)(n)?r.i(p.f)(n):u.h])})),u.b(r.i(s.d)(s.b.StaticNodeDebugInfo)).instantiate([u.g(n,new u.A(u.m,[u.d.Const])),i,u.f(o,new u.q(u.m,[u.d.Const]))],u.c(r.i(s.d)(s.b.StaticNodeDebugInfo),null,[u.d.Const]))}function createViewClass(e,t,n){var i=[new u.l(d.e.viewUtils.name,u.c(r.i(s.d)(s.b.ViewUtils))),new u.l(d.e.parentInjector.name,u.c(r.i(s.d)(s.b.Injector))),new u.l(d.e.declarationEl.name,u.c(r.i(s.d)(s.b.AppElement)))],o=[u.e(e.className),t,d.f.fromValue(e.viewType),d.e.viewUtils,d.e.parentInjector,d.e.declarationEl,d.g.fromValue(getChangeDetectionMode(e))];e.genConfig.genDebugInfo&&o.push(n);var a=new u.s(null,i,[u.K.callFn(o).toStmt()]),c=[new u.s("createInternal",[new u.l(C.name,u.L)],generateCreateMethod(e),u.c(r.i(s.d)(s.b.AppElement))),new u.s("injectorGetInternal",[new u.l(d.a.token.name,u.m),new u.l(d.a.requestNodeIndex.name,u.M),new u.l(d.a.notFoundResult.name,u.m)],addReturnValuefNotEmpty(e.injectorGetMethod.finish(),d.a.notFoundResult),u.m),new u.s("detectChangesInternal",[new u.l(d.d.throwOnChange.name,u.p)],generateDetectChangesMethod(e)),new u.s("dirtyParentQueriesInternal",[],e.dirtyParentQueriesMethod.finish()),new u.s("destroyInternal",[],e.destroyMethod.finish()),new u.s("detachInternal",[],e.detachMethod.finish())].concat(e.eventHandlerMethods),l=e.genConfig.genDebugInfo?s.b.DebugAppView:s.b.AppView,p=new u.t(e.className,u.b(r.i(s.d)(l),[getContextType(e)]),e.fields,e.getters,a,c.filter(function(e){return e.body.length>0}));return p}function createViewFactory(e,t,n){var i,o=[new u.l(d.e.viewUtils.name,u.c(r.i(s.d)(s.b.ViewUtils))),new u.l(d.e.parentInjector.name,u.c(r.i(s.d)(s.b.Injector))),new u.l(d.e.declarationEl.name,u.c(r.i(s.d)(s.b.AppElement)))],a=[];if(i=e.component.template.templateUrl==e.component.type.moduleUrl?e.component.type.moduleUrl+" class "+e.component.type.name+" - inline template":e.component.template.templateUrl,0===e.viewIndex){var c=u.f(e.animations.map(function(e){return[e.name,e.fnExp]}));a=[new u.i(n.identical(u.h),[n.set(d.e.viewUtils.callMethod("createRenderComponentType",[e.genConfig.genDebugInfo?u.a(i):u.a(""),u.a(e.component.template.ngContentSelectors.length),d.h.fromValue(e.component.template.encapsulation),e.styles,c])).toStmt()])]}return u.j(o,a.concat([new u.k(u.e(t.name).instantiate(t.constructorMethod.params.map(function(e){return u.e(e.name)})))]),u.c(r.i(s.d)(s.b.AppView),[getContextType(e)])).toDeclStmt(e.viewFactory.name,[u.r.Final])}function generateCreateMethod(e){var t=u.h,n=[];e.viewType===c.j.COMPONENT&&(t=d.c.renderer.callMethod("createViewRoot",[u.n.prop("declarationAppElement").prop("nativeElement")]),n=[w.set(t).toDeclStmt(u.c(e.genConfig.renderTypes.renderNode),[u.r.Final])]);var i;return i=e.viewType===c.j.HOST?e.nodes[0].appElement:u.h,n.concat(e.createMethod.finish(),[u.n.callMethod("init",[r.i(v.e)(e.rootNodesOrAppElements),u.g(e.nodes.map(function(e){return e.renderNode})),u.g(e.disposables),u.g(e.subscriptions)]).toStmt(),new u.k(i)])}function generateDetectChangesMethod(e){var t=[];if(e.animationBindingsMethod.isEmpty()&&e.detectChangesInInputsMethod.isEmpty()&&e.updateContentQueriesMethod.isEmpty()&&e.afterContentLifecycleCallbacksMethod.isEmpty()&&e.detectChangesRenderPropertiesMethod.isEmpty()&&e.updateViewQueriesMethod.isEmpty()&&e.afterViewLifecycleCallbacksMethod.isEmpty())return t;o.a.addAll(t,e.animationBindingsMethod.finish()),o.a.addAll(t,e.detectChangesInInputsMethod.finish()),t.push(u.n.callMethod("detectContentChildrenChanges",[d.d.throwOnChange]).toStmt());var n=e.updateContentQueriesMethod.finish().concat(e.afterContentLifecycleCallbacksMethod.finish());n.length>0&&t.push(new u.i(u.v(d.d.throwOnChange),n)),o.a.addAll(t,e.detectChangesRenderPropertiesMethod.finish()),t.push(u.n.callMethod("detectViewChildrenChanges",[d.d.throwOnChange]).toStmt());var i=e.updateViewQueriesMethod.finish().concat(e.afterViewLifecycleCallbacksMethod.finish());i.length>0&&t.push(new u.i(u.v(d.d.throwOnChange),i));var a=[],c=u.N(t);return c.has(d.d.changed.name)&&a.push(d.d.changed.set(u.a(!0)).toDeclStmt(u.p)),c.has(d.d.changes.name)&&a.push(d.d.changes.set(u.h).toDeclStmt(new u.q(u.c(r.i(s.d)(s.b.SimpleChange))))),c.has(d.d.valUnwrapper.name)&&a.push(d.d.valUnwrapper.set(u.b(r.i(s.d)(s.b.ValueUnwrapper)).instantiate([])).toDeclStmt(null,[u.r.Final])),a.concat(t)}function addReturnValuefNotEmpty(e,t){return e.length>0?e.concat([new u.k(t)]):e}function getContextType(e){return e.viewType===c.j.COMPONENT?u.c(e.component.type):u.m}function getChangeDetectionMode(e){var t;return t=e.viewType===c.j.COMPONENT?r.i(c.H)(e.component.changeDetection)?c.n.CheckAlways:c.n.CheckOnce:c.n.CheckAlways}var n=r(0),i=r(17),o=r(18),a=r(2),s=r(13),u=r(8),c=r(14),l=r(53),p=r(23),f=r(280),h=r(282),d=r(77),m=r(177),v=r(92);t.a=buildView,t.b=finishView;var y="$implicit",g="class",_="style",b="ng-container",w=u.e("parentRenderNode"),C=u.e("rootSelector"),E=function(){function ViewBuilderVisitor(e,t){this.view=e,this.targetDependencies=t,this.nestedViewCount=0}return ViewBuilderVisitor.prototype._isRootNode=function(e){return e.view!==this.view},ViewBuilderVisitor.prototype._addRootNodeAndProject=function(e){var t=_getOuterContainerOrSelf(e),n=t.parent,i=t.sourceAst.ngContentIndex,o=e instanceof f.a&&e.hasViewContainer?e.appElement:null;this._isRootNode(n)?this.view.viewType!==c.j.COMPONENT&&this.view.rootNodesOrAppElements.push(o||e.renderNode):r.i(a.a)(n.component)&&r.i(a.a)(i)&&n.addContentNode(i,o||e.renderNode)},ViewBuilderVisitor.prototype._getParentRenderNode=function(e){return e=_getOuterContainerParentOrSelf(e),this._isRootNode(e)?this.view.viewType===c.j.COMPONENT?w:u.h:r.i(a.a)(e.component)&&e.component.template.encapsulation!==n.ViewEncapsulation.Native?u.h:e.renderNode},ViewBuilderVisitor.prototype.visitBoundText=function(e,t){return this._visitText(e,"",t)},ViewBuilderVisitor.prototype.visitText=function(e,t){return this._visitText(e,e.value,t)},ViewBuilderVisitor.prototype._visitText=function(e,t,r){var n="_text_"+this.view.nodes.length;this.view.fields.push(new u.o(n,u.c(this.view.genConfig.renderTypes.renderText)));var i=u.n.prop(n),o=new f.b(r,this.view,this.view.nodes.length,i,e),a=u.n.prop(n).set(d.c.renderer.callMethod("createText",[this._getParentRenderNode(r),u.a(t),this.view.createMethod.resetDebugInfoExpr(this.view.nodes.length,e)])).toStmt();return this.view.nodes.push(o),this.view.createMethod.addStmt(a),this._addRootNodeAndProject(o),i},ViewBuilderVisitor.prototype.visitNgContent=function(e,t){this.view.createMethod.resetDebugInfo(null,e);var n=this._getParentRenderNode(t),i=d.c.projectableNodes.key(u.a(e.index),new u.A(u.c(this.view.genConfig.renderTypes.renderNode)));return n!==u.h?this.view.createMethod.addStmt(d.c.renderer.callMethod("projectNodes",[n,u.b(r.i(s.d)(s.b.flattenNestedViewRenderNodes)).callFn([i])]).toStmt()):this._isRootNode(t)?this.view.viewType!==c.j.COMPONENT&&this.view.rootNodesOrAppElements.push(i):r.i(a.a)(t.component)&&r.i(a.a)(e.ngContentIndex)&&t.addContentNode(e.ngContentIndex,i),null},ViewBuilderVisitor.prototype.visitElement=function(e,t){var n,o=this.view.nodes.length,s=this.view.createMethod.resetDebugInfoExpr(o,e);n=0===o&&this.view.viewType===c.j.HOST?u.n.callMethod("selectOrCreateHostElement",[u.a(e.name),C,s]):e.name===b?d.c.renderer.callMethod("createTemplateAnchor",[this._getParentRenderNode(t),s]):d.c.renderer.callMethod("createElement",[this._getParentRenderNode(t),u.a(e.name),s]);var p="_el_"+o;this.view.fields.push(new u.o(p,u.c(this.view.genConfig.renderTypes.renderElement))),this.view.createMethod.addStmt(u.n.prop(p).set(n).toStmt());for(var h=u.n.prop(p),y=e.directives.map(function(e){return e.directive}),g=y.find(function(e){return e.isComponent}),_=_readHtmlAttrs(e.attrs),w=_mergeHtmlAndDirectiveAttrs(_,y),E=0;E<w.length;E++){var S=w[E][0];if(e.name!==b){var A=w[E][1];this.view.createMethod.addStmt(d.c.renderer.callMethod("setElementAttribute",[h,u.a(S),u.a(A)]).toStmt())}}var P=new f.a(t,this.view,o,h,e,g,y,e.providers,e.hasViewContainer,!1,e.references,this.targetDependencies);this.view.nodes.push(P);var x=null;if(r.i(a.a)(g)){var T=new i.a({name:r.i(v.d)(g,0)});this.targetDependencies.push(new m.c(g.type,T)),x=u.e("compView_"+o),P.setComponentView(x),this.view.createMethod.addStmt(x.set(u.b(T).callFn([d.c.viewUtils,P.injector,P.appElement])).toDeclStmt())}if(P.beforeChildren(),this._addRootNodeAndProject(P),r.i(l.c)(this,e.children,P),P.afterChildren(this.view.nodes.length-o-1),r.i(a.a)(x)){var O;O=this.view.component.type.isHost?d.c.projectableNodes:u.g(P.contentNodesByNgContentIndex.map(function(e){return r.i(v.e)(e)})),this.view.createMethod.addStmt(x.callMethod("create",[P.getComponent(),O,u.h]).toStmt())}return null},ViewBuilderVisitor.prototype.visitEmbeddedTemplate=function(e,t){var r=this.view.nodes.length,n="_anchor_"+r;this.view.fields.push(new u.o(n,u.c(this.view.genConfig.renderTypes.renderComment))),this.view.createMethod.addStmt(u.n.prop(n).set(d.c.renderer.callMethod("createTemplateAnchor",[this._getParentRenderNode(t),this.view.createMethod.resetDebugInfoExpr(r,e)])).toStmt());var i=u.n.prop(n),o=e.variables.map(function(e){return[e.value.length>0?e.value:y,e.name]}),a=e.directives.map(function(e){return e.directive}),s=new f.a(t,this.view,r,i,e,null,a,e.providers,e.hasViewContainer,!0,e.references,this.targetDependencies);this.view.nodes.push(s),this.nestedViewCount++;var c=new h.a(this.view.component,this.view.genConfig,this.view.pipeMetas,u.h,this.view.animations,this.view.viewIndex+this.nestedViewCount,s,o);return this.nestedViewCount+=buildView(c,e.children,this.targetDependencies),s.beforeChildren(),this._addRootNodeAndProject(s),s.afterChildren(0),null},ViewBuilderVisitor.prototype.visitAttr=function(e,t){return null},ViewBuilderVisitor.prototype.visitDirective=function(e,t){return null},ViewBuilderVisitor.prototype.visitEvent=function(e,t){return null},ViewBuilderVisitor.prototype.visitReference=function(e,t){return null},ViewBuilderVisitor.prototype.visitVariable=function(e,t){return null},ViewBuilderVisitor.prototype.visitDirectiveProperty=function(e,t){return null},ViewBuilderVisitor.prototype.visitElementProperty=function(e,t){return null},ViewBuilderVisitor}()},function(e,t,r){"use strict";r.d(t,"a",function(){return n});var n=function(){function AnimationKeyframe(e,t){this.offset=e,this.styles=t}return AnimationKeyframe}()},function(e,t,r){"use strict";var n=r(3),i=r(178);r.d(t,"a",function(){return o});var o=function(){function AnimationSequencePlayer(e){var t=this;this._players=e,this._currentIndex=0,this._onDoneFns=[],this._onStartFns=[],this._finished=!1,this._started=!1,this.parentPlayer=null,this._players.forEach(function(e){e.parentPlayer=t}),this._onNext(!1)}return AnimationSequencePlayer.prototype._onNext=function(e){var t=this;if(!this._finished)if(0==this._players.length)this._activePlayer=new i.a,r.i(n.l)(function(){return t._onFinish()});else if(this._currentIndex>=this._players.length)this._activePlayer=new i.a,this._onFinish();else{var o=this._players[this._currentIndex++];o.onDone(function(){return t._onNext(!0)}),this._activePlayer=o,e&&o.play()}},AnimationSequencePlayer.prototype._onFinish=function(){this._finished||(this._finished=!0,r.i(n.d)(this.parentPlayer)||this.destroy(),this._onDoneFns.forEach(function(e){return e()}),this._onDoneFns=[])},AnimationSequencePlayer.prototype.init=function(){this._players.forEach(function(e){return e.init()})},AnimationSequencePlayer.prototype.onStart=function(e){this._onStartFns.push(e)},AnimationSequencePlayer.prototype.onDone=function(e){this._onDoneFns.push(e)},AnimationSequencePlayer.prototype.hasStarted=function(){return this._started},AnimationSequencePlayer.prototype.play=function(){r.i(n.d)(this.parentPlayer)||this.init(),this.hasStarted()||(this._onStartFns.forEach(function(e){return e()}),this._onStartFns=[],this._started=!0),this._activePlayer.play()},AnimationSequencePlayer.prototype.pause=function(){this._activePlayer.pause()},AnimationSequencePlayer.prototype.restart=function(){this._players.length>0&&(this.reset(),this._players[0].restart())},AnimationSequencePlayer.prototype.reset=function(){this._players.forEach(function(e){return e.reset()})},AnimationSequencePlayer.prototype.finish=function(){this._onFinish(),this._players.forEach(function(e){return e.finish()})},AnimationSequencePlayer.prototype.destroy=function(){this._onFinish(),this._players.forEach(function(e){return e.destroy()})},AnimationSequencePlayer.prototype.setPosition=function(e){this._players[0].setPosition(e)},AnimationSequencePlayer.prototype.getPosition=function(){return this._players[0].getPosition()},AnimationSequencePlayer}()},function(e,t,r){"use strict";function prepareFinalAnimationStyles(e,t,n){void 0===n&&(n=null);var o={};return Object.keys(t).forEach(function(e){var r=t[e];o[e]=r==a.a?n:r.toString()}),Object.keys(e).forEach(function(e){r.i(i.d)(o[e])||(o[e]=n)}),o}function balanceAnimationKeyframes(e,t,o){var s=o.length-1,u=o[0],c=flattenStyles(u.styles.styles),l={},p=!1;Object.keys(e).forEach(function(t){var r=e[t];c[t]||(c[t]=r,l[t]=r,p=!0)});var f=n.f.merge({},c),h=o[s];n.a.insert(h.styles.styles,0,t);var d=flattenStyles(h.styles.styles),m={},v=!1;return Object.keys(f).forEach(function(e){r.i(i.d)(d[e])||(m[e]=a.a,v=!0)}),v&&h.styles.styles.push(m),Object.keys(d).forEach(function(e){r.i(i.d)(c[e])||(l[e]=a.a,p=!0)}),p&&u.styles.styles.push(l),o}function clearStyles(e){var t={};return Object.keys(e).forEach(function(e){t[e]=null}),t}function collectAndResolveStyles(e,t){return t.map(function(t){var n={};return Object.keys(t).forEach(function(s){var u=t[s];u==o.a&&(u=e[s],r.i(i.d)(u)||(u=a.a)),e[s]=u,n[s]=u}),n})}function renderStyles(e,t,r){Object.keys(r).forEach(function(n){t.setElementStyle(e,n,r[n])})}function flattenStyles(e){var t={};return e.forEach(function(e){Object.keys(e).forEach(function(r){t[r]=e[r]})}),t}var n=r(19),i=r(3),o=r(284),a=r(288);t.a=prepareFinalAnimationStyles,t.b=balanceAnimationKeyframes,t.d=clearStyles,t.f=collectAndResolveStyles,t.e=renderStyles,t.c=flattenStyles},function(e,t,r){"use strict";r.d(t,"a",function(){return n});var n=function(){function AnimationStyles(e){this.styles=e}return AnimationStyles}()},function(e,t,r){"use strict";var n=r(287);r.d(t,"a",function(){return i});var i=function(){function AnimationTransition(e,t,r,n){this._player=e,this._fromState=t,this._toState=r,this._totalTime=n}return AnimationTransition.prototype._createEvent=function(e){return new n.a({fromState:this._fromState,toState:this._toState,totalTime:this._totalTime,phaseName:e})},AnimationTransition.prototype.onStart=function(e){var t=this._createEvent("start");this._player.onStart(function(){return e(t)})},AnimationTransition.prototype.onDone=function(e){var t=this._createEvent("done");this._player.onDone(function(){return e(t)})},AnimationTransition}()},function(e,t,r){"use strict";var n=r(3);r.d(t,"a",function(){return i});var i=function(){function ViewAnimationMap(){this._map=new Map,this._allPlayers=[]}return ViewAnimationMap.prototype.find=function(e,t){var i=this._map.get(e);if(r.i(n.d)(i))return i[t]},ViewAnimationMap.prototype.findAllPlayersByElement=function(e){var t=this._map.get(e);return t?Object.keys(t).map(function(e){return t[e]}):[]},ViewAnimationMap.prototype.set=function(e,t,i){var o=this._map.get(e);r.i(n.d)(o)||(o={});var a=o[t];r.i(n.d)(a)&&this.remove(e,t),o[t]=i,this._allPlayers.push(i),this._map.set(e,o)},ViewAnimationMap.prototype.getAllPlayers=function(){ return this._allPlayers},ViewAnimationMap.prototype.remove=function(e,t){var r=this._map.get(e);if(r){var n=r[t];delete r[t];var i=this._allPlayers.indexOf(n);this._allPlayers.splice(i,1),0===Object.keys(r).length&&this._map.delete(e)}},ViewAnimationMap}()},function(e,t,r){"use strict";function _iterableDiffersFactory(){return a.b}function _keyValueDiffersFactory(){return a.c}var n=r(179),i=r(180),o=r(124),a=r(125),s=r(295),u=r(93),c=r(132),l=r(305);r.d(t,"a",function(){return p});var p=function(){function ApplicationModule(){}return ApplicationModule.decorators=[{type:l.a,args:[{providers:[i.d,{provide:i.e,useExisting:i.d},n.a,u.b,o.d,c.ViewUtils,{provide:a.d,useFactory:_iterableDiffersFactory},{provide:a.e,useFactory:_keyValueDiffersFactory},{provide:s.a,useValue:"en-US"}]}]}],ApplicationModule.ctorParameters=[],ApplicationModule}()},function(e,t,r){"use strict";var n=r(125);r.d(t,"e",function(){return n.i}),r.d(t,"c",function(){return n.g}),r.d(t,"g",function(){return n.k}),r.d(t,"h",function(){return n.l}),r.d(t,"a",function(){return n.d}),r.d(t,"i",function(){return n.m}),r.d(t,"b",function(){return n.e}),r.d(t,"f",function(){return n.j}),r.d(t,"d",function(){return n.h})},function(e,t,r){"use strict";r.d(t,"a",function(){return n});var n=function(){function ChangeDetectorRef(){}return ChangeDetectorRef}()},function(e,t,r){"use strict";var n=r(305),i=r(481),o=r(33),a=r(180),s=r(124),u=r(179),c=r(482),l=r(480),p=r(469),f=r(292),h=r(192),d=r(463),m=r(478),v=r(295),y=r(462),g=r(133),_=r(193),b=r(187),w=r(294),C=r(466),E=r(288),S=r(287),A=r(178),P=r(310);r.d(t,"g",function(){return n.b}),r.d(t,"l",function(){return n.c}),r.d(t,"q",function(){return n.d}),r.d(t,"t",function(){return n.e}),r.d(t,"u",function(){return n.a}),r.d(t,"y",function(){return n.f}),r.d(t,"N",function(){return n.g}),r.d(t,"Y",function(){return n.h}),r.d(t,"Z",function(){return n.i}),r.d(t,"_0",function(){return n.j}),r.d(t,"_1",function(){return n.k}),r.d(t,"_2",function(){return n.l}),r.d(t,"_14",function(){return n.m}),r.d(t,"_15",function(){return n.n}),r.d(t,"_40",function(){return n.o}),r.d(t,"_41",function(){return n.p}),r.d(t,"_42",function(){return n.q}),r.d(t,"_43",function(){return n.r}),r.d(t,"_44",function(){return n.s}),r.d(t,"_45",function(){return n.t}),r.d(t,"_46",function(){return n.u}),r.d(t,"_47",function(){return n.v}),r.d(t,"_48",function(){return n.w}),r.d(t,"_49",function(){return n.x}),r.d(t,"_50",function(){return n.y}),r.d(t,"_51",function(){return n.z}),r.d(t,"_52",function(){return i.a}),r.d(t,"a",function(){return o.a}),r.d(t,"c",function(){return o.b}),r.d(t,"d",function(){return o.d}),r.d(t,"e",function(){return o.c}),r.d(t,"p",function(){return o.h}),r.d(t,"L",function(){return o.e}),r.d(t,"T",function(){return o.g}),r.d(t,"X",function(){return o.i}),r.d(t,"_10",function(){return o.j}),r.d(t,"_17",function(){return o.f}),r.d(t,"_53",function(){return o.k}),r.d(t,"_54",function(){return o.l}),r.d(t,"_55",function(){return o.m}),r.d(t,"_20",function(){return a.g}),r.d(t,"_21",function(){return a.h}),r.d(t,"_22",function(){return a.i}),r.d(t,"_23",function(){return a.j}),r.d(t,"z",function(){return a.e}),r.d(t,"_24",function(){return a.k}),r.d(t,"B",function(){return a.f}),r.d(t,"G",function(){return a.c}),r.d(t,"_25",function(){return a.b}),r.d(t,"_26",function(){return s.a}),r.d(t,"W",function(){return s.e}),r.d(t,"_27",function(){return s.c}),r.d(t,"E",function(){return s.b}),r.d(t,"_28",function(){return u.a}),r.d(t,"_29",function(){return u.b}),r.d(t,"x",function(){return c.a}),r.d(t,"k",function(){return l.a}),r.d(t,"C",function(){return l.b}),r.d(t,"O",function(){return l.c}),r.d(t,"j",function(){return p.a}),r.d(t,"m",function(){return p.b}),r.d(t,"n",function(){return p.c}),r.d(t,"P",function(){return p.d}),r.d(t,"Q",function(){return p.e}),r.d(t,"R",function(){return p.f}),r.d(t,"S",function(){return p.g}),r.d(t,"_12",function(){return p.h}),r.d(t,"_13",function(){return p.i}),r.d(t,"_18",function(){return p.j}),r.d(t,"_19",function(){return p.k}),r.d(t,"_56",function(){return p.l}),r.d(t,"_57",function(){return p.m}),r.d(t,"_58",function(){return p.n}),r.d(t,"_59",function(){return p.o}),r.d(t,"_60",function(){return p.p}),r.d(t,"_61",function(){return p.q}),r.d(t,"_62",function(){return p.r}),r.d(t,"_63",function(){return p.s}),r.d(t,"_30",function(){return f.a}),r.d(t,"_31",function(){return f.d}),r.d(t,"_32",function(){return f.g}),r.d(t,"A",function(){return f.c}),r.d(t,"J",function(){return h.a}),r.d(t,"_33",function(){return h.b}),r.d(t,"w",function(){return h.c}),r.d(t,"h",function(){return d.a}),r.d(t,"i",function(){return d.b}),r.d(t,"o",function(){return d.c}),r.d(t,"s",function(){return d.d}),r.d(t,"M",function(){return d.e}),r.d(t,"U",function(){return d.f}),r.d(t,"_64",function(){return d.g}),r.d(t,"_65",function(){return d.h}),r.d(t,"_66",function(){return d.i}),r.d(t,"H",function(){return m.a}),r.d(t,"_16",function(){return v.c}),r.d(t,"V",function(){return v.b}),r.d(t,"f",function(){return v.a}),r.d(t,"K",function(){return y.a}),r.d(t,"_34",function(){return g.a}),r.d(t,"_35",function(){return g.b}),r.d(t,"_36",function(){return g.c}),r.d(t,"_37",function(){return g.d}),r.d(t,"_11",function(){return _.a}),r.d(t,"b",function(){return b.a}),r.d(t,"I",function(){return w.a}),r.d(t,"r",function(){return C.a}),r.d(t,"v",function(){return E.a}),r.d(t,"_3",function(){return E.b}),r.d(t,"_4",function(){return E.c}),r.d(t,"_5",function(){return E.d}),r.d(t,"_6",function(){return E.e}),r.d(t,"_7",function(){return E.f}),r.d(t,"_8",function(){return E.g}),r.d(t,"_9",function(){return E.h}),r.d(t,"_67",function(){return E.i}),r.d(t,"_68",function(){return E.j}),r.d(t,"_69",function(){return E.k}),r.d(t,"_70",function(){return E.l}),r.d(t,"_71",function(){return E.m}),r.d(t,"_72",function(){return E.n}),r.d(t,"_73",function(){return E.o}),r.d(t,"_74",function(){return E.p}),r.d(t,"_75",function(){return E.q}),r.d(t,"_76",function(){return E.r}),r.d(t,"_77",function(){return E.s}),r.d(t,"_78",function(){return E.t}),r.d(t,"_38",function(){return S.a}),r.d(t,"_39",function(){return A.b}),r.d(t,"F",function(){return P.a}),r.d(t,"D",function(){return P.b})},function(e,t,r){"use strict";var n=r(284),i=r(285),o=r(456),a=r(178),s=r(457),u=r(458),c=r(459),l=r(460),p=r(126),f=r(127),h=r(182),d=r(467),m=r(186),v=r(93),y=r(130),g=r(297),_=r(188),b=r(300),w=r(301),C=r(302),E=r(474),S=r(131),A=r(132),P=r(306),x=r(307),T=r(189),O=r(308),R=r(190),M=r(191),N=r(78),I=r(194);r.d(t,"a",function(){return D});var D={isDefaultChangeDetectionStrategy:f.c,ChangeDetectorStatus:f.b,constructDependencies:m.b,LifecycleHooks:P.a,LIFECYCLE_HOOKS_VALUES:P.b,ReflectorReader:R.a,CodegenComponentFactoryResolver:y.b,AppElement:_.a,AppView:E.a,DebugAppView:E.b,NgModuleInjector:b.a,registerModuleFactory:w.a,ViewType:S.a,view_utils:A,ViewMetadata:x.a,DebugContext:g.a,StaticNodeDebugInfo:g.b,devModeEqual:p.b,UNINITIALIZED:p.a,ValueUnwrapper:p.c,RenderDebugInfo:M.c,TemplateRef_:C.a,ReflectionCapabilities:O.a,makeDecorator:N.c,DebugDomRootRenderer:d.a,Console:h.a,reflector:T.a,Reflector:T.b,NoOpAnimationPlayer:a.a,AnimationPlayer:a.b,AnimationSequencePlayer:s.a,AnimationGroupPlayer:i.a,AnimationKeyframe:o.a,prepareFinalAnimationStyles:u.a,balanceAnimationKeyframes:u.b,flattenStyles:u.c,clearStyles:u.d,renderStyles:u.e,collectAndResolveStyles:u.f,AnimationStyles:c.a,ANY_STATE:n.b,DEFAULT_STATE:n.c,EMPTY_STATE:n.d,FILL_STYLE_FLAG:n.a,ComponentStillLoadingError:v.c,isPromise:I.a,AnimationTransition:l.a}},function(e,t,r){"use strict";var n=r(3),i=r(292);r.d(t,"a",function(){return o});var o=function(){function DebugDomRootRenderer(e){this._delegate=e}return DebugDomRootRenderer.prototype.renderComponent=function(e){return new a(this._delegate.renderComponent(e))},DebugDomRootRenderer}(),a=function(){function DebugDomRenderer(e){this._delegate=e}return DebugDomRenderer.prototype.selectRootElement=function(e,t){var n=this._delegate.selectRootElement(e,t),o=new i.a(n,null,t);return r.i(i.b)(o),n},DebugDomRenderer.prototype.createElement=function(e,t,n){var o=this._delegate.createElement(e,t,n),a=new i.a(o,r.i(i.c)(e),n);return a.name=t,r.i(i.b)(a),o},DebugDomRenderer.prototype.createViewRoot=function(e){return this._delegate.createViewRoot(e)},DebugDomRenderer.prototype.createTemplateAnchor=function(e,t){var n=this._delegate.createTemplateAnchor(e,t),o=new i.d(n,r.i(i.c)(e),t);return r.i(i.b)(o),n},DebugDomRenderer.prototype.createText=function(e,t,n){var o=this._delegate.createText(e,t,n),a=new i.d(o,r.i(i.c)(e),n);return r.i(i.b)(a),o},DebugDomRenderer.prototype.projectNodes=function(e,t){var o=r.i(i.c)(e);if(r.i(n.d)(o)&&o instanceof i.a){var a=o;t.forEach(function(e){a.addChild(r.i(i.c)(e))})}this._delegate.projectNodes(e,t)},DebugDomRenderer.prototype.attachViewAfter=function(e,t){var o=r.i(i.c)(e);if(r.i(n.d)(o)){var a=o.parent;if(t.length>0&&r.i(n.d)(a)){var s=[];t.forEach(function(e){return s.push(r.i(i.c)(e))}),a.insertChildrenAfter(o,s)}}this._delegate.attachViewAfter(e,t)},DebugDomRenderer.prototype.detachView=function(e){e.forEach(function(e){var t=r.i(i.c)(e);r.i(n.d)(t)&&r.i(n.d)(t.parent)&&t.parent.removeChild(t)}),this._delegate.detachView(e)},DebugDomRenderer.prototype.destroyView=function(e,t){t.forEach(function(e){r.i(i.e)(r.i(i.c)(e))}),this._delegate.destroyView(e,t)},DebugDomRenderer.prototype.listen=function(e,t,o){var a=r.i(i.c)(e);return r.i(n.d)(a)&&a.listeners.push(new i.f(t,o)),this._delegate.listen(e,t,o)},DebugDomRenderer.prototype.listenGlobal=function(e,t,r){return this._delegate.listenGlobal(e,t,r)},DebugDomRenderer.prototype.setElementProperty=function(e,t,o){var a=r.i(i.c)(e);r.i(n.d)(a)&&a instanceof i.a&&(a.properties[t]=o),this._delegate.setElementProperty(e,t,o)},DebugDomRenderer.prototype.setElementAttribute=function(e,t,o){var a=r.i(i.c)(e);r.i(n.d)(a)&&a instanceof i.a&&(a.attributes[t]=o),this._delegate.setElementAttribute(e,t,o)},DebugDomRenderer.prototype.setBindingDebugInfo=function(e,t,r){this._delegate.setBindingDebugInfo(e,t,r)},DebugDomRenderer.prototype.setElementClass=function(e,t,o){var a=r.i(i.c)(e);r.i(n.d)(a)&&a instanceof i.a&&(a.classes[t]=o),this._delegate.setElementClass(e,t,o)},DebugDomRenderer.prototype.setElementStyle=function(e,t,o){var a=r.i(i.c)(e);r.i(n.d)(a)&&a instanceof i.a&&(a.styles[t]=o),this._delegate.setElementStyle(e,t,o)},DebugDomRenderer.prototype.invokeElementMethod=function(e,t,r){this._delegate.invokeElementMethod(e,t,r)},DebugDomRenderer.prototype.setText=function(e,t){this._delegate.setText(e,t)},DebugDomRenderer.prototype.animate=function(e,t,r,n,i,o){return this._delegate.animate(e,t,r,n,i,o)},DebugDomRenderer}()},function(e,t,r){"use strict";function _mapProviders(e,t){for(var r=new Array(e._proto.numberOfProviders),n=0;n<e._proto.numberOfProviders;++n)r[n]=t(e._proto.getProviderAtIndex(n));return r}var n=r(19),i=r(29),o=r(128),a=r(129),s=r(293),u=r(185),c=r(186);r.d(t,"a",function(){return y});var l=10,p=new Object,f=function(){function ReflectiveProtoInjectorInlineStrategy(e,t){this.provider0=null,this.provider1=null,this.provider2=null,this.provider3=null,this.provider4=null,this.provider5=null,this.provider6=null,this.provider7=null,this.provider8=null,this.provider9=null,this.keyId0=null,this.keyId1=null,this.keyId2=null,this.keyId3=null,this.keyId4=null,this.keyId5=null,this.keyId6=null,this.keyId7=null,this.keyId8=null,this.keyId9=null;var r=t.length;r>0&&(this.provider0=t[0],this.keyId0=t[0].key.id),r>1&&(this.provider1=t[1],this.keyId1=t[1].key.id),r>2&&(this.provider2=t[2],this.keyId2=t[2].key.id),r>3&&(this.provider3=t[3],this.keyId3=t[3].key.id),r>4&&(this.provider4=t[4],this.keyId4=t[4].key.id),r>5&&(this.provider5=t[5],this.keyId5=t[5].key.id),r>6&&(this.provider6=t[6],this.keyId6=t[6].key.id),r>7&&(this.provider7=t[7],this.keyId7=t[7].key.id),r>8&&(this.provider8=t[8],this.keyId8=t[8].key.id),r>9&&(this.provider9=t[9],this.keyId9=t[9].key.id)}return ReflectiveProtoInjectorInlineStrategy.prototype.getProviderAtIndex=function(e){if(0==e)return this.provider0;if(1==e)return this.provider1;if(2==e)return this.provider2;if(3==e)return this.provider3;if(4==e)return this.provider4;if(5==e)return this.provider5;if(6==e)return this.provider6;if(7==e)return this.provider7;if(8==e)return this.provider8;if(9==e)return this.provider9;throw new s.d(e)},ReflectiveProtoInjectorInlineStrategy.prototype.createInjectorStrategy=function(e){return new m(e,this)},ReflectiveProtoInjectorInlineStrategy}(),h=function(){function ReflectiveProtoInjectorDynamicStrategy(e,t){this.providers=t;var r=t.length;this.keyIds=new Array(r);for(var n=0;n<r;n++)this.keyIds[n]=t[n].key.id}return ReflectiveProtoInjectorDynamicStrategy.prototype.getProviderAtIndex=function(e){if(e<0||e>=this.providers.length)throw new s.d(e);return this.providers[e]},ReflectiveProtoInjectorDynamicStrategy.prototype.createInjectorStrategy=function(e){return new v(this,e)},ReflectiveProtoInjectorDynamicStrategy}(),d=function(){function ReflectiveProtoInjector(e){this.numberOfProviders=e.length,this._strategy=e.length>l?new h(this,e):new f(this,e)}return ReflectiveProtoInjector.fromResolvedProviders=function(e){return new ReflectiveProtoInjector(e)},ReflectiveProtoInjector.prototype.getProviderAtIndex=function(e){return this._strategy.getProviderAtIndex(e)},ReflectiveProtoInjector}(),m=function(){function ReflectiveInjectorInlineStrategy(e,t){this.injector=e,this.protoStrategy=t,this.obj0=p,this.obj1=p,this.obj2=p,this.obj3=p,this.obj4=p,this.obj5=p,this.obj6=p,this.obj7=p,this.obj8=p,this.obj9=p}return ReflectiveInjectorInlineStrategy.prototype.resetConstructionCounter=function(){this.injector._constructionCounter=0},ReflectiveInjectorInlineStrategy.prototype.instantiateProvider=function(e){return this.injector._new(e)},ReflectiveInjectorInlineStrategy.prototype.getObjByKeyId=function(e){var t=this.protoStrategy,r=this.injector;return t.keyId0===e?(this.obj0===p&&(this.obj0=r._new(t.provider0)),this.obj0):t.keyId1===e?(this.obj1===p&&(this.obj1=r._new(t.provider1)),this.obj1):t.keyId2===e?(this.obj2===p&&(this.obj2=r._new(t.provider2)),this.obj2):t.keyId3===e?(this.obj3===p&&(this.obj3=r._new(t.provider3)),this.obj3):t.keyId4===e?(this.obj4===p&&(this.obj4=r._new(t.provider4)),this.obj4):t.keyId5===e?(this.obj5===p&&(this.obj5=r._new(t.provider5)),this.obj5):t.keyId6===e?(this.obj6===p&&(this.obj6=r._new(t.provider6)),this.obj6):t.keyId7===e?(this.obj7===p&&(this.obj7=r._new(t.provider7)),this.obj7):t.keyId8===e?(this.obj8===p&&(this.obj8=r._new(t.provider8)),this.obj8):t.keyId9===e?(this.obj9===p&&(this.obj9=r._new(t.provider9)),this.obj9):p},ReflectiveInjectorInlineStrategy.prototype.getObjAtIndex=function(e){if(0==e)return this.obj0;if(1==e)return this.obj1;if(2==e)return this.obj2;if(3==e)return this.obj3;if(4==e)return this.obj4;if(5==e)return this.obj5;if(6==e)return this.obj6;if(7==e)return this.obj7;if(8==e)return this.obj8;if(9==e)return this.obj9;throw new s.d(e)},ReflectiveInjectorInlineStrategy.prototype.getMaxNumberOfObjects=function(){return l},ReflectiveInjectorInlineStrategy}(),v=function(){function ReflectiveInjectorDynamicStrategy(e,t){this.protoStrategy=e,this.injector=t,this.objs=new Array(e.providers.length),n.a.fill(this.objs,p)}return ReflectiveInjectorDynamicStrategy.prototype.resetConstructionCounter=function(){this.injector._constructionCounter=0},ReflectiveInjectorDynamicStrategy.prototype.instantiateProvider=function(e){return this.injector._new(e)},ReflectiveInjectorDynamicStrategy.prototype.getObjByKeyId=function(e){for(var t=this.protoStrategy,r=0;r<t.keyIds.length;r++)if(t.keyIds[r]===e)return this.objs[r]===p&&(this.objs[r]=this.injector._new(t.providers[r])),this.objs[r];return p},ReflectiveInjectorDynamicStrategy.prototype.getObjAtIndex=function(e){if(e<0||e>=this.objs.length)throw new s.d(e);return this.objs[e]},ReflectiveInjectorDynamicStrategy.prototype.getMaxNumberOfObjects=function(){return this.objs.length},ReflectiveInjectorDynamicStrategy}(),y=function(){function ReflectiveInjector(){}return ReflectiveInjector.resolve=function(e){return r.i(c.a)(e)},ReflectiveInjector.resolveAndCreate=function(e,t){void 0===t&&(t=null);var r=ReflectiveInjector.resolve(e);return ReflectiveInjector.fromResolvedProviders(r,t)},ReflectiveInjector.fromResolvedProviders=function(e,t){return void 0===t&&(t=null),new g(d.fromResolvedProviders(e),t)},Object.defineProperty(ReflectiveInjector.prototype,"parent",{get:function(){return r.i(i.a)()},enumerable:!0,configurable:!0}),ReflectiveInjector.prototype.resolveAndCreateChild=function(e){return r.i(i.a)()},ReflectiveInjector.prototype.createChildFromResolved=function(e){return r.i(i.a)()},ReflectiveInjector.prototype.resolveAndInstantiate=function(e){return r.i(i.a)()},ReflectiveInjector.prototype.instantiateResolved=function(e){return r.i(i.a)()},ReflectiveInjector}(),g=function(){function ReflectiveInjector_(e,t){void 0===t&&(t=null),this._constructionCounter=0,this._proto=e,this._parent=t,this._strategy=e._strategy.createInjectorStrategy(this)}return ReflectiveInjector_.prototype.get=function(e,t){return void 0===t&&(t=o.a),this._getByKey(u.a.get(e),null,null,t)},ReflectiveInjector_.prototype.getAt=function(e){return this._strategy.getObjAtIndex(e)},Object.defineProperty(ReflectiveInjector_.prototype,"parent",{get:function(){return this._parent},enumerable:!0,configurable:!0}),Object.defineProperty(ReflectiveInjector_.prototype,"internalStrategy",{get:function(){return this._strategy},enumerable:!0,configurable:!0}),ReflectiveInjector_.prototype.resolveAndCreateChild=function(e){var t=y.resolve(e);return this.createChildFromResolved(t)},ReflectiveInjector_.prototype.createChildFromResolved=function(e){var t=new d(e),r=new ReflectiveInjector_(t);return r._parent=this,r},ReflectiveInjector_.prototype.resolveAndInstantiate=function(e){return this.instantiateResolved(y.resolve([e])[0])},ReflectiveInjector_.prototype.instantiateResolved=function(e){return this._instantiateProvider(e)},ReflectiveInjector_.prototype._new=function(e){if(this._constructionCounter++>this._strategy.getMaxNumberOfObjects())throw new s.e(this,e.key);return this._instantiateProvider(e)},ReflectiveInjector_.prototype._instantiateProvider=function(e){if(e.multiProvider){for(var t=new Array(e.resolvedFactories.length),r=0;r<e.resolvedFactories.length;++r)t[r]=this._instantiate(e,e.resolvedFactories[r]);return t}return this._instantiate(e,e.resolvedFactories[0])},ReflectiveInjector_.prototype._instantiate=function(e,t){var r,n,i,o,a,u,c,l,p,f,h,d,m,v,y,g,_,b,w,C,E=t.factory,S=t.dependencies,A=S.length;try{r=A>0?this._getByReflectiveDependency(e,S[0]):null,n=A>1?this._getByReflectiveDependency(e,S[1]):null,i=A>2?this._getByReflectiveDependency(e,S[2]):null,o=A>3?this._getByReflectiveDependency(e,S[3]):null,a=A>4?this._getByReflectiveDependency(e,S[4]):null,u=A>5?this._getByReflectiveDependency(e,S[5]):null,c=A>6?this._getByReflectiveDependency(e,S[6]):null,l=A>7?this._getByReflectiveDependency(e,S[7]):null,p=A>8?this._getByReflectiveDependency(e,S[8]):null,f=A>9?this._getByReflectiveDependency(e,S[9]):null,h=A>10?this._getByReflectiveDependency(e,S[10]):null,d=A>11?this._getByReflectiveDependency(e,S[11]):null,m=A>12?this._getByReflectiveDependency(e,S[12]):null,v=A>13?this._getByReflectiveDependency(e,S[13]):null,y=A>14?this._getByReflectiveDependency(e,S[14]):null,g=A>15?this._getByReflectiveDependency(e,S[15]):null,_=A>16?this._getByReflectiveDependency(e,S[16]):null,b=A>17?this._getByReflectiveDependency(e,S[17]):null,w=A>18?this._getByReflectiveDependency(e,S[18]):null,C=A>19?this._getByReflectiveDependency(e,S[19]):null}catch(t){throw(t instanceof s.f||t instanceof s.g)&&t.addKey(this,e.key),t}var P;try{switch(A){case 0:P=E();break;case 1:P=E(r);break;case 2:P=E(r,n);break;case 3:P=E(r,n,i);break;case 4:P=E(r,n,i,o);break;case 5:P=E(r,n,i,o,a);break;case 6:P=E(r,n,i,o,a,u);break;case 7:P=E(r,n,i,o,a,u,c);break;case 8:P=E(r,n,i,o,a,u,c,l);break;case 9:P=E(r,n,i,o,a,u,c,l,p);break;case 10:P=E(r,n,i,o,a,u,c,l,p,f);break;case 11:P=E(r,n,i,o,a,u,c,l,p,f,h);break;case 12:P=E(r,n,i,o,a,u,c,l,p,f,h,d);break;case 13:P=E(r,n,i,o,a,u,c,l,p,f,h,d,m);break;case 14:P=E(r,n,i,o,a,u,c,l,p,f,h,d,m,v);break;case 15:P=E(r,n,i,o,a,u,c,l,p,f,h,d,m,v,y);break;case 16:P=E(r,n,i,o,a,u,c,l,p,f,h,d,m,v,y,g);break;case 17:P=E(r,n,i,o,a,u,c,l,p,f,h,d,m,v,y,g,_);break;case 18:P=E(r,n,i,o,a,u,c,l,p,f,h,d,m,v,y,g,_,b);break;case 19:P=E(r,n,i,o,a,u,c,l,p,f,h,d,m,v,y,g,_,b,w);break;case 20:P=E(r,n,i,o,a,u,c,l,p,f,h,d,m,v,y,g,_,b,w,C);break;default:throw new Error("Cannot instantiate '"+e.key.displayName+"' because it has more than 20 dependencies")}}catch(t){throw new s.g(this,t,t.stack,e.key)}return P},ReflectiveInjector_.prototype._getByReflectiveDependency=function(e,t){return this._getByKey(t.key,t.lowerBoundVisibility,t.upperBoundVisibility,t.optional?null:o.a)},ReflectiveInjector_.prototype._getByKey=function(e,t,r,n){return e===_?this:r instanceof a.d?this._getByKeySelf(e,n):this._getByKeyDefault(e,n,t)},ReflectiveInjector_.prototype._throwOrNull=function(e,t){if(t!==o.a)return t;throw new s.h(this,e)},ReflectiveInjector_.prototype._getByKeySelf=function(e,t){var r=this._strategy.getObjByKeyId(e.id);return r!==p?r:this._throwOrNull(e,t)},ReflectiveInjector_.prototype._getByKeyDefault=function(e,t,r){var n;for(n=r instanceof a.f?this._parent:this;n instanceof ReflectiveInjector_;){var i=n,o=i._strategy.getObjByKeyId(e.id);if(o!==p)return o;n=i._parent}return null!==n?n.get(e.token,t):this._throwOrNull(e,t)},Object.defineProperty(ReflectiveInjector_.prototype,"displayName",{get:function(){var e=_mapProviders(this,function(e){return' "'+e.key.displayName+'" '}).join(", ");return"ReflectiveInjector(providers: ["+e+"])"},enumerable:!0,configurable:!0}),ReflectiveInjector_.prototype.toString=function(){return this.displayName},ReflectiveInjector_}(),_=u.a.get(o.b)},function(e,t,r){"use strict";var n=r(93),i=r(296),o=r(130),a=r(298),s=r(300),u=r(301),c=r(472),l=r(473),p=r(302),f=r(303),h=r(304);r.d(t,"j",function(){return n.e}),r.d(t,"k",function(){return n.a}),r.d(t,"h",function(){return n.d}),r.d(t,"i",function(){return n.b}),r.d(t,"f",function(){return i.a}),r.d(t,"l",function(){return i.b}),r.d(t,"e",function(){return o.a}),r.d(t,"a",function(){return a.a}),r.d(t,"g",function(){return s.b}),r.d(t,"m",function(){return s.c}),r.d(t,"n",function(){return u.b}),r.d(t,"o",function(){return u.c}),r.d(t,"d",function(){return c.a}),r.d(t,"p",function(){return l.a}),r.d(t,"q",function(){return l.b}),r.d(t,"c",function(){return p.b}),r.d(t,"b",function(){return f.b}),r.d(t,"r",function(){return h.b}),r.d(t,"s",function(){return h.c})},function(e,t,r){"use strict";var n=r(285),i=r(286),o=r(461);r.d(t,"a",function(){return a});var a=function(){function AnimationViewContext(){this._players=new o.a}return AnimationViewContext.prototype.onAllActiveAnimationsDone=function(e){var t=this._players.getAllPlayers();t.length?new n.a(t).onDone(function(){return e()}):e()},AnimationViewContext.prototype.queueAnimation=function(e,t,n){r.i(i.b)(n),this._players.set(e,t,n)},AnimationViewContext.prototype.cancelActiveAnimation=function(e,t,r){if(void 0===r&&(r=!1),r)this._players.findAllPlayersByElement(e).forEach(function(e){return e.destroy()});else{var n=this._players.find(e,t);n&&n.destroy()}},AnimationViewContext}()},function(e,t,r){"use strict";var n=r(128);r.d(t,"a",function(){return a});var i=this&&this.__extends||function(e,t){function __(){this.constructor=e}for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r]);e.prototype=null===t?Object.create(t):(__.prototype=t.prototype,new __)},o=new Object,a=function(e){function ElementInjector(t,r){e.call(this),this._view=t,this._nodeIndex=r}return i(ElementInjector,e),ElementInjector.prototype.get=function(e,t){void 0===t&&(t=n.a);var r=o;return r===o&&(r=this._view.injectorGet(e,this._nodeIndex,o)),r===o&&(r=this._view.parentInjector.get(e,t)),r},ElementInjector}(n.b)},function(e,t,r){"use strict";var n=r(187),i=r(19),o=r(3);r.d(t,"a",function(){return a});var a=function(){function QueryList(){this._dirty=!0,this._results=[],this._emitter=new n.a}return Object.defineProperty(QueryList.prototype,"changes",{get:function(){return this._emitter},enumerable:!0,configurable:!0}),Object.defineProperty(QueryList.prototype,"length",{get:function(){return this._results.length},enumerable:!0,configurable:!0}),Object.defineProperty(QueryList.prototype,"first",{get:function(){return this._results[0]},enumerable:!0,configurable:!0}),Object.defineProperty(QueryList.prototype,"last",{get:function(){return this._results[this.length-1]},enumerable:!0,configurable:!0}),QueryList.prototype.map=function(e){return this._results.map(e)},QueryList.prototype.filter=function(e){return this._results.filter(e)},QueryList.prototype.reduce=function(e,t){return this._results.reduce(e,t)},QueryList.prototype.forEach=function(e){this._results.forEach(e)},QueryList.prototype.some=function(e){return this._results.some(e)},QueryList.prototype.toArray=function(){return this._results.slice()},QueryList.prototype[r.i(o.f)()]=function(){return this._results[r.i(o.f)()]()},QueryList.prototype.toString=function(){return this._results.toString()},QueryList.prototype.reset=function(e){this._results=i.a.flatten(e),this._dirty=!1},QueryList.prototype.notifyOnChanges=function(){this._emitter.emit(this)},QueryList.prototype.setDirty=function(){this._dirty=!0},Object.defineProperty(QueryList.prototype,"dirty",{get:function(){return this._dirty},enumerable:!0,configurable:!0}),QueryList}()},function(e,t,r){"use strict";function checkNotEmpty(e,t,r){if(!e)throw new Error("Cannot find '"+r+"' in '"+t+"'");return e}var n=r(33),i=r(93);r.d(t,"b",function(){return s}),r.d(t,"a",function(){return c});var o="#",a="NgFactory",s=function(){function SystemJsNgModuleLoaderConfig(){}return SystemJsNgModuleLoaderConfig}(),u={factoryPathPrefix:"",factoryPathSuffix:".ngfactory"},c=function(){function SystemJsNgModuleLoader(e,t){this._compiler=e,this._config=t||u}return SystemJsNgModuleLoader.prototype.load=function(e){var t=this._compiler instanceof i.b;return t?this.loadFactory(e):this.loadAndCompile(e)},SystemJsNgModuleLoader.prototype.loadAndCompile=function(e){var t=this,n=e.split(o),i=n[0],a=n[1];return void 0===a&&(a="default"),r(390)(i).then(function(e){return e[a]}).then(function(e){return checkNotEmpty(e,i,a)}).then(function(e){return t._compiler.compileModuleAsync(e)})},SystemJsNgModuleLoader.prototype.loadFactory=function(e){var t=e.split(o),n=t[0],i=t[1],s=a;return void 0===i&&(i="default",s=""),r(390)(this._config.factoryPathPrefix+n+this._config.factoryPathSuffix).then(function(e){return e[i+s]}).then(function(e){return checkNotEmpty(e,n,i)})},SystemJsNgModuleLoader.decorators=[{type:n.b}],SystemJsNgModuleLoader.ctorParameters=[{type:i.b},{type:s,decorators:[{type:n.d}]}],SystemJsNgModuleLoader}()},function(e,t,r){"use strict";function _findLastRenderNode(e){var t;if(e instanceof c.a){var n=e;if(t=n.nativeElement,r.i(o.d)(n.nestedViews))for(var i=n.nestedViews.length-1;i>=0;i--){var a=n.nestedViews[i];a.rootNodesOrAppElements.length>0&&(t=_findLastRenderNode(a.rootNodesOrAppElements[a.rootNodesOrAppElements.length-1]))}}else t=e;return t}var n=r(125),i=r(19),o=r(3),a=r(133),s=r(470),u=r(297),c=r(188),l=r(471),p=r(299),f=r(304),h=r(131),d=r(132);r.d(t,"a",function(){return y}),r.d(t,"b",function(){return g});var m=this&&this.__extends||function(e,t){function __(){this.constructor=e}for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r]);e.prototype=null===t?Object.create(t):(__.prototype=t.prototype,new __)},v=r.i(a.a)("AppView#check(ascii id)"),y=function(){function AppView(e,t,r,n,i,o,a){this.clazz=e,this.componentType=t,this.type=r,this.viewUtils=n,this.parentInjector=i,this.declarationAppElement=o,this.cdMode=a,this.contentChildren=[],this.viewChildren=[],this.viewContainerElement=null,this.numberOfChecks=0,this.ref=new f.a(this),r===h.a.COMPONENT||r===h.a.HOST?this.renderer=n.renderComponent(t):this.renderer=o.parentView.renderer}return Object.defineProperty(AppView.prototype,"animationContext",{get:function(){return this._animationContext||(this._animationContext=new s.a),this._animationContext},enumerable:!0,configurable:!0}),Object.defineProperty(AppView.prototype,"destroyed",{get:function(){return this.cdMode===n.f.Destroyed},enumerable:!0,configurable:!0}),AppView.prototype.create=function(e,t,n){this.context=e;var i;switch(this.type){case h.a.COMPONENT:i=r.i(d.ensureSlotCount)(t,this.componentType.slotCount);break;case h.a.EMBEDDED:i=this.declarationAppElement.parentView.projectableNodes;break;case h.a.HOST:i=t}return this._hasExternalHostElement=r.i(o.d)(n),this.projectableNodes=i,this.createInternal(n)},AppView.prototype.createInternal=function(e){return null},AppView.prototype.init=function(e,t,r,n){this.rootNodesOrAppElements=e,this.allNodes=t,this.disposables=r,this.subscriptions=n,this.type===h.a.COMPONENT&&(this.declarationAppElement.parentView.viewChildren.push(this),this.dirtyParentQueriesInternal())},AppView.prototype.selectOrCreateHostElement=function(e,t,n){var i;return i=r.i(o.d)(t)?this.renderer.selectRootElement(t,n):this.renderer.createElement(null,e,n)},AppView.prototype.injectorGet=function(e,t,r){return this.injectorGetInternal(e,t,r)},AppView.prototype.injectorGetInternal=function(e,t,r){return r},AppView.prototype.injector=function(e){return r.i(o.d)(e)?new l.a(this,e):this.parentInjector},AppView.prototype.destroy=function(){this._hasExternalHostElement?this.renderer.detachView(this.flatRootNodes):r.i(o.d)(this.viewContainerElement)&&this.viewContainerElement.detachView(this.viewContainerElement.nestedViews.indexOf(this)),this._destroyRecurse()},AppView.prototype._destroyRecurse=function(){if(this.cdMode!==n.f.Destroyed){for(var e=this.contentChildren,t=0;t<e.length;t++)e[t]._destroyRecurse();e=this.viewChildren;for(var t=0;t<e.length;t++)e[t]._destroyRecurse();this.destroyLocal(),this.cdMode=n.f.Destroyed}},AppView.prototype.destroyLocal=function(){for(var e=this,t=this.type===h.a.COMPONENT?this.declarationAppElement.nativeElement:null,r=0;r<this.disposables.length;r++)this.disposables[r]();for(var r=0;r<this.subscriptions.length;r++)this.subscriptions[r].unsubscribe();this.destroyInternal(),this.dirtyParentQueriesInternal(),this._animationContext?this._animationContext.onAllActiveAnimationsDone(function(){return e.renderer.destroyView(t,e.allNodes)}):this.renderer.destroyView(t,this.allNodes)},AppView.prototype.destroyInternal=function(){},AppView.prototype.detachInternal=function(){},AppView.prototype.detach=function(){var e=this;this.detachInternal(),this._animationContext?this._animationContext.onAllActiveAnimationsDone(function(){return e.renderer.detachView(e.flatRootNodes)}):this.renderer.detachView(this.flatRootNodes)},Object.defineProperty(AppView.prototype,"changeDetectorRef",{get:function(){return this.ref},enumerable:!0,configurable:!0}),Object.defineProperty(AppView.prototype,"parent",{get:function(){return r.i(o.d)(this.declarationAppElement)?this.declarationAppElement.parentView:null},enumerable:!0,configurable:!0}),Object.defineProperty(AppView.prototype,"flatRootNodes",{get:function(){return r.i(d.flattenNestedViewRenderNodes)(this.rootNodesOrAppElements)},enumerable:!0,configurable:!0}),Object.defineProperty(AppView.prototype,"lastRootNode",{get:function(){var e=this.rootNodesOrAppElements.length>0?this.rootNodesOrAppElements[this.rootNodesOrAppElements.length-1]:null;return _findLastRenderNode(e)},enumerable:!0,configurable:!0}),AppView.prototype.dirtyParentQueriesInternal=function(){},AppView.prototype.detectChanges=function(e){var t=v(this.clazz);this.cdMode!==n.f.Checked&&this.cdMode!==n.f.Errored&&(this.cdMode===n.f.Destroyed&&this.throwDestroyedError("detectChanges"),this.detectChangesInternal(e),this.cdMode===n.f.CheckOnce&&(this.cdMode=n.f.Checked),this.numberOfChecks++,r.i(a.b)(t))},AppView.prototype.detectChangesInternal=function(e){this.detectContentChildrenChanges(e), this.detectViewChildrenChanges(e)},AppView.prototype.detectContentChildrenChanges=function(e){for(var t=0;t<this.contentChildren.length;++t){var r=this.contentChildren[t];r.cdMode!==n.f.Detached&&r.detectChanges(e)}},AppView.prototype.detectViewChildrenChanges=function(e){for(var t=0;t<this.viewChildren.length;++t){var r=this.viewChildren[t];r.cdMode!==n.f.Detached&&r.detectChanges(e)}},AppView.prototype.markContentChildAsMoved=function(e){this.dirtyParentQueriesInternal()},AppView.prototype.addToContentChildren=function(e){e.parentView.contentChildren.push(this),this.viewContainerElement=e,this.dirtyParentQueriesInternal()},AppView.prototype.removeFromContentChildren=function(e){i.a.remove(e.parentView.contentChildren,this),this.dirtyParentQueriesInternal(),this.viewContainerElement=null},AppView.prototype.markAsCheckOnce=function(){this.cdMode=n.f.CheckOnce},AppView.prototype.markPathToRootAsCheckOnce=function(){for(var e=this;r.i(o.d)(e)&&e.cdMode!==n.f.Detached;){e.cdMode===n.f.Checked&&(e.cdMode=n.f.CheckOnce);var t=e.type===h.a.COMPONENT?e.declarationAppElement:e.viewContainerElement;e=r.i(o.d)(t)?t.parentView:null}},AppView.prototype.eventHandler=function(e){return e},AppView.prototype.throwDestroyedError=function(e){throw new p.b(e)},AppView}(),g=function(e){function DebugAppView(t,r,n,i,o,a,s,u){e.call(this,t,r,n,i,o,a,s),this.staticNodeDebugInfos=u,this._currentDebugContext=null}return m(DebugAppView,e),DebugAppView.prototype.create=function(t,r,n){this._resetDebug();try{return e.prototype.create.call(this,t,r,n)}catch(e){throw this._rethrowWithContext(e),e}},DebugAppView.prototype.injectorGet=function(t,r,n){this._resetDebug();try{return e.prototype.injectorGet.call(this,t,r,n)}catch(e){throw this._rethrowWithContext(e),e}},DebugAppView.prototype.detach=function(){this._resetDebug();try{e.prototype.detach.call(this)}catch(e){throw this._rethrowWithContext(e),e}},DebugAppView.prototype.destroyLocal=function(){this._resetDebug();try{e.prototype.destroyLocal.call(this)}catch(e){throw this._rethrowWithContext(e),e}},DebugAppView.prototype.detectChanges=function(t){this._resetDebug();try{e.prototype.detectChanges.call(this,t)}catch(e){throw this._rethrowWithContext(e),e}},DebugAppView.prototype._resetDebug=function(){this._currentDebugContext=null},DebugAppView.prototype.debug=function(e,t,r){return this._currentDebugContext=new u.a(this,e,t,r)},DebugAppView.prototype._rethrowWithContext=function(e){if(!(e instanceof p.c)&&(e instanceof p.a||(this.cdMode=n.f.Errored),r.i(o.d)(this._currentDebugContext)))throw new p.c(e,this._currentDebugContext)},DebugAppView.prototype.eventHandler=function(t){var r=this,n=e.prototype.eventHandler.call(this,t);return function(e){r._resetDebug();try{return n(e)}catch(e){throw r._rethrowWithContext(e),e}}},DebugAppView}(y)},function(e,t,r){"use strict";var n=r(184),i=r(78);r.d(t,"b",function(){return o}),r.d(t,"a",function(){return a}),r.d(t,"c",function(){return s}),r.d(t,"e",function(){return u}),r.d(t,"d",function(){return c}),r.d(t,"g",function(){return l}),r.d(t,"f",function(){return p});var o=new n.a("AnalyzeForEntryComponents"),a=r.i(i.a)("Attribute",[["attributeName",void 0]]),s=function(){function Query(){}return Query}(),u=r.i(i.b)("ContentChildren",[["selector",void 0],{first:!1,isViewQuery:!1,descendants:!1,read:void 0}],s),c=r.i(i.b)("ContentChild",[["selector",void 0],{first:!0,isViewQuery:!1,descendants:!0,read:void 0}],s),l=r.i(i.b)("ViewChildren",[["selector",void 0],{first:!1,isViewQuery:!0,descendants:!0,read:void 0}],s),p=r.i(i.b)("ViewChild",[["selector",void 0],{first:!0,isViewQuery:!0,descendants:!0,read:void 0}],s)},function(e,t,r){"use strict";var n=r(127),i=r(78);r.d(t,"a",function(){return o}),r.d(t,"g",function(){return a}),r.d(t,"c",function(){return s}),r.d(t,"b",function(){return u}),r.d(t,"d",function(){return c}),r.d(t,"e",function(){return l}),r.d(t,"f",function(){return p});var o=r.i(i.c)("Directive",{selector:void 0,inputs:void 0,outputs:void 0,host:void 0,providers:void 0,exportAs:void 0,queries:void 0}),a=r.i(i.c)("Component",{selector:void 0,inputs:void 0,outputs:void 0,host:void 0,exportAs:void 0,moduleId:void 0,providers:void 0,viewProviders:void 0,changeDetection:n.a.Default,queries:void 0,templateUrl:void 0,template:void 0,styleUrls:void 0,styles:void 0,animations:void 0,encapsulation:void 0,interpolation:void 0,entryComponents:void 0},o),s=r.i(i.c)("Pipe",{name:void 0,pure:!0}),u=r.i(i.b)("Input",[["bindingPropertyName",void 0]]),c=r.i(i.b)("Output",[["bindingPropertyName",void 0]]),l=r.i(i.b)("HostBinding",[["hostPropertyName",void 0]]),p=r.i(i.b)("HostListener",[["eventName",void 0],["args",[]]])},function(e,t,r){"use strict";var n=r(78);r.d(t,"c",function(){return i}),r.d(t,"b",function(){return o}),r.d(t,"a",function(){return a});var i={name:"custom-elements"},o={name:"no-errors-schema"},a=r.i(n.c)("NgModule",{providers:void 0,declarations:void 0,imports:void 0,exports:void 0,entryComponents:void 0,bootstrap:void 0,schemas:void 0,id:void 0})},function(e,t,r){"use strict";function _reflector(){return o.a}var n=r(180),i=r(182),o=r(189),a=r(190),s=r(192);r.d(t,"a",function(){return c});var u=[n.a,{provide:n.b,useExisting:n.a},{provide:o.b,useFactory:_reflector,deps:[]},{provide:a.a,useExisting:o.b},s.b,i.a],c=r.i(n.c)(null,"core",u)},function(e,t,r){"use strict";function detectWTF(){var e=n.a.wtf;return!(!e||!(i=e.trace))&&(o=i.events,!0)}function createScope(e,t){return void 0===t&&(t=null),o.createScope(e,t)}function leave(e,t){return i.leaveScope(e,t),t}function startTimeRange(e,t){return i.beginTimeRange(e,t)}function endTimeRange(e){i.endTimeRange(e)}var n=r(3);t.a=detectWTF,t.b=createScope,t.c=leave,t.d=startTimeRange,t.e=endTimeRange;var i,o},function(e,t,r){"use strict";var n=r(191);r.d(t,"c",function(){return n.a}),r.d(t,"a",function(){return n.d}),r.d(t,"b",function(){return n.b})},function(e,t,r){"use strict";var n=r(78);r.d(t,"a",function(){return n.d})},function(e,t,r){"use strict";var n=r(195);r.d(t,"a",function(){return n.a})},function(e,t,r){"use strict";var n=r(0),i=r(134),o=r(135),a=r(197),s=r(95),u=r(198),c=r(136),l=r(199),p=r(96),f=r(200),h=r(201),d=r(97),m=r(98),v=r(138),y=r(139),g=r(202);r(62);r.d(t,"a",function(){return b}),r.d(t,"c",function(){return w}),r.d(t,"b",function(){return C});var _=[v.b,y.b,o.a,l.a,i.a,v.a,y.a,p.a,a.a,a.b,g.a,g.b,g.c,g.d],b=[u.a,c.a,s.a],w=[f.a,d.a,h.a,m.a,m.b],C=function(){function InternalFormsSharedModule(){}return InternalFormsSharedModule.decorators=[{type:n.NgModule,args:[{declarations:_,exports:_}]}],InternalFormsSharedModule.ctorParameters=[],InternalFormsSharedModule}()},function(e,t,r){"use strict";function normalizeValidator(e){return void 0!==e.validate?function(t){return e.validate(t)}:e}function normalizeAsyncValidator(e){return void 0!==e.validate?function(t){return e.validate(t)}:e}t.a=normalizeValidator,t.b=normalizeAsyncValidator},function(e,t,r){"use strict";var n=r(0),i=r(483),o=r(96),a=r(313);r.d(t,"a",function(){return s}),r.d(t,"b",function(){return u});var s=function(){function FormsModule(){}return FormsModule.decorators=[{type:n.NgModule,args:[{declarations:i.a,providers:[o.b],exports:[i.b,i.a]}]}],FormsModule.ctorParameters=[],FormsModule}(),u=function(){function ReactiveFormsModule(){}return ReactiveFormsModule.decorators=[{type:n.NgModule,args:[{declarations:[i.c],providers:[a.a,o.b],exports:[i.b,i.c]}]}],ReactiveFormsModule.ctorParameters=[],ReactiveFormsModule}()},function(e,t,r){"use strict";var n=r(196),i=r(94),o=r(134),a=r(43),s=r(36),u=r(135),c=r(62),l=r(197),p=r(95),f=r(198),h=r(136),d=r(96),m=r(200),v=r(201),y=r(97),g=r(98),_=r(138),b=r(139),w=r(202),C=r(313),E=r(140),S=r(37),A=r(485);r.d(t,"a",function(){return n.a}),r.d(t,"b",function(){return i.a}),r.d(t,"c",function(){return o.a}),r.d(t,"d",function(){return a.a}),r.d(t,"e",function(){return s.a}),r.d(t,"f",function(){return u.a}),r.d(t,"g",function(){return c.a}),r.d(t,"h",function(){return l.a}),r.d(t,"i",function(){return l.b}),r.d(t,"j",function(){return p.a}),r.d(t,"k",function(){return f.a}),r.d(t,"l",function(){return h.a}),r.d(t,"m",function(){return d.a}),r.d(t,"n",function(){return m.a}),r.d(t,"o",function(){return v.a}),r.d(t,"p",function(){return y.a}),r.d(t,"q",function(){return g.b}),r.d(t,"r",function(){return g.a}),r.d(t,"s",function(){return _.b}),r.d(t,"t",function(){return _.a}),r.d(t,"u",function(){return b.a}),r.d(t,"v",function(){return w.c}),r.d(t,"w",function(){return w.b}),r.d(t,"x",function(){return w.d}),r.d(t,"y",function(){return w.a}),r.d(t,"z",function(){return C.a}),r.d(t,"A",function(){return E.d}),r.d(t,"B",function(){return E.c}),r.d(t,"C",function(){return E.b}),r.d(t,"D",function(){return E.a}),r.d(t,"E",function(){return S.c}),r.d(t,"F",function(){return S.b}),r.d(t,"G",function(){return S.a}),r.d(t,"H",function(){return A.a}),r.d(t,"I",function(){return A.b})},function(e,t,r){"use strict";function _flattenArray(e,t){if(r.i(n.a)(e))for(var i=0;i<e.length;i++){var o=e[i];Array.isArray(o)?_flattenArray(o,t):t.push(o)}return t}var n=r(44);r.d(t,"a",function(){return o});var i=function(){try{if((new Map).values().next)return function(e,t){return t?Array.from(e.values()):Array.from(e.keys())}}catch(e){}return function(e,t){var r=new Array(e.size),n=0;return e.forEach(function(e,i){r[n]=t?e:i,n++}),r}}(),o=function(){function MapWrapper(){}return MapWrapper.createFromStringMap=function(e){var t=new Map;for(var r in e)t.set(r,e[r]);return t},MapWrapper.keys=function(e){return i(e,!1)},MapWrapper.values=function(e){return i(e,!0)},MapWrapper}();(function(){function StringMapWrapper(){}return StringMapWrapper.merge=function(e,t){for(var r={},n=0,i=Object.keys(e);n<i.length;n++){var o=i[n];r[o]=e[o]}for(var a=0,s=Object.keys(t);a<s.length;a++){var o=s[a];r[o]=t[o]}return r},StringMapWrapper.equals=function(e,t){var r=Object.keys(e),n=Object.keys(t);if(r.length!=n.length)return!1;for(var i=0;i<r.length;i++){var o=r[i];if(e[o]!==t[o])return!1}return!0},StringMapWrapper})(),function(){function ListWrapper(){}return ListWrapper.createFixedSize=function(e){return new Array(e)},ListWrapper.createGrowableSize=function(e){return new Array(e)},ListWrapper.clone=function(e){return e.slice(0)},ListWrapper.forEachWithIndex=function(e,t){for(var r=0;r<e.length;r++)t(e[r],r)},ListWrapper.first=function(e){return e?e[0]:null},ListWrapper.last=function(e){return e&&0!=e.length?e[e.length-1]:null},ListWrapper.indexOf=function(e,t,r){return void 0===r&&(r=0),e.indexOf(t,r)},ListWrapper.contains=function(e,t){return e.indexOf(t)!==-1},ListWrapper.reversed=function(e){var t=ListWrapper.clone(e);return t.reverse()},ListWrapper.concat=function(e,t){return e.concat(t)},ListWrapper.insert=function(e,t,r){e.splice(t,0,r)},ListWrapper.removeAt=function(e,t){var r=e[t];return e.splice(t,1),r},ListWrapper.removeAll=function(e,t){for(var r=0;r<t.length;++r){var n=e.indexOf(t[r]);e.splice(n,1)}},ListWrapper.remove=function(e,t){var r=e.indexOf(t);return r>-1&&(e.splice(r,1),!0)},ListWrapper.clear=function(e){e.length=0},ListWrapper.isEmpty=function(e){return 0==e.length},ListWrapper.fill=function(e,t,r,n){void 0===r&&(r=0),void 0===n&&(n=null),e.fill(t,r,null===n?e.length:n)},ListWrapper.equals=function(e,t){if(e.length!=t.length)return!1;for(var r=0;r<e.length;++r)if(e[r]!==t[r])return!1;return!0},ListWrapper.slice=function(e,t,r){return void 0===t&&(t=0),void 0===r&&(r=null),e.slice(t,null===r?void 0:r)},ListWrapper.splice=function(e,t,r){return e.splice(t,r)},ListWrapper.sort=function(e,t){r.i(n.a)(t)?e.sort(t):e.sort()},ListWrapper.toString=function(e){return e.toString()},ListWrapper.toJSON=function(e){return JSON.stringify(e)},ListWrapper.maximum=function(e,t){if(0==e.length)return null;for(var i=null,o=-(1/0),a=0;a<e.length;a++){var s=e[a];if(!r.i(n.b)(s)){var u=t(s);u>o&&(i=s,o=u)}}return i},ListWrapper.flatten=function(e){var t=[];return _flattenArray(e,t),t},ListWrapper.addAll=function(e,t){for(var r=0;r<t.length;r++)e.push(t[r])},ListWrapper}()},function(e,t,r){"use strict";function _createDefaultCookieXSRFStrategy(){return new s.a}function httpFactory(e,t){return new l.a(e,t)}function jsonpFactory(e,t){return new l.b(e,t)}var n=r(0),i=r(315),o=r(203),a=r(316),s=r(317),u=r(204),c=r(141),l=r(319),p=r(100);r.d(t,"a",function(){return f}),r.d(t,"b",function(){return h});var f=function(){function HttpModule(){}return HttpModule.decorators=[{type:n.NgModule,args:[{providers:[{provide:l.a,useFactory:httpFactory,deps:[s.b,u.a]},o.a,{provide:u.a,useClass:u.b},{provide:c.a,useClass:c.b},s.b,{provide:p.b,useFactory:_createDefaultCookieXSRFStrategy}]}]}],HttpModule.ctorParameters=[],HttpModule}(),h=function(){function JsonpModule(){}return JsonpModule.decorators=[{type:n.NgModule,args:[{providers:[{provide:l.b,useFactory:jsonpFactory,deps:[a.a,u.a]},i.a,{provide:u.a,useClass:u.b},{provide:c.a,useClass:c.b},{provide:a.a,useClass:a.b}]}]}],JsonpModule.ctorParameters=[],JsonpModule}()},function(e,t,r){"use strict";var n=r(203),i=r(316),o=r(317),a=r(204),s=r(141),u=r(55),c=r(99),l=r(319),p=r(488),f=r(100),h=r(320),d=r(205),m=r(143);r.d(t,"a",function(){return n.a}),r.d(t,"b",function(){return i.a}),r.d(t,"c",function(){return i.c}),r.d(t,"d",function(){return o.a}),r.d(t,"e",function(){return o.b}),r.d(t,"f",function(){return o.c}),r.d(t,"g",function(){return a.b}),r.d(t,"h",function(){return a.a}),r.d(t,"i",function(){return s.b}),r.d(t,"j",function(){return s.a}),r.d(t,"k",function(){return u.c}),r.d(t,"l",function(){return u.b}),r.d(t,"m",function(){return u.d}),r.d(t,"n",function(){return u.a}),r.d(t,"o",function(){return c.a}),r.d(t,"p",function(){return l.a}),r.d(t,"q",function(){return l.b}),r.d(t,"r",function(){return p.a}),r.d(t,"s",function(){return p.b}),r.d(t,"t",function(){return f.c}),r.d(t,"u",function(){return f.a}),r.d(t,"v",function(){return f.b}),r.d(t,"w",function(){return h.a}),r.d(t,"x",function(){return d.a}),r.d(t,"y",function(){return m.b}),r.d(t,"z",function(){return m.a})},function(e,t,r){"use strict";(function(e){r.d(t,"a",function(){return i});var n;n="undefined"==typeof window?"undefined"!=typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope?self:e:window;var i=n;i.assert=function(e){};Object.getPrototypeOf({}),function(){function NumberWrapper(){}return NumberWrapper.parseIntAutoRadix=function(e){var t=parseInt(e);if(isNaN(t))throw new Error("Invalid integer literal when parsing "+e);return t},NumberWrapper.parseInt=function(e,t){if(10==t){if(/^(\-|\+)?[0-9]+$/.test(e))return parseInt(e,t)}else if(16==t){if(/^(\-|\+)?[0-9ABCDEFabcdef]+$/.test(e))return parseInt(e,t)}else{var r=parseInt(e,t);if(!isNaN(r))return r}throw new Error("Invalid integer literal when parsing "+e+" in base "+t)},NumberWrapper.isNumeric=function(e){return!isNaN(e-parseFloat(e))},NumberWrapper}()}).call(t,r(28))},function(e,t,r){"use strict";var n=r(117),i=r(0),o=r(321),a=r(494),s=r(492);r.d(t,"a",function(){return u}),r.d(t,"b",function(){return c}),r.d(t,"c",function(){return s.a});var u=[{provide:n.a,useClass:a.a}],c=r.i(i.createPlatformFactory)(n.b,"browserDynamic",o.a)},function(e,t,r){"use strict";var n=r(321),i=r(322);r.d(t,"a",function(){return o});var o={INTERNAL_BROWSER_DYNAMIC_PLATFORM_PROVIDERS:n.a,ResourceLoaderImpl:i.a}},function(e,t,r){"use strict";var n=r(89);r.d(t,"a",function(){return i});var i=n.__platform_browser_private__.INTERNAL_BROWSER_PLATFORM_PROVIDERS;n.__platform_browser_private__.getDOM},function(e,t,r){"use strict";var n=r(117),i=r(490);r.d(t,"a",function(){return a});var o=this&&this.__extends||function(e,t){function __(){this.constructor=e}for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r]);e.prototype=null===t?Object.create(t):(__.prototype=t.prototype,new __)},a=function(e){function CachedResourceLoader(){if(e.call(this),this._cache=i.a.$templateCache,null==this._cache)throw new Error("CachedResourceLoader: Template cache was not found in $templateCache.")}return o(CachedResourceLoader,e),CachedResourceLoader.prototype.get=function(e){return this._cache.hasOwnProperty(e)?Promise.resolve(this._cache[e]):Promise.reject("CachedResourceLoader: Did not find cached template for "+e)},CachedResourceLoader}(n.a)},function(e,t,r){"use strict";var n=r(15),i=r(30);r.d(t,"a",function(){return a});var o=this&&this.__extends||function(e,t){function __(){this.constructor=e}for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r]);e.prototype=null===t?Object.create(t):(__.prototype=t.prototype,new __)},a=function(e){function GenericBrowserDomAdapter(){var t=this;e.call(this),this._animationPrefix=null,this._transitionEnd=null;try{var n=this.createElement("div",this.defaultDoc());if(r.i(i.a)(this.getStyle(n,"animationName")))this._animationPrefix="";else for(var o=["Webkit","Moz","O","ms"],a=0;a<o.length;a++)if(r.i(i.a)(this.getStyle(n,o[a]+"AnimationName"))){this._animationPrefix="-"+o[a].toLowerCase()+"-";break}var s={WebkitTransition:"webkitTransitionEnd",MozTransition:"transitionend",OTransition:"oTransitionEnd otransitionend",transition:"transitionend"};Object.keys(s).forEach(function(e){r.i(i.a)(t.getStyle(n,e))&&(t._transitionEnd=s[e])})}catch(e){this._animationPrefix=null,this._transitionEnd=null}}return o(GenericBrowserDomAdapter,e),GenericBrowserDomAdapter.prototype.getDistributedNodes=function(e){return e.getDistributedNodes()},GenericBrowserDomAdapter.prototype.resolveAndSetHref=function(e,t,r){e.href=null==r?t:t+"/../"+r},GenericBrowserDomAdapter.prototype.supportsDOMEvents=function(){return!0},GenericBrowserDomAdapter.prototype.supportsNativeShadowDOM=function(){return"function"==typeof this.defaultDoc().body.createShadowRoot},GenericBrowserDomAdapter.prototype.getAnimationPrefix=function(){return this._animationPrefix?this._animationPrefix:""},GenericBrowserDomAdapter.prototype.getTransitionEnd=function(){return this._transitionEnd?this._transitionEnd:""},GenericBrowserDomAdapter.prototype.supportsAnimation=function(){return r.i(i.a)(this._animationPrefix)&&r.i(i.a)(this._transitionEnd)},GenericBrowserDomAdapter}(n.b)},function(e,t,r){"use strict";function supportsState(){return!!window.history.pushState}t.a=supportsState},function(e,t,r){"use strict";var n=r(0),i=r(15),o=r(503),a=r(30);r.d(t,"a",function(){return u});var s=function(){function ChangeDetectionPerfRecord(e,t){this.msPerTick=e,this.numTicks=t}return ChangeDetectionPerfRecord}(),u=function(){function AngularTools(e){this.profiler=new c(e)}return AngularTools}(),c=function(){function AngularProfiler(e){this.appRef=e.injector.get(n.ApplicationRef)}return AngularProfiler.prototype.timeChangeDetection=function(e){var t=e&&e.record,n="Change Detection",u=r.i(a.a)(o.a.console.profile);t&&u&&o.a.console.profile(n);for(var c=r.i(i.a)().performanceNow(),l=0;l<5||r.i(i.a)().performanceNow()-c<500;)this.appRef.tick(),l++;var p=r.i(i.a)().performanceNow();t&&u&&o.a.console.profileEnd(n);var f=(p-c)/l;return o.a.console.log("ran "+l+" change detection cycles"),o.a.console.log(f.toFixed(2)+" ms per check"),new s(f,l)},AngularProfiler}()},function(e,t,r){"use strict";function enableDebugTools(e){return o.ng=new i.a(e),e}function disableDebugTools(){delete o.ng}var n=r(30),i=r(497);t.b=enableDebugTools,t.a=disableDebugTools;var o=n.d},function(e,t,r){"use strict";var n=r(15),i=r(30);r.d(t,"a",function(){return o});var o=function(){function By(){}return By.all=function(){return function(e){return!0}},By.css=function(e){return function(t){return!!r.i(i.a)(t.nativeElement)&&r.i(n.a)().elementMatches(t.nativeElement,e)}},By.directive=function(e){return function(t){return t.providerTokens.indexOf(e)!==-1}},By}()},function(e,t,r){"use strict";var n=r(81);r.d(t,"a",function(){return a});var i=this&&this.__extends||function(e,t){function __(){this.constructor=e}for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r]);e.prototype=null===t?Object.create(t):(__.prototype=t.prototype,new __)},o={pan:!0,panstart:!0,panmove:!0,panend:!0,pancancel:!0,panleft:!0,panright:!0,panup:!0,pandown:!0,pinch:!0,pinchstart:!0,pinchmove:!0,pinchend:!0,pinchcancel:!0,pinchin:!0,pinchout:!0,press:!0,pressup:!0,rotate:!0,rotatestart:!0,rotatemove:!0,rotateend:!0,rotatecancel:!0,swipe:!0,swipeleft:!0,swiperight:!0,swipeup:!0,swipedown:!0,tap:!0},a=function(e){function HammerGesturesPluginCommon(){e.call(this)}return i(HammerGesturesPluginCommon,e),HammerGesturesPluginCommon.prototype.supports=function(e){return o.hasOwnProperty(e.toLowerCase())},HammerGesturesPluginCommon}(n.b)},function(e,t,r){"use strict";function _populateStyles(e,t,a){var s={};return t.styles.forEach(function(e){Object.keys(e).forEach(function(t){var i=e[t],a=r.i(o.a)(t);s[a]=i==n.AUTO_STYLE?i:i.toString()+_resolveStyleUnit(i,t,a)})}),Object.keys(a).forEach(function(e){r.i(i.a)(s[e])||(s[e]=a[e])}),s}function _resolveStyleUnit(e,t,r){var n="";if(_isPixelDimensionStyle(r)&&0!=e&&"0"!=e)if("number"==typeof e)n="px";else if(0==_findDimensionalSuffix(e.toString()).length)throw new Error("Please provide a CSS unit value for "+t+":"+e);return n}function _findDimensionalSuffix(e){for(var t=0;t<e.length;t++){var r=e.charCodeAt(t);if(!(r>=u&&r<=c||r==l))return e.substring(t,e.length)}return""}function _isPixelDimensionStyle(e){switch(e){case"width":case"height":case"minWidth":case"minHeight":case"maxWidth":case"maxHeight":case"left":case"top":case"bottom":case"right":case"fontSize":case"outlineWidth":case"outlineOffset":case"paddingTop":case"paddingLeft":case"paddingBottom":case"paddingRight":case"marginTop":case"marginLeft":case"marginBottom":case"marginRight":case"borderRadius":case"borderWidth":case"borderTopWidth":case"borderLeftWidth":case"borderRightWidth":case"borderBottomWidth":case"textIndent":return!0;default:return!1}}var n=r(0),i=r(30),o=r(330),a=r(502);r.d(t,"a",function(){return s});var s=function(){function WebAnimationsDriver(){}return WebAnimationsDriver.prototype.animate=function(e,t,n,o,s,u){var c=[],l={};if(r.i(i.a)(t)&&t.styles.length>0&&(l=_populateStyles(e,t,{}),l.offset=0,c.push(l)),n.forEach(function(t){var r=_populateStyles(e,t.styles,l);r.offset=t.offset,c.push(r)}),1==c.length){var p=c[0];p.offset=null,c=[p,p]}var f={duration:o,delay:s,fill:"both"};return u&&(f.easing=u),new a.a(e,c,f)},WebAnimationsDriver}(),u=48,c=57,l=46},function(e,t,r){"use strict";function _computeStyle(e,t){return r.i(o.a)().getComputedStyle(e)[t]}var n=r(0),i=r(30),o=r(15);r.d(t,"a",function(){return a});var a=function(){function WebAnimationsPlayer(e,t,r){this.element=e,this.keyframes=t,this.options=r,this._onDoneFns=[],this._onStartFns=[],this._finished=!1,this._initialized=!1,this._started=!1,this.parentPlayer=null,this._duration=r.duration}return WebAnimationsPlayer.prototype._onFinish=function(){this._finished||(this._finished=!0,r.i(i.a)(this.parentPlayer)||this.destroy(),this._onDoneFns.forEach(function(e){return e()}),this._onDoneFns=[])},WebAnimationsPlayer.prototype.init=function(){var e=this;if(!this._initialized){this._initialized=!0;var t=this.keyframes.map(function(t){var r={};return Object.keys(t).forEach(function(i){var o=t[i];r[i]=o==n.AUTO_STYLE?_computeStyle(e.element,i):o}),r});this._player=this._triggerWebAnimation(this.element,t,this.options),this.reset(),this._player.onfinish=function(){return e._onFinish()}}},WebAnimationsPlayer.prototype._triggerWebAnimation=function(e,t,r){return e.animate(t,r)},WebAnimationsPlayer.prototype.onStart=function(e){this._onStartFns.push(e)},WebAnimationsPlayer.prototype.onDone=function(e){this._onDoneFns.push(e)},WebAnimationsPlayer.prototype.play=function(){this.init(),this.hasStarted()||(this._onStartFns.forEach(function(e){return e()}),this._onStartFns=[],this._started=!0),this._player.play()},WebAnimationsPlayer.prototype.pause=function(){this.init(),this._player.pause()},WebAnimationsPlayer.prototype.finish=function(){this.init(),this._onFinish(),this._player.finish()},WebAnimationsPlayer.prototype.reset=function(){this._player.cancel()},WebAnimationsPlayer.prototype.restart=function(){this.reset(),this.play()},WebAnimationsPlayer.prototype.hasStarted=function(){return this._started},WebAnimationsPlayer.prototype.destroy=function(){this.reset(),this._onFinish()},Object.defineProperty(WebAnimationsPlayer.prototype,"totalTime",{get:function(){return this._duration},enumerable:!0,configurable:!0}),WebAnimationsPlayer.prototype.setPosition=function(e){this._player.currentTime=e*this.totalTime},WebAnimationsPlayer.prototype.getPosition=function(){return this._player.currentTime/this.totalTime},WebAnimationsPlayer}()},function(e,t,r){"use strict";r.d(t,"a",function(){return n});var n="undefined"!=typeof window&&window||{};n.document,n.location,n.gc?function(){return n.gc()}:function(){return null},n.performance?n.performance:null,n.Event,n.MouseEvent,n.KeyboardEvent,n.EventTarget,n.History,n.Location,n.EventListener},function(e,t,r){"use strict";var n=r(323),i=r(327),o=r(498),a=r(206),s=r(499),u=r(207),c=r(144),l=r(81),p=r(209),f=r(332),h=r(505);r.d(t,"a",function(){return n.d}),r.d(t,"b",function(){return n.e}),r.d(t,"c",function(){return i.a}),r.d(t,"d",function(){return o.a}),r.d(t,"e",function(){return o.b}),r.d(t,"f",function(){return a.a}),r.d(t,"g",function(){return s.a}),r.d(t,"h",function(){return u.b}),r.d(t,"i",function(){return c.a}),r.d(t,"j",function(){return l.c}),r.d(t,"k",function(){return l.a}),r.d(t,"l",function(){return p.b}),r.d(t,"m",function(){return p.c}),r.d(t,"n",function(){return f.a}),r.d(t,"o",function(){return h.a})},function(e,t,r){"use strict";var n=r(323),i=r(324),o=r(325),a=r(326),s=r(207),u=r(15),c=r(208),l=r(328),p=r(209),f=r(329),h=r(210);r.d(t,"a",function(){return d});var d={BrowserPlatformLocation:o.a,DomAdapter:u.b,BrowserDomAdapter:i.a,BrowserGetTestability:a.a,getDOM:u.a,setRootDomAdapter:u.c,DomRootRenderer_:c.b,DomRootRenderer:c.a,DomSharedStylesHost:h.a,SharedStylesHost:h.b,ELEMENT_PROBE_PROVIDERS:s.a,DomEventsPlugin:l.a,KeyEventsPlugin:f.a,HammerGesturesPlugin:p.a,initDomAdapter:n.a,INTERNAL_BROWSER_PLATFORM_PROVIDERS:n.b,BROWSER_SANITIZATION_PROVIDERS:n.c}},function(e,t,r){"use strict";function getInertElement(){if(a)return a;s=r.i(i.a)();var e=s.createElement("template");if("content"in e)return e;var t=s.createHtmlDocument();if(a=s.querySelector(t,"body"),null==a){var n=s.createElement("html",t);a=s.createElement("body",t),s.appendChild(n,a),s.appendChild(t,n)}return a}function tagSet(e){for(var t={},r=0,n=e.split(",");r<n.length;r++){var i=n[r];t[i]=!0}return t}function merge(){for(var e=[],t=0;t<arguments.length;t++)e[t-0]=arguments[t];for(var r={},n=0,i=e;n<i.length;n++){var o=i[n];for(var a in o)o.hasOwnProperty(a)&&(r[a]=!0)}return r}function encodeEntities(e){return e.replace(/&/g,"&amp;").replace(b,function(e){var t=e.charCodeAt(0),r=e.charCodeAt(1);return"&#"+(1024*(t-55296)+(r-56320)+65536)+";"}).replace(w,function(e){return"&#"+e.charCodeAt(0)+";"}).replace(/</g,"&lt;").replace(/>/g,"&gt;")}function stripCustomNsAttrs(e){s.attributeMap(e).forEach(function(t,r){"xmlns:ns1"!==r&&0!==r.indexOf("ns1:")||s.removeAttribute(e,r)});for(var t=0,r=s.childNodesAsList(e);t<r.length;t++){var n=r[t];s.isElementNode(n)&&stripCustomNsAttrs(n)}}function sanitizeHtml(e){try{var t=getInertElement(),i=e?String(e):"",o=5,u=i;do{if(0===o)throw new Error("Failed to sanitize html because the input is unstable");o--,i=u,s.setInnerHTML(t,i),s.defaultDoc().documentMode&&stripCustomNsAttrs(t),u=s.getInnerHTML(t)}while(i!==u);for(var c=new _,l=c.sanitizeChildren(s.getTemplateContent(t)||t),p=s.getTemplateContent(t)||t,f=0,h=s.childNodesAsList(p);f<h.length;f++){var d=h[f];s.removeChild(p,d)}return r.i(n.isDevMode)()&&c.sanitizedSomething&&s.log("WARNING: sanitizing HTML stripped some content (see http://g.co/ng/security#xss)."),l}catch(e){throw a=null,e}}var n=r(0),i=r(15),o=r(212);t.a=sanitizeHtml;var a=null,s=null,u=tagSet("area,br,col,hr,img,wbr"),c=tagSet("colgroup,dd,dt,li,p,tbody,td,tfoot,th,thead,tr"),l=tagSet("rp,rt"),p=merge(l,c),f=merge(c,tagSet("address,article,aside,blockquote,caption,center,del,details,dialog,dir,div,dl,figure,figcaption,footer,h1,h2,h3,h4,h5,h6,header,hgroup,hr,ins,main,map,menu,nav,ol,pre,section,summary,table,ul")),h=merge(l,tagSet("a,abbr,acronym,audio,b,bdi,bdo,big,br,cite,code,del,dfn,em,font,i,img,ins,kbd,label,map,mark,picture,q,ruby,rp,rt,s,samp,small,source,span,strike,strong,sub,sup,time,track,tt,u,var,video")),d=merge(u,f,h,p),m=tagSet("background,cite,href,itemtype,longdesc,poster,src,xlink:href"),v=tagSet("srcset"),y=tagSet("abbr,accesskey,align,alt,autoplay,axis,bgcolor,border,cellpadding,cellspacing,class,clear,color,cols,colspan,compact,controls,coords,datetime,default,dir,download,face,headers,height,hidden,hreflang,hspace,ismap,itemscope,itemprop,kind,label,lang,language,loop,media,muted,nohref,nowrap,open,preload,rel,rev,role,rows,rowspan,rules,scope,scrolling,shape,size,sizes,span,srclang,start,summary,tabindex,target,title,translate,type,usemap,valign,value,vspace,width"),g=merge(m,v,y),_=function(){function SanitizingHtmlSerializer(){this.sanitizedSomething=!1,this.buf=[]}return SanitizingHtmlSerializer.prototype.sanitizeChildren=function(e){for(var t=e.firstChild;t;)if(s.isElementNode(t)?this.startElement(t):s.isTextNode(t)?this.chars(s.nodeValue(t)):this.sanitizedSomething=!0,s.firstChild(t))t=s.firstChild(t);else for(;t;){if(s.isElementNode(t)&&this.endElement(t),s.nextSibling(t)){t=s.nextSibling(t);break}t=s.parentElement(t)}return this.buf.join("")},SanitizingHtmlSerializer.prototype.startElement=function(e){var t=this,n=s.nodeName(e).toLowerCase();return d.hasOwnProperty(n)?(this.buf.push("<"),this.buf.push(n),s.attributeMap(e).forEach(function(e,n){var i=n.toLowerCase();return g.hasOwnProperty(i)?(m[i]&&(e=r.i(o.a)(e)),v[i]&&(e=r.i(o.b)(e)),t.buf.push(" "),t.buf.push(n),t.buf.push('="'),t.buf.push(encodeEntities(e)),void t.buf.push('"')):void(t.sanitizedSomething=!0)}),void this.buf.push(">")):void(this.sanitizedSomething=!0)},SanitizingHtmlSerializer.prototype.endElement=function(e){var t=s.nodeName(e).toLowerCase();d.hasOwnProperty(t)&&!u.hasOwnProperty(t)&&(this.buf.push("</"),this.buf.push(t),this.buf.push(">"))},SanitizingHtmlSerializer.prototype.chars=function(e){this.buf.push(encodeEntities(e))},SanitizingHtmlSerializer}(),b=/[\uD800-\uDBFF][\uDC00-\uDFFF]/g,w=/([^\#-~ |!])/g},function(e,t,r){"use strict";function hasBalancedQuotes(e){for(var t=!0,r=!0,n=0;n<e.length;n++){var i=e.charAt(n);"'"===i&&r?t=!t:'"'===i&&t&&(r=!r)}return t&&r}function sanitizeStyle(e){if(e=String(e).trim(),!e)return"";var t=e.match(p);return t&&r.i(o.a)(t[1])===t[1]||e.match(l)&&hasBalancedQuotes(e)?e:(r.i(n.isDevMode)()&&r.i(i.a)().log("WARNING: sanitizing unsafe style value "+e+" (see http://g.co/ng/security#xss)."),"unsafe")}var n=r(0),i=r(15),o=r(212);t.a=sanitizeStyle;var a="[-,.\"'%_!# a-zA-Z0-9]+",s="(?:matrix|translate|scale|rotate|skew|perspective)(?:X|Y|3d)?",u="(?:rgb|hsl)a?",c="\\([-0-9.%, a-zA-Z]+\\)",l=new RegExp("^("+a+"|(?:"+s+"|"+u+")"+c+")$","g"),p=/^url\(([^)]+)\)$/},function(e,t,r){"use strict";function noMatch(e){return new n.Observable(function(t){return t.error(new v(e))})}function absoluteRedirect(e){return new n.Observable(function(t){return t.error(new y(e))})}function canLoadFails(e){return new n.Observable(function(t){return t.error(new h.b("Cannot load children because the guard of the route \"path: '"+e.path+"'\" returned false"))})}function applyRedirects(e,t,r,n){return new g(e,t,r,n).apply()}function runGuards(e,t){var n=t.canLoad;if(!n||0===n.length)return r.i(o.of)(!0);var a=c.map.call(r.i(i.from)(n),function(n){var i=e.get(n);return i.canLoad?r.i(m.b)(i.canLoad(t)):r.i(m.b)(i(t))});return r.i(m.f)(a)}function match(e,t,r){var n={matched:!1,consumedSegments:[],lastChild:0,positionalParamSegments:{}};if(""===t.path)return"full"===t.pathMatch&&(e.hasChildren()||r.length>0)?{matched:!1,consumedSegments:[],lastChild:0,positionalParamSegments:{}}:{matched:!0,consumedSegments:[],lastChild:0,positionalParamSegments:{}};for(var i=t.path,o=i.split("/"),a={},s=[],u=0,c=0;c<o.length;++c){if(u>=r.length)return n;var l=r[u],p=o[c],f=p.startsWith(":"); if(!f&&p!==l.path)return n;f&&(a[p.substring(1)]=l),s.push(l),u++}return"full"===t.pathMatch&&(e.hasChildren()||u<r.length)?{matched:!1,consumedSegments:[],lastChild:0,positionalParamSegments:{}}:{matched:!0,consumedSegments:s,lastChild:u,positionalParamSegments:a}}function applyRedirectCommands(e,t,r){var n=t.startsWith("/")?t.substring(1):t;return""===n?[]:createSegments(t,n.split("/"),e,r)}function createSegments(e,t,r,n){return t.map(function(t){return t.startsWith(":")?findPosParam(t,n,e):findOrCreateSegment(t,r)})}function findPosParam(e,t,r){var n=e.substring(1),i=t[n];if(!i)throw new Error("Cannot redirect to '"+r+"'. Cannot find '"+e+"'.");return i}function findOrCreateSegment(e,t){for(var r=0,n=0,i=t;n<i.length;n++){var o=i[n];if(o.path===e)return t.splice(r),o;r++}return new d.c(e,{})}function split(e,t,r,n){if(r.length>0&&containsEmptyPathRedirectsWithNamedOutlets(e,r,n)){var i=new d.a(t,createChildrenForEmptySegments(n,new d.a(r,e.children)));return{segmentGroup:mergeTrivialChildren(i),slicedSegments:[]}}if(0===r.length&&containsEmptyPathRedirects(e,r,n)){var i=new d.a(e.segments,addEmptySegmentsToChildrenIfNeeded(e,r,n,e.children));return{segmentGroup:mergeTrivialChildren(i),slicedSegments:r}}return{segmentGroup:e,slicedSegments:r}}function mergeTrivialChildren(e){if(1===e.numberOfChildren&&e.children[h.a]){var t=e.children[h.a];return new d.a(e.segments.concat(t.segments),t.children)}return e}function addEmptySegmentsToChildrenIfNeeded(e,t,n,i){for(var o={},a=0,s=n;a<s.length;a++){var u=s[a];emptyPathRedirect(e,t,u)&&!i[getOutlet(u)]&&(o[getOutlet(u)]=new d.a([],{}))}return r.i(m.g)(i,o)}function createChildrenForEmptySegments(e,t){var r={};r[h.a]=t;for(var n=0,i=e;n<i.length;n++){var o=i[n];""===o.path&&getOutlet(o)!==h.a&&(r[getOutlet(o)]=new d.a([],{}))}return r}function containsEmptyPathRedirectsWithNamedOutlets(e,t,r){return r.filter(function(r){return emptyPathRedirect(e,t,r)&&getOutlet(r)!==h.a}).length>0}function containsEmptyPathRedirects(e,t,r){return r.filter(function(r){return emptyPathRedirect(e,t,r)}).length>0}function emptyPathRedirect(e,t,r){return(!(e.hasChildren()||t.length>0)||"full"!==r.pathMatch)&&(""===r.path&&void 0!==r.redirectTo)}function getOutlet(e){return e.outlet?e.outlet:h.a}var n=r(6),i=(r.n(n),r(240)),o=(r.n(i),r(71)),a=(r.n(o),r(241)),s=(r.n(a),r(383)),u=(r.n(s),r(709)),c=(r.n(u),r(112)),l=(r.n(c),r(87)),p=(r.n(l),r(245)),f=(r.n(p),r(102)),h=r(45),d=r(63),m=r(46);t.a=applyRedirects;var v=function(){function NoMatch(e){void 0===e&&(e=null),this.segmentGroup=e}return NoMatch}(),y=function(){function AbsoluteRedirect(e){this.segments=e}return AbsoluteRedirect}(),g=function(){function ApplyRedirects(e,t,r,n){this.injector=e,this.configLoader=t,this.urlTree=r,this.config=n,this.allowRedirects=!0}return ApplyRedirects.prototype.apply=function(){var e=this,t=this.expandSegmentGroup(this.injector,this.config,this.urlTree.root,h.a),r=c.map.call(t,function(t){return e.createUrlTree(t)});return a._catch.call(r,function(t){if(t instanceof y){e.allowRedirects=!1;var r=new d.a([],(n={},n[h.a]=new d.a(t.segments,{}),n));return e.match(r)}throw t instanceof v?e.noMatchError(t):t;var n})},ApplyRedirects.prototype.match=function(e){var t=this,r=this.expandSegmentGroup(this.injector,this.config,e,h.a),n=c.map.call(r,function(e){return t.createUrlTree(e)});return a._catch.call(n,function(e){throw e instanceof v?t.noMatchError(e):e})},ApplyRedirects.prototype.noMatchError=function(e){return new Error("Cannot match any routes. URL Segment: '"+e.segmentGroup+"'")},ApplyRedirects.prototype.createUrlTree=function(e){var t=e.segments.length>0?new d.a([],(r={},r[h.a]=e,r)):e;return new d.b(t,this.urlTree.queryParams,this.urlTree.fragment);var r},ApplyRedirects.prototype.expandSegmentGroup=function(e,t,r,n){return 0===r.segments.length&&r.hasChildren()?c.map.call(this.expandChildren(e,t,r),function(e){return new d.a([],e)}):this.expandSegment(e,r,t,r.segments,n,!0)},ApplyRedirects.prototype.expandChildren=function(e,t,n){var i=this;return r.i(m.e)(n.children,function(r,n){return i.expandSegmentGroup(e,t,n,r)})},ApplyRedirects.prototype.expandSegment=function(e,t,n,i,l,f){var h=this,d=o.of.apply(void 0,n),m=c.map.call(d,function(s){var u=h.expandSegmentAgainstRoute(e,t,n,s,i,l,f);return a._catch.call(u,function(e){if(e instanceof v)return r.i(o.of)(null);throw e})}),y=s.concatAll.call(m),g=u.first.call(y,function(e){return!!e});return a._catch.call(g,function(e,r){throw e instanceof p.EmptyError?new v(t):e})},ApplyRedirects.prototype.expandSegmentAgainstRoute=function(e,t,r,n,i,o,a){return getOutlet(n)!==o?noMatch(t):void 0===n.redirectTo||a&&this.allowRedirects?void 0===n.redirectTo?this.matchSegmentAgainstRoute(e,t,n,i):this.expandSegmentAgainstRouteUsingRedirect(e,t,r,n,i,o):noMatch(t)},ApplyRedirects.prototype.expandSegmentAgainstRouteUsingRedirect=function(e,t,r,n,i,o){return"**"===n.path?this.expandWildCardWithParamsAgainstRouteUsingRedirect(e,r,n,o):this.expandRegularSegmentAgainstRouteUsingRedirect(e,t,r,n,i,o)},ApplyRedirects.prototype.expandWildCardWithParamsAgainstRouteUsingRedirect=function(e,t,r,n){var i=applyRedirectCommands([],r.redirectTo,{});if(r.redirectTo.startsWith("/"))return absoluteRedirect(i);var o=new d.a(i,{});return this.expandSegment(e,o,t,i,n,!1)},ApplyRedirects.prototype.expandRegularSegmentAgainstRouteUsingRedirect=function(e,t,r,n,i,o){var a=match(t,n,i),s=a.matched,u=a.consumedSegments,c=a.lastChild,l=a.positionalParamSegments;if(!s)return noMatch(t);var p=applyRedirectCommands(u,n.redirectTo,l);return n.redirectTo.startsWith("/")?absoluteRedirect(p):this.expandSegment(e,t,r,p.concat(i.slice(c)),o,!1)},ApplyRedirects.prototype.matchSegmentAgainstRoute=function(e,t,n,i){var a=this;if("**"===n.path)return n.loadChildren?c.map.call(this.configLoader.load(e,n.loadChildren),function(e){return n._loadedConfig=e,r.i(o.of)(new d.a(i,{}))}):r.i(o.of)(new d.a(i,{}));var s=match(t,n,i),u=s.matched,p=s.consumedSegments,f=s.lastChild;if(!u)return noMatch(t);var m=i.slice(f),v=this.getChildConfig(e,n);return l.mergeMap.call(v,function(e){var n=e.injector,i=e.routes,s=split(t,p,m,i),u=s.segmentGroup,l=s.slicedSegments;if(0===l.length&&u.hasChildren()){var f=a.expandChildren(n,i,u);return c.map.call(f,function(e){return new d.a(p,e)})}if(0===i.length&&0===l.length)return r.i(o.of)(new d.a(p,{}));var f=a.expandSegment(n,u,i,l,h.a,!0);return c.map.call(f,function(e){return new d.a(p.concat(e.segments),e.children)})})},ApplyRedirects.prototype.getChildConfig=function(e,t){var n=this;return t.children?r.i(o.of)(new f.a(t.children,e,null)):t.loadChildren?l.mergeMap.call(runGuards(e,t),function(i){return i?t._loadedConfig?r.i(o.of)(t._loadedConfig):c.map.call(n.configLoader.load(e,t.loadChildren),function(e){return t._loadedConfig=e,e}):canLoadFails(t)}):r.i(o.of)(new f.a([],e,null))},ApplyRedirects}()},function(e,t,r){"use strict";function validateConfig(e){e.forEach(validateNode)}function validateNode(e){if(Array.isArray(e))throw new Error("Invalid route configuration: Array cannot be specified");if(e.redirectTo&&e.children)throw new Error("Invalid configuration of route '"+e.path+"': redirectTo and children cannot be used together");if(e.redirectTo&&e.loadChildren)throw new Error("Invalid configuration of route '"+e.path+"': redirectTo and loadChildren cannot be used together");if(e.children&&e.loadChildren)throw new Error("Invalid configuration of route '"+e.path+"': children and loadChildren cannot be used together");if(e.redirectTo&&e.component)throw new Error("Invalid configuration of route '"+e.path+"': redirectTo and component cannot be used together");if(void 0===e.redirectTo&&!e.component&&!e.children&&!e.loadChildren)throw new Error("Invalid configuration of route '"+e.path+"': one of the following must be provided (component or redirectTo or children or loadChildren)");if(void 0===e.path)throw new Error("Invalid route configuration: routes must have path specified");if(e.path.startsWith("/"))throw new Error("Invalid route configuration of route '"+e.path+"': path cannot start with a slash");if(""===e.path&&void 0!==e.redirectTo&&void 0===e.pathMatch){var t="The default value of 'pathMatch' is 'prefix', but often the intent is to use 'full'.";throw new Error("Invalid route configuration of route '{path: \""+e.path+'", redirectTo: "'+e.redirectTo+"\"}': please provide 'pathMatch'. "+t)}if(void 0!==e.pathMatch&&"full"!==e.pathMatch&&"prefix"!==e.pathMatch)throw new Error("Invalid configuration of route '"+e.path+"': pathMatch can only be set to 'prefix' or 'full'")}t.a=validateConfig},function(e,t,r){"use strict";function createRouterState(e,t){var r=createNode(e._root,t?t._root:void 0);return new i.a(r,e)}function createNode(e,t){if(t&&equalRouteSnapshots(t.value.snapshot,e.value)){var r=t.value;r._futureSnapshot=e.value;var n=createOrReuseChildren(e,t);return new o.b(r,n)}var r=createActivatedRoute(e.value),n=e.children.map(function(e){return createNode(e)});return new o.b(r,n)}function createOrReuseChildren(e,t){return e.children.map(function(e){for(var r=0,n=t.children;r<n.length;r++){var i=n[r];if(equalRouteSnapshots(i.value.snapshot,e.value))return createNode(e,i)}return createNode(e)})}function createActivatedRoute(e){return new i.b(new n.BehaviorSubject(e.url),new n.BehaviorSubject(e.params),new n.BehaviorSubject(e.queryParams),new n.BehaviorSubject(e.fragment),new n.BehaviorSubject(e.data),e.outlet,e.component,e)}function equalRouteSnapshots(e,t){return e._routeConfig===t._routeConfig}var n=r(237),i=(r.n(n),r(82)),o=r(214);t.a=createRouterState},function(e,t,r){"use strict";function createUrlTree(e,t,r,n,o){if(0===r.length)return tree(t.root,t.root,t,n,o);var a=normalizeCommands(r);if(validateCommands(a),navigateToRoot(a))return tree(t.root,new i.a([],{}),t,n,o);var s=findStartingPosition(a,t,e),u=s.processChildren?updateSegmentGroupChildren(s.segmentGroup,s.index,a.commands):updateSegmentGroup(s.segmentGroup,s.index,a.commands);return tree(s.segmentGroup,u,t,n,o)}function validateCommands(e){if(e.isAbsolute&&e.commands.length>0&&isMatrixParams(e.commands[0]))throw new Error("Root segment cannot have matrix parameters");var t=e.commands.filter(function(e){return"object"==typeof e&&void 0!==e.outlets});if(t.length>0&&t[0]!==e.commands[e.commands.length-1])throw new Error("{outlets:{}} has to be the last command")}function isMatrixParams(e){return"object"==typeof e&&void 0===e.outlets&&void 0===e.segmentPath}function tree(e,t,r,n,o){return r.root===e?new i.b(t,stringify(n),o):new i.b(replaceSegment(r.root,e,t),stringify(n),o)}function replaceSegment(e,t,n){var a={};return r.i(o.c)(e.children,function(e,r){e===t?a[r]=n:a[r]=replaceSegment(e,t,n)}),new i.a(e.segments,a)}function navigateToRoot(e){return e.isAbsolute&&1===e.commands.length&&"/"==e.commands[0]}function normalizeCommands(e){if("string"==typeof e[0]&&1===e.length&&"/"==e[0])return new a(!0,0,e);for(var t=0,n=!1,i=[],s=function(a){var s=e[a];if("object"==typeof s&&void 0!==s.outlets){var u={};return r.i(o.c)(s.outlets,function(e,t){"string"==typeof e?u[t]=e.split("/"):u[t]=e}),i.push({outlets:u}),"continue"}if("object"==typeof s&&void 0!==s.segmentPath)return i.push(s.segmentPath),"continue";if("string"!=typeof s)return i.push(s),"continue";if(0===a)for(var c=s.split("/"),l=0;l<c.length;++l){var p=c[l];0==l&&"."==p||(0==l&&""==p?n=!0:".."==p?t++:""!=p&&i.push(p))}else i.push(s)},u=0;u<e.length;++u)s(u);return new a(n,t,i)}function findStartingPosition(e,t,r){if(e.isAbsolute)return new s(t.root,!0,0);if(r.snapshot._lastPathIndex===-1)return new s(r.snapshot._urlSegment,!0,0);var n=isMatrixParams(e.commands[0])?0:1,i=r.snapshot._lastPathIndex+n;return createPositionApplyingDoubleDots(r.snapshot._urlSegment,i,e.numberOfDoubleDots)}function createPositionApplyingDoubleDots(e,t,r){for(var n=e,i=t,o=r;o>i;){if(o-=i,n=n.parent,!n)throw new Error("Invalid number of '../'");i=n.segments.length}return new s(n,!1,i-o)}function getPath(e){return"object"==typeof e&&e.outlets?e.outlets[n.a]:""+e}function getOutlets(e){return"object"!=typeof e[0]?(t={},t[n.a]=e,t):void 0===e[0].outlets?(r={},r[n.a]=e,r):e[0].outlets;var t,r}function updateSegmentGroup(e,t,r){if(e||(e=new i.a([],{})),0===e.segments.length&&e.hasChildren())return updateSegmentGroupChildren(e,t,r);var o=prefixedWith(e,t,r),a=r.slice(o.commandIndex);if(o.match&&o.pathIndex<e.segments.length){var s=new i.a(e.segments.slice(0,o.pathIndex),{});return s.children[n.a]=new i.a(e.segments.slice(o.pathIndex),e.children),updateSegmentGroupChildren(s,0,a)}return o.match&&0===a.length?new i.a(e.segments,{}):o.match&&!e.hasChildren()?createNewSegmentGroup(e,t,r):o.match?updateSegmentGroupChildren(e,0,a):createNewSegmentGroup(e,t,r)}function updateSegmentGroupChildren(e,t,n){if(0===n.length)return new i.a(e.segments,{});var a=getOutlets(n),s={};return r.i(o.c)(a,function(r,n){null!==r&&(s[n]=updateSegmentGroup(e.children[n],t,r))}),r.i(o.c)(e.children,function(e,t){void 0===a[t]&&(s[t]=e)}),new i.a(e.segments,s)}function prefixedWith(e,t,r){for(var n=0,i=t,o={match:!1,pathIndex:0,commandIndex:0};i<e.segments.length;){if(n>=r.length)return o;var a=e.segments[i],s=getPath(r[n]),u=n<r.length-1?r[n+1]:null;if(i>0&&void 0===s)break;if(s&&u&&"object"==typeof u&&void 0===u.outlets){if(!compare(s,u,a))return o;n+=2}else{if(!compare(s,{},a))return o;n++}i++}return{match:!0,pathIndex:i,commandIndex:n}}function createNewSegmentGroup(e,t,r){for(var n=e.segments.slice(0,t),o=0;o<r.length;){if("object"==typeof r[o]&&void 0!==r[o].outlets){var a=createNewSegmentChldren(r[o].outlets);return new i.a(n,a)}if(0===o&&isMatrixParams(r[0])){var s=e.segments[t];n.push(new i.c(s.path,r[0])),o++}else{var u=getPath(r[o]),c=o<r.length-1?r[o+1]:null;u&&c&&isMatrixParams(c)?(n.push(new i.c(u,stringify(c))),o+=2):(n.push(new i.c(u,{})),o++)}}return new i.a(n,{})}function createNewSegmentChldren(e){var t={};return r.i(o.c)(e,function(e,r){null!==e&&(t[r]=createNewSegmentGroup(new i.a([],{}),0,e))}),t}function stringify(e){var t={};return r.i(o.c)(e,function(e,r){return t[r]=""+e}),t}function compare(e,t,n){return e==n.path&&r.i(o.d)(t,n.parameters)}var n=r(45),i=r(63),o=r(46);t.a=createUrlTree;var a=function(){function NormalizedNavigationCommands(e,t,r){this.isAbsolute=e,this.numberOfDoubleDots=t,this.commands=r}return NormalizedNavigationCommands}(),s=function(){function Position(e,t,r){this.segmentGroup=e,this.processChildren=t,this.index=r}return Position}()},function(e,t,r){"use strict";var n=r(213),i=r(333),o=r(334),a=r(101),s=r(335),u=r(145),c=r(336),l=r(82),p=r(45),f=r(63),h=r(513);r.d(t,"a",function(){return n.a}),r.d(t,"b",function(){return n.b}),r.d(t,"c",function(){return i.a}),r.d(t,"d",function(){return o.a}),r.d(t,"e",function(){return a.c}),r.d(t,"f",function(){return a.b}),r.d(t,"g",function(){return a.d}),r.d(t,"h",function(){return a.a}),r.d(t,"i",function(){return a.e}),r.d(t,"j",function(){return a.f}),r.d(t,"k",function(){return s.b}),r.d(t,"l",function(){return s.c}),r.d(t,"m",function(){return u.a}),r.d(t,"n",function(){return c.c}),r.d(t,"o",function(){return c.d}),r.d(t,"p",function(){return c.b}),r.d(t,"q",function(){return l.b}),r.d(t,"r",function(){return l.d}),r.d(t,"s",function(){return l.a}),r.d(t,"t",function(){return l.e}),r.d(t,"u",function(){return p.a}),r.d(t,"v",function(){return f.h}),r.d(t,"w",function(){return f.c}),r.d(t,"x",function(){return f.g}),r.d(t,"y",function(){return f.b}),r.d(t,"z",function(){return h.a})},function(e,t,r){"use strict";var n=r(102),i=r(335),o=r(46);r.d(t,"a",function(){return a});var a={ROUTER_PROVIDERS:i.a,ROUTES:n.c,flatten:o.a}},function(e,t,r){"use strict";function recognize(e,t,r,n){return new f(e,t,r,n).recognize()}function sortActivatedRouteSnapshots(e){e.sort(function(e,t){return e.value.outlet===a.a?-1:t.value.outlet===a.a?1:e.value.outlet.localeCompare(t.value.outlet)})}function getChildConfig(e){return e.children?e.children:e.loadChildren?e._loadedConfig.routes:[]}function match(e,t,n,i){if(""===t.path){if("full"===t.pathMatch&&(e.hasChildren()||n.length>0))throw new l;var o=i?i.params:{};return{consumedSegments:[],lastChild:0,parameters:o}}for(var a=t.path,s=a.split("/"),c={},p=[],f=0,h=0;h<s.length;++h){if(f>=n.length)throw new l;var d=n[f],m=s[h],v=m.startsWith(":");if(!v&&m!==d.path)throw new l;v&&(c[m.substring(1)]=d.path),p.push(d),f++}if("full"===t.pathMatch&&(e.hasChildren()||f<n.length))throw new l;var y=r.i(u.g)(c,p[p.length-1].parameters);return{consumedSegments:p,lastChild:f,parameters:y}}function checkOutletNameUniqueness(e){var t={};e.forEach(function(e){var r=t[e.value.outlet];if(r){var n=r.url.map(function(e){return e.toString()}).join("/"),i=e.value.url.map(function(e){return e.toString()}).join("/");throw new Error("Two segments cannot have the same outlet name: '"+n+"' and '"+i+"'.")}t[e.value.outlet]=e.value})}function getSourceSegmentGroup(e){for(var t=e;t._sourceSegment;)t=t._sourceSegment;return t}function getPathIndexShift(e){for(var t=e,r=t._segmentIndexShift?t._segmentIndexShift:0;t._sourceSegment;)t=t._sourceSegment,r+=t._segmentIndexShift?t._segmentIndexShift:0;return r-1}function split(e,t,r,n){if(r.length>0&&containsEmptyPathMatchesWithNamedOutlets(e,r,n)){var i=new s.a(t,createChildrenForEmptyPaths(e,t,n,new s.a(r,e.children)));return i._sourceSegment=e,i._segmentIndexShift=t.length,{segmentGroup:i,slicedSegments:[]}}if(0===r.length&&containsEmptyPathMatches(e,r,n)){var i=new s.a(e.segments,addEmptyPathsToChildrenIfNeeded(e,r,n,e.children));return i._sourceSegment=e,i._segmentIndexShift=t.length,{segmentGroup:i,slicedSegments:r}}var i=new s.a(e.segments,e.children);return i._sourceSegment=e,i._segmentIndexShift=t.length,{segmentGroup:i,slicedSegments:r}}function addEmptyPathsToChildrenIfNeeded(e,t,n,i){for(var o={},a=0,c=n;a<c.length;a++){var l=c[a];if(emptyPathMatch(e,t,l)&&!i[getOutlet(l)]){var p=new s.a([],{});p._sourceSegment=e,p._segmentIndexShift=e.segments.length,o[getOutlet(l)]=p}}return r.i(u.g)(i,o)}function createChildrenForEmptyPaths(e,t,r,n){var i={};i[a.a]=n,n._sourceSegment=e,n._segmentIndexShift=t.length;for(var o=0,u=r;o<u.length;o++){var c=u[o];if(""===c.path&&getOutlet(c)!==a.a){var l=new s.a([],{});l._sourceSegment=e,l._segmentIndexShift=t.length,i[getOutlet(c)]=l}}return i}function containsEmptyPathMatchesWithNamedOutlets(e,t,r){return r.filter(function(r){return emptyPathMatch(e,t,r)&&getOutlet(r)!==a.a}).length>0}function containsEmptyPathMatches(e,t,r){return r.filter(function(r){return emptyPathMatch(e,t,r)}).length>0}function emptyPathMatch(e,t,r){return(!(e.hasChildren()||t.length>0)||"full"!==r.pathMatch)&&(""===r.path&&void 0===r.redirectTo)}function getOutlet(e){return e.outlet?e.outlet:a.a}function getData(e){return e.data?e.data:{}}function getResolve(e){return e.resolve?e.resolve:{}}var n=r(6),i=(r.n(n),r(71)),o=(r.n(i),r(82)),a=r(45),s=r(63),u=r(46),c=r(214);t.a=recognize;var l=function(){function NoMatch(){}return NoMatch}(),p=function(){function InheritedFromParent(e,t,r,n,i){this.parent=e,this.snapshot=t,this.params=r,this.data=n,this.resolve=i}return Object.defineProperty(InheritedFromParent.prototype,"allParams",{get:function(){return this.parent?r.i(u.g)(this.parent.allParams,this.params):this.params},enumerable:!0,configurable:!0}),Object.defineProperty(InheritedFromParent.prototype,"allData",{get:function(){return this.parent?r.i(u.g)(this.parent.allData,this.data):this.data},enumerable:!0,configurable:!0}),InheritedFromParent.empty=function(e){return new InheritedFromParent(null,e,{},{},new o.c(null,{}))},InheritedFromParent}(),f=function(){function Recognizer(e,t,r,n){this.rootComponentType=e,this.config=t,this.urlTree=r,this.url=n}return Recognizer.prototype.recognize=function(){try{var e=split(this.urlTree.root,[],[],this.config).segmentGroup,t=this.processSegmentGroup(this.config,e,p.empty(null),a.a),s=new o.d([],Object.freeze({}),Object.freeze(this.urlTree.queryParams),this.urlTree.fragment,{},a.a,this.rootComponentType,null,this.urlTree.root,-1,o.c.empty),u=new c.b(s,t);return r.i(i.of)(new o.e(this.url,u))}catch(e){return new n.Observable(function(t){return t.error(e)})}},Recognizer.prototype.processSegmentGroup=function(e,t,r,n){return 0===t.segments.length&&t.hasChildren()?this.processChildren(e,t,r):this.processSegment(e,t,0,t.segments,r,n)},Recognizer.prototype.processChildren=function(e,t,n){var i=this,o=r.i(s.d)(t,function(t,r){return i.processSegmentGroup(e,t,n,r)});return checkOutletNameUniqueness(o),sortActivatedRouteSnapshots(o),o},Recognizer.prototype.processSegment=function(e,t,r,n,i,o){for(var a=0,s=e;a<s.length;a++){var u=s[a];try{return this.processSegmentAgainstRoute(u,t,r,n,i,o)}catch(e){if(!(e instanceof l))throw e}}throw new l},Recognizer.prototype.processSegmentAgainstRoute=function(e,t,n,i,s,f){if(e.redirectTo)throw new l;if((e.outlet?e.outlet:a.a)!==f)throw new l;var h=new o.c(s.resolve,getResolve(e));if("**"===e.path){var d=i.length>0?r.i(u.i)(i).parameters:{},m=new o.d(i,Object.freeze(r.i(u.g)(s.allParams,d)),Object.freeze(this.urlTree.queryParams),this.urlTree.fragment,r.i(u.g)(s.allData,getData(e)),f,e.component,e,getSourceSegmentGroup(t),getPathIndexShift(t)+i.length,h);return[new c.b(m,[])]}var v=match(t,e,i,s.snapshot),y=v.consumedSegments,g=v.parameters,_=v.lastChild,b=i.slice(_),w=getChildConfig(e),C=split(t,y,b,w),E=C.segmentGroup,S=C.slicedSegments,A=new o.d(y,Object.freeze(r.i(u.g)(s.allParams,g)),Object.freeze(this.urlTree.queryParams),this.urlTree.fragment,r.i(u.g)(s.allData,getData(e)),f,e.component,e,getSourceSegmentGroup(t),getPathIndexShift(t)+y.length,h),P=e.component?p.empty(A):new p(s,A,g,getData(e),h);if(0===S.length&&E.hasChildren()){var x=this.processChildren(w,E,P);return[new c.b(A,x)]}if(0===w.length&&0===S.length)return[new c.b(A,[])];var x=this.processSegment(w,E,n+_,S,P,a.a);return[new c.b(A,x)]},Recognizer}()},,,,,,,,,,,,,,,,,,,function(e,t){"use strict";function bootloader(e){"complete"===document.readyState?e():document.addEventListener("DOMContentLoaded",e)}function createNewHosts(e){var t=e.map(function(e){var t=document.createElement(e.tagName),r=t.style.display;t.style.display="none";var n=e.parentNode;return n.insertBefore(t,e),{currentDisplay:r,newNode:t}});return function(){t.forEach(function(e){e.newNode.style.display=e.currentDisplay,e.newNode=null,e.currentDisplay=null})}}function removeNgStyles(){Array.prototype.slice.call(document.head.querySelectorAll("style"),0).filter(function(e){return e.innerText.indexOf("_ng")!==-1}).map(function(e){return e.remove()})}function getInputValues(){var e=document.querySelectorAll("input");return Array.prototype.slice.call(e).map(function(e){return e.value})}function setInputValues(e){var t=document.querySelectorAll("input");e&&t.length===e.length&&e.forEach(function(e,r){var n=t[r];n.value=e,n.dispatchEvent(new CustomEvent("input",{detail:n.value}))})}function createInputTransfer(){var e=getInputValues();return function(){setInputValues(e)}}t.bootloader=bootloader,t.createNewHosts=createNewHosts,t.removeNgStyles=removeNgStyles,t.getInputValues=getInputValues,t.setInputValues=setInputValues,t.createInputTransfer=createInputTransfer},,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,function(e,t,r){"use strict";var n=this&&this.__extends||function(e,t){function __(){this.constructor=e}for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r]);e.prototype=null===t?Object.create(t):(__.prototype=t.prototype,new __)},i=r(27),o=function(e){function InnerSubscriber(t,r,n){e.call(this),this.parent=t,this.outerValue=r,this.outerIndex=n,this.index=0}return n(InnerSubscriber,e),InnerSubscriber.prototype._next=function(e){this.parent.notifyNext(this.outerValue,e,this.outerIndex,this.index++,this)},InnerSubscriber.prototype._error=function(e){this.parent.notifyError(e,this),this.unsubscribe()},InnerSubscriber.prototype._complete=function(){this.parent.notifyComplete(this),this.unsubscribe()},InnerSubscriber}(i.Subscriber);t.InnerSubscriber=o},function(e,t,r){"use strict";var n=r(6),i=function(){function Notification(e,t,r){this.kind=e,this.value=t,this.exception=r,this.hasValue="N"===e}return Notification.prototype.observe=function(e){switch(this.kind){case"N":return e.next&&e.next(this.value);case"E":return e.error&&e.error(this.exception);case"C":return e.complete&&e.complete()}},Notification.prototype.do=function(e,t,r){var n=this.kind;switch(n){case"N":return e&&e(this.value);case"E":return t&&t(this.exception);case"C":return r&&r()}},Notification.prototype.accept=function(e,t,r){return e&&"function"==typeof e.next?this.observe(e):this.do(e,t,r)},Notification.prototype.toObservable=function(){var e=this.kind;switch(e){case"N":return n.Observable.of(this.value);case"E":return n.Observable.throw(this.exception);case"C":return n.Observable.empty()}throw new Error("unexpected notification kind value")},Notification.createNext=function(e){return"undefined"!=typeof e?new Notification("N",e):this.undefinedValueNotification},Notification.createError=function(e){return new Notification("E",void 0,e)},Notification.createComplete=function(){return this.completeNotification},Notification.completeNotification=new Notification("C"),Notification.undefinedValueNotification=new Notification("N",void 0),Notification}();t.Notification=i},function(e,t,r){"use strict";var n=this&&this.__extends||function(e,t){function __(){this.constructor=e}for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r]);e.prototype=null===t?Object.create(t):(__.prototype=t.prototype,new __)},i=r(239),o=function(e){function SubjectSubscription(t,r){e.call(this),this.subject=t,this.subscriber=r,this.closed=!1}return n(SubjectSubscription,e),SubjectSubscription.prototype.unsubscribe=function(){if(!this.closed){this.closed=!0;var e=this.subject,t=e.observers;if(this.subject=null,t&&0!==t.length&&!e.isStopped&&!e.closed){var r=t.indexOf(this.subscriber);r!==-1&&t.splice(r,1)}}},SubjectSubscription}(i.Subscription);t.SubjectSubscription=o},,,,,,function(e,t,r){"use strict";var n=this&&this.__extends||function(e,t){function __(){this.constructor=e}for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r]);e.prototype=null===t?Object.create(t):(__.prototype=t.prototype,new __)},i=r(6),o=r(382),a=r(380),s=function(e){function ArrayLikeObservable(t,r){e.call(this),this.arrayLike=t,this.scheduler=r,r||1!==t.length||(this._isScalar=!0,this.value=t[0])}return n(ArrayLikeObservable,e),ArrayLikeObservable.create=function(e,t){var r=e.length;return 0===r?new a.EmptyObservable:1===r?new o.ScalarObservable(e[0],t):new ArrayLikeObservable(e,t)},ArrayLikeObservable.dispatch=function(e){var t=e.arrayLike,r=e.index,n=e.length,i=e.subscriber;if(!i.closed){if(r>=n)return void i.complete();i.next(t[r]),e.index=r+1,this.schedule(e)}},ArrayLikeObservable.prototype._subscribe=function(e){var t=0,r=this,n=r.arrayLike,i=r.scheduler,o=n.length;if(i)return i.schedule(ArrayLikeObservable.dispatch,0,{arrayLike:n,index:t,length:o,subscriber:e});for(var a=0;a<o&&!e.closed;a++)e.next(n[a]);e.complete()},ArrayLikeObservable}(i.Observable);t.ArrayLikeObservable=s},,function(e,t,r){"use strict";var n=this&&this.__extends||function(e,t){function __(){this.constructor=e}for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r]);e.prototype=null===t?Object.create(t):(__.prototype=t.prototype,new __)},i=r(247),o=r(388),a=r(381),s=r(704),u=r(379),c=r(701),l=r(242),p=r(6),f=r(711),h=r(243),d=function(e){return e&&"number"==typeof e.length},m=function(e){function FromObservable(t,r){e.call(this,null),this.ish=t,this.scheduler=r}return n(FromObservable,e),FromObservable.create=function(e,t){if(null!=e){if("function"==typeof e[h.$$observable])return e instanceof p.Observable&&!t?e:new FromObservable(e,t);if(i.isArray(e))return new u.ArrayObservable(e,t);if(o.isPromise(e))return new a.PromiseObservable(e,t);if("function"==typeof e[l.$$iterator]||"string"==typeof e)return new s.IteratorObservable(e,t);if(d(e))return new c.ArrayLikeObservable(e,t)}throw new TypeError((null!==e&&typeof e||e)+" is not observable")},FromObservable.prototype._subscribe=function(e){var t=this.ish,r=this.scheduler;return null==r?t[h.$$observable]().subscribe(e):t[h.$$observable]().subscribe(new f.ObserveOnSubscriber(e,r,0))},FromObservable}(p.Observable);t.FromObservable=m},function(e,t,r){"use strict";function getIterator(e){var t=e[a.$$iterator];if(!t&&"string"==typeof e)return new u(e);if(!t&&void 0!==e.length)return new c(e);if(!t)throw new TypeError("object is not iterable");return e[a.$$iterator]()}function toLength(e){var t=+e.length;return isNaN(t)?0:0!==t&&numberIsFinite(t)?(t=sign(t)*Math.floor(Math.abs(t)),t<=0?0:t>l?l:t):t}function numberIsFinite(e){return"number"==typeof e&&i.root.isFinite(e)}function sign(e){var t=+e;return 0===t?t:isNaN(t)?t:t<0?-1:1}var n=this&&this.__extends||function(e,t){function __(){this.constructor=e}for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r]);e.prototype=null===t?Object.create(t):(__.prototype=t.prototype,new __)},i=r(61),o=r(6),a=r(242),s=function(e){function IteratorObservable(t,r){if(e.call(this),this.scheduler=r,null==t)throw new Error("iterator cannot be null.");this.iterator=getIterator(t)}return n(IteratorObservable,e),IteratorObservable.create=function(e,t){return new IteratorObservable(e,t)},IteratorObservable.dispatch=function(e){var t=e.index,r=e.hasError,n=e.iterator,i=e.subscriber;if(r)return void i.error(e.error);var o=n.next();return o.done?void i.complete():(i.next(o.value),e.index=t+1,void(i.closed||this.schedule(e)))},IteratorObservable.prototype._subscribe=function(e){var t=0,r=this,n=r.iterator,i=r.scheduler;if(i)return i.schedule(IteratorObservable.dispatch,0,{index:t,iterator:n,subscriber:e});for(;;){var o=n.next();if(o.done){e.complete();break}if(e.next(o.value),e.closed)break}},IteratorObservable}(o.Observable);t.IteratorObservable=s;var u=function(){function StringIterator(e,t,r){void 0===t&&(t=0),void 0===r&&(r=e.length),this.str=e,this.idx=t,this.len=r}return StringIterator.prototype[a.$$iterator]=function(){return this},StringIterator.prototype.next=function(){return this.idx<this.len?{done:!1,value:this.str.charAt(this.idx++)}:{done:!0,value:void 0}},StringIterator}(),c=function(){function ArrayIterator(e,t,r){void 0===t&&(t=0),void 0===r&&(r=toLength(e)),this.arr=e,this.idx=t,this.len=r}return ArrayIterator.prototype[a.$$iterator]=function(){return this},ArrayIterator.prototype.next=function(){return this.idx<this.len?{done:!1,value:this.arr[this.idx++]}:{done:!0,value:void 0}},ArrayIterator}(),l=Math.pow(2,53)-1},,,,function(e,t,r){"use strict";function filter(e,t){return this.lift(new o(e,t))}var n=this&&this.__extends||function(e,t){function __(){this.constructor=e}for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r]);e.prototype=null===t?Object.create(t):(__.prototype=t.prototype,new __)},i=r(27);t.filter=filter;var o=function(){function FilterOperator(e,t){this.predicate=e,this.thisArg=t}return FilterOperator.prototype.call=function(e,t){return t._subscribe(new a(e,this.predicate,this.thisArg))},FilterOperator}(),a=function(e){function FilterSubscriber(t,r,n){e.call(this,t),this.predicate=r,this.thisArg=n,this.count=0,this.predicate=r}return n(FilterSubscriber,e),FilterSubscriber.prototype._next=function(e){var t;try{t=this.predicate.call(this.thisArg,e,this.count++)}catch(e){return void this.destination.error(e)}t&&this.destination.next(e)},FilterSubscriber}(i.Subscriber)},function(e,t,r){"use strict";function first(e,t,r){return this.lift(new a(e,t,r,this))}var n=this&&this.__extends||function(e,t){function __(){this.constructor=e}for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r]);e.prototype=null===t?Object.create(t):(__.prototype=t.prototype,new __)},i=r(27),o=r(245);t.first=first;var a=function(){function FirstOperator(e,t,r,n){this.predicate=e,this.resultSelector=t,this.defaultValue=r,this.source=n}return FirstOperator.prototype.call=function(e,t){return t._subscribe(new s(e,this.predicate,this.resultSelector,this.defaultValue,this.source)); },FirstOperator}(),s=function(e){function FirstSubscriber(t,r,n,i,o){e.call(this,t),this.predicate=r,this.resultSelector=n,this.defaultValue=i,this.source=o,this.index=0,this.hasCompleted=!1}return n(FirstSubscriber,e),FirstSubscriber.prototype._next=function(e){var t=this.index++;this.predicate?this._tryPredicate(e,t):this._emit(e,t)},FirstSubscriber.prototype._tryPredicate=function(e,t){var r;try{r=this.predicate(e,t,this.source)}catch(e){return void this.destination.error(e)}r&&this._emit(e,t)},FirstSubscriber.prototype._emit=function(e,t){return this.resultSelector?void this._tryResultSelector(e,t):void this._emitFinal(e)},FirstSubscriber.prototype._tryResultSelector=function(e,t){var r;try{r=this.resultSelector(e,t)}catch(e){return void this.destination.error(e)}this._emitFinal(r)},FirstSubscriber.prototype._emitFinal=function(e){var t=this.destination;t.next(e),t.complete(),this.hasCompleted=!0},FirstSubscriber.prototype._complete=function(){var e=this.destination;this.hasCompleted||"undefined"==typeof this.defaultValue?this.hasCompleted||e.error(new o.EmptyError):(e.next(this.defaultValue),e.complete())},FirstSubscriber}(i.Subscriber)},function(e,t,r){"use strict";function last(e,t,r){return this.lift(new a(e,t,r,this))}var n=this&&this.__extends||function(e,t){function __(){this.constructor=e}for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r]);e.prototype=null===t?Object.create(t):(__.prototype=t.prototype,new __)},i=r(27),o=r(245);t.last=last;var a=function(){function LastOperator(e,t,r,n){this.predicate=e,this.resultSelector=t,this.defaultValue=r,this.source=n}return LastOperator.prototype.call=function(e,t){return t._subscribe(new s(e,this.predicate,this.resultSelector,this.defaultValue,this.source))},LastOperator}(),s=function(e){function LastSubscriber(t,r,n,i,o){e.call(this,t),this.predicate=r,this.resultSelector=n,this.defaultValue=i,this.source=o,this.hasValue=!1,this.index=0,"undefined"!=typeof i&&(this.lastValue=i,this.hasValue=!0)}return n(LastSubscriber,e),LastSubscriber.prototype._next=function(e){var t=this.index++;if(this.predicate)this._tryPredicate(e,t);else{if(this.resultSelector)return void this._tryResultSelector(e,t);this.lastValue=e,this.hasValue=!0}},LastSubscriber.prototype._tryPredicate=function(e,t){var r;try{r=this.predicate(e,t,this.source)}catch(e){return void this.destination.error(e)}if(r){if(this.resultSelector)return void this._tryResultSelector(e,t);this.lastValue=e,this.hasValue=!0}},LastSubscriber.prototype._tryResultSelector=function(e,t){var r;try{r=this.resultSelector(e,t)}catch(e){return void this.destination.error(e)}this.lastValue=r,this.hasValue=!0},LastSubscriber.prototype._complete=function(){var e=this.destination;this.hasValue?(e.next(this.lastValue),e.complete()):e.error(new o.EmptyError)},LastSubscriber}(i.Subscriber)},function(e,t,r){"use strict";function observeOn(e,t){return void 0===t&&(t=0),this.lift(new a(e,t))}var n=this&&this.__extends||function(e,t){function __(){this.constructor=e}for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r]);e.prototype=null===t?Object.create(t):(__.prototype=t.prototype,new __)},i=r(27),o=r(694);t.observeOn=observeOn;var a=function(){function ObserveOnOperator(e,t){void 0===t&&(t=0),this.scheduler=e,this.delay=t}return ObserveOnOperator.prototype.call=function(e,t){return t._subscribe(new s(e,this.scheduler,this.delay))},ObserveOnOperator}();t.ObserveOnOperator=a;var s=function(e){function ObserveOnSubscriber(t,r,n){void 0===n&&(n=0),e.call(this,t),this.scheduler=r,this.delay=n}return n(ObserveOnSubscriber,e),ObserveOnSubscriber.dispatch=function(e){var t=e.notification,r=e.destination;t.observe(r)},ObserveOnSubscriber.prototype.scheduleMessage=function(e){this.add(this.scheduler.schedule(ObserveOnSubscriber.dispatch,this.delay,new u(e,this.destination)))},ObserveOnSubscriber.prototype._next=function(e){this.scheduleMessage(o.Notification.createNext(e))},ObserveOnSubscriber.prototype._error=function(e){this.scheduleMessage(o.Notification.createError(e))},ObserveOnSubscriber.prototype._complete=function(){this.scheduleMessage(o.Notification.createComplete())},ObserveOnSubscriber}(i.Subscriber);t.ObserveOnSubscriber=s;var u=function(){function ObserveOnMessage(e,t){this.notification=e,this.destination=t}return ObserveOnMessage}();t.ObserveOnMessage=u},function(e,t,r){"use strict";function reduce(e,t){return this.lift(new o(e,t))}var n=this&&this.__extends||function(e,t){function __(){this.constructor=e}for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r]);e.prototype=null===t?Object.create(t):(__.prototype=t.prototype,new __)},i=r(27);t.reduce=reduce;var o=function(){function ReduceOperator(e,t){this.accumulator=e,this.seed=t}return ReduceOperator.prototype.call=function(e,t){return t._subscribe(new a(e,this.accumulator,this.seed))},ReduceOperator}();t.ReduceOperator=o;var a=function(e){function ReduceSubscriber(t,r,n){e.call(this,t),this.accumulator=r,this.hasValue=!1,this.acc=n,this.accumulator=r,this.hasSeed="undefined"!=typeof n}return n(ReduceSubscriber,e),ReduceSubscriber.prototype._next=function(e){this.hasValue||(this.hasValue=this.hasSeed)?this._tryReduce(e):(this.acc=e,this.hasValue=!0)},ReduceSubscriber.prototype._tryReduce=function(e){var t;try{t=this.accumulator(this.acc,e)}catch(e){return void this.destination.error(e)}this.acc=t},ReduceSubscriber.prototype._complete=function(){(this.hasValue||this.hasSeed)&&this.destination.next(this.acc),this.destination.complete()},ReduceSubscriber}(i.Subscriber);t.ReduceSubscriber=a},function(e,t,r){"use strict";function toPromise(e){var t=this;if(e||(n.root.Rx&&n.root.Rx.config&&n.root.Rx.config.Promise?e=n.root.Rx.config.Promise:n.root.Promise&&(e=n.root.Promise)),!e)throw new Error("no Promise impl found");return new e(function(e,r){var n;t.subscribe(function(e){return n=e},function(e){return r(e)},function(){return e(n)})})}var n=r(61);t.toPromise=toPromise},function(e,t){"use strict";var r=this&&this.__extends||function(e,t){function __(){this.constructor=e}for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r]);e.prototype=null===t?Object.create(t):(__.prototype=t.prototype,new __)},n=function(e){function UnsubscriptionError(t){e.call(this),this.errors=t;var r=Error.call(this,t?t.length+" errors occurred during unsubscription:\n "+t.map(function(e,t){return t+1+") "+e.toString()}).join("\n "):"");this.name=r.name="UnsubscriptionError",this.stack=r.stack,this.message=r.message}return r(UnsubscriptionError,e),UnsubscriptionError}(Error);t.UnsubscriptionError=n},function(e,t){"use strict";function isObject(e){return null!=e&&"object"==typeof e}t.isObject=isObject},function(e,t){"use strict";function isScheduler(e){return e&&"function"==typeof e.schedule}t.isScheduler=isScheduler},function(e,t,r){"use strict";function toSubscriber(e,t,r){if(e){if(e instanceof n.Subscriber)return e;if(e[i.$$rxSubscriber])return e[i.$$rxSubscriber]()}return e||t||r?new n.Subscriber(e,t,r):new n.Subscriber(o.empty)}var n=r(27),i=r(244),o=r(377);t.toSubscriber=toSubscriber},,,,,,,,function(e,t,r){"use strict";r(89),r(158),r(0),r(72),r(249),r(88),r(73),r(114),r(251),r(410)}],[725]);
protected/modules1/yupe/extensions/booster/assets/js/jqslider/jQRangeSlider-min.js
itrustam/cupon
/* jQRangeSlider Copyright (C) Guillaume Gautreau 2012 Dual licensed under the MIT or GPL Version 2 licenses. */ (function(c){c.widget("ui.rangeSliderMouseTouch",c.ui.mouse,{_mouseInit:function(){var a=this;c.ui.mouse.prototype._mouseInit.apply(this);this._mouseDownEvent=!1;this.element.bind("touchstart."+this.widgetName,function(b){return a._touchStart(b)})},_mouseDestroy:function(){c(document).unbind("touchmove."+this.widgetName,this._touchMoveDelegate).unbind("touchend."+this.widgetName,this._touchEndDelegate);c.ui.mouse.prototype._mouseDestroy.apply(this)},_touchStart:function(a){a.which=1;a.preventDefault(); this._fillTouchEvent(a);var b=this,d=this._mouseDownEvent;this._mouseDown(a);if(d!==this._mouseDownEvent)this._touchEndDelegate=function(a){b._touchEnd(a)},this._touchMoveDelegate=function(a){b._touchMove(a)},c(document).bind("touchmove."+this.widgetName,this._touchMoveDelegate).bind("touchend."+this.widgetName,this._touchEndDelegate)},_touchEnd:function(a){this._fillTouchEvent(a);this._mouseUp(a);c(document).unbind("touchmove."+this.widgetName,this._touchMoveDelegate).unbind("touchend."+this.widgetName, this._touchEndDelegate);this._mouseDownEvent=!1;c(document).trigger("mouseup")},_touchMove:function(a){a.preventDefault();this._fillTouchEvent(a);return this._mouseMove(a)},_fillTouchEvent:function(a){var b;b=typeof a.targetTouches==="undefined"&&typeof a.changedTouches==="undefined"?a.originalEvent.targetTouches[0]||a.originalEvent.changedTouches[0]:a.targetTouches[0]||a.changedTouches[0];a.pageX=b.pageX;a.pageY=b.pageY}})})(jQuery);(function(c){c.widget("ui.rangeSliderDraggable",c.ui.rangeSliderMouseTouch,{cache:null,options:{containment:null},_create:function(){setTimeout(c.proxy(this._initElement,this),10)},_initElement:function(){this._mouseInit();this._cache()},_setOption:function(a,b){if(a=="containment")this.options.containment=b===null||c(b).length==0?null:c(b)},_mouseStart:function(a){this._cache();this.cache.click={left:a.pageX,top:a.pageY};this.cache.initialOffset=this.element.offset();this._triggerMouseEvent("mousestart"); return!0},_mouseDrag:function(a){a=a.pageX-this.cache.click.left;a=this._constraintPosition(a+this.cache.initialOffset.left);this._applyPosition(a);this._triggerMouseEvent("sliderDrag");return!1},_mouseStop:function(){this._triggerMouseEvent("stop")},_constraintPosition:function(a){this.element.parent().length!==0&&this.cache.parent.offset!=null&&(a=Math.min(a,this.cache.parent.offset.left+this.cache.parent.width-this.cache.width.outer),a=Math.max(a,this.cache.parent.offset.left));return a},_applyPosition:function(a){var b= {top:this.cache.offset.top,left:a};this.element.offset({left:a});this.cache.offset=b},_cacheIfNecessary:function(){this.cache===null&&this._cache()},_cache:function(){this.cache={};this._cacheMargins();this._cacheParent();this._cacheDimensions();this.cache.offset=this.element.offset()},_cacheMargins:function(){this.cache.margin={left:this._parsePixels(this.element,"marginLeft"),right:this._parsePixels(this.element,"marginRight"),top:this._parsePixels(this.element,"marginTop"),bottom:this._parsePixels(this.element, "marginBottom")}},_cacheParent:function(){if(this.options.parent!==null){var a=this.element.parent();this.cache.parent={offset:a.offset(),width:a.width()}}else this.cache.parent=null},_cacheDimensions:function(){this.cache.width={outer:this.element.outerWidth(),inner:this.element.width()}},_parsePixels:function(a,b){return parseInt(a.css(b),10)||0},_triggerMouseEvent:function(a){var b=this._prepareEventData();this.element.trigger(a,b)},_prepareEventData:function(){return{element:this.element,offset:this.cache.offset|| null}}})})(jQuery);(function(c){c.widget("ui.rangeSliderBar",c.ui.rangeSliderDraggable,{options:{leftHandle:null,rightHandle:null,bounds:{min:0,max:100},type:"rangeSliderHandle",range:!1,drag:function(){},stop:function(){},values:{min:0,max:20},wheelSpeed:4,wheelMode:null},_values:{min:0,max:20},_waitingToInit:2,_wheelTimeout:!1,_create:function(){c.ui.rangeSliderDraggable.prototype._create.apply(this);this.element.css("position","absolute").css("top",0).addClass("ui-rangeSlider-bar");this.options.leftHandle.bind("initialize", c.proxy(this._onInitialized,this)).bind("mousestart",c.proxy(this._cache,this)).bind("stop",c.proxy(this._onHandleStop,this));this.options.rightHandle.bind("initialize",c.proxy(this._onInitialized,this)).bind("mousestart",c.proxy(this._cache,this)).bind("stop",c.proxy(this._onHandleStop,this));this._bindHandles();this._values=this.options.values;this._setWheelModeOption(this.options.wheelMode)},_setOption:function(a,b){a==="range"?this._setRangeOption(b):a==="wheelSpeed"?this._setWheelSpeedOption(b): a==="wheelMode"&&this._setWheelModeOption(b)},_setRangeOption:function(a){if(typeof a!="object"||a===null)a=!1;if(!(a===!1&&this.options.range===!1))this.options.range=a!==!1?{min:typeof a.min==="undefined"?this.options.range.min||!1:a.min,max:typeof a.max==="undefined"?this.options.range.max||!1:a.max}:!1,this._setLeftRange(),this._setRightRange()},_setWheelSpeedOption:function(a){if(typeof a==="number"&&a>0)this.options.wheelSpeed=a},_setWheelModeOption:function(a){if(a===null||a===!1||a==="zoom"|| a==="scroll")this.options.wheelMode!==a&&this.element.parent().unbind("mousewheel.bar"),this._bindMouseWheel(a),this.options.wheelMode=a},_bindMouseWheel:function(a){a==="zoom"?this.element.parent().bind("mousewheel.bar",c.proxy(this._mouseWheelZoom,this)):a==="scroll"&&this.element.parent().bind("mousewheel.bar",c.proxy(this._mouseWheelScroll,this))},_setLeftRange:function(){if(this.options.range==!1)return!1;var a=this._values.max,b={min:!1,max:!1};b.max=(this.options.range.min||!1)!==!1?this._leftHandle("substract", a,this.options.range.min):!1;b.min=(this.options.range.max||!1)!==!1?this._leftHandle("substract",a,this.options.range.max):!1;this._leftHandle("option","range",b)},_setRightRange:function(){var a=this._values.min,b={min:!1,max:!1};b.min=(this.options.range.min||!1)!==!1?this._rightHandle("add",a,this.options.range.min):!1;b.max=(this.options.range.max||!1)!==!1?this._rightHandle("add",a,this.options.range.max):!1;this._rightHandle("option","range",b)},_deactivateRange:function(){this._leftHandle("option", "range",!1);this._rightHandle("option","range",!1)},_reactivateRange:function(){this._setRangeOption(this.options.range)},_onInitialized:function(){this._waitingToInit--;this._waitingToInit===0&&this._initMe()},_initMe:function(){this._cache();this.min(this.options.values.min);this.max(this.options.values.max);var a=this._leftHandle("position"),b=this._rightHandle("position")+this.options.rightHandle.width();this.element.offset({left:a});this.element.css("width",b-a)},_leftHandle:function(){return this._handleProxy(this.options.leftHandle, arguments)},_rightHandle:function(){return this._handleProxy(this.options.rightHandle,arguments)},_handleProxy:function(a,b){var c=Array.prototype.slice.call(b);return a[this.options.type].apply(a,c)},_cache:function(){c.ui.rangeSliderDraggable.prototype._cache.apply(this);this._cacheHandles()},_cacheHandles:function(){this.cache.rightHandle={};this.cache.rightHandle.width=this.options.rightHandle.width();this.cache.rightHandle.offset=this.options.rightHandle.offset();this.cache.leftHandle={};this.cache.leftHandle.offset= this.options.leftHandle.offset()},_mouseStart:function(a){c.ui.rangeSliderDraggable.prototype._mouseStart.apply(this,[a]);this._deactivateRange()},_mouseStop:function(a){c.ui.rangeSliderDraggable.prototype._mouseStop.apply(this,[a]);this._cacheHandles();this._values.min=this._leftHandle("value");this._values.max=this._rightHandle("value");this._reactivateRange();this._leftHandle().trigger("stop");this._rightHandle().trigger("stop")},_onDragLeftHandle:function(a,b){this._cacheIfNecessary();this._switchedValues()? (this._switchHandles(),this._onDragRightHandle(a,b)):(this._values.min=b.value,this.cache.offset.left=b.offset.left,this.cache.leftHandle.offset=b.offset,this._positionBar())},_onDragRightHandle:function(a,b){this._cacheIfNecessary();this._switchedValues()?(this._switchHandles(),this._onDragLeftHandle(a,b)):(this._values.max=b.value,this.cache.rightHandle.offset=b.offset,this._positionBar())},_positionBar:function(){var a=this.cache.rightHandle.offset.left+this.cache.rightHandle.width-this.cache.leftHandle.offset.left; this.cache.width.inner=a;this.element.css("width",a).offset({left:this.cache.leftHandle.offset.left})},_onHandleStop:function(){this._setLeftRange();this._setRightRange()},_switchedValues:function(){if(this.min()>this.max()){var a=this._values.min;this._values.min=this._values.max;this._values.max=a;return!0}return!1},_switchHandles:function(){var a=this.options.leftHandle;this.options.leftHandle=this.options.rightHandle;this.options.rightHandle=a;this._leftHandle("option","isLeft",!0);this._rightHandle("option", "isLeft",!1);this._bindHandles();this._cacheHandles()},_bindHandles:function(){this.options.leftHandle.unbind(".bar").bind("sliderDrag.bar update.bar moving.bar",c.proxy(this._onDragLeftHandle,this));this.options.rightHandle.unbind(".bar").bind("sliderDrag.bar update.bar moving.bar",c.proxy(this._onDragRightHandle,this))},_constraintPosition:function(a){var b={};b.left=c.ui.rangeSliderDraggable.prototype._constraintPosition.apply(this,[a]);b.left=this._leftHandle("position",b.left);a=this._rightHandle("position", b.left+this.cache.width.outer-this.cache.rightHandle.width);b.width=a-b.left+this.cache.rightHandle.width;return b},_applyPosition:function(a){c.ui.rangeSliderDraggable.prototype._applyPosition.apply(this,[a.left]);this.element.width(a.width)},_mouseWheelZoom:function(a,b,d,e){a=this._values.min+(this._values.max-this._values.min)/2;b={};d={};this.options.range===!1||this.options.range.min===!1?(b.max=a,d.min=a):(b.max=a-this.options.range.min/2,d.min=a+this.options.range.min/2);if(this.options.range!== !1&&this.options.range.max!==!1)b.min=a-this.options.range.max/2,d.max=a+this.options.range.max/2;this._leftHandle("option","range",b);this._rightHandle("option","range",d);clearTimeout(this._wheelTimeout);this._wheelTimeout=setTimeout(c.proxy(this._wheelStop,this),200);this.zoomOut(e*this.options.wheelSpeed);return!1},_mouseWheelScroll:function(a,b,d,e){this._wheelTimeout===!1?this.startScroll():clearTimeout(this._wheelTimeout);this._wheelTimeout=setTimeout(c.proxy(this._wheelStop,this),200);this.scrollLeft(e* this.options.wheelSpeed);return!1},_wheelStop:function(){this.stopScroll();this._wheelTimeout=!1},min:function(a){return this._leftHandle("value",a)},max:function(a){return this._rightHandle("value",a)},startScroll:function(){this._deactivateRange()},stopScroll:function(){this._reactivateRange();this._triggerMouseEvent("stop")},scrollLeft:function(a){a=a||1;if(a<0)return this.scrollRight(-a);a=this._leftHandle("moveLeft",a);this._rightHandle("moveLeft",a);this.update();this._triggerMouseEvent("scroll")}, scrollRight:function(a){a=a||1;if(a<0)return this.scrollLeft(-a);a=this._rightHandle("moveRight",a);this._leftHandle("moveRight",a);this.update();this._triggerMouseEvent("scroll")},zoomIn:function(a){a=a||1;if(a<0)return this.zoomOut(-a);var b=this._rightHandle("moveLeft",a);a>b&&(b/=2,this._rightHandle("moveRight",b));this._leftHandle("moveRight",b);this.update();this._triggerMouseEvent("zoom")},zoomOut:function(a){a=a||1;if(a<0)return this.zoomIn(-a);var b=this._rightHandle("moveRight",a);a>b&& (b/=2,this._rightHandle("moveLeft",b));this._leftHandle("moveLeft",b);this.update();this._triggerMouseEvent("zoom")},values:function(a,b){if(typeof a!=="undefined"&&typeof b!=="undefined"){var c=Math.min(a,b),e=Math.max(a,b);this._deactivateRange();this.options.leftHandle.unbind(".bar");this.options.rightHandle.unbind(".bar");this._values.min=this._leftHandle("value",c);this._values.max=this._rightHandle("value",e);this._bindHandles();this._reactivateRange();this.update()}return{min:this._values.min, max:this._values.max}},update:function(){this._values.min=this.min();this._values.max=this.max();this._cache();this._positionBar()}})})(jQuery);(function(c){function a(a,d,e,f){this.label1=a;this.label2=d;this.type=e;this.options=f;this.handle1=this.label1[this.type]("option","handle");this.handle2=this.label2[this.type]("option","handle");this.cache=null;this.left=a;this.right=d;this.updating=this.initialized=this.moving=!1;this.Init=function(){this.BindHandle(this.handle1);this.BindHandle(this.handle2);this.options.show==="show"?(setTimeout(c.proxy(this.PositionLabels,this),1),this.initialized=!0):setTimeout(c.proxy(this.AfterInit,this), 1E3)};this.AfterInit=function(){this.initialized=!0};this.Cache=function(){if(this.label1.css("display")!="none")this.cache={},this.cache.label1={},this.cache.label2={},this.cache.handle1={},this.cache.handle2={},this.cache.offsetParent={},this.CacheElement(this.label1,this.cache.label1),this.CacheElement(this.label2,this.cache.label2),this.CacheElement(this.handle1,this.cache.handle1),this.CacheElement(this.handle2,this.cache.handle2),this.CacheElement(this.label1.offsetParent(),this.cache.offsetParent)}; this.CacheIfNecessary=function(){this.cache===null?this.Cache():(this.CacheWidth(this.label1,this.cache.label1),this.CacheWidth(this.label2,this.cache.label2),this.CacheHeight(this.label1,this.cache.label1),this.CacheHeight(this.label2,this.cache.label2),this.CacheWidth(this.label1.offsetParent(),this.cache.offsetParent))};this.CacheElement=function(a,b){this.CacheWidth(a,b);this.CacheHeight(a,b);b.offset=a.offset();b.margin={left:this.ParsePixels("marginLeft",a),right:this.ParsePixels("marginRight", a)};b.border={left:this.ParsePixels("borderLeftWidth",a),right:this.ParsePixels("borderRightWidth",a)}};this.CacheWidth=function(a,b){b.width=a.width();b.outerWidth=a.outerWidth()};this.CacheHeight=function(a,b){b.outerHeightMargin=a.outerHeight(!0)};this.ParsePixels=function(a,b){return parseInt(b.css(a),10)||0};this.BindHandle=function(a){a.bind("updating",c.proxy(this.onHandleUpdating,this));a.bind("update",c.proxy(this.onHandleUpdated,this));a.bind("moving",c.proxy(this.onHandleMoving,this)); a.bind("stop",c.proxy(this.onHandleStop,this))};this.PositionLabels=function(){this.CacheIfNecessary();if(this.cache!=null){var a=this.GetRawPosition(this.cache.label1,this.cache.handle1),b=this.GetRawPosition(this.cache.label2,this.cache.handle2);this.ConstraintPositions(a,b);this.PositionLabel(this.label1,a.left,this.cache.label1);this.PositionLabel(this.label2,b.left,this.cache.label2)}};this.PositionLabel=function(a,b,c){var d=this.cache.offsetParent.offset.left+this.cache.offsetParent.border.left; d-b>=0?(a.css("right",""),a.offset({left:b})):(d+=this.cache.offsetParent.width,b=b+c.margin.left+c.outerWidth+c.margin.right,b=d-b,a.css("left",""),a.css("right",b))};this.ConstraintPositions=function(a,b){a.center<b.center&&a.outerRight>b.outerLeft?(a=this.getLeftPosition(a,b),this.getRightPosition(a,b)):a.center>b.center&&b.outerRight>a.outerLeft&&(b=this.getLeftPosition(b,a),this.getRightPosition(b,a))};this.getLeftPosition=function(a,b){a.left=(b.center+a.center)/2-a.cache.outerWidth-a.cache.margin.right+ a.cache.border.left;return a};this.getRightPosition=function(a,b){b.left=(b.center+a.center)/2+b.cache.margin.left+b.cache.border.left;return b};this.ShowIfNecessary=function(){if(!(this.options.show==="show"||this.moving||!this.initialized||this.updating))this.label1.stop(!0,!0).fadeIn(this.options.durationIn||0),this.label2.stop(!0,!0).fadeIn(this.options.durationIn||0),this.moving=!0};this.HideIfNeeded=function(){if(this.moving===!0)this.label1.stop(!0,!0).delay(this.options.delayOut||0).fadeOut(this.options.durationOut|| 0),this.label2.stop(!0,!0).delay(this.options.delayOut||0).fadeOut(this.options.durationOut||0),this.moving=!1};this.onHandleMoving=function(a,b){this.ShowIfNecessary();this.CacheIfNecessary();this.UpdateHandlePosition(b);this.PositionLabels()};this.onHandleUpdating=function(){this.updating=!0};this.onHandleUpdated=function(){this.updating=!1;this.cache=null};this.onHandleStop=function(){this.HideIfNeeded()};this.UpdateHandlePosition=function(a){this.cache!=null&&(a.element[0]==this.handle1[0]?this.UpdatePosition(a, this.cache.handle1):this.UpdatePosition(a,this.cache.handle2))};this.UpdatePosition=function(a,b){b.offset=a.offset};this.GetRawPosition=function(a,b){var c=b.offset.left+b.outerWidth/2,d=c-a.outerWidth/2,e=d-a.margin.left-a.border.left;return{left:d,outerLeft:e,top:b.offset.top-a.outerHeightMargin,right:d+a.outerWidth-a.border.left-a.border.right,outerRight:e+a.outerWidth+a.margin.left+a.margin.right,cache:a,center:c}};this.Init()}c.widget("ui.rangeSliderLabel",c.ui.rangeSliderMouseTouch,{options:{handle:null, formatter:!1,handleType:"rangeSliderHandle",show:"show",durationIn:0,durationOut:500,delayOut:500,isLeft:!1},cache:null,_positionner:null,_valueContainer:null,_innerElement:null,_create:function(){this.options.isLeft=this._handle("option","isLeft");this.element.addClass("ui-rangeSlider-label").css("position","absolute").css("display","block");this._valueContainer=c("<div class='ui-rangeSlider-label-value' />").appendTo(this.element);this._innerElement=c("<div class='ui-rangeSlider-label-inner' />").appendTo(this.element); this._toggleClass();this.options.handle.bind("moving",c.proxy(this._onMoving,this)).bind("update",c.proxy(this._onUpdate,this)).bind("switch",c.proxy(this._onSwitch,this));this.options.show!=="show"&&this.element.hide();this._mouseInit()},_handle:function(){return this.options.handle[this.options.handleType].apply(this.options.handle,Array.prototype.slice.apply(arguments))},_setOption:function(a,c){a==="show"?this._updateShowOption(c):(a==="durationIn"||a==="durationOut"||a==="delayOut")&&this._updateDurations(a, c)},_updateShowOption:function(a){this.options.show=a;this.options.show!=="show"?this.element.hide():(this.element.show(),this._display(this.options.handle[this.options.handleType]("value")),this._positionner.PositionLabels());this._positionner.options.show=this.options.show},_updateDurations:function(a,c){parseInt(c)===c&&(this._positionner.options[a]=c,this.options[a]=c)},_display:function(a){this.options.formatter==!1?this._displayText(Math.round(a)):this._displayText(this.options.formatter(a))}, _displayText:function(a){this._valueContainer.text(a)},_toggleClass:function(){this.element.toggleClass("ui-rangeSlider-leftLabel",this.options.isLeft).toggleClass("ui-rangeSlider-rightLabel",!this.options.isLeft)},_mouseDown:function(a){this.options.handle.trigger(a)},_mouseUp:function(a){this.options.handle.trigger(a)},_mouseMove:function(a){this.options.handle.trigger(a)},_onMoving:function(a,c){this._display(c.value)},_onUpdate:function(){this.options.show==="show"&&this.update()},_onSwitch:function(a, c){this.options.isLeft=c;this._toggleClass();this._positionner.PositionLabels()},pair:function(b){if(this._positionner==null)this._positionner=new a(this.element,b,this.widgetName,{show:this.options.show,durationIn:this.options.durationIn,durationOut:this.options.durationOut,delayOut:this.options.delayOut}),b[this.widgetName]("positionner",this._positionner)},positionner:function(a){if(typeof a!=="undefined")this._positionner=a;return this._positionner},update:function(){this._positionner.cache=null; this._display(this._handle("value"));this.options.show=="show"&&this._positionner.PositionLabels()}})})(jQuery);(function(c){c.widget("ui.rangeSliderHandle",c.ui.rangeSliderDraggable,{currentMove:null,margin:0,parentElement:null,options:{isLeft:!0,bounds:{min:0,max:100},range:!1,value:0,step:!1},_value:0,_left:0,_create:function(){c.ui.rangeSliderDraggable.prototype._create.apply(this);this.element.css("position","absolute").css("top",0).addClass("ui-rangeSlider-handle").toggleClass("ui-rangeSlider-leftHandle",this.options.isLeft).toggleClass("ui-rangeSlider-rightHandle",!this.options.isLeft);this._value=this.options.value}, _setOption:function(a,b){if(a==="isLeft"&&(b===!0||b===!1)&&b!=this.options.isLeft)this.options.isLeft=b,this.element.toggleClass("ui-rangeSlider-leftHandle",this.options.isLeft).toggleClass("ui-rangeSlider-rightHandle",!this.options.isLeft),this._position(this._value),this.element.trigger("switch",this.options.isLeft);else if(a==="step"&&this._checkStep(b))this.options.step=b,this.update();else if(a==="bounds")this.options.bounds=b,this.update();else if(a==="range"&&this._checkRange(b))this.options.range= b,this.update();c.ui.rangeSliderDraggable.prototype._setOption.apply(this,[a,b])},_checkRange:function(a){return a===!1||(typeof a.min==="undefined"||a.min===!1||parseFloat(a.min)===a.min)&&(typeof a.max==="undefined"||a.max===!1||parseFloat(a.max)===a.max)},_checkStep:function(a){return a===!1||parseFloat(a)==a},_initElement:function(){c.ui.rangeSliderDraggable.prototype._initElement.apply(this);this.cache.parent.width===0||this.cache.parent.width===null?setTimeout(c.proxy(this._initElement,this), 500):(this._position(this.options.value),this._triggerMouseEvent("initialize"))},_bounds:function(){return this.options.bounds},_cache:function(){c.ui.rangeSliderDraggable.prototype._cache.apply(this);this._cacheParent()},_cacheParent:function(){var a=this.element.parent();this.cache.parent={element:a,offset:a.offset(),padding:{left:this._parsePixels(a,"paddingLeft")},width:a.width()}},_position:function(a){this._applyPosition(this._getPositionForValue(a))},_constraintPosition:function(a){return this._getPositionForValue(this._getValueForPosition(a))}, _applyPosition:function(a){c.ui.rangeSliderDraggable.prototype._applyPosition.apply(this,[a]);this._left=a;this._setValue(this._getValueForPosition(a));this._triggerMouseEvent("moving")},_prepareEventData:function(){var a=c.ui.rangeSliderDraggable.prototype._prepareEventData.apply(this);a.value=this._value;return a},_setValue:function(a){if(a!=this._value)this._value=a},_constraintValue:function(a){a=Math.min(a,this._bounds().max);a=Math.max(a,this._bounds().min);a=this._round(a);if(this.options.range!== !1){var b=this.options.range.min||!1,c=this.options.range.max||!1;b!==!1&&(a=Math.max(a,this._round(b)));c!==!1&&(a=Math.min(a,this._round(c)))}return a},_round:function(a){if(this.options.step!==!1&&this.options.step>0)return Math.round(a/this.options.step)*this.options.step;return a},_getPositionForValue:function(a){if(this.cache.parent.offset==null)return 0;a=this._constraintValue(a);return(a-this.options.bounds.min)/(this.options.bounds.max-this.options.bounds.min)*(this.cache.parent.width-this.cache.width.outer)+ this.cache.parent.offset.left},_getValueForPosition:function(a){return this._constraintValue(this._getRawValueForPositionAndBounds(a,this.options.bounds.min,this.options.bounds.max))},_getRawValueForPositionAndBounds:function(a,b,c){return(a-(this.cache.parent.offset==null?0:this.cache.parent.offset.left))/(this.cache.parent.width-this.cache.width.outer)*(c-b)+b},value:function(a){typeof a!="undefined"&&(this._cache(),a=this._constraintValue(a),this._position(a));return this._value},update:function(){this._cache(); var a=this._constraintValue(this._value),b=this._getPositionForValue(a);a!=this._value?(this._triggerMouseEvent("updating"),this._position(a),this._triggerMouseEvent("update")):b!=this.cache.offset.left&&(this._triggerMouseEvent("updating"),this._position(a),this._triggerMouseEvent("update"))},position:function(a){typeof a!="undefined"&&(this._cache(),a=this._constraintPosition(a),this._applyPosition(a));return this._left},add:function(a,b){return a+b},substract:function(a,b){return a-b},stepsBetween:function(a, b){if(this.options.step===!1)return b-a;return(b-a)/this.options.step},multiplyStep:function(a,b){return a*b},moveRight:function(a){var b;if(this.options.step==!1)return b=this._left,this.position(this._left+a),this._left-b;b=this._value;this.value(this.add(b,this.multiplyStep(this.options.step,a)));return this.stepsBetween(b,this._value)},moveLeft:function(a){return-this.moveRight(-a)},stepRatio:function(){return this.options.step==!1?1:this.cache.parent.width/((this.options.bounds.max-this.options.bounds.min)/ this.options.step)}})})(jQuery);(function(c){c.widget("ui.rangeSlider",{options:{bounds:{min:0,max:100},defaultValues:{min:20,max:50},wheelMode:null,wheelSpeed:4,arrows:!0,valueLabels:"show",formatter:null,durationIn:0,durationOut:400,delayOut:200,range:{min:!1,max:!1},step:!1},_values:null,_valuesChanged:!1,bar:null,leftHandle:null,rightHandle:null,innerBar:null,container:null,arrows:null,labels:null,changing:{min:!1,max:!1},changed:{min:!1,max:!1},_create:function(){this._values={min:this.options.defaultValues.min,max:this.options.defaultValues.max}; this.labels={left:null,right:null,leftDisplayed:!0,rightDisplayed:!0};this.arrows={left:null,right:null};this.changing={min:!1,max:!1};this.changed={min:!1,max:!1};this.element.css("position")!=="absolute"&&this.element.css("position","relative");this.container=c("<div class='ui-rangeSlider-container' />").css("position","absolute").appendTo(this.element);this.innerBar=c("<div class='ui-rangeSlider-innerBar' />").css("position","absolute").css("top",0).css("left",0);this.leftHandle=this._createHandle({isLeft:!0, bounds:this.options.bounds,value:this.options.defaultValues.min,step:this.options.step}).appendTo(this.container);this.rightHandle=this._createHandle({isLeft:!1,bounds:this.options.bounds,value:this.options.defaultValues.max,step:this.options.step}).appendTo(this.container);this._createBar();this.container.prepend(this.innerBar);this.arrows.left=this._createArrow("left");this.arrows.right=this._createArrow("right");this.element.addClass("ui-rangeSlider");this.options.arrows?this.element.addClass("ui-rangeSlider-withArrows"): (this.arrows.left.css("display","none"),this.arrows.right.css("display","none"),this.element.addClass("ui-rangeSlider-noArrow"));this.options.valueLabels!=="hide"?this._createLabels():this._destroyLabels();this._bindResize();setTimeout(c.proxy(this.resize,this),1);setTimeout(c.proxy(this._initValues,this),1)},_bindResize:function(){var a=this;this._resizeProxy=function(b){a.resize(b)};c(window).resize(this._resizeProxy)},_initWidth:function(){this.container.css("width",this.element.width()-this.container.outerWidth(!0)+ this.container.width());this.innerBar.css("width",this.container.width()-this.innerBar.outerWidth(!0)+this.innerBar.width())},_initValues:function(){this.values(this.options.defaultValues.min,this.options.defaultValues.max)},_setOption:function(a,b){if(a==="defaultValues"){if(typeof b.min!=="undefined"&&typeof b.max!=="undefined"&&parseFloat(b.min)===b.min&&parseFloat(b.max)===b.max)this.options.defaultValues=b}else if(a==="wheelMode"||a==="wheelSpeed")this._bar("option",a,b),this.options[a]=this._bar("option", a);else if(a==="arrows"&&(b===!0||b===!1)&&b!==this.options.arrows)this._setArrowsOption(b);else if(a==="valueLabels")this._setLabelsOption(b);else if(a==="durationIn"||a==="durationOut"||a==="delayOut")this._setLabelsDurations(a,b);else if(a==="formatter"&&b!==null&&typeof b==="function")this.options.formatter=b,this.options.valueLabels!=="hide"&&(this._destroyLabels(),this._createLabels());else if(a==="bounds"&&typeof b.min!=="undefined"&&typeof b.max!=="undefined")this.bounds(b.min,b.max);else if(a=== "range")this._bar("option","range",b),this.options.range=this._bar("option","range"),this._changed(!0);else if(a==="step")this.options.step=b,this._leftHandle("option","step",b),this._rightHandle("option","step",b),this._changed(!0)},_validProperty:function(a,b,c){if(a===null||typeof a[b]==="undefined")return c;return a[b]},_setLabelsOption:function(a){if(!(a!=="hide"&&a!=="show"&&a!=="change"))this.options.valueLabels=a,a!=="hide"?(this._createLabels(),this._leftLabel("update"),this._rightLabel("update")): this._destroyLabels()},_setArrowsOption:function(a){if(a===!0)this.element.removeClass("ui-rangeSlider-noArrow").addClass("ui-rangeSlider-withArrows"),this.arrows.left.css("display","block"),this.arrows.right.css("display","block"),this.options.arrows=!0;else if(a===!1)this.element.addClass("ui-rangeSlider-noArrow").removeClass("ui-rangeSlider-withArrows"),this.arrows.left.css("display","none"),this.arrows.right.css("display","none"),this.options.arrows=!1;this._initWidth()},_setLabelsDurations:function(a, b){parseInt(b,10)===b&&(this.labels.left!==null&&this._leftLabel("option",a,b),this.labels.right!==null&&this._rightLabel("option",a,b),this.options[a]=b)},_createHandle:function(a){return c("<div />")[this._handleType()](a).bind("sliderDrag",c.proxy(this._changing,this)).bind("stop",c.proxy(this._changed,this))},_createBar:function(){this.bar=c("<div />").prependTo(this.container).bind("sliderDrag scroll zoom",c.proxy(this._changing,this)).bind("stop",c.proxy(this._changed,this));this._bar({leftHandle:this.leftHandle, rightHandle:this.rightHandle,values:{min:this.options.defaultValues.min,max:this.options.defaultValues.max},type:this._handleType(),range:this.options.range,wheelMode:this.options.wheelMode,wheelSpeed:this.options.wheelSpeed});this.options.range=this._bar("option","range");this.options.wheelMode=this._bar("option","wheelMode");this.options.wheelSpeed=this._bar("option","wheelSpeed")},_createArrow:function(a){var b=c("<div class='ui-rangeSlider-arrow' />").append("<div class='ui-rangeSlider-arrow-inner' />").addClass("ui-rangeSlider-"+ a+"Arrow").css("position","absolute").css(a,0).appendTo(this.element),a=a==="right"?c.proxy(this._scrollRightClick,this):c.proxy(this._scrollLeftClick,this);b.bind("mousedown touchstart",a);return b},_proxy:function(a,b,c){c=Array.prototype.slice.call(c);return a[b].apply(a,c)},_handleType:function(){return"rangeSliderHandle"},_barType:function(){return"rangeSliderBar"},_bar:function(){return this._proxy(this.bar,this._barType(),arguments)},_labelType:function(){return"rangeSliderLabel"},_leftLabel:function(){return this._proxy(this.labels.left, this._labelType(),arguments)},_rightLabel:function(){return this._proxy(this.labels.right,this._labelType(),arguments)},_leftHandle:function(){return this._proxy(this.leftHandle,this._handleType(),arguments)},_rightHandle:function(){return this._proxy(this.rightHandle,this._handleType(),arguments)},_getValue:function(a,b){b===this.rightHandle&&(a-=b.outerWidth());return a*(this.options.bounds.max-this.options.bounds.min)/(this.container.innerWidth()-b.outerWidth(!0))+this.options.bounds.min},_trigger:function(a){var b= this;setTimeout(function(){b.element.trigger(a,{label:b.element,values:b.values()})},1)},_changing:function(){if(this._updateValues())this._trigger("valuesChanging"),this._valuesChanged=!0},_changed:function(a){if(this._updateValues()||this._valuesChanged)this._trigger("valuesChanged"),a!==!0&&this._trigger("userValuesChanged"),this._valuesChanged=!1},_updateValues:function(){var a=this._leftHandle("value"),b=this._rightHandle("value"),c=this._min(a,b),e=this._max(a,b),c=c!==this._values.min||e!== this._values.max;this._values.min=this._min(a,b);this._values.max=this._max(a,b);return c},_min:function(a,b){return Math.min(a,b)},_max:function(a,b){return Math.max(a,b)},_createLabel:function(a,b){var d;a===null?(d=this._getLabelConstructorParameters(a,b),a=c("<div />").appendTo(this.element)[this._labelType()](d)):(d=this._getLabelRefreshParameters(a,b),a[this._labelType()](d));return a},_getLabelConstructorParameters:function(a,b){return{handle:b,handleType:this._handleType(),formatter:this._getFormatter(), show:this.options.valueLabels,durationIn:this.options.durationIn,durationOut:this.options.durationOut,delayOut:this.options.delayOut}},_getLabelRefreshParameters:function(){return{formatter:this._getFormatter(),show:this.options.valueLabels,durationIn:this.options.durationIn,durationOut:this.options.durationOut,delayOut:this.options.delayOut}},_getFormatter:function(){if(this.options.formatter===!1||this.options.formatter===null)return this._defaultFormatter;return this.options.formatter},_defaultFormatter:function(a){return Math.round(a)}, _destroyLabel:function(a){a!==null&&(a.remove(),a=null);return a},_createLabels:function(){this.labels.left=this._createLabel(this.labels.left,this.leftHandle);this.labels.right=this._createLabel(this.labels.right,this.rightHandle);this._leftLabel("pair",this.labels.right)},_destroyLabels:function(){this.labels.left=this._destroyLabel(this.labels.left);this.labels.right=this._destroyLabel(this.labels.right)},_stepRatio:function(){return this._leftHandle("stepRatio")},_scrollRightClick:function(a){a.preventDefault(); this._bar("startScroll");this._bindStopScroll();this._continueScrolling("scrollRight",4*this._stepRatio(),1)},_continueScrolling:function(a,b,c,e){this._bar(a,c);e=e||5;e--;var f=this,g=Math.max(1,4/this._stepRatio());this._scrollTimeout=setTimeout(function(){e===0&&(b>16?b=Math.max(16,b/1.5):c=Math.min(g,c*2),e=5);f._continueScrolling(a,b,c,e)},b)},_scrollLeftClick:function(a){a.preventDefault();this._bar("startScroll");this._bindStopScroll();this._continueScrolling("scrollLeft",4*this._stepRatio(), 1)},_bindStopScroll:function(){var a=this;this._stopScrollHandle=function(b){b.preventDefault();a._stopScroll()};c(document).bind("mouseup touchend",this._stopScrollHandle)},_stopScroll:function(){c(document).unbind("mouseup touchend",this._stopScrollHandle);this._bar("stopScroll");clearTimeout(this._scrollTimeout)},values:function(a,b){var c=this._bar("values",a,b);typeof a!=="undefined"&&typeof b!=="undefined"&&this._changed(!0);return c},min:function(a){this._values.min=this.values(a,this._values.max).min; return this._values.min},max:function(a){this._values.max=this.values(this._values.min,a).max;return this._values.max},bounds:function(a,b){typeof a!=="undefined"&&typeof b!=="undefined"&&parseFloat(a)===a&&parseFloat(b)===b&&a<b&&(this._setBounds(a,b),this._changed(!0));return this.options.bounds},_setBounds:function(a,b){this.options.bounds={min:a,max:b};this._leftHandle("option","bounds",this.options.bounds);this._rightHandle("option","bounds",this.options.bounds);this._bar("option","bounds",this.options.bounds)}, zoomIn:function(a){this._bar("zoomIn",a)},zoomOut:function(a){this._bar("zoomOut",a)},scrollLeft:function(a){this._bar("startScroll");this._bar("scrollLeft",a);this._bar("stopScroll")},scrollRight:function(a){this._bar("startScroll");this._bar("scrollRight",a);this._bar("stopScroll")},resize:function(){this._initWidth();this._leftHandle("update");this._rightHandle("update")},destroy:function(){this.element.removeClass("ui-rangeSlider-withArrows").removeClass("ui-rangeSlider-noArrow");this.bar.detach(); this.leftHandle.detach();this.rightHandle.detach();this.innerBar.detach();this.container.detach();this.arrows.left.detach();this.arrows.right.detach();this.element.removeClass("ui-rangeSlider");this._destroyLabels();delete this.options;c(window).unbind("resize",this._resizeProxy);c.Widget.prototype.destroy.apply(this,arguments)}})})(jQuery);
ajax/libs/angular-google-maps/1.1.13/angular-google-maps.js
dmsanchez86/cdnjs
/*! angular-google-maps 1.1.13 2014-07-29 * AngularJS directives for Google Maps * git: https://github.com/nlaplante/angular-google-maps.git */ /* ! The MIT License Copyright (c) 2010-2013 Google, Inc. http://angularjs.org 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. angular-google-maps https://github.com/nlaplante/angular-google-maps @authors Nicolas Laplante - https://plus.google.com/108189012221374960701 Nicholas McCready - https://twitter.com/nmccready */ (function() { angular.module("google-maps.extensions", []); angular.module("google-maps.directives.api.utils", ['google-maps.extensions']); angular.module("google-maps.directives.api.managers", []); angular.module("google-maps.directives.api.models.child", ["google-maps.directives.api.utils"]); angular.module("google-maps.directives.api.models.parent", ["google-maps.directives.api.managers", "google-maps.directives.api.models.child"]); angular.module("google-maps.directives.api", ["google-maps.directives.api.models.parent"]); angular.module("google-maps", ["google-maps.directives.api"]).factory("debounce", [ "$timeout", function($timeout) { return function(fn) { var nthCall; nthCall = 0; return function() { var argz, later, that; that = this; argz = arguments; nthCall++; later = (function(version) { return function() { if (version === nthCall) { return fn.apply(that, argz); } }; })(nthCall); return $timeout(later, 0, true); }; }; } ]); }).call(this); (function() { angular.module("google-maps.extensions").service('ExtendGWin', function() { return { init: _.once(function() { if (!(google || (typeof google !== "undefined" && google !== null ? google.maps : void 0) || (google.maps.InfoWindow != null))) { return; } google.maps.InfoWindow.prototype._open = google.maps.InfoWindow.prototype.open; google.maps.InfoWindow.prototype._close = google.maps.InfoWindow.prototype.close; google.maps.InfoWindow.prototype._isOpen = false; google.maps.InfoWindow.prototype.open = function(map, anchor) { this._isOpen = true; this._open(map, anchor); }; google.maps.InfoWindow.prototype.close = function() { this._isOpen = false; this._close(); }; google.maps.InfoWindow.prototype.isOpen = function(val) { if (val == null) { val = void 0; } if (val == null) { return this._isOpen; } else { return this._isOpen = val; } }; /* Do the same for InfoBox TODO: Clean this up so the logic is defined once, wait until develop becomes master as this will be easier */ if (!window.InfoBox) { return; } window.InfoBox.prototype._open = window.InfoBox.prototype.open; window.InfoBox.prototype._close = window.InfoBox.prototype.close; window.InfoBox.prototype._isOpen = false; window.InfoBox.prototype.open = function(map, anchor) { this._isOpen = true; this._open(map, anchor); }; window.InfoBox.prototype.close = function() { this._isOpen = false; this._close(); }; window.InfoBox.prototype.isOpen = function(val) { if (val == null) { val = void 0; } if (val == null) { return this._isOpen; } else { return this._isOpen = val; } }; MarkerLabel_.prototype.setContent = function() { var content; content = this.marker_.get("labelContent"); if (!content || _.isEqual(this.oldContent, content)) { return; } if (typeof (content != null ? content.nodeType : void 0) === "undefined") { this.labelDiv_.innerHTML = content; this.eventDiv_.innerHTML = this.labelDiv_.innerHTML; this.oldContent = content; } else { this.labelDiv_.innerHTML = ""; this.labelDiv_.appendChild(content); content = content.cloneNode(true); this.eventDiv_.appendChild(content); this.oldContent = content; } }; /* Removes the DIV for the label from the DOM. It also removes all event handlers. This method is called automatically when the marker's <code>setMap(null)</code> method is called. @private */ return MarkerLabel_.prototype.onRemove = function() { if (this.labelDiv_.parentNode != null) { this.labelDiv_.parentNode.removeChild(this.labelDiv_); } if (this.eventDiv_.parentNode != null) { this.eventDiv_.parentNode.removeChild(this.eventDiv_); } if (!this.listeners_) { return; } if (!this.listeners_.length) { return; } this.listeners_.forEach(function(l) { return google.maps.event.removeListener(l); }); }; }) }; }); }).call(this); /* Author Nick McCready Intersection of Objects if the arrays have something in common each intersecting object will be returned in an new array. */ (function() { _.intersectionObjects = function(array1, array2, comparison) { var res, _this = this; if (comparison == null) { comparison = void 0; } res = _.map(array1, function(obj1) { return _.find(array2, function(obj2) { if (comparison != null) { return comparison(obj1, obj2); } else { return _.isEqual(obj1, obj2); } }); }); return _.filter(res, function(o) { return o != null; }); }; _.containsObject = _.includeObject = function(obj, target, comparison) { var _this = this; if (comparison == null) { comparison = void 0; } if (obj === null) { return false; } return _.any(obj, function(value) { if (comparison != null) { return comparison(value, target); } else { return _.isEqual(value, target); } }); }; _.differenceObjects = function(array1, array2, comparison) { if (comparison == null) { comparison = void 0; } return _.filter(array1, function(value) { return !_.containsObject(array2, value); }); }; _.withoutObjects = function(array, array2) { return _.differenceObjects(array, array2); }; _.indexOfObject = function(array, item, comparison, isSorted) { var i, length; if (array == null) { return -1; } i = 0; length = array.length; if (isSorted) { if (typeof isSorted === "number") { i = (isSorted < 0 ? Math.max(0, length + isSorted) : isSorted); } else { i = _.sortedIndex(array, item); return (array[i] === item ? i : -1); } } while (i < length) { if (comparison != null) { if (comparison(array[i], item)) { return i; } } else { if (_.isEqual(array[i], item)) { return i; } } i++; } return -1; }; _["extends"] = function(arrayOfObjectsToCombine) { return _.reduce(arrayOfObjectsToCombine, function(combined, toAdd) { return _.extend(combined, toAdd); }, {}); }; }).call(this); /* Author: Nicholas McCready & jfriend00 _async handles things asynchronous-like :), to allow the UI to be free'd to do other things Code taken from http://stackoverflow.com/questions/10344498/best-way-to-iterate-over-an-array-without-blocking-the-ui The design of any funcitonality of _async is to be like lodash/underscore and replicate it but call things asynchronously underneath. Each should be sufficient for most things to be derrived from. TODO: Handle Object iteration like underscore and lodash as well.. not that important right now */ (function() { var async; async = { each: function(array, callback, doneCallBack, pausedCallBack, chunk, index, pause) { var doChunk; if (chunk == null) { chunk = 20; } if (index == null) { index = 0; } if (pause == null) { pause = 1; } if (!pause) { throw "pause (delay) must be set from _async!"; return; } if (array === void 0 || (array != null ? array.length : void 0) <= 0) { doneCallBack(); return; } doChunk = function() { var cnt, i; cnt = chunk; i = index; while (cnt-- && i < (array ? array.length : i + 1)) { callback(array[i], i); ++i; } if (array) { if (i < array.length) { index = i; if (pausedCallBack != null) { pausedCallBack(); } return setTimeout(doChunk, pause); } else { if (doneCallBack) { return doneCallBack(); } } } }; return doChunk(); }, map: function(objs, iterator, doneCallBack, pausedCallBack, chunk) { var results; results = []; if (objs == null) { return results; } return _async.each(objs, function(o) { return results.push(iterator(o)); }, function() { return doneCallBack(results); }, pausedCallBack, chunk); } }; window._async = async; angular.module("google-maps.directives.api.utils").factory("async", function() { return window._async; }); }).call(this); (function() { var __indexOf = [].indexOf || function(item) { for (var i = 0, l = this.length; i < l; i++) { if (i in this && this[i] === item) return i; } return -1; }; angular.module("google-maps.directives.api.utils").factory("BaseObject", function() { var BaseObject, baseObjectKeywords; baseObjectKeywords = ['extended', 'included']; BaseObject = (function() { function BaseObject() {} BaseObject.extend = function(obj) { var key, value, _ref; for (key in obj) { value = obj[key]; if (__indexOf.call(baseObjectKeywords, key) < 0) { this[key] = value; } } if ((_ref = obj.extended) != null) { _ref.apply(this); } return this; }; BaseObject.include = function(obj) { var key, value, _ref; for (key in obj) { value = obj[key]; if (__indexOf.call(baseObjectKeywords, key) < 0) { this.prototype[key] = value; } } if ((_ref = obj.included) != null) { _ref.apply(this); } return this; }; return BaseObject; })(); return BaseObject; }); }).call(this); /* Useful function callbacks that should be defined at later time. Mainly to be used for specs to verify creation / linking. This is to lead a common design in notifying child stuff. */ (function() { angular.module("google-maps.directives.api.utils").factory("ChildEvents", function() { return { onChildCreation: function(child) {} }; }); }).call(this); (function() { angular.module("google-maps.directives.api.utils").service('CtrlHandle', [ '$q', function($q) { var CtrlHandle; return CtrlHandle = { handle: function($scope, $element) { $scope.deferred = $q.defer(); return { getScope: function() { return $scope; } }; } }; } ]); }).call(this); (function() { angular.module("google-maps.directives.api.utils").service("EventsHelper", [ "Logger", function($log) { return { setEvents: function(marker, scope, model) { if (angular.isDefined(scope.events) && (scope.events != null) && angular.isObject(scope.events)) { return _.compact(_.map(scope.events, function(eventHandler, eventName) { if (scope.events.hasOwnProperty(eventName) && angular.isFunction(scope.events[eventName])) { return google.maps.event.addListener(marker, eventName, function() { return eventHandler.apply(scope, [marker, eventName, model, arguments]); }); } else { return $log.info("MarkerEventHelper: invalid event listener " + eventName); } })); } } }; } ]); }).call(this); (function() { var __hasProp = {}.hasOwnProperty, __extends = function(child, parent) { for (var key in parent) { if (__hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; }; angular.module("google-maps.directives.api.utils").factory("FitHelper", [ "BaseObject", "Logger", function(BaseObject, $log) { var FitHelper, _ref; return FitHelper = (function(_super) { __extends(FitHelper, _super); function FitHelper() { _ref = FitHelper.__super__.constructor.apply(this, arguments); return _ref; } FitHelper.prototype.fit = function(gMarkers, gMap) { var bounds, everSet, _this = this; if (gMap && gMarkers && gMarkers.length > 0) { bounds = new google.maps.LatLngBounds(); everSet = false; return _async.each(gMarkers, function(gMarker) { if (gMarker) { if (!everSet) { everSet = true; } return bounds.extend(gMarker.getPosition()); } }, function() { if (everSet) { return gMap.fitBounds(bounds); } }); } }; return FitHelper; })(BaseObject); } ]); }).call(this); (function() { angular.module("google-maps.directives.api.utils").service("GmapUtil", [ "Logger", "$compile", function(Logger, $compile) { var getCoords, validateCoords; getCoords = function(value) { if (!value) { return; } if (Array.isArray(value) && value.length === 2) { return new google.maps.LatLng(value[1], value[0]); } else if (angular.isDefined(value.type) && value.type === "Point") { return new google.maps.LatLng(value.coordinates[1], value.coordinates[0]); } else { return new google.maps.LatLng(value.latitude, value.longitude); } }; validateCoords = function(coords) { if (angular.isUndefined(coords)) { return false; } if (_.isArray(coords)) { if (coords.length === 2) { return true; } } else if ((coords != null) && (coords != null ? coords.type : void 0)) { if (coords.type === "Point" && _.isArray(coords.coordinates) && coords.coordinates.length === 2) { return true; } } if (coords && angular.isDefined((coords != null ? coords.latitude : void 0) && angular.isDefined(coords != null ? coords.longitude : void 0))) { return true; } return false; }; return { getLabelPositionPoint: function(anchor) { var xPos, yPos; if (anchor === void 0) { return void 0; } anchor = /^([-\d\.]+)\s([-\d\.]+)$/.exec(anchor); xPos = parseFloat(anchor[1]); yPos = parseFloat(anchor[2]); if ((xPos != null) && (yPos != null)) { return new google.maps.Point(xPos, yPos); } }, createMarkerOptions: function(coords, icon, defaults, map) { var opts; if (map == null) { map = void 0; } if (defaults == null) { defaults = {}; } opts = angular.extend({}, defaults, { position: defaults.position != null ? defaults.position : getCoords(coords), icon: defaults.icon != null ? defaults.icon : icon, visible: defaults.visible != null ? defaults.visible : validateCoords(coords) }); if (map != null) { opts.map = map; } return opts; }, createWindowOptions: function(gMarker, scope, content, defaults) { if ((content != null) && (defaults != null) && ($compile != null)) { return angular.extend({}, defaults, { content: this.buildContent(scope, defaults, content), position: defaults.position != null ? defaults.position : angular.isObject(gMarker) ? gMarker.getPosition() : getCoords(scope.coords) }); } else { if (!defaults) { Logger.error("infoWindow defaults not defined"); if (!content) { return Logger.error("infoWindow content not defined"); } } else { return defaults; } } }, buildContent: function(scope, defaults, content) { var parsed, ret; if (defaults.content != null) { ret = defaults.content; } else { if ($compile != null) { parsed = $compile(content)(scope); if (parsed.length > 0) { ret = parsed[0]; } } else { ret = content; } } return ret; }, defaultDelay: 50, isTrue: function(val) { return angular.isDefined(val) && val !== null && val === true || val === "1" || val === "y" || val === "true"; }, isFalse: function(value) { return ['false', 'FALSE', 0, 'n', 'N', 'no', 'NO'].indexOf(value) !== -1; }, getCoords: getCoords, validateCoords: validateCoords, validatePath: function(path) { var array, i, polygon, trackMaxVertices; i = 0; if (angular.isUndefined(path.type)) { if (!Array.isArray(path) || path.length < 2) { return false; } while (i < path.length) { if (!((angular.isDefined(path[i].latitude) && angular.isDefined(path[i].longitude)) || (typeof path[i].lat === "function" && typeof path[i].lng === "function"))) { return false; } i++; } return true; } else { if (angular.isUndefined(path.coordinates)) { return false; } if (path.type === "Polygon") { if (path.coordinates[0].length < 4) { return false; } array = path.coordinates[0]; } else if (path.type === "MultiPolygon") { trackMaxVertices = { max: 0, index: 0 }; _.forEach(path.coordinates, function(polygon, index) { if (polygon[0].length > this.max) { this.max = polygon[0].length; return this.index = index; } }, trackMaxVertices); polygon = path.coordinates[trackMaxVertices.index]; array = polygon[0]; if (array.length < 4) { return false; } } else if (path.type === "LineString") { if (path.coordinates.length < 2) { return false; } array = path.coordinates; } else { return false; } while (i < array.length) { if (array[i].length !== 2) { return false; } i++; } return true; } }, convertPathPoints: function(path) { var array, i, latlng, result, trackMaxVertices; i = 0; result = new google.maps.MVCArray(); if (angular.isUndefined(path.type)) { while (i < path.length) { latlng; if (angular.isDefined(path[i].latitude) && angular.isDefined(path[i].longitude)) { latlng = new google.maps.LatLng(path[i].latitude, path[i].longitude); } else if (typeof path[i].lat === "function" && typeof path[i].lng === "function") { latlng = path[i]; } result.push(latlng); i++; } } else { array; if (path.type === "Polygon") { array = path.coordinates[0]; } else if (path.type === "MultiPolygon") { trackMaxVertices = { max: 0, index: 0 }; _.forEach(path.coordinates, function(polygon, index) { if (polygon[0].length > this.max) { this.max = polygon[0].length; return this.index = index; } }, trackMaxVertices); array = path.coordinates[trackMaxVertices.index][0]; } else if (path.type === "LineString") { array = path.coordinates; } while (i < array.length) { result.push(new google.maps.LatLng(array[i][1], array[i][0])); i++; } } return result; }, extendMapBounds: function(map, points) { var bounds, i; bounds = new google.maps.LatLngBounds(); i = 0; while (i < points.length) { bounds.extend(points.getAt(i)); i++; } return map.fitBounds(bounds); } }; } ]); }).call(this); (function() { var __hasProp = {}.hasOwnProperty, __extends = function(child, parent) { for (var key in parent) { if (__hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; }; angular.module("google-maps.directives.api.utils").factory("Linked", [ "BaseObject", function(BaseObject) { var Linked; Linked = (function(_super) { __extends(Linked, _super); function Linked(scope, element, attrs, ctrls) { this.scope = scope; this.element = element; this.attrs = attrs; this.ctrls = ctrls; } return Linked; })(BaseObject); return Linked; } ]); }).call(this); (function() { angular.module("google-maps.directives.api.utils").service("Logger", [ "$log", function($log) { return { logger: $log, doLog: false, info: function(msg) { if (this.doLog) { if (this.logger != null) { return this.logger.info(msg); } else { return console.info(msg); } } }, error: function(msg) { if (this.doLog) { if (this.logger != null) { return this.logger.error(msg); } else { return console.error(msg); } } }, warn: function(msg) { if (this.doLog) { if (this.logger != null) { return this.logger.warn(msg); } else { return console.warn(msg); } } } }; } ]); }).call(this); (function() { var __bind = function(fn, me){ return function(){ return fn.apply(me, arguments); }; }, __hasProp = {}.hasOwnProperty, __extends = function(child, parent) { for (var key in parent) { if (__hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; }; angular.module("google-maps.directives.api.utils").factory("ModelKey", [ "BaseObject", function(BaseObject) { var ModelKey; return ModelKey = (function(_super) { __extends(ModelKey, _super); function ModelKey(scope) { this.scope = scope; this.setIdKey = __bind(this.setIdKey, this); this.modelKeyComparison = __bind(this.modelKeyComparison, this); ModelKey.__super__.constructor.call(this); this.defaultIdKey = "id"; this.idKey = void 0; } ModelKey.prototype.evalModelHandle = function(model, modelKey) { if (model === void 0) { return void 0; } if (modelKey === 'self') { return model; } else { return model[modelKey]; } }; ModelKey.prototype.modelKeyComparison = function(model1, model2) { var scope; scope = this.scope.coords != null ? this.scope : this.parentScope; if (scope == null) { throw "No scope or parentScope set!"; } return this.evalModelHandle(model1, scope.coords).latitude === this.evalModelHandle(model2, scope.coords).latitude && this.evalModelHandle(model1, scope.coords).longitude === this.evalModelHandle(model2, scope.coords).longitude; }; ModelKey.prototype.setIdKey = function(scope) { return this.idKey = scope.idKey != null ? scope.idKey : this.defaultIdKey; }; return ModelKey; })(BaseObject); } ]); }).call(this); (function() { angular.module("google-maps.directives.api.utils").factory("ModelsWatcher", [ "Logger", function(Logger) { return { figureOutState: function(idKey, scope, childObjects, comparison, callBack) { var adds, mappedScopeModelIds, removals, _this = this; adds = []; mappedScopeModelIds = {}; removals = []; return _async.each(scope.models, function(m) { var child; if (m[idKey] != null) { mappedScopeModelIds[m[idKey]] = {}; if (childObjects[m[idKey]] == null) { return adds.push(m); } else { child = childObjects[m[idKey]]; if (!comparison(m, child.model)) { adds.push(m); return removals.push(child); } } } else { return Logger.error("id missing for model " + (m.toString()) + ", can not use do comparison/insertion"); } }, function() { return _async.each(childObjects.values(), function(c) { var id; if (c == null) { Logger.error("child undefined in ModelsWatcher."); return; } if (c.model == null) { Logger.error("child.model undefined in ModelsWatcher."); return; } id = c.model[idKey]; if (mappedScopeModelIds[id] == null) { return removals.push(c); } }, function() { return callBack({ adds: adds, removals: removals }); }); }); } }; } ]); }).call(this); /* Simple Object Map with a lenght property to make it easy to track length/size */ (function() { var __bind = function(fn, me){ return function(){ return fn.apply(me, arguments); }; }; angular.module("google-maps.directives.api.utils").factory("PropMap", function() { var PropMap, propsToPop; propsToPop = ['get', 'put', 'remove', 'values', 'keys', 'length']; PropMap = (function() { function PropMap() { this.keys = __bind(this.keys, this); this.values = __bind(this.values, this); this.remove = __bind(this.remove, this); this.put = __bind(this.put, this); this.get = __bind(this.get, this); this.length = 0; } PropMap.prototype.get = function(key) { return this[key]; }; PropMap.prototype.put = function(key, value) { if (this[key] == null) { this.length++; } return this[key] = value; }; PropMap.prototype.remove = function(key) { delete this[key]; return this.length--; }; PropMap.prototype.values = function() { var all, keys, _this = this; all = []; keys = _.keys(this); _.each(keys, function(value) { if (_.indexOf(propsToPop, value) === -1) { return all.push(_this[value]); } }); return all; }; PropMap.prototype.keys = function() { var all, keys, _this = this; keys = _.keys(this); all = []; _.each(keys, function(prop) { if (_.indexOf(propsToPop, prop) === -1) { return all.push(prop); } }); return all; }; return PropMap; })(); return PropMap; }); }).call(this); (function() { angular.module("google-maps.directives.api.utils").factory("nggmap-PropertyAction", [ "Logger", function(Logger) { var PropertyAction; PropertyAction = function(setterFn, isFirstSet) { var _this = this; this.setIfChange = function(newVal, oldVal) { if (!_.isEqual(oldVal, newVal || isFirstSet)) { return setterFn(newVal); } }; this.sic = function(oldVal, newVal) { return _this.setIfChange(oldVal, newVal); }; return this; }; return PropertyAction; } ]); }).call(this); (function() { var __bind = function(fn, me){ return function(){ return fn.apply(me, arguments); }; }, __hasProp = {}.hasOwnProperty, __extends = function(child, parent) { for (var key in parent) { if (__hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; }; angular.module("google-maps.directives.api.managers").factory("ClustererMarkerManager", [ "Logger", "FitHelper", function($log, FitHelper) { var ClustererMarkerManager; ClustererMarkerManager = (function(_super) { __extends(ClustererMarkerManager, _super); function ClustererMarkerManager(gMap, opt_markers, opt_options, opt_events) { var self; this.opt_events = opt_events; this.fit = __bind(this.fit, this); this.destroy = __bind(this.destroy, this); this.clear = __bind(this.clear, this); this.draw = __bind(this.draw, this); this.removeMany = __bind(this.removeMany, this); this.remove = __bind(this.remove, this); this.addMany = __bind(this.addMany, this); this.add = __bind(this.add, this); ClustererMarkerManager.__super__.constructor.call(this); self = this; this.opt_options = opt_options; if ((opt_options != null) && opt_markers === void 0) { this.clusterer = new MarkerClusterer(gMap, void 0, opt_options); } else if ((opt_options != null) && (opt_markers != null)) { this.clusterer = new MarkerClusterer(gMap, opt_markers, opt_options); } else { this.clusterer = new MarkerClusterer(gMap); } this.attachEvents(this.opt_events, "opt_events"); this.clusterer.setIgnoreHidden(true); this.noDrawOnSingleAddRemoves = true; $log.info(this); } ClustererMarkerManager.prototype.add = function(gMarker) { return this.clusterer.addMarker(gMarker, this.noDrawOnSingleAddRemoves); }; ClustererMarkerManager.prototype.addMany = function(gMarkers) { return this.clusterer.addMarkers(gMarkers); }; ClustererMarkerManager.prototype.remove = function(gMarker) { return this.clusterer.removeMarker(gMarker, this.noDrawOnSingleAddRemoves); }; ClustererMarkerManager.prototype.removeMany = function(gMarkers) { return this.clusterer.addMarkers(gMarkers); }; ClustererMarkerManager.prototype.draw = function() { return this.clusterer.repaint(); }; ClustererMarkerManager.prototype.clear = function() { this.clusterer.clearMarkers(); return this.clusterer.repaint(); }; ClustererMarkerManager.prototype.attachEvents = function(options, optionsName) { var eventHandler, eventName, _results; if (angular.isDefined(options) && (options != null) && angular.isObject(options)) { _results = []; for (eventName in options) { eventHandler = options[eventName]; if (options.hasOwnProperty(eventName) && angular.isFunction(options[eventName])) { $log.info("" + optionsName + ": Attaching event: " + eventName + " to clusterer"); _results.push(google.maps.event.addListener(this.clusterer, eventName, options[eventName])); } else { _results.push(void 0); } } return _results; } }; ClustererMarkerManager.prototype.clearEvents = function(options) { var eventHandler, eventName, _results; if (angular.isDefined(options) && (options != null) && angular.isObject(options)) { _results = []; for (eventName in options) { eventHandler = options[eventName]; if (options.hasOwnProperty(eventName) && angular.isFunction(options[eventName])) { $log.info("" + optionsName + ": Clearing event: " + eventName + " to clusterer"); _results.push(google.maps.event.clearListeners(this.clusterer, eventName)); } else { _results.push(void 0); } } return _results; } }; ClustererMarkerManager.prototype.destroy = function() { this.clearEvents(this.opt_events); this.clearEvents(this.opt_internal_events); return this.clear(); }; ClustererMarkerManager.prototype.fit = function() { return ClustererMarkerManager.__super__.fit.call(this, this.clusterer.getMarkers(), this.clusterer.getMap()); }; return ClustererMarkerManager; })(FitHelper); return ClustererMarkerManager; } ]); }).call(this); (function() { var __bind = function(fn, me){ return function(){ return fn.apply(me, arguments); }; }, __hasProp = {}.hasOwnProperty, __extends = function(child, parent) { for (var key in parent) { if (__hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; }; angular.module("google-maps.directives.api.managers").factory("MarkerManager", [ "Logger", "FitHelper", function(Logger, FitHelper) { var MarkerManager; MarkerManager = (function(_super) { __extends(MarkerManager, _super); MarkerManager.include(FitHelper); function MarkerManager(gMap, opt_markers, opt_options) { this.fit = __bind(this.fit, this); this.handleOptDraw = __bind(this.handleOptDraw, this); this.clear = __bind(this.clear, this); this.draw = __bind(this.draw, this); this.removeMany = __bind(this.removeMany, this); this.remove = __bind(this.remove, this); this.addMany = __bind(this.addMany, this); this.add = __bind(this.add, this); var self; MarkerManager.__super__.constructor.call(this); self = this; this.gMap = gMap; this.gMarkers = []; this.$log = Logger; this.$log.info(this); } MarkerManager.prototype.add = function(gMarker, optDraw, redraw) { if (redraw == null) { redraw = true; } this.handleOptDraw(gMarker, optDraw, redraw); return this.gMarkers.push(gMarker); }; MarkerManager.prototype.addMany = function(gMarkers) { var gMarker, _i, _len, _results; _results = []; for (_i = 0, _len = gMarkers.length; _i < _len; _i++) { gMarker = gMarkers[_i]; _results.push(this.add(gMarker)); } return _results; }; MarkerManager.prototype.remove = function(gMarker, optDraw) { var index, tempIndex; this.handleOptDraw(gMarker, optDraw, false); if (!optDraw) { return; } index = void 0; if (this.gMarkers.indexOf != null) { index = this.gMarkers.indexOf(gMarker); } else { tempIndex = 0; _.find(this.gMarkers, function(marker) { tempIndex += 1; if (marker === gMarker) { index = tempIndex; } }); } if (index != null) { return this.gMarkers.splice(index, 1); } }; MarkerManager.prototype.removeMany = function(gMarkers) { var _this = this; return this.gMarkers.forEach(function(marker) { return _this.remove(marker); }); }; MarkerManager.prototype.draw = function() { var deletes, _this = this; deletes = []; this.gMarkers.forEach(function(gMarker) { if (!gMarker.isDrawn) { if (gMarker.doAdd) { gMarker.setMap(_this.gMap); return gMarker.isDrawn = true; } else { return deletes.push(gMarker); } } }); return deletes.forEach(function(gMarker) { gMarker.isDrawn = false; return _this.remove(gMarker, true); }); }; MarkerManager.prototype.clear = function() { var gMarker, _i, _len, _ref; _ref = this.gMarkers; for (_i = 0, _len = _ref.length; _i < _len; _i++) { gMarker = _ref[_i]; gMarker.setMap(null); } delete this.gMarkers; return this.gMarkers = []; }; MarkerManager.prototype.handleOptDraw = function(gMarker, optDraw, doAdd) { if (optDraw === true) { if (doAdd) { gMarker.setMap(this.gMap); } else { gMarker.setMap(null); } return gMarker.isDrawn = true; } else { gMarker.isDrawn = false; return gMarker.doAdd = doAdd; } }; MarkerManager.prototype.fit = function() { return MarkerManager.__super__.fit.call(this, this.gMarkers, this.gMap); }; return MarkerManager; })(FitHelper); return MarkerManager; } ]); }).call(this); (function() { angular.module("google-maps").factory("array-sync", [ "add-events", function(mapEvents) { return function(mapArray, scope, pathEval, pathChangedFn) { var geojsonArray, geojsonHandlers, geojsonWatcher, isSetFromScope, legacyHandlers, legacyWatcher, mapArrayListener, scopePath, watchListener; isSetFromScope = false; scopePath = scope.$eval(pathEval); if (!scope["static"]) { legacyHandlers = { set_at: function(index) { var value; if (isSetFromScope) { return; } value = mapArray.getAt(index); if (!value) { return; } if (!value.lng || !value.lat) { return scopePath[index] = value; } else { scopePath[index].latitude = value.lat(); return scopePath[index].longitude = value.lng(); } }, insert_at: function(index) { var value; if (isSetFromScope) { return; } value = mapArray.getAt(index); if (!value) { return; } if (!value.lng || !value.lat) { return scopePath.splice(index, 0, value); } else { return scopePath.splice(index, 0, { latitude: value.lat(), longitude: value.lng() }); } }, remove_at: function(index) { if (isSetFromScope) { return; } return scopePath.splice(index, 1); } }; geojsonArray; if (scopePath.type === "Polygon") { geojsonArray = scopePath.coordinates[0]; } else if (scopePath.type === "LineString") { geojsonArray = scopePath.coordinates; } geojsonHandlers = { set_at: function(index) { var value; if (isSetFromScope) { return; } value = mapArray.getAt(index); if (!value) { return; } if (!value.lng || !value.lat) { return; } geojsonArray[index][1] = value.lat(); return geojsonArray[index][0] = value.lng(); }, insert_at: function(index) { var value; if (isSetFromScope) { return; } value = mapArray.getAt(index); if (!value) { return; } if (!value.lng || !value.lat) { return; } return geojsonArray.splice(index, 0, [value.lng(), value.lat()]); }, remove_at: function(index) { if (isSetFromScope) { return; } return geojsonArray.splice(index, 1); } }; mapArrayListener = mapEvents(mapArray, angular.isUndefined(scopePath.type) ? legacyHandlers : geojsonHandlers); } legacyWatcher = function(newPath) { var i, l, newLength, newValue, oldArray, oldLength, oldValue; isSetFromScope = true; oldArray = mapArray; if (newPath) { i = 0; oldLength = oldArray.getLength(); newLength = newPath.length; l = Math.min(oldLength, newLength); newValue = void 0; while (i < l) { oldValue = oldArray.getAt(i); newValue = newPath[i]; if (typeof newValue.equals === "function") { if (!newValue.equals(oldValue)) { oldArray.setAt(i, newValue); } } else { if ((oldValue.lat() !== newValue.latitude) || (oldValue.lng() !== newValue.longitude)) { oldArray.setAt(i, new google.maps.LatLng(newValue.latitude, newValue.longitude)); } } i++; } while (i < newLength) { newValue = newPath[i]; if (typeof newValue.lat === "function" && typeof newValue.lng === "function") { oldArray.push(newValue); } else { oldArray.push(new google.maps.LatLng(newValue.latitude, newValue.longitude)); } i++; } while (i < oldLength) { oldArray.pop(); i++; } } return isSetFromScope = false; }; geojsonWatcher = function(newPath) { var array, i, l, newLength, newValue, oldArray, oldLength, oldValue; isSetFromScope = true; oldArray = mapArray; if (newPath) { array; if (scopePath.type === "Polygon") { array = newPath.coordinates[0]; } else if (scopePath.type === "LineString") { array = newPath.coordinates; } i = 0; oldLength = oldArray.getLength(); newLength = array.length; l = Math.min(oldLength, newLength); newValue = void 0; while (i < l) { oldValue = oldArray.getAt(i); newValue = array[i]; if ((oldValue.lat() !== newValue[1]) || (oldValue.lng() !== newValue[0])) { oldArray.setAt(i, new google.maps.LatLng(newValue[1], newValue[0])); } i++; } while (i < newLength) { newValue = array[i]; oldArray.push(new google.maps.LatLng(newValue[1], newValue[0])); i++; } while (i < oldLength) { oldArray.pop(); i++; } } return isSetFromScope = false; }; watchListener; if (!scope["static"]) { if (angular.isUndefined(scopePath.type)) { watchListener = scope.$watchCollection(pathEval, legacyWatcher); } else { watchListener = scope.$watch(pathEval, geojsonWatcher, true); } } return function() { if (mapArrayListener) { mapArrayListener(); mapArrayListener = null; } if (watchListener) { watchListener(); return watchListener = null; } }; }; } ]); }).call(this); (function() { angular.module("google-maps").factory("add-events", [ "$timeout", function($timeout) { var addEvent, addEvents; addEvent = function(target, eventName, handler) { return google.maps.event.addListener(target, eventName, function() { handler.apply(this, arguments); return $timeout((function() {}), true); }); }; addEvents = function(target, eventName, handler) { var remove; if (handler) { return addEvent(target, eventName, handler); } remove = []; angular.forEach(eventName, function(_handler, key) { return remove.push(addEvent(target, key, _handler)); }); return function() { angular.forEach(remove, function(listener) { return google.maps.event.removeListener(listener); }); return remove = null; }; }; return addEvents; } ]); }).call(this); (function() { var __bind = function(fn, me){ return function(){ return fn.apply(me, arguments); }; }, __hasProp = {}.hasOwnProperty, __extends = function(child, parent) { for (var key in parent) { if (__hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; }; angular.module("google-maps.directives.api.models.child").factory("MarkerLabelChildModel", [ "BaseObject", "GmapUtil", function(BaseObject, GmapUtil) { var MarkerLabelChildModel; MarkerLabelChildModel = (function(_super) { __extends(MarkerLabelChildModel, _super); MarkerLabelChildModel.include(GmapUtil); function MarkerLabelChildModel(gMarker, options, map) { this.destroy = __bind(this.destroy, this); this.setOptions = __bind(this.setOptions, this); var self; MarkerLabelChildModel.__super__.constructor.call(this); self = this; this.gMarker = gMarker; this.setOptions(options); this.gMarkerLabel = new MarkerLabel_(this.gMarker, options.crossImage, options.handCursor); this.gMarker.set("setMap", function(theMap) { self.gMarkerLabel.setMap(theMap); return google.maps.Marker.prototype.setMap.apply(this, arguments); }); this.gMarker.setMap(map); } MarkerLabelChildModel.prototype.setOption = function(optStr, content) { /* COMENTED CODE SHOWS AWFUL CHROME BUG in Google Maps SDK 3, still happens in version 3.16 any animation will cause markers to disappear */ return this.gMarker.set(optStr, content); }; MarkerLabelChildModel.prototype.setOptions = function(options) { var _ref, _ref1; if (options != null ? options.labelContent : void 0) { this.gMarker.set("labelContent", options.labelContent); } if (options != null ? options.labelAnchor : void 0) { this.gMarker.set("labelAnchor", this.getLabelPositionPoint(options.labelAnchor)); } this.gMarker.set("labelClass", options.labelClass || 'labels'); this.gMarker.set("labelStyle", options.labelStyle || { opacity: 100 }); this.gMarker.set("labelInBackground", options.labelInBackground || false); if (!options.labelVisible) { this.gMarker.set("labelVisible", true); } if (!options.raiseOnDrag) { this.gMarker.set("raiseOnDrag", true); } if (!options.clickable) { this.gMarker.set("clickable", true); } if (!options.draggable) { this.gMarker.set("draggable", false); } if (!options.optimized) { this.gMarker.set("optimized", false); } options.crossImage = (_ref = options.crossImage) != null ? _ref : document.location.protocol + "//maps.gstatic.com/intl/en_us/mapfiles/drag_cross_67_16.png"; return options.handCursor = (_ref1 = options.handCursor) != null ? _ref1 : document.location.protocol + "//maps.gstatic.com/intl/en_us/mapfiles/closedhand_8_8.cur"; }; MarkerLabelChildModel.prototype.destroy = function() { if ((this.gMarkerLabel.labelDiv_.parentNode != null) && (this.gMarkerLabel.eventDiv_.parentNode != null)) { return this.gMarkerLabel.onRemove(); } }; return MarkerLabelChildModel; })(BaseObject); return MarkerLabelChildModel; } ]); }).call(this); (function() { var __bind = function(fn, me){ return function(){ return fn.apply(me, arguments); }; }, __hasProp = {}.hasOwnProperty, __extends = function(child, parent) { for (var key in parent) { if (__hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; }; angular.module("google-maps.directives.api.models.child").factory("MarkerChildModel", [ "ModelKey", "GmapUtil", "Logger", "$injector", "EventsHelper", function(ModelKey, GmapUtil, Logger, $injector, EventsHelper) { var MarkerChildModel; MarkerChildModel = (function(_super) { __extends(MarkerChildModel, _super); MarkerChildModel.include(GmapUtil); MarkerChildModel.include(EventsHelper); function MarkerChildModel(model, parentScope, gMap, $timeout, defaults, doClick, gMarkerManager, idKey) { var self, _this = this; this.model = model; this.parentScope = parentScope; this.gMap = gMap; this.$timeout = $timeout; this.defaults = defaults; this.doClick = doClick; this.gMarkerManager = gMarkerManager; this.idKey = idKey; this.watchDestroy = __bind(this.watchDestroy, this); this.setLabelOptions = __bind(this.setLabelOptions, this); this.isLabelDefined = __bind(this.isLabelDefined, this); this.setOptions = __bind(this.setOptions, this); this.setIcon = __bind(this.setIcon, this); this.setCoords = __bind(this.setCoords, this); this.destroy = __bind(this.destroy, this); this.maybeSetScopeValue = __bind(this.maybeSetScopeValue, this); this.createMarker = __bind(this.createMarker, this); this.setMyScope = __bind(this.setMyScope, this); self = this; if (this.model[this.idKey]) { this.id = this.model[this.idKey]; } this.iconKey = this.parentScope.icon; this.coordsKey = this.parentScope.coords; this.clickKey = this.parentScope.click(); this.labelContentKey = this.parentScope.labelContent; this.optionsKey = this.parentScope.options; this.labelOptionsKey = this.parentScope.labelOptions; MarkerChildModel.__super__.constructor.call(this, this.parentScope.$new(false)); this.scope.model = this.model; this.setMyScope(this.model, void 0, true); this.createMarker(this.model); this.scope.$watch('model', function(newValue, oldValue) { if (newValue !== oldValue) { return _this.setMyScope(newValue, oldValue); } }, true); this.$log = Logger; this.$log.info(self); this.watchDestroy(this.scope); } MarkerChildModel.prototype.setMyScope = function(model, oldModel, isInit) { var _this = this; if (oldModel == null) { oldModel = void 0; } if (isInit == null) { isInit = false; } this.maybeSetScopeValue('icon', model, oldModel, this.iconKey, this.evalModelHandle, isInit, this.setIcon); this.maybeSetScopeValue('coords', model, oldModel, this.coordsKey, this.evalModelHandle, isInit, this.setCoords); this.maybeSetScopeValue('labelContent', model, oldModel, this.labelContentKey, this.evalModelHandle, isInit); if (_.isFunction(this.clickKey) && $injector) { return this.scope.click = function() { return $injector.invoke(_this.clickKey, void 0, { "$markerModel": model }); }; } else { this.maybeSetScopeValue('click', model, oldModel, this.clickKey, this.evalModelHandle, isInit); return this.createMarker(model, oldModel, isInit); } }; MarkerChildModel.prototype.createMarker = function(model, oldModel, isInit) { var _this = this; if (oldModel == null) { oldModel = void 0; } if (isInit == null) { isInit = false; } return this.maybeSetScopeValue('options', model, oldModel, this.optionsKey, function(lModel, lModelKey) { var value; if (lModel === void 0) { return void 0; } value = lModelKey === 'self' ? lModel : lModel[lModelKey]; if (value === void 0) { return value = lModelKey === void 0 ? _this.defaults : _this.scope.options; } else { return value; } }, isInit, this.setOptions); }; MarkerChildModel.prototype.maybeSetScopeValue = function(scopePropName, model, oldModel, modelKey, evaluate, isInit, gSetter) { var newValue, oldVal; if (gSetter == null) { gSetter = void 0; } if (oldModel === void 0) { this.scope[scopePropName] = evaluate(model, modelKey); if (!isInit) { if (gSetter != null) { gSetter(this.scope); } } return; } oldVal = evaluate(oldModel, modelKey); newValue = evaluate(model, modelKey); if (newValue !== oldVal && this.scope[scopePropName] !== newValue) { this.scope[scopePropName] = newValue; if (!isInit) { if (gSetter != null) { gSetter(this.scope); } return this.gMarkerManager.draw(); } } }; MarkerChildModel.prototype.destroy = function() { return this.scope.$destroy(); }; MarkerChildModel.prototype.setCoords = function(scope) { if (scope.$id !== this.scope.$id || this.gMarker === void 0) { return; } if ((scope.coords != null)) { if (!this.validateCoords(this.scope.coords)) { this.$log.error("MarkerChildMarker cannot render marker as scope.coords as no position on marker: " + (JSON.stringify(this.model))); return; } this.gMarker.setPosition(this.getCoords(scope.coords)); this.gMarker.setVisible(this.validateCoords(scope.coords)); this.gMarkerManager.remove(this.gMarker); return this.gMarkerManager.add(this.gMarker); } else { return this.gMarkerManager.remove(this.gMarker); } }; MarkerChildModel.prototype.setIcon = function(scope) { if (scope.$id !== this.scope.$id || this.gMarker === void 0) { return; } this.gMarkerManager.remove(this.gMarker); this.gMarker.setIcon(scope.icon); this.gMarkerManager.add(this.gMarker); this.gMarker.setPosition(this.getCoords(scope.coords)); return this.gMarker.setVisible(this.validateCoords(scope.coords)); }; MarkerChildModel.prototype.setOptions = function(scope) { var _ref, _this = this; if (scope.$id !== this.scope.$id) { return; } if (this.gMarker != null) { this.gMarkerManager.remove(this.gMarker); delete this.gMarker; } if (!((_ref = scope.coords) != null ? _ref : typeof scope.icon === "function" ? scope.icon(scope.options != null) : void 0)) { return; } this.opts = this.createMarkerOptions(scope.coords, scope.icon, scope.options); delete this.gMarker; if (this.isLabelDefined(scope)) { this.gMarker = new MarkerWithLabel(this.setLabelOptions(this.opts, scope)); } else { this.gMarker = new google.maps.Marker(this.opts); } this.setEvents(this.gMarker, this.parentScope, this.model); if (this.id) { this.gMarker.key = this.id; } this.gMarkerManager.add(this.gMarker); return google.maps.event.addListener(this.gMarker, 'click', function() { if (_this.doClick && (_this.scope.click != null)) { return _this.scope.click(); } }); }; MarkerChildModel.prototype.isLabelDefined = function(scope) { return scope.labelContent != null; }; MarkerChildModel.prototype.setLabelOptions = function(opts, scope) { opts.labelAnchor = this.getLabelPositionPoint(scope.labelAnchor); opts.labelClass = scope.labelClass; opts.labelContent = scope.labelContent; return opts; }; MarkerChildModel.prototype.watchDestroy = function(scope) { var _this = this; return scope.$on("$destroy", function() { var self, _ref; if (_this.gMarker != null) { google.maps.event.clearListeners(_this.gMarker, 'click'); if (((_ref = _this.parentScope) != null ? _ref.events : void 0) && _.isArray(_this.parentScope.events)) { _this.parentScope.events.forEach(function(event, eventName) { return google.maps.event.clearListeners(this.gMarker, eventName); }); } _this.gMarkerManager.remove(_this.gMarker, true); delete _this.gMarker; } return self = void 0; }); }; return MarkerChildModel; })(ModelKey); return MarkerChildModel; } ]); }).call(this); (function() { var __bind = function(fn, me){ return function(){ return fn.apply(me, arguments); }; }, __hasProp = {}.hasOwnProperty, __extends = function(child, parent) { for (var key in parent) { if (__hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; }; angular.module("google-maps.directives.api").factory("PolylineChildModel", [ "BaseObject", "Logger", "$timeout", "array-sync", "GmapUtil", function(BaseObject, Logger, $timeout, arraySync, GmapUtil) { var $log, PolylineChildModel; $log = Logger; return PolylineChildModel = (function(_super) { __extends(PolylineChildModel, _super); PolylineChildModel.include(GmapUtil); function PolylineChildModel(scope, attrs, map, defaults, model) { var arraySyncer, pathPoints, _this = this; this.scope = scope; this.attrs = attrs; this.map = map; this.defaults = defaults; this.model = model; this.buildOpts = __bind(this.buildOpts, this); pathPoints = this.convertPathPoints(scope.path); this.polyline = new google.maps.Polyline(this.buildOpts(pathPoints)); if (scope.fit) { GmapUtil.extendMapBounds(map, pathPoints); } if (!scope["static"] && angular.isDefined(scope.editable)) { scope.$watch("editable", function(newValue, oldValue) { if (newValue !== oldValue) { return _this.polyline.setEditable(newValue); } }); } if (angular.isDefined(scope.draggable)) { scope.$watch("draggable", function(newValue, oldValue) { if (newValue !== oldValue) { return _this.polyline.setDraggable(newValue); } }); } if (angular.isDefined(scope.visible)) { scope.$watch("visible", function(newValue, oldValue) { if (newValue !== oldValue) { return _this.polyline.setVisible(newValue); } }); } if (angular.isDefined(scope.geodesic)) { scope.$watch("geodesic", function(newValue, oldValue) { if (newValue !== oldValue) { return _this.polyline.setOptions(_this.buildOpts(_this.polyline.getPath())); } }); } if (angular.isDefined(scope.stroke) && angular.isDefined(scope.stroke.weight)) { scope.$watch("stroke.weight", function(newValue, oldValue) { if (newValue !== oldValue) { return _this.polyline.setOptions(_this.buildOpts(_this.polyline.getPath())); } }); } if (angular.isDefined(scope.stroke) && angular.isDefined(scope.stroke.color)) { scope.$watch("stroke.color", function(newValue, oldValue) { if (newValue !== oldValue) { return _this.polyline.setOptions(_this.buildOpts(_this.polyline.getPath())); } }); } if (angular.isDefined(scope.stroke) && angular.isDefined(scope.stroke.opacity)) { scope.$watch("stroke.opacity", function(newValue, oldValue) { if (newValue !== oldValue) { return _this.polyline.setOptions(_this.buildOpts(_this.polyline.getPath())); } }); } if (angular.isDefined(scope.icons)) { scope.$watch("icons", function(newValue, oldValue) { if (newValue !== oldValue) { return _this.polyline.setOptions(_this.buildOpts(_this.polyline.getPath())); } }); } arraySyncer = arraySync(this.polyline.getPath(), scope, "path", function(pathPoints) { if (scope.fit) { return GmapUtil.extendMapBounds(map, pathPoints); } }); scope.$on("$destroy", function() { _this.polyline.setMap(null); _this.polyline = null; _this.scope = null; if (arraySyncer) { arraySyncer(); return arraySyncer = null; } }); $log.info(this); } PolylineChildModel.prototype.buildOpts = function(pathPoints) { var opts, _this = this; opts = angular.extend({}, this.defaults, { map: this.map, path: pathPoints, icons: this.scope.icons, strokeColor: this.scope.stroke && this.scope.stroke.color, strokeOpacity: this.scope.stroke && this.scope.stroke.opacity, strokeWeight: this.scope.stroke && this.scope.stroke.weight }); angular.forEach({ clickable: true, draggable: false, editable: false, geodesic: false, visible: true, "static": false, fit: false }, function(defaultValue, key) { if (angular.isUndefined(_this.scope[key]) || _this.scope[key] === null) { return opts[key] = defaultValue; } else { return opts[key] = _this.scope[key]; } }); if (opts["static"]) { opts.editable = false; } return opts; }; PolylineChildModel.prototype.destroy = function() { return this.scope.$destroy(); }; return PolylineChildModel; })(BaseObject); } ]); }).call(this); (function() { var __bind = function(fn, me){ return function(){ return fn.apply(me, arguments); }; }, __hasProp = {}.hasOwnProperty, __extends = function(child, parent) { for (var key in parent) { if (__hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; }; angular.module("google-maps.directives.api.models.child").factory("WindowChildModel", [ "BaseObject", "GmapUtil", "Logger", "$compile", "$http", "$templateCache", function(BaseObject, GmapUtil, Logger, $compile, $http, $templateCache) { var WindowChildModel; WindowChildModel = (function(_super) { __extends(WindowChildModel, _super); WindowChildModel.include(GmapUtil); function WindowChildModel(model, scope, opts, isIconVisibleOnClick, mapCtrl, markerCtrl, element, needToManualDestroy, markerIsVisibleAfterWindowClose) { this.model = model; this.scope = scope; this.opts = opts; this.isIconVisibleOnClick = isIconVisibleOnClick; this.mapCtrl = mapCtrl; this.markerCtrl = markerCtrl; this.element = element; this.needToManualDestroy = needToManualDestroy != null ? needToManualDestroy : false; this.markerIsVisibleAfterWindowClose = markerIsVisibleAfterWindowClose != null ? markerIsVisibleAfterWindowClose : true; this.destroy = __bind(this.destroy, this); this.remove = __bind(this.remove, this); this.hideWindow = __bind(this.hideWindow, this); this.getLatestPosition = __bind(this.getLatestPosition, this); this.showWindow = __bind(this.showWindow, this); this.handleClick = __bind(this.handleClick, this); this.watchCoords = __bind(this.watchCoords, this); this.watchShow = __bind(this.watchShow, this); this.createGWin = __bind(this.createGWin, this); this.watchElement = __bind(this.watchElement, this); this.googleMapsHandles = []; this.$log = Logger; this.createGWin(); if (this.markerCtrl != null) { this.markerCtrl.setClickable(true); } this.handleClick(); this.watchElement(); this.watchShow(); this.watchCoords(); this.$log.info(this); } WindowChildModel.prototype.watchElement = function() { var _this = this; return this.scope.$watch(function() { var _ref; if (!_this.element || !_this.html) { return; } if (_this.html !== _this.element.html()) { if (_this.gWin) { if ((_ref = _this.opts) != null) { _ref.content = void 0; } _this.remove(); _this.createGWin(); return _this.showHide(); } } }); }; WindowChildModel.prototype.createGWin = function() { var defaults, _this = this; if (this.gWin == null) { defaults = {}; if (this.opts != null) { if (this.scope.coords) { this.opts.position = this.getCoords(this.scope.coords); } defaults = this.opts; } if (this.element) { this.html = _.isObject(this.element) ? this.element.html() : this.element; } this.opts = this.createWindowOptions(this.markerCtrl, this.scope, this.html, defaults); } if ((this.opts != null) && !this.gWin) { if (this.opts.boxClass && (window.InfoBox && typeof window.InfoBox === 'function')) { this.gWin = new window.InfoBox(this.opts); } else { this.gWin = new google.maps.InfoWindow(this.opts); } return this.googleMapsHandles.push(google.maps.event.addListener(this.gWin, 'closeclick', function() { if (_this.markerCtrl) { _this.markerCtrl.setAnimation(_this.oldMarkerAnimation); if (_this.markerIsVisibleAfterWindowClose) { _.delay(function() { _this.markerCtrl.setVisible(false); return _this.markerCtrl.setVisible(_this.markerIsVisibleAfterWindowClose); }, 250); } } _this.gWin.isOpen(false); if (_this.scope.closeClick != null) { return _this.scope.closeClick(); } })); } }; WindowChildModel.prototype.watchShow = function() { var _this = this; return this.scope.$watch('show', function(newValue, oldValue) { if (newValue !== oldValue) { if (newValue) { return _this.showWindow(); } else { return _this.hideWindow(); } } else { if (_this.gWin != null) { if (newValue && !_this.gWin.getMap()) { return _this.showWindow(); } } } }, true); }; WindowChildModel.prototype.watchCoords = function() { var scope, _this = this; scope = this.markerCtrl != null ? this.scope.$parent : this.scope; return scope.$watch('coords', function(newValue, oldValue) { var pos; if (newValue !== oldValue) { if (newValue == null) { return _this.hideWindow(); } else { if (!_this.validateCoords(newValue)) { _this.$log.error("WindowChildMarker cannot render marker as scope.coords as no position on marker: " + (JSON.stringify(_this.model))); return; } pos = _this.getCoords(newValue); _this.gWin.setPosition(pos); if (_this.opts) { return _this.opts.position = pos; } } } }, true); }; WindowChildModel.prototype.handleClick = function(forceClick) { var click, _this = this; click = function() { var pos; if (_this.gWin == null) { _this.createGWin(); } pos = _this.markerCtrl.getPosition(); if (_this.gWin != null) { _this.gWin.setPosition(pos); if (_this.opts) { _this.opts.position = pos; } _this.showWindow(); } _this.initialMarkerVisibility = _this.markerCtrl.getVisible(); _this.oldMarkerAnimation = _this.markerCtrl.getAnimation(); return _this.markerCtrl.setVisible(_this.isIconVisibleOnClick); }; if (this.markerCtrl != null) { if (forceClick) { click(); } return this.googleMapsHandles.push(google.maps.event.addListener(this.markerCtrl, 'click', click)); } }; WindowChildModel.prototype.showWindow = function() { var show, _this = this; show = function() { if (_this.gWin) { if ((_this.scope.show || (_this.scope.show == null)) && !_this.gWin.isOpen()) { return _this.gWin.open(_this.mapCtrl); } } }; if (this.scope.templateUrl) { if (this.gWin) { $http.get(this.scope.templateUrl, { cache: $templateCache }).then(function(content) { var compiled, templateScope; templateScope = _this.scope.$new(); if (angular.isDefined(_this.scope.templateParameter)) { templateScope.parameter = _this.scope.templateParameter; } compiled = $compile(content.data)(templateScope); return _this.gWin.setContent(compiled[0]); }); } return show(); } else { return show(); } }; WindowChildModel.prototype.showHide = function() { if (this.scope.show) { return this.showWindow(); } else { return this.hideWindow(); } }; WindowChildModel.prototype.getLatestPosition = function(overridePos) { if ((this.gWin != null) && (this.markerCtrl != null) && !overridePos) { return this.gWin.setPosition(this.markerCtrl.getPosition()); } else { if (overridePos) { return this.gWin.setPosition(overridePos); } } }; WindowChildModel.prototype.hideWindow = function() { if ((this.gWin != null) && this.gWin.isOpen()) { return this.gWin.close(); } }; WindowChildModel.prototype.remove = function() { this.hideWindow(); _.each(this.googleMapsHandles, function(h) { return google.maps.event.removeListener(h); }); this.googleMapsHandles.length = 0; return delete this.gWin; }; WindowChildModel.prototype.destroy = function(manualOverride) { var self; if (manualOverride == null) { manualOverride = false; } this.remove(); if ((this.scope != null) && (this.needToManualDestroy || manualOverride)) { this.scope.$destroy(); } return self = void 0; }; return WindowChildModel; })(BaseObject); return WindowChildModel; } ]); }).call(this); /* - interface for all markers to derrive from - to enforce a minimum set of requirements - attributes - coords - icon - implementation needed on watches */ (function() { var __bind = function(fn, me){ return function(){ return fn.apply(me, arguments); }; }, __hasProp = {}.hasOwnProperty, __extends = function(child, parent) { for (var key in parent) { if (__hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; }; angular.module("google-maps.directives.api.models.parent").factory("IMarkerParentModel", [ "ModelKey", "Logger", function(ModelKey, Logger) { var IMarkerParentModel; IMarkerParentModel = (function(_super) { __extends(IMarkerParentModel, _super); IMarkerParentModel.prototype.DEFAULTS = {}; function IMarkerParentModel(scope, element, attrs, map, $timeout) { var self, _this = this; this.scope = scope; this.element = element; this.attrs = attrs; this.map = map; this.$timeout = $timeout; this.onDestroy = __bind(this.onDestroy, this); this.onWatch = __bind(this.onWatch, this); this.watch = __bind(this.watch, this); this.validateScope = __bind(this.validateScope, this); IMarkerParentModel.__super__.constructor.call(this, this.scope); self = this; this.$log = Logger; if (!this.validateScope(scope)) { throw new String("Unable to construct IMarkerParentModel due to invalid scope"); } this.doClick = angular.isDefined(attrs.click); if (scope.options != null) { this.DEFAULTS = scope.options; } this.watch('coords', this.scope); this.watch('icon', this.scope); this.watch('options', this.scope); scope.$on("$destroy", function() { return _this.onDestroy(scope); }); } IMarkerParentModel.prototype.validateScope = function(scope) { var ret; if (scope == null) { this.$log.error(this.constructor.name + ": invalid scope used"); return false; } ret = scope.coords != null; if (!ret) { this.$log.error(this.constructor.name + ": no valid coords attribute found"); return false; } return ret; }; IMarkerParentModel.prototype.watch = function(propNameToWatch, scope) { var _this = this; return scope.$watch(propNameToWatch, function(newValue, oldValue) { if (!_.isEqual(newValue, oldValue)) { return _this.onWatch(propNameToWatch, scope, newValue, oldValue); } }, true); }; IMarkerParentModel.prototype.onWatch = function(propNameToWatch, scope, newValue, oldValue) { throw new String("OnWatch Not Implemented!!"); }; IMarkerParentModel.prototype.onDestroy = function(scope) { throw new String("OnDestroy Not Implemented!!"); }; return IMarkerParentModel; })(ModelKey); return IMarkerParentModel; } ]); }).call(this); /* - interface directive for all window(s) to derrive from */ (function() { var __hasProp = {}.hasOwnProperty, __extends = function(child, parent) { for (var key in parent) { if (__hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; }; angular.module("google-maps.directives.api.models.parent").factory("IWindowParentModel", [ "ModelKey", "GmapUtil", "Logger", function(ModelKey, GmapUtil, Logger) { var IWindowParentModel; IWindowParentModel = (function(_super) { __extends(IWindowParentModel, _super); IWindowParentModel.include(GmapUtil); IWindowParentModel.prototype.DEFAULTS = {}; function IWindowParentModel(scope, element, attrs, ctrls, $timeout, $compile, $http, $templateCache) { var self; IWindowParentModel.__super__.constructor.call(this, scope); self = this; this.$log = Logger; this.$timeout = $timeout; this.$compile = $compile; this.$http = $http; this.$templateCache = $templateCache; if (scope.options != null) { this.DEFAULTS = scope.options; } } return IWindowParentModel; })(ModelKey); return IWindowParentModel; } ]); }).call(this); (function() { var __bind = function(fn, me){ return function(){ return fn.apply(me, arguments); }; }, __hasProp = {}.hasOwnProperty, __extends = function(child, parent) { for (var key in parent) { if (__hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; }; angular.module("google-maps.directives.api.models.parent").factory("LayerParentModel", [ "BaseObject", "Logger", '$timeout', function(BaseObject, Logger, $timeout) { var LayerParentModel; LayerParentModel = (function(_super) { __extends(LayerParentModel, _super); function LayerParentModel(scope, element, attrs, gMap, onLayerCreated, $log) { var _this = this; this.scope = scope; this.element = element; this.attrs = attrs; this.gMap = gMap; this.onLayerCreated = onLayerCreated != null ? onLayerCreated : void 0; this.$log = $log != null ? $log : Logger; this.createGoogleLayer = __bind(this.createGoogleLayer, this); if (this.attrs.type == null) { this.$log.info("type attribute for the layer directive is mandatory. Layer creation aborted!!"); return; } this.createGoogleLayer(); this.doShow = true; if (angular.isDefined(this.attrs.show)) { this.doShow = this.scope.show; } if (this.doShow && (this.gMap != null)) { this.layer.setMap(this.gMap); } this.scope.$watch("show", function(newValue, oldValue) { if (newValue !== oldValue) { _this.doShow = newValue; if (newValue) { return _this.layer.setMap(_this.gMap); } else { return _this.layer.setMap(null); } } }, true); this.scope.$watch("options", function(newValue, oldValue) { if (newValue !== oldValue) { _this.layer.setMap(null); _this.layer = null; return _this.createGoogleLayer(); } }, true); this.scope.$on("$destroy", function() { return _this.layer.setMap(null); }); } LayerParentModel.prototype.createGoogleLayer = function() { var fn; if (this.attrs.options == null) { this.layer = this.attrs.namespace === void 0 ? new google.maps[this.attrs.type]() : new google.maps[this.attrs.namespace][this.attrs.type](); } else { this.layer = this.attrs.namespace === void 0 ? new google.maps[this.attrs.type](this.scope.options) : new google.maps[this.attrs.namespace][this.attrs.type](this.scope.options); } if ((this.layer != null) && (this.onLayerCreated != null)) { fn = this.onLayerCreated(this.scope, this.layer); if (fn) { return fn(this.layer); } } }; return LayerParentModel; })(BaseObject); return LayerParentModel; } ]); }).call(this); /* Basic Directive api for a marker. Basic in the sense that this directive contains 1:1 on scope and model. Thus there will be one html element per marker within the directive. */ (function() { var __bind = function(fn, me){ return function(){ return fn.apply(me, arguments); }; }, __hasProp = {}.hasOwnProperty, __extends = function(child, parent) { for (var key in parent) { if (__hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; }; angular.module("google-maps.directives.api.models.parent").factory("MarkerParentModel", [ "IMarkerParentModel", "GmapUtil", "EventsHelper", function(IMarkerParentModel, GmapUtil, EventsHelper) { var MarkerParentModel; MarkerParentModel = (function(_super) { __extends(MarkerParentModel, _super); MarkerParentModel.include(GmapUtil); MarkerParentModel.include(EventsHelper); function MarkerParentModel(scope, element, attrs, map, $timeout, gMarkerManager, doFit) { var opts, self, _this = this; this.gMarkerManager = gMarkerManager; this.doFit = doFit; this.onDestroy = __bind(this.onDestroy, this); this.setGMarker = __bind(this.setGMarker, this); this.onWatch = __bind(this.onWatch, this); MarkerParentModel.__super__.constructor.call(this, scope, element, attrs, map, $timeout); self = this; opts = this.createMarkerOptions(scope.coords, scope.icon, scope.options, this.map); this.setGMarker(new google.maps.Marker(opts)); this.listener = google.maps.event.addListener(this.scope.gMarker, 'click', function() { if (_this.doClick && (scope.click != null)) { return _this.$timeout(function() { return _this.scope.click(); }); } }); this.setEvents(this.scope.gMarker, scope, scope); this.$log.info(this); } MarkerParentModel.prototype.onWatch = function(propNameToWatch, scope) { var old, pos, _ref; switch (propNameToWatch) { case 'coords': if (this.validateCoords(scope.coords) && (this.scope.gMarker != null)) { pos = (_ref = this.scope.gMarker) != null ? _ref.getPosition() : void 0; if (pos.lat() === this.scope.coords.latitude && this.scope.coords.longitude === pos.lng()) { return; } old = this.scope.gMarker.getAnimation(); this.scope.gMarker.setMap(this.map); this.scope.gMarker.setPosition(this.getCoords(scope.coords)); this.scope.gMarker.setVisible(this.validateCoords(scope.coords)); return this.scope.gMarker.setAnimation(old); } else { return this.scope.gMarker.setMap(null); } break; case 'icon': if ((scope.icon != null) && this.validateCoords(scope.coords) && (this.scope.gMarker != null)) { this.scope.gMarker.setIcon(scope.icon); this.scope.gMarker.setMap(null); this.scope.gMarker.setMap(this.map); this.scope.gMarker.setPosition(this.getCoords(scope.coords)); return this.scope.gMarker.setVisible(this.validateCoords(scope.coords)); } break; case 'options': if (this.validateCoords(scope.coords) && (scope.icon != null) && scope.options) { if (this.scope.gMarker != null) { this.onDestroy(scope); return this.onTimeOut(scope); } } } }; MarkerParentModel.prototype.setGMarker = function(gMarker) { if (this.scope.gMarker) { delete this.scope.gMarker; this.gMarkerManager.remove(this.scope.gMarker, false); } this.scope.gMarker = gMarker; if (this.scope.gMarker) { this.gMarkerManager.add(this.scope.gMarker, false); if (this.doFit) { return this.gMarkerManager.fit(); } } }; MarkerParentModel.prototype.onDestroy = function(scope) { var self; if (!this.scope.gMarker) { self = void 0; return; } this.scope.gMarker.setMap(null); google.maps.event.removeListener(this.listener); this.listener = null; this.gMarkerManager.remove(this.scope.gMarker, false); delete this.scope.gMarker; return self = void 0; }; return MarkerParentModel; })(IMarkerParentModel); return MarkerParentModel; } ]); }).call(this); (function() { var __bind = function(fn, me){ return function(){ return fn.apply(me, arguments); }; }, __hasProp = {}.hasOwnProperty, __extends = function(child, parent) { for (var key in parent) { if (__hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; }; angular.module("google-maps.directives.api.models.parent").factory("MarkersParentModel", [ "IMarkerParentModel", "ModelsWatcher", "PropMap", "MarkerChildModel", "ClustererMarkerManager", "MarkerManager", function(IMarkerParentModel, ModelsWatcher, PropMap, MarkerChildModel, ClustererMarkerManager, MarkerManager) { var MarkersParentModel; MarkersParentModel = (function(_super) { __extends(MarkersParentModel, _super); MarkersParentModel.include(ModelsWatcher); function MarkersParentModel(scope, element, attrs, map, $timeout) { this.onDestroy = __bind(this.onDestroy, this); this.newChildMarker = __bind(this.newChildMarker, this); this.pieceMealMarkers = __bind(this.pieceMealMarkers, this); this.reBuildMarkers = __bind(this.reBuildMarkers, this); this.createMarkersFromScratch = __bind(this.createMarkersFromScratch, this); this.validateScope = __bind(this.validateScope, this); this.onWatch = __bind(this.onWatch, this); var self, _this = this; MarkersParentModel.__super__.constructor.call(this, scope, element, attrs, map, $timeout); self = this; this.scope.markerModels = new PropMap(); this.$timeout = $timeout; this.$log.info(this); this.doRebuildAll = this.scope.doRebuildAll != null ? this.scope.doRebuildAll : false; this.setIdKey(scope); this.scope.$watch('doRebuildAll', function(newValue, oldValue) { if (newValue !== oldValue) { return _this.doRebuildAll = newValue; } }); this.watch('models', scope); this.watch('doCluster', scope); this.watch('clusterOptions', scope); this.watch('clusterEvents', scope); this.watch('fit', scope); this.watch('idKey', scope); this.gMarkerManager = void 0; this.createMarkersFromScratch(scope); } MarkersParentModel.prototype.onWatch = function(propNameToWatch, scope, newValue, oldValue) { if (propNameToWatch === "idKey" && newValue !== oldValue) { this.idKey = newValue; } if (this.doRebuildAll) { return this.reBuildMarkers(scope); } else { return this.pieceMealMarkers(scope); } }; MarkersParentModel.prototype.validateScope = function(scope) { var modelsNotDefined; modelsNotDefined = angular.isUndefined(scope.models) || scope.models === void 0; if (modelsNotDefined) { this.$log.error(this.constructor.name + ": no valid models attribute found"); } return MarkersParentModel.__super__.validateScope.call(this, scope) || modelsNotDefined; }; MarkersParentModel.prototype.createMarkersFromScratch = function(scope) { var _this = this; if (scope.doCluster) { if (scope.clusterEvents) { this.clusterInternalOptions = _.once(function() { var self, _ref, _ref1, _ref2; self = _this; if (!_this.origClusterEvents) { _this.origClusterEvents = { click: (_ref = scope.clusterEvents) != null ? _ref.click : void 0, mouseout: (_ref1 = scope.clusterEvents) != null ? _ref1.mouseout : void 0, mouseover: (_ref2 = scope.clusterEvents) != null ? _ref2.mouseover : void 0 }; return _.extend(scope.clusterEvents, { click: function(cluster) { return self.maybeExecMappedEvent(cluster, 'click'); }, mouseout: function(cluster) { return self.maybeExecMappedEvent(cluster, 'mouseout'); }, mouseover: function(cluster) { return self.maybeExecMappedEvent(cluster, 'mouseover'); } }); } })(); } if (scope.clusterOptions || scope.clusterEvents) { if (this.gMarkerManager === void 0) { this.gMarkerManager = new ClustererMarkerManager(this.map, void 0, scope.clusterOptions, this.clusterInternalOptions); } else { if (this.gMarkerManager.opt_options !== scope.clusterOptions) { this.gMarkerManager = new ClustererMarkerManager(this.map, void 0, scope.clusterOptions, this.clusterInternalOptions); } } } else { this.gMarkerManager = new ClustererMarkerManager(this.map); } } else { this.gMarkerManager = new MarkerManager(this.map); } return _async.each(scope.models, function(model) { return _this.newChildMarker(model, scope); }, function() { _this.gMarkerManager.draw(); if (scope.fit) { return _this.gMarkerManager.fit(); } }); }; MarkersParentModel.prototype.reBuildMarkers = function(scope) { if (!scope.doRebuild && scope.doRebuild !== void 0) { return; } this.onDestroy(scope); return this.createMarkersFromScratch(scope); }; MarkersParentModel.prototype.pieceMealMarkers = function(scope) { var _this = this; if ((this.scope.models != null) && this.scope.models.length > 0 && this.scope.markerModels.length > 0) { return this.figureOutState(this.idKey, scope, this.scope.markerModels, this.modelKeyComparison, function(state) { var payload; payload = state; return _async.each(payload.removals, function(child) { if (child != null) { if (child.destroy != null) { child.destroy(); } return _this.scope.markerModels.remove(child.id); } }, function() { return _async.each(payload.adds, function(modelToAdd) { return _this.newChildMarker(modelToAdd, scope); }, function() { if (payload.adds.length > 0 || payload.removals.length > 0) { _this.gMarkerManager.draw(); return scope.markerModels = _this.scope.markerModels; } }); }); }); } else { return this.reBuildMarkers(scope); } }; MarkersParentModel.prototype.newChildMarker = function(model, scope) { var child; if (model[this.idKey] == null) { this.$log.error("Marker model has no id to assign a child to. This is required for performance. Please assign id, or redirect id to a different key."); return; } this.$log.info('child', child, 'markers', this.scope.markerModels); child = new MarkerChildModel(model, scope, this.map, this.$timeout, this.DEFAULTS, this.doClick, this.gMarkerManager, this.idKey); this.scope.markerModels.put(model[this.idKey], child); return child; }; MarkersParentModel.prototype.onDestroy = function(scope) { _.each(this.scope.markerModels.values(), function(model) { if (model != null) { return model.destroy(); } }); delete this.scope.markerModels; this.scope.markerModels = new PropMap(); if (this.gMarkerManager != null) { return this.gMarkerManager.clear(); } }; MarkersParentModel.prototype.maybeExecMappedEvent = function(cluster, fnName) { var pair, _ref; if (_.isFunction((_ref = this.scope.clusterEvents) != null ? _ref[fnName] : void 0)) { pair = this.mapClusterToMarkerModels(cluster); if (this.origClusterEvents[fnName]) { return this.origClusterEvents[fnName](pair.cluster, pair.mapped); } } }; MarkersParentModel.prototype.mapClusterToMarkerModels = function(cluster) { var gMarkers, mapped, _this = this; gMarkers = cluster.getMarkers(); mapped = gMarkers.map(function(g) { return _this.scope.markerModels[g.key].model; }); return { cluster: cluster, mapped: mapped }; }; return MarkersParentModel; })(IMarkerParentModel); return MarkersParentModel; } ]); }).call(this); /* Windows directive where many windows map to the models property */ (function() { var __bind = function(fn, me){ return function(){ return fn.apply(me, arguments); }; }, __hasProp = {}.hasOwnProperty, __extends = function(child, parent) { for (var key in parent) { if (__hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; }; angular.module("google-maps.directives.api.models.parent").factory("PolylinesParentModel", [ "$timeout", "Logger", "ModelKey", "ModelsWatcher", "PropMap", "PolylineChildModel", function($timeout, Logger, ModelKey, ModelsWatcher, PropMap, PolylineChildModel) { var PolylinesParentModel; return PolylinesParentModel = (function(_super) { __extends(PolylinesParentModel, _super); PolylinesParentModel.include(ModelsWatcher); function PolylinesParentModel(scope, element, attrs, gMap, defaults) { var self, _this = this; this.scope = scope; this.element = element; this.attrs = attrs; this.gMap = gMap; this.defaults = defaults; this.modelKeyComparison = __bind(this.modelKeyComparison, this); this.setChildScope = __bind(this.setChildScope, this); this.createChild = __bind(this.createChild, this); this.pieceMeal = __bind(this.pieceMeal, this); this.createAllNew = __bind(this.createAllNew, this); this.watchIdKey = __bind(this.watchIdKey, this); this.createChildScopes = __bind(this.createChildScopes, this); this.watchOurScope = __bind(this.watchOurScope, this); this.watchDestroy = __bind(this.watchDestroy, this); this.rebuildAll = __bind(this.rebuildAll, this); this.doINeedToWipe = __bind(this.doINeedToWipe, this); this.watchModels = __bind(this.watchModels, this); this.watch = __bind(this.watch, this); PolylinesParentModel.__super__.constructor.call(this, scope); self = this; this.$log = Logger; this.plurals = new PropMap(); this.scopePropNames = ['path', 'stroke', 'clickable', 'draggable', 'editable', 'geodesic', 'icons', 'visible']; _.each(this.scopePropNames, function(name) { return _this[name + 'Key'] = void 0; }); this.models = void 0; this.firstTime = true; this.$log.info(this); this.watchOurScope(scope); this.createChildScopes(); } PolylinesParentModel.prototype.watch = function(scope, name, nameKey) { var _this = this; return scope.$watch(name, function(newValue, oldValue) { if (newValue !== oldValue) { _this[nameKey] = typeof newValue === 'function' ? newValue() : newValue; return _async.each(_.values(_this.plurals), function(model) { return model.scope[name] = _this[nameKey] === 'self' ? model : model[_this[nameKey]]; }, function() {}); } }); }; PolylinesParentModel.prototype.watchModels = function(scope) { var _this = this; return scope.$watch('models', function(newValue, oldValue) { if (!_.isEqual(newValue, oldValue)) { if (_this.doINeedToWipe(newValue)) { return _this.rebuildAll(scope, true, true); } else { return _this.createChildScopes(false); } } }, true); }; PolylinesParentModel.prototype.doINeedToWipe = function(newValue) { var newValueIsEmpty; newValueIsEmpty = newValue != null ? newValue.length === 0 : true; return this.plurals.length > 0 && newValueIsEmpty; }; PolylinesParentModel.prototype.rebuildAll = function(scope, doCreate, doDelete) { var _this = this; return _async.each(this.plurals.values(), function(model) { return model.destroy(); }, function() { if (doDelete) { delete _this.plurals; } _this.plurals = new PropMap(); if (doCreate) { return _this.createChildScopes(); } }); }; PolylinesParentModel.prototype.watchDestroy = function(scope) { var _this = this; return scope.$on("$destroy", function() { return _this.rebuildAll(scope, false, true); }); }; PolylinesParentModel.prototype.watchOurScope = function(scope) { var _this = this; return _.each(this.scopePropNames, function(name) { var nameKey; nameKey = name + 'Key'; _this[nameKey] = typeof scope[name] === 'function' ? scope[name]() : scope[name]; return _this.watch(scope, name, nameKey); }); }; PolylinesParentModel.prototype.createChildScopes = function(isCreatingFromScratch) { if (isCreatingFromScratch == null) { isCreatingFromScratch = true; } if (angular.isUndefined(this.scope.models)) { this.$log.error("No models to create polylines from! I Need direct models!"); return; } if (this.gMap != null) { if (this.scope.models != null) { this.watchIdKey(this.scope); if (isCreatingFromScratch) { return this.createAllNew(this.scope, false); } else { return this.pieceMeal(this.scope, false); } } } }; PolylinesParentModel.prototype.watchIdKey = function(scope) { var _this = this; this.setIdKey(scope); return scope.$watch('idKey', function(newValue, oldValue) { if (newValue !== oldValue && (newValue == null)) { _this.idKey = newValue; return _this.rebuildAll(scope, true, true); } }); }; PolylinesParentModel.prototype.createAllNew = function(scope, isArray) { var _this = this; if (isArray == null) { isArray = false; } this.models = scope.models; if (this.firstTime) { this.watchModels(scope); this.watchDestroy(scope); } return _async.each(scope.models, function(model) { return _this.createChild(model, _this.gMap); }, function() { return _this.firstTime = false; }); }; PolylinesParentModel.prototype.pieceMeal = function(scope, isArray) { var _this = this; if (isArray == null) { isArray = true; } this.models = scope.models; if ((scope != null) && (scope.models != null) && scope.models.length > 0 && this.plurals.length > 0) { return this.figureOutState(this.idKey, scope, this.plurals, this.modelKeyComparison, function(state) { var payload; payload = state; return _async.each(payload.removals, function(id) { var child; child = _this.plurals[id]; if (child != null) { child.destroy(); return _this.plurals.remove(id); } }, function() { return _async.each(payload.adds, function(modelToAdd) { return _this.createChild(modelToAdd, _this.gMap); }, function() {}); }); }); } else { return this.rebuildAll(this.scope, true, true); } }; PolylinesParentModel.prototype.createChild = function(model, gMap) { var child, childScope, _this = this; childScope = this.scope.$new(false); this.setChildScope(childScope, model); childScope.$watch('model', function(newValue, oldValue) { if (newValue !== oldValue) { return _this.setChildScope(childScope, newValue); } }, true); childScope["static"] = this.scope["static"]; child = new PolylineChildModel(childScope, this.attrs, gMap, this.defaults, model); if (model[this.idKey] == null) { this.$log.error("Polyline model has no id to assign a child to. This is required for performance. Please assign id, or redirect id to a different key."); return; } this.plurals.put(model[this.idKey], child); return child; }; PolylinesParentModel.prototype.setChildScope = function(childScope, model) { var _this = this; _.each(this.scopePropNames, function(name) { var nameKey, newValue; nameKey = name + 'Key'; newValue = _this[nameKey] === 'self' ? model : model[_this[nameKey]]; if (newValue !== childScope[name]) { return childScope[name] = newValue; } }); return childScope.model = model; }; PolylinesParentModel.prototype.modelKeyComparison = function(model1, model2) { return _.isEqual(this.evalModelHandle(model1, this.scope.path), this.evalModelHandle(model2, this.scope.path)); }; return PolylinesParentModel; })(ModelKey); } ]); }).call(this); /* Windows directive where many windows map to the models property */ (function() { var __bind = function(fn, me){ return function(){ return fn.apply(me, arguments); }; }, __hasProp = {}.hasOwnProperty, __extends = function(child, parent) { for (var key in parent) { if (__hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; }; angular.module("google-maps.directives.api.models.parent").factory("WindowsParentModel", [ "IWindowParentModel", "ModelsWatcher", "PropMap", "WindowChildModel", "Linked", function(IWindowParentModel, ModelsWatcher, PropMap, WindowChildModel, Linked) { var WindowsParentModel; WindowsParentModel = (function(_super) { __extends(WindowsParentModel, _super); WindowsParentModel.include(ModelsWatcher); function WindowsParentModel(scope, element, attrs, ctrls, $timeout, $compile, $http, $templateCache, $interpolate) { var mapScope, self, _this = this; this.$interpolate = $interpolate; this.interpolateContent = __bind(this.interpolateContent, this); this.setChildScope = __bind(this.setChildScope, this); this.createWindow = __bind(this.createWindow, this); this.setContentKeys = __bind(this.setContentKeys, this); this.pieceMealWindows = __bind(this.pieceMealWindows, this); this.createAllNewWindows = __bind(this.createAllNewWindows, this); this.watchIdKey = __bind(this.watchIdKey, this); this.createChildScopesWindows = __bind(this.createChildScopesWindows, this); this.watchOurScope = __bind(this.watchOurScope, this); this.watchDestroy = __bind(this.watchDestroy, this); this.rebuildAll = __bind(this.rebuildAll, this); this.doINeedToWipe = __bind(this.doINeedToWipe, this); this.watchModels = __bind(this.watchModels, this); this.watch = __bind(this.watch, this); this.go = __bind(this.go, this); WindowsParentModel.__super__.constructor.call(this, scope, element, attrs, ctrls, $timeout, $compile, $http, $templateCache); self = this; this.windows = new PropMap(); this.scopePropNames = ['show', 'coords', 'templateUrl', 'templateParameter', 'isIconVisibleOnClick', 'closeClick']; _.each(this.scopePropNames, function(name) { return _this[name + 'Key'] = void 0; }); this.linked = new Linked(scope, element, attrs, ctrls); this.models = void 0; this.contentKeys = void 0; this.isIconVisibleOnClick = void 0; this.firstTime = true; this.$log.info(self); this.parentScope = void 0; mapScope = ctrls[0].getScope(); mapScope.deferred.promise.then(function(map) { var markerCtrl; _this.gMap = map; markerCtrl = ctrls.length > 1 && (ctrls[1] != null) ? ctrls[1] : void 0; if (!markerCtrl) { _this.go(scope); return; } return markerCtrl.getScope().deferred.promise.then(function() { _this.markerScope = markerCtrl.getScope(); return _this.go(scope); }); }); } WindowsParentModel.prototype.go = function(scope) { var _this = this; this.watchOurScope(scope); this.doRebuildAll = this.scope.doRebuildAll != null ? this.scope.doRebuildAll : false; scope.$watch('doRebuildAll', function(newValue, oldValue) { if (newValue !== oldValue) { return _this.doRebuildAll = newValue; } }); return this.createChildScopesWindows(); }; WindowsParentModel.prototype.watch = function(scope, name, nameKey) { var _this = this; return scope.$watch(name, function(newValue, oldValue) { if (newValue !== oldValue) { _this[nameKey] = typeof newValue === 'function' ? newValue() : newValue; return _async.each(_.values(_this.windows), function(model) { return model.scope[name] = _this[nameKey] === 'self' ? model : model[_this[nameKey]]; }, function() {}); } }); }; WindowsParentModel.prototype.watchModels = function(scope) { var _this = this; return scope.$watch('models', function(newValue, oldValue) { if (!_.isEqual(newValue, oldValue)) { if (_this.doRebuildAll || _this.doINeedToWipe(newValue)) { return _this.rebuildAll(scope, true, true); } else { return _this.createChildScopesWindows(false); } } }); }; WindowsParentModel.prototype.doINeedToWipe = function(newValue) { var newValueIsEmpty; newValueIsEmpty = newValue != null ? newValue.length === 0 : true; return this.windows.length > 0 && newValueIsEmpty; }; WindowsParentModel.prototype.rebuildAll = function(scope, doCreate, doDelete) { var _this = this; return _async.each(this.windows.values(), function(model) { return model.destroy(); }, function() { if (doDelete) { delete _this.windows; } _this.windows = new PropMap(); if (doCreate) { return _this.createChildScopesWindows(); } }); }; WindowsParentModel.prototype.watchDestroy = function(scope) { var _this = this; return scope.$on("$destroy", function() { return _this.rebuildAll(scope, false, true); }); }; WindowsParentModel.prototype.watchOurScope = function(scope) { var _this = this; return _.each(this.scopePropNames, function(name) { var nameKey; nameKey = name + 'Key'; _this[nameKey] = typeof scope[name] === 'function' ? scope[name]() : scope[name]; return _this.watch(scope, name, nameKey); }); }; WindowsParentModel.prototype.createChildScopesWindows = function(isCreatingFromScratch) { var markersScope, modelsNotDefined; if (isCreatingFromScratch == null) { isCreatingFromScratch = true; } /* being that we cannot tell the difference in Key String vs. a normal value string (TemplateUrl) we will assume that all scope values are string expressions either pointing to a key (propName) or using 'self' to point the model as container/object of interest. This may force redundant information into the model, but this appears to be the most flexible approach. */ this.isIconVisibleOnClick = true; if (angular.isDefined(this.linked.attrs.isiconvisibleonclick)) { this.isIconVisibleOnClick = this.linked.scope.isIconVisibleOnClick; } markersScope = this.markerScope; modelsNotDefined = angular.isUndefined(this.linked.scope.models); if (modelsNotDefined && (markersScope === void 0 || (markersScope.markerModels === void 0 || markersScope.models === void 0))) { this.$log.error("No models to create windows from! Need direct models or models derrived from markers!"); return; } if (this.gMap != null) { if (this.linked.scope.models != null) { this.watchIdKey(this.linked.scope); if (isCreatingFromScratch) { return this.createAllNewWindows(this.linked.scope, false); } else { return this.pieceMealWindows(this.linked.scope, false); } } else { this.parentScope = markersScope; this.watchIdKey(this.parentScope); if (isCreatingFromScratch) { return this.createAllNewWindows(markersScope, true, 'markerModels', false); } else { return this.pieceMealWindows(markersScope, true, 'markerModels', false); } } } }; WindowsParentModel.prototype.watchIdKey = function(scope) { var _this = this; this.setIdKey(scope); return scope.$watch('idKey', function(newValue, oldValue) { if (newValue !== oldValue && (newValue == null)) { _this.idKey = newValue; return _this.rebuildAll(scope, true, true); } }); }; WindowsParentModel.prototype.createAllNewWindows = function(scope, hasGMarker, modelsPropToIterate, isArray) { var _this = this; if (modelsPropToIterate == null) { modelsPropToIterate = 'models'; } if (isArray == null) { isArray = false; } this.models = scope.models; if (this.firstTime) { this.watchModels(scope); this.watchDestroy(scope); } this.setContentKeys(scope.models); return _async.each(scope.models, function(model) { var gMarker; gMarker = hasGMarker ? scope[modelsPropToIterate][[model[_this.idKey]]].gMarker : void 0; return _this.createWindow(model, gMarker, _this.gMap); }, function() { return _this.firstTime = false; }); }; WindowsParentModel.prototype.pieceMealWindows = function(scope, hasGMarker, modelsPropToIterate, isArray) { var _this = this; if (modelsPropToIterate == null) { modelsPropToIterate = 'models'; } if (isArray == null) { isArray = true; } this.models = scope.models; if ((scope != null) && (scope.models != null) && scope.models.length > 0 && this.windows.length > 0) { return this.figureOutState(this.idKey, scope, this.windows, this.modelKeyComparison, function(state) { var payload; payload = state; return _async.each(payload.removals, function(child) { if (child != null) { if (child.destroy != null) { child.destroy(); } return _this.windows.remove(child.id); } }, function() { return _async.each(payload.adds, function(modelToAdd) { var gMarker; gMarker = scope[modelsPropToIterate][modelToAdd[_this.idKey]].gMarker; return _this.createWindow(modelToAdd, gMarker, _this.gMap); }, function() {}); }); }); } else { return this.rebuildAll(this.scope, true, true); } }; WindowsParentModel.prototype.setContentKeys = function(models) { if (models.length > 0) { return this.contentKeys = Object.keys(models[0]); } }; WindowsParentModel.prototype.createWindow = function(model, gMarker, gMap) { var child, childScope, fakeElement, opts, _this = this; childScope = this.linked.scope.$new(false); this.setChildScope(childScope, model); childScope.$watch('model', function(newValue, oldValue) { if (newValue !== oldValue) { return _this.setChildScope(childScope, newValue); } }, true); fakeElement = { html: function() { return _this.interpolateContent(_this.linked.element.html(), model); } }; opts = this.createWindowOptions(gMarker, childScope, fakeElement.html(), this.DEFAULTS); child = new WindowChildModel(model, childScope, opts, this.isIconVisibleOnClick, gMap, gMarker, fakeElement, true, true); if (model[this.idKey] == null) { this.$log.error("Window model has no id to assign a child to. This is required for performance. Please assign id, or redirect id to a different key."); return; } this.windows.put(model[this.idKey], child); return child; }; WindowsParentModel.prototype.setChildScope = function(childScope, model) { var _this = this; _.each(this.scopePropNames, function(name) { var nameKey, newValue; nameKey = name + 'Key'; newValue = _this[nameKey] === 'self' ? model : model[_this[nameKey]]; if (newValue !== childScope[name]) { return childScope[name] = newValue; } }); return childScope.model = model; }; WindowsParentModel.prototype.interpolateContent = function(content, model) { var exp, interpModel, key, _i, _len, _ref; if (this.contentKeys === void 0 || this.contentKeys.length === 0) { return; } exp = this.$interpolate(content); interpModel = {}; _ref = this.contentKeys; for (_i = 0, _len = _ref.length; _i < _len; _i++) { key = _ref[_i]; interpModel[key] = model[key]; } return exp(interpModel); }; return WindowsParentModel; })(IWindowParentModel); return WindowsParentModel; } ]); }).call(this); /* - interface for all labels to derrive from - to enforce a minimum set of requirements - attributes - content - anchor - implementation needed on watches */ (function() { var __bind = function(fn, me){ return function(){ return fn.apply(me, arguments); }; }, __hasProp = {}.hasOwnProperty, __extends = function(child, parent) { for (var key in parent) { if (__hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; }; angular.module("google-maps.directives.api").factory("ILabel", [ "BaseObject", "Logger", function(BaseObject, Logger) { var ILabel; return ILabel = (function(_super) { __extends(ILabel, _super); function ILabel($timeout) { this.link = __bind(this.link, this); var self; self = this; this.restrict = 'ECMA'; this.replace = true; this.template = void 0; this.require = void 0; this.transclude = true; this.priority = -100; this.scope = { labelContent: '=content', labelAnchor: '@anchor', labelClass: '@class', labelStyle: '=style' }; this.$log = Logger; this.$timeout = $timeout; } ILabel.prototype.link = function(scope, element, attrs, ctrl) { throw new Exception("Not Implemented!!"); }; return ILabel; })(BaseObject); } ]); }).call(this); /* - interface for all markers to derrive from - to enforce a minimum set of requirements - attributes - coords - icon - implementation needed on watches */ (function() { var __bind = function(fn, me){ return function(){ return fn.apply(me, arguments); }; }, __hasProp = {}.hasOwnProperty, __extends = function(child, parent) { for (var key in parent) { if (__hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; }; angular.module("google-maps.directives.api").factory("IMarker", [ "Logger", "BaseObject", "$q", function(Logger, BaseObject, $q) { var IMarker; return IMarker = (function(_super) { __extends(IMarker, _super); function IMarker($timeout) { this.link = __bind(this.link, this); var self; self = this; this.$log = Logger; this.$timeout = $timeout; this.restrict = 'ECMA'; this.require = '^googleMap'; this.priority = -1; this.transclude = true; this.replace = true; this.scope = { coords: '=coords', icon: '=icon', click: '&click', options: '=options', events: '=events', fit: '=fit' }; } IMarker.prototype.link = function(scope, element, attrs, ctrl) { if (!ctrl) { throw new Error("No Map Control! Marker Directive Must be inside the map!"); } }; IMarker.prototype.mapPromise = function(scope, ctrl) { var mapScope; mapScope = ctrl.getScope(); mapScope.deferred.promise.then(function(map) { return scope.map = map; }); return mapScope.deferred.promise; }; return IMarker; })(BaseObject); } ]); }).call(this); (function() { var __hasProp = {}.hasOwnProperty, __extends = function(child, parent) { for (var key in parent) { if (__hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; }; angular.module("google-maps.directives.api").factory("IPolyline", [ "GmapUtil", "BaseObject", "Logger", function(GmapUtil, BaseObject, Logger) { var IPolyline; return IPolyline = (function(_super) { __extends(IPolyline, _super); IPolyline.include(GmapUtil); function IPolyline() { var self; self = this; } IPolyline.prototype.restrict = "ECA"; IPolyline.prototype.replace = true; IPolyline.prototype.require = "^googleMap"; IPolyline.prototype.scope = { path: "=", stroke: "=", clickable: "=", draggable: "=", editable: "=", geodesic: "=", icons: "=", visible: "=", "static": "=", fit: "=" }; IPolyline.prototype.DEFAULTS = {}; IPolyline.prototype.$log = Logger; return IPolyline; })(BaseObject); } ]); }).call(this); /* - interface directive for all window(s) to derrive from */ (function() { var __bind = function(fn, me){ return function(){ return fn.apply(me, arguments); }; }, __hasProp = {}.hasOwnProperty, __extends = function(child, parent) { for (var key in parent) { if (__hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; }; angular.module("google-maps.directives.api").factory("IWindow", [ "BaseObject", "ChildEvents", "Logger", function(BaseObject, ChildEvents, Logger) { var IWindow; return IWindow = (function(_super) { __extends(IWindow, _super); IWindow.include(ChildEvents); function IWindow($timeout, $compile, $http, $templateCache) { var self; this.$timeout = $timeout; this.$compile = $compile; this.$http = $http; this.$templateCache = $templateCache; this.link = __bind(this.link, this); self = this; this.restrict = 'ECMA'; this.template = void 0; this.transclude = true; this.priority = -100; this.require = void 0; this.replace = true; this.scope = { coords: '=coords', show: '=show', templateUrl: '=templateurl', templateParameter: '=templateparameter', isIconVisibleOnClick: '=isiconvisibleonclick', closeClick: '&closeclick', options: '=options' }; this.$log = Logger; } IWindow.prototype.link = function(scope, element, attrs, ctrls) { throw new Exception("Not Implemented!!"); }; return IWindow; })(BaseObject); } ]); }).call(this); (function() { var __bind = function(fn, me){ return function(){ return fn.apply(me, arguments); }; }, __hasProp = {}.hasOwnProperty, __extends = function(child, parent) { for (var key in parent) { if (__hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; }; angular.module("google-maps.directives.api").factory("Map", [ "$timeout", '$q', 'Logger', "GmapUtil", "BaseObject", "ExtendGWin", "CtrlHandle", function($timeout, $q, Logger, GmapUtil, BaseObject, ExtendGWin, CtrlHandle) { "use strict"; var $log, DEFAULTS, Map; $log = Logger; DEFAULTS = { mapTypeId: google.maps.MapTypeId.ROADMAP }; return Map = (function(_super) { __extends(Map, _super); Map.include(GmapUtil); function Map() { this.link = __bind(this.link, this); var self; self = this; } Map.prototype.restrict = "ECMA"; Map.prototype.transclude = true; Map.prototype.replace = false; Map.prototype.template = "<div class=\"angular-google-map\"><div class=\"angular-google-map-container\"></div><div ng-transclude style=\"display: none\"></div></div>"; Map.prototype.scope = { center: "=center", zoom: "=zoom", dragging: "=dragging", control: "=", windows: "=windows", options: "=options", events: "=events", styles: "=styles", bounds: "=bounds" }; Map.prototype.controller = [ "$scope", function($scope) { var ctrlObj; ctrlObj = CtrlHandle.handle($scope); $scope.ctrlType = 'Map'; $scope.deferred.promise.then(function() { return ExtendGWin.init(); }); return _.extend(ctrlObj, { getMap: function() { return $scope.map; } }); } ]; /* @param scope @param element @param attrs */ Map.prototype.link = function(scope, element, attrs) { var dragging, el, eventName, getEventHandler, opts, settingCenterFromScope, type, _m, _this = this; if (!this.validateCoords(scope.center)) { $log.error("angular-google-maps: could not find a valid center property"); return; } if (!angular.isDefined(scope.zoom)) { $log.error("angular-google-maps: map zoom property not set"); return; } el = angular.element(element); el.addClass("angular-google-map"); opts = { options: {} }; if (attrs.options) { opts.options = scope.options; } if (attrs.styles) { opts.styles = scope.styles; } if (attrs.type) { type = attrs.type.toUpperCase(); if (google.maps.MapTypeId.hasOwnProperty(type)) { opts.mapTypeId = google.maps.MapTypeId[attrs.type.toUpperCase()]; } else { $log.error("angular-google-maps: invalid map type \"" + attrs.type + "\""); } } _m = new google.maps.Map(el.find("div")[1], angular.extend({}, DEFAULTS, opts, { center: this.getCoords(scope.center), draggable: this.isTrue(attrs.draggable), zoom: scope.zoom, bounds: scope.bounds })); dragging = false; if (!_m) { google.maps.event.addListener(_m, 'tilesloaded ', function(map) { return scope.deferred.resolve(map); }); } else { scope.deferred.resolve(_m); } google.maps.event.addListener(_m, "dragstart", function() { dragging = true; return _.defer(function() { return scope.$apply(function(s) { if (s.dragging != null) { return s.dragging = dragging; } }); }); }); google.maps.event.addListener(_m, "dragend", function() { dragging = false; return _.defer(function() { return scope.$apply(function(s) { if (s.dragging != null) { return s.dragging = dragging; } }); }); }); google.maps.event.addListener(_m, "drag", function() { var c; c = _m.center; return _.defer(function() { return scope.$apply(function(s) { if (angular.isDefined(s.center.type)) { s.center.coordinates[1] = c.lat(); return s.center.coordinates[0] = c.lng(); } else { s.center.latitude = c.lat(); return s.center.longitude = c.lng(); } }); }); }); google.maps.event.addListener(_m, "zoom_changed", function() { if (scope.zoom !== _m.zoom) { return _.defer(function() { return scope.$apply(function(s) { return s.zoom = _m.zoom; }); }); } }); settingCenterFromScope = false; google.maps.event.addListener(_m, "center_changed", function() { var c; c = _m.center; if (settingCenterFromScope) { return; } return _.defer(function() { return scope.$apply(function(s) { if (!_m.dragging) { if (angular.isDefined(s.center.type)) { if (s.center.coordinates[1] !== c.lat()) { s.center.coordinates[1] = c.lat(); } if (s.center.coordinates[0] !== c.lng()) { return s.center.coordinates[0] = c.lng(); } } else { if (s.center.latitude !== c.lat()) { s.center.latitude = c.lat(); } if (s.center.longitude !== c.lng()) { return s.center.longitude = c.lng(); } } } }); }); }); google.maps.event.addListener(_m, "idle", function() { var b, ne, sw; b = _m.getBounds(); ne = b.getNorthEast(); sw = b.getSouthWest(); return _.defer(function() { return scope.$apply(function(s) { if (s.bounds !== null && s.bounds !== undefined && s.bounds !== void 0) { s.bounds.northeast = { latitude: ne.lat(), longitude: ne.lng() }; return s.bounds.southwest = { latitude: sw.lat(), longitude: sw.lng() }; } }); }); }); if (angular.isDefined(scope.events) && scope.events !== null && angular.isObject(scope.events)) { getEventHandler = function(eventName) { return function() { return scope.events[eventName].apply(scope, [_m, eventName, arguments]); }; }; for (eventName in scope.events) { if (scope.events.hasOwnProperty(eventName) && angular.isFunction(scope.events[eventName])) { google.maps.event.addListener(_m, eventName, getEventHandler(eventName)); } } } scope.map = _m; if ((attrs.control != null) && (scope.control != null)) { scope.control.refresh = function(maybeCoords) { var coords; if (_m == null) { return; } google.maps.event.trigger(_m, "resize"); if (((maybeCoords != null ? maybeCoords.latitude : void 0) != null) && ((maybeCoords != null ? maybeCoords.latitude : void 0) != null)) { coords = _this.getCoords(maybeCoords); if (_this.isTrue(attrs.pan)) { return _m.panTo(coords); } else { return _m.setCenter(coords); } } }; /* I am sure you all will love this. You want the instance here you go.. BOOM! */ scope.control.getGMap = function() { return _m; }; } scope.$watch("center", (function(newValue, oldValue) { var coords; coords = _this.getCoords(newValue); if (coords.lat() === _m.center.lat() && coords.lng() === _m.center.lng()) { return; } settingCenterFromScope = true; if (!dragging) { if (!_this.validateCoords(newValue)) { $log.error("Invalid center for newValue: " + (JSON.stringify(newValue))); } if (_this.isTrue(attrs.pan) && scope.zoom === _m.zoom) { _m.panTo(coords); } else { _m.setCenter(coords); } } return settingCenterFromScope = false; }), true); scope.$watch("zoom", function(newValue, oldValue) { if (newValue === _m.zoom) { return; } return _.defer(function() { return _m.setZoom(newValue); }); }); scope.$watch("bounds", function(newValue, oldValue) { var bounds, ne, sw; if (newValue === oldValue) { return; } if ((newValue.northeast.latitude == null) || (newValue.northeast.longitude == null) || (newValue.southwest.latitude == null) || (newValue.southwest.longitude == null)) { $log.error("Invalid map bounds for new value: " + (JSON.stringify(newValue))); return; } ne = new google.maps.LatLng(newValue.northeast.latitude, newValue.northeast.longitude); sw = new google.maps.LatLng(newValue.southwest.latitude, newValue.southwest.longitude); bounds = new google.maps.LatLngBounds(sw, ne); return _m.fitBounds(bounds); }); scope.$watch("options", function(newValue, oldValue) { if (!_.isEqual(newValue, oldValue)) { opts.options = newValue; if (_m != null) { return _m.setOptions(opts); } } }, true); return scope.$watch("styles", function(newValue, oldValue) { if (!_.isEqual(newValue, oldValue)) { opts.styles = newValue; if (_m != null) { return _m.setOptions(opts); } } }, true); }; return Map; })(BaseObject); } ]); }).call(this); (function() { var __bind = function(fn, me){ return function(){ return fn.apply(me, arguments); }; }, __hasProp = {}.hasOwnProperty, __extends = function(child, parent) { for (var key in parent) { if (__hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; }; angular.module("google-maps.directives.api").factory("Marker", [ "IMarker", "MarkerParentModel", "MarkerManager", "CtrlHandle", function(IMarker, MarkerParentModel, MarkerManager, CtrlHandle) { var Marker; return Marker = (function(_super) { var _this = this; __extends(Marker, _super); function Marker($timeout) { this.link = __bind(this.link, this); Marker.__super__.constructor.call(this, $timeout); this.template = '<span class="angular-google-map-marker" ng-transclude></span>'; this.$log.info(this); } Marker.prototype.controller = [ '$scope', '$element', function($scope, $element) { $scope.ctrlType = 'Marker'; return CtrlHandle.handle($scope, $element); } ]; Marker.prototype.link = function(scope, element, attrs, ctrl) { var doFit, _this = this; Marker.__super__.link.call(this, scope, element, attrs, ctrl); if (scope.fit) { doFit = true; } return this.mapPromise(scope, ctrl).then(function(map) { if (!_this.gMarkerManager) { _this.gMarkerManager = new MarkerManager(map); } new MarkerParentModel(scope, element, attrs, map, _this.$timeout, _this.gMarkerManager, doFit); return scope.deferred.resolve(); }); }; return Marker; }).call(this, IMarker); } ]); }).call(this); (function() { var __bind = function(fn, me){ return function(){ return fn.apply(me, arguments); }; }, __hasProp = {}.hasOwnProperty, __extends = function(child, parent) { for (var key in parent) { if (__hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; }; angular.module("google-maps.directives.api").factory("Markers", [ "IMarker", "MarkersParentModel", "CtrlHandle", function(IMarker, MarkersParentModel, CtrlHandle) { var Markers; return Markers = (function(_super) { __extends(Markers, _super); function Markers($timeout) { this.link = __bind(this.link, this); var self; Markers.__super__.constructor.call(this, $timeout); this.template = '<span class="angular-google-map-markers" ng-transclude></span>'; this.scope = _.extend(this.scope || {}, { idKey: '=idkey', doRebuildAll: '=dorebuildall', models: '=models', doCluster: '=docluster', clusterOptions: '=clusteroptions', clusterEvents: '=clusterevents', labelContent: '=labelcontent', labelAnchor: '@labelanchor', labelClass: '@labelclass' }); this.$timeout = $timeout; self = this; this.$log.info(this); } Markers.prototype.controller = [ '$scope', '$element', function($scope, $element) { $scope.ctrlType = 'Markers'; return CtrlHandle.handle($scope, $element); } ]; Markers.prototype.link = function(scope, element, attrs, ctrl) { var _this = this; return this.mapPromise(scope, ctrl).then(function(map) { new MarkersParentModel(scope, element, attrs, map, _this.$timeout); return scope.deferred.resolve(); }); }; return Markers; })(IMarker); } ]); }).call(this); (function() { var __bind = function(fn, me){ return function(){ return fn.apply(me, arguments); }; }, __hasProp = {}.hasOwnProperty, __extends = function(child, parent) { for (var key in parent) { if (__hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; }; angular.module("google-maps.directives.api").factory("Polyline", [ "IPolyline", "$timeout", "array-sync", "PolylineChildModel", function(IPolyline, $timeout, arraySync, PolylineChildModel) { var Polyline, _ref; return Polyline = (function(_super) { __extends(Polyline, _super); function Polyline() { this.link = __bind(this.link, this); _ref = Polyline.__super__.constructor.apply(this, arguments); return _ref; } Polyline.prototype.link = function(scope, element, attrs, mapCtrl) { var _this = this; if (angular.isUndefined(scope.path) || scope.path === null || !this.validatePath(scope.path)) { this.$log.error("polyline: no valid path attribute found"); return; } return mapCtrl.getScope().deferred.promise.then(function(map) { return new PolylineChildModel(scope, attrs, map, _this.DEFAULTS); }); }; return Polyline; })(IPolyline); } ]); }).call(this); (function() { var __bind = function(fn, me){ return function(){ return fn.apply(me, arguments); }; }, __hasProp = {}.hasOwnProperty, __extends = function(child, parent) { for (var key in parent) { if (__hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; }; angular.module("google-maps.directives.api").factory("Polylines", [ "IPolyline", "$timeout", "array-sync", "PolylinesParentModel", function(IPolyline, $timeout, arraySync, PolylinesParentModel) { var Polylines; return Polylines = (function(_super) { __extends(Polylines, _super); function Polylines() { this.link = __bind(this.link, this); Polylines.__super__.constructor.call(this); this.scope.idKey = '=idkey'; this.scope.models = '=models'; this.$log.info(this); } Polylines.prototype.link = function(scope, element, attrs, mapCtrl) { var _this = this; if (angular.isUndefined(scope.path) || scope.path === null) { this.$log.error("polylines: no valid path attribute found"); return; } if (!scope.models) { this.$log.error("polylines: no models found to create from"); return; } return mapCtrl.getScope().deferred.promise.then(function(map) { return new PolylinesParentModel(scope, element, attrs, map, _this.DEFAULTS); }); }; return Polylines; })(IPolyline); } ]); }).call(this); (function() { var __bind = function(fn, me){ return function(){ return fn.apply(me, arguments); }; }, __hasProp = {}.hasOwnProperty, __extends = function(child, parent) { for (var key in parent) { if (__hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; }; angular.module("google-maps.directives.api").factory("Window", [ "IWindow", "GmapUtil", "WindowChildModel", "$q", function(IWindow, GmapUtil, WindowChildModel, $q) { var Window; return Window = (function(_super) { __extends(Window, _super); Window.include(GmapUtil); function Window($timeout, $compile, $http, $templateCache) { this.init = __bind(this.init, this); this.link = __bind(this.link, this); var self; Window.__super__.constructor.call(this, $timeout, $compile, $http, $templateCache); self = this; this.require = ['^googleMap', '^?marker']; this.template = '<span class="angular-google-maps-window" ng-transclude></span>'; this.$log.info(self); } Window.prototype.link = function(scope, element, attrs, ctrls) { var mapScope, _this = this; mapScope = ctrls[0].getScope(); return mapScope.deferred.promise.then(function(mapCtrl) { var isIconVisibleOnClick, markerCtrl, markerScope; isIconVisibleOnClick = true; if (angular.isDefined(attrs.isiconvisibleonclick)) { isIconVisibleOnClick = scope.isIconVisibleOnClick; } markerCtrl = ctrls.length > 1 && (ctrls[1] != null) ? ctrls[1] : void 0; if (!markerCtrl) { _this.init(scope, element, isIconVisibleOnClick, mapCtrl); return; } markerScope = markerCtrl.getScope(); return markerScope.deferred.promise.then(function() { return _this.init(scope, element, isIconVisibleOnClick, mapCtrl, markerScope); }); }); }; Window.prototype.init = function(scope, element, isIconVisibleOnClick, mapCtrl, markerScope) { var defaults, gMarker, hasScopeCoords, opts, window, _this = this; defaults = scope.options != null ? scope.options : {}; hasScopeCoords = (scope != null) && this.validateCoords(scope.coords); if (markerScope != null) { gMarker = markerScope.gMarker; markerScope.$watch('coords', function(newValue, oldValue) { if ((markerScope.gMarker != null) && !window.markerCtrl) { window.markerCtrl = markerScope.gMarker; window.handleClick(true); } if (!_this.validateCoords(newValue)) { return window.hideWindow(); } if (!angular.equals(newValue, oldValue)) { return window.getLatestPosition(_this.getCoords(newValue)); } }, true); } opts = hasScopeCoords ? this.createWindowOptions(gMarker, scope, element.html(), defaults) : defaults; if (mapCtrl != null) { window = new WindowChildModel({}, scope, opts, isIconVisibleOnClick, mapCtrl, gMarker, element); } scope.$on("$destroy", function() { return window != null ? window.destroy() : void 0; }); if ((this.onChildCreation != null) && (window != null)) { return this.onChildCreation(window); } }; return Window; })(IWindow); } ]); }).call(this); (function() { var __bind = function(fn, me){ return function(){ return fn.apply(me, arguments); }; }, __hasProp = {}.hasOwnProperty, __extends = function(child, parent) { for (var key in parent) { if (__hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; }; angular.module("google-maps.directives.api").factory("Windows", [ "IWindow", "WindowsParentModel", function(IWindow, WindowsParentModel) { /* Windows directive where many windows map to the models property */ var Windows; return Windows = (function(_super) { __extends(Windows, _super); function Windows($timeout, $compile, $http, $templateCache, $interpolate) { this.link = __bind(this.link, this); var self; Windows.__super__.constructor.call(this, $timeout, $compile, $http, $templateCache); self = this; this.$interpolate = $interpolate; this.require = ['^googleMap', '^?markers']; this.template = '<span class="angular-google-maps-windows" ng-transclude></span>'; this.scope.idKey = '=idkey'; this.scope.doRebuildAll = '=dorebuildall'; this.scope.models = '=models'; this.$log.info(this); } Windows.prototype.link = function(scope, element, attrs, ctrls) { return new WindowsParentModel(scope, element, attrs, ctrls, this.$timeout, this.$compile, this.$http, this.$templateCache, this.$interpolate); }; return Windows; })(IWindow); } ]); }).call(this); /* ! The MIT License Copyright (c) 2010-2013 Google, Inc. http://angularjs.org 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. angular-google-maps https://github.com/nlaplante/angular-google-maps @authors Nicolas Laplante - https://plus.google.com/108189012221374960701 Nicholas McCready - https://twitter.com/nmccready Nick Baugh - https://github.com/niftylettuce */ (function() { angular.module("google-maps").directive("googleMap", [ "Map", function(Map) { return new Map(); } ]); }).call(this); /* ! The MIT License Copyright (c) 2010-2013 Google, Inc. http://angularjs.org 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. angular-google-maps https://github.com/nlaplante/angular-google-maps @authors Nicolas Laplante - https://plus.google.com/108189012221374960701 Nicholas McCready - https://twitter.com/nmccready */ /* Map marker directive This directive is used to create a marker on an existing map. This directive creates a new scope. {attribute coords required} object containing latitude and longitude properties {attribute icon optional} string url to image used for marker icon {attribute animate optional} if set to false, the marker won't be animated (on by default) */ (function() { angular.module("google-maps").directive("marker", [ "$timeout", "Marker", function($timeout, Marker) { return new Marker($timeout); } ]); }).call(this); /* ! The MIT License Copyright (c) 2010-2013 Google, Inc. http://angularjs.org 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. angular-google-maps https://github.com/nlaplante/angular-google-maps @authors Nicolas Laplante - https://plus.google.com/108189012221374960701 Nicholas McCready - https://twitter.com/nmccready */ /* Map marker directive This directive is used to create a marker on an existing map. This directive creates a new scope. {attribute coords required} object containing latitude and longitude properties {attribute icon optional} string url to image used for marker icon {attribute animate optional} if set to false, the marker won't be animated (on by default) */ (function() { angular.module("google-maps").directive("markers", [ "$timeout", "Markers", function($timeout, Markers) { return new Markers($timeout); } ]); }).call(this); /* ! The MIT License Copyright (c) 2010-2013 Google, Inc. http://angularjs.org 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. angular-google-maps https://github.com/nlaplante/angular-google-maps @authors Bruno Queiroz, creativelikeadog@gmail.com */ /* Marker label directive This directive is used to create a marker label on an existing map. {attribute content required} content of the label {attribute anchor required} string that contains the x and y point position of the label {attribute class optional} class to DOM object {attribute style optional} style for the label */ /* Basic Directive api for a label. Basic in the sense that this directive contains 1:1 on scope and model. Thus there will be one html element per marker within the directive. */ (function() { var __bind = function(fn, me){ return function(){ return fn.apply(me, arguments); }; }, __hasProp = {}.hasOwnProperty, __extends = function(child, parent) { for (var key in parent) { if (__hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; }; angular.module("google-maps").directive("markerLabel", [ "$timeout", "ILabel", "MarkerLabelChildModel", "GmapUtil", "nggmap-PropertyAction", function($timeout, ILabel, MarkerLabelChildModel, GmapUtil, PropertyAction) { var Label; Label = (function(_super) { __extends(Label, _super); function Label($timeout) { this.init = __bind(this.init, this); this.link = __bind(this.link, this); var self; Label.__super__.constructor.call(this, $timeout); self = this; this.require = '^marker'; this.template = '<span class="angular-google-maps-marker-label" ng-transclude></span>'; this.$log.info(this); } Label.prototype.link = function(scope, element, attrs, ctrl) { var markerScope, _this = this; markerScope = ctrl.getScope(); if (markerScope) { return markerScope.deferred.promise.then(function() { return _this.init(markerScope, scope); }); } }; Label.prototype.init = function(markerScope, scope) { var createLabel, isFirstSet, label; label = null; createLabel = function() { if (!label) { return label = new MarkerLabelChildModel(markerScope.gMarker, scope, markerScope.map); } }; isFirstSet = true; return markerScope.$watch('gMarker', function(newVal, oldVal) { var anchorAction, classAction, contentAction, styleAction; if (markerScope.gMarker != null) { contentAction = new PropertyAction(function(newVal) { createLabel(); if (scope.labelContent) { return label != null ? label.setOption('labelContent', scope.labelContent) : void 0; } }, isFirstSet); anchorAction = new PropertyAction(function(newVal) { createLabel(); return label != null ? label.setOption('labelAnchor', scope.labelAnchor) : void 0; }, isFirstSet); classAction = new PropertyAction(function(newVal) { createLabel(); return label != null ? label.setOption('labelClass', scope.labelClass) : void 0; }, isFirstSet); styleAction = new PropertyAction(function(newVal) { createLabel(); return label != null ? label.setOption('labelStyle', scope.labelStyle) : void 0; }, isFirstSet); scope.$watch('labelContent', contentAction.sic); scope.$watch('labelAnchor', anchorAction.sic); scope.$watch('labelClass', classAction.sic); scope.$watch('labelStyle', styleAction.sic); isFirstSet = false; } return scope.$on('$destroy', function() { return label != null ? label.destroy() : void 0; }); }); }; return Label; })(ILabel); return new Label($timeout); } ]); }).call(this); /* ! The MIT License Copyright (c) 2010-2013 Google, Inc. http://angularjs.org 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. angular-google-maps https://github.com/nlaplante/angular-google-maps @authors Nicolas Laplante - https://plus.google.com/108189012221374960701 Nicholas McCready - https://twitter.com/nmccready Rick Huizinga - https://plus.google.com/+RickHuizinga */ (function() { angular.module("google-maps").directive("polygon", [ "$log", "$timeout", "array-sync", "GmapUtil", function($log, $timeout, arraySync, GmapUtil) { /* Check if a value is true */ var DEFAULTS, isTrue; isTrue = function(val) { return angular.isDefined(val) && val !== null && val === true || val === "1" || val === "y" || val === "true"; }; "use strict"; DEFAULTS = {}; return { restrict: "ECA", replace: true, require: "^googleMap", scope: { path: "=path", stroke: "=stroke", clickable: "=", draggable: "=", editable: "=", geodesic: "=", fill: "=", icons: "=icons", visible: "=", "static": "=", events: "=", zIndex: "=zindex", fit: "=" }, link: function(scope, element, attrs, mapCtrl) { var _this = this; if (angular.isUndefined(scope.path) || scope.path === null || !GmapUtil.validatePath(scope.path)) { $log.error("polygon: no valid path attribute found"); return; } return mapCtrl.getScope().deferred.promise.then(function(map) { var arraySyncer, buildOpts, eventName, getEventHandler, pathPoints, polygon; buildOpts = function(pathPoints) { var opts; opts = angular.extend({}, DEFAULTS, { map: map, path: pathPoints, strokeColor: scope.stroke && scope.stroke.color, strokeOpacity: scope.stroke && scope.stroke.opacity, strokeWeight: scope.stroke && scope.stroke.weight, fillColor: scope.fill && scope.fill.color, fillOpacity: scope.fill && scope.fill.opacity }); angular.forEach({ clickable: true, draggable: false, editable: false, geodesic: false, visible: true, "static": false, fit: false, zIndex: 0 }, function(defaultValue, key) { if (angular.isUndefined(scope[key]) || scope[key] === null) { return opts[key] = defaultValue; } else { return opts[key] = scope[key]; } }); if (opts["static"]) { opts.editable = false; } return opts; }; pathPoints = GmapUtil.convertPathPoints(scope.path); polygon = new google.maps.Polygon(buildOpts(pathPoints)); if (scope.fit) { GmapUtil.extendMapBounds(map, pathPoints); } if (!scope["static"] && angular.isDefined(scope.editable)) { scope.$watch("editable", function(newValue, oldValue) { if (newValue !== oldValue) { return polygon.setEditable(newValue); } }); } if (angular.isDefined(scope.draggable)) { scope.$watch("draggable", function(newValue, oldValue) { if (newValue !== oldValue) { return polygon.setDraggable(newValue); } }); } if (angular.isDefined(scope.visible)) { scope.$watch("visible", function(newValue, oldValue) { if (newValue !== oldValue) { return polygon.setVisible(newValue); } }); } if (angular.isDefined(scope.geodesic)) { scope.$watch("geodesic", function(newValue, oldValue) { if (newValue !== oldValue) { return polygon.setOptions(buildOpts(polygon.getPath())); } }); } if (angular.isDefined(scope.stroke) && angular.isDefined(scope.stroke.opacity)) { scope.$watch("stroke.opacity", function(newValue, oldValue) { return polygon.setOptions(buildOpts(polygon.getPath())); }); } if (angular.isDefined(scope.stroke) && angular.isDefined(scope.stroke.weight)) { scope.$watch("stroke.weight", function(newValue, oldValue) { if (newValue !== oldValue) { return polygon.setOptions(buildOpts(polygon.getPath())); } }); } if (angular.isDefined(scope.stroke) && angular.isDefined(scope.stroke.color)) { scope.$watch("stroke.color", function(newValue, oldValue) { if (newValue !== oldValue) { return polygon.setOptions(buildOpts(polygon.getPath())); } }); } if (angular.isDefined(scope.fill) && angular.isDefined(scope.fill.color)) { scope.$watch("fill.color", function(newValue, oldValue) { if (newValue !== oldValue) { return polygon.setOptions(buildOpts(polygon.getPath())); } }); } if (angular.isDefined(scope.fill) && angular.isDefined(scope.fill.opacity)) { scope.$watch("fill.opacity", function(newValue, oldValue) { if (newValue !== oldValue) { return polygon.setOptions(buildOpts(polygon.getPath())); } }); } if (angular.isDefined(scope.zIndex)) { scope.$watch("zIndex", function(newValue, oldValue) { if (newValue !== oldValue) { return polygon.setOptions(buildOpts(polygon.getPath())); } }); } if (angular.isDefined(scope.events) && scope.events !== null && angular.isObject(scope.events)) { getEventHandler = function(eventName) { return function() { return scope.events[eventName].apply(scope, [polygon, eventName, arguments]); }; }; for (eventName in scope.events) { if (scope.events.hasOwnProperty(eventName) && angular.isFunction(scope.events[eventName])) { polygon.addListener(eventName, getEventHandler(eventName)); } } } arraySyncer = arraySync(polygon.getPath(), scope, "path", function(pathPoints) { if (scope.fit) { return GmapUtil.extendMapBounds(map, pathPoints); } }); return scope.$on("$destroy", function() { polygon.setMap(null); if (arraySyncer) { arraySyncer(); return arraySyncer = null; } }); }); } }; } ]); }).call(this); /* ! The MIT License Copyright (c) 2010-2013 Google, Inc. http://angularjs.org 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. @authors Julian Popescu - https://github.com/jpopesculian Rick Huizinga - https://plus.google.com/+RickHuizinga */ (function() { angular.module("google-maps").directive("circle", [ "$log", "$timeout", "GmapUtil", "EventsHelper", function($log, $timeout, GmapUtil, EventsHelper) { "use strict"; var DEFAULTS; DEFAULTS = {}; return { restrict: "ECA", replace: true, require: "^googleMap", scope: { center: "=center", radius: "=radius", stroke: "=stroke", fill: "=fill", clickable: "=", draggable: "=", editable: "=", geodesic: "=", icons: "=icons", visible: "=", events: "=" }, link: function(scope, element, attrs, mapCtrl) { var _this = this; return mapCtrl.getScope().deferred.promise.then(function(map) { var buildOpts, circle; buildOpts = function() { var opts; if (!GmapUtil.validateCoords(scope.center)) { $log.error("circle: no valid center attribute found"); return; } opts = angular.extend({}, DEFAULTS, { map: map, center: GmapUtil.getCoords(scope.center), radius: scope.radius, strokeColor: scope.stroke && scope.stroke.color, strokeOpacity: scope.stroke && scope.stroke.opacity, strokeWeight: scope.stroke && scope.stroke.weight, fillColor: scope.fill && scope.fill.color, fillOpacity: scope.fill && scope.fill.opacity }); angular.forEach({ clickable: true, draggable: false, editable: false, geodesic: false, visible: true }, function(defaultValue, key) { if (angular.isUndefined(scope[key]) || scope[key] === null) { return opts[key] = defaultValue; } else { return opts[key] = scope[key]; } }); return opts; }; circle = new google.maps.Circle(buildOpts()); scope.$watchCollection('center', function(newVals, oldVals) { if (newVals !== oldVals) { return circle.setOptions(buildOpts()); } }); scope.$watchCollection('stroke', function(newVals, oldVals) { if (newVals !== oldVals) { return circle.setOptions(buildOpts()); } }); scope.$watchCollection('fill', function(newVals, oldVals) { if (newVals !== oldVals) { return circle.setOptions(buildOpts()); } }); scope.$watch('radius', function(newVal, oldVal) { if (newVal !== oldVal) { return circle.setOptions(buildOpts()); } }); scope.$watch('clickable', function(newVal, oldVal) { if (newVal !== oldVal) { return circle.setOptions(buildOpts()); } }); scope.$watch('editable', function(newVal, oldVal) { if (newVal !== oldVal) { return circle.setOptions(buildOpts()); } }); scope.$watch('draggable', function(newVal, oldVal) { if (newVal !== oldVal) { return circle.setOptions(buildOpts()); } }); scope.$watch('visible', function(newVal, oldVal) { if (newVal !== oldVal) { return circle.setOptions(buildOpts()); } }); scope.$watch('geodesic', function(newVal, oldVal) { if (newVal !== oldVal) { return circle.setOptions(buildOpts()); } }); EventsHelper.setEvents(circle, scope, scope); google.maps.event.addListener(circle, 'radius_changed', function() { scope.radius = circle.getRadius(); return $timeout(function() { return scope.$apply(); }); }); google.maps.event.addListener(circle, 'center_changed', function() { if (angular.isDefined(scope.center.type)) { scope.center.coordinates[1] = circle.getCenter().lat(); scope.center.coordinates[0] = circle.getCenter().lng(); } else { scope.center.latitude = circle.getCenter().lat(); scope.center.longitude = circle.getCenter().lng(); } return $timeout(function() { return scope.$apply(); }); }); return scope.$on("$destroy", function() { return circle.setMap(null); }); }); } }; } ]); }).call(this); /* ! The MIT License Copyright (c) 2010-2013 Google, Inc. http://angularjs.org 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. angular-google-maps https://github.com/nlaplante/angular-google-maps @authors Nicolas Laplante - https://plus.google.com/108189012221374960701 Nicholas McCready - https://twitter.com/nmccready */ (function() { angular.module("google-maps").directive("polyline", [ "Polyline", function(Polyline) { return new Polyline(); } ]); }).call(this); /* ! The MIT License Copyright (c) 2010-2013 Google, Inc. http://angularjs.org 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. angular-google-maps https://github.com/nlaplante/angular-google-maps @authors Nicolas Laplante - https://plus.google.com/108189012221374960701 Nicholas McCready - https://twitter.com/nmccready */ (function() { angular.module("google-maps").directive("polylines", [ "Polylines", function(Polylines) { return new Polylines(); } ]); }).call(this); /* ! The MIT License Copyright (c) 2010-2013 Google, Inc. http://angularjs.org 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. angular-google-maps https://github.com/nlaplante/angular-google-maps @authors Nicolas Laplante - https://plus.google.com/108189012221374960701 Nicholas McCready - https://twitter.com/nmccready Chentsu Lin - https://github.com/ChenTsuLin */ (function() { angular.module("google-maps").directive("rectangle", [ "$log", "$timeout", function($log, $timeout) { var DEFAULTS, convertBoundPoints, fitMapBounds, isTrue, validateBoundPoints; validateBoundPoints = function(bounds) { if (angular.isUndefined(bounds.sw.latitude) || angular.isUndefined(bounds.sw.longitude) || angular.isUndefined(bounds.ne.latitude) || angular.isUndefined(bounds.ne.longitude)) { return false; } return true; }; convertBoundPoints = function(bounds) { var result; result = new google.maps.LatLngBounds(new google.maps.LatLng(bounds.sw.latitude, bounds.sw.longitude), new google.maps.LatLng(bounds.ne.latitude, bounds.ne.longitude)); return result; }; fitMapBounds = function(map, bounds) { return map.fitBounds(bounds); }; /* Check if a value is true */ isTrue = function(val) { return angular.isDefined(val) && val !== null && val === true || val === "1" || val === "y" || val === "true"; }; "use strict"; DEFAULTS = {}; return { restrict: "ECA", require: "^googleMap", replace: true, scope: { bounds: "=", stroke: "=", clickable: "=", draggable: "=", editable: "=", fill: "=", visible: "=" }, link: function(scope, element, attrs, mapCtrl) { var _this = this; if (angular.isUndefined(scope.bounds) || scope.bounds === null || angular.isUndefined(scope.bounds.sw) || scope.bounds.sw === null || angular.isUndefined(scope.bounds.ne) || scope.bounds.ne === null || !validateBoundPoints(scope.bounds)) { $log.error("rectangle: no valid bound attribute found"); return; } return mapCtrl.getScope().deferred.promise.then(function(map) { var buildOpts, dragging, rectangle, settingBoundsFromScope; buildOpts = function(bounds) { var opts; opts = angular.extend({}, DEFAULTS, { map: map, bounds: bounds, strokeColor: scope.stroke && scope.stroke.color, strokeOpacity: scope.stroke && scope.stroke.opacity, strokeWeight: scope.stroke && scope.stroke.weight, fillColor: scope.fill && scope.fill.color, fillOpacity: scope.fill && scope.fill.opacity }); angular.forEach({ clickable: true, draggable: false, editable: false, visible: true }, function(defaultValue, key) { if (angular.isUndefined(scope[key]) || scope[key] === null) { return opts[key] = defaultValue; } else { return opts[key] = scope[key]; } }); return opts; }; rectangle = new google.maps.Rectangle(buildOpts(convertBoundPoints(scope.bounds))); if (isTrue(attrs.fit)) { fitMapBounds(map, bounds); } dragging = false; google.maps.event.addListener(rectangle, "mousedown", function() { google.maps.event.addListener(rectangle, "mousemove", function() { dragging = true; return _.defer(function() { return scope.$apply(function(s) { if (s.dragging != null) { return s.dragging = dragging; } }); }); }); google.maps.event.addListener(rectangle, "mouseup", function() { google.maps.event.clearListeners(rectangle, 'mousemove'); google.maps.event.clearListeners(rectangle, 'mouseup'); dragging = false; return _.defer(function() { return scope.$apply(function(s) { if (s.dragging != null) { return s.dragging = dragging; } }); }); }); }); settingBoundsFromScope = false; google.maps.event.addListener(rectangle, "bounds_changed", function() { var b, ne, sw; b = rectangle.getBounds(); ne = b.getNorthEast(); sw = b.getSouthWest(); if (settingBoundsFromScope) { return; } return _.defer(function() { return scope.$apply(function(s) { if (!rectangle.dragging) { if (s.bounds !== null && s.bounds !== undefined && s.bounds !== void 0) { s.bounds.ne = { latitude: ne.lat(), longitude: ne.lng() }; s.bounds.sw = { latitude: sw.lat(), longitude: sw.lng() }; } } }); }); }); scope.$watch("bounds", (function(newValue, oldValue) { var bounds; if (_.isEqual(newValue, oldValue)) { return; } settingBoundsFromScope = true; if (!dragging) { if ((newValue.sw.latitude == null) || (newValue.sw.longitude == null) || (newValue.ne.latitude == null) || (newValue.ne.longitude == null)) { $log.error("Invalid bounds for newValue: " + (JSON.stringify(newValue))); } bounds = new google.maps.LatLngBounds(new google.maps.LatLng(newValue.sw.latitude, newValue.sw.longitude), new google.maps.LatLng(newValue.ne.latitude, newValue.ne.longitude)); rectangle.setBounds(bounds); } return settingBoundsFromScope = false; }), true); if (angular.isDefined(scope.editable)) { scope.$watch("editable", function(newValue, oldValue) { return rectangle.setEditable(newValue); }); } if (angular.isDefined(scope.draggable)) { scope.$watch("draggable", function(newValue, oldValue) { return rectangle.setDraggable(newValue); }); } if (angular.isDefined(scope.visible)) { scope.$watch("visible", function(newValue, oldValue) { return rectangle.setVisible(newValue); }); } if (angular.isDefined(scope.stroke)) { if (angular.isDefined(scope.stroke.color)) { scope.$watch("stroke.color", function(newValue, oldValue) { return rectangle.setOptions(buildOpts(rectangle.getBounds())); }); } if (angular.isDefined(scope.stroke.weight)) { scope.$watch("stroke.weight", function(newValue, oldValue) { return rectangle.setOptions(buildOpts(rectangle.getBounds())); }); } if (angular.isDefined(scope.stroke.opacity)) { scope.$watch("stroke.opacity", function(newValue, oldValue) { return rectangle.setOptions(buildOpts(rectangle.getBounds())); }); } } if (angular.isDefined(scope.fill)) { if (angular.isDefined(scope.fill.color)) { scope.$watch("fill.color", function(newValue, oldValue) { return rectangle.setOptions(buildOpts(rectangle.getBounds())); }); } if (angular.isDefined(scope.fill.opacity)) { scope.$watch("fill.opacity", function(newValue, oldValue) { return rectangle.setOptions(buildOpts(rectangle.getBounds())); }); } } return scope.$on("$destroy", function() { return rectangle.setMap(null); }); }); } }; } ]); }).call(this); /* ! The MIT License Copyright (c) 2010-2013 Google, Inc. http://angularjs.org 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. angular-google-maps https://github.com/nlaplante/angular-google-maps @authors Nicolas Laplante - https://plus.google.com/108189012221374960701 Nicholas McCready - https://twitter.com/nmccready */ /* Map info window directive This directive is used to create an info window on an existing map. This directive creates a new scope. {attribute coords required} object containing latitude and longitude properties {attribute show optional} map will show when this expression returns true */ (function() { angular.module("google-maps").directive("window", [ "$timeout", "$compile", "$http", "$templateCache", "Window", function($timeout, $compile, $http, $templateCache, Window) { return new Window($timeout, $compile, $http, $templateCache); } ]); }).call(this); /* ! The MIT License Copyright (c) 2010-2013 Google, Inc. http://angularjs.org 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. angular-google-maps https://github.com/nlaplante/angular-google-maps @authors Nicolas Laplante - https://plus.google.com/108189012221374960701 Nicholas McCready - https://twitter.com/nmccready */ /* Map info window directive This directive is used to create an info window on an existing map. This directive creates a new scope. {attribute coords required} object containing latitude and longitude properties {attribute show optional} map will show when this expression returns true */ (function() { angular.module("google-maps").directive("windows", [ "$timeout", "$compile", "$http", "$templateCache", "$interpolate", "Windows", function($timeout, $compile, $http, $templateCache, $interpolate, Windows) { return new Windows($timeout, $compile, $http, $templateCache, $interpolate); } ]); }).call(this); /* ! The MIT License Copyright (c) 2010-2013 Google, Inc. http://angularjs.org 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. angular-google-maps https://github.com/nlaplante/angular-google-maps @authors: - Nicolas Laplante https://plus.google.com/108189012221374960701 - Nicholas McCready - https://twitter.com/nmccready */ /* Map Layer directive This directive is used to create any type of Layer from the google maps sdk. This directive creates a new scope. {attribute show optional} true (default) shows the trafficlayer otherwise it is hidden */ (function() { var __bind = function(fn, me){ return function(){ return fn.apply(me, arguments); }; }; angular.module("google-maps").directive("layer", [ "$timeout", "Logger", "LayerParentModel", function($timeout, Logger, LayerParentModel) { var Layer; Layer = (function() { function Layer() { this.link = __bind(this.link, this); this.$log = Logger; this.restrict = "ECMA"; this.require = "^googleMap"; this.priority = -1; this.transclude = true; this.template = '<span class=\"angular-google-map-layer\" ng-transclude></span>'; this.replace = true; this.scope = { show: "=show", type: "=type", namespace: "=namespace", options: '=options', onCreated: '&oncreated' }; } Layer.prototype.link = function(scope, element, attrs, mapCtrl) { var _this = this; return mapCtrl.getScope().deferred.promise.then(function(map) { if (scope.onCreated != null) { return new LayerParentModel(scope, element, attrs, map, scope.onCreated); } else { return new LayerParentModel(scope, element, attrs, map); } }); }; return Layer; })(); return new Layer(); } ]); }).call(this); ;/** * @name InfoBox * @version 1.1.12 [December 11, 2012] * @author Gary Little (inspired by proof-of-concept code from Pamela Fox of Google) * @copyright Copyright 2010 Gary Little [gary at luxcentral.com] * @fileoverview InfoBox extends the Google Maps JavaScript API V3 <tt>OverlayView</tt> class. * <p> * An InfoBox behaves like a <tt>google.maps.InfoWindow</tt>, but it supports several * additional properties for advanced styling. An InfoBox can also be used as a map label. * <p> * An InfoBox also fires the same events as a <tt>google.maps.InfoWindow</tt>. */ /*! * * 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 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /*jslint browser:true */ /*global google */ /** * @name InfoBoxOptions * @class This class represents the optional parameter passed to the {@link InfoBox} constructor. * @property {string|Node} content The content of the InfoBox (plain text or an HTML DOM node). * @property {boolean} [disableAutoPan=false] Disable auto-pan on <tt>open</tt>. * @property {number} maxWidth The maximum width (in pixels) of the InfoBox. Set to 0 if no maximum. * @property {Size} pixelOffset The offset (in pixels) from the top left corner of the InfoBox * (or the bottom left corner if the <code>alignBottom</code> property is <code>true</code>) * to the map pixel corresponding to <tt>position</tt>. * @property {LatLng} position The geographic location at which to display the InfoBox. * @property {number} zIndex The CSS z-index style value for the InfoBox. * Note: This value overrides a zIndex setting specified in the <tt>boxStyle</tt> property. * @property {string} [boxClass="infoBox"] The name of the CSS class defining the styles for the InfoBox container. * @property {Object} [boxStyle] An object literal whose properties define specific CSS * style values to be applied to the InfoBox. Style values defined here override those that may * be defined in the <code>boxClass</code> style sheet. If this property is changed after the * InfoBox has been created, all previously set styles (except those defined in the style sheet) * are removed from the InfoBox before the new style values are applied. * @property {string} closeBoxMargin The CSS margin style value for the close box. * The default is "2px" (a 2-pixel margin on all sides). * @property {string} closeBoxURL The URL of the image representing the close box. * Note: The default is the URL for Google's standard close box. * Set this property to "" if no close box is required. * @property {Size} infoBoxClearance Minimum offset (in pixels) from the InfoBox to the * map edge after an auto-pan. * @property {boolean} [isHidden=false] Hide the InfoBox on <tt>open</tt>. * [Deprecated in favor of the <tt>visible</tt> property.] * @property {boolean} [visible=true] Show the InfoBox on <tt>open</tt>. * @property {boolean} alignBottom Align the bottom left corner of the InfoBox to the <code>position</code> * location (default is <tt>false</tt> which means that the top left corner of the InfoBox is aligned). * @property {string} pane The pane where the InfoBox is to appear (default is "floatPane"). * Set the pane to "mapPane" if the InfoBox is being used as a map label. * Valid pane names are the property names for the <tt>google.maps.MapPanes</tt> object. * @property {boolean} enableEventPropagation Propagate mousedown, mousemove, mouseover, mouseout, * mouseup, click, dblclick, touchstart, touchend, touchmove, and contextmenu events in the InfoBox * (default is <tt>false</tt> to mimic the behavior of a <tt>google.maps.InfoWindow</tt>). Set * this property to <tt>true</tt> if the InfoBox is being used as a map label. */ /** * Creates an InfoBox with the options specified in {@link InfoBoxOptions}. * Call <tt>InfoBox.open</tt> to add the box to the map. * @constructor * @param {InfoBoxOptions} [opt_opts] */ function InfoBox(opt_opts) { opt_opts = opt_opts || {}; google.maps.OverlayView.apply(this, arguments); // Standard options (in common with google.maps.InfoWindow): // this.content_ = opt_opts.content || ""; this.disableAutoPan_ = opt_opts.disableAutoPan || false; this.maxWidth_ = opt_opts.maxWidth || 0; this.pixelOffset_ = opt_opts.pixelOffset || new google.maps.Size(0, 0); this.position_ = opt_opts.position || new google.maps.LatLng(0, 0); this.zIndex_ = opt_opts.zIndex || null; // Additional options (unique to InfoBox): // this.boxClass_ = opt_opts.boxClass || "infoBox"; this.boxStyle_ = opt_opts.boxStyle || {}; this.closeBoxMargin_ = opt_opts.closeBoxMargin || "2px"; this.closeBoxURL_ = opt_opts.closeBoxURL || "http://www.google.com/intl/en_us/mapfiles/close.gif"; if (opt_opts.closeBoxURL === "") { this.closeBoxURL_ = ""; } this.infoBoxClearance_ = opt_opts.infoBoxClearance || new google.maps.Size(1, 1); if (typeof opt_opts.visible === "undefined") { if (typeof opt_opts.isHidden === "undefined") { opt_opts.visible = true; } else { opt_opts.visible = !opt_opts.isHidden; } } this.isHidden_ = !opt_opts.visible; this.alignBottom_ = opt_opts.alignBottom || false; this.pane_ = opt_opts.pane || "floatPane"; this.enableEventPropagation_ = opt_opts.enableEventPropagation || false; this.div_ = null; this.closeListener_ = null; this.moveListener_ = null; this.contextListener_ = null; this.eventListeners_ = null; this.fixedWidthSet_ = null; } /* InfoBox extends OverlayView in the Google Maps API v3. */ InfoBox.prototype = new google.maps.OverlayView(); /** * Creates the DIV representing the InfoBox. * @private */ InfoBox.prototype.createInfoBoxDiv_ = function () { var i; var events; var bw; var me = this; // This handler prevents an event in the InfoBox from being passed on to the map. // var cancelHandler = function (e) { e.cancelBubble = true; if (e.stopPropagation) { e.stopPropagation(); } }; // This handler ignores the current event in the InfoBox and conditionally prevents // the event from being passed on to the map. It is used for the contextmenu event. // var ignoreHandler = function (e) { e.returnValue = false; if (e.preventDefault) { e.preventDefault(); } if (!me.enableEventPropagation_) { cancelHandler(e); } }; if (!this.div_) { this.div_ = document.createElement("div"); this.setBoxStyle_(); if (typeof this.content_.nodeType === "undefined") { this.div_.innerHTML = this.getCloseBoxImg_() + this.content_; } else { this.div_.innerHTML = this.getCloseBoxImg_(); this.div_.appendChild(this.content_); } // Add the InfoBox DIV to the DOM this.getPanes()[this.pane_].appendChild(this.div_); this.addClickHandler_(); if (this.div_.style.width) { this.fixedWidthSet_ = true; } else { if (this.maxWidth_ !== 0 && this.div_.offsetWidth > this.maxWidth_) { this.div_.style.width = this.maxWidth_; this.div_.style.overflow = "auto"; this.fixedWidthSet_ = true; } else { // The following code is needed to overcome problems with MSIE bw = this.getBoxWidths_(); this.div_.style.width = (this.div_.offsetWidth - bw.left - bw.right) + "px"; this.fixedWidthSet_ = false; } } this.panBox_(this.disableAutoPan_); if (!this.enableEventPropagation_) { this.eventListeners_ = []; // Cancel event propagation. // // Note: mousemove not included (to resolve Issue 152) events = ["mousedown", "mouseover", "mouseout", "mouseup", "click", "dblclick", "touchstart", "touchend", "touchmove"]; for (i = 0; i < events.length; i++) { this.eventListeners_.push(google.maps.event.addDomListener(this.div_, events[i], cancelHandler)); } // Workaround for Google bug that causes the cursor to change to a pointer // when the mouse moves over a marker underneath InfoBox. this.eventListeners_.push(google.maps.event.addDomListener(this.div_, "mouseover", function (e) { this.style.cursor = "default"; })); } this.contextListener_ = google.maps.event.addDomListener(this.div_, "contextmenu", ignoreHandler); /** * This event is fired when the DIV containing the InfoBox's content is attached to the DOM. * @name InfoBox#domready * @event */ google.maps.event.trigger(this, "domready"); } }; /** * Returns the HTML <IMG> tag for the close box. * @private */ InfoBox.prototype.getCloseBoxImg_ = function () { var img = ""; if (this.closeBoxURL_ !== "") { img = "<img"; img += " src='" + this.closeBoxURL_ + "'"; img += " align=right"; // Do this because Opera chokes on style='float: right;' img += " style='"; img += " position: relative;"; // Required by MSIE img += " cursor: pointer;"; img += " margin: " + this.closeBoxMargin_ + ";"; img += "'>"; } return img; }; /** * Adds the click handler to the InfoBox close box. * @private */ InfoBox.prototype.addClickHandler_ = function () { var closeBox; if (this.closeBoxURL_ !== "") { closeBox = this.div_.firstChild; this.closeListener_ = google.maps.event.addDomListener(closeBox, "click", this.getCloseClickHandler_()); } else { this.closeListener_ = null; } }; /** * Returns the function to call when the user clicks the close box of an InfoBox. * @private */ InfoBox.prototype.getCloseClickHandler_ = function () { var me = this; return function (e) { // 1.0.3 fix: Always prevent propagation of a close box click to the map: e.cancelBubble = true; if (e.stopPropagation) { e.stopPropagation(); } /** * This event is fired when the InfoBox's close box is clicked. * @name InfoBox#closeclick * @event */ google.maps.event.trigger(me, "closeclick"); me.close(); }; }; /** * Pans the map so that the InfoBox appears entirely within the map's visible area. * @private */ InfoBox.prototype.panBox_ = function (disablePan) { var map; var bounds; var xOffset = 0, yOffset = 0; if (!disablePan) { map = this.getMap(); if (map instanceof google.maps.Map) { // Only pan if attached to map, not panorama if (!map.getBounds().contains(this.position_)) { // Marker not in visible area of map, so set center // of map to the marker position first. map.setCenter(this.position_); } bounds = map.getBounds(); var mapDiv = map.getDiv(); var mapWidth = mapDiv.offsetWidth; var mapHeight = mapDiv.offsetHeight; var iwOffsetX = this.pixelOffset_.width; var iwOffsetY = this.pixelOffset_.height; var iwWidth = this.div_.offsetWidth; var iwHeight = this.div_.offsetHeight; var padX = this.infoBoxClearance_.width; var padY = this.infoBoxClearance_.height; var pixPosition = this.getProjection().fromLatLngToContainerPixel(this.position_); if (pixPosition.x < (-iwOffsetX + padX)) { xOffset = pixPosition.x + iwOffsetX - padX; } else if ((pixPosition.x + iwWidth + iwOffsetX + padX) > mapWidth) { xOffset = pixPosition.x + iwWidth + iwOffsetX + padX - mapWidth; } if (this.alignBottom_) { if (pixPosition.y < (-iwOffsetY + padY + iwHeight)) { yOffset = pixPosition.y + iwOffsetY - padY - iwHeight; } else if ((pixPosition.y + iwOffsetY + padY) > mapHeight) { yOffset = pixPosition.y + iwOffsetY + padY - mapHeight; } } else { if (pixPosition.y < (-iwOffsetY + padY)) { yOffset = pixPosition.y + iwOffsetY - padY; } else if ((pixPosition.y + iwHeight + iwOffsetY + padY) > mapHeight) { yOffset = pixPosition.y + iwHeight + iwOffsetY + padY - mapHeight; } } if (!(xOffset === 0 && yOffset === 0)) { // Move the map to the shifted center. // var c = map.getCenter(); map.panBy(xOffset, yOffset); } } } }; /** * Sets the style of the InfoBox by setting the style sheet and applying * other specific styles requested. * @private */ InfoBox.prototype.setBoxStyle_ = function () { var i, boxStyle; if (this.div_) { // Apply style values from the style sheet defined in the boxClass parameter: this.div_.className = this.boxClass_; // Clear existing inline style values: this.div_.style.cssText = ""; // Apply style values defined in the boxStyle parameter: boxStyle = this.boxStyle_; for (i in boxStyle) { if (boxStyle.hasOwnProperty(i)) { this.div_.style[i] = boxStyle[i]; } } // Fix up opacity style for benefit of MSIE: // if (typeof this.div_.style.opacity !== "undefined" && this.div_.style.opacity !== "") { this.div_.style.filter = "alpha(opacity=" + (this.div_.style.opacity * 100) + ")"; } // Apply required styles: // this.div_.style.position = "absolute"; this.div_.style.visibility = 'hidden'; if (this.zIndex_ !== null) { this.div_.style.zIndex = this.zIndex_; } } }; /** * Get the widths of the borders of the InfoBox. * @private * @return {Object} widths object (top, bottom left, right) */ InfoBox.prototype.getBoxWidths_ = function () { var computedStyle; var bw = {top: 0, bottom: 0, left: 0, right: 0}; var box = this.div_; if (document.defaultView && document.defaultView.getComputedStyle) { computedStyle = box.ownerDocument.defaultView.getComputedStyle(box, ""); if (computedStyle) { // The computed styles are always in pixel units (good!) bw.top = parseInt(computedStyle.borderTopWidth, 10) || 0; bw.bottom = parseInt(computedStyle.borderBottomWidth, 10) || 0; bw.left = parseInt(computedStyle.borderLeftWidth, 10) || 0; bw.right = parseInt(computedStyle.borderRightWidth, 10) || 0; } } else if (document.documentElement.currentStyle) { // MSIE if (box.currentStyle) { // The current styles may not be in pixel units, but assume they are (bad!) bw.top = parseInt(box.currentStyle.borderTopWidth, 10) || 0; bw.bottom = parseInt(box.currentStyle.borderBottomWidth, 10) || 0; bw.left = parseInt(box.currentStyle.borderLeftWidth, 10) || 0; bw.right = parseInt(box.currentStyle.borderRightWidth, 10) || 0; } } return bw; }; /** * Invoked when <tt>close</tt> is called. Do not call it directly. */ InfoBox.prototype.onRemove = function () { if (this.div_) { this.div_.parentNode.removeChild(this.div_); this.div_ = null; } }; /** * Draws the InfoBox based on the current map projection and zoom level. */ InfoBox.prototype.draw = function () { this.createInfoBoxDiv_(); var pixPosition = this.getProjection().fromLatLngToDivPixel(this.position_); this.div_.style.left = (pixPosition.x + this.pixelOffset_.width) + "px"; if (this.alignBottom_) { this.div_.style.bottom = -(pixPosition.y + this.pixelOffset_.height) + "px"; } else { this.div_.style.top = (pixPosition.y + this.pixelOffset_.height) + "px"; } if (this.isHidden_) { this.div_.style.visibility = 'hidden'; } else { this.div_.style.visibility = "visible"; } }; /** * Sets the options for the InfoBox. Note that changes to the <tt>maxWidth</tt>, * <tt>closeBoxMargin</tt>, <tt>closeBoxURL</tt>, and <tt>enableEventPropagation</tt> * properties have no affect until the current InfoBox is <tt>close</tt>d and a new one * is <tt>open</tt>ed. * @param {InfoBoxOptions} opt_opts */ InfoBox.prototype.setOptions = function (opt_opts) { if (typeof opt_opts.boxClass !== "undefined") { // Must be first this.boxClass_ = opt_opts.boxClass; this.setBoxStyle_(); } if (typeof opt_opts.boxStyle !== "undefined") { // Must be second this.boxStyle_ = opt_opts.boxStyle; this.setBoxStyle_(); } if (typeof opt_opts.content !== "undefined") { this.setContent(opt_opts.content); } if (typeof opt_opts.disableAutoPan !== "undefined") { this.disableAutoPan_ = opt_opts.disableAutoPan; } if (typeof opt_opts.maxWidth !== "undefined") { this.maxWidth_ = opt_opts.maxWidth; } if (typeof opt_opts.pixelOffset !== "undefined") { this.pixelOffset_ = opt_opts.pixelOffset; } if (typeof opt_opts.alignBottom !== "undefined") { this.alignBottom_ = opt_opts.alignBottom; } if (typeof opt_opts.position !== "undefined") { this.setPosition(opt_opts.position); } if (typeof opt_opts.zIndex !== "undefined") { this.setZIndex(opt_opts.zIndex); } if (typeof opt_opts.closeBoxMargin !== "undefined") { this.closeBoxMargin_ = opt_opts.closeBoxMargin; } if (typeof opt_opts.closeBoxURL !== "undefined") { this.closeBoxURL_ = opt_opts.closeBoxURL; } if (typeof opt_opts.infoBoxClearance !== "undefined") { this.infoBoxClearance_ = opt_opts.infoBoxClearance; } if (typeof opt_opts.isHidden !== "undefined") { this.isHidden_ = opt_opts.isHidden; } if (typeof opt_opts.visible !== "undefined") { this.isHidden_ = !opt_opts.visible; } if (typeof opt_opts.enableEventPropagation !== "undefined") { this.enableEventPropagation_ = opt_opts.enableEventPropagation; } if (this.div_) { this.draw(); } }; /** * Sets the content of the InfoBox. * The content can be plain text or an HTML DOM node. * @param {string|Node} content */ InfoBox.prototype.setContent = function (content) { this.content_ = content; if (this.div_) { if (this.closeListener_) { google.maps.event.removeListener(this.closeListener_); this.closeListener_ = null; } // Odd code required to make things work with MSIE. // if (!this.fixedWidthSet_) { this.div_.style.width = ""; } if (typeof content.nodeType === "undefined") { this.div_.innerHTML = this.getCloseBoxImg_() + content; } else { this.div_.innerHTML = this.getCloseBoxImg_(); this.div_.appendChild(content); } // Perverse code required to make things work with MSIE. // (Ensures the close box does, in fact, float to the right.) // if (!this.fixedWidthSet_) { this.div_.style.width = this.div_.offsetWidth + "px"; if (typeof content.nodeType === "undefined") { this.div_.innerHTML = this.getCloseBoxImg_() + content; } else { this.div_.innerHTML = this.getCloseBoxImg_(); this.div_.appendChild(content); } } this.addClickHandler_(); } /** * This event is fired when the content of the InfoBox changes. * @name InfoBox#content_changed * @event */ google.maps.event.trigger(this, "content_changed"); }; /** * Sets the geographic location of the InfoBox. * @param {LatLng} latlng */ InfoBox.prototype.setPosition = function (latlng) { this.position_ = latlng; if (this.div_) { this.draw(); } /** * This event is fired when the position of the InfoBox changes. * @name InfoBox#position_changed * @event */ google.maps.event.trigger(this, "position_changed"); }; /** * Sets the zIndex style for the InfoBox. * @param {number} index */ InfoBox.prototype.setZIndex = function (index) { this.zIndex_ = index; if (this.div_) { this.div_.style.zIndex = index; } /** * This event is fired when the zIndex of the InfoBox changes. * @name InfoBox#zindex_changed * @event */ google.maps.event.trigger(this, "zindex_changed"); }; /** * Sets the visibility of the InfoBox. * @param {boolean} isVisible */ InfoBox.prototype.setVisible = function (isVisible) { this.isHidden_ = !isVisible; if (this.div_) { this.div_.style.visibility = (this.isHidden_ ? "hidden" : "visible"); } }; /** * Returns the content of the InfoBox. * @returns {string} */ InfoBox.prototype.getContent = function () { return this.content_; }; /** * Returns the geographic location of the InfoBox. * @returns {LatLng} */ InfoBox.prototype.getPosition = function () { return this.position_; }; /** * Returns the zIndex for the InfoBox. * @returns {number} */ InfoBox.prototype.getZIndex = function () { return this.zIndex_; }; /** * Returns a flag indicating whether the InfoBox is visible. * @returns {boolean} */ InfoBox.prototype.getVisible = function () { var isVisible; if ((typeof this.getMap() === "undefined") || (this.getMap() === null)) { isVisible = false; } else { isVisible = !this.isHidden_; } return isVisible; }; /** * Shows the InfoBox. [Deprecated; use <tt>setVisible</tt> instead.] */ InfoBox.prototype.show = function () { this.isHidden_ = false; if (this.div_) { this.div_.style.visibility = "visible"; } }; /** * Hides the InfoBox. [Deprecated; use <tt>setVisible</tt> instead.] */ InfoBox.prototype.hide = function () { this.isHidden_ = true; if (this.div_) { this.div_.style.visibility = "hidden"; } }; /** * Adds the InfoBox to the specified map or Street View panorama. If <tt>anchor</tt> * (usually a <tt>google.maps.Marker</tt>) is specified, the position * of the InfoBox is set to the position of the <tt>anchor</tt>. If the * anchor is dragged to a new location, the InfoBox moves as well. * @param {Map|StreetViewPanorama} map * @param {MVCObject} [anchor] */ InfoBox.prototype.open = function (map, anchor) { var me = this; if (anchor) { this.position_ = anchor.getPosition(); this.moveListener_ = google.maps.event.addListener(anchor, "position_changed", function () { me.setPosition(this.getPosition()); }); } this.setMap(map); if (this.div_) { this.panBox_(); } }; /** * Removes the InfoBox from the map. */ InfoBox.prototype.close = function () { var i; if (this.closeListener_) { google.maps.event.removeListener(this.closeListener_); this.closeListener_ = null; } if (this.eventListeners_) { for (i = 0; i < this.eventListeners_.length; i++) { google.maps.event.removeListener(this.eventListeners_[i]); } this.eventListeners_ = null; } if (this.moveListener_) { google.maps.event.removeListener(this.moveListener_); this.moveListener_ = null; } if (this.contextListener_) { google.maps.event.removeListener(this.contextListener_); this.contextListener_ = null; } this.setMap(null); };;/** * @name MarkerClustererPlus for Google Maps V3 * @version 2.1.1 [November 4, 2013] * @author Gary Little * @fileoverview * The library creates and manages per-zoom-level clusters for large amounts of markers. * <p> * This is an enhanced V3 implementation of the * <a href="http://gmaps-utility-library-dev.googlecode.com/svn/tags/markerclusterer/" * >V2 MarkerClusterer</a> by Xiaoxi Wu. It is based on the * <a href="http://google-maps-utility-library-v3.googlecode.com/svn/tags/markerclusterer/" * >V3 MarkerClusterer</a> port by Luke Mahe. MarkerClustererPlus was created by Gary Little. * <p> * v2.0 release: MarkerClustererPlus v2.0 is backward compatible with MarkerClusterer v1.0. It * adds support for the <code>ignoreHidden</code>, <code>title</code>, <code>batchSizeIE</code>, * and <code>calculator</code> properties as well as support for four more events. It also allows * greater control over the styling of the text that appears on the cluster marker. The * documentation has been significantly improved and the overall code has been simplified and * polished. Very large numbers of markers can now be managed without causing Javascript timeout * errors on Internet Explorer. Note that the name of the <code>clusterclick</code> event has been * deprecated. The new name is <code>click</code>, so please change your application code now. */ /** * 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 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /** * @name ClusterIconStyle * @class This class represents the object for values in the <code>styles</code> array passed * to the {@link MarkerClusterer} constructor. The element in this array that is used to * style the cluster icon is determined by calling the <code>calculator</code> function. * * @property {string} url The URL of the cluster icon image file. Required. * @property {number} height The display height (in pixels) of the cluster icon. Required. * @property {number} width The display width (in pixels) of the cluster icon. Required. * @property {Array} [anchorText] The position (in pixels) from the center of the cluster icon to * where the text label is to be centered and drawn. The format is <code>[yoffset, xoffset]</code> * where <code>yoffset</code> increases as you go down from center and <code>xoffset</code> * increases to the right of center. The default is <code>[0, 0]</code>. * @property {Array} [anchorIcon] The anchor position (in pixels) of the cluster icon. This is the * spot on the cluster icon that is to be aligned with the cluster position. The format is * <code>[yoffset, xoffset]</code> where <code>yoffset</code> increases as you go down and * <code>xoffset</code> increases to the right of the top-left corner of the icon. The default * anchor position is the center of the cluster icon. * @property {string} [textColor="black"] The color of the label text shown on the * cluster icon. * @property {number} [textSize=11] The size (in pixels) of the label text shown on the * cluster icon. * @property {string} [textDecoration="none"] The value of the CSS <code>text-decoration</code> * property for the label text shown on the cluster icon. * @property {string} [fontWeight="bold"] The value of the CSS <code>font-weight</code> * property for the label text shown on the cluster icon. * @property {string} [fontStyle="normal"] The value of the CSS <code>font-style</code> * property for the label text shown on the cluster icon. * @property {string} [fontFamily="Arial,sans-serif"] The value of the CSS <code>font-family</code> * property for the label text shown on the cluster icon. * @property {string} [backgroundPosition="0 0"] The position of the cluster icon image * within the image defined by <code>url</code>. The format is <code>"xpos ypos"</code> * (the same format as for the CSS <code>background-position</code> property). You must set * this property appropriately when the image defined by <code>url</code> represents a sprite * containing multiple images. Note that the position <i>must</i> be specified in px units. */ /** * @name ClusterIconInfo * @class This class is an object containing general information about a cluster icon. This is * the object that a <code>calculator</code> function returns. * * @property {string} text The text of the label to be shown on the cluster icon. * @property {number} index The index plus 1 of the element in the <code>styles</code> * array to be used to style the cluster icon. * @property {string} title The tooltip to display when the mouse moves over the cluster icon. * If this value is <code>undefined</code> or <code>""</code>, <code>title</code> is set to the * value of the <code>title</code> property passed to the MarkerClusterer. */ /** * A cluster icon. * * @constructor * @extends google.maps.OverlayView * @param {Cluster} cluster The cluster with which the icon is to be associated. * @param {Array} [styles] An array of {@link ClusterIconStyle} defining the cluster icons * to use for various cluster sizes. * @private */ function ClusterIcon(cluster, styles) { cluster.getMarkerClusterer().extend(ClusterIcon, google.maps.OverlayView); this.cluster_ = cluster; this.className_ = cluster.getMarkerClusterer().getClusterClass(); this.styles_ = styles; this.center_ = null; this.div_ = null; this.sums_ = null; this.visible_ = false; this.setMap(cluster.getMap()); // Note: this causes onAdd to be called } /** * Adds the icon to the DOM. */ ClusterIcon.prototype.onAdd = function () { var cClusterIcon = this; var cMouseDownInCluster; var cDraggingMapByCluster; this.div_ = document.createElement("div"); this.div_.className = this.className_; if (this.visible_) { this.show(); } this.getPanes().overlayMouseTarget.appendChild(this.div_); // Fix for Issue 157 this.boundsChangedListener_ = google.maps.event.addListener(this.getMap(), "bounds_changed", function () { cDraggingMapByCluster = cMouseDownInCluster; }); google.maps.event.addDomListener(this.div_, "mousedown", function () { cMouseDownInCluster = true; cDraggingMapByCluster = false; }); google.maps.event.addDomListener(this.div_, "click", function (e) { cMouseDownInCluster = false; if (!cDraggingMapByCluster) { var theBounds; var mz; var mc = cClusterIcon.cluster_.getMarkerClusterer(); /** * This event is fired when a cluster marker is clicked. * @name MarkerClusterer#click * @param {Cluster} c The cluster that was clicked. * @event */ google.maps.event.trigger(mc, "click", cClusterIcon.cluster_); google.maps.event.trigger(mc, "clusterclick", cClusterIcon.cluster_); // deprecated name // The default click handler follows. Disable it by setting // the zoomOnClick property to false. if (mc.getZoomOnClick()) { // Zoom into the cluster. mz = mc.getMaxZoom(); theBounds = cClusterIcon.cluster_.getBounds(); mc.getMap().fitBounds(theBounds); // There is a fix for Issue 170 here: setTimeout(function () { mc.getMap().fitBounds(theBounds); // Don't zoom beyond the max zoom level if (mz !== null && (mc.getMap().getZoom() > mz)) { mc.getMap().setZoom(mz + 1); } }, 100); } // Prevent event propagation to the map: e.cancelBubble = true; if (e.stopPropagation) { e.stopPropagation(); } } }); google.maps.event.addDomListener(this.div_, "mouseover", function () { var mc = cClusterIcon.cluster_.getMarkerClusterer(); /** * This event is fired when the mouse moves over a cluster marker. * @name MarkerClusterer#mouseover * @param {Cluster} c The cluster that the mouse moved over. * @event */ google.maps.event.trigger(mc, "mouseover", cClusterIcon.cluster_); }); google.maps.event.addDomListener(this.div_, "mouseout", function () { var mc = cClusterIcon.cluster_.getMarkerClusterer(); /** * This event is fired when the mouse moves out of a cluster marker. * @name MarkerClusterer#mouseout * @param {Cluster} c The cluster that the mouse moved out of. * @event */ google.maps.event.trigger(mc, "mouseout", cClusterIcon.cluster_); }); }; /** * Removes the icon from the DOM. */ ClusterIcon.prototype.onRemove = function () { if (this.div_ && this.div_.parentNode) { this.hide(); google.maps.event.removeListener(this.boundsChangedListener_); google.maps.event.clearInstanceListeners(this.div_); this.div_.parentNode.removeChild(this.div_); this.div_ = null; } }; /** * Draws the icon. */ ClusterIcon.prototype.draw = function () { if (this.visible_) { var pos = this.getPosFromLatLng_(this.center_); this.div_.style.top = pos.y + "px"; this.div_.style.left = pos.x + "px"; } }; /** * Hides the icon. */ ClusterIcon.prototype.hide = function () { if (this.div_) { this.div_.style.display = "none"; } this.visible_ = false; }; /** * Positions and shows the icon. */ ClusterIcon.prototype.show = function () { if (this.div_) { var img = ""; // NOTE: values must be specified in px units var bp = this.backgroundPosition_.split(" "); var spriteH = parseInt(bp[0].trim(), 10); var spriteV = parseInt(bp[1].trim(), 10); var pos = this.getPosFromLatLng_(this.center_); this.div_.style.cssText = this.createCss(pos); img = "<img src='" + this.url_ + "' style='position: absolute; top: " + spriteV + "px; left: " + spriteH + "px; "; if (!this.cluster_.getMarkerClusterer().enableRetinaIcons_) { img += "clip: rect(" + (-1 * spriteV) + "px, " + ((-1 * spriteH) + this.width_) + "px, " + ((-1 * spriteV) + this.height_) + "px, " + (-1 * spriteH) + "px);"; } img += "'>"; this.div_.innerHTML = img + "<div style='" + "position: absolute;" + "top: " + this.anchorText_[0] + "px;" + "left: " + this.anchorText_[1] + "px;" + "color: " + this.textColor_ + ";" + "font-size: " + this.textSize_ + "px;" + "font-family: " + this.fontFamily_ + ";" + "font-weight: " + this.fontWeight_ + ";" + "font-style: " + this.fontStyle_ + ";" + "text-decoration: " + this.textDecoration_ + ";" + "text-align: center;" + "width: " + this.width_ + "px;" + "line-height:" + this.height_ + "px;" + "'>" + this.sums_.text + "</div>"; if (typeof this.sums_.title === "undefined" || this.sums_.title === "") { this.div_.title = this.cluster_.getMarkerClusterer().getTitle(); } else { this.div_.title = this.sums_.title; } this.div_.style.display = ""; } this.visible_ = true; }; /** * Sets the icon styles to the appropriate element in the styles array. * * @param {ClusterIconInfo} sums The icon label text and styles index. */ ClusterIcon.prototype.useStyle = function (sums) { this.sums_ = sums; var index = Math.max(0, sums.index - 1); index = Math.min(this.styles_.length - 1, index); var style = this.styles_[index]; this.url_ = style.url; this.height_ = style.height; this.width_ = style.width; this.anchorText_ = style.anchorText || [0, 0]; this.anchorIcon_ = style.anchorIcon || [parseInt(this.height_ / 2, 10), parseInt(this.width_ / 2, 10)]; this.textColor_ = style.textColor || "black"; this.textSize_ = style.textSize || 11; this.textDecoration_ = style.textDecoration || "none"; this.fontWeight_ = style.fontWeight || "bold"; this.fontStyle_ = style.fontStyle || "normal"; this.fontFamily_ = style.fontFamily || "Arial,sans-serif"; this.backgroundPosition_ = style.backgroundPosition || "0 0"; }; /** * Sets the position at which to center the icon. * * @param {google.maps.LatLng} center The latlng to set as the center. */ ClusterIcon.prototype.setCenter = function (center) { this.center_ = center; }; /** * Creates the cssText style parameter based on the position of the icon. * * @param {google.maps.Point} pos The position of the icon. * @return {string} The CSS style text. */ ClusterIcon.prototype.createCss = function (pos) { var style = []; style.push("cursor: pointer;"); style.push("position: absolute; top: " + pos.y + "px; left: " + pos.x + "px;"); style.push("width: " + this.width_ + "px; height: " + this.height_ + "px;"); return style.join(""); }; /** * Returns the position at which to place the DIV depending on the latlng. * * @param {google.maps.LatLng} latlng The position in latlng. * @return {google.maps.Point} The position in pixels. */ ClusterIcon.prototype.getPosFromLatLng_ = function (latlng) { var pos = this.getProjection().fromLatLngToDivPixel(latlng); pos.x -= this.anchorIcon_[1]; pos.y -= this.anchorIcon_[0]; pos.x = parseInt(pos.x, 10); pos.y = parseInt(pos.y, 10); return pos; }; /** * Creates a single cluster that manages a group of proximate markers. * Used internally, do not call this constructor directly. * @constructor * @param {MarkerClusterer} mc The <code>MarkerClusterer</code> object with which this * cluster is associated. */ function Cluster(mc) { this.markerClusterer_ = mc; this.map_ = mc.getMap(); this.gridSize_ = mc.getGridSize(); this.minClusterSize_ = mc.getMinimumClusterSize(); this.averageCenter_ = mc.getAverageCenter(); this.markers_ = []; this.center_ = null; this.bounds_ = null; this.clusterIcon_ = new ClusterIcon(this, mc.getStyles()); } /** * Returns the number of markers managed by the cluster. You can call this from * a <code>click</code>, <code>mouseover</code>, or <code>mouseout</code> event handler * for the <code>MarkerClusterer</code> object. * * @return {number} The number of markers in the cluster. */ Cluster.prototype.getSize = function () { return this.markers_.length; }; /** * Returns the array of markers managed by the cluster. You can call this from * a <code>click</code>, <code>mouseover</code>, or <code>mouseout</code> event handler * for the <code>MarkerClusterer</code> object. * * @return {Array} The array of markers in the cluster. */ Cluster.prototype.getMarkers = function () { return this.markers_; }; /** * Returns the center of the cluster. You can call this from * a <code>click</code>, <code>mouseover</code>, or <code>mouseout</code> event handler * for the <code>MarkerClusterer</code> object. * * @return {google.maps.LatLng} The center of the cluster. */ Cluster.prototype.getCenter = function () { return this.center_; }; /** * Returns the map with which the cluster is associated. * * @return {google.maps.Map} The map. * @ignore */ Cluster.prototype.getMap = function () { return this.map_; }; /** * Returns the <code>MarkerClusterer</code> object with which the cluster is associated. * * @return {MarkerClusterer} The associated marker clusterer. * @ignore */ Cluster.prototype.getMarkerClusterer = function () { return this.markerClusterer_; }; /** * Returns the bounds of the cluster. * * @return {google.maps.LatLngBounds} the cluster bounds. * @ignore */ Cluster.prototype.getBounds = function () { var i; var bounds = new google.maps.LatLngBounds(this.center_, this.center_); var markers = this.getMarkers(); for (i = 0; i < markers.length; i++) { bounds.extend(markers[i].getPosition()); } return bounds; }; /** * Removes the cluster from the map. * * @ignore */ Cluster.prototype.remove = function () { this.clusterIcon_.setMap(null); this.markers_ = []; delete this.markers_; }; /** * Adds a marker to the cluster. * * @param {google.maps.Marker} marker The marker to be added. * @return {boolean} True if the marker was added. * @ignore */ Cluster.prototype.addMarker = function (marker) { var i; var mCount; var mz; if (this.isMarkerAlreadyAdded_(marker)) { return false; } if (!this.center_) { this.center_ = marker.getPosition(); this.calculateBounds_(); } else { if (this.averageCenter_) { var l = this.markers_.length + 1; var lat = (this.center_.lat() * (l - 1) + marker.getPosition().lat()) / l; var lng = (this.center_.lng() * (l - 1) + marker.getPosition().lng()) / l; this.center_ = new google.maps.LatLng(lat, lng); this.calculateBounds_(); } } marker.isAdded = true; this.markers_.push(marker); mCount = this.markers_.length; mz = this.markerClusterer_.getMaxZoom(); if (mz !== null && this.map_.getZoom() > mz) { // Zoomed in past max zoom, so show the marker. if (marker.getMap() !== this.map_) { marker.setMap(this.map_); } } else if (mCount < this.minClusterSize_) { // Min cluster size not reached so show the marker. if (marker.getMap() !== this.map_) { marker.setMap(this.map_); } } else if (mCount === this.minClusterSize_) { // Hide the markers that were showing. for (i = 0; i < mCount; i++) { this.markers_[i].setMap(null); } } else { marker.setMap(null); } this.updateIcon_(); return true; }; /** * Determines if a marker lies within the cluster's bounds. * * @param {google.maps.Marker} marker The marker to check. * @return {boolean} True if the marker lies in the bounds. * @ignore */ Cluster.prototype.isMarkerInClusterBounds = function (marker) { return this.bounds_.contains(marker.getPosition()); }; /** * Calculates the extended bounds of the cluster with the grid. */ Cluster.prototype.calculateBounds_ = function () { var bounds = new google.maps.LatLngBounds(this.center_, this.center_); this.bounds_ = this.markerClusterer_.getExtendedBounds(bounds); }; /** * Updates the cluster icon. */ Cluster.prototype.updateIcon_ = function () { var mCount = this.markers_.length; var mz = this.markerClusterer_.getMaxZoom(); if (mz !== null && this.map_.getZoom() > mz) { this.clusterIcon_.hide(); return; } if (mCount < this.minClusterSize_) { // Min cluster size not yet reached. this.clusterIcon_.hide(); return; } var numStyles = this.markerClusterer_.getStyles().length; var sums = this.markerClusterer_.getCalculator()(this.markers_, numStyles); this.clusterIcon_.setCenter(this.center_); this.clusterIcon_.useStyle(sums); this.clusterIcon_.show(); }; /** * Determines if a marker has already been added to the cluster. * * @param {google.maps.Marker} marker The marker to check. * @return {boolean} True if the marker has already been added. */ Cluster.prototype.isMarkerAlreadyAdded_ = function (marker) { var i; if (this.markers_.indexOf) { return this.markers_.indexOf(marker) !== -1; } else { for (i = 0; i < this.markers_.length; i++) { if (marker === this.markers_[i]) { return true; } } } return false; }; /** * @name MarkerClustererOptions * @class This class represents the optional parameter passed to * the {@link MarkerClusterer} constructor. * @property {number} [gridSize=60] The grid size of a cluster in pixels. The grid is a square. * @property {number} [maxZoom=null] The maximum zoom level at which clustering is enabled or * <code>null</code> if clustering is to be enabled at all zoom levels. * @property {boolean} [zoomOnClick=true] Whether to zoom the map when a cluster marker is * clicked. You may want to set this to <code>false</code> if you have installed a handler * for the <code>click</code> event and it deals with zooming on its own. * @property {boolean} [averageCenter=false] Whether the position of a cluster marker should be * the average position of all markers in the cluster. If set to <code>false</code>, the * cluster marker is positioned at the location of the first marker added to the cluster. * @property {number} [minimumClusterSize=2] The minimum number of markers needed in a cluster * before the markers are hidden and a cluster marker appears. * @property {boolean} [ignoreHidden=false] Whether to ignore hidden markers in clusters. You * may want to set this to <code>true</code> to ensure that hidden markers are not included * in the marker count that appears on a cluster marker (this count is the value of the * <code>text</code> property of the result returned by the default <code>calculator</code>). * If set to <code>true</code> and you change the visibility of a marker being clustered, be * sure to also call <code>MarkerClusterer.repaint()</code>. * @property {string} [title=""] The tooltip to display when the mouse moves over a cluster * marker. (Alternatively, you can use a custom <code>calculator</code> function to specify a * different tooltip for each cluster marker.) * @property {function} [calculator=MarkerClusterer.CALCULATOR] The function used to determine * the text to be displayed on a cluster marker and the index indicating which style to use * for the cluster marker. The input parameters for the function are (1) the array of markers * represented by a cluster marker and (2) the number of cluster icon styles. It returns a * {@link ClusterIconInfo} object. The default <code>calculator</code> returns a * <code>text</code> property which is the number of markers in the cluster and an * <code>index</code> property which is one higher than the lowest integer such that * <code>10^i</code> exceeds the number of markers in the cluster, or the size of the styles * array, whichever is less. The <code>styles</code> array element used has an index of * <code>index</code> minus 1. For example, the default <code>calculator</code> returns a * <code>text</code> value of <code>"125"</code> and an <code>index</code> of <code>3</code> * for a cluster icon representing 125 markers so the element used in the <code>styles</code> * array is <code>2</code>. A <code>calculator</code> may also return a <code>title</code> * property that contains the text of the tooltip to be used for the cluster marker. If * <code>title</code> is not defined, the tooltip is set to the value of the <code>title</code> * property for the MarkerClusterer. * @property {string} [clusterClass="cluster"] The name of the CSS class defining general styles * for the cluster markers. Use this class to define CSS styles that are not set up by the code * that processes the <code>styles</code> array. * @property {Array} [styles] An array of {@link ClusterIconStyle} elements defining the styles * of the cluster markers to be used. The element to be used to style a given cluster marker * is determined by the function defined by the <code>calculator</code> property. * The default is an array of {@link ClusterIconStyle} elements whose properties are derived * from the values for <code>imagePath</code>, <code>imageExtension</code>, and * <code>imageSizes</code>. * @property {boolean} [enableRetinaIcons=false] Whether to allow the use of cluster icons that * have sizes that are some multiple (typically double) of their actual display size. Icons such * as these look better when viewed on high-resolution monitors such as Apple's Retina displays. * Note: if this property is <code>true</code>, sprites cannot be used as cluster icons. * @property {number} [batchSize=MarkerClusterer.BATCH_SIZE] Set this property to the * number of markers to be processed in a single batch when using a browser other than * Internet Explorer (for Internet Explorer, use the batchSizeIE property instead). * @property {number} [batchSizeIE=MarkerClusterer.BATCH_SIZE_IE] When Internet Explorer is * being used, markers are processed in several batches with a small delay inserted between * each batch in an attempt to avoid Javascript timeout errors. Set this property to the * number of markers to be processed in a single batch; select as high a number as you can * without causing a timeout error in the browser. This number might need to be as low as 100 * if 15,000 markers are being managed, for example. * @property {string} [imagePath=MarkerClusterer.IMAGE_PATH] * The full URL of the root name of the group of image files to use for cluster icons. * The complete file name is of the form <code>imagePath</code>n.<code>imageExtension</code> * where n is the image file number (1, 2, etc.). * @property {string} [imageExtension=MarkerClusterer.IMAGE_EXTENSION] * The extension name for the cluster icon image files (e.g., <code>"png"</code> or * <code>"jpg"</code>). * @property {Array} [imageSizes=MarkerClusterer.IMAGE_SIZES] * An array of numbers containing the widths of the group of * <code>imagePath</code>n.<code>imageExtension</code> image files. * (The images are assumed to be square.) */ /** * Creates a MarkerClusterer object with the options specified in {@link MarkerClustererOptions}. * @constructor * @extends google.maps.OverlayView * @param {google.maps.Map} map The Google map to attach to. * @param {Array.<google.maps.Marker>} [opt_markers] The markers to be added to the cluster. * @param {MarkerClustererOptions} [opt_options] The optional parameters. */ function MarkerClusterer(map, opt_markers, opt_options) { // MarkerClusterer implements google.maps.OverlayView interface. We use the // extend function to extend MarkerClusterer with google.maps.OverlayView // because it might not always be available when the code is defined so we // look for it at the last possible moment. If it doesn't exist now then // there is no point going ahead :) this.extend(MarkerClusterer, google.maps.OverlayView); opt_markers = opt_markers || []; opt_options = opt_options || {}; this.markers_ = []; this.clusters_ = []; this.listeners_ = []; this.activeMap_ = null; this.ready_ = false; this.gridSize_ = opt_options.gridSize || 60; this.minClusterSize_ = opt_options.minimumClusterSize || 2; this.maxZoom_ = opt_options.maxZoom || null; this.styles_ = opt_options.styles || []; this.title_ = opt_options.title || ""; this.zoomOnClick_ = true; if (opt_options.zoomOnClick !== undefined) { this.zoomOnClick_ = opt_options.zoomOnClick; } this.averageCenter_ = false; if (opt_options.averageCenter !== undefined) { this.averageCenter_ = opt_options.averageCenter; } this.ignoreHidden_ = false; if (opt_options.ignoreHidden !== undefined) { this.ignoreHidden_ = opt_options.ignoreHidden; } this.enableRetinaIcons_ = false; if (opt_options.enableRetinaIcons !== undefined) { this.enableRetinaIcons_ = opt_options.enableRetinaIcons; } this.imagePath_ = opt_options.imagePath || MarkerClusterer.IMAGE_PATH; this.imageExtension_ = opt_options.imageExtension || MarkerClusterer.IMAGE_EXTENSION; this.imageSizes_ = opt_options.imageSizes || MarkerClusterer.IMAGE_SIZES; this.calculator_ = opt_options.calculator || MarkerClusterer.CALCULATOR; this.batchSize_ = opt_options.batchSize || MarkerClusterer.BATCH_SIZE; this.batchSizeIE_ = opt_options.batchSizeIE || MarkerClusterer.BATCH_SIZE_IE; this.clusterClass_ = opt_options.clusterClass || "cluster"; if (navigator.userAgent.toLowerCase().indexOf("msie") !== -1) { // Try to avoid IE timeout when processing a huge number of markers: this.batchSize_ = this.batchSizeIE_; } this.setupStyles_(); this.addMarkers(opt_markers, true); this.setMap(map); // Note: this causes onAdd to be called } /** * Implementation of the onAdd interface method. * @ignore */ MarkerClusterer.prototype.onAdd = function () { var cMarkerClusterer = this; this.activeMap_ = this.getMap(); this.ready_ = true; this.repaint(); // Add the map event listeners this.listeners_ = [ google.maps.event.addListener(this.getMap(), "zoom_changed", function () { cMarkerClusterer.resetViewport_(false); // Workaround for this Google bug: when map is at level 0 and "-" of // zoom slider is clicked, a "zoom_changed" event is fired even though // the map doesn't zoom out any further. In this situation, no "idle" // event is triggered so the cluster markers that have been removed // do not get redrawn. Same goes for a zoom in at maxZoom. if (this.getZoom() === (this.get("minZoom") || 0) || this.getZoom() === this.get("maxZoom")) { google.maps.event.trigger(this, "idle"); } }), google.maps.event.addListener(this.getMap(), "idle", function () { cMarkerClusterer.redraw_(); }) ]; }; /** * Implementation of the onRemove interface method. * Removes map event listeners and all cluster icons from the DOM. * All managed markers are also put back on the map. * @ignore */ MarkerClusterer.prototype.onRemove = function () { var i; // Put all the managed markers back on the map: for (i = 0; i < this.markers_.length; i++) { if (this.markers_[i].getMap() !== this.activeMap_) { this.markers_[i].setMap(this.activeMap_); } } // Remove all clusters: for (i = 0; i < this.clusters_.length; i++) { this.clusters_[i].remove(); } this.clusters_ = []; // Remove map event listeners: for (i = 0; i < this.listeners_.length; i++) { google.maps.event.removeListener(this.listeners_[i]); } this.listeners_ = []; this.activeMap_ = null; this.ready_ = false; }; /** * Implementation of the draw interface method. * @ignore */ MarkerClusterer.prototype.draw = function () {}; /** * Sets up the styles object. */ MarkerClusterer.prototype.setupStyles_ = function () { var i, size; if (this.styles_.length > 0) { return; } for (i = 0; i < this.imageSizes_.length; i++) { size = this.imageSizes_[i]; this.styles_.push({ url: this.imagePath_ + (i + 1) + "." + this.imageExtension_, height: size, width: size }); } }; /** * Fits the map to the bounds of the markers managed by the clusterer. */ MarkerClusterer.prototype.fitMapToMarkers = function () { var i; var markers = this.getMarkers(); var bounds = new google.maps.LatLngBounds(); for (i = 0; i < markers.length; i++) { bounds.extend(markers[i].getPosition()); } this.getMap().fitBounds(bounds); }; /** * Returns the value of the <code>gridSize</code> property. * * @return {number} The grid size. */ MarkerClusterer.prototype.getGridSize = function () { return this.gridSize_; }; /** * Sets the value of the <code>gridSize</code> property. * * @param {number} gridSize The grid size. */ MarkerClusterer.prototype.setGridSize = function (gridSize) { this.gridSize_ = gridSize; }; /** * Returns the value of the <code>minimumClusterSize</code> property. * * @return {number} The minimum cluster size. */ MarkerClusterer.prototype.getMinimumClusterSize = function () { return this.minClusterSize_; }; /** * Sets the value of the <code>minimumClusterSize</code> property. * * @param {number} minimumClusterSize The minimum cluster size. */ MarkerClusterer.prototype.setMinimumClusterSize = function (minimumClusterSize) { this.minClusterSize_ = minimumClusterSize; }; /** * Returns the value of the <code>maxZoom</code> property. * * @return {number} The maximum zoom level. */ MarkerClusterer.prototype.getMaxZoom = function () { return this.maxZoom_; }; /** * Sets the value of the <code>maxZoom</code> property. * * @param {number} maxZoom The maximum zoom level. */ MarkerClusterer.prototype.setMaxZoom = function (maxZoom) { this.maxZoom_ = maxZoom; }; /** * Returns the value of the <code>styles</code> property. * * @return {Array} The array of styles defining the cluster markers to be used. */ MarkerClusterer.prototype.getStyles = function () { return this.styles_; }; /** * Sets the value of the <code>styles</code> property. * * @param {Array.<ClusterIconStyle>} styles The array of styles to use. */ MarkerClusterer.prototype.setStyles = function (styles) { this.styles_ = styles; }; /** * Returns the value of the <code>title</code> property. * * @return {string} The content of the title text. */ MarkerClusterer.prototype.getTitle = function () { return this.title_; }; /** * Sets the value of the <code>title</code> property. * * @param {string} title The value of the title property. */ MarkerClusterer.prototype.setTitle = function (title) { this.title_ = title; }; /** * Returns the value of the <code>zoomOnClick</code> property. * * @return {boolean} True if zoomOnClick property is set. */ MarkerClusterer.prototype.getZoomOnClick = function () { return this.zoomOnClick_; }; /** * Sets the value of the <code>zoomOnClick</code> property. * * @param {boolean} zoomOnClick The value of the zoomOnClick property. */ MarkerClusterer.prototype.setZoomOnClick = function (zoomOnClick) { this.zoomOnClick_ = zoomOnClick; }; /** * Returns the value of the <code>averageCenter</code> property. * * @return {boolean} True if averageCenter property is set. */ MarkerClusterer.prototype.getAverageCenter = function () { return this.averageCenter_; }; /** * Sets the value of the <code>averageCenter</code> property. * * @param {boolean} averageCenter The value of the averageCenter property. */ MarkerClusterer.prototype.setAverageCenter = function (averageCenter) { this.averageCenter_ = averageCenter; }; /** * Returns the value of the <code>ignoreHidden</code> property. * * @return {boolean} True if ignoreHidden property is set. */ MarkerClusterer.prototype.getIgnoreHidden = function () { return this.ignoreHidden_; }; /** * Sets the value of the <code>ignoreHidden</code> property. * * @param {boolean} ignoreHidden The value of the ignoreHidden property. */ MarkerClusterer.prototype.setIgnoreHidden = function (ignoreHidden) { this.ignoreHidden_ = ignoreHidden; }; /** * Returns the value of the <code>enableRetinaIcons</code> property. * * @return {boolean} True if enableRetinaIcons property is set. */ MarkerClusterer.prototype.getEnableRetinaIcons = function () { return this.enableRetinaIcons_; }; /** * Sets the value of the <code>enableRetinaIcons</code> property. * * @param {boolean} enableRetinaIcons The value of the enableRetinaIcons property. */ MarkerClusterer.prototype.setEnableRetinaIcons = function (enableRetinaIcons) { this.enableRetinaIcons_ = enableRetinaIcons; }; /** * Returns the value of the <code>imageExtension</code> property. * * @return {string} The value of the imageExtension property. */ MarkerClusterer.prototype.getImageExtension = function () { return this.imageExtension_; }; /** * Sets the value of the <code>imageExtension</code> property. * * @param {string} imageExtension The value of the imageExtension property. */ MarkerClusterer.prototype.setImageExtension = function (imageExtension) { this.imageExtension_ = imageExtension; }; /** * Returns the value of the <code>imagePath</code> property. * * @return {string} The value of the imagePath property. */ MarkerClusterer.prototype.getImagePath = function () { return this.imagePath_; }; /** * Sets the value of the <code>imagePath</code> property. * * @param {string} imagePath The value of the imagePath property. */ MarkerClusterer.prototype.setImagePath = function (imagePath) { this.imagePath_ = imagePath; }; /** * Returns the value of the <code>imageSizes</code> property. * * @return {Array} The value of the imageSizes property. */ MarkerClusterer.prototype.getImageSizes = function () { return this.imageSizes_; }; /** * Sets the value of the <code>imageSizes</code> property. * * @param {Array} imageSizes The value of the imageSizes property. */ MarkerClusterer.prototype.setImageSizes = function (imageSizes) { this.imageSizes_ = imageSizes; }; /** * Returns the value of the <code>calculator</code> property. * * @return {function} the value of the calculator property. */ MarkerClusterer.prototype.getCalculator = function () { return this.calculator_; }; /** * Sets the value of the <code>calculator</code> property. * * @param {function(Array.<google.maps.Marker>, number)} calculator The value * of the calculator property. */ MarkerClusterer.prototype.setCalculator = function (calculator) { this.calculator_ = calculator; }; /** * Returns the value of the <code>batchSizeIE</code> property. * * @return {number} the value of the batchSizeIE property. */ MarkerClusterer.prototype.getBatchSizeIE = function () { return this.batchSizeIE_; }; /** * Sets the value of the <code>batchSizeIE</code> property. * * @param {number} batchSizeIE The value of the batchSizeIE property. */ MarkerClusterer.prototype.setBatchSizeIE = function (batchSizeIE) { this.batchSizeIE_ = batchSizeIE; }; /** * Returns the value of the <code>clusterClass</code> property. * * @return {string} the value of the clusterClass property. */ MarkerClusterer.prototype.getClusterClass = function () { return this.clusterClass_; }; /** * Sets the value of the <code>clusterClass</code> property. * * @param {string} clusterClass The value of the clusterClass property. */ MarkerClusterer.prototype.setClusterClass = function (clusterClass) { this.clusterClass_ = clusterClass; }; /** * Returns the array of markers managed by the clusterer. * * @return {Array} The array of markers managed by the clusterer. */ MarkerClusterer.prototype.getMarkers = function () { return this.markers_; }; /** * Returns the number of markers managed by the clusterer. * * @return {number} The number of markers. */ MarkerClusterer.prototype.getTotalMarkers = function () { return this.markers_.length; }; /** * Returns the current array of clusters formed by the clusterer. * * @return {Array} The array of clusters formed by the clusterer. */ MarkerClusterer.prototype.getClusters = function () { return this.clusters_; }; /** * Returns the number of clusters formed by the clusterer. * * @return {number} The number of clusters formed by the clusterer. */ MarkerClusterer.prototype.getTotalClusters = function () { return this.clusters_.length; }; /** * Adds a marker to the clusterer. The clusters are redrawn unless * <code>opt_nodraw</code> is set to <code>true</code>. * * @param {google.maps.Marker} marker The marker to add. * @param {boolean} [opt_nodraw] Set to <code>true</code> to prevent redrawing. */ MarkerClusterer.prototype.addMarker = function (marker, opt_nodraw) { this.pushMarkerTo_(marker); if (!opt_nodraw) { this.redraw_(); } }; /** * Adds an array of markers to the clusterer. The clusters are redrawn unless * <code>opt_nodraw</code> is set to <code>true</code>. * * @param {Array.<google.maps.Marker>} markers The markers to add. * @param {boolean} [opt_nodraw] Set to <code>true</code> to prevent redrawing. */ MarkerClusterer.prototype.addMarkers = function (markers, opt_nodraw) { var key; for (key in markers) { if (markers.hasOwnProperty(key)) { this.pushMarkerTo_(markers[key]); } } if (!opt_nodraw) { this.redraw_(); } }; /** * Pushes a marker to the clusterer. * * @param {google.maps.Marker} marker The marker to add. */ MarkerClusterer.prototype.pushMarkerTo_ = function (marker) { // If the marker is draggable add a listener so we can update the clusters on the dragend: if (marker.getDraggable()) { var cMarkerClusterer = this; google.maps.event.addListener(marker, "dragend", function () { if (cMarkerClusterer.ready_) { this.isAdded = false; cMarkerClusterer.repaint(); } }); } marker.isAdded = false; this.markers_.push(marker); }; /** * Removes a marker from the cluster. The clusters are redrawn unless * <code>opt_nodraw</code> is set to <code>true</code>. Returns <code>true</code> if the * marker was removed from the clusterer. * * @param {google.maps.Marker} marker The marker to remove. * @param {boolean} [opt_nodraw] Set to <code>true</code> to prevent redrawing. * @return {boolean} True if the marker was removed from the clusterer. */ MarkerClusterer.prototype.removeMarker = function (marker, opt_nodraw) { var removed = this.removeMarker_(marker); if (!opt_nodraw && removed) { this.repaint(); } return removed; }; /** * Removes an array of markers from the cluster. The clusters are redrawn unless * <code>opt_nodraw</code> is set to <code>true</code>. Returns <code>true</code> if markers * were removed from the clusterer. * * @param {Array.<google.maps.Marker>} markers The markers to remove. * @param {boolean} [opt_nodraw] Set to <code>true</code> to prevent redrawing. * @return {boolean} True if markers were removed from the clusterer. */ MarkerClusterer.prototype.removeMarkers = function (markers, opt_nodraw) { var i, r; var removed = false; for (i = 0; i < markers.length; i++) { r = this.removeMarker_(markers[i]); removed = removed || r; } if (!opt_nodraw && removed) { this.repaint(); } return removed; }; /** * Removes a marker and returns true if removed, false if not. * * @param {google.maps.Marker} marker The marker to remove * @return {boolean} Whether the marker was removed or not */ MarkerClusterer.prototype.removeMarker_ = function (marker) { var i; var index = -1; if (this.markers_.indexOf) { index = this.markers_.indexOf(marker); } else { for (i = 0; i < this.markers_.length; i++) { if (marker === this.markers_[i]) { index = i; break; } } } if (index === -1) { // Marker is not in our list of markers, so do nothing: return false; } marker.setMap(null); this.markers_.splice(index, 1); // Remove the marker from the list of managed markers return true; }; /** * Removes all clusters and markers from the map and also removes all markers * managed by the clusterer. */ MarkerClusterer.prototype.clearMarkers = function () { this.resetViewport_(true); this.markers_ = []; }; /** * Recalculates and redraws all the marker clusters from scratch. * Call this after changing any properties. */ MarkerClusterer.prototype.repaint = function () { var oldClusters = this.clusters_.slice(); this.clusters_ = []; this.resetViewport_(false); this.redraw_(); // Remove the old clusters. // Do it in a timeout to prevent blinking effect. setTimeout(function () { var i; for (i = 0; i < oldClusters.length; i++) { oldClusters[i].remove(); } }, 0); }; /** * Returns the current bounds extended by the grid size. * * @param {google.maps.LatLngBounds} bounds The bounds to extend. * @return {google.maps.LatLngBounds} The extended bounds. * @ignore */ MarkerClusterer.prototype.getExtendedBounds = function (bounds) { var projection = this.getProjection(); // Turn the bounds into latlng. var tr = new google.maps.LatLng(bounds.getNorthEast().lat(), bounds.getNorthEast().lng()); var bl = new google.maps.LatLng(bounds.getSouthWest().lat(), bounds.getSouthWest().lng()); // Convert the points to pixels and the extend out by the grid size. var trPix = projection.fromLatLngToDivPixel(tr); trPix.x += this.gridSize_; trPix.y -= this.gridSize_; var blPix = projection.fromLatLngToDivPixel(bl); blPix.x -= this.gridSize_; blPix.y += this.gridSize_; // Convert the pixel points back to LatLng var ne = projection.fromDivPixelToLatLng(trPix); var sw = projection.fromDivPixelToLatLng(blPix); // Extend the bounds to contain the new bounds. bounds.extend(ne); bounds.extend(sw); return bounds; }; /** * Redraws all the clusters. */ MarkerClusterer.prototype.redraw_ = function () { this.createClusters_(0); }; /** * Removes all clusters from the map. The markers are also removed from the map * if <code>opt_hide</code> is set to <code>true</code>. * * @param {boolean} [opt_hide] Set to <code>true</code> to also remove the markers * from the map. */ MarkerClusterer.prototype.resetViewport_ = function (opt_hide) { var i, marker; // Remove all the clusters for (i = 0; i < this.clusters_.length; i++) { this.clusters_[i].remove(); } this.clusters_ = []; // Reset the markers to not be added and to be removed from the map. for (i = 0; i < this.markers_.length; i++) { marker = this.markers_[i]; marker.isAdded = false; if (opt_hide) { marker.setMap(null); } } }; /** * Calculates the distance between two latlng locations in km. * * @param {google.maps.LatLng} p1 The first lat lng point. * @param {google.maps.LatLng} p2 The second lat lng point. * @return {number} The distance between the two points in km. * @see http://www.movable-type.co.uk/scripts/latlong.html */ MarkerClusterer.prototype.distanceBetweenPoints_ = function (p1, p2) { var R = 6371; // Radius of the Earth in km var dLat = (p2.lat() - p1.lat()) * Math.PI / 180; var dLon = (p2.lng() - p1.lng()) * Math.PI / 180; var a = Math.sin(dLat / 2) * Math.sin(dLat / 2) + Math.cos(p1.lat() * Math.PI / 180) * Math.cos(p2.lat() * Math.PI / 180) * Math.sin(dLon / 2) * Math.sin(dLon / 2); var c = 2 * Math.atan2(Math.sqrt(a), Math.sqrt(1 - a)); var d = R * c; return d; }; /** * Determines if a marker is contained in a bounds. * * @param {google.maps.Marker} marker The marker to check. * @param {google.maps.LatLngBounds} bounds The bounds to check against. * @return {boolean} True if the marker is in the bounds. */ MarkerClusterer.prototype.isMarkerInBounds_ = function (marker, bounds) { return bounds.contains(marker.getPosition()); }; /** * Adds a marker to a cluster, or creates a new cluster. * * @param {google.maps.Marker} marker The marker to add. */ MarkerClusterer.prototype.addToClosestCluster_ = function (marker) { var i, d, cluster, center; var distance = 40000; // Some large number var clusterToAddTo = null; for (i = 0; i < this.clusters_.length; i++) { cluster = this.clusters_[i]; center = cluster.getCenter(); if (center) { d = this.distanceBetweenPoints_(center, marker.getPosition()); if (d < distance) { distance = d; clusterToAddTo = cluster; } } } if (clusterToAddTo && clusterToAddTo.isMarkerInClusterBounds(marker)) { clusterToAddTo.addMarker(marker); } else { cluster = new Cluster(this); cluster.addMarker(marker); this.clusters_.push(cluster); } }; /** * Creates the clusters. This is done in batches to avoid timeout errors * in some browsers when there is a huge number of markers. * * @param {number} iFirst The index of the first marker in the batch of * markers to be added to clusters. */ MarkerClusterer.prototype.createClusters_ = function (iFirst) { var i, marker; var mapBounds; var cMarkerClusterer = this; if (!this.ready_) { return; } // Cancel previous batch processing if we're working on the first batch: if (iFirst === 0) { /** * This event is fired when the <code>MarkerClusterer</code> begins * clustering markers. * @name MarkerClusterer#clusteringbegin * @param {MarkerClusterer} mc The MarkerClusterer whose markers are being clustered. * @event */ google.maps.event.trigger(this, "clusteringbegin", this); if (typeof this.timerRefStatic !== "undefined") { clearTimeout(this.timerRefStatic); delete this.timerRefStatic; } } // Get our current map view bounds. // Create a new bounds object so we don't affect the map. // // See Comments 9 & 11 on Issue 3651 relating to this workaround for a Google Maps bug: if (this.getMap().getZoom() > 3) { mapBounds = new google.maps.LatLngBounds(this.getMap().getBounds().getSouthWest(), this.getMap().getBounds().getNorthEast()); } else { mapBounds = new google.maps.LatLngBounds(new google.maps.LatLng(85.02070771743472, -178.48388434375), new google.maps.LatLng(-85.08136444384544, 178.00048865625)); } var bounds = this.getExtendedBounds(mapBounds); var iLast = Math.min(iFirst + this.batchSize_, this.markers_.length); for (i = iFirst; i < iLast; i++) { marker = this.markers_[i]; if (!marker.isAdded && this.isMarkerInBounds_(marker, bounds)) { if (!this.ignoreHidden_ || (this.ignoreHidden_ && marker.getVisible())) { this.addToClosestCluster_(marker); } } } if (iLast < this.markers_.length) { this.timerRefStatic = setTimeout(function () { cMarkerClusterer.createClusters_(iLast); }, 0); } else { delete this.timerRefStatic; /** * This event is fired when the <code>MarkerClusterer</code> stops * clustering markers. * @name MarkerClusterer#clusteringend * @param {MarkerClusterer} mc The MarkerClusterer whose markers are being clustered. * @event */ google.maps.event.trigger(this, "clusteringend", this); } }; /** * Extends an object's prototype by another's. * * @param {Object} obj1 The object to be extended. * @param {Object} obj2 The object to extend with. * @return {Object} The new extended object. * @ignore */ MarkerClusterer.prototype.extend = function (obj1, obj2) { return (function (object) { var property; for (property in object.prototype) { this.prototype[property] = object.prototype[property]; } return this; }).apply(obj1, [obj2]); }; /** * The default function for determining the label text and style * for a cluster icon. * * @param {Array.<google.maps.Marker>} markers The array of markers represented by the cluster. * @param {number} numStyles The number of marker styles available. * @return {ClusterIconInfo} The information resource for the cluster. * @constant * @ignore */ MarkerClusterer.CALCULATOR = function (markers, numStyles) { var index = 0; var title = ""; var count = markers.length.toString(); var dv = count; while (dv !== 0) { dv = parseInt(dv / 10, 10); index++; } index = Math.min(index, numStyles); return { text: count, index: index, title: title }; }; /** * The number of markers to process in one batch. * * @type {number} * @constant */ MarkerClusterer.BATCH_SIZE = 2000; /** * The number of markers to process in one batch (IE only). * * @type {number} * @constant */ MarkerClusterer.BATCH_SIZE_IE = 500; /** * The default root name for the marker cluster images. * * @type {string} * @constant */ MarkerClusterer.IMAGE_PATH = "http://google-maps-utility-library-v3.googlecode.com/svn/trunk/markerclustererplus/images/m"; /** * The default extension name for the marker cluster images. * * @type {string} * @constant */ MarkerClusterer.IMAGE_EXTENSION = "png"; /** * The default array of sizes for the marker cluster images. * * @type {Array.<number>} * @constant */ MarkerClusterer.IMAGE_SIZES = [53, 56, 66, 78, 90]; if (typeof String.prototype.trim !== 'function') { /** * IE hack since trim() doesn't exist in all browsers * @return {string} The string with removed whitespace */ String.prototype.trim = function() { return this.replace(/^\s+|\s+$/g, ''); } } ;/** * 1.1.9-patched * @name MarkerWithLabel for V3 * @version 1.1.8 [February 26, 2013] * @author Gary Little (inspired by code from Marc Ridey of Google). * @copyright Copyright 2012 Gary Little [gary at luxcentral.com] * @fileoverview MarkerWithLabel extends the Google Maps JavaScript API V3 * <code>google.maps.Marker</code> class. * <p> * MarkerWithLabel allows you to define markers with associated labels. As you would expect, * if the marker is draggable, so too will be the label. In addition, a marker with a label * responds to all mouse events in the same manner as a regular marker. It also fires mouse * events and "property changed" events just as a regular marker would. Version 1.1 adds * support for the raiseOnDrag feature introduced in API V3.3. * <p> * If you drag a marker by its label, you can cancel the drag and return the marker to its * original position by pressing the <code>Esc</code> key. This doesn't work if you drag the marker * itself because this feature is not (yet) supported in the <code>google.maps.Marker</code> class. */ /*! * * 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 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /*jslint browser:true */ /*global document,google */ /** * @param {Function} childCtor Child class. * @param {Function} parentCtor Parent class. */ function inherits(childCtor, parentCtor) { /** @constructor */ function tempCtor() {} tempCtor.prototype = parentCtor.prototype; childCtor.superClass_ = parentCtor.prototype; childCtor.prototype = new tempCtor(); /** @override */ childCtor.prototype.constructor = childCtor; } /** * This constructor creates a label and associates it with a marker. * It is for the private use of the MarkerWithLabel class. * @constructor * @param {Marker} marker The marker with which the label is to be associated. * @param {string} crossURL The URL of the cross image =. * @param {string} handCursor The URL of the hand cursor. * @private */ function MarkerLabel_(marker, crossURL, handCursorURL) { this.marker_ = marker; this.handCursorURL_ = marker.handCursorURL; this.labelDiv_ = document.createElement("div"); this.labelDiv_.style.cssText = "position: absolute; overflow: hidden;"; // Set up the DIV for handling mouse events in the label. This DIV forms a transparent veil // in the "overlayMouseTarget" pane, a veil that covers just the label. This is done so that // events can be captured even if the label is in the shadow of a google.maps.InfoWindow. // Code is included here to ensure the veil is always exactly the same size as the label. this.eventDiv_ = document.createElement("div"); this.eventDiv_.style.cssText = this.labelDiv_.style.cssText; // This is needed for proper behavior on MSIE: this.eventDiv_.setAttribute("onselectstart", "return false;"); this.eventDiv_.setAttribute("ondragstart", "return false;"); // Get the DIV for the "X" to be displayed when the marker is raised. this.crossDiv_ = MarkerLabel_.getSharedCross(crossURL); } inherits(MarkerLabel_, google.maps.OverlayView); /** * Returns the DIV for the cross used when dragging a marker when the * raiseOnDrag parameter set to true. One cross is shared with all markers. * @param {string} crossURL The URL of the cross image =. * @private */ MarkerLabel_.getSharedCross = function (crossURL) { var div; if (typeof MarkerLabel_.getSharedCross.crossDiv === "undefined") { div = document.createElement("img"); div.style.cssText = "position: absolute; z-index: 1000002; display: none;"; // Hopefully Google never changes the standard "X" attributes: div.style.marginLeft = "-8px"; div.style.marginTop = "-9px"; div.src = crossURL; MarkerLabel_.getSharedCross.crossDiv = div; } return MarkerLabel_.getSharedCross.crossDiv; }; /** * Adds the DIV representing the label to the DOM. This method is called * automatically when the marker's <code>setMap</code> method is called. * @private */ MarkerLabel_.prototype.onAdd = function () { var me = this; var cMouseIsDown = false; var cDraggingLabel = false; var cSavedZIndex; var cLatOffset, cLngOffset; var cIgnoreClick; var cRaiseEnabled; var cStartPosition; var cStartCenter; // Constants: var cRaiseOffset = 20; var cDraggingCursor = "url(" + this.handCursorURL_ + ")"; // Stops all processing of an event. // var cAbortEvent = function (e) { if (e.preventDefault) { e.preventDefault(); } e.cancelBubble = true; if (e.stopPropagation) { e.stopPropagation(); } }; var cStopBounce = function () { me.marker_.setAnimation(null); }; this.getPanes().overlayImage.appendChild(this.labelDiv_); this.getPanes().overlayMouseTarget.appendChild(this.eventDiv_); // One cross is shared with all markers, so only add it once: if (typeof MarkerLabel_.getSharedCross.processed === "undefined") { this.getPanes().overlayImage.appendChild(this.crossDiv_); MarkerLabel_.getSharedCross.processed = true; } this.listeners_ = [ google.maps.event.addDomListener(this.eventDiv_, "mouseover", function (e) { if (me.marker_.getDraggable() || me.marker_.getClickable()) { this.style.cursor = "pointer"; google.maps.event.trigger(me.marker_, "mouseover", e); } }), google.maps.event.addDomListener(this.eventDiv_, "mouseout", function (e) { if ((me.marker_.getDraggable() || me.marker_.getClickable()) && !cDraggingLabel) { this.style.cursor = me.marker_.getCursor(); google.maps.event.trigger(me.marker_, "mouseout", e); } }), google.maps.event.addDomListener(this.eventDiv_, "mousedown", function (e) { cDraggingLabel = false; if (me.marker_.getDraggable()) { cMouseIsDown = true; this.style.cursor = cDraggingCursor; } if (me.marker_.getDraggable() || me.marker_.getClickable()) { google.maps.event.trigger(me.marker_, "mousedown", e); cAbortEvent(e); // Prevent map pan when starting a drag on a label } }), google.maps.event.addDomListener(document, "mouseup", function (mEvent) { var position; if (cMouseIsDown) { cMouseIsDown = false; me.eventDiv_.style.cursor = "pointer"; google.maps.event.trigger(me.marker_, "mouseup", mEvent); } if (cDraggingLabel) { if (cRaiseEnabled) { // Lower the marker & label position = me.getProjection().fromLatLngToDivPixel(me.marker_.getPosition()); position.y += cRaiseOffset; me.marker_.setPosition(me.getProjection().fromDivPixelToLatLng(position)); // This is not the same bouncing style as when the marker portion is dragged, // but it will have to do: try { // Will fail if running Google Maps API earlier than V3.3 me.marker_.setAnimation(google.maps.Animation.BOUNCE); setTimeout(cStopBounce, 1406); } catch (e) {} } me.crossDiv_.style.display = "none"; me.marker_.setZIndex(cSavedZIndex); cIgnoreClick = true; // Set flag to ignore the click event reported after a label drag cDraggingLabel = false; mEvent.latLng = me.marker_.getPosition(); google.maps.event.trigger(me.marker_, "dragend", mEvent); } }), google.maps.event.addListener(me.marker_.getMap(), "mousemove", function (mEvent) { var position; if (cMouseIsDown) { if (cDraggingLabel) { // Change the reported location from the mouse position to the marker position: mEvent.latLng = new google.maps.LatLng(mEvent.latLng.lat() - cLatOffset, mEvent.latLng.lng() - cLngOffset); position = me.getProjection().fromLatLngToDivPixel(mEvent.latLng); if (cRaiseEnabled) { me.crossDiv_.style.left = position.x + "px"; me.crossDiv_.style.top = position.y + "px"; me.crossDiv_.style.display = ""; position.y -= cRaiseOffset; } me.marker_.setPosition(me.getProjection().fromDivPixelToLatLng(position)); if (cRaiseEnabled) { // Don't raise the veil; this hack needed to make MSIE act properly me.eventDiv_.style.top = (position.y + cRaiseOffset) + "px"; } google.maps.event.trigger(me.marker_, "drag", mEvent); } else { // Calculate offsets from the click point to the marker position: cLatOffset = mEvent.latLng.lat() - me.marker_.getPosition().lat(); cLngOffset = mEvent.latLng.lng() - me.marker_.getPosition().lng(); cSavedZIndex = me.marker_.getZIndex(); cStartPosition = me.marker_.getPosition(); cStartCenter = me.marker_.getMap().getCenter(); cRaiseEnabled = me.marker_.get("raiseOnDrag"); cDraggingLabel = true; me.marker_.setZIndex(1000000); // Moves the marker & label to the foreground during a drag mEvent.latLng = me.marker_.getPosition(); google.maps.event.trigger(me.marker_, "dragstart", mEvent); } } }), google.maps.event.addDomListener(document, "keydown", function (e) { if (cDraggingLabel) { if (e.keyCode === 27) { // Esc key cRaiseEnabled = false; me.marker_.setPosition(cStartPosition); me.marker_.getMap().setCenter(cStartCenter); google.maps.event.trigger(document, "mouseup", e); } } }), google.maps.event.addDomListener(this.eventDiv_, "click", function (e) { if (me.marker_.getDraggable() || me.marker_.getClickable()) { if (cIgnoreClick) { // Ignore the click reported when a label drag ends cIgnoreClick = false; } else { google.maps.event.trigger(me.marker_, "click", e); cAbortEvent(e); // Prevent click from being passed on to map } } }), google.maps.event.addDomListener(this.eventDiv_, "dblclick", function (e) { if (me.marker_.getDraggable() || me.marker_.getClickable()) { google.maps.event.trigger(me.marker_, "dblclick", e); cAbortEvent(e); // Prevent map zoom when double-clicking on a label } }), google.maps.event.addListener(this.marker_, "dragstart", function (mEvent) { if (!cDraggingLabel) { cRaiseEnabled = this.get("raiseOnDrag"); } }), google.maps.event.addListener(this.marker_, "drag", function (mEvent) { if (!cDraggingLabel) { if (cRaiseEnabled) { me.setPosition(cRaiseOffset); // During a drag, the marker's z-index is temporarily set to 1000000 to // ensure it appears above all other markers. Also set the label's z-index // to 1000000 (plus or minus 1 depending on whether the label is supposed // to be above or below the marker). me.labelDiv_.style.zIndex = 1000000 + (this.get("labelInBackground") ? -1 : +1); } } }), google.maps.event.addListener(this.marker_, "dragend", function (mEvent) { if (!cDraggingLabel) { if (cRaiseEnabled) { me.setPosition(0); // Also restores z-index of label } } }), google.maps.event.addListener(this.marker_, "position_changed", function () { me.setPosition(); }), google.maps.event.addListener(this.marker_, "zindex_changed", function () { me.setZIndex(); }), google.maps.event.addListener(this.marker_, "visible_changed", function () { me.setVisible(); }), google.maps.event.addListener(this.marker_, "labelvisible_changed", function () { me.setVisible(); }), google.maps.event.addListener(this.marker_, "title_changed", function () { me.setTitle(); }), google.maps.event.addListener(this.marker_, "labelcontent_changed", function () { me.setContent(); }), google.maps.event.addListener(this.marker_, "labelanchor_changed", function () { me.setAnchor(); }), google.maps.event.addListener(this.marker_, "labelclass_changed", function () { me.setStyles(); }), google.maps.event.addListener(this.marker_, "labelstyle_changed", function () { me.setStyles(); }) ]; }; /** * Removes the DIV for the label from the DOM. It also removes all event handlers. * This method is called automatically when the marker's <code>setMap(null)</code> * method is called. * @private */ MarkerLabel_.prototype.onRemove = function () { var i; if (this.labelDiv_.parentNode !== null) this.labelDiv_.parentNode.removeChild(this.labelDiv_); if (this.eventDiv_.parentNode !== null) this.eventDiv_.parentNode.removeChild(this.eventDiv_); // Remove event listeners: for (i = 0; i < this.listeners_.length; i++) { google.maps.event.removeListener(this.listeners_[i]); } }; /** * Draws the label on the map. * @private */ MarkerLabel_.prototype.draw = function () { this.setContent(); this.setTitle(); this.setStyles(); }; /** * Sets the content of the label. * The content can be plain text or an HTML DOM node. * @private */ MarkerLabel_.prototype.setContent = function () { var content = this.marker_.get("labelContent"); if (typeof content.nodeType === "undefined") { this.labelDiv_.innerHTML = content; this.eventDiv_.innerHTML = this.labelDiv_.innerHTML; } else { this.labelDiv_.innerHTML = ""; // Remove current content this.labelDiv_.appendChild(content); content = content.cloneNode(true); this.eventDiv_.appendChild(content); } }; /** * Sets the content of the tool tip for the label. It is * always set to be the same as for the marker itself. * @private */ MarkerLabel_.prototype.setTitle = function () { this.eventDiv_.title = this.marker_.getTitle() || ""; }; /** * Sets the style of the label by setting the style sheet and applying * other specific styles requested. * @private */ MarkerLabel_.prototype.setStyles = function () { var i, labelStyle; // Apply style values from the style sheet defined in the labelClass parameter: this.labelDiv_.className = this.marker_.get("labelClass"); this.eventDiv_.className = this.labelDiv_.className; // Clear existing inline style values: this.labelDiv_.style.cssText = ""; this.eventDiv_.style.cssText = ""; // Apply style values defined in the labelStyle parameter: labelStyle = this.marker_.get("labelStyle"); for (i in labelStyle) { if (labelStyle.hasOwnProperty(i)) { this.labelDiv_.style[i] = labelStyle[i]; this.eventDiv_.style[i] = labelStyle[i]; } } this.setMandatoryStyles(); }; /** * Sets the mandatory styles to the DIV representing the label as well as to the * associated event DIV. This includes setting the DIV position, z-index, and visibility. * @private */ MarkerLabel_.prototype.setMandatoryStyles = function () { this.labelDiv_.style.position = "absolute"; this.labelDiv_.style.overflow = "hidden"; // Make sure the opacity setting causes the desired effect on MSIE: if (typeof this.labelDiv_.style.opacity !== "undefined" && this.labelDiv_.style.opacity !== "") { this.labelDiv_.style.MsFilter = "\"progid:DXImageTransform.Microsoft.Alpha(opacity=" + (this.labelDiv_.style.opacity * 100) + ")\""; this.labelDiv_.style.filter = "alpha(opacity=" + (this.labelDiv_.style.opacity * 100) + ")"; } this.eventDiv_.style.position = this.labelDiv_.style.position; this.eventDiv_.style.overflow = this.labelDiv_.style.overflow; this.eventDiv_.style.opacity = 0.01; // Don't use 0; DIV won't be clickable on MSIE this.eventDiv_.style.MsFilter = "\"progid:DXImageTransform.Microsoft.Alpha(opacity=1)\""; this.eventDiv_.style.filter = "alpha(opacity=1)"; // For MSIE this.setAnchor(); this.setPosition(); // This also updates z-index, if necessary. this.setVisible(); }; /** * Sets the anchor point of the label. * @private */ MarkerLabel_.prototype.setAnchor = function () { var anchor = this.marker_.get("labelAnchor"); this.labelDiv_.style.marginLeft = -anchor.x + "px"; this.labelDiv_.style.marginTop = -anchor.y + "px"; this.eventDiv_.style.marginLeft = -anchor.x + "px"; this.eventDiv_.style.marginTop = -anchor.y + "px"; }; /** * Sets the position of the label. The z-index is also updated, if necessary. * @private */ MarkerLabel_.prototype.setPosition = function (yOffset) { var position = this.getProjection().fromLatLngToDivPixel(this.marker_.getPosition()); if (typeof yOffset === "undefined") { yOffset = 0; } this.labelDiv_.style.left = Math.round(position.x) + "px"; this.labelDiv_.style.top = Math.round(position.y - yOffset) + "px"; this.eventDiv_.style.left = this.labelDiv_.style.left; this.eventDiv_.style.top = this.labelDiv_.style.top; this.setZIndex(); }; /** * Sets the z-index of the label. If the marker's z-index property has not been defined, the z-index * of the label is set to the vertical coordinate of the label. This is in keeping with the default * stacking order for Google Maps: markers to the south are in front of markers to the north. * @private */ MarkerLabel_.prototype.setZIndex = function () { var zAdjust = (this.marker_.get("labelInBackground") ? -1 : +1); if (typeof this.marker_.getZIndex() === "undefined") { this.labelDiv_.style.zIndex = parseInt(this.labelDiv_.style.top, 10) + zAdjust; this.eventDiv_.style.zIndex = this.labelDiv_.style.zIndex; } else { this.labelDiv_.style.zIndex = this.marker_.getZIndex() + zAdjust; this.eventDiv_.style.zIndex = this.labelDiv_.style.zIndex; } }; /** * Sets the visibility of the label. The label is visible only if the marker itself is * visible (i.e., its visible property is true) and the labelVisible property is true. * @private */ MarkerLabel_.prototype.setVisible = function () { if (this.marker_.get("labelVisible")) { this.labelDiv_.style.display = this.marker_.getVisible() ? "block" : "none"; } else { this.labelDiv_.style.display = "none"; } this.eventDiv_.style.display = this.labelDiv_.style.display; }; /** * @name MarkerWithLabelOptions * @class This class represents the optional parameter passed to the {@link MarkerWithLabel} constructor. * The properties available are the same as for <code>google.maps.Marker</code> with the addition * of the properties listed below. To change any of these additional properties after the labeled * marker has been created, call <code>google.maps.Marker.set(propertyName, propertyValue)</code>. * <p> * When any of these properties changes, a property changed event is fired. The names of these * events are derived from the name of the property and are of the form <code>propertyname_changed</code>. * For example, if the content of the label changes, a <code>labelcontent_changed</code> event * is fired. * <p> * @property {string|Node} [labelContent] The content of the label (plain text or an HTML DOM node). * @property {Point} [labelAnchor] By default, a label is drawn with its anchor point at (0,0) so * that its top left corner is positioned at the anchor point of the associated marker. Use this * property to change the anchor point of the label. For example, to center a 50px-wide label * beneath a marker, specify a <code>labelAnchor</code> of <code>google.maps.Point(25, 0)</code>. * (Note: x-values increase to the right and y-values increase to the top.) * @property {string} [labelClass] The name of the CSS class defining the styles for the label. * Note that style values for <code>position</code>, <code>overflow</code>, <code>top</code>, * <code>left</code>, <code>zIndex</code>, <code>display</code>, <code>marginLeft</code>, and * <code>marginTop</code> are ignored; these styles are for internal use only. * @property {Object} [labelStyle] An object literal whose properties define specific CSS * style values to be applied to the label. Style values defined here override those that may * be defined in the <code>labelClass</code> style sheet. If this property is changed after the * label has been created, all previously set styles (except those defined in the style sheet) * are removed from the label before the new style values are applied. * Note that style values for <code>position</code>, <code>overflow</code>, <code>top</code>, * <code>left</code>, <code>zIndex</code>, <code>display</code>, <code>marginLeft</code>, and * <code>marginTop</code> are ignored; these styles are for internal use only. * @property {boolean} [labelInBackground] A flag indicating whether a label that overlaps its * associated marker should appear in the background (i.e., in a plane below the marker). * The default is <code>false</code>, which causes the label to appear in the foreground. * @property {boolean} [labelVisible] A flag indicating whether the label is to be visible. * The default is <code>true</code>. Note that even if <code>labelVisible</code> is * <code>true</code>, the label will <i>not</i> be visible unless the associated marker is also * visible (i.e., unless the marker's <code>visible</code> property is <code>true</code>). * @property {boolean} [raiseOnDrag] A flag indicating whether the label and marker are to be * raised when the marker is dragged. The default is <code>true</code>. If a draggable marker is * being created and a version of Google Maps API earlier than V3.3 is being used, this property * must be set to <code>false</code>. * @property {boolean} [optimized] A flag indicating whether rendering is to be optimized for the * marker. <b>Important: The optimized rendering technique is not supported by MarkerWithLabel, * so the value of this parameter is always forced to <code>false</code>. * @property {string} [crossImage="http://maps.gstatic.com/intl/en_us/mapfiles/drag_cross_67_16.png"] * The URL of the cross image to be displayed while dragging a marker. * @property {string} [handCursor="http://maps.gstatic.com/intl/en_us/mapfiles/closedhand_8_8.cur"] * The URL of the cursor to be displayed while dragging a marker. */ /** * Creates a MarkerWithLabel with the options specified in {@link MarkerWithLabelOptions}. * @constructor * @param {MarkerWithLabelOptions} [opt_options] The optional parameters. */ function MarkerWithLabel(opt_options) { opt_options = opt_options || {}; opt_options.labelContent = opt_options.labelContent || ""; opt_options.labelAnchor = opt_options.labelAnchor || new google.maps.Point(0, 0); opt_options.labelClass = opt_options.labelClass || "markerLabels"; opt_options.labelStyle = opt_options.labelStyle || {}; opt_options.labelInBackground = opt_options.labelInBackground || false; if (typeof opt_options.labelVisible === "undefined") { opt_options.labelVisible = true; } if (typeof opt_options.raiseOnDrag === "undefined") { opt_options.raiseOnDrag = true; } if (typeof opt_options.clickable === "undefined") { opt_options.clickable = true; } if (typeof opt_options.draggable === "undefined") { opt_options.draggable = false; } if (typeof opt_options.optimized === "undefined") { opt_options.optimized = false; } opt_options.crossImage = opt_options.crossImage || "http" + (document.location.protocol === "https:" ? "s" : "") + "://maps.gstatic.com/intl/en_us/mapfiles/drag_cross_67_16.png"; opt_options.handCursor = opt_options.handCursor || "http" + (document.location.protocol === "https:" ? "s" : "") + "://maps.gstatic.com/intl/en_us/mapfiles/closedhand_8_8.cur"; opt_options.optimized = false; // Optimized rendering is not supported this.label = new MarkerLabel_(this, opt_options.crossImage, opt_options.handCursor); // Bind the label to the marker // Call the parent constructor. It calls Marker.setValues to initialize, so all // the new parameters are conveniently saved and can be accessed with get/set. // Marker.set triggers a property changed event (called "propertyname_changed") // that the marker label listens for in order to react to state changes. google.maps.Marker.apply(this, arguments); } inherits(MarkerWithLabel, google.maps.Marker); /** * Overrides the standard Marker setMap function. * @param {Map} theMap The map to which the marker is to be added. * @private */ MarkerWithLabel.prototype.setMap = function (theMap) { // Call the inherited function... google.maps.Marker.prototype.setMap.apply(this, arguments); // ... then deal with the label: this.label.setMap(theMap); };
example/react/src/index.js
i18next/react-i18next
import React from 'react'; import { createRoot } from 'react-dom/client'; import './index.css'; import App from './App'; // import i18n (needs to be bundled ;)) import './i18n'; const root = createRoot(document.getElementById('root')); root.render( <React.StrictMode> <App /> </React.StrictMode>, );
ajax/libs/inferno/1.0.7/inferno-devtools.js
kennynaoh/cdnjs
/*! * inferno-devtools v1.0.7 * (c) 2017 Dominic Gannaway * Released under the MIT License. */ (function (global, factory) { typeof exports === 'object' && typeof module !== 'undefined' ? factory(require('inferno'), require('inferno-component')) : typeof define === 'function' && define.amd ? define(['inferno', 'inferno-component'], factory) : (factory(global.Inferno,global.Inferno.Component)); }(this, (function (inferno,Component) { 'use strict'; Component = 'default' in Component ? Component['default'] : Component; // this is MUCH faster than .constructor === Array and instanceof Array // in Node 7 and the later versions of V8, slower in older versions though var isArray = Array.isArray; function isStatefulComponent(o) { return !isUndefined(o.prototype) && !isUndefined(o.prototype.render); } function isStringOrNumber(obj) { return isString(obj) || isNumber(obj); } function isInvalid(obj) { return isNull(obj) || obj === false || isTrue(obj) || isUndefined(obj); } function isString(obj) { return typeof obj === 'string'; } function isNumber(obj) { return typeof obj === 'number'; } function isNull(obj) { return obj === null; } function isTrue(obj) { return obj === true; } function isUndefined(obj) { return obj === undefined; } function isObject(o) { return typeof o === 'object'; } function findVNodeFromDom(vNode, dom) { if (!vNode) { var roots = inferno.options.roots; for (var i = 0; i < roots.length; i++) { var root = roots[i]; var result = findVNodeFromDom(root.input, dom); if (result) { return result; } } } else { if (vNode.dom === dom) { return vNode; } var flags = vNode.flags; var children = vNode.children; if (flags & 28 /* Component */) { children = children._lastInput || children; } if (children) { if (isArray(children)) { for (var i$1 = 0; i$1 < children.length; i$1++) { var child = children[i$1]; if (child) { var result$1 = findVNodeFromDom(child, dom); if (result$1) { return result$1; } } } } else if (isObject(children)) { var result$2 = findVNodeFromDom(children, dom); if (result$2) { return result$2; } } } } } var instanceMap = new Map(); function getKeyForVNode(vNode) { var flags = vNode.flags; if (flags & 4 /* ComponentClass */) { return vNode.children; } else { return vNode.dom; } } function getInstanceFromVNode(vNode) { var key = getKeyForVNode(vNode); return instanceMap.get(key); } function createInstanceFromVNode(vNode, instance) { var key = getKeyForVNode(vNode); instanceMap.set(key, instance); } function deleteInstanceForVNode(vNode) { var key = getKeyForVNode(vNode); instanceMap.delete(key); } /** * Create a bridge for exposing Inferno's component tree to React DevTools. * * It creates implementations of the interfaces that ReactDOM passes to * devtools to enable it to query the component tree and hook into component * updates. * * See https://github.com/facebook/react/blob/59ff7749eda0cd858d5ee568315bcba1be75a1ca/src/renderers/dom/ReactDOM.js * for how ReactDOM exports its internals for use by the devtools and * the `attachRenderer()` function in * https://github.com/facebook/react-devtools/blob/e31ec5825342eda570acfc9bcb43a44258fceb28/backend/attachRenderer.js * for how the devtools consumes the resulting objects. */ function createDevToolsBridge() { var ComponentTree = { getNodeFromInstance: function getNodeFromInstance(instance) { return instance.node; }, getClosestInstanceFromNode: function getClosestInstanceFromNode(dom) { var vNode = findVNodeFromDom(null, dom); return vNode ? updateReactComponent(vNode, null) : null; } }; // Map of root ID (the ID is unimportant) to component instance. var roots = {}; findRoots(roots); var Mount = { _instancesByReactRootID: roots, _renderNewRootComponent: function _renderNewRootComponent(instance) { } }; var Reconciler = { mountComponent: function mountComponent(instance) { }, performUpdateIfNecessary: function performUpdateIfNecessary(instance) { }, receiveComponent: function receiveComponent(instance) { }, unmountComponent: function unmountComponent(instance) { } }; var queuedMountComponents = new Map(); var queuedReceiveComponents = new Map(); var queuedUnmountComponents = new Map(); var queueUpdate = function (updater, map, component) { if (!map.has(component)) { map.set(component, true); requestAnimationFrame(function () { updater(component); map.delete(component); }); } }; var queueMountComponent = function (component) { return queueUpdate(Reconciler.mountComponent, queuedMountComponents, component); }; var queueReceiveComponent = function (component) { return queueUpdate(Reconciler.receiveComponent, queuedReceiveComponents, component); }; var queueUnmountComponent = function (component) { return queueUpdate(Reconciler.unmountComponent, queuedUnmountComponents, component); }; /** Notify devtools that a new component instance has been mounted into the DOM. */ var componentAdded = function (vNode) { var instance = updateReactComponent(vNode, null); if (isRootVNode(vNode)) { instance._rootID = nextRootKey(roots); roots[instance._rootID] = instance; Mount._renderNewRootComponent(instance); } visitNonCompositeChildren(instance, function (childInst) { if (childInst) { childInst._inDevTools = true; queueMountComponent(childInst); } }); queueMountComponent(instance); }; /** Notify devtools that a component has been updated with new props/state. */ var componentUpdated = function (vNode) { var prevRenderedChildren = []; visitNonCompositeChildren(getInstanceFromVNode(vNode), function (childInst) { prevRenderedChildren.push(childInst); }); // Notify devtools about updates to this component and any non-composite // children var instance = updateReactComponent(vNode, null); queueReceiveComponent(instance); visitNonCompositeChildren(instance, function (childInst) { if (!childInst._inDevTools) { // New DOM child component childInst._inDevTools = true; queueMountComponent(childInst); } else { // Updated DOM child component queueReceiveComponent(childInst); } }); // For any non-composite children that were removed by the latest render, // remove the corresponding ReactDOMComponent-like instances and notify // the devtools prevRenderedChildren.forEach(function (childInst) { if (!document.body.contains(childInst.node)) { deleteInstanceForVNode(childInst.vNode); queueUnmountComponent(childInst); } }); }; /** Notify devtools that a component has been unmounted from the DOM. */ var componentRemoved = function (vNode) { var instance = updateReactComponent(vNode, null); visitNonCompositeChildren(function (childInst) { deleteInstanceForVNode(childInst.vNode); queueUnmountComponent(childInst); }); queueUnmountComponent(instance); deleteInstanceForVNode(vNode); if (instance._rootID) { delete roots[instance._rootID]; } }; return { componentAdded: componentAdded, componentUpdated: componentUpdated, componentRemoved: componentRemoved, ComponentTree: ComponentTree, Mount: Mount, Reconciler: Reconciler }; } function isRootVNode(vNode) { for (var i = 0; i < inferno.options.roots.length; i++) { var root = inferno.options.roots[i]; if (root.input === vNode) { return true; } } } /** * Update (and create if necessary) the ReactDOMComponent|ReactCompositeComponent-like * instance for a given Inferno component instance or DOM Node. */ function updateReactComponent(vNode, parentDom) { if (!vNode) { return null; } var flags = vNode.flags; var newInstance; if (flags & 28 /* Component */) { newInstance = createReactCompositeComponent(vNode, parentDom); } else { newInstance = createReactDOMComponent(vNode, parentDom); } var oldInstance = getInstanceFromVNode(vNode); if (oldInstance) { Object.assign(oldInstance, newInstance); return oldInstance; } createInstanceFromVNode(vNode, newInstance); return newInstance; } function normalizeChildren(children, dom) { if (isArray(children)) { return children.filter(function (child) { return !isInvalid(child); }).map(function (child) { return updateReactComponent(child, dom); }); } else { return !isInvalid(children) ? [updateReactComponent(children, dom)] : []; } } /** * Create a ReactDOMComponent-compatible object for a given DOM node rendered * by Inferno. * * This implements the subset of the ReactDOMComponent interface that * React DevTools requires in order to display DOM nodes in the inspector with * the correct type and properties. */ function createReactDOMComponent(vNode, parentDom) { var flags = vNode.flags; if (flags & 4096 /* Void */) { return null; } var type = vNode.type; var children = vNode.children; var props = vNode.props; var dom = vNode.dom; var isText = (flags & 1 /* Text */) || isStringOrNumber(vNode); return { _currentElement: isText ? (children || vNode) : { type: type, props: props }, _renderedChildren: !isText && normalizeChildren(children, dom), _stringText: isText ? (children || vNode) : null, _inDevTools: false, node: dom || parentDom, vNode: vNode }; } function normalizeKey(key) { if (key && key[0] === '.') { return null; } } /** * Return a ReactCompositeComponent-compatible object for a given Inferno * component instance. * * This implements the subset of the ReactCompositeComponent interface that * the DevTools requires in order to walk the component tree and inspect the * component's properties. * * See https://github.com/facebook/react-devtools/blob/e31ec5825342eda570acfc9bcb43a44258fceb28/backend/getData.js */ function createReactCompositeComponent(vNode, parentDom) { var type = vNode.type; var instance = vNode.children; var lastInput = instance._lastInput || instance; var dom = vNode.dom; return { getName: function getName() { return typeName(type); }, _currentElement: { type: type, key: normalizeKey(vNode.key), ref: null, props: vNode.props }, props: instance.props, state: instance.state, forceUpdate: instance.forceUpdate.bind(instance), setState: instance.setState.bind(instance), node: dom, _instance: instance, _renderedComponent: updateReactComponent(lastInput, dom), vNode: vNode }; } function nextRootKey(roots) { return '.' + Object.keys(roots).length; } /** * Visit all child instances of a ReactCompositeComponent-like object that are * not composite components (ie. they represent DOM elements or text) */ function visitNonCompositeChildren(component, visitor) { if (component._renderedComponent) { if (!component._renderedComponent._component) { visitor(component._renderedComponent); visitNonCompositeChildren(component._renderedComponent, visitor); } } else if (component._renderedChildren) { component._renderedChildren.forEach(function (child) { if (child) { visitor(child); if (!child._component) { visitNonCompositeChildren(child, visitor); } } }); } } /** * Return the name of a component created by a `ReactElement`-like object. */ function typeName(type) { if (typeof type === 'function') { return type.displayName || type.name; } return type; } /** * Find all root component instances rendered by Inferno in `node`'s children * and add them to the `roots` map. */ function findRoots(roots) { inferno.options.roots.forEach(function (root) { roots[nextRootKey(roots)] = updateReactComponent(root.input, null); }); } var functionalComponentWrappers = new Map(); function wrapFunctionalComponent(vNode) { var originalRender = vNode.type; var name = vNode.type.name || 'Function (anonymous)'; var wrappers = functionalComponentWrappers; if (!wrappers.has(originalRender)) { var wrapper = (function (Component$$1) { function wrapper () { Component$$1.apply(this, arguments); } if ( Component$$1 ) wrapper.__proto__ = Component$$1; wrapper.prototype = Object.create( Component$$1 && Component$$1.prototype ); wrapper.prototype.constructor = wrapper; wrapper.prototype.render = function render (props, state, context) { return originalRender(props, context); }; return wrapper; }(Component)); // Expose the original component name. React Dev Tools will use // this property if it exists or fall back to Function.name // otherwise. /* tslint:disable */ wrapper['displayName'] = name; /* tslint:enable */ wrappers.set(originalRender, wrapper); } vNode.type = wrappers.get(originalRender); vNode.type.defaultProps = originalRender.defaultProps; vNode.ref = null; vNode.flags = 4 /* ComponentClass */; } // Credit: this based on on the great work done with Preact and its devtools // https://github.com/developit/preact/blob/master/devtools/devtools.js function initDevTools() { /* tslint:disable */ if (typeof window['__REACT_DEVTOOLS_GLOBAL_HOOK__'] === 'undefined') { /* tslint:enable */ // React DevTools are not installed return; } var nextVNode = inferno.options.createVNode; inferno.options.createVNode = function (vNode) { var flags = vNode.flags; if ((flags & 28 /* Component */) && !isStatefulComponent(vNode.type)) { wrapFunctionalComponent(vNode); } if (nextVNode) { return nextVNode(vNode); } }; // Notify devtools when preact components are mounted, updated or unmounted var bridge = createDevToolsBridge(); var nextAfterMount = inferno.options.afterMount; inferno.options.afterMount = function (vNode) { bridge.componentAdded(vNode); if (nextAfterMount) { nextAfterMount(vNode); } }; var nextAfterUpdate = inferno.options.afterUpdate; inferno.options.afterUpdate = function (vNode) { bridge.componentUpdated(vNode); if (nextAfterUpdate) { nextAfterUpdate(vNode); } }; var nextBeforeUnmount = inferno.options.beforeUnmount; inferno.options.beforeUnmount = function (vNode) { bridge.componentRemoved(vNode); if (nextBeforeUnmount) { nextBeforeUnmount(vNode); } }; // Notify devtools about this instance of "React" /* tslint:disable */ window['__REACT_DEVTOOLS_GLOBAL_HOOK__'].inject(bridge); /* tslint:enable */ return function () { inferno.options.afterMount = nextAfterMount; inferno.options.afterUpdate = nextAfterUpdate; inferno.options.beforeUnmount = nextBeforeUnmount; }; } initDevTools(); })));
dispatch/static/manager/src/js/components/modals/ImageManager/ImageThumb.js
ubyssey/dispatch
import React from 'react' require('../../../../styles/components/image_thumb.scss') export default function ImageThumb(props) { let style if (props.isSelected) { style = { background: `repeating-linear-gradient( 45deg, rgba(0, 0, 0, 0.2), rgba(0, 0, 0, 0.2) 10px, rgba(0, 0, 0, 0.3) 10px, rgba(0, 0, 0, 0.3) 20px ), url('${props.image.url_thumb}'), center center` } } else { style = { background: `url('${props.image.url_thumb}'), center center` } } const baseClass = 'c-image-thumb' const componentClass = props.isSelected ? `${baseClass} ${baseClass}--selected` : baseClass return ( <div className={componentClass} style={props.width ? { width: props.width} : {}}> <div className='c-image-thumb__inner' onClick={() => props.selectImage(props.image.id)} style={style} /> </div> ) }
react-flux-mui/js/material-ui/src/svg-icons/device/signal-cellular-1-bar.js
pbogdan/react-flux-mui
import React from 'react'; import pure from 'recompose/pure'; import SvgIcon from '../../SvgIcon'; let DeviceSignalCellular1Bar = (props) => ( <SvgIcon {...props}> <path fillOpacity=".3" d="M2 22h20V2z"/><path d="M12 12L2 22h10z"/> </SvgIcon> ); DeviceSignalCellular1Bar = pure(DeviceSignalCellular1Bar); DeviceSignalCellular1Bar.displayName = 'DeviceSignalCellular1Bar'; DeviceSignalCellular1Bar.muiName = 'SvgIcon'; export default DeviceSignalCellular1Bar;
src/components/counter/__tests__/CounterDisplay-test.js
TedChenNZ/js-testing-presentation
import React from 'react'; import chai from 'chai'; import chaiEnzyme from 'chai-enzyme' import { expect } from 'chai'; import { shallow } from 'enzyme'; import CounterDisplay from '../CounterDisplay'; import { PINK, BLUE } from '../../../constants'; chai.use(chaiEnzyme()); describe('CounterDisplay', () => { let wrapper; beforeEach(() => { wrapper = shallow(<CounterDisplay />); }); afterEach(() => { wrapper.unmount(); }); describe('render()', () => { it('displays count from props', () => { wrapper.setProps({ count: 1 }); expect(wrapper.find('#count')).to.have.text('1'); }); }); describe('state', () => { it('click toggles active state', () => { expect(wrapper.state('active')).is.false; wrapper.simulate('click'); expect(wrapper.state('active')).is.true; wrapper.simulate('click'); expect(wrapper.state('active')).is.false; }); }) describe('style()', () => { it('returns a blue color if state is active', () => { wrapper.setState({ active: true, }); const style = wrapper.instance().style(); expect(style).to.have.property('color').which.equals(BLUE); }); it('returns a pink color if state is not active', () => { wrapper.setState({ active: false, }); const style = wrapper.instance().style(); expect(style).to.have.property('color').which.equals(PINK); }); }) });
test/DropdownButtonSpec.js
xsistens/react-bootstrap
import React from 'react'; import ReactTestUtils from 'react/lib/ReactTestUtils'; import DropdownButton from '../src/DropdownButton'; import DropdownMenu from '../src/DropdownMenu'; import MenuItem from '../src/MenuItem'; import { shouldWarn } from './helpers'; describe('DropdownButton', function() { const simpleDropdown = ( <DropdownButton title='Simple Dropdown' id='test-id'> <MenuItem>Item 1</MenuItem> <MenuItem>Item 2</MenuItem> <MenuItem>Item 3</MenuItem> <MenuItem>Item 4</MenuItem> </DropdownButton> ); it('renders title prop', function() { const instance = ReactTestUtils.renderIntoDocument(simpleDropdown); const buttonNode = React.findDOMNode(ReactTestUtils.findRenderedDOMComponentWithTag(instance, 'BUTTON')); buttonNode.innerText.should.match(/Simple Dropdown/); }); it('renders dropdown toggle button', function() { const instance = ReactTestUtils.renderIntoDocument(simpleDropdown); const buttonNode = React.findDOMNode(ReactTestUtils.findRenderedDOMComponentWithTag(instance, 'BUTTON')); buttonNode.tagName.should.equal('BUTTON'); buttonNode.className.should.match(/\bbtn[ $]/); buttonNode.className.should.match(/\bbtn-default\b/); buttonNode.className.should.match(/\bdropdown-toggle\b/); buttonNode.getAttribute('type').should.equal('button'); buttonNode.getAttribute('aria-expanded').should.equal('false'); buttonNode.getAttribute('id').should.be.ok; }); it('renders single MenuItem child', function() { const instance = ReactTestUtils.renderIntoDocument( <DropdownButton title='Single child' id='test-id'> <MenuItem>Item 1</MenuItem> </DropdownButton> ); const menuNode = React.findDOMNode( ReactTestUtils.findRenderedComponentWithType(instance, DropdownMenu)); expect(menuNode.children.length).to.equal(1); }); it('forwards pullRight to menu', function() { const instance = ReactTestUtils.renderIntoDocument( <DropdownButton pullRight title='blah' id='test-id'> <MenuItem>Item 1</MenuItem> </DropdownButton> ); const menu = ReactTestUtils.findRenderedComponentWithType(instance, DropdownMenu); menu.props.pullRight.should.be.true; }); it('renders bsSize', function() { const instance = ReactTestUtils.renderIntoDocument( <DropdownButton title='blah' bsSize='small' id='test-id'> <MenuItem>Item 1</MenuItem> </DropdownButton> ); const node = React.findDOMNode(instance); node.className.should.match(/\bbtn-group-sm\b/); }); it('renders bsStyle', function() { const instance = ReactTestUtils.renderIntoDocument( <DropdownButton title='blah' bsStyle='success' id='test-id'> <MenuItem>Item 1</MenuItem> </DropdownButton> ); const buttonNode = React.findDOMNode(ReactTestUtils.findRenderedDOMComponentWithTag(instance, 'BUTTON')); buttonNode.className.should.match(/\bbtn-success\b/); }); it('forwards onSelect handler to MenuItems', function(done) { const selectedEvents = []; const onSelect = (event, eventKey) => { selectedEvents.push(eventKey); if (selectedEvents.length === 4) { selectedEvents.should.eql(['1', '2', '3', '4']); done(); } }; const instance = ReactTestUtils.renderIntoDocument( <DropdownButton title='Simple Dropdown' onSelect={onSelect} id='test-id'> <MenuItem eventKey='1'>Item 1</MenuItem> <MenuItem eventKey='2'>Item 2</MenuItem> <MenuItem eventKey='3'>Item 3</MenuItem> <MenuItem eventKey='4'>Item 4</MenuItem> </DropdownButton> ); const menuItems = ReactTestUtils.scryRenderedDOMComponentsWithTag(instance, 'A'); menuItems.forEach(item => { ReactTestUtils.Simulate.click(item); }); }); it('closes when child MenuItem is selected', function() { const instance = ReactTestUtils.renderIntoDocument( <DropdownButton title='Simple Dropdown' id='test-id'> <MenuItem eventKey='1'>Item 1</MenuItem> </DropdownButton> ); const node = React.findDOMNode(instance); const buttonNode = React.findDOMNode(ReactTestUtils.findRenderedDOMComponentWithTag(instance, 'BUTTON')); const menuItem = React.findDOMNode( ReactTestUtils.findRenderedDOMComponentWithTag(instance, 'A')); ReactTestUtils.Simulate.click(buttonNode); node.className.should.match(/\bopen\b/); ReactTestUtils.Simulate.click(menuItem); node.className.should.not.match(/\bopen\b/); }); it('does not close when onToggle is controlled', function() { const handleSelect = () => {}; const instance = ReactTestUtils.renderIntoDocument( <DropdownButton title='Simple Dropdown' open={true} onToggle={handleSelect} id='test-id'> <MenuItem eventKey='1'>Item 1</MenuItem> </DropdownButton> ); const node = React.findDOMNode(instance); const buttonNode = React.findDOMNode(ReactTestUtils.findRenderedDOMComponentWithTag(instance, 'BUTTON')); const menuItem = React.findDOMNode( ReactTestUtils.findRenderedDOMComponentWithTag(instance, 'A')); ReactTestUtils.Simulate.click(buttonNode); node.className.should.match(/\bopen\b/); ReactTestUtils.Simulate.click(menuItem); node.className.should.match(/\bopen\b/); }); it('warn about the navItem deprecation', function() { const props = { title: 'some title', navItem: true }; DropdownButton.propTypes.navItem(props, 'navItem', 'DropdownButton'); shouldWarn(/navItem.*NavDropdown component/); }); it('Should pass props to button', function () { const instance = ReactTestUtils.renderIntoDocument( <DropdownButton title="Title" bsStyle="primary" id="testId" disabled> <MenuItem eventKey="1">MenuItem 1 content</MenuItem> <MenuItem eventKey="2">MenuItem 2 content</MenuItem> </DropdownButton> ); const buttonNode = React.findDOMNode( ReactTestUtils.findRenderedDOMComponentWithTag(instance, 'BUTTON')); assert.ok(buttonNode.className.match(/\bbtn-primary\b/)); assert.equal(buttonNode.getAttribute('id'), 'testId'); assert.ok(buttonNode.disabled); }); });
src/scenes/Booking/components/ReservationCard/index.js
galsen0/hair-dv-front
/** * Created by diop on 07/05/2017. */ import React from 'react'; import { Card, Image, Icon , Grid, Rating, Label } from 'semantic-ui-react'; class ReservationCard extends React.Component{ render(){ return( <Grid columns="equal" centered> <Grid.Row> <Grid.Column textAlign={"center"}> <Card fluid> <Image src='../img/front-image-one.jpeg' label={{ as: 'a', color: 'red', content: '15', icon: 'euro', ribbon: true }} /> <Card.Content> <Card.Header>Name</Card.Header> <Card.Meta> <div> <p> Adresse<br/> CP Ville </p> </div> </Card.Meta> <Card.Description> <p text-align="left"> <strong>Type de prestation</strong><br/> Coupe<br/><br/> <strong>Horaires du rendez-vous</strong><br/> Mardi 13 Mai, 14h00<br/><br/> <strong>Durée de la prestation</strong><br/> 30min <br/><br/> </p> </Card.Description> </Card.Content> <Card.Content extra> &nbsp;&nbsp;<Rating icon='star' defaultRating={0} maxRating={5} clearable />&nbsp;20 commentaires </Card.Content> </Card> </Grid.Column> </Grid.Row> <Grid.Row></Grid.Row> </Grid> ); } } export default ReservationCard;
files/videojs/5.0.0-rc.83/video.js
ezekutor/jsdelivr
/** * @license * Video.js 5.0.0-rc.83 <http://videojs.com/> * Copyright Brightcove, Inc. <https://www.brightcove.com/> * Available under Apache License Version 2.0 * <https://github.com/videojs/video.js/blob/master/LICENSE> * * Includes vtt.js <https://github.com/mozilla/vtt.js> * Available under Apache License Version 2.0 * <https://github.com/mozilla/vtt.js/blob/master/LICENSE> */ (function(f){if(typeof exports==="object"&&typeof module!=="undefined"){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.videojs = 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 a(o,!0);if(i)return i(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(_dereq_,module,exports){ (function (global){ var topLevel = typeof global !== 'undefined' ? global : typeof window !== 'undefined' ? window : {} var minDoc = _dereq_('min-document'); if (typeof document !== 'undefined') { module.exports = document; } else { var doccy = topLevel['__GLOBAL_DOCUMENT_CACHE@4']; if (!doccy) { doccy = topLevel['__GLOBAL_DOCUMENT_CACHE@4'] = minDoc; } module.exports = doccy; } }).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {}) //# sourceMappingURL=data:application/json;charset:utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIm5vZGVfbW9kdWxlcy9nbG9iYWwvZG9jdW1lbnQuanMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IjtBQUFBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBIiwiZmlsZSI6ImdlbmVyYXRlZC5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzQ29udGVudCI6WyJ2YXIgdG9wTGV2ZWwgPSB0eXBlb2YgZ2xvYmFsICE9PSAndW5kZWZpbmVkJyA/IGdsb2JhbCA6XG4gICAgdHlwZW9mIHdpbmRvdyAhPT0gJ3VuZGVmaW5lZCcgPyB3aW5kb3cgOiB7fVxudmFyIG1pbkRvYyA9IHJlcXVpcmUoJ21pbi1kb2N1bWVudCcpO1xuXG5pZiAodHlwZW9mIGRvY3VtZW50ICE9PSAndW5kZWZpbmVkJykge1xuICAgIG1vZHVsZS5leHBvcnRzID0gZG9jdW1lbnQ7XG59IGVsc2Uge1xuICAgIHZhciBkb2NjeSA9IHRvcExldmVsWydfX0dMT0JBTF9ET0NVTUVOVF9DQUNIRUA0J107XG5cbiAgICBpZiAoIWRvY2N5KSB7XG4gICAgICAgIGRvY2N5ID0gdG9wTGV2ZWxbJ19fR0xPQkFMX0RPQ1VNRU5UX0NBQ0hFQDQnXSA9IG1pbkRvYztcbiAgICB9XG5cbiAgICBtb2R1bGUuZXhwb3J0cyA9IGRvY2N5O1xufVxuIl19 },{"min-document":3}],2:[function(_dereq_,module,exports){ (function (global){ if (typeof window !== "undefined") { module.exports = window; } else if (typeof global !== "undefined") { module.exports = global; } else if (typeof self !== "undefined"){ module.exports = self; } else { module.exports = {}; } }).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {}) //# sourceMappingURL=data:application/json;charset:utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIm5vZGVfbW9kdWxlcy9nbG9iYWwvd2luZG93LmpzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7QUFBQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQSIsImZpbGUiOiJnZW5lcmF0ZWQuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlc0NvbnRlbnQiOlsiaWYgKHR5cGVvZiB3aW5kb3cgIT09IFwidW5kZWZpbmVkXCIpIHtcbiAgICBtb2R1bGUuZXhwb3J0cyA9IHdpbmRvdztcbn0gZWxzZSBpZiAodHlwZW9mIGdsb2JhbCAhPT0gXCJ1bmRlZmluZWRcIikge1xuICAgIG1vZHVsZS5leHBvcnRzID0gZ2xvYmFsO1xufSBlbHNlIGlmICh0eXBlb2Ygc2VsZiAhPT0gXCJ1bmRlZmluZWRcIil7XG4gICAgbW9kdWxlLmV4cG9ydHMgPSBzZWxmO1xufSBlbHNlIHtcbiAgICBtb2R1bGUuZXhwb3J0cyA9IHt9O1xufVxuIl19 },{}],3:[function(_dereq_,module,exports){ },{}],4:[function(_dereq_,module,exports){ /** Used as the `TypeError` message for "Functions" methods. */ var FUNC_ERROR_TEXT = 'Expected a function'; /* Native method references for those with the same name as other `lodash` methods. */ var nativeMax = Math.max; /** * Creates a function that invokes `func` with the `this` binding of the * created function and arguments from `start` and beyond provided as an array. * * **Note:** This method is based on the [rest parameter](https://developer.mozilla.org/Web/JavaScript/Reference/Functions/rest_parameters). * * @static * @memberOf _ * @category Function * @param {Function} func The function to apply a rest parameter to. * @param {number} [start=func.length-1] The start position of the rest parameter. * @returns {Function} Returns the new function. * @example * * var say = _.restParam(function(what, names) { * return what + ' ' + _.initial(names).join(', ') + * (_.size(names) > 1 ? ', & ' : '') + _.last(names); * }); * * say('hello', 'fred', 'barney', 'pebbles'); * // => 'hello fred, barney, & pebbles' */ function restParam(func, start) { if (typeof func != 'function') { throw new TypeError(FUNC_ERROR_TEXT); } start = nativeMax(start === undefined ? (func.length - 1) : (+start || 0), 0); return function() { var args = arguments, index = -1, length = nativeMax(args.length - start, 0), rest = Array(length); while (++index < length) { rest[index] = args[start + index]; } switch (start) { case 0: return func.call(this, rest); case 1: return func.call(this, args[0], rest); case 2: return func.call(this, args[0], args[1], rest); } var otherArgs = Array(start + 1); index = -1; while (++index < start) { otherArgs[index] = args[index]; } otherArgs[start] = rest; return func.apply(this, otherArgs); }; } module.exports = restParam; },{}],5:[function(_dereq_,module,exports){ /** * Copies the values of `source` to `array`. * * @private * @param {Array} source The array to copy values from. * @param {Array} [array=[]] The array to copy values to. * @returns {Array} Returns `array`. */ function arrayCopy(source, array) { var index = -1, length = source.length; array || (array = Array(length)); while (++index < length) { array[index] = source[index]; } return array; } module.exports = arrayCopy; },{}],6:[function(_dereq_,module,exports){ /** * A specialized version of `_.forEach` for arrays without support for callback * shorthands and `this` binding. * * @private * @param {Array} array The array to iterate over. * @param {Function} iteratee The function invoked per iteration. * @returns {Array} Returns `array`. */ function arrayEach(array, iteratee) { var index = -1, length = array.length; while (++index < length) { if (iteratee(array[index], index, array) === false) { break; } } return array; } module.exports = arrayEach; },{}],7:[function(_dereq_,module,exports){ /** * Copies properties of `source` to `object`. * * @private * @param {Object} source The object to copy properties from. * @param {Array} props The property names to copy. * @param {Object} [object={}] The object to copy properties to. * @returns {Object} Returns `object`. */ function baseCopy(source, props, object) { object || (object = {}); var index = -1, length = props.length; while (++index < length) { var key = props[index]; object[key] = source[key]; } return object; } module.exports = baseCopy; },{}],8:[function(_dereq_,module,exports){ var createBaseFor = _dereq_('./createBaseFor'); /** * The base implementation of `baseForIn` and `baseForOwn` which iterates * over `object` properties returned by `keysFunc` invoking `iteratee` for * each property. Iteratee functions may exit iteration early by explicitly * returning `false`. * * @private * @param {Object} object The object to iterate over. * @param {Function} iteratee The function invoked per iteration. * @param {Function} keysFunc The function to get the keys of `object`. * @returns {Object} Returns `object`. */ var baseFor = createBaseFor(); module.exports = baseFor; },{"./createBaseFor":15}],9:[function(_dereq_,module,exports){ var baseFor = _dereq_('./baseFor'), keysIn = _dereq_('../object/keysIn'); /** * The base implementation of `_.forIn` without support for callback * shorthands and `this` binding. * * @private * @param {Object} object The object to iterate over. * @param {Function} iteratee The function invoked per iteration. * @returns {Object} Returns `object`. */ function baseForIn(object, iteratee) { return baseFor(object, iteratee, keysIn); } module.exports = baseForIn; },{"../object/keysIn":36,"./baseFor":8}],10:[function(_dereq_,module,exports){ var arrayEach = _dereq_('./arrayEach'), baseMergeDeep = _dereq_('./baseMergeDeep'), isArray = _dereq_('../lang/isArray'), isArrayLike = _dereq_('./isArrayLike'), isObject = _dereq_('../lang/isObject'), isObjectLike = _dereq_('./isObjectLike'), isTypedArray = _dereq_('../lang/isTypedArray'), keys = _dereq_('../object/keys'); /** * The base implementation of `_.merge` without support for argument juggling, * multiple sources, and `this` binding `customizer` functions. * * @private * @param {Object} object The destination object. * @param {Object} source The source object. * @param {Function} [customizer] The function to customize merged values. * @param {Array} [stackA=[]] Tracks traversed source objects. * @param {Array} [stackB=[]] Associates values with source counterparts. * @returns {Object} Returns `object`. */ function baseMerge(object, source, customizer, stackA, stackB) { if (!isObject(object)) { return object; } var isSrcArr = isArrayLike(source) && (isArray(source) || isTypedArray(source)), props = isSrcArr ? undefined : keys(source); arrayEach(props || source, function(srcValue, key) { if (props) { key = srcValue; srcValue = source[key]; } if (isObjectLike(srcValue)) { stackA || (stackA = []); stackB || (stackB = []); baseMergeDeep(object, source, key, baseMerge, customizer, stackA, stackB); } else { var value = object[key], result = customizer ? customizer(value, srcValue, key, object, source) : undefined, isCommon = result === undefined; if (isCommon) { result = srcValue; } if ((result !== undefined || (isSrcArr && !(key in object))) && (isCommon || (result === result ? (result !== value) : (value === value)))) { object[key] = result; } } }); return object; } module.exports = baseMerge; },{"../lang/isArray":27,"../lang/isObject":30,"../lang/isTypedArray":33,"../object/keys":35,"./arrayEach":6,"./baseMergeDeep":11,"./isArrayLike":18,"./isObjectLike":23}],11:[function(_dereq_,module,exports){ var arrayCopy = _dereq_('./arrayCopy'), isArguments = _dereq_('../lang/isArguments'), isArray = _dereq_('../lang/isArray'), isArrayLike = _dereq_('./isArrayLike'), isPlainObject = _dereq_('../lang/isPlainObject'), isTypedArray = _dereq_('../lang/isTypedArray'), toPlainObject = _dereq_('../lang/toPlainObject'); /** * A specialized version of `baseMerge` for arrays and objects which performs * deep merges and tracks traversed objects enabling objects with circular * references to be merged. * * @private * @param {Object} object The destination object. * @param {Object} source The source object. * @param {string} key The key of the value to merge. * @param {Function} mergeFunc The function to merge values. * @param {Function} [customizer] The function to customize merged values. * @param {Array} [stackA=[]] Tracks traversed source objects. * @param {Array} [stackB=[]] Associates values with source counterparts. * @returns {boolean} Returns `true` if the objects are equivalent, else `false`. */ function baseMergeDeep(object, source, key, mergeFunc, customizer, stackA, stackB) { var length = stackA.length, srcValue = source[key]; while (length--) { if (stackA[length] == srcValue) { object[key] = stackB[length]; return; } } var value = object[key], result = customizer ? customizer(value, srcValue, key, object, source) : undefined, isCommon = result === undefined; if (isCommon) { result = srcValue; if (isArrayLike(srcValue) && (isArray(srcValue) || isTypedArray(srcValue))) { result = isArray(value) ? value : (isArrayLike(value) ? arrayCopy(value) : []); } else if (isPlainObject(srcValue) || isArguments(srcValue)) { result = isArguments(value) ? toPlainObject(value) : (isPlainObject(value) ? value : {}); } else { isCommon = false; } } // Add the source value to the stack of traversed objects and associate // it with its merged value. stackA.push(srcValue); stackB.push(result); if (isCommon) { // Recursively merge objects and arrays (susceptible to call stack limits). object[key] = mergeFunc(result, srcValue, customizer, stackA, stackB); } else if (result === result ? (result !== value) : (value === value)) { object[key] = result; } } module.exports = baseMergeDeep; },{"../lang/isArguments":26,"../lang/isArray":27,"../lang/isPlainObject":31,"../lang/isTypedArray":33,"../lang/toPlainObject":34,"./arrayCopy":5,"./isArrayLike":18}],12:[function(_dereq_,module,exports){ var toObject = _dereq_('./toObject'); /** * The base implementation of `_.property` without support for deep paths. * * @private * @param {string} key The key of the property to get. * @returns {Function} Returns the new function. */ function baseProperty(key) { return function(object) { return object == null ? undefined : toObject(object)[key]; }; } module.exports = baseProperty; },{"./toObject":25}],13:[function(_dereq_,module,exports){ var identity = _dereq_('../utility/identity'); /** * A specialized version of `baseCallback` which only supports `this` binding * and specifying the number of arguments to provide to `func`. * * @private * @param {Function} func The function to bind. * @param {*} thisArg The `this` binding of `func`. * @param {number} [argCount] The number of arguments to provide to `func`. * @returns {Function} Returns the callback. */ function bindCallback(func, thisArg, argCount) { if (typeof func != 'function') { return identity; } if (thisArg === undefined) { return func; } switch (argCount) { case 1: return function(value) { return func.call(thisArg, value); }; case 3: return function(value, index, collection) { return func.call(thisArg, value, index, collection); }; case 4: return function(accumulator, value, index, collection) { return func.call(thisArg, accumulator, value, index, collection); }; case 5: return function(value, other, key, object, source) { return func.call(thisArg, value, other, key, object, source); }; } return function() { return func.apply(thisArg, arguments); }; } module.exports = bindCallback; },{"../utility/identity":39}],14:[function(_dereq_,module,exports){ var bindCallback = _dereq_('./bindCallback'), isIterateeCall = _dereq_('./isIterateeCall'), restParam = _dereq_('../function/restParam'); /** * Creates a `_.assign`, `_.defaults`, or `_.merge` function. * * @private * @param {Function} assigner The function to assign values. * @returns {Function} Returns the new assigner function. */ function createAssigner(assigner) { return restParam(function(object, sources) { var index = -1, length = object == null ? 0 : sources.length, customizer = length > 2 ? sources[length - 2] : undefined, guard = length > 2 ? sources[2] : undefined, thisArg = length > 1 ? sources[length - 1] : undefined; if (typeof customizer == 'function') { customizer = bindCallback(customizer, thisArg, 5); length -= 2; } else { customizer = typeof thisArg == 'function' ? thisArg : undefined; length -= (customizer ? 1 : 0); } if (guard && isIterateeCall(sources[0], sources[1], guard)) { customizer = length < 3 ? undefined : customizer; length = 1; } while (++index < length) { var source = sources[index]; if (source) { assigner(object, source, customizer); } } return object; }); } module.exports = createAssigner; },{"../function/restParam":4,"./bindCallback":13,"./isIterateeCall":21}],15:[function(_dereq_,module,exports){ var toObject = _dereq_('./toObject'); /** * Creates a base function for `_.forIn` or `_.forInRight`. * * @private * @param {boolean} [fromRight] Specify iterating from right to left. * @returns {Function} Returns the new base function. */ function createBaseFor(fromRight) { return function(object, iteratee, keysFunc) { var iterable = toObject(object), props = keysFunc(object), length = props.length, index = fromRight ? length : -1; while ((fromRight ? index-- : ++index < length)) { var key = props[index]; if (iteratee(iterable[key], key, iterable) === false) { break; } } return object; }; } module.exports = createBaseFor; },{"./toObject":25}],16:[function(_dereq_,module,exports){ var baseProperty = _dereq_('./baseProperty'); /** * Gets the "length" property value of `object`. * * **Note:** This function is used to avoid a [JIT bug](https://bugs.webkit.org/show_bug.cgi?id=142792) * that affects Safari on at least iOS 8.1-8.3 ARM64. * * @private * @param {Object} object The object to query. * @returns {*} Returns the "length" value. */ var getLength = baseProperty('length'); module.exports = getLength; },{"./baseProperty":12}],17:[function(_dereq_,module,exports){ var isNative = _dereq_('../lang/isNative'); /** * Gets the native function at `key` of `object`. * * @private * @param {Object} object The object to query. * @param {string} key The key of the method to get. * @returns {*} Returns the function if it's native, else `undefined`. */ function getNative(object, key) { var value = object == null ? undefined : object[key]; return isNative(value) ? value : undefined; } module.exports = getNative; },{"../lang/isNative":29}],18:[function(_dereq_,module,exports){ var getLength = _dereq_('./getLength'), isLength = _dereq_('./isLength'); /** * Checks if `value` is array-like. * * @private * @param {*} value The value to check. * @returns {boolean} Returns `true` if `value` is array-like, else `false`. */ function isArrayLike(value) { return value != null && isLength(getLength(value)); } module.exports = isArrayLike; },{"./getLength":16,"./isLength":22}],19:[function(_dereq_,module,exports){ /** * Checks if `value` is a host object in IE < 9. * * @private * @param {*} value The value to check. * @returns {boolean} Returns `true` if `value` is a host object, else `false`. */ var isHostObject = (function() { try { Object({ 'toString': 0 } + ''); } catch(e) { return function() { return false; }; } return function(value) { // IE < 9 presents many host objects as `Object` objects that can coerce // to strings despite having improperly defined `toString` methods. return typeof value.toString != 'function' && typeof (value + '') == 'string'; }; }()); module.exports = isHostObject; },{}],20:[function(_dereq_,module,exports){ /** Used to detect unsigned integer values. */ var reIsUint = /^\d+$/; /** * Used as the [maximum length](http://ecma-international.org/ecma-262/6.0/#sec-number.max_safe_integer) * of an array-like value. */ var MAX_SAFE_INTEGER = 9007199254740991; /** * Checks if `value` is a valid array-like index. * * @private * @param {*} value The value to check. * @param {number} [length=MAX_SAFE_INTEGER] The upper bounds of a valid index. * @returns {boolean} Returns `true` if `value` is a valid index, else `false`. */ function isIndex(value, length) { value = (typeof value == 'number' || reIsUint.test(value)) ? +value : -1; length = length == null ? MAX_SAFE_INTEGER : length; return value > -1 && value % 1 == 0 && value < length; } module.exports = isIndex; },{}],21:[function(_dereq_,module,exports){ var isArrayLike = _dereq_('./isArrayLike'), isIndex = _dereq_('./isIndex'), isObject = _dereq_('../lang/isObject'); /** * Checks if the provided arguments are from an iteratee call. * * @private * @param {*} value The potential iteratee value argument. * @param {*} index The potential iteratee index or key argument. * @param {*} object The potential iteratee object argument. * @returns {boolean} Returns `true` if the arguments are from an iteratee call, else `false`. */ function isIterateeCall(value, index, object) { if (!isObject(object)) { return false; } var type = typeof index; if (type == 'number' ? (isArrayLike(object) && isIndex(index, object.length)) : (type == 'string' && index in object)) { var other = object[index]; return value === value ? (value === other) : (other !== other); } return false; } module.exports = isIterateeCall; },{"../lang/isObject":30,"./isArrayLike":18,"./isIndex":20}],22:[function(_dereq_,module,exports){ /** * Used as the [maximum length](http://ecma-international.org/ecma-262/6.0/#sec-number.max_safe_integer) * of an array-like value. */ var MAX_SAFE_INTEGER = 9007199254740991; /** * Checks if `value` is a valid array-like length. * * **Note:** This function is based on [`ToLength`](http://ecma-international.org/ecma-262/6.0/#sec-tolength). * * @private * @param {*} value The value to check. * @returns {boolean} Returns `true` if `value` is a valid length, else `false`. */ function isLength(value) { return typeof value == 'number' && value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER; } module.exports = isLength; },{}],23:[function(_dereq_,module,exports){ /** * Checks if `value` is object-like. * * @private * @param {*} value The value to check. * @returns {boolean} Returns `true` if `value` is object-like, else `false`. */ function isObjectLike(value) { return !!value && typeof value == 'object'; } module.exports = isObjectLike; },{}],24:[function(_dereq_,module,exports){ var isArguments = _dereq_('../lang/isArguments'), isArray = _dereq_('../lang/isArray'), isIndex = _dereq_('./isIndex'), isLength = _dereq_('./isLength'), isString = _dereq_('../lang/isString'), keysIn = _dereq_('../object/keysIn'); /** Used for native method references. */ var objectProto = Object.prototype; /** Used to check objects for own properties. */ var hasOwnProperty = objectProto.hasOwnProperty; /** * A fallback implementation of `Object.keys` which creates an array of the * own enumerable property names of `object`. * * @private * @param {Object} object The object to query. * @returns {Array} Returns the array of property names. */ function shimKeys(object) { var props = keysIn(object), propsLength = props.length, length = propsLength && object.length; var allowIndexes = !!length && isLength(length) && (isArray(object) || isArguments(object) || isString(object)); var index = -1, result = []; while (++index < propsLength) { var key = props[index]; if ((allowIndexes && isIndex(key, length)) || hasOwnProperty.call(object, key)) { result.push(key); } } return result; } module.exports = shimKeys; },{"../lang/isArguments":26,"../lang/isArray":27,"../lang/isString":32,"../object/keysIn":36,"./isIndex":20,"./isLength":22}],25:[function(_dereq_,module,exports){ var isObject = _dereq_('../lang/isObject'), isString = _dereq_('../lang/isString'), support = _dereq_('../support'); /** * Converts `value` to an object if it's not one. * * @private * @param {*} value The value to process. * @returns {Object} Returns the object. */ function toObject(value) { if (support.unindexedChars && isString(value)) { var index = -1, length = value.length, result = Object(value); while (++index < length) { result[index] = value.charAt(index); } return result; } return isObject(value) ? value : Object(value); } module.exports = toObject; },{"../lang/isObject":30,"../lang/isString":32,"../support":38}],26:[function(_dereq_,module,exports){ var isArrayLike = _dereq_('../internal/isArrayLike'), isObjectLike = _dereq_('../internal/isObjectLike'); /** Used for native method references. */ var objectProto = Object.prototype; /** Used to check objects for own properties. */ var hasOwnProperty = objectProto.hasOwnProperty; /** Native method references. */ var propertyIsEnumerable = objectProto.propertyIsEnumerable; /** * Checks if `value` is classified as an `arguments` object. * * @static * @memberOf _ * @category Lang * @param {*} value The value to check. * @returns {boolean} Returns `true` if `value` is correctly classified, else `false`. * @example * * _.isArguments(function() { return arguments; }()); * // => true * * _.isArguments([1, 2, 3]); * // => false */ function isArguments(value) { return isObjectLike(value) && isArrayLike(value) && hasOwnProperty.call(value, 'callee') && !propertyIsEnumerable.call(value, 'callee'); } module.exports = isArguments; },{"../internal/isArrayLike":18,"../internal/isObjectLike":23}],27:[function(_dereq_,module,exports){ var getNative = _dereq_('../internal/getNative'), isLength = _dereq_('../internal/isLength'), isObjectLike = _dereq_('../internal/isObjectLike'); /** `Object#toString` result references. */ var arrayTag = '[object Array]'; /** Used for native method references. */ var objectProto = Object.prototype; /** * Used to resolve the [`toStringTag`](http://ecma-international.org/ecma-262/6.0/#sec-object.prototype.tostring) * of values. */ var objToString = objectProto.toString; /* Native method references for those with the same name as other `lodash` methods. */ var nativeIsArray = getNative(Array, 'isArray'); /** * Checks if `value` is classified as an `Array` object. * * @static * @memberOf _ * @category Lang * @param {*} value The value to check. * @returns {boolean} Returns `true` if `value` is correctly classified, else `false`. * @example * * _.isArray([1, 2, 3]); * // => true * * _.isArray(function() { return arguments; }()); * // => false */ var isArray = nativeIsArray || function(value) { return isObjectLike(value) && isLength(value.length) && objToString.call(value) == arrayTag; }; module.exports = isArray; },{"../internal/getNative":17,"../internal/isLength":22,"../internal/isObjectLike":23}],28:[function(_dereq_,module,exports){ var isObject = _dereq_('./isObject'); /** `Object#toString` result references. */ var funcTag = '[object Function]'; /** Used for native method references. */ var objectProto = Object.prototype; /** * Used to resolve the [`toStringTag`](http://ecma-international.org/ecma-262/6.0/#sec-object.prototype.tostring) * of values. */ var objToString = objectProto.toString; /** * Checks if `value` is classified as a `Function` object. * * @static * @memberOf _ * @category Lang * @param {*} value The value to check. * @returns {boolean} Returns `true` if `value` is correctly classified, else `false`. * @example * * _.isFunction(_); * // => true * * _.isFunction(/abc/); * // => false */ function isFunction(value) { // The use of `Object#toString` avoids issues with the `typeof` operator // in older versions of Chrome and Safari which return 'function' for regexes // and Safari 8 which returns 'object' for typed array constructors. return isObject(value) && objToString.call(value) == funcTag; } module.exports = isFunction; },{"./isObject":30}],29:[function(_dereq_,module,exports){ var isFunction = _dereq_('./isFunction'), isHostObject = _dereq_('../internal/isHostObject'), isObjectLike = _dereq_('../internal/isObjectLike'); /** Used to detect host constructors (Safari > 5). */ var reIsHostCtor = /^\[object .+?Constructor\]$/; /** Used for native method references. */ var objectProto = Object.prototype; /** Used to resolve the decompiled source of functions. */ var fnToString = Function.prototype.toString; /** Used to check objects for own properties. */ var hasOwnProperty = objectProto.hasOwnProperty; /** Used to detect if a method is native. */ var reIsNative = RegExp('^' + fnToString.call(hasOwnProperty).replace(/[\\^$.*+?()[\]{}|]/g, '\\$&') .replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, '$1.*?') + '$' ); /** * Checks if `value` is a native function. * * @static * @memberOf _ * @category Lang * @param {*} value The value to check. * @returns {boolean} Returns `true` if `value` is a native function, else `false`. * @example * * _.isNative(Array.prototype.push); * // => true * * _.isNative(_); * // => false */ function isNative(value) { if (value == null) { return false; } if (isFunction(value)) { return reIsNative.test(fnToString.call(value)); } return isObjectLike(value) && (isHostObject(value) ? reIsNative : reIsHostCtor).test(value); } module.exports = isNative; },{"../internal/isHostObject":19,"../internal/isObjectLike":23,"./isFunction":28}],30:[function(_dereq_,module,exports){ /** * Checks if `value` is the [language type](https://es5.github.io/#x8) of `Object`. * (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`) * * @static * @memberOf _ * @category Lang * @param {*} value The value to check. * @returns {boolean} Returns `true` if `value` is an object, else `false`. * @example * * _.isObject({}); * // => true * * _.isObject([1, 2, 3]); * // => true * * _.isObject(1); * // => false */ function isObject(value) { // Avoid a V8 JIT bug in Chrome 19-20. // See https://code.google.com/p/v8/issues/detail?id=2291 for more details. var type = typeof value; return !!value && (type == 'object' || type == 'function'); } module.exports = isObject; },{}],31:[function(_dereq_,module,exports){ var baseForIn = _dereq_('../internal/baseForIn'), isArguments = _dereq_('./isArguments'), isHostObject = _dereq_('../internal/isHostObject'), isObjectLike = _dereq_('../internal/isObjectLike'), support = _dereq_('../support'); /** `Object#toString` result references. */ var objectTag = '[object Object]'; /** Used for native method references. */ var objectProto = Object.prototype; /** Used to check objects for own properties. */ var hasOwnProperty = objectProto.hasOwnProperty; /** * Used to resolve the [`toStringTag`](http://ecma-international.org/ecma-262/6.0/#sec-object.prototype.tostring) * of values. */ var objToString = objectProto.toString; /** * Checks if `value` is a plain object, that is, an object created by the * `Object` constructor or one with a `[[Prototype]]` of `null`. * * **Note:** This method assumes objects created by the `Object` constructor * have no inherited enumerable properties. * * @static * @memberOf _ * @category Lang * @param {*} value The value to check. * @returns {boolean} Returns `true` if `value` is a plain object, else `false`. * @example * * function Foo() { * this.a = 1; * } * * _.isPlainObject(new Foo); * // => false * * _.isPlainObject([1, 2, 3]); * // => false * * _.isPlainObject({ 'x': 0, 'y': 0 }); * // => true * * _.isPlainObject(Object.create(null)); * // => true */ function isPlainObject(value) { var Ctor; // Exit early for non `Object` objects. if (!(isObjectLike(value) && objToString.call(value) == objectTag && !isHostObject(value) && !isArguments(value)) || (!hasOwnProperty.call(value, 'constructor') && (Ctor = value.constructor, typeof Ctor == 'function' && !(Ctor instanceof Ctor)))) { return false; } // IE < 9 iterates inherited properties before own properties. If the first // iterated property is an object's own property then there are no inherited // enumerable properties. var result; if (support.ownLast) { baseForIn(value, function(subValue, key, object) { result = hasOwnProperty.call(object, key); return false; }); return result !== false; } // In most environments an object's own properties are iterated before // its inherited properties. If the last iterated property is an object's // own property then there are no inherited enumerable properties. baseForIn(value, function(subValue, key) { result = key; }); return result === undefined || hasOwnProperty.call(value, result); } module.exports = isPlainObject; },{"../internal/baseForIn":9,"../internal/isHostObject":19,"../internal/isObjectLike":23,"../support":38,"./isArguments":26}],32:[function(_dereq_,module,exports){ var isObjectLike = _dereq_('../internal/isObjectLike'); /** `Object#toString` result references. */ var stringTag = '[object String]'; /** Used for native method references. */ var objectProto = Object.prototype; /** * Used to resolve the [`toStringTag`](http://ecma-international.org/ecma-262/6.0/#sec-object.prototype.tostring) * of values. */ var objToString = objectProto.toString; /** * Checks if `value` is classified as a `String` primitive or object. * * @static * @memberOf _ * @category Lang * @param {*} value The value to check. * @returns {boolean} Returns `true` if `value` is correctly classified, else `false`. * @example * * _.isString('abc'); * // => true * * _.isString(1); * // => false */ function isString(value) { return typeof value == 'string' || (isObjectLike(value) && objToString.call(value) == stringTag); } module.exports = isString; },{"../internal/isObjectLike":23}],33:[function(_dereq_,module,exports){ var isLength = _dereq_('../internal/isLength'), isObjectLike = _dereq_('../internal/isObjectLike'); /** `Object#toString` result references. */ var argsTag = '[object Arguments]', arrayTag = '[object Array]', boolTag = '[object Boolean]', dateTag = '[object Date]', errorTag = '[object Error]', funcTag = '[object Function]', mapTag = '[object Map]', numberTag = '[object Number]', objectTag = '[object Object]', regexpTag = '[object RegExp]', setTag = '[object Set]', stringTag = '[object String]', weakMapTag = '[object WeakMap]'; var arrayBufferTag = '[object ArrayBuffer]', float32Tag = '[object Float32Array]', float64Tag = '[object Float64Array]', int8Tag = '[object Int8Array]', int16Tag = '[object Int16Array]', int32Tag = '[object Int32Array]', uint8Tag = '[object Uint8Array]', uint8ClampedTag = '[object Uint8ClampedArray]', uint16Tag = '[object Uint16Array]', uint32Tag = '[object Uint32Array]'; /** Used to identify `toStringTag` values of typed arrays. */ var typedArrayTags = {}; typedArrayTags[float32Tag] = typedArrayTags[float64Tag] = typedArrayTags[int8Tag] = typedArrayTags[int16Tag] = typedArrayTags[int32Tag] = typedArrayTags[uint8Tag] = typedArrayTags[uint8ClampedTag] = typedArrayTags[uint16Tag] = typedArrayTags[uint32Tag] = true; typedArrayTags[argsTag] = typedArrayTags[arrayTag] = typedArrayTags[arrayBufferTag] = typedArrayTags[boolTag] = typedArrayTags[dateTag] = typedArrayTags[errorTag] = typedArrayTags[funcTag] = typedArrayTags[mapTag] = typedArrayTags[numberTag] = typedArrayTags[objectTag] = typedArrayTags[regexpTag] = typedArrayTags[setTag] = typedArrayTags[stringTag] = typedArrayTags[weakMapTag] = false; /** Used for native method references. */ var objectProto = Object.prototype; /** * Used to resolve the [`toStringTag`](http://ecma-international.org/ecma-262/6.0/#sec-object.prototype.tostring) * of values. */ var objToString = objectProto.toString; /** * Checks if `value` is classified as a typed array. * * @static * @memberOf _ * @category Lang * @param {*} value The value to check. * @returns {boolean} Returns `true` if `value` is correctly classified, else `false`. * @example * * _.isTypedArray(new Uint8Array); * // => true * * _.isTypedArray([]); * // => false */ function isTypedArray(value) { return isObjectLike(value) && isLength(value.length) && !!typedArrayTags[objToString.call(value)]; } module.exports = isTypedArray; },{"../internal/isLength":22,"../internal/isObjectLike":23}],34:[function(_dereq_,module,exports){ var baseCopy = _dereq_('../internal/baseCopy'), keysIn = _dereq_('../object/keysIn'); /** * Converts `value` to a plain object flattening inherited enumerable * properties of `value` to own properties of the plain object. * * @static * @memberOf _ * @category Lang * @param {*} value The value to convert. * @returns {Object} Returns the converted plain object. * @example * * function Foo() { * this.b = 2; * } * * Foo.prototype.c = 3; * * _.assign({ 'a': 1 }, new Foo); * // => { 'a': 1, 'b': 2 } * * _.assign({ 'a': 1 }, _.toPlainObject(new Foo)); * // => { 'a': 1, 'b': 2, 'c': 3 } */ function toPlainObject(value) { return baseCopy(value, keysIn(value)); } module.exports = toPlainObject; },{"../internal/baseCopy":7,"../object/keysIn":36}],35:[function(_dereq_,module,exports){ var getNative = _dereq_('../internal/getNative'), isArrayLike = _dereq_('../internal/isArrayLike'), isObject = _dereq_('../lang/isObject'), shimKeys = _dereq_('../internal/shimKeys'), support = _dereq_('../support'); /* Native method references for those with the same name as other `lodash` methods. */ var nativeKeys = getNative(Object, 'keys'); /** * Creates an array of the own enumerable property names of `object`. * * **Note:** Non-object values are coerced to objects. See the * [ES spec](http://ecma-international.org/ecma-262/6.0/#sec-object.keys) * for more details. * * @static * @memberOf _ * @category Object * @param {Object} object The object to query. * @returns {Array} Returns the array of property names. * @example * * function Foo() { * this.a = 1; * this.b = 2; * } * * Foo.prototype.c = 3; * * _.keys(new Foo); * // => ['a', 'b'] (iteration order is not guaranteed) * * _.keys('hi'); * // => ['0', '1'] */ var keys = !nativeKeys ? shimKeys : function(object) { var Ctor = object == null ? undefined : object.constructor; if ((typeof Ctor == 'function' && Ctor.prototype === object) || (typeof object == 'function' ? support.enumPrototypes : isArrayLike(object))) { return shimKeys(object); } return isObject(object) ? nativeKeys(object) : []; }; module.exports = keys; },{"../internal/getNative":17,"../internal/isArrayLike":18,"../internal/shimKeys":24,"../lang/isObject":30,"../support":38}],36:[function(_dereq_,module,exports){ var arrayEach = _dereq_('../internal/arrayEach'), isArguments = _dereq_('../lang/isArguments'), isArray = _dereq_('../lang/isArray'), isFunction = _dereq_('../lang/isFunction'), isIndex = _dereq_('../internal/isIndex'), isLength = _dereq_('../internal/isLength'), isObject = _dereq_('../lang/isObject'), isString = _dereq_('../lang/isString'), support = _dereq_('../support'); /** `Object#toString` result references. */ var arrayTag = '[object Array]', boolTag = '[object Boolean]', dateTag = '[object Date]', errorTag = '[object Error]', funcTag = '[object Function]', numberTag = '[object Number]', objectTag = '[object Object]', regexpTag = '[object RegExp]', stringTag = '[object String]'; /** Used to fix the JScript `[[DontEnum]]` bug. */ var shadowProps = [ 'constructor', 'hasOwnProperty', 'isPrototypeOf', 'propertyIsEnumerable', 'toLocaleString', 'toString', 'valueOf' ]; /** Used for native method references. */ var errorProto = Error.prototype, objectProto = Object.prototype, stringProto = String.prototype; /** Used to check objects for own properties. */ var hasOwnProperty = objectProto.hasOwnProperty; /** * Used to resolve the [`toStringTag`](http://ecma-international.org/ecma-262/6.0/#sec-object.prototype.tostring) * of values. */ var objToString = objectProto.toString; /** Used to avoid iterating over non-enumerable properties in IE < 9. */ var nonEnumProps = {}; nonEnumProps[arrayTag] = nonEnumProps[dateTag] = nonEnumProps[numberTag] = { 'constructor': true, 'toLocaleString': true, 'toString': true, 'valueOf': true }; nonEnumProps[boolTag] = nonEnumProps[stringTag] = { 'constructor': true, 'toString': true, 'valueOf': true }; nonEnumProps[errorTag] = nonEnumProps[funcTag] = nonEnumProps[regexpTag] = { 'constructor': true, 'toString': true }; nonEnumProps[objectTag] = { 'constructor': true }; arrayEach(shadowProps, function(key) { for (var tag in nonEnumProps) { if (hasOwnProperty.call(nonEnumProps, tag)) { var props = nonEnumProps[tag]; props[key] = hasOwnProperty.call(props, key); } } }); /** * Creates an array of the own and inherited enumerable property names of `object`. * * **Note:** Non-object values are coerced to objects. * * @static * @memberOf _ * @category Object * @param {Object} object The object to query. * @returns {Array} Returns the array of property names. * @example * * function Foo() { * this.a = 1; * this.b = 2; * } * * Foo.prototype.c = 3; * * _.keysIn(new Foo); * // => ['a', 'b', 'c'] (iteration order is not guaranteed) */ function keysIn(object) { if (object == null) { return []; } if (!isObject(object)) { object = Object(object); } var length = object.length; length = (length && isLength(length) && (isArray(object) || isArguments(object) || isString(object)) && length) || 0; var Ctor = object.constructor, index = -1, proto = (isFunction(Ctor) && Ctor.prototype) || objectProto, isProto = proto === object, result = Array(length), skipIndexes = length > 0, skipErrorProps = support.enumErrorProps && (object === errorProto || object instanceof Error), skipProto = support.enumPrototypes && isFunction(object); while (++index < length) { result[index] = (index + ''); } // lodash skips the `constructor` property when it infers it's iterating // over a `prototype` object because IE < 9 can't set the `[[Enumerable]]` // attribute of an existing property and the `constructor` property of a // prototype defaults to non-enumerable. for (var key in object) { if (!(skipProto && key == 'prototype') && !(skipErrorProps && (key == 'message' || key == 'name')) && !(skipIndexes && isIndex(key, length)) && !(key == 'constructor' && (isProto || !hasOwnProperty.call(object, key)))) { result.push(key); } } if (support.nonEnumShadows && object !== objectProto) { var tag = object === stringProto ? stringTag : (object === errorProto ? errorTag : objToString.call(object)), nonEnums = nonEnumProps[tag] || nonEnumProps[objectTag]; if (tag == objectTag) { proto = objectProto; } length = shadowProps.length; while (length--) { key = shadowProps[length]; var nonEnum = nonEnums[key]; if (!(isProto && nonEnum) && (nonEnum ? hasOwnProperty.call(object, key) : object[key] !== proto[key])) { result.push(key); } } } return result; } module.exports = keysIn; },{"../internal/arrayEach":6,"../internal/isIndex":20,"../internal/isLength":22,"../lang/isArguments":26,"../lang/isArray":27,"../lang/isFunction":28,"../lang/isObject":30,"../lang/isString":32,"../support":38}],37:[function(_dereq_,module,exports){ var baseMerge = _dereq_('../internal/baseMerge'), createAssigner = _dereq_('../internal/createAssigner'); /** * Recursively merges own enumerable properties of the source object(s), that * don't resolve to `undefined` into the destination object. Subsequent sources * overwrite property assignments of previous sources. If `customizer` is * provided it's invoked to produce the merged values of the destination and * source properties. If `customizer` returns `undefined` merging is handled * by the method instead. The `customizer` is bound to `thisArg` and invoked * with five arguments: (objectValue, sourceValue, key, object, source). * * @static * @memberOf _ * @category Object * @param {Object} object The destination object. * @param {...Object} [sources] The source objects. * @param {Function} [customizer] The function to customize assigned values. * @param {*} [thisArg] The `this` binding of `customizer`. * @returns {Object} Returns `object`. * @example * * var users = { * 'data': [{ 'user': 'barney' }, { 'user': 'fred' }] * }; * * var ages = { * 'data': [{ 'age': 36 }, { 'age': 40 }] * }; * * _.merge(users, ages); * // => { 'data': [{ 'user': 'barney', 'age': 36 }, { 'user': 'fred', 'age': 40 }] } * * // using a customizer callback * var object = { * 'fruits': ['apple'], * 'vegetables': ['beet'] * }; * * var other = { * 'fruits': ['banana'], * 'vegetables': ['carrot'] * }; * * _.merge(object, other, function(a, b) { * if (_.isArray(a)) { * return a.concat(b); * } * }); * // => { 'fruits': ['apple', 'banana'], 'vegetables': ['beet', 'carrot'] } */ var merge = createAssigner(baseMerge); module.exports = merge; },{"../internal/baseMerge":10,"../internal/createAssigner":14}],38:[function(_dereq_,module,exports){ /** Used for native method references. */ var arrayProto = Array.prototype, errorProto = Error.prototype, objectProto = Object.prototype; /** Native method references. */ var propertyIsEnumerable = objectProto.propertyIsEnumerable, splice = arrayProto.splice; /** * An object environment feature flags. * * @static * @memberOf _ * @type Object */ var support = {}; (function(x) { var Ctor = function() { this.x = x; }, object = { '0': x, 'length': x }, props = []; Ctor.prototype = { 'valueOf': x, 'y': x }; for (var key in new Ctor) { props.push(key); } /** * Detect if `name` or `message` properties of `Error.prototype` are * enumerable by default (IE < 9, Safari < 5.1). * * @memberOf _.support * @type boolean */ support.enumErrorProps = propertyIsEnumerable.call(errorProto, 'message') || propertyIsEnumerable.call(errorProto, 'name'); /** * Detect if `prototype` properties are enumerable by default. * * Firefox < 3.6, Opera > 9.50 - Opera < 11.60, and Safari < 5.1 * (if the prototype or a property on the prototype has been set) * incorrectly set the `[[Enumerable]]` value of a function's `prototype` * property to `true`. * * @memberOf _.support * @type boolean */ support.enumPrototypes = propertyIsEnumerable.call(Ctor, 'prototype'); /** * Detect if properties shadowing those on `Object.prototype` are non-enumerable. * * In IE < 9 an object's own properties, shadowing non-enumerable ones, * are made non-enumerable as well (a.k.a the JScript `[[DontEnum]]` bug). * * @memberOf _.support * @type boolean */ support.nonEnumShadows = !/valueOf/.test(props); /** * Detect if own properties are iterated after inherited properties (IE < 9). * * @memberOf _.support * @type boolean */ support.ownLast = props[0] != 'x'; /** * Detect if `Array#shift` and `Array#splice` augment array-like objects * correctly. * * Firefox < 10, compatibility modes of IE 8, and IE < 9 have buggy Array * `shift()` and `splice()` functions that fail to remove the last element, * `value[0]`, of array-like objects even though the "length" property is * set to `0`. The `shift()` method is buggy in compatibility modes of IE 8, * while `splice()` is buggy regardless of mode in IE < 9. * * @memberOf _.support * @type boolean */ support.spliceObjects = (splice.call(object, 0, 1), !object[0]); /** * Detect lack of support for accessing string characters by index. * * IE < 8 can't access characters by index. IE 8 can only access characters * by index on string literals, not string objects. * * @memberOf _.support * @type boolean */ support.unindexedChars = ('x'[0] + Object('x')[0]) != 'xx'; }(1, 0)); module.exports = support; },{}],39:[function(_dereq_,module,exports){ /** * This method returns the first argument provided to it. * * @static * @memberOf _ * @category Utility * @param {*} value Any value. * @returns {*} Returns `value`. * @example * * var object = { 'user': 'fred' }; * * _.identity(object) === object; * // => true */ function identity(value) { return value; } module.exports = identity; },{}],40:[function(_dereq_,module,exports){ 'use strict'; // modified from https://github.com/es-shims/es6-shim var keys = _dereq_('object-keys'); var canBeObject = function (obj) { return typeof obj !== 'undefined' && obj !== null; }; var hasSymbols = typeof Symbol === 'function' && typeof Symbol() === 'symbol'; var defineProperties = _dereq_('define-properties'); var toObject = Object; var push = Array.prototype.push; var propIsEnumerable = Object.prototype.propertyIsEnumerable; var assignShim = function assign(target, source1) { if (!canBeObject(target)) { throw new TypeError('target must be an object'); } var objTarget = toObject(target); var s, source, i, props, syms; for (s = 1; s < arguments.length; ++s) { source = toObject(arguments[s]); props = keys(source); if (hasSymbols && Object.getOwnPropertySymbols) { syms = Object.getOwnPropertySymbols(source); for (i = 0; i < syms.length; ++i) { if (propIsEnumerable.call(source, syms[i])) { push.call(props, syms[i]); } } } for (i = 0; i < props.length; ++i) { objTarget[props[i]] = source[props[i]]; } } return objTarget; }; defineProperties(assignShim, { shim: function shimObjectAssign() { var assignHasPendingExceptions = function () { if (!Object.assign || !Object.preventExtensions) { return false; } // Firefox 37 still has "pending exception" logic in its Object.assign implementation, // which is 72% slower than our shim, and Firefox 40's native implementation. var thrower = Object.preventExtensions({ 1: 2 }); try { Object.assign(thrower, 'xy'); } catch (e) { return thrower[1] === 'y'; } }; defineProperties( Object, { assign: assignShim }, { assign: assignHasPendingExceptions } ); return Object.assign || assignShim; } }); module.exports = assignShim; },{"define-properties":41,"object-keys":43}],41:[function(_dereq_,module,exports){ 'use strict'; var keys = _dereq_('object-keys'); var foreach = _dereq_('foreach'); var hasSymbols = typeof Symbol === 'function' && typeof Symbol() === 'symbol'; var toStr = Object.prototype.toString; var isFunction = function (fn) { return typeof fn === 'function' && toStr.call(fn) === '[object Function]'; }; var arePropertyDescriptorsSupported = function () { var obj = {}; try { Object.defineProperty(obj, 'x', { value: obj, enumerable: false }); /* eslint-disable no-unused-vars */ for (var _ in obj) { return false; } /* eslint-enable no-unused-vars */ return obj.x === obj; } catch (e) { /* this is IE 8. */ return false; } }; var supportsDescriptors = Object.defineProperty && arePropertyDescriptorsSupported(); var defineProperty = function (object, name, value, predicate) { if (name in object && (!isFunction(predicate) || !predicate())) { return; } if (supportsDescriptors) { Object.defineProperty(object, name, { configurable: true, enumerable: false, writable: true, value: value }); } else { object[name] = value; } }; var defineProperties = function (object, map) { var predicates = arguments.length > 2 ? arguments[2] : {}; var props = keys(map); if (hasSymbols) { props = props.concat(Object.getOwnPropertySymbols(map)); } foreach(props, function (name) { defineProperty(object, name, map[name], predicates[name]); }); }; defineProperties.supportsDescriptors = !!supportsDescriptors; module.exports = defineProperties; },{"foreach":42,"object-keys":43}],42:[function(_dereq_,module,exports){ var hasOwn = Object.prototype.hasOwnProperty; var toString = Object.prototype.toString; module.exports = function forEach (obj, fn, ctx) { if (toString.call(fn) !== '[object Function]') { throw new TypeError('iterator must be a function'); } var l = obj.length; if (l === +l) { for (var i = 0; i < l; i++) { fn.call(ctx, obj[i], i, obj); } } else { for (var k in obj) { if (hasOwn.call(obj, k)) { fn.call(ctx, obj[k], k, obj); } } } }; },{}],43:[function(_dereq_,module,exports){ 'use strict'; // modified from https://github.com/es-shims/es5-shim var has = Object.prototype.hasOwnProperty; var toStr = Object.prototype.toString; var slice = Array.prototype.slice; var isArgs = _dereq_('./isArguments'); var hasDontEnumBug = !({ 'toString': null }).propertyIsEnumerable('toString'); var hasProtoEnumBug = function () {}.propertyIsEnumerable('prototype'); var dontEnums = [ 'toString', 'toLocaleString', 'valueOf', 'hasOwnProperty', 'isPrototypeOf', 'propertyIsEnumerable', 'constructor' ]; var equalsConstructorPrototype = function (o) { var ctor = o.constructor; return ctor && ctor.prototype === o; }; var blacklistedKeys = { $window: true, $console: true, $parent: true, $self: true, $frames: true, $webkitIndexedDB: true, $webkitStorageInfo: true }; var hasAutomationEqualityBug = (function () { /* global window */ if (typeof window === 'undefined') { return false; } for (var k in window) { if (!blacklistedKeys['$' + k] && has.call(window, k) && window[k] !== null && typeof window[k] === 'object') { try { equalsConstructorPrototype(window[k]); } catch (e) { return true; } } } return false; }()); var equalsConstructorPrototypeIfNotBuggy = function (o) { /* global window */ if (typeof window === 'undefined' && !hasAutomationEqualityBug) { return equalsConstructorPrototype(o); } try { return equalsConstructorPrototype(o); } catch (e) { return false; } }; var keysShim = function keys(object) { var isObject = object !== null && typeof object === 'object'; var isFunction = toStr.call(object) === '[object Function]'; var isArguments = isArgs(object); var isString = isObject && toStr.call(object) === '[object String]'; var theKeys = []; if (!isObject && !isFunction && !isArguments) { throw new TypeError('Object.keys called on a non-object'); } var skipProto = hasProtoEnumBug && isFunction; if (isString && object.length > 0 && !has.call(object, 0)) { for (var i = 0; i < object.length; ++i) { theKeys.push(String(i)); } } if (isArguments && object.length > 0) { for (var j = 0; j < object.length; ++j) { theKeys.push(String(j)); } } else { for (var name in object) { if (!(skipProto && name === 'prototype') && has.call(object, name)) { theKeys.push(String(name)); } } } if (hasDontEnumBug) { var skipConstructor = equalsConstructorPrototypeIfNotBuggy(object); for (var k = 0; k < dontEnums.length; ++k) { if (!(skipConstructor && dontEnums[k] === 'constructor') && has.call(object, dontEnums[k])) { theKeys.push(dontEnums[k]); } } } return theKeys; }; keysShim.shim = function shimObjectKeys() { if (!Object.keys) { Object.keys = keysShim; } else { var keysWorksWithArguments = (function () { // Safari 5.0 bug return (Object.keys(arguments) || '').length === 2; }(1, 2)); if (!keysWorksWithArguments) { var originalKeys = Object.keys; Object.keys = function keys(object) { if (isArgs(object)) { return originalKeys(slice.call(object)); } else { return originalKeys(object); } }; } } return Object.keys || keysShim; }; module.exports = keysShim; },{"./isArguments":44}],44:[function(_dereq_,module,exports){ 'use strict'; var toStr = Object.prototype.toString; module.exports = function isArguments(value) { var str = toStr.call(value); var isArgs = str === '[object Arguments]'; if (!isArgs) { isArgs = str !== '[object Array]' && value !== null && typeof value === 'object' && typeof value.length === 'number' && value.length >= 0 && toStr.call(value.callee) === '[object Function]'; } return isArgs; }; },{}],45:[function(_dereq_,module,exports){ module.exports = SafeParseTuple function SafeParseTuple(obj, reviver) { var json var error = null try { json = JSON.parse(obj, reviver) } catch (err) { error = err } return [error, json] } },{}],46:[function(_dereq_,module,exports){ /** * @file big-play-button.js */ 'use strict'; exports.__esModule = true; function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError('Cannot call a class as a function'); } } function _inherits(subClass, superClass) { if (typeof superClass !== 'function' && superClass !== null) { throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } var _buttonJs = _dereq_('./button.js'); var _buttonJs2 = _interopRequireDefault(_buttonJs); var _componentJs = _dereq_('./component.js'); var _componentJs2 = _interopRequireDefault(_componentJs); /** * Initial play button. Shows before the video has played. The hiding of the * big play button is done via CSS and player states. * * @param {Object} player Main Player * @param {Object=} options Object of option names and values * @extends Button * @class BigPlayButton */ var BigPlayButton = (function (_Button) { _inherits(BigPlayButton, _Button); function BigPlayButton(player, options) { _classCallCheck(this, BigPlayButton); _Button.call(this, player, options); } /** * Allow sub components to stack CSS class names * * @return {String} The constructed class name * @method buildCSSClass */ BigPlayButton.prototype.buildCSSClass = function buildCSSClass() { return 'vjs-big-play-button'; }; /** * Handles click for play * * @method handleClick */ BigPlayButton.prototype.handleClick = function handleClick() { this.player_.play(); }; return BigPlayButton; })(_buttonJs2['default']); BigPlayButton.prototype.controlText_ = 'Play Video'; _componentJs2['default'].registerComponent('BigPlayButton', BigPlayButton); exports['default'] = BigPlayButton; module.exports = exports['default']; },{"./button.js":47,"./component.js":48}],47:[function(_dereq_,module,exports){ /** * @file button.js */ 'use strict'; exports.__esModule = true; function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj['default'] = obj; return newObj; } } function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError('Cannot call a class as a function'); } } function _inherits(subClass, superClass) { if (typeof superClass !== 'function' && superClass !== null) { throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } var _component = _dereq_('./component'); var _component2 = _interopRequireDefault(_component); var _utilsDomJs = _dereq_('./utils/dom.js'); var Dom = _interopRequireWildcard(_utilsDomJs); var _utilsEventsJs = _dereq_('./utils/events.js'); var Events = _interopRequireWildcard(_utilsEventsJs); var _utilsFnJs = _dereq_('./utils/fn.js'); var Fn = _interopRequireWildcard(_utilsFnJs); var _globalDocument = _dereq_('global/document'); var _globalDocument2 = _interopRequireDefault(_globalDocument); var _objectAssign = _dereq_('object.assign'); var _objectAssign2 = _interopRequireDefault(_objectAssign); /** * Base class for all buttons * * @param {Object} player Main Player * @param {Object=} options Object of option names and values * @extends Component * @class Button */ var Button = (function (_Component) { _inherits(Button, _Component); function Button(player, options) { _classCallCheck(this, Button); _Component.call(this, player, options); this.emitTapEvents(); this.on('tap', this.handleClick); this.on('click', this.handleClick); this.on('focus', this.handleFocus); this.on('blur', this.handleBlur); } /** * Create the component's DOM element * * @param {String=} type Element's node type. e.g. 'div' * @param {Object=} props An object of element attributes that should be set on the element Tag name * @return {Element} * @method createEl */ Button.prototype.createEl = function createEl() { var tag = arguments.length <= 0 || arguments[0] === undefined ? 'button' : arguments[0]; var props = arguments.length <= 1 || arguments[1] === undefined ? {} : arguments[1]; // Add standard Aria and Tabindex info props = _objectAssign2['default']({ className: this.buildCSSClass(), 'role': 'button', 'type': 'button', // Necessary since the default button type is "submit" 'aria-live': 'polite', // let the screen reader user know that the text of the button may change tabIndex: 0 }, props); var el = _Component.prototype.createEl.call(this, tag, props); this.controlTextEl_ = Dom.createEl('span', { className: 'vjs-control-text' }); el.appendChild(this.controlTextEl_); this.controlText(this.controlText_); return el; }; /** * Controls text - both request and localize * * @param {String} text Text for button * @return {String} * @method controlText */ Button.prototype.controlText = function controlText(text) { if (!text) return this.controlText_ || 'Need Text'; this.controlText_ = text; this.controlTextEl_.innerHTML = this.localize(this.controlText_); return this; }; /** * Allows sub components to stack CSS class names * * @return {String} * @method buildCSSClass */ Button.prototype.buildCSSClass = function buildCSSClass() { return 'vjs-control vjs-button ' + _Component.prototype.buildCSSClass.call(this); }; /** * Handle Click - Override with specific functionality for button * * @method handleClick */ Button.prototype.handleClick = function handleClick() {}; /** * Handle Focus - Add keyboard functionality to element * * @method handleFocus */ Button.prototype.handleFocus = function handleFocus() { Events.on(_globalDocument2['default'], 'keydown', Fn.bind(this, this.handleKeyPress)); }; /** * Handle KeyPress (document level) - Trigger click when keys are pressed * * @method handleKeyPress */ Button.prototype.handleKeyPress = function handleKeyPress(event) { // Check for space bar (32) or enter (13) keys if (event.which === 32 || event.which === 13) { event.preventDefault(); this.handleClick(event); } }; /** * Handle Blur - Remove keyboard triggers * * @method handleBlur */ Button.prototype.handleBlur = function handleBlur() { Events.off(_globalDocument2['default'], 'keydown', Fn.bind(this, this.handleKeyPress)); }; return Button; })(_component2['default']); _component2['default'].registerComponent('Button', Button); exports['default'] = Button; module.exports = exports['default']; },{"./component":48,"./utils/dom.js":107,"./utils/events.js":108,"./utils/fn.js":109,"global/document":1,"object.assign":40}],48:[function(_dereq_,module,exports){ /** * @file component.js * * Player Component - Base class for all UI objects */ 'use strict'; exports.__esModule = true; function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj['default'] = obj; return newObj; } } function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError('Cannot call a class as a function'); } } var _globalWindow = _dereq_('global/window'); var _globalWindow2 = _interopRequireDefault(_globalWindow); var _utilsDomJs = _dereq_('./utils/dom.js'); var Dom = _interopRequireWildcard(_utilsDomJs); var _utilsFnJs = _dereq_('./utils/fn.js'); var Fn = _interopRequireWildcard(_utilsFnJs); var _utilsGuidJs = _dereq_('./utils/guid.js'); var Guid = _interopRequireWildcard(_utilsGuidJs); var _utilsEventsJs = _dereq_('./utils/events.js'); var Events = _interopRequireWildcard(_utilsEventsJs); var _utilsLogJs = _dereq_('./utils/log.js'); var _utilsLogJs2 = _interopRequireDefault(_utilsLogJs); var _utilsToTitleCaseJs = _dereq_('./utils/to-title-case.js'); var _utilsToTitleCaseJs2 = _interopRequireDefault(_utilsToTitleCaseJs); var _objectAssign = _dereq_('object.assign'); var _objectAssign2 = _interopRequireDefault(_objectAssign); var _utilsMergeOptionsJs = _dereq_('./utils/merge-options.js'); var _utilsMergeOptionsJs2 = _interopRequireDefault(_utilsMergeOptionsJs); /** * Base UI Component class * Components are embeddable UI objects that are represented by both a * javascript object and an element in the DOM. They can be children of other * components, and can have many children themselves. * ```js * // adding a button to the player * var button = player.addChild('button'); * button.el(); // -> button element * ``` * ```html * <div class="video-js"> * <div class="vjs-button">Button</div> * </div> * ``` * Components are also event targets. * ```js * button.on('click', function(){ * console.log('Button Clicked!'); * }); * button.trigger('customevent'); * ``` * * @param {Object} player Main Player * @param {Object=} options Object of option names and values * @param {Function=} ready Ready callback function * @class Component */ var Component = (function () { function Component(player, options, ready) { _classCallCheck(this, Component); // The component might be the player itself and we can't pass `this` to super if (!player && this.play) { this.player_ = player = this; // eslint-disable-line } else { this.player_ = player; } // Make a copy of prototype.options_ to protect against overriding defaults this.options_ = _utilsMergeOptionsJs2['default']({}, this.options_); // Updated options with supplied options options = this.options_ = _utilsMergeOptionsJs2['default'](this.options_, options); // Get ID from options or options element if one is supplied this.id_ = options.id || options.el && options.el.id; // If there was no ID from the options, generate one if (!this.id_) { // Don't require the player ID function in the case of mock players var id = player && player.id && player.id() || 'no_player'; this.id_ = id + '_component_' + Guid.newGUID(); } this.name_ = options.name || null; // Create element if one wasn't provided in options if (options.el) { this.el_ = options.el; } else if (options.createEl !== false) { this.el_ = this.createEl(); } this.children_ = []; this.childIndex_ = {}; this.childNameIndex_ = {}; // Add any child components in options if (options.initChildren !== false) { this.initChildren(); } this.ready(ready); // Don't want to trigger ready here or it will before init is actually // finished for all children that run this constructor if (options.reportTouchActivity !== false) { this.enableTouchActivity(); } } /** * Dispose of the component and all child components * * @method dispose */ Component.prototype.dispose = function dispose() { this.trigger({ type: 'dispose', bubbles: false }); // Dispose all children. if (this.children_) { for (var i = this.children_.length - 1; i >= 0; i--) { if (this.children_[i].dispose) { this.children_[i].dispose(); } } } // Delete child references this.children_ = null; this.childIndex_ = null; this.childNameIndex_ = null; // Remove all event listeners. this.off(); // Remove element from DOM if (this.el_.parentNode) { this.el_.parentNode.removeChild(this.el_); } Dom.removeElData(this.el_); this.el_ = null; }; /** * Return the component's player * * @return {Player} * @method player */ Component.prototype.player = function player() { return this.player_; }; /** * Deep merge of options objects * Whenever a property is an object on both options objects * the two properties will be merged using mergeOptions. * This is used for merging options for child components. We * want it to be easy to override individual options on a child * component without having to rewrite all the other default options. * ```js * Parent.prototype.options_ = { * children: { * 'childOne': { 'foo': 'bar', 'asdf': 'fdsa' }, * 'childTwo': {}, * 'childThree': {} * } * } * newOptions = { * children: { * 'childOne': { 'foo': 'baz', 'abc': '123' } * 'childTwo': null, * 'childFour': {} * } * } * * this.options(newOptions); * ``` * RESULT * ```js * { * children: { * 'childOne': { 'foo': 'baz', 'asdf': 'fdsa', 'abc': '123' }, * 'childTwo': null, // Disabled. Won't be initialized. * 'childThree': {}, * 'childFour': {} * } * } * ``` * * @param {Object} obj Object of new option values * @return {Object} A NEW object of this.options_ and obj merged * @method options */ Component.prototype.options = function options(obj) { _utilsLogJs2['default'].warn('this.options() has been deprecated and will be moved to the constructor in 6.0'); if (!obj) { return this.options_; } this.options_ = _utilsMergeOptionsJs2['default'](this.options_, obj); return this.options_; }; /** * Get the component's DOM element * ```js * var domEl = myComponent.el(); * ``` * * @return {Element} * @method el */ Component.prototype.el = function el() { return this.el_; }; /** * Create the component's DOM element * * @param {String=} tagName Element's node type. e.g. 'div' * @param {Object=} attributes An object of element attributes that should be set on the element * @return {Element} * @method createEl */ Component.prototype.createEl = function createEl(tagName, attributes) { return Dom.createEl(tagName, attributes); }; Component.prototype.localize = function localize(string) { var code = this.player_.language && this.player_.language(); var languages = this.player_.languages && this.player_.languages(); if (!code || !languages) { return string; } var language = languages[code]; if (language && language[string]) { return language[string]; } var primaryCode = code.split('-')[0]; var primaryLang = languages[primaryCode]; if (primaryLang && primaryLang[string]) { return primaryLang[string]; } return string; }; /** * Return the component's DOM element where children are inserted. * Will either be the same as el() or a new element defined in createEl(). * * @return {Element} * @method contentEl */ Component.prototype.contentEl = function contentEl() { return this.contentEl_ || this.el_; }; /** * Get the component's ID * ```js * var id = myComponent.id(); * ``` * * @return {String} * @method id */ Component.prototype.id = function id() { return this.id_; }; /** * Get the component's name. The name is often used to reference the component. * ```js * var name = myComponent.name(); * ``` * * @return {String} * @method name */ Component.prototype.name = function name() { return this.name_; }; /** * Get an array of all child components * ```js * var kids = myComponent.children(); * ``` * * @return {Array} The children * @method children */ Component.prototype.children = function children() { return this.children_; }; /** * Returns a child component with the provided ID * * @return {Component} * @method getChildById */ Component.prototype.getChildById = function getChildById(id) { return this.childIndex_[id]; }; /** * Returns a child component with the provided name * * @return {Component} * @method getChild */ Component.prototype.getChild = function getChild(name) { return this.childNameIndex_[name]; }; /** * Adds a child component inside this component * ```js * myComponent.el(); * // -> <div class='my-component'></div> * myComponent.children(); * // [empty array] * * var myButton = myComponent.addChild('MyButton'); * // -> <div class='my-component'><div class="my-button">myButton<div></div> * // -> myButton === myComonent.children()[0]; * ``` * Pass in options for child constructors and options for children of the child * ```js * var myButton = myComponent.addChild('MyButton', { * text: 'Press Me', * children: { * buttonChildExample: { * buttonChildOption: true * } * } * }); * ``` * * @param {String|Component} child The class name or instance of a child to add * @param {Object=} options Options, including options to be passed to children of the child. * @return {Component} The child component (created by this process if a string was used) * @method addChild */ Component.prototype.addChild = function addChild(child) { var options = arguments.length <= 1 || arguments[1] === undefined ? {} : arguments[1]; var component = undefined; var componentName = undefined; // If child is a string, create nt with options if (typeof child === 'string') { componentName = child; // Options can also be specified as a boolean, so convert to an empty object if false. if (!options) { options = {}; } // Same as above, but true is deprecated so show a warning. if (options === true) { _utilsLogJs2['default'].warn('Initializing a child component with `true` is deprecated. Children should be defined in an array when possible, but if necessary use an object instead of `true`.'); options = {}; } // If no componentClass in options, assume componentClass is the name lowercased // (e.g. playButton) var componentClassName = options.componentClass || _utilsToTitleCaseJs2['default'](componentName); // Set name through options options.name = componentName; // Create a new object & element for this controls set // If there's no .player_, this is a player var ComponentClass = Component.getComponent(componentClassName); component = new ComponentClass(this.player_ || this, options); // child is a component instance } else { component = child; } this.children_.push(component); if (typeof component.id === 'function') { this.childIndex_[component.id()] = component; } // If a name wasn't used to create the component, check if we can use the // name function of the component componentName = componentName || component.name && component.name(); if (componentName) { this.childNameIndex_[componentName] = component; } // Add the UI object's element to the container div (box) // Having an element is not required if (typeof component.el === 'function' && component.el()) { this.contentEl().appendChild(component.el()); } // Return so it can stored on parent object if desired. return component; }; /** * Remove a child component from this component's list of children, and the * child component's element from this component's element * * @param {Component} component Component to remove * @method removeChild */ Component.prototype.removeChild = function removeChild(component) { if (typeof component === 'string') { component = this.getChild(component); } if (!component || !this.children_) { return; } var childFound = false; for (var i = this.children_.length - 1; i >= 0; i--) { if (this.children_[i] === component) { childFound = true; this.children_.splice(i, 1); break; } } if (!childFound) { return; } this.childIndex_[component.id()] = null; this.childNameIndex_[component.name()] = null; var compEl = component.el(); if (compEl && compEl.parentNode === this.contentEl()) { this.contentEl().removeChild(component.el()); } }; /** * Add and initialize default child components from options * ```js * // when an instance of MyComponent is created, all children in options * // will be added to the instance by their name strings and options * MyComponent.prototype.options_.children = { * myChildComponent: { * myChildOption: true * } * } * ``` * // Or when creating the component * ```js * var myComp = new MyComponent(player, { * children: { * myChildComponent: { * myChildOption: true * } * } * }); * ``` * The children option can also be an Array of child names or * child options objects (that also include a 'name' key). * ```js * var myComp = new MyComponent(player, { * children: [ * 'button', * { * name: 'button', * someOtherOption: true * } * ] * }); * ``` * * @method initChildren */ Component.prototype.initChildren = function initChildren() { var _this = this; var children = this.options_.children; if (children) { (function () { // `this` is `parent` var parentOptions = _this.options_; var handleAdd = function handleAdd(name, opts) { // Allow options for children to be set at the parent options // e.g. videojs(id, { controlBar: false }); // instead of videojs(id, { children: { controlBar: false }); if (parentOptions[name] !== undefined) { opts = parentOptions[name]; } // Allow for disabling default components // e.g. options['children']['posterImage'] = false if (opts === false) { return; } // Allow options to be passed as a simple boolean if no configuration // is necessary. if (opts === true) { opts = {}; } // We also want to pass the original player options to each component as well so they don't need to // reach back into the player for options later. opts.playerOptions = _this.options_.playerOptions; // Create and add the child component. // Add a direct reference to the child by name on the parent instance. // If two of the same component are used, different names should be supplied // for each _this[name] = _this.addChild(name, opts); }; // Allow for an array of children details to passed in the options if (Array.isArray(children)) { for (var i = 0; i < children.length; i++) { var child = children[i]; var _name = undefined; var opts = undefined; if (typeof child === 'string') { // ['myComponent'] _name = child; opts = {}; } else { // [{ name: 'myComponent', otherOption: true }] _name = child.name; opts = child; } handleAdd(_name, opts); } } else { Object.getOwnPropertyNames(children).forEach(function (name) { handleAdd(name, children[name]); }); } })(); } }; /** * Allows sub components to stack CSS class names * * @return {String} The constructed class name * @method buildCSSClass */ Component.prototype.buildCSSClass = function buildCSSClass() { // Child classes can include a function that does: // return 'CLASS NAME' + this._super(); return ''; }; /** * Add an event listener to this component's element * ```js * var myFunc = function(){ * var myComponent = this; * // Do something when the event is fired * }; * * myComponent.on('eventType', myFunc); * ``` * The context of myFunc will be myComponent unless previously bound. * Alternatively, you can add a listener to another element or component. * ```js * myComponent.on(otherElement, 'eventName', myFunc); * myComponent.on(otherComponent, 'eventName', myFunc); * ``` * The benefit of using this over `VjsEvents.on(otherElement, 'eventName', myFunc)` * and `otherComponent.on('eventName', myFunc)` is that this way the listeners * will be automatically cleaned up when either component is disposed. * It will also bind myComponent as the context of myFunc. * **NOTE**: When using this on elements in the page other than window * and document (both permanent), if you remove the element from the DOM * you need to call `myComponent.trigger(el, 'dispose')` on it to clean up * references to it and allow the browser to garbage collect it. * * @param {String|Component} first The event type or other component * @param {Function|String} second The event handler or event type * @param {Function} third The event handler * @return {Component} * @method on */ Component.prototype.on = function on(first, second, third) { var _this2 = this; if (typeof first === 'string' || Array.isArray(first)) { Events.on(this.el_, first, Fn.bind(this, second)); // Targeting another component or element } else { (function () { var target = first; var type = second; var fn = Fn.bind(_this2, third); // When this component is disposed, remove the listener from the other component var removeOnDispose = function removeOnDispose() { return _this2.off(target, type, fn); }; // Use the same function ID so we can remove it later it using the ID // of the original listener removeOnDispose.guid = fn.guid; _this2.on('dispose', removeOnDispose); // If the other component is disposed first we need to clean the reference // to the other component in this component's removeOnDispose listener // Otherwise we create a memory leak. var cleanRemover = function cleanRemover() { return _this2.off('dispose', removeOnDispose); }; // Add the same function ID so we can easily remove it later cleanRemover.guid = fn.guid; // Check if this is a DOM node if (first.nodeName) { // Add the listener to the other element Events.on(target, type, fn); Events.on(target, 'dispose', cleanRemover); // Should be a component // Not using `instanceof Component` because it makes mock players difficult } else if (typeof first.on === 'function') { // Add the listener to the other component target.on(type, fn); target.on('dispose', cleanRemover); } })(); } return this; }; /** * Remove an event listener from this component's element * ```js * myComponent.off('eventType', myFunc); * ``` * If myFunc is excluded, ALL listeners for the event type will be removed. * If eventType is excluded, ALL listeners will be removed from the component. * Alternatively you can use `off` to remove listeners that were added to other * elements or components using `myComponent.on(otherComponent...`. * In this case both the event type and listener function are REQUIRED. * ```js * myComponent.off(otherElement, 'eventType', myFunc); * myComponent.off(otherComponent, 'eventType', myFunc); * ``` * * @param {String=|Component} first The event type or other component * @param {Function=|String} second The listener function or event type * @param {Function=} third The listener for other component * @return {Component} * @method off */ Component.prototype.off = function off(first, second, third) { if (!first || typeof first === 'string' || Array.isArray(first)) { Events.off(this.el_, first, second); } else { var target = first; var type = second; // Ensure there's at least a guid, even if the function hasn't been used var fn = Fn.bind(this, third); // Remove the dispose listener on this component, // which was given the same guid as the event listener this.off('dispose', fn); if (first.nodeName) { // Remove the listener Events.off(target, type, fn); // Remove the listener for cleaning the dispose listener Events.off(target, 'dispose', fn); } else { target.off(type, fn); target.off('dispose', fn); } } return this; }; /** * Add an event listener to be triggered only once and then removed * ```js * myComponent.one('eventName', myFunc); * ``` * Alternatively you can add a listener to another element or component * that will be triggered only once. * ```js * myComponent.one(otherElement, 'eventName', myFunc); * myComponent.one(otherComponent, 'eventName', myFunc); * ``` * * @param {String|Component} first The event type or other component * @param {Function|String} second The listener function or event type * @param {Function=} third The listener function for other component * @return {Component} * @method one */ Component.prototype.one = function one(first, second, third) { var _this3 = this, _arguments = arguments; if (typeof first === 'string' || Array.isArray(first)) { Events.one(this.el_, first, Fn.bind(this, second)); } else { (function () { var target = first; var type = second; var fn = Fn.bind(_this3, third); var newFunc = function newFunc() { _this3.off(target, type, newFunc); fn.apply(null, _arguments); }; // Keep the same function ID so we can remove it later newFunc.guid = fn.guid; _this3.on(target, type, newFunc); })(); } return this; }; /** * Trigger an event on an element * ```js * myComponent.trigger('eventName'); * myComponent.trigger({'type':'eventName'}); * myComponent.trigger('eventName', {data: 'some data'}); * myComponent.trigger({'type':'eventName'}, {data: 'some data'}); * ``` * * @param {Event|Object|String} event A string (the type) or an event object with a type attribute * @param {Object} [hash] data hash to pass along with the event * @return {Component} self * @method trigger */ Component.prototype.trigger = function trigger(event, hash) { Events.trigger(this.el_, event, hash); return this; }; /** * Bind a listener to the component's ready state. * Different from event listeners in that if the ready event has already happened * it will trigger the function immediately. * * @param {Function} fn Ready listener * @param {Boolean} sync Exec the listener synchronously if component is ready * @return {Component} * @method ready */ Component.prototype.ready = function ready(fn) { var sync = arguments.length <= 1 || arguments[1] === undefined ? false : arguments[1]; if (fn) { if (this.isReady_) { if (sync) { fn.call(this); } else { // Call the function asynchronously by default for consistency this.setTimeout(fn, 1); } } else { this.readyQueue_ = this.readyQueue_ || []; this.readyQueue_.push(fn); } } return this; }; /** * Trigger the ready listeners * * @return {Component} * @method triggerReady */ Component.prototype.triggerReady = function triggerReady() { this.isReady_ = true; // Ensure ready is triggerd asynchronously this.setTimeout(function () { var readyQueue = this.readyQueue_; if (readyQueue && readyQueue.length > 0) { readyQueue.forEach(function (fn) { fn.call(this); }, this); // Reset Ready Queue this.readyQueue_ = []; } // Allow for using event listeners also this.trigger('ready'); }, 1); }; /** * Check if a component's element has a CSS class name * * @param {String} classToCheck Classname to check * @return {Component} * @method hasClass */ Component.prototype.hasClass = function hasClass(classToCheck) { return Dom.hasElClass(this.el_, classToCheck); }; /** * Add a CSS class name to the component's element * * @param {String} classToAdd Classname to add * @return {Component} * @method addClass */ Component.prototype.addClass = function addClass(classToAdd) { Dom.addElClass(this.el_, classToAdd); return this; }; /** * Remove and return a CSS class name from the component's element * * @param {String} classToRemove Classname to remove * @return {Component} * @method removeClass */ Component.prototype.removeClass = function removeClass(classToRemove) { Dom.removeElClass(this.el_, classToRemove); return this; }; /** * Show the component element if hidden * * @return {Component} * @method show */ Component.prototype.show = function show() { this.removeClass('vjs-hidden'); return this; }; /** * Hide the component element if currently showing * * @return {Component} * @method hide */ Component.prototype.hide = function hide() { this.addClass('vjs-hidden'); return this; }; /** * Lock an item in its visible state * To be used with fadeIn/fadeOut. * * @return {Component} * @private * @method lockShowing */ Component.prototype.lockShowing = function lockShowing() { this.addClass('vjs-lock-showing'); return this; }; /** * Unlock an item to be hidden * To be used with fadeIn/fadeOut. * * @return {Component} * @private * @method unlockShowing */ Component.prototype.unlockShowing = function unlockShowing() { this.removeClass('vjs-lock-showing'); return this; }; /** * Set or get the width of the component (CSS values) * Setting the video tag dimension values only works with values in pixels. * Percent values will not work. * Some percents can be used, but width()/height() will return the number + %, * not the actual computed width/height. * * @param {Number|String=} num Optional width number * @param {Boolean} skipListeners Skip the 'resize' event trigger * @return {Component} This component, when setting the width * @return {Number|String} The width, when getting * @method width */ Component.prototype.width = function width(num, skipListeners) { return this.dimension('width', num, skipListeners); }; /** * Get or set the height of the component (CSS values) * Setting the video tag dimension values only works with values in pixels. * Percent values will not work. * Some percents can be used, but width()/height() will return the number + %, * not the actual computed width/height. * * @param {Number|String=} num New component height * @param {Boolean=} skipListeners Skip the resize event trigger * @return {Component} This component, when setting the height * @return {Number|String} The height, when getting * @method height */ Component.prototype.height = function height(num, skipListeners) { return this.dimension('height', num, skipListeners); }; /** * Set both width and height at the same time * * @param {Number|String} width Width of player * @param {Number|String} height Height of player * @return {Component} The component * @method dimensions */ Component.prototype.dimensions = function dimensions(width, height) { // Skip resize listeners on width for optimization return this.width(width, true).height(height); }; /** * Get or set width or height * This is the shared code for the width() and height() methods. * All for an integer, integer + 'px' or integer + '%'; * Known issue: Hidden elements officially have a width of 0. We're defaulting * to the style.width value and falling back to computedStyle which has the * hidden element issue. Info, but probably not an efficient fix: * http://www.foliotek.com/devblog/getting-the-width-of-a-hidden-element-with-jquery-using-width/ * * @param {String} widthOrHeight 'width' or 'height' * @param {Number|String=} num New dimension * @param {Boolean=} skipListeners Skip resize event trigger * @return {Component} The component if a dimension was set * @return {Number|String} The dimension if nothing was set * @private * @method dimension */ Component.prototype.dimension = function dimension(widthOrHeight, num, skipListeners) { if (num !== undefined) { // Set to zero if null or literally NaN (NaN !== NaN) if (num === null || num !== num) { num = 0; } // Check if using css width/height (% or px) and adjust if (('' + num).indexOf('%') !== -1 || ('' + num).indexOf('px') !== -1) { this.el_.style[widthOrHeight] = num; } else if (num === 'auto') { this.el_.style[widthOrHeight] = ''; } else { this.el_.style[widthOrHeight] = num + 'px'; } // skipListeners allows us to avoid triggering the resize event when setting both width and height if (!skipListeners) { this.trigger('resize'); } // Return component return this; } // Not setting a value, so getting it // Make sure element exists if (!this.el_) { return 0; } // Get dimension value from style var val = this.el_.style[widthOrHeight]; var pxIndex = val.indexOf('px'); if (pxIndex !== -1) { // Return the pixel value with no 'px' return parseInt(val.slice(0, pxIndex), 10); } // No px so using % or no style was set, so falling back to offsetWidth/height // If component has display:none, offset will return 0 // TODO: handle display:none and no dimension style using px return parseInt(this.el_['offset' + _utilsToTitleCaseJs2['default'](widthOrHeight)], 10); }; /** * Emit 'tap' events when touch events are supported * This is used to support toggling the controls through a tap on the video. * We're requiring them to be enabled because otherwise every component would * have this extra overhead unnecessarily, on mobile devices where extra * overhead is especially bad. * * @private * @method emitTapEvents */ Component.prototype.emitTapEvents = function emitTapEvents() { // Track the start time so we can determine how long the touch lasted var touchStart = 0; var firstTouch = null; // Maximum movement allowed during a touch event to still be considered a tap // Other popular libs use anywhere from 2 (hammer.js) to 15, so 10 seems like a nice, round number. var tapMovementThreshold = 10; // The maximum length a touch can be while still being considered a tap var touchTimeThreshold = 200; var couldBeTap = undefined; this.on('touchstart', function (event) { // If more than one finger, don't consider treating this as a click if (event.touches.length === 1) { // Copy the touches object to prevent modifying the original firstTouch = _objectAssign2['default']({}, event.touches[0]); // Record start time so we can detect a tap vs. "touch and hold" touchStart = new Date().getTime(); // Reset couldBeTap tracking couldBeTap = true; } }); this.on('touchmove', function (event) { // If more than one finger, don't consider treating this as a click if (event.touches.length > 1) { couldBeTap = false; } else if (firstTouch) { // Some devices will throw touchmoves for all but the slightest of taps. // So, if we moved only a small distance, this could still be a tap var xdiff = event.touches[0].pageX - firstTouch.pageX; var ydiff = event.touches[0].pageY - firstTouch.pageY; var touchDistance = Math.sqrt(xdiff * xdiff + ydiff * ydiff); if (touchDistance > tapMovementThreshold) { couldBeTap = false; } } }); var noTap = function noTap() { couldBeTap = false; }; // TODO: Listen to the original target. http://youtu.be/DujfpXOKUp8?t=13m8s this.on('touchleave', noTap); this.on('touchcancel', noTap); // When the touch ends, measure how long it took and trigger the appropriate // event this.on('touchend', function (event) { firstTouch = null; // Proceed only if the touchmove/leave/cancel event didn't happen if (couldBeTap === true) { // Measure how long the touch lasted var touchTime = new Date().getTime() - touchStart; // Make sure the touch was less than the threshold to be considered a tap if (touchTime < touchTimeThreshold) { // Don't let browser turn this into a click event.preventDefault(); this.trigger('tap'); // It may be good to copy the touchend event object and change the // type to tap, if the other event properties aren't exact after // Events.fixEvent runs (e.g. event.target) } } }); }; /** * Report user touch activity when touch events occur * User activity is used to determine when controls should show/hide. It's * relatively simple when it comes to mouse events, because any mouse event * should show the controls. So we capture mouse events that bubble up to the * player and report activity when that happens. * With touch events it isn't as easy. We can't rely on touch events at the * player level, because a tap (touchstart + touchend) on the video itself on * mobile devices is meant to turn controls off (and on). User activity is * checked asynchronously, so what could happen is a tap event on the video * turns the controls off, then the touchend event bubbles up to the player, * which if it reported user activity, would turn the controls right back on. * (We also don't want to completely block touch events from bubbling up) * Also a touchmove, touch+hold, and anything other than a tap is not supposed * to turn the controls back on on a mobile device. * Here we're setting the default component behavior to report user activity * whenever touch events happen, and this can be turned off by components that * want touch events to act differently. * * @method enableTouchActivity */ Component.prototype.enableTouchActivity = function enableTouchActivity() { // Don't continue if the root player doesn't support reporting user activity if (!this.player() || !this.player().reportUserActivity) { return; } // listener for reporting that the user is active var report = Fn.bind(this.player(), this.player().reportUserActivity); var touchHolding = undefined; this.on('touchstart', function () { report(); // For as long as the they are touching the device or have their mouse down, // we consider them active even if they're not moving their finger or mouse. // So we want to continue to update that they are active this.clearInterval(touchHolding); // report at the same interval as activityCheck touchHolding = this.setInterval(report, 250); }); var touchEnd = function touchEnd(event) { report(); // stop the interval that maintains activity if the touch is holding this.clearInterval(touchHolding); }; this.on('touchmove', report); this.on('touchend', touchEnd); this.on('touchcancel', touchEnd); }; /** * Creates timeout and sets up disposal automatically. * * @param {Function} fn The function to run after the timeout. * @param {Number} timeout Number of ms to delay before executing specified function. * @return {Number} Returns the timeout ID * @method setTimeout */ Component.prototype.setTimeout = function setTimeout(fn, timeout) { fn = Fn.bind(this, fn); // window.setTimeout would be preferable here, but due to some bizarre issue with Sinon and/or Phantomjs, we can't. var timeoutId = _globalWindow2['default'].setTimeout(fn, timeout); var disposeFn = function disposeFn() { this.clearTimeout(timeoutId); }; disposeFn.guid = 'vjs-timeout-' + timeoutId; this.on('dispose', disposeFn); return timeoutId; }; /** * Clears a timeout and removes the associated dispose listener * * @param {Number} timeoutId The id of the timeout to clear * @return {Number} Returns the timeout ID * @method clearTimeout */ Component.prototype.clearTimeout = function clearTimeout(timeoutId) { _globalWindow2['default'].clearTimeout(timeoutId); var disposeFn = function disposeFn() {}; disposeFn.guid = 'vjs-timeout-' + timeoutId; this.off('dispose', disposeFn); return timeoutId; }; /** * Creates an interval and sets up disposal automatically. * * @param {Function} fn The function to run every N seconds. * @param {Number} interval Number of ms to delay before executing specified function. * @return {Number} Returns the interval ID * @method setInterval */ Component.prototype.setInterval = function setInterval(fn, interval) { fn = Fn.bind(this, fn); var intervalId = _globalWindow2['default'].setInterval(fn, interval); var disposeFn = function disposeFn() { this.clearInterval(intervalId); }; disposeFn.guid = 'vjs-interval-' + intervalId; this.on('dispose', disposeFn); return intervalId; }; /** * Clears an interval and removes the associated dispose listener * * @param {Number} intervalId The id of the interval to clear * @return {Number} Returns the interval ID * @method clearInterval */ Component.prototype.clearInterval = function clearInterval(intervalId) { _globalWindow2['default'].clearInterval(intervalId); var disposeFn = function disposeFn() {}; disposeFn.guid = 'vjs-interval-' + intervalId; this.off('dispose', disposeFn); return intervalId; }; /** * Registers a component * * @param {String} name Name of the component to register * @param {Object} comp The component to register * @static * @method registerComponent */ Component.registerComponent = function registerComponent(name, comp) { if (!Component.components_) { Component.components_ = {}; } Component.components_[name] = comp; return comp; }; /** * Gets a component by name * * @param {String} name Name of the component to get * @return {Component} * @static * @method getComponent */ Component.getComponent = function getComponent(name) { if (Component.components_ && Component.components_[name]) { return Component.components_[name]; } if (_globalWindow2['default'] && _globalWindow2['default'].videojs && _globalWindow2['default'].videojs[name]) { _utilsLogJs2['default'].warn('The ' + name + ' component was added to the videojs object when it should be registered using videojs.registerComponent(name, component)'); return _globalWindow2['default'].videojs[name]; } }; /** * Sets up the constructor using the supplied init method * or uses the init of the parent object * * @param {Object} props An object of properties * @static * @deprecated * @method extend */ Component.extend = function extend(props) { props = props || {}; _utilsLogJs2['default'].warn('Component.extend({}) has been deprecated, use videojs.extends(Component, {}) instead'); // Set up the constructor using the supplied init method // or using the init of the parent object // Make sure to check the unobfuscated version for external libs var init = props.init || props.init || this.prototype.init || this.prototype.init || function () {}; // In Resig's simple class inheritance (previously used) the constructor // is a function that calls `this.init.apply(arguments)` // However that would prevent us from using `ParentObject.call(this);` // in a Child constructor because the `this` in `this.init` // would still refer to the Child and cause an infinite loop. // We would instead have to do // `ParentObject.prototype.init.apply(this, arguments);` // Bleh. We're not creating a _super() function, so it's good to keep // the parent constructor reference simple. var subObj = function subObj() { init.apply(this, arguments); }; // Inherit from this object's prototype subObj.prototype = Object.create(this.prototype); // Reset the constructor property for subObj otherwise // instances of subObj would have the constructor of the parent Object subObj.prototype.constructor = subObj; // Make the class extendable subObj.extend = Component.extend; // Extend subObj's prototype with functions and other properties from props for (var _name2 in props) { if (props.hasOwnProperty(_name2)) { subObj.prototype[_name2] = props[_name2]; } } return subObj; }; return Component; })(); Component.registerComponent('Component', Component); exports['default'] = Component; module.exports = exports['default']; },{"./utils/dom.js":107,"./utils/events.js":108,"./utils/fn.js":109,"./utils/guid.js":111,"./utils/log.js":112,"./utils/merge-options.js":113,"./utils/to-title-case.js":116,"global/window":2,"object.assign":40}],49:[function(_dereq_,module,exports){ /** * @file control-bar.js */ 'use strict'; exports.__esModule = true; function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError('Cannot call a class as a function'); } } function _inherits(subClass, superClass) { if (typeof superClass !== 'function' && superClass !== null) { throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } var _componentJs = _dereq_('../component.js'); var _componentJs2 = _interopRequireDefault(_componentJs); // Required children var _playToggleJs = _dereq_('./play-toggle.js'); var _playToggleJs2 = _interopRequireDefault(_playToggleJs); var _timeControlsCurrentTimeDisplayJs = _dereq_('./time-controls/current-time-display.js'); var _timeControlsCurrentTimeDisplayJs2 = _interopRequireDefault(_timeControlsCurrentTimeDisplayJs); var _timeControlsDurationDisplayJs = _dereq_('./time-controls/duration-display.js'); var _timeControlsDurationDisplayJs2 = _interopRequireDefault(_timeControlsDurationDisplayJs); var _timeControlsTimeDividerJs = _dereq_('./time-controls/time-divider.js'); var _timeControlsTimeDividerJs2 = _interopRequireDefault(_timeControlsTimeDividerJs); var _timeControlsRemainingTimeDisplayJs = _dereq_('./time-controls/remaining-time-display.js'); var _timeControlsRemainingTimeDisplayJs2 = _interopRequireDefault(_timeControlsRemainingTimeDisplayJs); var _liveDisplayJs = _dereq_('./live-display.js'); var _liveDisplayJs2 = _interopRequireDefault(_liveDisplayJs); var _progressControlProgressControlJs = _dereq_('./progress-control/progress-control.js'); var _progressControlProgressControlJs2 = _interopRequireDefault(_progressControlProgressControlJs); var _fullscreenToggleJs = _dereq_('./fullscreen-toggle.js'); var _fullscreenToggleJs2 = _interopRequireDefault(_fullscreenToggleJs); var _volumeControlVolumeControlJs = _dereq_('./volume-control/volume-control.js'); var _volumeControlVolumeControlJs2 = _interopRequireDefault(_volumeControlVolumeControlJs); var _volumeMenuButtonJs = _dereq_('./volume-menu-button.js'); var _volumeMenuButtonJs2 = _interopRequireDefault(_volumeMenuButtonJs); var _muteToggleJs = _dereq_('./mute-toggle.js'); var _muteToggleJs2 = _interopRequireDefault(_muteToggleJs); var _textTrackControlsChaptersButtonJs = _dereq_('./text-track-controls/chapters-button.js'); var _textTrackControlsChaptersButtonJs2 = _interopRequireDefault(_textTrackControlsChaptersButtonJs); var _textTrackControlsSubtitlesButtonJs = _dereq_('./text-track-controls/subtitles-button.js'); var _textTrackControlsSubtitlesButtonJs2 = _interopRequireDefault(_textTrackControlsSubtitlesButtonJs); var _textTrackControlsCaptionsButtonJs = _dereq_('./text-track-controls/captions-button.js'); var _textTrackControlsCaptionsButtonJs2 = _interopRequireDefault(_textTrackControlsCaptionsButtonJs); var _playbackRateMenuPlaybackRateMenuButtonJs = _dereq_('./playback-rate-menu/playback-rate-menu-button.js'); var _playbackRateMenuPlaybackRateMenuButtonJs2 = _interopRequireDefault(_playbackRateMenuPlaybackRateMenuButtonJs); var _spacerControlsCustomControlSpacerJs = _dereq_('./spacer-controls/custom-control-spacer.js'); var _spacerControlsCustomControlSpacerJs2 = _interopRequireDefault(_spacerControlsCustomControlSpacerJs); /** * Container of main controls * * @extends Component * @class ControlBar */ var ControlBar = (function (_Component) { _inherits(ControlBar, _Component); function ControlBar() { _classCallCheck(this, ControlBar); _Component.apply(this, arguments); } /** * Create the component's DOM element * * @return {Element} * @method createEl */ ControlBar.prototype.createEl = function createEl() { return _Component.prototype.createEl.call(this, 'div', { className: 'vjs-control-bar' }); }; return ControlBar; })(_componentJs2['default']); ControlBar.prototype.options_ = { loadEvent: 'play', children: ['playToggle', 'volumeMenuButton', 'currentTimeDisplay', 'timeDivider', 'durationDisplay', 'progressControl', 'liveDisplay', 'remainingTimeDisplay', 'customControlSpacer', 'playbackRateMenuButton', 'chaptersButton', 'subtitlesButton', 'captionsButton', 'fullscreenToggle'] }; _componentJs2['default'].registerComponent('ControlBar', ControlBar); exports['default'] = ControlBar; module.exports = exports['default']; },{"../component.js":48,"./fullscreen-toggle.js":50,"./live-display.js":51,"./mute-toggle.js":52,"./play-toggle.js":53,"./playback-rate-menu/playback-rate-menu-button.js":54,"./progress-control/progress-control.js":58,"./spacer-controls/custom-control-spacer.js":60,"./text-track-controls/captions-button.js":63,"./text-track-controls/chapters-button.js":64,"./text-track-controls/subtitles-button.js":67,"./time-controls/current-time-display.js":70,"./time-controls/duration-display.js":71,"./time-controls/remaining-time-display.js":72,"./time-controls/time-divider.js":73,"./volume-control/volume-control.js":75,"./volume-menu-button.js":77}],50:[function(_dereq_,module,exports){ /** * @file fullscreen-toggle.js */ 'use strict'; exports.__esModule = true; function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError('Cannot call a class as a function'); } } function _inherits(subClass, superClass) { if (typeof superClass !== 'function' && superClass !== null) { throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } var _buttonJs = _dereq_('../button.js'); var _buttonJs2 = _interopRequireDefault(_buttonJs); var _componentJs = _dereq_('../component.js'); var _componentJs2 = _interopRequireDefault(_componentJs); /** * Toggle fullscreen video * * @extends Button * @class FullscreenToggle */ var FullscreenToggle = (function (_Button) { _inherits(FullscreenToggle, _Button); function FullscreenToggle() { _classCallCheck(this, FullscreenToggle); _Button.apply(this, arguments); } /** * Allow sub components to stack CSS class names * * @return {String} The constructed class name * @method buildCSSClass */ FullscreenToggle.prototype.buildCSSClass = function buildCSSClass() { return 'vjs-fullscreen-control ' + _Button.prototype.buildCSSClass.call(this); }; /** * Handles click for full screen * * @method handleClick */ FullscreenToggle.prototype.handleClick = function handleClick() { if (!this.player_.isFullscreen()) { this.player_.requestFullscreen(); this.controlText('Non-Fullscreen'); } else { this.player_.exitFullscreen(); this.controlText('Fullscreen'); } }; return FullscreenToggle; })(_buttonJs2['default']); FullscreenToggle.prototype.controlText_ = 'Fullscreen'; _componentJs2['default'].registerComponent('FullscreenToggle', FullscreenToggle); exports['default'] = FullscreenToggle; module.exports = exports['default']; },{"../button.js":47,"../component.js":48}],51:[function(_dereq_,module,exports){ /** * @file live-display.js */ 'use strict'; exports.__esModule = true; function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj['default'] = obj; return newObj; } } function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError('Cannot call a class as a function'); } } function _inherits(subClass, superClass) { if (typeof superClass !== 'function' && superClass !== null) { throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } var _component = _dereq_('../component'); var _component2 = _interopRequireDefault(_component); var _utilsDomJs = _dereq_('../utils/dom.js'); var Dom = _interopRequireWildcard(_utilsDomJs); /** * Displays the live indicator * TODO - Future make it click to snap to live * * @extends Component * @class LiveDisplay */ var LiveDisplay = (function (_Component) { _inherits(LiveDisplay, _Component); function LiveDisplay(player, options) { _classCallCheck(this, LiveDisplay); _Component.call(this, player, options); this.updateShowing(); this.on(this.player(), 'durationchange', this.updateShowing); } /** * Create the component's DOM element * * @return {Element} * @method createEl */ LiveDisplay.prototype.createEl = function createEl() { var el = _Component.prototype.createEl.call(this, 'div', { className: 'vjs-live-control vjs-control' }); this.contentEl_ = Dom.createEl('div', { className: 'vjs-live-display', innerHTML: '<span class="vjs-control-text">' + this.localize('Stream Type') + '</span>' + this.localize('LIVE'), 'aria-live': 'off' }); el.appendChild(this.contentEl_); return el; }; LiveDisplay.prototype.updateShowing = function updateShowing() { if (this.player().duration() === Infinity) { this.show(); } else { this.hide(); } }; return LiveDisplay; })(_component2['default']); _component2['default'].registerComponent('LiveDisplay', LiveDisplay); exports['default'] = LiveDisplay; module.exports = exports['default']; },{"../component":48,"../utils/dom.js":107}],52:[function(_dereq_,module,exports){ /** * @file mute-toggle.js */ 'use strict'; exports.__esModule = true; function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj['default'] = obj; return newObj; } } function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError('Cannot call a class as a function'); } } function _inherits(subClass, superClass) { if (typeof superClass !== 'function' && superClass !== null) { throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } var _button = _dereq_('../button'); var _button2 = _interopRequireDefault(_button); var _component = _dereq_('../component'); var _component2 = _interopRequireDefault(_component); var _utilsDomJs = _dereq_('../utils/dom.js'); var Dom = _interopRequireWildcard(_utilsDomJs); /** * A button component for muting the audio * * @param {Player|Object} player * @param {Object=} options * @extends Button * @class MuteToggle */ var MuteToggle = (function (_Button) { _inherits(MuteToggle, _Button); function MuteToggle(player, options) { _classCallCheck(this, MuteToggle); _Button.call(this, player, options); this.on(player, 'volumechange', this.update); // hide mute toggle if the current tech doesn't support volume control if (player.tech && player.tech['featuresVolumeControl'] === false) { this.addClass('vjs-hidden'); } this.on(player, 'loadstart', function () { this.update(); // We need to update the button to account for a default muted state. if (player.tech['featuresVolumeControl'] === false) { this.addClass('vjs-hidden'); } else { this.removeClass('vjs-hidden'); } }); } /** * Allow sub components to stack CSS class names * * @return {String} The constructed class name * @method buildCSSClass */ MuteToggle.prototype.buildCSSClass = function buildCSSClass() { return 'vjs-mute-control ' + _Button.prototype.buildCSSClass.call(this); }; /** * Handle click on mute * * @method handleClick */ MuteToggle.prototype.handleClick = function handleClick() { this.player_.muted(this.player_.muted() ? false : true); }; /** * Update volume * * @method update */ MuteToggle.prototype.update = function update() { var vol = this.player_.volume(), level = 3; if (vol === 0 || this.player_.muted()) { level = 0; } else if (vol < 0.33) { level = 1; } else if (vol < 0.67) { level = 2; } // Don't rewrite the button text if the actual text doesn't change. // This causes unnecessary and confusing information for screen reader users. // This check is needed because this function gets called every time the volume level is changed. var toMute = this.player_.muted() ? 'Unmute' : 'Mute'; var localizedMute = this.localize(toMute); if (this.controlText() !== localizedMute) { this.controlText(localizedMute); } /* TODO improve muted icon classes */ for (var i = 0; i < 4; i++) { Dom.removeElClass(this.el_, 'vjs-vol-' + i); } Dom.addElClass(this.el_, 'vjs-vol-' + level); }; return MuteToggle; })(_button2['default']); MuteToggle.prototype.controlText_ = 'Mute'; _component2['default'].registerComponent('MuteToggle', MuteToggle); exports['default'] = MuteToggle; module.exports = exports['default']; },{"../button":47,"../component":48,"../utils/dom.js":107}],53:[function(_dereq_,module,exports){ /** * @file play-toggle.js */ 'use strict'; exports.__esModule = true; function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError('Cannot call a class as a function'); } } function _inherits(subClass, superClass) { if (typeof superClass !== 'function' && superClass !== null) { throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } var _buttonJs = _dereq_('../button.js'); var _buttonJs2 = _interopRequireDefault(_buttonJs); var _componentJs = _dereq_('../component.js'); var _componentJs2 = _interopRequireDefault(_componentJs); /** * Button to toggle between play and pause * * @param {Player|Object} player * @param {Object=} options * @extends Button * @class PlayToggle */ var PlayToggle = (function (_Button) { _inherits(PlayToggle, _Button); function PlayToggle(player, options) { _classCallCheck(this, PlayToggle); _Button.call(this, player, options); this.on(player, 'play', this.handlePlay); this.on(player, 'pause', this.handlePause); } /** * Allow sub components to stack CSS class names * * @return {String} The constructed class name * @method buildCSSClass */ PlayToggle.prototype.buildCSSClass = function buildCSSClass() { return 'vjs-play-control ' + _Button.prototype.buildCSSClass.call(this); }; /** * Handle click to toggle between play and pause * * @method handleClick */ PlayToggle.prototype.handleClick = function handleClick() { if (this.player_.paused()) { this.player_.play(); } else { this.player_.pause(); } }; /** * Add the vjs-playing class to the element so it can change appearance * * @method handlePlay */ PlayToggle.prototype.handlePlay = function handlePlay() { this.removeClass('vjs-paused'); this.addClass('vjs-playing'); this.controlText('Pause'); // change the button text to "Pause" }; /** * Add the vjs-paused class to the element so it can change appearance * * @method handlePause */ PlayToggle.prototype.handlePause = function handlePause() { this.removeClass('vjs-playing'); this.addClass('vjs-paused'); this.controlText('Play'); // change the button text to "Play" }; return PlayToggle; })(_buttonJs2['default']); PlayToggle.prototype.controlText_ = 'Play'; _componentJs2['default'].registerComponent('PlayToggle', PlayToggle); exports['default'] = PlayToggle; module.exports = exports['default']; },{"../button.js":47,"../component.js":48}],54:[function(_dereq_,module,exports){ /** * @file playback-rate-menu-button.js */ 'use strict'; exports.__esModule = true; function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj['default'] = obj; return newObj; } } function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError('Cannot call a class as a function'); } } function _inherits(subClass, superClass) { if (typeof superClass !== 'function' && superClass !== null) { throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } var _menuMenuButtonJs = _dereq_('../../menu/menu-button.js'); var _menuMenuButtonJs2 = _interopRequireDefault(_menuMenuButtonJs); var _menuMenuJs = _dereq_('../../menu/menu.js'); var _menuMenuJs2 = _interopRequireDefault(_menuMenuJs); var _playbackRateMenuItemJs = _dereq_('./playback-rate-menu-item.js'); var _playbackRateMenuItemJs2 = _interopRequireDefault(_playbackRateMenuItemJs); var _componentJs = _dereq_('../../component.js'); var _componentJs2 = _interopRequireDefault(_componentJs); var _utilsDomJs = _dereq_('../../utils/dom.js'); var Dom = _interopRequireWildcard(_utilsDomJs); /** * The component for controlling the playback rate * * @param {Player|Object} player * @param {Object=} options * @extends MenuButton * @class PlaybackRateMenuButton */ var PlaybackRateMenuButton = (function (_MenuButton) { _inherits(PlaybackRateMenuButton, _MenuButton); function PlaybackRateMenuButton(player, options) { _classCallCheck(this, PlaybackRateMenuButton); _MenuButton.call(this, player, options); this.updateVisibility(); this.updateLabel(); this.on(player, 'loadstart', this.updateVisibility); this.on(player, 'ratechange', this.updateLabel); } /** * Create the component's DOM element * * @return {Element} * @method createEl */ PlaybackRateMenuButton.prototype.createEl = function createEl() { var el = _MenuButton.prototype.createEl.call(this); this.labelEl_ = Dom.createEl('div', { className: 'vjs-playback-rate-value', innerHTML: 1.0 }); el.appendChild(this.labelEl_); return el; }; /** * Allow sub components to stack CSS class names * * @return {String} The constructed class name * @method buildCSSClass */ PlaybackRateMenuButton.prototype.buildCSSClass = function buildCSSClass() { return 'vjs-playback-rate ' + _MenuButton.prototype.buildCSSClass.call(this); }; /** * Create the playback rate menu * * @return {Menu} Menu object populated with items * @method createMenu */ PlaybackRateMenuButton.prototype.createMenu = function createMenu() { var menu = new _menuMenuJs2['default'](this.player()); var rates = this.playbackRates(); if (rates) { for (var i = rates.length - 1; i >= 0; i--) { menu.addChild(new _playbackRateMenuItemJs2['default'](this.player(), { 'rate': rates[i] + 'x' })); } } return menu; }; /** * Updates ARIA accessibility attributes * * @method updateARIAAttributes */ PlaybackRateMenuButton.prototype.updateARIAAttributes = function updateARIAAttributes() { // Current playback rate this.el().setAttribute('aria-valuenow', this.player().playbackRate()); }; /** * Handle menu item click * * @method handleClick */ PlaybackRateMenuButton.prototype.handleClick = function handleClick() { // select next rate option var currentRate = this.player().playbackRate(); var rates = this.playbackRates(); // this will select first one if the last one currently selected var newRate = rates[0]; for (var i = 0; i < rates.length; i++) { if (rates[i] > currentRate) { newRate = rates[i]; break; } } this.player().playbackRate(newRate); }; /** * Get possible playback rates * * @return {Array} Possible playback rates * @method playbackRates */ PlaybackRateMenuButton.prototype.playbackRates = function playbackRates() { return this.options_['playbackRates'] || this.options_.playerOptions && this.options_.playerOptions['playbackRates']; }; /** * Get supported playback rates * * @return {Array} Supported playback rates * @method playbackRateSupported */ PlaybackRateMenuButton.prototype.playbackRateSupported = function playbackRateSupported() { return this.player().tech && this.player().tech['featuresPlaybackRate'] && this.playbackRates() && this.playbackRates().length > 0; }; /** * Hide playback rate controls when they're no playback rate options to select * * @method updateVisibility */ PlaybackRateMenuButton.prototype.updateVisibility = function updateVisibility() { if (this.playbackRateSupported()) { this.removeClass('vjs-hidden'); } else { this.addClass('vjs-hidden'); } }; /** * Update button label when rate changed * * @method updateLabel */ PlaybackRateMenuButton.prototype.updateLabel = function updateLabel() { if (this.playbackRateSupported()) { this.labelEl_.innerHTML = this.player().playbackRate() + 'x'; } }; return PlaybackRateMenuButton; })(_menuMenuButtonJs2['default']); PlaybackRateMenuButton.prototype.controlText_ = 'Playback Rate'; _componentJs2['default'].registerComponent('PlaybackRateMenuButton', PlaybackRateMenuButton); exports['default'] = PlaybackRateMenuButton; module.exports = exports['default']; },{"../../component.js":48,"../../menu/menu-button.js":84,"../../menu/menu.js":86,"../../utils/dom.js":107,"./playback-rate-menu-item.js":55}],55:[function(_dereq_,module,exports){ /** * @file playback-rate-menu-item.js */ 'use strict'; exports.__esModule = true; function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError('Cannot call a class as a function'); } } function _inherits(subClass, superClass) { if (typeof superClass !== 'function' && superClass !== null) { throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } var _menuMenuItemJs = _dereq_('../../menu/menu-item.js'); var _menuMenuItemJs2 = _interopRequireDefault(_menuMenuItemJs); var _componentJs = _dereq_('../../component.js'); var _componentJs2 = _interopRequireDefault(_componentJs); /** * The specific menu item type for selecting a playback rate * * @param {Player|Object} player * @param {Object=} options * @extends MenuItem * @class PlaybackRateMenuItem */ var PlaybackRateMenuItem = (function (_MenuItem) { _inherits(PlaybackRateMenuItem, _MenuItem); function PlaybackRateMenuItem(player, options) { _classCallCheck(this, PlaybackRateMenuItem); var label = options['rate']; var rate = parseFloat(label, 10); // Modify options for parent MenuItem class's init. options['label'] = label; options['selected'] = rate === 1; _MenuItem.call(this, player, options); this.label = label; this.rate = rate; this.on(player, 'ratechange', this.update); } /** * Handle click on menu item * * @method handleClick */ PlaybackRateMenuItem.prototype.handleClick = function handleClick() { _MenuItem.prototype.handleClick.call(this); this.player().playbackRate(this.rate); }; /** * Update playback rate with selected rate * * @method update */ PlaybackRateMenuItem.prototype.update = function update() { this.selected(this.player().playbackRate() === this.rate); }; return PlaybackRateMenuItem; })(_menuMenuItemJs2['default']); PlaybackRateMenuItem.prototype.contentElType = 'button'; _componentJs2['default'].registerComponent('PlaybackRateMenuItem', PlaybackRateMenuItem); exports['default'] = PlaybackRateMenuItem; module.exports = exports['default']; },{"../../component.js":48,"../../menu/menu-item.js":85}],56:[function(_dereq_,module,exports){ /** * @file load-progress-bar.js */ 'use strict'; exports.__esModule = true; function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj['default'] = obj; return newObj; } } function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError('Cannot call a class as a function'); } } function _inherits(subClass, superClass) { if (typeof superClass !== 'function' && superClass !== null) { throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } var _componentJs = _dereq_('../../component.js'); var _componentJs2 = _interopRequireDefault(_componentJs); var _utilsDomJs = _dereq_('../../utils/dom.js'); var Dom = _interopRequireWildcard(_utilsDomJs); /** * Shows load progress * * @param {Player|Object} player * @param {Object=} options * @extends Component * @class LoadProgressBar */ var LoadProgressBar = (function (_Component) { _inherits(LoadProgressBar, _Component); function LoadProgressBar(player, options) { _classCallCheck(this, LoadProgressBar); _Component.call(this, player, options); this.on(player, 'progress', this.update); } /** * Create the component's DOM element * * @return {Element} * @method createEl */ LoadProgressBar.prototype.createEl = function createEl() { return _Component.prototype.createEl.call(this, 'div', { className: 'vjs-load-progress', innerHTML: '<span class="vjs-control-text"><span>' + this.localize('Loaded') + '</span>: 0%</span>' }); }; /** * Update progress bar * * @method update */ LoadProgressBar.prototype.update = function update() { var buffered = this.player_.buffered(); var duration = this.player_.duration(); var bufferedEnd = this.player_.bufferedEnd(); var children = this.el_.children; // get the percent width of a time compared to the total end var percentify = function percentify(time, end) { var percent = time / end || 0; // no NaN return (percent >= 1 ? 1 : percent) * 100 + '%'; }; // update the width of the progress bar this.el_.style.width = percentify(bufferedEnd, duration); // add child elements to represent the individual buffered time ranges for (var i = 0; i < buffered.length; i++) { var start = buffered.start(i); var end = buffered.end(i); var part = children[i]; if (!part) { part = this.el_.appendChild(Dom.createEl()); } // set the percent based on the width of the progress bar (bufferedEnd) part.style.left = percentify(start, bufferedEnd); part.style.width = percentify(end - start, bufferedEnd); } // remove unused buffered range elements for (var i = children.length; i > buffered.length; i--) { this.el_.removeChild(children[i - 1]); } }; return LoadProgressBar; })(_componentJs2['default']); _componentJs2['default'].registerComponent('LoadProgressBar', LoadProgressBar); exports['default'] = LoadProgressBar; module.exports = exports['default']; },{"../../component.js":48,"../../utils/dom.js":107}],57:[function(_dereq_,module,exports){ /** * @file play-progress-bar.js */ 'use strict'; exports.__esModule = true; function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj['default'] = obj; return newObj; } } function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError('Cannot call a class as a function'); } } function _inherits(subClass, superClass) { if (typeof superClass !== 'function' && superClass !== null) { throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } var _componentJs = _dereq_('../../component.js'); var _componentJs2 = _interopRequireDefault(_componentJs); var _utilsFnJs = _dereq_('../../utils/fn.js'); var Fn = _interopRequireWildcard(_utilsFnJs); var _utilsFormatTimeJs = _dereq_('../../utils/format-time.js'); var _utilsFormatTimeJs2 = _interopRequireDefault(_utilsFormatTimeJs); /** * Shows play progress * * @param {Player|Object} player * @param {Object=} options * @extends Component * @class PlayProgressBar */ var PlayProgressBar = (function (_Component) { _inherits(PlayProgressBar, _Component); function PlayProgressBar(player, options) { _classCallCheck(this, PlayProgressBar); _Component.call(this, player, options); this.updateDataAttr(); this.on(player, 'timeupdate', this.updateDataAttr); player.ready(Fn.bind(this, this.updateDataAttr)); } /** * Create the component's DOM element * * @return {Element} * @method createEl */ PlayProgressBar.prototype.createEl = function createEl() { return _Component.prototype.createEl.call(this, 'div', { className: 'vjs-play-progress', innerHTML: '<span class="vjs-control-text"><span>' + this.localize('Progress') + '</span>: 0%</span>' }); }; PlayProgressBar.prototype.updateDataAttr = function updateDataAttr() { var time = this.player_.scrubbing() ? this.player_.getCache().currentTime : this.player_.currentTime(); this.el_.setAttribute('data-current-time', _utilsFormatTimeJs2['default'](time, this.player_.duration())); }; return PlayProgressBar; })(_componentJs2['default']); _componentJs2['default'].registerComponent('PlayProgressBar', PlayProgressBar); exports['default'] = PlayProgressBar; module.exports = exports['default']; },{"../../component.js":48,"../../utils/fn.js":109,"../../utils/format-time.js":110}],58:[function(_dereq_,module,exports){ /** * @file progress-control.js */ 'use strict'; exports.__esModule = true; function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError('Cannot call a class as a function'); } } function _inherits(subClass, superClass) { if (typeof superClass !== 'function' && superClass !== null) { throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } var _componentJs = _dereq_('../../component.js'); var _componentJs2 = _interopRequireDefault(_componentJs); var _seekBarJs = _dereq_('./seek-bar.js'); var _seekBarJs2 = _interopRequireDefault(_seekBarJs); /** * The Progress Control component contains the seek bar, load progress, * and play progress * * @param {Player|Object} player * @param {Object=} options * @extends Component * @class ProgressControl */ var ProgressControl = (function (_Component) { _inherits(ProgressControl, _Component); function ProgressControl() { _classCallCheck(this, ProgressControl); _Component.apply(this, arguments); } /** * Create the component's DOM element * * @return {Element} * @method createEl */ ProgressControl.prototype.createEl = function createEl() { return _Component.prototype.createEl.call(this, 'div', { className: 'vjs-progress-control vjs-control' }); }; return ProgressControl; })(_componentJs2['default']); ProgressControl.prototype.options_ = { children: { 'seekBar': {} } }; _componentJs2['default'].registerComponent('ProgressControl', ProgressControl); exports['default'] = ProgressControl; module.exports = exports['default']; },{"../../component.js":48,"./seek-bar.js":59}],59:[function(_dereq_,module,exports){ /** * @file seek-bar.js */ 'use strict'; exports.__esModule = true; function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj['default'] = obj; return newObj; } } function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError('Cannot call a class as a function'); } } function _inherits(subClass, superClass) { if (typeof superClass !== 'function' && superClass !== null) { throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } var _sliderSliderJs = _dereq_('../../slider/slider.js'); var _sliderSliderJs2 = _interopRequireDefault(_sliderSliderJs); var _componentJs = _dereq_('../../component.js'); var _componentJs2 = _interopRequireDefault(_componentJs); var _loadProgressBarJs = _dereq_('./load-progress-bar.js'); var _loadProgressBarJs2 = _interopRequireDefault(_loadProgressBarJs); var _playProgressBarJs = _dereq_('./play-progress-bar.js'); var _playProgressBarJs2 = _interopRequireDefault(_playProgressBarJs); var _utilsFnJs = _dereq_('../../utils/fn.js'); var Fn = _interopRequireWildcard(_utilsFnJs); var _utilsFormatTimeJs = _dereq_('../../utils/format-time.js'); var _utilsFormatTimeJs2 = _interopRequireDefault(_utilsFormatTimeJs); /** * Seek Bar and holder for the progress bars * * @param {Player|Object} player * @param {Object=} options * @extends Slider * @class SeekBar */ var SeekBar = (function (_Slider) { _inherits(SeekBar, _Slider); function SeekBar(player, options) { _classCallCheck(this, SeekBar); _Slider.call(this, player, options); this.on(player, 'timeupdate', this.updateARIAAttributes); player.ready(Fn.bind(this, this.updateARIAAttributes)); } /** * Create the component's DOM element * * @return {Element} * @method createEl */ SeekBar.prototype.createEl = function createEl() { return _Slider.prototype.createEl.call(this, 'div', { className: 'vjs-progress-holder', 'aria-label': 'video progress bar' }); }; /** * Update ARIA accessibility attributes * * @method updateARIAAttributes */ SeekBar.prototype.updateARIAAttributes = function updateARIAAttributes() { // Allows for smooth scrubbing, when player can't keep up. var time = this.player_.scrubbing() ? this.player_.getCache().currentTime : this.player_.currentTime(); this.el_.setAttribute('aria-valuenow', (this.getPercent() * 100).toFixed(2)); // machine readable value of progress bar (percentage complete) this.el_.setAttribute('aria-valuetext', _utilsFormatTimeJs2['default'](time, this.player_.duration())); // human readable value of progress bar (time complete) }; /** * Get percentage of video played * * @return {Number} Percentage played * @method getPercent */ SeekBar.prototype.getPercent = function getPercent() { var percent = this.player_.currentTime() / this.player_.duration(); return percent >= 1 ? 1 : percent; }; /** * Handle mouse down on seek bar * * @method handleMouseDown */ SeekBar.prototype.handleMouseDown = function handleMouseDown(event) { _Slider.prototype.handleMouseDown.call(this, event); this.player_.scrubbing(true); this.videoWasPlaying = !this.player_.paused(); this.player_.pause(); }; /** * Handle mouse move on seek bar * * @method handleMouseMove */ SeekBar.prototype.handleMouseMove = function handleMouseMove(event) { var newTime = this.calculateDistance(event) * this.player_.duration(); // Don't let video end while scrubbing. if (newTime === this.player_.duration()) { newTime = newTime - 0.1; } // Set new time (tell player to seek to new time) this.player_.currentTime(newTime); }; /** * Handle mouse up on seek bar * * @method handleMouseUp */ SeekBar.prototype.handleMouseUp = function handleMouseUp(event) { _Slider.prototype.handleMouseUp.call(this, event); this.player_.scrubbing(false); if (this.videoWasPlaying) { this.player_.play(); } }; /** * Move more quickly fast forward for keyboard-only users * * @method stepForward */ SeekBar.prototype.stepForward = function stepForward() { this.player_.currentTime(this.player_.currentTime() + 5); // more quickly fast forward for keyboard-only users }; /** * Move more quickly rewind for keyboard-only users * * @method stepBack */ SeekBar.prototype.stepBack = function stepBack() { this.player_.currentTime(this.player_.currentTime() - 5); // more quickly rewind for keyboard-only users }; return SeekBar; })(_sliderSliderJs2['default']); SeekBar.prototype.options_ = { children: { 'loadProgressBar': {}, 'playProgressBar': {} }, 'barName': 'playProgressBar' }; SeekBar.prototype.playerEvent = 'timeupdate'; _componentJs2['default'].registerComponent('SeekBar', SeekBar); exports['default'] = SeekBar; module.exports = exports['default']; },{"../../component.js":48,"../../slider/slider.js":91,"../../utils/fn.js":109,"../../utils/format-time.js":110,"./load-progress-bar.js":56,"./play-progress-bar.js":57}],60:[function(_dereq_,module,exports){ /** * @file custom-control-spacer.js */ 'use strict'; exports.__esModule = true; function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError('Cannot call a class as a function'); } } function _inherits(subClass, superClass) { if (typeof superClass !== 'function' && superClass !== null) { throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } var _spacerJs = _dereq_('./spacer.js'); var _spacerJs2 = _interopRequireDefault(_spacerJs); var _componentJs = _dereq_('../../component.js'); var _componentJs2 = _interopRequireDefault(_componentJs); /** * Spacer specifically meant to be used as an insertion point for new plugins, etc. * * @extends Spacer * @class CustomControlSpacer */ var CustomControlSpacer = (function (_Spacer) { _inherits(CustomControlSpacer, _Spacer); function CustomControlSpacer() { _classCallCheck(this, CustomControlSpacer); _Spacer.apply(this, arguments); } /** * Allow sub components to stack CSS class names * * @return {String} The constructed class name * @method buildCSSClass */ CustomControlSpacer.prototype.buildCSSClass = function buildCSSClass() { return 'vjs-custom-control-spacer ' + _Spacer.prototype.buildCSSClass.call(this); }; /** * Create the component's DOM element * * @return {Element} * @method createEl */ CustomControlSpacer.prototype.createEl = function createEl() { var el = _Spacer.prototype.createEl.call(this, { className: this.buildCSSClass() }); // No-flex/table-cell mode requires there be some content // in the cell to fill the remaining space of the table. el.innerHTML = '&nbsp;'; return el; }; return CustomControlSpacer; })(_spacerJs2['default']); _componentJs2['default'].registerComponent('CustomControlSpacer', CustomControlSpacer); exports['default'] = CustomControlSpacer; module.exports = exports['default']; },{"../../component.js":48,"./spacer.js":61}],61:[function(_dereq_,module,exports){ /** * @file spacer.js */ 'use strict'; exports.__esModule = true; function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError('Cannot call a class as a function'); } } function _inherits(subClass, superClass) { if (typeof superClass !== 'function' && superClass !== null) { throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } var _componentJs = _dereq_('../../component.js'); var _componentJs2 = _interopRequireDefault(_componentJs); /** * Just an empty spacer element that can be used as an append point for plugins, etc. * Also can be used to create space between elements when necessary. * * @extends Component * @class Spacer */ var Spacer = (function (_Component) { _inherits(Spacer, _Component); function Spacer() { _classCallCheck(this, Spacer); _Component.apply(this, arguments); } /** * Allow sub components to stack CSS class names * * @return {String} The constructed class name * @method buildCSSClass */ Spacer.prototype.buildCSSClass = function buildCSSClass() { return 'vjs-spacer ' + _Component.prototype.buildCSSClass.call(this); }; /** * Create the component's DOM element * * @param {Object} props An object of properties * @return {Element} * @method createEl */ Spacer.prototype.createEl = function createEl(props) { return _Component.prototype.createEl.call(this, 'div', { className: this.buildCSSClass() }); }; return Spacer; })(_componentJs2['default']); _componentJs2['default'].registerComponent('Spacer', Spacer); exports['default'] = Spacer; module.exports = exports['default']; },{"../../component.js":48}],62:[function(_dereq_,module,exports){ /** * @file caption-settings-menu-item.js */ 'use strict'; exports.__esModule = true; function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError('Cannot call a class as a function'); } } function _inherits(subClass, superClass) { if (typeof superClass !== 'function' && superClass !== null) { throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } var _textTrackMenuItemJs = _dereq_('./text-track-menu-item.js'); var _textTrackMenuItemJs2 = _interopRequireDefault(_textTrackMenuItemJs); var _componentJs = _dereq_('../../component.js'); var _componentJs2 = _interopRequireDefault(_componentJs); /** * The menu item for caption track settings menu * * @param {Player|Object} player * @param {Object=} options * @extends TextTrackMenuItem * @class CaptionSettingsMenuItem */ var CaptionSettingsMenuItem = (function (_TextTrackMenuItem) { _inherits(CaptionSettingsMenuItem, _TextTrackMenuItem); function CaptionSettingsMenuItem(player, options) { _classCallCheck(this, CaptionSettingsMenuItem); options['track'] = { 'kind': options['kind'], 'player': player, 'label': options['kind'] + ' settings', 'default': false, mode: 'disabled' }; _TextTrackMenuItem.call(this, player, options); this.addClass('vjs-texttrack-settings'); } /** * Handle click on menu item * * @method handleClick */ CaptionSettingsMenuItem.prototype.handleClick = function handleClick() { this.player().getChild('textTrackSettings').show(); }; return CaptionSettingsMenuItem; })(_textTrackMenuItemJs2['default']); _componentJs2['default'].registerComponent('CaptionSettingsMenuItem', CaptionSettingsMenuItem); exports['default'] = CaptionSettingsMenuItem; module.exports = exports['default']; },{"../../component.js":48,"./text-track-menu-item.js":69}],63:[function(_dereq_,module,exports){ /** * @file captions-button.js */ 'use strict'; exports.__esModule = true; function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError('Cannot call a class as a function'); } } function _inherits(subClass, superClass) { if (typeof superClass !== 'function' && superClass !== null) { throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } var _textTrackButtonJs = _dereq_('./text-track-button.js'); var _textTrackButtonJs2 = _interopRequireDefault(_textTrackButtonJs); var _componentJs = _dereq_('../../component.js'); var _componentJs2 = _interopRequireDefault(_componentJs); var _captionSettingsMenuItemJs = _dereq_('./caption-settings-menu-item.js'); var _captionSettingsMenuItemJs2 = _interopRequireDefault(_captionSettingsMenuItemJs); /** * The button component for toggling and selecting captions * * @param {Object} player Player object * @param {Object=} options Object of option names and values * @param {Function=} ready Ready callback function * @extends TextTrackButton * @class CaptionsButton */ var CaptionsButton = (function (_TextTrackButton) { _inherits(CaptionsButton, _TextTrackButton); function CaptionsButton(player, options, ready) { _classCallCheck(this, CaptionsButton); _TextTrackButton.call(this, player, options, ready); this.el_.setAttribute('aria-label', 'Captions Menu'); } /** * Allow sub components to stack CSS class names * * @return {String} The constructed class name * @method buildCSSClass */ CaptionsButton.prototype.buildCSSClass = function buildCSSClass() { return 'vjs-captions-button ' + _TextTrackButton.prototype.buildCSSClass.call(this); }; /** * Update caption menu items * * @method update */ CaptionsButton.prototype.update = function update() { var threshold = 2; _TextTrackButton.prototype.update.call(this); // if native, then threshold is 1 because no settings button if (this.player().tech && this.player().tech['featuresNativeTextTracks']) { threshold = 1; } if (this.items && this.items.length > threshold) { this.show(); } else { this.hide(); } }; /** * Create caption menu items * * @return {Array} Array of menu items * @method createItems */ CaptionsButton.prototype.createItems = function createItems() { var items = []; if (!(this.player().tech && this.player().tech['featuresNativeTextTracks'])) { items.push(new _captionSettingsMenuItemJs2['default'](this.player_, { 'kind': this.kind_ })); } return _TextTrackButton.prototype.createItems.call(this, items); }; return CaptionsButton; })(_textTrackButtonJs2['default']); CaptionsButton.prototype.kind_ = 'captions'; CaptionsButton.prototype.controlText_ = 'Captions'; _componentJs2['default'].registerComponent('CaptionsButton', CaptionsButton); exports['default'] = CaptionsButton; module.exports = exports['default']; },{"../../component.js":48,"./caption-settings-menu-item.js":62,"./text-track-button.js":68}],64:[function(_dereq_,module,exports){ /** * @file chapters-button.js */ 'use strict'; exports.__esModule = true; function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj['default'] = obj; return newObj; } } function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError('Cannot call a class as a function'); } } function _inherits(subClass, superClass) { if (typeof superClass !== 'function' && superClass !== null) { throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } var _textTrackButtonJs = _dereq_('./text-track-button.js'); var _textTrackButtonJs2 = _interopRequireDefault(_textTrackButtonJs); var _componentJs = _dereq_('../../component.js'); var _componentJs2 = _interopRequireDefault(_componentJs); var _textTrackMenuItemJs = _dereq_('./text-track-menu-item.js'); var _textTrackMenuItemJs2 = _interopRequireDefault(_textTrackMenuItemJs); var _chaptersTrackMenuItemJs = _dereq_('./chapters-track-menu-item.js'); var _chaptersTrackMenuItemJs2 = _interopRequireDefault(_chaptersTrackMenuItemJs); var _menuMenuJs = _dereq_('../../menu/menu.js'); var _menuMenuJs2 = _interopRequireDefault(_menuMenuJs); var _utilsDomJs = _dereq_('../../utils/dom.js'); var Dom = _interopRequireWildcard(_utilsDomJs); var _utilsFnJs = _dereq_('../../utils/fn.js'); var Fn = _interopRequireWildcard(_utilsFnJs); var _utilsToTitleCaseJs = _dereq_('../../utils/to-title-case.js'); var _utilsToTitleCaseJs2 = _interopRequireDefault(_utilsToTitleCaseJs); var _globalWindow = _dereq_('global/window'); var _globalWindow2 = _interopRequireDefault(_globalWindow); /** * The button component for toggling and selecting chapters * Chapters act much differently than other text tracks * Cues are navigation vs. other tracks of alternative languages * * @param {Object} player Player object * @param {Object=} options Object of option names and values * @param {Function=} ready Ready callback function * @extends TextTrackButton * @class ChaptersButton */ var ChaptersButton = (function (_TextTrackButton) { _inherits(ChaptersButton, _TextTrackButton); function ChaptersButton(player, options, ready) { _classCallCheck(this, ChaptersButton); _TextTrackButton.call(this, player, options, ready); this.el_.setAttribute('aria-label', 'Chapters Menu'); } /** * Allow sub components to stack CSS class names * * @return {String} The constructed class name * @method buildCSSClass */ ChaptersButton.prototype.buildCSSClass = function buildCSSClass() { return 'vjs-chapters-button ' + _TextTrackButton.prototype.buildCSSClass.call(this); }; /** * Create a menu item for each text track * * @return {Array} Array of menu items * @method createItems */ ChaptersButton.prototype.createItems = function createItems() { var items = []; var tracks = this.player_.textTracks(); if (!tracks) { return items; } for (var i = 0; i < tracks.length; i++) { var track = tracks[i]; if (track['kind'] === this.kind_) { items.push(new _textTrackMenuItemJs2['default'](this.player_, { 'track': track })); } } return items; }; /** * Create menu from chapter buttons * * @return {Menu} Menu of chapter buttons * @method createMenu */ ChaptersButton.prototype.createMenu = function createMenu() { var tracks = this.player_.textTracks() || []; var chaptersTrack = undefined; var items = this.items = []; for (var i = 0, l = tracks.length; i < l; i++) { var track = tracks[i]; if (track['kind'] === this.kind_) { if (!track.cues) { track['mode'] = 'hidden'; /* jshint loopfunc:true */ // TODO see if we can figure out a better way of doing this https://github.com/videojs/video.js/issues/1864 _globalWindow2['default'].setTimeout(Fn.bind(this, function () { this.createMenu(); }), 100); /* jshint loopfunc:false */ } else { chaptersTrack = track; break; } } } var menu = this.menu; if (menu === undefined) { menu = new _menuMenuJs2['default'](this.player_); menu.contentEl().appendChild(Dom.createEl('li', { className: 'vjs-menu-title', innerHTML: _utilsToTitleCaseJs2['default'](this.kind_), tabIndex: -1 })); } if (chaptersTrack) { var cues = chaptersTrack['cues'], cue = undefined; for (var i = 0, l = cues.length; i < l; i++) { cue = cues[i]; var mi = new _chaptersTrackMenuItemJs2['default'](this.player_, { 'track': chaptersTrack, 'cue': cue }); items.push(mi); menu.addChild(mi); } this.addChild(menu); } if (this.items.length > 0) { this.show(); } return menu; }; return ChaptersButton; })(_textTrackButtonJs2['default']); ChaptersButton.prototype.kind_ = 'chapters'; ChaptersButton.prototype.controlText_ = 'Chapters'; _componentJs2['default'].registerComponent('ChaptersButton', ChaptersButton); exports['default'] = ChaptersButton; module.exports = exports['default']; },{"../../component.js":48,"../../menu/menu.js":86,"../../utils/dom.js":107,"../../utils/fn.js":109,"../../utils/to-title-case.js":116,"./chapters-track-menu-item.js":65,"./text-track-button.js":68,"./text-track-menu-item.js":69,"global/window":2}],65:[function(_dereq_,module,exports){ /** * @file chapters-track-menu-item.js */ 'use strict'; exports.__esModule = true; function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj['default'] = obj; return newObj; } } function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError('Cannot call a class as a function'); } } function _inherits(subClass, superClass) { if (typeof superClass !== 'function' && superClass !== null) { throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } var _menuMenuItemJs = _dereq_('../../menu/menu-item.js'); var _menuMenuItemJs2 = _interopRequireDefault(_menuMenuItemJs); var _componentJs = _dereq_('../../component.js'); var _componentJs2 = _interopRequireDefault(_componentJs); var _utilsFnJs = _dereq_('../../utils/fn.js'); var Fn = _interopRequireWildcard(_utilsFnJs); /** * The chapter track menu item * * @param {Player|Object} player * @param {Object=} options * @extends MenuItem * @class ChaptersTrackMenuItem */ var ChaptersTrackMenuItem = (function (_MenuItem) { _inherits(ChaptersTrackMenuItem, _MenuItem); function ChaptersTrackMenuItem(player, options) { _classCallCheck(this, ChaptersTrackMenuItem); var track = options['track']; var cue = options['cue']; var currentTime = player.currentTime(); // Modify options for parent MenuItem class's init. options['label'] = cue.text; options['selected'] = cue['startTime'] <= currentTime && currentTime < cue['endTime']; _MenuItem.call(this, player, options); this.track = track; this.cue = cue; track.addEventListener('cuechange', Fn.bind(this, this.update)); } /** * Handle click on menu item * * @method handleClick */ ChaptersTrackMenuItem.prototype.handleClick = function handleClick() { _MenuItem.prototype.handleClick.call(this); this.player_.currentTime(this.cue.startTime); this.update(this.cue.startTime); }; /** * Update chapter menu item * * @method update */ ChaptersTrackMenuItem.prototype.update = function update() { var cue = this.cue; var currentTime = this.player_.currentTime(); // vjs.log(currentTime, cue.startTime); this.selected(cue['startTime'] <= currentTime && currentTime < cue['endTime']); }; return ChaptersTrackMenuItem; })(_menuMenuItemJs2['default']); _componentJs2['default'].registerComponent('ChaptersTrackMenuItem', ChaptersTrackMenuItem); exports['default'] = ChaptersTrackMenuItem; module.exports = exports['default']; },{"../../component.js":48,"../../menu/menu-item.js":85,"../../utils/fn.js":109}],66:[function(_dereq_,module,exports){ /** * @file off-text-track-menu-item.js */ 'use strict'; exports.__esModule = true; function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError('Cannot call a class as a function'); } } function _inherits(subClass, superClass) { if (typeof superClass !== 'function' && superClass !== null) { throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } var _textTrackMenuItemJs = _dereq_('./text-track-menu-item.js'); var _textTrackMenuItemJs2 = _interopRequireDefault(_textTrackMenuItemJs); var _componentJs = _dereq_('../../component.js'); var _componentJs2 = _interopRequireDefault(_componentJs); /** * A special menu item for turning of a specific type of text track * * @param {Player|Object} player * @param {Object=} options * @extends TextTrackMenuItem * @class OffTextTrackMenuItem */ var OffTextTrackMenuItem = (function (_TextTrackMenuItem) { _inherits(OffTextTrackMenuItem, _TextTrackMenuItem); function OffTextTrackMenuItem(player, options) { _classCallCheck(this, OffTextTrackMenuItem); // Create pseudo track info // Requires options['kind'] options['track'] = { 'kind': options['kind'], 'player': player, 'label': options['kind'] + ' off', 'default': false, 'mode': 'disabled' }; _TextTrackMenuItem.call(this, player, options); this.selected(true); } /** * Handle text track change * * @param {Object} event Event object * @method handleTracksChange */ OffTextTrackMenuItem.prototype.handleTracksChange = function handleTracksChange(event) { var tracks = this.player().textTracks(); var selected = true; for (var i = 0, l = tracks.length; i < l; i++) { var track = tracks[i]; if (track['kind'] === this.track['kind'] && track['mode'] === 'showing') { selected = false; break; } } this.selected(selected); }; return OffTextTrackMenuItem; })(_textTrackMenuItemJs2['default']); _componentJs2['default'].registerComponent('OffTextTrackMenuItem', OffTextTrackMenuItem); exports['default'] = OffTextTrackMenuItem; module.exports = exports['default']; },{"../../component.js":48,"./text-track-menu-item.js":69}],67:[function(_dereq_,module,exports){ /** * @file subtitles-button.js */ 'use strict'; exports.__esModule = true; function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError('Cannot call a class as a function'); } } function _inherits(subClass, superClass) { if (typeof superClass !== 'function' && superClass !== null) { throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } var _textTrackButtonJs = _dereq_('./text-track-button.js'); var _textTrackButtonJs2 = _interopRequireDefault(_textTrackButtonJs); var _componentJs = _dereq_('../../component.js'); var _componentJs2 = _interopRequireDefault(_componentJs); /** * The button component for toggling and selecting subtitles * * @param {Object} player Player object * @param {Object=} options Object of option names and values * @param {Function=} ready Ready callback function * @extends TextTrackButton * @class SubtitlesButton */ var SubtitlesButton = (function (_TextTrackButton) { _inherits(SubtitlesButton, _TextTrackButton); function SubtitlesButton(player, options, ready) { _classCallCheck(this, SubtitlesButton); _TextTrackButton.call(this, player, options, ready); this.el_.setAttribute('aria-label', 'Subtitles Menu'); } /** * Allow sub components to stack CSS class names * * @return {String} The constructed class name * @method buildCSSClass */ SubtitlesButton.prototype.buildCSSClass = function buildCSSClass() { return 'vjs-subtitles-button ' + _TextTrackButton.prototype.buildCSSClass.call(this); }; return SubtitlesButton; })(_textTrackButtonJs2['default']); SubtitlesButton.prototype.kind_ = 'subtitles'; SubtitlesButton.prototype.controlText_ = 'Subtitles'; _componentJs2['default'].registerComponent('SubtitlesButton', SubtitlesButton); exports['default'] = SubtitlesButton; module.exports = exports['default']; },{"../../component.js":48,"./text-track-button.js":68}],68:[function(_dereq_,module,exports){ /** * @file text-track-button.js */ 'use strict'; exports.__esModule = true; function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj['default'] = obj; return newObj; } } function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError('Cannot call a class as a function'); } } function _inherits(subClass, superClass) { if (typeof superClass !== 'function' && superClass !== null) { throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } var _menuMenuButtonJs = _dereq_('../../menu/menu-button.js'); var _menuMenuButtonJs2 = _interopRequireDefault(_menuMenuButtonJs); var _componentJs = _dereq_('../../component.js'); var _componentJs2 = _interopRequireDefault(_componentJs); var _utilsFnJs = _dereq_('../../utils/fn.js'); var Fn = _interopRequireWildcard(_utilsFnJs); var _textTrackMenuItemJs = _dereq_('./text-track-menu-item.js'); var _textTrackMenuItemJs2 = _interopRequireDefault(_textTrackMenuItemJs); var _offTextTrackMenuItemJs = _dereq_('./off-text-track-menu-item.js'); var _offTextTrackMenuItemJs2 = _interopRequireDefault(_offTextTrackMenuItemJs); /** * The base class for buttons that toggle specific text track types (e.g. subtitles) * * @param {Player|Object} player * @param {Object=} options * @extends MenuButton * @class TextTrackButton */ var TextTrackButton = (function (_MenuButton) { _inherits(TextTrackButton, _MenuButton); function TextTrackButton(player, options) { _classCallCheck(this, TextTrackButton); _MenuButton.call(this, player, options); var tracks = this.player_.textTracks(); if (this.items.length <= 1) { this.hide(); } if (!tracks) { return; } var updateHandler = Fn.bind(this, this.update); tracks.addEventListener('removetrack', updateHandler); tracks.addEventListener('addtrack', updateHandler); this.player_.on('dispose', function () { tracks.removeEventListener('removetrack', updateHandler); tracks.removeEventListener('addtrack', updateHandler); }); } // Create a menu item for each text track TextTrackButton.prototype.createItems = function createItems() { var items = arguments.length <= 0 || arguments[0] === undefined ? [] : arguments[0]; // Add an OFF menu item to turn all tracks off items.push(new _offTextTrackMenuItemJs2['default'](this.player_, { 'kind': this.kind_ })); var tracks = this.player_.textTracks(); if (!tracks) { return items; } for (var i = 0; i < tracks.length; i++) { var track = tracks[i]; // only add tracks that are of the appropriate kind and have a label if (track['kind'] === this.kind_) { items.push(new _textTrackMenuItemJs2['default'](this.player_, { 'track': track })); } } return items; }; return TextTrackButton; })(_menuMenuButtonJs2['default']); _componentJs2['default'].registerComponent('TextTrackButton', TextTrackButton); exports['default'] = TextTrackButton; module.exports = exports['default']; },{"../../component.js":48,"../../menu/menu-button.js":84,"../../utils/fn.js":109,"./off-text-track-menu-item.js":66,"./text-track-menu-item.js":69}],69:[function(_dereq_,module,exports){ /** * @file text-track-menu-item.js */ 'use strict'; exports.__esModule = true; function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj['default'] = obj; return newObj; } } function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError('Cannot call a class as a function'); } } function _inherits(subClass, superClass) { if (typeof superClass !== 'function' && superClass !== null) { throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } var _menuMenuItemJs = _dereq_('../../menu/menu-item.js'); var _menuMenuItemJs2 = _interopRequireDefault(_menuMenuItemJs); var _componentJs = _dereq_('../../component.js'); var _componentJs2 = _interopRequireDefault(_componentJs); var _utilsFnJs = _dereq_('../../utils/fn.js'); var Fn = _interopRequireWildcard(_utilsFnJs); var _globalWindow = _dereq_('global/window'); var _globalWindow2 = _interopRequireDefault(_globalWindow); var _globalDocument = _dereq_('global/document'); var _globalDocument2 = _interopRequireDefault(_globalDocument); /** * The specific menu item type for selecting a language within a text track kind * * @param {Player|Object} player * @param {Object=} options * @extends MenuItem * @class TextTrackMenuItem */ var TextTrackMenuItem = (function (_MenuItem) { _inherits(TextTrackMenuItem, _MenuItem); function TextTrackMenuItem(player, options) { var _this = this; _classCallCheck(this, TextTrackMenuItem); var track = options['track']; var tracks = player.textTracks(); // Modify options for parent MenuItem class's init. options['label'] = track['label'] || track['language'] || 'Unknown'; options['selected'] = track['default'] || track['mode'] === 'showing'; _MenuItem.call(this, player, options); this.track = track; if (tracks) { (function () { var changeHandler = Fn.bind(_this, _this.handleTracksChange); tracks.addEventListener('change', changeHandler); _this.on('dispose', function () { tracks.removeEventListener('change', changeHandler); }); })(); } // iOS7 doesn't dispatch change events to TextTrackLists when an // associated track's mode changes. Without something like // Object.observe() (also not present on iOS7), it's not // possible to detect changes to the mode attribute and polyfill // the change event. As a poor substitute, we manually dispatch // change events whenever the controls modify the mode. if (tracks && tracks.onchange === undefined) { (function () { var event = undefined; _this.on(['tap', 'click'], function () { if (typeof _globalWindow2['default'].Event !== 'object') { // Android 2.3 throws an Illegal Constructor error for window.Event try { event = new _globalWindow2['default'].Event('change'); } catch (err) {} } if (!event) { event = _globalDocument2['default'].createEvent('Event'); event.initEvent('change', true, true); } tracks.dispatchEvent(event); }); })(); } } /** * Handle click on text track * * @method handleClick */ TextTrackMenuItem.prototype.handleClick = function handleClick(event) { var kind = this.track['kind']; var tracks = this.player_.textTracks(); _MenuItem.prototype.handleClick.call(this, event); if (!tracks) return; for (var i = 0; i < tracks.length; i++) { var track = tracks[i]; if (track['kind'] !== kind) { continue; } if (track === this.track) { track['mode'] = 'showing'; } else { track['mode'] = 'disabled'; } } }; /** * Handle text track change * * @method handleTracksChange */ TextTrackMenuItem.prototype.handleTracksChange = function handleTracksChange(event) { this.selected(this.track['mode'] === 'showing'); }; return TextTrackMenuItem; })(_menuMenuItemJs2['default']); _componentJs2['default'].registerComponent('TextTrackMenuItem', TextTrackMenuItem); exports['default'] = TextTrackMenuItem; module.exports = exports['default']; },{"../../component.js":48,"../../menu/menu-item.js":85,"../../utils/fn.js":109,"global/document":1,"global/window":2}],70:[function(_dereq_,module,exports){ /** * @file current-time-display.js */ 'use strict'; exports.__esModule = true; function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj['default'] = obj; return newObj; } } function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError('Cannot call a class as a function'); } } function _inherits(subClass, superClass) { if (typeof superClass !== 'function' && superClass !== null) { throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } var _componentJs = _dereq_('../../component.js'); var _componentJs2 = _interopRequireDefault(_componentJs); var _utilsDomJs = _dereq_('../../utils/dom.js'); var Dom = _interopRequireWildcard(_utilsDomJs); var _utilsFormatTimeJs = _dereq_('../../utils/format-time.js'); var _utilsFormatTimeJs2 = _interopRequireDefault(_utilsFormatTimeJs); /** * Displays the current time * * @param {Player|Object} player * @param {Object=} options * @extends Component * @class CurrentTimeDisplay */ var CurrentTimeDisplay = (function (_Component) { _inherits(CurrentTimeDisplay, _Component); function CurrentTimeDisplay(player, options) { _classCallCheck(this, CurrentTimeDisplay); _Component.call(this, player, options); this.on(player, 'timeupdate', this.updateContent); } /** * Create the component's DOM element * * @return {Element} * @method createEl */ CurrentTimeDisplay.prototype.createEl = function createEl() { var el = _Component.prototype.createEl.call(this, 'div', { className: 'vjs-current-time vjs-time-control vjs-control' }); this.contentEl_ = Dom.createEl('div', { className: 'vjs-current-time-display', innerHTML: '<span class="vjs-control-text">Current Time </span>' + '0:00', // label the current time for screen reader users 'aria-live': 'off' // tell screen readers not to automatically read the time as it changes }); el.appendChild(this.contentEl_); return el; }; /** * Update current time display * * @method updateContent */ CurrentTimeDisplay.prototype.updateContent = function updateContent() { // Allows for smooth scrubbing, when player can't keep up. var time = this.player_.scrubbing() ? this.player_.getCache().currentTime : this.player_.currentTime(); var localizedText = this.localize('Current Time'); var formattedTime = _utilsFormatTimeJs2['default'](time, this.player_.duration()); this.contentEl_.innerHTML = '<span class="vjs-control-text">' + localizedText + '</span> ' + formattedTime; }; return CurrentTimeDisplay; })(_componentJs2['default']); _componentJs2['default'].registerComponent('CurrentTimeDisplay', CurrentTimeDisplay); exports['default'] = CurrentTimeDisplay; module.exports = exports['default']; },{"../../component.js":48,"../../utils/dom.js":107,"../../utils/format-time.js":110}],71:[function(_dereq_,module,exports){ /** * @file duration-display.js */ 'use strict'; exports.__esModule = true; function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj['default'] = obj; return newObj; } } function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError('Cannot call a class as a function'); } } function _inherits(subClass, superClass) { if (typeof superClass !== 'function' && superClass !== null) { throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } var _componentJs = _dereq_('../../component.js'); var _componentJs2 = _interopRequireDefault(_componentJs); var _utilsDomJs = _dereq_('../../utils/dom.js'); var Dom = _interopRequireWildcard(_utilsDomJs); var _utilsFormatTimeJs = _dereq_('../../utils/format-time.js'); var _utilsFormatTimeJs2 = _interopRequireDefault(_utilsFormatTimeJs); /** * Displays the duration * * @param {Player|Object} player * @param {Object=} options * @extends Component * @class DurationDisplay */ var DurationDisplay = (function (_Component) { _inherits(DurationDisplay, _Component); function DurationDisplay(player, options) { _classCallCheck(this, DurationDisplay); _Component.call(this, player, options); // this might need to be changed to 'durationchange' instead of 'timeupdate' eventually, // however the durationchange event fires before this.player_.duration() is set, // so the value cannot be written out using this method. // Once the order of durationchange and this.player_.duration() being set is figured out, // this can be updated. this.on(player, 'timeupdate', this.updateContent); this.on(player, 'loadedmetadata', this.updateContent); } /** * Create the component's DOM element * * @return {Element} * @method createEl */ DurationDisplay.prototype.createEl = function createEl() { var el = _Component.prototype.createEl.call(this, 'div', { className: 'vjs-duration vjs-time-control vjs-control' }); this.contentEl_ = Dom.createEl('div', { className: 'vjs-duration-display', innerHTML: '<span class="vjs-control-text">' + this.localize('Duration Time') + '</span> 0:00', // label the duration time for screen reader users 'aria-live': 'off' // tell screen readers not to automatically read the time as it changes }); el.appendChild(this.contentEl_); return el; }; /** * Update duration time display * * @method updateContent */ DurationDisplay.prototype.updateContent = function updateContent() { var duration = this.player_.duration(); if (duration) { var localizedText = this.localize('Duration Time'); var formattedTime = _utilsFormatTimeJs2['default'](duration); this.contentEl_.innerHTML = '<span class="vjs-control-text">' + localizedText + '</span> ' + formattedTime; // label the duration time for screen reader users } }; return DurationDisplay; })(_componentJs2['default']); _componentJs2['default'].registerComponent('DurationDisplay', DurationDisplay); exports['default'] = DurationDisplay; module.exports = exports['default']; },{"../../component.js":48,"../../utils/dom.js":107,"../../utils/format-time.js":110}],72:[function(_dereq_,module,exports){ /** * @file remaining-time-display.js */ 'use strict'; exports.__esModule = true; function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj['default'] = obj; return newObj; } } function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError('Cannot call a class as a function'); } } function _inherits(subClass, superClass) { if (typeof superClass !== 'function' && superClass !== null) { throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } var _componentJs = _dereq_('../../component.js'); var _componentJs2 = _interopRequireDefault(_componentJs); var _utilsDomJs = _dereq_('../../utils/dom.js'); var Dom = _interopRequireWildcard(_utilsDomJs); var _utilsFormatTimeJs = _dereq_('../../utils/format-time.js'); var _utilsFormatTimeJs2 = _interopRequireDefault(_utilsFormatTimeJs); /** * Displays the time left in the video * * @param {Player|Object} player * @param {Object=} options * @extends Component * @class RemainingTimeDisplay */ var RemainingTimeDisplay = (function (_Component) { _inherits(RemainingTimeDisplay, _Component); function RemainingTimeDisplay(player, options) { _classCallCheck(this, RemainingTimeDisplay); _Component.call(this, player, options); this.on(player, 'timeupdate', this.updateContent); } /** * Create the component's DOM element * * @return {Element} * @method createEl */ RemainingTimeDisplay.prototype.createEl = function createEl() { var el = _Component.prototype.createEl.call(this, 'div', { className: 'vjs-remaining-time vjs-time-control vjs-control' }); this.contentEl_ = Dom.createEl('div', { className: 'vjs-remaining-time-display', innerHTML: '<span class="vjs-control-text">' + this.localize('Remaining Time') + '</span> -0:00', // label the remaining time for screen reader users 'aria-live': 'off' // tell screen readers not to automatically read the time as it changes }); el.appendChild(this.contentEl_); return el; }; /** * Update remaining time display * * @method updateContent */ RemainingTimeDisplay.prototype.updateContent = function updateContent() { if (this.player_.duration()) { var localizedText = this.localize('Remaining Time'); var formattedTime = _utilsFormatTimeJs2['default'](this.player_.remainingTime()); this.contentEl_.innerHTML = '<span class="vjs-control-text">' + localizedText + '</span> -' + formattedTime; } // Allows for smooth scrubbing, when player can't keep up. // var time = (this.player_.scrubbing()) ? this.player_.getCache().currentTime : this.player_.currentTime(); // this.contentEl_.innerHTML = vjs.formatTime(time, this.player_.duration()); }; return RemainingTimeDisplay; })(_componentJs2['default']); _componentJs2['default'].registerComponent('RemainingTimeDisplay', RemainingTimeDisplay); exports['default'] = RemainingTimeDisplay; module.exports = exports['default']; },{"../../component.js":48,"../../utils/dom.js":107,"../../utils/format-time.js":110}],73:[function(_dereq_,module,exports){ /** * @file time-divider.js */ 'use strict'; exports.__esModule = true; function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError('Cannot call a class as a function'); } } function _inherits(subClass, superClass) { if (typeof superClass !== 'function' && superClass !== null) { throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } var _componentJs = _dereq_('../../component.js'); var _componentJs2 = _interopRequireDefault(_componentJs); /** * The separator between the current time and duration. * Can be hidden if it's not needed in the design. * * @param {Player|Object} player * @param {Object=} options * @extends Component * @class TimeDivider */ var TimeDivider = (function (_Component) { _inherits(TimeDivider, _Component); function TimeDivider() { _classCallCheck(this, TimeDivider); _Component.apply(this, arguments); } /** * Create the component's DOM element * * @return {Element} * @method createEl */ TimeDivider.prototype.createEl = function createEl() { return _Component.prototype.createEl.call(this, 'div', { className: 'vjs-time-control vjs-time-divider', innerHTML: '<div><span>/</span></div>' }); }; return TimeDivider; })(_componentJs2['default']); _componentJs2['default'].registerComponent('TimeDivider', TimeDivider); exports['default'] = TimeDivider; module.exports = exports['default']; },{"../../component.js":48}],74:[function(_dereq_,module,exports){ /** * @file volume-bar.js */ 'use strict'; exports.__esModule = true; function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj['default'] = obj; return newObj; } } function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError('Cannot call a class as a function'); } } function _inherits(subClass, superClass) { if (typeof superClass !== 'function' && superClass !== null) { throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } var _sliderSliderJs = _dereq_('../../slider/slider.js'); var _sliderSliderJs2 = _interopRequireDefault(_sliderSliderJs); var _componentJs = _dereq_('../../component.js'); var _componentJs2 = _interopRequireDefault(_componentJs); var _utilsFnJs = _dereq_('../../utils/fn.js'); var Fn = _interopRequireWildcard(_utilsFnJs); // Required children var _volumeLevelJs = _dereq_('./volume-level.js'); var _volumeLevelJs2 = _interopRequireDefault(_volumeLevelJs); /** * The bar that contains the volume level and can be clicked on to adjust the level * * @param {Player|Object} player * @param {Object=} options * @extends Slider * @class VolumeBar */ var VolumeBar = (function (_Slider) { _inherits(VolumeBar, _Slider); function VolumeBar(player, options) { _classCallCheck(this, VolumeBar); _Slider.call(this, player, options); this.on(player, 'volumechange', this.updateARIAAttributes); player.ready(Fn.bind(this, this.updateARIAAttributes)); } /** * Create the component's DOM element * * @return {Element} * @method createEl */ VolumeBar.prototype.createEl = function createEl() { return _Slider.prototype.createEl.call(this, 'div', { className: 'vjs-volume-bar', 'aria-label': 'volume level' }); }; /** * Handle mouse move on volume bar * * @method handleMouseMove */ VolumeBar.prototype.handleMouseMove = function handleMouseMove(event) { if (this.player_.muted()) { this.player_.muted(false); } this.player_.volume(this.calculateDistance(event)); }; /** * Get percent of volume level * * @retun {Number} Volume level percent * @method getPercent */ VolumeBar.prototype.getPercent = function getPercent() { if (this.player_.muted()) { return 0; } else { return this.player_.volume(); } }; /** * Increase volume level for keyboard users * * @method stepForward */ VolumeBar.prototype.stepForward = function stepForward() { this.player_.volume(this.player_.volume() + 0.1); }; /** * Decrease volume level for keyboard users * * @method stepBack */ VolumeBar.prototype.stepBack = function stepBack() { this.player_.volume(this.player_.volume() - 0.1); }; /** * Update ARIA accessibility attributes * * @method updateARIAAttributes */ VolumeBar.prototype.updateARIAAttributes = function updateARIAAttributes() { // Current value of volume bar as a percentage var volume = (this.player_.volume() * 100).toFixed(2); this.el_.setAttribute('aria-valuenow', volume); this.el_.setAttribute('aria-valuetext', volume + '%'); }; return VolumeBar; })(_sliderSliderJs2['default']); VolumeBar.prototype.options_ = { children: { 'volumeLevel': {} }, 'barName': 'volumeLevel' }; VolumeBar.prototype.playerEvent = 'volumechange'; _componentJs2['default'].registerComponent('VolumeBar', VolumeBar); exports['default'] = VolumeBar; module.exports = exports['default']; },{"../../component.js":48,"../../slider/slider.js":91,"../../utils/fn.js":109,"./volume-level.js":76}],75:[function(_dereq_,module,exports){ /** * @file volume-control.js */ 'use strict'; exports.__esModule = true; function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError('Cannot call a class as a function'); } } function _inherits(subClass, superClass) { if (typeof superClass !== 'function' && superClass !== null) { throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } var _componentJs = _dereq_('../../component.js'); var _componentJs2 = _interopRequireDefault(_componentJs); // Required children var _volumeBarJs = _dereq_('./volume-bar.js'); var _volumeBarJs2 = _interopRequireDefault(_volumeBarJs); /** * The component for controlling the volume level * * @param {Player|Object} player * @param {Object=} options * @extends Component * @class VolumeControl */ var VolumeControl = (function (_Component) { _inherits(VolumeControl, _Component); function VolumeControl(player, options) { _classCallCheck(this, VolumeControl); _Component.call(this, player, options); // hide volume controls when they're not supported by the current tech if (player.tech && player.tech['featuresVolumeControl'] === false) { this.addClass('vjs-hidden'); } this.on(player, 'loadstart', function () { if (player.tech['featuresVolumeControl'] === false) { this.addClass('vjs-hidden'); } else { this.removeClass('vjs-hidden'); } }); } /** * Create the component's DOM element * * @return {Element} * @method createEl */ VolumeControl.prototype.createEl = function createEl() { return _Component.prototype.createEl.call(this, 'div', { className: 'vjs-volume-control vjs-control' }); }; return VolumeControl; })(_componentJs2['default']); VolumeControl.prototype.options_ = { children: { 'volumeBar': {} } }; _componentJs2['default'].registerComponent('VolumeControl', VolumeControl); exports['default'] = VolumeControl; module.exports = exports['default']; },{"../../component.js":48,"./volume-bar.js":74}],76:[function(_dereq_,module,exports){ /** * @file volume-level.js */ 'use strict'; exports.__esModule = true; function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError('Cannot call a class as a function'); } } function _inherits(subClass, superClass) { if (typeof superClass !== 'function' && superClass !== null) { throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } var _componentJs = _dereq_('../../component.js'); var _componentJs2 = _interopRequireDefault(_componentJs); /** * Shows volume level * * @param {Player|Object} player * @param {Object=} options * @extends Component * @class VolumeLevel */ var VolumeLevel = (function (_Component) { _inherits(VolumeLevel, _Component); function VolumeLevel() { _classCallCheck(this, VolumeLevel); _Component.apply(this, arguments); } /** * Create the component's DOM element * * @return {Element} * @method createEl */ VolumeLevel.prototype.createEl = function createEl() { return _Component.prototype.createEl.call(this, 'div', { className: 'vjs-volume-level', innerHTML: '<span class="vjs-control-text"></span>' }); }; return VolumeLevel; })(_componentJs2['default']); _componentJs2['default'].registerComponent('VolumeLevel', VolumeLevel); exports['default'] = VolumeLevel; module.exports = exports['default']; },{"../../component.js":48}],77:[function(_dereq_,module,exports){ /** * @file volume-menu-button.js */ 'use strict'; exports.__esModule = true; function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError('Cannot call a class as a function'); } } function _inherits(subClass, superClass) { if (typeof superClass !== 'function' && superClass !== null) { throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } var _buttonJs = _dereq_('../button.js'); var _buttonJs2 = _interopRequireDefault(_buttonJs); var _componentJs = _dereq_('../component.js'); var _componentJs2 = _interopRequireDefault(_componentJs); var _menuMenuJs = _dereq_('../menu/menu.js'); var _menuMenuJs2 = _interopRequireDefault(_menuMenuJs); var _menuMenuButtonJs = _dereq_('../menu/menu-button.js'); var _menuMenuButtonJs2 = _interopRequireDefault(_menuMenuButtonJs); var _muteToggleJs = _dereq_('./mute-toggle.js'); var _muteToggleJs2 = _interopRequireDefault(_muteToggleJs); var _volumeControlVolumeBarJs = _dereq_('./volume-control/volume-bar.js'); var _volumeControlVolumeBarJs2 = _interopRequireDefault(_volumeControlVolumeBarJs); /** * Button for volume menu * * @param {Player|Object} player * @param {Object=} options * @extends MenuButton * @class VolumeMenuButton */ var VolumeMenuButton = (function (_MenuButton) { _inherits(VolumeMenuButton, _MenuButton); function VolumeMenuButton(player) { var options = arguments.length <= 1 || arguments[1] === undefined ? {} : arguments[1]; _classCallCheck(this, VolumeMenuButton); // Default to inline if (options.inline === undefined) { options.inline = true; } // If the vertical option isn't passed at all, default to true. if (options.vertical === undefined) { // If an inline volumeMenuButton is used, we should default to using // a horizontal slider for obvious reasons. if (options.inline) { options.vertical = false; } else { options.vertical = true; } } // The vertical option needs to be set on the volumeBar as well, // since that will need to be passed along to the VolumeBar constructor options.volumeBar = options.volumeBar || {}; options.volumeBar.vertical = !!options.vertical; _MenuButton.call(this, player, options); // Same listeners as MuteToggle this.on(player, 'volumechange', this.volumeUpdate); this.on(player, 'loadstart', this.volumeUpdate); // hide mute toggle if the current tech doesn't support volume control function updateVisibility() { if (player.tech && player.tech['featuresVolumeControl'] === false) { this.addClass('vjs-hidden'); } else { this.removeClass('vjs-hidden'); } } updateVisibility.call(this); this.on(player, 'loadstart', updateVisibility); this.on(this.volumeBar, ['slideractive', 'focus'], function () { this.addClass('vjs-slider-active'); }); this.on(this.volumeBar, ['sliderinactive', 'blur'], function () { this.removeClass('vjs-slider-active'); }); } /** * Allow sub components to stack CSS class names * * @return {String} The constructed class name * @method buildCSSClass */ VolumeMenuButton.prototype.buildCSSClass = function buildCSSClass() { var orientationClass = ''; if (!!this.options_.vertical) { orientationClass = 'vjs-volume-menu-button-vertical'; } else { orientationClass = 'vjs-volume-menu-button-horizontal'; } return 'vjs-volume-menu-button ' + _MenuButton.prototype.buildCSSClass.call(this) + ' ' + orientationClass; }; /** * Allow sub components to stack CSS class names * * @return {Menu} The volume menu button * @method createMenu */ VolumeMenuButton.prototype.createMenu = function createMenu() { var menu = new _menuMenuJs2['default'](this.player_, { contentElType: 'div' }); var vb = new _volumeControlVolumeBarJs2['default'](this.player_, this.options_.volumeBar); menu.addChild(vb); this.volumeBar = vb; return menu; }; /** * Handle click on volume menu and calls super * * @method handleClick */ VolumeMenuButton.prototype.handleClick = function handleClick() { _muteToggleJs2['default'].prototype.handleClick.call(this); _MenuButton.prototype.handleClick.call(this); }; return VolumeMenuButton; })(_menuMenuButtonJs2['default']); VolumeMenuButton.prototype.volumeUpdate = _muteToggleJs2['default'].prototype.update; VolumeMenuButton.prototype.controlText_ = 'Mute'; _componentJs2['default'].registerComponent('VolumeMenuButton', VolumeMenuButton); exports['default'] = VolumeMenuButton; module.exports = exports['default']; },{"../button.js":47,"../component.js":48,"../menu/menu-button.js":84,"../menu/menu.js":86,"./mute-toggle.js":52,"./volume-control/volume-bar.js":74}],78:[function(_dereq_,module,exports){ /** * @file error-display.js */ 'use strict'; exports.__esModule = true; function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj['default'] = obj; return newObj; } } function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError('Cannot call a class as a function'); } } function _inherits(subClass, superClass) { if (typeof superClass !== 'function' && superClass !== null) { throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } var _component = _dereq_('./component'); var _component2 = _interopRequireDefault(_component); var _utilsDomJs = _dereq_('./utils/dom.js'); var Dom = _interopRequireWildcard(_utilsDomJs); /** * Display that an error has occurred making the video unplayable * * @param {Object} player Main Player * @param {Object=} options Object of option names and values * @extends Component * @class ErrorDisplay */ var ErrorDisplay = (function (_Component) { _inherits(ErrorDisplay, _Component); function ErrorDisplay(player, options) { _classCallCheck(this, ErrorDisplay); _Component.call(this, player, options); this.update(); this.on(player, 'error', this.update); } /** * Create the component's DOM element * * @return {Element} * @method createEl */ ErrorDisplay.prototype.createEl = function createEl() { var el = _Component.prototype.createEl.call(this, 'div', { className: 'vjs-error-display' }); this.contentEl_ = Dom.createEl('div'); el.appendChild(this.contentEl_); return el; }; /** * Update the error message in localized language * * @method update */ ErrorDisplay.prototype.update = function update() { if (this.player().error()) { this.contentEl_.innerHTML = this.localize(this.player().error().message); } }; return ErrorDisplay; })(_component2['default']); _component2['default'].registerComponent('ErrorDisplay', ErrorDisplay); exports['default'] = ErrorDisplay; module.exports = exports['default']; },{"./component":48,"./utils/dom.js":107}],79:[function(_dereq_,module,exports){ /** * @file event-target.js */ 'use strict'; exports.__esModule = true; function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj['default'] = obj; return newObj; } } var _utilsEventsJs = _dereq_('./utils/events.js'); var Events = _interopRequireWildcard(_utilsEventsJs); var EventTarget = function EventTarget() {}; EventTarget.prototype.allowedEvents_ = {}; EventTarget.prototype.on = function (type, fn) { // Remove the addEventListener alias before calling Events.on // so we don't get into an infinite type loop var ael = this.addEventListener; this.addEventListener = Function.prototype; Events.on(this, type, fn); this.addEventListener = ael; }; EventTarget.prototype.addEventListener = EventTarget.prototype.on; EventTarget.prototype.off = function (type, fn) { Events.off(this, type, fn); }; EventTarget.prototype.removeEventListener = EventTarget.prototype.off; EventTarget.prototype.one = function (type, fn) { Events.one(this, type, fn); }; EventTarget.prototype.trigger = function (event) { var type = event.type || event; if (typeof event === 'string') { event = { type: type }; } event = Events.fixEvent(event); if (this.allowedEvents_[type] && this['on' + type]) { this['on' + type](event); } Events.trigger(this, event); }; // The standard DOM EventTarget.dispatchEvent() is aliased to trigger() EventTarget.prototype.dispatchEvent = EventTarget.prototype.trigger; exports['default'] = EventTarget; module.exports = exports['default']; },{"./utils/events.js":108}],80:[function(_dereq_,module,exports){ 'use strict'; exports.__esModule = true; function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } var _utilsLog = _dereq_('./utils/log'); var _utilsLog2 = _interopRequireDefault(_utilsLog); /* * @file extends.js * * A combination of node inherits and babel's inherits (after transpile). * Both work the same but node adds `super_` to the subClass * and Bable adds the superClass as __proto__. Both seem useful. */ var _inherits = function _inherits(subClass, superClass) { if (typeof superClass !== 'function' && superClass !== null) { throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) { // node subClass.super_ = superClass; } }; /* * Function for subclassing using the same inheritance that * videojs uses internally * ```js * var Button = videojs.getComponent('Button'); * ``` * ```js * var MyButton = videojs.extends(Button, { * constructor: function(player, options) { * Button.call(this, player, options); * }, * onClick: function() { * // doSomething * } * }); * ``` */ var extendsFn = function extendsFn(superClass) { var subClassMethods = arguments.length <= 1 || arguments[1] === undefined ? {} : arguments[1]; var subClass = function subClass() { superClass.apply(this, arguments); }; var methods = {}; if (typeof subClassMethods === 'object') { if (typeof subClassMethods.init === 'function') { _utilsLog2['default'].warn('Constructor logic via init() is deprecated; please use constructor() instead.'); subClassMethods.constructor = subClassMethods.init; } if (subClassMethods.constructor !== Object.prototype.constructor) { subClass = subClassMethods.constructor; } methods = subClassMethods; } else if (typeof subClassMethods === 'function') { subClass = subClassMethods; } _inherits(subClass, superClass); // Extend subObj's prototype with functions and other properties from props for (var name in methods) { if (methods.hasOwnProperty(name)) { subClass.prototype[name] = methods[name]; } } return subClass; }; exports['default'] = extendsFn; module.exports = exports['default']; },{"./utils/log":112}],81:[function(_dereq_,module,exports){ /** * @file fullscreen-api.js */ 'use strict'; exports.__esModule = true; function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } var _globalDocument = _dereq_('global/document'); var _globalDocument2 = _interopRequireDefault(_globalDocument); /* * Store the browser-specific methods for the fullscreen API * @type {Object|undefined} * @private */ var FullscreenApi = {}; // browser API methods // map approach from Screenful.js - https://github.com/sindresorhus/screenfull.js var apiMap = [ // Spec: https://dvcs.w3.org/hg/fullscreen/raw-file/tip/Overview.html ['requestFullscreen', 'exitFullscreen', 'fullscreenElement', 'fullscreenEnabled', 'fullscreenchange', 'fullscreenerror'], // WebKit ['webkitRequestFullscreen', 'webkitExitFullscreen', 'webkitFullscreenElement', 'webkitFullscreenEnabled', 'webkitfullscreenchange', 'webkitfullscreenerror'], // Old WebKit (Safari 5.1) ['webkitRequestFullScreen', 'webkitCancelFullScreen', 'webkitCurrentFullScreenElement', 'webkitCancelFullScreen', 'webkitfullscreenchange', 'webkitfullscreenerror'], // Mozilla ['mozRequestFullScreen', 'mozCancelFullScreen', 'mozFullScreenElement', 'mozFullScreenEnabled', 'mozfullscreenchange', 'mozfullscreenerror'], // Microsoft ['msRequestFullscreen', 'msExitFullscreen', 'msFullscreenElement', 'msFullscreenEnabled', 'MSFullscreenChange', 'MSFullscreenError']]; var specApi = apiMap[0]; var browserApi = undefined; // determine the supported set of functions for (var i = 0; i < apiMap.length; i++) { // check for exitFullscreen function if (apiMap[i][1] in _globalDocument2['default']) { browserApi = apiMap[i]; break; } } // map the browser API names to the spec API names if (browserApi) { for (var i = 0; i < browserApi.length; i++) { FullscreenApi[specApi[i]] = browserApi[i]; } } exports['default'] = FullscreenApi; module.exports = exports['default']; },{"global/document":1}],82:[function(_dereq_,module,exports){ /** * @file loading-spinner.js */ 'use strict'; exports.__esModule = true; function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError('Cannot call a class as a function'); } } function _inherits(subClass, superClass) { if (typeof superClass !== 'function' && superClass !== null) { throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } var _component = _dereq_('./component'); var _component2 = _interopRequireDefault(_component); /* Loading Spinner ================================================================================ */ /** * Loading spinner for waiting events * * @extends Component * @class LoadingSpinner */ var LoadingSpinner = (function (_Component) { _inherits(LoadingSpinner, _Component); function LoadingSpinner() { _classCallCheck(this, LoadingSpinner); _Component.apply(this, arguments); } /** * Create the component's DOM element * * @method createEl */ LoadingSpinner.prototype.createEl = function createEl() { return _Component.prototype.createEl.call(this, 'div', { className: 'vjs-loading-spinner' }); }; return LoadingSpinner; })(_component2['default']); _component2['default'].registerComponent('LoadingSpinner', LoadingSpinner); exports['default'] = LoadingSpinner; module.exports = exports['default']; },{"./component":48}],83:[function(_dereq_,module,exports){ /** * @file media-error.js */ 'use strict'; exports.__esModule = true; function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } var _objectAssign = _dereq_('object.assign'); var _objectAssign2 = _interopRequireDefault(_objectAssign); /* * Custom MediaError to mimic the HTML5 MediaError * * @param {Number} code The media error code */ var MediaError = function MediaError(code) { if (typeof code === 'number') { this.code = code; } else if (typeof code === 'string') { // default code is zero, so this is a custom error this.message = code; } else if (typeof code === 'object') { // object _objectAssign2['default'](this, code); } if (!this.message) { this.message = MediaError.defaultMessages[this.code] || ''; } }; /* * The error code that refers two one of the defined * MediaError types * * @type {Number} */ MediaError.prototype.code = 0; /* * An optional message to be shown with the error. * Message is not part of the HTML5 video spec * but allows for more informative custom errors. * * @type {String} */ MediaError.prototype.message = ''; /* * An optional status code that can be set by plugins * to allow even more detail about the error. * For example the HLS plugin might provide the specific * HTTP status code that was returned when the error * occurred, then allowing a custom error overlay * to display more information. * * @type {Array} */ MediaError.prototype.status = null; MediaError.errorTypes = ['MEDIA_ERR_CUSTOM', // = 0 'MEDIA_ERR_ABORTED', // = 1 'MEDIA_ERR_NETWORK', // = 2 'MEDIA_ERR_DECODE', // = 3 'MEDIA_ERR_SRC_NOT_SUPPORTED', // = 4 'MEDIA_ERR_ENCRYPTED' // = 5 ]; MediaError.defaultMessages = { 1: 'You aborted the media playback', 2: 'A network error caused the media download to fail part-way.', 3: 'The media playback was aborted due to a corruption problem or because the media used features your browser did not support.', 4: 'The media could not be loaded, either because the server or network failed or because the format is not supported.', 5: 'The media is encrypted and we do not have the keys to decrypt it.' }; // Add types as properties on MediaError // e.g. MediaError.MEDIA_ERR_SRC_NOT_SUPPORTED = 4; for (var errNum = 0; errNum < MediaError.errorTypes.length; errNum++) { MediaError[MediaError.errorTypes[errNum]] = errNum; // values should be accessible on both the class and instance MediaError.prototype[MediaError.errorTypes[errNum]] = errNum; } exports['default'] = MediaError; module.exports = exports['default']; },{"object.assign":40}],84:[function(_dereq_,module,exports){ /** * @file menu-button.js */ 'use strict'; exports.__esModule = true; function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj['default'] = obj; return newObj; } } function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError('Cannot call a class as a function'); } } function _inherits(subClass, superClass) { if (typeof superClass !== 'function' && superClass !== null) { throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } var _buttonJs = _dereq_('../button.js'); var _buttonJs2 = _interopRequireDefault(_buttonJs); var _componentJs = _dereq_('../component.js'); var _componentJs2 = _interopRequireDefault(_componentJs); var _menuJs = _dereq_('./menu.js'); var _menuJs2 = _interopRequireDefault(_menuJs); var _utilsDomJs = _dereq_('../utils/dom.js'); var Dom = _interopRequireWildcard(_utilsDomJs); var _utilsFnJs = _dereq_('../utils/fn.js'); var Fn = _interopRequireWildcard(_utilsFnJs); var _utilsToTitleCaseJs = _dereq_('../utils/to-title-case.js'); var _utilsToTitleCaseJs2 = _interopRequireDefault(_utilsToTitleCaseJs); /** * A button class with a popup menu * * @param {Player|Object} player * @param {Object=} options * @extends Button * @class MenuButton */ var MenuButton = (function (_Button) { _inherits(MenuButton, _Button); function MenuButton(player) { var options = arguments.length <= 1 || arguments[1] === undefined ? {} : arguments[1]; _classCallCheck(this, MenuButton); _Button.call(this, player, options); this.update(); this.on('keydown', this.handleKeyPress); this.el_.setAttribute('aria-haspopup', true); this.el_.setAttribute('role', 'button'); } /** * Update menu * * @method update */ MenuButton.prototype.update = function update() { var menu = this.createMenu(); if (this.menu) { this.removeChild(this.menu); } this.menu = menu; this.addChild(menu); /** * Track the state of the menu button * * @type {Boolean} * @private */ this.buttonPressed_ = false; if (this.items && this.items.length === 0) { this.hide(); } else if (this.items && this.items.length > 1) { this.show(); } }; /** * Create menu * * @return {Menu} The constructed menu * @method createMenu */ MenuButton.prototype.createMenu = function createMenu() { var menu = new _menuJs2['default'](this.player_); // Add a title list item to the top if (this.options_.title) { menu.contentEl().appendChild(Dom.createEl('li', { className: 'vjs-menu-title', innerHTML: _utilsToTitleCaseJs2['default'](this.options_.title), tabIndex: -1 })); } this.items = this['createItems'](); if (this.items) { // Add menu items to the menu for (var i = 0; i < this.items.length; i++) { menu.addItem(this.items[i]); } } return menu; }; /** * Create the list of menu items. Specific to each subclass. * * @method createItems */ MenuButton.prototype.createItems = function createItems() {}; /** * Create the component's DOM element * * @return {Element} * @method createEl */ MenuButton.prototype.createEl = function createEl() { return _Button.prototype.createEl.call(this, 'div', { className: this.buildCSSClass() }); }; /** * Allow sub components to stack CSS class names * * @return {String} The constructed class name * @method buildCSSClass */ MenuButton.prototype.buildCSSClass = function buildCSSClass() { var menuButtonClass = 'vjs-menu-button'; // If the inline option is passed, we want to use different styles altogether. if (this.options_.inline === true) { menuButtonClass += '-inline'; } else { menuButtonClass += '-popup'; } return 'vjs-menu-button ' + menuButtonClass + ' ' + _Button.prototype.buildCSSClass.call(this); }; /** * Focus - Add keyboard functionality to element * This function is not needed anymore. Instead, the * keyboard functionality is handled by * treating the button as triggering a submenu. * When the button is pressed, the submenu * appears. Pressing the button again makes * the submenu disappear. * * @method handleFocus */ MenuButton.prototype.handleFocus = function handleFocus() {}; /** * Can't turn off list display that we turned * on with focus, because list would go away. * * @method handleBlur */ MenuButton.prototype.handleBlur = function handleBlur() {}; /** * When you click the button it adds focus, which * will show the menu indefinitely. * So we'll remove focus when the mouse leaves the button. * Focus is needed for tab navigation. * Allow sub components to stack CSS class names * * @method handleClick */ MenuButton.prototype.handleClick = function handleClick() { this.one('mouseout', Fn.bind(this, function () { this.menu.unlockShowing(); this.el_.blur(); })); if (this.buttonPressed_) { this.unpressButton(); } else { this.pressButton(); } }; /** * Handle key press on menu * * @param {Object} Key press event * @method handleKeyPress */ MenuButton.prototype.handleKeyPress = function handleKeyPress(event) { // Check for space bar (32) or enter (13) keys if (event.which === 32 || event.which === 13) { if (this.buttonPressed_) { this.unpressButton(); } else { this.pressButton(); } event.preventDefault(); // Check for escape (27) key } else if (event.which === 27) { if (this.buttonPressed_) { this.unpressButton(); } event.preventDefault(); } }; /** * Makes changes based on button pressed * * @method pressButton */ MenuButton.prototype.pressButton = function pressButton() { this.buttonPressed_ = true; this.menu.lockShowing(); this.el_.setAttribute('aria-pressed', true); if (this.items && this.items.length > 0) { this.items[0].el().focus(); // set the focus to the title of the submenu } }; /** * Makes changes based on button unpressed * * @method unpressButton */ MenuButton.prototype.unpressButton = function unpressButton() { this.buttonPressed_ = false; this.menu.unlockShowing(); this.el_.setAttribute('aria-pressed', false); }; return MenuButton; })(_buttonJs2['default']); _componentJs2['default'].registerComponent('MenuButton', MenuButton); exports['default'] = MenuButton; module.exports = exports['default']; },{"../button.js":47,"../component.js":48,"../utils/dom.js":107,"../utils/fn.js":109,"../utils/to-title-case.js":116,"./menu.js":86}],85:[function(_dereq_,module,exports){ /** * @file menu-item.js */ 'use strict'; exports.__esModule = true; function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError('Cannot call a class as a function'); } } function _inherits(subClass, superClass) { if (typeof superClass !== 'function' && superClass !== null) { throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } var _buttonJs = _dereq_('../button.js'); var _buttonJs2 = _interopRequireDefault(_buttonJs); var _componentJs = _dereq_('../component.js'); var _componentJs2 = _interopRequireDefault(_componentJs); var _objectAssign = _dereq_('object.assign'); var _objectAssign2 = _interopRequireDefault(_objectAssign); /** * The component for a menu item. `<li>` * * @param {Player|Object} player * @param {Object=} options * @extends Button * @class MenuItem */ var MenuItem = (function (_Button) { _inherits(MenuItem, _Button); function MenuItem(player, options) { _classCallCheck(this, MenuItem); _Button.call(this, player, options); this.selected(options['selected']); } /** * Create the component's DOM element * * @param {String=} type Desc * @param {Object=} props Desc * @return {Element} * @method createEl */ MenuItem.prototype.createEl = function createEl(type, props) { return _Button.prototype.createEl.call(this, 'li', _objectAssign2['default']({ className: 'vjs-menu-item', innerHTML: this.localize(this.options_['label']) }, props)); }; /** * Handle a click on the menu item, and set it to selected * * @method handleClick */ MenuItem.prototype.handleClick = function handleClick() { this.selected(true); }; /** * Set this menu item as selected or not * * @param {Boolean} selected * @method selected */ MenuItem.prototype.selected = function selected(_selected) { if (_selected) { this.addClass('vjs-selected'); this.el_.setAttribute('aria-selected', true); } else { this.removeClass('vjs-selected'); this.el_.setAttribute('aria-selected', false); } }; return MenuItem; })(_buttonJs2['default']); _componentJs2['default'].registerComponent('MenuItem', MenuItem); exports['default'] = MenuItem; module.exports = exports['default']; },{"../button.js":47,"../component.js":48,"object.assign":40}],86:[function(_dereq_,module,exports){ /** * @file menu.js */ 'use strict'; exports.__esModule = true; function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj['default'] = obj; return newObj; } } function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError('Cannot call a class as a function'); } } function _inherits(subClass, superClass) { if (typeof superClass !== 'function' && superClass !== null) { throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } var _componentJs = _dereq_('../component.js'); var _componentJs2 = _interopRequireDefault(_componentJs); var _utilsDomJs = _dereq_('../utils/dom.js'); var Dom = _interopRequireWildcard(_utilsDomJs); var _utilsFnJs = _dereq_('../utils/fn.js'); var Fn = _interopRequireWildcard(_utilsFnJs); var _utilsEventsJs = _dereq_('../utils/events.js'); var Events = _interopRequireWildcard(_utilsEventsJs); /** * The Menu component is used to build pop up menus, including subtitle and * captions selection menus. * * @extends Component * @class Menu */ var Menu = (function (_Component) { _inherits(Menu, _Component); function Menu() { _classCallCheck(this, Menu); _Component.apply(this, arguments); } /** * Add a menu item to the menu * * @param {Object|String} component Component or component type to add * @method addItem */ Menu.prototype.addItem = function addItem(component) { this.addChild(component); component.on('click', Fn.bind(this, function () { this.unlockShowing(); })); }; /** * Create the component's DOM element * * @return {Element} * @method createEl */ Menu.prototype.createEl = function createEl() { var contentElType = this.options_.contentElType || 'ul'; this.contentEl_ = Dom.createEl(contentElType, { className: 'vjs-menu-content' }); var el = _Component.prototype.createEl.call(this, 'div', { append: this.contentEl_, className: 'vjs-menu' }); el.appendChild(this.contentEl_); // Prevent clicks from bubbling up. Needed for Menu Buttons, // where a click on the parent is significant Events.on(el, 'click', function (event) { event.preventDefault(); event.stopImmediatePropagation(); }); return el; }; return Menu; })(_componentJs2['default']); _componentJs2['default'].registerComponent('Menu', Menu); exports['default'] = Menu; module.exports = exports['default']; },{"../component.js":48,"../utils/dom.js":107,"../utils/events.js":108,"../utils/fn.js":109}],87:[function(_dereq_,module,exports){ /** * @file player.js */ // Subclasses Component 'use strict'; exports.__esModule = true; function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj['default'] = obj; return newObj; } } function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError('Cannot call a class as a function'); } } function _inherits(subClass, superClass) { if (typeof superClass !== 'function' && superClass !== null) { throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } var _componentJs = _dereq_('./component.js'); var _componentJs2 = _interopRequireDefault(_componentJs); var _globalDocument = _dereq_('global/document'); var _globalDocument2 = _interopRequireDefault(_globalDocument); var _globalWindow = _dereq_('global/window'); var _globalWindow2 = _interopRequireDefault(_globalWindow); var _utilsEventsJs = _dereq_('./utils/events.js'); var Events = _interopRequireWildcard(_utilsEventsJs); var _utilsDomJs = _dereq_('./utils/dom.js'); var Dom = _interopRequireWildcard(_utilsDomJs); var _utilsFnJs = _dereq_('./utils/fn.js'); var Fn = _interopRequireWildcard(_utilsFnJs); var _utilsGuidJs = _dereq_('./utils/guid.js'); var Guid = _interopRequireWildcard(_utilsGuidJs); var _utilsBrowserJs = _dereq_('./utils/browser.js'); var browser = _interopRequireWildcard(_utilsBrowserJs); var _utilsLogJs = _dereq_('./utils/log.js'); var _utilsLogJs2 = _interopRequireDefault(_utilsLogJs); var _utilsToTitleCaseJs = _dereq_('./utils/to-title-case.js'); var _utilsToTitleCaseJs2 = _interopRequireDefault(_utilsToTitleCaseJs); var _utilsTimeRangesJs = _dereq_('./utils/time-ranges.js'); var _utilsBufferJs = _dereq_('./utils/buffer.js'); var _utilsStylesheetJs = _dereq_('./utils/stylesheet.js'); var stylesheet = _interopRequireWildcard(_utilsStylesheetJs); var _fullscreenApiJs = _dereq_('./fullscreen-api.js'); var _fullscreenApiJs2 = _interopRequireDefault(_fullscreenApiJs); var _mediaErrorJs = _dereq_('./media-error.js'); var _mediaErrorJs2 = _interopRequireDefault(_mediaErrorJs); var _safeJsonParseTuple = _dereq_('safe-json-parse/tuple'); var _safeJsonParseTuple2 = _interopRequireDefault(_safeJsonParseTuple); var _objectAssign = _dereq_('object.assign'); var _objectAssign2 = _interopRequireDefault(_objectAssign); var _utilsMergeOptionsJs = _dereq_('./utils/merge-options.js'); var _utilsMergeOptionsJs2 = _interopRequireDefault(_utilsMergeOptionsJs); var _tracksTextTrackListConverterJs = _dereq_('./tracks/text-track-list-converter.js'); var _tracksTextTrackListConverterJs2 = _interopRequireDefault(_tracksTextTrackListConverterJs); // Include required child components (importing also registers them) var _techLoaderJs = _dereq_('./tech/loader.js'); var _techLoaderJs2 = _interopRequireDefault(_techLoaderJs); var _posterImageJs = _dereq_('./poster-image.js'); var _posterImageJs2 = _interopRequireDefault(_posterImageJs); var _tracksTextTrackDisplayJs = _dereq_('./tracks/text-track-display.js'); var _tracksTextTrackDisplayJs2 = _interopRequireDefault(_tracksTextTrackDisplayJs); var _loadingSpinnerJs = _dereq_('./loading-spinner.js'); var _loadingSpinnerJs2 = _interopRequireDefault(_loadingSpinnerJs); var _bigPlayButtonJs = _dereq_('./big-play-button.js'); var _bigPlayButtonJs2 = _interopRequireDefault(_bigPlayButtonJs); var _controlBarControlBarJs = _dereq_('./control-bar/control-bar.js'); var _controlBarControlBarJs2 = _interopRequireDefault(_controlBarControlBarJs); var _errorDisplayJs = _dereq_('./error-display.js'); var _errorDisplayJs2 = _interopRequireDefault(_errorDisplayJs); var _tracksTextTrackSettingsJs = _dereq_('./tracks/text-track-settings.js'); var _tracksTextTrackSettingsJs2 = _interopRequireDefault(_tracksTextTrackSettingsJs); // Require html5 tech, at least for disposing the original video tag var _techHtml5Js = _dereq_('./tech/html5.js'); var _techHtml5Js2 = _interopRequireDefault(_techHtml5Js); /** * An instance of the `Player` class is created when any of the Video.js setup methods are used to initialize a video. * ```js * var myPlayer = videojs('example_video_1'); * ``` * In the following example, the `data-setup` attribute tells the Video.js library to create a player instance when the library is ready. * ```html * <video id="example_video_1" data-setup='{}' controls> * <source src="my-source.mp4" type="video/mp4"> * </video> * ``` * After an instance has been created it can be accessed globally using `Video('example_video_1')`. * * @param {Element} tag The original video tag used for configuring options * @param {Object=} options Object of option names and values * @param {Function=} ready Ready callback function * @extends Component * @class Player */ var Player = (function (_Component) { _inherits(Player, _Component); /** * player's constructor function * * @constructs * @method init * @param {Element} tag The original video tag used for configuring options * @param {Object=} options Player options * @param {Function=} ready Ready callback function */ function Player(tag, options, ready) { var _this = this; _classCallCheck(this, Player); // Make sure tag ID exists tag.id = tag.id || 'vjs_video_' + Guid.newGUID(); // Set Options // The options argument overrides options set in the video tag // which overrides globally set options. // This latter part coincides with the load order // (tag must exist before Player) options = _objectAssign2['default'](Player.getTagSettings(tag), options); // Delay the initialization of children because we need to set up // player properties first, and can't use `this` before `super()` options.initChildren = false; // Same with creating the element options.createEl = false; // we don't want the player to report touch activity on itself // see enableTouchActivity in Component options.reportTouchActivity = false; // Run base component initializing with new options _Component.call(this, null, options, ready); // if the global option object was accidentally blown away by // someone, bail early with an informative error if (!this.options_ || !this.options_.techOrder || !this.options_.techOrder.length) { throw new Error('No techOrder specified. Did you overwrite ' + 'videojs.options instead of just changing the ' + 'properties you want to override?'); } this.tag = tag; // Store the original tag used to set options // Store the tag attributes used to restore html5 element this.tagAttributes = tag && Dom.getElAttributes(tag); // Update current language this.language(this.options_.language); // Update Supported Languages if (options.languages) { (function () { // Normalise player option languages to lowercase var languagesToLower = {}; Object.getOwnPropertyNames(options.languages).forEach(function (name) { languagesToLower[name.toLowerCase()] = options.languages[name]; }); _this.languages_ = languagesToLower; })(); } else { this.languages_ = Player.prototype.options_.languages; } // Cache for video property values. this.cache_ = {}; // Set poster this.poster_ = options.poster || ''; // Set controls this.controls_ = !!options.controls; // Original tag settings stored in options // now remove immediately so native controls don't flash. // May be turned back on by HTML5 tech if nativeControlsForTouch is true tag.controls = false; /* * Store the internal state of scrubbing * * @private * @return {Boolean} True if the user is scrubbing */ this.scrubbing_ = false; this.el_ = this.createEl(); // We also want to pass the original player options to each component and plugin // as well so they don't need to reach back into the player for options later. // We also need to do another copy of this.options_ so we don't end up with // an infinite loop. var playerOptionsCopy = _utilsMergeOptionsJs2['default'](this.options_); // Load plugins if (options.plugins) { (function () { var plugins = options.plugins; Object.getOwnPropertyNames(plugins).forEach(function (name) { if (typeof this[name] === 'function') { this[name](plugins[name]); } else { _utilsLogJs2['default'].error('Unable to find plugin:', name); } }, _this); })(); } this.options_.playerOptions = playerOptionsCopy; this.initChildren(); // Set isAudio based on whether or not an audio tag was used this.isAudio(tag.nodeName.toLowerCase() === 'audio'); // Update controls className. Can't do this when the controls are initially // set because the element doesn't exist yet. if (this.controls()) { this.addClass('vjs-controls-enabled'); } else { this.addClass('vjs-controls-disabled'); } if (this.isAudio()) { this.addClass('vjs-audio'); } if (this.flexNotSupported_()) { this.addClass('vjs-no-flex'); } // TODO: Make this smarter. Toggle user state between touching/mousing // using events, since devices can have both touch and mouse events. // if (browser.TOUCH_ENABLED) { // this.addClass('vjs-touch-enabled'); // } // Make player easily findable by ID Player.players[this.id_] = this; // When the player is first initialized, trigger activity so components // like the control bar show themselves if needed this.userActive(true); this.reportUserActivity(); this.listenForUserActivity(); this.on('fullscreenchange', this.handleFullscreenChange); this.on('stageclick', this.handleStageClick); } /* * Global player list * * @type {Object} */ /** * Destroys the video player and does any necessary cleanup * ```js * myPlayer.dispose(); * ``` * This is especially helpful if you are dynamically adding and removing videos * to/from the DOM. * * @method dispose */ Player.prototype.dispose = function dispose() { this.trigger('dispose'); // prevent dispose from being called twice this.off('dispose'); if (this.styleEl_) { this.styleEl_.parentNode.removeChild(this.styleEl_); } // Kill reference to this player Player.players[this.id_] = null; if (this.tag && this.tag.player) { this.tag.player = null; } if (this.el_ && this.el_.player) { this.el_.player = null; } if (this.tech) { this.tech.dispose(); } _Component.prototype.dispose.call(this); }; /** * Create the component's DOM element * * @return {Element} * @method createEl */ Player.prototype.createEl = function createEl() { var el = this.el_ = _Component.prototype.createEl.call(this, 'div'); var tag = this.tag; // Remove width/height attrs from tag so CSS can make it 100% width/height tag.removeAttribute('width'); tag.removeAttribute('height'); // Copy over all the attributes from the tag, including ID and class // ID will now reference player box, not the video tag var attrs = Dom.getElAttributes(tag); Object.getOwnPropertyNames(attrs).forEach(function (attr) { // workaround so we don't totally break IE7 // http://stackoverflow.com/questions/3653444/css-styles-not-applied-on-dynamic-elements-in-internet-explorer-7 if (attr === 'class') { el.className = attrs[attr]; } else { el.setAttribute(attr, attrs[attr]); } }); // Update tag id/class for use as HTML5 playback tech // Might think we should do this after embedding in container so .vjs-tech class // doesn't flash 100% width/height, but class only applies with .video-js parent tag.id += '_html5_api'; tag.className = 'vjs-tech'; // Make player findable on elements tag.player = el.player = this; // Default state of video is paused this.addClass('vjs-paused'); // Add a style element in the player that we'll use to set the width/height // of the player in a way that's still overrideable by CSS, just like the // video element this.styleEl_ = stylesheet.createStyleElement('vjs-styles-dimensions'); var defaultsStyleEl = _globalDocument2['default'].querySelector('.vjs-styles-defaults'); var head = _globalDocument2['default'].querySelector('head'); head.insertBefore(this.styleEl_, defaultsStyleEl ? defaultsStyleEl.nextSibling : head.firstChild); // Pass in the width/height/aspectRatio options which will update the style el this.width(this.options_.width); this.height(this.options_.height); this.fluid(this.options_.fluid); this.aspectRatio(this.options_.aspectRatio); // insertElFirst seems to cause the networkState to flicker from 3 to 2, so // keep track of the original for later so we can know if the source originally failed tag.initNetworkState_ = tag.networkState; // Wrap video tag in div (el/box) container if (tag.parentNode) { tag.parentNode.insertBefore(el, tag); } Dom.insertElFirst(tag, el); // Breaks iPhone, fixed in HTML5 setup. this.el_ = el; return el; }; /** * Get/set player width * * @param {Number=} value Value for width * @return {Number} Width when getting * @method width */ Player.prototype.width = function width(value) { return this.dimension('width', value); }; /** * Get/set player height * * @param {Number=} value Value for height * @return {Number} Height when getting * @method height */ Player.prototype.height = function height(value) { return this.dimension('height', value); }; /** * Get/set dimension for player * * @param {String} dimension Either width or height * @param {Number=} value Value for dimension * @return {Component} * @method dimension */ Player.prototype.dimension = function dimension(_dimension, value) { var privDimension = _dimension + '_'; if (value === undefined) { return this[privDimension] || 0; } if (value === '') { // If an empty string is given, reset the dimension to be automatic this[privDimension] = undefined; } else { var parsedVal = parseFloat(value); if (isNaN(parsedVal)) { _utilsLogJs2['default'].error('Improper value "' + value + '" supplied for for ' + _dimension); return this; } this[privDimension] = parsedVal; } this.updateStyleEl_(); return this; }; /** * Add/remove the vjs-fluid class * * @param {Boolean} bool Value of true adds the class, value of false removes the class * @method fluid */ Player.prototype.fluid = function fluid(bool) { if (bool === undefined) { return !!this.fluid_; } this.fluid_ = !!bool; if (bool) { this.addClass('vjs-fluid'); } else { this.removeClass('vjs-fluid'); } }; /** * Get/Set the aspect ratio * * @param {String=} ratio Aspect ratio for player * @return aspectRatio * @method aspectRatio */ Player.prototype.aspectRatio = function aspectRatio(ratio) { if (ratio === undefined) { return this.aspectRatio_; } // Check for width:height format if (!/^\d+\:\d+$/.test(ratio)) { throw new Error('Improper value supplied for aspect ratio. The format should be width:height, for example 16:9.'); } this.aspectRatio_ = ratio; // We're assuming if you set an aspect ratio you want fluid mode, // because in fixed mode you could calculate width and height yourself. this.fluid(true); this.updateStyleEl_(); }; /** * Update styles of the player element (height, width and aspect ratio) * * @method updateStyleEl_ */ Player.prototype.updateStyleEl_ = function updateStyleEl_() { var width = undefined; var height = undefined; var aspectRatio = undefined; // The aspect ratio is either used directly or to calculate width and height. if (this.aspectRatio_ !== undefined && this.aspectRatio_ !== 'auto') { // Use any aspectRatio that's been specifically set aspectRatio = this.aspectRatio_; } else if (this.videoWidth()) { // Otherwise try to get the aspect ratio from the video metadata aspectRatio = this.videoWidth() + ':' + this.videoHeight(); } else { // Or use a default. The video element's is 2:1, but 16:9 is more common. aspectRatio = '16:9'; } // Get the ratio as a decimal we can use to calculate dimensions var ratioParts = aspectRatio.split(':'); var ratioMultiplier = ratioParts[1] / ratioParts[0]; if (this.width_ !== undefined) { // Use any width that's been specifically set width = this.width_; } else if (this.height_ !== undefined) { // Or calulate the width from the aspect ratio if a height has been set width = this.height_ / ratioMultiplier; } else { // Or use the video's metadata, or use the video el's default of 300 width = this.videoWidth() || 300; } if (this.height_ !== undefined) { // Use any height that's been specifically set height = this.height_; } else { // Otherwise calculate the height from the ratio and the width height = width * ratioMultiplier; } var idClass = this.id() + '-dimensions'; // Ensure the right class is still on the player for the style element this.addClass(idClass); stylesheet.setTextContent(this.styleEl_, '\n .' + idClass + ' {\n width: ' + width + 'px;\n height: ' + height + 'px;\n }\n\n .' + idClass + '.vjs-fluid {\n padding-top: ' + ratioMultiplier * 100 + '%;\n }\n '); }; /** * Load the Media Playback Technology (tech) * Load/Create an instance of playback technology including element and API methods * And append playback element in player div. * * @param {String} techName Name of the playback technology * @param {String} source Video source * @method loadTech */ Player.prototype.loadTech = function loadTech(techName, source) { // Pause and remove current playback technology if (this.tech) { this.unloadTech(); } // get rid of the HTML5 video tag as soon as we are using another tech if (techName !== 'Html5' && this.tag) { _componentJs2['default'].getComponent('Html5').disposeMediaElement(this.tag); this.tag.player = null; this.tag = null; } this.techName = techName; // Turn off API access because we're loading a new tech that might load asynchronously this.isReady_ = false; var techReady = Fn.bind(this, function () { this.triggerReady(); }); // Grab tech-specific options from player options and add source and parent element to use. var techOptions = _objectAssign2['default']({ 'nativeControlsForTouch': this.options_.nativeControlsForTouch, 'source': source, 'playerId': this.id(), 'techId': this.id() + '_' + techName + '_api', 'textTracks': this.textTracks_, 'autoplay': this.options_.autoplay, 'preload': this.options_.preload, 'loop': this.options_.loop, 'muted': this.options_.muted, 'poster': this.poster(), 'language': this.language(), 'vtt.js': this.options_['vtt.js'] }, this.options_[techName.toLowerCase()]); if (this.tag) { techOptions.tag = this.tag; } if (source) { this.currentType_ = source.type; if (source.src === this.cache_.src && this.cache_.currentTime > 0) { techOptions.startTime = this.cache_.currentTime; } this.cache_.src = source.src; } // Initialize tech instance var techComponent = _componentJs2['default'].getComponent(techName); this.tech = new techComponent(techOptions); _tracksTextTrackListConverterJs2['default'].jsonToTextTracks(this.textTracksJson_ || [], this.tech); this.on(this.tech, 'ready', this.handleTechReady); // Listen to every HTML5 events and trigger them back on the player for the plugins this.on(this.tech, 'loadstart', this.handleTechLoadStart); this.on(this.tech, 'waiting', this.handleTechWaiting); this.on(this.tech, 'canplay', this.handleTechCanPlay); this.on(this.tech, 'canplaythrough', this.handleTechCanPlayThrough); this.on(this.tech, 'playing', this.handleTechPlaying); this.on(this.tech, 'ended', this.handleTechEnded); this.on(this.tech, 'seeking', this.handleTechSeeking); this.on(this.tech, 'seeked', this.handleTechSeeked); this.on(this.tech, 'play', this.handleTechPlay); this.on(this.tech, 'firstplay', this.handleTechFirstPlay); this.on(this.tech, 'pause', this.handleTechPause); this.on(this.tech, 'progress', this.handleTechProgress); this.on(this.tech, 'durationchange', this.handleTechDurationChange); this.on(this.tech, 'fullscreenchange', this.handleTechFullscreenChange); this.on(this.tech, 'error', this.handleTechError); this.on(this.tech, 'suspend', this.handleTechSuspend); this.on(this.tech, 'abort', this.handleTechAbort); this.on(this.tech, 'emptied', this.handleTechEmptied); this.on(this.tech, 'stalled', this.handleTechStalled); this.on(this.tech, 'loadedmetadata', this.handleTechLoadedMetaData); this.on(this.tech, 'loadeddata', this.handleTechLoadedData); this.on(this.tech, 'timeupdate', this.handleTechTimeUpdate); this.on(this.tech, 'ratechange', this.handleTechRateChange); this.on(this.tech, 'volumechange', this.handleTechVolumeChange); this.on(this.tech, 'texttrackchange', this.onTextTrackChange); this.on(this.tech, 'loadedmetadata', this.updateStyleEl_); this.usingNativeControls(this.techGet('controls')); if (this.controls() && !this.usingNativeControls()) { this.addTechControlsListeners(); } // Add the tech element in the DOM if it was not already there // Make sure to not insert the original video element if using Html5 if (this.tech.el().parentNode !== this.el() && (techName !== 'Html5' || !this.tag)) { Dom.insertElFirst(this.tech.el(), this.el()); } // Get rid of the original video tag reference after the first tech is loaded if (this.tag) { this.tag.player = null; this.tag = null; } // player.triggerReady is always async, so don't need this to be async this.tech.ready(techReady, true); }; /** * Unload playback technology * * @method unloadTech */ Player.prototype.unloadTech = function unloadTech() { // Save the current text tracks so that we can reuse the same text tracks with the next tech this.textTracks_ = this.textTracks(); this.textTracksJson_ = _tracksTextTrackListConverterJs2['default'].textTracksToJson(this); this.isReady_ = false; this.tech.dispose(); this.tech = false; }; /** * Add playback technology listeners * * @method addTechControlsListeners */ Player.prototype.addTechControlsListeners = function addTechControlsListeners() { // Make sure to remove all the previous listeners in case we are called multiple times. this.removeTechControlsListeners(); // Some browsers (Chrome & IE) don't trigger a click on a flash swf, but do // trigger mousedown/up. // http://stackoverflow.com/questions/1444562/javascript-onclick-event-over-flash-object // Any touch events are set to block the mousedown event from happening this.on(this.tech, 'mousedown', this.handleTechClick); // If the controls were hidden we don't want that to change without a tap event // so we'll check if the controls were already showing before reporting user // activity this.on(this.tech, 'touchstart', this.handleTechTouchStart); this.on(this.tech, 'touchmove', this.handleTechTouchMove); this.on(this.tech, 'touchend', this.handleTechTouchEnd); // The tap listener needs to come after the touchend listener because the tap // listener cancels out any reportedUserActivity when setting userActive(false) this.on(this.tech, 'tap', this.handleTechTap); }; /** * Remove the listeners used for click and tap controls. This is needed for * toggling to controls disabled, where a tap/touch should do nothing. * * @method removeTechControlsListeners */ Player.prototype.removeTechControlsListeners = function removeTechControlsListeners() { // We don't want to just use `this.off()` because there might be other needed // listeners added by techs that extend this. this.off(this.tech, 'tap', this.handleTechTap); this.off(this.tech, 'touchstart', this.handleTechTouchStart); this.off(this.tech, 'touchmove', this.handleTechTouchMove); this.off(this.tech, 'touchend', this.handleTechTouchEnd); this.off(this.tech, 'mousedown', this.handleTechClick); }; /** * Player waits for the tech to be ready * * @private * @method handleTechReady */ Player.prototype.handleTechReady = function handleTechReady() { this.triggerReady(); // Keep the same volume as before if (this.cache_.volume) { this.techCall('setVolume', this.cache_.volume); } // Update the duration if available this.handleTechDurationChange(); // Chrome and Safari both have issues with autoplay. // In Safari (5.1.1), when we move the video element into the container div, autoplay doesn't work. // In Chrome (15), if you have autoplay + a poster + no controls, the video gets hidden (but audio plays) // This fixes both issues. Need to wait for API, so it updates displays correctly if (this.tag && this.options_.autoplay && this.paused()) { delete this.tag.poster; // Chrome Fix. Fixed in Chrome v16. this.play(); } }; /** * Fired when the user agent begins looking for media data * * @event loadstart */ Player.prototype.handleTechLoadStart = function handleTechLoadStart() { // TODO: Update to use `emptied` event instead. See #1277. this.removeClass('vjs-ended'); // reset the error state this.error(null); // If it's already playing we want to trigger a firstplay event now. // The firstplay event relies on both the play and loadstart events // which can happen in any order for a new source if (!this.paused()) { this.trigger('loadstart'); this.trigger('firstplay'); } else { // reset the hasStarted state this.hasStarted(false); this.trigger('loadstart'); } }; /** * Add/remove the vjs-has-started class * * @param {Boolean} hasStarted The value of true adds the class the value of false remove the class * @return {Boolean} Boolean value if has started * @method hasStarted */ Player.prototype.hasStarted = function hasStarted(_hasStarted) { if (_hasStarted !== undefined) { // only update if this is a new value if (this.hasStarted_ !== _hasStarted) { this.hasStarted_ = _hasStarted; if (_hasStarted) { this.addClass('vjs-has-started'); // trigger the firstplay event if this newly has played this.trigger('firstplay'); } else { this.removeClass('vjs-has-started'); } } return this; } return !!this.hasStarted_; }; /** * Fired whenever the media begins or resumes playback * * @event play */ Player.prototype.handleTechPlay = function handleTechPlay() { this.removeClass('vjs-ended'); this.removeClass('vjs-paused'); this.addClass('vjs-playing'); // hide the poster when the user hits play // https://html.spec.whatwg.org/multipage/embedded-content.html#dom-media-play this.hasStarted(true); this.trigger('play'); }; /** * Fired whenever the media begins waiting * * @event waiting */ Player.prototype.handleTechWaiting = function handleTechWaiting() { this.addClass('vjs-waiting'); this.trigger('waiting'); }; /** * A handler for events that signal that waiting has ended * which is not consistent between browsers. See #1351 * * @event canplay */ Player.prototype.handleTechCanPlay = function handleTechCanPlay() { this.removeClass('vjs-waiting'); this.trigger('canplay'); }; /** * A handler for events that signal that waiting has ended * which is not consistent between browsers. See #1351 * * @event canplaythrough */ Player.prototype.handleTechCanPlayThrough = function handleTechCanPlayThrough() { this.removeClass('vjs-waiting'); this.trigger('canplaythrough'); }; /** * A handler for events that signal that waiting has ended * which is not consistent between browsers. See #1351 * * @event playing */ Player.prototype.handleTechPlaying = function handleTechPlaying() { this.removeClass('vjs-waiting'); this.trigger('playing'); }; /** * Fired whenever the player is jumping to a new time * * @event seeking */ Player.prototype.handleTechSeeking = function handleTechSeeking() { this.addClass('vjs-seeking'); this.trigger('seeking'); }; /** * Fired when the player has finished jumping to a new time * * @event seeked */ Player.prototype.handleTechSeeked = function handleTechSeeked() { this.removeClass('vjs-seeking'); this.trigger('seeked'); }; /** * Fired the first time a video is played * Not part of the HLS spec, and we're not sure if this is the best * implementation yet, so use sparingly. If you don't have a reason to * prevent playback, use `myPlayer.one('play');` instead. * * @event firstplay */ Player.prototype.handleTechFirstPlay = function handleTechFirstPlay() { //If the first starttime attribute is specified //then we will start at the given offset in seconds if (this.options_.starttime) { this.currentTime(this.options_.starttime); } this.addClass('vjs-has-started'); this.trigger('firstplay'); }; /** * Fired whenever the media has been paused * * @event pause */ Player.prototype.handleTechPause = function handleTechPause() { this.removeClass('vjs-playing'); this.addClass('vjs-paused'); this.trigger('pause'); }; /** * Fired while the user agent is downloading media data * * @event progress */ Player.prototype.handleTechProgress = function handleTechProgress() { this.trigger('progress'); // Add custom event for when source is finished downloading. if (this.bufferedPercent() === 1) { this.trigger('loadedalldata'); } }; /** * Fired when the end of the media resource is reached (currentTime == duration) * * @event ended */ Player.prototype.handleTechEnded = function handleTechEnded() { this.addClass('vjs-ended'); if (this.options_.loop) { this.currentTime(0); this.play(); } else if (!this.paused()) { this.pause(); } this.trigger('ended'); }; /** * Fired when the duration of the media resource is first known or changed * * @event durationchange */ Player.prototype.handleTechDurationChange = function handleTechDurationChange() { this.duration(this.techGet('duration')); }; /** * Handle a click on the media element to play/pause * * @param {Object=} event Event object * @method handleTechClick */ Player.prototype.handleTechClick = function handleTechClick(event) { // We're using mousedown to detect clicks thanks to Flash, but mousedown // will also be triggered with right-clicks, so we need to prevent that if (event.button !== 0) return; // When controls are disabled a click should not toggle playback because // the click is considered a control if (this.controls()) { if (this.paused()) { this.play(); } else { this.pause(); } } }; /** * Handle a tap on the media element. It will toggle the user * activity state, which hides and shows the controls. * * @method handleTechTap */ Player.prototype.handleTechTap = function handleTechTap() { this.userActive(!this.userActive()); }; /** * Handle touch to start * * @method handleTechTouchStart */ Player.prototype.handleTechTouchStart = function handleTechTouchStart() { this.userWasActive = this.userActive(); }; /** * Handle touch to move * * @method handleTechTouchMove */ Player.prototype.handleTechTouchMove = function handleTechTouchMove() { if (this.userWasActive) { this.reportUserActivity(); } }; /** * Handle touch to end * * @method handleTechTouchEnd */ Player.prototype.handleTechTouchEnd = function handleTechTouchEnd(event) { // Stop the mouse events from also happening event.preventDefault(); }; /** * Fired when the player switches in or out of fullscreen mode * * @event fullscreenchange */ Player.prototype.handleFullscreenChange = function handleFullscreenChange() { if (this.isFullscreen()) { this.addClass('vjs-fullscreen'); } else { this.removeClass('vjs-fullscreen'); } }; /** * native click events on the SWF aren't triggered on IE11, Win8.1RT * use stageclick events triggered from inside the SWF instead * * @private * @method handleStageClick */ Player.prototype.handleStageClick = function handleStageClick() { this.reportUserActivity(); }; /** * Handle Tech Fullscreen Change * * @method handleTechFullscreenChange */ Player.prototype.handleTechFullscreenChange = function handleTechFullscreenChange(event, data) { if (data) { this.isFullscreen(data.isFullscreen); } this.trigger('fullscreenchange'); }; /** * Fires when an error occurred during the loading of an audio/video * * @event error */ Player.prototype.handleTechError = function handleTechError() { var error = this.tech.error(); this.error(error && error.code); }; /** * Fires when the browser is intentionally not getting media data * * @event suspend */ Player.prototype.handleTechSuspend = function handleTechSuspend() { this.trigger('suspend'); }; /** * Fires when the loading of an audio/video is aborted * * @event abort */ Player.prototype.handleTechAbort = function handleTechAbort() { this.trigger('abort'); }; /** * Fires when the current playlist is empty * * @event emptied */ Player.prototype.handleTechEmptied = function handleTechEmptied() { this.trigger('emptied'); }; /** * Fires when the browser is trying to get media data, but data is not available * * @event stalled */ Player.prototype.handleTechStalled = function handleTechStalled() { this.trigger('stalled'); }; /** * Fires when the browser has loaded meta data for the audio/video * * @event loadedmetadata */ Player.prototype.handleTechLoadedMetaData = function handleTechLoadedMetaData() { this.trigger('loadedmetadata'); }; /** * Fires when the browser has loaded the current frame of the audio/video * * @event loaddata */ Player.prototype.handleTechLoadedData = function handleTechLoadedData() { this.trigger('loadeddata'); }; /** * Fires when the current playback position has changed * * @event timeupdate */ Player.prototype.handleTechTimeUpdate = function handleTechTimeUpdate() { this.trigger('timeupdate'); }; /** * Fires when the playing speed of the audio/video is changed * * @event ratechange */ Player.prototype.handleTechRateChange = function handleTechRateChange() { this.trigger('ratechange'); }; /** * Fires when the volume has been changed * * @event volumechange */ Player.prototype.handleTechVolumeChange = function handleTechVolumeChange() { this.trigger('volumechange'); }; /** * Fires when the text track has been changed * * @event texttrackchange */ Player.prototype.onTextTrackChange = function onTextTrackChange() { this.trigger('texttrackchange'); }; /** * Get object for cached values. * * @return {Object} * @method getCache */ Player.prototype.getCache = function getCache() { return this.cache_; }; /** * Pass values to the playback tech * * @param {String=} method Method * @param {Object=} arg Argument * @method techCall */ Player.prototype.techCall = function techCall(method, arg) { // If it's not ready yet, call method when it is if (this.tech && !this.tech.isReady_) { this.tech.ready(function () { this[method](arg); }, true); // Otherwise call method now } else { try { this.tech[method](arg); } catch (e) { _utilsLogJs2['default'](e); throw e; } } }; /** * Get calls can't wait for the tech, and sometimes don't need to. * * @param {String} method Tech method * @return {Method} * @method techGet */ Player.prototype.techGet = function techGet(method) { if (this.tech && this.tech.isReady_) { // Flash likes to die and reload when you hide or reposition it. // In these cases the object methods go away and we get errors. // When that happens we'll catch the errors and inform tech that it's not ready any more. try { return this.tech[method](); } catch (e) { // When building additional tech libs, an expected method may not be defined yet if (this.tech[method] === undefined) { _utilsLogJs2['default']('Video.js: ' + method + ' method not defined for ' + this.techName + ' playback technology.', e); } else { // When a method isn't available on the object it throws a TypeError if (e.name === 'TypeError') { _utilsLogJs2['default']('Video.js: ' + method + ' unavailable on ' + this.techName + ' playback technology element.', e); this.tech.isReady_ = false; } else { _utilsLogJs2['default'](e); } } throw e; } } return; }; /** * start media playback * ```js * myPlayer.play(); * ``` * * @return {Player} self * @method play */ Player.prototype.play = function play() { this.techCall('play'); return this; }; /** * Pause the video playback * ```js * myPlayer.pause(); * ``` * * @return {Player} self * @method pause */ Player.prototype.pause = function pause() { this.techCall('pause'); return this; }; /** * Check if the player is paused * ```js * var isPaused = myPlayer.paused(); * var isPlaying = !myPlayer.paused(); * ``` * * @return {Boolean} false if the media is currently playing, or true otherwise * @method paused */ Player.prototype.paused = function paused() { // The initial state of paused should be true (in Safari it's actually false) return this.techGet('paused') === false ? false : true; }; /** * Returns whether or not the user is "scrubbing". Scrubbing is when the user * has clicked the progress bar handle and is dragging it along the progress bar. * * @param {Boolean} isScrubbing True/false the user is scrubbing * @return {Boolean} The scrubbing status when getting * @return {Object} The player when setting * @method scrubbing */ Player.prototype.scrubbing = function scrubbing(isScrubbing) { if (isScrubbing !== undefined) { this.scrubbing_ = !!isScrubbing; if (isScrubbing) { this.addClass('vjs-scrubbing'); } else { this.removeClass('vjs-scrubbing'); } return this; } return this.scrubbing_; }; /** * Get or set the current time (in seconds) * ```js * // get * var whereYouAt = myPlayer.currentTime(); * // set * myPlayer.currentTime(120); // 2 minutes into the video * ``` * * @param {Number|String=} seconds The time to seek to * @return {Number} The time in seconds, when not setting * @return {Player} self, when the current time is set * @method currentTime */ Player.prototype.currentTime = function currentTime(seconds) { if (seconds !== undefined) { this.techCall('setCurrentTime', seconds); return this; } // cache last currentTime and return. default to 0 seconds // // Caching the currentTime is meant to prevent a massive amount of reads on the tech's // currentTime when scrubbing, but may not provide much performance benefit afterall. // Should be tested. Also something has to read the actual current time or the cache will // never get updated. return this.cache_.currentTime = this.techGet('currentTime') || 0; }; /** * Get the length in time of the video in seconds * ```js * var lengthOfVideo = myPlayer.duration(); * ``` * **NOTE**: The video must have started loading before the duration can be * known, and in the case of Flash, may not be known until the video starts * playing. * * @param {Number} seconds Duration when setting * @return {Number} The duration of the video in seconds when getting * @method duration */ Player.prototype.duration = function duration(seconds) { if (seconds === undefined) { return this.cache_.duration || 0; } seconds = parseFloat(seconds) || 0; // Standardize on Inifity for signaling video is live if (seconds < 0) { seconds = Infinity; } if (seconds !== this.cache_.duration) { // Cache the last set value for optimized scrubbing (esp. Flash) this.cache_.duration = seconds; if (seconds === Infinity) { this.addClass('vjs-live'); } else { this.removeClass('vjs-live'); } this.trigger('durationchange'); } return this; }; /** * Calculates how much time is left. * ```js * var timeLeft = myPlayer.remainingTime(); * ``` * Not a native video element function, but useful * * @return {Number} The time remaining in seconds * @method remainingTime */ Player.prototype.remainingTime = function remainingTime() { return this.duration() - this.currentTime(); }; // http://dev.w3.org/html5/spec/video.html#dom-media-buffered // Buffered returns a timerange object. // Kind of like an array of portions of the video that have been downloaded. /** * Get a TimeRange object with the times of the video that have been downloaded * If you just want the percent of the video that's been downloaded, * use bufferedPercent. * ```js * // Number of different ranges of time have been buffered. Usually 1. * numberOfRanges = bufferedTimeRange.length, * // Time in seconds when the first range starts. Usually 0. * firstRangeStart = bufferedTimeRange.start(0), * // Time in seconds when the first range ends * firstRangeEnd = bufferedTimeRange.end(0), * // Length in seconds of the first time range * firstRangeLength = firstRangeEnd - firstRangeStart; * ``` * * @return {Object} A mock TimeRange object (following HTML spec) * @method buffered */ Player.prototype.buffered = function buffered() { var buffered = this.techGet('buffered'); if (!buffered || !buffered.length) { buffered = _utilsTimeRangesJs.createTimeRange(0, 0); } return buffered; }; /** * Get the percent (as a decimal) of the video that's been downloaded * ```js * var howMuchIsDownloaded = myPlayer.bufferedPercent(); * ``` * 0 means none, 1 means all. * (This method isn't in the HTML5 spec, but it's very convenient) * * @return {Number} A decimal between 0 and 1 representing the percent * @method bufferedPercent */ Player.prototype.bufferedPercent = function bufferedPercent() { return _utilsBufferJs.bufferedPercent(this.buffered(), this.duration()); }; /** * Get the ending time of the last buffered time range * This is used in the progress bar to encapsulate all time ranges. * * @return {Number} The end of the last buffered time range * @method bufferedEnd */ Player.prototype.bufferedEnd = function bufferedEnd() { var buffered = this.buffered(), duration = this.duration(), end = buffered.end(buffered.length - 1); if (end > duration) { end = duration; } return end; }; /** * Get or set the current volume of the media * ```js * // get * var howLoudIsIt = myPlayer.volume(); * // set * myPlayer.volume(0.5); // Set volume to half * ``` * 0 is off (muted), 1.0 is all the way up, 0.5 is half way. * * @param {Number} percentAsDecimal The new volume as a decimal percent * @return {Number} The current volume when getting * @return {Player} self when setting * @method volume */ Player.prototype.volume = function volume(percentAsDecimal) { var vol = undefined; if (percentAsDecimal !== undefined) { vol = Math.max(0, Math.min(1, parseFloat(percentAsDecimal))); // Force value to between 0 and 1 this.cache_.volume = vol; this.techCall('setVolume', vol); return this; } // Default to 1 when returning current volume. vol = parseFloat(this.techGet('volume')); return isNaN(vol) ? 1 : vol; }; /** * Get the current muted state, or turn mute on or off * ```js * // get * var isVolumeMuted = myPlayer.muted(); * // set * myPlayer.muted(true); // mute the volume * ``` * * @param {Boolean=} muted True to mute, false to unmute * @return {Boolean} True if mute is on, false if not when getting * @return {Player} self when setting mute * @method muted */ Player.prototype.muted = function muted(_muted) { if (_muted !== undefined) { this.techCall('setMuted', _muted); return this; } return this.techGet('muted') || false; // Default to false }; // Check if current tech can support native fullscreen // (e.g. with built in controls like iOS, so not our flash swf) /** * Check to see if fullscreen is supported * * @return {Boolean} * @method supportsFullScreen */ Player.prototype.supportsFullScreen = function supportsFullScreen() { return this.techGet('supportsFullScreen') || false; }; /** * Check if the player is in fullscreen mode * ```js * // get * var fullscreenOrNot = myPlayer.isFullscreen(); * // set * myPlayer.isFullscreen(true); // tell the player it's in fullscreen * ``` * NOTE: As of the latest HTML5 spec, isFullscreen is no longer an official * property and instead document.fullscreenElement is used. But isFullscreen is * still a valuable property for internal player workings. * * @param {Boolean=} isFS Update the player's fullscreen state * @return {Boolean} true if fullscreen false if not when getting * @return {Player} self when setting * @method isFullscreen */ Player.prototype.isFullscreen = function isFullscreen(isFS) { if (isFS !== undefined) { this.isFullscreen_ = !!isFS; return this; } return !!this.isFullscreen_; }; /** * Increase the size of the video to full screen * ```js * myPlayer.requestFullscreen(); * ``` * In some browsers, full screen is not supported natively, so it enters * "full window mode", where the video fills the browser window. * In browsers and devices that support native full screen, sometimes the * browser's default controls will be shown, and not the Video.js custom skin. * This includes most mobile devices (iOS, Android) and older versions of * Safari. * * @return {Player} self * @method requestFullscreen */ Player.prototype.requestFullscreen = function requestFullscreen() { var fsApi = _fullscreenApiJs2['default']; this.isFullscreen(true); if (fsApi.requestFullscreen) { // the browser supports going fullscreen at the element level so we can // take the controls fullscreen as well as the video // Trigger fullscreenchange event after change // We have to specifically add this each time, and remove // when canceling fullscreen. Otherwise if there's multiple // players on a page, they would all be reacting to the same fullscreen // events Events.on(_globalDocument2['default'], fsApi.fullscreenchange, Fn.bind(this, function documentFullscreenChange(e) { this.isFullscreen(_globalDocument2['default'][fsApi.fullscreenElement]); // If cancelling fullscreen, remove event listener. if (this.isFullscreen() === false) { Events.off(_globalDocument2['default'], fsApi.fullscreenchange, documentFullscreenChange); } this.trigger('fullscreenchange'); })); this.el_[fsApi.requestFullscreen](); } else if (this.tech.supportsFullScreen()) { // we can't take the video.js controls fullscreen but we can go fullscreen // with native controls this.techCall('enterFullScreen'); } else { // fullscreen isn't supported so we'll just stretch the video element to // fill the viewport this.enterFullWindow(); this.trigger('fullscreenchange'); } return this; }; /** * Return the video to its normal size after having been in full screen mode * ```js * myPlayer.exitFullscreen(); * ``` * * @return {Player} self * @method exitFullscreen */ Player.prototype.exitFullscreen = function exitFullscreen() { var fsApi = _fullscreenApiJs2['default']; this.isFullscreen(false); // Check for browser element fullscreen support if (fsApi.requestFullscreen) { _globalDocument2['default'][fsApi.exitFullscreen](); } else if (this.tech.supportsFullScreen()) { this.techCall('exitFullScreen'); } else { this.exitFullWindow(); this.trigger('fullscreenchange'); } return this; }; /** * When fullscreen isn't supported we can stretch the video container to as wide as the browser will let us. * * @method enterFullWindow */ Player.prototype.enterFullWindow = function enterFullWindow() { this.isFullWindow = true; // Storing original doc overflow value to return to when fullscreen is off this.docOrigOverflow = _globalDocument2['default'].documentElement.style.overflow; // Add listener for esc key to exit fullscreen Events.on(_globalDocument2['default'], 'keydown', Fn.bind(this, this.fullWindowOnEscKey)); // Hide any scroll bars _globalDocument2['default'].documentElement.style.overflow = 'hidden'; // Apply fullscreen styles Dom.addElClass(_globalDocument2['default'].body, 'vjs-full-window'); this.trigger('enterFullWindow'); }; /** * Check for call to either exit full window or full screen on ESC key * * @param {String} event Event to check for key press * @method fullWindowOnEscKey */ Player.prototype.fullWindowOnEscKey = function fullWindowOnEscKey(event) { if (event.keyCode === 27) { if (this.isFullscreen() === true) { this.exitFullscreen(); } else { this.exitFullWindow(); } } }; /** * Exit full window * * @method exitFullWindow */ Player.prototype.exitFullWindow = function exitFullWindow() { this.isFullWindow = false; Events.off(_globalDocument2['default'], 'keydown', this.fullWindowOnEscKey); // Unhide scroll bars. _globalDocument2['default'].documentElement.style.overflow = this.docOrigOverflow; // Remove fullscreen styles Dom.removeElClass(_globalDocument2['default'].body, 'vjs-full-window'); // Resize the box, controller, and poster to original sizes // this.positionAll(); this.trigger('exitFullWindow'); }; /** * Select source based on tech order * * @param {Array} sources The sources for a media asset * @return {Object|Boolean} Object of source and tech order, otherwise false * @method selectSource */ Player.prototype.selectSource = function selectSource(sources) { // Loop through each playback technology in the options order for (var i = 0, j = this.options_.techOrder; i < j.length; i++) { var techName = _utilsToTitleCaseJs2['default'](j[i]); var tech = _componentJs2['default'].getComponent(techName); // Check if the current tech is defined before continuing if (!tech) { _utilsLogJs2['default'].error('The "' + techName + '" tech is undefined. Skipped browser support check for that tech.'); continue; } // Check if the browser supports this technology if (tech.isSupported()) { // Loop through each source object for (var a = 0, b = sources; a < b.length; a++) { var source = b[a]; // Check if source can be played with this technology if (tech.canPlaySource(source)) { return { source: source, tech: techName }; } } } } return false; }; /** * The source function updates the video source * There are three types of variables you can pass as the argument. * **URL String**: A URL to the the video file. Use this method if you are sure * the current playback technology (HTML5/Flash) can support the source you * provide. Currently only MP4 files can be used in both HTML5 and Flash. * ```js * myPlayer.src("http://www.example.com/path/to/video.mp4"); * ``` * **Source Object (or element):* * A javascript object containing information * about the source file. Use this method if you want the player to determine if * it can support the file using the type information. * ```js * myPlayer.src({ type: "video/mp4", src: "http://www.example.com/path/to/video.mp4" }); * ``` * **Array of Source Objects:* * To provide multiple versions of the source so * that it can be played using HTML5 across browsers you can use an array of * source objects. Video.js will detect which version is supported and load that * file. * ```js * myPlayer.src([ * { type: "video/mp4", src: "http://www.example.com/path/to/video.mp4" }, * { type: "video/webm", src: "http://www.example.com/path/to/video.webm" }, * { type: "video/ogg", src: "http://www.example.com/path/to/video.ogv" } * ]); * ``` * * @param {String|Object|Array=} source The source URL, object, or array of sources * @return {String} The current video source when getting * @return {String} The player when setting * @method src */ Player.prototype.src = function src(source) { if (source === undefined) { return this.techGet('src'); } var currentTech = _componentJs2['default'].getComponent(this.techName); // case: Array of source objects to choose from and pick the best to play if (Array.isArray(source)) { this.sourceList_(source); // case: URL String (http://myvideo...) } else if (typeof source === 'string') { // create a source object from the string this.src({ src: source }); // case: Source object { src: '', type: '' ... } } else if (source instanceof Object) { // check if the source has a type and the loaded tech cannot play the source // if there's no type we'll just try the current tech if (source.type && !currentTech.canPlaySource(source)) { // create a source list with the current source and send through // the tech loop to check for a compatible technology this.sourceList_([source]); } else { this.cache_.src = source.src; this.currentType_ = source.type || ''; // wait until the tech is ready to set the source this.ready(function () { // The setSource tech method was added with source handlers // so older techs won't support it // We need to check the direct prototype for the case where subclasses // of the tech do not support source handlers if (currentTech.prototype.hasOwnProperty('setSource')) { this.techCall('setSource', source); } else { this.techCall('src', source.src); } if (this.options_.preload === 'auto') { this.load(); } if (this.options_.autoplay) { this.play(); } // Set the source synchronously if possible (#2326) }, true); } } return this; }; /** * Handle an array of source objects * * @param {Array} sources Array of source objects * @private * @method sourceList_ */ Player.prototype.sourceList_ = function sourceList_(sources) { var sourceTech = this.selectSource(sources); if (sourceTech) { if (sourceTech.tech === this.techName) { // if this technology is already loaded, set the source this.src(sourceTech.source); } else { // load this technology with the chosen source this.loadTech(sourceTech.tech, sourceTech.source); } } else { // We need to wrap this in a timeout to give folks a chance to add error event handlers this.setTimeout(function () { this.error({ code: 4, message: this.localize(this.options_.notSupportedMessage) }); }, 0); // we could not find an appropriate tech, but let's still notify the delegate that this is it // this needs a better comment about why this is needed this.triggerReady(); } }; /** * Begin loading the src data. * * @return {Player} Returns the player * @method load */ Player.prototype.load = function load() { this.techCall('load'); return this; }; /** * Returns the fully qualified URL of the current source value e.g. http://mysite.com/video.mp4 * Can be used in conjuction with `currentType` to assist in rebuilding the current source object. * * @return {String} The current source * @method currentSrc */ Player.prototype.currentSrc = function currentSrc() { return this.techGet('currentSrc') || this.cache_.src || ''; }; /** * Get the current source type e.g. video/mp4 * This can allow you rebuild the current source object so that you could load the same * source and tech later * * @return {String} The source MIME type * @method currentType */ Player.prototype.currentType = function currentType() { return this.currentType_ || ''; }; /** * Get or set the preload attribute * * @param {Boolean} value Boolean to determine if preload should be used * @return {String} The preload attribute value when getting * @return {Player} Returns the player when setting * @method preload */ Player.prototype.preload = function preload(value) { if (value !== undefined) { this.techCall('setPreload', value); this.options_.preload = value; return this; } return this.techGet('preload'); }; /** * Get or set the autoplay attribute. * * @param {Boolean} value Boolean to determine if preload should be used * @return {String} The autoplay attribute value when getting * @return {Player} Returns the player when setting * @method autoplay */ Player.prototype.autoplay = function autoplay(value) { if (value !== undefined) { this.techCall('setAutoplay', value); this.options_.autoplay = value; return this; } return this.techGet('autoplay', value); }; /** * Get or set the loop attribute on the video element. * * @param {Boolean} value Boolean to determine if preload should be used * @return {String} The loop attribute value when getting * @return {Player} Returns the player when setting * @method loop */ Player.prototype.loop = function loop(value) { if (value !== undefined) { this.techCall('setLoop', value); this.options_['loop'] = value; return this; } return this.techGet('loop'); }; /** * get or set the poster image source url * ##### EXAMPLE: * ```js * // get * var currentPoster = myPlayer.poster(); * // set * myPlayer.poster('http://example.com/myImage.jpg'); * ``` * * @param {String=} src Poster image source URL * @return {String} poster URL when getting * @return {Player} self when setting * @method poster */ Player.prototype.poster = function poster(src) { if (src === undefined) { return this.poster_; } // The correct way to remove a poster is to set as an empty string // other falsey values will throw errors if (!src) { src = ''; } // update the internal poster variable this.poster_ = src; // update the tech's poster this.techCall('setPoster', src); // alert components that the poster has been set this.trigger('posterchange'); return this; }; /** * Get or set whether or not the controls are showing. * * @param {Boolean} bool Set controls to showing or not * @return {Boolean} Controls are showing * @method controls */ Player.prototype.controls = function controls(bool) { if (bool !== undefined) { bool = !!bool; // force boolean // Don't trigger a change event unless it actually changed if (this.controls_ !== bool) { this.controls_ = bool; if (this.usingNativeControls()) { this.techCall('setControls', bool); } if (bool) { this.removeClass('vjs-controls-disabled'); this.addClass('vjs-controls-enabled'); this.trigger('controlsenabled'); if (!this.usingNativeControls()) { this.addTechControlsListeners(); } } else { this.removeClass('vjs-controls-enabled'); this.addClass('vjs-controls-disabled'); this.trigger('controlsdisabled'); if (!this.usingNativeControls()) { this.removeTechControlsListeners(); } } } return this; } return !!this.controls_; }; /** * Toggle native controls on/off. Native controls are the controls built into * devices (e.g. default iPhone controls), Flash, or other techs * (e.g. Vimeo Controls) * **This should only be set by the current tech, because only the tech knows * if it can support native controls** * * @param {Boolean} bool True signals that native controls are on * @return {Player} Returns the player * @private * @method usingNativeControls */ Player.prototype.usingNativeControls = function usingNativeControls(bool) { if (bool !== undefined) { bool = !!bool; // force boolean // Don't trigger a change event unless it actually changed if (this.usingNativeControls_ !== bool) { this.usingNativeControls_ = bool; if (bool) { this.addClass('vjs-using-native-controls'); /** * player is using the native device controls * * @event usingnativecontrols * @memberof Player * @instance * @private */ this.trigger('usingnativecontrols'); } else { this.removeClass('vjs-using-native-controls'); /** * player is using the custom HTML controls * * @event usingcustomcontrols * @memberof Player * @instance * @private */ this.trigger('usingcustomcontrols'); } } return this; } return !!this.usingNativeControls_; }; /** * Set or get the current MediaError * * @param {*} err A MediaError or a String/Number to be turned into a MediaError * @return {MediaError|null} when getting * @return {Player} when setting * @method error */ Player.prototype.error = function error(err) { if (err === undefined) { return this.error_ || null; } // restoring to default if (err === null) { this.error_ = err; this.removeClass('vjs-error'); return this; } // error instance if (err instanceof _mediaErrorJs2['default']) { this.error_ = err; } else { this.error_ = new _mediaErrorJs2['default'](err); } // fire an error event on the player this.trigger('error'); // add the vjs-error classname to the player this.addClass('vjs-error'); // log the name of the error type and any message // ie8 just logs "[object object]" if you just log the error object _utilsLogJs2['default'].error('(CODE:' + this.error_.code + ' ' + _mediaErrorJs2['default'].errorTypes[this.error_.code] + ')', this.error_.message, this.error_); return this; }; /** * Returns whether or not the player is in the "ended" state. * * @return {Boolean} True if the player is in the ended state, false if not. * @method ended */ Player.prototype.ended = function ended() { return this.techGet('ended'); }; /** * Returns whether or not the player is in the "seeking" state. * * @return {Boolean} True if the player is in the seeking state, false if not. * @method seeking */ Player.prototype.seeking = function seeking() { return this.techGet('seeking'); }; /** * Returns the TimeRanges of the media that are currently available * for seeking to. * * @return {TimeRanges} the seekable intervals of the media timeline * @method seekable */ Player.prototype.seekable = function seekable() { return this.techGet('seekable'); }; /** * Report user activity * * @param {Object} event Event object * @method reportUserActivity */ Player.prototype.reportUserActivity = function reportUserActivity(event) { this.userActivity_ = true; }; /** * Get/set if user is active * * @param {Boolean} bool Value when setting * @return {Boolean} Value if user is active user when getting * @method userActive */ Player.prototype.userActive = function userActive(bool) { if (bool !== undefined) { bool = !!bool; if (bool !== this.userActive_) { this.userActive_ = bool; if (bool) { // If the user was inactive and is now active we want to reset the // inactivity timer this.userActivity_ = true; this.removeClass('vjs-user-inactive'); this.addClass('vjs-user-active'); this.trigger('useractive'); } else { // We're switching the state to inactive manually, so erase any other // activity this.userActivity_ = false; // Chrome/Safari/IE have bugs where when you change the cursor it can // trigger a mousemove event. This causes an issue when you're hiding // the cursor when the user is inactive, and a mousemove signals user // activity. Making it impossible to go into inactive mode. Specifically // this happens in fullscreen when we really need to hide the cursor. // // When this gets resolved in ALL browsers it can be removed // https://code.google.com/p/chromium/issues/detail?id=103041 if (this.tech) { this.tech.one('mousemove', function (e) { e.stopPropagation(); e.preventDefault(); }); } this.removeClass('vjs-user-active'); this.addClass('vjs-user-inactive'); this.trigger('userinactive'); } } return this; } return this.userActive_; }; /** * Listen for user activity based on timeout value * * @method listenForUserActivity */ Player.prototype.listenForUserActivity = function listenForUserActivity() { var mouseInProgress = undefined, lastMoveX = undefined, lastMoveY = undefined; var handleActivity = Fn.bind(this, this.reportUserActivity); var handleMouseMove = function handleMouseMove(e) { // #1068 - Prevent mousemove spamming // Chrome Bug: https://code.google.com/p/chromium/issues/detail?id=366970 if (e.screenX !== lastMoveX || e.screenY !== lastMoveY) { lastMoveX = e.screenX; lastMoveY = e.screenY; handleActivity(); } }; var handleMouseDown = function handleMouseDown() { handleActivity(); // For as long as the they are touching the device or have their mouse down, // we consider them active even if they're not moving their finger or mouse. // So we want to continue to update that they are active this.clearInterval(mouseInProgress); // Setting userActivity=true now and setting the interval to the same time // as the activityCheck interval (250) should ensure we never miss the // next activityCheck mouseInProgress = this.setInterval(handleActivity, 250); }; var handleMouseUp = function handleMouseUp(event) { handleActivity(); // Stop the interval that maintains activity if the mouse/touch is down this.clearInterval(mouseInProgress); }; // Any mouse movement will be considered user activity this.on('mousedown', handleMouseDown); this.on('mousemove', handleMouseMove); this.on('mouseup', handleMouseUp); // Listen for keyboard navigation // Shouldn't need to use inProgress interval because of key repeat this.on('keydown', handleActivity); this.on('keyup', handleActivity); // Run an interval every 250 milliseconds instead of stuffing everything into // the mousemove/touchmove function itself, to prevent performance degradation. // `this.reportUserActivity` simply sets this.userActivity_ to true, which // then gets picked up by this loop // http://ejohn.org/blog/learning-from-twitter/ var inactivityTimeout = undefined; var activityCheck = this.setInterval(function () { // Check to see if mouse/touch activity has happened if (this.userActivity_) { // Reset the activity tracker this.userActivity_ = false; // If the user state was inactive, set the state to active this.userActive(true); // Clear any existing inactivity timeout to start the timer over this.clearTimeout(inactivityTimeout); var timeout = this.options_['inactivityTimeout']; if (timeout > 0) { // In <timeout> milliseconds, if no more activity has occurred the // user will be considered inactive inactivityTimeout = this.setTimeout(function () { // Protect against the case where the inactivityTimeout can trigger just // before the next user activity is picked up by the activityCheck loop // causing a flicker if (!this.userActivity_) { this.userActive(false); } }, timeout); } } }, 250); }; /** * Gets or sets the current playback rate. A playback rate of * 1.0 represents normal speed and 0.5 would indicate half-speed * playback, for instance. * @see https://html.spec.whatwg.org/multipage/embedded-content.html#dom-media-playbackrate * * @param {Number} rate New playback rate to set. * @return {Number} Returns the new playback rate when setting * @return {Number} Returns the current playback rate when getting * @method playbackRate */ Player.prototype.playbackRate = function playbackRate(rate) { if (rate !== undefined) { this.techCall('setPlaybackRate', rate); return this; } if (this.tech && this.tech['featuresPlaybackRate']) { return this.techGet('playbackRate'); } else { return 1.0; } }; /** * Gets or sets the audio flag * * @param {Boolean} bool True signals that this is an audio player. * @return {Boolean} Returns true if player is audio, false if not when getting * @return {Player} Returns the player if setting * @private * @method isAudio */ Player.prototype.isAudio = function isAudio(bool) { if (bool !== undefined) { this.isAudio_ = !!bool; return this; } return !!this.isAudio_; }; /** * Returns the current state of network activity for the element, from * the codes in the list below. * - NETWORK_EMPTY (numeric value 0) * The element has not yet been initialised. All attributes are in * their initial states. * - NETWORK_IDLE (numeric value 1) * The element's resource selection algorithm is active and has * selected a resource, but it is not actually using the network at * this time. * - NETWORK_LOADING (numeric value 2) * The user agent is actively trying to download data. * - NETWORK_NO_SOURCE (numeric value 3) * The element's resource selection algorithm is active, but it has * not yet found a resource to use. * * @see https://html.spec.whatwg.org/multipage/embedded-content.html#network-states * @return {Number} the current network activity state * @method networkState */ Player.prototype.networkState = function networkState() { return this.techGet('networkState'); }; /** * Returns a value that expresses the current state of the element * with respect to rendering the current playback position, from the * codes in the list below. * - HAVE_NOTHING (numeric value 0) * No information regarding the media resource is available. * - HAVE_METADATA (numeric value 1) * Enough of the resource has been obtained that the duration of the * resource is available. * - HAVE_CURRENT_DATA (numeric value 2) * Data for the immediate current playback position is available. * - HAVE_FUTURE_DATA (numeric value 3) * Data for the immediate current playback position is available, as * well as enough data for the user agent to advance the current * playback position in the direction of playback. * - HAVE_ENOUGH_DATA (numeric value 4) * The user agent estimates that enough data is available for * playback to proceed uninterrupted. * * @see https://html.spec.whatwg.org/multipage/embedded-content.html#dom-media-readystate * @return {Number} the current playback rendering state * @method readyState */ Player.prototype.readyState = function readyState() { return this.techGet('readyState'); }; /* * Text tracks are tracks of timed text events. * Captions - text displayed over the video for the hearing impaired * Subtitles - text displayed over the video for those who don't understand language in the video * Chapters - text displayed in a menu allowing the user to jump to particular points (chapters) in the video * Descriptions (not supported yet) - audio descriptions that are read back to the user by a screen reading device */ /** * Get an array of associated text tracks. captions, subtitles, chapters, descriptions * http://www.w3.org/html/wg/drafts/html/master/embedded-content-0.html#dom-media-texttracks * * @return {Array} Array of track objects * @method textTracks */ Player.prototype.textTracks = function textTracks() { // cannot use techGet directly because it checks to see whether the tech is ready. // Flash is unlikely to be ready in time but textTracks should still work. return this.tech && this.tech['textTracks'](); }; /** * Get an array of remote text tracks * * @return {Array} * @method remoteTextTracks */ Player.prototype.remoteTextTracks = function remoteTextTracks() { return this.tech && this.tech['remoteTextTracks'](); }; /** * Add a text track * In addition to the W3C settings we allow adding additional info through options. * http://www.w3.org/html/wg/drafts/html/master/embedded-content-0.html#dom-media-addtexttrack * * @param {String} kind Captions, subtitles, chapters, descriptions, or metadata * @param {String=} label Optional label * @param {String=} language Optional language * @method addTextTrack */ Player.prototype.addTextTrack = function addTextTrack(kind, label, language) { return this.tech && this.tech['addTextTrack'](kind, label, language); }; /** * Add a remote text track * * @param {Object} options Options for remote text track * @method addRemoteTextTrack */ Player.prototype.addRemoteTextTrack = function addRemoteTextTrack(options) { return this.tech && this.tech['addRemoteTextTrack'](options); }; /** * Remove a remote text track * * @param {Object} track Remote text track to remove * @method removeRemoteTextTrack */ Player.prototype.removeRemoteTextTrack = function removeRemoteTextTrack(track) { this.tech && this.tech['removeRemoteTextTrack'](track); }; /** * Get video width * * @return {Number} Video width * @method videoWidth */ Player.prototype.videoWidth = function videoWidth() { return this.tech && this.tech.videoWidth && this.tech.videoWidth() || 0; }; /** * Get video height * * @return {Number} Video height * @method videoHeight */ Player.prototype.videoHeight = function videoHeight() { return this.tech && this.tech.videoHeight && this.tech.videoHeight() || 0; }; // Methods to add support for // initialTime: function(){ return this.techCall('initialTime'); }, // startOffsetTime: function(){ return this.techCall('startOffsetTime'); }, // played: function(){ return this.techCall('played'); }, // seekable: function(){ return this.techCall('seekable'); }, // videoTracks: function(){ return this.techCall('videoTracks'); }, // audioTracks: function(){ return this.techCall('audioTracks'); }, // defaultPlaybackRate: function(){ return this.techCall('defaultPlaybackRate'); }, // mediaGroup: function(){ return this.techCall('mediaGroup'); }, // controller: function(){ return this.techCall('controller'); }, // defaultMuted: function(){ return this.techCall('defaultMuted'); } // TODO // currentSrcList: the array of sources including other formats and bitrates // playList: array of source lists in order of playback /** * The player's language code * NOTE: The language should be set in the player options if you want the * the controls to be built with a specific language. Changing the lanugage * later will not update controls text. * * @param {String} code The locale string * @return {String} The locale string when getting * @return {Player} self when setting * @method language */ Player.prototype.language = function language(code) { if (code === undefined) { return this.language_; } this.language_ = ('' + code).toLowerCase(); return this; }; /** * Get the player's language dictionary * Merge every time, because a newly added plugin might call videojs.addLanguage() at any time * Languages specified directly in the player options have precedence * * @return {Array} Array of languages * @method languages */ Player.prototype.languages = function languages() { return _utilsMergeOptionsJs2['default'](Player.prototype.options_.languages, this.languages_); }; /** * Converts track info to JSON * * @return {Object} JSON object of options * @method toJSON */ Player.prototype.toJSON = function toJSON() { var options = _utilsMergeOptionsJs2['default'](this.options_); var tracks = options.tracks; options.tracks = []; for (var i = 0; i < tracks.length; i++) { var track = tracks[i]; // deep merge tracks and null out player so no circular references track = _utilsMergeOptionsJs2['default'](track); track.player = undefined; options.tracks[i] = track; } return options; }; /** * Gets tag settings * * @param {Element} tag The player tag * @return {Array} An array of sources and track objects * @static * @method getTagSettings */ Player.getTagSettings = function getTagSettings(tag) { var baseOptions = { 'sources': [], 'tracks': [] }; var tagOptions = Dom.getElAttributes(tag); var dataSetup = tagOptions['data-setup']; // Check if data-setup attr exists. if (dataSetup !== null) { // Parse options JSON var _safeParseTuple = _safeJsonParseTuple2['default'](dataSetup || '{}'); var err = _safeParseTuple[0]; var data = _safeParseTuple[1]; if (err) { _utilsLogJs2['default'].error(err); } _objectAssign2['default'](tagOptions, data); } _objectAssign2['default'](baseOptions, tagOptions); // Get tag children settings if (tag.hasChildNodes()) { var children = tag.childNodes; for (var i = 0, j = children.length; i < j; i++) { var child = children[i]; // Change case needed: http://ejohn.org/blog/nodename-case-sensitivity/ var childName = child.nodeName.toLowerCase(); if (childName === 'source') { baseOptions.sources.push(Dom.getElAttributes(child)); } else if (childName === 'track') { baseOptions.tracks.push(Dom.getElAttributes(child)); } } } return baseOptions; }; return Player; })(_componentJs2['default']); Player.players = {}; var navigator = _globalWindow2['default'].navigator; /* * Player instance options, surfaced using options * options = Player.prototype.options_ * Make changes in options, not here. * * @type {Object} * @private */ Player.prototype.options_ = { // Default order of fallback technology techOrder: ['html5', 'flash'], // techOrder: ['flash','html5'], html5: {}, flash: {}, // defaultVolume: 0.85, defaultVolume: 0.00, // The freakin seaguls are driving me crazy! // default inactivity timeout inactivityTimeout: 2000, // default playback rates playbackRates: [], // Add playback rate selection by adding rates // 'playbackRates': [0.5, 1, 1.5, 2], // Included control sets children: { mediaLoader: {}, posterImage: {}, textTrackDisplay: {}, loadingSpinner: {}, bigPlayButton: {}, controlBar: {}, errorDisplay: {}, textTrackSettings: {} }, language: _globalDocument2['default'].getElementsByTagName('html')[0].getAttribute('lang') || navigator.languages && navigator.languages[0] || navigator.userLanguage || navigator.language || 'en', // locales and their language translations languages: {}, // Default message to show when a video cannot be played. notSupportedMessage: 'No compatible source was found for this video.' }; /** * Fired when the player has initial duration and dimension information * * @event loadedmetadata */ Player.prototype.handleLoadedMetaData; /** * Fired when the player has downloaded data at the current playback position * * @event loadeddata */ Player.prototype.handleLoadedData; /** * Fired when the player has finished downloading the source data * * @event loadedalldata */ Player.prototype.handleLoadedAllData; /** * Fired when the user is active, e.g. moves the mouse over the player * * @event useractive */ Player.prototype.handleUserActive; /** * Fired when the user is inactive, e.g. a short delay after the last mouse move or control interaction * * @event userinactive */ Player.prototype.handleUserInactive; /** * Fired when the current playback position has changed * * During playback this is fired every 15-250 milliseconds, depending on the * playback technology in use. * * @event timeupdate */ Player.prototype.handleTimeUpdate; /** * Fired when the volume changes * * @event volumechange */ Player.prototype.handleVolumeChange; /** * Fired when an error occurs * * @event error */ Player.prototype.handleError; Player.prototype.flexNotSupported_ = function () { var elem = _globalDocument2['default'].createElement('i'); // Note: We don't actually use flexBasis (or flexOrder), but it's one of the more // common flex features that we can rely on when checking for flex support. return !('flexBasis' in elem.style || 'webkitFlexBasis' in elem.style || 'mozFlexBasis' in elem.style || 'msFlexBasis' in elem.style || 'msFlexOrder' in elem.style) /* IE10-specific (2012 flex spec) */; }; _componentJs2['default'].registerComponent('Player', Player); exports['default'] = Player; module.exports = exports['default']; // If empty string, make it a parsable json object. },{"./big-play-button.js":46,"./component.js":48,"./control-bar/control-bar.js":49,"./error-display.js":78,"./fullscreen-api.js":81,"./loading-spinner.js":82,"./media-error.js":83,"./poster-image.js":89,"./tech/html5.js":94,"./tech/loader.js":95,"./tracks/text-track-display.js":98,"./tracks/text-track-list-converter.js":100,"./tracks/text-track-settings.js":102,"./utils/browser.js":104,"./utils/buffer.js":105,"./utils/dom.js":107,"./utils/events.js":108,"./utils/fn.js":109,"./utils/guid.js":111,"./utils/log.js":112,"./utils/merge-options.js":113,"./utils/stylesheet.js":114,"./utils/time-ranges.js":115,"./utils/to-title-case.js":116,"global/document":1,"global/window":2,"object.assign":40,"safe-json-parse/tuple":45}],88:[function(_dereq_,module,exports){ /** * @file plugins.js */ 'use strict'; exports.__esModule = true; function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } var _playerJs = _dereq_('./player.js'); var _playerJs2 = _interopRequireDefault(_playerJs); /** * The method for registering a video.js plugin * * @param {String} name The name of the plugin * @param {Function} init The function that is run when the player inits * @method plugin */ var plugin = function plugin(name, init) { _playerJs2['default'].prototype[name] = init; }; exports['default'] = plugin; module.exports = exports['default']; },{"./player.js":87}],89:[function(_dereq_,module,exports){ /** * @file poster-image.js */ 'use strict'; exports.__esModule = true; function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj['default'] = obj; return newObj; } } function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError('Cannot call a class as a function'); } } function _inherits(subClass, superClass) { if (typeof superClass !== 'function' && superClass !== null) { throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } var _buttonJs = _dereq_('./button.js'); var _buttonJs2 = _interopRequireDefault(_buttonJs); var _componentJs = _dereq_('./component.js'); var _componentJs2 = _interopRequireDefault(_componentJs); var _utilsFnJs = _dereq_('./utils/fn.js'); var Fn = _interopRequireWildcard(_utilsFnJs); var _utilsDomJs = _dereq_('./utils/dom.js'); var Dom = _interopRequireWildcard(_utilsDomJs); var _utilsBrowserJs = _dereq_('./utils/browser.js'); var browser = _interopRequireWildcard(_utilsBrowserJs); /** * The component that handles showing the poster image. * * @param {Player|Object} player * @param {Object=} options * @extends Button * @class PosterImage */ var PosterImage = (function (_Button) { _inherits(PosterImage, _Button); function PosterImage(player, options) { _classCallCheck(this, PosterImage); _Button.call(this, player, options); this.update(); player.on('posterchange', Fn.bind(this, this.update)); } /** * Clean up the poster image * * @method dispose */ PosterImage.prototype.dispose = function dispose() { this.player().off('posterchange', this.update); _Button.prototype.dispose.call(this); }; /** * Create the poster's image element * * @return {Element} * @method createEl */ PosterImage.prototype.createEl = function createEl() { var el = Dom.createEl('div', { className: 'vjs-poster', // Don't want poster to be tabbable. tabIndex: -1 }); // To ensure the poster image resizes while maintaining its original aspect // ratio, use a div with `background-size` when available. For browsers that // do not support `background-size` (e.g. IE8), fall back on using a regular // img element. if (!browser.BACKGROUND_SIZE_SUPPORTED) { this.fallbackImg_ = Dom.createEl('img'); el.appendChild(this.fallbackImg_); } return el; }; /** * Event handler for updates to the player's poster source * * @method update */ PosterImage.prototype.update = function update() { var url = this.player().poster(); this.setSrc(url); // If there's no poster source we should display:none on this component // so it's not still clickable or right-clickable if (url) { this.show(); } else { this.hide(); } }; /** * Set the poster source depending on the display method * * @param {String} url The URL to the poster source * @method setSrc */ PosterImage.prototype.setSrc = function setSrc(url) { if (this.fallbackImg_) { this.fallbackImg_.src = url; } else { var backgroundImage = ''; // Any falsey values should stay as an empty string, otherwise // this will throw an extra error if (url) { backgroundImage = 'url("' + url + '")'; } this.el_.style.backgroundImage = backgroundImage; } }; /** * Event handler for clicks on the poster image * * @method handleClick */ PosterImage.prototype.handleClick = function handleClick() { // We don't want a click to trigger playback when controls are disabled // but CSS should be hiding the poster to prevent that from happening if (this.player_.paused()) { this.player_.play(); } else { this.player_.pause(); } }; return PosterImage; })(_buttonJs2['default']); _componentJs2['default'].registerComponent('PosterImage', PosterImage); exports['default'] = PosterImage; module.exports = exports['default']; },{"./button.js":47,"./component.js":48,"./utils/browser.js":104,"./utils/dom.js":107,"./utils/fn.js":109}],90:[function(_dereq_,module,exports){ /** * @file setup.js * * Functions for automatically setting up a player * based on the data-setup attribute of the video tag */ 'use strict'; exports.__esModule = true; function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj['default'] = obj; return newObj; } } var _utilsEventsJs = _dereq_('./utils/events.js'); var Events = _interopRequireWildcard(_utilsEventsJs); var _globalDocument = _dereq_('global/document'); var _globalDocument2 = _interopRequireDefault(_globalDocument); var _globalWindow = _dereq_('global/window'); var _globalWindow2 = _interopRequireDefault(_globalWindow); var _windowLoaded = false; var videojs = undefined; // Automatically set up any tags that have a data-setup attribute var autoSetup = function autoSetup() { // One day, when we stop supporting IE8, go back to this, but in the meantime...*hack hack hack* // var vids = Array.prototype.slice.call(document.getElementsByTagName('video')); // var audios = Array.prototype.slice.call(document.getElementsByTagName('audio')); // var mediaEls = vids.concat(audios); // Because IE8 doesn't support calling slice on a node list, we need to loop through each list of elements // to build up a new, combined list of elements. var vids = _globalDocument2['default'].getElementsByTagName('video'); var audios = _globalDocument2['default'].getElementsByTagName('audio'); var mediaEls = []; if (vids && vids.length > 0) { for (var i = 0, e = vids.length; i < e; i++) { mediaEls.push(vids[i]); } } if (audios && audios.length > 0) { for (var i = 0, e = audios.length; i < e; i++) { mediaEls.push(audios[i]); } } // Check if any media elements exist if (mediaEls && mediaEls.length > 0) { for (var i = 0, e = mediaEls.length; i < e; i++) { var mediaEl = mediaEls[i]; // Check if element exists, has getAttribute func. // IE seems to consider typeof el.getAttribute == 'object' instead of 'function' like expected, at least when loading the player immediately. if (mediaEl && mediaEl.getAttribute) { // Make sure this player hasn't already been set up. if (mediaEl['player'] === undefined) { var options = mediaEl.getAttribute('data-setup'); // Check if data-setup attr exists. // We only auto-setup if they've added the data-setup attr. if (options !== null) { // Create new video.js instance. var player = videojs(mediaEl); } } // If getAttribute isn't defined, we need to wait for the DOM. } else { autoSetupTimeout(1); break; } } // No videos were found, so keep looping unless page is finished loading. } else if (!_windowLoaded) { autoSetupTimeout(1); } }; // Pause to let the DOM keep processing var autoSetupTimeout = function autoSetupTimeout(wait, vjs) { videojs = vjs; setTimeout(autoSetup, wait); }; if (_globalDocument2['default'].readyState === 'complete') { _windowLoaded = true; } else { Events.one(_globalWindow2['default'], 'load', function () { _windowLoaded = true; }); } var hasLoaded = function hasLoaded() { return _windowLoaded; }; exports.autoSetup = autoSetup; exports.autoSetupTimeout = autoSetupTimeout; exports.hasLoaded = hasLoaded; },{"./utils/events.js":108,"global/document":1,"global/window":2}],91:[function(_dereq_,module,exports){ /** * @file slider.js */ 'use strict'; exports.__esModule = true; function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj['default'] = obj; return newObj; } } function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError('Cannot call a class as a function'); } } function _inherits(subClass, superClass) { if (typeof superClass !== 'function' && superClass !== null) { throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } var _componentJs = _dereq_('../component.js'); var _componentJs2 = _interopRequireDefault(_componentJs); var _utilsDomJs = _dereq_('../utils/dom.js'); var Dom = _interopRequireWildcard(_utilsDomJs); var _globalDocument = _dereq_('global/document'); var _globalDocument2 = _interopRequireDefault(_globalDocument); var _objectAssign = _dereq_('object.assign'); var _objectAssign2 = _interopRequireDefault(_objectAssign); /** * The base functionality for sliders like the volume bar and seek bar * * @param {Player|Object} player * @param {Object=} options * @extends Component * @class Slider */ var Slider = (function (_Component) { _inherits(Slider, _Component); function Slider(player, options) { _classCallCheck(this, Slider); _Component.call(this, player, options); // Set property names to bar to match with the child Slider class is looking for this.bar = this.getChild(this.options_.barName); // Set a horizontal or vertical class on the slider depending on the slider type this.vertical(!!this.options_.vertical); this.on('mousedown', this.handleMouseDown); this.on('touchstart', this.handleMouseDown); this.on('focus', this.handleFocus); this.on('blur', this.handleBlur); this.on('click', this.handleClick); this.on(player, 'controlsvisible', this.update); this.on(player, this.playerEvent, this.update); } /** * Create the component's DOM element * * @param {String} type Type of element to create * @param {Object=} props List of properties in Object form * @return {Element} * @method createEl */ Slider.prototype.createEl = function createEl(type) { var props = arguments.length <= 1 || arguments[1] === undefined ? {} : arguments[1]; // Add the slider element class to all sub classes props.className = props.className + ' vjs-slider'; props = _objectAssign2['default']({ 'role': 'slider', 'aria-valuenow': 0, 'aria-valuemin': 0, 'aria-valuemax': 100, tabIndex: 0 }, props); return _Component.prototype.createEl.call(this, type, props); }; /** * Handle mouse down on slider * * @param {Object} event Mouse down event object * @method handleMouseDown */ Slider.prototype.handleMouseDown = function handleMouseDown(event) { event.preventDefault(); Dom.blockTextSelection(); this.addClass('vjs-sliding'); this.trigger('slideractive'); this.on(_globalDocument2['default'], 'mousemove', this.handleMouseMove); this.on(_globalDocument2['default'], 'mouseup', this.handleMouseUp); this.on(_globalDocument2['default'], 'touchmove', this.handleMouseMove); this.on(_globalDocument2['default'], 'touchend', this.handleMouseUp); this.handleMouseMove(event); }; /** * To be overridden by a subclass * * @method handleMouseMove */ Slider.prototype.handleMouseMove = function handleMouseMove() {}; /** * Handle mouse up on Slider * * @method handleMouseUp */ Slider.prototype.handleMouseUp = function handleMouseUp() { Dom.unblockTextSelection(); this.removeClass('vjs-sliding'); this.trigger('sliderinactive'); this.off(_globalDocument2['default'], 'mousemove', this.handleMouseMove); this.off(_globalDocument2['default'], 'mouseup', this.handleMouseUp); this.off(_globalDocument2['default'], 'touchmove', this.handleMouseMove); this.off(_globalDocument2['default'], 'touchend', this.handleMouseUp); this.update(); }; /** * Update slider * * @method update */ Slider.prototype.update = function update() { // In VolumeBar init we have a setTimeout for update that pops and update to the end of the // execution stack. The player is destroyed before then update will cause an error if (!this.el_) return; // If scrubbing, we could use a cached value to make the handle keep up with the user's mouse. // On HTML5 browsers scrubbing is really smooth, but some flash players are slow, so we might want to utilize this later. // var progress = (this.player_.scrubbing()) ? this.player_.getCache().currentTime / this.player_.duration() : this.player_.currentTime() / this.player_.duration(); var progress = this.getPercent(); var bar = this.bar; // If there's no bar... if (!bar) return; // Protect against no duration and other division issues if (typeof progress !== 'number' || progress !== progress || progress < 0 || progress === Infinity) { progress = 0; } // Convert to a percentage for setting var percentage = (progress * 100).toFixed(2) + '%'; // Set the new bar width or height if (this.vertical()) { bar.el().style.height = percentage; } else { bar.el().style.width = percentage; } }; /** * Calculate distance for slider * * @param {Object} event Event object * @method calculateDistance */ Slider.prototype.calculateDistance = function calculateDistance(event) { var el = this.el_; var box = Dom.findElPosition(el); var boxW = el.offsetWidth; var boxH = el.offsetHeight; if (this.vertical()) { var boxY = box.top; var pageY = undefined; if (event.changedTouches) { pageY = event.changedTouches[0].pageY; } else { pageY = event.pageY; } // Percent that the click is through the adjusted area return Math.max(0, Math.min(1, (boxY - pageY + boxH) / boxH)); } else { var boxX = box.left; var pageX = undefined; if (event.changedTouches) { pageX = event.changedTouches[0].pageX; } else { pageX = event.pageX; } // Percent that the click is through the adjusted area return Math.max(0, Math.min(1, (pageX - boxX) / boxW)); } }; /** * Handle on focus for slider * * @method handleFocus */ Slider.prototype.handleFocus = function handleFocus() { this.on(_globalDocument2['default'], 'keydown', this.handleKeyPress); }; /** * Handle key press for slider * * @param {Object} event Event object * @method handleKeyPress */ Slider.prototype.handleKeyPress = function handleKeyPress(event) { if (event.which === 37 || event.which === 40) { // Left and Down Arrows event.preventDefault(); this.stepBack(); } else if (event.which === 38 || event.which === 39) { // Up and Right Arrows event.preventDefault(); this.stepForward(); } }; /** * Handle on blur for slider * * @method handleBlur */ Slider.prototype.handleBlur = function handleBlur() { this.off(_globalDocument2['default'], 'keydown', this.handleKeyPress); }; /** * Listener for click events on slider, used to prevent clicks * from bubbling up to parent elements like button menus. * * @param {Object} event Event object * @method handleClick */ Slider.prototype.handleClick = function handleClick(event) { event.stopImmediatePropagation(); event.preventDefault(); }; /** * Get/set if slider is horizontal for vertical * * @param {Boolean} bool True if slider is vertical, false is horizontal * @return {Boolean} True if slider is vertical, false is horizontal * @method vertical */ Slider.prototype.vertical = function vertical(bool) { if (bool === undefined) { return this.vertical_ || false; } this.vertical_ = !!bool; if (this.vertical_) { this.addClass('vjs-slider-vertical'); } else { this.addClass('vjs-slider-horizontal'); } return this; }; return Slider; })(_componentJs2['default']); _componentJs2['default'].registerComponent('Slider', Slider); exports['default'] = Slider; module.exports = exports['default']; },{"../component.js":48,"../utils/dom.js":107,"global/document":1,"object.assign":40}],92:[function(_dereq_,module,exports){ /** * @file flash-rtmp.js */ 'use strict'; exports.__esModule = true; function FlashRtmpDecorator(Flash) { Flash.streamingFormats = { 'rtmp/mp4': 'MP4', 'rtmp/flv': 'FLV' }; Flash.streamFromParts = function (connection, stream) { return connection + '&' + stream; }; Flash.streamToParts = function (src) { var parts = { connection: '', stream: '' }; if (!src) return parts; // Look for the normal URL separator we expect, '&'. // If found, we split the URL into two pieces around the // first '&'. var connEnd = src.indexOf('&'); var streamBegin = undefined; if (connEnd !== -1) { streamBegin = connEnd + 1; } else { // If there's not a '&', we use the last '/' as the delimiter. connEnd = streamBegin = src.lastIndexOf('/') + 1; if (connEnd === 0) { // really, there's not a '/'? connEnd = streamBegin = src.length; } } parts.connection = src.substring(0, connEnd); parts.stream = src.substring(streamBegin, src.length); return parts; }; Flash.isStreamingType = function (srcType) { return srcType in Flash.streamingFormats; }; // RTMP has four variations, any string starting // with one of these protocols should be valid Flash.RTMP_RE = /^rtmp[set]?:\/\//i; Flash.isStreamingSrc = function (src) { return Flash.RTMP_RE.test(src); }; /** * A source handler for RTMP urls * @type {Object} */ Flash.rtmpSourceHandler = {}; /** * Check Flash can handle the source natively * @param {Object} source The source object * @return {String} 'probably', 'maybe', or '' (empty string) */ Flash.rtmpSourceHandler.canHandleSource = function (source) { if (Flash.isStreamingType(source.type) || Flash.isStreamingSrc(source.src)) { return 'maybe'; } return ''; }; /** * Pass the source to the flash object * Adaptive source handlers will have more complicated workflows before passing * video data to the video element * @param {Object} source The source object * @param {Flash} tech The instance of the Flash tech */ Flash.rtmpSourceHandler.handleSource = function (source, tech) { var srcParts = Flash.streamToParts(source.src); tech['setRtmpConnection'](srcParts.connection); tech['setRtmpStream'](srcParts.stream); }; // Register the native source handler Flash.registerSourceHandler(Flash.rtmpSourceHandler); return Flash; } exports['default'] = FlashRtmpDecorator; module.exports = exports['default']; },{}],93:[function(_dereq_,module,exports){ /** * @file flash.js * VideoJS-SWF - Custom Flash Player with HTML5-ish API * https://github.com/zencoder/video-js-swf * Not using setupTriggers. Using global onEvent func to distribute events */ 'use strict'; exports.__esModule = true; function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj['default'] = obj; return newObj; } } function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError('Cannot call a class as a function'); } } function _inherits(subClass, superClass) { if (typeof superClass !== 'function' && superClass !== null) { throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } var _tech = _dereq_('./tech'); var _tech2 = _interopRequireDefault(_tech); var _utilsDomJs = _dereq_('../utils/dom.js'); var Dom = _interopRequireWildcard(_utilsDomJs); var _utilsUrlJs = _dereq_('../utils/url.js'); var Url = _interopRequireWildcard(_utilsUrlJs); var _utilsTimeRangesJs = _dereq_('../utils/time-ranges.js'); var _flashRtmp = _dereq_('./flash-rtmp'); var _flashRtmp2 = _interopRequireDefault(_flashRtmp); var _component = _dereq_('../component'); var _component2 = _interopRequireDefault(_component); var _globalWindow = _dereq_('global/window'); var _globalWindow2 = _interopRequireDefault(_globalWindow); var _objectAssign = _dereq_('object.assign'); var _objectAssign2 = _interopRequireDefault(_objectAssign); var navigator = _globalWindow2['default'].navigator; /** * Flash Media Controller - Wrapper for fallback SWF API * * @param {Object=} options Object of option names and values * @param {Function=} ready Ready callback function * @extends Tech * @class Flash */ var Flash = (function (_Tech) { _inherits(Flash, _Tech); function Flash(options, ready) { _classCallCheck(this, Flash); _Tech.call(this, options, ready); // Set the source when ready if (options.source) { this.ready(function () { this.setSource(options.source); }, true); } // Having issues with Flash reloading on certain page actions (hide/resize/fullscreen) in certain browsers // This allows resetting the playhead when we catch the reload if (options.startTime) { this.ready(function () { this.load(); this.play(); this.currentTime(options.startTime); }, true); } // Add global window functions that the swf expects // A 4.x workflow we weren't able to solve for in 5.0 // because of the need to hard code these functions // into the swf for security reasons _globalWindow2['default'].videojs = _globalWindow2['default'].videojs || {}; _globalWindow2['default'].videojs.Flash = _globalWindow2['default'].videojs.Flash || {}; _globalWindow2['default'].videojs.Flash.onReady = Flash.onReady; _globalWindow2['default'].videojs.Flash.onEvent = Flash.onEvent; _globalWindow2['default'].videojs.Flash.onError = Flash.onError; this.on('seeked', function () { this.lastSeekTarget_ = undefined; }); } // Create setters and getters for attributes /** * Create the component's DOM element * * @return {Element} * @method createEl */ Flash.prototype.createEl = function createEl() { var options = this.options_; // If video.js is hosted locally you should also set the location // for the hosted swf, which should be relative to the page (not video.js) // Otherwise this adds a CDN url. // The CDN also auto-adds a swf URL for that specific version. if (!options.swf) { options.swf = '//vjs.zencdn.net/swf/5.0.0-rc1/video-js.swf'; } // Generate ID for swf object var objId = options.techId; // Merge default flashvars with ones passed in to init var flashVars = _objectAssign2['default']({ // SWF Callback Functions 'readyFunction': 'videojs.Flash.onReady', 'eventProxyFunction': 'videojs.Flash.onEvent', 'errorEventProxyFunction': 'videojs.Flash.onError', // Player Settings 'autoplay': options.autoplay, 'preload': options.preload, 'loop': options.loop, 'muted': options.muted }, options.flashVars); // Merge default parames with ones passed in var params = _objectAssign2['default']({ 'wmode': 'opaque', // Opaque is needed to overlay controls, but can affect playback performance 'bgcolor': '#000000' // Using bgcolor prevents a white flash when the object is loading }, options.params); // Merge default attributes with ones passed in var attributes = _objectAssign2['default']({ 'id': objId, 'name': objId, // Both ID and Name needed or swf to identify itself 'class': 'vjs-tech' }, options.attributes); this.el_ = Flash.embed(options.swf, flashVars, params, attributes); this.el_.tech = this; return this.el_; }; /** * Play for flash tech * * @method play */ Flash.prototype.play = function play() { if (this.ended()) { this.setCurrentTime(0); } this.el_.vjs_play(); }; /** * Pause for flash tech * * @method pause */ Flash.prototype.pause = function pause() { this.el_.vjs_pause(); }; /** * Get/set video * * @param {Object=} src Source object * @return {Object} * @method src */ Flash.prototype.src = function src(_src) { if (_src === undefined) { return this.currentSrc(); } // Setting src through `src` not `setSrc` will be deprecated return this.setSrc(_src); }; /** * Set video * * @param {Object=} src Source object * @deprecated * @method setSrc */ Flash.prototype.setSrc = function setSrc(src) { // Make sure source URL is absolute. src = Url.getAbsoluteURL(src); this.el_.vjs_src(src); // Currently the SWF doesn't autoplay if you load a source later. // e.g. Load player w/ no source, wait 2s, set src. if (this.autoplay()) { var tech = this; this.setTimeout(function () { tech.play(); }, 0); } }; /** * Returns true if the tech is currently seeking. * @return {boolean} true if seeking */ Flash.prototype.seeking = function seeking() { return this.lastSeekTarget_ !== undefined; }; /** * Set current time * * @param {Number} time Current time of video * @method setCurrentTime */ Flash.prototype.setCurrentTime = function setCurrentTime(time) { var seekable = this.seekable(); if (seekable.length) { // clamp to the current seekable range time = time > seekable.start(0) ? time : seekable.start(0); time = time < seekable.end(seekable.length - 1) ? time : seekable.end(seekable.length - 1); this.lastSeekTarget_ = time; this.trigger('seeking'); this.el_.vjs_setProperty('currentTime', time); _Tech.prototype.setCurrentTime.call(this); } }; /** * Get current time * * @param {Number=} time Current time of video * @return {Number} Current time * @method currentTime */ Flash.prototype.currentTime = function currentTime(time) { // when seeking make the reported time keep up with the requested time // by reading the time we're seeking to if (this.seeking()) { return this.lastSeekTarget_ || 0; } return this.el_.vjs_getProperty('currentTime'); }; /** * Get current source * * @method currentSrc */ Flash.prototype.currentSrc = function currentSrc() { if (this.currentSource_) { return this.currentSource_.src; } else { return this.el_.vjs_getProperty('currentSrc'); } }; /** * Load media into player * * @method load */ Flash.prototype.load = function load() { this.el_.vjs_load(); }; /** * Get poster * * @method poster */ Flash.prototype.poster = function poster() { this.el_.vjs_getProperty('poster'); }; /** * Poster images are not handled by the Flash tech so make this a no-op * * @method setPoster */ Flash.prototype.setPoster = function setPoster() {}; /** * Determine if can seek in media * * @return {TimeRangeObject} * @method seekable */ Flash.prototype.seekable = function seekable() { var duration = this.duration(); if (duration === 0) { return _utilsTimeRangesJs.createTimeRange(); } return _utilsTimeRangesJs.createTimeRange(0, duration); }; /** * Get buffered time range * * @return {TimeRangeObject} * @method buffered */ Flash.prototype.buffered = function buffered() { var ranges = this.el_.vjs_getProperty('buffered'); if (ranges.length === 0) { return _utilsTimeRangesJs.createTimeRange(); } return _utilsTimeRangesJs.createTimeRange(ranges[0][0], ranges[0][1]); }; /** * Get fullscreen support - * Flash does not allow fullscreen through javascript * so always returns false * * @return {Boolean} false * @method supportsFullScreen */ Flash.prototype.supportsFullScreen = function supportsFullScreen() { return false; // Flash does not allow fullscreen through javascript }; /** * Request to enter fullscreen * Flash does not allow fullscreen through javascript * so always returns false * * @return {Boolean} false * @method enterFullScreen */ Flash.prototype.enterFullScreen = function enterFullScreen() { return false; }; return Flash; })(_tech2['default']); var _api = Flash.prototype; var _readWrite = 'rtmpConnection,rtmpStream,preload,defaultPlaybackRate,playbackRate,autoplay,loop,mediaGroup,controller,controls,volume,muted,defaultMuted'.split(','); var _readOnly = 'networkState,readyState,initialTime,duration,startOffsetTime,paused,ended,videoTracks,audioTracks,videoWidth,videoHeight'.split(','); function _createSetter(attr) { var attrUpper = attr.charAt(0).toUpperCase() + attr.slice(1); _api['set' + attrUpper] = function (val) { return this.el_.vjs_setProperty(attr, val); }; } function _createGetter(attr) { _api[attr] = function () { return this.el_.vjs_getProperty(attr); }; } // Create getter and setters for all read/write attributes for (var i = 0; i < _readWrite.length; i++) { _createGetter(_readWrite[i]); _createSetter(_readWrite[i]); } // Create getters for read-only attributes for (var i = 0; i < _readOnly.length; i++) { _createGetter(_readOnly[i]); } /* Flash Support Testing -------------------------------------------------------- */ Flash.isSupported = function () { return Flash.version()[0] >= 10; // return swfobject.hasFlashPlayerVersion('10'); }; // Add Source Handler pattern functions to this tech _tech2['default'].withSourceHandlers(Flash); /* * The default native source handler. * This simply passes the source to the video element. Nothing fancy. * * @param {Object} source The source object * @param {Flash} tech The instance of the Flash tech */ Flash.nativeSourceHandler = {}; /* * Check Flash can handle the source natively * * @param {Object} source The source object * @return {String} 'probably', 'maybe', or '' (empty string) */ Flash.nativeSourceHandler.canHandleSource = function (source) { var type; function guessMimeType(src) { var ext = Url.getFileExtension(src); if (ext) { return 'video/' + ext; } return ''; } if (!source.type) { type = guessMimeType(source.src); } else { // Strip code information from the type because we don't get that specific type = source.type.replace(/;.*/, '').toLowerCase(); } if (type in Flash.formats) { return 'maybe'; } return ''; }; /* * Pass the source to the flash object * Adaptive source handlers will have more complicated workflows before passing * video data to the video element * * @param {Object} source The source object * @param {Flash} tech The instance of the Flash tech */ Flash.nativeSourceHandler.handleSource = function (source, tech) { tech.setSrc(source.src); }; /* * Clean up the source handler when disposing the player or switching sources.. * (no cleanup is needed when supporting the format natively) */ Flash.nativeSourceHandler.dispose = function () {}; // Register the native source handler Flash.registerSourceHandler(Flash.nativeSourceHandler); Flash.formats = { 'video/flv': 'FLV', 'video/x-flv': 'FLV', 'video/mp4': 'MP4', 'video/m4v': 'MP4' }; Flash.onReady = function (currSwf) { var el = Dom.getEl(currSwf); var tech = el && el.tech; // if there is no el then the tech has been disposed // and the tech element was removed from the player div if (tech && tech.el()) { // check that the flash object is really ready Flash.checkReady(tech); } }; // The SWF isn't always ready when it says it is. Sometimes the API functions still need to be added to the object. // If it's not ready, we set a timeout to check again shortly. Flash.checkReady = function (tech) { // stop worrying if the tech has been disposed if (!tech.el()) { return; } // check if API property exists if (tech.el().vjs_getProperty) { // tell tech it's ready tech.triggerReady(); } else { // wait longer this.setTimeout(function () { Flash['checkReady'](tech); }, 50); } }; // Trigger events from the swf on the player Flash.onEvent = function (swfID, eventName) { var tech = Dom.getEl(swfID).tech; tech.trigger(eventName); }; // Log errors from the swf Flash.onError = function (swfID, err) { var tech = Dom.getEl(swfID).tech; // trigger MEDIA_ERR_SRC_NOT_SUPPORTED if (err === 'srcnotfound') { return tech.error(4); } // trigger a custom error tech.error('FLASH: ' + err); }; // Flash Version Check Flash.version = function () { var version = '0,0,0'; // IE try { version = new _globalWindow2['default'].ActiveXObject('ShockwaveFlash.ShockwaveFlash').GetVariable('$version').replace(/\D+/g, ',').match(/^,?(.+),?$/)[1]; // other browsers } catch (e) { try { if (navigator.mimeTypes['application/x-shockwave-flash'].enabledPlugin) { version = (navigator.plugins['Shockwave Flash 2.0'] || navigator.plugins['Shockwave Flash']).description.replace(/\D+/g, ',').match(/^,?(.+),?$/)[1]; } } catch (err) {} } return version.split(','); }; // Flash embedding method. Only used in non-iframe mode Flash.embed = function (swf, flashVars, params, attributes) { var code = Flash.getEmbedCode(swf, flashVars, params, attributes); // Get element by embedding code and retrieving created element var obj = Dom.createEl('div', { innerHTML: code }).childNodes[0]; return obj; }; Flash.getEmbedCode = function (swf, flashVars, params, attributes) { var objTag = '<object type="application/x-shockwave-flash" '; var flashVarsString = ''; var paramsString = ''; var attrsString = ''; // Convert flash vars to string if (flashVars) { Object.getOwnPropertyNames(flashVars).forEach(function (key) { flashVarsString += key + '=' + flashVars[key] + '&amp;'; }); } // Add swf, flashVars, and other default params params = _objectAssign2['default']({ 'movie': swf, 'flashvars': flashVarsString, 'allowScriptAccess': 'always', // Required to talk to swf 'allowNetworking': 'all' // All should be default, but having security issues. }, params); // Create param tags string Object.getOwnPropertyNames(params).forEach(function (key) { paramsString += '<param name="' + key + '" value="' + params[key] + '" />'; }); attributes = _objectAssign2['default']({ // Add swf to attributes (need both for IE and Others to work) 'data': swf, // Default to 100% width/height 'width': '100%', 'height': '100%' }, attributes); // Create Attributes string Object.getOwnPropertyNames(attributes).forEach(function (key) { attrsString += key + '="' + attributes[key] + '" '; }); return '' + objTag + attrsString + '>' + paramsString + '</object>'; }; // Run Flash through the RTMP decorator _flashRtmp2['default'](Flash); _component2['default'].registerComponent('Flash', Flash); exports['default'] = Flash; module.exports = exports['default']; },{"../component":48,"../utils/dom.js":107,"../utils/time-ranges.js":115,"../utils/url.js":117,"./flash-rtmp":92,"./tech":96,"global/window":2,"object.assign":40}],94:[function(_dereq_,module,exports){ /** * @file html5.js * HTML5 Media Controller - Wrapper for HTML5 Media API */ 'use strict'; exports.__esModule = true; function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj['default'] = obj; return newObj; } } function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError('Cannot call a class as a function'); } } function _inherits(subClass, superClass) { if (typeof superClass !== 'function' && superClass !== null) { throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } var _techJs = _dereq_('./tech.js'); var _techJs2 = _interopRequireDefault(_techJs); var _component = _dereq_('../component'); var _component2 = _interopRequireDefault(_component); var _utilsDomJs = _dereq_('../utils/dom.js'); var Dom = _interopRequireWildcard(_utilsDomJs); var _utilsUrlJs = _dereq_('../utils/url.js'); var Url = _interopRequireWildcard(_utilsUrlJs); var _utilsFnJs = _dereq_('../utils/fn.js'); var Fn = _interopRequireWildcard(_utilsFnJs); var _utilsLogJs = _dereq_('../utils/log.js'); var _utilsLogJs2 = _interopRequireDefault(_utilsLogJs); var _utilsBrowserJs = _dereq_('../utils/browser.js'); var browser = _interopRequireWildcard(_utilsBrowserJs); var _globalDocument = _dereq_('global/document'); var _globalDocument2 = _interopRequireDefault(_globalDocument); var _globalWindow = _dereq_('global/window'); var _globalWindow2 = _interopRequireDefault(_globalWindow); var _objectAssign = _dereq_('object.assign'); var _objectAssign2 = _interopRequireDefault(_objectAssign); var _utilsMergeOptionsJs = _dereq_('../utils/merge-options.js'); var _utilsMergeOptionsJs2 = _interopRequireDefault(_utilsMergeOptionsJs); /** * HTML5 Media Controller - Wrapper for HTML5 Media API * * @param {Object=} options Object of option names and values * @param {Function=} ready Ready callback function * @extends Tech * @class Html5 */ var Html5 = (function (_Tech) { _inherits(Html5, _Tech); function Html5(options, ready) { _classCallCheck(this, Html5); _Tech.call(this, options, ready); var source = options.source; // Set the source if one is provided // 1) Check if the source is new (if not, we want to keep the original so playback isn't interrupted) // 2) Check to see if the network state of the tag was failed at init, and if so, reset the source // anyway so the error gets fired. if (source && (this.el_.currentSrc !== source.src || options.tag && options.tag.initNetworkState_ === 3)) { this.setSource(source); } if (this.el_.hasChildNodes()) { var nodes = this.el_.childNodes; var nodesLength = nodes.length; var removeNodes = []; while (nodesLength--) { var node = nodes[nodesLength]; var nodeName = node.nodeName.toLowerCase(); if (nodeName === 'track') { if (!this.featuresNativeTextTracks) { // Empty video tag tracks so the built-in player doesn't use them also. // This may not be fast enough to stop HTML5 browsers from reading the tags // so we'll need to turn off any default tracks if we're manually doing // captions and subtitles. videoElement.textTracks removeNodes.push(node); } else { this.remoteTextTracks().addTrack_(node.track); } } } for (var i = 0; i < removeNodes.length; i++) { this.el_.removeChild(removeNodes[i]); } } if (this.featuresNativeTextTracks) { this.handleTextTrackChange_ = Fn.bind(this, this.handleTextTrackChange); this.handleTextTrackAdd_ = Fn.bind(this, this.handleTextTrackAdd); this.handleTextTrackRemove_ = Fn.bind(this, this.handleTextTrackRemove); this.proxyNativeTextTracks_(); } // Determine if native controls should be used // Our goal should be to get the custom controls on mobile solid everywhere // so we can remove this all together. Right now this will block custom // controls on touch enabled laptops like the Chrome Pixel if (browser.TOUCH_ENABLED && options.nativeControlsForTouch === true || browser.IS_IPHONE || browser.IS_NATIVE_ANDROID) { this.setControls(true); } this.triggerReady(); } /* HTML5 Support Testing ---------------------------------------------------- */ /* * Element for testing browser HTML5 video capabilities * * @type {Element} * @constant * @private */ /** * Dispose of html5 media element * * @method dispose */ Html5.prototype.dispose = function dispose() { var tt = this.el().textTracks; var emulatedTt = this.textTracks(); // remove native event listeners if (tt && tt.removeEventListener) { tt.removeEventListener('change', this.handleTextTrackChange_); tt.removeEventListener('addtrack', this.handleTextTrackAdd_); tt.removeEventListener('removetrack', this.handleTextTrackRemove_); } // clearout the emulated text track list. var i = emulatedTt.length; while (i--) { emulatedTt.removeTrack_(emulatedTt[i]); } Html5.disposeMediaElement(this.el_); _Tech.prototype.dispose.call(this); }; /** * Create the component's DOM element * * @return {Element} * @method createEl */ Html5.prototype.createEl = function createEl() { var el = this.options_.tag; // Check if this browser supports moving the element into the box. // On the iPhone video will break if you move the element, // So we have to create a brand new element. if (!el || this['movingMediaElementInDOM'] === false) { // If the original tag is still there, clone and remove it. if (el) { var clone = el.cloneNode(true); el.parentNode.insertBefore(clone, el); Html5.disposeMediaElement(el); el = clone; } else { el = _globalDocument2['default'].createElement('video'); // determine if native controls should be used var tagAttributes = this.options_.tag && Dom.getElAttributes(this.options_.tag); var attributes = _utilsMergeOptionsJs2['default']({}, tagAttributes); if (!browser.TOUCH_ENABLED || this.options_.nativeControlsForTouch !== true) { delete attributes.controls; } Dom.setElAttributes(el, _objectAssign2['default'](attributes, { id: this.options_.techId, 'class': 'vjs-tech' })); } } // Update specific tag settings, in case they were overridden var settingsAttrs = ['autoplay', 'preload', 'loop', 'muted']; for (var i = settingsAttrs.length - 1; i >= 0; i--) { var attr = settingsAttrs[i]; var overwriteAttrs = {}; if (typeof this.options_[attr] !== 'undefined') { overwriteAttrs[attr] = this.options_[attr]; } Dom.setElAttributes(el, overwriteAttrs); } return el; // jenniisawesome = true; }; Html5.prototype.proxyNativeTextTracks_ = function proxyNativeTextTracks_() { var tt = this.el().textTracks; if (tt && tt.addEventListener) { tt.addEventListener('change', this.handleTextTrackChange_); tt.addEventListener('addtrack', this.handleTextTrackAdd_); tt.addEventListener('removetrack', this.handleTextTrackRemove_); } }; Html5.prototype.handleTextTrackChange = function handleTextTrackChange(e) { var tt = this.textTracks(); this.textTracks().trigger({ type: 'change', target: tt, currentTarget: tt, srcElement: tt }); }; Html5.prototype.handleTextTrackAdd = function handleTextTrackAdd(e) { this.textTracks().addTrack_(e.track); }; Html5.prototype.handleTextTrackRemove = function handleTextTrackRemove(e) { this.textTracks().removeTrack_(e.track); }; /** * Play for html5 tech * * @method play */ Html5.prototype.play = function play() { this.el_.play(); }; /** * Pause for html5 tech * * @method pause */ Html5.prototype.pause = function pause() { this.el_.pause(); }; /** * Paused for html5 tech * * @return {Boolean} * @method paused */ Html5.prototype.paused = function paused() { return this.el_.paused; }; /** * Get current time * * @return {Number} * @method currentTime */ Html5.prototype.currentTime = function currentTime() { return this.el_.currentTime; }; /** * Set current time * * @param {Number} seconds Current time of video * @method setCurrentTime */ Html5.prototype.setCurrentTime = function setCurrentTime(seconds) { try { this.el_.currentTime = seconds; } catch (e) { _utilsLogJs2['default'](e, 'Video is not ready. (Video.js)'); // this.warning(VideoJS.warnings.videoNotReady); } }; /** * Get duration * * @return {Number} * @method duration */ Html5.prototype.duration = function duration() { return this.el_.duration || 0; }; /** * Get a TimeRange object that represents the intersection * of the time ranges for which the user agent has all * relevant media * * @return {TimeRangeObject} * @method buffered */ Html5.prototype.buffered = function buffered() { return this.el_.buffered; }; /** * Get volume level * * @return {Number} * @method volume */ Html5.prototype.volume = function volume() { return this.el_.volume; }; /** * Set volume level * * @param {Number} percentAsDecimal Volume percent as a decimal * @method setVolume */ Html5.prototype.setVolume = function setVolume(percentAsDecimal) { this.el_.volume = percentAsDecimal; }; /** * Get if muted * * @return {Boolean} * @method muted */ Html5.prototype.muted = function muted() { return this.el_.muted; }; /** * Set muted * * @param {Boolean} If player is to be muted or note * @method setMuted */ Html5.prototype.setMuted = function setMuted(muted) { this.el_.muted = muted; }; /** * Get player width * * @return {Number} * @method width */ Html5.prototype.width = function width() { return this.el_.offsetWidth; }; /** * Get player height * * @return {Number} * @method height */ Html5.prototype.height = function height() { return this.el_.offsetHeight; }; /** * Get if there is fullscreen support * * @return {Boolean} * @method supportsFullScreen */ Html5.prototype.supportsFullScreen = function supportsFullScreen() { if (typeof this.el_.webkitEnterFullScreen === 'function') { var userAgent = _globalWindow2['default'].navigator.userAgent; // Seems to be broken in Chromium/Chrome && Safari in Leopard if (/Android/.test(userAgent) || !/Chrome|Mac OS X 10.5/.test(userAgent)) { return true; } } return false; }; /** * Request to enter fullscreen * * @method enterFullScreen */ Html5.prototype.enterFullScreen = function enterFullScreen() { var video = this.el_; if ('webkitDisplayingFullscreen' in video) { this.one('webkitbeginfullscreen', function () { this.one('webkitendfullscreen', function () { this.trigger('fullscreenchange', { isFullscreen: false }); }); this.trigger('fullscreenchange', { isFullscreen: true }); }); } if (video.paused && video.networkState <= video.HAVE_METADATA) { // attempt to prime the video element for programmatic access // this isn't necessary on the desktop but shouldn't hurt this.el_.play(); // playing and pausing synchronously during the transition to fullscreen // can get iOS ~6.1 devices into a play/pause loop this.setTimeout(function () { video.pause(); video.webkitEnterFullScreen(); }, 0); } else { video.webkitEnterFullScreen(); } }; /** * Request to exit fullscreen * * @method exitFullScreen */ Html5.prototype.exitFullScreen = function exitFullScreen() { this.el_.webkitExitFullScreen(); }; /** * Get/set video * * @param {Object=} src Source object * @return {Object} * @method src */ Html5.prototype.src = function src(_src) { if (_src === undefined) { return this.el_.src; } else { // Setting src through `src` instead of `setSrc` will be deprecated this.setSrc(_src); } }; /** * Set video * * @param {Object} src Source object * @deprecated * @method setSrc */ Html5.prototype.setSrc = function setSrc(src) { this.el_.src = src; }; /** * Load media into player * * @method load */ Html5.prototype.load = function load() { this.el_.load(); }; /** * Get current source * * @return {Object} * @method currentSrc */ Html5.prototype.currentSrc = function currentSrc() { return this.el_.currentSrc; }; /** * Get poster * * @return {String} * @method poster */ Html5.prototype.poster = function poster() { return this.el_.poster; }; /** * Set poster * * @param {String} val URL to poster image * @method */ Html5.prototype.setPoster = function setPoster(val) { this.el_.poster = val; }; /** * Get preload attribute * * @return {String} * @method preload */ Html5.prototype.preload = function preload() { return this.el_.preload; }; /** * Set preload attribute * * @param {String} val Value for preload attribute * @method setPreload */ Html5.prototype.setPreload = function setPreload(val) { this.el_.preload = val; }; /** * Get autoplay attribute * * @return {String} * @method autoplay */ Html5.prototype.autoplay = function autoplay() { return this.el_.autoplay; }; /** * Set autoplay attribute * * @param {String} val Value for preload attribute * @method setAutoplay */ Html5.prototype.setAutoplay = function setAutoplay(val) { this.el_.autoplay = val; }; /** * Get controls attribute * * @return {String} * @method controls */ Html5.prototype.controls = function controls() { return this.el_.controls; }; /** * Set controls attribute * * @param {String} val Value for controls attribute * @method setControls */ Html5.prototype.setControls = function setControls(val) { this.el_.controls = !!val; }; /** * Get loop attribute * * @return {String} * @method loop */ Html5.prototype.loop = function loop() { return this.el_.loop; }; /** * Set loop attribute * * @param {String} val Value for loop attribute * @method setLoop */ Html5.prototype.setLoop = function setLoop(val) { this.el_.loop = val; }; /** * Get error value * * @return {String} * @method error */ Html5.prototype.error = function error() { return this.el_.error; }; /** * Get whether or not the player is in the "seeking" state * * @return {Boolean} * @method seeking */ Html5.prototype.seeking = function seeking() { return this.el_.seeking; }; /** * Get a TimeRanges object that represents the * ranges of the media resource to which it is possible * for the user agent to seek. * * @return {TimeRangeObject} * @method seekable */ Html5.prototype.seekable = function seekable() { return this.el_.seekable; }; /** * Get if video ended * * @return {Boolean} * @method ended */ Html5.prototype.ended = function ended() { return this.el_.ended; }; /** * Get the value of the muted content attribute * This attribute has no dynamic effect, it only * controls the default state of the element * * @return {Boolean} * @method defaultMuted */ Html5.prototype.defaultMuted = function defaultMuted() { return this.el_.defaultMuted; }; /** * Get desired speed at which the media resource is to play * * @return {Number} * @method playbackRate */ Html5.prototype.playbackRate = function playbackRate() { return this.el_.playbackRate; }; /** * Returns a TimeRanges object that represents the ranges of the * media resource that the user agent has played. * @return {TimeRangeObject} the range of points on the media * timeline that has been reached through normal playback * @see https://html.spec.whatwg.org/multipage/embedded-content.html#dom-media-played */ Html5.prototype.played = function played() { return this.el_.played; }; /** * Set desired speed at which the media resource is to play * * @param {Number} val Speed at which the media resource is to play * @method setPlaybackRate */ Html5.prototype.setPlaybackRate = function setPlaybackRate(val) { this.el_.playbackRate = val; }; /** * Get the current state of network activity for the element, from * the list below * NETWORK_EMPTY (numeric value 0) * NETWORK_IDLE (numeric value 1) * NETWORK_LOADING (numeric value 2) * NETWORK_NO_SOURCE (numeric value 3) * * @return {Number} * @method networkState */ Html5.prototype.networkState = function networkState() { return this.el_.networkState; }; /** * Get a value that expresses the current state of the element * with respect to rendering the current playback position, from * the codes in the list below * HAVE_NOTHING (numeric value 0) * HAVE_METADATA (numeric value 1) * HAVE_CURRENT_DATA (numeric value 2) * HAVE_FUTURE_DATA (numeric value 3) * HAVE_ENOUGH_DATA (numeric value 4) * * @return {Number} * @method readyState */ Html5.prototype.readyState = function readyState() { return this.el_.readyState; }; /** * Get width of video * * @return {Number} * @method videoWidth */ Html5.prototype.videoWidth = function videoWidth() { return this.el_.videoWidth; }; /** * Get height of video * * @return {Number} * @method videoHeight */ Html5.prototype.videoHeight = function videoHeight() { return this.el_.videoHeight; }; /** * Get text tracks * * @return {TextTrackList} * @method textTracks */ Html5.prototype.textTracks = function textTracks() { return _Tech.prototype.textTracks.call(this); }; /** * Creates and returns a text track object * * @param {String} kind Text track kind (subtitles, captions, descriptions * chapters and metadata) * @param {String=} label Label to identify the text track * @param {String=} language Two letter language abbreviation * @return {TextTrackObject} * @method addTextTrack */ Html5.prototype.addTextTrack = function addTextTrack(kind, label, language) { if (!this['featuresNativeTextTracks']) { return _Tech.prototype.addTextTrack.call(this, kind, label, language); } return this.el_.addTextTrack(kind, label, language); }; /** * Creates and returns a remote text track object * * @param {Object} options The object should contain values for * kind, language, label and src (location of the WebVTT file) * @return {TextTrackObject} * @method addRemoteTextTrack */ Html5.prototype.addRemoteTextTrack = function addRemoteTextTrack() { var options = arguments.length <= 0 || arguments[0] === undefined ? {} : arguments[0]; if (!this['featuresNativeTextTracks']) { return _Tech.prototype.addRemoteTextTrack.call(this, options); } var track = _globalDocument2['default'].createElement('track'); if (options['kind']) { track['kind'] = options['kind']; } if (options['label']) { track['label'] = options['label']; } if (options['language'] || options['srclang']) { track['srclang'] = options['language'] || options['srclang']; } if (options['default']) { track['default'] = options['default']; } if (options['id']) { track['id'] = options['id']; } if (options['src']) { track['src'] = options['src']; } this.el().appendChild(track); this.remoteTextTracks().addTrack_(track.track); return track; }; /** * Remove remote text track from TextTrackList object * * @param {TextTrackObject} track Texttrack object to remove * @method removeRemoteTextTrack */ Html5.prototype.removeRemoteTextTrack = function removeRemoteTextTrack(track) { if (!this['featuresNativeTextTracks']) { return _Tech.prototype.removeRemoteTextTrack.call(this, track); } var tracks, i; this.remoteTextTracks().removeTrack_(track); tracks = this.el().querySelectorAll('track'); i = tracks.length; while (i--) { if (track === tracks[i] || track === tracks[i].track) { this.el().removeChild(tracks[i]); } } }; return Html5; })(_techJs2['default']); Html5.TEST_VID = _globalDocument2['default'].createElement('video'); var track = _globalDocument2['default'].createElement('track'); track.kind = 'captions'; track.srclang = 'en'; track.label = 'English'; Html5.TEST_VID.appendChild(track); /* * Check if HTML5 video is supported by this browser/device * * @return {Boolean} */ Html5.isSupported = function () { // IE9 with no Media Player is a LIAR! (#984) try { Html5.TEST_VID['volume'] = 0.5; } catch (e) { return false; } return !!Html5.TEST_VID.canPlayType; }; // Add Source Handler pattern functions to this tech _techJs2['default'].withSourceHandlers(Html5); /* * The default native source handler. * This simply passes the source to the video element. Nothing fancy. * * @param {Object} source The source object * @param {Html5} tech The instance of the HTML5 tech */ Html5.nativeSourceHandler = {}; /* * Check if the video element can handle the source natively * * @param {Object} source The source object * @return {String} 'probably', 'maybe', or '' (empty string) */ Html5.nativeSourceHandler.canHandleSource = function (source) { var match, ext; function canPlayType(type) { // IE9 on Windows 7 without MediaPlayer throws an error here // https://github.com/videojs/video.js/issues/519 try { return Html5.TEST_VID.canPlayType(type); } catch (e) { return ''; } } // If a type was provided we should rely on that if (source.type) { return canPlayType(source.type); } else if (source.src) { // If no type, fall back to checking 'video/[EXTENSION]' ext = Url.getFileExtension(source.src); return canPlayType('video/' + ext); } return ''; }; /* * Pass the source to the video element * Adaptive source handlers will have more complicated workflows before passing * video data to the video element * * @param {Object} source The source object * @param {Html5} tech The instance of the Html5 tech */ Html5.nativeSourceHandler.handleSource = function (source, tech) { tech.setSrc(source.src); }; /* * Clean up the source handler when disposing the player or switching sources.. * (no cleanup is needed when supporting the format natively) */ Html5.nativeSourceHandler.dispose = function () {}; // Register the native source handler Html5.registerSourceHandler(Html5.nativeSourceHandler); /* * Check if the volume can be changed in this browser/device. * Volume cannot be changed in a lot of mobile devices. * Specifically, it can't be changed from 1 on iOS. * * @return {Boolean} */ Html5.canControlVolume = function () { var volume = Html5.TEST_VID.volume; Html5.TEST_VID.volume = volume / 2 + 0.1; return volume !== Html5.TEST_VID.volume; }; /* * Check if playbackRate is supported in this browser/device. * * @return {Number} [description] */ Html5.canControlPlaybackRate = function () { var playbackRate = Html5.TEST_VID.playbackRate; Html5.TEST_VID.playbackRate = playbackRate / 2 + 0.1; return playbackRate !== Html5.TEST_VID.playbackRate; }; /* * Check to see if native text tracks are supported by this browser/device * * @return {Boolean} */ Html5.supportsNativeTextTracks = function () { var supportsTextTracks; // Figure out native text track support // If mode is a number, we cannot change it because it'll disappear from view. // Browsers with numeric modes include IE10 and older (<=2013) samsung android models. // Firefox isn't playing nice either with modifying the mode // TODO: Investigate firefox: https://github.com/videojs/video.js/issues/1862 supportsTextTracks = !!Html5.TEST_VID.textTracks; if (supportsTextTracks && Html5.TEST_VID.textTracks.length > 0) { supportsTextTracks = typeof Html5.TEST_VID.textTracks[0]['mode'] !== 'number'; } if (supportsTextTracks && browser.IS_FIREFOX) { supportsTextTracks = false; } if (supportsTextTracks && !('onremovetrack' in Html5.TEST_VID.textTracks)) { supportsTextTracks = false; } return supportsTextTracks; }; /** * An array of events available on the Html5 tech. * * @private * @type {Array} */ Html5.Events = ['loadstart', 'suspend', 'abort', 'error', 'emptied', 'stalled', 'loadedmetadata', 'loadeddata', 'canplay', 'canplaythrough', 'playing', 'waiting', 'seeking', 'seeked', 'ended', 'durationchange', 'timeupdate', 'progress', 'play', 'pause', 'ratechange', 'volumechange']; /* * Set the tech's volume control support status * * @type {Boolean} */ Html5.prototype['featuresVolumeControl'] = Html5.canControlVolume(); /* * Set the tech's playbackRate support status * * @type {Boolean} */ Html5.prototype['featuresPlaybackRate'] = Html5.canControlPlaybackRate(); /* * Set the tech's status on moving the video element. * In iOS, if you move a video element in the DOM, it breaks video playback. * * @type {Boolean} */ Html5.prototype['movingMediaElementInDOM'] = !browser.IS_IOS; /* * Set the the tech's fullscreen resize support status. * HTML video is able to automatically resize when going to fullscreen. * (No longer appears to be used. Can probably be removed.) */ Html5.prototype['featuresFullscreenResize'] = true; /* * Set the tech's progress event support status * (this disables the manual progress events of the Tech) */ Html5.prototype['featuresProgressEvents'] = true; /* * Sets the tech's status on native text track support * * @type {Boolean} */ Html5.prototype['featuresNativeTextTracks'] = Html5.supportsNativeTextTracks(); // HTML5 Feature detection and Device Fixes --------------------------------- // var canPlayType = undefined; var mpegurlRE = /^application\/(?:x-|vnd\.apple\.)mpegurl/i; var mp4RE = /^video\/mp4/i; Html5.patchCanPlayType = function () { // Android 4.0 and above can play HLS to some extent but it reports being unable to do so if (browser.ANDROID_VERSION >= 4.0) { if (!canPlayType) { canPlayType = Html5.TEST_VID.constructor.prototype.canPlayType; } Html5.TEST_VID.constructor.prototype.canPlayType = function (type) { if (type && mpegurlRE.test(type)) { return 'maybe'; } return canPlayType.call(this, type); }; } // Override Android 2.2 and less canPlayType method which is broken if (browser.IS_OLD_ANDROID) { if (!canPlayType) { canPlayType = Html5.TEST_VID.constructor.prototype.canPlayType; } Html5.TEST_VID.constructor.prototype.canPlayType = function (type) { if (type && mp4RE.test(type)) { return 'maybe'; } return canPlayType.call(this, type); }; } }; Html5.unpatchCanPlayType = function () { var r = Html5.TEST_VID.constructor.prototype.canPlayType; Html5.TEST_VID.constructor.prototype.canPlayType = canPlayType; canPlayType = null; return r; }; // by default, patch the video element Html5.patchCanPlayType(); Html5.disposeMediaElement = function (el) { if (!el) { return; } if (el.parentNode) { el.parentNode.removeChild(el); } // remove any child track or source nodes to prevent their loading while (el.hasChildNodes()) { el.removeChild(el.firstChild); } // remove any src reference. not setting `src=''` because that causes a warning // in firefox el.removeAttribute('src'); // force the media element to update its loading state by calling load() // however IE on Windows 7N has a bug that throws an error so need a try/catch (#793) if (typeof el.load === 'function') { // wrapping in an iife so it's not deoptimized (#1060#discussion_r10324473) (function () { try { el.load(); } catch (e) { // not supported } })(); } }; _component2['default'].registerComponent('Html5', Html5); exports['default'] = Html5; module.exports = exports['default']; },{"../component":48,"../utils/browser.js":104,"../utils/dom.js":107,"../utils/fn.js":109,"../utils/log.js":112,"../utils/merge-options.js":113,"../utils/url.js":117,"./tech.js":96,"global/document":1,"global/window":2,"object.assign":40}],95:[function(_dereq_,module,exports){ /** * @file loader.js */ 'use strict'; exports.__esModule = true; function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError('Cannot call a class as a function'); } } function _inherits(subClass, superClass) { if (typeof superClass !== 'function' && superClass !== null) { throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } var _component = _dereq_('../component'); var _component2 = _interopRequireDefault(_component); var _globalWindow = _dereq_('global/window'); var _globalWindow2 = _interopRequireDefault(_globalWindow); var _utilsToTitleCaseJs = _dereq_('../utils/to-title-case.js'); var _utilsToTitleCaseJs2 = _interopRequireDefault(_utilsToTitleCaseJs); /** * The Media Loader is the component that decides which playback technology to load * when the player is initialized. * * @param {Object} player Main Player * @param {Object=} options Object of option names and values * @param {Function=} ready Ready callback function * @extends Component * @class MediaLoader */ var MediaLoader = (function (_Component) { _inherits(MediaLoader, _Component); function MediaLoader(player, options, ready) { _classCallCheck(this, MediaLoader); _Component.call(this, player, options, ready); // If there are no sources when the player is initialized, // load the first supported playback technology. if (!options.playerOptions['sources'] || options.playerOptions['sources'].length === 0) { for (var i = 0, j = options.playerOptions['techOrder']; i < j.length; i++) { var techName = _utilsToTitleCaseJs2['default'](j[i]); var tech = _component2['default'].getComponent(techName); // Check if the browser supports this technology if (tech && tech.isSupported()) { player.loadTech(techName); break; } } } else { // // Loop through playback technologies (HTML5, Flash) and check for support. // // Then load the best source. // // A few assumptions here: // // All playback technologies respect preload false. player.src(options.playerOptions['sources']); } } return MediaLoader; })(_component2['default']); _component2['default'].registerComponent('MediaLoader', MediaLoader); exports['default'] = MediaLoader; module.exports = exports['default']; },{"../component":48,"../utils/to-title-case.js":116,"global/window":2}],96:[function(_dereq_,module,exports){ /** * @file tech.js * Media Technology Controller - Base class for media playback * technology controllers like Flash and HTML5 */ 'use strict'; exports.__esModule = true; function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj['default'] = obj; return newObj; } } function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError('Cannot call a class as a function'); } } function _inherits(subClass, superClass) { if (typeof superClass !== 'function' && superClass !== null) { throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } var _component = _dereq_('../component'); var _component2 = _interopRequireDefault(_component); var _tracksTextTrack = _dereq_('../tracks/text-track'); var _tracksTextTrack2 = _interopRequireDefault(_tracksTextTrack); var _tracksTextTrackList = _dereq_('../tracks/text-track-list'); var _tracksTextTrackList2 = _interopRequireDefault(_tracksTextTrackList); var _utilsFnJs = _dereq_('../utils/fn.js'); var Fn = _interopRequireWildcard(_utilsFnJs); var _utilsLogJs = _dereq_('../utils/log.js'); var _utilsLogJs2 = _interopRequireDefault(_utilsLogJs); var _utilsTimeRangesJs = _dereq_('../utils/time-ranges.js'); var _utilsBufferJs = _dereq_('../utils/buffer.js'); var _mediaErrorJs = _dereq_('../media-error.js'); var _mediaErrorJs2 = _interopRequireDefault(_mediaErrorJs); var _globalWindow = _dereq_('global/window'); var _globalWindow2 = _interopRequireDefault(_globalWindow); var _globalDocument = _dereq_('global/document'); var _globalDocument2 = _interopRequireDefault(_globalDocument); /** * Base class for media (HTML5 Video, Flash) controllers * * @param {Object=} options Options object * @param {Function=} ready Ready callback function * @extends Component * @class Tech */ var Tech = (function (_Component) { _inherits(Tech, _Component); function Tech() { var options = arguments.length <= 0 || arguments[0] === undefined ? {} : arguments[0]; var ready = arguments.length <= 1 || arguments[1] === undefined ? function () {} : arguments[1]; _classCallCheck(this, Tech); // we don't want the tech to report user activity automatically. // This is done manually in addControlsListeners options.reportTouchActivity = false; _Component.call(this, null, options, ready); // keep track of whether the current source has played at all to // implement a very limited played() this.hasStarted_ = false; this.on('playing', function () { this.hasStarted_ = true; }); this.on('loadstart', function () { this.hasStarted_ = false; }); this.textTracks_ = options.textTracks; // Manually track progress in cases where the browser/flash player doesn't report it. if (!this.featuresProgressEvents) { this.manualProgressOn(); } // Manually track timeupdates in cases where the browser/flash player doesn't report it. if (!this.featuresTimeupdateEvents) { this.manualTimeUpdatesOn(); } this.initControlsListeners(); if (options.nativeCaptions === false || options.nativeTextTracks === false) { this.featuresNativeTextTracks = false; } if (!this.featuresNativeTextTracks) { this.emulateTextTracks(); } this.initTextTrackListeners(); // Turn on component tap events this.emitTapEvents(); } /* * List of associated text tracks * * @type {Array} * @private */ /** * Set up click and touch listeners for the playback element * On desktops, a click on the video itself will toggle playback, * on a mobile device a click on the video toggles controls. * (toggling controls is done by toggling the user state between active and * inactive) * A tap can signal that a user has become active, or has become inactive * e.g. a quick tap on an iPhone movie should reveal the controls. Another * quick tap should hide them again (signaling the user is in an inactive * viewing state) * In addition to this, we still want the user to be considered inactive after * a few seconds of inactivity. * Note: the only part of iOS interaction we can't mimic with this setup * is a touch and hold on the video element counting as activity in order to * keep the controls showing, but that shouldn't be an issue. A touch and hold on * any controls will still keep the user active * * @method initControlsListeners */ Tech.prototype.initControlsListeners = function initControlsListeners() { // if we're loading the playback object after it has started loading or playing the // video (often with autoplay on) then the loadstart event has already fired and we // need to fire it manually because many things rely on it. // Long term we might consider how we would do this for other events like 'canplay' // that may also have fired. this.ready(function () { if (this.networkState && this.networkState() > 0) { this.trigger('loadstart'); } // Allow the tech ready event to handle synchronisity }, true); }; /* Fallbacks for unsupported event types ================================================================================ */ // Manually trigger progress events based on changes to the buffered amount // Many flash players and older HTML5 browsers don't send progress or progress-like events /** * Turn on progress events * * @method manualProgressOn */ Tech.prototype.manualProgressOn = function manualProgressOn() { this.on('durationchange', this.onDurationChange); this.manualProgress = true; // Trigger progress watching when a source begins loading this.one('ready', this.trackProgress); }; /** * Turn off progress events * * @method manualProgressOff */ Tech.prototype.manualProgressOff = function manualProgressOff() { this.manualProgress = false; this.stopTrackingProgress(); this.off('durationchange', this.onDurationChange); }; /** * Track progress * * @method trackProgress */ Tech.prototype.trackProgress = function trackProgress() { this.stopTrackingProgress(); this.progressInterval = this.setInterval(Fn.bind(this, function () { // Don't trigger unless buffered amount is greater than last time var numBufferedPercent = this.bufferedPercent(); if (this.bufferedPercent_ !== numBufferedPercent) { this.trigger('progress'); } this.bufferedPercent_ = numBufferedPercent; if (numBufferedPercent === 1) { this.stopTrackingProgress(); } }), 500); }; /** * Update duration * * @method onDurationChange */ Tech.prototype.onDurationChange = function onDurationChange() { this.duration_ = this.duration(); }; /** * Create and get TimeRange object for buffering * * @return {TimeRangeObject} * @method buffered */ Tech.prototype.buffered = function buffered() { return _utilsTimeRangesJs.createTimeRange(0, 0); }; /** * Get buffered percent * * @return {Number} * @method bufferedPercent */ Tech.prototype.bufferedPercent = function bufferedPercent() { return _utilsBufferJs.bufferedPercent(this.buffered(), this.duration_); }; /** * Stops tracking progress by clearing progress interval * * @method stopTrackingProgress */ Tech.prototype.stopTrackingProgress = function stopTrackingProgress() { this.clearInterval(this.progressInterval); }; /*! Time Tracking -------------------------------------------------------------- */ /** * Set event listeners for on play and pause and tracking current time * * @method manualTimeUpdatesOn */ Tech.prototype.manualTimeUpdatesOn = function manualTimeUpdatesOn() { this.manualTimeUpdates = true; this.on('play', this.trackCurrentTime); this.on('pause', this.stopTrackingCurrentTime); }; /** * Remove event listeners for on play and pause and tracking current time * * @method manualTimeUpdatesOff */ Tech.prototype.manualTimeUpdatesOff = function manualTimeUpdatesOff() { this.manualTimeUpdates = false; this.stopTrackingCurrentTime(); this.off('play', this.trackCurrentTime); this.off('pause', this.stopTrackingCurrentTime); }; /** * Tracks current time * * @method trackCurrentTime */ Tech.prototype.trackCurrentTime = function trackCurrentTime() { if (this.currentTimeInterval) { this.stopTrackingCurrentTime(); } this.currentTimeInterval = this.setInterval(function () { this.trigger({ type: 'timeupdate', target: this, manuallyTriggered: true }); }, 250); // 42 = 24 fps // 250 is what Webkit uses // FF uses 15 }; /** * Turn off play progress tracking (when paused or dragging) * * @method stopTrackingCurrentTime */ Tech.prototype.stopTrackingCurrentTime = function stopTrackingCurrentTime() { this.clearInterval(this.currentTimeInterval); // #1002 - if the video ends right before the next timeupdate would happen, // the progress bar won't make it all the way to the end this.trigger({ type: 'timeupdate', target: this, manuallyTriggered: true }); }; /** * Turn off any manual progress or timeupdate tracking * * @method dispose */ Tech.prototype.dispose = function dispose() { // clear out text tracks because we can't reuse them between techs var textTracks = this.textTracks(); if (textTracks) { var i = textTracks.length; while (i--) { this.removeRemoteTextTrack(textTracks[i]); } } // Turn off any manual progress or timeupdate tracking if (this.manualProgress) { this.manualProgressOff(); } if (this.manualTimeUpdates) { this.manualTimeUpdatesOff(); } _Component.prototype.dispose.call(this); }; /** * When invoked without an argument, returns a MediaError object * representing the current error state of the player or null if * there is no error. When invoked with an argument, set the current * error state of the player. * @param {MediaError=} err Optional an error object * @return {MediaError} the current error object or null * @method error */ Tech.prototype.error = function error(err) { if (err !== undefined) { if (err instanceof _mediaErrorJs2['default']) { this.error_ = err; } else { this.error_ = new _mediaErrorJs2['default'](err); } this.trigger('error'); } return this.error_; }; /** * Return the time ranges that have been played through for the * current source. This implementation is incomplete. It does not * track the played time ranges, only whether the source has played * at all or not. * @return {TimeRangeObject} a single time range if this video has * played or an empty set of ranges if not. * @method played */ Tech.prototype.played = function played() { if (this.hasStarted_) { return _utilsTimeRangesJs.createTimeRange(0, 0); } return _utilsTimeRangesJs.createTimeRange(); }; /** * Set current time * * @method setCurrentTime */ Tech.prototype.setCurrentTime = function setCurrentTime() { // improve the accuracy of manual timeupdates if (this.manualTimeUpdates) { this.trigger({ type: 'timeupdate', target: this, manuallyTriggered: true }); } }; /** * Initialize texttrack listeners * * @method initTextTrackListeners */ Tech.prototype.initTextTrackListeners = function initTextTrackListeners() { var textTrackListChanges = Fn.bind(this, function () { this.trigger('texttrackchange'); }); var tracks = this.textTracks(); if (!tracks) return; tracks.addEventListener('removetrack', textTrackListChanges); tracks.addEventListener('addtrack', textTrackListChanges); this.on('dispose', Fn.bind(this, function () { tracks.removeEventListener('removetrack', textTrackListChanges); tracks.removeEventListener('addtrack', textTrackListChanges); })); }; /** * Emulate texttracks * * @method emulateTextTracks */ Tech.prototype.emulateTextTracks = function emulateTextTracks() { if (!_globalWindow2['default']['WebVTT'] && this.el().parentNode != null) { var script = _globalDocument2['default'].createElement('script'); script.src = this.options_['vtt.js'] || '../node_modules/vtt.js/dist/vtt.js'; this.el().parentNode.appendChild(script); _globalWindow2['default']['WebVTT'] = true; } var tracks = this.textTracks(); if (!tracks) { return; } var textTracksChanges = Fn.bind(this, function () { var _this = this; var updateDisplay = function updateDisplay() { return _this.trigger('texttrackchange'); }; updateDisplay(); for (var i = 0; i < tracks.length; i++) { var track = tracks[i]; track.removeEventListener('cuechange', updateDisplay); if (track.mode === 'showing') { track.addEventListener('cuechange', updateDisplay); } } }); tracks.addEventListener('change', textTracksChanges); this.on('dispose', function () { tracks.removeEventListener('change', textTracksChanges); }); }; /* * Provide default methods for text tracks. * * Html5 tech overrides these. */ /** * Get texttracks * * @returns {TextTrackList} * @method textTracks */ Tech.prototype.textTracks = function textTracks() { this.textTracks_ = this.textTracks_ || new _tracksTextTrackList2['default'](); return this.textTracks_; }; /** * Get remote texttracks * * @returns {TextTrackList} * @method remoteTextTracks */ Tech.prototype.remoteTextTracks = function remoteTextTracks() { this.remoteTextTracks_ = this.remoteTextTracks_ || new _tracksTextTrackList2['default'](); return this.remoteTextTracks_; }; /** * Creates and returns a remote text track object * * @param {String} kind Text track kind (subtitles, captions, descriptions * chapters and metadata) * @param {String=} label Label to identify the text track * @param {String=} language Two letter language abbreviation * @return {TextTrackObject} * @method addTextTrack */ Tech.prototype.addTextTrack = function addTextTrack(kind, label, language) { if (!kind) { throw new Error('TextTrack kind is required but was not provided'); } return createTrackHelper(this, kind, label, language); }; /** * Creates and returns a remote text track object * * @param {Object} options The object should contain values for * kind, language, label and src (location of the WebVTT file) * @return {TextTrackObject} * @method addRemoteTextTrack */ Tech.prototype.addRemoteTextTrack = function addRemoteTextTrack(options) { var track = createTrackHelper(this, options.kind, options.label, options.language, options); this.remoteTextTracks().addTrack_(track); return { track: track }; }; /** * Remove remote texttrack * * @param {TextTrackObject} track Texttrack to remove * @method removeRemoteTextTrack */ Tech.prototype.removeRemoteTextTrack = function removeRemoteTextTrack(track) { this.textTracks().removeTrack_(track); this.remoteTextTracks().removeTrack_(track); }; /** * Provide a default setPoster method for techs * Poster support for techs should be optional, so we don't want techs to * break if they don't have a way to set a poster. * * @method setPoster */ Tech.prototype.setPoster = function setPoster() {}; return Tech; })(_component2['default']); Tech.prototype.textTracks_; var createTrackHelper = function createTrackHelper(self, kind, label, language) { var options = arguments.length <= 4 || arguments[4] === undefined ? {} : arguments[4]; var tracks = self.textTracks(); options.kind = kind; if (label) { options.label = label; } if (language) { options.language = language; } options.tech = self; var track = new _tracksTextTrack2['default'](options); tracks.addTrack_(track); return track; }; Tech.prototype.featuresVolumeControl = true; // Resizing plugins using request fullscreen reloads the plugin Tech.prototype.featuresFullscreenResize = false; Tech.prototype.featuresPlaybackRate = false; // Optional events that we can manually mimic with timers // currently not triggered by video-js-swf Tech.prototype.featuresProgressEvents = false; Tech.prototype.featuresTimeupdateEvents = false; Tech.prototype.featuresNativeTextTracks = false; /* * A functional mixin for techs that want to use the Source Handler pattern. * * ##### EXAMPLE: * * Tech.withSourceHandlers.call(MyTech); * */ Tech.withSourceHandlers = function (_Tech) { /* * Register a source handler * Source handlers are scripts for handling specific formats. * The source handler pattern is used for adaptive formats (HLS, DASH) that * manually load video data and feed it into a Source Buffer (Media Source Extensions) * @param {Function} handler The source handler * @param {Boolean} first Register it before any existing handlers */ _Tech.registerSourceHandler = function (handler, index) { var handlers = _Tech.sourceHandlers; if (!handlers) { handlers = _Tech.sourceHandlers = []; } if (index === undefined) { // add to the end of the list index = handlers.length; } handlers.splice(index, 0, handler); }; /* * Return the first source handler that supports the source * TODO: Answer question: should 'probably' be prioritized over 'maybe' * @param {Object} source The source object * @returns {Object} The first source handler that supports the source * @returns {null} Null if no source handler is found */ _Tech.selectSourceHandler = function (source) { var handlers = _Tech.sourceHandlers || []; var can = undefined; for (var i = 0; i < handlers.length; i++) { can = handlers[i].canHandleSource(source); if (can) { return handlers[i]; } } return null; }; /* * Check if the tech can support the given source * @param {Object} srcObj The source object * @return {String} 'probably', 'maybe', or '' (empty string) */ _Tech.canPlaySource = function (srcObj) { var sh = _Tech.selectSourceHandler(srcObj); if (sh) { return sh.canHandleSource(srcObj); } return ''; }; var originalSeekable = _Tech.prototype.seekable; // when a source handler is registered, prefer its implementation of // seekable when present. _Tech.prototype.seekable = function () { if (this.sourceHandler_ && this.sourceHandler_.seekable) { return this.sourceHandler_.seekable(); } return originalSeekable.call(this); }; /* * Create a function for setting the source using a source object * and source handlers. * Should never be called unless a source handler was found. * @param {Object} source A source object with src and type keys * @return {Tech} self */ _Tech.prototype.setSource = function (source) { var sh = _Tech.selectSourceHandler(source); if (!sh) { // Fall back to a native source hander when unsupported sources are // deliberately set if (_Tech.nativeSourceHandler) { sh = _Tech.nativeSourceHandler; } else { _utilsLogJs2['default'].error('No source hander found for the current source.'); } } // Dispose any existing source handler this.disposeSourceHandler(); this.off('dispose', this.disposeSourceHandler); this.currentSource_ = source; this.sourceHandler_ = sh.handleSource(source, this); this.on('dispose', this.disposeSourceHandler); return this; }; /* * Clean up any existing source handler */ _Tech.prototype.disposeSourceHandler = function () { if (this.sourceHandler_ && this.sourceHandler_.dispose) { this.sourceHandler_.dispose(); } }; }; _component2['default'].registerComponent('Tech', Tech); // Old name for Tech _component2['default'].registerComponent('MediaTechController', Tech); exports['default'] = Tech; module.exports = exports['default']; },{"../component":48,"../media-error.js":83,"../tracks/text-track":103,"../tracks/text-track-list":101,"../utils/buffer.js":105,"../utils/fn.js":109,"../utils/log.js":112,"../utils/time-ranges.js":115,"global/document":1,"global/window":2}],97:[function(_dereq_,module,exports){ /** * @file text-track-cue-list.js */ 'use strict'; exports.__esModule = true; function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj['default'] = obj; return newObj; } } var _utilsBrowserJs = _dereq_('../utils/browser.js'); var browser = _interopRequireWildcard(_utilsBrowserJs); var _globalDocument = _dereq_('global/document'); var _globalDocument2 = _interopRequireDefault(_globalDocument); /* * https://html.spec.whatwg.org/multipage/embedded-content.html#texttrackcuelist * * interface TextTrackCueList { * readonly attribute unsigned long length; * getter TextTrackCue (unsigned long index); * TextTrackCue? getCueById(DOMString id); * }; */ var TextTrackCueList = function TextTrackCueList(cues) { var list = this; if (browser.IS_IE8) { list = _globalDocument2['default'].createElement('custom'); for (var prop in TextTrackCueList.prototype) { list[prop] = TextTrackCueList.prototype[prop]; } } TextTrackCueList.prototype.setCues_.call(list, cues); Object.defineProperty(list, 'length', { get: function get() { return this.length_; } }); if (browser.IS_IE8) { return list; } }; TextTrackCueList.prototype.setCues_ = function (cues) { var oldLength = this.length || 0; var i = 0; var l = cues.length; this.cues_ = cues; this.length_ = cues.length; var defineProp = function defineProp(i) { if (!('' + i in this)) { Object.defineProperty(this, '' + i, { get: function get() { return this.cues_[i]; } }); } }; if (oldLength < l) { i = oldLength; for (; i < l; i++) { defineProp.call(this, i); } } }; TextTrackCueList.prototype.getCueById = function (id) { var result = null; for (var i = 0, l = this.length; i < l; i++) { var cue = this[i]; if (cue.id === id) { result = cue; break; } } return result; }; exports['default'] = TextTrackCueList; module.exports = exports['default']; },{"../utils/browser.js":104,"global/document":1}],98:[function(_dereq_,module,exports){ /** * @file text-track-display.js */ 'use strict'; exports.__esModule = true; function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj['default'] = obj; return newObj; } } function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError('Cannot call a class as a function'); } } function _inherits(subClass, superClass) { if (typeof superClass !== 'function' && superClass !== null) { throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } var _component = _dereq_('../component'); var _component2 = _interopRequireDefault(_component); var _menuMenuJs = _dereq_('../menu/menu.js'); var _menuMenuJs2 = _interopRequireDefault(_menuMenuJs); var _menuMenuItemJs = _dereq_('../menu/menu-item.js'); var _menuMenuItemJs2 = _interopRequireDefault(_menuMenuItemJs); var _menuMenuButtonJs = _dereq_('../menu/menu-button.js'); var _menuMenuButtonJs2 = _interopRequireDefault(_menuMenuButtonJs); var _utilsFnJs = _dereq_('../utils/fn.js'); var Fn = _interopRequireWildcard(_utilsFnJs); var _globalDocument = _dereq_('global/document'); var _globalDocument2 = _interopRequireDefault(_globalDocument); var _globalWindow = _dereq_('global/window'); var _globalWindow2 = _interopRequireDefault(_globalWindow); var darkGray = '#222'; var lightGray = '#ccc'; var fontMap = { monospace: 'monospace', sansSerif: 'sans-serif', serif: 'serif', monospaceSansSerif: '"Andale Mono", "Lucida Console", monospace', monospaceSerif: '"Courier New", monospace', proportionalSansSerif: 'sans-serif', proportionalSerif: 'serif', casual: '"Comic Sans MS", Impact, fantasy', script: '"Monotype Corsiva", cursive', smallcaps: '"Andale Mono", "Lucida Console", monospace, sans-serif' }; /** * The component for displaying text track cues * * @param {Object} player Main Player * @param {Object=} options Object of option names and values * @param {Function=} ready Ready callback function * @extends Component * @class TextTrackDisplay */ var TextTrackDisplay = (function (_Component) { _inherits(TextTrackDisplay, _Component); function TextTrackDisplay(player, options, ready) { _classCallCheck(this, TextTrackDisplay); _Component.call(this, player, options, ready); player.on('loadstart', Fn.bind(this, this.toggleDisplay)); player.on('texttrackchange', Fn.bind(this, this.updateDisplay)); // This used to be called during player init, but was causing an error // if a track should show by default and the display hadn't loaded yet. // Should probably be moved to an external track loader when we support // tracks that don't need a display. player.ready(Fn.bind(this, function () { if (player.tech && player.tech['featuresNativeTextTracks']) { this.hide(); return; } player.on('fullscreenchange', Fn.bind(this, this.updateDisplay)); var tracks = this.options_.playerOptions['tracks'] || []; for (var i = 0; i < tracks.length; i++) { var track = tracks[i]; this.player_.addRemoteTextTrack(track); } })); } /** * Add cue HTML to display * * @param {Number} color Hex number for color, like #f0e * @param {Number} opacity Value for opacity,0.0 - 1.0 * @return {RGBAColor} In the form 'rgba(255, 0, 0, 0.3)' * @method constructColor */ /** * Toggle display texttracks * * @method toggleDisplay */ TextTrackDisplay.prototype.toggleDisplay = function toggleDisplay() { if (this.player_.tech && this.player_.tech['featuresNativeTextTracks']) { this.hide(); } else { this.show(); } }; /** * Create the component's DOM element * * @return {Element} * @method createEl */ TextTrackDisplay.prototype.createEl = function createEl() { return _Component.prototype.createEl.call(this, 'div', { className: 'vjs-text-track-display' }); }; /** * Clear display texttracks * * @method clearDisplay */ TextTrackDisplay.prototype.clearDisplay = function clearDisplay() { if (typeof _globalWindow2['default']['WebVTT'] === 'function') { _globalWindow2['default']['WebVTT']['processCues'](_globalWindow2['default'], [], this.el_); } }; /** * Update display texttracks * * @method updateDisplay */ TextTrackDisplay.prototype.updateDisplay = function updateDisplay() { var tracks = this.player_.textTracks(); this.clearDisplay(); if (!tracks) { return; } for (var i = 0; i < tracks.length; i++) { var track = tracks[i]; if (track['mode'] === 'showing') { this.updateForTrack(track); } } }; /** * Add texttrack to texttrack list * * @param {TextTrackObject} track Texttrack object to be added to list * @method updateForTrack */ TextTrackDisplay.prototype.updateForTrack = function updateForTrack(track) { if (typeof _globalWindow2['default']['WebVTT'] !== 'function' || !track['activeCues']) { return; } var overrides = this.player_['textTrackSettings'].getValues(); var cues = []; for (var _i = 0; _i < track['activeCues'].length; _i++) { cues.push(track['activeCues'][_i]); } _globalWindow2['default']['WebVTT']['processCues'](_globalWindow2['default'], track['activeCues'], this.el_); var i = cues.length; while (i--) { var cueDiv = cues[i].displayState; if (overrides.color) { cueDiv.firstChild.style.color = overrides.color; } if (overrides.textOpacity) { tryUpdateStyle(cueDiv.firstChild, 'color', constructColor(overrides.color || '#fff', overrides.textOpacity)); } if (overrides.backgroundColor) { cueDiv.firstChild.style.backgroundColor = overrides.backgroundColor; } if (overrides.backgroundOpacity) { tryUpdateStyle(cueDiv.firstChild, 'backgroundColor', constructColor(overrides.backgroundColor || '#000', overrides.backgroundOpacity)); } if (overrides.windowColor) { if (overrides.windowOpacity) { tryUpdateStyle(cueDiv, 'backgroundColor', constructColor(overrides.windowColor, overrides.windowOpacity)); } else { cueDiv.style.backgroundColor = overrides.windowColor; } } if (overrides.edgeStyle) { if (overrides.edgeStyle === 'dropshadow') { cueDiv.firstChild.style.textShadow = '2px 2px 3px ' + darkGray + ', 2px 2px 4px ' + darkGray + ', 2px 2px 5px ' + darkGray; } else if (overrides.edgeStyle === 'raised') { cueDiv.firstChild.style.textShadow = '1px 1px ' + darkGray + ', 2px 2px ' + darkGray + ', 3px 3px ' + darkGray; } else if (overrides.edgeStyle === 'depressed') { cueDiv.firstChild.style.textShadow = '1px 1px ' + lightGray + ', 0 1px ' + lightGray + ', -1px -1px ' + darkGray + ', 0 -1px ' + darkGray; } else if (overrides.edgeStyle === 'uniform') { cueDiv.firstChild.style.textShadow = '0 0 4px ' + darkGray + ', 0 0 4px ' + darkGray + ', 0 0 4px ' + darkGray + ', 0 0 4px ' + darkGray; } } if (overrides.fontPercent && overrides.fontPercent !== 1) { var fontSize = _globalWindow2['default'].parseFloat(cueDiv.style.fontSize); cueDiv.style.fontSize = fontSize * overrides.fontPercent + 'px'; cueDiv.style.height = 'auto'; cueDiv.style.top = 'auto'; cueDiv.style.bottom = '2px'; } if (overrides.fontFamily && overrides.fontFamily !== 'default') { if (overrides.fontFamily === 'small-caps') { cueDiv.firstChild.style.fontVariant = 'small-caps'; } else { cueDiv.firstChild.style.fontFamily = fontMap[overrides.fontFamily]; } } } }; return TextTrackDisplay; })(_component2['default']); function constructColor(color, opacity) { return 'rgba(' + // color looks like "#f0e" parseInt(color[1] + color[1], 16) + ',' + parseInt(color[2] + color[2], 16) + ',' + parseInt(color[3] + color[3], 16) + ',' + opacity + ')'; } /** * Try to update style * Some style changes will throw an error, particularly in IE8. Those should be noops. * * @param {Element} el The element to be styles * @param {CSSProperty} style The CSS property to be styled * @param {CSSStyle} rule The actual style to be applied to the property * @method tryUpdateStyle */ function tryUpdateStyle(el, style, rule) { // try { el.style[style] = rule; } catch (e) {} } _component2['default'].registerComponent('TextTrackDisplay', TextTrackDisplay); exports['default'] = TextTrackDisplay; module.exports = exports['default']; },{"../component":48,"../menu/menu-button.js":84,"../menu/menu-item.js":85,"../menu/menu.js":86,"../utils/fn.js":109,"global/document":1,"global/window":2}],99:[function(_dereq_,module,exports){ /** * @file text-track-enums.js * * https://html.spec.whatwg.org/multipage/embedded-content.html#texttrackmode * * enum TextTrackMode { "disabled", "hidden", "showing" }; */ 'use strict'; exports.__esModule = true; var TextTrackMode = { 'disabled': 'disabled', 'hidden': 'hidden', 'showing': 'showing' }; /* * https://html.spec.whatwg.org/multipage/embedded-content.html#texttrackkind * * enum TextTrackKind { "subtitles", "captions", "descriptions", "chapters", "metadata" }; */ var TextTrackKind = { 'subtitles': 'subtitles', 'captions': 'captions', 'descriptions': 'descriptions', 'chapters': 'chapters', 'metadata': 'metadata' }; exports.TextTrackMode = TextTrackMode; exports.TextTrackKind = TextTrackKind; },{}],100:[function(_dereq_,module,exports){ /** * Utilities for capturing text track state and re-creating tracks * based on a capture. * * @file text-track-list-converter.js */ /** * Examine a single text track and return a JSON-compatible javascript * object that represents the text track's state. * @param track {TextTrackObject} the text track to query * @return {Object} a serializable javascript representation of the * @private */ 'use strict'; exports.__esModule = true; var trackToJson_ = function trackToJson_(track) { return { kind: track.kind, label: track.label, language: track.language, id: track.id, inBandMetadataTrackDispatchType: track.inBandMetadataTrackDispatchType, mode: track.mode, cues: track.cues && Array.prototype.map.call(track.cues, function (cue) { return { startTime: cue.startTime, endTime: cue.endTime, text: cue.text, id: cue.id }; }), src: track.src }; }; /** * Examine a tech and return a JSON-compatible javascript array that * represents the state of all text tracks currently configured. The * return array is compatible with `jsonToTextTracks`. * @param tech {tech} the tech object to query * @return {Array} a serializable javascript representation of the * @function textTracksToJson */ var textTracksToJson = function textTracksToJson(tech) { var trackEls = tech.el().querySelectorAll('track'); var trackObjs = Array.prototype.map.call(trackEls, function (t) { return t.track; }); var tracks = Array.prototype.map.call(trackEls, function (trackEl) { var json = trackToJson_(trackEl.track); json.src = trackEl.src; return json; }); return tracks.concat(Array.prototype.filter.call(tech.textTracks(), function (track) { return trackObjs.indexOf(track) === -1; }).map(trackToJson_)); }; /** * Creates a set of remote text tracks on a tech based on an array of * javascript text track representations. * @param json {Array} an array of text track representation objects, * like those that would be produced by `textTracksToJson` * @param tech {tech} the tech to create text tracks on * @function jsonToTextTracks */ var jsonToTextTracks = function jsonToTextTracks(json, tech) { json.forEach(function (track) { var addedTrack = tech.addRemoteTextTrack(track).track; if (!track.src && track.cues) { track.cues.forEach(function (cue) { return addedTrack.addCue(cue); }); } }); return tech.textTracks(); }; exports['default'] = { textTracksToJson: textTracksToJson, jsonToTextTracks: jsonToTextTracks, trackToJson_: trackToJson_ }; module.exports = exports['default']; },{}],101:[function(_dereq_,module,exports){ /** * @file text-track-list.js */ 'use strict'; exports.__esModule = true; function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj['default'] = obj; return newObj; } } function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } var _eventTarget = _dereq_('../event-target'); var _eventTarget2 = _interopRequireDefault(_eventTarget); var _utilsFnJs = _dereq_('../utils/fn.js'); var Fn = _interopRequireWildcard(_utilsFnJs); var _utilsBrowserJs = _dereq_('../utils/browser.js'); var browser = _interopRequireWildcard(_utilsBrowserJs); var _globalDocument = _dereq_('global/document'); var _globalDocument2 = _interopRequireDefault(_globalDocument); /* * https://html.spec.whatwg.org/multipage/embedded-content.html#texttracklist * * interface TextTrackList : EventTarget { * readonly attribute unsigned long length; * getter TextTrack (unsigned long index); * TextTrack? getTrackById(DOMString id); * * attribute EventHandler onchange; * attribute EventHandler onaddtrack; * attribute EventHandler onremovetrack; * }; */ var TextTrackList = function TextTrackList(tracks) { var list = this; if (browser.IS_IE8) { list = _globalDocument2['default'].createElement('custom'); for (var prop in TextTrackList.prototype) { list[prop] = TextTrackList.prototype[prop]; } } tracks = tracks || []; list.tracks_ = []; Object.defineProperty(list, 'length', { get: function get() { return this.tracks_.length; } }); for (var i = 0; i < tracks.length; i++) { list.addTrack_(tracks[i]); } if (browser.IS_IE8) { return list; } }; TextTrackList.prototype = Object.create(_eventTarget2['default'].prototype); TextTrackList.prototype.constructor = TextTrackList; /* * change - One or more tracks in the track list have been enabled or disabled. * addtrack - A track has been added to the track list. * removetrack - A track has been removed from the track list. */ TextTrackList.prototype.allowedEvents_ = { 'change': 'change', 'addtrack': 'addtrack', 'removetrack': 'removetrack' }; // emulate attribute EventHandler support to allow for feature detection for (var _event in TextTrackList.prototype.allowedEvents_) { TextTrackList.prototype['on' + _event] = null; } TextTrackList.prototype.addTrack_ = function (track) { var index = this.tracks_.length; if (!('' + index in this)) { Object.defineProperty(this, index, { get: function get() { return this.tracks_[index]; } }); } track.addEventListener('modechange', Fn.bind(this, function () { this.trigger('change'); })); this.tracks_.push(track); this.trigger({ type: 'addtrack', track: track }); }; TextTrackList.prototype.removeTrack_ = function (rtrack) { var result = null; var track = undefined; for (var i = 0, l = this.length; i < l; i++) { track = this[i]; if (track === rtrack) { this.tracks_.splice(i, 1); break; } } this.trigger({ type: 'removetrack', track: track }); }; TextTrackList.prototype.getTrackById = function (id) { var result = null; for (var i = 0, l = this.length; i < l; i++) { var track = this[i]; if (track.id === id) { result = track; break; } } return result; }; exports['default'] = TextTrackList; module.exports = exports['default']; },{"../event-target":79,"../utils/browser.js":104,"../utils/fn.js":109,"global/document":1}],102:[function(_dereq_,module,exports){ /** * @file text-track-settings.js */ 'use strict'; exports.__esModule = true; function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj['default'] = obj; return newObj; } } function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError('Cannot call a class as a function'); } } function _inherits(subClass, superClass) { if (typeof superClass !== 'function' && superClass !== null) { throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } var _component = _dereq_('../component'); var _component2 = _interopRequireDefault(_component); var _utilsEventsJs = _dereq_('../utils/events.js'); var Events = _interopRequireWildcard(_utilsEventsJs); var _utilsFnJs = _dereq_('../utils/fn.js'); var Fn = _interopRequireWildcard(_utilsFnJs); var _utilsLogJs = _dereq_('../utils/log.js'); var _utilsLogJs2 = _interopRequireDefault(_utilsLogJs); var _safeJsonParseTuple = _dereq_('safe-json-parse/tuple'); var _safeJsonParseTuple2 = _interopRequireDefault(_safeJsonParseTuple); var _globalWindow = _dereq_('global/window'); var _globalWindow2 = _interopRequireDefault(_globalWindow); /** * Manipulate settings of texttracks * * @param {Object} player Main Player * @param {Object=} options Object of option names and values * @extends Component * @class TextTrackSettings */ var TextTrackSettings = (function (_Component) { _inherits(TextTrackSettings, _Component); function TextTrackSettings(player, options) { _classCallCheck(this, TextTrackSettings); _Component.call(this, player, options); this.hide(); // Grab `persistTextTrackSettings` from the player options if not passed in child options if (options.persistTextTrackSettings === undefined) { this.options_.persistTextTrackSettings = this.options_.playerOptions.persistTextTrackSettings; } Events.on(this.el().querySelector('.vjs-done-button'), 'click', Fn.bind(this, function () { this.saveSettings(); this.hide(); })); Events.on(this.el().querySelector('.vjs-default-button'), 'click', Fn.bind(this, function () { this.el().querySelector('.vjs-fg-color > select').selectedIndex = 0; this.el().querySelector('.vjs-bg-color > select').selectedIndex = 0; this.el().querySelector('.window-color > select').selectedIndex = 0; this.el().querySelector('.vjs-text-opacity > select').selectedIndex = 0; this.el().querySelector('.vjs-bg-opacity > select').selectedIndex = 0; this.el().querySelector('.vjs-window-opacity > select').selectedIndex = 0; this.el().querySelector('.vjs-edge-style select').selectedIndex = 0; this.el().querySelector('.vjs-font-family select').selectedIndex = 0; this.el().querySelector('.vjs-font-percent select').selectedIndex = 2; this.updateDisplay(); })); Events.on(this.el().querySelector('.vjs-fg-color > select'), 'change', Fn.bind(this, this.updateDisplay)); Events.on(this.el().querySelector('.vjs-bg-color > select'), 'change', Fn.bind(this, this.updateDisplay)); Events.on(this.el().querySelector('.window-color > select'), 'change', Fn.bind(this, this.updateDisplay)); Events.on(this.el().querySelector('.vjs-text-opacity > select'), 'change', Fn.bind(this, this.updateDisplay)); Events.on(this.el().querySelector('.vjs-bg-opacity > select'), 'change', Fn.bind(this, this.updateDisplay)); Events.on(this.el().querySelector('.vjs-window-opacity > select'), 'change', Fn.bind(this, this.updateDisplay)); Events.on(this.el().querySelector('.vjs-font-percent select'), 'change', Fn.bind(this, this.updateDisplay)); Events.on(this.el().querySelector('.vjs-edge-style select'), 'change', Fn.bind(this, this.updateDisplay)); Events.on(this.el().querySelector('.vjs-font-family select'), 'change', Fn.bind(this, this.updateDisplay)); if (this.options_.persistTextTrackSettings) { this.restoreSettings(); } } /** * Create the component's DOM element * * @return {Element} * @method createEl */ TextTrackSettings.prototype.createEl = function createEl() { return _Component.prototype.createEl.call(this, 'div', { className: 'vjs-caption-settings vjs-modal-overlay', innerHTML: captionOptionsMenuTemplate() }); }; /** * Get texttrack settings * Settings are * .vjs-edge-style * .vjs-font-family * .vjs-fg-color * .vjs-text-opacity * .vjs-bg-color * .vjs-bg-opacity * .window-color * .vjs-window-opacity * * @return {Object} * @method getValues */ TextTrackSettings.prototype.getValues = function getValues() { var el = this.el(); var textEdge = getSelectedOptionValue(el.querySelector('.vjs-edge-style select')); var fontFamily = getSelectedOptionValue(el.querySelector('.vjs-font-family select')); var fgColor = getSelectedOptionValue(el.querySelector('.vjs-fg-color > select')); var textOpacity = getSelectedOptionValue(el.querySelector('.vjs-text-opacity > select')); var bgColor = getSelectedOptionValue(el.querySelector('.vjs-bg-color > select')); var bgOpacity = getSelectedOptionValue(el.querySelector('.vjs-bg-opacity > select')); var windowColor = getSelectedOptionValue(el.querySelector('.window-color > select')); var windowOpacity = getSelectedOptionValue(el.querySelector('.vjs-window-opacity > select')); var fontPercent = _globalWindow2['default']['parseFloat'](getSelectedOptionValue(el.querySelector('.vjs-font-percent > select'))); var result = { 'backgroundOpacity': bgOpacity, 'textOpacity': textOpacity, 'windowOpacity': windowOpacity, 'edgeStyle': textEdge, 'fontFamily': fontFamily, 'color': fgColor, 'backgroundColor': bgColor, 'windowColor': windowColor, 'fontPercent': fontPercent }; for (var _name in result) { if (result[_name] === '' || result[_name] === 'none' || _name === 'fontPercent' && result[_name] === 1.00) { delete result[_name]; } } return result; }; /** * Set texttrack settings * Settings are * .vjs-edge-style * .vjs-font-family * .vjs-fg-color * .vjs-text-opacity * .vjs-bg-color * .vjs-bg-opacity * .window-color * .vjs-window-opacity * * @param {Object} values Object with texttrack setting values * @method setValues */ TextTrackSettings.prototype.setValues = function setValues(values) { var el = this.el(); setSelectedOption(el.querySelector('.vjs-edge-style select'), values.edgeStyle); setSelectedOption(el.querySelector('.vjs-font-family select'), values.fontFamily); setSelectedOption(el.querySelector('.vjs-fg-color > select'), values.color); setSelectedOption(el.querySelector('.vjs-text-opacity > select'), values.textOpacity); setSelectedOption(el.querySelector('.vjs-bg-color > select'), values.backgroundColor); setSelectedOption(el.querySelector('.vjs-bg-opacity > select'), values.backgroundOpacity); setSelectedOption(el.querySelector('.window-color > select'), values.windowColor); setSelectedOption(el.querySelector('.vjs-window-opacity > select'), values.windowOpacity); var fontPercent = values.fontPercent; if (fontPercent) { fontPercent = fontPercent.toFixed(2); } setSelectedOption(el.querySelector('.vjs-font-percent > select'), fontPercent); }; /** * Restore texttrack settings * * @method restoreSettings */ TextTrackSettings.prototype.restoreSettings = function restoreSettings() { var _safeParseTuple = _safeJsonParseTuple2['default'](_globalWindow2['default'].localStorage.getItem('vjs-text-track-settings')); var err = _safeParseTuple[0]; var values = _safeParseTuple[1]; if (err) { _utilsLogJs2['default'].error(err); } if (values) { this.setValues(values); } }; /** * Save texttrack settings to local storage * * @method saveSettings */ TextTrackSettings.prototype.saveSettings = function saveSettings() { if (!this.options_.persistTextTrackSettings) { return; } var values = this.getValues(); try { if (Object.getOwnPropertyNames(values).length > 0) { _globalWindow2['default'].localStorage.setItem('vjs-text-track-settings', JSON.stringify(values)); } else { _globalWindow2['default'].localStorage.removeItem('vjs-text-track-settings'); } } catch (e) {} }; /** * Update display of texttrack settings * * @method updateDisplay */ TextTrackSettings.prototype.updateDisplay = function updateDisplay() { var ttDisplay = this.player_.getChild('textTrackDisplay'); if (ttDisplay) { ttDisplay.updateDisplay(); } }; return TextTrackSettings; })(_component2['default']); _component2['default'].registerComponent('TextTrackSettings', TextTrackSettings); function getSelectedOptionValue(target) { var selectedOption = undefined; // not all browsers support selectedOptions, so, fallback to options if (target.selectedOptions) { selectedOption = target.selectedOptions[0]; } else if (target.options) { selectedOption = target.options[target.options.selectedIndex]; } return selectedOption.value; } function setSelectedOption(target, value) { if (!value) { return; } var i = undefined; for (i = 0; i < target.options.length; i++) { var option = target.options[i]; if (option.value === value) { break; } } target.selectedIndex = i; } function captionOptionsMenuTemplate() { var template = '<div class="vjs-tracksettings">\n <div class="vjs-tracksettings-colors">\n <div class="vjs-fg-color vjs-tracksetting">\n <label class="vjs-label">Foreground</label>\n <select>\n <option value="">---</option>\n <option value="#FFF">White</option>\n <option value="#000">Black</option>\n <option value="#F00">Red</option>\n <option value="#0F0">Green</option>\n <option value="#00F">Blue</option>\n <option value="#FF0">Yellow</option>\n <option value="#F0F">Magenta</option>\n <option value="#0FF">Cyan</option>\n </select>\n <span class="vjs-text-opacity vjs-opacity">\n <select>\n <option value="">---</option>\n <option value="1">Opaque</option>\n <option value="0.5">Semi-Opaque</option>\n </select>\n </span>\n </div> <!-- vjs-fg-color -->\n <div class="vjs-bg-color vjs-tracksetting">\n <label class="vjs-label">Background</label>\n <select>\n <option value="">---</option>\n <option value="#FFF">White</option>\n <option value="#000">Black</option>\n <option value="#F00">Red</option>\n <option value="#0F0">Green</option>\n <option value="#00F">Blue</option>\n <option value="#FF0">Yellow</option>\n <option value="#F0F">Magenta</option>\n <option value="#0FF">Cyan</option>\n </select>\n <span class="vjs-bg-opacity vjs-opacity">\n <select>\n <option value="">---</option>\n <option value="1">Opaque</option>\n <option value="0.5">Semi-Transparent</option>\n <option value="0">Transparent</option>\n </select>\n </span>\n </div> <!-- vjs-bg-color -->\n <div class="window-color vjs-tracksetting">\n <label class="vjs-label">Window</label>\n <select>\n <option value="">---</option>\n <option value="#FFF">White</option>\n <option value="#000">Black</option>\n <option value="#F00">Red</option>\n <option value="#0F0">Green</option>\n <option value="#00F">Blue</option>\n <option value="#FF0">Yellow</option>\n <option value="#F0F">Magenta</option>\n <option value="#0FF">Cyan</option>\n </select>\n <span class="vjs-window-opacity vjs-opacity">\n <select>\n <option value="">---</option>\n <option value="1">Opaque</option>\n <option value="0.5">Semi-Transparent</option>\n <option value="0">Transparent</option>\n </select>\n </span>\n </div> <!-- vjs-window-color -->\n </div> <!-- vjs-tracksettings -->\n <div class="vjs-tracksettings-font">\n <div class="vjs-font-percent vjs-tracksetting">\n <label class="vjs-label">Font Size</label>\n <select>\n <option value="0.50">50%</option>\n <option value="0.75">75%</option>\n <option value="1.00" selected>100%</option>\n <option value="1.25">125%</option>\n <option value="1.50">150%</option>\n <option value="1.75">175%</option>\n <option value="2.00">200%</option>\n <option value="3.00">300%</option>\n <option value="4.00">400%</option>\n </select>\n </div> <!-- vjs-font-percent -->\n <div class="vjs-edge-style vjs-tracksetting">\n <label class="vjs-label">Text Edge Style</label>\n <select>\n <option value="none">None</option>\n <option value="raised">Raised</option>\n <option value="depressed">Depressed</option>\n <option value="uniform">Uniform</option>\n <option value="dropshadow">Dropshadow</option>\n </select>\n </div> <!-- vjs-edge-style -->\n <div class="vjs-font-family vjs-tracksetting">\n <label class="vjs-label">Font Family</label>\n <select>\n <option value="">Default</option>\n <option value="monospaceSerif">Monospace Serif</option>\n <option value="proportionalSerif">Proportional Serif</option>\n <option value="monospaceSansSerif">Monospace Sans-Serif</option>\n <option value="proportionalSansSerif">Proportional Sans-Serif</option>\n <option value="casual">Casual</option>\n <option value="script">Script</option>\n <option value="small-caps">Small Caps</option>\n </select>\n </div> <!-- vjs-font-family -->\n </div>\n </div>\n <div class="vjs-tracksettings-controls">\n <button class="vjs-default-button">Defaults</button>\n <button class="vjs-done-button">Done</button>\n </div>'; return template; } exports['default'] = TextTrackSettings; module.exports = exports['default']; },{"../component":48,"../utils/events.js":108,"../utils/fn.js":109,"../utils/log.js":112,"global/window":2,"safe-json-parse/tuple":45}],103:[function(_dereq_,module,exports){ /** * @file text-track.js */ 'use strict'; exports.__esModule = true; function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj['default'] = obj; return newObj; } } function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } var _textTrackCueList = _dereq_('./text-track-cue-list'); var _textTrackCueList2 = _interopRequireDefault(_textTrackCueList); var _utilsFnJs = _dereq_('../utils/fn.js'); var Fn = _interopRequireWildcard(_utilsFnJs); var _utilsGuidJs = _dereq_('../utils/guid.js'); var Guid = _interopRequireWildcard(_utilsGuidJs); var _utilsBrowserJs = _dereq_('../utils/browser.js'); var browser = _interopRequireWildcard(_utilsBrowserJs); var _textTrackEnums = _dereq_('./text-track-enums'); var TextTrackEnum = _interopRequireWildcard(_textTrackEnums); var _utilsLogJs = _dereq_('../utils/log.js'); var _utilsLogJs2 = _interopRequireDefault(_utilsLogJs); var _eventTarget = _dereq_('../event-target'); var _eventTarget2 = _interopRequireDefault(_eventTarget); var _globalDocument = _dereq_('global/document'); var _globalDocument2 = _interopRequireDefault(_globalDocument); var _globalWindow = _dereq_('global/window'); var _globalWindow2 = _interopRequireDefault(_globalWindow); var _xhrJs = _dereq_('../xhr.js'); var _xhrJs2 = _interopRequireDefault(_xhrJs); /* * https://html.spec.whatwg.org/multipage/embedded-content.html#texttrack * * interface TextTrack : EventTarget { * readonly attribute TextTrackKind kind; * readonly attribute DOMString label; * readonly attribute DOMString language; * * readonly attribute DOMString id; * readonly attribute DOMString inBandMetadataTrackDispatchType; * * attribute TextTrackMode mode; * * readonly attribute TextTrackCueList? cues; * readonly attribute TextTrackCueList? activeCues; * * void addCue(TextTrackCue cue); * void removeCue(TextTrackCue cue); * * attribute EventHandler oncuechange; * }; */ var TextTrack = function TextTrack() { var options = arguments.length <= 0 || arguments[0] === undefined ? {} : arguments[0]; if (!options.tech) { throw new Error('A tech was not provided.'); } var tt = this; if (browser.IS_IE8) { tt = _globalDocument2['default'].createElement('custom'); for (var prop in TextTrack.prototype) { tt[prop] = TextTrack.prototype[prop]; } } tt.tech_ = options.tech; var mode = TextTrackEnum.TextTrackMode[options['mode']] || 'disabled'; var kind = TextTrackEnum.TextTrackKind[options['kind']] || 'subtitles'; var label = options['label'] || ''; var language = options['language'] || options['srclang'] || ''; var id = options['id'] || 'vjs_text_track_' + Guid.newGUID(); if (kind === 'metadata' || kind === 'chapters') { mode = 'hidden'; } tt.cues_ = []; tt.activeCues_ = []; var cues = new _textTrackCueList2['default'](tt.cues_); var activeCues = new _textTrackCueList2['default'](tt.activeCues_); var changed = false; var timeupdateHandler = Fn.bind(tt, function () { this['activeCues']; if (changed) { this['trigger']('cuechange'); changed = false; } }); if (mode !== 'disabled') { tt.tech_.on('timeupdate', timeupdateHandler); } Object.defineProperty(tt, 'kind', { get: function get() { return kind; }, set: Function.prototype }); Object.defineProperty(tt, 'label', { get: function get() { return label; }, set: Function.prototype }); Object.defineProperty(tt, 'language', { get: function get() { return language; }, set: Function.prototype }); Object.defineProperty(tt, 'id', { get: function get() { return id; }, set: Function.prototype }); Object.defineProperty(tt, 'mode', { get: function get() { return mode; }, set: function set(newMode) { if (!TextTrackEnum.TextTrackMode[newMode]) { return; } mode = newMode; if (mode === 'showing') { this.tech_.on('timeupdate', timeupdateHandler); } this.trigger('modechange'); } }); Object.defineProperty(tt, 'cues', { get: function get() { if (!this.loaded_) { return null; } return cues; }, set: Function.prototype }); Object.defineProperty(tt, 'activeCues', { get: function get() { if (!this.loaded_) { return null; } if (this['cues'].length === 0) { return activeCues; // nothing to do } var ct = this.tech_.currentTime(); var active = []; for (var i = 0, l = this['cues'].length; i < l; i++) { var cue = this['cues'][i]; if (cue['startTime'] <= ct && cue['endTime'] >= ct) { active.push(cue); } else if (cue['startTime'] === cue['endTime'] && cue['startTime'] <= ct && cue['startTime'] + 0.5 >= ct) { active.push(cue); } } changed = false; if (active.length !== this.activeCues_.length) { changed = true; } else { for (var i = 0; i < active.length; i++) { if (indexOf.call(this.activeCues_, active[i]) === -1) { changed = true; } } } this.activeCues_ = active; activeCues.setCues_(this.activeCues_); return activeCues; }, set: Function.prototype }); if (options.src) { tt.src = options.src; loadTrack(options.src, tt); } else { tt.loaded_ = true; } if (browser.IS_IE8) { return tt; } }; TextTrack.prototype = Object.create(_eventTarget2['default'].prototype); TextTrack.prototype.constructor = TextTrack; /* * cuechange - One or more cues in the track have become active or stopped being active. */ TextTrack.prototype.allowedEvents_ = { 'cuechange': 'cuechange' }; TextTrack.prototype.addCue = function (cue) { var tracks = this.tech_.textTracks(); if (tracks) { for (var i = 0; i < tracks.length; i++) { if (tracks[i] !== this) { tracks[i].removeCue(cue); } } } this.cues_.push(cue); this['cues'].setCues_(this.cues_); }; TextTrack.prototype.removeCue = function (removeCue) { var removed = false; for (var i = 0, l = this.cues_.length; i < l; i++) { var cue = this.cues_[i]; if (cue === removeCue) { this.cues_.splice(i, 1); removed = true; } } if (removed) { this.cues.setCues_(this.cues_); } }; /* * Downloading stuff happens below this point */ var parseCues = function parseCues(srcContent, track) { if (typeof _globalWindow2['default']['WebVTT'] !== 'function') { //try again a bit later return _globalWindow2['default'].setTimeout(function () { parseCues(srcContent, track); }, 25); } var parser = new _globalWindow2['default']['WebVTT']['Parser'](_globalWindow2['default'], _globalWindow2['default']['vttjs'], _globalWindow2['default']['WebVTT']['StringDecoder']()); parser['oncue'] = function (cue) { track.addCue(cue); }; parser['onparsingerror'] = function (error) { _utilsLogJs2['default'].error(error); }; parser['parse'](srcContent); parser['flush'](); }; var loadTrack = function loadTrack(src, track) { _xhrJs2['default'](src, Fn.bind(this, function (err, response, responseBody) { if (err) { return _utilsLogJs2['default'].error(err, response); } track.loaded_ = true; parseCues(responseBody, track); })); }; var indexOf = function indexOf(searchElement, fromIndex) { if (this == null) { throw new TypeError('"this" is null or not defined'); } var O = Object(this); var len = O.length >>> 0; if (len === 0) { return -1; } var n = +fromIndex || 0; if (Math.abs(n) === Infinity) { n = 0; } if (n >= len) { return -1; } var k = Math.max(n >= 0 ? n : len - Math.abs(n), 0); while (k < len) { if (k in O && O[k] === searchElement) { return k; } k++; } return -1; }; exports['default'] = TextTrack; module.exports = exports['default']; },{"../event-target":79,"../utils/browser.js":104,"../utils/fn.js":109,"../utils/guid.js":111,"../utils/log.js":112,"../xhr.js":119,"./text-track-cue-list":97,"./text-track-enums":99,"global/document":1,"global/window":2}],104:[function(_dereq_,module,exports){ /** * @file browser.js */ 'use strict'; exports.__esModule = true; function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } var _globalDocument = _dereq_('global/document'); var _globalDocument2 = _interopRequireDefault(_globalDocument); var _globalWindow = _dereq_('global/window'); var _globalWindow2 = _interopRequireDefault(_globalWindow); var USER_AGENT = _globalWindow2['default'].navigator.userAgent; var webkitVersionMap = /AppleWebKit\/([\d.]+)/i.exec(USER_AGENT); var appleWebkitVersion = webkitVersionMap ? parseFloat(webkitVersionMap.pop()) : null; /* * Device is an iPhone * * @type {Boolean} * @constant * @private */ var IS_IPHONE = /iPhone/i.test(USER_AGENT); exports.IS_IPHONE = IS_IPHONE; var IS_IPAD = /iPad/i.test(USER_AGENT); exports.IS_IPAD = IS_IPAD; var IS_IPOD = /iPod/i.test(USER_AGENT); exports.IS_IPOD = IS_IPOD; var IS_IOS = IS_IPHONE || IS_IPAD || IS_IPOD; exports.IS_IOS = IS_IOS; var IOS_VERSION = (function () { var match = USER_AGENT.match(/OS (\d+)_/i); if (match && match[1]) { return match[1]; } })(); exports.IOS_VERSION = IOS_VERSION; var IS_ANDROID = /Android/i.test(USER_AGENT); exports.IS_ANDROID = IS_ANDROID; var ANDROID_VERSION = (function () { // This matches Android Major.Minor.Patch versions // ANDROID_VERSION is Major.Minor as a Number, if Minor isn't available, then only Major is returned var match = USER_AGENT.match(/Android (\d+)(?:\.(\d+))?(?:\.(\d+))*/i), major, minor; if (!match) { return null; } major = match[1] && parseFloat(match[1]); minor = match[2] && parseFloat(match[2]); if (major && minor) { return parseFloat(match[1] + '.' + match[2]); } else if (major) { return major; } else { return null; } })(); exports.ANDROID_VERSION = ANDROID_VERSION; // Old Android is defined as Version older than 2.3, and requiring a webkit version of the android browser var IS_OLD_ANDROID = IS_ANDROID && /webkit/i.test(USER_AGENT) && ANDROID_VERSION < 2.3; exports.IS_OLD_ANDROID = IS_OLD_ANDROID; var IS_NATIVE_ANDROID = IS_ANDROID && ANDROID_VERSION < 5 && appleWebkitVersion < 537; exports.IS_NATIVE_ANDROID = IS_NATIVE_ANDROID; var IS_FIREFOX = /Firefox/i.test(USER_AGENT); exports.IS_FIREFOX = IS_FIREFOX; var IS_CHROME = /Chrome/i.test(USER_AGENT); exports.IS_CHROME = IS_CHROME; var IS_IE8 = /MSIE\s8\.0/.test(USER_AGENT); exports.IS_IE8 = IS_IE8; var TOUCH_ENABLED = !!('ontouchstart' in _globalWindow2['default'] || _globalWindow2['default'].DocumentTouch && _globalDocument2['default'] instanceof _globalWindow2['default'].DocumentTouch); exports.TOUCH_ENABLED = TOUCH_ENABLED; var BACKGROUND_SIZE_SUPPORTED = ('backgroundSize' in _globalDocument2['default'].createElement('video').style); exports.BACKGROUND_SIZE_SUPPORTED = BACKGROUND_SIZE_SUPPORTED; },{"global/document":1,"global/window":2}],105:[function(_dereq_,module,exports){ /** * @file buffer.js */ 'use strict'; exports.__esModule = true; exports.bufferedPercent = bufferedPercent; var _timeRangesJs = _dereq_('./time-ranges.js'); /** * Compute how much your video has been buffered * * @param {Object} Buffered object * @param {Number} Total duration * @return {Number} Percent buffered of the total duration * @private * @function bufferedPercent */ function bufferedPercent(buffered, duration) { var bufferedDuration = 0, start, end; if (!duration) { return 0; } if (!buffered || !buffered.length) { buffered = _timeRangesJs.createTimeRange(0, 0); } for (var i = 0; i < buffered.length; i++) { start = buffered.start(i); end = buffered.end(i); // buffered end can be bigger than duration by a very small fraction if (end > duration) { end = duration; } bufferedDuration += end - start; } return bufferedDuration / duration; } },{"./time-ranges.js":115}],106:[function(_dereq_,module,exports){ 'use strict'; exports.__esModule = true; function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } var _logJs = _dereq_('./log.js'); var _logJs2 = _interopRequireDefault(_logJs); /** * Object containing the default behaviors for available handler methods. * * @private * @type {Object} */ var defaultBehaviors = { get: function get(obj, key) { return obj[key]; }, set: function set(obj, key, value) { obj[key] = value; return true; } }; /** * Expose private objects publicly using a Proxy to log deprecation warnings. * * Browsers that do not support Proxy objects will simply return the `target` * object, so it can be directly exposed. * * @param {Object} target The target object. * @param {Object} messages Messages to display from a Proxy. Only operations * with an associated message will be proxied. * @param {String} [messages.get] * @param {String} [messages.set] * @return {Object} A Proxy if supported or the `target` argument. */ exports['default'] = function (target) { var messages = arguments.length <= 1 || arguments[1] === undefined ? {} : arguments[1]; if (typeof Proxy === 'function') { var _ret = (function () { var handler = {}; // Build a handler object based on those keys that have both messages // and default behaviors. Object.keys(messages).forEach(function (key) { if (defaultBehaviors.hasOwnProperty(key)) { handler[key] = function () { _logJs2['default'].warn(messages[key]); return defaultBehaviors[key].apply(this, arguments); }; } }); return { v: new Proxy(target, handler) }; })(); if (typeof _ret === 'object') return _ret.v; } return target; }; module.exports = exports['default']; },{"./log.js":112}],107:[function(_dereq_,module,exports){ /** * @file dom.js */ 'use strict'; exports.__esModule = true; exports.getEl = getEl; exports.createEl = createEl; exports.insertElFirst = insertElFirst; exports.getElData = getElData; exports.hasElData = hasElData; exports.removeElData = removeElData; exports.hasElClass = hasElClass; exports.addElClass = addElClass; exports.removeElClass = removeElClass; exports.setElAttributes = setElAttributes; exports.getElAttributes = getElAttributes; exports.blockTextSelection = blockTextSelection; exports.unblockTextSelection = unblockTextSelection; exports.findElPosition = findElPosition; function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj['default'] = obj; return newObj; } } function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } var _globalDocument = _dereq_('global/document'); var _globalDocument2 = _interopRequireDefault(_globalDocument); var _globalWindow = _dereq_('global/window'); var _globalWindow2 = _interopRequireDefault(_globalWindow); var _guidJs = _dereq_('./guid.js'); var Guid = _interopRequireWildcard(_guidJs); /** * Shorthand for document.getElementById() * Also allows for CSS (jQuery) ID syntax. But nothing other than IDs. * * @param {String} id Element ID * @return {Element} Element with supplied ID * @function getEl */ function getEl(id) { if (id.indexOf('#') === 0) { id = id.slice(1); } return _globalDocument2['default'].getElementById(id); } /** * Creates an element and applies properties. * * @param {String=} tagName Name of tag to be created. * @param {Object=} properties Element properties to be applied. * @return {Element} * @function createEl */ function createEl() { var tagName = arguments.length <= 0 || arguments[0] === undefined ? 'div' : arguments[0]; var properties = arguments.length <= 1 || arguments[1] === undefined ? {} : arguments[1]; var el = _globalDocument2['default'].createElement(tagName); Object.getOwnPropertyNames(properties).forEach(function (propName) { var val = properties[propName]; // Not remembering why we were checking for dash // but using setAttribute means you have to use getAttribute // The check for dash checks for the aria- * attributes, like aria-label, aria-valuemin. // The additional check for "role" is because the default method for adding attributes does not // add the attribute "role". My guess is because it's not a valid attribute in some namespaces, although // browsers handle the attribute just fine. The W3C allows for aria- * attributes to be used in pre-HTML5 docs. // http://www.w3.org/TR/wai-aria-primer/#ariahtml. Using setAttribute gets around this problem. if (propName.indexOf('aria-') !== -1 || propName === 'role' || propName === 'type') { el.setAttribute(propName, val); } else { el[propName] = val; } }); return el; } /** * Insert an element as the first child node of another * * @param {Element} child Element to insert * @param {Element} parent Element to insert child into * @private * @function insertElFirst */ function insertElFirst(child, parent) { if (parent.firstChild) { parent.insertBefore(child, parent.firstChild); } else { parent.appendChild(child); } } /** * Element Data Store. Allows for binding data to an element without putting it directly on the element. * Ex. Event listeners are stored here. * (also from jsninja.com, slightly modified and updated for closure compiler) * * @type {Object} * @private */ var elData = {}; /* * Unique attribute name to store an element's guid in * * @type {String} * @constant * @private */ var elIdAttr = 'vdata' + new Date().getTime(); /** * Returns the cache object where data for an element is stored * * @param {Element} el Element to store data for. * @return {Object} * @function getElData */ function getElData(el) { var id = el[elIdAttr]; if (!id) { id = el[elIdAttr] = Guid.newGUID(); } if (!elData[id]) { elData[id] = {}; } return elData[id]; } /** * Returns whether or not an element has cached data * * @param {Element} el A dom element * @return {Boolean} * @private * @function hasElData */ function hasElData(el) { var id = el[elIdAttr]; if (!id) { return false; } return !!Object.getOwnPropertyNames(elData[id]).length; } /** * Delete data for the element from the cache and the guid attr from getElementById * * @param {Element} el Remove data for an element * @private * @function removeElData */ function removeElData(el) { var id = el[elIdAttr]; if (!id) { return; } // Remove all stored data delete elData[id]; // Remove the elIdAttr property from the DOM node try { delete el[elIdAttr]; } catch (e) { if (el.removeAttribute) { el.removeAttribute(elIdAttr); } else { // IE doesn't appear to support removeAttribute on the document element el[elIdAttr] = null; } } } /** * Check if an element has a CSS class * * @param {Element} element Element to check * @param {String} classToCheck Classname to check * @function hasElClass */ function hasElClass(element, classToCheck) { return (' ' + element.className + ' ').indexOf(' ' + classToCheck + ' ') !== -1; } /** * Add a CSS class name to an element * * @param {Element} element Element to add class name to * @param {String} classToAdd Classname to add * @function addElClass */ function addElClass(element, classToAdd) { if (!hasElClass(element, classToAdd)) { element.className = element.className === '' ? classToAdd : element.className + ' ' + classToAdd; } } /** * Remove a CSS class name from an element * * @param {Element} element Element to remove from class name * @param {String} classToRemove Classname to remove * @function removeElClass */ function removeElClass(element, classToRemove) { if (!hasElClass(element, classToRemove)) { return; } var classNames = element.className.split(' '); // no arr.indexOf in ie8, and we don't want to add a big shim for (var i = classNames.length - 1; i >= 0; i--) { if (classNames[i] === classToRemove) { classNames.splice(i, 1); } } element.className = classNames.join(' '); } /** * Apply attributes to an HTML element. * * @param {Element} el Target element. * @param {Object=} attributes Element attributes to be applied. * @private * @function setElAttributes */ function setElAttributes(el, attributes) { Object.getOwnPropertyNames(attributes).forEach(function (attrName) { var attrValue = attributes[attrName]; if (attrValue === null || typeof attrValue === 'undefined' || attrValue === false) { el.removeAttribute(attrName); } else { el.setAttribute(attrName, attrValue === true ? '' : attrValue); } }); } /** * Get an element's attribute values, as defined on the HTML tag * Attributes are not the same as properties. They're defined on the tag * or with setAttribute (which shouldn't be used with HTML) * This will return true or false for boolean attributes. * * @param {Element} tag Element from which to get tag attributes * @return {Object} * @private * @function getElAttributes */ function getElAttributes(tag) { var obj, knownBooleans, attrs, attrName, attrVal; obj = {}; // known boolean attributes // we can check for matching boolean properties, but older browsers // won't know about HTML5 boolean attributes that we still read from knownBooleans = ',' + 'autoplay,controls,loop,muted,default' + ','; if (tag && tag.attributes && tag.attributes.length > 0) { attrs = tag.attributes; for (var i = attrs.length - 1; i >= 0; i--) { attrName = attrs[i].name; attrVal = attrs[i].value; // check for known booleans // the matching element property will return a value for typeof if (typeof tag[attrName] === 'boolean' || knownBooleans.indexOf(',' + attrName + ',') !== -1) { // the value of an included boolean attribute is typically an empty // string ('') which would equal false if we just check for a false value. // we also don't want support bad code like autoplay='false' attrVal = attrVal !== null ? true : false; } obj[attrName] = attrVal; } } return obj; } /** * Attempt to block the ability to select text while dragging controls * * @return {Boolean} * @method blockTextSelection */ function blockTextSelection() { _globalDocument2['default'].body.focus(); _globalDocument2['default'].onselectstart = function () { return false; }; } /** * Turn off text selection blocking * * @return {Boolean} * @method unblockTextSelection */ function unblockTextSelection() { _globalDocument2['default'].onselectstart = function () { return true; }; } /** * Offset Left * getBoundingClientRect technique from * John Resig http://ejohn.org/blog/getboundingclientrect-is-awesome/ * * @param {Element} el Element from which to get offset * @return {Object=} * @method findElPosition */ function findElPosition(el) { var box = undefined; if (el.getBoundingClientRect && el.parentNode) { box = el.getBoundingClientRect(); } if (!box) { return { left: 0, top: 0 }; } var docEl = _globalDocument2['default'].documentElement; var body = _globalDocument2['default'].body; var clientLeft = docEl.clientLeft || body.clientLeft || 0; var scrollLeft = _globalWindow2['default'].pageXOffset || body.scrollLeft; var left = box.left + scrollLeft - clientLeft; var clientTop = docEl.clientTop || body.clientTop || 0; var scrollTop = _globalWindow2['default'].pageYOffset || body.scrollTop; var top = box.top + scrollTop - clientTop; // Android sometimes returns slightly off decimal values, so need to round return { left: Math.round(left), top: Math.round(top) }; } },{"./guid.js":111,"global/document":1,"global/window":2}],108:[function(_dereq_,module,exports){ /** * @file events.js * * Event System (John Resig - Secrets of a JS Ninja http://jsninja.com/) * (Original book version wasn't completely usable, so fixed some things and made Closure Compiler compatible) * This should work very similarly to jQuery's events, however it's based off the book version which isn't as * robust as jquery's, so there's probably some differences. */ 'use strict'; exports.__esModule = true; exports.on = on; exports.off = off; exports.trigger = trigger; exports.one = one; exports.fixEvent = fixEvent; function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj['default'] = obj; return newObj; } } var _domJs = _dereq_('./dom.js'); var Dom = _interopRequireWildcard(_domJs); var _guidJs = _dereq_('./guid.js'); var Guid = _interopRequireWildcard(_guidJs); var _globalWindow = _dereq_('global/window'); var _globalWindow2 = _interopRequireDefault(_globalWindow); var _globalDocument = _dereq_('global/document'); var _globalDocument2 = _interopRequireDefault(_globalDocument); /** * Add an event listener to element * It stores the handler function in a separate cache object * and adds a generic handler to the element's event, * along with a unique id (guid) to the element. * * @param {Element|Object} elem Element or object to bind listeners to * @param {String|Array} type Type of event to bind to. * @param {Function} fn Event listener. * @method on */ function on(elem, type, fn) { if (Array.isArray(type)) { return _handleMultipleEvents(on, elem, type, fn); } var data = Dom.getElData(elem); // We need a place to store all our handler data if (!data.handlers) data.handlers = {}; if (!data.handlers[type]) data.handlers[type] = []; if (!fn.guid) fn.guid = Guid.newGUID(); data.handlers[type].push(fn); if (!data.dispatcher) { data.disabled = false; data.dispatcher = function (event, hash) { if (data.disabled) return; event = fixEvent(event); var handlers = data.handlers[event.type]; if (handlers) { // Copy handlers so if handlers are added/removed during the process it doesn't throw everything off. var handlersCopy = handlers.slice(0); for (var m = 0, n = handlersCopy.length; m < n; m++) { if (event.isImmediatePropagationStopped()) { break; } else { handlersCopy[m].call(elem, event, hash); } } } }; } if (data.handlers[type].length === 1) { if (elem.addEventListener) { elem.addEventListener(type, data.dispatcher, false); } else if (elem.attachEvent) { elem.attachEvent('on' + type, data.dispatcher); } } } /** * Removes event listeners from an element * * @param {Element|Object} elem Object to remove listeners from * @param {String|Array=} type Type of listener to remove. Don't include to remove all events from element. * @param {Function} fn Specific listener to remove. Don't include to remove listeners for an event type. * @method off */ function off(elem, type, fn) { // Don't want to add a cache object through getElData if not needed if (!Dom.hasElData(elem)) return; var data = Dom.getElData(elem); // If no events exist, nothing to unbind if (!data.handlers) { return; } if (Array.isArray(type)) { return _handleMultipleEvents(off, elem, type, fn); } // Utility function var removeType = function removeType(t) { data.handlers[t] = []; _cleanUpEvents(elem, t); }; // Are we removing all bound events? if (!type) { for (var t in data.handlers) { removeType(t); }return; } var handlers = data.handlers[type]; // If no handlers exist, nothing to unbind if (!handlers) return; // If no listener was provided, remove all listeners for type if (!fn) { removeType(type); return; } // We're only removing a single handler if (fn.guid) { for (var n = 0; n < handlers.length; n++) { if (handlers[n].guid === fn.guid) { handlers.splice(n--, 1); } } } _cleanUpEvents(elem, type); } /** * Trigger an event for an element * * @param {Element|Object} elem Element to trigger an event on * @param {Event|Object|String} event A string (the type) or an event object with a type attribute * @param {Object} [hash] data hash to pass along with the event * @return {Boolean=} Returned only if default was prevented * @method trigger */ function trigger(elem, event, hash) { // Fetches element data and a reference to the parent (for bubbling). // Don't want to add a data object to cache for every parent, // so checking hasElData first. var elemData = Dom.hasElData(elem) ? Dom.getElData(elem) : {}; var parent = elem.parentNode || elem.ownerDocument; // type = event.type || event, // handler; // If an event name was passed as a string, creates an event out of it if (typeof event === 'string') { event = { type: event, target: elem }; } // Normalizes the event properties. event = fixEvent(event); // If the passed element has a dispatcher, executes the established handlers. if (elemData.dispatcher) { elemData.dispatcher.call(elem, event, hash); } // Unless explicitly stopped or the event does not bubble (e.g. media events) // recursively calls this function to bubble the event up the DOM. if (parent && !event.isPropagationStopped() && event.bubbles === true) { trigger.call(null, parent, event, hash); // If at the top of the DOM, triggers the default action unless disabled. } else if (!parent && !event.defaultPrevented) { var targetData = Dom.getElData(event.target); // Checks if the target has a default action for this event. if (event.target[event.type]) { // Temporarily disables event dispatching on the target as we have already executed the handler. targetData.disabled = true; // Executes the default action. if (typeof event.target[event.type] === 'function') { event.target[event.type](); } // Re-enables event dispatching. targetData.disabled = false; } } // Inform the triggerer if the default was prevented by returning false return !event.defaultPrevented; } /** * Trigger a listener only once for an event * * @param {Element|Object} elem Element or object to * @param {String|Array} type Name/type of event * @param {Function} fn Event handler function * @method one */ function one(elem, type, fn) { if (Array.isArray(type)) { return _handleMultipleEvents(one, elem, type, fn); } var func = function func() { off(elem, type, func); fn.apply(this, arguments); }; // copy the guid to the new function so it can removed using the original function's ID func.guid = fn.guid = fn.guid || Guid.newGUID(); on(elem, type, func); } /** * Fix a native event to have standard property values * * @param {Object} event Event object to fix * @return {Object} * @private * @method fixEvent */ function fixEvent(event) { function returnTrue() { return true; } function returnFalse() { return false; } // Test if fixing up is needed // Used to check if !event.stopPropagation instead of isPropagationStopped // But native events return true for stopPropagation, but don't have // other expected methods like isPropagationStopped. Seems to be a problem // with the Javascript Ninja code. So we're just overriding all events now. if (!event || !event.isPropagationStopped) { var old = event || _globalWindow2['default'].event; event = {}; // Clone the old object so that we can modify the values event = {}; // IE8 Doesn't like when you mess with native event properties // Firefox returns false for event.hasOwnProperty('type') and other props // which makes copying more difficult. // TODO: Probably best to create a whitelist of event props for (var key in old) { // Safari 6.0.3 warns you if you try to copy deprecated layerX/Y // Chrome warns you if you try to copy deprecated keyboardEvent.keyLocation // and webkitMovementX/Y if (key !== 'layerX' && key !== 'layerY' && key !== 'keyLocation' && key !== 'webkitMovementX' && key !== 'webkitMovementY') { // Chrome 32+ warns if you try to copy deprecated returnValue, but // we still want to if preventDefault isn't supported (IE8). if (!(key === 'returnValue' && old.preventDefault)) { event[key] = old[key]; } } } // The event occurred on this element if (!event.target) { event.target = event.srcElement || _globalDocument2['default']; } // Handle which other element the event is related to if (!event.relatedTarget) { event.relatedTarget = event.fromElement === event.target ? event.toElement : event.fromElement; } // Stop the default browser action event.preventDefault = function () { if (old.preventDefault) { old.preventDefault(); } event.returnValue = false; old.returnValue = false; event.defaultPrevented = true; }; event.defaultPrevented = false; // Stop the event from bubbling event.stopPropagation = function () { if (old.stopPropagation) { old.stopPropagation(); } event.cancelBubble = true; old.cancelBubble = true; event.isPropagationStopped = returnTrue; }; event.isPropagationStopped = returnFalse; // Stop the event from bubbling and executing other handlers event.stopImmediatePropagation = function () { if (old.stopImmediatePropagation) { old.stopImmediatePropagation(); } event.isImmediatePropagationStopped = returnTrue; event.stopPropagation(); }; event.isImmediatePropagationStopped = returnFalse; // Handle mouse position if (event.clientX != null) { var doc = _globalDocument2['default'].documentElement, body = _globalDocument2['default'].body; event.pageX = event.clientX + (doc && doc.scrollLeft || body && body.scrollLeft || 0) - (doc && doc.clientLeft || body && body.clientLeft || 0); event.pageY = event.clientY + (doc && doc.scrollTop || body && body.scrollTop || 0) - (doc && doc.clientTop || body && body.clientTop || 0); } // Handle key presses event.which = event.charCode || event.keyCode; // Fix button for mouse clicks: // 0 == left; 1 == middle; 2 == right if (event.button != null) { event.button = event.button & 1 ? 0 : event.button & 4 ? 1 : event.button & 2 ? 2 : 0; } } // Returns fixed-up instance return event; } /** * Clean up the listener cache and dispatchers * * @param {Element|Object} elem Element to clean up * @param {String} type Type of event to clean up * @private * @method _cleanUpEvents */ function _cleanUpEvents(elem, type) { var data = Dom.getElData(elem); // Remove the events of a particular type if there are none left if (data.handlers[type].length === 0) { delete data.handlers[type]; // data.handlers[type] = null; // Setting to null was causing an error with data.handlers // Remove the meta-handler from the element if (elem.removeEventListener) { elem.removeEventListener(type, data.dispatcher, false); } else if (elem.detachEvent) { elem.detachEvent('on' + type, data.dispatcher); } } // Remove the events object if there are no types left if (Object.getOwnPropertyNames(data.handlers).length <= 0) { delete data.handlers; delete data.dispatcher; delete data.disabled; } // Finally remove the element data if there is no data left if (Object.getOwnPropertyNames(data).length === 0) { Dom.removeElData(elem); } } /** * Loops through an array of event types and calls the requested method for each type. * * @param {Function} fn The event method we want to use. * @param {Element|Object} elem Element or object to bind listeners to * @param {String} type Type of event to bind to. * @param {Function} callback Event listener. * @private * @function _handleMultipleEvents */ function _handleMultipleEvents(fn, elem, types, callback) { types.forEach(function (type) { //Call the event method for each one of the types fn(elem, type, callback); }); } },{"./dom.js":107,"./guid.js":111,"global/document":1,"global/window":2}],109:[function(_dereq_,module,exports){ /** * @file fn.js */ 'use strict'; exports.__esModule = true; var _guidJs = _dereq_('./guid.js'); /** * Bind (a.k.a proxy or Context). A simple method for changing the context of a function * It also stores a unique id on the function so it can be easily removed from events * * @param {*} context The object to bind as scope * @param {Function} fn The function to be bound to a scope * @param {Number=} uid An optional unique ID for the function to be set * @return {Function} * @private * @method bind */ var bind = function bind(context, fn, uid) { // Make sure the function has a unique ID if (!fn.guid) { fn.guid = _guidJs.newGUID(); } // Create the new function that changes the context var ret = function ret() { return fn.apply(context, arguments); }; // Allow for the ability to individualize this function // Needed in the case where multiple objects might share the same prototype // IF both items add an event listener with the same function, then you try to remove just one // it will remove both because they both have the same guid. // when using this, you need to use the bind method when you remove the listener as well. // currently used in text tracks ret.guid = uid ? uid + '_' + fn.guid : fn.guid; return ret; }; exports.bind = bind; },{"./guid.js":111}],110:[function(_dereq_,module,exports){ /** * @file format-time.js * * Format seconds as a time string, H:MM:SS or M:SS * Supplying a guide (in seconds) will force a number of leading zeros * to cover the length of the guide * * @param {Number} seconds Number of seconds to be turned into a string * @param {Number} guide Number (in seconds) to model the string after * @return {String} Time formatted as H:MM:SS or M:SS * @private * @function formatTime */ 'use strict'; exports.__esModule = true; function formatTime(seconds) { var guide = arguments.length <= 1 || arguments[1] === undefined ? seconds : arguments[1]; return (function () { var s = Math.floor(seconds % 60); var m = Math.floor(seconds / 60 % 60); var h = Math.floor(seconds / 3600); var gm = Math.floor(guide / 60 % 60); var gh = Math.floor(guide / 3600); // handle invalid times if (isNaN(seconds) || seconds === Infinity) { // '-' is false for all relational operators (e.g. <, >=) so this setting // will add the minimum number of fields specified by the guide h = m = s = '-'; } // Check if we need to show hours h = h > 0 || gh > 0 ? h + ':' : ''; // If hours are showing, we may need to add a leading zero. // Always show at least one digit of minutes. m = ((h || gm >= 10) && m < 10 ? '0' + m : m) + ':'; // Check if leading zero is need for seconds s = s < 10 ? '0' + s : s; return h + m + s; })(); } exports['default'] = formatTime; module.exports = exports['default']; },{}],111:[function(_dereq_,module,exports){ /** * @file guid.js * * Unique ID for an element or function * @type {Number} * @private */ "use strict"; exports.__esModule = true; exports.newGUID = newGUID; var _guid = 1; /** * Get the next unique ID * * @return {String} * @function newGUID */ function newGUID() { return _guid++; } },{}],112:[function(_dereq_,module,exports){ /** * @file log.js */ 'use strict'; exports.__esModule = true; function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } var _globalWindow = _dereq_('global/window'); var _globalWindow2 = _interopRequireDefault(_globalWindow); /** * Log plain debug messages */ var log = function log() { _logType(null, arguments); }; /** * Keep a history of log messages * @type {Array} */ log.history = []; /** * Log error messages */ log.error = function () { _logType('error', arguments); }; /** * Log warning messages */ log.warn = function () { _logType('warn', arguments); }; /** * Log messages to the console and history based on the type of message * * @param {String} type The type of message, or `null` for `log` * @param {Object} args The args to be passed to the log * @private * @method _logType */ function _logType(type, args) { // convert args to an array to get array functions var argsArray = Array.prototype.slice.call(args); // if there's no console then don't try to output messages // they will still be stored in log.history // Was setting these once outside of this function, but containing them // in the function makes it easier to test cases where console doesn't exist var noop = function noop() {}; var console = _globalWindow2['default']['console'] || { 'log': noop, 'warn': noop, 'error': noop }; if (type) { // add the type to the front of the message argsArray.unshift(type.toUpperCase() + ':'); } else { // default to log with no prefix type = 'log'; } // add to history log.history.push(argsArray); // add console prefix after adding to history argsArray.unshift('VIDEOJS:'); // call appropriate log function if (console[type].apply) { console[type].apply(console, argsArray); } else { // ie8 doesn't allow error.apply, but it will just join() the array anyway console[type](argsArray.join(' ')); } } exports['default'] = log; module.exports = exports['default']; },{"global/window":2}],113:[function(_dereq_,module,exports){ /** * @file merge-options.js */ 'use strict'; exports.__esModule = true; exports['default'] = mergeOptions; function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } var _lodashCompatObjectMerge = _dereq_('lodash-compat/object/merge'); var _lodashCompatObjectMerge2 = _interopRequireDefault(_lodashCompatObjectMerge); function isPlain(obj) { return !!obj && typeof obj === 'object' && obj.toString() === '[object Object]' && obj.constructor === Object; } /** * Merge customizer. video.js simply overwrites non-simple objects * (like arrays) instead of attempting to overlay them. * @see https://lodash.com/docs#merge */ var customizer = function customizer(destination, source) { // If we're not working with a plain object, copy the value as is // If source is an array, for instance, it will replace destination if (!isPlain(source)) { return source; } // If the new value is a plain object but the first object value is not // we need to create a new object for the first object to merge with. // This makes it consistent with how merge() works by default // and also protects from later changes the to first object affecting // the second object's values. if (!isPlain(destination)) { return mergeOptions(source); } }; /** * Merge one or more options objects, recursively merging **only** * plain object properties. Previously `deepMerge`. * * @param {...Object} source One or more objects to merge * @returns {Object} a new object that is the union of all * provided objects * @function mergeOptions */ function mergeOptions() { // contruct the call dynamically to handle the variable number of // objects to merge var args = Array.prototype.slice.call(arguments); // unshift an empty object into the front of the call as the target // of the merge args.unshift({}); // customize conflict resolution to match our historical merge behavior args.push(customizer); _lodashCompatObjectMerge2['default'].apply(null, args); // return the mutated result object return args[0]; } module.exports = exports['default']; },{"lodash-compat/object/merge":37}],114:[function(_dereq_,module,exports){ 'use strict'; exports.__esModule = true; function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } var _globalDocument = _dereq_('global/document'); var _globalDocument2 = _interopRequireDefault(_globalDocument); var createStyleElement = function createStyleElement(className) { var style = _globalDocument2['default'].createElement('style'); style.className = className; return style; }; exports.createStyleElement = createStyleElement; var setTextContent = function setTextContent(el, content) { if (el.styleSheet) { el.styleSheet.cssText = content; } else { el.textContent = content; } }; exports.setTextContent = setTextContent; },{"global/document":1}],115:[function(_dereq_,module,exports){ /** * @file time-ranges.js * * Should create a fake TimeRange object * Mimics an HTML5 time range instance, which has functions that * return the start and end times for a range * TimeRanges are returned by the buffered() method * * @param {Number} start Start time in seconds * @param {Number} end End time in seconds * @return {Object} Fake TimeRange object * @private * @method createTimeRange */ 'use strict'; exports.__esModule = true; exports.createTimeRange = createTimeRange; function createTimeRange(_start, _end) { if (_start === undefined && _end === undefined) { return { length: 0, start: function start() { throw new Error('This TimeRanges object is empty'); }, end: function end() { throw new Error('This TimeRanges object is empty'); } }; } return { length: 1, start: function start() { return _start; }, end: function end() { return _end; } }; } },{}],116:[function(_dereq_,module,exports){ /** * @file to-title-case.js * * Uppercase the first letter of a string * * @param {String} string String to be uppercased * @return {String} * @private * @method toTitleCase */ "use strict"; exports.__esModule = true; function toTitleCase(string) { return string.charAt(0).toUpperCase() + string.slice(1); } exports["default"] = toTitleCase; module.exports = exports["default"]; },{}],117:[function(_dereq_,module,exports){ /** * @file url.js */ 'use strict'; exports.__esModule = true; function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } var _globalDocument = _dereq_('global/document'); var _globalDocument2 = _interopRequireDefault(_globalDocument); /** * Resolve and parse the elements of a URL * * @param {String} url The url to parse * @return {Object} An object of url details * @method parseUrl */ var parseUrl = function parseUrl(url) { var props = ['protocol', 'hostname', 'port', 'pathname', 'search', 'hash', 'host']; // add the url to an anchor and let the browser parse the URL var a = _globalDocument2['default'].createElement('a'); a.href = url; // IE8 (and 9?) Fix // ie8 doesn't parse the URL correctly until the anchor is actually // added to the body, and an innerHTML is needed to trigger the parsing var addToBody = a.host === '' && a.protocol !== 'file:'; var div = undefined; if (addToBody) { div = _globalDocument2['default'].createElement('div'); div.innerHTML = '<a href="' + url + '"></a>'; a = div.firstChild; // prevent the div from affecting layout div.setAttribute('style', 'display:none; position:absolute;'); _globalDocument2['default'].body.appendChild(div); } // Copy the specific URL properties to a new object // This is also needed for IE8 because the anchor loses its // properties when it's removed from the dom var details = {}; for (var i = 0; i < props.length; i++) { details[props[i]] = a[props[i]]; } // IE9 adds the port to the host property unlike everyone else. If // a port identifier is added for standard ports, strip it. if (details.protocol === 'http:') { details.host = details.host.replace(/:80$/, ''); } if (details.protocol === 'https:') { details.host = details.host.replace(/:443$/, ''); } if (addToBody) { _globalDocument2['default'].body.removeChild(div); } return details; }; exports.parseUrl = parseUrl; /** * Get absolute version of relative URL. Used to tell flash correct URL. * http://stackoverflow.com/questions/470832/getting-an-absolute-url-from-a-relative-one-ie6-issue * * @param {String} url URL to make absolute * @return {String} Absolute URL * @private * @method getAbsoluteURL */ var getAbsoluteURL = function getAbsoluteURL(url) { // Check if absolute URL if (!url.match(/^https?:\/\//)) { // Convert to absolute URL. Flash hosted off-site needs an absolute URL. var div = _globalDocument2['default'].createElement('div'); div.innerHTML = '<a href="' + url + '">x</a>'; url = div.firstChild.href; } return url; }; exports.getAbsoluteURL = getAbsoluteURL; /** * Returns the extension of the passed file name. It will return an empty string if you pass an invalid path * * @param {String} path The fileName path like '/path/to/file.mp4' * @returns {String} The extension in lower case or an empty string if no extension could be found. * @method getFileExtension */ var getFileExtension = function getFileExtension(path) { if (typeof path === 'string') { var splitPathRe = /^(\/?)([\s\S]*?)((?:\.{1,2}|[^\/]+?)(\.([^\.\/\?]+)))(?:[\/]*|[\?].*)$/i; var pathParts = splitPathRe.exec(path); if (pathParts) { return pathParts.pop().toLowerCase(); } } return ''; }; exports.getFileExtension = getFileExtension; },{"global/document":1}],118:[function(_dereq_,module,exports){ /** * @file video.js */ 'use strict'; exports.__esModule = true; function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj['default'] = obj; return newObj; } } function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } var _globalDocument = _dereq_('global/document'); var _globalDocument2 = _interopRequireDefault(_globalDocument); var _setup = _dereq_('./setup'); var setup = _interopRequireWildcard(_setup); var _utilsStylesheetJs = _dereq_('./utils/stylesheet.js'); var stylesheet = _interopRequireWildcard(_utilsStylesheetJs); var _component = _dereq_('./component'); var _component2 = _interopRequireDefault(_component); var _eventTarget = _dereq_('./event-target'); var _eventTarget2 = _interopRequireDefault(_eventTarget); var _utilsEventsJs = _dereq_('./utils/events.js'); var Events = _interopRequireWildcard(_utilsEventsJs); var _player = _dereq_('./player'); var _player2 = _interopRequireDefault(_player); var _pluginsJs = _dereq_('./plugins.js'); var _pluginsJs2 = _interopRequireDefault(_pluginsJs); var _srcJsUtilsMergeOptionsJs = _dereq_('../../src/js/utils/merge-options.js'); var _srcJsUtilsMergeOptionsJs2 = _interopRequireDefault(_srcJsUtilsMergeOptionsJs); var _utilsFnJs = _dereq_('./utils/fn.js'); var Fn = _interopRequireWildcard(_utilsFnJs); var _objectAssign = _dereq_('object.assign'); var _objectAssign2 = _interopRequireDefault(_objectAssign); var _utilsTimeRangesJs = _dereq_('./utils/time-ranges.js'); var _utilsFormatTimeJs = _dereq_('./utils/format-time.js'); var _utilsFormatTimeJs2 = _interopRequireDefault(_utilsFormatTimeJs); var _utilsLogJs = _dereq_('./utils/log.js'); var _utilsLogJs2 = _interopRequireDefault(_utilsLogJs); var _xhrJs = _dereq_('./xhr.js'); var _xhrJs2 = _interopRequireDefault(_xhrJs); var _utilsDomJs = _dereq_('./utils/dom.js'); var Dom = _interopRequireWildcard(_utilsDomJs); var _utilsBrowserJs = _dereq_('./utils/browser.js'); var browser = _interopRequireWildcard(_utilsBrowserJs); var _utilsUrlJs = _dereq_('./utils/url.js'); var Url = _interopRequireWildcard(_utilsUrlJs); var _extendsJs = _dereq_('./extends.js'); var _extendsJs2 = _interopRequireDefault(_extendsJs); var _lodashCompatObjectMerge = _dereq_('lodash-compat/object/merge'); var _lodashCompatObjectMerge2 = _interopRequireDefault(_lodashCompatObjectMerge); var _utilsCreateDeprecationProxyJs = _dereq_('./utils/create-deprecation-proxy.js'); var _utilsCreateDeprecationProxyJs2 = _interopRequireDefault(_utilsCreateDeprecationProxyJs); // Include the built-in techs var _techHtml5Js = _dereq_('./tech/html5.js'); var _techHtml5Js2 = _interopRequireDefault(_techHtml5Js); var _techFlashJs = _dereq_('./tech/flash.js'); var _techFlashJs2 = _interopRequireDefault(_techFlashJs); // HTML5 Element Shim for IE8 if (typeof HTMLVideoElement === 'undefined') { _globalDocument2['default'].createElement('video'); _globalDocument2['default'].createElement('audio'); _globalDocument2['default'].createElement('track'); } /** * Doubles as the main function for users to create a player instance and also * the main library object. * The `videojs` function can be used to initialize or retrieve a player. * ```js * var myPlayer = videojs('my_video_id'); * ``` * * @param {String|Element} id Video element or video element ID * @param {Object=} options Optional options object for config/settings * @param {Function=} ready Optional ready callback * @return {Player} A player instance * @mixes videojs * @method videojs */ var videojs = function videojs(id, options, ready) { var tag; // Element of ID // Allow for element or ID to be passed in // String ID if (typeof id === 'string') { // Adjust for jQuery ID syntax if (id.indexOf('#') === 0) { id = id.slice(1); } // If a player instance has already been created for this ID return it. if (videojs.getPlayers()[id]) { // If options or ready funtion are passed, warn if (options) { _utilsLogJs2['default'].warn('Player "' + id + '" is already initialised. Options will not be applied.'); } if (ready) { videojs.getPlayers()[id].ready(ready); } return videojs.getPlayers()[id]; // Otherwise get element for ID } else { tag = Dom.getEl(id); } // ID is a media element } else { tag = id; } // Check for a useable element if (!tag || !tag.nodeName) { // re: nodeName, could be a box div also throw new TypeError('The element or ID supplied is not valid. (videojs)'); // Returns } // Element may have a player attr referring to an already created player instance. // If not, set up a new player and return the instance. return tag['player'] || new _player2['default'](tag, options, ready); }; // Add default styles var style = stylesheet.createStyleElement('vjs-styles-defaults'); var head = _globalDocument2['default'].querySelector('head'); head.insertBefore(style, head.firstChild); stylesheet.setTextContent(style, '\n .video-js {\n width: 300px;\n height: 150px;\n'); // Run Auto-load players // You have to wait at least once in case this script is loaded after your video in the DOM (weird behavior only with minified version) setup.autoSetupTimeout(1, videojs); /* * Current software version (semver) * * @type {String} */ videojs.VERSION = '5.0.0-rc.83'; /** * The global options object. These are the settings that take effect * if no overrides are specified when the player is created. * * ```js * videojs.options.autoplay = true * // -> all players will autoplay by default * ``` * * @type {Object} */ videojs.options = _player2['default'].prototype.options_; /** * Get an object with the currently created players, keyed by player ID * * @return {Object} The created players * @mixes videojs * @method getPlayers */ videojs.getPlayers = function () { return _player2['default'].players; }; /** * For backward compatibility, expose players object. * * @deprecated * @memberOf videojs * @property {Object|Proxy} players */ videojs.players = _utilsCreateDeprecationProxyJs2['default'](_player2['default'].players, { get: 'Access to videojs.players is deprecated; use videojs.getPlayers instead', set: 'Modification of videojs.players is deprecated' }); /** * Get a component class object by name * ```js * var VjsButton = videojs.getComponent('Button'); * // Create a new instance of the component * var myButton = new VjsButton(myPlayer); * ``` * * @return {Component} Component identified by name * @mixes videojs * @method getComponent */ videojs.getComponent = _component2['default'].getComponent; /** * Register a component so it can referred to by name * Used when adding to other * components, either through addChild * `component.addChild('myComponent')` * or through default children options * `{ children: ['myComponent'] }`. * ```js * // Get a component to subclass * var VjsButton = videojs.getComponent('Button'); * // Subclass the component (see 'extends' doc for more info) * var MySpecialButton = videojs.extends(VjsButton, {}); * // Register the new component * VjsButton.registerComponent('MySepcialButton', MySepcialButton); * // (optionally) add the new component as a default player child * myPlayer.addChild('MySepcialButton'); * ``` * NOTE: You could also just initialize the component before adding. * `component.addChild(new MyComponent());` * * @param {String} The class name of the component * @param {Component} The component class * @return {Component} The newly registered component * @mixes videojs * @method registerComponent */ videojs.registerComponent = _component2['default'].registerComponent; /** * A suite of browser and device tests * * @type {Object} * @private */ videojs.browser = browser; /** * Whether or not the browser supports touch events. Included for backward * compatibility with 4.x, but deprecated. Use `videojs.browser.TOUCH_ENABLED` * instead going forward. * * @deprecated * @type {Boolean} */ videojs.TOUCH_ENABLED = browser.TOUCH_ENABLED; /** * Subclass an existing class * Mimics ES6 subclassing with the `extends` keyword * ```js * // Create a basic javascript 'class' * function MyClass(name){ * // Set a property at initialization * this.myName = name; * } * // Create an instance method * MyClass.prototype.sayMyName = function(){ * alert(this.myName); * }; * // Subclass the exisitng class and change the name * // when initializing * var MySubClass = videojs.extends(MyClass, { * constructor: function(name) { * // Call the super class constructor for the subclass * MyClass.call(this, name) * } * }); * // Create an instance of the new sub class * var myInstance = new MySubClass('John'); * myInstance.sayMyName(); // -> should alert "John" * ``` * * @param {Function} The Class to subclass * @param {Object} An object including instace methods for the new class * Optionally including a `constructor` function * @return {Function} The newly created subclass * @mixes videojs * @method extends */ videojs['extends'] = _extendsJs2['default']; /** * Merge two options objects recursively * Performs a deep merge like lodash.merge but **only merges plain objects** * (not arrays, elements, anything else) * Other values will be copied directly from the second object. * ```js * var defaultOptions = { * foo: true, * bar: { * a: true, * b: [1,2,3] * } * }; * var newOptions = { * foo: false, * bar: { * b: [4,5,6] * } * }; * var result = videojs.mergeOptions(defaultOptions, newOptions); * // result.foo = false; * // result.bar.a = true; * // result.bar.b = [4,5,6]; * ``` * * @param {Object} The options object whose values will be overriden * @param {Object} The options object with values to override the first * @param {Object} Any number of additional options objects * * @return {Object} a new object with the merged values * @mixes videojs * @method mergeOptions */ videojs.mergeOptions = _srcJsUtilsMergeOptionsJs2['default']; /** * Change the context (this) of a function * * videojs.bind(newContext, function(){ * this === newContext * }); * * NOTE: as of v5.0 we require an ES5 shim, so you should use the native * `function(){}.bind(newContext);` instead of this. * * @param {*} context The object to bind as scope * @param {Function} fn The function to be bound to a scope * @param {Number=} uid An optional unique ID for the function to be set * @return {Function} */ videojs.bind = Fn.bind; /** * Create a Video.js player plugin * Plugins are only initialized when options for the plugin are included * in the player options, or the plugin function on the player instance is * called. * **See the plugin guide in the docs for a more detailed example** * ```js * // Make a plugin that alerts when the player plays * videojs.plugin('myPlugin', function(myPluginOptions) { * myPluginOptions = myPluginOptions || {}; * * var player = this; * var alertText = myPluginOptions.text || 'Player is playing!' * * player.on('play', function(){ * alert(alertText); * }); * }); * // USAGE EXAMPLES * // EXAMPLE 1: New player with plugin options, call plugin immediately * var player1 = videojs('idOne', { * myPlugin: { * text: 'Custom text!' * } * }); * // Click play * // --> Should alert 'Custom text!' * // EXAMPLE 3: New player, initialize plugin later * var player3 = videojs('idThree'); * // Click play * // --> NO ALERT * // Click pause * // Initialize plugin using the plugin function on the player instance * player3.myPlugin({ * text: 'Plugin added later!' * }); * // Click play * // --> Should alert 'Plugin added later!' * ``` * * @param {String} The plugin name * @param {Function} The plugin function that will be called with options * @mixes videojs * @method plugin */ videojs.plugin = _pluginsJs2['default']; /** * Adding languages so that they're available to all players. * ```js * videojs.addLanguage('es', { 'Hello': 'Hola' }); * ``` * * @param {String} code The language code or dictionary property * @param {Object} data The data values to be translated * @return {Object} The resulting language dictionary object * @mixes videojs * @method addLanguage */ videojs.addLanguage = function (code, data) { var _merge; code = ('' + code).toLowerCase(); return _lodashCompatObjectMerge2['default'](videojs.options.languages, (_merge = {}, _merge[code] = data, _merge))[code]; }; /** * Log debug messages. * * @param {...Object} messages One or more messages to log */ videojs.log = _utilsLogJs2['default']; /** * Creates an emulated TimeRange object. * * @param {Number} start Start time in seconds * @param {Number} end End time in seconds * @return {Object} Fake TimeRange object * @method createTimeRange */ videojs.createTimeRange = _utilsTimeRangesJs.createTimeRange; /** * Format seconds as a time string, H:MM:SS or M:SS * Supplying a guide (in seconds) will force a number of leading zeros * to cover the length of the guide * * @param {Number} seconds Number of seconds to be turned into a string * @param {Number} guide Number (in seconds) to model the string after * @return {String} Time formatted as H:MM:SS or M:SS * @method formatTime */ videojs.formatTime = _utilsFormatTimeJs2['default']; /** * Simple http request for retrieving external files (e.g. text tracks) * * ##### Example * * // using url string * videojs.xhr('http://example.com/myfile.vtt', function(error, response, responseBody){}); * * // or options block * videojs.xhr({ * uri: 'http://example.com/myfile.vtt', * method: 'GET', * responseType: 'text' * }, function(error, response, responseBody){ * if (error) { * // log the error * } else { * // successful, do something with the response * } * }); * * * API is modeled after the Raynos/xhr. * https://github.com/Raynos/xhr/blob/master/index.js * * @param {Object|String} options Options block or URL string * @param {Function} callback The callback function * @returns {Object} The request */ videojs.xhr = _xhrJs2['default']; /** * Resolve and parse the elements of a URL * * @param {String} url The url to parse * @return {Object} An object of url details * @method parseUrl */ videojs.parseUrl = Url.parseUrl; /** * Event target class. * * @type {Function} */ videojs.EventTarget = _eventTarget2['default']; /** * Add an event listener to element * It stores the handler function in a separate cache object * and adds a generic handler to the element's event, * along with a unique id (guid) to the element. * * @param {Element|Object} elem Element or object to bind listeners to * @param {String|Array} type Type of event to bind to. * @param {Function} fn Event listener. * @method on */ videojs.on = Events.on; /** * Trigger a listener only once for an event * * @param {Element|Object} elem Element or object to * @param {String|Array} type Name/type of event * @param {Function} fn Event handler function * @method one */ videojs.one = Events.one; /** * Removes event listeners from an element * * @param {Element|Object} elem Object to remove listeners from * @param {String|Array=} type Type of listener to remove. Don't include to remove all events from element. * @param {Function} fn Specific listener to remove. Don't include to remove listeners for an event type. * @method off */ videojs.off = Events.off; /** * Trigger an event for an element * * @param {Element|Object} elem Element to trigger an event on * @param {Event|Object|String} event A string (the type) or an event object with a type attribute * @param {Object} [hash] data hash to pass along with the event * @return {Boolean=} Returned only if default was prevented * @method trigger */ videojs.trigger = Events.trigger; // REMOVING: We probably should add this to the migration plugin // // Expose but deprecate the window[componentName] method for accessing components // Object.getOwnPropertyNames(Component.components).forEach(function(name){ // let component = Component.components[name]; // // // A deprecation warning as the constuctor // module.exports[name] = function(player, options, ready){ // log.warn('Using videojs.'+name+' to access the '+name+' component has been deprecated. Please use videojs.getComponent("componentName")'); // // return new Component(player, options, ready); // }; // // // Allow the prototype and class methods to be accessible still this way // // Though anything that attempts to override class methods will no longer work // assign(module.exports[name], component); // }); /* * Custom Universal Module Definition (UMD) * * Video.js will never be a non-browser lib so we can simplify UMD a bunch and * still support requirejs and browserify. This also needs to be closure * compiler compatible, so string keys are used. */ if (typeof define === 'function' && define['amd']) { define('videojs', [], function () { return videojs; }); // checking that module is an object too because of umdjs/umd#35 } else if (typeof exports === 'object' && typeof module === 'object') { module['exports'] = videojs; } exports['default'] = videojs; module.exports = exports['default']; },{"../../src/js/utils/merge-options.js":113,"./component":48,"./event-target":79,"./extends.js":80,"./player":87,"./plugins.js":88,"./setup":90,"./tech/flash.js":93,"./tech/html5.js":94,"./utils/browser.js":104,"./utils/create-deprecation-proxy.js":106,"./utils/dom.js":107,"./utils/events.js":108,"./utils/fn.js":109,"./utils/format-time.js":110,"./utils/log.js":112,"./utils/stylesheet.js":114,"./utils/time-ranges.js":115,"./utils/url.js":117,"./xhr.js":119,"global/document":1,"lodash-compat/object/merge":37,"object.assign":40}],119:[function(_dereq_,module,exports){ /** * @file xhr.js */ 'use strict'; exports.__esModule = true; function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj['default'] = obj; return newObj; } } var _utilsUrlJs = _dereq_('./utils/url.js'); var Url = _interopRequireWildcard(_utilsUrlJs); var _utilsLogJs = _dereq_('./utils/log.js'); var _utilsLogJs2 = _interopRequireDefault(_utilsLogJs); var _utilsMergeOptionsJs = _dereq_('./utils/merge-options.js'); var _utilsMergeOptionsJs2 = _interopRequireDefault(_utilsMergeOptionsJs); var _globalWindow = _dereq_('global/window'); var _globalWindow2 = _interopRequireDefault(_globalWindow); /* * Simple http request for retrieving external files (e.g. text tracks) * ##### Example * // using url string * videojs.xhr('http://example.com/myfile.vtt', function(error, response, responseBody){}); * * // or options block * videojs.xhr({ * uri: 'http://example.com/myfile.vtt', * method: 'GET', * responseType: 'text' * }, function(error, response, responseBody){ * if (error) { * // log the error * } else { * // successful, do something with the response * } * }); * ///////////// * API is modeled after the Raynos/xhr, which we hope to use after * getting browserify implemented. * https://github.com/Raynos/xhr/blob/master/index.js * * @param {Object|String} options Options block or URL string * @param {Function} callback The callback function * @return {Object} The request * @method xhr */ var xhr = function xhr(options, callback) { var abortTimeout = undefined; // If options is a string it's the url if (typeof options === 'string') { options = { uri: options }; } // Merge with default options options = _utilsMergeOptionsJs2['default']({ method: 'GET', timeout: 45 * 1000 }, options); callback = callback || function () {}; var XHR = _globalWindow2['default'].XMLHttpRequest; if (typeof XHR === 'undefined') { // Shim XMLHttpRequest for older IEs XHR = function () { try { return new _globalWindow2['default'].ActiveXObject('Msxml2.XMLHTTP.6.0'); } catch (e) {} try { return new _globalWindow2['default'].ActiveXObject('Msxml2.XMLHTTP.3.0'); } catch (f) {} try { return new _globalWindow2['default'].ActiveXObject('Msxml2.XMLHTTP'); } catch (g) {} throw new Error('This browser does not support XMLHttpRequest.'); }; } var request = new XHR(); // Store a reference to the url on the request instance request.uri = options.uri; var urlInfo = Url.parseUrl(options.uri); var winLoc = _globalWindow2['default'].location; var successHandler = function successHandler() { _globalWindow2['default'].clearTimeout(abortTimeout); callback(null, request, request.response || request.responseText); }; var errorHandler = function errorHandler(err) { _globalWindow2['default'].clearTimeout(abortTimeout); if (!err || typeof err === 'string') { err = new Error(err || 'XHR Failed with a response of: ' + (request && (request.response || request.responseText))); } callback(err, request); }; // Check if url is for another domain/origin // IE8 doesn't know location.origin, so we won't rely on it here var crossOrigin = urlInfo.protocol + urlInfo.host !== winLoc.protocol + winLoc.host; // XDomainRequest -- Use for IE if XMLHTTPRequest2 isn't available // 'withCredentials' is only available in XMLHTTPRequest2 // Also XDomainRequest has a lot of gotchas, so only use if cross domain if (crossOrigin && _globalWindow2['default'].XDomainRequest && !('withCredentials' in request)) { request = new _globalWindow2['default'].XDomainRequest(); request.onload = successHandler; request.onerror = errorHandler; // These blank handlers need to be set to fix ie9 // http://cypressnorth.com/programming/internet-explorer-aborting-ajax-requests-fixed/ request.onprogress = function () {}; request.ontimeout = function () {}; // XMLHTTPRequest } else { (function () { var fileUrl = urlInfo.protocol === 'file:' || winLoc.protocol === 'file:'; request.onreadystatechange = function () { if (request.readyState === 4) { if (request.timedout) { return errorHandler('timeout'); } if (request.status === 200 || fileUrl && request.status === 0) { successHandler(); } else { errorHandler(); } } }; if (options.timeout) { abortTimeout = _globalWindow2['default'].setTimeout(function () { if (request.readyState !== 4) { request.timedout = true; request.abort(); } }, options.timeout); } })(); } // open the connection try { // Third arg is async, or ignored by XDomainRequest request.open(options.method || 'GET', options.uri, true); } catch (err) { return errorHandler(err); } // withCredentials only supported by XMLHttpRequest2 if (options.withCredentials) { request.withCredentials = true; } if (options.responseType) { request.responseType = options.responseType; } // send the request try { request.send(); } catch (err) { return errorHandler(err); } return request; }; exports['default'] = xhr; module.exports = exports['default']; },{"./utils/log.js":112,"./utils/merge-options.js":113,"./utils/url.js":117,"global/window":2}]},{},[118])(118) }); //# sourceMappingURL=video.js.map /* vtt.js - v0.12.1 (https://github.com/mozilla/vtt.js) built on 08-07-2015 */ (function(root) { var vttjs = root.vttjs = {}; var cueShim = vttjs.VTTCue; var regionShim = vttjs.VTTRegion; var oldVTTCue = root.VTTCue; var oldVTTRegion = root.VTTRegion; vttjs.shim = function() { vttjs.VTTCue = cueShim; vttjs.VTTRegion = regionShim; }; vttjs.restore = function() { vttjs.VTTCue = oldVTTCue; vttjs.VTTRegion = oldVTTRegion; }; }(this)); /** * Copyright 2013 vtt.js Contributors * * 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 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ (function(root, vttjs) { var autoKeyword = "auto"; var directionSetting = { "": true, "lr": true, "rl": true }; var alignSetting = { "start": true, "middle": true, "end": true, "left": true, "right": true }; function findDirectionSetting(value) { if (typeof value !== "string") { return false; } var dir = directionSetting[value.toLowerCase()]; return dir ? value.toLowerCase() : false; } function findAlignSetting(value) { if (typeof value !== "string") { return false; } var align = alignSetting[value.toLowerCase()]; return align ? value.toLowerCase() : false; } function extend(obj) { var i = 1; for (; i < arguments.length; i++) { var cobj = arguments[i]; for (var p in cobj) { obj[p] = cobj[p]; } } return obj; } function VTTCue(startTime, endTime, text) { var cue = this; var isIE8 = (/MSIE\s8\.0/).test(navigator.userAgent); var baseObj = {}; if (isIE8) { cue = document.createElement('custom'); } else { baseObj.enumerable = true; } /** * Shim implementation specific properties. These properties are not in * the spec. */ // Lets us know when the VTTCue's data has changed in such a way that we need // to recompute its display state. This lets us compute its display state // lazily. cue.hasBeenReset = false; /** * VTTCue and TextTrackCue properties * http://dev.w3.org/html5/webvtt/#vttcue-interface */ var _id = ""; var _pauseOnExit = false; var _startTime = startTime; var _endTime = endTime; var _text = text; var _region = null; var _vertical = ""; var _snapToLines = true; var _line = "auto"; var _lineAlign = "start"; var _position = 50; var _positionAlign = "middle"; var _size = 50; var _align = "middle"; Object.defineProperty(cue, "id", extend({}, baseObj, { get: function() { return _id; }, set: function(value) { _id = "" + value; } })); Object.defineProperty(cue, "pauseOnExit", extend({}, baseObj, { get: function() { return _pauseOnExit; }, set: function(value) { _pauseOnExit = !!value; } })); Object.defineProperty(cue, "startTime", extend({}, baseObj, { get: function() { return _startTime; }, set: function(value) { if (typeof value !== "number") { throw new TypeError("Start time must be set to a number."); } _startTime = value; this.hasBeenReset = true; } })); Object.defineProperty(cue, "endTime", extend({}, baseObj, { get: function() { return _endTime; }, set: function(value) { if (typeof value !== "number") { throw new TypeError("End time must be set to a number."); } _endTime = value; this.hasBeenReset = true; } })); Object.defineProperty(cue, "text", extend({}, baseObj, { get: function() { return _text; }, set: function(value) { _text = "" + value; this.hasBeenReset = true; } })); Object.defineProperty(cue, "region", extend({}, baseObj, { get: function() { return _region; }, set: function(value) { _region = value; this.hasBeenReset = true; } })); Object.defineProperty(cue, "vertical", extend({}, baseObj, { get: function() { return _vertical; }, set: function(value) { var setting = findDirectionSetting(value); // Have to check for false because the setting an be an empty string. if (setting === false) { throw new SyntaxError("An invalid or illegal string was specified."); } _vertical = setting; this.hasBeenReset = true; } })); Object.defineProperty(cue, "snapToLines", extend({}, baseObj, { get: function() { return _snapToLines; }, set: function(value) { _snapToLines = !!value; this.hasBeenReset = true; } })); Object.defineProperty(cue, "line", extend({}, baseObj, { get: function() { return _line; }, set: function(value) { if (typeof value !== "number" && value !== autoKeyword) { throw new SyntaxError("An invalid number or illegal string was specified."); } _line = value; this.hasBeenReset = true; } })); Object.defineProperty(cue, "lineAlign", extend({}, baseObj, { get: function() { return _lineAlign; }, set: function(value) { var setting = findAlignSetting(value); if (!setting) { throw new SyntaxError("An invalid or illegal string was specified."); } _lineAlign = setting; this.hasBeenReset = true; } })); Object.defineProperty(cue, "position", extend({}, baseObj, { get: function() { return _position; }, set: function(value) { if (value < 0 || value > 100) { throw new Error("Position must be between 0 and 100."); } _position = value; this.hasBeenReset = true; } })); Object.defineProperty(cue, "positionAlign", extend({}, baseObj, { get: function() { return _positionAlign; }, set: function(value) { var setting = findAlignSetting(value); if (!setting) { throw new SyntaxError("An invalid or illegal string was specified."); } _positionAlign = setting; this.hasBeenReset = true; } })); Object.defineProperty(cue, "size", extend({}, baseObj, { get: function() { return _size; }, set: function(value) { if (value < 0 || value > 100) { throw new Error("Size must be between 0 and 100."); } _size = value; this.hasBeenReset = true; } })); Object.defineProperty(cue, "align", extend({}, baseObj, { get: function() { return _align; }, set: function(value) { var setting = findAlignSetting(value); if (!setting) { throw new SyntaxError("An invalid or illegal string was specified."); } _align = setting; this.hasBeenReset = true; } })); /** * Other <track> spec defined properties */ // http://www.whatwg.org/specs/web-apps/current-work/multipage/the-video-element.html#text-track-cue-display-state cue.displayState = undefined; if (isIE8) { return cue; } } /** * VTTCue methods */ VTTCue.prototype.getCueAsHTML = function() { // Assume WebVTT.convertCueToDOMTree is on the global. return WebVTT.convertCueToDOMTree(window, this.text); }; root.VTTCue = root.VTTCue || VTTCue; vttjs.VTTCue = VTTCue; }(this, (this.vttjs || {}))); /** * Copyright 2013 vtt.js Contributors * * 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 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ (function(root, vttjs) { var scrollSetting = { "": true, "up": true }; function findScrollSetting(value) { if (typeof value !== "string") { return false; } var scroll = scrollSetting[value.toLowerCase()]; return scroll ? value.toLowerCase() : false; } function isValidPercentValue(value) { return typeof value === "number" && (value >= 0 && value <= 100); } // VTTRegion shim http://dev.w3.org/html5/webvtt/#vttregion-interface function VTTRegion() { var _width = 100; var _lines = 3; var _regionAnchorX = 0; var _regionAnchorY = 100; var _viewportAnchorX = 0; var _viewportAnchorY = 100; var _scroll = ""; Object.defineProperties(this, { "width": { enumerable: true, get: function() { return _width; }, set: function(value) { if (!isValidPercentValue(value)) { throw new Error("Width must be between 0 and 100."); } _width = value; } }, "lines": { enumerable: true, get: function() { return _lines; }, set: function(value) { if (typeof value !== "number") { throw new TypeError("Lines must be set to a number."); } _lines = value; } }, "regionAnchorY": { enumerable: true, get: function() { return _regionAnchorY; }, set: function(value) { if (!isValidPercentValue(value)) { throw new Error("RegionAnchorX must be between 0 and 100."); } _regionAnchorY = value; } }, "regionAnchorX": { enumerable: true, get: function() { return _regionAnchorX; }, set: function(value) { if(!isValidPercentValue(value)) { throw new Error("RegionAnchorY must be between 0 and 100."); } _regionAnchorX = value; } }, "viewportAnchorY": { enumerable: true, get: function() { return _viewportAnchorY; }, set: function(value) { if (!isValidPercentValue(value)) { throw new Error("ViewportAnchorY must be between 0 and 100."); } _viewportAnchorY = value; } }, "viewportAnchorX": { enumerable: true, get: function() { return _viewportAnchorX; }, set: function(value) { if (!isValidPercentValue(value)) { throw new Error("ViewportAnchorX must be between 0 and 100."); } _viewportAnchorX = value; } }, "scroll": { enumerable: true, get: function() { return _scroll; }, set: function(value) { var setting = findScrollSetting(value); // Have to check for false as an empty string is a legal value. if (setting === false) { throw new SyntaxError("An invalid or illegal string was specified."); } _scroll = setting; } } }); } root.VTTRegion = root.VTTRegion || VTTRegion; vttjs.VTTRegion = VTTRegion; }(this, (this.vttjs || {}))); /** * Copyright 2013 vtt.js Contributors * * 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 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* -*- Mode: Java; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ /* vim: set shiftwidth=2 tabstop=2 autoindent cindent expandtab: */ (function(global) { var _objCreate = Object.create || (function() { function F() {} return function(o) { if (arguments.length !== 1) { throw new Error('Object.create shim only accepts one parameter.'); } F.prototype = o; return new F(); }; })(); // Creates a new ParserError object from an errorData object. The errorData // object should have default code and message properties. The default message // property can be overriden by passing in a message parameter. // See ParsingError.Errors below for acceptable errors. function ParsingError(errorData, message) { this.name = "ParsingError"; this.code = errorData.code; this.message = message || errorData.message; } ParsingError.prototype = _objCreate(Error.prototype); ParsingError.prototype.constructor = ParsingError; // ParsingError metadata for acceptable ParsingErrors. ParsingError.Errors = { BadSignature: { code: 0, message: "Malformed WebVTT signature." }, BadTimeStamp: { code: 1, message: "Malformed time stamp." } }; // Try to parse input as a time stamp. function parseTimeStamp(input) { function computeSeconds(h, m, s, f) { return (h | 0) * 3600 + (m | 0) * 60 + (s | 0) + (f | 0) / 1000; } var m = input.match(/^(\d+):(\d{2})(:\d{2})?\.(\d{3})/); if (!m) { return null; } if (m[3]) { // Timestamp takes the form of [hours]:[minutes]:[seconds].[milliseconds] return computeSeconds(m[1], m[2], m[3].replace(":", ""), m[4]); } else if (m[1] > 59) { // Timestamp takes the form of [hours]:[minutes].[milliseconds] // First position is hours as it's over 59. return computeSeconds(m[1], m[2], 0, m[4]); } else { // Timestamp takes the form of [minutes]:[seconds].[milliseconds] return computeSeconds(0, m[1], m[2], m[4]); } } // A settings object holds key/value pairs and will ignore anything but the first // assignment to a specific key. function Settings() { this.values = _objCreate(null); } Settings.prototype = { // Only accept the first assignment to any key. set: function(k, v) { if (!this.get(k) && v !== "") { this.values[k] = v; } }, // Return the value for a key, or a default value. // If 'defaultKey' is passed then 'dflt' is assumed to be an object with // a number of possible default values as properties where 'defaultKey' is // the key of the property that will be chosen; otherwise it's assumed to be // a single value. get: function(k, dflt, defaultKey) { if (defaultKey) { return this.has(k) ? this.values[k] : dflt[defaultKey]; } return this.has(k) ? this.values[k] : dflt; }, // Check whether we have a value for a key. has: function(k) { return k in this.values; }, // Accept a setting if its one of the given alternatives. alt: function(k, v, a) { for (var n = 0; n < a.length; ++n) { if (v === a[n]) { this.set(k, v); break; } } }, // Accept a setting if its a valid (signed) integer. integer: function(k, v) { if (/^-?\d+$/.test(v)) { // integer this.set(k, parseInt(v, 10)); } }, // Accept a setting if its a valid percentage. percent: function(k, v) { var m; if ((m = v.match(/^([\d]{1,3})(\.[\d]*)?%$/))) { v = parseFloat(v); if (v >= 0 && v <= 100) { this.set(k, v); return true; } } return false; } }; // Helper function to parse input into groups separated by 'groupDelim', and // interprete each group as a key/value pair separated by 'keyValueDelim'. function parseOptions(input, callback, keyValueDelim, groupDelim) { var groups = groupDelim ? input.split(groupDelim) : [input]; for (var i in groups) { if (typeof groups[i] !== "string") { continue; } var kv = groups[i].split(keyValueDelim); if (kv.length !== 2) { continue; } var k = kv[0]; var v = kv[1]; callback(k, v); } } function parseCue(input, cue, regionList) { // Remember the original input if we need to throw an error. var oInput = input; // 4.1 WebVTT timestamp function consumeTimeStamp() { var ts = parseTimeStamp(input); if (ts === null) { throw new ParsingError(ParsingError.Errors.BadTimeStamp, "Malformed timestamp: " + oInput); } // Remove time stamp from input. input = input.replace(/^[^\sa-zA-Z-]+/, ""); return ts; } // 4.4.2 WebVTT cue settings function consumeCueSettings(input, cue) { var settings = new Settings(); parseOptions(input, function (k, v) { switch (k) { case "region": // Find the last region we parsed with the same region id. for (var i = regionList.length - 1; i >= 0; i--) { if (regionList[i].id === v) { settings.set(k, regionList[i].region); break; } } break; case "vertical": settings.alt(k, v, ["rl", "lr"]); break; case "line": var vals = v.split(","), vals0 = vals[0]; settings.integer(k, vals0); settings.percent(k, vals0) ? settings.set("snapToLines", false) : null; settings.alt(k, vals0, ["auto"]); if (vals.length === 2) { settings.alt("lineAlign", vals[1], ["start", "middle", "end"]); } break; case "position": vals = v.split(","); settings.percent(k, vals[0]); if (vals.length === 2) { settings.alt("positionAlign", vals[1], ["start", "middle", "end"]); } break; case "size": settings.percent(k, v); break; case "align": settings.alt(k, v, ["start", "middle", "end", "left", "right"]); break; } }, /:/, /\s/); // Apply default values for any missing fields. cue.region = settings.get("region", null); cue.vertical = settings.get("vertical", ""); cue.line = settings.get("line", "auto"); cue.lineAlign = settings.get("lineAlign", "start"); cue.snapToLines = settings.get("snapToLines", true); cue.size = settings.get("size", 100); cue.align = settings.get("align", "middle"); cue.position = settings.get("position", { start: 0, left: 0, middle: 50, end: 100, right: 100 }, cue.align); cue.positionAlign = settings.get("positionAlign", { start: "start", left: "start", middle: "middle", end: "end", right: "end" }, cue.align); } function skipWhitespace() { input = input.replace(/^\s+/, ""); } // 4.1 WebVTT cue timings. skipWhitespace(); cue.startTime = consumeTimeStamp(); // (1) collect cue start time skipWhitespace(); if (input.substr(0, 3) !== "-->") { // (3) next characters must match "-->" throw new ParsingError(ParsingError.Errors.BadTimeStamp, "Malformed time stamp (time stamps must be separated by '-->'): " + oInput); } input = input.substr(3); skipWhitespace(); cue.endTime = consumeTimeStamp(); // (5) collect cue end time // 4.1 WebVTT cue settings list. skipWhitespace(); consumeCueSettings(input, cue); } var ESCAPE = { "&amp;": "&", "&lt;": "<", "&gt;": ">", "&lrm;": "\u200e", "&rlm;": "\u200f", "&nbsp;": "\u00a0" }; var TAG_NAME = { c: "span", i: "i", b: "b", u: "u", ruby: "ruby", rt: "rt", v: "span", lang: "span" }; var TAG_ANNOTATION = { v: "title", lang: "lang" }; var NEEDS_PARENT = { rt: "ruby" }; // Parse content into a document fragment. function parseContent(window, input) { function nextToken() { // Check for end-of-string. if (!input) { return null; } // Consume 'n' characters from the input. function consume(result) { input = input.substr(result.length); return result; } var m = input.match(/^([^<]*)(<[^>]+>?)?/); // If there is some text before the next tag, return it, otherwise return // the tag. return consume(m[1] ? m[1] : m[2]); } // Unescape a string 's'. function unescape1(e) { return ESCAPE[e]; } function unescape(s) { while ((m = s.match(/&(amp|lt|gt|lrm|rlm|nbsp);/))) { s = s.replace(m[0], unescape1); } return s; } function shouldAdd(current, element) { return !NEEDS_PARENT[element.localName] || NEEDS_PARENT[element.localName] === current.localName; } // Create an element for this tag. function createElement(type, annotation) { var tagName = TAG_NAME[type]; if (!tagName) { return null; } var element = window.document.createElement(tagName); element.localName = tagName; var name = TAG_ANNOTATION[type]; if (name && annotation) { element[name] = annotation.trim(); } return element; } var rootDiv = window.document.createElement("div"), current = rootDiv, t, tagStack = []; while ((t = nextToken()) !== null) { if (t[0] === '<') { if (t[1] === "/") { // If the closing tag matches, move back up to the parent node. if (tagStack.length && tagStack[tagStack.length - 1] === t.substr(2).replace(">", "")) { tagStack.pop(); current = current.parentNode; } // Otherwise just ignore the end tag. continue; } var ts = parseTimeStamp(t.substr(1, t.length - 2)); var node; if (ts) { // Timestamps are lead nodes as well. node = window.document.createProcessingInstruction("timestamp", ts); current.appendChild(node); continue; } var m = t.match(/^<([^.\s/0-9>]+)(\.[^\s\\>]+)?([^>\\]+)?(\\?)>?$/); // If we can't parse the tag, skip to the next tag. if (!m) { continue; } // Try to construct an element, and ignore the tag if we couldn't. node = createElement(m[1], m[3]); if (!node) { continue; } // Determine if the tag should be added based on the context of where it // is placed in the cuetext. if (!shouldAdd(current, node)) { continue; } // Set the class list (as a list of classes, separated by space). if (m[2]) { node.className = m[2].substr(1).replace('.', ' '); } // Append the node to the current node, and enter the scope of the new // node. tagStack.push(m[1]); current.appendChild(node); current = node; continue; } // Text nodes are leaf nodes. current.appendChild(window.document.createTextNode(unescape(t))); } return rootDiv; } // This is a list of all the Unicode characters that have a strong // right-to-left category. What this means is that these characters are // written right-to-left for sure. It was generated by pulling all the strong // right-to-left characters out of the Unicode data table. That table can // found at: http://www.unicode.org/Public/UNIDATA/UnicodeData.txt var strongRTLChars = [0x05BE, 0x05C0, 0x05C3, 0x05C6, 0x05D0, 0x05D1, 0x05D2, 0x05D3, 0x05D4, 0x05D5, 0x05D6, 0x05D7, 0x05D8, 0x05D9, 0x05DA, 0x05DB, 0x05DC, 0x05DD, 0x05DE, 0x05DF, 0x05E0, 0x05E1, 0x05E2, 0x05E3, 0x05E4, 0x05E5, 0x05E6, 0x05E7, 0x05E8, 0x05E9, 0x05EA, 0x05F0, 0x05F1, 0x05F2, 0x05F3, 0x05F4, 0x0608, 0x060B, 0x060D, 0x061B, 0x061E, 0x061F, 0x0620, 0x0621, 0x0622, 0x0623, 0x0624, 0x0625, 0x0626, 0x0627, 0x0628, 0x0629, 0x062A, 0x062B, 0x062C, 0x062D, 0x062E, 0x062F, 0x0630, 0x0631, 0x0632, 0x0633, 0x0634, 0x0635, 0x0636, 0x0637, 0x0638, 0x0639, 0x063A, 0x063B, 0x063C, 0x063D, 0x063E, 0x063F, 0x0640, 0x0641, 0x0642, 0x0643, 0x0644, 0x0645, 0x0646, 0x0647, 0x0648, 0x0649, 0x064A, 0x066D, 0x066E, 0x066F, 0x0671, 0x0672, 0x0673, 0x0674, 0x0675, 0x0676, 0x0677, 0x0678, 0x0679, 0x067A, 0x067B, 0x067C, 0x067D, 0x067E, 0x067F, 0x0680, 0x0681, 0x0682, 0x0683, 0x0684, 0x0685, 0x0686, 0x0687, 0x0688, 0x0689, 0x068A, 0x068B, 0x068C, 0x068D, 0x068E, 0x068F, 0x0690, 0x0691, 0x0692, 0x0693, 0x0694, 0x0695, 0x0696, 0x0697, 0x0698, 0x0699, 0x069A, 0x069B, 0x069C, 0x069D, 0x069E, 0x069F, 0x06A0, 0x06A1, 0x06A2, 0x06A3, 0x06A4, 0x06A5, 0x06A6, 0x06A7, 0x06A8, 0x06A9, 0x06AA, 0x06AB, 0x06AC, 0x06AD, 0x06AE, 0x06AF, 0x06B0, 0x06B1, 0x06B2, 0x06B3, 0x06B4, 0x06B5, 0x06B6, 0x06B7, 0x06B8, 0x06B9, 0x06BA, 0x06BB, 0x06BC, 0x06BD, 0x06BE, 0x06BF, 0x06C0, 0x06C1, 0x06C2, 0x06C3, 0x06C4, 0x06C5, 0x06C6, 0x06C7, 0x06C8, 0x06C9, 0x06CA, 0x06CB, 0x06CC, 0x06CD, 0x06CE, 0x06CF, 0x06D0, 0x06D1, 0x06D2, 0x06D3, 0x06D4, 0x06D5, 0x06E5, 0x06E6, 0x06EE, 0x06EF, 0x06FA, 0x06FB, 0x06FC, 0x06FD, 0x06FE, 0x06FF, 0x0700, 0x0701, 0x0702, 0x0703, 0x0704, 0x0705, 0x0706, 0x0707, 0x0708, 0x0709, 0x070A, 0x070B, 0x070C, 0x070D, 0x070F, 0x0710, 0x0712, 0x0713, 0x0714, 0x0715, 0x0716, 0x0717, 0x0718, 0x0719, 0x071A, 0x071B, 0x071C, 0x071D, 0x071E, 0x071F, 0x0720, 0x0721, 0x0722, 0x0723, 0x0724, 0x0725, 0x0726, 0x0727, 0x0728, 0x0729, 0x072A, 0x072B, 0x072C, 0x072D, 0x072E, 0x072F, 0x074D, 0x074E, 0x074F, 0x0750, 0x0751, 0x0752, 0x0753, 0x0754, 0x0755, 0x0756, 0x0757, 0x0758, 0x0759, 0x075A, 0x075B, 0x075C, 0x075D, 0x075E, 0x075F, 0x0760, 0x0761, 0x0762, 0x0763, 0x0764, 0x0765, 0x0766, 0x0767, 0x0768, 0x0769, 0x076A, 0x076B, 0x076C, 0x076D, 0x076E, 0x076F, 0x0770, 0x0771, 0x0772, 0x0773, 0x0774, 0x0775, 0x0776, 0x0777, 0x0778, 0x0779, 0x077A, 0x077B, 0x077C, 0x077D, 0x077E, 0x077F, 0x0780, 0x0781, 0x0782, 0x0783, 0x0784, 0x0785, 0x0786, 0x0787, 0x0788, 0x0789, 0x078A, 0x078B, 0x078C, 0x078D, 0x078E, 0x078F, 0x0790, 0x0791, 0x0792, 0x0793, 0x0794, 0x0795, 0x0796, 0x0797, 0x0798, 0x0799, 0x079A, 0x079B, 0x079C, 0x079D, 0x079E, 0x079F, 0x07A0, 0x07A1, 0x07A2, 0x07A3, 0x07A4, 0x07A5, 0x07B1, 0x07C0, 0x07C1, 0x07C2, 0x07C3, 0x07C4, 0x07C5, 0x07C6, 0x07C7, 0x07C8, 0x07C9, 0x07CA, 0x07CB, 0x07CC, 0x07CD, 0x07CE, 0x07CF, 0x07D0, 0x07D1, 0x07D2, 0x07D3, 0x07D4, 0x07D5, 0x07D6, 0x07D7, 0x07D8, 0x07D9, 0x07DA, 0x07DB, 0x07DC, 0x07DD, 0x07DE, 0x07DF, 0x07E0, 0x07E1, 0x07E2, 0x07E3, 0x07E4, 0x07E5, 0x07E6, 0x07E7, 0x07E8, 0x07E9, 0x07EA, 0x07F4, 0x07F5, 0x07FA, 0x0800, 0x0801, 0x0802, 0x0803, 0x0804, 0x0805, 0x0806, 0x0807, 0x0808, 0x0809, 0x080A, 0x080B, 0x080C, 0x080D, 0x080E, 0x080F, 0x0810, 0x0811, 0x0812, 0x0813, 0x0814, 0x0815, 0x081A, 0x0824, 0x0828, 0x0830, 0x0831, 0x0832, 0x0833, 0x0834, 0x0835, 0x0836, 0x0837, 0x0838, 0x0839, 0x083A, 0x083B, 0x083C, 0x083D, 0x083E, 0x0840, 0x0841, 0x0842, 0x0843, 0x0844, 0x0845, 0x0846, 0x0847, 0x0848, 0x0849, 0x084A, 0x084B, 0x084C, 0x084D, 0x084E, 0x084F, 0x0850, 0x0851, 0x0852, 0x0853, 0x0854, 0x0855, 0x0856, 0x0857, 0x0858, 0x085E, 0x08A0, 0x08A2, 0x08A3, 0x08A4, 0x08A5, 0x08A6, 0x08A7, 0x08A8, 0x08A9, 0x08AA, 0x08AB, 0x08AC, 0x200F, 0xFB1D, 0xFB1F, 0xFB20, 0xFB21, 0xFB22, 0xFB23, 0xFB24, 0xFB25, 0xFB26, 0xFB27, 0xFB28, 0xFB2A, 0xFB2B, 0xFB2C, 0xFB2D, 0xFB2E, 0xFB2F, 0xFB30, 0xFB31, 0xFB32, 0xFB33, 0xFB34, 0xFB35, 0xFB36, 0xFB38, 0xFB39, 0xFB3A, 0xFB3B, 0xFB3C, 0xFB3E, 0xFB40, 0xFB41, 0xFB43, 0xFB44, 0xFB46, 0xFB47, 0xFB48, 0xFB49, 0xFB4A, 0xFB4B, 0xFB4C, 0xFB4D, 0xFB4E, 0xFB4F, 0xFB50, 0xFB51, 0xFB52, 0xFB53, 0xFB54, 0xFB55, 0xFB56, 0xFB57, 0xFB58, 0xFB59, 0xFB5A, 0xFB5B, 0xFB5C, 0xFB5D, 0xFB5E, 0xFB5F, 0xFB60, 0xFB61, 0xFB62, 0xFB63, 0xFB64, 0xFB65, 0xFB66, 0xFB67, 0xFB68, 0xFB69, 0xFB6A, 0xFB6B, 0xFB6C, 0xFB6D, 0xFB6E, 0xFB6F, 0xFB70, 0xFB71, 0xFB72, 0xFB73, 0xFB74, 0xFB75, 0xFB76, 0xFB77, 0xFB78, 0xFB79, 0xFB7A, 0xFB7B, 0xFB7C, 0xFB7D, 0xFB7E, 0xFB7F, 0xFB80, 0xFB81, 0xFB82, 0xFB83, 0xFB84, 0xFB85, 0xFB86, 0xFB87, 0xFB88, 0xFB89, 0xFB8A, 0xFB8B, 0xFB8C, 0xFB8D, 0xFB8E, 0xFB8F, 0xFB90, 0xFB91, 0xFB92, 0xFB93, 0xFB94, 0xFB95, 0xFB96, 0xFB97, 0xFB98, 0xFB99, 0xFB9A, 0xFB9B, 0xFB9C, 0xFB9D, 0xFB9E, 0xFB9F, 0xFBA0, 0xFBA1, 0xFBA2, 0xFBA3, 0xFBA4, 0xFBA5, 0xFBA6, 0xFBA7, 0xFBA8, 0xFBA9, 0xFBAA, 0xFBAB, 0xFBAC, 0xFBAD, 0xFBAE, 0xFBAF, 0xFBB0, 0xFBB1, 0xFBB2, 0xFBB3, 0xFBB4, 0xFBB5, 0xFBB6, 0xFBB7, 0xFBB8, 0xFBB9, 0xFBBA, 0xFBBB, 0xFBBC, 0xFBBD, 0xFBBE, 0xFBBF, 0xFBC0, 0xFBC1, 0xFBD3, 0xFBD4, 0xFBD5, 0xFBD6, 0xFBD7, 0xFBD8, 0xFBD9, 0xFBDA, 0xFBDB, 0xFBDC, 0xFBDD, 0xFBDE, 0xFBDF, 0xFBE0, 0xFBE1, 0xFBE2, 0xFBE3, 0xFBE4, 0xFBE5, 0xFBE6, 0xFBE7, 0xFBE8, 0xFBE9, 0xFBEA, 0xFBEB, 0xFBEC, 0xFBED, 0xFBEE, 0xFBEF, 0xFBF0, 0xFBF1, 0xFBF2, 0xFBF3, 0xFBF4, 0xFBF5, 0xFBF6, 0xFBF7, 0xFBF8, 0xFBF9, 0xFBFA, 0xFBFB, 0xFBFC, 0xFBFD, 0xFBFE, 0xFBFF, 0xFC00, 0xFC01, 0xFC02, 0xFC03, 0xFC04, 0xFC05, 0xFC06, 0xFC07, 0xFC08, 0xFC09, 0xFC0A, 0xFC0B, 0xFC0C, 0xFC0D, 0xFC0E, 0xFC0F, 0xFC10, 0xFC11, 0xFC12, 0xFC13, 0xFC14, 0xFC15, 0xFC16, 0xFC17, 0xFC18, 0xFC19, 0xFC1A, 0xFC1B, 0xFC1C, 0xFC1D, 0xFC1E, 0xFC1F, 0xFC20, 0xFC21, 0xFC22, 0xFC23, 0xFC24, 0xFC25, 0xFC26, 0xFC27, 0xFC28, 0xFC29, 0xFC2A, 0xFC2B, 0xFC2C, 0xFC2D, 0xFC2E, 0xFC2F, 0xFC30, 0xFC31, 0xFC32, 0xFC33, 0xFC34, 0xFC35, 0xFC36, 0xFC37, 0xFC38, 0xFC39, 0xFC3A, 0xFC3B, 0xFC3C, 0xFC3D, 0xFC3E, 0xFC3F, 0xFC40, 0xFC41, 0xFC42, 0xFC43, 0xFC44, 0xFC45, 0xFC46, 0xFC47, 0xFC48, 0xFC49, 0xFC4A, 0xFC4B, 0xFC4C, 0xFC4D, 0xFC4E, 0xFC4F, 0xFC50, 0xFC51, 0xFC52, 0xFC53, 0xFC54, 0xFC55, 0xFC56, 0xFC57, 0xFC58, 0xFC59, 0xFC5A, 0xFC5B, 0xFC5C, 0xFC5D, 0xFC5E, 0xFC5F, 0xFC60, 0xFC61, 0xFC62, 0xFC63, 0xFC64, 0xFC65, 0xFC66, 0xFC67, 0xFC68, 0xFC69, 0xFC6A, 0xFC6B, 0xFC6C, 0xFC6D, 0xFC6E, 0xFC6F, 0xFC70, 0xFC71, 0xFC72, 0xFC73, 0xFC74, 0xFC75, 0xFC76, 0xFC77, 0xFC78, 0xFC79, 0xFC7A, 0xFC7B, 0xFC7C, 0xFC7D, 0xFC7E, 0xFC7F, 0xFC80, 0xFC81, 0xFC82, 0xFC83, 0xFC84, 0xFC85, 0xFC86, 0xFC87, 0xFC88, 0xFC89, 0xFC8A, 0xFC8B, 0xFC8C, 0xFC8D, 0xFC8E, 0xFC8F, 0xFC90, 0xFC91, 0xFC92, 0xFC93, 0xFC94, 0xFC95, 0xFC96, 0xFC97, 0xFC98, 0xFC99, 0xFC9A, 0xFC9B, 0xFC9C, 0xFC9D, 0xFC9E, 0xFC9F, 0xFCA0, 0xFCA1, 0xFCA2, 0xFCA3, 0xFCA4, 0xFCA5, 0xFCA6, 0xFCA7, 0xFCA8, 0xFCA9, 0xFCAA, 0xFCAB, 0xFCAC, 0xFCAD, 0xFCAE, 0xFCAF, 0xFCB0, 0xFCB1, 0xFCB2, 0xFCB3, 0xFCB4, 0xFCB5, 0xFCB6, 0xFCB7, 0xFCB8, 0xFCB9, 0xFCBA, 0xFCBB, 0xFCBC, 0xFCBD, 0xFCBE, 0xFCBF, 0xFCC0, 0xFCC1, 0xFCC2, 0xFCC3, 0xFCC4, 0xFCC5, 0xFCC6, 0xFCC7, 0xFCC8, 0xFCC9, 0xFCCA, 0xFCCB, 0xFCCC, 0xFCCD, 0xFCCE, 0xFCCF, 0xFCD0, 0xFCD1, 0xFCD2, 0xFCD3, 0xFCD4, 0xFCD5, 0xFCD6, 0xFCD7, 0xFCD8, 0xFCD9, 0xFCDA, 0xFCDB, 0xFCDC, 0xFCDD, 0xFCDE, 0xFCDF, 0xFCE0, 0xFCE1, 0xFCE2, 0xFCE3, 0xFCE4, 0xFCE5, 0xFCE6, 0xFCE7, 0xFCE8, 0xFCE9, 0xFCEA, 0xFCEB, 0xFCEC, 0xFCED, 0xFCEE, 0xFCEF, 0xFCF0, 0xFCF1, 0xFCF2, 0xFCF3, 0xFCF4, 0xFCF5, 0xFCF6, 0xFCF7, 0xFCF8, 0xFCF9, 0xFCFA, 0xFCFB, 0xFCFC, 0xFCFD, 0xFCFE, 0xFCFF, 0xFD00, 0xFD01, 0xFD02, 0xFD03, 0xFD04, 0xFD05, 0xFD06, 0xFD07, 0xFD08, 0xFD09, 0xFD0A, 0xFD0B, 0xFD0C, 0xFD0D, 0xFD0E, 0xFD0F, 0xFD10, 0xFD11, 0xFD12, 0xFD13, 0xFD14, 0xFD15, 0xFD16, 0xFD17, 0xFD18, 0xFD19, 0xFD1A, 0xFD1B, 0xFD1C, 0xFD1D, 0xFD1E, 0xFD1F, 0xFD20, 0xFD21, 0xFD22, 0xFD23, 0xFD24, 0xFD25, 0xFD26, 0xFD27, 0xFD28, 0xFD29, 0xFD2A, 0xFD2B, 0xFD2C, 0xFD2D, 0xFD2E, 0xFD2F, 0xFD30, 0xFD31, 0xFD32, 0xFD33, 0xFD34, 0xFD35, 0xFD36, 0xFD37, 0xFD38, 0xFD39, 0xFD3A, 0xFD3B, 0xFD3C, 0xFD3D, 0xFD50, 0xFD51, 0xFD52, 0xFD53, 0xFD54, 0xFD55, 0xFD56, 0xFD57, 0xFD58, 0xFD59, 0xFD5A, 0xFD5B, 0xFD5C, 0xFD5D, 0xFD5E, 0xFD5F, 0xFD60, 0xFD61, 0xFD62, 0xFD63, 0xFD64, 0xFD65, 0xFD66, 0xFD67, 0xFD68, 0xFD69, 0xFD6A, 0xFD6B, 0xFD6C, 0xFD6D, 0xFD6E, 0xFD6F, 0xFD70, 0xFD71, 0xFD72, 0xFD73, 0xFD74, 0xFD75, 0xFD76, 0xFD77, 0xFD78, 0xFD79, 0xFD7A, 0xFD7B, 0xFD7C, 0xFD7D, 0xFD7E, 0xFD7F, 0xFD80, 0xFD81, 0xFD82, 0xFD83, 0xFD84, 0xFD85, 0xFD86, 0xFD87, 0xFD88, 0xFD89, 0xFD8A, 0xFD8B, 0xFD8C, 0xFD8D, 0xFD8E, 0xFD8F, 0xFD92, 0xFD93, 0xFD94, 0xFD95, 0xFD96, 0xFD97, 0xFD98, 0xFD99, 0xFD9A, 0xFD9B, 0xFD9C, 0xFD9D, 0xFD9E, 0xFD9F, 0xFDA0, 0xFDA1, 0xFDA2, 0xFDA3, 0xFDA4, 0xFDA5, 0xFDA6, 0xFDA7, 0xFDA8, 0xFDA9, 0xFDAA, 0xFDAB, 0xFDAC, 0xFDAD, 0xFDAE, 0xFDAF, 0xFDB0, 0xFDB1, 0xFDB2, 0xFDB3, 0xFDB4, 0xFDB5, 0xFDB6, 0xFDB7, 0xFDB8, 0xFDB9, 0xFDBA, 0xFDBB, 0xFDBC, 0xFDBD, 0xFDBE, 0xFDBF, 0xFDC0, 0xFDC1, 0xFDC2, 0xFDC3, 0xFDC4, 0xFDC5, 0xFDC6, 0xFDC7, 0xFDF0, 0xFDF1, 0xFDF2, 0xFDF3, 0xFDF4, 0xFDF5, 0xFDF6, 0xFDF7, 0xFDF8, 0xFDF9, 0xFDFA, 0xFDFB, 0xFDFC, 0xFE70, 0xFE71, 0xFE72, 0xFE73, 0xFE74, 0xFE76, 0xFE77, 0xFE78, 0xFE79, 0xFE7A, 0xFE7B, 0xFE7C, 0xFE7D, 0xFE7E, 0xFE7F, 0xFE80, 0xFE81, 0xFE82, 0xFE83, 0xFE84, 0xFE85, 0xFE86, 0xFE87, 0xFE88, 0xFE89, 0xFE8A, 0xFE8B, 0xFE8C, 0xFE8D, 0xFE8E, 0xFE8F, 0xFE90, 0xFE91, 0xFE92, 0xFE93, 0xFE94, 0xFE95, 0xFE96, 0xFE97, 0xFE98, 0xFE99, 0xFE9A, 0xFE9B, 0xFE9C, 0xFE9D, 0xFE9E, 0xFE9F, 0xFEA0, 0xFEA1, 0xFEA2, 0xFEA3, 0xFEA4, 0xFEA5, 0xFEA6, 0xFEA7, 0xFEA8, 0xFEA9, 0xFEAA, 0xFEAB, 0xFEAC, 0xFEAD, 0xFEAE, 0xFEAF, 0xFEB0, 0xFEB1, 0xFEB2, 0xFEB3, 0xFEB4, 0xFEB5, 0xFEB6, 0xFEB7, 0xFEB8, 0xFEB9, 0xFEBA, 0xFEBB, 0xFEBC, 0xFEBD, 0xFEBE, 0xFEBF, 0xFEC0, 0xFEC1, 0xFEC2, 0xFEC3, 0xFEC4, 0xFEC5, 0xFEC6, 0xFEC7, 0xFEC8, 0xFEC9, 0xFECA, 0xFECB, 0xFECC, 0xFECD, 0xFECE, 0xFECF, 0xFED0, 0xFED1, 0xFED2, 0xFED3, 0xFED4, 0xFED5, 0xFED6, 0xFED7, 0xFED8, 0xFED9, 0xFEDA, 0xFEDB, 0xFEDC, 0xFEDD, 0xFEDE, 0xFEDF, 0xFEE0, 0xFEE1, 0xFEE2, 0xFEE3, 0xFEE4, 0xFEE5, 0xFEE6, 0xFEE7, 0xFEE8, 0xFEE9, 0xFEEA, 0xFEEB, 0xFEEC, 0xFEED, 0xFEEE, 0xFEEF, 0xFEF0, 0xFEF1, 0xFEF2, 0xFEF3, 0xFEF4, 0xFEF5, 0xFEF6, 0xFEF7, 0xFEF8, 0xFEF9, 0xFEFA, 0xFEFB, 0xFEFC, 0x10800, 0x10801, 0x10802, 0x10803, 0x10804, 0x10805, 0x10808, 0x1080A, 0x1080B, 0x1080C, 0x1080D, 0x1080E, 0x1080F, 0x10810, 0x10811, 0x10812, 0x10813, 0x10814, 0x10815, 0x10816, 0x10817, 0x10818, 0x10819, 0x1081A, 0x1081B, 0x1081C, 0x1081D, 0x1081E, 0x1081F, 0x10820, 0x10821, 0x10822, 0x10823, 0x10824, 0x10825, 0x10826, 0x10827, 0x10828, 0x10829, 0x1082A, 0x1082B, 0x1082C, 0x1082D, 0x1082E, 0x1082F, 0x10830, 0x10831, 0x10832, 0x10833, 0x10834, 0x10835, 0x10837, 0x10838, 0x1083C, 0x1083F, 0x10840, 0x10841, 0x10842, 0x10843, 0x10844, 0x10845, 0x10846, 0x10847, 0x10848, 0x10849, 0x1084A, 0x1084B, 0x1084C, 0x1084D, 0x1084E, 0x1084F, 0x10850, 0x10851, 0x10852, 0x10853, 0x10854, 0x10855, 0x10857, 0x10858, 0x10859, 0x1085A, 0x1085B, 0x1085C, 0x1085D, 0x1085E, 0x1085F, 0x10900, 0x10901, 0x10902, 0x10903, 0x10904, 0x10905, 0x10906, 0x10907, 0x10908, 0x10909, 0x1090A, 0x1090B, 0x1090C, 0x1090D, 0x1090E, 0x1090F, 0x10910, 0x10911, 0x10912, 0x10913, 0x10914, 0x10915, 0x10916, 0x10917, 0x10918, 0x10919, 0x1091A, 0x1091B, 0x10920, 0x10921, 0x10922, 0x10923, 0x10924, 0x10925, 0x10926, 0x10927, 0x10928, 0x10929, 0x1092A, 0x1092B, 0x1092C, 0x1092D, 0x1092E, 0x1092F, 0x10930, 0x10931, 0x10932, 0x10933, 0x10934, 0x10935, 0x10936, 0x10937, 0x10938, 0x10939, 0x1093F, 0x10980, 0x10981, 0x10982, 0x10983, 0x10984, 0x10985, 0x10986, 0x10987, 0x10988, 0x10989, 0x1098A, 0x1098B, 0x1098C, 0x1098D, 0x1098E, 0x1098F, 0x10990, 0x10991, 0x10992, 0x10993, 0x10994, 0x10995, 0x10996, 0x10997, 0x10998, 0x10999, 0x1099A, 0x1099B, 0x1099C, 0x1099D, 0x1099E, 0x1099F, 0x109A0, 0x109A1, 0x109A2, 0x109A3, 0x109A4, 0x109A5, 0x109A6, 0x109A7, 0x109A8, 0x109A9, 0x109AA, 0x109AB, 0x109AC, 0x109AD, 0x109AE, 0x109AF, 0x109B0, 0x109B1, 0x109B2, 0x109B3, 0x109B4, 0x109B5, 0x109B6, 0x109B7, 0x109BE, 0x109BF, 0x10A00, 0x10A10, 0x10A11, 0x10A12, 0x10A13, 0x10A15, 0x10A16, 0x10A17, 0x10A19, 0x10A1A, 0x10A1B, 0x10A1C, 0x10A1D, 0x10A1E, 0x10A1F, 0x10A20, 0x10A21, 0x10A22, 0x10A23, 0x10A24, 0x10A25, 0x10A26, 0x10A27, 0x10A28, 0x10A29, 0x10A2A, 0x10A2B, 0x10A2C, 0x10A2D, 0x10A2E, 0x10A2F, 0x10A30, 0x10A31, 0x10A32, 0x10A33, 0x10A40, 0x10A41, 0x10A42, 0x10A43, 0x10A44, 0x10A45, 0x10A46, 0x10A47, 0x10A50, 0x10A51, 0x10A52, 0x10A53, 0x10A54, 0x10A55, 0x10A56, 0x10A57, 0x10A58, 0x10A60, 0x10A61, 0x10A62, 0x10A63, 0x10A64, 0x10A65, 0x10A66, 0x10A67, 0x10A68, 0x10A69, 0x10A6A, 0x10A6B, 0x10A6C, 0x10A6D, 0x10A6E, 0x10A6F, 0x10A70, 0x10A71, 0x10A72, 0x10A73, 0x10A74, 0x10A75, 0x10A76, 0x10A77, 0x10A78, 0x10A79, 0x10A7A, 0x10A7B, 0x10A7C, 0x10A7D, 0x10A7E, 0x10A7F, 0x10B00, 0x10B01, 0x10B02, 0x10B03, 0x10B04, 0x10B05, 0x10B06, 0x10B07, 0x10B08, 0x10B09, 0x10B0A, 0x10B0B, 0x10B0C, 0x10B0D, 0x10B0E, 0x10B0F, 0x10B10, 0x10B11, 0x10B12, 0x10B13, 0x10B14, 0x10B15, 0x10B16, 0x10B17, 0x10B18, 0x10B19, 0x10B1A, 0x10B1B, 0x10B1C, 0x10B1D, 0x10B1E, 0x10B1F, 0x10B20, 0x10B21, 0x10B22, 0x10B23, 0x10B24, 0x10B25, 0x10B26, 0x10B27, 0x10B28, 0x10B29, 0x10B2A, 0x10B2B, 0x10B2C, 0x10B2D, 0x10B2E, 0x10B2F, 0x10B30, 0x10B31, 0x10B32, 0x10B33, 0x10B34, 0x10B35, 0x10B40, 0x10B41, 0x10B42, 0x10B43, 0x10B44, 0x10B45, 0x10B46, 0x10B47, 0x10B48, 0x10B49, 0x10B4A, 0x10B4B, 0x10B4C, 0x10B4D, 0x10B4E, 0x10B4F, 0x10B50, 0x10B51, 0x10B52, 0x10B53, 0x10B54, 0x10B55, 0x10B58, 0x10B59, 0x10B5A, 0x10B5B, 0x10B5C, 0x10B5D, 0x10B5E, 0x10B5F, 0x10B60, 0x10B61, 0x10B62, 0x10B63, 0x10B64, 0x10B65, 0x10B66, 0x10B67, 0x10B68, 0x10B69, 0x10B6A, 0x10B6B, 0x10B6C, 0x10B6D, 0x10B6E, 0x10B6F, 0x10B70, 0x10B71, 0x10B72, 0x10B78, 0x10B79, 0x10B7A, 0x10B7B, 0x10B7C, 0x10B7D, 0x10B7E, 0x10B7F, 0x10C00, 0x10C01, 0x10C02, 0x10C03, 0x10C04, 0x10C05, 0x10C06, 0x10C07, 0x10C08, 0x10C09, 0x10C0A, 0x10C0B, 0x10C0C, 0x10C0D, 0x10C0E, 0x10C0F, 0x10C10, 0x10C11, 0x10C12, 0x10C13, 0x10C14, 0x10C15, 0x10C16, 0x10C17, 0x10C18, 0x10C19, 0x10C1A, 0x10C1B, 0x10C1C, 0x10C1D, 0x10C1E, 0x10C1F, 0x10C20, 0x10C21, 0x10C22, 0x10C23, 0x10C24, 0x10C25, 0x10C26, 0x10C27, 0x10C28, 0x10C29, 0x10C2A, 0x10C2B, 0x10C2C, 0x10C2D, 0x10C2E, 0x10C2F, 0x10C30, 0x10C31, 0x10C32, 0x10C33, 0x10C34, 0x10C35, 0x10C36, 0x10C37, 0x10C38, 0x10C39, 0x10C3A, 0x10C3B, 0x10C3C, 0x10C3D, 0x10C3E, 0x10C3F, 0x10C40, 0x10C41, 0x10C42, 0x10C43, 0x10C44, 0x10C45, 0x10C46, 0x10C47, 0x10C48, 0x1EE00, 0x1EE01, 0x1EE02, 0x1EE03, 0x1EE05, 0x1EE06, 0x1EE07, 0x1EE08, 0x1EE09, 0x1EE0A, 0x1EE0B, 0x1EE0C, 0x1EE0D, 0x1EE0E, 0x1EE0F, 0x1EE10, 0x1EE11, 0x1EE12, 0x1EE13, 0x1EE14, 0x1EE15, 0x1EE16, 0x1EE17, 0x1EE18, 0x1EE19, 0x1EE1A, 0x1EE1B, 0x1EE1C, 0x1EE1D, 0x1EE1E, 0x1EE1F, 0x1EE21, 0x1EE22, 0x1EE24, 0x1EE27, 0x1EE29, 0x1EE2A, 0x1EE2B, 0x1EE2C, 0x1EE2D, 0x1EE2E, 0x1EE2F, 0x1EE30, 0x1EE31, 0x1EE32, 0x1EE34, 0x1EE35, 0x1EE36, 0x1EE37, 0x1EE39, 0x1EE3B, 0x1EE42, 0x1EE47, 0x1EE49, 0x1EE4B, 0x1EE4D, 0x1EE4E, 0x1EE4F, 0x1EE51, 0x1EE52, 0x1EE54, 0x1EE57, 0x1EE59, 0x1EE5B, 0x1EE5D, 0x1EE5F, 0x1EE61, 0x1EE62, 0x1EE64, 0x1EE67, 0x1EE68, 0x1EE69, 0x1EE6A, 0x1EE6C, 0x1EE6D, 0x1EE6E, 0x1EE6F, 0x1EE70, 0x1EE71, 0x1EE72, 0x1EE74, 0x1EE75, 0x1EE76, 0x1EE77, 0x1EE79, 0x1EE7A, 0x1EE7B, 0x1EE7C, 0x1EE7E, 0x1EE80, 0x1EE81, 0x1EE82, 0x1EE83, 0x1EE84, 0x1EE85, 0x1EE86, 0x1EE87, 0x1EE88, 0x1EE89, 0x1EE8B, 0x1EE8C, 0x1EE8D, 0x1EE8E, 0x1EE8F, 0x1EE90, 0x1EE91, 0x1EE92, 0x1EE93, 0x1EE94, 0x1EE95, 0x1EE96, 0x1EE97, 0x1EE98, 0x1EE99, 0x1EE9A, 0x1EE9B, 0x1EEA1, 0x1EEA2, 0x1EEA3, 0x1EEA5, 0x1EEA6, 0x1EEA7, 0x1EEA8, 0x1EEA9, 0x1EEAB, 0x1EEAC, 0x1EEAD, 0x1EEAE, 0x1EEAF, 0x1EEB0, 0x1EEB1, 0x1EEB2, 0x1EEB3, 0x1EEB4, 0x1EEB5, 0x1EEB6, 0x1EEB7, 0x1EEB8, 0x1EEB9, 0x1EEBA, 0x1EEBB, 0x10FFFD]; function determineBidi(cueDiv) { var nodeStack = [], text = "", charCode; if (!cueDiv || !cueDiv.childNodes) { return "ltr"; } function pushNodes(nodeStack, node) { for (var i = node.childNodes.length - 1; i >= 0; i--) { nodeStack.push(node.childNodes[i]); } } function nextTextNode(nodeStack) { if (!nodeStack || !nodeStack.length) { return null; } var node = nodeStack.pop(), text = node.textContent || node.innerText; if (text) { // TODO: This should match all unicode type B characters (paragraph // separator characters). See issue #115. var m = text.match(/^.*(\n|\r)/); if (m) { nodeStack.length = 0; return m[0]; } return text; } if (node.tagName === "ruby") { return nextTextNode(nodeStack); } if (node.childNodes) { pushNodes(nodeStack, node); return nextTextNode(nodeStack); } } pushNodes(nodeStack, cueDiv); while ((text = nextTextNode(nodeStack))) { for (var i = 0; i < text.length; i++) { charCode = text.charCodeAt(i); for (var j = 0; j < strongRTLChars.length; j++) { if (strongRTLChars[j] === charCode) { return "rtl"; } } } } return "ltr"; } function computeLinePos(cue) { if (typeof cue.line === "number" && (cue.snapToLines || (cue.line >= 0 && cue.line <= 100))) { return cue.line; } if (!cue.track || !cue.track.textTrackList || !cue.track.textTrackList.mediaElement) { return -1; } var track = cue.track, trackList = track.textTrackList, count = 0; for (var i = 0; i < trackList.length && trackList[i] !== track; i++) { if (trackList[i].mode === "showing") { count++; } } return ++count * -1; } function StyleBox() { } // Apply styles to a div. If there is no div passed then it defaults to the // div on 'this'. StyleBox.prototype.applyStyles = function(styles, div) { div = div || this.div; for (var prop in styles) { if (styles.hasOwnProperty(prop)) { div.style[prop] = styles[prop]; } } }; StyleBox.prototype.formatStyle = function(val, unit) { return val === 0 ? 0 : val + unit; }; // Constructs the computed display state of the cue (a div). Places the div // into the overlay which should be a block level element (usually a div). function CueStyleBox(window, cue, styleOptions) { var isIE8 = (/MSIE\s8\.0/).test(navigator.userAgent); var color = "rgba(255, 255, 255, 1)"; var backgroundColor = "rgba(0, 0, 0, 0.8)"; if (isIE8) { color = "rgb(255, 255, 255)"; backgroundColor = "rgb(0, 0, 0)"; } StyleBox.call(this); this.cue = cue; // Parse our cue's text into a DOM tree rooted at 'cueDiv'. This div will // have inline positioning and will function as the cue background box. this.cueDiv = parseContent(window, cue.text); var styles = { color: color, backgroundColor: backgroundColor, position: "relative", left: 0, right: 0, top: 0, bottom: 0, display: "inline" }; if (!isIE8) { styles.writingMode = cue.vertical === "" ? "horizontal-tb" : cue.vertical === "lr" ? "vertical-lr" : "vertical-rl"; styles.unicodeBidi = "plaintext"; } this.applyStyles(styles, this.cueDiv); // Create an absolutely positioned div that will be used to position the cue // div. Note, all WebVTT cue-setting alignments are equivalent to the CSS // mirrors of them except "middle" which is "center" in CSS. this.div = window.document.createElement("div"); styles = { textAlign: cue.align === "middle" ? "center" : cue.align, font: styleOptions.font, whiteSpace: "pre-line", position: "absolute" }; if (!isIE8) { styles.direction = determineBidi(this.cueDiv); styles.writingMode = cue.vertical === "" ? "horizontal-tb" : cue.vertical === "lr" ? "vertical-lr" : "vertical-rl". stylesunicodeBidi = "plaintext"; } this.applyStyles(styles); this.div.appendChild(this.cueDiv); // Calculate the distance from the reference edge of the viewport to the text // position of the cue box. The reference edge will be resolved later when // the box orientation styles are applied. var textPos = 0; switch (cue.positionAlign) { case "start": textPos = cue.position; break; case "middle": textPos = cue.position - (cue.size / 2); break; case "end": textPos = cue.position - cue.size; break; } // Horizontal box orientation; textPos is the distance from the left edge of the // area to the left edge of the box and cue.size is the distance extending to // the right from there. if (cue.vertical === "") { this.applyStyles({ left: this.formatStyle(textPos, "%"), width: this.formatStyle(cue.size, "%") }); // Vertical box orientation; textPos is the distance from the top edge of the // area to the top edge of the box and cue.size is the height extending // downwards from there. } else { this.applyStyles({ top: this.formatStyle(textPos, "%"), height: this.formatStyle(cue.size, "%") }); } this.move = function(box) { this.applyStyles({ top: this.formatStyle(box.top, "px"), bottom: this.formatStyle(box.bottom, "px"), left: this.formatStyle(box.left, "px"), right: this.formatStyle(box.right, "px"), height: this.formatStyle(box.height, "px"), width: this.formatStyle(box.width, "px") }); }; } CueStyleBox.prototype = _objCreate(StyleBox.prototype); CueStyleBox.prototype.constructor = CueStyleBox; // Represents the co-ordinates of an Element in a way that we can easily // compute things with such as if it overlaps or intersects with another Element. // Can initialize it with either a StyleBox or another BoxPosition. function BoxPosition(obj) { var isIE8 = (/MSIE\s8\.0/).test(navigator.userAgent); // Either a BoxPosition was passed in and we need to copy it, or a StyleBox // was passed in and we need to copy the results of 'getBoundingClientRect' // as the object returned is readonly. All co-ordinate values are in reference // to the viewport origin (top left). var lh, height, width, top; if (obj.div) { height = obj.div.offsetHeight; width = obj.div.offsetWidth; top = obj.div.offsetTop; var rects = (rects = obj.div.childNodes) && (rects = rects[0]) && rects.getClientRects && rects.getClientRects(); obj = obj.div.getBoundingClientRect(); // In certain cases the outter div will be slightly larger then the sum of // the inner div's lines. This could be due to bold text, etc, on some platforms. // In this case we should get the average line height and use that. This will // result in the desired behaviour. lh = rects ? Math.max((rects[0] && rects[0].height) || 0, obj.height / rects.length) : 0; } this.left = obj.left; this.right = obj.right; this.top = obj.top || top; this.height = obj.height || height; this.bottom = obj.bottom || (top + (obj.height || height)); this.width = obj.width || width; this.lineHeight = lh !== undefined ? lh : obj.lineHeight; if (isIE8 && !this.lineHeight) { this.lineHeight = 13; } } // Move the box along a particular axis. Optionally pass in an amount to move // the box. If no amount is passed then the default is the line height of the // box. BoxPosition.prototype.move = function(axis, toMove) { toMove = toMove !== undefined ? toMove : this.lineHeight; switch (axis) { case "+x": this.left += toMove; this.right += toMove; break; case "-x": this.left -= toMove; this.right -= toMove; break; case "+y": this.top += toMove; this.bottom += toMove; break; case "-y": this.top -= toMove; this.bottom -= toMove; break; } }; // Check if this box overlaps another box, b2. BoxPosition.prototype.overlaps = function(b2) { return this.left < b2.right && this.right > b2.left && this.top < b2.bottom && this.bottom > b2.top; }; // Check if this box overlaps any other boxes in boxes. BoxPosition.prototype.overlapsAny = function(boxes) { for (var i = 0; i < boxes.length; i++) { if (this.overlaps(boxes[i])) { return true; } } return false; }; // Check if this box is within another box. BoxPosition.prototype.within = function(container) { return this.top >= container.top && this.bottom <= container.bottom && this.left >= container.left && this.right <= container.right; }; // Check if this box is entirely within the container or it is overlapping // on the edge opposite of the axis direction passed. For example, if "+x" is // passed and the box is overlapping on the left edge of the container, then // return true. BoxPosition.prototype.overlapsOppositeAxis = function(container, axis) { switch (axis) { case "+x": return this.left < container.left; case "-x": return this.right > container.right; case "+y": return this.top < container.top; case "-y": return this.bottom > container.bottom; } }; // Find the percentage of the area that this box is overlapping with another // box. BoxPosition.prototype.intersectPercentage = function(b2) { var x = Math.max(0, Math.min(this.right, b2.right) - Math.max(this.left, b2.left)), y = Math.max(0, Math.min(this.bottom, b2.bottom) - Math.max(this.top, b2.top)), intersectArea = x * y; return intersectArea / (this.height * this.width); }; // Convert the positions from this box to CSS compatible positions using // the reference container's positions. This has to be done because this // box's positions are in reference to the viewport origin, whereas, CSS // values are in referecne to their respective edges. BoxPosition.prototype.toCSSCompatValues = function(reference) { return { top: this.top - reference.top, bottom: reference.bottom - this.bottom, left: this.left - reference.left, right: reference.right - this.right, height: this.height, width: this.width }; }; // Get an object that represents the box's position without anything extra. // Can pass a StyleBox, HTMLElement, or another BoxPositon. BoxPosition.getSimpleBoxPosition = function(obj) { var height = obj.div ? obj.div.offsetHeight : obj.tagName ? obj.offsetHeight : 0; var width = obj.div ? obj.div.offsetWidth : obj.tagName ? obj.offsetWidth : 0; var top = obj.div ? obj.div.offsetTop : obj.tagName ? obj.offsetTop : 0; obj = obj.div ? obj.div.getBoundingClientRect() : obj.tagName ? obj.getBoundingClientRect() : obj; var ret = { left: obj.left, right: obj.right, top: obj.top || top, height: obj.height || height, bottom: obj.bottom || (top + (obj.height || height)), width: obj.width || width }; return ret; }; // Move a StyleBox to its specified, or next best, position. The containerBox // is the box that contains the StyleBox, such as a div. boxPositions are // a list of other boxes that the styleBox can't overlap with. function moveBoxToLinePosition(window, styleBox, containerBox, boxPositions) { // Find the best position for a cue box, b, on the video. The axis parameter // is a list of axis, the order of which, it will move the box along. For example: // Passing ["+x", "-x"] will move the box first along the x axis in the positive // direction. If it doesn't find a good position for it there it will then move // it along the x axis in the negative direction. function findBestPosition(b, axis) { var bestPosition, specifiedPosition = new BoxPosition(b), percentage = 1; // Highest possible so the first thing we get is better. for (var i = 0; i < axis.length; i++) { while (b.overlapsOppositeAxis(containerBox, axis[i]) || (b.within(containerBox) && b.overlapsAny(boxPositions))) { b.move(axis[i]); } // We found a spot where we aren't overlapping anything. This is our // best position. if (b.within(containerBox)) { return b; } var p = b.intersectPercentage(containerBox); // If we're outside the container box less then we were on our last try // then remember this position as the best position. if (percentage > p) { bestPosition = new BoxPosition(b); percentage = p; } // Reset the box position to the specified position. b = new BoxPosition(specifiedPosition); } return bestPosition || specifiedPosition; } var boxPosition = new BoxPosition(styleBox), cue = styleBox.cue, linePos = computeLinePos(cue), axis = []; // If we have a line number to align the cue to. if (cue.snapToLines) { var size; switch (cue.vertical) { case "": axis = [ "+y", "-y" ]; size = "height"; break; case "rl": axis = [ "+x", "-x" ]; size = "width"; break; case "lr": axis = [ "-x", "+x" ]; size = "width"; break; } var step = boxPosition.lineHeight, position = step * Math.round(linePos), maxPosition = containerBox[size] + step, initialAxis = axis[0]; // If the specified intial position is greater then the max position then // clamp the box to the amount of steps it would take for the box to // reach the max position. if (Math.abs(position) > maxPosition) { position = position < 0 ? -1 : 1; position *= Math.ceil(maxPosition / step) * step; } // If computed line position returns negative then line numbers are // relative to the bottom of the video instead of the top. Therefore, we // need to increase our initial position by the length or width of the // video, depending on the writing direction, and reverse our axis directions. if (linePos < 0) { position += cue.vertical === "" ? containerBox.height : containerBox.width; axis = axis.reverse(); } // Move the box to the specified position. This may not be its best // position. boxPosition.move(initialAxis, position); } else { // If we have a percentage line value for the cue. var calculatedPercentage = (boxPosition.lineHeight / containerBox.height) * 100; switch (cue.lineAlign) { case "middle": linePos -= (calculatedPercentage / 2); break; case "end": linePos -= calculatedPercentage; break; } // Apply initial line position to the cue box. switch (cue.vertical) { case "": styleBox.applyStyles({ top: styleBox.formatStyle(linePos, "%") }); break; case "rl": styleBox.applyStyles({ left: styleBox.formatStyle(linePos, "%") }); break; case "lr": styleBox.applyStyles({ right: styleBox.formatStyle(linePos, "%") }); break; } axis = [ "+y", "-x", "+x", "-y" ]; // Get the box position again after we've applied the specified positioning // to it. boxPosition = new BoxPosition(styleBox); } var bestPosition = findBestPosition(boxPosition, axis); styleBox.move(bestPosition.toCSSCompatValues(containerBox)); } function WebVTT() { // Nothing } // Helper to allow strings to be decoded instead of the default binary utf8 data. WebVTT.StringDecoder = function() { return { decode: function(data) { if (!data) { return ""; } if (typeof data !== "string") { throw new Error("Error - expected string data."); } return decodeURIComponent(encodeURIComponent(data)); } }; }; WebVTT.convertCueToDOMTree = function(window, cuetext) { if (!window || !cuetext) { return null; } return parseContent(window, cuetext); }; var FONT_SIZE_PERCENT = 0.05; var FONT_STYLE = "sans-serif"; var CUE_BACKGROUND_PADDING = "1.5%"; // Runs the processing model over the cues and regions passed to it. // @param overlay A block level element (usually a div) that the computed cues // and regions will be placed into. WebVTT.processCues = function(window, cues, overlay) { if (!window || !cues || !overlay) { return null; } // Remove all previous children. while (overlay.firstChild) { overlay.removeChild(overlay.firstChild); } var paddedOverlay = window.document.createElement("div"); paddedOverlay.style.position = "absolute"; paddedOverlay.style.left = "0"; paddedOverlay.style.right = "0"; paddedOverlay.style.top = "0"; paddedOverlay.style.bottom = "0"; paddedOverlay.style.margin = CUE_BACKGROUND_PADDING; overlay.appendChild(paddedOverlay); // Determine if we need to compute the display states of the cues. This could // be the case if a cue's state has been changed since the last computation or // if it has not been computed yet. function shouldCompute(cues) { for (var i = 0; i < cues.length; i++) { if (cues[i].hasBeenReset || !cues[i].displayState) { return true; } } return false; } // We don't need to recompute the cues' display states. Just reuse them. if (!shouldCompute(cues)) { for (var i = 0; i < cues.length; i++) { paddedOverlay.appendChild(cues[i].displayState); } return; } var boxPositions = [], containerBox = BoxPosition.getSimpleBoxPosition(paddedOverlay), fontSize = Math.round(containerBox.height * FONT_SIZE_PERCENT * 100) / 100; var styleOptions = { font: fontSize + "px " + FONT_STYLE }; (function() { var styleBox, cue; for (var i = 0; i < cues.length; i++) { cue = cues[i]; // Compute the intial position and styles of the cue div. styleBox = new CueStyleBox(window, cue, styleOptions); paddedOverlay.appendChild(styleBox.div); // Move the cue div to it's correct line position. moveBoxToLinePosition(window, styleBox, containerBox, boxPositions); // Remember the computed div so that we don't have to recompute it later // if we don't have too. cue.displayState = styleBox.div; boxPositions.push(BoxPosition.getSimpleBoxPosition(styleBox)); } })(); }; WebVTT.Parser = function(window, vttjs, decoder) { if (!decoder) { decoder = vttjs; vttjs = {}; } if (!vttjs) { vttjs = {}; } this.window = window; this.vttjs = vttjs; this.state = "INITIAL"; this.buffer = ""; this.decoder = decoder || new TextDecoder("utf8"); this.regionList = []; }; WebVTT.Parser.prototype = { // If the error is a ParsingError then report it to the consumer if // possible. If it's not a ParsingError then throw it like normal. reportOrThrowError: function(e) { if (e instanceof ParsingError) { this.onparsingerror && this.onparsingerror(e); } else { throw e; } }, parse: function (data) { var self = this; // If there is no data then we won't decode it, but will just try to parse // whatever is in buffer already. This may occur in circumstances, for // example when flush() is called. if (data) { // Try to decode the data that we received. self.buffer += self.decoder.decode(data, {stream: true}); } function collectNextLine() { var buffer = self.buffer; var pos = 0; while (pos < buffer.length && buffer[pos] !== '\r' && buffer[pos] !== '\n') { ++pos; } var line = buffer.substr(0, pos); // Advance the buffer early in case we fail below. if (buffer[pos] === '\r') { ++pos; } if (buffer[pos] === '\n') { ++pos; } self.buffer = buffer.substr(pos); return line; } // 3.4 WebVTT region and WebVTT region settings syntax function parseRegion(input) { var settings = new Settings(); parseOptions(input, function (k, v) { switch (k) { case "id": settings.set(k, v); break; case "width": settings.percent(k, v); break; case "lines": settings.integer(k, v); break; case "regionanchor": case "viewportanchor": var xy = v.split(','); if (xy.length !== 2) { break; } // We have to make sure both x and y parse, so use a temporary // settings object here. var anchor = new Settings(); anchor.percent("x", xy[0]); anchor.percent("y", xy[1]); if (!anchor.has("x") || !anchor.has("y")) { break; } settings.set(k + "X", anchor.get("x")); settings.set(k + "Y", anchor.get("y")); break; case "scroll": settings.alt(k, v, ["up"]); break; } }, /=/, /\s/); // Create the region, using default values for any values that were not // specified. if (settings.has("id")) { var region = new (self.vttjs.VTTRegion || self.window.VTTRegion)(); region.width = settings.get("width", 100); region.lines = settings.get("lines", 3); region.regionAnchorX = settings.get("regionanchorX", 0); region.regionAnchorY = settings.get("regionanchorY", 100); region.viewportAnchorX = settings.get("viewportanchorX", 0); region.viewportAnchorY = settings.get("viewportanchorY", 100); region.scroll = settings.get("scroll", ""); // Register the region. self.onregion && self.onregion(region); // Remember the VTTRegion for later in case we parse any VTTCues that // reference it. self.regionList.push({ id: settings.get("id"), region: region }); } } // 3.2 WebVTT metadata header syntax function parseHeader(input) { parseOptions(input, function (k, v) { switch (k) { case "Region": // 3.3 WebVTT region metadata header syntax parseRegion(v); break; } }, /:/); } // 5.1 WebVTT file parsing. try { var line; if (self.state === "INITIAL") { // We can't start parsing until we have the first line. if (!/\r\n|\n/.test(self.buffer)) { return this; } line = collectNextLine(); var m = line.match(/^WEBVTT([ \t].*)?$/); if (!m || !m[0]) { throw new ParsingError(ParsingError.Errors.BadSignature); } self.state = "HEADER"; } var alreadyCollectedLine = false; while (self.buffer) { // We can't parse a line until we have the full line. if (!/\r\n|\n/.test(self.buffer)) { return this; } if (!alreadyCollectedLine) { line = collectNextLine(); } else { alreadyCollectedLine = false; } switch (self.state) { case "HEADER": // 13-18 - Allow a header (metadata) under the WEBVTT line. if (/:/.test(line)) { parseHeader(line); } else if (!line) { // An empty line terminates the header and starts the body (cues). self.state = "ID"; } continue; case "NOTE": // Ignore NOTE blocks. if (!line) { self.state = "ID"; } continue; case "ID": // Check for the start of NOTE blocks. if (/^NOTE($|[ \t])/.test(line)) { self.state = "NOTE"; break; } // 19-29 - Allow any number of line terminators, then initialize new cue values. if (!line) { continue; } self.cue = new (self.vttjs.VTTCue || self.window.VTTCue)(0, 0, ""); self.state = "CUE"; // 30-39 - Check if self line contains an optional identifier or timing data. if (line.indexOf("-->") === -1) { self.cue.id = line; continue; } // Process line as start of a cue. /*falls through*/ case "CUE": // 40 - Collect cue timings and settings. try { parseCue(line, self.cue, self.regionList); } catch (e) { self.reportOrThrowError(e); // In case of an error ignore rest of the cue. self.cue = null; self.state = "BADCUE"; continue; } self.state = "CUETEXT"; continue; case "CUETEXT": var hasSubstring = line.indexOf("-->") !== -1; // 34 - If we have an empty line then report the cue. // 35 - If we have the special substring '-->' then report the cue, // but do not collect the line as we need to process the current // one as a new cue. if (!line || hasSubstring && (alreadyCollectedLine = true)) { // We are done parsing self cue. self.oncue && self.oncue(self.cue); self.cue = null; self.state = "ID"; continue; } if (self.cue.text) { self.cue.text += "\n"; } self.cue.text += line; continue; case "BADCUE": // BADCUE // 54-62 - Collect and discard the remaining cue. if (!line) { self.state = "ID"; } continue; } } } catch (e) { self.reportOrThrowError(e); // If we are currently parsing a cue, report what we have. if (self.state === "CUETEXT" && self.cue && self.oncue) { self.oncue(self.cue); } self.cue = null; // Enter BADWEBVTT state if header was not parsed correctly otherwise // another exception occurred so enter BADCUE state. self.state = self.state === "INITIAL" ? "BADWEBVTT" : "BADCUE"; } return this; }, flush: function () { var self = this; try { // Finish decoding the stream. self.buffer += self.decoder.decode(); // Synthesize the end of the current cue or region. if (self.cue || self.state === "HEADER") { self.buffer += "\n\n"; self.parse(); } // If we've flushed, parsed, and we're still on the INITIAL state then // that means we don't have enough of the stream to parse the first // line. if (self.state === "INITIAL") { throw new ParsingError(ParsingError.Errors.BadSignature); } } catch(e) { self.reportOrThrowError(e); } self.onflush && self.onflush(); return this; } }; global.WebVTT = WebVTT; }(this, (this.vttjs || {})));
src/TitleBar/windows/Controls/Maximize.js
gabrielbull/react-desktop
import React, { Component } from 'react'; import PropTypes from 'prop-types'; import WindowFocus from '../../../windowFocus'; import { themeContextTypes } from '../../../style/theme/windows'; import { backgroundContextTypes } from '../../../style/background/windows'; import { isDarkColor } from '../../../color'; import Radium from 'radium' var styles = { button: { WebkitUserSelect: 'none', userSelect: 'none', WebkitAppRegion: 'no-drag', cursor: 'default', width: '46px', height: '100%', lineHeight: 0, display: 'flex', justifyContent: 'center', alignItems: 'center', display: 'flex', ':hover': { transition: 'background-color 0.1s', backgroundColor: '#e5e5e5' }, ':active': { backgroundColor: '#cccccc' } }, buttonColorBackground: { ':hover': { transition: 'background-color 0.1s', backgroundColor: 'rgba(255, 255, 255, .13)' }, ':active': { backgroundColor: 'rgba(255, 255, 255, .23)' } }, icon: { width: '10px', height: '10px' } }; @WindowFocus() @Radium class Maximize extends Component { static contextTypes = { ...themeContextTypes, ...backgroundContextTypes, isMaximized: PropTypes.bool }; render() { const { style, isWindowFocused, ...props } = this.props; delete props.onMaximizeClick; delete props.onRestoreDownClick; let svgFill = '#000000'; if (!isWindowFocused && this.context.theme !== 'dark') { svgFill = 'rgba(0, 0, 0, .4)'; } let componentStyle = { ...styles.button, ...style }; if (this.context.theme === 'dark' || this.context.background && isDarkColor(this.context.background)) { svgFill = '#ffffff'; componentStyle = { ...componentStyle, ...styles.buttonColorBackground }; } let title = 'Maximize'; let icon = ( <svg x="0px" y="0px" viewBox="0 0 10.2 10.1" style={styles.icon}> <path fill={svgFill} d="M0,0v10.1h10.2V0H0z M9.2,9.2H1.1V1h8.1V9.2z" /> </svg> ); let onClick = this.props.onMaximizeClick; if (this.context.isMaximized) { title = 'Restore Down'; icon = ( <svg x="0px" y="0px" viewBox="0 0 10.2 10.2" style={styles.icon}> <path fill={svgFill} d="M2.1,0v2H0v8.1h8.2v-2h2V0H2.1z M7.2,9.2H1.1V3h6.1V9.2z M9.2,7.1h-1V2H3.1V1h6.1V7.1z" /> </svg> ); onClick = this.props.onRestoreDownClick; } return ( <a title={title} style={componentStyle} onClick={onClick} {...props} > {icon} </a> ); } } export default Maximize;
doc/ref/csharp/html/scripts/jquery-1.11.0.min.js
doubi-workshop/grpc
/*! jQuery v1.11.0 | (c) 2005, 2014 jQuery Foundation, Inc. | jquery.org/license */ !function(a,b){"object"==typeof module&&"object"==typeof module.exports?module.exports=a.document?b(a,!0):function(a){if(!a.document)throw new Error("jQuery requires a window with a document");return b(a)}:b(a)}("undefined"!=typeof window?window:this,function(a,b){var c=[],d=c.slice,e=c.concat,f=c.push,g=c.indexOf,h={},i=h.toString,j=h.hasOwnProperty,k="".trim,l={},m="1.11.0",n=function(a,b){return new n.fn.init(a,b)},o=/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,p=/^-ms-/,q=/-([\da-z])/gi,r=function(a,b){return b.toUpperCase()};n.fn=n.prototype={jquery:m,constructor:n,selector:"",length:0,toArray:function(){return d.call(this)},get:function(a){return null!=a?0>a?this[a+this.length]:this[a]:d.call(this)},pushStack:function(a){var b=n.merge(this.constructor(),a);return b.prevObject=this,b.context=this.context,b},each:function(a,b){return n.each(this,a,b)},map:function(a){return this.pushStack(n.map(this,function(b,c){return a.call(b,c,b)}))},slice:function(){return this.pushStack(d.apply(this,arguments))},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},eq:function(a){var b=this.length,c=+a+(0>a?b:0);return this.pushStack(c>=0&&b>c?[this[c]]:[])},end:function(){return this.prevObject||this.constructor(null)},push:f,sort:c.sort,splice:c.splice},n.extend=n.fn.extend=function(){var a,b,c,d,e,f,g=arguments[0]||{},h=1,i=arguments.length,j=!1;for("boolean"==typeof g&&(j=g,g=arguments[h]||{},h++),"object"==typeof g||n.isFunction(g)||(g={}),h===i&&(g=this,h--);i>h;h++)if(null!=(e=arguments[h]))for(d in e)a=g[d],c=e[d],g!==c&&(j&&c&&(n.isPlainObject(c)||(b=n.isArray(c)))?(b?(b=!1,f=a&&n.isArray(a)?a:[]):f=a&&n.isPlainObject(a)?a:{},g[d]=n.extend(j,f,c)):void 0!==c&&(g[d]=c));return g},n.extend({expando:"jQuery"+(m+Math.random()).replace(/\D/g,""),isReady:!0,error:function(a){throw new Error(a)},noop:function(){},isFunction:function(a){return"function"===n.type(a)},isArray:Array.isArray||function(a){return"array"===n.type(a)},isWindow:function(a){return null!=a&&a==a.window},isNumeric:function(a){return a-parseFloat(a)>=0},isEmptyObject:function(a){var b;for(b in a)return!1;return!0},isPlainObject:function(a){var b;if(!a||"object"!==n.type(a)||a.nodeType||n.isWindow(a))return!1;try{if(a.constructor&&!j.call(a,"constructor")&&!j.call(a.constructor.prototype,"isPrototypeOf"))return!1}catch(c){return!1}if(l.ownLast)for(b in a)return j.call(a,b);for(b in a);return void 0===b||j.call(a,b)},type:function(a){return null==a?a+"":"object"==typeof a||"function"==typeof a?h[i.call(a)]||"object":typeof a},globalEval:function(b){b&&n.trim(b)&&(a.execScript||function(b){a.eval.call(a,b)})(b)},camelCase:function(a){return a.replace(p,"ms-").replace(q,r)},nodeName:function(a,b){return a.nodeName&&a.nodeName.toLowerCase()===b.toLowerCase()},each:function(a,b,c){var d,e=0,f=a.length,g=s(a);if(c){if(g){for(;f>e;e++)if(d=b.apply(a[e],c),d===!1)break}else for(e in a)if(d=b.apply(a[e],c),d===!1)break}else if(g){for(;f>e;e++)if(d=b.call(a[e],e,a[e]),d===!1)break}else for(e in a)if(d=b.call(a[e],e,a[e]),d===!1)break;return a},trim:k&&!k.call("\ufeff\xa0")?function(a){return null==a?"":k.call(a)}:function(a){return null==a?"":(a+"").replace(o,"")},makeArray:function(a,b){var c=b||[];return null!=a&&(s(Object(a))?n.merge(c,"string"==typeof a?[a]:a):f.call(c,a)),c},inArray:function(a,b,c){var d;if(b){if(g)return g.call(b,a,c);for(d=b.length,c=c?0>c?Math.max(0,d+c):c:0;d>c;c++)if(c in b&&b[c]===a)return c}return-1},merge:function(a,b){var c=+b.length,d=0,e=a.length;while(c>d)a[e++]=b[d++];if(c!==c)while(void 0!==b[d])a[e++]=b[d++];return a.length=e,a},grep:function(a,b,c){for(var d,e=[],f=0,g=a.length,h=!c;g>f;f++)d=!b(a[f],f),d!==h&&e.push(a[f]);return e},map:function(a,b,c){var d,f=0,g=a.length,h=s(a),i=[];if(h)for(;g>f;f++)d=b(a[f],f,c),null!=d&&i.push(d);else for(f in a)d=b(a[f],f,c),null!=d&&i.push(d);return e.apply([],i)},guid:1,proxy:function(a,b){var c,e,f;return"string"==typeof b&&(f=a[b],b=a,a=f),n.isFunction(a)?(c=d.call(arguments,2),e=function(){return a.apply(b||this,c.concat(d.call(arguments)))},e.guid=a.guid=a.guid||n.guid++,e):void 0},now:function(){return+new Date},support:l}),n.each("Boolean Number String Function Array Date RegExp Object Error".split(" "),function(a,b){h["[object "+b+"]"]=b.toLowerCase()});function s(a){var b=a.length,c=n.type(a);return"function"===c||n.isWindow(a)?!1:1===a.nodeType&&b?!0:"array"===c||0===b||"number"==typeof b&&b>0&&b-1 in a}var t=function(a){var b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s="sizzle"+-new Date,t=a.document,u=0,v=0,w=eb(),x=eb(),y=eb(),z=function(a,b){return a===b&&(j=!0),0},A="undefined",B=1<<31,C={}.hasOwnProperty,D=[],E=D.pop,F=D.push,G=D.push,H=D.slice,I=D.indexOf||function(a){for(var b=0,c=this.length;c>b;b++)if(this[b]===a)return b;return-1},J="checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|ismap|loop|multiple|open|readonly|required|scoped",K="[\\x20\\t\\r\\n\\f]",L="(?:\\\\.|[\\w-]|[^\\x00-\\xa0])+",M=L.replace("w","w#"),N="\\["+K+"*("+L+")"+K+"*(?:([*^$|!~]?=)"+K+"*(?:(['\"])((?:\\\\.|[^\\\\])*?)\\3|("+M+")|)|)"+K+"*\\]",O=":("+L+")(?:\\(((['\"])((?:\\\\.|[^\\\\])*?)\\3|((?:\\\\.|[^\\\\()[\\]]|"+N.replace(3,8)+")*)|.*)\\)|)",P=new RegExp("^"+K+"+|((?:^|[^\\\\])(?:\\\\.)*)"+K+"+$","g"),Q=new RegExp("^"+K+"*,"+K+"*"),R=new RegExp("^"+K+"*([>+~]|"+K+")"+K+"*"),S=new RegExp("="+K+"*([^\\]'\"]*?)"+K+"*\\]","g"),T=new RegExp(O),U=new RegExp("^"+M+"$"),V={ID:new RegExp("^#("+L+")"),CLASS:new RegExp("^\\.("+L+")"),TAG:new RegExp("^("+L.replace("w","w*")+")"),ATTR:new RegExp("^"+N),PSEUDO:new RegExp("^"+O),CHILD:new RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\("+K+"*(even|odd|(([+-]|)(\\d*)n|)"+K+"*(?:([+-]|)"+K+"*(\\d+)|))"+K+"*\\)|)","i"),bool:new RegExp("^(?:"+J+")$","i"),needsContext:new RegExp("^"+K+"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\("+K+"*((?:-\\d)?\\d*)"+K+"*\\)|)(?=[^-]|$)","i")},W=/^(?:input|select|textarea|button)$/i,X=/^h\d$/i,Y=/^[^{]+\{\s*\[native \w/,Z=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,$=/[+~]/,_=/'|\\/g,ab=new RegExp("\\\\([\\da-f]{1,6}"+K+"?|("+K+")|.)","ig"),bb=function(a,b,c){var d="0x"+b-65536;return d!==d||c?b:0>d?String.fromCharCode(d+65536):String.fromCharCode(d>>10|55296,1023&d|56320)};try{G.apply(D=H.call(t.childNodes),t.childNodes),D[t.childNodes.length].nodeType}catch(cb){G={apply:D.length?function(a,b){F.apply(a,H.call(b))}:function(a,b){var c=a.length,d=0;while(a[c++]=b[d++]);a.length=c-1}}}function db(a,b,d,e){var f,g,h,i,j,m,p,q,u,v;if((b?b.ownerDocument||b:t)!==l&&k(b),b=b||l,d=d||[],!a||"string"!=typeof a)return d;if(1!==(i=b.nodeType)&&9!==i)return[];if(n&&!e){if(f=Z.exec(a))if(h=f[1]){if(9===i){if(g=b.getElementById(h),!g||!g.parentNode)return d;if(g.id===h)return d.push(g),d}else if(b.ownerDocument&&(g=b.ownerDocument.getElementById(h))&&r(b,g)&&g.id===h)return d.push(g),d}else{if(f[2])return G.apply(d,b.getElementsByTagName(a)),d;if((h=f[3])&&c.getElementsByClassName&&b.getElementsByClassName)return G.apply(d,b.getElementsByClassName(h)),d}if(c.qsa&&(!o||!o.test(a))){if(q=p=s,u=b,v=9===i&&a,1===i&&"object"!==b.nodeName.toLowerCase()){m=ob(a),(p=b.getAttribute("id"))?q=p.replace(_,"\\$&"):b.setAttribute("id",q),q="[id='"+q+"'] ",j=m.length;while(j--)m[j]=q+pb(m[j]);u=$.test(a)&&mb(b.parentNode)||b,v=m.join(",")}if(v)try{return G.apply(d,u.querySelectorAll(v)),d}catch(w){}finally{p||b.removeAttribute("id")}}}return xb(a.replace(P,"$1"),b,d,e)}function eb(){var a=[];function b(c,e){return a.push(c+" ")>d.cacheLength&&delete b[a.shift()],b[c+" "]=e}return b}function fb(a){return a[s]=!0,a}function gb(a){var b=l.createElement("div");try{return!!a(b)}catch(c){return!1}finally{b.parentNode&&b.parentNode.removeChild(b),b=null}}function hb(a,b){var c=a.split("|"),e=a.length;while(e--)d.attrHandle[c[e]]=b}function ib(a,b){var c=b&&a,d=c&&1===a.nodeType&&1===b.nodeType&&(~b.sourceIndex||B)-(~a.sourceIndex||B);if(d)return d;if(c)while(c=c.nextSibling)if(c===b)return-1;return a?1:-1}function jb(a){return function(b){var c=b.nodeName.toLowerCase();return"input"===c&&b.type===a}}function kb(a){return function(b){var c=b.nodeName.toLowerCase();return("input"===c||"button"===c)&&b.type===a}}function lb(a){return fb(function(b){return b=+b,fb(function(c,d){var e,f=a([],c.length,b),g=f.length;while(g--)c[e=f[g]]&&(c[e]=!(d[e]=c[e]))})})}function mb(a){return a&&typeof a.getElementsByTagName!==A&&a}c=db.support={},f=db.isXML=function(a){var b=a&&(a.ownerDocument||a).documentElement;return b?"HTML"!==b.nodeName:!1},k=db.setDocument=function(a){var b,e=a?a.ownerDocument||a:t,g=e.defaultView;return e!==l&&9===e.nodeType&&e.documentElement?(l=e,m=e.documentElement,n=!f(e),g&&g!==g.top&&(g.addEventListener?g.addEventListener("unload",function(){k()},!1):g.attachEvent&&g.attachEvent("onunload",function(){k()})),c.attributes=gb(function(a){return a.className="i",!a.getAttribute("className")}),c.getElementsByTagName=gb(function(a){return a.appendChild(e.createComment("")),!a.getElementsByTagName("*").length}),c.getElementsByClassName=Y.test(e.getElementsByClassName)&&gb(function(a){return a.innerHTML="<div class='a'></div><div class='a i'></div>",a.firstChild.className="i",2===a.getElementsByClassName("i").length}),c.getById=gb(function(a){return m.appendChild(a).id=s,!e.getElementsByName||!e.getElementsByName(s).length}),c.getById?(d.find.ID=function(a,b){if(typeof b.getElementById!==A&&n){var c=b.getElementById(a);return c&&c.parentNode?[c]:[]}},d.filter.ID=function(a){var b=a.replace(ab,bb);return function(a){return a.getAttribute("id")===b}}):(delete d.find.ID,d.filter.ID=function(a){var b=a.replace(ab,bb);return function(a){var c=typeof a.getAttributeNode!==A&&a.getAttributeNode("id");return c&&c.value===b}}),d.find.TAG=c.getElementsByTagName?function(a,b){return typeof b.getElementsByTagName!==A?b.getElementsByTagName(a):void 0}:function(a,b){var c,d=[],e=0,f=b.getElementsByTagName(a);if("*"===a){while(c=f[e++])1===c.nodeType&&d.push(c);return d}return f},d.find.CLASS=c.getElementsByClassName&&function(a,b){return typeof b.getElementsByClassName!==A&&n?b.getElementsByClassName(a):void 0},p=[],o=[],(c.qsa=Y.test(e.querySelectorAll))&&(gb(function(a){a.innerHTML="<select t=''><option selected=''></option></select>",a.querySelectorAll("[t^='']").length&&o.push("[*^$]="+K+"*(?:''|\"\")"),a.querySelectorAll("[selected]").length||o.push("\\["+K+"*(?:value|"+J+")"),a.querySelectorAll(":checked").length||o.push(":checked")}),gb(function(a){var b=e.createElement("input");b.setAttribute("type","hidden"),a.appendChild(b).setAttribute("name","D"),a.querySelectorAll("[name=d]").length&&o.push("name"+K+"*[*^$|!~]?="),a.querySelectorAll(":enabled").length||o.push(":enabled",":disabled"),a.querySelectorAll("*,:x"),o.push(",.*:")})),(c.matchesSelector=Y.test(q=m.webkitMatchesSelector||m.mozMatchesSelector||m.oMatchesSelector||m.msMatchesSelector))&&gb(function(a){c.disconnectedMatch=q.call(a,"div"),q.call(a,"[s!='']:x"),p.push("!=",O)}),o=o.length&&new RegExp(o.join("|")),p=p.length&&new RegExp(p.join("|")),b=Y.test(m.compareDocumentPosition),r=b||Y.test(m.contains)?function(a,b){var c=9===a.nodeType?a.documentElement:a,d=b&&b.parentNode;return a===d||!(!d||1!==d.nodeType||!(c.contains?c.contains(d):a.compareDocumentPosition&&16&a.compareDocumentPosition(d)))}:function(a,b){if(b)while(b=b.parentNode)if(b===a)return!0;return!1},z=b?function(a,b){if(a===b)return j=!0,0;var d=!a.compareDocumentPosition-!b.compareDocumentPosition;return d?d:(d=(a.ownerDocument||a)===(b.ownerDocument||b)?a.compareDocumentPosition(b):1,1&d||!c.sortDetached&&b.compareDocumentPosition(a)===d?a===e||a.ownerDocument===t&&r(t,a)?-1:b===e||b.ownerDocument===t&&r(t,b)?1:i?I.call(i,a)-I.call(i,b):0:4&d?-1:1)}:function(a,b){if(a===b)return j=!0,0;var c,d=0,f=a.parentNode,g=b.parentNode,h=[a],k=[b];if(!f||!g)return a===e?-1:b===e?1:f?-1:g?1:i?I.call(i,a)-I.call(i,b):0;if(f===g)return ib(a,b);c=a;while(c=c.parentNode)h.unshift(c);c=b;while(c=c.parentNode)k.unshift(c);while(h[d]===k[d])d++;return d?ib(h[d],k[d]):h[d]===t?-1:k[d]===t?1:0},e):l},db.matches=function(a,b){return db(a,null,null,b)},db.matchesSelector=function(a,b){if((a.ownerDocument||a)!==l&&k(a),b=b.replace(S,"='$1']"),!(!c.matchesSelector||!n||p&&p.test(b)||o&&o.test(b)))try{var d=q.call(a,b);if(d||c.disconnectedMatch||a.document&&11!==a.document.nodeType)return d}catch(e){}return db(b,l,null,[a]).length>0},db.contains=function(a,b){return(a.ownerDocument||a)!==l&&k(a),r(a,b)},db.attr=function(a,b){(a.ownerDocument||a)!==l&&k(a);var e=d.attrHandle[b.toLowerCase()],f=e&&C.call(d.attrHandle,b.toLowerCase())?e(a,b,!n):void 0;return void 0!==f?f:c.attributes||!n?a.getAttribute(b):(f=a.getAttributeNode(b))&&f.specified?f.value:null},db.error=function(a){throw new Error("Syntax error, unrecognized expression: "+a)},db.uniqueSort=function(a){var b,d=[],e=0,f=0;if(j=!c.detectDuplicates,i=!c.sortStable&&a.slice(0),a.sort(z),j){while(b=a[f++])b===a[f]&&(e=d.push(f));while(e--)a.splice(d[e],1)}return i=null,a},e=db.getText=function(a){var b,c="",d=0,f=a.nodeType;if(f){if(1===f||9===f||11===f){if("string"==typeof a.textContent)return a.textContent;for(a=a.firstChild;a;a=a.nextSibling)c+=e(a)}else if(3===f||4===f)return a.nodeValue}else while(b=a[d++])c+=e(b);return c},d=db.selectors={cacheLength:50,createPseudo:fb,match:V,attrHandle:{},find:{},relative:{">":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(a){return a[1]=a[1].replace(ab,bb),a[3]=(a[4]||a[5]||"").replace(ab,bb),"~="===a[2]&&(a[3]=" "+a[3]+" "),a.slice(0,4)},CHILD:function(a){return a[1]=a[1].toLowerCase(),"nth"===a[1].slice(0,3)?(a[3]||db.error(a[0]),a[4]=+(a[4]?a[5]+(a[6]||1):2*("even"===a[3]||"odd"===a[3])),a[5]=+(a[7]+a[8]||"odd"===a[3])):a[3]&&db.error(a[0]),a},PSEUDO:function(a){var b,c=!a[5]&&a[2];return V.CHILD.test(a[0])?null:(a[3]&&void 0!==a[4]?a[2]=a[4]:c&&T.test(c)&&(b=ob(c,!0))&&(b=c.indexOf(")",c.length-b)-c.length)&&(a[0]=a[0].slice(0,b),a[2]=c.slice(0,b)),a.slice(0,3))}},filter:{TAG:function(a){var b=a.replace(ab,bb).toLowerCase();return"*"===a?function(){return!0}:function(a){return a.nodeName&&a.nodeName.toLowerCase()===b}},CLASS:function(a){var b=w[a+" "];return b||(b=new RegExp("(^|"+K+")"+a+"("+K+"|$)"))&&w(a,function(a){return b.test("string"==typeof a.className&&a.className||typeof a.getAttribute!==A&&a.getAttribute("class")||"")})},ATTR:function(a,b,c){return function(d){var e=db.attr(d,a);return null==e?"!="===b:b?(e+="","="===b?e===c:"!="===b?e!==c:"^="===b?c&&0===e.indexOf(c):"*="===b?c&&e.indexOf(c)>-1:"$="===b?c&&e.slice(-c.length)===c:"~="===b?(" "+e+" ").indexOf(c)>-1:"|="===b?e===c||e.slice(0,c.length+1)===c+"-":!1):!0}},CHILD:function(a,b,c,d,e){var f="nth"!==a.slice(0,3),g="last"!==a.slice(-4),h="of-type"===b;return 1===d&&0===e?function(a){return!!a.parentNode}:function(b,c,i){var j,k,l,m,n,o,p=f!==g?"nextSibling":"previousSibling",q=b.parentNode,r=h&&b.nodeName.toLowerCase(),t=!i&&!h;if(q){if(f){while(p){l=b;while(l=l[p])if(h?l.nodeName.toLowerCase()===r:1===l.nodeType)return!1;o=p="only"===a&&!o&&"nextSibling"}return!0}if(o=[g?q.firstChild:q.lastChild],g&&t){k=q[s]||(q[s]={}),j=k[a]||[],n=j[0]===u&&j[1],m=j[0]===u&&j[2],l=n&&q.childNodes[n];while(l=++n&&l&&l[p]||(m=n=0)||o.pop())if(1===l.nodeType&&++m&&l===b){k[a]=[u,n,m];break}}else if(t&&(j=(b[s]||(b[s]={}))[a])&&j[0]===u)m=j[1];else while(l=++n&&l&&l[p]||(m=n=0)||o.pop())if((h?l.nodeName.toLowerCase()===r:1===l.nodeType)&&++m&&(t&&((l[s]||(l[s]={}))[a]=[u,m]),l===b))break;return m-=e,m===d||m%d===0&&m/d>=0}}},PSEUDO:function(a,b){var c,e=d.pseudos[a]||d.setFilters[a.toLowerCase()]||db.error("unsupported pseudo: "+a);return e[s]?e(b):e.length>1?(c=[a,a,"",b],d.setFilters.hasOwnProperty(a.toLowerCase())?fb(function(a,c){var d,f=e(a,b),g=f.length;while(g--)d=I.call(a,f[g]),a[d]=!(c[d]=f[g])}):function(a){return e(a,0,c)}):e}},pseudos:{not:fb(function(a){var b=[],c=[],d=g(a.replace(P,"$1"));return d[s]?fb(function(a,b,c,e){var f,g=d(a,null,e,[]),h=a.length;while(h--)(f=g[h])&&(a[h]=!(b[h]=f))}):function(a,e,f){return b[0]=a,d(b,null,f,c),!c.pop()}}),has:fb(function(a){return function(b){return db(a,b).length>0}}),contains:fb(function(a){return function(b){return(b.textContent||b.innerText||e(b)).indexOf(a)>-1}}),lang:fb(function(a){return U.test(a||"")||db.error("unsupported lang: "+a),a=a.replace(ab,bb).toLowerCase(),function(b){var c;do if(c=n?b.lang:b.getAttribute("xml:lang")||b.getAttribute("lang"))return c=c.toLowerCase(),c===a||0===c.indexOf(a+"-");while((b=b.parentNode)&&1===b.nodeType);return!1}}),target:function(b){var c=a.location&&a.location.hash;return c&&c.slice(1)===b.id},root:function(a){return a===m},focus:function(a){return a===l.activeElement&&(!l.hasFocus||l.hasFocus())&&!!(a.type||a.href||~a.tabIndex)},enabled:function(a){return a.disabled===!1},disabled:function(a){return a.disabled===!0},checked:function(a){var b=a.nodeName.toLowerCase();return"input"===b&&!!a.checked||"option"===b&&!!a.selected},selected:function(a){return a.parentNode&&a.parentNode.selectedIndex,a.selected===!0},empty:function(a){for(a=a.firstChild;a;a=a.nextSibling)if(a.nodeType<6)return!1;return!0},parent:function(a){return!d.pseudos.empty(a)},header:function(a){return X.test(a.nodeName)},input:function(a){return W.test(a.nodeName)},button:function(a){var b=a.nodeName.toLowerCase();return"input"===b&&"button"===a.type||"button"===b},text:function(a){var b;return"input"===a.nodeName.toLowerCase()&&"text"===a.type&&(null==(b=a.getAttribute("type"))||"text"===b.toLowerCase())},first:lb(function(){return[0]}),last:lb(function(a,b){return[b-1]}),eq:lb(function(a,b,c){return[0>c?c+b:c]}),even:lb(function(a,b){for(var c=0;b>c;c+=2)a.push(c);return a}),odd:lb(function(a,b){for(var c=1;b>c;c+=2)a.push(c);return a}),lt:lb(function(a,b,c){for(var d=0>c?c+b:c;--d>=0;)a.push(d);return a}),gt:lb(function(a,b,c){for(var d=0>c?c+b:c;++d<b;)a.push(d);return a})}},d.pseudos.nth=d.pseudos.eq;for(b in{radio:!0,checkbox:!0,file:!0,password:!0,image:!0})d.pseudos[b]=jb(b);for(b in{submit:!0,reset:!0})d.pseudos[b]=kb(b);function nb(){}nb.prototype=d.filters=d.pseudos,d.setFilters=new nb;function ob(a,b){var c,e,f,g,h,i,j,k=x[a+" "];if(k)return b?0:k.slice(0);h=a,i=[],j=d.preFilter;while(h){(!c||(e=Q.exec(h)))&&(e&&(h=h.slice(e[0].length)||h),i.push(f=[])),c=!1,(e=R.exec(h))&&(c=e.shift(),f.push({value:c,type:e[0].replace(P," ")}),h=h.slice(c.length));for(g in d.filter)!(e=V[g].exec(h))||j[g]&&!(e=j[g](e))||(c=e.shift(),f.push({value:c,type:g,matches:e}),h=h.slice(c.length));if(!c)break}return b?h.length:h?db.error(a):x(a,i).slice(0)}function pb(a){for(var b=0,c=a.length,d="";c>b;b++)d+=a[b].value;return d}function qb(a,b,c){var d=b.dir,e=c&&"parentNode"===d,f=v++;return b.first?function(b,c,f){while(b=b[d])if(1===b.nodeType||e)return a(b,c,f)}:function(b,c,g){var h,i,j=[u,f];if(g){while(b=b[d])if((1===b.nodeType||e)&&a(b,c,g))return!0}else while(b=b[d])if(1===b.nodeType||e){if(i=b[s]||(b[s]={}),(h=i[d])&&h[0]===u&&h[1]===f)return j[2]=h[2];if(i[d]=j,j[2]=a(b,c,g))return!0}}}function rb(a){return a.length>1?function(b,c,d){var e=a.length;while(e--)if(!a[e](b,c,d))return!1;return!0}:a[0]}function sb(a,b,c,d,e){for(var f,g=[],h=0,i=a.length,j=null!=b;i>h;h++)(f=a[h])&&(!c||c(f,d,e))&&(g.push(f),j&&b.push(h));return g}function tb(a,b,c,d,e,f){return d&&!d[s]&&(d=tb(d)),e&&!e[s]&&(e=tb(e,f)),fb(function(f,g,h,i){var j,k,l,m=[],n=[],o=g.length,p=f||wb(b||"*",h.nodeType?[h]:h,[]),q=!a||!f&&b?p:sb(p,m,a,h,i),r=c?e||(f?a:o||d)?[]:g:q;if(c&&c(q,r,h,i),d){j=sb(r,n),d(j,[],h,i),k=j.length;while(k--)(l=j[k])&&(r[n[k]]=!(q[n[k]]=l))}if(f){if(e||a){if(e){j=[],k=r.length;while(k--)(l=r[k])&&j.push(q[k]=l);e(null,r=[],j,i)}k=r.length;while(k--)(l=r[k])&&(j=e?I.call(f,l):m[k])>-1&&(f[j]=!(g[j]=l))}}else r=sb(r===g?r.splice(o,r.length):r),e?e(null,g,r,i):G.apply(g,r)})}function ub(a){for(var b,c,e,f=a.length,g=d.relative[a[0].type],i=g||d.relative[" "],j=g?1:0,k=qb(function(a){return a===b},i,!0),l=qb(function(a){return I.call(b,a)>-1},i,!0),m=[function(a,c,d){return!g&&(d||c!==h)||((b=c).nodeType?k(a,c,d):l(a,c,d))}];f>j;j++)if(c=d.relative[a[j].type])m=[qb(rb(m),c)];else{if(c=d.filter[a[j].type].apply(null,a[j].matches),c[s]){for(e=++j;f>e;e++)if(d.relative[a[e].type])break;return tb(j>1&&rb(m),j>1&&pb(a.slice(0,j-1).concat({value:" "===a[j-2].type?"*":""})).replace(P,"$1"),c,e>j&&ub(a.slice(j,e)),f>e&&ub(a=a.slice(e)),f>e&&pb(a))}m.push(c)}return rb(m)}function vb(a,b){var c=b.length>0,e=a.length>0,f=function(f,g,i,j,k){var m,n,o,p=0,q="0",r=f&&[],s=[],t=h,v=f||e&&d.find.TAG("*",k),w=u+=null==t?1:Math.random()||.1,x=v.length;for(k&&(h=g!==l&&g);q!==x&&null!=(m=v[q]);q++){if(e&&m){n=0;while(o=a[n++])if(o(m,g,i)){j.push(m);break}k&&(u=w)}c&&((m=!o&&m)&&p--,f&&r.push(m))}if(p+=q,c&&q!==p){n=0;while(o=b[n++])o(r,s,g,i);if(f){if(p>0)while(q--)r[q]||s[q]||(s[q]=E.call(j));s=sb(s)}G.apply(j,s),k&&!f&&s.length>0&&p+b.length>1&&db.uniqueSort(j)}return k&&(u=w,h=t),r};return c?fb(f):f}g=db.compile=function(a,b){var c,d=[],e=[],f=y[a+" "];if(!f){b||(b=ob(a)),c=b.length;while(c--)f=ub(b[c]),f[s]?d.push(f):e.push(f);f=y(a,vb(e,d))}return f};function wb(a,b,c){for(var d=0,e=b.length;e>d;d++)db(a,b[d],c);return c}function xb(a,b,e,f){var h,i,j,k,l,m=ob(a);if(!f&&1===m.length){if(i=m[0]=m[0].slice(0),i.length>2&&"ID"===(j=i[0]).type&&c.getById&&9===b.nodeType&&n&&d.relative[i[1].type]){if(b=(d.find.ID(j.matches[0].replace(ab,bb),b)||[])[0],!b)return e;a=a.slice(i.shift().value.length)}h=V.needsContext.test(a)?0:i.length;while(h--){if(j=i[h],d.relative[k=j.type])break;if((l=d.find[k])&&(f=l(j.matches[0].replace(ab,bb),$.test(i[0].type)&&mb(b.parentNode)||b))){if(i.splice(h,1),a=f.length&&pb(i),!a)return G.apply(e,f),e;break}}}return g(a,m)(f,b,!n,e,$.test(a)&&mb(b.parentNode)||b),e}return c.sortStable=s.split("").sort(z).join("")===s,c.detectDuplicates=!!j,k(),c.sortDetached=gb(function(a){return 1&a.compareDocumentPosition(l.createElement("div"))}),gb(function(a){return a.innerHTML="<a href='#'></a>","#"===a.firstChild.getAttribute("href")})||hb("type|href|height|width",function(a,b,c){return c?void 0:a.getAttribute(b,"type"===b.toLowerCase()?1:2)}),c.attributes&&gb(function(a){return a.innerHTML="<input/>",a.firstChild.setAttribute("value",""),""===a.firstChild.getAttribute("value")})||hb("value",function(a,b,c){return c||"input"!==a.nodeName.toLowerCase()?void 0:a.defaultValue}),gb(function(a){return null==a.getAttribute("disabled")})||hb(J,function(a,b,c){var d;return c?void 0:a[b]===!0?b.toLowerCase():(d=a.getAttributeNode(b))&&d.specified?d.value:null}),db}(a);n.find=t,n.expr=t.selectors,n.expr[":"]=n.expr.pseudos,n.unique=t.uniqueSort,n.text=t.getText,n.isXMLDoc=t.isXML,n.contains=t.contains;var u=n.expr.match.needsContext,v=/^<(\w+)\s*\/?>(?:<\/\1>|)$/,w=/^.[^:#\[\.,]*$/;function x(a,b,c){if(n.isFunction(b))return n.grep(a,function(a,d){return!!b.call(a,d,a)!==c});if(b.nodeType)return n.grep(a,function(a){return a===b!==c});if("string"==typeof b){if(w.test(b))return n.filter(b,a,c);b=n.filter(b,a)}return n.grep(a,function(a){return n.inArray(a,b)>=0!==c})}n.filter=function(a,b,c){var d=b[0];return c&&(a=":not("+a+")"),1===b.length&&1===d.nodeType?n.find.matchesSelector(d,a)?[d]:[]:n.find.matches(a,n.grep(b,function(a){return 1===a.nodeType}))},n.fn.extend({find:function(a){var b,c=[],d=this,e=d.length;if("string"!=typeof a)return this.pushStack(n(a).filter(function(){for(b=0;e>b;b++)if(n.contains(d[b],this))return!0}));for(b=0;e>b;b++)n.find(a,d[b],c);return c=this.pushStack(e>1?n.unique(c):c),c.selector=this.selector?this.selector+" "+a:a,c},filter:function(a){return this.pushStack(x(this,a||[],!1))},not:function(a){return this.pushStack(x(this,a||[],!0))},is:function(a){return!!x(this,"string"==typeof a&&u.test(a)?n(a):a||[],!1).length}});var y,z=a.document,A=/^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]*))$/,B=n.fn.init=function(a,b){var c,d;if(!a)return this;if("string"==typeof a){if(c="<"===a.charAt(0)&&">"===a.charAt(a.length-1)&&a.length>=3?[null,a,null]:A.exec(a),!c||!c[1]&&b)return!b||b.jquery?(b||y).find(a):this.constructor(b).find(a);if(c[1]){if(b=b instanceof n?b[0]:b,n.merge(this,n.parseHTML(c[1],b&&b.nodeType?b.ownerDocument||b:z,!0)),v.test(c[1])&&n.isPlainObject(b))for(c in b)n.isFunction(this[c])?this[c](b[c]):this.attr(c,b[c]);return this}if(d=z.getElementById(c[2]),d&&d.parentNode){if(d.id!==c[2])return y.find(a);this.length=1,this[0]=d}return this.context=z,this.selector=a,this}return a.nodeType?(this.context=this[0]=a,this.length=1,this):n.isFunction(a)?"undefined"!=typeof y.ready?y.ready(a):a(n):(void 0!==a.selector&&(this.selector=a.selector,this.context=a.context),n.makeArray(a,this))};B.prototype=n.fn,y=n(z);var C=/^(?:parents|prev(?:Until|All))/,D={children:!0,contents:!0,next:!0,prev:!0};n.extend({dir:function(a,b,c){var d=[],e=a[b];while(e&&9!==e.nodeType&&(void 0===c||1!==e.nodeType||!n(e).is(c)))1===e.nodeType&&d.push(e),e=e[b];return d},sibling:function(a,b){for(var c=[];a;a=a.nextSibling)1===a.nodeType&&a!==b&&c.push(a);return c}}),n.fn.extend({has:function(a){var b,c=n(a,this),d=c.length;return this.filter(function(){for(b=0;d>b;b++)if(n.contains(this,c[b]))return!0})},closest:function(a,b){for(var c,d=0,e=this.length,f=[],g=u.test(a)||"string"!=typeof a?n(a,b||this.context):0;e>d;d++)for(c=this[d];c&&c!==b;c=c.parentNode)if(c.nodeType<11&&(g?g.index(c)>-1:1===c.nodeType&&n.find.matchesSelector(c,a))){f.push(c);break}return this.pushStack(f.length>1?n.unique(f):f)},index:function(a){return a?"string"==typeof a?n.inArray(this[0],n(a)):n.inArray(a.jquery?a[0]:a,this):this[0]&&this[0].parentNode?this.first().prevAll().length:-1},add:function(a,b){return this.pushStack(n.unique(n.merge(this.get(),n(a,b))))},addBack:function(a){return this.add(null==a?this.prevObject:this.prevObject.filter(a))}});function E(a,b){do a=a[b];while(a&&1!==a.nodeType);return a}n.each({parent:function(a){var b=a.parentNode;return b&&11!==b.nodeType?b:null},parents:function(a){return n.dir(a,"parentNode")},parentsUntil:function(a,b,c){return n.dir(a,"parentNode",c)},next:function(a){return E(a,"nextSibling")},prev:function(a){return E(a,"previousSibling")},nextAll:function(a){return n.dir(a,"nextSibling")},prevAll:function(a){return n.dir(a,"previousSibling")},nextUntil:function(a,b,c){return n.dir(a,"nextSibling",c)},prevUntil:function(a,b,c){return n.dir(a,"previousSibling",c)},siblings:function(a){return n.sibling((a.parentNode||{}).firstChild,a)},children:function(a){return n.sibling(a.firstChild)},contents:function(a){return n.nodeName(a,"iframe")?a.contentDocument||a.contentWindow.document:n.merge([],a.childNodes)}},function(a,b){n.fn[a]=function(c,d){var e=n.map(this,b,c);return"Until"!==a.slice(-5)&&(d=c),d&&"string"==typeof d&&(e=n.filter(d,e)),this.length>1&&(D[a]||(e=n.unique(e)),C.test(a)&&(e=e.reverse())),this.pushStack(e)}});var F=/\S+/g,G={};function H(a){var b=G[a]={};return n.each(a.match(F)||[],function(a,c){b[c]=!0}),b}n.Callbacks=function(a){a="string"==typeof a?G[a]||H(a):n.extend({},a);var b,c,d,e,f,g,h=[],i=!a.once&&[],j=function(l){for(c=a.memory&&l,d=!0,f=g||0,g=0,e=h.length,b=!0;h&&e>f;f++)if(h[f].apply(l[0],l[1])===!1&&a.stopOnFalse){c=!1;break}b=!1,h&&(i?i.length&&j(i.shift()):c?h=[]:k.disable())},k={add:function(){if(h){var d=h.length;!function f(b){n.each(b,function(b,c){var d=n.type(c);"function"===d?a.unique&&k.has(c)||h.push(c):c&&c.length&&"string"!==d&&f(c)})}(arguments),b?e=h.length:c&&(g=d,j(c))}return this},remove:function(){return h&&n.each(arguments,function(a,c){var d;while((d=n.inArray(c,h,d))>-1)h.splice(d,1),b&&(e>=d&&e--,f>=d&&f--)}),this},has:function(a){return a?n.inArray(a,h)>-1:!(!h||!h.length)},empty:function(){return h=[],e=0,this},disable:function(){return h=i=c=void 0,this},disabled:function(){return!h},lock:function(){return i=void 0,c||k.disable(),this},locked:function(){return!i},fireWith:function(a,c){return!h||d&&!i||(c=c||[],c=[a,c.slice?c.slice():c],b?i.push(c):j(c)),this},fire:function(){return k.fireWith(this,arguments),this},fired:function(){return!!d}};return k},n.extend({Deferred:function(a){var b=[["resolve","done",n.Callbacks("once memory"),"resolved"],["reject","fail",n.Callbacks("once memory"),"rejected"],["notify","progress",n.Callbacks("memory")]],c="pending",d={state:function(){return c},always:function(){return e.done(arguments).fail(arguments),this},then:function(){var a=arguments;return n.Deferred(function(c){n.each(b,function(b,f){var g=n.isFunction(a[b])&&a[b];e[f[1]](function(){var a=g&&g.apply(this,arguments);a&&n.isFunction(a.promise)?a.promise().done(c.resolve).fail(c.reject).progress(c.notify):c[f[0]+"With"](this===d?c.promise():this,g?[a]:arguments)})}),a=null}).promise()},promise:function(a){return null!=a?n.extend(a,d):d}},e={};return d.pipe=d.then,n.each(b,function(a,f){var g=f[2],h=f[3];d[f[1]]=g.add,h&&g.add(function(){c=h},b[1^a][2].disable,b[2][2].lock),e[f[0]]=function(){return e[f[0]+"With"](this===e?d:this,arguments),this},e[f[0]+"With"]=g.fireWith}),d.promise(e),a&&a.call(e,e),e},when:function(a){var b=0,c=d.call(arguments),e=c.length,f=1!==e||a&&n.isFunction(a.promise)?e:0,g=1===f?a:n.Deferred(),h=function(a,b,c){return function(e){b[a]=this,c[a]=arguments.length>1?d.call(arguments):e,c===i?g.notifyWith(b,c):--f||g.resolveWith(b,c)}},i,j,k;if(e>1)for(i=new Array(e),j=new Array(e),k=new Array(e);e>b;b++)c[b]&&n.isFunction(c[b].promise)?c[b].promise().done(h(b,k,c)).fail(g.reject).progress(h(b,j,i)):--f;return f||g.resolveWith(k,c),g.promise()}});var I;n.fn.ready=function(a){return n.ready.promise().done(a),this},n.extend({isReady:!1,readyWait:1,holdReady:function(a){a?n.readyWait++:n.ready(!0)},ready:function(a){if(a===!0?!--n.readyWait:!n.isReady){if(!z.body)return setTimeout(n.ready);n.isReady=!0,a!==!0&&--n.readyWait>0||(I.resolveWith(z,[n]),n.fn.trigger&&n(z).trigger("ready").off("ready"))}}});function J(){z.addEventListener?(z.removeEventListener("DOMContentLoaded",K,!1),a.removeEventListener("load",K,!1)):(z.detachEvent("onreadystatechange",K),a.detachEvent("onload",K))}function K(){(z.addEventListener||"load"===event.type||"complete"===z.readyState)&&(J(),n.ready())}n.ready.promise=function(b){if(!I)if(I=n.Deferred(),"complete"===z.readyState)setTimeout(n.ready);else if(z.addEventListener)z.addEventListener("DOMContentLoaded",K,!1),a.addEventListener("load",K,!1);else{z.attachEvent("onreadystatechange",K),a.attachEvent("onload",K);var c=!1;try{c=null==a.frameElement&&z.documentElement}catch(d){}c&&c.doScroll&&!function e(){if(!n.isReady){try{c.doScroll("left")}catch(a){return setTimeout(e,50)}J(),n.ready()}}()}return I.promise(b)};var L="undefined",M;for(M in n(l))break;l.ownLast="0"!==M,l.inlineBlockNeedsLayout=!1,n(function(){var a,b,c=z.getElementsByTagName("body")[0];c&&(a=z.createElement("div"),a.style.cssText="border:0;width:0;height:0;position:absolute;top:0;left:-9999px;margin-top:1px",b=z.createElement("div"),c.appendChild(a).appendChild(b),typeof b.style.zoom!==L&&(b.style.cssText="border:0;margin:0;width:1px;padding:1px;display:inline;zoom:1",(l.inlineBlockNeedsLayout=3===b.offsetWidth)&&(c.style.zoom=1)),c.removeChild(a),a=b=null)}),function(){var a=z.createElement("div");if(null==l.deleteExpando){l.deleteExpando=!0;try{delete a.test}catch(b){l.deleteExpando=!1}}a=null}(),n.acceptData=function(a){var b=n.noData[(a.nodeName+" ").toLowerCase()],c=+a.nodeType||1;return 1!==c&&9!==c?!1:!b||b!==!0&&a.getAttribute("classid")===b};var N=/^(?:\{[\w\W]*\}|\[[\w\W]*\])$/,O=/([A-Z])/g;function P(a,b,c){if(void 0===c&&1===a.nodeType){var d="data-"+b.replace(O,"-$1").toLowerCase();if(c=a.getAttribute(d),"string"==typeof c){try{c="true"===c?!0:"false"===c?!1:"null"===c?null:+c+""===c?+c:N.test(c)?n.parseJSON(c):c}catch(e){}n.data(a,b,c)}else c=void 0}return c}function Q(a){var b;for(b in a)if(("data"!==b||!n.isEmptyObject(a[b]))&&"toJSON"!==b)return!1;return!0}function R(a,b,d,e){if(n.acceptData(a)){var f,g,h=n.expando,i=a.nodeType,j=i?n.cache:a,k=i?a[h]:a[h]&&h;if(k&&j[k]&&(e||j[k].data)||void 0!==d||"string"!=typeof b)return k||(k=i?a[h]=c.pop()||n.guid++:h),j[k]||(j[k]=i?{}:{toJSON:n.noop}),("object"==typeof b||"function"==typeof b)&&(e?j[k]=n.extend(j[k],b):j[k].data=n.extend(j[k].data,b)),g=j[k],e||(g.data||(g.data={}),g=g.data),void 0!==d&&(g[n.camelCase(b)]=d),"string"==typeof b?(f=g[b],null==f&&(f=g[n.camelCase(b)])):f=g,f }}function S(a,b,c){if(n.acceptData(a)){var d,e,f=a.nodeType,g=f?n.cache:a,h=f?a[n.expando]:n.expando;if(g[h]){if(b&&(d=c?g[h]:g[h].data)){n.isArray(b)?b=b.concat(n.map(b,n.camelCase)):b in d?b=[b]:(b=n.camelCase(b),b=b in d?[b]:b.split(" ")),e=b.length;while(e--)delete d[b[e]];if(c?!Q(d):!n.isEmptyObject(d))return}(c||(delete g[h].data,Q(g[h])))&&(f?n.cleanData([a],!0):l.deleteExpando||g!=g.window?delete g[h]:g[h]=null)}}}n.extend({cache:{},noData:{"applet ":!0,"embed ":!0,"object ":"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"},hasData:function(a){return a=a.nodeType?n.cache[a[n.expando]]:a[n.expando],!!a&&!Q(a)},data:function(a,b,c){return R(a,b,c)},removeData:function(a,b){return S(a,b)},_data:function(a,b,c){return R(a,b,c,!0)},_removeData:function(a,b){return S(a,b,!0)}}),n.fn.extend({data:function(a,b){var c,d,e,f=this[0],g=f&&f.attributes;if(void 0===a){if(this.length&&(e=n.data(f),1===f.nodeType&&!n._data(f,"parsedAttrs"))){c=g.length;while(c--)d=g[c].name,0===d.indexOf("data-")&&(d=n.camelCase(d.slice(5)),P(f,d,e[d]));n._data(f,"parsedAttrs",!0)}return e}return"object"==typeof a?this.each(function(){n.data(this,a)}):arguments.length>1?this.each(function(){n.data(this,a,b)}):f?P(f,a,n.data(f,a)):void 0},removeData:function(a){return this.each(function(){n.removeData(this,a)})}}),n.extend({queue:function(a,b,c){var d;return a?(b=(b||"fx")+"queue",d=n._data(a,b),c&&(!d||n.isArray(c)?d=n._data(a,b,n.makeArray(c)):d.push(c)),d||[]):void 0},dequeue:function(a,b){b=b||"fx";var c=n.queue(a,b),d=c.length,e=c.shift(),f=n._queueHooks(a,b),g=function(){n.dequeue(a,b)};"inprogress"===e&&(e=c.shift(),d--),e&&("fx"===b&&c.unshift("inprogress"),delete f.stop,e.call(a,g,f)),!d&&f&&f.empty.fire()},_queueHooks:function(a,b){var c=b+"queueHooks";return n._data(a,c)||n._data(a,c,{empty:n.Callbacks("once memory").add(function(){n._removeData(a,b+"queue"),n._removeData(a,c)})})}}),n.fn.extend({queue:function(a,b){var c=2;return"string"!=typeof a&&(b=a,a="fx",c--),arguments.length<c?n.queue(this[0],a):void 0===b?this:this.each(function(){var c=n.queue(this,a,b);n._queueHooks(this,a),"fx"===a&&"inprogress"!==c[0]&&n.dequeue(this,a)})},dequeue:function(a){return this.each(function(){n.dequeue(this,a)})},clearQueue:function(a){return this.queue(a||"fx",[])},promise:function(a,b){var c,d=1,e=n.Deferred(),f=this,g=this.length,h=function(){--d||e.resolveWith(f,[f])};"string"!=typeof a&&(b=a,a=void 0),a=a||"fx";while(g--)c=n._data(f[g],a+"queueHooks"),c&&c.empty&&(d++,c.empty.add(h));return h(),e.promise(b)}});var T=/[+-]?(?:\d*\.|)\d+(?:[eE][+-]?\d+|)/.source,U=["Top","Right","Bottom","Left"],V=function(a,b){return a=b||a,"none"===n.css(a,"display")||!n.contains(a.ownerDocument,a)},W=n.access=function(a,b,c,d,e,f,g){var h=0,i=a.length,j=null==c;if("object"===n.type(c)){e=!0;for(h in c)n.access(a,b,h,c[h],!0,f,g)}else if(void 0!==d&&(e=!0,n.isFunction(d)||(g=!0),j&&(g?(b.call(a,d),b=null):(j=b,b=function(a,b,c){return j.call(n(a),c)})),b))for(;i>h;h++)b(a[h],c,g?d:d.call(a[h],h,b(a[h],c)));return e?a:j?b.call(a):i?b(a[0],c):f},X=/^(?:checkbox|radio)$/i;!function(){var a=z.createDocumentFragment(),b=z.createElement("div"),c=z.createElement("input");if(b.setAttribute("className","t"),b.innerHTML=" <link/><table></table><a href='/a'>a</a>",l.leadingWhitespace=3===b.firstChild.nodeType,l.tbody=!b.getElementsByTagName("tbody").length,l.htmlSerialize=!!b.getElementsByTagName("link").length,l.html5Clone="<:nav></:nav>"!==z.createElement("nav").cloneNode(!0).outerHTML,c.type="checkbox",c.checked=!0,a.appendChild(c),l.appendChecked=c.checked,b.innerHTML="<textarea>x</textarea>",l.noCloneChecked=!!b.cloneNode(!0).lastChild.defaultValue,a.appendChild(b),b.innerHTML="<input type='radio' checked='checked' name='t'/>",l.checkClone=b.cloneNode(!0).cloneNode(!0).lastChild.checked,l.noCloneEvent=!0,b.attachEvent&&(b.attachEvent("onclick",function(){l.noCloneEvent=!1}),b.cloneNode(!0).click()),null==l.deleteExpando){l.deleteExpando=!0;try{delete b.test}catch(d){l.deleteExpando=!1}}a=b=c=null}(),function(){var b,c,d=z.createElement("div");for(b in{submit:!0,change:!0,focusin:!0})c="on"+b,(l[b+"Bubbles"]=c in a)||(d.setAttribute(c,"t"),l[b+"Bubbles"]=d.attributes[c].expando===!1);d=null}();var Y=/^(?:input|select|textarea)$/i,Z=/^key/,$=/^(?:mouse|contextmenu)|click/,_=/^(?:focusinfocus|focusoutblur)$/,ab=/^([^.]*)(?:\.(.+)|)$/;function bb(){return!0}function cb(){return!1}function db(){try{return z.activeElement}catch(a){}}n.event={global:{},add:function(a,b,c,d,e){var f,g,h,i,j,k,l,m,o,p,q,r=n._data(a);if(r){c.handler&&(i=c,c=i.handler,e=i.selector),c.guid||(c.guid=n.guid++),(g=r.events)||(g=r.events={}),(k=r.handle)||(k=r.handle=function(a){return typeof n===L||a&&n.event.triggered===a.type?void 0:n.event.dispatch.apply(k.elem,arguments)},k.elem=a),b=(b||"").match(F)||[""],h=b.length;while(h--)f=ab.exec(b[h])||[],o=q=f[1],p=(f[2]||"").split(".").sort(),o&&(j=n.event.special[o]||{},o=(e?j.delegateType:j.bindType)||o,j=n.event.special[o]||{},l=n.extend({type:o,origType:q,data:d,handler:c,guid:c.guid,selector:e,needsContext:e&&n.expr.match.needsContext.test(e),namespace:p.join(".")},i),(m=g[o])||(m=g[o]=[],m.delegateCount=0,j.setup&&j.setup.call(a,d,p,k)!==!1||(a.addEventListener?a.addEventListener(o,k,!1):a.attachEvent&&a.attachEvent("on"+o,k))),j.add&&(j.add.call(a,l),l.handler.guid||(l.handler.guid=c.guid)),e?m.splice(m.delegateCount++,0,l):m.push(l),n.event.global[o]=!0);a=null}},remove:function(a,b,c,d,e){var f,g,h,i,j,k,l,m,o,p,q,r=n.hasData(a)&&n._data(a);if(r&&(k=r.events)){b=(b||"").match(F)||[""],j=b.length;while(j--)if(h=ab.exec(b[j])||[],o=q=h[1],p=(h[2]||"").split(".").sort(),o){l=n.event.special[o]||{},o=(d?l.delegateType:l.bindType)||o,m=k[o]||[],h=h[2]&&new RegExp("(^|\\.)"+p.join("\\.(?:.*\\.|)")+"(\\.|$)"),i=f=m.length;while(f--)g=m[f],!e&&q!==g.origType||c&&c.guid!==g.guid||h&&!h.test(g.namespace)||d&&d!==g.selector&&("**"!==d||!g.selector)||(m.splice(f,1),g.selector&&m.delegateCount--,l.remove&&l.remove.call(a,g));i&&!m.length&&(l.teardown&&l.teardown.call(a,p,r.handle)!==!1||n.removeEvent(a,o,r.handle),delete k[o])}else for(o in k)n.event.remove(a,o+b[j],c,d,!0);n.isEmptyObject(k)&&(delete r.handle,n._removeData(a,"events"))}},trigger:function(b,c,d,e){var f,g,h,i,k,l,m,o=[d||z],p=j.call(b,"type")?b.type:b,q=j.call(b,"namespace")?b.namespace.split("."):[];if(h=l=d=d||z,3!==d.nodeType&&8!==d.nodeType&&!_.test(p+n.event.triggered)&&(p.indexOf(".")>=0&&(q=p.split("."),p=q.shift(),q.sort()),g=p.indexOf(":")<0&&"on"+p,b=b[n.expando]?b:new n.Event(p,"object"==typeof b&&b),b.isTrigger=e?2:3,b.namespace=q.join("."),b.namespace_re=b.namespace?new RegExp("(^|\\.)"+q.join("\\.(?:.*\\.|)")+"(\\.|$)"):null,b.result=void 0,b.target||(b.target=d),c=null==c?[b]:n.makeArray(c,[b]),k=n.event.special[p]||{},e||!k.trigger||k.trigger.apply(d,c)!==!1)){if(!e&&!k.noBubble&&!n.isWindow(d)){for(i=k.delegateType||p,_.test(i+p)||(h=h.parentNode);h;h=h.parentNode)o.push(h),l=h;l===(d.ownerDocument||z)&&o.push(l.defaultView||l.parentWindow||a)}m=0;while((h=o[m++])&&!b.isPropagationStopped())b.type=m>1?i:k.bindType||p,f=(n._data(h,"events")||{})[b.type]&&n._data(h,"handle"),f&&f.apply(h,c),f=g&&h[g],f&&f.apply&&n.acceptData(h)&&(b.result=f.apply(h,c),b.result===!1&&b.preventDefault());if(b.type=p,!e&&!b.isDefaultPrevented()&&(!k._default||k._default.apply(o.pop(),c)===!1)&&n.acceptData(d)&&g&&d[p]&&!n.isWindow(d)){l=d[g],l&&(d[g]=null),n.event.triggered=p;try{d[p]()}catch(r){}n.event.triggered=void 0,l&&(d[g]=l)}return b.result}},dispatch:function(a){a=n.event.fix(a);var b,c,e,f,g,h=[],i=d.call(arguments),j=(n._data(this,"events")||{})[a.type]||[],k=n.event.special[a.type]||{};if(i[0]=a,a.delegateTarget=this,!k.preDispatch||k.preDispatch.call(this,a)!==!1){h=n.event.handlers.call(this,a,j),b=0;while((f=h[b++])&&!a.isPropagationStopped()){a.currentTarget=f.elem,g=0;while((e=f.handlers[g++])&&!a.isImmediatePropagationStopped())(!a.namespace_re||a.namespace_re.test(e.namespace))&&(a.handleObj=e,a.data=e.data,c=((n.event.special[e.origType]||{}).handle||e.handler).apply(f.elem,i),void 0!==c&&(a.result=c)===!1&&(a.preventDefault(),a.stopPropagation()))}return k.postDispatch&&k.postDispatch.call(this,a),a.result}},handlers:function(a,b){var c,d,e,f,g=[],h=b.delegateCount,i=a.target;if(h&&i.nodeType&&(!a.button||"click"!==a.type))for(;i!=this;i=i.parentNode||this)if(1===i.nodeType&&(i.disabled!==!0||"click"!==a.type)){for(e=[],f=0;h>f;f++)d=b[f],c=d.selector+" ",void 0===e[c]&&(e[c]=d.needsContext?n(c,this).index(i)>=0:n.find(c,this,null,[i]).length),e[c]&&e.push(d);e.length&&g.push({elem:i,handlers:e})}return h<b.length&&g.push({elem:this,handlers:b.slice(h)}),g},fix:function(a){if(a[n.expando])return a;var b,c,d,e=a.type,f=a,g=this.fixHooks[e];g||(this.fixHooks[e]=g=$.test(e)?this.mouseHooks:Z.test(e)?this.keyHooks:{}),d=g.props?this.props.concat(g.props):this.props,a=new n.Event(f),b=d.length;while(b--)c=d[b],a[c]=f[c];return a.target||(a.target=f.srcElement||z),3===a.target.nodeType&&(a.target=a.target.parentNode),a.metaKey=!!a.metaKey,g.filter?g.filter(a,f):a},props:"altKey bubbles cancelable ctrlKey currentTarget eventPhase metaKey relatedTarget shiftKey target timeStamp view which".split(" "),fixHooks:{},keyHooks:{props:"char charCode key keyCode".split(" "),filter:function(a,b){return null==a.which&&(a.which=null!=b.charCode?b.charCode:b.keyCode),a}},mouseHooks:{props:"button buttons clientX clientY fromElement offsetX offsetY pageX pageY screenX screenY toElement".split(" "),filter:function(a,b){var c,d,e,f=b.button,g=b.fromElement;return null==a.pageX&&null!=b.clientX&&(d=a.target.ownerDocument||z,e=d.documentElement,c=d.body,a.pageX=b.clientX+(e&&e.scrollLeft||c&&c.scrollLeft||0)-(e&&e.clientLeft||c&&c.clientLeft||0),a.pageY=b.clientY+(e&&e.scrollTop||c&&c.scrollTop||0)-(e&&e.clientTop||c&&c.clientTop||0)),!a.relatedTarget&&g&&(a.relatedTarget=g===a.target?b.toElement:g),a.which||void 0===f||(a.which=1&f?1:2&f?3:4&f?2:0),a}},special:{load:{noBubble:!0},focus:{trigger:function(){if(this!==db()&&this.focus)try{return this.focus(),!1}catch(a){}},delegateType:"focusin"},blur:{trigger:function(){return this===db()&&this.blur?(this.blur(),!1):void 0},delegateType:"focusout"},click:{trigger:function(){return n.nodeName(this,"input")&&"checkbox"===this.type&&this.click?(this.click(),!1):void 0},_default:function(a){return n.nodeName(a.target,"a")}},beforeunload:{postDispatch:function(a){void 0!==a.result&&(a.originalEvent.returnValue=a.result)}}},simulate:function(a,b,c,d){var e=n.extend(new n.Event,c,{type:a,isSimulated:!0,originalEvent:{}});d?n.event.trigger(e,null,b):n.event.dispatch.call(b,e),e.isDefaultPrevented()&&c.preventDefault()}},n.removeEvent=z.removeEventListener?function(a,b,c){a.removeEventListener&&a.removeEventListener(b,c,!1)}:function(a,b,c){var d="on"+b;a.detachEvent&&(typeof a[d]===L&&(a[d]=null),a.detachEvent(d,c))},n.Event=function(a,b){return this instanceof n.Event?(a&&a.type?(this.originalEvent=a,this.type=a.type,this.isDefaultPrevented=a.defaultPrevented||void 0===a.defaultPrevented&&(a.returnValue===!1||a.getPreventDefault&&a.getPreventDefault())?bb:cb):this.type=a,b&&n.extend(this,b),this.timeStamp=a&&a.timeStamp||n.now(),void(this[n.expando]=!0)):new n.Event(a,b)},n.Event.prototype={isDefaultPrevented:cb,isPropagationStopped:cb,isImmediatePropagationStopped:cb,preventDefault:function(){var a=this.originalEvent;this.isDefaultPrevented=bb,a&&(a.preventDefault?a.preventDefault():a.returnValue=!1)},stopPropagation:function(){var a=this.originalEvent;this.isPropagationStopped=bb,a&&(a.stopPropagation&&a.stopPropagation(),a.cancelBubble=!0)},stopImmediatePropagation:function(){this.isImmediatePropagationStopped=bb,this.stopPropagation()}},n.each({mouseenter:"mouseover",mouseleave:"mouseout"},function(a,b){n.event.special[a]={delegateType:b,bindType:b,handle:function(a){var c,d=this,e=a.relatedTarget,f=a.handleObj;return(!e||e!==d&&!n.contains(d,e))&&(a.type=f.origType,c=f.handler.apply(this,arguments),a.type=b),c}}}),l.submitBubbles||(n.event.special.submit={setup:function(){return n.nodeName(this,"form")?!1:void n.event.add(this,"click._submit keypress._submit",function(a){var b=a.target,c=n.nodeName(b,"input")||n.nodeName(b,"button")?b.form:void 0;c&&!n._data(c,"submitBubbles")&&(n.event.add(c,"submit._submit",function(a){a._submit_bubble=!0}),n._data(c,"submitBubbles",!0))})},postDispatch:function(a){a._submit_bubble&&(delete a._submit_bubble,this.parentNode&&!a.isTrigger&&n.event.simulate("submit",this.parentNode,a,!0))},teardown:function(){return n.nodeName(this,"form")?!1:void n.event.remove(this,"._submit")}}),l.changeBubbles||(n.event.special.change={setup:function(){return Y.test(this.nodeName)?(("checkbox"===this.type||"radio"===this.type)&&(n.event.add(this,"propertychange._change",function(a){"checked"===a.originalEvent.propertyName&&(this._just_changed=!0)}),n.event.add(this,"click._change",function(a){this._just_changed&&!a.isTrigger&&(this._just_changed=!1),n.event.simulate("change",this,a,!0)})),!1):void n.event.add(this,"beforeactivate._change",function(a){var b=a.target;Y.test(b.nodeName)&&!n._data(b,"changeBubbles")&&(n.event.add(b,"change._change",function(a){!this.parentNode||a.isSimulated||a.isTrigger||n.event.simulate("change",this.parentNode,a,!0)}),n._data(b,"changeBubbles",!0))})},handle:function(a){var b=a.target;return this!==b||a.isSimulated||a.isTrigger||"radio"!==b.type&&"checkbox"!==b.type?a.handleObj.handler.apply(this,arguments):void 0},teardown:function(){return n.event.remove(this,"._change"),!Y.test(this.nodeName)}}),l.focusinBubbles||n.each({focus:"focusin",blur:"focusout"},function(a,b){var c=function(a){n.event.simulate(b,a.target,n.event.fix(a),!0)};n.event.special[b]={setup:function(){var d=this.ownerDocument||this,e=n._data(d,b);e||d.addEventListener(a,c,!0),n._data(d,b,(e||0)+1)},teardown:function(){var d=this.ownerDocument||this,e=n._data(d,b)-1;e?n._data(d,b,e):(d.removeEventListener(a,c,!0),n._removeData(d,b))}}}),n.fn.extend({on:function(a,b,c,d,e){var f,g;if("object"==typeof a){"string"!=typeof b&&(c=c||b,b=void 0);for(f in a)this.on(f,b,c,a[f],e);return this}if(null==c&&null==d?(d=b,c=b=void 0):null==d&&("string"==typeof b?(d=c,c=void 0):(d=c,c=b,b=void 0)),d===!1)d=cb;else if(!d)return this;return 1===e&&(g=d,d=function(a){return n().off(a),g.apply(this,arguments)},d.guid=g.guid||(g.guid=n.guid++)),this.each(function(){n.event.add(this,a,d,c,b)})},one:function(a,b,c,d){return this.on(a,b,c,d,1)},off:function(a,b,c){var d,e;if(a&&a.preventDefault&&a.handleObj)return d=a.handleObj,n(a.delegateTarget).off(d.namespace?d.origType+"."+d.namespace:d.origType,d.selector,d.handler),this;if("object"==typeof a){for(e in a)this.off(e,b,a[e]);return this}return(b===!1||"function"==typeof b)&&(c=b,b=void 0),c===!1&&(c=cb),this.each(function(){n.event.remove(this,a,c,b)})},trigger:function(a,b){return this.each(function(){n.event.trigger(a,b,this)})},triggerHandler:function(a,b){var c=this[0];return c?n.event.trigger(a,b,c,!0):void 0}});function eb(a){var b=fb.split("|"),c=a.createDocumentFragment();if(c.createElement)while(b.length)c.createElement(b.pop());return c}var fb="abbr|article|aside|audio|bdi|canvas|data|datalist|details|figcaption|figure|footer|header|hgroup|mark|meter|nav|output|progress|section|summary|time|video",gb=/ jQuery\d+="(?:null|\d+)"/g,hb=new RegExp("<(?:"+fb+")[\\s/>]","i"),ib=/^\s+/,jb=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/gi,kb=/<([\w:]+)/,lb=/<tbody/i,mb=/<|&#?\w+;/,nb=/<(?:script|style|link)/i,ob=/checked\s*(?:[^=]|=\s*.checked.)/i,pb=/^$|\/(?:java|ecma)script/i,qb=/^true\/(.*)/,rb=/^\s*<!(?:\[CDATA\[|--)|(?:\]\]|--)>\s*$/g,sb={option:[1,"<select multiple='multiple'>","</select>"],legend:[1,"<fieldset>","</fieldset>"],area:[1,"<map>","</map>"],param:[1,"<object>","</object>"],thead:[1,"<table>","</table>"],tr:[2,"<table><tbody>","</tbody></table>"],col:[2,"<table><tbody></tbody><colgroup>","</colgroup></table>"],td:[3,"<table><tbody><tr>","</tr></tbody></table>"],_default:l.htmlSerialize?[0,"",""]:[1,"X<div>","</div>"]},tb=eb(z),ub=tb.appendChild(z.createElement("div"));sb.optgroup=sb.option,sb.tbody=sb.tfoot=sb.colgroup=sb.caption=sb.thead,sb.th=sb.td;function vb(a,b){var c,d,e=0,f=typeof a.getElementsByTagName!==L?a.getElementsByTagName(b||"*"):typeof a.querySelectorAll!==L?a.querySelectorAll(b||"*"):void 0;if(!f)for(f=[],c=a.childNodes||a;null!=(d=c[e]);e++)!b||n.nodeName(d,b)?f.push(d):n.merge(f,vb(d,b));return void 0===b||b&&n.nodeName(a,b)?n.merge([a],f):f}function wb(a){X.test(a.type)&&(a.defaultChecked=a.checked)}function xb(a,b){return n.nodeName(a,"table")&&n.nodeName(11!==b.nodeType?b:b.firstChild,"tr")?a.getElementsByTagName("tbody")[0]||a.appendChild(a.ownerDocument.createElement("tbody")):a}function yb(a){return a.type=(null!==n.find.attr(a,"type"))+"/"+a.type,a}function zb(a){var b=qb.exec(a.type);return b?a.type=b[1]:a.removeAttribute("type"),a}function Ab(a,b){for(var c,d=0;null!=(c=a[d]);d++)n._data(c,"globalEval",!b||n._data(b[d],"globalEval"))}function Bb(a,b){if(1===b.nodeType&&n.hasData(a)){var c,d,e,f=n._data(a),g=n._data(b,f),h=f.events;if(h){delete g.handle,g.events={};for(c in h)for(d=0,e=h[c].length;e>d;d++)n.event.add(b,c,h[c][d])}g.data&&(g.data=n.extend({},g.data))}}function Cb(a,b){var c,d,e;if(1===b.nodeType){if(c=b.nodeName.toLowerCase(),!l.noCloneEvent&&b[n.expando]){e=n._data(b);for(d in e.events)n.removeEvent(b,d,e.handle);b.removeAttribute(n.expando)}"script"===c&&b.text!==a.text?(yb(b).text=a.text,zb(b)):"object"===c?(b.parentNode&&(b.outerHTML=a.outerHTML),l.html5Clone&&a.innerHTML&&!n.trim(b.innerHTML)&&(b.innerHTML=a.innerHTML)):"input"===c&&X.test(a.type)?(b.defaultChecked=b.checked=a.checked,b.value!==a.value&&(b.value=a.value)):"option"===c?b.defaultSelected=b.selected=a.defaultSelected:("input"===c||"textarea"===c)&&(b.defaultValue=a.defaultValue)}}n.extend({clone:function(a,b,c){var d,e,f,g,h,i=n.contains(a.ownerDocument,a);if(l.html5Clone||n.isXMLDoc(a)||!hb.test("<"+a.nodeName+">")?f=a.cloneNode(!0):(ub.innerHTML=a.outerHTML,ub.removeChild(f=ub.firstChild)),!(l.noCloneEvent&&l.noCloneChecked||1!==a.nodeType&&11!==a.nodeType||n.isXMLDoc(a)))for(d=vb(f),h=vb(a),g=0;null!=(e=h[g]);++g)d[g]&&Cb(e,d[g]);if(b)if(c)for(h=h||vb(a),d=d||vb(f),g=0;null!=(e=h[g]);g++)Bb(e,d[g]);else Bb(a,f);return d=vb(f,"script"),d.length>0&&Ab(d,!i&&vb(a,"script")),d=h=e=null,f},buildFragment:function(a,b,c,d){for(var e,f,g,h,i,j,k,m=a.length,o=eb(b),p=[],q=0;m>q;q++)if(f=a[q],f||0===f)if("object"===n.type(f))n.merge(p,f.nodeType?[f]:f);else if(mb.test(f)){h=h||o.appendChild(b.createElement("div")),i=(kb.exec(f)||["",""])[1].toLowerCase(),k=sb[i]||sb._default,h.innerHTML=k[1]+f.replace(jb,"<$1></$2>")+k[2],e=k[0];while(e--)h=h.lastChild;if(!l.leadingWhitespace&&ib.test(f)&&p.push(b.createTextNode(ib.exec(f)[0])),!l.tbody){f="table"!==i||lb.test(f)?"<table>"!==k[1]||lb.test(f)?0:h:h.firstChild,e=f&&f.childNodes.length;while(e--)n.nodeName(j=f.childNodes[e],"tbody")&&!j.childNodes.length&&f.removeChild(j)}n.merge(p,h.childNodes),h.textContent="";while(h.firstChild)h.removeChild(h.firstChild);h=o.lastChild}else p.push(b.createTextNode(f));h&&o.removeChild(h),l.appendChecked||n.grep(vb(p,"input"),wb),q=0;while(f=p[q++])if((!d||-1===n.inArray(f,d))&&(g=n.contains(f.ownerDocument,f),h=vb(o.appendChild(f),"script"),g&&Ab(h),c)){e=0;while(f=h[e++])pb.test(f.type||"")&&c.push(f)}return h=null,o},cleanData:function(a,b){for(var d,e,f,g,h=0,i=n.expando,j=n.cache,k=l.deleteExpando,m=n.event.special;null!=(d=a[h]);h++)if((b||n.acceptData(d))&&(f=d[i],g=f&&j[f])){if(g.events)for(e in g.events)m[e]?n.event.remove(d,e):n.removeEvent(d,e,g.handle);j[f]&&(delete j[f],k?delete d[i]:typeof d.removeAttribute!==L?d.removeAttribute(i):d[i]=null,c.push(f))}}}),n.fn.extend({text:function(a){return W(this,function(a){return void 0===a?n.text(this):this.empty().append((this[0]&&this[0].ownerDocument||z).createTextNode(a))},null,a,arguments.length)},append:function(){return this.domManip(arguments,function(a){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var b=xb(this,a);b.appendChild(a)}})},prepend:function(){return this.domManip(arguments,function(a){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var b=xb(this,a);b.insertBefore(a,b.firstChild)}})},before:function(){return this.domManip(arguments,function(a){this.parentNode&&this.parentNode.insertBefore(a,this)})},after:function(){return this.domManip(arguments,function(a){this.parentNode&&this.parentNode.insertBefore(a,this.nextSibling)})},remove:function(a,b){for(var c,d=a?n.filter(a,this):this,e=0;null!=(c=d[e]);e++)b||1!==c.nodeType||n.cleanData(vb(c)),c.parentNode&&(b&&n.contains(c.ownerDocument,c)&&Ab(vb(c,"script")),c.parentNode.removeChild(c));return this},empty:function(){for(var a,b=0;null!=(a=this[b]);b++){1===a.nodeType&&n.cleanData(vb(a,!1));while(a.firstChild)a.removeChild(a.firstChild);a.options&&n.nodeName(a,"select")&&(a.options.length=0)}return this},clone:function(a,b){return a=null==a?!1:a,b=null==b?a:b,this.map(function(){return n.clone(this,a,b)})},html:function(a){return W(this,function(a){var b=this[0]||{},c=0,d=this.length;if(void 0===a)return 1===b.nodeType?b.innerHTML.replace(gb,""):void 0;if(!("string"!=typeof a||nb.test(a)||!l.htmlSerialize&&hb.test(a)||!l.leadingWhitespace&&ib.test(a)||sb[(kb.exec(a)||["",""])[1].toLowerCase()])){a=a.replace(jb,"<$1></$2>");try{for(;d>c;c++)b=this[c]||{},1===b.nodeType&&(n.cleanData(vb(b,!1)),b.innerHTML=a);b=0}catch(e){}}b&&this.empty().append(a)},null,a,arguments.length)},replaceWith:function(){var a=arguments[0];return this.domManip(arguments,function(b){a=this.parentNode,n.cleanData(vb(this)),a&&a.replaceChild(b,this)}),a&&(a.length||a.nodeType)?this:this.remove()},detach:function(a){return this.remove(a,!0)},domManip:function(a,b){a=e.apply([],a);var c,d,f,g,h,i,j=0,k=this.length,m=this,o=k-1,p=a[0],q=n.isFunction(p);if(q||k>1&&"string"==typeof p&&!l.checkClone&&ob.test(p))return this.each(function(c){var d=m.eq(c);q&&(a[0]=p.call(this,c,d.html())),d.domManip(a,b)});if(k&&(i=n.buildFragment(a,this[0].ownerDocument,!1,this),c=i.firstChild,1===i.childNodes.length&&(i=c),c)){for(g=n.map(vb(i,"script"),yb),f=g.length;k>j;j++)d=i,j!==o&&(d=n.clone(d,!0,!0),f&&n.merge(g,vb(d,"script"))),b.call(this[j],d,j);if(f)for(h=g[g.length-1].ownerDocument,n.map(g,zb),j=0;f>j;j++)d=g[j],pb.test(d.type||"")&&!n._data(d,"globalEval")&&n.contains(h,d)&&(d.src?n._evalUrl&&n._evalUrl(d.src):n.globalEval((d.text||d.textContent||d.innerHTML||"").replace(rb,"")));i=c=null}return this}}),n.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(a,b){n.fn[a]=function(a){for(var c,d=0,e=[],g=n(a),h=g.length-1;h>=d;d++)c=d===h?this:this.clone(!0),n(g[d])[b](c),f.apply(e,c.get());return this.pushStack(e)}});var Db,Eb={};function Fb(b,c){var d=n(c.createElement(b)).appendTo(c.body),e=a.getDefaultComputedStyle?a.getDefaultComputedStyle(d[0]).display:n.css(d[0],"display");return d.detach(),e}function Gb(a){var b=z,c=Eb[a];return c||(c=Fb(a,b),"none"!==c&&c||(Db=(Db||n("<iframe frameborder='0' width='0' height='0'/>")).appendTo(b.documentElement),b=(Db[0].contentWindow||Db[0].contentDocument).document,b.write(),b.close(),c=Fb(a,b),Db.detach()),Eb[a]=c),c}!function(){var a,b,c=z.createElement("div"),d="-webkit-box-sizing:content-box;-moz-box-sizing:content-box;box-sizing:content-box;display:block;padding:0;margin:0;border:0";c.innerHTML=" <link/><table></table><a href='/a'>a</a><input type='checkbox'/>",a=c.getElementsByTagName("a")[0],a.style.cssText="float:left;opacity:.5",l.opacity=/^0.5/.test(a.style.opacity),l.cssFloat=!!a.style.cssFloat,c.style.backgroundClip="content-box",c.cloneNode(!0).style.backgroundClip="",l.clearCloneStyle="content-box"===c.style.backgroundClip,a=c=null,l.shrinkWrapBlocks=function(){var a,c,e,f;if(null==b){if(a=z.getElementsByTagName("body")[0],!a)return;f="border:0;width:0;height:0;position:absolute;top:0;left:-9999px",c=z.createElement("div"),e=z.createElement("div"),a.appendChild(c).appendChild(e),b=!1,typeof e.style.zoom!==L&&(e.style.cssText=d+";width:1px;padding:1px;zoom:1",e.innerHTML="<div></div>",e.firstChild.style.width="5px",b=3!==e.offsetWidth),a.removeChild(c),a=c=e=null}return b}}();var Hb=/^margin/,Ib=new RegExp("^("+T+")(?!px)[a-z%]+$","i"),Jb,Kb,Lb=/^(top|right|bottom|left)$/;a.getComputedStyle?(Jb=function(a){return a.ownerDocument.defaultView.getComputedStyle(a,null)},Kb=function(a,b,c){var d,e,f,g,h=a.style;return c=c||Jb(a),g=c?c.getPropertyValue(b)||c[b]:void 0,c&&(""!==g||n.contains(a.ownerDocument,a)||(g=n.style(a,b)),Ib.test(g)&&Hb.test(b)&&(d=h.width,e=h.minWidth,f=h.maxWidth,h.minWidth=h.maxWidth=h.width=g,g=c.width,h.width=d,h.minWidth=e,h.maxWidth=f)),void 0===g?g:g+""}):z.documentElement.currentStyle&&(Jb=function(a){return a.currentStyle},Kb=function(a,b,c){var d,e,f,g,h=a.style;return c=c||Jb(a),g=c?c[b]:void 0,null==g&&h&&h[b]&&(g=h[b]),Ib.test(g)&&!Lb.test(b)&&(d=h.left,e=a.runtimeStyle,f=e&&e.left,f&&(e.left=a.currentStyle.left),h.left="fontSize"===b?"1em":g,g=h.pixelLeft+"px",h.left=d,f&&(e.left=f)),void 0===g?g:g+""||"auto"});function Mb(a,b){return{get:function(){var c=a();if(null!=c)return c?void delete this.get:(this.get=b).apply(this,arguments)}}}!function(){var b,c,d,e,f,g,h=z.createElement("div"),i="border:0;width:0;height:0;position:absolute;top:0;left:-9999px",j="-webkit-box-sizing:content-box;-moz-box-sizing:content-box;box-sizing:content-box;display:block;padding:0;margin:0;border:0";h.innerHTML=" <link/><table></table><a href='/a'>a</a><input type='checkbox'/>",b=h.getElementsByTagName("a")[0],b.style.cssText="float:left;opacity:.5",l.opacity=/^0.5/.test(b.style.opacity),l.cssFloat=!!b.style.cssFloat,h.style.backgroundClip="content-box",h.cloneNode(!0).style.backgroundClip="",l.clearCloneStyle="content-box"===h.style.backgroundClip,b=h=null,n.extend(l,{reliableHiddenOffsets:function(){if(null!=c)return c;var a,b,d,e=z.createElement("div"),f=z.getElementsByTagName("body")[0];if(f)return e.setAttribute("className","t"),e.innerHTML=" <link/><table></table><a href='/a'>a</a><input type='checkbox'/>",a=z.createElement("div"),a.style.cssText=i,f.appendChild(a).appendChild(e),e.innerHTML="<table><tr><td></td><td>t</td></tr></table>",b=e.getElementsByTagName("td"),b[0].style.cssText="padding:0;margin:0;border:0;display:none",d=0===b[0].offsetHeight,b[0].style.display="",b[1].style.display="none",c=d&&0===b[0].offsetHeight,f.removeChild(a),e=f=null,c},boxSizing:function(){return null==d&&k(),d},boxSizingReliable:function(){return null==e&&k(),e},pixelPosition:function(){return null==f&&k(),f},reliableMarginRight:function(){var b,c,d,e;if(null==g&&a.getComputedStyle){if(b=z.getElementsByTagName("body")[0],!b)return;c=z.createElement("div"),d=z.createElement("div"),c.style.cssText=i,b.appendChild(c).appendChild(d),e=d.appendChild(z.createElement("div")),e.style.cssText=d.style.cssText=j,e.style.marginRight=e.style.width="0",d.style.width="1px",g=!parseFloat((a.getComputedStyle(e,null)||{}).marginRight),b.removeChild(c)}return g}});function k(){var b,c,h=z.getElementsByTagName("body")[0];h&&(b=z.createElement("div"),c=z.createElement("div"),b.style.cssText=i,h.appendChild(b).appendChild(c),c.style.cssText="-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;position:absolute;display:block;padding:1px;border:1px;width:4px;margin-top:1%;top:1%",n.swap(h,null!=h.style.zoom?{zoom:1}:{},function(){d=4===c.offsetWidth}),e=!0,f=!1,g=!0,a.getComputedStyle&&(f="1%"!==(a.getComputedStyle(c,null)||{}).top,e="4px"===(a.getComputedStyle(c,null)||{width:"4px"}).width),h.removeChild(b),c=h=null)}}(),n.swap=function(a,b,c,d){var e,f,g={};for(f in b)g[f]=a.style[f],a.style[f]=b[f];e=c.apply(a,d||[]);for(f in b)a.style[f]=g[f];return e};var Nb=/alpha\([^)]*\)/i,Ob=/opacity\s*=\s*([^)]*)/,Pb=/^(none|table(?!-c[ea]).+)/,Qb=new RegExp("^("+T+")(.*)$","i"),Rb=new RegExp("^([+-])=("+T+")","i"),Sb={position:"absolute",visibility:"hidden",display:"block"},Tb={letterSpacing:0,fontWeight:400},Ub=["Webkit","O","Moz","ms"];function Vb(a,b){if(b in a)return b;var c=b.charAt(0).toUpperCase()+b.slice(1),d=b,e=Ub.length;while(e--)if(b=Ub[e]+c,b in a)return b;return d}function Wb(a,b){for(var c,d,e,f=[],g=0,h=a.length;h>g;g++)d=a[g],d.style&&(f[g]=n._data(d,"olddisplay"),c=d.style.display,b?(f[g]||"none"!==c||(d.style.display=""),""===d.style.display&&V(d)&&(f[g]=n._data(d,"olddisplay",Gb(d.nodeName)))):f[g]||(e=V(d),(c&&"none"!==c||!e)&&n._data(d,"olddisplay",e?c:n.css(d,"display"))));for(g=0;h>g;g++)d=a[g],d.style&&(b&&"none"!==d.style.display&&""!==d.style.display||(d.style.display=b?f[g]||"":"none"));return a}function Xb(a,b,c){var d=Qb.exec(b);return d?Math.max(0,d[1]-(c||0))+(d[2]||"px"):b}function Yb(a,b,c,d,e){for(var f=c===(d?"border":"content")?4:"width"===b?1:0,g=0;4>f;f+=2)"margin"===c&&(g+=n.css(a,c+U[f],!0,e)),d?("content"===c&&(g-=n.css(a,"padding"+U[f],!0,e)),"margin"!==c&&(g-=n.css(a,"border"+U[f]+"Width",!0,e))):(g+=n.css(a,"padding"+U[f],!0,e),"padding"!==c&&(g+=n.css(a,"border"+U[f]+"Width",!0,e)));return g}function Zb(a,b,c){var d=!0,e="width"===b?a.offsetWidth:a.offsetHeight,f=Jb(a),g=l.boxSizing()&&"border-box"===n.css(a,"boxSizing",!1,f);if(0>=e||null==e){if(e=Kb(a,b,f),(0>e||null==e)&&(e=a.style[b]),Ib.test(e))return e;d=g&&(l.boxSizingReliable()||e===a.style[b]),e=parseFloat(e)||0}return e+Yb(a,b,c||(g?"border":"content"),d,f)+"px"}n.extend({cssHooks:{opacity:{get:function(a,b){if(b){var c=Kb(a,"opacity");return""===c?"1":c}}}},cssNumber:{columnCount:!0,fillOpacity:!0,fontWeight:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,widows:!0,zIndex:!0,zoom:!0},cssProps:{"float":l.cssFloat?"cssFloat":"styleFloat"},style:function(a,b,c,d){if(a&&3!==a.nodeType&&8!==a.nodeType&&a.style){var e,f,g,h=n.camelCase(b),i=a.style;if(b=n.cssProps[h]||(n.cssProps[h]=Vb(i,h)),g=n.cssHooks[b]||n.cssHooks[h],void 0===c)return g&&"get"in g&&void 0!==(e=g.get(a,!1,d))?e:i[b];if(f=typeof c,"string"===f&&(e=Rb.exec(c))&&(c=(e[1]+1)*e[2]+parseFloat(n.css(a,b)),f="number"),null!=c&&c===c&&("number"!==f||n.cssNumber[h]||(c+="px"),l.clearCloneStyle||""!==c||0!==b.indexOf("background")||(i[b]="inherit"),!(g&&"set"in g&&void 0===(c=g.set(a,c,d)))))try{i[b]="",i[b]=c}catch(j){}}},css:function(a,b,c,d){var e,f,g,h=n.camelCase(b);return b=n.cssProps[h]||(n.cssProps[h]=Vb(a.style,h)),g=n.cssHooks[b]||n.cssHooks[h],g&&"get"in g&&(f=g.get(a,!0,c)),void 0===f&&(f=Kb(a,b,d)),"normal"===f&&b in Tb&&(f=Tb[b]),""===c||c?(e=parseFloat(f),c===!0||n.isNumeric(e)?e||0:f):f}}),n.each(["height","width"],function(a,b){n.cssHooks[b]={get:function(a,c,d){return c?0===a.offsetWidth&&Pb.test(n.css(a,"display"))?n.swap(a,Sb,function(){return Zb(a,b,d)}):Zb(a,b,d):void 0},set:function(a,c,d){var e=d&&Jb(a);return Xb(a,c,d?Yb(a,b,d,l.boxSizing()&&"border-box"===n.css(a,"boxSizing",!1,e),e):0)}}}),l.opacity||(n.cssHooks.opacity={get:function(a,b){return Ob.test((b&&a.currentStyle?a.currentStyle.filter:a.style.filter)||"")?.01*parseFloat(RegExp.$1)+"":b?"1":""},set:function(a,b){var c=a.style,d=a.currentStyle,e=n.isNumeric(b)?"alpha(opacity="+100*b+")":"",f=d&&d.filter||c.filter||"";c.zoom=1,(b>=1||""===b)&&""===n.trim(f.replace(Nb,""))&&c.removeAttribute&&(c.removeAttribute("filter"),""===b||d&&!d.filter)||(c.filter=Nb.test(f)?f.replace(Nb,e):f+" "+e)}}),n.cssHooks.marginRight=Mb(l.reliableMarginRight,function(a,b){return b?n.swap(a,{display:"inline-block"},Kb,[a,"marginRight"]):void 0}),n.each({margin:"",padding:"",border:"Width"},function(a,b){n.cssHooks[a+b]={expand:function(c){for(var d=0,e={},f="string"==typeof c?c.split(" "):[c];4>d;d++)e[a+U[d]+b]=f[d]||f[d-2]||f[0];return e}},Hb.test(a)||(n.cssHooks[a+b].set=Xb)}),n.fn.extend({css:function(a,b){return W(this,function(a,b,c){var d,e,f={},g=0;if(n.isArray(b)){for(d=Jb(a),e=b.length;e>g;g++)f[b[g]]=n.css(a,b[g],!1,d);return f}return void 0!==c?n.style(a,b,c):n.css(a,b) },a,b,arguments.length>1)},show:function(){return Wb(this,!0)},hide:function(){return Wb(this)},toggle:function(a){return"boolean"==typeof a?a?this.show():this.hide():this.each(function(){V(this)?n(this).show():n(this).hide()})}});function $b(a,b,c,d,e){return new $b.prototype.init(a,b,c,d,e)}n.Tween=$b,$b.prototype={constructor:$b,init:function(a,b,c,d,e,f){this.elem=a,this.prop=c,this.easing=e||"swing",this.options=b,this.start=this.now=this.cur(),this.end=d,this.unit=f||(n.cssNumber[c]?"":"px")},cur:function(){var a=$b.propHooks[this.prop];return a&&a.get?a.get(this):$b.propHooks._default.get(this)},run:function(a){var b,c=$b.propHooks[this.prop];return this.pos=b=this.options.duration?n.easing[this.easing](a,this.options.duration*a,0,1,this.options.duration):a,this.now=(this.end-this.start)*b+this.start,this.options.step&&this.options.step.call(this.elem,this.now,this),c&&c.set?c.set(this):$b.propHooks._default.set(this),this}},$b.prototype.init.prototype=$b.prototype,$b.propHooks={_default:{get:function(a){var b;return null==a.elem[a.prop]||a.elem.style&&null!=a.elem.style[a.prop]?(b=n.css(a.elem,a.prop,""),b&&"auto"!==b?b:0):a.elem[a.prop]},set:function(a){n.fx.step[a.prop]?n.fx.step[a.prop](a):a.elem.style&&(null!=a.elem.style[n.cssProps[a.prop]]||n.cssHooks[a.prop])?n.style(a.elem,a.prop,a.now+a.unit):a.elem[a.prop]=a.now}}},$b.propHooks.scrollTop=$b.propHooks.scrollLeft={set:function(a){a.elem.nodeType&&a.elem.parentNode&&(a.elem[a.prop]=a.now)}},n.easing={linear:function(a){return a},swing:function(a){return.5-Math.cos(a*Math.PI)/2}},n.fx=$b.prototype.init,n.fx.step={};var _b,ac,bc=/^(?:toggle|show|hide)$/,cc=new RegExp("^(?:([+-])=|)("+T+")([a-z%]*)$","i"),dc=/queueHooks$/,ec=[jc],fc={"*":[function(a,b){var c=this.createTween(a,b),d=c.cur(),e=cc.exec(b),f=e&&e[3]||(n.cssNumber[a]?"":"px"),g=(n.cssNumber[a]||"px"!==f&&+d)&&cc.exec(n.css(c.elem,a)),h=1,i=20;if(g&&g[3]!==f){f=f||g[3],e=e||[],g=+d||1;do h=h||".5",g/=h,n.style(c.elem,a,g+f);while(h!==(h=c.cur()/d)&&1!==h&&--i)}return e&&(g=c.start=+g||+d||0,c.unit=f,c.end=e[1]?g+(e[1]+1)*e[2]:+e[2]),c}]};function gc(){return setTimeout(function(){_b=void 0}),_b=n.now()}function hc(a,b){var c,d={height:a},e=0;for(b=b?1:0;4>e;e+=2-b)c=U[e],d["margin"+c]=d["padding"+c]=a;return b&&(d.opacity=d.width=a),d}function ic(a,b,c){for(var d,e=(fc[b]||[]).concat(fc["*"]),f=0,g=e.length;g>f;f++)if(d=e[f].call(c,b,a))return d}function jc(a,b,c){var d,e,f,g,h,i,j,k,m=this,o={},p=a.style,q=a.nodeType&&V(a),r=n._data(a,"fxshow");c.queue||(h=n._queueHooks(a,"fx"),null==h.unqueued&&(h.unqueued=0,i=h.empty.fire,h.empty.fire=function(){h.unqueued||i()}),h.unqueued++,m.always(function(){m.always(function(){h.unqueued--,n.queue(a,"fx").length||h.empty.fire()})})),1===a.nodeType&&("height"in b||"width"in b)&&(c.overflow=[p.overflow,p.overflowX,p.overflowY],j=n.css(a,"display"),k=Gb(a.nodeName),"none"===j&&(j=k),"inline"===j&&"none"===n.css(a,"float")&&(l.inlineBlockNeedsLayout&&"inline"!==k?p.zoom=1:p.display="inline-block")),c.overflow&&(p.overflow="hidden",l.shrinkWrapBlocks()||m.always(function(){p.overflow=c.overflow[0],p.overflowX=c.overflow[1],p.overflowY=c.overflow[2]}));for(d in b)if(e=b[d],bc.exec(e)){if(delete b[d],f=f||"toggle"===e,e===(q?"hide":"show")){if("show"!==e||!r||void 0===r[d])continue;q=!0}o[d]=r&&r[d]||n.style(a,d)}if(!n.isEmptyObject(o)){r?"hidden"in r&&(q=r.hidden):r=n._data(a,"fxshow",{}),f&&(r.hidden=!q),q?n(a).show():m.done(function(){n(a).hide()}),m.done(function(){var b;n._removeData(a,"fxshow");for(b in o)n.style(a,b,o[b])});for(d in o)g=ic(q?r[d]:0,d,m),d in r||(r[d]=g.start,q&&(g.end=g.start,g.start="width"===d||"height"===d?1:0))}}function kc(a,b){var c,d,e,f,g;for(c in a)if(d=n.camelCase(c),e=b[d],f=a[c],n.isArray(f)&&(e=f[1],f=a[c]=f[0]),c!==d&&(a[d]=f,delete a[c]),g=n.cssHooks[d],g&&"expand"in g){f=g.expand(f),delete a[d];for(c in f)c in a||(a[c]=f[c],b[c]=e)}else b[d]=e}function lc(a,b,c){var d,e,f=0,g=ec.length,h=n.Deferred().always(function(){delete i.elem}),i=function(){if(e)return!1;for(var b=_b||gc(),c=Math.max(0,j.startTime+j.duration-b),d=c/j.duration||0,f=1-d,g=0,i=j.tweens.length;i>g;g++)j.tweens[g].run(f);return h.notifyWith(a,[j,f,c]),1>f&&i?c:(h.resolveWith(a,[j]),!1)},j=h.promise({elem:a,props:n.extend({},b),opts:n.extend(!0,{specialEasing:{}},c),originalProperties:b,originalOptions:c,startTime:_b||gc(),duration:c.duration,tweens:[],createTween:function(b,c){var d=n.Tween(a,j.opts,b,c,j.opts.specialEasing[b]||j.opts.easing);return j.tweens.push(d),d},stop:function(b){var c=0,d=b?j.tweens.length:0;if(e)return this;for(e=!0;d>c;c++)j.tweens[c].run(1);return b?h.resolveWith(a,[j,b]):h.rejectWith(a,[j,b]),this}}),k=j.props;for(kc(k,j.opts.specialEasing);g>f;f++)if(d=ec[f].call(j,a,k,j.opts))return d;return n.map(k,ic,j),n.isFunction(j.opts.start)&&j.opts.start.call(a,j),n.fx.timer(n.extend(i,{elem:a,anim:j,queue:j.opts.queue})),j.progress(j.opts.progress).done(j.opts.done,j.opts.complete).fail(j.opts.fail).always(j.opts.always)}n.Animation=n.extend(lc,{tweener:function(a,b){n.isFunction(a)?(b=a,a=["*"]):a=a.split(" ");for(var c,d=0,e=a.length;e>d;d++)c=a[d],fc[c]=fc[c]||[],fc[c].unshift(b)},prefilter:function(a,b){b?ec.unshift(a):ec.push(a)}}),n.speed=function(a,b,c){var d=a&&"object"==typeof a?n.extend({},a):{complete:c||!c&&b||n.isFunction(a)&&a,duration:a,easing:c&&b||b&&!n.isFunction(b)&&b};return d.duration=n.fx.off?0:"number"==typeof d.duration?d.duration:d.duration in n.fx.speeds?n.fx.speeds[d.duration]:n.fx.speeds._default,(null==d.queue||d.queue===!0)&&(d.queue="fx"),d.old=d.complete,d.complete=function(){n.isFunction(d.old)&&d.old.call(this),d.queue&&n.dequeue(this,d.queue)},d},n.fn.extend({fadeTo:function(a,b,c,d){return this.filter(V).css("opacity",0).show().end().animate({opacity:b},a,c,d)},animate:function(a,b,c,d){var e=n.isEmptyObject(a),f=n.speed(b,c,d),g=function(){var b=lc(this,n.extend({},a),f);(e||n._data(this,"finish"))&&b.stop(!0)};return g.finish=g,e||f.queue===!1?this.each(g):this.queue(f.queue,g)},stop:function(a,b,c){var d=function(a){var b=a.stop;delete a.stop,b(c)};return"string"!=typeof a&&(c=b,b=a,a=void 0),b&&a!==!1&&this.queue(a||"fx",[]),this.each(function(){var b=!0,e=null!=a&&a+"queueHooks",f=n.timers,g=n._data(this);if(e)g[e]&&g[e].stop&&d(g[e]);else for(e in g)g[e]&&g[e].stop&&dc.test(e)&&d(g[e]);for(e=f.length;e--;)f[e].elem!==this||null!=a&&f[e].queue!==a||(f[e].anim.stop(c),b=!1,f.splice(e,1));(b||!c)&&n.dequeue(this,a)})},finish:function(a){return a!==!1&&(a=a||"fx"),this.each(function(){var b,c=n._data(this),d=c[a+"queue"],e=c[a+"queueHooks"],f=n.timers,g=d?d.length:0;for(c.finish=!0,n.queue(this,a,[]),e&&e.stop&&e.stop.call(this,!0),b=f.length;b--;)f[b].elem===this&&f[b].queue===a&&(f[b].anim.stop(!0),f.splice(b,1));for(b=0;g>b;b++)d[b]&&d[b].finish&&d[b].finish.call(this);delete c.finish})}}),n.each(["toggle","show","hide"],function(a,b){var c=n.fn[b];n.fn[b]=function(a,d,e){return null==a||"boolean"==typeof a?c.apply(this,arguments):this.animate(hc(b,!0),a,d,e)}}),n.each({slideDown:hc("show"),slideUp:hc("hide"),slideToggle:hc("toggle"),fadeIn:{opacity:"show"},fadeOut:{opacity:"hide"},fadeToggle:{opacity:"toggle"}},function(a,b){n.fn[a]=function(a,c,d){return this.animate(b,a,c,d)}}),n.timers=[],n.fx.tick=function(){var a,b=n.timers,c=0;for(_b=n.now();c<b.length;c++)a=b[c],a()||b[c]!==a||b.splice(c--,1);b.length||n.fx.stop(),_b=void 0},n.fx.timer=function(a){n.timers.push(a),a()?n.fx.start():n.timers.pop()},n.fx.interval=13,n.fx.start=function(){ac||(ac=setInterval(n.fx.tick,n.fx.interval))},n.fx.stop=function(){clearInterval(ac),ac=null},n.fx.speeds={slow:600,fast:200,_default:400},n.fn.delay=function(a,b){return a=n.fx?n.fx.speeds[a]||a:a,b=b||"fx",this.queue(b,function(b,c){var d=setTimeout(b,a);c.stop=function(){clearTimeout(d)}})},function(){var a,b,c,d,e=z.createElement("div");e.setAttribute("className","t"),e.innerHTML=" <link/><table></table><a href='/a'>a</a><input type='checkbox'/>",a=e.getElementsByTagName("a")[0],c=z.createElement("select"),d=c.appendChild(z.createElement("option")),b=e.getElementsByTagName("input")[0],a.style.cssText="top:1px",l.getSetAttribute="t"!==e.className,l.style=/top/.test(a.getAttribute("style")),l.hrefNormalized="/a"===a.getAttribute("href"),l.checkOn=!!b.value,l.optSelected=d.selected,l.enctype=!!z.createElement("form").enctype,c.disabled=!0,l.optDisabled=!d.disabled,b=z.createElement("input"),b.setAttribute("value",""),l.input=""===b.getAttribute("value"),b.value="t",b.setAttribute("type","radio"),l.radioValue="t"===b.value,a=b=c=d=e=null}();var mc=/\r/g;n.fn.extend({val:function(a){var b,c,d,e=this[0];{if(arguments.length)return d=n.isFunction(a),this.each(function(c){var e;1===this.nodeType&&(e=d?a.call(this,c,n(this).val()):a,null==e?e="":"number"==typeof e?e+="":n.isArray(e)&&(e=n.map(e,function(a){return null==a?"":a+""})),b=n.valHooks[this.type]||n.valHooks[this.nodeName.toLowerCase()],b&&"set"in b&&void 0!==b.set(this,e,"value")||(this.value=e))});if(e)return b=n.valHooks[e.type]||n.valHooks[e.nodeName.toLowerCase()],b&&"get"in b&&void 0!==(c=b.get(e,"value"))?c:(c=e.value,"string"==typeof c?c.replace(mc,""):null==c?"":c)}}}),n.extend({valHooks:{option:{get:function(a){var b=n.find.attr(a,"value");return null!=b?b:n.text(a)}},select:{get:function(a){for(var b,c,d=a.options,e=a.selectedIndex,f="select-one"===a.type||0>e,g=f?null:[],h=f?e+1:d.length,i=0>e?h:f?e:0;h>i;i++)if(c=d[i],!(!c.selected&&i!==e||(l.optDisabled?c.disabled:null!==c.getAttribute("disabled"))||c.parentNode.disabled&&n.nodeName(c.parentNode,"optgroup"))){if(b=n(c).val(),f)return b;g.push(b)}return g},set:function(a,b){var c,d,e=a.options,f=n.makeArray(b),g=e.length;while(g--)if(d=e[g],n.inArray(n.valHooks.option.get(d),f)>=0)try{d.selected=c=!0}catch(h){d.scrollHeight}else d.selected=!1;return c||(a.selectedIndex=-1),e}}}}),n.each(["radio","checkbox"],function(){n.valHooks[this]={set:function(a,b){return n.isArray(b)?a.checked=n.inArray(n(a).val(),b)>=0:void 0}},l.checkOn||(n.valHooks[this].get=function(a){return null===a.getAttribute("value")?"on":a.value})});var nc,oc,pc=n.expr.attrHandle,qc=/^(?:checked|selected)$/i,rc=l.getSetAttribute,sc=l.input;n.fn.extend({attr:function(a,b){return W(this,n.attr,a,b,arguments.length>1)},removeAttr:function(a){return this.each(function(){n.removeAttr(this,a)})}}),n.extend({attr:function(a,b,c){var d,e,f=a.nodeType;if(a&&3!==f&&8!==f&&2!==f)return typeof a.getAttribute===L?n.prop(a,b,c):(1===f&&n.isXMLDoc(a)||(b=b.toLowerCase(),d=n.attrHooks[b]||(n.expr.match.bool.test(b)?oc:nc)),void 0===c?d&&"get"in d&&null!==(e=d.get(a,b))?e:(e=n.find.attr(a,b),null==e?void 0:e):null!==c?d&&"set"in d&&void 0!==(e=d.set(a,c,b))?e:(a.setAttribute(b,c+""),c):void n.removeAttr(a,b))},removeAttr:function(a,b){var c,d,e=0,f=b&&b.match(F);if(f&&1===a.nodeType)while(c=f[e++])d=n.propFix[c]||c,n.expr.match.bool.test(c)?sc&&rc||!qc.test(c)?a[d]=!1:a[n.camelCase("default-"+c)]=a[d]=!1:n.attr(a,c,""),a.removeAttribute(rc?c:d)},attrHooks:{type:{set:function(a,b){if(!l.radioValue&&"radio"===b&&n.nodeName(a,"input")){var c=a.value;return a.setAttribute("type",b),c&&(a.value=c),b}}}}}),oc={set:function(a,b,c){return b===!1?n.removeAttr(a,c):sc&&rc||!qc.test(c)?a.setAttribute(!rc&&n.propFix[c]||c,c):a[n.camelCase("default-"+c)]=a[c]=!0,c}},n.each(n.expr.match.bool.source.match(/\w+/g),function(a,b){var c=pc[b]||n.find.attr;pc[b]=sc&&rc||!qc.test(b)?function(a,b,d){var e,f;return d||(f=pc[b],pc[b]=e,e=null!=c(a,b,d)?b.toLowerCase():null,pc[b]=f),e}:function(a,b,c){return c?void 0:a[n.camelCase("default-"+b)]?b.toLowerCase():null}}),sc&&rc||(n.attrHooks.value={set:function(a,b,c){return n.nodeName(a,"input")?void(a.defaultValue=b):nc&&nc.set(a,b,c)}}),rc||(nc={set:function(a,b,c){var d=a.getAttributeNode(c);return d||a.setAttributeNode(d=a.ownerDocument.createAttribute(c)),d.value=b+="","value"===c||b===a.getAttribute(c)?b:void 0}},pc.id=pc.name=pc.coords=function(a,b,c){var d;return c?void 0:(d=a.getAttributeNode(b))&&""!==d.value?d.value:null},n.valHooks.button={get:function(a,b){var c=a.getAttributeNode(b);return c&&c.specified?c.value:void 0},set:nc.set},n.attrHooks.contenteditable={set:function(a,b,c){nc.set(a,""===b?!1:b,c)}},n.each(["width","height"],function(a,b){n.attrHooks[b]={set:function(a,c){return""===c?(a.setAttribute(b,"auto"),c):void 0}}})),l.style||(n.attrHooks.style={get:function(a){return a.style.cssText||void 0},set:function(a,b){return a.style.cssText=b+""}});var tc=/^(?:input|select|textarea|button|object)$/i,uc=/^(?:a|area)$/i;n.fn.extend({prop:function(a,b){return W(this,n.prop,a,b,arguments.length>1)},removeProp:function(a){return a=n.propFix[a]||a,this.each(function(){try{this[a]=void 0,delete this[a]}catch(b){}})}}),n.extend({propFix:{"for":"htmlFor","class":"className"},prop:function(a,b,c){var d,e,f,g=a.nodeType;if(a&&3!==g&&8!==g&&2!==g)return f=1!==g||!n.isXMLDoc(a),f&&(b=n.propFix[b]||b,e=n.propHooks[b]),void 0!==c?e&&"set"in e&&void 0!==(d=e.set(a,c,b))?d:a[b]=c:e&&"get"in e&&null!==(d=e.get(a,b))?d:a[b]},propHooks:{tabIndex:{get:function(a){var b=n.find.attr(a,"tabindex");return b?parseInt(b,10):tc.test(a.nodeName)||uc.test(a.nodeName)&&a.href?0:-1}}}}),l.hrefNormalized||n.each(["href","src"],function(a,b){n.propHooks[b]={get:function(a){return a.getAttribute(b,4)}}}),l.optSelected||(n.propHooks.selected={get:function(a){var b=a.parentNode;return b&&(b.selectedIndex,b.parentNode&&b.parentNode.selectedIndex),null}}),n.each(["tabIndex","readOnly","maxLength","cellSpacing","cellPadding","rowSpan","colSpan","useMap","frameBorder","contentEditable"],function(){n.propFix[this.toLowerCase()]=this}),l.enctype||(n.propFix.enctype="encoding");var vc=/[\t\r\n\f]/g;n.fn.extend({addClass:function(a){var b,c,d,e,f,g,h=0,i=this.length,j="string"==typeof a&&a;if(n.isFunction(a))return this.each(function(b){n(this).addClass(a.call(this,b,this.className))});if(j)for(b=(a||"").match(F)||[];i>h;h++)if(c=this[h],d=1===c.nodeType&&(c.className?(" "+c.className+" ").replace(vc," "):" ")){f=0;while(e=b[f++])d.indexOf(" "+e+" ")<0&&(d+=e+" ");g=n.trim(d),c.className!==g&&(c.className=g)}return this},removeClass:function(a){var b,c,d,e,f,g,h=0,i=this.length,j=0===arguments.length||"string"==typeof a&&a;if(n.isFunction(a))return this.each(function(b){n(this).removeClass(a.call(this,b,this.className))});if(j)for(b=(a||"").match(F)||[];i>h;h++)if(c=this[h],d=1===c.nodeType&&(c.className?(" "+c.className+" ").replace(vc," "):"")){f=0;while(e=b[f++])while(d.indexOf(" "+e+" ")>=0)d=d.replace(" "+e+" "," ");g=a?n.trim(d):"",c.className!==g&&(c.className=g)}return this},toggleClass:function(a,b){var c=typeof a;return"boolean"==typeof b&&"string"===c?b?this.addClass(a):this.removeClass(a):this.each(n.isFunction(a)?function(c){n(this).toggleClass(a.call(this,c,this.className,b),b)}:function(){if("string"===c){var b,d=0,e=n(this),f=a.match(F)||[];while(b=f[d++])e.hasClass(b)?e.removeClass(b):e.addClass(b)}else(c===L||"boolean"===c)&&(this.className&&n._data(this,"__className__",this.className),this.className=this.className||a===!1?"":n._data(this,"__className__")||"")})},hasClass:function(a){for(var b=" "+a+" ",c=0,d=this.length;d>c;c++)if(1===this[c].nodeType&&(" "+this[c].className+" ").replace(vc," ").indexOf(b)>=0)return!0;return!1}}),n.each("blur focus focusin focusout load resize scroll unload click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select submit keydown keypress keyup error contextmenu".split(" "),function(a,b){n.fn[b]=function(a,c){return arguments.length>0?this.on(b,null,a,c):this.trigger(b)}}),n.fn.extend({hover:function(a,b){return this.mouseenter(a).mouseleave(b||a)},bind:function(a,b,c){return this.on(a,null,b,c)},unbind:function(a,b){return this.off(a,null,b)},delegate:function(a,b,c,d){return this.on(b,a,c,d)},undelegate:function(a,b,c){return 1===arguments.length?this.off(a,"**"):this.off(b,a||"**",c)}});var wc=n.now(),xc=/\?/,yc=/(,)|(\[|{)|(}|])|"(?:[^"\\\r\n]|\\["\\\/bfnrt]|\\u[\da-fA-F]{4})*"\s*:?|true|false|null|-?(?!0\d)\d+(?:\.\d+|)(?:[eE][+-]?\d+|)/g;n.parseJSON=function(b){if(a.JSON&&a.JSON.parse)return a.JSON.parse(b+"");var c,d=null,e=n.trim(b+"");return e&&!n.trim(e.replace(yc,function(a,b,e,f){return c&&b&&(d=0),0===d?a:(c=e||b,d+=!f-!e,"")}))?Function("return "+e)():n.error("Invalid JSON: "+b)},n.parseXML=function(b){var c,d;if(!b||"string"!=typeof b)return null;try{a.DOMParser?(d=new DOMParser,c=d.parseFromString(b,"text/xml")):(c=new ActiveXObject("Microsoft.XMLDOM"),c.async="false",c.loadXML(b))}catch(e){c=void 0}return c&&c.documentElement&&!c.getElementsByTagName("parsererror").length||n.error("Invalid XML: "+b),c};var zc,Ac,Bc=/#.*$/,Cc=/([?&])_=[^&]*/,Dc=/^(.*?):[ \t]*([^\r\n]*)\r?$/gm,Ec=/^(?:about|app|app-storage|.+-extension|file|res|widget):$/,Fc=/^(?:GET|HEAD)$/,Gc=/^\/\//,Hc=/^([\w.+-]+:)(?:\/\/(?:[^\/?#]*@|)([^\/?#:]*)(?::(\d+)|)|)/,Ic={},Jc={},Kc="*/".concat("*");try{Ac=location.href}catch(Lc){Ac=z.createElement("a"),Ac.href="",Ac=Ac.href}zc=Hc.exec(Ac.toLowerCase())||[];function Mc(a){return function(b,c){"string"!=typeof b&&(c=b,b="*");var d,e=0,f=b.toLowerCase().match(F)||[];if(n.isFunction(c))while(d=f[e++])"+"===d.charAt(0)?(d=d.slice(1)||"*",(a[d]=a[d]||[]).unshift(c)):(a[d]=a[d]||[]).push(c)}}function Nc(a,b,c,d){var e={},f=a===Jc;function g(h){var i;return e[h]=!0,n.each(a[h]||[],function(a,h){var j=h(b,c,d);return"string"!=typeof j||f||e[j]?f?!(i=j):void 0:(b.dataTypes.unshift(j),g(j),!1)}),i}return g(b.dataTypes[0])||!e["*"]&&g("*")}function Oc(a,b){var c,d,e=n.ajaxSettings.flatOptions||{};for(d in b)void 0!==b[d]&&((e[d]?a:c||(c={}))[d]=b[d]);return c&&n.extend(!0,a,c),a}function Pc(a,b,c){var d,e,f,g,h=a.contents,i=a.dataTypes;while("*"===i[0])i.shift(),void 0===e&&(e=a.mimeType||b.getResponseHeader("Content-Type"));if(e)for(g in h)if(h[g]&&h[g].test(e)){i.unshift(g);break}if(i[0]in c)f=i[0];else{for(g in c){if(!i[0]||a.converters[g+" "+i[0]]){f=g;break}d||(d=g)}f=f||d}return f?(f!==i[0]&&i.unshift(f),c[f]):void 0}function Qc(a,b,c,d){var e,f,g,h,i,j={},k=a.dataTypes.slice();if(k[1])for(g in a.converters)j[g.toLowerCase()]=a.converters[g];f=k.shift();while(f)if(a.responseFields[f]&&(c[a.responseFields[f]]=b),!i&&d&&a.dataFilter&&(b=a.dataFilter(b,a.dataType)),i=f,f=k.shift())if("*"===f)f=i;else if("*"!==i&&i!==f){if(g=j[i+" "+f]||j["* "+f],!g)for(e in j)if(h=e.split(" "),h[1]===f&&(g=j[i+" "+h[0]]||j["* "+h[0]])){g===!0?g=j[e]:j[e]!==!0&&(f=h[0],k.unshift(h[1]));break}if(g!==!0)if(g&&a["throws"])b=g(b);else try{b=g(b)}catch(l){return{state:"parsererror",error:g?l:"No conversion from "+i+" to "+f}}}return{state:"success",data:b}}n.extend({active:0,lastModified:{},etag:{},ajaxSettings:{url:Ac,type:"GET",isLocal:Ec.test(zc[1]),global:!0,processData:!0,async:!0,contentType:"application/x-www-form-urlencoded; charset=UTF-8",accepts:{"*":Kc,text:"text/plain",html:"text/html",xml:"application/xml, text/xml",json:"application/json, text/javascript"},contents:{xml:/xml/,html:/html/,json:/json/},responseFields:{xml:"responseXML",text:"responseText",json:"responseJSON"},converters:{"* text":String,"text html":!0,"text json":n.parseJSON,"text xml":n.parseXML},flatOptions:{url:!0,context:!0}},ajaxSetup:function(a,b){return b?Oc(Oc(a,n.ajaxSettings),b):Oc(n.ajaxSettings,a)},ajaxPrefilter:Mc(Ic),ajaxTransport:Mc(Jc),ajax:function(a,b){"object"==typeof a&&(b=a,a=void 0),b=b||{};var c,d,e,f,g,h,i,j,k=n.ajaxSetup({},b),l=k.context||k,m=k.context&&(l.nodeType||l.jquery)?n(l):n.event,o=n.Deferred(),p=n.Callbacks("once memory"),q=k.statusCode||{},r={},s={},t=0,u="canceled",v={readyState:0,getResponseHeader:function(a){var b;if(2===t){if(!j){j={};while(b=Dc.exec(f))j[b[1].toLowerCase()]=b[2]}b=j[a.toLowerCase()]}return null==b?null:b},getAllResponseHeaders:function(){return 2===t?f:null},setRequestHeader:function(a,b){var c=a.toLowerCase();return t||(a=s[c]=s[c]||a,r[a]=b),this},overrideMimeType:function(a){return t||(k.mimeType=a),this},statusCode:function(a){var b;if(a)if(2>t)for(b in a)q[b]=[q[b],a[b]];else v.always(a[v.status]);return this},abort:function(a){var b=a||u;return i&&i.abort(b),x(0,b),this}};if(o.promise(v).complete=p.add,v.success=v.done,v.error=v.fail,k.url=((a||k.url||Ac)+"").replace(Bc,"").replace(Gc,zc[1]+"//"),k.type=b.method||b.type||k.method||k.type,k.dataTypes=n.trim(k.dataType||"*").toLowerCase().match(F)||[""],null==k.crossDomain&&(c=Hc.exec(k.url.toLowerCase()),k.crossDomain=!(!c||c[1]===zc[1]&&c[2]===zc[2]&&(c[3]||("http:"===c[1]?"80":"443"))===(zc[3]||("http:"===zc[1]?"80":"443")))),k.data&&k.processData&&"string"!=typeof k.data&&(k.data=n.param(k.data,k.traditional)),Nc(Ic,k,b,v),2===t)return v;h=k.global,h&&0===n.active++&&n.event.trigger("ajaxStart"),k.type=k.type.toUpperCase(),k.hasContent=!Fc.test(k.type),e=k.url,k.hasContent||(k.data&&(e=k.url+=(xc.test(e)?"&":"?")+k.data,delete k.data),k.cache===!1&&(k.url=Cc.test(e)?e.replace(Cc,"$1_="+wc++):e+(xc.test(e)?"&":"?")+"_="+wc++)),k.ifModified&&(n.lastModified[e]&&v.setRequestHeader("If-Modified-Since",n.lastModified[e]),n.etag[e]&&v.setRequestHeader("If-None-Match",n.etag[e])),(k.data&&k.hasContent&&k.contentType!==!1||b.contentType)&&v.setRequestHeader("Content-Type",k.contentType),v.setRequestHeader("Accept",k.dataTypes[0]&&k.accepts[k.dataTypes[0]]?k.accepts[k.dataTypes[0]]+("*"!==k.dataTypes[0]?", "+Kc+"; q=0.01":""):k.accepts["*"]);for(d in k.headers)v.setRequestHeader(d,k.headers[d]);if(k.beforeSend&&(k.beforeSend.call(l,v,k)===!1||2===t))return v.abort();u="abort";for(d in{success:1,error:1,complete:1})v[d](k[d]);if(i=Nc(Jc,k,b,v)){v.readyState=1,h&&m.trigger("ajaxSend",[v,k]),k.async&&k.timeout>0&&(g=setTimeout(function(){v.abort("timeout")},k.timeout));try{t=1,i.send(r,x)}catch(w){if(!(2>t))throw w;x(-1,w)}}else x(-1,"No Transport");function x(a,b,c,d){var j,r,s,u,w,x=b;2!==t&&(t=2,g&&clearTimeout(g),i=void 0,f=d||"",v.readyState=a>0?4:0,j=a>=200&&300>a||304===a,c&&(u=Pc(k,v,c)),u=Qc(k,u,v,j),j?(k.ifModified&&(w=v.getResponseHeader("Last-Modified"),w&&(n.lastModified[e]=w),w=v.getResponseHeader("etag"),w&&(n.etag[e]=w)),204===a||"HEAD"===k.type?x="nocontent":304===a?x="notmodified":(x=u.state,r=u.data,s=u.error,j=!s)):(s=x,(a||!x)&&(x="error",0>a&&(a=0))),v.status=a,v.statusText=(b||x)+"",j?o.resolveWith(l,[r,x,v]):o.rejectWith(l,[v,x,s]),v.statusCode(q),q=void 0,h&&m.trigger(j?"ajaxSuccess":"ajaxError",[v,k,j?r:s]),p.fireWith(l,[v,x]),h&&(m.trigger("ajaxComplete",[v,k]),--n.active||n.event.trigger("ajaxStop")))}return v},getJSON:function(a,b,c){return n.get(a,b,c,"json")},getScript:function(a,b){return n.get(a,void 0,b,"script")}}),n.each(["get","post"],function(a,b){n[b]=function(a,c,d,e){return n.isFunction(c)&&(e=e||d,d=c,c=void 0),n.ajax({url:a,type:b,dataType:e,data:c,success:d})}}),n.each(["ajaxStart","ajaxStop","ajaxComplete","ajaxError","ajaxSuccess","ajaxSend"],function(a,b){n.fn[b]=function(a){return this.on(b,a)}}),n._evalUrl=function(a){return n.ajax({url:a,type:"GET",dataType:"script",async:!1,global:!1,"throws":!0})},n.fn.extend({wrapAll:function(a){if(n.isFunction(a))return this.each(function(b){n(this).wrapAll(a.call(this,b))});if(this[0]){var b=n(a,this[0].ownerDocument).eq(0).clone(!0);this[0].parentNode&&b.insertBefore(this[0]),b.map(function(){var a=this;while(a.firstChild&&1===a.firstChild.nodeType)a=a.firstChild;return a}).append(this)}return this},wrapInner:function(a){return this.each(n.isFunction(a)?function(b){n(this).wrapInner(a.call(this,b))}:function(){var b=n(this),c=b.contents();c.length?c.wrapAll(a):b.append(a)})},wrap:function(a){var b=n.isFunction(a);return this.each(function(c){n(this).wrapAll(b?a.call(this,c):a)})},unwrap:function(){return this.parent().each(function(){n.nodeName(this,"body")||n(this).replaceWith(this.childNodes)}).end()}}),n.expr.filters.hidden=function(a){return a.offsetWidth<=0&&a.offsetHeight<=0||!l.reliableHiddenOffsets()&&"none"===(a.style&&a.style.display||n.css(a,"display"))},n.expr.filters.visible=function(a){return!n.expr.filters.hidden(a)};var Rc=/%20/g,Sc=/\[\]$/,Tc=/\r?\n/g,Uc=/^(?:submit|button|image|reset|file)$/i,Vc=/^(?:input|select|textarea|keygen)/i;function Wc(a,b,c,d){var e;if(n.isArray(b))n.each(b,function(b,e){c||Sc.test(a)?d(a,e):Wc(a+"["+("object"==typeof e?b:"")+"]",e,c,d)});else if(c||"object"!==n.type(b))d(a,b);else for(e in b)Wc(a+"["+e+"]",b[e],c,d)}n.param=function(a,b){var c,d=[],e=function(a,b){b=n.isFunction(b)?b():null==b?"":b,d[d.length]=encodeURIComponent(a)+"="+encodeURIComponent(b)};if(void 0===b&&(b=n.ajaxSettings&&n.ajaxSettings.traditional),n.isArray(a)||a.jquery&&!n.isPlainObject(a))n.each(a,function(){e(this.name,this.value)});else for(c in a)Wc(c,a[c],b,e);return d.join("&").replace(Rc,"+")},n.fn.extend({serialize:function(){return n.param(this.serializeArray())},serializeArray:function(){return this.map(function(){var a=n.prop(this,"elements");return a?n.makeArray(a):this}).filter(function(){var a=this.type;return this.name&&!n(this).is(":disabled")&&Vc.test(this.nodeName)&&!Uc.test(a)&&(this.checked||!X.test(a))}).map(function(a,b){var c=n(this).val();return null==c?null:n.isArray(c)?n.map(c,function(a){return{name:b.name,value:a.replace(Tc,"\r\n")}}):{name:b.name,value:c.replace(Tc,"\r\n")}}).get()}}),n.ajaxSettings.xhr=void 0!==a.ActiveXObject?function(){return!this.isLocal&&/^(get|post|head|put|delete|options)$/i.test(this.type)&&$c()||_c()}:$c;var Xc=0,Yc={},Zc=n.ajaxSettings.xhr();a.ActiveXObject&&n(a).on("unload",function(){for(var a in Yc)Yc[a](void 0,!0)}),l.cors=!!Zc&&"withCredentials"in Zc,Zc=l.ajax=!!Zc,Zc&&n.ajaxTransport(function(a){if(!a.crossDomain||l.cors){var b;return{send:function(c,d){var e,f=a.xhr(),g=++Xc;if(f.open(a.type,a.url,a.async,a.username,a.password),a.xhrFields)for(e in a.xhrFields)f[e]=a.xhrFields[e];a.mimeType&&f.overrideMimeType&&f.overrideMimeType(a.mimeType),a.crossDomain||c["X-Requested-With"]||(c["X-Requested-With"]="XMLHttpRequest");for(e in c)void 0!==c[e]&&f.setRequestHeader(e,c[e]+"");f.send(a.hasContent&&a.data||null),b=function(c,e){var h,i,j;if(b&&(e||4===f.readyState))if(delete Yc[g],b=void 0,f.onreadystatechange=n.noop,e)4!==f.readyState&&f.abort();else{j={},h=f.status,"string"==typeof f.responseText&&(j.text=f.responseText);try{i=f.statusText}catch(k){i=""}h||!a.isLocal||a.crossDomain?1223===h&&(h=204):h=j.text?200:404}j&&d(h,i,j,f.getAllResponseHeaders())},a.async?4===f.readyState?setTimeout(b):f.onreadystatechange=Yc[g]=b:b()},abort:function(){b&&b(void 0,!0)}}}});function $c(){try{return new a.XMLHttpRequest}catch(b){}}function _c(){try{return new a.ActiveXObject("Microsoft.XMLHTTP")}catch(b){}}n.ajaxSetup({accepts:{script:"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"},contents:{script:/(?:java|ecma)script/},converters:{"text script":function(a){return n.globalEval(a),a}}}),n.ajaxPrefilter("script",function(a){void 0===a.cache&&(a.cache=!1),a.crossDomain&&(a.type="GET",a.global=!1)}),n.ajaxTransport("script",function(a){if(a.crossDomain){var b,c=z.head||n("head")[0]||z.documentElement;return{send:function(d,e){b=z.createElement("script"),b.async=!0,a.scriptCharset&&(b.charset=a.scriptCharset),b.src=a.url,b.onload=b.onreadystatechange=function(a,c){(c||!b.readyState||/loaded|complete/.test(b.readyState))&&(b.onload=b.onreadystatechange=null,b.parentNode&&b.parentNode.removeChild(b),b=null,c||e(200,"success"))},c.insertBefore(b,c.firstChild)},abort:function(){b&&b.onload(void 0,!0)}}}});var ad=[],bd=/(=)\?(?=&|$)|\?\?/;n.ajaxSetup({jsonp:"callback",jsonpCallback:function(){var a=ad.pop()||n.expando+"_"+wc++;return this[a]=!0,a}}),n.ajaxPrefilter("json jsonp",function(b,c,d){var e,f,g,h=b.jsonp!==!1&&(bd.test(b.url)?"url":"string"==typeof b.data&&!(b.contentType||"").indexOf("application/x-www-form-urlencoded")&&bd.test(b.data)&&"data");return h||"jsonp"===b.dataTypes[0]?(e=b.jsonpCallback=n.isFunction(b.jsonpCallback)?b.jsonpCallback():b.jsonpCallback,h?b[h]=b[h].replace(bd,"$1"+e):b.jsonp!==!1&&(b.url+=(xc.test(b.url)?"&":"?")+b.jsonp+"="+e),b.converters["script json"]=function(){return g||n.error(e+" was not called"),g[0]},b.dataTypes[0]="json",f=a[e],a[e]=function(){g=arguments},d.always(function(){a[e]=f,b[e]&&(b.jsonpCallback=c.jsonpCallback,ad.push(e)),g&&n.isFunction(f)&&f(g[0]),g=f=void 0}),"script"):void 0}),n.parseHTML=function(a,b,c){if(!a||"string"!=typeof a)return null;"boolean"==typeof b&&(c=b,b=!1),b=b||z;var d=v.exec(a),e=!c&&[];return d?[b.createElement(d[1])]:(d=n.buildFragment([a],b,e),e&&e.length&&n(e).remove(),n.merge([],d.childNodes))};var cd=n.fn.load;n.fn.load=function(a,b,c){if("string"!=typeof a&&cd)return cd.apply(this,arguments);var d,e,f,g=this,h=a.indexOf(" ");return h>=0&&(d=a.slice(h,a.length),a=a.slice(0,h)),n.isFunction(b)?(c=b,b=void 0):b&&"object"==typeof b&&(f="POST"),g.length>0&&n.ajax({url:a,type:f,dataType:"html",data:b}).done(function(a){e=arguments,g.html(d?n("<div>").append(n.parseHTML(a)).find(d):a)}).complete(c&&function(a,b){g.each(c,e||[a.responseText,b,a])}),this},n.expr.filters.animated=function(a){return n.grep(n.timers,function(b){return a===b.elem}).length};var dd=a.document.documentElement;function ed(a){return n.isWindow(a)?a:9===a.nodeType?a.defaultView||a.parentWindow:!1}n.offset={setOffset:function(a,b,c){var d,e,f,g,h,i,j,k=n.css(a,"position"),l=n(a),m={};"static"===k&&(a.style.position="relative"),h=l.offset(),f=n.css(a,"top"),i=n.css(a,"left"),j=("absolute"===k||"fixed"===k)&&n.inArray("auto",[f,i])>-1,j?(d=l.position(),g=d.top,e=d.left):(g=parseFloat(f)||0,e=parseFloat(i)||0),n.isFunction(b)&&(b=b.call(a,c,h)),null!=b.top&&(m.top=b.top-h.top+g),null!=b.left&&(m.left=b.left-h.left+e),"using"in b?b.using.call(a,m):l.css(m)}},n.fn.extend({offset:function(a){if(arguments.length)return void 0===a?this:this.each(function(b){n.offset.setOffset(this,a,b)});var b,c,d={top:0,left:0},e=this[0],f=e&&e.ownerDocument;if(f)return b=f.documentElement,n.contains(b,e)?(typeof e.getBoundingClientRect!==L&&(d=e.getBoundingClientRect()),c=ed(f),{top:d.top+(c.pageYOffset||b.scrollTop)-(b.clientTop||0),left:d.left+(c.pageXOffset||b.scrollLeft)-(b.clientLeft||0)}):d},position:function(){if(this[0]){var a,b,c={top:0,left:0},d=this[0];return"fixed"===n.css(d,"position")?b=d.getBoundingClientRect():(a=this.offsetParent(),b=this.offset(),n.nodeName(a[0],"html")||(c=a.offset()),c.top+=n.css(a[0],"borderTopWidth",!0),c.left+=n.css(a[0],"borderLeftWidth",!0)),{top:b.top-c.top-n.css(d,"marginTop",!0),left:b.left-c.left-n.css(d,"marginLeft",!0)}}},offsetParent:function(){return this.map(function(){var a=this.offsetParent||dd;while(a&&!n.nodeName(a,"html")&&"static"===n.css(a,"position"))a=a.offsetParent;return a||dd})}}),n.each({scrollLeft:"pageXOffset",scrollTop:"pageYOffset"},function(a,b){var c=/Y/.test(b);n.fn[a]=function(d){return W(this,function(a,d,e){var f=ed(a);return void 0===e?f?b in f?f[b]:f.document.documentElement[d]:a[d]:void(f?f.scrollTo(c?n(f).scrollLeft():e,c?e:n(f).scrollTop()):a[d]=e)},a,d,arguments.length,null)}}),n.each(["top","left"],function(a,b){n.cssHooks[b]=Mb(l.pixelPosition,function(a,c){return c?(c=Kb(a,b),Ib.test(c)?n(a).position()[b]+"px":c):void 0})}),n.each({Height:"height",Width:"width"},function(a,b){n.each({padding:"inner"+a,content:b,"":"outer"+a},function(c,d){n.fn[d]=function(d,e){var f=arguments.length&&(c||"boolean"!=typeof d),g=c||(d===!0||e===!0?"margin":"border");return W(this,function(b,c,d){var e;return n.isWindow(b)?b.document.documentElement["client"+a]:9===b.nodeType?(e=b.documentElement,Math.max(b.body["scroll"+a],e["scroll"+a],b.body["offset"+a],e["offset"+a],e["client"+a])):void 0===d?n.css(b,c,g):n.style(b,c,d,g)},b,f?d:void 0,f,null)}})}),n.fn.size=function(){return this.length},n.fn.andSelf=n.fn.addBack,"function"==typeof define&&define.amd&&define("jquery",[],function(){return n});var fd=a.jQuery,gd=a.$;return n.noConflict=function(b){return a.$===n&&(a.$=gd),b&&a.jQuery===n&&(a.jQuery=fd),n},typeof b===L&&(a.jQuery=a.$=n),n});
ajax/libs/algoliasearch/3.24.2/algoliasearch.js
joeyparrish/cdnjs
/*! algoliasearch 3.24.2 | © 2014, 2015 Algolia SAS | github.com/algolia/algoliasearch-client-js */ (function(f){var g;if(typeof window!=='undefined'){g=window}else if(typeof self!=='undefined'){g=self}g.ALGOLIA_MIGRATION_LAYER=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 a(o,!0);if(i)return i(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){ module.exports = function load (src, opts, cb) { var head = document.head || document.getElementsByTagName('head')[0] var script = document.createElement('script') if (typeof opts === 'function') { cb = opts opts = {} } opts = opts || {} cb = cb || function() {} script.type = opts.type || 'text/javascript' script.charset = opts.charset || 'utf8'; script.async = 'async' in opts ? !!opts.async : true script.src = src if (opts.attrs) { setAttributes(script, opts.attrs) } if (opts.text) { script.text = '' + opts.text } var onend = 'onload' in script ? stdOnEnd : ieOnEnd onend(script, cb) // some good legacy browsers (firefox) fail the 'in' detection above // so as a fallback we always set onload // old IE will ignore this and new IE will set onload if (!script.onload) { stdOnEnd(script, cb); } head.appendChild(script) } function setAttributes(script, attrs) { for (var attr in attrs) { script.setAttribute(attr, attrs[attr]); } } function stdOnEnd (script, cb) { script.onload = function () { this.onerror = this.onload = null cb(null, script) } script.onerror = function () { // this.onload = null here is necessary // because even IE9 works not like others this.onerror = this.onload = null cb(new Error('Failed to load ' + this.src), script) } } function ieOnEnd (script, cb) { script.onreadystatechange = function () { if (this.readyState != 'complete' && this.readyState != 'loaded') return this.onreadystatechange = null cb(null, script) // there is no way to catch loading errors in IE8 } } },{}],2:[function(require,module,exports){ 'use strict'; // this module helps finding if the current page is using // the cdn.jsdelivr.net/algoliasearch/latest/$BUILDNAME.min.js version module.exports = isUsingLatest; function isUsingLatest(buildName) { var toFind = new RegExp('cdn\\.jsdelivr\\.net/algoliasearch/latest/' + buildName.replace('.', '\\.') + // algoliasearch, algoliasearch.angular '(?:\\.min)?\\.js$'); // [.min].js var scripts = document.getElementsByTagName('script'); var found = false; for (var currentScript = 0, nbScripts = scripts.length; currentScript < nbScripts; currentScript++) { if (scripts[currentScript].src && toFind.test(scripts[currentScript].src)) { found = true; break; } } return found; } },{}],3:[function(require,module,exports){ 'use strict'; module.exports = loadV2; function loadV2(buildName) { var loadScript = require(1); var v2ScriptUrl = '//cdn.jsdelivr.net/algoliasearch/2/' + buildName + '.min.js'; var message = '-- AlgoliaSearch `latest` warning --\n' + 'Warning, you are using the `latest` version string from jsDelivr to load the AlgoliaSearch library.\n' + 'Using `latest` is no more recommended, you should load //cdn.jsdelivr.net/algoliasearch/2/algoliasearch.min.js\n\n' + 'Also, we updated the AlgoliaSearch JavaScript client to V3. If you want to upgrade,\n' + 'please read our migration guide at https://github.com/algolia/algoliasearch-client-js/wiki/Migration-guide-from-2.x.x-to-3.x.x\n' + '-- /AlgoliaSearch `latest` warning --'; if (window.console) { if (window.console.warn) { window.console.warn(message); } else if (window.console.log) { window.console.log(message); } } // If current script loaded asynchronously, // it will load the script with DOMElement // otherwise, it will load the script with document.write try { // why \x3c? http://stackoverflow.com/a/236106/147079 document.write('\x3Cscript>window.ALGOLIA_SUPPORTS_DOCWRITE = true\x3C/script>'); if (window.ALGOLIA_SUPPORTS_DOCWRITE === true) { document.write('\x3Cscript src="' + v2ScriptUrl + '">\x3C/script>'); scriptLoaded('document.write')(); } else { loadScript(v2ScriptUrl, scriptLoaded('DOMElement')); } } catch (e) { loadScript(v2ScriptUrl, scriptLoaded('DOMElement')); } } function scriptLoaded(method) { return function log() { var message = 'AlgoliaSearch: loaded V2 script using ' + method; if (window.console && window.console.log) { window.console.log(message); } }; } },{"1":1}],4:[function(require,module,exports){ 'use strict'; /* eslint no-unused-vars: [2, {"vars": "local"}] */ module.exports = oldGlobals; // put old window.AlgoliaSearch.. into window. again so that // users upgrading to V3 without changing their code, will be warned function oldGlobals() { var message = '-- AlgoliaSearch V2 => V3 error --\n' + 'You are trying to use a new version of the AlgoliaSearch JavaScript client with an old notation.\n' + 'Please read our migration guide at https://github.com/algolia/algoliasearch-client-js/wiki/Migration-guide-from-2.x.x-to-3.x.x\n' + '-- /AlgoliaSearch V2 => V3 error --'; window.AlgoliaSearch = function() { throw new Error(message); }; window.AlgoliaSearchHelper = function() { throw new Error(message); }; window.AlgoliaExplainResults = function() { throw new Error(message); }; } },{}],5:[function(require,module,exports){ 'use strict'; // This script will be browserified and prepended to the normal build // directly in window, not wrapped in any module definition // To avoid cases where we are loaded with /latest/ along with migrationLayer("algoliasearch"); // Now onto the V2 related code: // If the client is using /latest/$BUILDNAME.min.js, load V2 of the library // // Otherwise, setup a migration layer that will throw on old constructors like // new AlgoliaSearch(). // So that users upgrading from v2 to v3 will have a clear information // message on what to do if they did not read the migration guide function migrationLayer(buildName) { var isUsingLatest = require(2); var loadV2 = require(3); var oldGlobals = require(4); if (isUsingLatest(buildName)) { loadV2(buildName); } else { oldGlobals(); } } },{"2":2,"3":3,"4":4}]},{},[5])(5) });(function(f){if(typeof exports==="object"&&typeof module!=="undefined"){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.algoliasearch = 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 a(o,!0);if(i)return i(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){ (function (process){ /** * This is the web browser implementation of `debug()`. * * Expose `debug()` as the module. */ exports = module.exports = require(2); exports.log = log; exports.formatArgs = formatArgs; exports.save = save; exports.load = load; exports.useColors = useColors; exports.storage = 'undefined' != typeof chrome && 'undefined' != typeof chrome.storage ? chrome.storage.local : localstorage(); /** * Colors. */ exports.colors = [ 'lightseagreen', 'forestgreen', 'goldenrod', 'dodgerblue', 'darkorchid', 'crimson' ]; /** * Currently only WebKit-based Web Inspectors, Firefox >= v31, * and the Firebug extension (any Firefox version) are known * to support "%c" CSS customizations. * * TODO: add a `localStorage` variable to explicitly enable/disable colors */ function useColors() { // NB: In an Electron preload script, document will be defined but not fully // initialized. Since we know we're in Chrome, we'll just detect this case // explicitly if (typeof window !== 'undefined' && window.process && window.process.type === 'renderer') { return true; } // is webkit? http://stackoverflow.com/a/16459606/376773 // document is undefined in react-native: https://github.com/facebook/react-native/pull/1632 return (typeof document !== 'undefined' && document.documentElement && document.documentElement.style && document.documentElement.style.WebkitAppearance) || // is firebug? http://stackoverflow.com/a/398120/376773 (typeof window !== 'undefined' && window.console && (window.console.firebug || (window.console.exception && window.console.table))) || // is firefox >= v31? // https://developer.mozilla.org/en-US/docs/Tools/Web_Console#Styling_messages (typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/) && parseInt(RegExp.$1, 10) >= 31) || // double check webkit in userAgent just in case we are in a worker (typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)); } /** * Map %j to `JSON.stringify()`, since no Web Inspectors do that by default. */ exports.formatters.j = function(v) { try { return JSON.stringify(v); } catch (err) { return '[UnexpectedJSONParseError]: ' + err.message; } }; /** * Colorize log arguments if enabled. * * @api public */ function formatArgs(args) { var useColors = this.useColors; args[0] = (useColors ? '%c' : '') + this.namespace + (useColors ? ' %c' : ' ') + args[0] + (useColors ? '%c ' : ' ') + '+' + exports.humanize(this.diff); if (!useColors) return; var c = 'color: ' + this.color; args.splice(1, 0, c, 'color: inherit') // the final "%c" is somewhat tricky, because there could be other // arguments passed either before or after the %c, so we need to // figure out the correct index to insert the CSS into var index = 0; var lastC = 0; args[0].replace(/%[a-zA-Z%]/g, function(match) { if ('%%' === match) return; index++; if ('%c' === match) { // we only are interested in the *last* %c // (the user may have provided their own) lastC = index; } }); args.splice(lastC, 0, c); } /** * Invokes `console.log()` when available. * No-op when `console.log` is not a "function". * * @api public */ function log() { // this hackery is required for IE8/9, where // the `console.log` function doesn't have 'apply' return 'object' === typeof console && console.log && Function.prototype.apply.call(console.log, console, arguments); } /** * Save `namespaces`. * * @param {String} namespaces * @api private */ function save(namespaces) { try { if (null == namespaces) { exports.storage.removeItem('debug'); } else { exports.storage.debug = namespaces; } } catch(e) {} } /** * Load `namespaces`. * * @return {String} returns the previously persisted debug modes * @api private */ function load() { var r; try { r = exports.storage.debug; } catch(e) {} // If debug isn't set in LS, and we're in Electron, try to load $DEBUG if (!r && typeof process !== 'undefined' && 'env' in process) { r = process.env.DEBUG; } return r; } /** * Enable namespaces listed in `localStorage.debug` initially. */ exports.enable(load()); /** * Localstorage attempts to return the localstorage. * * This is necessary because safari throws * when a user disables cookies/localstorage * and you attempt to access it. * * @return {LocalStorage} * @api private */ function localstorage() { try { return window.localStorage; } catch (e) {} } }).call(this,require(12)) },{"12":12,"2":2}],2:[function(require,module,exports){ /** * This is the common logic for both the Node.js and web browser * implementations of `debug()`. * * Expose `debug()` as the module. */ exports = module.exports = createDebug.debug = createDebug['default'] = createDebug; exports.coerce = coerce; exports.disable = disable; exports.enable = enable; exports.enabled = enabled; exports.humanize = require(9); /** * The currently active debug mode names, and names to skip. */ exports.names = []; exports.skips = []; /** * Map of special "%n" handling functions, for the debug "format" argument. * * Valid key names are a single, lower or upper-case letter, i.e. "n" and "N". */ exports.formatters = {}; /** * Previous log timestamp. */ var prevTime; /** * Select a color. * @param {String} namespace * @return {Number} * @api private */ function selectColor(namespace) { var hash = 0, i; for (i in namespace) { hash = ((hash << 5) - hash) + namespace.charCodeAt(i); hash |= 0; // Convert to 32bit integer } return exports.colors[Math.abs(hash) % exports.colors.length]; } /** * Create a debugger with the given `namespace`. * * @param {String} namespace * @return {Function} * @api public */ function createDebug(namespace) { function debug() { // disabled? if (!debug.enabled) return; var self = debug; // set `diff` timestamp var curr = +new Date(); var ms = curr - (prevTime || curr); self.diff = ms; self.prev = prevTime; self.curr = curr; prevTime = curr; // turn the `arguments` into a proper Array var args = new Array(arguments.length); for (var i = 0; i < args.length; i++) { args[i] = arguments[i]; } args[0] = exports.coerce(args[0]); if ('string' !== typeof args[0]) { // anything else let's inspect with %O args.unshift('%O'); } // apply any `formatters` transformations var index = 0; args[0] = args[0].replace(/%([a-zA-Z%])/g, function(match, format) { // if we encounter an escaped % then don't increase the array index if (match === '%%') return match; index++; var formatter = exports.formatters[format]; if ('function' === typeof formatter) { var val = args[index]; match = formatter.call(self, val); // now we need to remove `args[index]` since it's inlined in the `format` args.splice(index, 1); index--; } return match; }); // apply env-specific formatting (colors, etc.) exports.formatArgs.call(self, args); var logFn = debug.log || exports.log || console.log.bind(console); logFn.apply(self, args); } debug.namespace = namespace; debug.enabled = exports.enabled(namespace); debug.useColors = exports.useColors(); debug.color = selectColor(namespace); // env-specific initialization logic for debug instances if ('function' === typeof exports.init) { exports.init(debug); } return debug; } /** * Enables a debug mode by namespaces. This can include modes * separated by a colon and wildcards. * * @param {String} namespaces * @api public */ function enable(namespaces) { exports.save(namespaces); exports.names = []; exports.skips = []; var split = (typeof namespaces === 'string' ? namespaces : '').split(/[\s,]+/); var len = split.length; for (var i = 0; i < len; i++) { if (!split[i]) continue; // ignore empty strings namespaces = split[i].replace(/\*/g, '.*?'); if (namespaces[0] === '-') { exports.skips.push(new RegExp('^' + namespaces.substr(1) + '$')); } else { exports.names.push(new RegExp('^' + namespaces + '$')); } } } /** * Disable debug output. * * @api public */ function disable() { exports.enable(''); } /** * Returns true if the given mode name is enabled, false otherwise. * * @param {String} name * @return {Boolean} * @api public */ function enabled(name) { var i, len; for (i = 0, len = exports.skips.length; i < len; i++) { if (exports.skips[i].test(name)) { return false; } } for (i = 0, len = exports.names.length; i < len; i++) { if (exports.names[i].test(name)) { return true; } } return false; } /** * Coerce `val`. * * @param {Mixed} val * @return {Mixed} * @api private */ function coerce(val) { if (val instanceof Error) return val.stack || val.message; return val; } },{"9":9}],3:[function(require,module,exports){ (function (process,global){ /*! * @overview es6-promise - a tiny implementation of Promises/A+. * @copyright Copyright (c) 2014 Yehuda Katz, Tom Dale, Stefan Penner and contributors (Conversion to ES6 API by Jake Archibald) * @license Licensed under MIT license * See https://raw.githubusercontent.com/stefanpenner/es6-promise/master/LICENSE * @version 4.1.0 */ (function (global, factory) { typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() : typeof define === 'function' && define.amd ? define(factory) : (global.ES6Promise = factory()); }(this, (function () { 'use strict'; function objectOrFunction(x) { return typeof x === 'function' || typeof x === 'object' && x !== null; } function isFunction(x) { return typeof x === 'function'; } var _isArray = undefined; if (!Array.isArray) { _isArray = function (x) { return Object.prototype.toString.call(x) === '[object Array]'; }; } else { _isArray = Array.isArray; } var isArray = _isArray; var len = 0; var vertxNext = undefined; var customSchedulerFn = undefined; var asap = function asap(callback, arg) { queue[len] = callback; queue[len + 1] = arg; len += 2; if (len === 2) { // If len is 2, that means that we need to schedule an async flush. // If additional callbacks are queued before the queue is flushed, they // will be processed by this flush that we are scheduling. if (customSchedulerFn) { customSchedulerFn(flush); } else { scheduleFlush(); } } }; function setScheduler(scheduleFn) { customSchedulerFn = scheduleFn; } function setAsap(asapFn) { asap = asapFn; } var browserWindow = typeof window !== 'undefined' ? window : undefined; var browserGlobal = browserWindow || {}; var BrowserMutationObserver = browserGlobal.MutationObserver || browserGlobal.WebKitMutationObserver; var isNode = typeof self === 'undefined' && typeof process !== 'undefined' && ({}).toString.call(process) === '[object process]'; // test for web worker but not in IE10 var isWorker = typeof Uint8ClampedArray !== 'undefined' && typeof importScripts !== 'undefined' && typeof MessageChannel !== 'undefined'; // node function useNextTick() { // node version 0.10.x displays a deprecation warning when nextTick is used recursively // see https://github.com/cujojs/when/issues/410 for details return function () { return process.nextTick(flush); }; } // vertx function useVertxTimer() { if (typeof vertxNext !== 'undefined') { return function () { vertxNext(flush); }; } return useSetTimeout(); } function useMutationObserver() { var iterations = 0; var observer = new BrowserMutationObserver(flush); var node = document.createTextNode(''); observer.observe(node, { characterData: true }); return function () { node.data = iterations = ++iterations % 2; }; } // web worker function useMessageChannel() { var channel = new MessageChannel(); channel.port1.onmessage = flush; return function () { return channel.port2.postMessage(0); }; } function useSetTimeout() { // Store setTimeout reference so es6-promise will be unaffected by // other code modifying setTimeout (like sinon.useFakeTimers()) var globalSetTimeout = setTimeout; return function () { return globalSetTimeout(flush, 1); }; } var queue = new Array(1000); function flush() { for (var i = 0; i < len; i += 2) { var callback = queue[i]; var arg = queue[i + 1]; callback(arg); queue[i] = undefined; queue[i + 1] = undefined; } len = 0; } function attemptVertx() { try { var r = require; var vertx = r('vertx'); vertxNext = vertx.runOnLoop || vertx.runOnContext; return useVertxTimer(); } catch (e) { return useSetTimeout(); } } var scheduleFlush = undefined; // Decide what async method to use to triggering processing of queued callbacks: if (isNode) { scheduleFlush = useNextTick(); } else if (BrowserMutationObserver) { scheduleFlush = useMutationObserver(); } else if (isWorker) { scheduleFlush = useMessageChannel(); } else if (browserWindow === undefined && typeof require === 'function') { scheduleFlush = attemptVertx(); } else { scheduleFlush = useSetTimeout(); } function then(onFulfillment, onRejection) { var _arguments = arguments; var parent = this; var child = new this.constructor(noop); if (child[PROMISE_ID] === undefined) { makePromise(child); } var _state = parent._state; if (_state) { (function () { var callback = _arguments[_state - 1]; asap(function () { return invokeCallback(_state, child, callback, parent._result); }); })(); } else { subscribe(parent, child, onFulfillment, onRejection); } return child; } /** `Promise.resolve` returns a promise that will become resolved with the passed `value`. It is shorthand for the following: ```javascript let promise = new Promise(function(resolve, reject){ resolve(1); }); promise.then(function(value){ // value === 1 }); ``` Instead of writing the above, your code now simply becomes the following: ```javascript let promise = Promise.resolve(1); promise.then(function(value){ // value === 1 }); ``` @method resolve @static @param {Any} value value that the returned promise will be resolved with Useful for tooling. @return {Promise} a promise that will become fulfilled with the given `value` */ function resolve(object) { /*jshint validthis:true */ var Constructor = this; if (object && typeof object === 'object' && object.constructor === Constructor) { return object; } var promise = new Constructor(noop); _resolve(promise, object); return promise; } var PROMISE_ID = Math.random().toString(36).substring(16); function noop() {} var PENDING = void 0; var FULFILLED = 1; var REJECTED = 2; var GET_THEN_ERROR = new ErrorObject(); function selfFulfillment() { return new TypeError("You cannot resolve a promise with itself"); } function cannotReturnOwn() { return new TypeError('A promises callback cannot return that same promise.'); } function getThen(promise) { try { return promise.then; } catch (error) { GET_THEN_ERROR.error = error; return GET_THEN_ERROR; } } function tryThen(then, value, fulfillmentHandler, rejectionHandler) { try { then.call(value, fulfillmentHandler, rejectionHandler); } catch (e) { return e; } } function handleForeignThenable(promise, thenable, then) { asap(function (promise) { var sealed = false; var error = tryThen(then, thenable, function (value) { if (sealed) { return; } sealed = true; if (thenable !== value) { _resolve(promise, value); } else { fulfill(promise, value); } }, function (reason) { if (sealed) { return; } sealed = true; _reject(promise, reason); }, 'Settle: ' + (promise._label || ' unknown promise')); if (!sealed && error) { sealed = true; _reject(promise, error); } }, promise); } function handleOwnThenable(promise, thenable) { if (thenable._state === FULFILLED) { fulfill(promise, thenable._result); } else if (thenable._state === REJECTED) { _reject(promise, thenable._result); } else { subscribe(thenable, undefined, function (value) { return _resolve(promise, value); }, function (reason) { return _reject(promise, reason); }); } } function handleMaybeThenable(promise, maybeThenable, then$$) { if (maybeThenable.constructor === promise.constructor && then$$ === then && maybeThenable.constructor.resolve === resolve) { handleOwnThenable(promise, maybeThenable); } else { if (then$$ === GET_THEN_ERROR) { _reject(promise, GET_THEN_ERROR.error); GET_THEN_ERROR.error = null; } else if (then$$ === undefined) { fulfill(promise, maybeThenable); } else if (isFunction(then$$)) { handleForeignThenable(promise, maybeThenable, then$$); } else { fulfill(promise, maybeThenable); } } } function _resolve(promise, value) { if (promise === value) { _reject(promise, selfFulfillment()); } else if (objectOrFunction(value)) { handleMaybeThenable(promise, value, getThen(value)); } else { fulfill(promise, value); } } function publishRejection(promise) { if (promise._onerror) { promise._onerror(promise._result); } publish(promise); } function fulfill(promise, value) { if (promise._state !== PENDING) { return; } promise._result = value; promise._state = FULFILLED; if (promise._subscribers.length !== 0) { asap(publish, promise); } } function _reject(promise, reason) { if (promise._state !== PENDING) { return; } promise._state = REJECTED; promise._result = reason; asap(publishRejection, promise); } function subscribe(parent, child, onFulfillment, onRejection) { var _subscribers = parent._subscribers; var length = _subscribers.length; parent._onerror = null; _subscribers[length] = child; _subscribers[length + FULFILLED] = onFulfillment; _subscribers[length + REJECTED] = onRejection; if (length === 0 && parent._state) { asap(publish, parent); } } function publish(promise) { var subscribers = promise._subscribers; var settled = promise._state; if (subscribers.length === 0) { return; } var child = undefined, callback = undefined, detail = promise._result; for (var i = 0; i < subscribers.length; i += 3) { child = subscribers[i]; callback = subscribers[i + settled]; if (child) { invokeCallback(settled, child, callback, detail); } else { callback(detail); } } promise._subscribers.length = 0; } function ErrorObject() { this.error = null; } var TRY_CATCH_ERROR = new ErrorObject(); function tryCatch(callback, detail) { try { return callback(detail); } catch (e) { TRY_CATCH_ERROR.error = e; return TRY_CATCH_ERROR; } } function invokeCallback(settled, promise, callback, detail) { var hasCallback = isFunction(callback), value = undefined, error = undefined, succeeded = undefined, failed = undefined; if (hasCallback) { value = tryCatch(callback, detail); if (value === TRY_CATCH_ERROR) { failed = true; error = value.error; value.error = null; } else { succeeded = true; } if (promise === value) { _reject(promise, cannotReturnOwn()); return; } } else { value = detail; succeeded = true; } if (promise._state !== PENDING) { // noop } else if (hasCallback && succeeded) { _resolve(promise, value); } else if (failed) { _reject(promise, error); } else if (settled === FULFILLED) { fulfill(promise, value); } else if (settled === REJECTED) { _reject(promise, value); } } function initializePromise(promise, resolver) { try { resolver(function resolvePromise(value) { _resolve(promise, value); }, function rejectPromise(reason) { _reject(promise, reason); }); } catch (e) { _reject(promise, e); } } var id = 0; function nextId() { return id++; } function makePromise(promise) { promise[PROMISE_ID] = id++; promise._state = undefined; promise._result = undefined; promise._subscribers = []; } function Enumerator(Constructor, input) { this._instanceConstructor = Constructor; this.promise = new Constructor(noop); if (!this.promise[PROMISE_ID]) { makePromise(this.promise); } if (isArray(input)) { this._input = input; this.length = input.length; this._remaining = input.length; this._result = new Array(this.length); if (this.length === 0) { fulfill(this.promise, this._result); } else { this.length = this.length || 0; this._enumerate(); if (this._remaining === 0) { fulfill(this.promise, this._result); } } } else { _reject(this.promise, validationError()); } } function validationError() { return new Error('Array Methods must be provided an Array'); }; Enumerator.prototype._enumerate = function () { var length = this.length; var _input = this._input; for (var i = 0; this._state === PENDING && i < length; i++) { this._eachEntry(_input[i], i); } }; Enumerator.prototype._eachEntry = function (entry, i) { var c = this._instanceConstructor; var resolve$$ = c.resolve; if (resolve$$ === resolve) { var _then = getThen(entry); if (_then === then && entry._state !== PENDING) { this._settledAt(entry._state, i, entry._result); } else if (typeof _then !== 'function') { this._remaining--; this._result[i] = entry; } else if (c === Promise) { var promise = new c(noop); handleMaybeThenable(promise, entry, _then); this._willSettleAt(promise, i); } else { this._willSettleAt(new c(function (resolve$$) { return resolve$$(entry); }), i); } } else { this._willSettleAt(resolve$$(entry), i); } }; Enumerator.prototype._settledAt = function (state, i, value) { var promise = this.promise; if (promise._state === PENDING) { this._remaining--; if (state === REJECTED) { _reject(promise, value); } else { this._result[i] = value; } } if (this._remaining === 0) { fulfill(promise, this._result); } }; Enumerator.prototype._willSettleAt = function (promise, i) { var enumerator = this; subscribe(promise, undefined, function (value) { return enumerator._settledAt(FULFILLED, i, value); }, function (reason) { return enumerator._settledAt(REJECTED, i, reason); }); }; /** `Promise.all` accepts an array of promises, and returns a new promise which is fulfilled with an array of fulfillment values for the passed promises, or rejected with the reason of the first passed promise to be rejected. It casts all elements of the passed iterable to promises as it runs this algorithm. Example: ```javascript let promise1 = resolve(1); let promise2 = resolve(2); let promise3 = resolve(3); let promises = [ promise1, promise2, promise3 ]; Promise.all(promises).then(function(array){ // The array here would be [ 1, 2, 3 ]; }); ``` If any of the `promises` given to `all` are rejected, the first promise that is rejected will be given as an argument to the returned promises's rejection handler. For example: Example: ```javascript let promise1 = resolve(1); let promise2 = reject(new Error("2")); let promise3 = reject(new Error("3")); let promises = [ promise1, promise2, promise3 ]; Promise.all(promises).then(function(array){ // Code here never runs because there are rejected promises! }, function(error) { // error.message === "2" }); ``` @method all @static @param {Array} entries array of promises @param {String} label optional string for labeling the promise. Useful for tooling. @return {Promise} promise that is fulfilled when all `promises` have been fulfilled, or rejected if any of them become rejected. @static */ function all(entries) { return new Enumerator(this, entries).promise; } /** `Promise.race` returns a new promise which is settled in the same way as the first passed promise to settle. Example: ```javascript let promise1 = new Promise(function(resolve, reject){ setTimeout(function(){ resolve('promise 1'); }, 200); }); let promise2 = new Promise(function(resolve, reject){ setTimeout(function(){ resolve('promise 2'); }, 100); }); Promise.race([promise1, promise2]).then(function(result){ // result === 'promise 2' because it was resolved before promise1 // was resolved. }); ``` `Promise.race` is deterministic in that only the state of the first settled promise matters. For example, even if other promises given to the `promises` array argument are resolved, but the first settled promise has become rejected before the other promises became fulfilled, the returned promise will become rejected: ```javascript let promise1 = new Promise(function(resolve, reject){ setTimeout(function(){ resolve('promise 1'); }, 200); }); let promise2 = new Promise(function(resolve, reject){ setTimeout(function(){ reject(new Error('promise 2')); }, 100); }); Promise.race([promise1, promise2]).then(function(result){ // Code here never runs }, function(reason){ // reason.message === 'promise 2' because promise 2 became rejected before // promise 1 became fulfilled }); ``` An example real-world use case is implementing timeouts: ```javascript Promise.race([ajax('foo.json'), timeout(5000)]) ``` @method race @static @param {Array} promises array of promises to observe Useful for tooling. @return {Promise} a promise which settles in the same way as the first passed promise to settle. */ function race(entries) { /*jshint validthis:true */ var Constructor = this; if (!isArray(entries)) { return new Constructor(function (_, reject) { return reject(new TypeError('You must pass an array to race.')); }); } else { return new Constructor(function (resolve, reject) { var length = entries.length; for (var i = 0; i < length; i++) { Constructor.resolve(entries[i]).then(resolve, reject); } }); } } /** `Promise.reject` returns a promise rejected with the passed `reason`. It is shorthand for the following: ```javascript let promise = new Promise(function(resolve, reject){ reject(new Error('WHOOPS')); }); promise.then(function(value){ // Code here doesn't run because the promise is rejected! }, function(reason){ // reason.message === 'WHOOPS' }); ``` Instead of writing the above, your code now simply becomes the following: ```javascript let promise = Promise.reject(new Error('WHOOPS')); promise.then(function(value){ // Code here doesn't run because the promise is rejected! }, function(reason){ // reason.message === 'WHOOPS' }); ``` @method reject @static @param {Any} reason value that the returned promise will be rejected with. Useful for tooling. @return {Promise} a promise rejected with the given `reason`. */ function reject(reason) { /*jshint validthis:true */ var Constructor = this; var promise = new Constructor(noop); _reject(promise, reason); return promise; } function needsResolver() { throw new TypeError('You must pass a resolver function as the first argument to the promise constructor'); } function needsNew() { throw new TypeError("Failed to construct 'Promise': Please use the 'new' operator, this object constructor cannot be called as a function."); } /** Promise objects represent the eventual result of an asynchronous operation. The primary way of interacting with a promise is through its `then` method, which registers callbacks to receive either a promise's eventual value or the reason why the promise cannot be fulfilled. Terminology ----------- - `promise` is an object or function with a `then` method whose behavior conforms to this specification. - `thenable` is an object or function that defines a `then` method. - `value` is any legal JavaScript value (including undefined, a thenable, or a promise). - `exception` is a value that is thrown using the throw statement. - `reason` is a value that indicates why a promise was rejected. - `settled` the final resting state of a promise, fulfilled or rejected. A promise can be in one of three states: pending, fulfilled, or rejected. Promises that are fulfilled have a fulfillment value and are in the fulfilled state. Promises that are rejected have a rejection reason and are in the rejected state. A fulfillment value is never a thenable. Promises can also be said to *resolve* a value. If this value is also a promise, then the original promise's settled state will match the value's settled state. So a promise that *resolves* a promise that rejects will itself reject, and a promise that *resolves* a promise that fulfills will itself fulfill. Basic Usage: ------------ ```js let promise = new Promise(function(resolve, reject) { // on success resolve(value); // on failure reject(reason); }); promise.then(function(value) { // on fulfillment }, function(reason) { // on rejection }); ``` Advanced Usage: --------------- Promises shine when abstracting away asynchronous interactions such as `XMLHttpRequest`s. ```js function getJSON(url) { return new Promise(function(resolve, reject){ let xhr = new XMLHttpRequest(); xhr.open('GET', url); xhr.onreadystatechange = handler; xhr.responseType = 'json'; xhr.setRequestHeader('Accept', 'application/json'); xhr.send(); function handler() { if (this.readyState === this.DONE) { if (this.status === 200) { resolve(this.response); } else { reject(new Error('getJSON: `' + url + '` failed with status: [' + this.status + ']')); } } }; }); } getJSON('/posts.json').then(function(json) { // on fulfillment }, function(reason) { // on rejection }); ``` Unlike callbacks, promises are great composable primitives. ```js Promise.all([ getJSON('/posts'), getJSON('/comments') ]).then(function(values){ values[0] // => postsJSON values[1] // => commentsJSON return values; }); ``` @class Promise @param {function} resolver Useful for tooling. @constructor */ function Promise(resolver) { this[PROMISE_ID] = nextId(); this._result = this._state = undefined; this._subscribers = []; if (noop !== resolver) { typeof resolver !== 'function' && needsResolver(); this instanceof Promise ? initializePromise(this, resolver) : needsNew(); } } Promise.all = all; Promise.race = race; Promise.resolve = resolve; Promise.reject = reject; Promise._setScheduler = setScheduler; Promise._setAsap = setAsap; Promise._asap = asap; Promise.prototype = { constructor: Promise, /** The primary way of interacting with a promise is through its `then` method, which registers callbacks to receive either a promise's eventual value or the reason why the promise cannot be fulfilled. ```js findUser().then(function(user){ // user is available }, function(reason){ // user is unavailable, and you are given the reason why }); ``` Chaining -------- The return value of `then` is itself a promise. This second, 'downstream' promise is resolved with the return value of the first promise's fulfillment or rejection handler, or rejected if the handler throws an exception. ```js findUser().then(function (user) { return user.name; }, function (reason) { return 'default name'; }).then(function (userName) { // If `findUser` fulfilled, `userName` will be the user's name, otherwise it // will be `'default name'` }); findUser().then(function (user) { throw new Error('Found user, but still unhappy'); }, function (reason) { throw new Error('`findUser` rejected and we're unhappy'); }).then(function (value) { // never reached }, function (reason) { // if `findUser` fulfilled, `reason` will be 'Found user, but still unhappy'. // If `findUser` rejected, `reason` will be '`findUser` rejected and we're unhappy'. }); ``` If the downstream promise does not specify a rejection handler, rejection reasons will be propagated further downstream. ```js findUser().then(function (user) { throw new PedagogicalException('Upstream error'); }).then(function (value) { // never reached }).then(function (value) { // never reached }, function (reason) { // The `PedgagocialException` is propagated all the way down to here }); ``` Assimilation ------------ Sometimes the value you want to propagate to a downstream promise can only be retrieved asynchronously. This can be achieved by returning a promise in the fulfillment or rejection handler. The downstream promise will then be pending until the returned promise is settled. This is called *assimilation*. ```js findUser().then(function (user) { return findCommentsByAuthor(user); }).then(function (comments) { // The user's comments are now available }); ``` If the assimliated promise rejects, then the downstream promise will also reject. ```js findUser().then(function (user) { return findCommentsByAuthor(user); }).then(function (comments) { // If `findCommentsByAuthor` fulfills, we'll have the value here }, function (reason) { // If `findCommentsByAuthor` rejects, we'll have the reason here }); ``` Simple Example -------------- Synchronous Example ```javascript let result; try { result = findResult(); // success } catch(reason) { // failure } ``` Errback Example ```js findResult(function(result, err){ if (err) { // failure } else { // success } }); ``` Promise Example; ```javascript findResult().then(function(result){ // success }, function(reason){ // failure }); ``` Advanced Example -------------- Synchronous Example ```javascript let author, books; try { author = findAuthor(); books = findBooksByAuthor(author); // success } catch(reason) { // failure } ``` Errback Example ```js function foundBooks(books) { } function failure(reason) { } findAuthor(function(author, err){ if (err) { failure(err); // failure } else { try { findBoooksByAuthor(author, function(books, err) { if (err) { failure(err); } else { try { foundBooks(books); } catch(reason) { failure(reason); } } }); } catch(error) { failure(err); } // success } }); ``` Promise Example; ```javascript findAuthor(). then(findBooksByAuthor). then(function(books){ // found books }).catch(function(reason){ // something went wrong }); ``` @method then @param {Function} onFulfilled @param {Function} onRejected Useful for tooling. @return {Promise} */ then: then, /** `catch` is simply sugar for `then(undefined, onRejection)` which makes it the same as the catch block of a try/catch statement. ```js function findAuthor(){ throw new Error('couldn't find that author'); } // synchronous try { findAuthor(); } catch(reason) { // something went wrong } // async with promises findAuthor().catch(function(reason){ // something went wrong }); ``` @method catch @param {Function} onRejection Useful for tooling. @return {Promise} */ 'catch': function _catch(onRejection) { return this.then(null, onRejection); } }; function polyfill() { var local = undefined; if (typeof global !== 'undefined') { local = global; } else if (typeof self !== 'undefined') { local = self; } else { try { local = Function('return this')(); } catch (e) { throw new Error('polyfill failed because global object is unavailable in this environment'); } } var P = local.Promise; if (P) { var promiseToString = null; try { promiseToString = Object.prototype.toString.call(P.resolve()); } catch (e) { // silently ignored } if (promiseToString === '[object Promise]' && !P.cast) { return; } } local.Promise = Promise; } // Strange compat.. Promise.polyfill = polyfill; Promise.Promise = Promise; return Promise; }))); }).call(this,require(12),typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {}) },{"12":12}],4:[function(require,module,exports){ // 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. function EventEmitter() { this._events = this._events || {}; this._maxListeners = this._maxListeners || undefined; } module.exports = EventEmitter; // Backwards-compat with node 0.10.x EventEmitter.EventEmitter = EventEmitter; EventEmitter.prototype._events = undefined; EventEmitter.prototype._maxListeners = undefined; // By default EventEmitters will print a warning if more than 10 listeners are // added to it. This is a useful default which helps finding memory leaks. EventEmitter.defaultMaxListeners = 10; // Obviously not all Emitters should be limited to 10. This function allows // that to be increased. Set to zero for unlimited. EventEmitter.prototype.setMaxListeners = function(n) { if (!isNumber(n) || n < 0 || isNaN(n)) throw TypeError('n must be a positive number'); this._maxListeners = n; return this; }; EventEmitter.prototype.emit = function(type) { var er, handler, len, args, i, listeners; if (!this._events) this._events = {}; // If there is no 'error' event listener then throw. if (type === 'error') { if (!this._events.error || (isObject(this._events.error) && !this._events.error.length)) { er = arguments[1]; if (er instanceof Error) { throw er; // Unhandled 'error' event } else { // At least give some kind of context to the user var err = new Error('Uncaught, unspecified "error" event. (' + er + ')'); err.context = er; throw err; } } } handler = this._events[type]; if (isUndefined(handler)) return false; if (isFunction(handler)) { switch (arguments.length) { // fast cases case 1: handler.call(this); break; case 2: handler.call(this, arguments[1]); break; case 3: handler.call(this, arguments[1], arguments[2]); break; // slower default: args = Array.prototype.slice.call(arguments, 1); handler.apply(this, args); } } else if (isObject(handler)) { args = Array.prototype.slice.call(arguments, 1); listeners = handler.slice(); len = listeners.length; for (i = 0; i < len; i++) listeners[i].apply(this, args); } return true; }; EventEmitter.prototype.addListener = function(type, listener) { var m; if (!isFunction(listener)) throw TypeError('listener must be a function'); if (!this._events) this._events = {}; // To avoid recursion in the case that type === "newListener"! Before // adding it to the listeners, first emit "newListener". if (this._events.newListener) this.emit('newListener', type, isFunction(listener.listener) ? listener.listener : listener); if (!this._events[type]) // Optimize the case of one listener. Don't need the extra array object. this._events[type] = listener; else if (isObject(this._events[type])) // If we've already got an array, just append. this._events[type].push(listener); else // Adding the second element, need to change to array. this._events[type] = [this._events[type], listener]; // Check for listener leak if (isObject(this._events[type]) && !this._events[type].warned) { if (!isUndefined(this._maxListeners)) { m = this._maxListeners; } else { m = EventEmitter.defaultMaxListeners; } if (m && m > 0 && this._events[type].length > m) { this._events[type].warned = true; console.error('(node) warning: possible EventEmitter memory ' + 'leak detected. %d listeners added. ' + 'Use emitter.setMaxListeners() to increase limit.', this._events[type].length); if (typeof console.trace === 'function') { // not supported in IE 10 console.trace(); } } } return this; }; EventEmitter.prototype.on = EventEmitter.prototype.addListener; EventEmitter.prototype.once = function(type, listener) { if (!isFunction(listener)) throw TypeError('listener must be a function'); var fired = false; function g() { this.removeListener(type, g); if (!fired) { fired = true; listener.apply(this, arguments); } } g.listener = listener; this.on(type, g); return this; }; // emits a 'removeListener' event iff the listener was removed EventEmitter.prototype.removeListener = function(type, listener) { var list, position, length, i; if (!isFunction(listener)) throw TypeError('listener must be a function'); if (!this._events || !this._events[type]) return this; list = this._events[type]; length = list.length; position = -1; if (list === listener || (isFunction(list.listener) && list.listener === listener)) { delete this._events[type]; if (this._events.removeListener) this.emit('removeListener', type, listener); } else if (isObject(list)) { for (i = length; i-- > 0;) { if (list[i] === listener || (list[i].listener && list[i].listener === listener)) { position = i; break; } } if (position < 0) return this; if (list.length === 1) { list.length = 0; delete this._events[type]; } else { list.splice(position, 1); } if (this._events.removeListener) this.emit('removeListener', type, listener); } return this; }; EventEmitter.prototype.removeAllListeners = function(type) { var key, listeners; if (!this._events) return this; // not listening for removeListener, no need to emit if (!this._events.removeListener) { if (arguments.length === 0) this._events = {}; else if (this._events[type]) delete this._events[type]; return this; } // emit removeListener for all listeners on all events if (arguments.length === 0) { for (key in this._events) { if (key === 'removeListener') continue; this.removeAllListeners(key); } this.removeAllListeners('removeListener'); this._events = {}; return this; } listeners = this._events[type]; if (isFunction(listeners)) { this.removeListener(type, listeners); } else if (listeners) { // LIFO order while (listeners.length) this.removeListener(type, listeners[listeners.length - 1]); } delete this._events[type]; return this; }; EventEmitter.prototype.listeners = function(type) { var ret; if (!this._events || !this._events[type]) ret = []; else if (isFunction(this._events[type])) ret = [this._events[type]]; else ret = this._events[type].slice(); return ret; }; EventEmitter.prototype.listenerCount = function(type) { if (this._events) { var evlistener = this._events[type]; if (isFunction(evlistener)) return 1; else if (evlistener) return evlistener.length; } return 0; }; EventEmitter.listenerCount = function(emitter, type) { return emitter.listenerCount(type); }; function isFunction(arg) { return typeof arg === 'function'; } function isNumber(arg) { return typeof arg === 'number'; } function isObject(arg) { return typeof arg === 'object' && arg !== null; } function isUndefined(arg) { return arg === void 0; } },{}],5:[function(require,module,exports){ var hasOwn = Object.prototype.hasOwnProperty; var toString = Object.prototype.toString; module.exports = function forEach (obj, fn, ctx) { if (toString.call(fn) !== '[object Function]') { throw new TypeError('iterator must be a function'); } var l = obj.length; if (l === +l) { for (var i = 0; i < l; i++) { fn.call(ctx, obj[i], i, obj); } } else { for (var k in obj) { if (hasOwn.call(obj, k)) { fn.call(ctx, obj[k], k, obj); } } } }; },{}],6:[function(require,module,exports){ (function (global){ var win; if (typeof window !== "undefined") { win = window; } else if (typeof global !== "undefined") { win = global; } else if (typeof self !== "undefined"){ win = self; } else { win = {}; } module.exports = win; }).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {}) },{}],7:[function(require,module,exports){ if (typeof Object.create === 'function') { // implementation from standard node.js 'util' module module.exports = function inherits(ctor, superCtor) { ctor.super_ = superCtor ctor.prototype = Object.create(superCtor.prototype, { constructor: { value: ctor, enumerable: false, writable: true, configurable: true } }); }; } else { // old school shim for old browsers module.exports = function inherits(ctor, superCtor) { ctor.super_ = superCtor var TempCtor = function () {} TempCtor.prototype = superCtor.prototype ctor.prototype = new TempCtor() ctor.prototype.constructor = ctor } } },{}],8:[function(require,module,exports){ var toString = {}.toString; module.exports = Array.isArray || function (arr) { return toString.call(arr) == '[object Array]'; }; },{}],9:[function(require,module,exports){ /** * Helpers. */ var s = 1000; var m = s * 60; var h = m * 60; var d = h * 24; var y = d * 365.25; /** * Parse or format the given `val`. * * Options: * * - `long` verbose formatting [false] * * @param {String|Number} val * @param {Object} [options] * @throws {Error} throw an error if val is not a non-empty string or a number * @return {String|Number} * @api public */ module.exports = function(val, options) { options = options || {}; var type = typeof val; if (type === 'string' && val.length > 0) { return parse(val); } else if (type === 'number' && isNaN(val) === false) { return options.long ? fmtLong(val) : fmtShort(val); } throw new Error( 'val is not a non-empty string or a valid number. val=' + JSON.stringify(val) ); }; /** * Parse the given `str` and return milliseconds. * * @param {String} str * @return {Number} * @api private */ function parse(str) { str = String(str); if (str.length > 100) { return; } var match = /^((?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|years?|yrs?|y)?$/i.exec( str ); if (!match) { return; } var n = parseFloat(match[1]); var type = (match[2] || 'ms').toLowerCase(); switch (type) { case 'years': case 'year': case 'yrs': case 'yr': case 'y': return n * y; case 'days': case 'day': case 'd': return n * d; case 'hours': case 'hour': case 'hrs': case 'hr': case 'h': return n * h; case 'minutes': case 'minute': case 'mins': case 'min': case 'm': return n * m; case 'seconds': case 'second': case 'secs': case 'sec': case 's': return n * s; case 'milliseconds': case 'millisecond': case 'msecs': case 'msec': case 'ms': return n; default: return undefined; } } /** * Short format for `ms`. * * @param {Number} ms * @return {String} * @api private */ function fmtShort(ms) { if (ms >= d) { return Math.round(ms / d) + 'd'; } if (ms >= h) { return Math.round(ms / h) + 'h'; } if (ms >= m) { return Math.round(ms / m) + 'm'; } if (ms >= s) { return Math.round(ms / s) + 's'; } return ms + 'ms'; } /** * Long format for `ms`. * * @param {Number} ms * @return {String} * @api private */ function fmtLong(ms) { return plural(ms, d, 'day') || plural(ms, h, 'hour') || plural(ms, m, 'minute') || plural(ms, s, 'second') || ms + ' ms'; } /** * Pluralization helper. */ function plural(ms, n, name) { if (ms < n) { return; } if (ms < n * 1.5) { return Math.floor(ms / n) + ' ' + name; } return Math.ceil(ms / n) + ' ' + name + 's'; } },{}],10:[function(require,module,exports){ 'use strict'; // modified from https://github.com/es-shims/es5-shim var has = Object.prototype.hasOwnProperty; var toStr = Object.prototype.toString; var slice = Array.prototype.slice; var isArgs = require(11); var isEnumerable = Object.prototype.propertyIsEnumerable; var hasDontEnumBug = !isEnumerable.call({ toString: null }, 'toString'); var hasProtoEnumBug = isEnumerable.call(function () {}, 'prototype'); var dontEnums = [ 'toString', 'toLocaleString', 'valueOf', 'hasOwnProperty', 'isPrototypeOf', 'propertyIsEnumerable', 'constructor' ]; var equalsConstructorPrototype = function (o) { var ctor = o.constructor; return ctor && ctor.prototype === o; }; var excludedKeys = { $console: true, $external: true, $frame: true, $frameElement: true, $frames: true, $innerHeight: true, $innerWidth: true, $outerHeight: true, $outerWidth: true, $pageXOffset: true, $pageYOffset: true, $parent: true, $scrollLeft: true, $scrollTop: true, $scrollX: true, $scrollY: true, $self: true, $webkitIndexedDB: true, $webkitStorageInfo: true, $window: true }; var hasAutomationEqualityBug = (function () { /* global window */ if (typeof window === 'undefined') { return false; } for (var k in window) { try { if (!excludedKeys['$' + k] && has.call(window, k) && window[k] !== null && typeof window[k] === 'object') { try { equalsConstructorPrototype(window[k]); } catch (e) { return true; } } } catch (e) { return true; } } return false; }()); var equalsConstructorPrototypeIfNotBuggy = function (o) { /* global window */ if (typeof window === 'undefined' || !hasAutomationEqualityBug) { return equalsConstructorPrototype(o); } try { return equalsConstructorPrototype(o); } catch (e) { return false; } }; var keysShim = function keys(object) { var isObject = object !== null && typeof object === 'object'; var isFunction = toStr.call(object) === '[object Function]'; var isArguments = isArgs(object); var isString = isObject && toStr.call(object) === '[object String]'; var theKeys = []; if (!isObject && !isFunction && !isArguments) { throw new TypeError('Object.keys called on a non-object'); } var skipProto = hasProtoEnumBug && isFunction; if (isString && object.length > 0 && !has.call(object, 0)) { for (var i = 0; i < object.length; ++i) { theKeys.push(String(i)); } } if (isArguments && object.length > 0) { for (var j = 0; j < object.length; ++j) { theKeys.push(String(j)); } } else { for (var name in object) { if (!(skipProto && name === 'prototype') && has.call(object, name)) { theKeys.push(String(name)); } } } if (hasDontEnumBug) { var skipConstructor = equalsConstructorPrototypeIfNotBuggy(object); for (var k = 0; k < dontEnums.length; ++k) { if (!(skipConstructor && dontEnums[k] === 'constructor') && has.call(object, dontEnums[k])) { theKeys.push(dontEnums[k]); } } } return theKeys; }; keysShim.shim = function shimObjectKeys() { if (Object.keys) { var keysWorksWithArguments = (function () { // Safari 5.0 bug return (Object.keys(arguments) || '').length === 2; }(1, 2)); if (!keysWorksWithArguments) { var originalKeys = Object.keys; Object.keys = function keys(object) { if (isArgs(object)) { return originalKeys(slice.call(object)); } else { return originalKeys(object); } }; } } else { Object.keys = keysShim; } return Object.keys || keysShim; }; module.exports = keysShim; },{"11":11}],11:[function(require,module,exports){ 'use strict'; var toStr = Object.prototype.toString; module.exports = function isArguments(value) { var str = toStr.call(value); var isArgs = str === '[object Arguments]'; if (!isArgs) { isArgs = str !== '[object Array]' && value !== null && typeof value === 'object' && typeof value.length === 'number' && value.length >= 0 && toStr.call(value.callee) === '[object Function]'; } return isArgs; }; },{}],12:[function(require,module,exports){ // shim for using process in browser var process = module.exports = {}; // cached from whatever global is present so that test runners that stub it // don't break things. But we need to wrap it in a try catch in case it is // wrapped in strict mode code which doesn't define any globals. It's inside a // function because try/catches deoptimize in certain engines. var cachedSetTimeout; var cachedClearTimeout; function defaultSetTimout() { throw new Error('setTimeout has not been defined'); } function defaultClearTimeout () { throw new Error('clearTimeout has not been defined'); } (function () { try { if (typeof setTimeout === 'function') { cachedSetTimeout = setTimeout; } else { cachedSetTimeout = defaultSetTimout; } } catch (e) { cachedSetTimeout = defaultSetTimout; } try { if (typeof clearTimeout === 'function') { cachedClearTimeout = clearTimeout; } else { cachedClearTimeout = defaultClearTimeout; } } catch (e) { cachedClearTimeout = defaultClearTimeout; } } ()) function runTimeout(fun) { if (cachedSetTimeout === setTimeout) { //normal enviroments in sane situations return setTimeout(fun, 0); } // if setTimeout wasn't available but was latter defined if ((cachedSetTimeout === defaultSetTimout || !cachedSetTimeout) && setTimeout) { cachedSetTimeout = setTimeout; return setTimeout(fun, 0); } try { // when when somebody has screwed with setTimeout but no I.E. maddness return cachedSetTimeout(fun, 0); } catch(e){ try { // When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally return cachedSetTimeout.call(null, fun, 0); } catch(e){ // same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error return cachedSetTimeout.call(this, fun, 0); } } } function runClearTimeout(marker) { if (cachedClearTimeout === clearTimeout) { //normal enviroments in sane situations return clearTimeout(marker); } // if clearTimeout wasn't available but was latter defined if ((cachedClearTimeout === defaultClearTimeout || !cachedClearTimeout) && clearTimeout) { cachedClearTimeout = clearTimeout; return clearTimeout(marker); } try { // when when somebody has screwed with setTimeout but no I.E. maddness return cachedClearTimeout(marker); } catch (e){ try { // When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally return cachedClearTimeout.call(null, marker); } catch (e){ // same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error. // Some versions of I.E. have different rules for clearTimeout vs setTimeout return cachedClearTimeout.call(this, marker); } } } var queue = []; var draining = false; var currentQueue; var queueIndex = -1; function cleanUpNextTick() { if (!draining || !currentQueue) { return; } draining = false; if (currentQueue.length) { queue = currentQueue.concat(queue); } else { queueIndex = -1; } if (queue.length) { drainQueue(); } } function drainQueue() { if (draining) { return; } var timeout = runTimeout(cleanUpNextTick); draining = true; var len = queue.length; while(len) { currentQueue = queue; queue = []; while (++queueIndex < len) { if (currentQueue) { currentQueue[queueIndex].run(); } } queueIndex = -1; len = queue.length; } currentQueue = null; draining = false; runClearTimeout(timeout); } process.nextTick = function (fun) { var args = new Array(arguments.length - 1); if (arguments.length > 1) { for (var i = 1; i < arguments.length; i++) { args[i - 1] = arguments[i]; } } queue.push(new Item(fun, args)); if (queue.length === 1 && !draining) { runTimeout(drainQueue); } }; // v8 likes predictible objects function Item(fun, array) { this.fun = fun; this.array = array; } Item.prototype.run = function () { this.fun.apply(null, this.array); }; process.title = 'browser'; process.browser = true; process.env = {}; process.argv = []; process.version = ''; // empty string to avoid regexp issues process.versions = {}; function noop() {} process.on = noop; process.addListener = noop; process.once = noop; process.off = noop; process.removeListener = noop; process.removeAllListeners = noop; process.emit = noop; process.binding = function (name) { throw new Error('process.binding is not supported'); }; process.cwd = function () { return '/' }; process.chdir = function (dir) { throw new Error('process.chdir is not supported'); }; process.umask = function() { return 0; }; },{}],13:[function(require,module,exports){ // 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. 'use strict'; 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; }; },{}],14:[function(require,module,exports){ module.exports = AlgoliaSearch; var Index = require(16); var deprecate = require(26); var deprecatedMessage = require(27); var AlgoliaSearchCore = require(15); var inherits = require(7); var errors = require(28); function AlgoliaSearch() { AlgoliaSearchCore.apply(this, arguments); } inherits(AlgoliaSearch, AlgoliaSearchCore); /* * Delete an index * * @param indexName the name of index to delete * @param callback the result callback called with two arguments * error: null or Error('message') * content: the server answer that contains the task ID */ AlgoliaSearch.prototype.deleteIndex = function(indexName, callback) { return this._jsonRequest({ method: 'DELETE', url: '/1/indexes/' + encodeURIComponent(indexName), hostType: 'write', callback: callback }); }; /** * Move an existing index. * @param srcIndexName the name of index to copy. * @param dstIndexName the new index name that will contains a copy of * srcIndexName (destination will be overriten if it already exist). * @param callback the result callback called with two arguments * error: null or Error('message') * content: the server answer that contains the task ID */ AlgoliaSearch.prototype.moveIndex = function(srcIndexName, dstIndexName, callback) { var postObj = { operation: 'move', destination: dstIndexName }; return this._jsonRequest({ method: 'POST', url: '/1/indexes/' + encodeURIComponent(srcIndexName) + '/operation', body: postObj, hostType: 'write', callback: callback }); }; /** * Copy an existing index. * @param srcIndexName the name of index to copy. * @param dstIndexName the new index name that will contains a copy * of srcIndexName (destination will be overriten if it already exist). * @param callback the result callback called with two arguments * error: null or Error('message') * content: the server answer that contains the task ID */ AlgoliaSearch.prototype.copyIndex = function(srcIndexName, dstIndexName, callback) { var postObj = { operation: 'copy', destination: dstIndexName }; return this._jsonRequest({ method: 'POST', url: '/1/indexes/' + encodeURIComponent(srcIndexName) + '/operation', body: postObj, hostType: 'write', callback: callback }); }; /** * Return last log entries. * @param offset Specify the first entry to retrieve (0-based, 0 is the most recent log entry). * @param length Specify the maximum number of entries to retrieve starting * at offset. Maximum allowed value: 1000. * @param type Specify the maximum number of entries to retrieve starting * at offset. Maximum allowed value: 1000. * @param callback the result callback called with two arguments * error: null or Error('message') * content: the server answer that contains the task ID */ AlgoliaSearch.prototype.getLogs = function(offset, length, callback) { var clone = require(25); var params = {}; if (typeof offset === 'object') { // getLogs(params) params = clone(offset); callback = length; } else if (arguments.length === 0 || typeof offset === 'function') { // getLogs([cb]) callback = offset; } else if (arguments.length === 1 || typeof length === 'function') { // getLogs(1, [cb)] callback = length; params.offset = offset; } else { // getLogs(1, 2, [cb]) params.offset = offset; params.length = length; } if (params.offset === undefined) params.offset = 0; if (params.length === undefined) params.length = 10; return this._jsonRequest({ method: 'GET', url: '/1/logs?' + this._getSearchParams(params, ''), hostType: 'read', callback: callback }); }; /* * List all existing indexes (paginated) * * @param page The page to retrieve, starting at 0. * @param callback the result callback called with two arguments * error: null or Error('message') * content: the server answer with index list */ AlgoliaSearch.prototype.listIndexes = function(page, callback) { var params = ''; if (page === undefined || typeof page === 'function') { callback = page; } else { params = '?page=' + page; } return this._jsonRequest({ method: 'GET', url: '/1/indexes' + params, hostType: 'read', callback: callback }); }; /* * Get the index object initialized * * @param indexName the name of index * @param callback the result callback with one argument (the Index instance) */ AlgoliaSearch.prototype.initIndex = function(indexName) { return new Index(this, indexName); }; /* * @deprecated use client.listApiKeys */ AlgoliaSearch.prototype.listUserKeys = deprecate(function(callback) { return this.listApiKeys(callback); }, deprecatedMessage('client.listUserKeys()', 'client.listApiKeys()')); /* * List all existing api keys with their associated ACLs * * @param callback the result callback called with two arguments * error: null or Error('message') * content: the server answer with api keys list */ AlgoliaSearch.prototype.listApiKeys = function(callback) { return this._jsonRequest({ method: 'GET', url: '/1/keys', hostType: 'read', callback: callback }); }; /* * @deprecated see client.getApiKey */ AlgoliaSearch.prototype.getUserKeyACL = deprecate(function(key, callback) { return this.getApiKey(key, callback); }, deprecatedMessage('client.getUserKeyACL()', 'client.getApiKey()')); /* * Get an API key * * @param key * @param callback the result callback called with two arguments * error: null or Error('message') * content: the server answer with the right API key */ AlgoliaSearch.prototype.getApiKey = function(key, callback) { return this._jsonRequest({ method: 'GET', url: '/1/keys/' + key, hostType: 'read', callback: callback }); }; /* * @deprecated see client.deleteApiKey */ AlgoliaSearch.prototype.deleteUserKey = deprecate(function(key, callback) { return this.deleteApiKey(key, callback); }, deprecatedMessage('client.deleteUserKey()', 'client.deleteApiKey()')); /* * Delete an existing API key * @param key * @param callback the result callback called with two arguments * error: null or Error('message') * content: the server answer with the date of deletion */ AlgoliaSearch.prototype.deleteApiKey = function(key, callback) { return this._jsonRequest({ method: 'DELETE', url: '/1/keys/' + key, hostType: 'write', callback: callback }); }; /* @deprecated see client.addApiKey */ AlgoliaSearch.prototype.addUserKey = deprecate(function(acls, params, callback) { return this.addApiKey(acls, params, callback); }, deprecatedMessage('client.addUserKey()', 'client.addApiKey()')); /* * Add a new global API key * * @param {string[]} acls - The list of ACL for this key. Defined by an array of strings that * can contains the following values: * - search: allow to search (https and http) * - addObject: allows to add/update an object in the index (https only) * - deleteObject : allows to delete an existing object (https only) * - deleteIndex : allows to delete index content (https only) * - settings : allows to get index settings (https only) * - editSettings : allows to change index settings (https only) * @param {Object} [params] - Optionnal parameters to set for the key * @param {number} params.validity - Number of seconds after which the key will be automatically removed (0 means no time limit for this key) * @param {number} params.maxQueriesPerIPPerHour - Number of API calls allowed from an IP address per hour * @param {number} params.maxHitsPerQuery - Number of hits this API key can retrieve in one call * @param {string[]} params.indexes - Allowed targeted indexes for this key * @param {string} params.description - A description for your key * @param {string[]} params.referers - A list of authorized referers * @param {Object} params.queryParameters - Force the key to use specific query parameters * @param {Function} callback - The result callback called with two arguments * error: null or Error('message') * content: the server answer with the added API key * @return {Promise|undefined} Returns a promise if no callback given * @example * client.addUserKey(['search'], { * validity: 300, * maxQueriesPerIPPerHour: 2000, * maxHitsPerQuery: 3, * indexes: ['fruits'], * description: 'Eat three fruits', * referers: ['*.algolia.com'], * queryParameters: { * tagFilters: ['public'], * } * }) * @see {@link https://www.algolia.com/doc/rest_api#AddKey|Algolia REST API Documentation} */ AlgoliaSearch.prototype.addApiKey = function(acls, params, callback) { var isArray = require(8); var usage = 'Usage: client.addApiKey(arrayOfAcls[, params, callback])'; if (!isArray(acls)) { throw new Error(usage); } if (arguments.length === 1 || typeof params === 'function') { callback = params; params = null; } var postObj = { acl: acls }; if (params) { postObj.validity = params.validity; postObj.maxQueriesPerIPPerHour = params.maxQueriesPerIPPerHour; postObj.maxHitsPerQuery = params.maxHitsPerQuery; postObj.indexes = params.indexes; postObj.description = params.description; if (params.queryParameters) { postObj.queryParameters = this._getSearchParams(params.queryParameters, ''); } postObj.referers = params.referers; } return this._jsonRequest({ method: 'POST', url: '/1/keys', body: postObj, hostType: 'write', callback: callback }); }; /** * @deprecated Please use client.addApiKey() */ AlgoliaSearch.prototype.addUserKeyWithValidity = deprecate(function(acls, params, callback) { return this.addApiKey(acls, params, callback); }, deprecatedMessage('client.addUserKeyWithValidity()', 'client.addApiKey()')); /** * @deprecated Please use client.updateApiKey() */ AlgoliaSearch.prototype.updateUserKey = deprecate(function(key, acls, params, callback) { return this.updateApiKey(key, acls, params, callback); }, deprecatedMessage('client.updateUserKey()', 'client.updateApiKey()')); /** * Update an existing API key * @param {string} key - The key to update * @param {string[]} acls - The list of ACL for this key. Defined by an array of strings that * can contains the following values: * - search: allow to search (https and http) * - addObject: allows to add/update an object in the index (https only) * - deleteObject : allows to delete an existing object (https only) * - deleteIndex : allows to delete index content (https only) * - settings : allows to get index settings (https only) * - editSettings : allows to change index settings (https only) * @param {Object} [params] - Optionnal parameters to set for the key * @param {number} params.validity - Number of seconds after which the key will be automatically removed (0 means no time limit for this key) * @param {number} params.maxQueriesPerIPPerHour - Number of API calls allowed from an IP address per hour * @param {number} params.maxHitsPerQuery - Number of hits this API key can retrieve in one call * @param {string[]} params.indexes - Allowed targeted indexes for this key * @param {string} params.description - A description for your key * @param {string[]} params.referers - A list of authorized referers * @param {Object} params.queryParameters - Force the key to use specific query parameters * @param {Function} callback - The result callback called with two arguments * error: null or Error('message') * content: the server answer with the modified API key * @return {Promise|undefined} Returns a promise if no callback given * @example * client.updateApiKey('APIKEY', ['search'], { * validity: 300, * maxQueriesPerIPPerHour: 2000, * maxHitsPerQuery: 3, * indexes: ['fruits'], * description: 'Eat three fruits', * referers: ['*.algolia.com'], * queryParameters: { * tagFilters: ['public'], * } * }) * @see {@link https://www.algolia.com/doc/rest_api#UpdateIndexKey|Algolia REST API Documentation} */ AlgoliaSearch.prototype.updateApiKey = function(key, acls, params, callback) { var isArray = require(8); var usage = 'Usage: client.updateApiKey(key, arrayOfAcls[, params, callback])'; if (!isArray(acls)) { throw new Error(usage); } if (arguments.length === 2 || typeof params === 'function') { callback = params; params = null; } var putObj = { acl: acls }; if (params) { putObj.validity = params.validity; putObj.maxQueriesPerIPPerHour = params.maxQueriesPerIPPerHour; putObj.maxHitsPerQuery = params.maxHitsPerQuery; putObj.indexes = params.indexes; putObj.description = params.description; if (params.queryParameters) { putObj.queryParameters = this._getSearchParams(params.queryParameters, ''); } putObj.referers = params.referers; } return this._jsonRequest({ method: 'PUT', url: '/1/keys/' + key, body: putObj, hostType: 'write', callback: callback }); }; /** * Initialize a new batch of search queries * @deprecated use client.search() */ AlgoliaSearch.prototype.startQueriesBatch = deprecate(function startQueriesBatchDeprecated() { this._batch = []; }, deprecatedMessage('client.startQueriesBatch()', 'client.search()')); /** * Add a search query in the batch * @deprecated use client.search() */ AlgoliaSearch.prototype.addQueryInBatch = deprecate(function addQueryInBatchDeprecated(indexName, query, args) { this._batch.push({ indexName: indexName, query: query, params: args }); }, deprecatedMessage('client.addQueryInBatch()', 'client.search()')); /** * Launch the batch of queries using XMLHttpRequest. * @deprecated use client.search() */ AlgoliaSearch.prototype.sendQueriesBatch = deprecate(function sendQueriesBatchDeprecated(callback) { return this.search(this._batch, callback); }, deprecatedMessage('client.sendQueriesBatch()', 'client.search()')); /** * Perform write operations accross multiple indexes. * * To reduce the amount of time spent on network round trips, * you can create, update, or delete several objects in one call, * using the batch endpoint (all operations are done in the given order). * * Available actions: * - addObject * - updateObject * - partialUpdateObject * - partialUpdateObjectNoCreate * - deleteObject * * https://www.algolia.com/doc/rest_api#Indexes * @param {Object[]} operations An array of operations to perform * @return {Promise|undefined} Returns a promise if no callback given * @example * client.batch([{ * action: 'addObject', * indexName: 'clients', * body: { * name: 'Bill' * } * }, { * action: 'udpateObject', * indexName: 'fruits', * body: { * objectID: '29138', * name: 'banana' * } * }], cb) */ AlgoliaSearch.prototype.batch = function(operations, callback) { var isArray = require(8); var usage = 'Usage: client.batch(operations[, callback])'; if (!isArray(operations)) { throw new Error(usage); } return this._jsonRequest({ method: 'POST', url: '/1/indexes/*/batch', body: { requests: operations }, hostType: 'write', callback: callback }); }; // environment specific methods AlgoliaSearch.prototype.destroy = notImplemented; AlgoliaSearch.prototype.enableRateLimitForward = notImplemented; AlgoliaSearch.prototype.disableRateLimitForward = notImplemented; AlgoliaSearch.prototype.useSecuredAPIKey = notImplemented; AlgoliaSearch.prototype.disableSecuredAPIKey = notImplemented; AlgoliaSearch.prototype.generateSecuredApiKey = notImplemented; function notImplemented() { var message = 'Not implemented in this environment.\n' + 'If you feel this is a mistake, write to support@algolia.com'; throw new errors.AlgoliaSearchError(message); } },{"15":15,"16":16,"25":25,"26":26,"27":27,"28":28,"7":7,"8":8}],15:[function(require,module,exports){ (function (process){ module.exports = AlgoliaSearchCore; var errors = require(28); var exitPromise = require(29); var IndexCore = require(18); var store = require(34); // We will always put the API KEY in the JSON body in case of too long API KEY, // to avoid query string being too long and failing in various conditions (our server limit, browser limit, // proxies limit) var MAX_API_KEY_LENGTH = 500; var RESET_APP_DATA_TIMER = process.env.RESET_APP_DATA_TIMER && parseInt(process.env.RESET_APP_DATA_TIMER, 10) || 60 * 2 * 1000; // after 2 minutes reset to first host /* * Algolia Search library initialization * https://www.algolia.com/ * * @param {string} applicationID - Your applicationID, found in your dashboard * @param {string} apiKey - Your API key, found in your dashboard * @param {Object} [opts] * @param {number} [opts.timeout=2000] - The request timeout set in milliseconds, * another request will be issued after this timeout * @param {string} [opts.protocol='http:'] - The protocol used to query Algolia Search API. * Set to 'https:' to force using https. * Default to document.location.protocol in browsers * @param {Object|Array} [opts.hosts={ * read: [this.applicationID + '-dsn.algolia.net'].concat([ * this.applicationID + '-1.algolianet.com', * this.applicationID + '-2.algolianet.com', * this.applicationID + '-3.algolianet.com'] * ]), * write: [this.applicationID + '.algolia.net'].concat([ * this.applicationID + '-1.algolianet.com', * this.applicationID + '-2.algolianet.com', * this.applicationID + '-3.algolianet.com'] * ]) - The hosts to use for Algolia Search API. * If you provide them, you will less benefit from our HA implementation */ function AlgoliaSearchCore(applicationID, apiKey, opts) { var debug = require(1)('algoliasearch'); var clone = require(25); var isArray = require(8); var map = require(30); var usage = 'Usage: algoliasearch(applicationID, apiKey, opts)'; if (opts._allowEmptyCredentials !== true && !applicationID) { throw new errors.AlgoliaSearchError('Please provide an application ID. ' + usage); } if (opts._allowEmptyCredentials !== true && !apiKey) { throw new errors.AlgoliaSearchError('Please provide an API key. ' + usage); } this.applicationID = applicationID; this.apiKey = apiKey; this.hosts = { read: [], write: [] }; opts = opts || {}; var protocol = opts.protocol || 'https:'; this._timeouts = opts.timeouts || { connect: 1 * 1000, // 500ms connect is GPRS latency read: 2 * 1000, write: 30 * 1000 }; // backward compat, if opts.timeout is passed, we use it to configure all timeouts like before if (opts.timeout) { this._timeouts.connect = this._timeouts.read = this._timeouts.write = opts.timeout; } // while we advocate for colon-at-the-end values: 'http:' for `opts.protocol` // we also accept `http` and `https`. It's a common error. if (!/:$/.test(protocol)) { protocol = protocol + ':'; } if (opts.protocol !== 'http:' && opts.protocol !== 'https:') { throw new errors.AlgoliaSearchError('protocol must be `http:` or `https:` (was `' + opts.protocol + '`)'); } this._checkAppIdData(); if (!opts.hosts) { var defaultHosts = map(this._shuffleResult, function(hostNumber) { return applicationID + '-' + hostNumber + '.algolianet.com'; }); // no hosts given, compute defaults this.hosts.read = [this.applicationID + '-dsn.algolia.net'].concat(defaultHosts); this.hosts.write = [this.applicationID + '.algolia.net'].concat(defaultHosts); } else if (isArray(opts.hosts)) { // when passing custom hosts, we need to have a different host index if the number // of write/read hosts are different. this.hosts.read = clone(opts.hosts); this.hosts.write = clone(opts.hosts); } else { this.hosts.read = clone(opts.hosts.read); this.hosts.write = clone(opts.hosts.write); } // add protocol and lowercase hosts this.hosts.read = map(this.hosts.read, prepareHost(protocol)); this.hosts.write = map(this.hosts.write, prepareHost(protocol)); this.extraHeaders = {}; // In some situations you might want to warm the cache this.cache = opts._cache || {}; this._ua = opts._ua; this._useCache = opts._useCache === undefined || opts._cache ? true : opts._useCache; this._useFallback = opts.useFallback === undefined ? true : opts.useFallback; this._setTimeout = opts._setTimeout; debug('init done, %j', this); } /* * Get the index object initialized * * @param indexName the name of index * @param callback the result callback with one argument (the Index instance) */ AlgoliaSearchCore.prototype.initIndex = function(indexName) { return new IndexCore(this, indexName); }; /** * Add an extra field to the HTTP request * * @param name the header field name * @param value the header field value */ AlgoliaSearchCore.prototype.setExtraHeader = function(name, value) { this.extraHeaders[name.toLowerCase()] = value; }; /** * Get the value of an extra HTTP header * * @param name the header field name */ AlgoliaSearchCore.prototype.getExtraHeader = function(name) { return this.extraHeaders[name.toLowerCase()]; }; /** * Remove an extra field from the HTTP request * * @param name the header field name */ AlgoliaSearchCore.prototype.unsetExtraHeader = function(name) { delete this.extraHeaders[name.toLowerCase()]; }; /** * Augment sent x-algolia-agent with more data, each agent part * is automatically separated from the others by a semicolon; * * @param algoliaAgent the agent to add */ AlgoliaSearchCore.prototype.addAlgoliaAgent = function(algoliaAgent) { if (this._ua.indexOf(';' + algoliaAgent) === -1) { this._ua += ';' + algoliaAgent; } }; /* * Wrapper that try all hosts to maximize the quality of service */ AlgoliaSearchCore.prototype._jsonRequest = function(initialOpts) { this._checkAppIdData(); var requestDebug = require(1)('algoliasearch:' + initialOpts.url); var body; var additionalUA = initialOpts.additionalUA || ''; var cache = initialOpts.cache; var client = this; var tries = 0; var usingFallback = false; var hasFallback = client._useFallback && client._request.fallback && initialOpts.fallback; var headers; if ( this.apiKey.length > MAX_API_KEY_LENGTH && initialOpts.body !== undefined && (initialOpts.body.params !== undefined || // index.search() initialOpts.body.requests !== undefined) // client.search() ) { initialOpts.body.apiKey = this.apiKey; headers = this._computeRequestHeaders(additionalUA, false); } else { headers = this._computeRequestHeaders(additionalUA); } if (initialOpts.body !== undefined) { body = safeJSONStringify(initialOpts.body); } requestDebug('request start'); var debugData = []; function doRequest(requester, reqOpts) { client._checkAppIdData(); var startTime = new Date(); var cacheID; if (client._useCache) { cacheID = initialOpts.url; } // as we sometime use POST requests to pass parameters (like query='aa'), // the cacheID must also include the body to be different between calls if (client._useCache && body) { cacheID += '_body_' + reqOpts.body; } // handle cache existence if (client._useCache && cache && cache[cacheID] !== undefined) { requestDebug('serving response from cache'); return client._promise.resolve(JSON.parse(cache[cacheID])); } // if we reached max tries if (tries >= client.hosts[initialOpts.hostType].length) { if (!hasFallback || usingFallback) { requestDebug('could not get any response'); // then stop return client._promise.reject(new errors.AlgoliaSearchError( 'Cannot connect to the AlgoliaSearch API.' + ' Send an email to support@algolia.com to report and resolve the issue.' + ' Application id was: ' + client.applicationID, {debugData: debugData} )); } requestDebug('switching to fallback'); // let's try the fallback starting from here tries = 0; // method, url and body are fallback dependent reqOpts.method = initialOpts.fallback.method; reqOpts.url = initialOpts.fallback.url; reqOpts.jsonBody = initialOpts.fallback.body; if (reqOpts.jsonBody) { reqOpts.body = safeJSONStringify(reqOpts.jsonBody); } // re-compute headers, they could be omitting the API KEY headers = client._computeRequestHeaders(additionalUA); reqOpts.timeouts = client._getTimeoutsForRequest(initialOpts.hostType); client._setHostIndexByType(0, initialOpts.hostType); usingFallback = true; // the current request is now using fallback return doRequest(client._request.fallback, reqOpts); } var currentHost = client._getHostByType(initialOpts.hostType); var url = currentHost + reqOpts.url; var options = { body: reqOpts.body, jsonBody: reqOpts.jsonBody, method: reqOpts.method, headers: headers, timeouts: reqOpts.timeouts, debug: requestDebug }; requestDebug('method: %s, url: %s, headers: %j, timeouts: %d', options.method, url, options.headers, options.timeouts); if (requester === client._request.fallback) { requestDebug('using fallback'); } // `requester` is any of this._request or this._request.fallback // thus it needs to be called using the client as context return requester.call(client, url, options).then(success, tryFallback); function success(httpResponse) { // compute the status of the response, // // When in browser mode, using XDR or JSONP, we have no statusCode available // So we rely on our API response `status` property. // But `waitTask` can set a `status` property which is not the statusCode (it's the task status) // So we check if there's a `message` along `status` and it means it's an error // // That's the only case where we have a response.status that's not the http statusCode var status = httpResponse && httpResponse.body && httpResponse.body.message && httpResponse.body.status || // this is important to check the request statusCode AFTER the body eventual // statusCode because some implementations (jQuery XDomainRequest transport) may // send statusCode 200 while we had an error httpResponse.statusCode || // When in browser mode, using XDR or JSONP // we default to success when no error (no response.status && response.message) // If there was a JSON.parse() error then body is null and it fails httpResponse && httpResponse.body && 200; requestDebug('received response: statusCode: %s, computed statusCode: %d, headers: %j', httpResponse.statusCode, status, httpResponse.headers); var httpResponseOk = Math.floor(status / 100) === 2; var endTime = new Date(); debugData.push({ currentHost: currentHost, headers: removeCredentials(headers), content: body || null, contentLength: body !== undefined ? body.length : null, method: reqOpts.method, timeouts: reqOpts.timeouts, url: reqOpts.url, startTime: startTime, endTime: endTime, duration: endTime - startTime, statusCode: status }); if (httpResponseOk) { if (client._useCache && cache) { cache[cacheID] = httpResponse.responseText; } return httpResponse.body; } var shouldRetry = Math.floor(status / 100) !== 4; if (shouldRetry) { tries += 1; return retryRequest(); } requestDebug('unrecoverable error'); // no success and no retry => fail var unrecoverableError = new errors.AlgoliaSearchError( httpResponse.body && httpResponse.body.message, {debugData: debugData, statusCode: status} ); return client._promise.reject(unrecoverableError); } function tryFallback(err) { // error cases: // While not in fallback mode: // - CORS not supported // - network error // While in fallback mode: // - timeout // - network error // - badly formatted JSONP (script loaded, did not call our callback) // In both cases: // - uncaught exception occurs (TypeError) requestDebug('error: %s, stack: %s', err.message, err.stack); var endTime = new Date(); debugData.push({ currentHost: currentHost, headers: removeCredentials(headers), content: body || null, contentLength: body !== undefined ? body.length : null, method: reqOpts.method, timeouts: reqOpts.timeouts, url: reqOpts.url, startTime: startTime, endTime: endTime, duration: endTime - startTime }); if (!(err instanceof errors.AlgoliaSearchError)) { err = new errors.Unknown(err && err.message, err); } tries += 1; // stop the request implementation when: if ( // we did not generate this error, // it comes from a throw in some other piece of code err instanceof errors.Unknown || // server sent unparsable JSON err instanceof errors.UnparsableJSON || // max tries and already using fallback or no fallback tries >= client.hosts[initialOpts.hostType].length && (usingFallback || !hasFallback)) { // stop request implementation for this command err.debugData = debugData; return client._promise.reject(err); } // When a timeout occured, retry by raising timeout if (err instanceof errors.RequestTimeout) { return retryRequestWithHigherTimeout(); } return retryRequest(); } function retryRequest() { requestDebug('retrying request'); client._incrementHostIndex(initialOpts.hostType); return doRequest(requester, reqOpts); } function retryRequestWithHigherTimeout() { requestDebug('retrying request with higher timeout'); client._incrementHostIndex(initialOpts.hostType); client._incrementTimeoutMultipler(); reqOpts.timeouts = client._getTimeoutsForRequest(initialOpts.hostType); return doRequest(requester, reqOpts); } } var promise = doRequest( client._request, { url: initialOpts.url, method: initialOpts.method, body: body, jsonBody: initialOpts.body, timeouts: client._getTimeoutsForRequest(initialOpts.hostType) } ); // either we have a callback // either we are using promises if (typeof initialOpts.callback === 'function') { promise.then(function okCb(content) { exitPromise(function() { initialOpts.callback(null, content); }, client._setTimeout || setTimeout); }, function nookCb(err) { exitPromise(function() { initialOpts.callback(err); }, client._setTimeout || setTimeout); }); } else { return promise; } }; /* * Transform search param object in query string * @param {object} args arguments to add to the current query string * @param {string} params current query string * @return {string} the final query string */ AlgoliaSearchCore.prototype._getSearchParams = function(args, params) { if (args === undefined || args === null) { return params; } for (var key in args) { if (key !== null && args[key] !== undefined && args.hasOwnProperty(key)) { params += params === '' ? '' : '&'; params += key + '=' + encodeURIComponent(Object.prototype.toString.call(args[key]) === '[object Array]' ? safeJSONStringify(args[key]) : args[key]); } } return params; }; AlgoliaSearchCore.prototype._computeRequestHeaders = function(additionalUA, withAPIKey) { var forEach = require(5); var ua = additionalUA ? this._ua + ';' + additionalUA : this._ua; var requestHeaders = { 'x-algolia-agent': ua, 'x-algolia-application-id': this.applicationID }; // browser will inline headers in the url, node.js will use http headers // but in some situations, the API KEY will be too long (big secured API keys) // so if the request is a POST and the KEY is very long, we will be asked to not put // it into headers but in the JSON body if (withAPIKey !== false) { requestHeaders['x-algolia-api-key'] = this.apiKey; } if (this.userToken) { requestHeaders['x-algolia-usertoken'] = this.userToken; } if (this.securityTags) { requestHeaders['x-algolia-tagfilters'] = this.securityTags; } forEach(this.extraHeaders, function addToRequestHeaders(value, key) { requestHeaders[key] = value; }); return requestHeaders; }; /** * Search through multiple indices at the same time * @param {Object[]} queries An array of queries you want to run. * @param {string} queries[].indexName The index name you want to target * @param {string} [queries[].query] The query to issue on this index. Can also be passed into `params` * @param {Object} queries[].params Any search param like hitsPerPage, .. * @param {Function} callback Callback to be called * @return {Promise|undefined} Returns a promise if no callback given */ AlgoliaSearchCore.prototype.search = function(queries, opts, callback) { var isArray = require(8); var map = require(30); var usage = 'Usage: client.search(arrayOfQueries[, callback])'; if (!isArray(queries)) { throw new Error(usage); } if (typeof opts === 'function') { callback = opts; opts = {}; } else if (opts === undefined) { opts = {}; } var client = this; var postObj = { requests: map(queries, function prepareRequest(query) { var params = ''; // allow query.query // so we are mimicing the index.search(query, params) method // {indexName:, query:, params:} if (query.query !== undefined) { params += 'query=' + encodeURIComponent(query.query); } return { indexName: query.indexName, params: client._getSearchParams(query.params, params) }; }) }; var JSONPParams = map(postObj.requests, function prepareJSONPParams(request, requestId) { return requestId + '=' + encodeURIComponent( '/1/indexes/' + encodeURIComponent(request.indexName) + '?' + request.params ); }).join('&'); var url = '/1/indexes/*/queries'; if (opts.strategy !== undefined) { url += '?strategy=' + opts.strategy; } return this._jsonRequest({ cache: this.cache, method: 'POST', url: url, body: postObj, hostType: 'read', fallback: { method: 'GET', url: '/1/indexes/*', body: { params: JSONPParams } }, callback: callback }); }; /** * Set the extra security tagFilters header * @param {string|array} tags The list of tags defining the current security filters */ AlgoliaSearchCore.prototype.setSecurityTags = function(tags) { if (Object.prototype.toString.call(tags) === '[object Array]') { var strTags = []; for (var i = 0; i < tags.length; ++i) { if (Object.prototype.toString.call(tags[i]) === '[object Array]') { var oredTags = []; for (var j = 0; j < tags[i].length; ++j) { oredTags.push(tags[i][j]); } strTags.push('(' + oredTags.join(',') + ')'); } else { strTags.push(tags[i]); } } tags = strTags.join(','); } this.securityTags = tags; }; /** * Set the extra user token header * @param {string} userToken The token identifying a uniq user (used to apply rate limits) */ AlgoliaSearchCore.prototype.setUserToken = function(userToken) { this.userToken = userToken; }; /** * Clear all queries in client's cache * @return undefined */ AlgoliaSearchCore.prototype.clearCache = function() { this.cache = {}; }; /** * Set the number of milliseconds a request can take before automatically being terminated. * @deprecated * @param {Number} milliseconds */ AlgoliaSearchCore.prototype.setRequestTimeout = function(milliseconds) { if (milliseconds) { this._timeouts.connect = this._timeouts.read = this._timeouts.write = milliseconds; } }; /** * Set the three different (connect, read, write) timeouts to be used when requesting * @param {Object} timeouts */ AlgoliaSearchCore.prototype.setTimeouts = function(timeouts) { this._timeouts = timeouts; }; /** * Get the three different (connect, read, write) timeouts to be used when requesting * @param {Object} timeouts */ AlgoliaSearchCore.prototype.getTimeouts = function() { return this._timeouts; }; AlgoliaSearchCore.prototype._getAppIdData = function() { var data = store.get(this.applicationID); if (data !== null) this._cacheAppIdData(data); return data; }; AlgoliaSearchCore.prototype._setAppIdData = function(data) { data.lastChange = (new Date()).getTime(); this._cacheAppIdData(data); return store.set(this.applicationID, data); }; AlgoliaSearchCore.prototype._checkAppIdData = function() { var data = this._getAppIdData(); var now = (new Date()).getTime(); if (data === null || now - data.lastChange > RESET_APP_DATA_TIMER) { return this._resetInitialAppIdData(data); } return data; }; AlgoliaSearchCore.prototype._resetInitialAppIdData = function(data) { var newData = data || {}; newData.hostIndexes = {read: 0, write: 0}; newData.timeoutMultiplier = 1; newData.shuffleResult = newData.shuffleResult || shuffle([1, 2, 3]); return this._setAppIdData(newData); }; AlgoliaSearchCore.prototype._cacheAppIdData = function(data) { this._hostIndexes = data.hostIndexes; this._timeoutMultiplier = data.timeoutMultiplier; this._shuffleResult = data.shuffleResult; }; AlgoliaSearchCore.prototype._partialAppIdDataUpdate = function(newData) { var foreach = require(5); var currentData = this._getAppIdData(); foreach(newData, function(value, key) { currentData[key] = value; }); return this._setAppIdData(currentData); }; AlgoliaSearchCore.prototype._getHostByType = function(hostType) { return this.hosts[hostType][this._getHostIndexByType(hostType)]; }; AlgoliaSearchCore.prototype._getTimeoutMultiplier = function() { return this._timeoutMultiplier; }; AlgoliaSearchCore.prototype._getHostIndexByType = function(hostType) { return this._hostIndexes[hostType]; }; AlgoliaSearchCore.prototype._setHostIndexByType = function(hostIndex, hostType) { var clone = require(25); var newHostIndexes = clone(this._hostIndexes); newHostIndexes[hostType] = hostIndex; this._partialAppIdDataUpdate({hostIndexes: newHostIndexes}); return hostIndex; }; AlgoliaSearchCore.prototype._incrementHostIndex = function(hostType) { return this._setHostIndexByType( (this._getHostIndexByType(hostType) + 1) % this.hosts[hostType].length, hostType ); }; AlgoliaSearchCore.prototype._incrementTimeoutMultipler = function() { var timeoutMultiplier = Math.max(this._timeoutMultiplier + 1, 4); return this._partialAppIdDataUpdate({timeoutMultiplier: timeoutMultiplier}); }; AlgoliaSearchCore.prototype._getTimeoutsForRequest = function(hostType) { return { connect: this._timeouts.connect * this._timeoutMultiplier, complete: this._timeouts[hostType] * this._timeoutMultiplier }; }; function prepareHost(protocol) { return function prepare(host) { return protocol + '//' + host.toLowerCase(); }; } // Prototype.js < 1.7, a widely used library, defines a weird // Array.prototype.toJSON function that will fail to stringify our content // appropriately // refs: // - https://groups.google.com/forum/#!topic/prototype-core/E-SAVvV_V9Q // - https://github.com/sstephenson/prototype/commit/038a2985a70593c1a86c230fadbdfe2e4898a48c // - http://stackoverflow.com/a/3148441/147079 function safeJSONStringify(obj) { /* eslint no-extend-native:0 */ if (Array.prototype.toJSON === undefined) { return JSON.stringify(obj); } var toJSON = Array.prototype.toJSON; delete Array.prototype.toJSON; var out = JSON.stringify(obj); Array.prototype.toJSON = toJSON; return out; } function shuffle(array) { var currentIndex = array.length; var temporaryValue; var randomIndex; // While there remain elements to shuffle... while (currentIndex !== 0) { // Pick a remaining element... randomIndex = Math.floor(Math.random() * currentIndex); currentIndex -= 1; // And swap it with the current element. temporaryValue = array[currentIndex]; array[currentIndex] = array[randomIndex]; array[randomIndex] = temporaryValue; } return array; } function removeCredentials(headers) { var newHeaders = {}; for (var headerName in headers) { if (Object.prototype.hasOwnProperty.call(headers, headerName)) { var value; if (headerName === 'x-algolia-api-key' || headerName === 'x-algolia-application-id') { value = '**hidden for security purposes**'; } else { value = headers[headerName]; } newHeaders[headerName] = value; } } return newHeaders; } }).call(this,require(12)) },{"1":1,"12":12,"18":18,"25":25,"28":28,"29":29,"30":30,"34":34,"5":5,"8":8}],16:[function(require,module,exports){ var inherits = require(7); var IndexCore = require(18); var deprecate = require(26); var deprecatedMessage = require(27); var exitPromise = require(29); var errors = require(28); var deprecateForwardToSlaves = deprecate( function() {}, deprecatedMessage('forwardToSlaves', 'forwardToReplicas') ); module.exports = Index; function Index() { IndexCore.apply(this, arguments); } inherits(Index, IndexCore); /* * Add an object in this index * * @param content contains the javascript object to add inside the index * @param objectID (optional) an objectID you want to attribute to this object * (if the attribute already exist the old object will be overwrite) * @param callback (optional) the result callback called with two arguments: * error: null or Error('message') * content: the server answer that contains 3 elements: createAt, taskId and objectID */ Index.prototype.addObject = deprecate(function(content, objectID, callback) { var indexObj = this; if (arguments.length === 1 || typeof objectID === 'function') { callback = objectID; objectID = undefined; } return this.as._jsonRequest({ method: objectID !== undefined ? 'PUT' : // update or create 'POST', // create (API generates an objectID) url: '/1/indexes/' + encodeURIComponent(indexObj.indexName) + // create (objectID !== undefined ? '/' + encodeURIComponent(objectID) : ''), // update or create body: content, hostType: 'write', callback: callback }); }, deprecatedMessage('index.addObject(obj)', 'index.addObjects([obj])')); /* * Add several objects * * @param objects contains an array of objects to add * @param callback (optional) the result callback called with two arguments: * error: null or Error('message') * content: the server answer that updateAt and taskID */ Index.prototype.addObjects = function(objects, callback) { var isArray = require(8); var usage = 'Usage: index.addObjects(arrayOfObjects[, callback])'; if (!isArray(objects)) { throw new Error(usage); } var indexObj = this; var postObj = { requests: [] }; for (var i = 0; i < objects.length; ++i) { var request = { action: 'addObject', body: objects[i] }; postObj.requests.push(request); } return this.as._jsonRequest({ method: 'POST', url: '/1/indexes/' + encodeURIComponent(indexObj.indexName) + '/batch', body: postObj, hostType: 'write', callback: callback }); }; /* * Update partially an object (only update attributes passed in argument) * * @param partialObject contains the javascript attributes to override, the * object must contains an objectID attribute * @param createIfNotExists (optional) if false, avoid an automatic creation of the object * @param callback (optional) the result callback called with two arguments: * error: null or Error('message') * content: the server answer that contains 3 elements: createAt, taskId and objectID */ Index.prototype.partialUpdateObject = deprecate(function(partialObject, createIfNotExists, callback) { if (arguments.length === 1 || typeof createIfNotExists === 'function') { callback = createIfNotExists; createIfNotExists = undefined; } var indexObj = this; var url = '/1/indexes/' + encodeURIComponent(indexObj.indexName) + '/' + encodeURIComponent(partialObject.objectID) + '/partial'; if (createIfNotExists === false) { url += '?createIfNotExists=false'; } return this.as._jsonRequest({ method: 'POST', url: url, body: partialObject, hostType: 'write', callback: callback }); }, deprecatedMessage('index.partialUpdateObject(obj)', 'partialUpdateObjects([obj])')); /* * Partially Override the content of several objects * * @param objects contains an array of objects to update (each object must contains a objectID attribute) * @param callback (optional) the result callback called with two arguments: * error: null or Error('message') * content: the server answer that updateAt and taskID */ Index.prototype.partialUpdateObjects = function(objects, createIfNotExists, callback) { if (arguments.length === 1 || typeof createIfNotExists === 'function') { callback = createIfNotExists; createIfNotExists = true; } var isArray = require(8); var usage = 'Usage: index.partialUpdateObjects(arrayOfObjects[, callback])'; if (!isArray(objects)) { throw new Error(usage); } var indexObj = this; var postObj = { requests: [] }; for (var i = 0; i < objects.length; ++i) { var request = { action: createIfNotExists === true ? 'partialUpdateObject' : 'partialUpdateObjectNoCreate', objectID: objects[i].objectID, body: objects[i] }; postObj.requests.push(request); } return this.as._jsonRequest({ method: 'POST', url: '/1/indexes/' + encodeURIComponent(indexObj.indexName) + '/batch', body: postObj, hostType: 'write', callback: callback }); }; /* * Override the content of object * * @param object contains the javascript object to save, the object must contains an objectID attribute * @param callback (optional) the result callback called with two arguments: * error: null or Error('message') * content: the server answer that updateAt and taskID */ Index.prototype.saveObject = deprecate(function(object, callback) { var indexObj = this; return this.as._jsonRequest({ method: 'PUT', url: '/1/indexes/' + encodeURIComponent(indexObj.indexName) + '/' + encodeURIComponent(object.objectID), body: object, hostType: 'write', callback: callback }); }, deprecatedMessage('index.saveObject(obj)', 'index.saveObjects([obj])')); /* * Override the content of several objects * * @param objects contains an array of objects to update (each object must contains a objectID attribute) * @param callback (optional) the result callback called with two arguments: * error: null or Error('message') * content: the server answer that updateAt and taskID */ Index.prototype.saveObjects = function(objects, callback) { var isArray = require(8); var usage = 'Usage: index.saveObjects(arrayOfObjects[, callback])'; if (!isArray(objects)) { throw new Error(usage); } var indexObj = this; var postObj = { requests: [] }; for (var i = 0; i < objects.length; ++i) { var request = { action: 'updateObject', objectID: objects[i].objectID, body: objects[i] }; postObj.requests.push(request); } return this.as._jsonRequest({ method: 'POST', url: '/1/indexes/' + encodeURIComponent(indexObj.indexName) + '/batch', body: postObj, hostType: 'write', callback: callback }); }; /* * Delete an object from the index * * @param objectID the unique identifier of object to delete * @param callback (optional) the result callback called with two arguments: * error: null or Error('message') * content: the server answer that contains 3 elements: createAt, taskId and objectID */ Index.prototype.deleteObject = deprecate(function(objectID, callback) { if (typeof objectID === 'function' || typeof objectID !== 'string' && typeof objectID !== 'number') { var err = new errors.AlgoliaSearchError('Cannot delete an object without an objectID'); callback = objectID; if (typeof callback === 'function') { return callback(err); } return this.as._promise.reject(err); } var indexObj = this; return this.as._jsonRequest({ method: 'DELETE', url: '/1/indexes/' + encodeURIComponent(indexObj.indexName) + '/' + encodeURIComponent(objectID), hostType: 'write', callback: callback }); }, deprecatedMessage('index.deleteObject(objectID)', 'index.deleteObjects([objectID])')); /* * Delete several objects from an index * * @param objectIDs contains an array of objectID to delete * @param callback (optional) the result callback called with two arguments: * error: null or Error('message') * content: the server answer that contains 3 elements: createAt, taskId and objectID */ Index.prototype.deleteObjects = function(objectIDs, callback) { var isArray = require(8); var map = require(30); var usage = 'Usage: index.deleteObjects(arrayOfObjectIDs[, callback])'; if (!isArray(objectIDs)) { throw new Error(usage); } var indexObj = this; var postObj = { requests: map(objectIDs, function prepareRequest(objectID) { return { action: 'deleteObject', objectID: objectID, body: { objectID: objectID } }; }) }; return this.as._jsonRequest({ method: 'POST', url: '/1/indexes/' + encodeURIComponent(indexObj.indexName) + '/batch', body: postObj, hostType: 'write', callback: callback }); }; /* * Delete all objects matching a query * * @param query the query string * @param params the optional query parameters * @param callback (optional) the result callback called with one argument * error: null or Error('message') */ Index.prototype.deleteByQuery = function(query, params, callback) { var clone = require(25); var map = require(30); var indexObj = this; var client = indexObj.as; if (arguments.length === 1 || typeof params === 'function') { callback = params; params = {}; } else { params = clone(params); } params.attributesToRetrieve = 'objectID'; params.hitsPerPage = 1000; params.distinct = false; // when deleting, we should never use cache to get the // search results this.clearCache(); // there's a problem in how we use the promise chain, // see how waitTask is done var promise = this .search(query, params) .then(stopOrDelete); function stopOrDelete(searchContent) { // stop here if (searchContent.nbHits === 0) { // return indexObj.as._request.resolve(); return searchContent; } // continue and do a recursive call var objectIDs = map(searchContent.hits, function getObjectID(object) { return object.objectID; }); return indexObj .deleteObjects(objectIDs) .then(waitTask) .then(doDeleteByQuery); } function waitTask(deleteObjectsContent) { return indexObj.waitTask(deleteObjectsContent.taskID); } function doDeleteByQuery() { return indexObj.deleteByQuery(query, params); } if (!callback) { return promise; } promise.then(success, failure); function success() { exitPromise(function exit() { callback(null); }, client._setTimeout || setTimeout); } function failure(err) { exitPromise(function exit() { callback(err); }, client._setTimeout || setTimeout); } }; /* * Browse all content from an index using events. Basically this will do * .browse() -> .browseFrom -> .browseFrom -> .. until all the results are returned * * @param {string} query - The full text query * @param {Object} [queryParameters] - Any search query parameter * @return {EventEmitter} * @example * var browser = index.browseAll('cool songs', { * tagFilters: 'public,comments', * hitsPerPage: 500 * }); * * browser.on('result', function resultCallback(content) { * console.log(content.hits); * }); * * // if any error occurs, you get it * browser.on('error', function(err) { * throw err; * }); * * // when you have browsed the whole index, you get this event * browser.on('end', function() { * console.log('finished'); * }); * * // at any point if you want to stop the browsing process, you can stop it manually * // otherwise it will go on and on * browser.stop(); * * @see {@link https://www.algolia.com/doc/rest_api#Browse|Algolia REST API Documentation} */ Index.prototype.browseAll = function(query, queryParameters) { if (typeof query === 'object') { queryParameters = query; query = undefined; } var merge = require(31); var IndexBrowser = require(17); var browser = new IndexBrowser(); var client = this.as; var index = this; var params = client._getSearchParams( merge({}, queryParameters || {}, { query: query }), '' ); // start browsing browseLoop(); function browseLoop(cursor) { if (browser._stopped) { return; } var body; if (cursor !== undefined) { body = { cursor: cursor }; } else { body = { params: params }; } client._jsonRequest({ method: 'POST', url: '/1/indexes/' + encodeURIComponent(index.indexName) + '/browse', hostType: 'read', body: body, callback: browseCallback }); } function browseCallback(err, content) { if (browser._stopped) { return; } if (err) { browser._error(err); return; } browser._result(content); // no cursor means we are finished browsing if (content.cursor === undefined) { browser._end(); return; } browseLoop(content.cursor); } return browser; }; /* * Get a Typeahead.js adapter * @param searchParams contains an object with query parameters (see search for details) */ Index.prototype.ttAdapter = deprecate(function(params) { var self = this; return function ttAdapter(query, syncCb, asyncCb) { var cb; if (typeof asyncCb === 'function') { // typeahead 0.11 cb = asyncCb; } else { // pre typeahead 0.11 cb = syncCb; } self.search(query, params, function searchDone(err, content) { if (err) { cb(err); return; } cb(content.hits); }); }; }, 'ttAdapter is not necessary anymore and will be removed in the next version,\n' + 'have a look at autocomplete.js (https://github.com/algolia/autocomplete.js)'); /* * Wait the publication of a task on the server. * All server task are asynchronous and you can check with this method that the task is published. * * @param taskID the id of the task returned by server * @param callback the result callback with with two arguments: * error: null or Error('message') * content: the server answer that contains the list of results */ Index.prototype.waitTask = function(taskID, callback) { // wait minimum 100ms before retrying var baseDelay = 100; // wait maximum 5s before retrying var maxDelay = 5000; var loop = 0; // waitTask() must be handled differently from other methods, // it's a recursive method using a timeout var indexObj = this; var client = indexObj.as; var promise = retryLoop(); function retryLoop() { return client._jsonRequest({ method: 'GET', hostType: 'read', url: '/1/indexes/' + encodeURIComponent(indexObj.indexName) + '/task/' + taskID }).then(function success(content) { loop++; var delay = baseDelay * loop * loop; if (delay > maxDelay) { delay = maxDelay; } if (content.status !== 'published') { return client._promise.delay(delay).then(retryLoop); } return content; }); } if (!callback) { return promise; } promise.then(successCb, failureCb); function successCb(content) { exitPromise(function exit() { callback(null, content); }, client._setTimeout || setTimeout); } function failureCb(err) { exitPromise(function exit() { callback(err); }, client._setTimeout || setTimeout); } }; /* * This function deletes the index content. Settings and index specific API keys are kept untouched. * * @param callback (optional) the result callback called with two arguments * error: null or Error('message') * content: the settings object or the error message if a failure occured */ Index.prototype.clearIndex = function(callback) { var indexObj = this; return this.as._jsonRequest({ method: 'POST', url: '/1/indexes/' + encodeURIComponent(indexObj.indexName) + '/clear', hostType: 'write', callback: callback }); }; /* * Get settings of this index * * @param callback (optional) the result callback called with two arguments * error: null or Error('message') * content: the settings object or the error message if a failure occured */ Index.prototype.getSettings = function(callback) { var indexObj = this; return this.as._jsonRequest({ method: 'GET', url: '/1/indexes/' + encodeURIComponent(indexObj.indexName) + '/settings?getVersion=2', hostType: 'read', callback: callback }); }; Index.prototype.searchSynonyms = function(params, callback) { if (typeof params === 'function') { callback = params; params = {}; } else if (params === undefined) { params = {}; } return this.as._jsonRequest({ method: 'POST', url: '/1/indexes/' + encodeURIComponent(this.indexName) + '/synonyms/search', body: params, hostType: 'read', callback: callback }); }; Index.prototype.saveSynonym = function(synonym, opts, callback) { if (typeof opts === 'function') { callback = opts; opts = {}; } else if (opts === undefined) { opts = {}; } if (opts.forwardToSlaves !== undefined) deprecateForwardToSlaves(); var forwardToReplicas = (opts.forwardToSlaves || opts.forwardToReplicas) ? 'true' : 'false'; return this.as._jsonRequest({ method: 'PUT', url: '/1/indexes/' + encodeURIComponent(this.indexName) + '/synonyms/' + encodeURIComponent(synonym.objectID) + '?forwardToReplicas=' + forwardToReplicas, body: synonym, hostType: 'write', callback: callback }); }; Index.prototype.getSynonym = function(objectID, callback) { return this.as._jsonRequest({ method: 'GET', url: '/1/indexes/' + encodeURIComponent(this.indexName) + '/synonyms/' + encodeURIComponent(objectID), hostType: 'read', callback: callback }); }; Index.prototype.deleteSynonym = function(objectID, opts, callback) { if (typeof opts === 'function') { callback = opts; opts = {}; } else if (opts === undefined) { opts = {}; } if (opts.forwardToSlaves !== undefined) deprecateForwardToSlaves(); var forwardToReplicas = (opts.forwardToSlaves || opts.forwardToReplicas) ? 'true' : 'false'; return this.as._jsonRequest({ method: 'DELETE', url: '/1/indexes/' + encodeURIComponent(this.indexName) + '/synonyms/' + encodeURIComponent(objectID) + '?forwardToReplicas=' + forwardToReplicas, hostType: 'write', callback: callback }); }; Index.prototype.clearSynonyms = function(opts, callback) { if (typeof opts === 'function') { callback = opts; opts = {}; } else if (opts === undefined) { opts = {}; } if (opts.forwardToSlaves !== undefined) deprecateForwardToSlaves(); var forwardToReplicas = (opts.forwardToSlaves || opts.forwardToReplicas) ? 'true' : 'false'; return this.as._jsonRequest({ method: 'POST', url: '/1/indexes/' + encodeURIComponent(this.indexName) + '/synonyms/clear' + '?forwardToReplicas=' + forwardToReplicas, hostType: 'write', callback: callback }); }; Index.prototype.batchSynonyms = function(synonyms, opts, callback) { if (typeof opts === 'function') { callback = opts; opts = {}; } else if (opts === undefined) { opts = {}; } if (opts.forwardToSlaves !== undefined) deprecateForwardToSlaves(); var forwardToReplicas = (opts.forwardToSlaves || opts.forwardToReplicas) ? 'true' : 'false'; return this.as._jsonRequest({ method: 'POST', url: '/1/indexes/' + encodeURIComponent(this.indexName) + '/synonyms/batch' + '?forwardToReplicas=' + forwardToReplicas + '&replaceExistingSynonyms=' + (opts.replaceExistingSynonyms ? 'true' : 'false'), hostType: 'write', body: synonyms, callback: callback }); }; Index.prototype.searchRules = function(params, callback) { if (typeof params === 'function') { callback = params; params = {}; } else if (params === undefined) { params = {}; } return this.as._jsonRequest({ method: 'POST', url: '/1/indexes/' + encodeURIComponent(this.indexName) + '/rules/search', body: params, hostType: 'read', callback: callback }); }; Index.prototype.saveRule = function(rule, opts, callback) { if (typeof opts === 'function') { callback = opts; opts = {}; } else if (opts === undefined) { opts = {}; } var forwardToReplicas = opts.forwardToReplicas === true ? 'true' : 'false'; return this.as._jsonRequest({ method: 'PUT', url: '/1/indexes/' + encodeURIComponent(this.indexName) + '/rules/' + encodeURIComponent(rule.objectID) + '?forwardToReplicas=' + forwardToReplicas, body: rule, hostType: 'write', callback: callback }); }; Index.prototype.getRule = function(objectID, callback) { return this.as._jsonRequest({ method: 'GET', url: '/1/indexes/' + encodeURIComponent(this.indexName) + '/rules/' + encodeURIComponent(objectID), hostType: 'read', callback: callback }); }; Index.prototype.deleteRule = function(objectID, opts, callback) { if (typeof opts === 'function') { callback = opts; opts = {}; } else if (opts === undefined) { opts = {}; } var forwardToReplicas = opts.forwardToReplicas === true ? 'true' : 'false'; return this.as._jsonRequest({ method: 'DELETE', url: '/1/indexes/' + encodeURIComponent(this.indexName) + '/rules/' + encodeURIComponent(objectID) + '?forwardToReplicas=' + forwardToReplicas, hostType: 'write', callback: callback }); }; Index.prototype.clearRules = function(opts, callback) { if (typeof opts === 'function') { callback = opts; opts = {}; } else if (opts === undefined) { opts = {}; } var forwardToReplicas = opts.forwardToReplicas === true ? 'true' : 'false'; return this.as._jsonRequest({ method: 'POST', url: '/1/indexes/' + encodeURIComponent(this.indexName) + '/rules/clear' + '?forwardToReplicas=' + forwardToReplicas, hostType: 'write', callback: callback }); }; Index.prototype.batchRules = function(rules, opts, callback) { if (typeof opts === 'function') { callback = opts; opts = {}; } else if (opts === undefined) { opts = {}; } var forwardToReplicas = opts.forwardToReplicas === true ? 'true' : 'false'; return this.as._jsonRequest({ method: 'POST', url: '/1/indexes/' + encodeURIComponent(this.indexName) + '/rules/batch' + '?forwardToReplicas=' + forwardToReplicas + '&clearExistingRules=' + (opts.clearExistingRules === true ? 'true' : 'false'), hostType: 'write', body: rules, callback: callback }); }; /* * Set settings for this index * * @param settigns the settings object that can contains : * - minWordSizefor1Typo: (integer) the minimum number of characters to accept one typo (default = 3). * - minWordSizefor2Typos: (integer) the minimum number of characters to accept two typos (default = 7). * - hitsPerPage: (integer) the number of hits per page (default = 10). * - attributesToRetrieve: (array of strings) default list of attributes to retrieve in objects. * If set to null, all attributes are retrieved. * - attributesToHighlight: (array of strings) default list of attributes to highlight. * If set to null, all indexed attributes are highlighted. * - attributesToSnippet**: (array of strings) default list of attributes to snippet alongside the number * of words to return (syntax is attributeName:nbWords). * By default no snippet is computed. If set to null, no snippet is computed. * - attributesToIndex: (array of strings) the list of fields you want to index. * If set to null, all textual and numerical attributes of your objects are indexed, * but you should update it to get optimal results. * This parameter has two important uses: * - Limit the attributes to index: For example if you store a binary image in base64, * you want to store it and be able to * retrieve it but you don't want to search in the base64 string. * - Control part of the ranking*: (see the ranking parameter for full explanation) * Matches in attributes at the beginning of * the list will be considered more important than matches in attributes further down the list. * In one attribute, matching text at the beginning of the attribute will be * considered more important than text after, you can disable * this behavior if you add your attribute inside `unordered(AttributeName)`, * for example attributesToIndex: ["title", "unordered(text)"]. * - attributesForFaceting: (array of strings) The list of fields you want to use for faceting. * All strings in the attribute selected for faceting are extracted and added as a facet. * If set to null, no attribute is used for faceting. * - attributeForDistinct: (string) The attribute name used for the Distinct feature. * This feature is similar to the SQL "distinct" keyword: when enabled * in query with the distinct=1 parameter, all hits containing a duplicate * value for this attribute are removed from results. * For example, if the chosen attribute is show_name and several hits have * the same value for show_name, then only the best one is kept and others are removed. * - ranking: (array of strings) controls the way results are sorted. * We have six available criteria: * - typo: sort according to number of typos, * - geo: sort according to decreassing distance when performing a geo-location based search, * - proximity: sort according to the proximity of query words in hits, * - attribute: sort according to the order of attributes defined by attributesToIndex, * - exact: * - if the user query contains one word: sort objects having an attribute * that is exactly the query word before others. * For example if you search for the "V" TV show, you want to find it * with the "V" query and avoid to have all popular TV * show starting by the v letter before it. * - if the user query contains multiple words: sort according to the * number of words that matched exactly (and not as a prefix). * - custom: sort according to a user defined formula set in **customRanking** attribute. * The standard order is ["typo", "geo", "proximity", "attribute", "exact", "custom"] * - customRanking: (array of strings) lets you specify part of the ranking. * The syntax of this condition is an array of strings containing attributes * prefixed by asc (ascending order) or desc (descending order) operator. * For example `"customRanking" => ["desc(population)", "asc(name)"]` * - queryType: Select how the query words are interpreted, it can be one of the following value: * - prefixAll: all query words are interpreted as prefixes, * - prefixLast: only the last word is interpreted as a prefix (default behavior), * - prefixNone: no query word is interpreted as a prefix. This option is not recommended. * - highlightPreTag: (string) Specify the string that is inserted before * the highlighted parts in the query result (default to "<em>"). * - highlightPostTag: (string) Specify the string that is inserted after * the highlighted parts in the query result (default to "</em>"). * - optionalWords: (array of strings) Specify a list of words that should * be considered as optional when found in the query. * @param callback (optional) the result callback called with two arguments * error: null or Error('message') * content: the server answer or the error message if a failure occured */ Index.prototype.setSettings = function(settings, opts, callback) { if (arguments.length === 1 || typeof opts === 'function') { callback = opts; opts = {}; } if (opts.forwardToSlaves !== undefined) deprecateForwardToSlaves(); var forwardToReplicas = (opts.forwardToSlaves || opts.forwardToReplicas) ? 'true' : 'false'; var indexObj = this; return this.as._jsonRequest({ method: 'PUT', url: '/1/indexes/' + encodeURIComponent(indexObj.indexName) + '/settings?forwardToReplicas=' + forwardToReplicas, hostType: 'write', body: settings, callback: callback }); }; /* @deprecated see index.listApiKeys */ Index.prototype.listUserKeys = deprecate(function(callback) { return this.listApiKeys(callback); }, deprecatedMessage('index.listUserKeys()', 'index.listApiKeys()')); /* * List all existing API keys to this index * * @param callback the result callback called with two arguments * error: null or Error('message') * content: the server answer with API keys belonging to the index */ Index.prototype.listApiKeys = function(callback) { var indexObj = this; return this.as._jsonRequest({ method: 'GET', url: '/1/indexes/' + encodeURIComponent(indexObj.indexName) + '/keys', hostType: 'read', callback: callback }); }; /* @deprecated see index.getApiKey */ Index.prototype.getUserKeyACL = deprecate(function(key, callback) { return this.getApiKey(key, callback); }, deprecatedMessage('index.getUserKeyACL()', 'index.getApiKey()')); /* * Get an API key from this index * * @param key * @param callback the result callback called with two arguments * error: null or Error('message') * content: the server answer with the right API key */ Index.prototype.getApiKey = function(key, callback) { var indexObj = this; return this.as._jsonRequest({ method: 'GET', url: '/1/indexes/' + encodeURIComponent(indexObj.indexName) + '/keys/' + key, hostType: 'read', callback: callback }); }; /* @deprecated see index.deleteApiKey */ Index.prototype.deleteUserKey = deprecate(function(key, callback) { return this.deleteApiKey(key, callback); }, deprecatedMessage('index.deleteUserKey()', 'index.deleteApiKey()')); /* * Delete an existing API key associated to this index * * @param key * @param callback the result callback called with two arguments * error: null or Error('message') * content: the server answer with the deletion date */ Index.prototype.deleteApiKey = function(key, callback) { var indexObj = this; return this.as._jsonRequest({ method: 'DELETE', url: '/1/indexes/' + encodeURIComponent(indexObj.indexName) + '/keys/' + key, hostType: 'write', callback: callback }); }; /* @deprecated see index.addApiKey */ Index.prototype.addUserKey = deprecate(function(acls, params, callback) { return this.addApiKey(acls, params, callback); }, deprecatedMessage('index.addUserKey()', 'index.addApiKey()')); /* * Add a new API key to this index * * @param {string[]} acls - The list of ACL for this key. Defined by an array of strings that * can contains the following values: * - search: allow to search (https and http) * - addObject: allows to add/update an object in the index (https only) * - deleteObject : allows to delete an existing object (https only) * - deleteIndex : allows to delete index content (https only) * - settings : allows to get index settings (https only) * - editSettings : allows to change index settings (https only) * @param {Object} [params] - Optionnal parameters to set for the key * @param {number} params.validity - Number of seconds after which the key will * be automatically removed (0 means no time limit for this key) * @param {number} params.maxQueriesPerIPPerHour - Number of API calls allowed from an IP address per hour * @param {number} params.maxHitsPerQuery - Number of hits this API key can retrieve in one call * @param {string} params.description - A description for your key * @param {string[]} params.referers - A list of authorized referers * @param {Object} params.queryParameters - Force the key to use specific query parameters * @param {Function} callback - The result callback called with two arguments * error: null or Error('message') * content: the server answer with the added API key * @return {Promise|undefined} Returns a promise if no callback given * @example * index.addUserKey(['search'], { * validity: 300, * maxQueriesPerIPPerHour: 2000, * maxHitsPerQuery: 3, * description: 'Eat three fruits', * referers: ['*.algolia.com'], * queryParameters: { * tagFilters: ['public'], * } * }) * @see {@link https://www.algolia.com/doc/rest_api#AddIndexKey|Algolia REST API Documentation} */ Index.prototype.addApiKey = function(acls, params, callback) { var isArray = require(8); var usage = 'Usage: index.addApiKey(arrayOfAcls[, params, callback])'; if (!isArray(acls)) { throw new Error(usage); } if (arguments.length === 1 || typeof params === 'function') { callback = params; params = null; } var postObj = { acl: acls }; if (params) { postObj.validity = params.validity; postObj.maxQueriesPerIPPerHour = params.maxQueriesPerIPPerHour; postObj.maxHitsPerQuery = params.maxHitsPerQuery; postObj.description = params.description; if (params.queryParameters) { postObj.queryParameters = this.as._getSearchParams(params.queryParameters, ''); } postObj.referers = params.referers; } return this.as._jsonRequest({ method: 'POST', url: '/1/indexes/' + encodeURIComponent(this.indexName) + '/keys', body: postObj, hostType: 'write', callback: callback }); }; /** * @deprecated use index.addApiKey() */ Index.prototype.addUserKeyWithValidity = deprecate(function deprecatedAddUserKeyWithValidity(acls, params, callback) { return this.addApiKey(acls, params, callback); }, deprecatedMessage('index.addUserKeyWithValidity()', 'index.addApiKey()')); /* @deprecated see index.updateApiKey */ Index.prototype.updateUserKey = deprecate(function(key, acls, params, callback) { return this.updateApiKey(key, acls, params, callback); }, deprecatedMessage('index.updateUserKey()', 'index.updateApiKey()')); /** * Update an existing API key of this index * @param {string} key - The key to update * @param {string[]} acls - The list of ACL for this key. Defined by an array of strings that * can contains the following values: * - search: allow to search (https and http) * - addObject: allows to add/update an object in the index (https only) * - deleteObject : allows to delete an existing object (https only) * - deleteIndex : allows to delete index content (https only) * - settings : allows to get index settings (https only) * - editSettings : allows to change index settings (https only) * @param {Object} [params] - Optionnal parameters to set for the key * @param {number} params.validity - Number of seconds after which the key will * be automatically removed (0 means no time limit for this key) * @param {number} params.maxQueriesPerIPPerHour - Number of API calls allowed from an IP address per hour * @param {number} params.maxHitsPerQuery - Number of hits this API key can retrieve in one call * @param {string} params.description - A description for your key * @param {string[]} params.referers - A list of authorized referers * @param {Object} params.queryParameters - Force the key to use specific query parameters * @param {Function} callback - The result callback called with two arguments * error: null or Error('message') * content: the server answer with user keys list * @return {Promise|undefined} Returns a promise if no callback given * @example * index.updateApiKey('APIKEY', ['search'], { * validity: 300, * maxQueriesPerIPPerHour: 2000, * maxHitsPerQuery: 3, * description: 'Eat three fruits', * referers: ['*.algolia.com'], * queryParameters: { * tagFilters: ['public'], * } * }) * @see {@link https://www.algolia.com/doc/rest_api#UpdateIndexKey|Algolia REST API Documentation} */ Index.prototype.updateApiKey = function(key, acls, params, callback) { var isArray = require(8); var usage = 'Usage: index.updateApiKey(key, arrayOfAcls[, params, callback])'; if (!isArray(acls)) { throw new Error(usage); } if (arguments.length === 2 || typeof params === 'function') { callback = params; params = null; } var putObj = { acl: acls }; if (params) { putObj.validity = params.validity; putObj.maxQueriesPerIPPerHour = params.maxQueriesPerIPPerHour; putObj.maxHitsPerQuery = params.maxHitsPerQuery; putObj.description = params.description; if (params.queryParameters) { putObj.queryParameters = this.as._getSearchParams(params.queryParameters, ''); } putObj.referers = params.referers; } return this.as._jsonRequest({ method: 'PUT', url: '/1/indexes/' + encodeURIComponent(this.indexName) + '/keys/' + key, body: putObj, hostType: 'write', callback: callback }); }; },{"17":17,"18":18,"25":25,"26":26,"27":27,"28":28,"29":29,"30":30,"31":31,"7":7,"8":8}],17:[function(require,module,exports){ 'use strict'; // This is the object returned by the `index.browseAll()` method module.exports = IndexBrowser; var inherits = require(7); var EventEmitter = require(4).EventEmitter; function IndexBrowser() { } inherits(IndexBrowser, EventEmitter); IndexBrowser.prototype.stop = function() { this._stopped = true; this._clean(); }; IndexBrowser.prototype._end = function() { this.emit('end'); this._clean(); }; IndexBrowser.prototype._error = function(err) { this.emit('error', err); this._clean(); }; IndexBrowser.prototype._result = function(content) { this.emit('result', content); }; IndexBrowser.prototype._clean = function() { this.removeAllListeners('stop'); this.removeAllListeners('end'); this.removeAllListeners('error'); this.removeAllListeners('result'); }; },{"4":4,"7":7}],18:[function(require,module,exports){ var buildSearchMethod = require(24); var deprecate = require(26); var deprecatedMessage = require(27); module.exports = IndexCore; /* * Index class constructor. * You should not use this method directly but use initIndex() function */ function IndexCore(algoliasearch, indexName) { this.indexName = indexName; this.as = algoliasearch; this.typeAheadArgs = null; this.typeAheadValueOption = null; // make sure every index instance has it's own cache this.cache = {}; } /* * Clear all queries in cache */ IndexCore.prototype.clearCache = function() { this.cache = {}; }; /* * Search inside the index using XMLHttpRequest request (Using a POST query to * minimize number of OPTIONS queries: Cross-Origin Resource Sharing). * * @param {string} [query] the full text query * @param {object} [args] (optional) if set, contains an object with query parameters: * - page: (integer) Pagination parameter used to select the page to retrieve. * Page is zero-based and defaults to 0. Thus, * to retrieve the 10th page you need to set page=9 * - hitsPerPage: (integer) Pagination parameter used to select the number of hits per page. Defaults to 20. * - attributesToRetrieve: a string that contains the list of object attributes * you want to retrieve (let you minimize the answer size). * Attributes are separated with a comma (for example "name,address"). * You can also use an array (for example ["name","address"]). * By default, all attributes are retrieved. You can also use '*' to retrieve all * values when an attributesToRetrieve setting is specified for your index. * - attributesToHighlight: a string that contains the list of attributes you * want to highlight according to the query. * Attributes are separated by a comma. You can also use an array (for example ["name","address"]). * If an attribute has no match for the query, the raw value is returned. * By default all indexed text attributes are highlighted. * You can use `*` if you want to highlight all textual attributes. * Numerical attributes are not highlighted. * A matchLevel is returned for each highlighted attribute and can contain: * - full: if all the query terms were found in the attribute, * - partial: if only some of the query terms were found, * - none: if none of the query terms were found. * - attributesToSnippet: a string that contains the list of attributes to snippet alongside * the number of words to return (syntax is `attributeName:nbWords`). * Attributes are separated by a comma (Example: attributesToSnippet=name:10,content:10). * You can also use an array (Example: attributesToSnippet: ['name:10','content:10']). * By default no snippet is computed. * - minWordSizefor1Typo: the minimum number of characters in a query word to accept one typo in this word. * Defaults to 3. * - minWordSizefor2Typos: the minimum number of characters in a query word * to accept two typos in this word. Defaults to 7. * - getRankingInfo: if set to 1, the result hits will contain ranking * information in _rankingInfo attribute. * - aroundLatLng: search for entries around a given * latitude/longitude (specified as two floats separated by a comma). * For example aroundLatLng=47.316669,5.016670). * You can specify the maximum distance in meters with the aroundRadius parameter (in meters) * and the precision for ranking with aroundPrecision * (for example if you set aroundPrecision=100, two objects that are distant of * less than 100m will be considered as identical for "geo" ranking parameter). * At indexing, you should specify geoloc of an object with the _geoloc attribute * (in the form {"_geoloc":{"lat":48.853409, "lng":2.348800}}) * - insideBoundingBox: search entries inside a given area defined by the two extreme points * of a rectangle (defined by 4 floats: p1Lat,p1Lng,p2Lat,p2Lng). * For example insideBoundingBox=47.3165,4.9665,47.3424,5.0201). * At indexing, you should specify geoloc of an object with the _geoloc attribute * (in the form {"_geoloc":{"lat":48.853409, "lng":2.348800}}) * - numericFilters: a string that contains the list of numeric filters you want to * apply separated by a comma. * The syntax of one filter is `attributeName` followed by `operand` followed by `value`. * Supported operands are `<`, `<=`, `=`, `>` and `>=`. * You can have multiple conditions on one attribute like for example numericFilters=price>100,price<1000. * You can also use an array (for example numericFilters: ["price>100","price<1000"]). * - tagFilters: filter the query by a set of tags. You can AND tags by separating them by commas. * To OR tags, you must add parentheses. For example, tags=tag1,(tag2,tag3) means tag1 AND (tag2 OR tag3). * You can also use an array, for example tagFilters: ["tag1",["tag2","tag3"]] * means tag1 AND (tag2 OR tag3). * At indexing, tags should be added in the _tags** attribute * of objects (for example {"_tags":["tag1","tag2"]}). * - facetFilters: filter the query by a list of facets. * Facets are separated by commas and each facet is encoded as `attributeName:value`. * For example: `facetFilters=category:Book,author:John%20Doe`. * You can also use an array (for example `["category:Book","author:John%20Doe"]`). * - facets: List of object attributes that you want to use for faceting. * Comma separated list: `"category,author"` or array `['category','author']` * Only attributes that have been added in **attributesForFaceting** index setting * can be used in this parameter. * You can also use `*` to perform faceting on all attributes specified in **attributesForFaceting**. * - queryType: select how the query words are interpreted, it can be one of the following value: * - prefixAll: all query words are interpreted as prefixes, * - prefixLast: only the last word is interpreted as a prefix (default behavior), * - prefixNone: no query word is interpreted as a prefix. This option is not recommended. * - optionalWords: a string that contains the list of words that should * be considered as optional when found in the query. * Comma separated and array are accepted. * - distinct: If set to 1, enable the distinct feature (disabled by default) * if the attributeForDistinct index setting is set. * This feature is similar to the SQL "distinct" keyword: when enabled * in a query with the distinct=1 parameter, * all hits containing a duplicate value for the attributeForDistinct attribute are removed from results. * For example, if the chosen attribute is show_name and several hits have * the same value for show_name, then only the best * one is kept and others are removed. * - restrictSearchableAttributes: List of attributes you want to use for * textual search (must be a subset of the attributesToIndex index setting) * either comma separated or as an array * @param {function} [callback] the result callback called with two arguments: * error: null or Error('message'). If false, the content contains the error. * content: the server answer that contains the list of results. */ IndexCore.prototype.search = buildSearchMethod('query'); /* * -- BETA -- * Search a record similar to the query inside the index using XMLHttpRequest request (Using a POST query to * minimize number of OPTIONS queries: Cross-Origin Resource Sharing). * * @param {string} [query] the similar query * @param {object} [args] (optional) if set, contains an object with query parameters. * All search parameters are supported (see search function), restrictSearchableAttributes and facetFilters * are the two most useful to restrict the similar results and get more relevant content */ IndexCore.prototype.similarSearch = buildSearchMethod('similarQuery'); /* * Browse index content. The response content will have a `cursor` property that you can use * to browse subsequent pages for this query. Use `index.browseFrom(cursor)` when you want. * * @param {string} query - The full text query * @param {Object} [queryParameters] - Any search query parameter * @param {Function} [callback] - The result callback called with two arguments * error: null or Error('message') * content: the server answer with the browse result * @return {Promise|undefined} Returns a promise if no callback given * @example * index.browse('cool songs', { * tagFilters: 'public,comments', * hitsPerPage: 500 * }, callback); * @see {@link https://www.algolia.com/doc/rest_api#Browse|Algolia REST API Documentation} */ IndexCore.prototype.browse = function(query, queryParameters, callback) { var merge = require(31); var indexObj = this; var page; var hitsPerPage; // we check variadic calls that are not the one defined // .browse()/.browse(fn) // => page = 0 if (arguments.length === 0 || arguments.length === 1 && typeof arguments[0] === 'function') { page = 0; callback = arguments[0]; query = undefined; } else if (typeof arguments[0] === 'number') { // .browse(2)/.browse(2, 10)/.browse(2, fn)/.browse(2, 10, fn) page = arguments[0]; if (typeof arguments[1] === 'number') { hitsPerPage = arguments[1]; } else if (typeof arguments[1] === 'function') { callback = arguments[1]; hitsPerPage = undefined; } query = undefined; queryParameters = undefined; } else if (typeof arguments[0] === 'object') { // .browse(queryParameters)/.browse(queryParameters, cb) if (typeof arguments[1] === 'function') { callback = arguments[1]; } queryParameters = arguments[0]; query = undefined; } else if (typeof arguments[0] === 'string' && typeof arguments[1] === 'function') { // .browse(query, cb) callback = arguments[1]; queryParameters = undefined; } // otherwise it's a .browse(query)/.browse(query, queryParameters)/.browse(query, queryParameters, cb) // get search query parameters combining various possible calls // to .browse(); queryParameters = merge({}, queryParameters || {}, { page: page, hitsPerPage: hitsPerPage, query: query }); var params = this.as._getSearchParams(queryParameters, ''); return this.as._jsonRequest({ method: 'POST', url: '/1/indexes/' + encodeURIComponent(indexObj.indexName) + '/browse', body: {params: params}, hostType: 'read', callback: callback }); }; /* * Continue browsing from a previous position (cursor), obtained via a call to `.browse()`. * * @param {string} query - The full text query * @param {Object} [queryParameters] - Any search query parameter * @param {Function} [callback] - The result callback called with two arguments * error: null or Error('message') * content: the server answer with the browse result * @return {Promise|undefined} Returns a promise if no callback given * @example * index.browseFrom('14lkfsakl32', callback); * @see {@link https://www.algolia.com/doc/rest_api#Browse|Algolia REST API Documentation} */ IndexCore.prototype.browseFrom = function(cursor, callback) { return this.as._jsonRequest({ method: 'POST', url: '/1/indexes/' + encodeURIComponent(this.indexName) + '/browse', body: {cursor: cursor}, hostType: 'read', callback: callback }); }; /* * Search for facet values * https://www.algolia.com/doc/rest-api/search#search-for-facet-values * * @param {string} params.facetName Facet name, name of the attribute to search for values in. * Must be declared as a facet * @param {string} params.facetQuery Query for the facet search * @param {string} [params.*] Any search parameter of Algolia, * see https://www.algolia.com/doc/api-client/javascript/search#search-parameters * Pagination is not supported. The page and hitsPerPage parameters will be ignored. * @param callback (optional) */ IndexCore.prototype.searchForFacetValues = function(params, callback) { var clone = require(25); var omit = require(32); var usage = 'Usage: index.searchForFacetValues({facetName, facetQuery, ...params}[, callback])'; if (params.facetName === undefined || params.facetQuery === undefined) { throw new Error(usage); } var facetName = params.facetName; var filteredParams = omit(clone(params), function(keyName) { return keyName === 'facetName'; }); var searchParameters = this.as._getSearchParams(filteredParams, ''); return this.as._jsonRequest({ method: 'POST', url: '/1/indexes/' + encodeURIComponent(this.indexName) + '/facets/' + encodeURIComponent(facetName) + '/query', hostType: 'read', body: {params: searchParameters}, callback: callback }); }; IndexCore.prototype.searchFacet = deprecate(function(params, callback) { return this.searchForFacetValues(params, callback); }, deprecatedMessage( 'index.searchFacet(params[, callback])', 'index.searchForFacetValues(params[, callback])' )); IndexCore.prototype._search = function(params, url, callback, additionalUA) { return this.as._jsonRequest({ cache: this.cache, method: 'POST', url: url || '/1/indexes/' + encodeURIComponent(this.indexName) + '/query', body: {params: params}, hostType: 'read', fallback: { method: 'GET', url: '/1/indexes/' + encodeURIComponent(this.indexName), body: {params: params} }, callback: callback, additionalUA: additionalUA }); }; /* * Get an object from this index * * @param objectID the unique identifier of the object to retrieve * @param attrs (optional) if set, contains the array of attribute names to retrieve * @param callback (optional) the result callback called with two arguments * error: null or Error('message') * content: the object to retrieve or the error message if a failure occured */ IndexCore.prototype.getObject = deprecate(function(objectID, attrs, callback) { var indexObj = this; if (arguments.length === 1 || typeof attrs === 'function') { callback = attrs; attrs = undefined; } var params = ''; if (attrs !== undefined) { params = '?attributes='; for (var i = 0; i < attrs.length; ++i) { if (i !== 0) { params += ','; } params += attrs[i]; } } return this.as._jsonRequest({ method: 'GET', url: '/1/indexes/' + encodeURIComponent(indexObj.indexName) + '/' + encodeURIComponent(objectID) + params, hostType: 'read', callback: callback }); }, deprecatedMessage('index.getObject(objectID)', 'index.getObjects([objectID])')); /* * Get several objects from this index * * @param objectIDs the array of unique identifier of objects to retrieve */ IndexCore.prototype.getObjects = function(objectIDs, attributesToRetrieve, callback) { var isArray = require(8); var map = require(30); var usage = 'Usage: index.getObjects(arrayOfObjectIDs[, callback])'; if (!isArray(objectIDs)) { throw new Error(usage); } var indexObj = this; if (arguments.length === 1 || typeof attributesToRetrieve === 'function') { callback = attributesToRetrieve; attributesToRetrieve = undefined; } var body = { requests: map(objectIDs, function prepareRequest(objectID) { var request = { indexName: indexObj.indexName, objectID: objectID }; if (attributesToRetrieve) { request.attributesToRetrieve = attributesToRetrieve.join(','); } return request; }) }; return this.as._jsonRequest({ method: 'POST', url: '/1/indexes/*/objects', hostType: 'read', body: body, callback: callback }); }; IndexCore.prototype.as = null; IndexCore.prototype.indexName = null; IndexCore.prototype.typeAheadArgs = null; IndexCore.prototype.typeAheadValueOption = null; },{"24":24,"25":25,"26":26,"27":27,"30":30,"31":31,"32":32,"8":8}],19:[function(require,module,exports){ 'use strict'; var AlgoliaSearch = require(14); var createAlgoliasearch = require(20); module.exports = createAlgoliasearch(AlgoliaSearch); },{"14":14,"20":20}],20:[function(require,module,exports){ (function (process){ 'use strict'; var global = require(6); var Promise = global.Promise || require(3).Promise; // This is the standalone browser build entry point // Browser implementation of the Algolia Search JavaScript client, // using XMLHttpRequest, XDomainRequest and JSONP as fallback module.exports = function createAlgoliasearch(AlgoliaSearch, uaSuffix) { var inherits = require(7); var errors = require(28); var inlineHeaders = require(22); var jsonpRequest = require(23); var places = require(33); uaSuffix = uaSuffix || ''; if (process.env.NODE_ENV === 'debug') { require(1).enable('algoliasearch*'); } function algoliasearch(applicationID, apiKey, opts) { var cloneDeep = require(25); var getDocumentProtocol = require(21); opts = cloneDeep(opts || {}); if (opts.protocol === undefined) { opts.protocol = getDocumentProtocol(); } opts._ua = opts._ua || algoliasearch.ua; return new AlgoliaSearchBrowser(applicationID, apiKey, opts); } algoliasearch.version = require(35); algoliasearch.ua = 'Algolia for vanilla JavaScript ' + uaSuffix + algoliasearch.version; algoliasearch.initPlaces = places(algoliasearch); // we expose into window no matter how we are used, this will allow // us to easily debug any website running algolia global.__algolia = { debug: require(1), algoliasearch: algoliasearch }; var support = { hasXMLHttpRequest: 'XMLHttpRequest' in global, hasXDomainRequest: 'XDomainRequest' in global }; if (support.hasXMLHttpRequest) { support.cors = 'withCredentials' in new XMLHttpRequest(); } function AlgoliaSearchBrowser() { // call AlgoliaSearch constructor AlgoliaSearch.apply(this, arguments); } inherits(AlgoliaSearchBrowser, AlgoliaSearch); AlgoliaSearchBrowser.prototype._request = function request(url, opts) { return new Promise(function wrapRequest(resolve, reject) { // no cors or XDomainRequest, no request if (!support.cors && !support.hasXDomainRequest) { // very old browser, not supported reject(new errors.Network('CORS not supported')); return; } url = inlineHeaders(url, opts.headers); var body = opts.body; var req = support.cors ? new XMLHttpRequest() : new XDomainRequest(); var reqTimeout; var timedOut; var connected = false; reqTimeout = setTimeout(onTimeout, opts.timeouts.connect); // we set an empty onprogress listener // so that XDomainRequest on IE9 is not aborted // refs: // - https://github.com/algolia/algoliasearch-client-js/issues/76 // - https://social.msdn.microsoft.com/Forums/ie/en-US/30ef3add-767c-4436-b8a9-f1ca19b4812e/ie9-rtm-xdomainrequest-issued-requests-may-abort-if-all-event-handlers-not-specified?forum=iewebdevelopment req.onprogress = onProgress; if ('onreadystatechange' in req) req.onreadystatechange = onReadyStateChange; req.onload = onLoad; req.onerror = onError; // do not rely on default XHR async flag, as some analytics code like hotjar // breaks it and set it to false by default if (req instanceof XMLHttpRequest) { req.open(opts.method, url, true); } else { req.open(opts.method, url); } // headers are meant to be sent after open if (support.cors) { if (body) { if (opts.method === 'POST') { // https://developer.mozilla.org/en-US/docs/Web/HTTP/Access_control_CORS#Simple_requests req.setRequestHeader('content-type', 'application/x-www-form-urlencoded'); } else { req.setRequestHeader('content-type', 'application/json'); } } req.setRequestHeader('accept', 'application/json'); } req.send(body); // event object not received in IE8, at least // but we do not use it, still important to note function onLoad(/* event */) { // When browser does not supports req.timeout, we can // have both a load and timeout event, since handled by a dumb setTimeout if (timedOut) { return; } clearTimeout(reqTimeout); var out; try { out = { body: JSON.parse(req.responseText), responseText: req.responseText, statusCode: req.status, // XDomainRequest does not have any response headers headers: req.getAllResponseHeaders && req.getAllResponseHeaders() || {} }; } catch (e) { out = new errors.UnparsableJSON({ more: req.responseText }); } if (out instanceof errors.UnparsableJSON) { reject(out); } else { resolve(out); } } function onError(event) { if (timedOut) { return; } clearTimeout(reqTimeout); // error event is trigerred both with XDR/XHR on: // - DNS error // - unallowed cross domain request reject( new errors.Network({ more: event }) ); } function onTimeout() { timedOut = true; req.abort(); reject(new errors.RequestTimeout()); } function onConnect() { connected = true; clearTimeout(reqTimeout); reqTimeout = setTimeout(onTimeout, opts.timeouts.complete); } function onProgress() { if (!connected) onConnect(); } function onReadyStateChange() { if (!connected && req.readyState > 1) onConnect(); } }); }; AlgoliaSearchBrowser.prototype._request.fallback = function requestFallback(url, opts) { url = inlineHeaders(url, opts.headers); return new Promise(function wrapJsonpRequest(resolve, reject) { jsonpRequest(url, opts, function jsonpRequestDone(err, content) { if (err) { reject(err); return; } resolve(content); }); }); }; AlgoliaSearchBrowser.prototype._promise = { reject: function rejectPromise(val) { return Promise.reject(val); }, resolve: function resolvePromise(val) { return Promise.resolve(val); }, delay: function delayPromise(ms) { return new Promise(function resolveOnTimeout(resolve/* , reject*/) { setTimeout(resolve, ms); }); } }; return algoliasearch; }; }).call(this,require(12)) },{"1":1,"12":12,"21":21,"22":22,"23":23,"25":25,"28":28,"3":3,"33":33,"35":35,"6":6,"7":7}],21:[function(require,module,exports){ 'use strict'; module.exports = getDocumentProtocol; function getDocumentProtocol() { var protocol = window.document.location.protocol; // when in `file:` mode (local html file), default to `http:` if (protocol !== 'http:' && protocol !== 'https:') { protocol = 'http:'; } return protocol; } },{}],22:[function(require,module,exports){ 'use strict'; module.exports = inlineHeaders; var encode = require(13); function inlineHeaders(url, headers) { if (/\?/.test(url)) { url += '&'; } else { url += '?'; } return url + encode(headers); } },{"13":13}],23:[function(require,module,exports){ 'use strict'; module.exports = jsonpRequest; var errors = require(28); var JSONPCounter = 0; function jsonpRequest(url, opts, cb) { if (opts.method !== 'GET') { cb(new Error('Method ' + opts.method + ' ' + url + ' is not supported by JSONP.')); return; } opts.debug('JSONP: start'); var cbCalled = false; var timedOut = false; JSONPCounter += 1; var head = document.getElementsByTagName('head')[0]; var script = document.createElement('script'); var cbName = 'algoliaJSONP_' + JSONPCounter; var done = false; window[cbName] = function(data) { removeGlobals(); if (timedOut) { opts.debug('JSONP: Late answer, ignoring'); return; } cbCalled = true; clean(); cb(null, { body: data/* , // We do not send the statusCode, there's no statusCode in JSONP, it will be // computed using data.status && data.message like with XDR statusCode*/ }); }; // add callback by hand url += '&callback=' + cbName; // add body params manually if (opts.jsonBody && opts.jsonBody.params) { url += '&' + opts.jsonBody.params; } var ontimeout = setTimeout(timeout, opts.timeouts.complete); // script onreadystatechange needed only for // <= IE8 // https://github.com/angular/angular.js/issues/4523 script.onreadystatechange = readystatechange; script.onload = success; script.onerror = error; script.async = true; script.defer = true; script.src = url; head.appendChild(script); function success() { opts.debug('JSONP: success'); if (done || timedOut) { return; } done = true; // script loaded but did not call the fn => script loading error if (!cbCalled) { opts.debug('JSONP: Fail. Script loaded but did not call the callback'); clean(); cb(new errors.JSONPScriptFail()); } } function readystatechange() { if (this.readyState === 'loaded' || this.readyState === 'complete') { success(); } } function clean() { clearTimeout(ontimeout); script.onload = null; script.onreadystatechange = null; script.onerror = null; head.removeChild(script); } function removeGlobals() { try { delete window[cbName]; delete window[cbName + '_loaded']; } catch (e) { window[cbName] = window[cbName + '_loaded'] = undefined; } } function timeout() { opts.debug('JSONP: Script timeout'); timedOut = true; clean(); cb(new errors.RequestTimeout()); } function error() { opts.debug('JSONP: Script error'); if (done || timedOut) { return; } clean(); cb(new errors.JSONPScriptError()); } } },{"28":28}],24:[function(require,module,exports){ module.exports = buildSearchMethod; var errors = require(28); /** * Creates a search method to be used in clients * @param {string} queryParam the name of the attribute used for the query * @param {string} url the url * @return {function} the search method */ function buildSearchMethod(queryParam, url) { /** * The search method. Prepares the data and send the query to Algolia. * @param {string} query the string used for query search * @param {object} args additional parameters to send with the search * @param {function} [callback] the callback to be called with the client gets the answer * @return {undefined|Promise} If the callback is not provided then this methods returns a Promise */ return function search(query, args, callback) { // warn V2 users on how to search if (typeof query === 'function' && typeof args === 'object' || typeof callback === 'object') { // .search(query, params, cb) // .search(cb, params) throw new errors.AlgoliaSearchError('index.search usage is index.search(query, params, cb)'); } // Normalizing the function signature if (arguments.length === 0 || typeof query === 'function') { // Usage : .search(), .search(cb) callback = query; query = ''; } else if (arguments.length === 1 || typeof args === 'function') { // Usage : .search(query/args), .search(query, cb) callback = args; args = undefined; } // At this point we have 3 arguments with values // Usage : .search(args) // careful: typeof null === 'object' if (typeof query === 'object' && query !== null) { args = query; query = undefined; } else if (query === undefined || query === null) { // .search(undefined/null) query = ''; } var params = ''; if (query !== undefined) { params += queryParam + '=' + encodeURIComponent(query); } var additionalUA; if (args !== undefined) { if (args.additionalUA) { additionalUA = args.additionalUA; delete args.additionalUA; } // `_getSearchParams` will augment params, do not be fooled by the = versus += from previous if params = this.as._getSearchParams(args, params); } return this._search(params, url, callback, additionalUA); }; } },{"28":28}],25:[function(require,module,exports){ module.exports = function clone(obj) { return JSON.parse(JSON.stringify(obj)); }; },{}],26:[function(require,module,exports){ module.exports = function deprecate(fn, message) { var warned = false; function deprecated() { if (!warned) { /* eslint no-console:0 */ console.warn(message); warned = true; } return fn.apply(this, arguments); } return deprecated; }; },{}],27:[function(require,module,exports){ module.exports = function deprecatedMessage(previousUsage, newUsage) { var githubAnchorLink = previousUsage.toLowerCase() .replace(/[\.\(\)]/g, ''); return 'algoliasearch: `' + previousUsage + '` was replaced by `' + newUsage + '`. Please see https://github.com/algolia/algoliasearch-client-javascript/wiki/Deprecated#' + githubAnchorLink; }; },{}],28:[function(require,module,exports){ 'use strict'; // This file hosts our error definitions // We use custom error "types" so that we can act on them when we need it // e.g.: if error instanceof errors.UnparsableJSON then.. var inherits = require(7); function AlgoliaSearchError(message, extraProperties) { var forEach = require(5); var error = this; // try to get a stacktrace if (typeof Error.captureStackTrace === 'function') { Error.captureStackTrace(this, this.constructor); } else { error.stack = (new Error()).stack || 'Cannot get a stacktrace, browser is too old'; } this.name = 'AlgoliaSearchError'; this.message = message || 'Unknown error'; if (extraProperties) { forEach(extraProperties, function addToErrorObject(value, key) { error[key] = value; }); } } inherits(AlgoliaSearchError, Error); function createCustomError(name, message) { function AlgoliaSearchCustomError() { var args = Array.prototype.slice.call(arguments, 0); // custom message not set, use default if (typeof args[0] !== 'string') { args.unshift(message); } AlgoliaSearchError.apply(this, args); this.name = 'AlgoliaSearch' + name + 'Error'; } inherits(AlgoliaSearchCustomError, AlgoliaSearchError); return AlgoliaSearchCustomError; } // late exports to let various fn defs and inherits take place module.exports = { AlgoliaSearchError: AlgoliaSearchError, UnparsableJSON: createCustomError( 'UnparsableJSON', 'Could not parse the incoming response as JSON, see err.more for details' ), RequestTimeout: createCustomError( 'RequestTimeout', 'Request timedout before getting a response' ), Network: createCustomError( 'Network', 'Network issue, see err.more for details' ), JSONPScriptFail: createCustomError( 'JSONPScriptFail', '<script> was loaded but did not call our provided callback' ), JSONPScriptError: createCustomError( 'JSONPScriptError', '<script> unable to load due to an `error` event on it' ), Unknown: createCustomError( 'Unknown', 'Unknown error occured' ) }; },{"5":5,"7":7}],29:[function(require,module,exports){ // Parse cloud does not supports setTimeout // We do not store a setTimeout reference in the client everytime // We only fallback to a fake setTimeout when not available // setTimeout cannot be override globally sadly module.exports = function exitPromise(fn, _setTimeout) { _setTimeout(fn, 0); }; },{}],30:[function(require,module,exports){ var foreach = require(5); module.exports = function map(arr, fn) { var newArr = []; foreach(arr, function(item, itemIndex) { newArr.push(fn(item, itemIndex, arr)); }); return newArr; }; },{"5":5}],31:[function(require,module,exports){ var foreach = require(5); module.exports = function merge(destination/* , sources */) { var sources = Array.prototype.slice.call(arguments); foreach(sources, function(source) { for (var keyName in source) { if (source.hasOwnProperty(keyName)) { if (typeof destination[keyName] === 'object' && typeof source[keyName] === 'object') { destination[keyName] = merge({}, destination[keyName], source[keyName]); } else if (source[keyName] !== undefined) { destination[keyName] = source[keyName]; } } } }); return destination; }; },{"5":5}],32:[function(require,module,exports){ module.exports = function omit(obj, test) { var keys = require(10); var foreach = require(5); var filtered = {}; foreach(keys(obj), function doFilter(keyName) { if (test(keyName) !== true) { filtered[keyName] = obj[keyName]; } }); return filtered; }; },{"10":10,"5":5}],33:[function(require,module,exports){ module.exports = createPlacesClient; var buildSearchMethod = require(24); function createPlacesClient(algoliasearch) { return function places(appID, apiKey, opts) { var cloneDeep = require(25); opts = opts && cloneDeep(opts) || {}; opts.hosts = opts.hosts || [ 'places-dsn.algolia.net', 'places-1.algolianet.com', 'places-2.algolianet.com', 'places-3.algolianet.com' ]; // allow initPlaces() no arguments => community rate limited if (arguments.length === 0 || typeof appID === 'object' || appID === undefined) { appID = ''; apiKey = ''; opts._allowEmptyCredentials = true; } var client = algoliasearch(appID, apiKey, opts); var index = client.initIndex('places'); index.search = buildSearchMethod('query', '/1/places/query'); index.getObject = function(objectID, callback) { return this.as._jsonRequest({ method: 'GET', url: '/1/places/' + encodeURIComponent(objectID), hostType: 'read', callback: callback }); }; return index; }; } },{"24":24,"25":25}],34:[function(require,module,exports){ (function (global){ var debug = require(1)('algoliasearch:src/hostIndexState.js'); var localStorageNamespace = 'algoliasearch-client-js'; var store; var moduleStore = { state: {}, set: function(key, data) { this.state[key] = data; return this.state[key]; }, get: function(key) { return this.state[key] || null; } }; var localStorageStore = { set: function(key, data) { moduleStore.set(key, data); // always replicate localStorageStore to moduleStore in case of failure try { var namespace = JSON.parse(global.localStorage[localStorageNamespace]); namespace[key] = data; global.localStorage[localStorageNamespace] = JSON.stringify(namespace); return namespace[key]; } catch (e) { return localStorageFailure(key, e); } }, get: function(key) { try { return JSON.parse(global.localStorage[localStorageNamespace])[key] || null; } catch (e) { return localStorageFailure(key, e); } } }; function localStorageFailure(key, e) { debug('localStorage failed with', e); cleanup(); store = moduleStore; return store.get(key); } store = supportsLocalStorage() ? localStorageStore : moduleStore; module.exports = { get: getOrSet, set: getOrSet, supportsLocalStorage: supportsLocalStorage }; function getOrSet(key, data) { if (arguments.length === 1) { return store.get(key); } return store.set(key, data); } function supportsLocalStorage() { try { if ('localStorage' in global && global.localStorage !== null) { if (!global.localStorage[localStorageNamespace]) { // actual creation of the namespace global.localStorage.setItem(localStorageNamespace, JSON.stringify({})); } return true; } return false; } catch (_) { return false; } } // In case of any error on localStorage, we clean our own namespace, this should handle // quota errors when a lot of keys + data are used function cleanup() { try { global.localStorage.removeItem(localStorageNamespace); } catch (_) { // nothing to do } } }).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {}) },{"1":1}],35:[function(require,module,exports){ 'use strict'; module.exports = '3.24.2'; },{}]},{},[19])(19) });
demos/forms-demo/src/components/Fields/Input/index.js
FWeinb/cerebral
import React from 'react' import {connect} from 'cerebral/react' import {state, props, signal} from 'cerebral/tags' import {css} from 'aphrodite' import styles from './styles' export default connect({ field: state`${props`path`}.**`, settings: state`app.settings.**`, fieldChanged: signal`simple.fieldChanged` }, function Input ({name, field, path, settings, fieldChanged}) { function onChange (e) { fieldChanged({ field: path, value: e.target.value, settingsField: 'app.settings.validateOnChange' }) } function onBlur (e) { fieldChanged({ field: path, value: e.target.value, settingsField: 'app.settings.validateInputOnBlur' }) } function renderError () { const {errorMessage} = field const {showErrors} = settings return ( <div style={{color: '#d64242', fontSize: 11}}> {showErrors && errorMessage} </div> ) } return ( <div style={{marginTop: 10, fontSize: 14}}> {name} {field.isRequired ? '*' : ''}<br /> <input onChange={(e) => onChange(e)} onBlur={(e) => onBlur(e)} value={field.value} type={'text'} className={css(styles.input)} /> {renderError()} </div> ) } )
assets/src/containers/Applications/TagModal/index.js
mmillet/mock-server
/** * Tag modal * Created by zhengguo.chen on 18/06/11. */ import React from 'react'; import _ from 'lodash'; import {bindActionCreators} from 'redux'; import {connect} from 'react-redux'; import request, {METHODS} from 'utils/request'; import appsActions from 'actions/apps'; import rootActions from 'actions/root'; import {API_CURRENT_TAG} from 'constants/config'; import brace from 'brace'; import AceEditor from 'react-ace'; import 'brace/mode/diff'; import 'brace/theme/github'; import isEqual from 'is-equal-shallow'; import {forEach} from 'lodash'; import {Modal, Select, Spin, Popconfirm, message} from 'antd'; const Option = Select.Option; import STYLE from './style.less'; var TagModal = React.createClass({ getInitialState() { return { selectTag: '', loading: false, content: '', } }, onChangeTag(tag, item) { var {actions, tags, appId, apiId} = this.props; this.setState({selectTag: tag}); var index = _.findIndex(tags, _tag => tag === _tag); var tagPrev = tags[index + 1] || ''; this.setState({loading: true}); actions.getApiTagDiff(appId, apiId, {tag, tagPrev}).then(res => { this.setState({loading: false}); if(!res.error) { this.setState({content: res.payload}); } }); }, onDeleteTag() { var {actions, appId, apiId, onDeleteTag = () => {}} = this.props; var {selectTag} = this.state; actions.deleteApiTag(appId, apiId, selectTag).then(res => { if(!res.error) { message.success('Delete tag successfully!'); onDeleteTag(); } }); }, componentDidMount() { var {tags} = this.props; this.onChangeTag(tags[0]); }, componentWillReceiveProps(nextProps) { if(this.props.tags !== nextProps.tags) { this.setState({selectTag: nextProps.tags[0]}); } }, render() { var {root, tags, ...props} = this.props; var {selectTag, content, loading} = this.state; return ( <Modal visible={true} title="Api Tag Diff" width={740} footer={null} {...props} > <div className={STYLE.head} ref="head"> <span>Select to diff: </span> <Select style={{width: 200}} value={selectTag} onChange={this.onChangeTag}> { tags.map((tag, index) => { return <Option key={tag} value={tag}>{tag}{index === 0 ? ' (Current)' : ''}</Option> }) } </Select> { selectTag !== API_CURRENT_TAG ? <Popconfirm getTooltipContainer={() => this.refs.head} title={<span>Are you sure to delete tag <strong>{selectTag}</strong> ?</span>} placement="rightTop" onConfirm={this.onDeleteTag} okText="Yes" cancelText="No"> <a>Delete</a> </Popconfirm> : null } </div> <Spin spinning={loading}> <div className={STYLE.content}> <AceEditor value={content || 'Nothing changed'} mode="diff" theme="github" name="diff_ace" showGutter={false} readOnly={true} wrapEnabled={true} tabSize={1} height={600} width={'100%'} showPrintMargin={false} editorProps={{$blockScrolling: true, cursorStyle: 'smooth'}} setOptions={{displayIndentGuides: false}} /> </div> </Spin> </Modal> ); } }); const mapStateToProps = ({root}) => ({root}); const mapDispatchToProps = (dispatch) => ({actions: bindActionCreators({...appsActions, ...rootActions}, dispatch)}); export default connect(mapStateToProps, mapDispatchToProps)(TagModal);
docs/src/pages/components/links/Links.js
kybarg/material-ui
/* eslint-disable no-script-url */ import React from 'react'; import { makeStyles } from '@material-ui/core/styles'; import Link from '@material-ui/core/Link'; import Typography from '@material-ui/core/Typography'; const useStyles = makeStyles(theme => ({ link: { margin: theme.spacing(1), }, })); // This resolves to nothing and doesn't affect browser history const dudUrl = 'javascript:;'; export default function Links() { const classes = useStyles(); return ( <Typography> <Link href={dudUrl} className={classes.link}> Link </Link> <Link href={dudUrl} color="inherit" className={classes.link}> {'color="inherit"'} </Link> <Link href={dudUrl} variant="body2" className={classes.link}> {'variant="body2"'} </Link> </Typography> ); }
vendors/jquery-1.9.1.min.js
honeyleo/Bootstrap-Admin-Theme
/*! jQuery v1.9.1 | (c) 2005, 2012 jQuery Foundation, Inc. | jquery.org/license //@ sourceMappingURL=jquery.min.map */(function(e,t){var n,r,i=typeof t,o=e.document,a=e.location,s=e.jQuery,u=e.$,l={},c=[],p="1.9.1",f=c.concat,d=c.push,h=c.slice,g=c.indexOf,m=l.toString,y=l.hasOwnProperty,v=p.trim,b=function(e,t){return new b.fn.init(e,t,r)},x=/[+-]?(?:\d*\.|)\d+(?:[eE][+-]?\d+|)/.source,w=/\S+/g,T=/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,N=/^(?:(<[\w\W]+>)[^>]*|#([\w-]*))$/,C=/^<(\w+)\s*\/?>(?:<\/\1>|)$/,k=/^[\],:{}\s]*$/,E=/(?:^|:|,)(?:\s*\[)+/g,S=/\\(?:["\\\/bfnrt]|u[\da-fA-F]{4})/g,A=/"[^"\\\r\n]*"|true|false|null|-?(?:\d+\.|)\d+(?:[eE][+-]?\d+|)/g,j=/^-ms-/,D=/-([\da-z])/gi,L=function(e,t){return t.toUpperCase()},H=function(e){(o.addEventListener||"load"===e.type||"complete"===o.readyState)&&(q(),b.ready())},q=function(){o.addEventListener?(o.removeEventListener("DOMContentLoaded",H,!1),e.removeEventListener("load",H,!1)):(o.detachEvent("onreadystatechange",H),e.detachEvent("onload",H))};b.fn=b.prototype={jquery:p,constructor:b,init:function(e,n,r){var i,a;if(!e)return this;if("string"==typeof e){if(i="<"===e.charAt(0)&&">"===e.charAt(e.length-1)&&e.length>=3?[null,e,null]:N.exec(e),!i||!i[1]&&n)return!n||n.jquery?(n||r).find(e):this.constructor(n).find(e);if(i[1]){if(n=n instanceof b?n[0]:n,b.merge(this,b.parseHTML(i[1],n&&n.nodeType?n.ownerDocument||n:o,!0)),C.test(i[1])&&b.isPlainObject(n))for(i in n)b.isFunction(this[i])?this[i](n[i]):this.attr(i,n[i]);return this}if(a=o.getElementById(i[2]),a&&a.parentNode){if(a.id!==i[2])return r.find(e);this.length=1,this[0]=a}return this.context=o,this.selector=e,this}return e.nodeType?(this.context=this[0]=e,this.length=1,this):b.isFunction(e)?r.ready(e):(e.selector!==t&&(this.selector=e.selector,this.context=e.context),b.makeArray(e,this))},selector:"",length:0,size:function(){return this.length},toArray:function(){return h.call(this)},get:function(e){return null==e?this.toArray():0>e?this[this.length+e]:this[e]},pushStack:function(e){var t=b.merge(this.constructor(),e);return t.prevObject=this,t.context=this.context,t},each:function(e,t){return b.each(this,e,t)},ready:function(e){return b.ready.promise().done(e),this},slice:function(){return this.pushStack(h.apply(this,arguments))},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},eq:function(e){var t=this.length,n=+e+(0>e?t:0);return this.pushStack(n>=0&&t>n?[this[n]]:[])},map:function(e){return this.pushStack(b.map(this,function(t,n){return e.call(t,n,t)}))},end:function(){return this.prevObject||this.constructor(null)},push:d,sort:[].sort,splice:[].splice},b.fn.init.prototype=b.fn,b.extend=b.fn.extend=function(){var e,n,r,i,o,a,s=arguments[0]||{},u=1,l=arguments.length,c=!1;for("boolean"==typeof s&&(c=s,s=arguments[1]||{},u=2),"object"==typeof s||b.isFunction(s)||(s={}),l===u&&(s=this,--u);l>u;u++)if(null!=(o=arguments[u]))for(i in o)e=s[i],r=o[i],s!==r&&(c&&r&&(b.isPlainObject(r)||(n=b.isArray(r)))?(n?(n=!1,a=e&&b.isArray(e)?e:[]):a=e&&b.isPlainObject(e)?e:{},s[i]=b.extend(c,a,r)):r!==t&&(s[i]=r));return s},b.extend({noConflict:function(t){return e.$===b&&(e.$=u),t&&e.jQuery===b&&(e.jQuery=s),b},isReady:!1,readyWait:1,holdReady:function(e){e?b.readyWait++:b.ready(!0)},ready:function(e){if(e===!0?!--b.readyWait:!b.isReady){if(!o.body)return setTimeout(b.ready);b.isReady=!0,e!==!0&&--b.readyWait>0||(n.resolveWith(o,[b]),b.fn.trigger&&b(o).trigger("ready").off("ready"))}},isFunction:function(e){return"function"===b.type(e)},isArray:Array.isArray||function(e){return"array"===b.type(e)},isWindow:function(e){return null!=e&&e==e.window},isNumeric:function(e){return!isNaN(parseFloat(e))&&isFinite(e)},type:function(e){return null==e?e+"":"object"==typeof e||"function"==typeof e?l[m.call(e)]||"object":typeof e},isPlainObject:function(e){if(!e||"object"!==b.type(e)||e.nodeType||b.isWindow(e))return!1;try{if(e.constructor&&!y.call(e,"constructor")&&!y.call(e.constructor.prototype,"isPrototypeOf"))return!1}catch(n){return!1}var r;for(r in e);return r===t||y.call(e,r)},isEmptyObject:function(e){var t;for(t in e)return!1;return!0},error:function(e){throw Error(e)},parseHTML:function(e,t,n){if(!e||"string"!=typeof e)return null;"boolean"==typeof t&&(n=t,t=!1),t=t||o;var r=C.exec(e),i=!n&&[];return r?[t.createElement(r[1])]:(r=b.buildFragment([e],t,i),i&&b(i).remove(),b.merge([],r.childNodes))},parseJSON:function(n){return e.JSON&&e.JSON.parse?e.JSON.parse(n):null===n?n:"string"==typeof n&&(n=b.trim(n),n&&k.test(n.replace(S,"@").replace(A,"]").replace(E,"")))?Function("return "+n)():(b.error("Invalid JSON: "+n),t)},parseXML:function(n){var r,i;if(!n||"string"!=typeof n)return null;try{e.DOMParser?(i=new DOMParser,r=i.parseFromString(n,"text/xml")):(r=new ActiveXObject("Microsoft.XMLDOM"),r.async="false",r.loadXML(n))}catch(o){r=t}return r&&r.documentElement&&!r.getElementsByTagName("parsererror").length||b.error("Invalid XML: "+n),r},noop:function(){},globalEval:function(t){t&&b.trim(t)&&(e.execScript||function(t){e.eval.call(e,t)})(t)},camelCase:function(e){return e.replace(j,"ms-").replace(D,L)},nodeName:function(e,t){return e.nodeName&&e.nodeName.toLowerCase()===t.toLowerCase()},each:function(e,t,n){var r,i=0,o=e.length,a=M(e);if(n){if(a){for(;o>i;i++)if(r=t.apply(e[i],n),r===!1)break}else for(i in e)if(r=t.apply(e[i],n),r===!1)break}else if(a){for(;o>i;i++)if(r=t.call(e[i],i,e[i]),r===!1)break}else for(i in e)if(r=t.call(e[i],i,e[i]),r===!1)break;return e},trim:v&&!v.call("\ufeff\u00a0")?function(e){return null==e?"":v.call(e)}:function(e){return null==e?"":(e+"").replace(T,"")},makeArray:function(e,t){var n=t||[];return null!=e&&(M(Object(e))?b.merge(n,"string"==typeof e?[e]:e):d.call(n,e)),n},inArray:function(e,t,n){var r;if(t){if(g)return g.call(t,e,n);for(r=t.length,n=n?0>n?Math.max(0,r+n):n:0;r>n;n++)if(n in t&&t[n]===e)return n}return-1},merge:function(e,n){var r=n.length,i=e.length,o=0;if("number"==typeof r)for(;r>o;o++)e[i++]=n[o];else while(n[o]!==t)e[i++]=n[o++];return e.length=i,e},grep:function(e,t,n){var r,i=[],o=0,a=e.length;for(n=!!n;a>o;o++)r=!!t(e[o],o),n!==r&&i.push(e[o]);return i},map:function(e,t,n){var r,i=0,o=e.length,a=M(e),s=[];if(a)for(;o>i;i++)r=t(e[i],i,n),null!=r&&(s[s.length]=r);else for(i in e)r=t(e[i],i,n),null!=r&&(s[s.length]=r);return f.apply([],s)},guid:1,proxy:function(e,n){var r,i,o;return"string"==typeof n&&(o=e[n],n=e,e=o),b.isFunction(e)?(r=h.call(arguments,2),i=function(){return e.apply(n||this,r.concat(h.call(arguments)))},i.guid=e.guid=e.guid||b.guid++,i):t},access:function(e,n,r,i,o,a,s){var u=0,l=e.length,c=null==r;if("object"===b.type(r)){o=!0;for(u in r)b.access(e,n,u,r[u],!0,a,s)}else if(i!==t&&(o=!0,b.isFunction(i)||(s=!0),c&&(s?(n.call(e,i),n=null):(c=n,n=function(e,t,n){return c.call(b(e),n)})),n))for(;l>u;u++)n(e[u],r,s?i:i.call(e[u],u,n(e[u],r)));return o?e:c?n.call(e):l?n(e[0],r):a},now:function(){return(new Date).getTime()}}),b.ready.promise=function(t){if(!n)if(n=b.Deferred(),"complete"===o.readyState)setTimeout(b.ready);else if(o.addEventListener)o.addEventListener("DOMContentLoaded",H,!1),e.addEventListener("load",H,!1);else{o.attachEvent("onreadystatechange",H),e.attachEvent("onload",H);var r=!1;try{r=null==e.frameElement&&o.documentElement}catch(i){}r&&r.doScroll&&function a(){if(!b.isReady){try{r.doScroll("left")}catch(e){return setTimeout(a,50)}q(),b.ready()}}()}return n.promise(t)},b.each("Boolean Number String Function Array Date RegExp Object Error".split(" "),function(e,t){l["[object "+t+"]"]=t.toLowerCase()});function M(e){var t=e.length,n=b.type(e);return b.isWindow(e)?!1:1===e.nodeType&&t?!0:"array"===n||"function"!==n&&(0===t||"number"==typeof t&&t>0&&t-1 in e)}r=b(o);var _={};function F(e){var t=_[e]={};return b.each(e.match(w)||[],function(e,n){t[n]=!0}),t}b.Callbacks=function(e){e="string"==typeof e?_[e]||F(e):b.extend({},e);var n,r,i,o,a,s,u=[],l=!e.once&&[],c=function(t){for(r=e.memory&&t,i=!0,a=s||0,s=0,o=u.length,n=!0;u&&o>a;a++)if(u[a].apply(t[0],t[1])===!1&&e.stopOnFalse){r=!1;break}n=!1,u&&(l?l.length&&c(l.shift()):r?u=[]:p.disable())},p={add:function(){if(u){var t=u.length;(function i(t){b.each(t,function(t,n){var r=b.type(n);"function"===r?e.unique&&p.has(n)||u.push(n):n&&n.length&&"string"!==r&&i(n)})})(arguments),n?o=u.length:r&&(s=t,c(r))}return this},remove:function(){return u&&b.each(arguments,function(e,t){var r;while((r=b.inArray(t,u,r))>-1)u.splice(r,1),n&&(o>=r&&o--,a>=r&&a--)}),this},has:function(e){return e?b.inArray(e,u)>-1:!(!u||!u.length)},empty:function(){return u=[],this},disable:function(){return u=l=r=t,this},disabled:function(){return!u},lock:function(){return l=t,r||p.disable(),this},locked:function(){return!l},fireWith:function(e,t){return t=t||[],t=[e,t.slice?t.slice():t],!u||i&&!l||(n?l.push(t):c(t)),this},fire:function(){return p.fireWith(this,arguments),this},fired:function(){return!!i}};return p},b.extend({Deferred:function(e){var t=[["resolve","done",b.Callbacks("once memory"),"resolved"],["reject","fail",b.Callbacks("once memory"),"rejected"],["notify","progress",b.Callbacks("memory")]],n="pending",r={state:function(){return n},always:function(){return i.done(arguments).fail(arguments),this},then:function(){var e=arguments;return b.Deferred(function(n){b.each(t,function(t,o){var a=o[0],s=b.isFunction(e[t])&&e[t];i[o[1]](function(){var e=s&&s.apply(this,arguments);e&&b.isFunction(e.promise)?e.promise().done(n.resolve).fail(n.reject).progress(n.notify):n[a+"With"](this===r?n.promise():this,s?[e]:arguments)})}),e=null}).promise()},promise:function(e){return null!=e?b.extend(e,r):r}},i={};return r.pipe=r.then,b.each(t,function(e,o){var a=o[2],s=o[3];r[o[1]]=a.add,s&&a.add(function(){n=s},t[1^e][2].disable,t[2][2].lock),i[o[0]]=function(){return i[o[0]+"With"](this===i?r:this,arguments),this},i[o[0]+"With"]=a.fireWith}),r.promise(i),e&&e.call(i,i),i},when:function(e){var t=0,n=h.call(arguments),r=n.length,i=1!==r||e&&b.isFunction(e.promise)?r:0,o=1===i?e:b.Deferred(),a=function(e,t,n){return function(r){t[e]=this,n[e]=arguments.length>1?h.call(arguments):r,n===s?o.notifyWith(t,n):--i||o.resolveWith(t,n)}},s,u,l;if(r>1)for(s=Array(r),u=Array(r),l=Array(r);r>t;t++)n[t]&&b.isFunction(n[t].promise)?n[t].promise().done(a(t,l,n)).fail(o.reject).progress(a(t,u,s)):--i;return i||o.resolveWith(l,n),o.promise()}}),b.support=function(){var t,n,r,a,s,u,l,c,p,f,d=o.createElement("div");if(d.setAttribute("className","t"),d.innerHTML=" <link/><table></table><a href='/a'>a</a><input type='checkbox'/>",n=d.getElementsByTagName("*"),r=d.getElementsByTagName("a")[0],!n||!r||!n.length)return{};s=o.createElement("select"),l=s.appendChild(o.createElement("option")),a=d.getElementsByTagName("input")[0],r.style.cssText="top:1px;float:left;opacity:.5",t={getSetAttribute:"t"!==d.className,leadingWhitespace:3===d.firstChild.nodeType,tbody:!d.getElementsByTagName("tbody").length,htmlSerialize:!!d.getElementsByTagName("link").length,style:/top/.test(r.getAttribute("style")),hrefNormalized:"/a"===r.getAttribute("href"),opacity:/^0.5/.test(r.style.opacity),cssFloat:!!r.style.cssFloat,checkOn:!!a.value,optSelected:l.selected,enctype:!!o.createElement("form").enctype,html5Clone:"<:nav></:nav>"!==o.createElement("nav").cloneNode(!0).outerHTML,boxModel:"CSS1Compat"===o.compatMode,deleteExpando:!0,noCloneEvent:!0,inlineBlockNeedsLayout:!1,shrinkWrapBlocks:!1,reliableMarginRight:!0,boxSizingReliable:!0,pixelPosition:!1},a.checked=!0,t.noCloneChecked=a.cloneNode(!0).checked,s.disabled=!0,t.optDisabled=!l.disabled;try{delete d.test}catch(h){t.deleteExpando=!1}a=o.createElement("input"),a.setAttribute("value",""),t.input=""===a.getAttribute("value"),a.value="t",a.setAttribute("type","radio"),t.radioValue="t"===a.value,a.setAttribute("checked","t"),a.setAttribute("name","t"),u=o.createDocumentFragment(),u.appendChild(a),t.appendChecked=a.checked,t.checkClone=u.cloneNode(!0).cloneNode(!0).lastChild.checked,d.attachEvent&&(d.attachEvent("onclick",function(){t.noCloneEvent=!1}),d.cloneNode(!0).click());for(f in{submit:!0,change:!0,focusin:!0})d.setAttribute(c="on"+f,"t"),t[f+"Bubbles"]=c in e||d.attributes[c].expando===!1;return d.style.backgroundClip="content-box",d.cloneNode(!0).style.backgroundClip="",t.clearCloneStyle="content-box"===d.style.backgroundClip,b(function(){var n,r,a,s="padding:0;margin:0;border:0;display:block;box-sizing:content-box;-moz-box-sizing:content-box;-webkit-box-sizing:content-box;",u=o.getElementsByTagName("body")[0];u&&(n=o.createElement("div"),n.style.cssText="border:0;width:0;height:0;position:absolute;top:0;left:-9999px;margin-top:1px",u.appendChild(n).appendChild(d),d.innerHTML="<table><tr><td></td><td>t</td></tr></table>",a=d.getElementsByTagName("td"),a[0].style.cssText="padding:0;margin:0;border:0;display:none",p=0===a[0].offsetHeight,a[0].style.display="",a[1].style.display="none",t.reliableHiddenOffsets=p&&0===a[0].offsetHeight,d.innerHTML="",d.style.cssText="box-sizing:border-box;-moz-box-sizing:border-box;-webkit-box-sizing:border-box;padding:1px;border:1px;display:block;width:4px;margin-top:1%;position:absolute;top:1%;",t.boxSizing=4===d.offsetWidth,t.doesNotIncludeMarginInBodyOffset=1!==u.offsetTop,e.getComputedStyle&&(t.pixelPosition="1%"!==(e.getComputedStyle(d,null)||{}).top,t.boxSizingReliable="4px"===(e.getComputedStyle(d,null)||{width:"4px"}).width,r=d.appendChild(o.createElement("div")),r.style.cssText=d.style.cssText=s,r.style.marginRight=r.style.width="0",d.style.width="1px",t.reliableMarginRight=!parseFloat((e.getComputedStyle(r,null)||{}).marginRight)),typeof d.style.zoom!==i&&(d.innerHTML="",d.style.cssText=s+"width:1px;padding:1px;display:inline;zoom:1",t.inlineBlockNeedsLayout=3===d.offsetWidth,d.style.display="block",d.innerHTML="<div></div>",d.firstChild.style.width="5px",t.shrinkWrapBlocks=3!==d.offsetWidth,t.inlineBlockNeedsLayout&&(u.style.zoom=1)),u.removeChild(n),n=d=a=r=null)}),n=s=u=l=r=a=null,t}();var O=/(?:\{[\s\S]*\}|\[[\s\S]*\])$/,B=/([A-Z])/g;function P(e,n,r,i){if(b.acceptData(e)){var o,a,s=b.expando,u="string"==typeof n,l=e.nodeType,p=l?b.cache:e,f=l?e[s]:e[s]&&s;if(f&&p[f]&&(i||p[f].data)||!u||r!==t)return f||(l?e[s]=f=c.pop()||b.guid++:f=s),p[f]||(p[f]={},l||(p[f].toJSON=b.noop)),("object"==typeof n||"function"==typeof n)&&(i?p[f]=b.extend(p[f],n):p[f].data=b.extend(p[f].data,n)),o=p[f],i||(o.data||(o.data={}),o=o.data),r!==t&&(o[b.camelCase(n)]=r),u?(a=o[n],null==a&&(a=o[b.camelCase(n)])):a=o,a}}function R(e,t,n){if(b.acceptData(e)){var r,i,o,a=e.nodeType,s=a?b.cache:e,u=a?e[b.expando]:b.expando;if(s[u]){if(t&&(o=n?s[u]:s[u].data)){b.isArray(t)?t=t.concat(b.map(t,b.camelCase)):t in o?t=[t]:(t=b.camelCase(t),t=t in o?[t]:t.split(" "));for(r=0,i=t.length;i>r;r++)delete o[t[r]];if(!(n?$:b.isEmptyObject)(o))return}(n||(delete s[u].data,$(s[u])))&&(a?b.cleanData([e],!0):b.support.deleteExpando||s!=s.window?delete s[u]:s[u]=null)}}}b.extend({cache:{},expando:"jQuery"+(p+Math.random()).replace(/\D/g,""),noData:{embed:!0,object:"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000",applet:!0},hasData:function(e){return e=e.nodeType?b.cache[e[b.expando]]:e[b.expando],!!e&&!$(e)},data:function(e,t,n){return P(e,t,n)},removeData:function(e,t){return R(e,t)},_data:function(e,t,n){return P(e,t,n,!0)},_removeData:function(e,t){return R(e,t,!0)},acceptData:function(e){if(e.nodeType&&1!==e.nodeType&&9!==e.nodeType)return!1;var t=e.nodeName&&b.noData[e.nodeName.toLowerCase()];return!t||t!==!0&&e.getAttribute("classid")===t}}),b.fn.extend({data:function(e,n){var r,i,o=this[0],a=0,s=null;if(e===t){if(this.length&&(s=b.data(o),1===o.nodeType&&!b._data(o,"parsedAttrs"))){for(r=o.attributes;r.length>a;a++)i=r[a].name,i.indexOf("data-")||(i=b.camelCase(i.slice(5)),W(o,i,s[i]));b._data(o,"parsedAttrs",!0)}return s}return"object"==typeof e?this.each(function(){b.data(this,e)}):b.access(this,function(n){return n===t?o?W(o,e,b.data(o,e)):null:(this.each(function(){b.data(this,e,n)}),t)},null,n,arguments.length>1,null,!0)},removeData:function(e){return this.each(function(){b.removeData(this,e)})}});function W(e,n,r){if(r===t&&1===e.nodeType){var i="data-"+n.replace(B,"-$1").toLowerCase();if(r=e.getAttribute(i),"string"==typeof r){try{r="true"===r?!0:"false"===r?!1:"null"===r?null:+r+""===r?+r:O.test(r)?b.parseJSON(r):r}catch(o){}b.data(e,n,r)}else r=t}return r}function $(e){var t;for(t in e)if(("data"!==t||!b.isEmptyObject(e[t]))&&"toJSON"!==t)return!1;return!0}b.extend({queue:function(e,n,r){var i;return e?(n=(n||"fx")+"queue",i=b._data(e,n),r&&(!i||b.isArray(r)?i=b._data(e,n,b.makeArray(r)):i.push(r)),i||[]):t},dequeue:function(e,t){t=t||"fx";var n=b.queue(e,t),r=n.length,i=n.shift(),o=b._queueHooks(e,t),a=function(){b.dequeue(e,t)};"inprogress"===i&&(i=n.shift(),r--),o.cur=i,i&&("fx"===t&&n.unshift("inprogress"),delete o.stop,i.call(e,a,o)),!r&&o&&o.empty.fire()},_queueHooks:function(e,t){var n=t+"queueHooks";return b._data(e,n)||b._data(e,n,{empty:b.Callbacks("once memory").add(function(){b._removeData(e,t+"queue"),b._removeData(e,n)})})}}),b.fn.extend({queue:function(e,n){var r=2;return"string"!=typeof e&&(n=e,e="fx",r--),r>arguments.length?b.queue(this[0],e):n===t?this:this.each(function(){var t=b.queue(this,e,n);b._queueHooks(this,e),"fx"===e&&"inprogress"!==t[0]&&b.dequeue(this,e)})},dequeue:function(e){return this.each(function(){b.dequeue(this,e)})},delay:function(e,t){return e=b.fx?b.fx.speeds[e]||e:e,t=t||"fx",this.queue(t,function(t,n){var r=setTimeout(t,e);n.stop=function(){clearTimeout(r)}})},clearQueue:function(e){return this.queue(e||"fx",[])},promise:function(e,n){var r,i=1,o=b.Deferred(),a=this,s=this.length,u=function(){--i||o.resolveWith(a,[a])};"string"!=typeof e&&(n=e,e=t),e=e||"fx";while(s--)r=b._data(a[s],e+"queueHooks"),r&&r.empty&&(i++,r.empty.add(u));return u(),o.promise(n)}});var I,z,X=/[\t\r\n]/g,U=/\r/g,V=/^(?:input|select|textarea|button|object)$/i,Y=/^(?:a|area)$/i,J=/^(?:checked|selected|autofocus|autoplay|async|controls|defer|disabled|hidden|loop|multiple|open|readonly|required|scoped)$/i,G=/^(?:checked|selected)$/i,Q=b.support.getSetAttribute,K=b.support.input;b.fn.extend({attr:function(e,t){return b.access(this,b.attr,e,t,arguments.length>1)},removeAttr:function(e){return this.each(function(){b.removeAttr(this,e)})},prop:function(e,t){return b.access(this,b.prop,e,t,arguments.length>1)},removeProp:function(e){return e=b.propFix[e]||e,this.each(function(){try{this[e]=t,delete this[e]}catch(n){}})},addClass:function(e){var t,n,r,i,o,a=0,s=this.length,u="string"==typeof e&&e;if(b.isFunction(e))return this.each(function(t){b(this).addClass(e.call(this,t,this.className))});if(u)for(t=(e||"").match(w)||[];s>a;a++)if(n=this[a],r=1===n.nodeType&&(n.className?(" "+n.className+" ").replace(X," "):" ")){o=0;while(i=t[o++])0>r.indexOf(" "+i+" ")&&(r+=i+" ");n.className=b.trim(r)}return this},removeClass:function(e){var t,n,r,i,o,a=0,s=this.length,u=0===arguments.length||"string"==typeof e&&e;if(b.isFunction(e))return this.each(function(t){b(this).removeClass(e.call(this,t,this.className))});if(u)for(t=(e||"").match(w)||[];s>a;a++)if(n=this[a],r=1===n.nodeType&&(n.className?(" "+n.className+" ").replace(X," "):"")){o=0;while(i=t[o++])while(r.indexOf(" "+i+" ")>=0)r=r.replace(" "+i+" "," ");n.className=e?b.trim(r):""}return this},toggleClass:function(e,t){var n=typeof e,r="boolean"==typeof t;return b.isFunction(e)?this.each(function(n){b(this).toggleClass(e.call(this,n,this.className,t),t)}):this.each(function(){if("string"===n){var o,a=0,s=b(this),u=t,l=e.match(w)||[];while(o=l[a++])u=r?u:!s.hasClass(o),s[u?"addClass":"removeClass"](o)}else(n===i||"boolean"===n)&&(this.className&&b._data(this,"__className__",this.className),this.className=this.className||e===!1?"":b._data(this,"__className__")||"")})},hasClass:function(e){var t=" "+e+" ",n=0,r=this.length;for(;r>n;n++)if(1===this[n].nodeType&&(" "+this[n].className+" ").replace(X," ").indexOf(t)>=0)return!0;return!1},val:function(e){var n,r,i,o=this[0];{if(arguments.length)return i=b.isFunction(e),this.each(function(n){var o,a=b(this);1===this.nodeType&&(o=i?e.call(this,n,a.val()):e,null==o?o="":"number"==typeof o?o+="":b.isArray(o)&&(o=b.map(o,function(e){return null==e?"":e+""})),r=b.valHooks[this.type]||b.valHooks[this.nodeName.toLowerCase()],r&&"set"in r&&r.set(this,o,"value")!==t||(this.value=o))});if(o)return r=b.valHooks[o.type]||b.valHooks[o.nodeName.toLowerCase()],r&&"get"in r&&(n=r.get(o,"value"))!==t?n:(n=o.value,"string"==typeof n?n.replace(U,""):null==n?"":n)}}}),b.extend({valHooks:{option:{get:function(e){var t=e.attributes.value;return!t||t.specified?e.value:e.text}},select:{get:function(e){var t,n,r=e.options,i=e.selectedIndex,o="select-one"===e.type||0>i,a=o?null:[],s=o?i+1:r.length,u=0>i?s:o?i:0;for(;s>u;u++)if(n=r[u],!(!n.selected&&u!==i||(b.support.optDisabled?n.disabled:null!==n.getAttribute("disabled"))||n.parentNode.disabled&&b.nodeName(n.parentNode,"optgroup"))){if(t=b(n).val(),o)return t;a.push(t)}return a},set:function(e,t){var n=b.makeArray(t);return b(e).find("option").each(function(){this.selected=b.inArray(b(this).val(),n)>=0}),n.length||(e.selectedIndex=-1),n}}},attr:function(e,n,r){var o,a,s,u=e.nodeType;if(e&&3!==u&&8!==u&&2!==u)return typeof e.getAttribute===i?b.prop(e,n,r):(a=1!==u||!b.isXMLDoc(e),a&&(n=n.toLowerCase(),o=b.attrHooks[n]||(J.test(n)?z:I)),r===t?o&&a&&"get"in o&&null!==(s=o.get(e,n))?s:(typeof e.getAttribute!==i&&(s=e.getAttribute(n)),null==s?t:s):null!==r?o&&a&&"set"in o&&(s=o.set(e,r,n))!==t?s:(e.setAttribute(n,r+""),r):(b.removeAttr(e,n),t))},removeAttr:function(e,t){var n,r,i=0,o=t&&t.match(w);if(o&&1===e.nodeType)while(n=o[i++])r=b.propFix[n]||n,J.test(n)?!Q&&G.test(n)?e[b.camelCase("default-"+n)]=e[r]=!1:e[r]=!1:b.attr(e,n,""),e.removeAttribute(Q?n:r)},attrHooks:{type:{set:function(e,t){if(!b.support.radioValue&&"radio"===t&&b.nodeName(e,"input")){var n=e.value;return e.setAttribute("type",t),n&&(e.value=n),t}}}},propFix:{tabindex:"tabIndex",readonly:"readOnly","for":"htmlFor","class":"className",maxlength:"maxLength",cellspacing:"cellSpacing",cellpadding:"cellPadding",rowspan:"rowSpan",colspan:"colSpan",usemap:"useMap",frameborder:"frameBorder",contenteditable:"contentEditable"},prop:function(e,n,r){var i,o,a,s=e.nodeType;if(e&&3!==s&&8!==s&&2!==s)return a=1!==s||!b.isXMLDoc(e),a&&(n=b.propFix[n]||n,o=b.propHooks[n]),r!==t?o&&"set"in o&&(i=o.set(e,r,n))!==t?i:e[n]=r:o&&"get"in o&&null!==(i=o.get(e,n))?i:e[n]},propHooks:{tabIndex:{get:function(e){var n=e.getAttributeNode("tabindex");return n&&n.specified?parseInt(n.value,10):V.test(e.nodeName)||Y.test(e.nodeName)&&e.href?0:t}}}}),z={get:function(e,n){var r=b.prop(e,n),i="boolean"==typeof r&&e.getAttribute(n),o="boolean"==typeof r?K&&Q?null!=i:G.test(n)?e[b.camelCase("default-"+n)]:!!i:e.getAttributeNode(n);return o&&o.value!==!1?n.toLowerCase():t},set:function(e,t,n){return t===!1?b.removeAttr(e,n):K&&Q||!G.test(n)?e.setAttribute(!Q&&b.propFix[n]||n,n):e[b.camelCase("default-"+n)]=e[n]=!0,n}},K&&Q||(b.attrHooks.value={get:function(e,n){var r=e.getAttributeNode(n);return b.nodeName(e,"input")?e.defaultValue:r&&r.specified?r.value:t},set:function(e,n,r){return b.nodeName(e,"input")?(e.defaultValue=n,t):I&&I.set(e,n,r)}}),Q||(I=b.valHooks.button={get:function(e,n){var r=e.getAttributeNode(n);return r&&("id"===n||"name"===n||"coords"===n?""!==r.value:r.specified)?r.value:t},set:function(e,n,r){var i=e.getAttributeNode(r);return i||e.setAttributeNode(i=e.ownerDocument.createAttribute(r)),i.value=n+="","value"===r||n===e.getAttribute(r)?n:t}},b.attrHooks.contenteditable={get:I.get,set:function(e,t,n){I.set(e,""===t?!1:t,n)}},b.each(["width","height"],function(e,n){b.attrHooks[n]=b.extend(b.attrHooks[n],{set:function(e,r){return""===r?(e.setAttribute(n,"auto"),r):t}})})),b.support.hrefNormalized||(b.each(["href","src","width","height"],function(e,n){b.attrHooks[n]=b.extend(b.attrHooks[n],{get:function(e){var r=e.getAttribute(n,2);return null==r?t:r}})}),b.each(["href","src"],function(e,t){b.propHooks[t]={get:function(e){return e.getAttribute(t,4)}}})),b.support.style||(b.attrHooks.style={get:function(e){return e.style.cssText||t},set:function(e,t){return e.style.cssText=t+""}}),b.support.optSelected||(b.propHooks.selected=b.extend(b.propHooks.selected,{get:function(e){var t=e.parentNode;return t&&(t.selectedIndex,t.parentNode&&t.parentNode.selectedIndex),null}})),b.support.enctype||(b.propFix.enctype="encoding"),b.support.checkOn||b.each(["radio","checkbox"],function(){b.valHooks[this]={get:function(e){return null===e.getAttribute("value")?"on":e.value}}}),b.each(["radio","checkbox"],function(){b.valHooks[this]=b.extend(b.valHooks[this],{set:function(e,n){return b.isArray(n)?e.checked=b.inArray(b(e).val(),n)>=0:t}})});var Z=/^(?:input|select|textarea)$/i,et=/^key/,tt=/^(?:mouse|contextmenu)|click/,nt=/^(?:focusinfocus|focusoutblur)$/,rt=/^([^.]*)(?:\.(.+)|)$/;function it(){return!0}function ot(){return!1}b.event={global:{},add:function(e,n,r,o,a){var s,u,l,c,p,f,d,h,g,m,y,v=b._data(e);if(v){r.handler&&(c=r,r=c.handler,a=c.selector),r.guid||(r.guid=b.guid++),(u=v.events)||(u=v.events={}),(f=v.handle)||(f=v.handle=function(e){return typeof b===i||e&&b.event.triggered===e.type?t:b.event.dispatch.apply(f.elem,arguments)},f.elem=e),n=(n||"").match(w)||[""],l=n.length;while(l--)s=rt.exec(n[l])||[],g=y=s[1],m=(s[2]||"").split(".").sort(),p=b.event.special[g]||{},g=(a?p.delegateType:p.bindType)||g,p=b.event.special[g]||{},d=b.extend({type:g,origType:y,data:o,handler:r,guid:r.guid,selector:a,needsContext:a&&b.expr.match.needsContext.test(a),namespace:m.join(".")},c),(h=u[g])||(h=u[g]=[],h.delegateCount=0,p.setup&&p.setup.call(e,o,m,f)!==!1||(e.addEventListener?e.addEventListener(g,f,!1):e.attachEvent&&e.attachEvent("on"+g,f))),p.add&&(p.add.call(e,d),d.handler.guid||(d.handler.guid=r.guid)),a?h.splice(h.delegateCount++,0,d):h.push(d),b.event.global[g]=!0;e=null}},remove:function(e,t,n,r,i){var o,a,s,u,l,c,p,f,d,h,g,m=b.hasData(e)&&b._data(e);if(m&&(c=m.events)){t=(t||"").match(w)||[""],l=t.length;while(l--)if(s=rt.exec(t[l])||[],d=g=s[1],h=(s[2]||"").split(".").sort(),d){p=b.event.special[d]||{},d=(r?p.delegateType:p.bindType)||d,f=c[d]||[],s=s[2]&&RegExp("(^|\\.)"+h.join("\\.(?:.*\\.|)")+"(\\.|$)"),u=o=f.length;while(o--)a=f[o],!i&&g!==a.origType||n&&n.guid!==a.guid||s&&!s.test(a.namespace)||r&&r!==a.selector&&("**"!==r||!a.selector)||(f.splice(o,1),a.selector&&f.delegateCount--,p.remove&&p.remove.call(e,a));u&&!f.length&&(p.teardown&&p.teardown.call(e,h,m.handle)!==!1||b.removeEvent(e,d,m.handle),delete c[d])}else for(d in c)b.event.remove(e,d+t[l],n,r,!0);b.isEmptyObject(c)&&(delete m.handle,b._removeData(e,"events"))}},trigger:function(n,r,i,a){var s,u,l,c,p,f,d,h=[i||o],g=y.call(n,"type")?n.type:n,m=y.call(n,"namespace")?n.namespace.split("."):[];if(l=f=i=i||o,3!==i.nodeType&&8!==i.nodeType&&!nt.test(g+b.event.triggered)&&(g.indexOf(".")>=0&&(m=g.split("."),g=m.shift(),m.sort()),u=0>g.indexOf(":")&&"on"+g,n=n[b.expando]?n:new b.Event(g,"object"==typeof n&&n),n.isTrigger=!0,n.namespace=m.join("."),n.namespace_re=n.namespace?RegExp("(^|\\.)"+m.join("\\.(?:.*\\.|)")+"(\\.|$)"):null,n.result=t,n.target||(n.target=i),r=null==r?[n]:b.makeArray(r,[n]),p=b.event.special[g]||{},a||!p.trigger||p.trigger.apply(i,r)!==!1)){if(!a&&!p.noBubble&&!b.isWindow(i)){for(c=p.delegateType||g,nt.test(c+g)||(l=l.parentNode);l;l=l.parentNode)h.push(l),f=l;f===(i.ownerDocument||o)&&h.push(f.defaultView||f.parentWindow||e)}d=0;while((l=h[d++])&&!n.isPropagationStopped())n.type=d>1?c:p.bindType||g,s=(b._data(l,"events")||{})[n.type]&&b._data(l,"handle"),s&&s.apply(l,r),s=u&&l[u],s&&b.acceptData(l)&&s.apply&&s.apply(l,r)===!1&&n.preventDefault();if(n.type=g,!(a||n.isDefaultPrevented()||p._default&&p._default.apply(i.ownerDocument,r)!==!1||"click"===g&&b.nodeName(i,"a")||!b.acceptData(i)||!u||!i[g]||b.isWindow(i))){f=i[u],f&&(i[u]=null),b.event.triggered=g;try{i[g]()}catch(v){}b.event.triggered=t,f&&(i[u]=f)}return n.result}},dispatch:function(e){e=b.event.fix(e);var n,r,i,o,a,s=[],u=h.call(arguments),l=(b._data(this,"events")||{})[e.type]||[],c=b.event.special[e.type]||{};if(u[0]=e,e.delegateTarget=this,!c.preDispatch||c.preDispatch.call(this,e)!==!1){s=b.event.handlers.call(this,e,l),n=0;while((o=s[n++])&&!e.isPropagationStopped()){e.currentTarget=o.elem,a=0;while((i=o.handlers[a++])&&!e.isImmediatePropagationStopped())(!e.namespace_re||e.namespace_re.test(i.namespace))&&(e.handleObj=i,e.data=i.data,r=((b.event.special[i.origType]||{}).handle||i.handler).apply(o.elem,u),r!==t&&(e.result=r)===!1&&(e.preventDefault(),e.stopPropagation()))}return c.postDispatch&&c.postDispatch.call(this,e),e.result}},handlers:function(e,n){var r,i,o,a,s=[],u=n.delegateCount,l=e.target;if(u&&l.nodeType&&(!e.button||"click"!==e.type))for(;l!=this;l=l.parentNode||this)if(1===l.nodeType&&(l.disabled!==!0||"click"!==e.type)){for(o=[],a=0;u>a;a++)i=n[a],r=i.selector+" ",o[r]===t&&(o[r]=i.needsContext?b(r,this).index(l)>=0:b.find(r,this,null,[l]).length),o[r]&&o.push(i);o.length&&s.push({elem:l,handlers:o})}return n.length>u&&s.push({elem:this,handlers:n.slice(u)}),s},fix:function(e){if(e[b.expando])return e;var t,n,r,i=e.type,a=e,s=this.fixHooks[i];s||(this.fixHooks[i]=s=tt.test(i)?this.mouseHooks:et.test(i)?this.keyHooks:{}),r=s.props?this.props.concat(s.props):this.props,e=new b.Event(a),t=r.length;while(t--)n=r[t],e[n]=a[n];return e.target||(e.target=a.srcElement||o),3===e.target.nodeType&&(e.target=e.target.parentNode),e.metaKey=!!e.metaKey,s.filter?s.filter(e,a):e},props:"altKey bubbles cancelable ctrlKey currentTarget eventPhase metaKey relatedTarget shiftKey target timeStamp view which".split(" "),fixHooks:{},keyHooks:{props:"char charCode key keyCode".split(" "),filter:function(e,t){return null==e.which&&(e.which=null!=t.charCode?t.charCode:t.keyCode),e}},mouseHooks:{props:"button buttons clientX clientY fromElement offsetX offsetY pageX pageY screenX screenY toElement".split(" "),filter:function(e,n){var r,i,a,s=n.button,u=n.fromElement;return null==e.pageX&&null!=n.clientX&&(i=e.target.ownerDocument||o,a=i.documentElement,r=i.body,e.pageX=n.clientX+(a&&a.scrollLeft||r&&r.scrollLeft||0)-(a&&a.clientLeft||r&&r.clientLeft||0),e.pageY=n.clientY+(a&&a.scrollTop||r&&r.scrollTop||0)-(a&&a.clientTop||r&&r.clientTop||0)),!e.relatedTarget&&u&&(e.relatedTarget=u===e.target?n.toElement:u),e.which||s===t||(e.which=1&s?1:2&s?3:4&s?2:0),e}},special:{load:{noBubble:!0},click:{trigger:function(){return b.nodeName(this,"input")&&"checkbox"===this.type&&this.click?(this.click(),!1):t}},focus:{trigger:function(){if(this!==o.activeElement&&this.focus)try{return this.focus(),!1}catch(e){}},delegateType:"focusin"},blur:{trigger:function(){return this===o.activeElement&&this.blur?(this.blur(),!1):t},delegateType:"focusout"},beforeunload:{postDispatch:function(e){e.result!==t&&(e.originalEvent.returnValue=e.result)}}},simulate:function(e,t,n,r){var i=b.extend(new b.Event,n,{type:e,isSimulated:!0,originalEvent:{}});r?b.event.trigger(i,null,t):b.event.dispatch.call(t,i),i.isDefaultPrevented()&&n.preventDefault()}},b.removeEvent=o.removeEventListener?function(e,t,n){e.removeEventListener&&e.removeEventListener(t,n,!1)}:function(e,t,n){var r="on"+t;e.detachEvent&&(typeof e[r]===i&&(e[r]=null),e.detachEvent(r,n))},b.Event=function(e,n){return this instanceof b.Event?(e&&e.type?(this.originalEvent=e,this.type=e.type,this.isDefaultPrevented=e.defaultPrevented||e.returnValue===!1||e.getPreventDefault&&e.getPreventDefault()?it:ot):this.type=e,n&&b.extend(this,n),this.timeStamp=e&&e.timeStamp||b.now(),this[b.expando]=!0,t):new b.Event(e,n)},b.Event.prototype={isDefaultPrevented:ot,isPropagationStopped:ot,isImmediatePropagationStopped:ot,preventDefault:function(){var e=this.originalEvent;this.isDefaultPrevented=it,e&&(e.preventDefault?e.preventDefault():e.returnValue=!1)},stopPropagation:function(){var e=this.originalEvent;this.isPropagationStopped=it,e&&(e.stopPropagation&&e.stopPropagation(),e.cancelBubble=!0)},stopImmediatePropagation:function(){this.isImmediatePropagationStopped=it,this.stopPropagation()}},b.each({mouseenter:"mouseover",mouseleave:"mouseout"},function(e,t){b.event.special[e]={delegateType:t,bindType:t,handle:function(e){var n,r=this,i=e.relatedTarget,o=e.handleObj; return(!i||i!==r&&!b.contains(r,i))&&(e.type=o.origType,n=o.handler.apply(this,arguments),e.type=t),n}}}),b.support.submitBubbles||(b.event.special.submit={setup:function(){return b.nodeName(this,"form")?!1:(b.event.add(this,"click._submit keypress._submit",function(e){var n=e.target,r=b.nodeName(n,"input")||b.nodeName(n,"button")?n.form:t;r&&!b._data(r,"submitBubbles")&&(b.event.add(r,"submit._submit",function(e){e._submit_bubble=!0}),b._data(r,"submitBubbles",!0))}),t)},postDispatch:function(e){e._submit_bubble&&(delete e._submit_bubble,this.parentNode&&!e.isTrigger&&b.event.simulate("submit",this.parentNode,e,!0))},teardown:function(){return b.nodeName(this,"form")?!1:(b.event.remove(this,"._submit"),t)}}),b.support.changeBubbles||(b.event.special.change={setup:function(){return Z.test(this.nodeName)?(("checkbox"===this.type||"radio"===this.type)&&(b.event.add(this,"propertychange._change",function(e){"checked"===e.originalEvent.propertyName&&(this._just_changed=!0)}),b.event.add(this,"click._change",function(e){this._just_changed&&!e.isTrigger&&(this._just_changed=!1),b.event.simulate("change",this,e,!0)})),!1):(b.event.add(this,"beforeactivate._change",function(e){var t=e.target;Z.test(t.nodeName)&&!b._data(t,"changeBubbles")&&(b.event.add(t,"change._change",function(e){!this.parentNode||e.isSimulated||e.isTrigger||b.event.simulate("change",this.parentNode,e,!0)}),b._data(t,"changeBubbles",!0))}),t)},handle:function(e){var n=e.target;return this!==n||e.isSimulated||e.isTrigger||"radio"!==n.type&&"checkbox"!==n.type?e.handleObj.handler.apply(this,arguments):t},teardown:function(){return b.event.remove(this,"._change"),!Z.test(this.nodeName)}}),b.support.focusinBubbles||b.each({focus:"focusin",blur:"focusout"},function(e,t){var n=0,r=function(e){b.event.simulate(t,e.target,b.event.fix(e),!0)};b.event.special[t]={setup:function(){0===n++&&o.addEventListener(e,r,!0)},teardown:function(){0===--n&&o.removeEventListener(e,r,!0)}}}),b.fn.extend({on:function(e,n,r,i,o){var a,s;if("object"==typeof e){"string"!=typeof n&&(r=r||n,n=t);for(a in e)this.on(a,n,r,e[a],o);return this}if(null==r&&null==i?(i=n,r=n=t):null==i&&("string"==typeof n?(i=r,r=t):(i=r,r=n,n=t)),i===!1)i=ot;else if(!i)return this;return 1===o&&(s=i,i=function(e){return b().off(e),s.apply(this,arguments)},i.guid=s.guid||(s.guid=b.guid++)),this.each(function(){b.event.add(this,e,i,r,n)})},one:function(e,t,n,r){return this.on(e,t,n,r,1)},off:function(e,n,r){var i,o;if(e&&e.preventDefault&&e.handleObj)return i=e.handleObj,b(e.delegateTarget).off(i.namespace?i.origType+"."+i.namespace:i.origType,i.selector,i.handler),this;if("object"==typeof e){for(o in e)this.off(o,n,e[o]);return this}return(n===!1||"function"==typeof n)&&(r=n,n=t),r===!1&&(r=ot),this.each(function(){b.event.remove(this,e,r,n)})},bind:function(e,t,n){return this.on(e,null,t,n)},unbind:function(e,t){return this.off(e,null,t)},delegate:function(e,t,n,r){return this.on(t,e,n,r)},undelegate:function(e,t,n){return 1===arguments.length?this.off(e,"**"):this.off(t,e||"**",n)},trigger:function(e,t){return this.each(function(){b.event.trigger(e,t,this)})},triggerHandler:function(e,n){var r=this[0];return r?b.event.trigger(e,n,r,!0):t}}),function(e,t){var n,r,i,o,a,s,u,l,c,p,f,d,h,g,m,y,v,x="sizzle"+-new Date,w=e.document,T={},N=0,C=0,k=it(),E=it(),S=it(),A=typeof t,j=1<<31,D=[],L=D.pop,H=D.push,q=D.slice,M=D.indexOf||function(e){var t=0,n=this.length;for(;n>t;t++)if(this[t]===e)return t;return-1},_="[\\x20\\t\\r\\n\\f]",F="(?:\\\\.|[\\w-]|[^\\x00-\\xa0])+",O=F.replace("w","w#"),B="([*^$|!~]?=)",P="\\["+_+"*("+F+")"+_+"*(?:"+B+_+"*(?:(['\"])((?:\\\\.|[^\\\\])*?)\\3|("+O+")|)|)"+_+"*\\]",R=":("+F+")(?:\\(((['\"])((?:\\\\.|[^\\\\])*?)\\3|((?:\\\\.|[^\\\\()[\\]]|"+P.replace(3,8)+")*)|.*)\\)|)",W=RegExp("^"+_+"+|((?:^|[^\\\\])(?:\\\\.)*)"+_+"+$","g"),$=RegExp("^"+_+"*,"+_+"*"),I=RegExp("^"+_+"*([\\x20\\t\\r\\n\\f>+~])"+_+"*"),z=RegExp(R),X=RegExp("^"+O+"$"),U={ID:RegExp("^#("+F+")"),CLASS:RegExp("^\\.("+F+")"),NAME:RegExp("^\\[name=['\"]?("+F+")['\"]?\\]"),TAG:RegExp("^("+F.replace("w","w*")+")"),ATTR:RegExp("^"+P),PSEUDO:RegExp("^"+R),CHILD:RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\("+_+"*(even|odd|(([+-]|)(\\d*)n|)"+_+"*(?:([+-]|)"+_+"*(\\d+)|))"+_+"*\\)|)","i"),needsContext:RegExp("^"+_+"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\("+_+"*((?:-\\d)?\\d*)"+_+"*\\)|)(?=[^-]|$)","i")},V=/[\x20\t\r\n\f]*[+~]/,Y=/^[^{]+\{\s*\[native code/,J=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,G=/^(?:input|select|textarea|button)$/i,Q=/^h\d$/i,K=/'|\\/g,Z=/\=[\x20\t\r\n\f]*([^'"\]]*)[\x20\t\r\n\f]*\]/g,et=/\\([\da-fA-F]{1,6}[\x20\t\r\n\f]?|.)/g,tt=function(e,t){var n="0x"+t-65536;return n!==n?t:0>n?String.fromCharCode(n+65536):String.fromCharCode(55296|n>>10,56320|1023&n)};try{q.call(w.documentElement.childNodes,0)[0].nodeType}catch(nt){q=function(e){var t,n=[];while(t=this[e++])n.push(t);return n}}function rt(e){return Y.test(e+"")}function it(){var e,t=[];return e=function(n,r){return t.push(n+=" ")>i.cacheLength&&delete e[t.shift()],e[n]=r}}function ot(e){return e[x]=!0,e}function at(e){var t=p.createElement("div");try{return e(t)}catch(n){return!1}finally{t=null}}function st(e,t,n,r){var i,o,a,s,u,l,f,g,m,v;if((t?t.ownerDocument||t:w)!==p&&c(t),t=t||p,n=n||[],!e||"string"!=typeof e)return n;if(1!==(s=t.nodeType)&&9!==s)return[];if(!d&&!r){if(i=J.exec(e))if(a=i[1]){if(9===s){if(o=t.getElementById(a),!o||!o.parentNode)return n;if(o.id===a)return n.push(o),n}else if(t.ownerDocument&&(o=t.ownerDocument.getElementById(a))&&y(t,o)&&o.id===a)return n.push(o),n}else{if(i[2])return H.apply(n,q.call(t.getElementsByTagName(e),0)),n;if((a=i[3])&&T.getByClassName&&t.getElementsByClassName)return H.apply(n,q.call(t.getElementsByClassName(a),0)),n}if(T.qsa&&!h.test(e)){if(f=!0,g=x,m=t,v=9===s&&e,1===s&&"object"!==t.nodeName.toLowerCase()){l=ft(e),(f=t.getAttribute("id"))?g=f.replace(K,"\\$&"):t.setAttribute("id",g),g="[id='"+g+"'] ",u=l.length;while(u--)l[u]=g+dt(l[u]);m=V.test(e)&&t.parentNode||t,v=l.join(",")}if(v)try{return H.apply(n,q.call(m.querySelectorAll(v),0)),n}catch(b){}finally{f||t.removeAttribute("id")}}}return wt(e.replace(W,"$1"),t,n,r)}a=st.isXML=function(e){var t=e&&(e.ownerDocument||e).documentElement;return t?"HTML"!==t.nodeName:!1},c=st.setDocument=function(e){var n=e?e.ownerDocument||e:w;return n!==p&&9===n.nodeType&&n.documentElement?(p=n,f=n.documentElement,d=a(n),T.tagNameNoComments=at(function(e){return e.appendChild(n.createComment("")),!e.getElementsByTagName("*").length}),T.attributes=at(function(e){e.innerHTML="<select></select>";var t=typeof e.lastChild.getAttribute("multiple");return"boolean"!==t&&"string"!==t}),T.getByClassName=at(function(e){return e.innerHTML="<div class='hidden e'></div><div class='hidden'></div>",e.getElementsByClassName&&e.getElementsByClassName("e").length?(e.lastChild.className="e",2===e.getElementsByClassName("e").length):!1}),T.getByName=at(function(e){e.id=x+0,e.innerHTML="<a name='"+x+"'></a><div name='"+x+"'></div>",f.insertBefore(e,f.firstChild);var t=n.getElementsByName&&n.getElementsByName(x).length===2+n.getElementsByName(x+0).length;return T.getIdNotName=!n.getElementById(x),f.removeChild(e),t}),i.attrHandle=at(function(e){return e.innerHTML="<a href='#'></a>",e.firstChild&&typeof e.firstChild.getAttribute!==A&&"#"===e.firstChild.getAttribute("href")})?{}:{href:function(e){return e.getAttribute("href",2)},type:function(e){return e.getAttribute("type")}},T.getIdNotName?(i.find.ID=function(e,t){if(typeof t.getElementById!==A&&!d){var n=t.getElementById(e);return n&&n.parentNode?[n]:[]}},i.filter.ID=function(e){var t=e.replace(et,tt);return function(e){return e.getAttribute("id")===t}}):(i.find.ID=function(e,n){if(typeof n.getElementById!==A&&!d){var r=n.getElementById(e);return r?r.id===e||typeof r.getAttributeNode!==A&&r.getAttributeNode("id").value===e?[r]:t:[]}},i.filter.ID=function(e){var t=e.replace(et,tt);return function(e){var n=typeof e.getAttributeNode!==A&&e.getAttributeNode("id");return n&&n.value===t}}),i.find.TAG=T.tagNameNoComments?function(e,n){return typeof n.getElementsByTagName!==A?n.getElementsByTagName(e):t}:function(e,t){var n,r=[],i=0,o=t.getElementsByTagName(e);if("*"===e){while(n=o[i++])1===n.nodeType&&r.push(n);return r}return o},i.find.NAME=T.getByName&&function(e,n){return typeof n.getElementsByName!==A?n.getElementsByName(name):t},i.find.CLASS=T.getByClassName&&function(e,n){return typeof n.getElementsByClassName===A||d?t:n.getElementsByClassName(e)},g=[],h=[":focus"],(T.qsa=rt(n.querySelectorAll))&&(at(function(e){e.innerHTML="<select><option selected=''></option></select>",e.querySelectorAll("[selected]").length||h.push("\\["+_+"*(?:checked|disabled|ismap|multiple|readonly|selected|value)"),e.querySelectorAll(":checked").length||h.push(":checked")}),at(function(e){e.innerHTML="<input type='hidden' i=''/>",e.querySelectorAll("[i^='']").length&&h.push("[*^$]="+_+"*(?:\"\"|'')"),e.querySelectorAll(":enabled").length||h.push(":enabled",":disabled"),e.querySelectorAll("*,:x"),h.push(",.*:")})),(T.matchesSelector=rt(m=f.matchesSelector||f.mozMatchesSelector||f.webkitMatchesSelector||f.oMatchesSelector||f.msMatchesSelector))&&at(function(e){T.disconnectedMatch=m.call(e,"div"),m.call(e,"[s!='']:x"),g.push("!=",R)}),h=RegExp(h.join("|")),g=RegExp(g.join("|")),y=rt(f.contains)||f.compareDocumentPosition?function(e,t){var n=9===e.nodeType?e.documentElement:e,r=t&&t.parentNode;return e===r||!(!r||1!==r.nodeType||!(n.contains?n.contains(r):e.compareDocumentPosition&&16&e.compareDocumentPosition(r)))}:function(e,t){if(t)while(t=t.parentNode)if(t===e)return!0;return!1},v=f.compareDocumentPosition?function(e,t){var r;return e===t?(u=!0,0):(r=t.compareDocumentPosition&&e.compareDocumentPosition&&e.compareDocumentPosition(t))?1&r||e.parentNode&&11===e.parentNode.nodeType?e===n||y(w,e)?-1:t===n||y(w,t)?1:0:4&r?-1:1:e.compareDocumentPosition?-1:1}:function(e,t){var r,i=0,o=e.parentNode,a=t.parentNode,s=[e],l=[t];if(e===t)return u=!0,0;if(!o||!a)return e===n?-1:t===n?1:o?-1:a?1:0;if(o===a)return ut(e,t);r=e;while(r=r.parentNode)s.unshift(r);r=t;while(r=r.parentNode)l.unshift(r);while(s[i]===l[i])i++;return i?ut(s[i],l[i]):s[i]===w?-1:l[i]===w?1:0},u=!1,[0,0].sort(v),T.detectDuplicates=u,p):p},st.matches=function(e,t){return st(e,null,null,t)},st.matchesSelector=function(e,t){if((e.ownerDocument||e)!==p&&c(e),t=t.replace(Z,"='$1']"),!(!T.matchesSelector||d||g&&g.test(t)||h.test(t)))try{var n=m.call(e,t);if(n||T.disconnectedMatch||e.document&&11!==e.document.nodeType)return n}catch(r){}return st(t,p,null,[e]).length>0},st.contains=function(e,t){return(e.ownerDocument||e)!==p&&c(e),y(e,t)},st.attr=function(e,t){var n;return(e.ownerDocument||e)!==p&&c(e),d||(t=t.toLowerCase()),(n=i.attrHandle[t])?n(e):d||T.attributes?e.getAttribute(t):((n=e.getAttributeNode(t))||e.getAttribute(t))&&e[t]===!0?t:n&&n.specified?n.value:null},st.error=function(e){throw Error("Syntax error, unrecognized expression: "+e)},st.uniqueSort=function(e){var t,n=[],r=1,i=0;if(u=!T.detectDuplicates,e.sort(v),u){for(;t=e[r];r++)t===e[r-1]&&(i=n.push(r));while(i--)e.splice(n[i],1)}return e};function ut(e,t){var n=t&&e,r=n&&(~t.sourceIndex||j)-(~e.sourceIndex||j);if(r)return r;if(n)while(n=n.nextSibling)if(n===t)return-1;return e?1:-1}function lt(e){return function(t){var n=t.nodeName.toLowerCase();return"input"===n&&t.type===e}}function ct(e){return function(t){var n=t.nodeName.toLowerCase();return("input"===n||"button"===n)&&t.type===e}}function pt(e){return ot(function(t){return t=+t,ot(function(n,r){var i,o=e([],n.length,t),a=o.length;while(a--)n[i=o[a]]&&(n[i]=!(r[i]=n[i]))})})}o=st.getText=function(e){var t,n="",r=0,i=e.nodeType;if(i){if(1===i||9===i||11===i){if("string"==typeof e.textContent)return e.textContent;for(e=e.firstChild;e;e=e.nextSibling)n+=o(e)}else if(3===i||4===i)return e.nodeValue}else for(;t=e[r];r++)n+=o(t);return n},i=st.selectors={cacheLength:50,createPseudo:ot,match:U,find:{},relative:{">":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(e){return e[1]=e[1].replace(et,tt),e[3]=(e[4]||e[5]||"").replace(et,tt),"~="===e[2]&&(e[3]=" "+e[3]+" "),e.slice(0,4)},CHILD:function(e){return e[1]=e[1].toLowerCase(),"nth"===e[1].slice(0,3)?(e[3]||st.error(e[0]),e[4]=+(e[4]?e[5]+(e[6]||1):2*("even"===e[3]||"odd"===e[3])),e[5]=+(e[7]+e[8]||"odd"===e[3])):e[3]&&st.error(e[0]),e},PSEUDO:function(e){var t,n=!e[5]&&e[2];return U.CHILD.test(e[0])?null:(e[4]?e[2]=e[4]:n&&z.test(n)&&(t=ft(n,!0))&&(t=n.indexOf(")",n.length-t)-n.length)&&(e[0]=e[0].slice(0,t),e[2]=n.slice(0,t)),e.slice(0,3))}},filter:{TAG:function(e){return"*"===e?function(){return!0}:(e=e.replace(et,tt).toLowerCase(),function(t){return t.nodeName&&t.nodeName.toLowerCase()===e})},CLASS:function(e){var t=k[e+" "];return t||(t=RegExp("(^|"+_+")"+e+"("+_+"|$)"))&&k(e,function(e){return t.test(e.className||typeof e.getAttribute!==A&&e.getAttribute("class")||"")})},ATTR:function(e,t,n){return function(r){var i=st.attr(r,e);return null==i?"!="===t:t?(i+="","="===t?i===n:"!="===t?i!==n:"^="===t?n&&0===i.indexOf(n):"*="===t?n&&i.indexOf(n)>-1:"$="===t?n&&i.slice(-n.length)===n:"~="===t?(" "+i+" ").indexOf(n)>-1:"|="===t?i===n||i.slice(0,n.length+1)===n+"-":!1):!0}},CHILD:function(e,t,n,r,i){var o="nth"!==e.slice(0,3),a="last"!==e.slice(-4),s="of-type"===t;return 1===r&&0===i?function(e){return!!e.parentNode}:function(t,n,u){var l,c,p,f,d,h,g=o!==a?"nextSibling":"previousSibling",m=t.parentNode,y=s&&t.nodeName.toLowerCase(),v=!u&&!s;if(m){if(o){while(g){p=t;while(p=p[g])if(s?p.nodeName.toLowerCase()===y:1===p.nodeType)return!1;h=g="only"===e&&!h&&"nextSibling"}return!0}if(h=[a?m.firstChild:m.lastChild],a&&v){c=m[x]||(m[x]={}),l=c[e]||[],d=l[0]===N&&l[1],f=l[0]===N&&l[2],p=d&&m.childNodes[d];while(p=++d&&p&&p[g]||(f=d=0)||h.pop())if(1===p.nodeType&&++f&&p===t){c[e]=[N,d,f];break}}else if(v&&(l=(t[x]||(t[x]={}))[e])&&l[0]===N)f=l[1];else while(p=++d&&p&&p[g]||(f=d=0)||h.pop())if((s?p.nodeName.toLowerCase()===y:1===p.nodeType)&&++f&&(v&&((p[x]||(p[x]={}))[e]=[N,f]),p===t))break;return f-=i,f===r||0===f%r&&f/r>=0}}},PSEUDO:function(e,t){var n,r=i.pseudos[e]||i.setFilters[e.toLowerCase()]||st.error("unsupported pseudo: "+e);return r[x]?r(t):r.length>1?(n=[e,e,"",t],i.setFilters.hasOwnProperty(e.toLowerCase())?ot(function(e,n){var i,o=r(e,t),a=o.length;while(a--)i=M.call(e,o[a]),e[i]=!(n[i]=o[a])}):function(e){return r(e,0,n)}):r}},pseudos:{not:ot(function(e){var t=[],n=[],r=s(e.replace(W,"$1"));return r[x]?ot(function(e,t,n,i){var o,a=r(e,null,i,[]),s=e.length;while(s--)(o=a[s])&&(e[s]=!(t[s]=o))}):function(e,i,o){return t[0]=e,r(t,null,o,n),!n.pop()}}),has:ot(function(e){return function(t){return st(e,t).length>0}}),contains:ot(function(e){return function(t){return(t.textContent||t.innerText||o(t)).indexOf(e)>-1}}),lang:ot(function(e){return X.test(e||"")||st.error("unsupported lang: "+e),e=e.replace(et,tt).toLowerCase(),function(t){var n;do if(n=d?t.getAttribute("xml:lang")||t.getAttribute("lang"):t.lang)return n=n.toLowerCase(),n===e||0===n.indexOf(e+"-");while((t=t.parentNode)&&1===t.nodeType);return!1}}),target:function(t){var n=e.location&&e.location.hash;return n&&n.slice(1)===t.id},root:function(e){return e===f},focus:function(e){return e===p.activeElement&&(!p.hasFocus||p.hasFocus())&&!!(e.type||e.href||~e.tabIndex)},enabled:function(e){return e.disabled===!1},disabled:function(e){return e.disabled===!0},checked:function(e){var t=e.nodeName.toLowerCase();return"input"===t&&!!e.checked||"option"===t&&!!e.selected},selected:function(e){return e.parentNode&&e.parentNode.selectedIndex,e.selected===!0},empty:function(e){for(e=e.firstChild;e;e=e.nextSibling)if(e.nodeName>"@"||3===e.nodeType||4===e.nodeType)return!1;return!0},parent:function(e){return!i.pseudos.empty(e)},header:function(e){return Q.test(e.nodeName)},input:function(e){return G.test(e.nodeName)},button:function(e){var t=e.nodeName.toLowerCase();return"input"===t&&"button"===e.type||"button"===t},text:function(e){var t;return"input"===e.nodeName.toLowerCase()&&"text"===e.type&&(null==(t=e.getAttribute("type"))||t.toLowerCase()===e.type)},first:pt(function(){return[0]}),last:pt(function(e,t){return[t-1]}),eq:pt(function(e,t,n){return[0>n?n+t:n]}),even:pt(function(e,t){var n=0;for(;t>n;n+=2)e.push(n);return e}),odd:pt(function(e,t){var n=1;for(;t>n;n+=2)e.push(n);return e}),lt:pt(function(e,t,n){var r=0>n?n+t:n;for(;--r>=0;)e.push(r);return e}),gt:pt(function(e,t,n){var r=0>n?n+t:n;for(;t>++r;)e.push(r);return e})}};for(n in{radio:!0,checkbox:!0,file:!0,password:!0,image:!0})i.pseudos[n]=lt(n);for(n in{submit:!0,reset:!0})i.pseudos[n]=ct(n);function ft(e,t){var n,r,o,a,s,u,l,c=E[e+" "];if(c)return t?0:c.slice(0);s=e,u=[],l=i.preFilter;while(s){(!n||(r=$.exec(s)))&&(r&&(s=s.slice(r[0].length)||s),u.push(o=[])),n=!1,(r=I.exec(s))&&(n=r.shift(),o.push({value:n,type:r[0].replace(W," ")}),s=s.slice(n.length));for(a in i.filter)!(r=U[a].exec(s))||l[a]&&!(r=l[a](r))||(n=r.shift(),o.push({value:n,type:a,matches:r}),s=s.slice(n.length));if(!n)break}return t?s.length:s?st.error(e):E(e,u).slice(0)}function dt(e){var t=0,n=e.length,r="";for(;n>t;t++)r+=e[t].value;return r}function ht(e,t,n){var i=t.dir,o=n&&"parentNode"===i,a=C++;return t.first?function(t,n,r){while(t=t[i])if(1===t.nodeType||o)return e(t,n,r)}:function(t,n,s){var u,l,c,p=N+" "+a;if(s){while(t=t[i])if((1===t.nodeType||o)&&e(t,n,s))return!0}else while(t=t[i])if(1===t.nodeType||o)if(c=t[x]||(t[x]={}),(l=c[i])&&l[0]===p){if((u=l[1])===!0||u===r)return u===!0}else if(l=c[i]=[p],l[1]=e(t,n,s)||r,l[1]===!0)return!0}}function gt(e){return e.length>1?function(t,n,r){var i=e.length;while(i--)if(!e[i](t,n,r))return!1;return!0}:e[0]}function mt(e,t,n,r,i){var o,a=[],s=0,u=e.length,l=null!=t;for(;u>s;s++)(o=e[s])&&(!n||n(o,r,i))&&(a.push(o),l&&t.push(s));return a}function yt(e,t,n,r,i,o){return r&&!r[x]&&(r=yt(r)),i&&!i[x]&&(i=yt(i,o)),ot(function(o,a,s,u){var l,c,p,f=[],d=[],h=a.length,g=o||xt(t||"*",s.nodeType?[s]:s,[]),m=!e||!o&&t?g:mt(g,f,e,s,u),y=n?i||(o?e:h||r)?[]:a:m;if(n&&n(m,y,s,u),r){l=mt(y,d),r(l,[],s,u),c=l.length;while(c--)(p=l[c])&&(y[d[c]]=!(m[d[c]]=p))}if(o){if(i||e){if(i){l=[],c=y.length;while(c--)(p=y[c])&&l.push(m[c]=p);i(null,y=[],l,u)}c=y.length;while(c--)(p=y[c])&&(l=i?M.call(o,p):f[c])>-1&&(o[l]=!(a[l]=p))}}else y=mt(y===a?y.splice(h,y.length):y),i?i(null,a,y,u):H.apply(a,y)})}function vt(e){var t,n,r,o=e.length,a=i.relative[e[0].type],s=a||i.relative[" "],u=a?1:0,c=ht(function(e){return e===t},s,!0),p=ht(function(e){return M.call(t,e)>-1},s,!0),f=[function(e,n,r){return!a&&(r||n!==l)||((t=n).nodeType?c(e,n,r):p(e,n,r))}];for(;o>u;u++)if(n=i.relative[e[u].type])f=[ht(gt(f),n)];else{if(n=i.filter[e[u].type].apply(null,e[u].matches),n[x]){for(r=++u;o>r;r++)if(i.relative[e[r].type])break;return yt(u>1&&gt(f),u>1&&dt(e.slice(0,u-1)).replace(W,"$1"),n,r>u&&vt(e.slice(u,r)),o>r&&vt(e=e.slice(r)),o>r&&dt(e))}f.push(n)}return gt(f)}function bt(e,t){var n=0,o=t.length>0,a=e.length>0,s=function(s,u,c,f,d){var h,g,m,y=[],v=0,b="0",x=s&&[],w=null!=d,T=l,C=s||a&&i.find.TAG("*",d&&u.parentNode||u),k=N+=null==T?1:Math.random()||.1;for(w&&(l=u!==p&&u,r=n);null!=(h=C[b]);b++){if(a&&h){g=0;while(m=e[g++])if(m(h,u,c)){f.push(h);break}w&&(N=k,r=++n)}o&&((h=!m&&h)&&v--,s&&x.push(h))}if(v+=b,o&&b!==v){g=0;while(m=t[g++])m(x,y,u,c);if(s){if(v>0)while(b--)x[b]||y[b]||(y[b]=L.call(f));y=mt(y)}H.apply(f,y),w&&!s&&y.length>0&&v+t.length>1&&st.uniqueSort(f)}return w&&(N=k,l=T),x};return o?ot(s):s}s=st.compile=function(e,t){var n,r=[],i=[],o=S[e+" "];if(!o){t||(t=ft(e)),n=t.length;while(n--)o=vt(t[n]),o[x]?r.push(o):i.push(o);o=S(e,bt(i,r))}return o};function xt(e,t,n){var r=0,i=t.length;for(;i>r;r++)st(e,t[r],n);return n}function wt(e,t,n,r){var o,a,u,l,c,p=ft(e);if(!r&&1===p.length){if(a=p[0]=p[0].slice(0),a.length>2&&"ID"===(u=a[0]).type&&9===t.nodeType&&!d&&i.relative[a[1].type]){if(t=i.find.ID(u.matches[0].replace(et,tt),t)[0],!t)return n;e=e.slice(a.shift().value.length)}o=U.needsContext.test(e)?0:a.length;while(o--){if(u=a[o],i.relative[l=u.type])break;if((c=i.find[l])&&(r=c(u.matches[0].replace(et,tt),V.test(a[0].type)&&t.parentNode||t))){if(a.splice(o,1),e=r.length&&dt(a),!e)return H.apply(n,q.call(r,0)),n;break}}}return s(e,p)(r,t,d,n,V.test(e)),n}i.pseudos.nth=i.pseudos.eq;function Tt(){}i.filters=Tt.prototype=i.pseudos,i.setFilters=new Tt,c(),st.attr=b.attr,b.find=st,b.expr=st.selectors,b.expr[":"]=b.expr.pseudos,b.unique=st.uniqueSort,b.text=st.getText,b.isXMLDoc=st.isXML,b.contains=st.contains}(e);var at=/Until$/,st=/^(?:parents|prev(?:Until|All))/,ut=/^.[^:#\[\.,]*$/,lt=b.expr.match.needsContext,ct={children:!0,contents:!0,next:!0,prev:!0};b.fn.extend({find:function(e){var t,n,r,i=this.length;if("string"!=typeof e)return r=this,this.pushStack(b(e).filter(function(){for(t=0;i>t;t++)if(b.contains(r[t],this))return!0}));for(n=[],t=0;i>t;t++)b.find(e,this[t],n);return n=this.pushStack(i>1?b.unique(n):n),n.selector=(this.selector?this.selector+" ":"")+e,n},has:function(e){var t,n=b(e,this),r=n.length;return this.filter(function(){for(t=0;r>t;t++)if(b.contains(this,n[t]))return!0})},not:function(e){return this.pushStack(ft(this,e,!1))},filter:function(e){return this.pushStack(ft(this,e,!0))},is:function(e){return!!e&&("string"==typeof e?lt.test(e)?b(e,this.context).index(this[0])>=0:b.filter(e,this).length>0:this.filter(e).length>0)},closest:function(e,t){var n,r=0,i=this.length,o=[],a=lt.test(e)||"string"!=typeof e?b(e,t||this.context):0;for(;i>r;r++){n=this[r];while(n&&n.ownerDocument&&n!==t&&11!==n.nodeType){if(a?a.index(n)>-1:b.find.matchesSelector(n,e)){o.push(n);break}n=n.parentNode}}return this.pushStack(o.length>1?b.unique(o):o)},index:function(e){return e?"string"==typeof e?b.inArray(this[0],b(e)):b.inArray(e.jquery?e[0]:e,this):this[0]&&this[0].parentNode?this.first().prevAll().length:-1},add:function(e,t){var n="string"==typeof e?b(e,t):b.makeArray(e&&e.nodeType?[e]:e),r=b.merge(this.get(),n);return this.pushStack(b.unique(r))},addBack:function(e){return this.add(null==e?this.prevObject:this.prevObject.filter(e))}}),b.fn.andSelf=b.fn.addBack;function pt(e,t){do e=e[t];while(e&&1!==e.nodeType);return e}b.each({parent:function(e){var t=e.parentNode;return t&&11!==t.nodeType?t:null},parents:function(e){return b.dir(e,"parentNode")},parentsUntil:function(e,t,n){return b.dir(e,"parentNode",n)},next:function(e){return pt(e,"nextSibling")},prev:function(e){return pt(e,"previousSibling")},nextAll:function(e){return b.dir(e,"nextSibling")},prevAll:function(e){return b.dir(e,"previousSibling")},nextUntil:function(e,t,n){return b.dir(e,"nextSibling",n)},prevUntil:function(e,t,n){return b.dir(e,"previousSibling",n)},siblings:function(e){return b.sibling((e.parentNode||{}).firstChild,e)},children:function(e){return b.sibling(e.firstChild)},contents:function(e){return b.nodeName(e,"iframe")?e.contentDocument||e.contentWindow.document:b.merge([],e.childNodes)}},function(e,t){b.fn[e]=function(n,r){var i=b.map(this,t,n);return at.test(e)||(r=n),r&&"string"==typeof r&&(i=b.filter(r,i)),i=this.length>1&&!ct[e]?b.unique(i):i,this.length>1&&st.test(e)&&(i=i.reverse()),this.pushStack(i)}}),b.extend({filter:function(e,t,n){return n&&(e=":not("+e+")"),1===t.length?b.find.matchesSelector(t[0],e)?[t[0]]:[]:b.find.matches(e,t)},dir:function(e,n,r){var i=[],o=e[n];while(o&&9!==o.nodeType&&(r===t||1!==o.nodeType||!b(o).is(r)))1===o.nodeType&&i.push(o),o=o[n];return i},sibling:function(e,t){var n=[];for(;e;e=e.nextSibling)1===e.nodeType&&e!==t&&n.push(e);return n}});function ft(e,t,n){if(t=t||0,b.isFunction(t))return b.grep(e,function(e,r){var i=!!t.call(e,r,e);return i===n});if(t.nodeType)return b.grep(e,function(e){return e===t===n});if("string"==typeof t){var r=b.grep(e,function(e){return 1===e.nodeType});if(ut.test(t))return b.filter(t,r,!n);t=b.filter(t,r)}return b.grep(e,function(e){return b.inArray(e,t)>=0===n})}function dt(e){var t=ht.split("|"),n=e.createDocumentFragment();if(n.createElement)while(t.length)n.createElement(t.pop());return n}var ht="abbr|article|aside|audio|bdi|canvas|data|datalist|details|figcaption|figure|footer|header|hgroup|mark|meter|nav|output|progress|section|summary|time|video",gt=/ jQuery\d+="(?:null|\d+)"/g,mt=RegExp("<(?:"+ht+")[\\s/>]","i"),yt=/^\s+/,vt=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/gi,bt=/<([\w:]+)/,xt=/<tbody/i,wt=/<|&#?\w+;/,Tt=/<(?:script|style|link)/i,Nt=/^(?:checkbox|radio)$/i,Ct=/checked\s*(?:[^=]|=\s*.checked.)/i,kt=/^$|\/(?:java|ecma)script/i,Et=/^true\/(.*)/,St=/^\s*<!(?:\[CDATA\[|--)|(?:\]\]|--)>\s*$/g,At={option:[1,"<select multiple='multiple'>","</select>"],legend:[1,"<fieldset>","</fieldset>"],area:[1,"<map>","</map>"],param:[1,"<object>","</object>"],thead:[1,"<table>","</table>"],tr:[2,"<table><tbody>","</tbody></table>"],col:[2,"<table><tbody></tbody><colgroup>","</colgroup></table>"],td:[3,"<table><tbody><tr>","</tr></tbody></table>"],_default:b.support.htmlSerialize?[0,"",""]:[1,"X<div>","</div>"]},jt=dt(o),Dt=jt.appendChild(o.createElement("div"));At.optgroup=At.option,At.tbody=At.tfoot=At.colgroup=At.caption=At.thead,At.th=At.td,b.fn.extend({text:function(e){return b.access(this,function(e){return e===t?b.text(this):this.empty().append((this[0]&&this[0].ownerDocument||o).createTextNode(e))},null,e,arguments.length)},wrapAll:function(e){if(b.isFunction(e))return this.each(function(t){b(this).wrapAll(e.call(this,t))});if(this[0]){var t=b(e,this[0].ownerDocument).eq(0).clone(!0);this[0].parentNode&&t.insertBefore(this[0]),t.map(function(){var e=this;while(e.firstChild&&1===e.firstChild.nodeType)e=e.firstChild;return e}).append(this)}return this},wrapInner:function(e){return b.isFunction(e)?this.each(function(t){b(this).wrapInner(e.call(this,t))}):this.each(function(){var t=b(this),n=t.contents();n.length?n.wrapAll(e):t.append(e)})},wrap:function(e){var t=b.isFunction(e);return this.each(function(n){b(this).wrapAll(t?e.call(this,n):e)})},unwrap:function(){return this.parent().each(function(){b.nodeName(this,"body")||b(this).replaceWith(this.childNodes)}).end()},append:function(){return this.domManip(arguments,!0,function(e){(1===this.nodeType||11===this.nodeType||9===this.nodeType)&&this.appendChild(e)})},prepend:function(){return this.domManip(arguments,!0,function(e){(1===this.nodeType||11===this.nodeType||9===this.nodeType)&&this.insertBefore(e,this.firstChild)})},before:function(){return this.domManip(arguments,!1,function(e){this.parentNode&&this.parentNode.insertBefore(e,this)})},after:function(){return this.domManip(arguments,!1,function(e){this.parentNode&&this.parentNode.insertBefore(e,this.nextSibling)})},remove:function(e,t){var n,r=0;for(;null!=(n=this[r]);r++)(!e||b.filter(e,[n]).length>0)&&(t||1!==n.nodeType||b.cleanData(Ot(n)),n.parentNode&&(t&&b.contains(n.ownerDocument,n)&&Mt(Ot(n,"script")),n.parentNode.removeChild(n)));return this},empty:function(){var e,t=0;for(;null!=(e=this[t]);t++){1===e.nodeType&&b.cleanData(Ot(e,!1));while(e.firstChild)e.removeChild(e.firstChild);e.options&&b.nodeName(e,"select")&&(e.options.length=0)}return this},clone:function(e,t){return e=null==e?!1:e,t=null==t?e:t,this.map(function(){return b.clone(this,e,t)})},html:function(e){return b.access(this,function(e){var n=this[0]||{},r=0,i=this.length;if(e===t)return 1===n.nodeType?n.innerHTML.replace(gt,""):t;if(!("string"!=typeof e||Tt.test(e)||!b.support.htmlSerialize&&mt.test(e)||!b.support.leadingWhitespace&&yt.test(e)||At[(bt.exec(e)||["",""])[1].toLowerCase()])){e=e.replace(vt,"<$1></$2>");try{for(;i>r;r++)n=this[r]||{},1===n.nodeType&&(b.cleanData(Ot(n,!1)),n.innerHTML=e);n=0}catch(o){}}n&&this.empty().append(e)},null,e,arguments.length)},replaceWith:function(e){var t=b.isFunction(e);return t||"string"==typeof e||(e=b(e).not(this).detach()),this.domManip([e],!0,function(e){var t=this.nextSibling,n=this.parentNode;n&&(b(this).remove(),n.insertBefore(e,t))})},detach:function(e){return this.remove(e,!0)},domManip:function(e,n,r){e=f.apply([],e);var i,o,a,s,u,l,c=0,p=this.length,d=this,h=p-1,g=e[0],m=b.isFunction(g);if(m||!(1>=p||"string"!=typeof g||b.support.checkClone)&&Ct.test(g))return this.each(function(i){var o=d.eq(i);m&&(e[0]=g.call(this,i,n?o.html():t)),o.domManip(e,n,r)});if(p&&(l=b.buildFragment(e,this[0].ownerDocument,!1,this),i=l.firstChild,1===l.childNodes.length&&(l=i),i)){for(n=n&&b.nodeName(i,"tr"),s=b.map(Ot(l,"script"),Ht),a=s.length;p>c;c++)o=l,c!==h&&(o=b.clone(o,!0,!0),a&&b.merge(s,Ot(o,"script"))),r.call(n&&b.nodeName(this[c],"table")?Lt(this[c],"tbody"):this[c],o,c);if(a)for(u=s[s.length-1].ownerDocument,b.map(s,qt),c=0;a>c;c++)o=s[c],kt.test(o.type||"")&&!b._data(o,"globalEval")&&b.contains(u,o)&&(o.src?b.ajax({url:o.src,type:"GET",dataType:"script",async:!1,global:!1,"throws":!0}):b.globalEval((o.text||o.textContent||o.innerHTML||"").replace(St,"")));l=i=null}return this}});function Lt(e,t){return e.getElementsByTagName(t)[0]||e.appendChild(e.ownerDocument.createElement(t))}function Ht(e){var t=e.getAttributeNode("type");return e.type=(t&&t.specified)+"/"+e.type,e}function qt(e){var t=Et.exec(e.type);return t?e.type=t[1]:e.removeAttribute("type"),e}function Mt(e,t){var n,r=0;for(;null!=(n=e[r]);r++)b._data(n,"globalEval",!t||b._data(t[r],"globalEval"))}function _t(e,t){if(1===t.nodeType&&b.hasData(e)){var n,r,i,o=b._data(e),a=b._data(t,o),s=o.events;if(s){delete a.handle,a.events={};for(n in s)for(r=0,i=s[n].length;i>r;r++)b.event.add(t,n,s[n][r])}a.data&&(a.data=b.extend({},a.data))}}function Ft(e,t){var n,r,i;if(1===t.nodeType){if(n=t.nodeName.toLowerCase(),!b.support.noCloneEvent&&t[b.expando]){i=b._data(t);for(r in i.events)b.removeEvent(t,r,i.handle);t.removeAttribute(b.expando)}"script"===n&&t.text!==e.text?(Ht(t).text=e.text,qt(t)):"object"===n?(t.parentNode&&(t.outerHTML=e.outerHTML),b.support.html5Clone&&e.innerHTML&&!b.trim(t.innerHTML)&&(t.innerHTML=e.innerHTML)):"input"===n&&Nt.test(e.type)?(t.defaultChecked=t.checked=e.checked,t.value!==e.value&&(t.value=e.value)):"option"===n?t.defaultSelected=t.selected=e.defaultSelected:("input"===n||"textarea"===n)&&(t.defaultValue=e.defaultValue)}}b.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(e,t){b.fn[e]=function(e){var n,r=0,i=[],o=b(e),a=o.length-1;for(;a>=r;r++)n=r===a?this:this.clone(!0),b(o[r])[t](n),d.apply(i,n.get());return this.pushStack(i)}});function Ot(e,n){var r,o,a=0,s=typeof e.getElementsByTagName!==i?e.getElementsByTagName(n||"*"):typeof e.querySelectorAll!==i?e.querySelectorAll(n||"*"):t;if(!s)for(s=[],r=e.childNodes||e;null!=(o=r[a]);a++)!n||b.nodeName(o,n)?s.push(o):b.merge(s,Ot(o,n));return n===t||n&&b.nodeName(e,n)?b.merge([e],s):s}function Bt(e){Nt.test(e.type)&&(e.defaultChecked=e.checked)}b.extend({clone:function(e,t,n){var r,i,o,a,s,u=b.contains(e.ownerDocument,e);if(b.support.html5Clone||b.isXMLDoc(e)||!mt.test("<"+e.nodeName+">")?o=e.cloneNode(!0):(Dt.innerHTML=e.outerHTML,Dt.removeChild(o=Dt.firstChild)),!(b.support.noCloneEvent&&b.support.noCloneChecked||1!==e.nodeType&&11!==e.nodeType||b.isXMLDoc(e)))for(r=Ot(o),s=Ot(e),a=0;null!=(i=s[a]);++a)r[a]&&Ft(i,r[a]);if(t)if(n)for(s=s||Ot(e),r=r||Ot(o),a=0;null!=(i=s[a]);a++)_t(i,r[a]);else _t(e,o);return r=Ot(o,"script"),r.length>0&&Mt(r,!u&&Ot(e,"script")),r=s=i=null,o},buildFragment:function(e,t,n,r){var i,o,a,s,u,l,c,p=e.length,f=dt(t),d=[],h=0;for(;p>h;h++)if(o=e[h],o||0===o)if("object"===b.type(o))b.merge(d,o.nodeType?[o]:o);else if(wt.test(o)){s=s||f.appendChild(t.createElement("div")),u=(bt.exec(o)||["",""])[1].toLowerCase(),c=At[u]||At._default,s.innerHTML=c[1]+o.replace(vt,"<$1></$2>")+c[2],i=c[0];while(i--)s=s.lastChild;if(!b.support.leadingWhitespace&&yt.test(o)&&d.push(t.createTextNode(yt.exec(o)[0])),!b.support.tbody){o="table"!==u||xt.test(o)?"<table>"!==c[1]||xt.test(o)?0:s:s.firstChild,i=o&&o.childNodes.length;while(i--)b.nodeName(l=o.childNodes[i],"tbody")&&!l.childNodes.length&&o.removeChild(l) }b.merge(d,s.childNodes),s.textContent="";while(s.firstChild)s.removeChild(s.firstChild);s=f.lastChild}else d.push(t.createTextNode(o));s&&f.removeChild(s),b.support.appendChecked||b.grep(Ot(d,"input"),Bt),h=0;while(o=d[h++])if((!r||-1===b.inArray(o,r))&&(a=b.contains(o.ownerDocument,o),s=Ot(f.appendChild(o),"script"),a&&Mt(s),n)){i=0;while(o=s[i++])kt.test(o.type||"")&&n.push(o)}return s=null,f},cleanData:function(e,t){var n,r,o,a,s=0,u=b.expando,l=b.cache,p=b.support.deleteExpando,f=b.event.special;for(;null!=(n=e[s]);s++)if((t||b.acceptData(n))&&(o=n[u],a=o&&l[o])){if(a.events)for(r in a.events)f[r]?b.event.remove(n,r):b.removeEvent(n,r,a.handle);l[o]&&(delete l[o],p?delete n[u]:typeof n.removeAttribute!==i?n.removeAttribute(u):n[u]=null,c.push(o))}}});var Pt,Rt,Wt,$t=/alpha\([^)]*\)/i,It=/opacity\s*=\s*([^)]*)/,zt=/^(top|right|bottom|left)$/,Xt=/^(none|table(?!-c[ea]).+)/,Ut=/^margin/,Vt=RegExp("^("+x+")(.*)$","i"),Yt=RegExp("^("+x+")(?!px)[a-z%]+$","i"),Jt=RegExp("^([+-])=("+x+")","i"),Gt={BODY:"block"},Qt={position:"absolute",visibility:"hidden",display:"block"},Kt={letterSpacing:0,fontWeight:400},Zt=["Top","Right","Bottom","Left"],en=["Webkit","O","Moz","ms"];function tn(e,t){if(t in e)return t;var n=t.charAt(0).toUpperCase()+t.slice(1),r=t,i=en.length;while(i--)if(t=en[i]+n,t in e)return t;return r}function nn(e,t){return e=t||e,"none"===b.css(e,"display")||!b.contains(e.ownerDocument,e)}function rn(e,t){var n,r,i,o=[],a=0,s=e.length;for(;s>a;a++)r=e[a],r.style&&(o[a]=b._data(r,"olddisplay"),n=r.style.display,t?(o[a]||"none"!==n||(r.style.display=""),""===r.style.display&&nn(r)&&(o[a]=b._data(r,"olddisplay",un(r.nodeName)))):o[a]||(i=nn(r),(n&&"none"!==n||!i)&&b._data(r,"olddisplay",i?n:b.css(r,"display"))));for(a=0;s>a;a++)r=e[a],r.style&&(t&&"none"!==r.style.display&&""!==r.style.display||(r.style.display=t?o[a]||"":"none"));return e}b.fn.extend({css:function(e,n){return b.access(this,function(e,n,r){var i,o,a={},s=0;if(b.isArray(n)){for(o=Rt(e),i=n.length;i>s;s++)a[n[s]]=b.css(e,n[s],!1,o);return a}return r!==t?b.style(e,n,r):b.css(e,n)},e,n,arguments.length>1)},show:function(){return rn(this,!0)},hide:function(){return rn(this)},toggle:function(e){var t="boolean"==typeof e;return this.each(function(){(t?e:nn(this))?b(this).show():b(this).hide()})}}),b.extend({cssHooks:{opacity:{get:function(e,t){if(t){var n=Wt(e,"opacity");return""===n?"1":n}}}},cssNumber:{columnCount:!0,fillOpacity:!0,fontWeight:!0,lineHeight:!0,opacity:!0,orphans:!0,widows:!0,zIndex:!0,zoom:!0},cssProps:{"float":b.support.cssFloat?"cssFloat":"styleFloat"},style:function(e,n,r,i){if(e&&3!==e.nodeType&&8!==e.nodeType&&e.style){var o,a,s,u=b.camelCase(n),l=e.style;if(n=b.cssProps[u]||(b.cssProps[u]=tn(l,u)),s=b.cssHooks[n]||b.cssHooks[u],r===t)return s&&"get"in s&&(o=s.get(e,!1,i))!==t?o:l[n];if(a=typeof r,"string"===a&&(o=Jt.exec(r))&&(r=(o[1]+1)*o[2]+parseFloat(b.css(e,n)),a="number"),!(null==r||"number"===a&&isNaN(r)||("number"!==a||b.cssNumber[u]||(r+="px"),b.support.clearCloneStyle||""!==r||0!==n.indexOf("background")||(l[n]="inherit"),s&&"set"in s&&(r=s.set(e,r,i))===t)))try{l[n]=r}catch(c){}}},css:function(e,n,r,i){var o,a,s,u=b.camelCase(n);return n=b.cssProps[u]||(b.cssProps[u]=tn(e.style,u)),s=b.cssHooks[n]||b.cssHooks[u],s&&"get"in s&&(a=s.get(e,!0,r)),a===t&&(a=Wt(e,n,i)),"normal"===a&&n in Kt&&(a=Kt[n]),""===r||r?(o=parseFloat(a),r===!0||b.isNumeric(o)?o||0:a):a},swap:function(e,t,n,r){var i,o,a={};for(o in t)a[o]=e.style[o],e.style[o]=t[o];i=n.apply(e,r||[]);for(o in t)e.style[o]=a[o];return i}}),e.getComputedStyle?(Rt=function(t){return e.getComputedStyle(t,null)},Wt=function(e,n,r){var i,o,a,s=r||Rt(e),u=s?s.getPropertyValue(n)||s[n]:t,l=e.style;return s&&(""!==u||b.contains(e.ownerDocument,e)||(u=b.style(e,n)),Yt.test(u)&&Ut.test(n)&&(i=l.width,o=l.minWidth,a=l.maxWidth,l.minWidth=l.maxWidth=l.width=u,u=s.width,l.width=i,l.minWidth=o,l.maxWidth=a)),u}):o.documentElement.currentStyle&&(Rt=function(e){return e.currentStyle},Wt=function(e,n,r){var i,o,a,s=r||Rt(e),u=s?s[n]:t,l=e.style;return null==u&&l&&l[n]&&(u=l[n]),Yt.test(u)&&!zt.test(n)&&(i=l.left,o=e.runtimeStyle,a=o&&o.left,a&&(o.left=e.currentStyle.left),l.left="fontSize"===n?"1em":u,u=l.pixelLeft+"px",l.left=i,a&&(o.left=a)),""===u?"auto":u});function on(e,t,n){var r=Vt.exec(t);return r?Math.max(0,r[1]-(n||0))+(r[2]||"px"):t}function an(e,t,n,r,i){var o=n===(r?"border":"content")?4:"width"===t?1:0,a=0;for(;4>o;o+=2)"margin"===n&&(a+=b.css(e,n+Zt[o],!0,i)),r?("content"===n&&(a-=b.css(e,"padding"+Zt[o],!0,i)),"margin"!==n&&(a-=b.css(e,"border"+Zt[o]+"Width",!0,i))):(a+=b.css(e,"padding"+Zt[o],!0,i),"padding"!==n&&(a+=b.css(e,"border"+Zt[o]+"Width",!0,i)));return a}function sn(e,t,n){var r=!0,i="width"===t?e.offsetWidth:e.offsetHeight,o=Rt(e),a=b.support.boxSizing&&"border-box"===b.css(e,"boxSizing",!1,o);if(0>=i||null==i){if(i=Wt(e,t,o),(0>i||null==i)&&(i=e.style[t]),Yt.test(i))return i;r=a&&(b.support.boxSizingReliable||i===e.style[t]),i=parseFloat(i)||0}return i+an(e,t,n||(a?"border":"content"),r,o)+"px"}function un(e){var t=o,n=Gt[e];return n||(n=ln(e,t),"none"!==n&&n||(Pt=(Pt||b("<iframe frameborder='0' width='0' height='0'/>").css("cssText","display:block !important")).appendTo(t.documentElement),t=(Pt[0].contentWindow||Pt[0].contentDocument).document,t.write("<!doctype html><html><body>"),t.close(),n=ln(e,t),Pt.detach()),Gt[e]=n),n}function ln(e,t){var n=b(t.createElement(e)).appendTo(t.body),r=b.css(n[0],"display");return n.remove(),r}b.each(["height","width"],function(e,n){b.cssHooks[n]={get:function(e,r,i){return r?0===e.offsetWidth&&Xt.test(b.css(e,"display"))?b.swap(e,Qt,function(){return sn(e,n,i)}):sn(e,n,i):t},set:function(e,t,r){var i=r&&Rt(e);return on(e,t,r?an(e,n,r,b.support.boxSizing&&"border-box"===b.css(e,"boxSizing",!1,i),i):0)}}}),b.support.opacity||(b.cssHooks.opacity={get:function(e,t){return It.test((t&&e.currentStyle?e.currentStyle.filter:e.style.filter)||"")?.01*parseFloat(RegExp.$1)+"":t?"1":""},set:function(e,t){var n=e.style,r=e.currentStyle,i=b.isNumeric(t)?"alpha(opacity="+100*t+")":"",o=r&&r.filter||n.filter||"";n.zoom=1,(t>=1||""===t)&&""===b.trim(o.replace($t,""))&&n.removeAttribute&&(n.removeAttribute("filter"),""===t||r&&!r.filter)||(n.filter=$t.test(o)?o.replace($t,i):o+" "+i)}}),b(function(){b.support.reliableMarginRight||(b.cssHooks.marginRight={get:function(e,n){return n?b.swap(e,{display:"inline-block"},Wt,[e,"marginRight"]):t}}),!b.support.pixelPosition&&b.fn.position&&b.each(["top","left"],function(e,n){b.cssHooks[n]={get:function(e,r){return r?(r=Wt(e,n),Yt.test(r)?b(e).position()[n]+"px":r):t}}})}),b.expr&&b.expr.filters&&(b.expr.filters.hidden=function(e){return 0>=e.offsetWidth&&0>=e.offsetHeight||!b.support.reliableHiddenOffsets&&"none"===(e.style&&e.style.display||b.css(e,"display"))},b.expr.filters.visible=function(e){return!b.expr.filters.hidden(e)}),b.each({margin:"",padding:"",border:"Width"},function(e,t){b.cssHooks[e+t]={expand:function(n){var r=0,i={},o="string"==typeof n?n.split(" "):[n];for(;4>r;r++)i[e+Zt[r]+t]=o[r]||o[r-2]||o[0];return i}},Ut.test(e)||(b.cssHooks[e+t].set=on)});var cn=/%20/g,pn=/\[\]$/,fn=/\r?\n/g,dn=/^(?:submit|button|image|reset|file)$/i,hn=/^(?:input|select|textarea|keygen)/i;b.fn.extend({serialize:function(){return b.param(this.serializeArray())},serializeArray:function(){return this.map(function(){var e=b.prop(this,"elements");return e?b.makeArray(e):this}).filter(function(){var e=this.type;return this.name&&!b(this).is(":disabled")&&hn.test(this.nodeName)&&!dn.test(e)&&(this.checked||!Nt.test(e))}).map(function(e,t){var n=b(this).val();return null==n?null:b.isArray(n)?b.map(n,function(e){return{name:t.name,value:e.replace(fn,"\r\n")}}):{name:t.name,value:n.replace(fn,"\r\n")}}).get()}}),b.param=function(e,n){var r,i=[],o=function(e,t){t=b.isFunction(t)?t():null==t?"":t,i[i.length]=encodeURIComponent(e)+"="+encodeURIComponent(t)};if(n===t&&(n=b.ajaxSettings&&b.ajaxSettings.traditional),b.isArray(e)||e.jquery&&!b.isPlainObject(e))b.each(e,function(){o(this.name,this.value)});else for(r in e)gn(r,e[r],n,o);return i.join("&").replace(cn,"+")};function gn(e,t,n,r){var i;if(b.isArray(t))b.each(t,function(t,i){n||pn.test(e)?r(e,i):gn(e+"["+("object"==typeof i?t:"")+"]",i,n,r)});else if(n||"object"!==b.type(t))r(e,t);else for(i in t)gn(e+"["+i+"]",t[i],n,r)}b.each("blur focus focusin focusout load resize scroll unload click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select submit keydown keypress keyup error contextmenu".split(" "),function(e,t){b.fn[t]=function(e,n){return arguments.length>0?this.on(t,null,e,n):this.trigger(t)}}),b.fn.hover=function(e,t){return this.mouseenter(e).mouseleave(t||e)};var mn,yn,vn=b.now(),bn=/\?/,xn=/#.*$/,wn=/([?&])_=[^&]*/,Tn=/^(.*?):[ \t]*([^\r\n]*)\r?$/gm,Nn=/^(?:about|app|app-storage|.+-extension|file|res|widget):$/,Cn=/^(?:GET|HEAD)$/,kn=/^\/\//,En=/^([\w.+-]+:)(?:\/\/([^\/?#:]*)(?::(\d+)|)|)/,Sn=b.fn.load,An={},jn={},Dn="*/".concat("*");try{yn=a.href}catch(Ln){yn=o.createElement("a"),yn.href="",yn=yn.href}mn=En.exec(yn.toLowerCase())||[];function Hn(e){return function(t,n){"string"!=typeof t&&(n=t,t="*");var r,i=0,o=t.toLowerCase().match(w)||[];if(b.isFunction(n))while(r=o[i++])"+"===r[0]?(r=r.slice(1)||"*",(e[r]=e[r]||[]).unshift(n)):(e[r]=e[r]||[]).push(n)}}function qn(e,n,r,i){var o={},a=e===jn;function s(u){var l;return o[u]=!0,b.each(e[u]||[],function(e,u){var c=u(n,r,i);return"string"!=typeof c||a||o[c]?a?!(l=c):t:(n.dataTypes.unshift(c),s(c),!1)}),l}return s(n.dataTypes[0])||!o["*"]&&s("*")}function Mn(e,n){var r,i,o=b.ajaxSettings.flatOptions||{};for(i in n)n[i]!==t&&((o[i]?e:r||(r={}))[i]=n[i]);return r&&b.extend(!0,e,r),e}b.fn.load=function(e,n,r){if("string"!=typeof e&&Sn)return Sn.apply(this,arguments);var i,o,a,s=this,u=e.indexOf(" ");return u>=0&&(i=e.slice(u,e.length),e=e.slice(0,u)),b.isFunction(n)?(r=n,n=t):n&&"object"==typeof n&&(a="POST"),s.length>0&&b.ajax({url:e,type:a,dataType:"html",data:n}).done(function(e){o=arguments,s.html(i?b("<div>").append(b.parseHTML(e)).find(i):e)}).complete(r&&function(e,t){s.each(r,o||[e.responseText,t,e])}),this},b.each(["ajaxStart","ajaxStop","ajaxComplete","ajaxError","ajaxSuccess","ajaxSend"],function(e,t){b.fn[t]=function(e){return this.on(t,e)}}),b.each(["get","post"],function(e,n){b[n]=function(e,r,i,o){return b.isFunction(r)&&(o=o||i,i=r,r=t),b.ajax({url:e,type:n,dataType:o,data:r,success:i})}}),b.extend({active:0,lastModified:{},etag:{},ajaxSettings:{url:yn,type:"GET",isLocal:Nn.test(mn[1]),global:!0,processData:!0,async:!0,contentType:"application/x-www-form-urlencoded; charset=UTF-8",accepts:{"*":Dn,text:"text/plain",html:"text/html",xml:"application/xml, text/xml",json:"application/json, text/javascript"},contents:{xml:/xml/,html:/html/,json:/json/},responseFields:{xml:"responseXML",text:"responseText"},converters:{"* text":e.String,"text html":!0,"text json":b.parseJSON,"text xml":b.parseXML},flatOptions:{url:!0,context:!0}},ajaxSetup:function(e,t){return t?Mn(Mn(e,b.ajaxSettings),t):Mn(b.ajaxSettings,e)},ajaxPrefilter:Hn(An),ajaxTransport:Hn(jn),ajax:function(e,n){"object"==typeof e&&(n=e,e=t),n=n||{};var r,i,o,a,s,u,l,c,p=b.ajaxSetup({},n),f=p.context||p,d=p.context&&(f.nodeType||f.jquery)?b(f):b.event,h=b.Deferred(),g=b.Callbacks("once memory"),m=p.statusCode||{},y={},v={},x=0,T="canceled",N={readyState:0,getResponseHeader:function(e){var t;if(2===x){if(!c){c={};while(t=Tn.exec(a))c[t[1].toLowerCase()]=t[2]}t=c[e.toLowerCase()]}return null==t?null:t},getAllResponseHeaders:function(){return 2===x?a:null},setRequestHeader:function(e,t){var n=e.toLowerCase();return x||(e=v[n]=v[n]||e,y[e]=t),this},overrideMimeType:function(e){return x||(p.mimeType=e),this},statusCode:function(e){var t;if(e)if(2>x)for(t in e)m[t]=[m[t],e[t]];else N.always(e[N.status]);return this},abort:function(e){var t=e||T;return l&&l.abort(t),k(0,t),this}};if(h.promise(N).complete=g.add,N.success=N.done,N.error=N.fail,p.url=((e||p.url||yn)+"").replace(xn,"").replace(kn,mn[1]+"//"),p.type=n.method||n.type||p.method||p.type,p.dataTypes=b.trim(p.dataType||"*").toLowerCase().match(w)||[""],null==p.crossDomain&&(r=En.exec(p.url.toLowerCase()),p.crossDomain=!(!r||r[1]===mn[1]&&r[2]===mn[2]&&(r[3]||("http:"===r[1]?80:443))==(mn[3]||("http:"===mn[1]?80:443)))),p.data&&p.processData&&"string"!=typeof p.data&&(p.data=b.param(p.data,p.traditional)),qn(An,p,n,N),2===x)return N;u=p.global,u&&0===b.active++&&b.event.trigger("ajaxStart"),p.type=p.type.toUpperCase(),p.hasContent=!Cn.test(p.type),o=p.url,p.hasContent||(p.data&&(o=p.url+=(bn.test(o)?"&":"?")+p.data,delete p.data),p.cache===!1&&(p.url=wn.test(o)?o.replace(wn,"$1_="+vn++):o+(bn.test(o)?"&":"?")+"_="+vn++)),p.ifModified&&(b.lastModified[o]&&N.setRequestHeader("If-Modified-Since",b.lastModified[o]),b.etag[o]&&N.setRequestHeader("If-None-Match",b.etag[o])),(p.data&&p.hasContent&&p.contentType!==!1||n.contentType)&&N.setRequestHeader("Content-Type",p.contentType),N.setRequestHeader("Accept",p.dataTypes[0]&&p.accepts[p.dataTypes[0]]?p.accepts[p.dataTypes[0]]+("*"!==p.dataTypes[0]?", "+Dn+"; q=0.01":""):p.accepts["*"]);for(i in p.headers)N.setRequestHeader(i,p.headers[i]);if(p.beforeSend&&(p.beforeSend.call(f,N,p)===!1||2===x))return N.abort();T="abort";for(i in{success:1,error:1,complete:1})N[i](p[i]);if(l=qn(jn,p,n,N)){N.readyState=1,u&&d.trigger("ajaxSend",[N,p]),p.async&&p.timeout>0&&(s=setTimeout(function(){N.abort("timeout")},p.timeout));try{x=1,l.send(y,k)}catch(C){if(!(2>x))throw C;k(-1,C)}}else k(-1,"No Transport");function k(e,n,r,i){var c,y,v,w,T,C=n;2!==x&&(x=2,s&&clearTimeout(s),l=t,a=i||"",N.readyState=e>0?4:0,r&&(w=_n(p,N,r)),e>=200&&300>e||304===e?(p.ifModified&&(T=N.getResponseHeader("Last-Modified"),T&&(b.lastModified[o]=T),T=N.getResponseHeader("etag"),T&&(b.etag[o]=T)),204===e?(c=!0,C="nocontent"):304===e?(c=!0,C="notmodified"):(c=Fn(p,w),C=c.state,y=c.data,v=c.error,c=!v)):(v=C,(e||!C)&&(C="error",0>e&&(e=0))),N.status=e,N.statusText=(n||C)+"",c?h.resolveWith(f,[y,C,N]):h.rejectWith(f,[N,C,v]),N.statusCode(m),m=t,u&&d.trigger(c?"ajaxSuccess":"ajaxError",[N,p,c?y:v]),g.fireWith(f,[N,C]),u&&(d.trigger("ajaxComplete",[N,p]),--b.active||b.event.trigger("ajaxStop")))}return N},getScript:function(e,n){return b.get(e,t,n,"script")},getJSON:function(e,t,n){return b.get(e,t,n,"json")}});function _n(e,n,r){var i,o,a,s,u=e.contents,l=e.dataTypes,c=e.responseFields;for(s in c)s in r&&(n[c[s]]=r[s]);while("*"===l[0])l.shift(),o===t&&(o=e.mimeType||n.getResponseHeader("Content-Type"));if(o)for(s in u)if(u[s]&&u[s].test(o)){l.unshift(s);break}if(l[0]in r)a=l[0];else{for(s in r){if(!l[0]||e.converters[s+" "+l[0]]){a=s;break}i||(i=s)}a=a||i}return a?(a!==l[0]&&l.unshift(a),r[a]):t}function Fn(e,t){var n,r,i,o,a={},s=0,u=e.dataTypes.slice(),l=u[0];if(e.dataFilter&&(t=e.dataFilter(t,e.dataType)),u[1])for(i in e.converters)a[i.toLowerCase()]=e.converters[i];for(;r=u[++s];)if("*"!==r){if("*"!==l&&l!==r){if(i=a[l+" "+r]||a["* "+r],!i)for(n in a)if(o=n.split(" "),o[1]===r&&(i=a[l+" "+o[0]]||a["* "+o[0]])){i===!0?i=a[n]:a[n]!==!0&&(r=o[0],u.splice(s--,0,r));break}if(i!==!0)if(i&&e["throws"])t=i(t);else try{t=i(t)}catch(c){return{state:"parsererror",error:i?c:"No conversion from "+l+" to "+r}}}l=r}return{state:"success",data:t}}b.ajaxSetup({accepts:{script:"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"},contents:{script:/(?:java|ecma)script/},converters:{"text script":function(e){return b.globalEval(e),e}}}),b.ajaxPrefilter("script",function(e){e.cache===t&&(e.cache=!1),e.crossDomain&&(e.type="GET",e.global=!1)}),b.ajaxTransport("script",function(e){if(e.crossDomain){var n,r=o.head||b("head")[0]||o.documentElement;return{send:function(t,i){n=o.createElement("script"),n.async=!0,e.scriptCharset&&(n.charset=e.scriptCharset),n.src=e.url,n.onload=n.onreadystatechange=function(e,t){(t||!n.readyState||/loaded|complete/.test(n.readyState))&&(n.onload=n.onreadystatechange=null,n.parentNode&&n.parentNode.removeChild(n),n=null,t||i(200,"success"))},r.insertBefore(n,r.firstChild)},abort:function(){n&&n.onload(t,!0)}}}});var On=[],Bn=/(=)\?(?=&|$)|\?\?/;b.ajaxSetup({jsonp:"callback",jsonpCallback:function(){var e=On.pop()||b.expando+"_"+vn++;return this[e]=!0,e}}),b.ajaxPrefilter("json jsonp",function(n,r,i){var o,a,s,u=n.jsonp!==!1&&(Bn.test(n.url)?"url":"string"==typeof n.data&&!(n.contentType||"").indexOf("application/x-www-form-urlencoded")&&Bn.test(n.data)&&"data");return u||"jsonp"===n.dataTypes[0]?(o=n.jsonpCallback=b.isFunction(n.jsonpCallback)?n.jsonpCallback():n.jsonpCallback,u?n[u]=n[u].replace(Bn,"$1"+o):n.jsonp!==!1&&(n.url+=(bn.test(n.url)?"&":"?")+n.jsonp+"="+o),n.converters["script json"]=function(){return s||b.error(o+" was not called"),s[0]},n.dataTypes[0]="json",a=e[o],e[o]=function(){s=arguments},i.always(function(){e[o]=a,n[o]&&(n.jsonpCallback=r.jsonpCallback,On.push(o)),s&&b.isFunction(a)&&a(s[0]),s=a=t}),"script"):t});var Pn,Rn,Wn=0,$n=e.ActiveXObject&&function(){var e;for(e in Pn)Pn[e](t,!0)};function In(){try{return new e.XMLHttpRequest}catch(t){}}function zn(){try{return new e.ActiveXObject("Microsoft.XMLHTTP")}catch(t){}}b.ajaxSettings.xhr=e.ActiveXObject?function(){return!this.isLocal&&In()||zn()}:In,Rn=b.ajaxSettings.xhr(),b.support.cors=!!Rn&&"withCredentials"in Rn,Rn=b.support.ajax=!!Rn,Rn&&b.ajaxTransport(function(n){if(!n.crossDomain||b.support.cors){var r;return{send:function(i,o){var a,s,u=n.xhr();if(n.username?u.open(n.type,n.url,n.async,n.username,n.password):u.open(n.type,n.url,n.async),n.xhrFields)for(s in n.xhrFields)u[s]=n.xhrFields[s];n.mimeType&&u.overrideMimeType&&u.overrideMimeType(n.mimeType),n.crossDomain||i["X-Requested-With"]||(i["X-Requested-With"]="XMLHttpRequest");try{for(s in i)u.setRequestHeader(s,i[s])}catch(l){}u.send(n.hasContent&&n.data||null),r=function(e,i){var s,l,c,p;try{if(r&&(i||4===u.readyState))if(r=t,a&&(u.onreadystatechange=b.noop,$n&&delete Pn[a]),i)4!==u.readyState&&u.abort();else{p={},s=u.status,l=u.getAllResponseHeaders(),"string"==typeof u.responseText&&(p.text=u.responseText);try{c=u.statusText}catch(f){c=""}s||!n.isLocal||n.crossDomain?1223===s&&(s=204):s=p.text?200:404}}catch(d){i||o(-1,d)}p&&o(s,c,p,l)},n.async?4===u.readyState?setTimeout(r):(a=++Wn,$n&&(Pn||(Pn={},b(e).unload($n)),Pn[a]=r),u.onreadystatechange=r):r()},abort:function(){r&&r(t,!0)}}}});var Xn,Un,Vn=/^(?:toggle|show|hide)$/,Yn=RegExp("^(?:([+-])=|)("+x+")([a-z%]*)$","i"),Jn=/queueHooks$/,Gn=[nr],Qn={"*":[function(e,t){var n,r,i=this.createTween(e,t),o=Yn.exec(t),a=i.cur(),s=+a||0,u=1,l=20;if(o){if(n=+o[2],r=o[3]||(b.cssNumber[e]?"":"px"),"px"!==r&&s){s=b.css(i.elem,e,!0)||n||1;do u=u||".5",s/=u,b.style(i.elem,e,s+r);while(u!==(u=i.cur()/a)&&1!==u&&--l)}i.unit=r,i.start=s,i.end=o[1]?s+(o[1]+1)*n:n}return i}]};function Kn(){return setTimeout(function(){Xn=t}),Xn=b.now()}function Zn(e,t){b.each(t,function(t,n){var r=(Qn[t]||[]).concat(Qn["*"]),i=0,o=r.length;for(;o>i;i++)if(r[i].call(e,t,n))return})}function er(e,t,n){var r,i,o=0,a=Gn.length,s=b.Deferred().always(function(){delete u.elem}),u=function(){if(i)return!1;var t=Xn||Kn(),n=Math.max(0,l.startTime+l.duration-t),r=n/l.duration||0,o=1-r,a=0,u=l.tweens.length;for(;u>a;a++)l.tweens[a].run(o);return s.notifyWith(e,[l,o,n]),1>o&&u?n:(s.resolveWith(e,[l]),!1)},l=s.promise({elem:e,props:b.extend({},t),opts:b.extend(!0,{specialEasing:{}},n),originalProperties:t,originalOptions:n,startTime:Xn||Kn(),duration:n.duration,tweens:[],createTween:function(t,n){var r=b.Tween(e,l.opts,t,n,l.opts.specialEasing[t]||l.opts.easing);return l.tweens.push(r),r},stop:function(t){var n=0,r=t?l.tweens.length:0;if(i)return this;for(i=!0;r>n;n++)l.tweens[n].run(1);return t?s.resolveWith(e,[l,t]):s.rejectWith(e,[l,t]),this}}),c=l.props;for(tr(c,l.opts.specialEasing);a>o;o++)if(r=Gn[o].call(l,e,c,l.opts))return r;return Zn(l,c),b.isFunction(l.opts.start)&&l.opts.start.call(e,l),b.fx.timer(b.extend(u,{elem:e,anim:l,queue:l.opts.queue})),l.progress(l.opts.progress).done(l.opts.done,l.opts.complete).fail(l.opts.fail).always(l.opts.always)}function tr(e,t){var n,r,i,o,a;for(i in e)if(r=b.camelCase(i),o=t[r],n=e[i],b.isArray(n)&&(o=n[1],n=e[i]=n[0]),i!==r&&(e[r]=n,delete e[i]),a=b.cssHooks[r],a&&"expand"in a){n=a.expand(n),delete e[r];for(i in n)i in e||(e[i]=n[i],t[i]=o)}else t[r]=o}b.Animation=b.extend(er,{tweener:function(e,t){b.isFunction(e)?(t=e,e=["*"]):e=e.split(" ");var n,r=0,i=e.length;for(;i>r;r++)n=e[r],Qn[n]=Qn[n]||[],Qn[n].unshift(t)},prefilter:function(e,t){t?Gn.unshift(e):Gn.push(e)}});function nr(e,t,n){var r,i,o,a,s,u,l,c,p,f=this,d=e.style,h={},g=[],m=e.nodeType&&nn(e);n.queue||(c=b._queueHooks(e,"fx"),null==c.unqueued&&(c.unqueued=0,p=c.empty.fire,c.empty.fire=function(){c.unqueued||p()}),c.unqueued++,f.always(function(){f.always(function(){c.unqueued--,b.queue(e,"fx").length||c.empty.fire()})})),1===e.nodeType&&("height"in t||"width"in t)&&(n.overflow=[d.overflow,d.overflowX,d.overflowY],"inline"===b.css(e,"display")&&"none"===b.css(e,"float")&&(b.support.inlineBlockNeedsLayout&&"inline"!==un(e.nodeName)?d.zoom=1:d.display="inline-block")),n.overflow&&(d.overflow="hidden",b.support.shrinkWrapBlocks||f.always(function(){d.overflow=n.overflow[0],d.overflowX=n.overflow[1],d.overflowY=n.overflow[2]}));for(i in t)if(a=t[i],Vn.exec(a)){if(delete t[i],u=u||"toggle"===a,a===(m?"hide":"show"))continue;g.push(i)}if(o=g.length){s=b._data(e,"fxshow")||b._data(e,"fxshow",{}),"hidden"in s&&(m=s.hidden),u&&(s.hidden=!m),m?b(e).show():f.done(function(){b(e).hide()}),f.done(function(){var t;b._removeData(e,"fxshow");for(t in h)b.style(e,t,h[t])});for(i=0;o>i;i++)r=g[i],l=f.createTween(r,m?s[r]:0),h[r]=s[r]||b.style(e,r),r in s||(s[r]=l.start,m&&(l.end=l.start,l.start="width"===r||"height"===r?1:0))}}function rr(e,t,n,r,i){return new rr.prototype.init(e,t,n,r,i)}b.Tween=rr,rr.prototype={constructor:rr,init:function(e,t,n,r,i,o){this.elem=e,this.prop=n,this.easing=i||"swing",this.options=t,this.start=this.now=this.cur(),this.end=r,this.unit=o||(b.cssNumber[n]?"":"px")},cur:function(){var e=rr.propHooks[this.prop];return e&&e.get?e.get(this):rr.propHooks._default.get(this)},run:function(e){var t,n=rr.propHooks[this.prop];return this.pos=t=this.options.duration?b.easing[this.easing](e,this.options.duration*e,0,1,this.options.duration):e,this.now=(this.end-this.start)*t+this.start,this.options.step&&this.options.step.call(this.elem,this.now,this),n&&n.set?n.set(this):rr.propHooks._default.set(this),this}},rr.prototype.init.prototype=rr.prototype,rr.propHooks={_default:{get:function(e){var t;return null==e.elem[e.prop]||e.elem.style&&null!=e.elem.style[e.prop]?(t=b.css(e.elem,e.prop,""),t&&"auto"!==t?t:0):e.elem[e.prop]},set:function(e){b.fx.step[e.prop]?b.fx.step[e.prop](e):e.elem.style&&(null!=e.elem.style[b.cssProps[e.prop]]||b.cssHooks[e.prop])?b.style(e.elem,e.prop,e.now+e.unit):e.elem[e.prop]=e.now}}},rr.propHooks.scrollTop=rr.propHooks.scrollLeft={set:function(e){e.elem.nodeType&&e.elem.parentNode&&(e.elem[e.prop]=e.now)}},b.each(["toggle","show","hide"],function(e,t){var n=b.fn[t];b.fn[t]=function(e,r,i){return null==e||"boolean"==typeof e?n.apply(this,arguments):this.animate(ir(t,!0),e,r,i)}}),b.fn.extend({fadeTo:function(e,t,n,r){return this.filter(nn).css("opacity",0).show().end().animate({opacity:t},e,n,r)},animate:function(e,t,n,r){var i=b.isEmptyObject(e),o=b.speed(t,n,r),a=function(){var t=er(this,b.extend({},e),o);a.finish=function(){t.stop(!0)},(i||b._data(this,"finish"))&&t.stop(!0)};return a.finish=a,i||o.queue===!1?this.each(a):this.queue(o.queue,a)},stop:function(e,n,r){var i=function(e){var t=e.stop;delete e.stop,t(r)};return"string"!=typeof e&&(r=n,n=e,e=t),n&&e!==!1&&this.queue(e||"fx",[]),this.each(function(){var t=!0,n=null!=e&&e+"queueHooks",o=b.timers,a=b._data(this);if(n)a[n]&&a[n].stop&&i(a[n]);else for(n in a)a[n]&&a[n].stop&&Jn.test(n)&&i(a[n]);for(n=o.length;n--;)o[n].elem!==this||null!=e&&o[n].queue!==e||(o[n].anim.stop(r),t=!1,o.splice(n,1));(t||!r)&&b.dequeue(this,e)})},finish:function(e){return e!==!1&&(e=e||"fx"),this.each(function(){var t,n=b._data(this),r=n[e+"queue"],i=n[e+"queueHooks"],o=b.timers,a=r?r.length:0;for(n.finish=!0,b.queue(this,e,[]),i&&i.cur&&i.cur.finish&&i.cur.finish.call(this),t=o.length;t--;)o[t].elem===this&&o[t].queue===e&&(o[t].anim.stop(!0),o.splice(t,1));for(t=0;a>t;t++)r[t]&&r[t].finish&&r[t].finish.call(this);delete n.finish})}});function ir(e,t){var n,r={height:e},i=0;for(t=t?1:0;4>i;i+=2-t)n=Zt[i],r["margin"+n]=r["padding"+n]=e;return t&&(r.opacity=r.width=e),r}b.each({slideDown:ir("show"),slideUp:ir("hide"),slideToggle:ir("toggle"),fadeIn:{opacity:"show"},fadeOut:{opacity:"hide"},fadeToggle:{opacity:"toggle"}},function(e,t){b.fn[e]=function(e,n,r){return this.animate(t,e,n,r)}}),b.speed=function(e,t,n){var r=e&&"object"==typeof e?b.extend({},e):{complete:n||!n&&t||b.isFunction(e)&&e,duration:e,easing:n&&t||t&&!b.isFunction(t)&&t};return r.duration=b.fx.off?0:"number"==typeof r.duration?r.duration:r.duration in b.fx.speeds?b.fx.speeds[r.duration]:b.fx.speeds._default,(null==r.queue||r.queue===!0)&&(r.queue="fx"),r.old=r.complete,r.complete=function(){b.isFunction(r.old)&&r.old.call(this),r.queue&&b.dequeue(this,r.queue)},r},b.easing={linear:function(e){return e},swing:function(e){return.5-Math.cos(e*Math.PI)/2}},b.timers=[],b.fx=rr.prototype.init,b.fx.tick=function(){var e,n=b.timers,r=0;for(Xn=b.now();n.length>r;r++)e=n[r],e()||n[r]!==e||n.splice(r--,1);n.length||b.fx.stop(),Xn=t},b.fx.timer=function(e){e()&&b.timers.push(e)&&b.fx.start()},b.fx.interval=13,b.fx.start=function(){Un||(Un=setInterval(b.fx.tick,b.fx.interval))},b.fx.stop=function(){clearInterval(Un),Un=null},b.fx.speeds={slow:600,fast:200,_default:400},b.fx.step={},b.expr&&b.expr.filters&&(b.expr.filters.animated=function(e){return b.grep(b.timers,function(t){return e===t.elem}).length}),b.fn.offset=function(e){if(arguments.length)return e===t?this:this.each(function(t){b.offset.setOffset(this,e,t)});var n,r,o={top:0,left:0},a=this[0],s=a&&a.ownerDocument;if(s)return n=s.documentElement,b.contains(n,a)?(typeof a.getBoundingClientRect!==i&&(o=a.getBoundingClientRect()),r=or(s),{top:o.top+(r.pageYOffset||n.scrollTop)-(n.clientTop||0),left:o.left+(r.pageXOffset||n.scrollLeft)-(n.clientLeft||0)}):o},b.offset={setOffset:function(e,t,n){var r=b.css(e,"position");"static"===r&&(e.style.position="relative");var i=b(e),o=i.offset(),a=b.css(e,"top"),s=b.css(e,"left"),u=("absolute"===r||"fixed"===r)&&b.inArray("auto",[a,s])>-1,l={},c={},p,f;u?(c=i.position(),p=c.top,f=c.left):(p=parseFloat(a)||0,f=parseFloat(s)||0),b.isFunction(t)&&(t=t.call(e,n,o)),null!=t.top&&(l.top=t.top-o.top+p),null!=t.left&&(l.left=t.left-o.left+f),"using"in t?t.using.call(e,l):i.css(l)}},b.fn.extend({position:function(){if(this[0]){var e,t,n={top:0,left:0},r=this[0];return"fixed"===b.css(r,"position")?t=r.getBoundingClientRect():(e=this.offsetParent(),t=this.offset(),b.nodeName(e[0],"html")||(n=e.offset()),n.top+=b.css(e[0],"borderTopWidth",!0),n.left+=b.css(e[0],"borderLeftWidth",!0)),{top:t.top-n.top-b.css(r,"marginTop",!0),left:t.left-n.left-b.css(r,"marginLeft",!0)}}},offsetParent:function(){return this.map(function(){var e=this.offsetParent||o.documentElement;while(e&&!b.nodeName(e,"html")&&"static"===b.css(e,"position"))e=e.offsetParent;return e||o.documentElement})}}),b.each({scrollLeft:"pageXOffset",scrollTop:"pageYOffset"},function(e,n){var r=/Y/.test(n);b.fn[e]=function(i){return b.access(this,function(e,i,o){var a=or(e);return o===t?a?n in a?a[n]:a.document.documentElement[i]:e[i]:(a?a.scrollTo(r?b(a).scrollLeft():o,r?o:b(a).scrollTop()):e[i]=o,t)},e,i,arguments.length,null)}});function or(e){return b.isWindow(e)?e:9===e.nodeType?e.defaultView||e.parentWindow:!1}b.each({Height:"height",Width:"width"},function(e,n){b.each({padding:"inner"+e,content:n,"":"outer"+e},function(r,i){b.fn[i]=function(i,o){var a=arguments.length&&(r||"boolean"!=typeof i),s=r||(i===!0||o===!0?"margin":"border");return b.access(this,function(n,r,i){var o;return b.isWindow(n)?n.document.documentElement["client"+e]:9===n.nodeType?(o=n.documentElement,Math.max(n.body["scroll"+e],o["scroll"+e],n.body["offset"+e],o["offset"+e],o["client"+e])):i===t?b.css(n,r,s):b.style(n,r,i,s)},n,a?i:t,a,null)}})}),e.jQuery=e.$=b,"function"==typeof define&&define.amd&&define.amd.jQuery&&define("jquery",[],function(){return b})})(window);
packages/material-ui-icons/src/NotificationsActive.js
dsslimshaddy/material-ui
import React from 'react'; import pure from 'recompose/pure'; import SvgIcon from 'material-ui/SvgIcon'; let NotificationsActive = props => <SvgIcon {...props}> <path d="M7.58 4.08L6.15 2.65C3.75 4.48 2.17 7.3 2.03 10.5h2c.15-2.65 1.51-4.97 3.55-6.42zm12.39 6.42h2c-.15-3.2-1.73-6.02-4.12-7.85l-1.42 1.43c2.02 1.45 3.39 3.77 3.54 6.42zM18 11c0-3.07-1.64-5.64-4.5-6.32V4c0-.83-.67-1.5-1.5-1.5s-1.5.67-1.5 1.5v.68C7.63 5.36 6 7.92 6 11v5l-2 2v1h16v-1l-2-2v-5zm-6 11c.14 0 .27-.01.4-.04.65-.14 1.18-.58 1.44-1.18.1-.24.15-.5.15-.78h-4c.01 1.1.9 2 2.01 2z" /> </SvgIcon>; NotificationsActive = pure(NotificationsActive); NotificationsActive.muiName = 'SvgIcon'; export default NotificationsActive;
src/renderer/ui/components/modals/AboutModal.js
MarshallOfSound/Google-Play-Music-Desktop-Player-UNOFFICIAL-
import { remote } from 'electron'; import React, { Component } from 'react'; import Dialog from './ThemedDialog'; import FlatButton from 'material-ui/FlatButton'; const appVersion = remote.app.getVersion(); const appName = remote.app.getName(); const appInDevMode = remote.getGlobal('DEV_MODE') ? 'Running in Development Mode' : ''; export default class AboutModal extends Component { constructor(...args) { super(...args); this.state = { open: false, }; } componentDidMount() { Emitter.on('about', this.show); } componentWillUnmount() { Emitter.off('about', this.show); } handleClose = () => { this.setState({ open: false, }); } show = () => { this.setState({ open: true, }); } render() { const actions = [ <FlatButton label={TranslationProvider.query('button-text-close')} onTouchTap={this.handleClose} />, ]; return ( <Dialog actions={actions} open={this.state.open} onRequestClose={this.handleClose} modal={false} > <h4> {TranslationProvider.query('label-about')} {appName} </h4> <p> {TranslationProvider.query('label-version')}: {appVersion} </p> <p> {appInDevMode} </p> </Dialog> ); } }
test/PopoverSpec.js
johanneshilden/react-bootstrap
import React from 'react'; import ReactTestUtils from 'react/lib/ReactTestUtils'; import Popover from '../src/Popover'; describe('Popover', function () { it('Should output a popover title and content', function () { let instance = ReactTestUtils.renderIntoDocument( <Popover title="Popover title"> <strong>Popover Content</strong> </Popover> ); assert.ok(ReactTestUtils.findRenderedDOMComponentWithClass(instance, 'popover-title')); assert.ok(ReactTestUtils.findRenderedDOMComponentWithClass(instance, 'popover-content')); assert.ok(ReactTestUtils.findRenderedDOMComponentWithClass(instance, 'fade')); assert.ok(ReactTestUtils.findRenderedDOMComponentWithTag(instance, 'strong')); }); it('Should not have the fade class if animation is false', function () { let instance = ReactTestUtils.renderIntoDocument( <Popover title="Popover title" animation={false}> <strong>Popover Content</strong> </Popover> ); assert.equal(React.findDOMNode(instance).className.match(/\bfade\b/), null, 'The fade class should not be present'); }); });
components/Menu/index.js
insane-ux/rebulma
// @flow import React from 'react' import cn from 'classnames' const Menu = ({ className, renderLink, items = [], }: { className?: string, renderLink: Function, items: Array<any>, }) => ( <ul className={cn('menu-list', className)}> {items.map(renderLink)} </ul> ) Menu.defaultProps = { className: null, items: [], } export default Menu
src/ChoiceField/__tests__/ChoiceField_test.js
react-fabric/react-fabric
import React from 'react' import { render } from 'enzyme' import test from 'tape' import ChoiceField from '..' test('ChoiceField', t => { t.ok(ChoiceField, 'export') t.equal(ChoiceField.displayName, 'FabricComponent(ChoiceField)') t.end() }) test('ChoiceField#render - simple', t => { const container = render( <ChoiceField name="foo" label="Foo">Foo</ChoiceField> ).contents() t.assert(container.is('div.ms-ChoiceField', 'container')) t.assert(container.is('[data-fabric="ChoiceField"]'), 'data-fabric') t.equal(container.find('.ms-ChoiceField-field > .ms-Label').text(), 'Foo') t.end() })
ui/redux/actions/content.js
lbryio/lbry-electron
// @flow import * as ACTIONS from 'constants/action_types'; import * as SETTINGS from 'constants/settings'; import * as NOTIFICATION_TYPES from 'constants/subscriptions'; import * as MODALS from 'constants/modal_types'; // @if TARGET='app' import { ipcRenderer } from 'electron'; // @endif import { doOpenModal } from 'redux/actions/app'; import { push } from 'connected-react-router'; import { doUpdateUnreadSubscriptions } from 'redux/actions/subscriptions'; import { makeSelectUnreadByChannel } from 'redux/selectors/subscriptions'; import { Lbry, makeSelectFileInfoForUri, selectFileInfosByOutpoint, makeSelectChannelForClaimUri, parseURI, doPurchaseUri, makeSelectUriIsStreamable, selectDownloadingByOutpoint, makeSelectClaimForUri, makeSelectClaimIsMine, makeSelectClaimWasPurchased, } from 'lbry-redux'; import { makeSelectCostInfoForUri, Lbryio } from 'lbryinc'; import { makeSelectClientSetting, selectosNotificationsEnabled, selectDaemonSettings } from 'redux/selectors/settings'; import { formatLbryUrlForWeb } from 'util/url'; import { selectFloatingUri } from 'redux/selectors/content'; const DOWNLOAD_POLL_INTERVAL = 250; export function doUpdateLoadStatus(uri: string, outpoint: string) { // Updates the loading status for a uri as it's downloading // Calls file_list and checks the written_bytes value to see if the number has increased // Not needed on web as users aren't actually downloading the file // @if TARGET='app' return (dispatch: Dispatch, getState: GetState) => { const setNextStatusUpdate = () => setTimeout(() => { // We need to check if outpoint still exists first because user are able to delete file (outpoint) while downloading. // If a file is already deleted, no point to still try update load status const byOutpoint = selectFileInfosByOutpoint(getState()); if (byOutpoint[outpoint]) { dispatch(doUpdateLoadStatus(uri, outpoint)); } }, DOWNLOAD_POLL_INTERVAL); Lbry.file_list({ outpoint, full_status: true, page: 1, page_size: 1, }).then(result => { const { items: fileInfos } = result; const fileInfo = fileInfos[0]; if (!fileInfo || fileInfo.written_bytes === 0) { // download hasn't started yet setNextStatusUpdate(); } else if (fileInfo.completed) { const state = getState(); // TODO this isn't going to get called if they reload the client before // the download finished dispatch({ type: ACTIONS.DOWNLOADING_COMPLETED, data: { uri, outpoint, fileInfo, }, }); const channelUri = makeSelectChannelForClaimUri(uri, true)(state); const { channelName } = parseURI(channelUri); const claimName = '@' + channelName; const unreadForChannel = makeSelectUnreadByChannel(channelUri)(state); if (unreadForChannel && unreadForChannel.type === NOTIFICATION_TYPES.DOWNLOADING) { const count = unreadForChannel.uris.length; if (selectosNotificationsEnabled(state)) { const notif = new window.Notification(claimName, { body: `Posted ${fileInfo.metadata.title}${ count > 1 && count < 10 ? ` and ${count - 1} other new items` : '' }${count > 9 ? ' and 9+ other new items' : ''}`, silent: false, }); notif.onclick = () => { dispatch(push(formatLbryUrlForWeb(uri))); }; } dispatch(doUpdateUnreadSubscriptions(channelUri, null, NOTIFICATION_TYPES.DOWNLOADED)); } else { // If notifications are disabled(false) just return if (!selectosNotificationsEnabled(getState()) || !fileInfo.written_bytes) return; const notif = new window.Notification(__('LBRY Download Complete'), { body: fileInfo.metadata.title, silent: false, }); // @if TARGET='app' notif.onclick = () => { ipcRenderer.send('focusWindow', 'main'); }; // @ENDIF } } else { // ready to play const { total_bytes: totalBytes, written_bytes: writtenBytes } = fileInfo; const progress = (writtenBytes / totalBytes) * 100; dispatch({ type: ACTIONS.DOWNLOADING_PROGRESSED, data: { uri, outpoint, fileInfo, progress, }, }); setNextStatusUpdate(); } }); }; // @endif } export function doSetPlayingUri(uri: ?string) { return (dispatch: Dispatch) => { dispatch({ type: ACTIONS.SET_PLAYING_URI, data: { uri }, }); }; } export function doSetFloatingUri(uri: ?string) { return (dispatch: Dispatch) => { dispatch({ type: ACTIONS.SET_FLOATING_URI, data: { uri }, }); }; } export function doCloseFloatingPlayer() { return (dispatch: Dispatch, getState: GetState) => { const state = getState(); const floatingUri = selectFloatingUri(state); if (floatingUri) { dispatch(doSetFloatingUri(null)); } else { dispatch(doSetPlayingUri(null)); } }; } export function doPurchaseUriWrapper(uri: string, cost: number, saveFile: boolean, cb: ?(GetResponse) => void) { return (dispatch: Dispatch, getState: () => any) => { function onSuccess(fileInfo) { if (saveFile) { dispatch(doUpdateLoadStatus(uri, fileInfo.outpoint)); } if (cb) { cb(fileInfo); } } dispatch(doPurchaseUri(uri, { costInfo: cost }, saveFile, onSuccess)); }; } export function doPlayUri( uri: string, skipCostCheck: boolean = false, saveFileOverride: boolean = false, cb?: () => void ) { return (dispatch: Dispatch, getState: () => any) => { const state = getState(); const isMine = makeSelectClaimIsMine(uri)(state); const fileInfo = makeSelectFileInfoForUri(uri)(state); const uriIsStreamable = makeSelectUriIsStreamable(uri)(state); const downloadingByOutpoint = selectDownloadingByOutpoint(state); const claimWasPurchased = makeSelectClaimWasPurchased(uri)(state); const alreadyDownloaded = fileInfo && (fileInfo.completed || (fileInfo.blobs_remaining === 0 && uriIsStreamable)); const alreadyDownloading = fileInfo && !!downloadingByOutpoint[fileInfo.outpoint]; if (!IS_WEB && (alreadyDownloading || alreadyDownloaded)) { return; } const daemonSettings = selectDaemonSettings(state); const costInfo = makeSelectCostInfoForUri(uri)(state); const cost = (costInfo && Number(costInfo.cost)) || 0; const saveFile = !IS_WEB && (!uriIsStreamable ? true : daemonSettings.save_files || saveFileOverride || cost > 0); const instantPurchaseEnabled = makeSelectClientSetting(SETTINGS.INSTANT_PURCHASE_ENABLED)(state); const instantPurchaseMax = makeSelectClientSetting(SETTINGS.INSTANT_PURCHASE_MAX)(state); function beginGetFile() { dispatch(doPurchaseUriWrapper(uri, cost, saveFile, cb)); } function attemptPlay(instantPurchaseMax = null) { // If you have a file_list entry, you have already purchased the file if ( !isMine && !fileInfo && !claimWasPurchased && (!instantPurchaseMax || !instantPurchaseEnabled || cost > instantPurchaseMax) ) { dispatch(doOpenModal(MODALS.AFFIRM_PURCHASE, { uri })); } else { beginGetFile(); } } if (fileInfo && saveFile && (!fileInfo.download_path || !fileInfo.written_bytes)) { beginGetFile(); return; } if (cost === 0 || skipCostCheck) { beginGetFile(); return; } if (instantPurchaseEnabled) { if (instantPurchaseMax.currency === 'LBC') { attemptPlay(instantPurchaseMax.amount); } else { // Need to convert currency of instant purchase maximum before trying to play Lbryio.getExchangeRates().then(({ LBC_USD }) => { attemptPlay(instantPurchaseMax.amount / LBC_USD); }); } } else { attemptPlay(); } }; } export function savePosition(uri: string, position: number) { return (dispatch: Dispatch, getState: () => any) => { const state = getState(); const claim = makeSelectClaimForUri(uri)(state); const { claim_id: claimId, txid, nout } = claim; const outpoint = `${txid}:${nout}`; dispatch({ type: ACTIONS.SET_CONTENT_POSITION, data: { claimId, outpoint, position }, }); }; } export function clearPosition(uri: string) { return (dispatch: Dispatch, getState: () => any) => { const state = getState(); const claim = makeSelectClaimForUri(uri)(state); const { claim_id: claimId, txid, nout } = claim; const outpoint = `${txid}:${nout}`; dispatch({ type: ACTIONS.CLEAR_CONTENT_POSITION, data: { claimId, outpoint }, }); }; } export function doSetContentHistoryItem(uri: string) { return (dispatch: Dispatch) => { dispatch({ type: ACTIONS.SET_CONTENT_LAST_VIEWED, data: { uri, lastViewed: Date.now() }, }); }; } export function doClearContentHistoryUri(uri: string) { return (dispatch: Dispatch) => { dispatch({ type: ACTIONS.CLEAR_CONTENT_HISTORY_URI, data: { uri }, }); }; } export function doClearContentHistoryAll() { return (dispatch: Dispatch) => { dispatch({ type: ACTIONS.CLEAR_CONTENT_HISTORY_ALL }); }; }
packages/material-ui-icons/src/Ballot.js
allanalexandre/material-ui
import React from 'react'; import createSvgIcon from './utils/createSvgIcon'; export default createSvgIcon( <React.Fragment><defs><path id="a" d="M0 0h24v24H0z" /></defs><path fillRule="evenodd" d="M13 9.5h5v-2h-5v2zm0 7h5v-2h-5v2zm6 4.5H5c-1.1 0-2-.9-2-2V5c0-1.1.9-2 2-2h14c1.1 0 2 .9 2 2v14c0 1.1-.9 2-2 2zM6 11h5V6H6v5zm1-4h3v3H7V7zM6 18h5v-5H6v5zm1-4h3v3H7v-3z" clipRule="evenodd" /></React.Fragment> , 'Ballot');
src/svg-icons/action/class.js
kasra-co/material-ui
import React from 'react'; import pure from 'recompose/pure'; import SvgIcon from '../../SvgIcon'; let ActionClass = (props) => ( <SvgIcon {...props}> <path d="M18 2H6c-1.1 0-2 .9-2 2v16c0 1.1.9 2 2 2h12c1.1 0 2-.9 2-2V4c0-1.1-.9-2-2-2zM6 4h5v8l-2.5-1.5L6 12V4z"/> </SvgIcon> ); ActionClass = pure(ActionClass); ActionClass.displayName = 'ActionClass'; ActionClass.muiName = 'SvgIcon'; export default ActionClass;
src/index.js
JJVvV/tuotuo
import React from 'react'; import App from './App'; var Route = Router.Route; var RouteHandler = Router.RouteHandler; var About = require('./components/test/about'); var Home = require('./components/test/home'); var Inbox = require('./components/test/inbox'); //function render(){ // var route = window.location.hash.substr(1); // console.log('route change'); // // // React.render(<App route={route} />, document.body); //} // //window.addEventListener('hashchange', render); // // //render();
ajax/libs/yui/3.10.0/datatable-core/datatable-core.js
Enelar/cdnjs
YUI.add('datatable-core', function (Y, NAME) { /** The core implementation of the `DataTable` and `DataTable.Base` Widgets. @module datatable @submodule datatable-core @since 3.5.0 **/ var INVALID = Y.Attribute.INVALID_VALUE, Lang = Y.Lang, isFunction = Lang.isFunction, isObject = Lang.isObject, isArray = Lang.isArray, isString = Lang.isString, isNumber = Lang.isNumber, toArray = Y.Array, keys = Y.Object.keys, Table; /** _API docs for this extension are included in the DataTable class._ Class extension providing the core API and structure for the DataTable Widget. Use this class extension with Widget or another Base-based superclass to create the basic DataTable model API and composing class structure. @class DataTable.Core @for DataTable @since 3.5.0 **/ Table = Y.namespace('DataTable').Core = function () {}; Table.ATTRS = { /** Columns to include in the rendered table. If omitted, the attributes on the configured `recordType` or the first item in the `data` collection will be used as a source. This attribute takes an array of strings or objects (mixing the two is fine). Each string or object is considered a column to be rendered. Strings are converted to objects, so `columns: ['first', 'last']` becomes `columns: [{ key: 'first' }, { key: 'last' }]`. DataTable.Core only concerns itself with a few properties of columns. These properties are: * `key` - Used to identify the record field/attribute containing content for this column. Also used to create a default Model if no `recordType` or `data` are provided during construction. If `name` is not specified, this is assigned to the `_id` property (with added incrementer if the key is used by multiple columns). * `children` - Traversed to initialize nested column objects * `name` - Used in place of, or in addition to, the `key`. Useful for columns that aren't bound to a field/attribute in the record data. This is assigned to the `_id` property. * `id` - For backward compatibility. Implementers can specify the id of the header cell. This should be avoided, if possible, to avoid the potential for creating DOM elements with duplicate IDs. * `field` - For backward compatibility. Implementers should use `name`. * `_id` - Assigned unique-within-this-instance id for a column. By order of preference, assumes the value of `name`, `key`, `id`, or `_yuid`. This is used by the rendering views as well as feature module as a means to identify a specific column without ambiguity (such as multiple columns using the same `key`. * `_yuid` - Guid stamp assigned to the column object. * `_parent` - Assigned to all child columns, referencing their parent column. @attribute columns @type {Object[]|String[]} @default (from `recordType` ATTRS or first item in the `data`) @since 3.5.0 **/ columns: { // TODO: change to setter to clone input array/objects validator: isArray, setter: '_setColumns', getter: '_getColumns' }, /** Model subclass to use as the `model` for the ModelList stored in the `data` attribute. If not provided, it will try really hard to figure out what to use. The following attempts will be made to set a default value: 1. If the `data` attribute is set with a ModelList instance and its `model` property is set, that will be used. 2. If the `data` attribute is set with a ModelList instance, and its `model` property is unset, but it is populated, the `ATTRS` of the `constructor of the first item will be used. 3. If the `data` attribute is set with a non-empty array, a Model subclass will be generated using the keys of the first item as its `ATTRS` (see the `_createRecordClass` method). 4. If the `columns` attribute is set, a Model subclass will be generated using the columns defined with a `key`. This is least desirable because columns can be duplicated or nested in a way that's not parsable. 5. If neither `data` nor `columns` is set or populated, a change event subscriber will listen for the first to be changed and try all over again. @attribute recordType @type {Function} @default (see description) @since 3.5.0 **/ recordType: { getter: '_getRecordType', setter: '_setRecordType' }, /** The collection of data records to display. This attribute is a pass through to a `data` property, which is a ModelList instance. If this attribute is passed a ModelList or subclass, it will be assigned to the property directly. If an array of objects is passed, a new ModelList will be created using the configured `recordType` as its `model` property and seeded with the array. Retrieving this attribute will return the ModelList stored in the `data` property. @attribute data @type {ModelList|Object[]} @default `new ModelList()` @since 3.5.0 **/ data: { valueFn: '_initData', setter : '_setData', lazyAdd: false }, /** Content for the `<table summary="ATTRIBUTE VALUE HERE">`. Values assigned to this attribute will be HTML escaped for security. @attribute summary @type {String} @default '' (empty string) @since 3.5.0 **/ //summary: {}, /** HTML content of an optional `<caption>` element to appear above the table. Leave this config unset or set to a falsy value to remove the caption. @attribute caption @type HTML @default '' (empty string) @since 3.5.0 **/ //caption: {}, /** Deprecated as of 3.5.0. Passes through to the `data` attribute. WARNING: `get('recordset')` will NOT return a Recordset instance as of 3.5.0. This is a break in backward compatibility. @attribute recordset @type {Object[]|Recordset} @deprecated Use the `data` attribute @since 3.5.0 **/ recordset: { setter: '_setRecordset', getter: '_getRecordset', lazyAdd: false }, /** Deprecated as of 3.5.0. Passes through to the `columns` attribute. WARNING: `get('columnset')` will NOT return a Columnset instance as of 3.5.0. This is a break in backward compatibility. @attribute columnset @type {Object[]} @deprecated Use the `columns` attribute @since 3.5.0 **/ columnset: { setter: '_setColumnset', getter: '_getColumnset', lazyAdd: false } }; Y.mix(Table.prototype, { // -- Instance properties ------------------------------------------------- /** The ModelList that manages the table's data. @property data @type {ModelList} @default undefined (initially unset) @since 3.5.0 **/ //data: null, // -- Public methods ------------------------------------------------------ /** Gets the column configuration object for the given key, name, or index. For nested columns, `name` can be an array of indexes, each identifying the index of that column in the respective parent's "children" array. If you pass a column object, it will be returned. For columns with keys, you can also fetch the column with `instance.get('columns.foo')`. @method getColumn @param {String|Number|Number[]} name Key, "name", index, or index array to identify the column @return {Object} the column configuration object @since 3.5.0 **/ getColumn: function (name) { var col, columns, i, len, cols; if (isObject(name) && !isArray(name)) { // TODO: support getting a column from a DOM node - this will cross // the line into the View logic, so it should be relayed // Assume an object passed in is already a column def col = name; } else { col = this.get('columns.' + name); } if (col) { return col; } columns = this.get('columns'); if (isNumber(name) || isArray(name)) { name = toArray(name); cols = columns; for (i = 0, len = name.length - 1; cols && i < len; ++i) { cols = cols[name[i]] && cols[name[i]].children; } return (cols && cols[name[i]]) || null; } return null; }, /** Returns the Model associated to the record `id`, `clientId`, or index (not row index). If none of those yield a Model from the `data` ModelList, the arguments will be passed to the `view` instance's `getRecord` method if it has one. If no Model can be found, `null` is returned. @method getRecord @param {Number|String|Node} seed Record `id`, `clientId`, index, Node, or identifier for a row or child element @return {Model} @since 3.5.0 **/ getRecord: function (seed) { var record = this.data.getById(seed) || this.data.getByClientId(seed); if (!record) { if (isNumber(seed)) { record = this.data.item(seed); } // TODO: this should be split out to base somehow if (!record && this.view && this.view.getRecord) { record = this.view.getRecord.apply(this.view, arguments); } } return record || null; }, // -- Protected and private properties and methods ------------------------ /** This tells `Y.Base` that it should create ad-hoc attributes for config properties passed to DataTable's constructor. This is useful for setting configurations on the DataTable that are intended for the rendering View(s). @property _allowAdHocAttrs @type Boolean @default true @protected @since 3.6.0 **/ _allowAdHocAttrs: true, /** A map of column key to column configuration objects parsed from the `columns` attribute. @property _columnMap @type {Object} @default undefined (initially unset) @protected @since 3.5.0 **/ //_columnMap: null, /** The Node instance of the table containing the data rows. This is set when the table is rendered. It may also be set by progressive enhancement, though this extension does not provide the logic to parse from source. @property _tableNode @type {Node} @default undefined (initially unset) @protected @since 3.5.0 **/ //_tableNode: null, /** Updates the `_columnMap` property in response to changes in the `columns` attribute. @method _afterColumnsChange @param {EventFacade} e The `columnsChange` event object @protected @since 3.5.0 **/ _afterColumnsChange: function (e) { this._setColumnMap(e.newVal); }, /** Updates the `modelList` attributes of the rendered views in response to the `data` attribute being assigned a new ModelList. @method _afterDataChange @param {EventFacade} e the `dataChange` event @protected @since 3.5.0 **/ _afterDataChange: function (e) { var modelList = e.newVal; this.data = e.newVal; if (!this.get('columns') && modelList.size()) { // TODO: this will cause a re-render twice because the Views are // subscribed to columnsChange this._initColumns(); } }, /** Assigns to the new recordType as the model for the data ModelList @method _afterRecordTypeChange @param {EventFacade} e recordTypeChange event @protected @since 3.6.0 **/ _afterRecordTypeChange: function (e) { var data = this.data.toJSON(); this.data.model = e.newVal; this.data.reset(data); if (!this.get('columns') && data) { if (data.length) { this._initColumns(); } else { this.set('columns', keys(e.newVal.ATTRS)); } } }, /** Creates a Model subclass from an array of attribute names or an object of attribute definitions. This is used to generate a class suitable to represent the data passed to the `data` attribute if no `recordType` is set. @method _createRecordClass @param {String[]|Object} attrs Names assigned to the Model subclass's `ATTRS` or its entire `ATTRS` definition object @return {Model} @protected @since 3.5.0 **/ _createRecordClass: function (attrs) { var ATTRS, i, len; if (isArray(attrs)) { ATTRS = {}; for (i = 0, len = attrs.length; i < len; ++i) { ATTRS[attrs[i]] = {}; } } else if (isObject(attrs)) { ATTRS = attrs; } return Y.Base.create('record', Y.Model, [], null, { ATTRS: ATTRS }); }, /** Tears down the instance. @method destructor @protected @since 3.6.0 **/ destructor: function () { new Y.EventHandle(Y.Object.values(this._eventHandles)).detach(); }, /** The getter for the `columns` attribute. Returns the array of column configuration objects if `instance.get('columns')` is called, or the specific column object if `instance.get('columns.columnKey')` is called. @method _getColumns @param {Object[]} columns The full array of column objects @param {String} name The attribute name requested (e.g. 'columns' or 'columns.foo'); @protected @since 3.5.0 **/ _getColumns: function (columns, name) { // Workaround for an attribute oddity (ticket #2529254) // getter is expected to return an object if get('columns.foo') is called. // Note 'columns.' is 8 characters return name.length > 8 ? this._columnMap : columns; }, /** Relays the `get()` request for the deprecated `columnset` attribute to the `columns` attribute. THIS BREAKS BACKWARD COMPATIBILITY. 3.4.1 and prior implementations will expect a Columnset instance returned from `get('columnset')`. @method _getColumnset @param {Object} ignored The current value stored in the `columnset` state @param {String} name The attribute name requested (e.g. 'columnset' or 'columnset.foo'); @deprecated This will be removed with the `columnset` attribute in a future version. @protected @since 3.5.0 **/ _getColumnset: function (_, name) { return this.get(name.replace(/^columnset/, 'columns')); }, /** Returns the Model class of the instance's `data` attribute ModelList. If not set, returns the explicitly configured value. @method _getRecordType @param {Model} val The currently configured value @return {Model} **/ _getRecordType: function (val) { // Prefer the value stored in the attribute because the attribute // change event defaultFn sets e.newVal = this.get('recordType') // before notifying the after() subs. But if this getter returns // this.data.model, then after() subs would get e.newVal === previous // model before _afterRecordTypeChange can set // this.data.model = e.newVal return val || (this.data && this.data.model); }, /** Initializes the `_columnMap` property from the configured `columns` attribute. If `columns` is not set, but there are records in the `data` ModelList, use `ATTRS` of that class. @method _initColumns @protected @since 3.5.0 **/ _initColumns: function () { var columns = this.get('columns') || [], item; // Default column definition from the configured recordType if (!columns.length && this.data.size()) { // TODO: merge superclass attributes up to Model? item = this.data.item(0); if (item.toJSON) { item = item.toJSON(); } this.set('columns', keys(item)); } this._setColumnMap(columns); }, /** Sets up the change event subscriptions to maintain internal state. @method _initCoreEvents @protected @since 3.6.0 **/ _initCoreEvents: function () { this._eventHandles.coreAttrChanges = this.after({ columnsChange : Y.bind('_afterColumnsChange', this), recordTypeChange: Y.bind('_afterRecordTypeChange', this), dataChange : Y.bind('_afterDataChange', this) }); }, /** Defaults the `data` attribute to an empty ModelList if not set during construction. Uses the configured `recordType` for the ModelList's `model` proeprty if set. @method _initData @protected @return {ModelList} @since 3.6.0 **/ _initData: function () { var recordType = this.get('recordType'), // TODO: LazyModelList if recordType doesn't have complex ATTRS modelList = new Y.ModelList(); if (recordType) { modelList.model = recordType; } return modelList; }, /** Initializes the instance's `data` property from the value of the `data` attribute. If the attribute value is a ModelList, it is assigned directly to `this.data`. If it is an array, a ModelList is created, its `model` property is set to the configured `recordType` class, and it is seeded with the array data. This ModelList is then assigned to `this.data`. @method _initDataProperty @param {Array|ModelList|ArrayList} data Collection of data to populate the DataTable @protected @since 3.6.0 **/ _initDataProperty: function (data) { var recordType; if (!this.data) { recordType = this.get('recordType'); if (data && data.each && data.toJSON) { this.data = data; if (recordType) { this.data.model = recordType; } } else { // TODO: customize the ModelList or read the ModelList class // from a configuration option? this.data = new Y.ModelList(); if (recordType) { this.data.model = recordType; } } // TODO: Replace this with an event relay for specific events. // Using bubbling causes subscription conflicts with the models' // aggregated change event and 'change' events from DOM elements // inside the table (via Widget UI event). this.data.addTarget(this); } }, /** Initializes the columns, `recordType` and data ModelList. @method initializer @param {Object} config Configuration object passed to constructor @protected @since 3.5.0 **/ initializer: function (config) { var data = config.data, columns = config.columns, recordType; // Referencing config.data to allow _setData to be more stringent // about its behavior this._initDataProperty(data); // Default columns from recordType ATTRS if recordType is supplied at // construction. If no recordType is supplied, but the data is // supplied as a non-empty array, use the keys of the first item // as the columns. if (!columns) { recordType = (config.recordType || config.data === this.data) && this.get('recordType'); if (recordType) { columns = keys(recordType.ATTRS); } else if (isArray(data) && data.length) { columns = keys(data[0]); } if (columns) { this.set('columns', columns); } } this._initColumns(); this._eventHandles = {}; this._initCoreEvents(); }, /** Iterates the array of column configurations to capture all columns with a `key` property. An map is built with column keys as the property name and the corresponding column object as the associated value. This map is then assigned to the instance's `_columnMap` property. @method _setColumnMap @param {Object[]|String[]} columns The array of column config objects @protected @since 3.6.0 **/ _setColumnMap: function (columns) { var map = {}; function process(cols) { var i, len, col, key; for (i = 0, len = cols.length; i < len; ++i) { col = cols[i]; key = col.key; // First in wins for multiple columns with the same key // because the first call to genId (in _setColumns) will // return the same key, which will then be overwritten by the // subsequent same-keyed column. So table.getColumn(key) would // return the last same-keyed column. if (key && !map[key]) { map[key] = col; } //TODO: named columns can conflict with keyed columns map[col._id] = col; if (col.children) { process(col.children); } } } process(columns); this._columnMap = map; }, /** Translates string columns into objects with that string as the value of its `key` property. All columns are assigned a `_yuid` stamp and `_id` property corresponding to the column's configured `name` or `key` property with any spaces replaced with dashes. If the same `name` or `key` appears in multiple columns, subsequent appearances will have their `_id` appended with an incrementing number (e.g. if column "foo" is included in the `columns` attribute twice, the first will get `_id` of "foo", and the second an `_id` of "foo1"). Columns that are children of other columns will have the `_parent` property added, assigned the column object to which they belong. @method _setColumns @param {null|Object[]|String[]} val Array of config objects or strings @return {null|Object[]} @protected **/ _setColumns: function (val) { var keys = {}, known = [], knownCopies = [], arrayIndex = Y.Array.indexOf; function copyObj(o) { var copy = {}, key, val, i; known.push(o); knownCopies.push(copy); for (key in o) { if (o.hasOwnProperty(key)) { val = o[key]; if (isArray(val)) { copy[key] = val.slice(); } else if (isObject(val, true)) { i = arrayIndex(val, known); copy[key] = i === -1 ? copyObj(val) : knownCopies[i]; } else { copy[key] = o[key]; } } } return copy; } function genId(name) { // Sanitize the name for use in generated CSS classes. // TODO: is there more to do for other uses of _id? name = name.replace(/\s+/, '-'); if (keys[name]) { name += (keys[name]++); } else { keys[name] = 1; } return name; } function process(cols, parent) { var columns = [], i, len, col, yuid; for (i = 0, len = cols.length; i < len; ++i) { columns[i] = // chained assignment col = isString(cols[i]) ? { key: cols[i] } : copyObj(cols[i]); yuid = Y.stamp(col); // For backward compatibility if (!col.id) { // Implementers can shoot themselves in the foot by setting // this config property to a non-unique value col.id = yuid; } if (col.field) { // Field is now known as "name" to avoid confusion with data // fields or schema.resultFields col.name = col.field; } if (parent) { col._parent = parent; } else { delete col._parent; } // Unique id based on the column's configured name or key, // falling back to the yuid. Duplicates will have a counter // added to the end. col._id = genId(col.name || col.key || col.id); if (isArray(col.children)) { col.children = process(col.children, col); } } return columns; } return val && process(val); }, /** Relays attribute assignments of the deprecated `columnset` attribute to the `columns` attribute. If a Columnset is object is passed, its basic object structure is mined. @method _setColumnset @param {Array|Columnset} val The columnset value to relay @deprecated This will be removed with the deprecated `columnset` attribute in a later version. @protected @since 3.5.0 **/ _setColumnset: function (val) { this.set('columns', val); return isArray(val) ? val : INVALID; }, /** Accepts an object with `each` and `getAttrs` (preferably a ModelList or subclass) or an array of data objects. If an array is passes, it will create a ModelList to wrap the data. In doing so, it will set the created ModelList's `model` property to the class in the `recordType` attribute, which will be defaulted if not yet set. If the `data` property is already set with a ModelList, passing an array as the value will call the ModelList's `reset()` method with that array rather than replacing the stored ModelList wholesale. Any non-ModelList-ish and non-array value is invalid. @method _setData @protected @since 3.5.0 **/ _setData: function (val) { if (val === null) { val = []; } if (isArray(val)) { this._initDataProperty(); // silent to prevent subscribers to both reset and dataChange // from reacting to the change twice. // TODO: would it be better to return INVALID to silence the // dataChange event, or even allow both events? this.data.reset(val, { silent: true }); // Return the instance ModelList to avoid storing unprocessed // data in the state and their vivified Model representations in // the instance's data property. Decreases memory consumption. val = this.data; } else if (!val || !val.each || !val.toJSON) { // ModelList/ArrayList duck typing val = INVALID; } return val; }, /** Relays the value assigned to the deprecated `recordset` attribute to the `data` attribute. If a Recordset instance is passed, the raw object data will be culled from it. @method _setRecordset @param {Object[]|Recordset} val The recordset value to relay @deprecated This will be removed with the deprecated `recordset` attribute in a later version. @protected @since 3.5.0 **/ _setRecordset: function (val) { var data; if (val && Y.Recordset && val instanceof Y.Recordset) { data = []; val.each(function (record) { data.push(record.get('data')); }); val = data; } this.set('data', val); return val; }, /** Accepts a Base subclass (preferably a Model subclass). Alternately, it will generate a custom Model subclass from an array of attribute names or an object defining attributes and their respective configurations (it is assigned as the `ATTRS` of the new class). Any other value is invalid. @method _setRecordType @param {Function|String[]|Object} val The Model subclass, array of attribute names, or the `ATTRS` definition for a custom model subclass @return {Function} A Base/Model subclass @protected @since 3.5.0 **/ _setRecordType: function (val) { var modelClass; // Duck type based on known/likely consumed APIs if (isFunction(val) && val.prototype.toJSON && val.prototype.setAttrs) { modelClass = val; } else if (isObject(val)) { modelClass = this._createRecordClass(val); } return modelClass || INVALID; } }); }, '@VERSION@', {"requires": ["escape", "model-list", "node-event-delegate"]});
examples/huge-apps/app.js
bmathews/react-router
import React from 'react'; import { history } from 'react-router/lib/HashHistory'; import { Router } from 'react-router'; import AsyncProps from 'react-router/lib/experimental/AsyncProps'; import stubbedCourses from './stubs/COURSES'; var rootRoute = { component: AsyncProps, // iunno? renderInitialLoad() { return <div>loading...</div> }, childRoutes: [{ path: '/', component: require('./components/App'), childRoutes: [ require('./routes/Calendar'), require('./routes/Course'), require('./routes/Grades'), require('./routes/Messages'), require('./routes/Profile'), ]} ] }; React.render(( <Router routes={rootRoute} history={history} createElement={AsyncProps.createElement} /> ), document.getElementById('example'));
examples/03 Nesting/Drag Sources/index.js
nickknw/react-dnd
import React from 'react'; import Container from './Container'; export default class NestingDragSources { render() { return ( <div> <p> <b><a href='https://github.com/gaearon/react-dnd/tree/master/examples/03%20Nesting/Drag%20Sources'>Browse the Source</a></b> </p> <p> You can nest the drag sources in one another. If a nested drag source returns <code>false</code> from <code>canDrag</code>, its parent will be asked, until a draggable source is found and activated. Only the activated drag source will have its <code>beginDrag()</code> and <code>endDrag()</code> called. </p> <Container /> </div> ); } }
src/components/base/toolbar-buttons.js
ambrinchaudhary/alloy-editor
/** * SPDX-FileCopyrightText: © 2014 Liferay, Inc. <https://liferay.com> * SPDX-License-Identifier: LGPL-3.0-or-later */ import React from 'react'; import ReactDOM from 'react-dom'; import EditorContext from '../../adapter/editor-context'; import Lang from '../../oop/lang'; /** * ToolbarButtons provides a list of buttons which have to be displayed * on the current toolbar depending on user preferences and given state. * * @class ToolbarButtons */ export default WrappedComponent => class ToolbarButtons extends WrappedComponent { static contextType = EditorContext; /** * Lifecycle. Returns the default values of the properties used in the * toolbar. * * @instance * @memberof ToolbarButtons * @method getDefaultProps */ static defaultProps = { ...WrappedComponent.defaultProps, gutter: { left: 0, top: 10, }, constrainToViewport: true, }; /** * Cancels an scheduled animation frame. * * @instance * @memberof ToolbarButtons * @method cancelAnimation */ cancelAnimation() { if (this._animationFrameId) { window.cancelAnimationFrame(this._animationFrameId); } } /** * Provides functionality for displaying toolbar Arrow box on top or on bottom of the toolbar * depending on the point of user interaction with the editor. * Returns the list of arrow box classes associated to the current element's state. It relies * on the getInteractionPoint method to calculate the selection direction. * * @instance * @memberof ToolbarButtons * @method getArrowBoxClasses * @return {String} A string with the arrow box CSS classes. */ getArrowBoxClasses() { let arrowBoxClasses = 'ae-arrow-box'; if ( this.getInteractionPoint().direction === CKEDITOR.SELECTION_TOP_TO_BOTTOM ) { arrowBoxClasses += ' ae-arrow-box-top'; } else { arrowBoxClasses += ' ae-arrow-box-bottom'; } return arrowBoxClasses; } /** * Returns an object which contains the position of the element in page coordinates, * restricted to fit to given viewport. * * @instance * @memberof ToolbarButtons * @method getConstrainedPosition * @param {Object} attrs The following properties, provided as numbers: * - height * - left * - top * - width * @param {Object} viewPaneSize Optional. If not provided, the current viewport will be used. Should contain at least these properties: * - width * @return {Object} An object with `x` and `y` properties, which represent the constrained position of the * element. */ getConstrainedPosition(attrs, viewPaneSize) { viewPaneSize = viewPaneSize || new CKEDITOR.dom.window(window).getViewPaneSize(); let x = attrs.left; let y = attrs.top; if (attrs.left + attrs.width > viewPaneSize.width) { x -= attrs.left + attrs.width - viewPaneSize.width; } if (y < 0) { y = 0; } return { x, y, }; } /** * Returns the position, in page coordinates, according to which a toolbar should appear. * Depending on the direction of the selection, the wdiget may appear above of or on bottom of the selection. * * It depends on the props editorEvent to analyze the following user-interaction parameters: * - {Object} selectionData The data about the selection in the editor as returned from * {{#crossLink "CKEDITOR.plugins.ae_selectionregion/getSelectionData:method"}}{{/crossLink}} * - {Number} pos Contains the coordinates of the position, considered as most appropriate. * This may be the point where the user released the mouse, or just the beginning or the end of * the selection. * * @instance * @method getInteractionPoint * @return {Object} An Object which contains the following properties: * direction, x, y, where x and y are in page coordinates and direction can be one of these: * CKEDITOR.SELECTION_BOTTOM_TO_TOP or CKEDITOR.SELECTION_TOP_TO_BOTTOM */ getInteractionPoint() { const eventPayload = this.props.editorEvent ? this.props.editorEvent.data : null; if (!eventPayload) { return; } const selectionData = eventPayload.selectionData; const nativeEvent = eventPayload.nativeEvent; const pos = { x: eventPayload.nativeEvent.pageX, y: selectionData.region.top, }; let direction = selectionData.region.direction; const endRect = selectionData.region.endRect; const startRect = selectionData.region.startRect; if (endRect && startRect && startRect.top === endRect.top) { direction = CKEDITOR.SELECTION_BOTTOM_TO_TOP; } let x; let y; // If we have the point where user released the mouse, show Toolbar at this point // otherwise show it on the middle of the selection. if (pos.x && pos.y) { x = this._getXPoint(selectionData, pos.x); if (direction === CKEDITOR.SELECTION_BOTTOM_TO_TOP) { y = Math.min(pos.y, selectionData.region.top); } else { y = Math.max( pos.y, this._getYPoint(selectionData, nativeEvent) ); } } else { x = selectionData.region.left + selectionData.region.width / 2; if (direction === CKEDITOR.SELECTION_TOP_TO_BOTTOM) { y = this._getYPoint(selectionData, nativeEvent); } else { y = selectionData.region.top; } } return { direction, x, y, }; } /** * Returns the position of the toolbar. * * @instance * @method _getXPoint * @param {Object} eventX The X coordinate received from the native event (mouseup). * @param {Object} selectionData The data about the selection in the editor as returned from {{#crossLink "CKEDITOR.plugins.ae_selectionregion/getSelectionData:method"}}{{/crossLink}} * @protected * @return {Number} The calculated X point in page coordinates. */ _getXPoint(selectionData, eventX) { const region = selectionData.region; const left = region.startRect ? region.startRect.left : region.left; const right = region.endRect ? region.endRect.right : region.right; let x; if (left < eventX && right > eventX) { x = eventX; } else { const leftDist = Math.abs(left - eventX); const rightDist = Math.abs(right - eventX); if (leftDist < rightDist) { // user raised the mouse on left on the selection x = left; } else { x = right; } } return x; } /** * Returns the position of the toolbar. * * @instance * @method _getYPoint * @param {Object} nativeEvent The data about event is fired * @param {Object} selectionData The data about the selection in the editor as returned from {{#crossLink "CKEDITOR.plugins.ae_selectionregion/getSelectionData:method"}}{{/crossLink}} * @protected * @return {Number} The calculated Y point in page coordinates. */ _getYPoint(selectionData, nativeEvent) { let y = 0; if (selectionData && nativeEvent) { const elementTarget = new CKEDITOR.dom.element( nativeEvent.target ); if ( elementTarget.$ && elementTarget.getStyle('overflow') === 'auto' ) { y = nativeEvent.target.offsetTop + nativeEvent.target.offsetHeight; } else { y = selectionData.region.bottom; } } return y; } /** * Returns the position of the toolbar taking in consideration the * {{#crossLink "ToolbarButtons/gutter:attribute"}}{{/crossLink}} attribute. * * @instance * @memberof ToolbarButtons * @protected * @method getWidgetXYPoint * @param {Number} left The left offset in page coordinates where Toolbar should be shown. * @param {Number} top The top offset in page coordinates where Toolbar should be shown. * @param {Number} direction The direction of the selection. May be one of the following: * CKEDITOR.SELECTION_BOTTOM_TO_TOP or CKEDITOR.SELECTION_TOP_TO_BOTTOM * @return {Array} An Array with left and top offsets in page coordinates. */ getWidgetXYPoint(left, top, direction) { const domNode = ReactDOM.findDOMNode(this); const gutter = this.props.gutter; if ( direction === CKEDITOR.SELECTION_TOP_TO_BOTTOM || direction === CKEDITOR.SELECTION_BOTTOM_TO_TOP ) { left = left - gutter.left - domNode.offsetWidth / 2; top = direction === CKEDITOR.SELECTION_TOP_TO_BOTTOM ? top + gutter.top : top - domNode.offsetHeight - gutter.top; } else if ( direction === CKEDITOR.SELECTION_LEFT_TO_RIGHT || direction === CKEDITOR.SELECTION_RIGHT_TO_LEFT ) { left = direction === CKEDITOR.SELECTION_LEFT_TO_RIGHT ? left + gutter.left + domNode.offsetHeight / 2 : left - (3 * domNode.offsetHeight) / 2 - gutter.left; top = top - gutter.top - domNode.offsetHeight / 2; } if (left < 0) { left = 0; } if (top < 0) { top = 0; } return [left, top]; } /** * Returns true if the toolbar is visible, false otherwise * * @instance * @memberof ToolbarButtons * @method isVisible * @return {Boolean} True if the toolbar is visible, false otherwise */ isVisible() { const domNode = ReactDOM.findDOMNode(this); if (domNode) { const domElement = new CKEDITOR.dom.element(domNode); return domElement.hasClass('alloy-editor-visible'); } return false; } /** * Moves a toolbar from a starting point to a destination point. * * @instance * @memberof ToolbarButtons * @method moveToPoint * @param {Object} startPoint The starting point for the movement. * @param {Object} endPoint The destination point for the movement. */ moveToPoint(startPoint, endPoint) { const domElement = new CKEDITOR.dom.element( ReactDOM.findDOMNode(this) ); domElement.setStyles({ left: startPoint[0] + 'px', top: startPoint[1] + 'px', opacity: 0, pointerEvents: 'none', }); domElement.removeClass('alloy-editor-invisible'); this._animationFrameId = window.requestAnimationFrame(() => { domElement.addClass('ae-toolbar-transition'); domElement.addClass('alloy-editor-visible'); domElement.setStyles({ left: endPoint[0] + 'px', top: endPoint[1] + 'px', opacity: 1, }); // 150ms to match transition-duration for .ae-toolbar-transition: setTimeout(() => { domElement.setStyles({ pointerEvents: '', }); }, 150); }); } /** * Shows the toolbar with the default animation transition. * * @instance * @memberof ToolbarButtons * @method show */ show() { const domNode = ReactDOM.findDOMNode(this); const uiNode = this.context.editor.get('uiNode'); const scrollTop = uiNode ? uiNode.scrollTop : 0; if (!this.isVisible() && domNode) { const interactionPoint = this.getInteractionPoint(); if (interactionPoint) { const domElement = new CKEDITOR.dom.element(domNode); let finalX; let finalY; let initialX; let initialY; finalX = initialX = parseFloat(domElement.getStyle('left')); finalY = initialY = parseFloat(domElement.getStyle('top')); if (this.props.constrainToViewport) { const res = this.getConstrainedPosition({ height: parseFloat(domNode.offsetHeight), left: finalX, top: finalY, width: parseFloat(domNode.offsetWidth), }); finalX = res.x; finalY = res.y; } if ( interactionPoint.direction === CKEDITOR.SELECTION_TOP_TO_BOTTOM ) { initialY = this.props.selectionData.region.bottom + scrollTop; } else { initialY = this.props.selectionData.region.top + scrollTop; } this.moveToPoint([initialX, initialY], [finalX, finalY]); } } } /** * Updates the toolbar position based on the current interaction point. * * @instance * @memberof ToolbarButtons * @method updatePosition */ updatePosition() { const interactionPoint = this.getInteractionPoint(); const domNode = ReactDOM.findDOMNode(this); if (interactionPoint && domNode) { const uiNode = this.context.editor.get('uiNode') || document.body; const uiNodeStyle = getComputedStyle(uiNode); const uiNodeMarginLeft = parseInt( uiNodeStyle.getPropertyValue('margin-left'), 10 ); const uiNodeMarginRight = parseInt( uiNodeStyle.getPropertyValue('margin-right'), 10 ); const totalWidth = uiNodeMarginLeft + document.body.clientWidth + uiNodeMarginRight; const scrollTop = uiNode.tagName !== 'BODY' ? uiNode.scrollTop : 0; const xy = this.getWidgetXYPoint( interactionPoint.x, interactionPoint.y, interactionPoint.direction ); xy[1] += scrollTop; if (xy[0] < 0) { xy[0] = 0; } if (xy[0] > totalWidth - domNode.offsetWidth) { xy[0] = totalWidth - domNode.offsetWidth; } new CKEDITOR.dom.element(domNode).setStyles({ left: xy[0] + 'px', top: xy[1] + 'px', }); } } /** * Analyses the current selection and returns the buttons or button groups to be rendered. * * @instance * @method getToolbarButtonGroups * @param {Array} buttons The buttons could be shown, prior to the state filtering. * @param {Object} additionalProps Additional props that should be passed down to the buttons. * @return {Array} An Array which contains the buttons or button groups that should be rendered. */ getToolbarButtonGroups(buttons, additionalProps) { if (Lang.isFunction(buttons)) { buttons = buttons.call(this) || []; } return buttons.reduce((list, button) => { if (Array.isArray(button)) { list.push(this.getToolbarButtons(button, additionalProps)); return list; } else { return this.getToolbarButtons(buttons, additionalProps); } }, []); } /** * Analyzes the current selection and the buttons exclusive mode value to figure out which * buttons should be present in a given state. * * @instance * @memberof ToolbarButtons * @method getToolbarButtons * @param {Array} buttons The buttons could be shown, prior to the state filtering. * @param {Object} additionalProps Additional props that should be passed down to the buttons. * @return {Array} An Array which contains the buttons that should be rendered. */ getToolbarButtons(buttons, additionalProps) { const buttonProps = {}; const nativeEditor = this.context.editor.get('nativeEditor'); const buttonCfg = nativeEditor.config.buttonCfg || {}; if (Lang.isFunction(buttons)) { buttons = buttons.call(this) || []; } const toolbarButtons = this.filterExclusive( buttons .filter(button => { return ( button && (AlloyEditor.Buttons[button] || AlloyEditor.Buttons[button.name]) ); }) .map(button => { if (Lang.isString(button)) { buttonProps[button] = buttonCfg[button]; button = AlloyEditor.Buttons[button]; } else if (Lang.isString(button.name)) { buttonProps[ AlloyEditor.Buttons[button.name].key ] = CKEDITOR.tools.merge( buttonCfg[button], button.cfg ); button = AlloyEditor.Buttons[button.name]; } return button; }) ).map(function(button, index) { let props = this.mergeExclusiveProps( { editor: this.context.editor, key: button.key !== 'separator' ? button.key : `${button.key}-${index}`, tabKey: button.key, tabIndex: this.props.trigger && this.props.trigger.props.tabKey === button.key ? 0 : -1, trigger: this.props.trigger, }, button.key ); props = this.mergeDropdownProps(props, button.key); if (additionalProps) { props = CKEDITOR.tools.merge(props, additionalProps); } props = CKEDITOR.tools.merge(props, buttonProps[button.key]); return React.createElement(button, props); }, this); return toolbarButtons; } };
src/routes.js
kakapo2016-projects/tooth-and-pail
import React from 'react' import { Router, Route, browserHistory, IndexRoute } from 'react-router' import App from './components/App' import Profile from './components/Profile' import Home from './components/Home' import Trends from './components/Trends' import RecipientSignup from './components/RecipientSignup' import About from './components/About' import Feed from './components/Feed' module.exports = ( <Router history={browserHistory}> <Route path="/" component={Home}></Route> <Route path="gallery" component={App}></Route> <Route path="recipient/:recipientID" component={Profile}></Route> <Route path="trends" component={Trends}></Route> <Route path="submitteeth" component={RecipientSignup}></Route> <Route path="about" component={About}></Route> <Route path="feed" component={Feed}></Route> </Router> )