").append(B.parseHTML(t)).find(r):t)}).complete(n&&function(t,e){s.each(n,o||[t.responseText,e,t])}),this},B.each(["ajaxStart","ajaxStop","ajaxComplete","ajaxError","ajaxSuccess","ajaxSend"],function(t,e){B.fn[e]=function(t){return this.on(e,t)}}),"function"==typeof define&&define.amd&&define("jquery",[],function(){return B});var Wt=t.jQuery,Gt=t.$;return B.noConflict=function(e){return t.$===B&&(t.$=Gt),e&&t.jQuery===B&&(t.jQuery=Wt),B},typeof e===rt&&(t.jQuery=t.$=B),B}),function(t){var e="object"==typeof self&&self.self==self&&self||"object"==typeof global&&global.global==global&&global;if("function"==typeof define&&define.amd)define(["underscore","jquery","exports"],function(n,r,i){e.Backbone=t(e,i,n,r)});else if("undefined"!=typeof exports){var n,r=require("underscore");try{n=require("jquery")}catch(i){}t(e,exports,r,n)}else e.Backbone=t(e,{},e._,e.jQuery||e.Zepto||e.ender||e.$)}(function(t,e,n,r){var i=t.Backbone,o=Array.prototype.slice;e.VERSION="1.2.3",e.$=r,e.noConflict=function(){return t.Backbone=i,this},e.emulateHTTP=!1,e.emulateJSON=!1;var s=function(t,e,r){switch(t){case 1:return function(){return n[e](this[r])};case 2:return function(t){return n[e](this[r],t)};case 3:return function(t,i){return n[e](this[r],u(t,this),i)};case 4:return function(t,i,o){return n[e](this[r],u(t,this),i,o)};default:return function(){var t=o.call(arguments);return t.unshift(this[r]),n[e].apply(n,t)}}},a=function(t,e,r){n.each(e,function(e,i){n[i]&&(t.prototype[i]=s(e,i,r))})},u=function(t,e){return n.isFunction(t)?t:n.isObject(t)&&!e._isModel(t)?c(t):n.isString(t)?function(e){return e.get(t)}:t},c=function(t){var e=n.matches(t);return function(t){return e(t.attributes)}},l=e.Events={},h=/\s+/,f=function(t,e,r,i,o){var s,a=0;if(r&&"object"==typeof r){void 0!==i&&"context"in o&&void 0===o.context&&(o.context=i);for(s=n.keys(r);a
r;r++)n[r]=arguments[r+1];return f(y,this._events,t,void 0,n),this};var y=function(t,e,n,r){if(t){var i=t[e],o=t.all;i&&o&&(o=o.slice()),i&&v(i,r),o&&v(o,[e].concat(r))}return t},v=function(t,e){var n,r=-1,i=t.length,o=e[0],s=e[1],a=e[2];switch(e.length){case 0:for(;++ro;o++)t[o+n]=e[o];for(o=0;oi&&(i+=this.length+1);for(var o,s=[],a=[],u=[],c={},l=e.add,h=e.merge,f=e.remove,p=!1,d=this.comparator&&null==i&&e.sort!==!1,g=n.isString(this.comparator)?this.comparator:null,m=0;mt&&(t+=this.length),this.models[t]},where:function(t,e){return this[e?"find":"filter"](t)},findWhere:function(t){return this.where(t,!0)},sort:function(t){var e=this.comparator;if(!e)throw new Error("Cannot sort a set without a comparator");t||(t={});var r=e.length;return n.isFunction(e)&&(e=n.bind(e,this)),1===r||n.isString(e)?this.models=this.sortBy(e):this.models.sort(e),t.silent||this.trigger("sort",this,t),
-this},pluck:function(t){return n.invoke(this.models,"get",t)},fetch:function(t){t=n.extend({parse:!0},t);var e=t.success,r=this;return t.success=function(n){var i=t.reset?"reset":"set";r[i](n,t),e&&e.call(t.context,r,n,t),r.trigger("sync",r,n,t)},V(this,t),this.sync("read",this,t)},create:function(t,e){e=e?n.clone(e):{};var r=e.wait;if(t=this._prepareModel(t,e),!t)return!1;r||this.add(t,e);var i=this,o=e.success;return e.success=function(t,e,n){r&&i.add(t,n),o&&o.call(n.context,t,e,n)},t.save(null,e),t},parse:function(t,e){return t},clone:function(){return new this.constructor(this.models,{model:this.model,comparator:this.comparator})},modelId:function(t){return t[this.model.prototype.idAttribute||"id"]},_reset:function(){this.length=0,this.models=[],this._byId={}},_prepareModel:function(t,e){if(this._isModel(t))return t.collection||(t.collection=this),t;e=e?n.clone(e):{},e.collection=this;var r=new this.model(t,e);return r.validationError?(this.trigger("invalid",this,r.validationError,e),!1):r},_removeModels:function(t,e){for(var n=[],r=0;r7),this._useHashChange=this._wantsHashChange&&this._hasHashChange,this._wantsPushState=!!this.options.pushState,this._hasPushState=!(!this.history||!this.history.pushState),this._usePushState=this._wantsPushState&&this._hasPushState,this.fragment=this.getFragment(),this.root=("/"+this.root+"/").replace(I,"/"),this._wantsHashChange&&this._wantsPushState){if(!this._hasPushState&&!this.atRoot()){var e=this.root.slice(0,-1)||"/";return this.location.replace(e+"#"+this.getPath()),!0}this._hasPushState&&this.atRoot()&&this.navigate(this.getHash(),{replace:!0})}if(!this._hasHashChange&&this._wantsHashChange&&!this._usePushState){this.iframe=document.createElement("iframe"),this.iframe.src="javascript:0",this.iframe.style.display="none",this.iframe.tabIndex=-1;var r=document.body,i=r.insertBefore(this.iframe,r.firstChild).contentWindow;i.document.open(),i.document.close(),i.location.hash="#"+this.fragment}var o=window.addEventListener||function(t,e){return attachEvent("on"+t,e)};return this._usePushState?o("popstate",this.checkUrl,!1):this._useHashChange&&!this.iframe?o("hashchange",this.checkUrl,!1):this._wantsHashChange&&(this._checkUrlInterval=setInterval(this.checkUrl,this.interval)),this.options.silent?void 0:this.loadUrl()},stop:function(){var t=window.removeEventListener||function(t,e){return detachEvent("on"+t,e)};this._usePushState?t("popstate",this.checkUrl,!1):this._useHashChange&&!this.iframe&&t("hashchange",this.checkUrl,!1),this.iframe&&(document.body.removeChild(this.iframe),this.iframe=null),this._checkUrlInterval&&clearInterval(this._checkUrlInterval),B.started=!1},route:function(t,e){this.handlers.unshift({route:t,callback:e})},checkUrl:function(t){var e=this.getFragment();return e===this.fragment&&this.iframe&&(e=this.getHash(this.iframe.contentWindow)),e===this.fragment?!1:(this.iframe&&this.navigate(e),void this.loadUrl())},loadUrl:function(t){return this.matchRoot()?(t=this.fragment=this.getFragment(t),n.some(this.handlers,function(e){return e.route.test(t)?(e.callback(t),!0):void 0})):!1},navigate:function(t,e){if(!B.started)return!1;e&&e!==!0||(e={trigger:!!e}),t=this.getFragment(t||"");var n=this.root;(""===t||"?"===t.charAt(0))&&(n=n.slice(0,-1)||"/");var r=n+t;if(t=this.decodeFragment(t.replace(L,"")),this.fragment!==t){if(this.fragment=t,this._usePushState)this.history[e.replace?"replaceState":"pushState"]({},document.title,r);else{if(!this._wantsHashChange)return this.location.assign(r);if(this._updateHash(this.location,t,e.replace),this.iframe&&t!==this.getHash(this.iframe.contentWindow)){var i=this.iframe.contentWindow;e.replace||(i.document.open(),i.document.close()),this._updateHash(i.location,t,e.replace)}}return e.trigger?this.loadUrl(t):void 0}},_updateHash:function(t,e,n){if(n){var r=t.href.replace(/(javascript:|#).*$/,"");t.replace(r+"#"+e)}else t.hash="#"+e}}),e.history=new B;var P=function(t,e){var r,i=this;r=t&&n.has(t,"constructor")?t.constructor:function(){return i.apply(this,arguments)},n.extend(r,i,e);var o=function(){this.constructor=r};return o.prototype=i.prototype,r.prototype=new o,t&&n.extend(r.prototype,t),r.__super__=i.prototype,r};_.extend=w.extend=M.extend=A.extend=B.extend=P;var U=function(){throw new Error('A "url" property or function must be specified')},V=function(t,e){var n=e.error;e.error=function(r){n&&n.call(e.context,t,r,e),t.trigger("error",t,r,e)}};return e}),function(t,e){if("function"==typeof define&&define.amd)define(["backbone","underscore"],function(t,n){return e(t,n)});else if("undefined"!=typeof exports){var n=require("backbone"),r=require("underscore");module.exports=e(n,r)}else e(t.Backbone,t._)}(this,function(t,e){"use strict";var n=t.ChildViewContainer;return t.ChildViewContainer=function(t,e){var n=function(t){this._views={},this._indexByModel={},this._indexByCustom={},this._updateLength(),e.each(t,this.add,this)};e.extend(n.prototype,{add:function(t,e){var n=t.cid;return this._views[n]=t,t.model&&(this._indexByModel[t.model.cid]=n),e&&(this._indexByCustom[e]=n),this._updateLength(),this},findByModel:function(t){return this.findByModelCid(t.cid)},findByModelCid:function(t){var e=this._indexByModel[t];return this.findByCid(e)},findByCustom:function(t){var e=this._indexByCustom[t];return this.findByCid(e)},findByIndex:function(t){return e.values(this._views)[t]},findByCid:function(t){return this._views[t]},remove:function(t){var n=t.cid;return t.model&&delete this._indexByModel[t.model.cid],e.any(this._indexByCustom,function(t,e){return t===n?(delete this._indexByCustom[e],!0):void 0},this),delete this._views[n],this._updateLength(),this},call:function(t){this.apply(t,e.tail(arguments))},apply:function(t,n){e.each(this._views,function(r){e.isFunction(r[t])&&r[t].apply(r,n||[])})},_updateLength:function(){this.length=e.size(this._views)}});var r=["forEach","each","map","find","detect","filter","select","reject","every","all","some","any","include","contains","invoke","toArray","first","initial","rest","last","without","isEmpty","pluck","reduce"];return e.each(r,function(t){n.prototype[t]=function(){var n=e.values(this._views),r=[n].concat(e.toArray(arguments));return e[t].apply(e,r)}}),n}(t,e),t.ChildViewContainer.VERSION="0.1.10",t.ChildViewContainer.noConflict=function(){return t.ChildViewContainer=n,this},t.ChildViewContainer}),function(t,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e(require("underscore"),require("backbone")):"function"==typeof define&&define.amd?define(["underscore","backbone"],e):t.Backbone.Radio=e(t._,t.Backbone)}(this,function(t,e){"use strict";function n(t,e,n,r){var i=t[e];return n&&n!==i.callback&&n!==i.callback._callback||r&&r!==i.context?void 0:(delete t[e],!0)}function r(e,r,i,o){e||(e={});for(var s=r?[r]:t.keys(e),a=!1,u=0,c=s.length;c>u;u++)r=s[u],e[r]&&n(e,r,i,o)&&(a=!0);return a}function i(e){return c[e]||(c[e]=t.partial(a.log,e))}function o(e){return t.isFunction(e)?e:function(){return e}}var s=e.Radio,a=e.Radio={};a.VERSION="1.0.2",a.noConflict=function(){return e.Radio=s,this},a.DEBUG=!1,a._debugText=function(t,e,n){return t+(n?" on the "+n+" channel":"")+': "'+e+'"'},a.debugLog=function(t,e,n){a.DEBUG&&console&&console.warn&&console.warn(a._debugText(t,e,n))};var u=/\s+/;a._eventsApi=function(e,n,r,i){if(!r)return!1;var o={};if("object"==typeof r){for(var s in r){var a=e[n].apply(e,[s,r[s]].concat(i));u.test(s)?t.extend(o,a):o[s]=a}return o}if(u.test(r)){for(var c=r.split(u),l=0,h=c.length;h>l;l++)o[c[l]]=e[n].apply(e,[c[l]].concat(i));return o}return!1},a._callHandler=function(t,e,n){var r=n[0],i=n[1],o=n[2];switch(n.length){case 0:return t.call(e);case 1:return t.call(e,r);case 2:return t.call(e,r,i);case 3:return t.call(e,r,i,o);default:return t.apply(e,n)}};var c={};t.extend(a,{log:function(e,n){var r=t.rest(arguments,2);console.log("["+e+'] "'+n+'"',r)},tuneIn:function(t){var e=a.channel(t);return e._tunedIn=!0,e.on("all",i(t)),this},tuneOut:function(t){var e=a.channel(t);return e._tunedIn=!1,e.off("all",i(t)),delete c[t],this}}),a.Requests={request:function(e){var n=t.rest(arguments),r=a._eventsApi(this,"request",e,n);if(r)return r;var i=this.channelName,o=this._requests;if(i&&this._tunedIn&&a.log.apply(this,[i,e].concat(n)),o&&(o[e]||o["default"])){var s=o[e]||o["default"];return n=o[e]?n:arguments,a._callHandler(s.callback,s.context,n)}a.debugLog("An unhandled request was fired",e,i)},reply:function(t,e,n){return a._eventsApi(this,"reply",t,[e,n])?this:(this._requests||(this._requests={}),this._requests[t]&&a.debugLog("A request was overwritten",t,this.channelName),this._requests[t]={callback:o(e),context:n||this},this)},replyOnce:function(e,n,r){if(a._eventsApi(this,"replyOnce",e,[n,r]))return this;var i=this,s=t.once(function(){return i.stopReplying(e),o(n).apply(this,arguments)});return this.reply(e,s,r)},stopReplying:function(t,e,n){return a._eventsApi(this,"stopReplying",t)?this:(t||e||n?r(this._requests,t,e,n)||a.debugLog("Attempted to remove the unregistered request",t,this.channelName):delete this._requests,this)}},a._channels={},a.channel=function(t){if(!t)throw new Error("You must provide a name for the channel.");return a._channels[t]?a._channels[t]:a._channels[t]=new a.Channel(t)},a.Channel=function(t){this.channelName=t},t.extend(a.Channel.prototype,e.Events,a.Requests,{reset:function(){return this.off(),this.stopListening(),this.stopReplying(),this}});var l,h,f=[e.Events,a.Commands,a.Requests];t.each(f,function(e){t.each(e,function(e,n){a[n]=function(e){return h=t.rest(arguments),l=this.channel(e),l[n].apply(l,h)}})}),a.reset=function(e){var n=e?[this._channels[e]]:this._channels;t.invoke(n,"reset")};var p=a;return p}),function(t,e){if("function"==typeof define&&define.amd)define(["backbone","underscore","backbone.wreqr","backbone.babysitter"],function(n,r){return t.Marionette=t.Mn=e(t,n,r)});else if("undefined"!=typeof exports){var n=require("backbone"),r=require("underscore");require("backbone.wreqr"),require("backbone.babysitter");module.exports=e(t,n,r)}else t.Marionette=t.Mn=e(t,t.Backbone,t._)}(this,function(t,e,n){"use strict";var r=t.Marionette,i=t.Mn,o=e.Marionette={};o.VERSION="2.4.4",o.noConflict=function(){return t.Marionette=r,t.Mn=i,this},o.Deferred=e.$.Deferred,o.FEATURES={},o.isEnabled=function(t){return!!o.FEATURES[t]},o.extend=e.Model.extend,o.isNodeAttached=function(t){return e.$.contains(document.documentElement,t)},o.mergeOptions=function(t,e){t&&n.extend(this,n.pick(t,e))},o.getOption=function(t,e){return t&&e?t.options&&void 0!==t.options[e]?t.options[e]:t[e]:void 0},o.proxyGetOption=function(t){return o.getOption(this,t)},o._getValue=function(t,e,r){return n.isFunction(t)&&(t=r?t.apply(e,r):t.call(e)),t},o.normalizeMethods=function(t){return n.reduce(t,function(t,e,r){return n.isFunction(e)||(e=this[e]),e&&(t[r]=e),t},{},this)},o.normalizeUIString=function(t,e){return t.replace(/@ui\.[a-zA-Z_$0-9]*/g,function(t){return e[t.slice(4)]})},o.normalizeUIKeys=function(t,e){return n.reduce(t,function(t,n,r){var i=o.normalizeUIString(r,e);return t[i]=n,t},{})},o.normalizeUIValues=function(t,e,r){return n.each(t,function(i,s){n.isString(i)?t[s]=o.normalizeUIString(i,e):n.isObject(i)&&n.isArray(r)&&(n.extend(i,o.normalizeUIValues(n.pick(i,r),e)),n.each(r,function(t){var r=i[t];n.isString(r)&&(i[t]=o.normalizeUIString(r,e))}))}),t},o.actAsCollection=function(t,e){var r=["forEach","each","map","find","detect","filter","select","reject","every","all","some","any","include","contains","invoke","toArray","first","initial","rest","last","without","isEmpty","pluck"];n.each(r,function(r){t[r]=function(){var t=n.values(n.result(this,e)),i=[t].concat(n.toArray(arguments));return n[r].apply(n,i)}})};var s=o.deprecate=function(t,e){n.isObject(t)&&(t=t.prev+" is going to be removed in the future. Please use "+t.next+" instead."+(t.url?" See: "+t.url:"")),void 0!==e&&e||s._cache[t]||(s._warn("Deprecation warning: "+t),s._cache[t]=!0)};s._warn="undefined"!=typeof console&&(console.warn||console.log)||function(){},s._cache={},o._triggerMethod=function(){function t(t,e,n){return n.toUpperCase()}var e=/(^|:)(\w)/gi;return function(r,i,o){var s=arguments.length<3;s&&(o=i,i=o[0]);var a,u="on"+i.replace(e,t),c=r[u];return n.isFunction(c)&&(a=c.apply(r,s?n.rest(o):o)),n.isFunction(r.trigger)&&(s+o.length>1?r.trigger.apply(r,s?o:[i].concat(n.drop(o,0))):r.trigger(i)),a}}(),o.triggerMethod=function(t){return o._triggerMethod(this,arguments)},o.triggerMethodOn=function(t){var e=n.isFunction(t.triggerMethod)?t.triggerMethod:o.triggerMethod;return e.apply(t,n.rest(arguments))},o.MonitorDOMRefresh=function(t){function e(){t._isShown=!0,r()}function n(){t._isRendered=!0,r()}function r(){t._isShown&&t._isRendered&&o.isNodeAttached(t.el)&&o.triggerMethodOn(t,"dom:refresh",t)}t._isDomRefreshMonitored||(t._isDomRefreshMonitored=!0,t.on({show:e,render:n}))},function(t){function e(e,r,i,o){var s=o.split(/\s+/);n.each(s,function(n){var o=e[n];if(!o)throw new t.Error('Method "'+n+'" was configured as an event handler, but does not exist.');e.listenTo(r,i,o)})}function r(t,e,n,r){t.listenTo(e,n,r)}function i(t,e,r,i){var o=i.split(/\s+/);n.each(o,function(n){var i=t[n];t.stopListening(e,r,i)})}function o(t,e,n,r){t.stopListening(e,n,r)}function s(e,r,i,o,s){if(r&&i){if(!n.isObject(i))throw new t.Error({message:"Bindings must be an object or function.",url:"marionette.functions.html#marionettebindentityevents"});i=t._getValue(i,e),n.each(i,function(t,i){n.isFunction(t)?o(e,r,i,t):s(e,r,i,t)})}}t.bindEntityEvents=function(t,n,i){s(t,n,i,r,e)},t.unbindEntityEvents=function(t,e,n){s(t,e,n,o,i)},t.proxyBindEntityEvents=function(e,n){return t.bindEntityEvents(this,e,n)},t.proxyUnbindEntityEvents=function(e,n){return t.unbindEntityEvents(this,e,n)}}(o);var a=["description","fileName","lineNumber","name","message","number"];return o.Error=o.extend.call(Error,{urlRoot:"http://marionettejs.com/docs/v"+o.VERSION+"/",constructor:function(t,e){n.isObject(t)?(e=t,t=e.message):e||(e={});var r=Error.call(this,t);n.extend(this,n.pick(r,a),n.pick(e,a)),this.captureStackTrace(),e.url&&(this.url=this.urlRoot+e.url)},captureStackTrace:function(){Error.captureStackTrace&&Error.captureStackTrace(this,o.Error)},toString:function(){return this.name+": "+this.message+(this.url?" See: "+this.url:"")}}),o.Error.extend=o.extend,o.Callbacks=function(){this._deferred=o.Deferred(),this._callbacks=[]},n.extend(o.Callbacks.prototype,{add:function(t,e){var r=n.result(this._deferred,"promise");this._callbacks.push({cb:t,ctx:e}),r.then(function(n){e&&(n.context=e),t.call(n.context,n.options)})},run:function(t,e){this._deferred.resolve({options:t,context:e})},reset:function(){var t=this._callbacks;this._deferred=o.Deferred(),this._callbacks=[],n.each(t,function(t){this.add(t.cb,t.ctx)},this)}}),o.Controller=function(t){this.options=t||{},n.isFunction(this.initialize)&&this.initialize(this.options)},o.Controller.extend=o.extend,n.extend(o.Controller.prototype,e.Events,{destroy:function(){return o._triggerMethod(this,"before:destroy",arguments),o._triggerMethod(this,"destroy",arguments),this.stopListening(),this.off(),this},triggerMethod:o.triggerMethod,mergeOptions:o.mergeOptions,getOption:o.proxyGetOption}),o.Object=function(t){this.options=n.extend({},n.result(this,"options"),t),this.initialize.apply(this,arguments)},o.Object.extend=o.extend,n.extend(o.Object.prototype,e.Events,{initialize:function(){},destroy:function(t){return t=t||{},this.triggerMethod("before:destroy",t),this.triggerMethod("destroy",t),this.stopListening(),this},triggerMethod:o.triggerMethod,mergeOptions:o.mergeOptions,getOption:o.proxyGetOption,bindEntityEvents:o.proxyBindEntityEvents,unbindEntityEvents:o.proxyUnbindEntityEvents}),o.Region=o.Object.extend({constructor:function(t){if(this.options=t||{},this.el=this.getOption("el"),this.el=this.el instanceof e.$?this.el[0]:this.el,!this.el)throw new o.Error({name:"NoElError",message:'An "el" must be specified for a region.'});this.$el=this.getEl(this.el),o.Object.call(this,t)},show:function(t,e){if(this._ensureElement()){this._ensureViewIsIntact(t),o.MonitorDOMRefresh(t);var r=e||{},i=t!==this.currentView,s=!!r.preventDestroy,a=!!r.forceShow,u=!!this.currentView,c=i&&!s,l=i||a;if(u&&this.triggerMethod("before:swapOut",this.currentView,this,e),this.currentView&&delete this.currentView._parent,c?this.empty():u&&l&&this.currentView.off("destroy",this.empty,this),l){t.once("destroy",this.empty,this),t._parent=this,this._renderView(t),u&&this.triggerMethod("before:swap",t,this,e),this.triggerMethod("before:show",t,this,e),o.triggerMethodOn(t,"before:show",t,this,e),u&&this.triggerMethod("swapOut",this.currentView,this,e);var h=o.isNodeAttached(this.el),f=[],p=n.extend({triggerBeforeAttach:this.triggerBeforeAttach,triggerAttach:this.triggerAttach},r);return h&&p.triggerBeforeAttach&&(f=this._displayedViews(t),this._triggerAttach(f,"before:")),this.attachHtml(t),this.currentView=t,h&&p.triggerAttach&&(f=this._displayedViews(t),this._triggerAttach(f)),u&&this.triggerMethod("swap",t,this,e),this.triggerMethod("show",t,this,e),o.triggerMethodOn(t,"show",t,this,e),this}return this}},triggerBeforeAttach:!0,triggerAttach:!0,_triggerAttach:function(t,e){var r=(e||"")+"attach";n.each(t,function(t){o.triggerMethodOn(t,r,t,this)},this)},_displayedViews:function(t){return n.union([t],n.result(t,"_getNestedViews")||[])},_renderView:function(t){t.supportsRenderLifecycle||o.triggerMethodOn(t,"before:render",t),t.render(),t.supportsRenderLifecycle||o.triggerMethodOn(t,"render",t)},_ensureElement:function(){if(n.isObject(this.el)||(this.$el=this.getEl(this.el),this.el=this.$el[0]),!this.$el||0===this.$el.length){if(this.getOption("allowMissingEl"))return!1;throw new o.Error('An "el" '+this.$el.selector+" must exist in DOM")}return!0},_ensureViewIsIntact:function(t){if(!t)throw new o.Error({name:"ViewNotValid",message:"The view passed is undefined and therefore invalid. You must pass a view instance to show."});if(t.isDestroyed)throw new o.Error({name:"ViewDestroyedError",message:'View (cid: "'+t.cid+'") has already been destroyed and cannot be used.'})},getEl:function(t){return e.$(t,o._getValue(this.options.parentEl,this))},attachHtml:function(t){this.$el.contents().detach(),this.el.appendChild(t.el)},empty:function(t){var e=this.currentView,n=t||{},r=!!n.preventDestroy;return e?(e.off("destroy",this.empty,this),this.triggerMethod("before:empty",e),r||this._destroyView(),this.triggerMethod("empty",e),delete this.currentView,r&&this.$el.contents().detach(),this):this},_destroyView:function(){var t=this.currentView;t.isDestroyed||(t.supportsDestroyLifecycle||o.triggerMethodOn(t,"before:destroy",t),t.destroy?t.destroy():(t.remove(),t.isDestroyed=!0),t.supportsDestroyLifecycle||o.triggerMethodOn(t,"destroy",t))},attachView:function(t){return this.currentView&&delete this.currentView._parent,t._parent=this,this.currentView=t,this},hasView:function(){return!!this.currentView},reset:function(){return this.empty(),this.$el&&(this.el=this.$el.selector),delete this.$el,this}},{buildRegion:function(t,e){if(n.isString(t))return this._buildRegionFromSelector(t,e);if(t.selector||t.el||t.regionClass)return this._buildRegionFromObject(t,e);if(n.isFunction(t))return this._buildRegionFromRegionClass(t);throw new o.Error({message:"Improper region configuration type.",url:"marionette.region.html#region-configuration-types"})},_buildRegionFromSelector:function(t,e){return new e({el:t})},_buildRegionFromObject:function(t,e){var r=t.regionClass||e,i=n.omit(t,"selector","regionClass");return t.selector&&!i.el&&(i.el=t.selector),new r(i)},_buildRegionFromRegionClass:function(t){return new t}}),o.RegionManager=o.Controller.extend({constructor:function(t){this._regions={},this.length=0,o.Controller.call(this,t),this.addRegions(this.getOption("regions"))},addRegions:function(t,e){return t=o._getValue(t,this,arguments),n.reduce(t,function(t,r,i){return n.isString(r)&&(r={selector:r}),r.selector&&(r=n.defaults({},r,e)),t[i]=this.addRegion(i,r),t},{},this)},addRegion:function(t,e){var n;return n=e instanceof o.Region?e:o.Region.buildRegion(e,o.Region),this.triggerMethod("before:add:region",t,n),n._parent=this,this._store(t,n),this.triggerMethod("add:region",t,n),n},get:function(t){return this._regions[t]},getRegions:function(){return n.clone(this._regions)},removeRegion:function(t){var e=this._regions[t];return this._remove(t,e),e},removeRegions:function(){var t=this.getRegions();return n.each(this._regions,function(t,e){this._remove(e,t)},this),t},emptyRegions:function(){var t=this.getRegions();return n.invoke(t,"empty"),t},destroy:function(){return this.removeRegions(),o.Controller.prototype.destroy.apply(this,arguments)},_store:function(t,e){this._regions[t]||this.length++,this._regions[t]=e},_remove:function(t,e){this.triggerMethod("before:remove:region",t,e),e.empty(),e.stopListening(),delete e._parent,delete this._regions[t],this.length--,this.triggerMethod("remove:region",t,e)}}),o.actAsCollection(o.RegionManager.prototype,"_regions"),o.TemplateCache=function(t){this.templateId=t},n.extend(o.TemplateCache,{templateCaches:{},get:function(t,e){var n=this.templateCaches[t];return n||(n=new o.TemplateCache(t),this.templateCaches[t]=n),n.load(e)},clear:function(){var t,e=n.toArray(arguments),r=e.length;if(r>0)for(t=0;r>t;t++)delete this.templateCaches[e[t]];else this.templateCaches={}}}),n.extend(o.TemplateCache.prototype,{load:function(t){if(this.compiledTemplate)return this.compiledTemplate;var e=this.loadTemplate(this.templateId,t);return this.compiledTemplate=this.compileTemplate(e,t),this.compiledTemplate},loadTemplate:function(t,n){var r=e.$(t);if(!r.length)throw new o.Error({name:"NoTemplateError",message:'Could not find template: "'+t+'"'});return r.html()},compileTemplate:function(t,e){return n.template(t,e)}}),o.Renderer={render:function(t,e){if(!t)throw new o.Error({name:"TemplateNotFoundError",message:"Cannot render the template since its false, null or undefined."});var r=n.isFunction(t)?t:o.TemplateCache.get(t);return r(e)}},o.View=e.View.extend({isDestroyed:!1,supportsRenderLifecycle:!0,supportsDestroyLifecycle:!0,constructor:function(t){this.render=n.bind(this.render,this),t=o._getValue(t,this),this.options=n.extend({},n.result(this,"options"),t),this._behaviors=o.Behaviors(this),e.View.call(this,this.options),o.MonitorDOMRefresh(this)},getTemplate:function(){return this.getOption("template")},serializeModel:function(t){return t.toJSON.apply(t,n.rest(arguments))},mixinTemplateHelpers:function(t){t=t||{};var e=this.getOption("templateHelpers");return e=o._getValue(e,this),n.extend(t,e)},normalizeUIKeys:function(t){var e=n.result(this,"_uiBindings");return o.normalizeUIKeys(t,e||n.result(this,"ui"))},normalizeUIValues:function(t,e){var r=n.result(this,"ui"),i=n.result(this,"_uiBindings");return o.normalizeUIValues(t,i||r,e)},configureTriggers:function(){if(this.triggers){var t=this.normalizeUIKeys(n.result(this,"triggers"));return n.reduce(t,function(t,e,n){return t[n]=this._buildViewTrigger(e),t},{},this)}},delegateEvents:function(t){return this._delegateDOMEvents(t),this.bindEntityEvents(this.model,this.getOption("modelEvents")),this.bindEntityEvents(this.collection,this.getOption("collectionEvents")),n.each(this._behaviors,function(t){t.bindEntityEvents(this.model,t.getOption("modelEvents")),t.bindEntityEvents(this.collection,t.getOption("collectionEvents"))},this),this},_delegateDOMEvents:function(t){var r=o._getValue(t||this.events,this);r=this.normalizeUIKeys(r),n.isUndefined(t)&&(this.events=r);var i={},s=n.result(this,"behaviorEvents")||{},a=this.configureTriggers(),u=n.result(this,"behaviorTriggers")||{};n.extend(i,s,r,a,u),e.View.prototype.delegateEvents.call(this,i)},undelegateEvents:function(){return e.View.prototype.undelegateEvents.apply(this,arguments),this.unbindEntityEvents(this.model,this.getOption("modelEvents")),this.unbindEntityEvents(this.collection,this.getOption("collectionEvents")),n.each(this._behaviors,function(t){t.unbindEntityEvents(this.model,t.getOption("modelEvents")),t.unbindEntityEvents(this.collection,t.getOption("collectionEvents"))},this),this},_ensureViewIsIntact:function(){if(this.isDestroyed)throw new o.Error({name:"ViewDestroyedError",message:'View (cid: "'+this.cid+'") has already been destroyed and cannot be used.'})},destroy:function(){if(this.isDestroyed)return this;var t=n.toArray(arguments);return this.triggerMethod.apply(this,["before:destroy"].concat(t)),this.isDestroyed=!0,this.triggerMethod.apply(this,["destroy"].concat(t)),this.unbindUIElements(),this.isRendered=!1,this.remove(),n.invoke(this._behaviors,"destroy",t),this},bindUIElements:function(){this._bindUIElements(),n.invoke(this._behaviors,this._bindUIElements)},_bindUIElements:function(){if(this.ui){this._uiBindings||(this._uiBindings=this.ui);var t=n.result(this,"_uiBindings");this.ui={},n.each(t,function(t,e){this.ui[e]=this.$(t)},this)}},unbindUIElements:function(){this._unbindUIElements(),n.invoke(this._behaviors,this._unbindUIElements)},_unbindUIElements:function(){this.ui&&this._uiBindings&&(n.each(this.ui,function(t,e){delete this.ui[e]},this),this.ui=this._uiBindings,delete this._uiBindings)},_buildViewTrigger:function(t){var e=n.defaults({},t,{preventDefault:!0,stopPropagation:!0}),r=n.isObject(t)?e.event:t;return function(t){t&&(t.preventDefault&&e.preventDefault&&t.preventDefault(),t.stopPropagation&&e.stopPropagation&&t.stopPropagation());var n={view:this,model:this.model,collection:this.collection};this.triggerMethod(r,n);
-}},setElement:function(){var t=e.View.prototype.setElement.apply(this,arguments);return n.invoke(this._behaviors,"proxyViewProperties",this),t},triggerMethod:function(){var t=o._triggerMethod(this,arguments);return this._triggerEventOnBehaviors(arguments),this._triggerEventOnParentLayout(arguments[0],n.rest(arguments)),t},_triggerEventOnBehaviors:function(t){for(var e=o._triggerMethod,n=this._behaviors,r=0,i=n&&n.length;i>r;r++)e(n[r],t)},_triggerEventOnParentLayout:function(t,e){var r=this._parentLayoutView();if(r){var i=o.getOption(r,"childViewEventPrefix"),s=i+":"+t,a=[this].concat(e);o._triggerMethod(r,s,a);var u=o.getOption(r,"childEvents");u=o._getValue(u,r);var c=r.normalizeMethods(u);c&&n.isFunction(c[t])&&c[t].apply(r,a)}},_getImmediateChildren:function(){return[]},_getNestedViews:function(){var t=this._getImmediateChildren();return t.length?n.reduce(t,function(t,e){return e._getNestedViews?t.concat(e._getNestedViews()):t},t):t},_parentLayoutView:function(){for(var t=this._parent;t;){if(t instanceof o.LayoutView)return t;t=t._parent}},normalizeMethods:o.normalizeMethods,mergeOptions:o.mergeOptions,getOption:o.proxyGetOption,bindEntityEvents:o.proxyBindEntityEvents,unbindEntityEvents:o.proxyUnbindEntityEvents}),o.ItemView=o.View.extend({constructor:function(){o.View.apply(this,arguments)},serializeData:function(){if(!this.model&&!this.collection)return{};var t=[this.model||this.collection];return arguments.length&&t.push.apply(t,arguments),this.model?this.serializeModel.apply(this,t):{items:this.serializeCollection.apply(this,t)}},serializeCollection:function(t){return t.toJSON.apply(t,n.rest(arguments))},render:function(){return this._ensureViewIsIntact(),this.triggerMethod("before:render",this),this._renderTemplate(),this.isRendered=!0,this.bindUIElements(),this.triggerMethod("render",this),this},_renderTemplate:function(){var t=this.getTemplate();if(t!==!1){if(!t)throw new o.Error({name:"UndefinedTemplateError",message:"Cannot render the template since it is null or undefined."});var e=this.mixinTemplateHelpers(this.serializeData()),n=o.Renderer.render(t,e,this);return this.attachElContent(n),this}},attachElContent:function(t){return this.$el.html(t),this}}),o.CollectionView=o.View.extend({childViewEventPrefix:"childview",sort:!0,constructor:function(t){this.once("render",this._initialEvents),this._initChildViewStorage(),o.View.apply(this,arguments),this.on({"before:show":this._onBeforeShowCalled,show:this._onShowCalled,"before:attach":this._onBeforeAttachCalled,attach:this._onAttachCalled}),this.initRenderBuffer()},initRenderBuffer:function(){this._bufferedChildren=[]},startBuffering:function(){this.initRenderBuffer(),this.isBuffering=!0},endBuffering:function(){var t,e=this._isShown&&o.isNodeAttached(this.el);this.isBuffering=!1,this._isShown&&this._triggerMethodMany(this._bufferedChildren,this,"before:show"),e&&this._triggerBeforeAttach&&(t=this._getNestedViews(),this._triggerMethodMany(t,this,"before:attach")),this.attachBuffer(this,this._createBuffer()),e&&this._triggerAttach&&(t=this._getNestedViews(),this._triggerMethodMany(t,this,"attach")),this._isShown&&this._triggerMethodMany(this._bufferedChildren,this,"show"),this.initRenderBuffer()},_triggerMethodMany:function(t,e,r){var i=n.drop(arguments,3);n.each(t,function(t){o.triggerMethodOn.apply(t,[t,r,t,e].concat(i))})},_initialEvents:function(){this.collection&&(this.listenTo(this.collection,"add",this._onCollectionAdd),this.listenTo(this.collection,"remove",this._onCollectionRemove),this.listenTo(this.collection,"reset",this.render),this.getOption("sort")&&this.listenTo(this.collection,"sort",this._sortViews))},_onCollectionAdd:function(t,e,r){var i=void 0!==r.at&&(r.index||e.indexOf(t));if((this.getOption("filter")||i===!1)&&(i=n.indexOf(this._filteredSortedModels(i),t)),this._shouldAddChild(t,i)){this.destroyEmptyView();var o=this.getChildView(t);this.addChild(t,o,i)}},_onCollectionRemove:function(t){var e=this.children.findByModel(t);this.removeChildView(e),this.checkEmpty()},_onBeforeShowCalled:function(){this._triggerBeforeAttach=this._triggerAttach=!1,this.children.each(function(t){o.triggerMethodOn(t,"before:show",t)})},_onShowCalled:function(){this.children.each(function(t){o.triggerMethodOn(t,"show",t)})},_onBeforeAttachCalled:function(){this._triggerBeforeAttach=!0},_onAttachCalled:function(){this._triggerAttach=!0},render:function(){return this._ensureViewIsIntact(),this.triggerMethod("before:render",this),this._renderChildren(),this.isRendered=!0,this.triggerMethod("render",this),this},reorder:function(){var t=this.children,e=this._filteredSortedModels(),r=n.some(e,function(e){return!t.findByModel(e)});if(r)this.render();else{var i=n.map(e,function(e,n){var r=t.findByModel(e);return r._index=n,r.el}),o=t.filter(function(t){return!n.contains(i,t.el)});this.triggerMethod("before:reorder"),this._appendReorderedChildren(i),n.each(o,this.removeChildView,this),this.checkEmpty(),this.triggerMethod("reorder")}},resortView:function(){o.getOption(this,"reorderOnSort")?this.reorder():this.render()},_sortViews:function(){var t=this._filteredSortedModels(),e=n.find(t,function(t,e){var n=this.children.findByModel(t);return!n||n._index!==e},this);e&&this.resortView()},_emptyViewIndex:-1,_appendReorderedChildren:function(t){this.$el.append(t)},_renderChildren:function(){this.destroyEmptyView(),this.destroyChildren({checkEmpty:!1}),this.isEmpty(this.collection)?this.showEmptyView():(this.triggerMethod("before:render:collection",this),this.startBuffering(),this.showCollection(),this.endBuffering(),this.triggerMethod("render:collection",this),this.children.isEmpty()&&this.getOption("filter")&&this.showEmptyView())},showCollection:function(){var t,e=this._filteredSortedModels();n.each(e,function(e,n){t=this.getChildView(e),this.addChild(e,t,n)},this)},_filteredSortedModels:function(t){var e=this.getViewComparator(),r=this.collection.models;if(t=Math.min(Math.max(t,0),r.length-1),e){var i;t&&(i=r[t],r=r.slice(0,t).concat(r.slice(t+1))),r=this._sortModelsBy(r,e),i&&r.splice(t,0,i)}return this.getOption("filter")&&(r=n.filter(r,function(t,e){return this._shouldAddChild(t,e)},this)),r},_sortModelsBy:function(t,e){return"string"==typeof e?n.sortBy(t,function(t){return t.get(e)},this):1===e.length?n.sortBy(t,e,this):t.sort(n.bind(e,this))},showEmptyView:function(){var t=this.getEmptyView();if(t&&!this._showingEmptyView){this.triggerMethod("before:render:empty"),this._showingEmptyView=!0;var n=new e.Model;this.addEmptyView(n,t),this.triggerMethod("render:empty")}},destroyEmptyView:function(){this._showingEmptyView&&(this.triggerMethod("before:remove:empty"),this.destroyChildren(),delete this._showingEmptyView,this.triggerMethod("remove:empty"))},getEmptyView:function(){return this.getOption("emptyView")},addEmptyView:function(t,e){var r,i=this._isShown&&!this.isBuffering&&o.isNodeAttached(this.el),s=this.getOption("emptyViewOptions")||this.getOption("childViewOptions");n.isFunction(s)&&(s=s.call(this,t,this._emptyViewIndex));var a=this.buildChildView(t,e,s);a._parent=this,this.proxyChildEvents(a),a.once("render",function(){this._isShown&&o.triggerMethodOn(a,"before:show",a),i&&this._triggerBeforeAttach&&(r=this._getViewAndNested(a),this._triggerMethodMany(r,this,"before:attach"))},this),this.children.add(a),this.renderChildView(a,this._emptyViewIndex),i&&this._triggerAttach&&(r=this._getViewAndNested(a),this._triggerMethodMany(r,this,"attach")),this._isShown&&o.triggerMethodOn(a,"show",a)},getChildView:function(t){var e=this.getOption("childView");if(!e)throw new o.Error({name:"NoChildViewError",message:'A "childView" must be specified'});return e},addChild:function(t,e,n){var r=this.getOption("childViewOptions");r=o._getValue(r,this,[t,n]);var i=this.buildChildView(t,e,r);return this._updateIndices(i,!0,n),this.triggerMethod("before:add:child",i),this._addChildView(i,n),this.triggerMethod("add:child",i),i._parent=this,i},_updateIndices:function(t,e,n){this.getOption("sort")&&(e&&(t._index=n),this.children.each(function(n){n._index>=t._index&&(n._index+=e?1:-1)}))},_addChildView:function(t,e){var n,r=this._isShown&&!this.isBuffering&&o.isNodeAttached(this.el);this.proxyChildEvents(t),t.once("render",function(){this._isShown&&!this.isBuffering&&o.triggerMethodOn(t,"before:show",t),r&&this._triggerBeforeAttach&&(n=this._getViewAndNested(t),this._triggerMethodMany(n,this,"before:attach"))},this),this.children.add(t),this.renderChildView(t,e),r&&this._triggerAttach&&(n=this._getViewAndNested(t),this._triggerMethodMany(n,this,"attach")),this._isShown&&!this.isBuffering&&o.triggerMethodOn(t,"show",t)},renderChildView:function(t,e){return t.supportsRenderLifecycle||o.triggerMethodOn(t,"before:render",t),t.render(),t.supportsRenderLifecycle||o.triggerMethodOn(t,"render",t),this.attachHtml(this,t,e),t},buildChildView:function(t,e,r){var i=n.extend({model:t},r),s=new e(i);return o.MonitorDOMRefresh(s),s},removeChildView:function(t){return t?(this.triggerMethod("before:remove:child",t),t.supportsDestroyLifecycle||o.triggerMethodOn(t,"before:destroy",t),t.destroy?t.destroy():t.remove(),t.supportsDestroyLifecycle||o.triggerMethodOn(t,"destroy",t),delete t._parent,this.stopListening(t),this.children.remove(t),this.triggerMethod("remove:child",t),this._updateIndices(t,!1),t):t},isEmpty:function(){return!this.collection||0===this.collection.length},checkEmpty:function(){this.isEmpty(this.collection)&&this.showEmptyView()},attachBuffer:function(t,e){t.$el.append(e)},_createBuffer:function(){var t=document.createDocumentFragment();return n.each(this._bufferedChildren,function(e){t.appendChild(e.el)}),t},attachHtml:function(t,e,n){t.isBuffering?t._bufferedChildren.splice(n,0,e):t._insertBefore(e,n)||t._insertAfter(e)},_insertBefore:function(t,e){var n,r=this.getOption("sort")&&e=0&&t.length%1===0}function a(t,e){return s(t)?u(t,e):f(t,e)}function u(t,e){for(var n=-1,r=t.length;++nr?r:null}):(n=P(t),e=n.length,function(){return r++,e>r?n[r]:null})}function g(t,e){return e=null==e?t.length-1:+e,function(){for(var n=Math.max(arguments.length-e,0),r=Array(n),i=0;n>i;i++)r[i]=arguments[i+e];switch(e){case 0:return t.call(this,r);case 1:return t.call(this,arguments[0],r)}}}function m(t){return function(e,n,r){return t(e,r)}}function y(e){return function(n,r,s){s=o(s||t),n=n||[];var a=d(n);if(0>=e)return s(null);var u=!1,c=0,l=!1;!function h(){if(u&&0>=c)return s(null);for(;e>c&&!l;){var t=a();if(null===t)return u=!0,void(0>=c&&s(null));c+=1,r(n[t],t,i(function(t){c-=1,t?(s(t),l=!0):h()}))}}()}}function v(t){return function(e,n,r){return t(j.eachOf,e,n,r)}}function _(t){return function(e,n,r,i){return t(y(n),e,r,i)}}function b(t){return function(e,n,r){return t(j.eachOfSeries,e,n,r)}}function w(e,n,r,i){i=o(i||t);var s=[];e(n,function(t,e,n){r(t,function(t,r){s[e]=r,n(t)})},function(t){i(t,s)})}function E(t,e,n,r){var i=[];t(e,function(t,e,r){n(t,function(n){n&&i.push({index:e,value:t}),r()})},function(){r(c(i.sort(function(t,e){return t.index-e.index}),function(t){return t.value}))})}function x(t,e,n,r){E(t,e,function(t,e){n(t,function(t){e(!t)})},r)}function C(t,e,n){return function(r,i,o,s){function a(){s&&s(n(!1,void 0))}function u(t,r,i){return s?void o(t,function(r){s&&e(r)&&(s(n(!0,t)),s=o=!1),i()}):i()}arguments.length>3?t(r,i,u,a):(s=o,o=i,t(r,u,a))}}function k(t,e){return e}function A(e,n,r){r=r||t;var i=s(n)?[]:{};e(n,function(t,e,n){t(g(function(t,r){r.length<=1&&(r=r[0]),i[e]=r,n(t)}))},function(t){r(t,i)})}function T(t,e,n,r){var i=[];t(e,function(t,e,r){n(t,function(t,e){i=i.concat(e||[]),r(t)})},function(t){r(t,i)})}function S(e,n,r){function o(e,n,r,i){if(null!=i&&"function"!=typeof i)throw new Error("task callback must be a function");return e.started=!0,I(n)||(n=[n]),0===n.length&&e.idle()?j.setImmediate(function(){e.drain()}):(u(n,function(n){var o={data:n,callback:i||t};r?e.tasks.unshift(o):e.tasks.push(o),e.tasks.length===e.concurrency&&e.saturated()}),void j.setImmediate(e.process))}function s(t,e){return function(){a-=1;var n=arguments;u(e,function(t){t.callback.apply(t,n)}),t.tasks.length+a===0&&t.drain(),t.process()}}if(null==n)n=1;else if(0===n)throw new Error("Concurrency must not be zero");var a=0,l={tasks:[],concurrency:n,payload:r,saturated:t,empty:t,drain:t,started:!1,paused:!1,push:function(t,e){o(l,t,!1,e)},kill:function(){l.drain=t,l.tasks=[]},unshift:function(t,e){o(l,t,!0,e)},process:function(){if(!l.paused&&a=e;e++)j.setImmediate(l.process)}}};return l}function D(t){return g(function(e,n){e.apply(null,n.concat([g(function(e,n){"object"==typeof console&&(e?console.error&&console.error(e):console[t]&&u(n,function(e){console[t](e)}))})]))})}function M(t){return function(e,n,r){t(l(e),n,r)}}function O(t){return g(function(e,n){var r=g(function(n){var r=this,i=n.pop();return t(e,function(t,e,i){t.apply(r,n.concat([i]))},i)});return n.length?r.apply(this,n):r})}function F(t){return g(function(e){var n=e.pop();e.push(function(){var t=arguments;r?j.setImmediate(function(){n.apply(null,t)}):n.apply(null,t)});var r=!0;t.apply(this,e),r=!1})}var R,j={},B="object"==typeof self&&self.self===self&&self||"object"==typeof global&&global.global===global&&global||this;null!=B&&(R=B.async),j.noConflict=function(){return B.async=R,j};var N=Object.prototype.toString,I=Array.isArray||function(t){return"[object Array]"===N.call(t)},L=function(t){var e=typeof t;return"function"===e||"object"===e&&!!t},P=Object.keys||function(t){var e=[];for(var n in t)t.hasOwnProperty(n)&&e.push(n);return e},U="function"==typeof setImmediate&&setImmediate,V=U?function(t){U(t)}:function(t){setTimeout(t,0)};"object"==typeof process&&"function"==typeof process.nextTick?j.nextTick=process.nextTick:j.nextTick=V,j.setImmediate=U?V:j.nextTick,j.forEach=j.each=function(t,e,n){return j.eachOf(t,m(e),n)},j.forEachSeries=j.eachSeries=function(t,e,n){return j.eachOfSeries(t,m(e),n)},j.forEachLimit=j.eachLimit=function(t,e,n,r){return y(e)(t,m(n),r)},j.forEachOf=j.eachOf=function(e,n,r){function u(t){t?r(t):(l+=1,l>=c&&r(null))}r=o(r||t),e=e||[];var c=s(e)?e.length:P(e).length,l=0;return c?void a(e,function(t,r){n(e[r],r,i(u))}):r(null)},j.forEachOfSeries=j.eachOfSeries=function(e,n,r){function s(){var t=!0;return null===u?r(null):(n(e[u],u,i(function(e){if(e)r(e);else{if(u=a(),null===u)return r(null);t?j.nextTick(s):s()}})),void(t=!1))}r=o(r||t),e=e||[];var a=d(e),u=a();s()},j.forEachOfLimit=j.eachOfLimit=function(t,e,n,r){y(e)(t,n,r)},j.map=v(w),j.mapSeries=b(w),j.mapLimit=_(w),j.inject=j.foldl=j.reduce=function(t,e,n,r){j.eachOfSeries(t,function(t,r,i){n(e,t,function(t,n){e=n,i(t)})},function(t){r(t||null,e)})},j.foldr=j.reduceRight=function(t,n,r,i){var o=c(t,e).reverse();j.reduce(o,n,r,i)},j.select=j.filter=v(E),j.selectLimit=j.filterLimit=_(E),j.selectSeries=j.filterSeries=b(E),j.reject=v(x),j.rejectLimit=_(x),j.rejectSeries=b(x),j.any=j.some=C(j.eachOf,n,e),j.someLimit=C(j.eachOfLimit,n,e),j.all=j.every=C(j.eachOf,r,r),j.everyLimit=C(j.eachOfLimit,r,r),j.detect=C(j.eachOf,e,k),j.detectSeries=C(j.eachOfSeries,e,k),j.detectLimit=C(j.eachOfLimit,e,k),j.sortBy=function(t,e,n){function r(t,e){var n=t.criteria,r=e.criteria;return r>n?-1:n>r?1:0}j.map(t,function(t,n){e(t,function(e,r){e?n(e):n(null,{value:t,criteria:r})})},function(t,e){return t?n(t):void n(null,c(e.sort(r),function(t){return t.value}))})},j.auto=function(e,n){function r(t){d.unshift(t)}function i(t){var e=p(d,t);e>=0&&d.splice(e,1)}function s(){c--,u(d.slice(0),function(t){t()})}n=o(n||t);var a=P(e),c=a.length;if(!c)return n(null);var l={},d=[];r(function(){c||n(null,l)}),u(a,function(t){function o(){return h(m,function(t,e){return t&&l.hasOwnProperty(e)},!0)&&!l.hasOwnProperty(t)}function a(){o()&&(i(a),c[c.length-1](d,l))}for(var u,c=I(e[t])?e[t]:[e[t]],d=g(function(e,r){if(r.length<=1&&(r=r[0]),e){var i={};f(l,function(t,e){i[e]=t}),i[t]=r,n(e,i)}else l[t]=r,j.setImmediate(s)}),m=c.slice(0,c.length-1),y=m.length;y--;){if(!(u=e[m[y]]))throw new Error("Has inexistant dependency");if(I(u)&&p(u,t)>=0)throw new Error("Has cyclic dependencies")}o()?c[c.length-1](d,l):r(a)})},j.retry=function(t,e,n){function r(t,e){if("number"==typeof e)t.times=parseInt(e,10)||o;else{if("object"!=typeof e)throw new Error("Unsupported argument type for 'times': "+typeof e);t.times=parseInt(e.times,10)||o,t.interval=parseInt(e.interval,10)||s}}function i(t,e){function n(t,n){return function(r){t(function(t,e){r(!t||n,{err:t,result:e})},e)}}function r(t){return function(e){setTimeout(function(){e(null)},t)}}for(;u.times;){var i=!(u.times-=1);a.push(n(u.task,i)),!i&&u.interval>0&&a.push(r(u.interval))}j.series(a,function(e,n){n=n[n.length-1],(t||u.callback)(n.err,n.result);
-})}var o=5,s=0,a=[],u={times:o,interval:s},c=arguments.length;if(1>c||c>3)throw new Error("Invalid arguments - must be either (task), (task, callback), (times, task) or (times, task, callback)");return 2>=c&&"function"==typeof t&&(n=e,e=t),"function"!=typeof t&&r(u,t),u.callback=n,u.task=e,u.callback?i():i},j.waterfall=function(e,n){function r(t){return g(function(e,i){if(e)n.apply(null,[e].concat(i));else{var o=t.next();o?i.push(r(o)):i.push(n),F(t).apply(null,i)}})}if(n=o(n||t),!I(e)){var i=new Error("First argument to waterfall must be an array of functions");return n(i)}return e.length?void r(j.iterator(e))():n()},j.parallel=function(t,e){A(j.eachOf,t,e)},j.parallelLimit=function(t,e,n){A(y(e),t,n)},j.series=function(t,e){A(j.eachOfSeries,t,e)},j.iterator=function(t){function e(n){function r(){return t.length&&t[n].apply(null,arguments),r.next()}return r.next=function(){return nr;){var o=r+(i-r+1>>>1);n(e,t[o])>=0?r=o:i=o-1}return r}function o(e,n,o,s){if(null!=s&&"function"!=typeof s)throw new Error("task callback must be a function");return e.started=!0,I(n)||(n=[n]),0===n.length?j.setImmediate(function(){e.drain()}):void u(n,function(n){var a={data:n,priority:o,callback:"function"==typeof s?s:t};e.tasks.splice(i(e.tasks,a,r)+1,0,a),e.tasks.length===e.concurrency&&e.saturated(),j.setImmediate(e.process)})}var s=j.queue(e,n);return s.push=function(t,e,n){o(s,t,e,n)},delete s.unshift,s},j.cargo=function(t,e){return S(t,1,e)},j.log=D("log"),j.dir=D("dir"),j.memoize=function(t,n){var r={},i={};n=n||e;var o=g(function(e){var o=e.pop(),s=n.apply(null,e);s in r?j.nextTick(function(){o.apply(null,r[s])}):s in i?i[s].push(o):(i[s]=[o],t.apply(null,e.concat([g(function(t){r[s]=t;var e=i[s];delete i[s];for(var n=0,o=e.length;o>n;n++)e[n].apply(null,t)})])))});return o.memo=r,o.unmemoized=t,o},j.unmemoize=function(t){return function(){return(t.unmemoized||t).apply(null,arguments)}},j.times=M(j.map),j.timesSeries=M(j.mapSeries),j.timesLimit=function(t,e,n,r){return j.mapLimit(l(t),e,n,r)},j.seq=function(){var e=arguments;return g(function(n){var r=this,i=n[n.length-1];"function"==typeof i?n.pop():i=t,j.reduce(e,n,function(t,e,n){e.apply(r,t.concat([g(function(t,e){n(t,e)})]))},function(t,e){i.apply(r,[t].concat(e))})})},j.compose=function(){return j.seq.apply(null,Array.prototype.reverse.call(arguments))},j.applyEach=O(j.eachOf),j.applyEachSeries=O(j.eachOfSeries),j.forever=function(e,n){function r(t){return t?o(t):void s(r)}var o=i(n||t),s=F(e);r()},j.ensureAsync=F,j.constant=g(function(t){var e=[null].concat(t);return function(t){return t.apply(this,e)}}),j.wrapSync=j.asyncify=function(t){return g(function(e){var n,r=e.pop();try{n=t.apply(this,e)}catch(i){return r(i)}L(n)&&"function"==typeof n.then?n.then(function(t){r(null,t)})["catch"](function(t){r(t.message?t:new Error(t))}):r(null,n)})},"object"==typeof module&&module.exports?module.exports=j:"function"==typeof define&&define.amd?define([],function(){return j}):B.async=j}(),function(){var t=this,e={};"undefined"!=typeof exports?module.exports=e:t.fuzzy=e,e.simpleFilter=function(t,n){return n.filter(function(n){return e.test(t,n)})},e.test=function(t,n){return null!==e.match(t,n)},e.match=function(t,e,n){n=n||{};var r,i=0,o=[],s=e.length,a=0,u=0,c=n.pre||"",l=n.post||"",h=n.caseSensitive&&e||e.toLowerCase();t=n.caseSensitive&&t||t.toLowerCase();for(var f=0;s>f;f++)r=e[f],h[f]===t[i]?(r=c+r+l,i+=1,u+=1+u):u=0,a+=u,o[o.length]=r;return i===t.length?{rendered:o.join(""),score:a}:null},e.filter=function(t,n,r){return r=r||{},n.reduce(function(n,i,o,s){var a=i;r.extract&&(a=r.extract(i));var u=e.match(t,a,r);return null!=u&&(n[n.length]={string:u.rendered,score:u.score,index:o,original:i}),n},[]).sort(function(t,e){var n=e.score-t.score;return n?n:t.index-e.index})}}(),function(t,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e():"function"==typeof define&&define.amd?define(e):t.moment=e()}(this,function(){"use strict";function t(){return jn.apply(null,arguments)}function e(t){jn=t}function n(t){return"[object Array]"===Object.prototype.toString.call(t)}function r(t){return t instanceof Date||"[object Date]"===Object.prototype.toString.call(t)}function i(t,e){var n,r=[];for(n=0;n0)for(n in Nn)r=Nn[n],i=e[r],"undefined"!=typeof i&&(t[r]=i);return t}function p(e){f(this,e),this._d=new Date(null!=e._d?e._d.getTime():NaN),In===!1&&(In=!0,t.updateOffset(this),In=!1)}function d(t){return t instanceof p||null!=t&&null!=t._isAMomentObject}function g(t){return 0>t?Math.ceil(t):Math.floor(t)}function m(t){var e=+t,n=0;return 0!==e&&isFinite(e)&&(n=g(e)),n}function y(t,e,n){var r,i=Math.min(t.length,e.length),o=Math.abs(t.length-e.length),s=0;for(r=0;i>r;r++)(n&&t[r]!==e[r]||!n&&m(t[r])!==m(e[r]))&&s++;return s+o}function v(){}function _(t){return t?t.toLowerCase().replace("_","-"):t}function b(t){for(var e,n,r,i,o=0;o0;){if(r=w(i.slice(0,e).join("-")))return r;if(n&&n.length>=e&&y(i,n,!0)>=e-1)break;e--}o++}return null}function w(t){var e=null;if(!Ln[t]&&"undefined"!=typeof module&&module&&module.exports)try{e=Bn._abbr,require("./locale/"+t),E(e)}catch(n){}return Ln[t]}function E(t,e){var n;return t&&(n="undefined"==typeof e?C(t):x(t,e),n&&(Bn=n)),Bn._abbr}function x(t,e){return null!==e?(e.abbr=t,Ln[t]=Ln[t]||new v,Ln[t].set(e),E(t),Ln[t]):(delete Ln[t],null)}function C(t){var e;if(t&&t._locale&&t._locale._abbr&&(t=t._locale._abbr),!t)return Bn;if(!n(t)){if(e=w(t))return e;t=[t]}return b(t)}function k(t,e){var n=t.toLowerCase();Pn[n]=Pn[n+"s"]=Pn[e]=t}function A(t){return"string"==typeof t?Pn[t]||Pn[t.toLowerCase()]:void 0}function T(t){var e,n,r={};for(n in t)o(t,n)&&(e=A(n),e&&(r[e]=t[n]));return r}function S(e,n){return function(r){return null!=r?(M(this,e,r),t.updateOffset(this,n),this):D(this,e)}}function D(t,e){return t._d["get"+(t._isUTC?"UTC":"")+e]()}function M(t,e,n){return t._d["set"+(t._isUTC?"UTC":"")+e](n)}function O(t,e){var n;if("object"==typeof t)for(n in t)this.set(n,t[n]);else if(t=A(t),"function"==typeof this[t])return this[t](e);return this}function F(t,e,n){var r=""+Math.abs(t),i=e-r.length,o=t>=0;return(o?n?"+":"":"-")+Math.pow(10,Math.max(0,i)).toString().substr(1)+r}function R(t,e,n,r){var i=r;"string"==typeof r&&(i=function(){return this[r]()}),t&&(Yn[t]=i),e&&(Yn[e[0]]=function(){return F(i.apply(this,arguments),e[1],e[2])}),n&&(Yn[n]=function(){return this.localeData().ordinal(i.apply(this,arguments),t)})}function j(t){return t.match(/\[[\s\S]/)?t.replace(/^\[|\]$/g,""):t.replace(/\\/g,"")}function B(t){var e,n,r=t.match(Un);for(e=0,n=r.length;n>e;e++)Yn[r[e]]?r[e]=Yn[r[e]]:r[e]=j(r[e]);return function(i){var o="";for(e=0;n>e;e++)o+=r[e]instanceof Function?r[e].call(i,t):r[e];return o}}function N(t,e){return t.isValid()?(e=I(e,t.localeData()),qn[e]=qn[e]||B(e),qn[e](t)):t.localeData().invalidDate()}function I(t,e){function n(t){return e.longDateFormat(t)||t}var r=5;for(Vn.lastIndex=0;r>=0&&Vn.test(t);)t=t.replace(Vn,n),Vn.lastIndex=0,r-=1;return t}function L(t){return"function"==typeof t&&"[object Function]"===Object.prototype.toString.call(t)}function P(t,e,n){ir[t]=L(e)?e:function(t){return t&&n?n:e}}function U(t,e){return o(ir,t)?ir[t](e._strict,e._locale):new RegExp(V(t))}function V(t){return t.replace("\\","").replace(/\\(\[)|\\(\])|\[([^\]\[]*)\]|\\(.)/g,function(t,e,n,r,i){return e||n||r||i}).replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&")}function q(t,e){var n,r=e;for("string"==typeof t&&(t=[t]),"number"==typeof e&&(r=function(t,n){n[e]=m(t)}),n=0;nr;r++){if(i=a([2e3,r]),n&&!this._longMonthsParse[r]&&(this._longMonthsParse[r]=new RegExp("^"+this.months(i,"").replace(".","")+"$","i"),this._shortMonthsParse[r]=new RegExp("^"+this.monthsShort(i,"").replace(".","")+"$","i")),n||this._monthsParse[r]||(o="^"+this.months(i,"")+"|^"+this.monthsShort(i,""),this._monthsParse[r]=new RegExp(o.replace(".",""),"i")),n&&"MMMM"===e&&this._longMonthsParse[r].test(t))return r;if(n&&"MMM"===e&&this._shortMonthsParse[r].test(t))return r;if(!n&&this._monthsParse[r].test(t))return r}}function X(t,e){var n;return"string"==typeof e&&(e=t.localeData().monthsParse(e),"number"!=typeof e)?t:(n=Math.min(t.date(),z(t.year(),e)),t._d["set"+(t._isUTC?"UTC":"")+"Month"](e,n),t)}function J(e){return null!=e?(X(this,e),t.updateOffset(this,!0),this):D(this,"Month")}function K(){return z(this.year(),this.month())}function Z(t){var e,n=t._a;return n&&-2===c(t).overflow&&(e=n[ar]<0||n[ar]>11?ar:n[ur]<1||n[ur]>z(n[sr],n[ar])?ur:n[cr]<0||n[cr]>24||24===n[cr]&&(0!==n[lr]||0!==n[hr]||0!==n[fr])?cr:n[lr]<0||n[lr]>59?lr:n[hr]<0||n[hr]>59?hr:n[fr]<0||n[fr]>999?fr:-1,c(t)._overflowDayOfYear&&(sr>e||e>ur)&&(e=ur),c(t).overflow=e),t}function Q(e){t.suppressDeprecationWarnings===!1&&"undefined"!=typeof console&&console.warn&&console.warn("Deprecation warning: "+e)}function tt(t,e){var n=!0;return s(function(){return n&&(Q(t+"\n"+(new Error).stack),n=!1),e.apply(this,arguments)},e)}function et(t,e){gr[t]||(Q(e),gr[t]=!0)}function nt(t){var e,n,r=t._i,i=mr.exec(r);if(i){for(c(t).iso=!0,e=0,n=yr.length;n>e;e++)if(yr[e][1].exec(r)){t._f=yr[e][0];break}for(e=0,n=vr.length;n>e;e++)if(vr[e][1].exec(r)){t._f+=(i[6]||" ")+vr[e][0];break}r.match(er)&&(t._f+="Z"),wt(t)}else t._isValid=!1}function rt(e){var n=_r.exec(e._i);return null!==n?void(e._d=new Date(+n[1])):(nt(e),void(e._isValid===!1&&(delete e._isValid,t.createFromInputFallback(e))))}function it(t,e,n,r,i,o,s){var a=new Date(t,e,n,r,i,o,s);return 1970>t&&a.setFullYear(t),a}function ot(t){var e=new Date(Date.UTC.apply(null,arguments));return 1970>t&&e.setUTCFullYear(t),e}function st(t){return at(t)?366:365}function at(t){return t%4===0&&t%100!==0||t%400===0}function ut(){return at(this.year())}function ct(t,e,n){var r,i=n-e,o=n-t.day();return o>i&&(o-=7),i-7>o&&(o+=7),r=Dt(t).add(o,"d"),{week:Math.ceil(r.dayOfYear()/7),year:r.year()}}function lt(t){return ct(t,this._week.dow,this._week.doy).week}function ht(){return this._week.dow}function ft(){return this._week.doy}function pt(t){var e=this.localeData().week(this);return null==t?e:this.add(7*(t-e),"d")}function dt(t){var e=ct(this,1,4).week;return null==t?e:this.add(7*(t-e),"d")}function gt(t,e,n,r,i){var o,s=6+i-r,a=ot(t,0,1+s),u=a.getUTCDay();return i>u&&(u+=7),n=null!=n?1*n:i,o=1+s+7*(e-1)-u+n,{year:o>0?t:t-1,dayOfYear:o>0?o:st(t-1)+o}}function mt(t){var e=Math.round((this.clone().startOf("day")-this.clone().startOf("year"))/864e5)+1;return null==t?e:this.add(t-e,"d")}function yt(t,e,n){return null!=t?t:null!=e?e:n}function vt(t){var e=new Date;return t._useUTC?[e.getUTCFullYear(),e.getUTCMonth(),e.getUTCDate()]:[e.getFullYear(),e.getMonth(),e.getDate()]}function _t(t){var e,n,r,i,o=[];if(!t._d){for(r=vt(t),t._w&&null==t._a[ur]&&null==t._a[ar]&&bt(t),t._dayOfYear&&(i=yt(t._a[sr],r[sr]),t._dayOfYear>st(i)&&(c(t)._overflowDayOfYear=!0),n=ot(i,0,t._dayOfYear),t._a[ar]=n.getUTCMonth(),t._a[ur]=n.getUTCDate()),e=0;3>e&&null==t._a[e];++e)t._a[e]=o[e]=r[e];for(;7>e;e++)t._a[e]=o[e]=null==t._a[e]?2===e?1:0:t._a[e];24===t._a[cr]&&0===t._a[lr]&&0===t._a[hr]&&0===t._a[fr]&&(t._nextDay=!0,t._a[cr]=0),t._d=(t._useUTC?ot:it).apply(null,o),null!=t._tzm&&t._d.setUTCMinutes(t._d.getUTCMinutes()-t._tzm),t._nextDay&&(t._a[cr]=24)}}function bt(t){var e,n,r,i,o,s,a;e=t._w,null!=e.GG||null!=e.W||null!=e.E?(o=1,s=4,n=yt(e.GG,t._a[sr],ct(Dt(),1,4).year),r=yt(e.W,1),i=yt(e.E,1)):(o=t._locale._week.dow,s=t._locale._week.doy,n=yt(e.gg,t._a[sr],ct(Dt(),o,s).year),r=yt(e.w,1),null!=e.d?(i=e.d,o>i&&++r):i=null!=e.e?e.e+o:o),a=gt(n,r,i,s,o),t._a[sr]=a.year,t._dayOfYear=a.dayOfYear}function wt(e){if(e._f===t.ISO_8601)return void nt(e);e._a=[],c(e).empty=!0;var n,r,i,o,s,a=""+e._i,u=a.length,l=0;for(i=I(e._f,e._locale).match(Un)||[],n=0;n0&&c(e).unusedInput.push(s),a=a.slice(a.indexOf(r)+r.length),l+=r.length),Yn[o]?(r?c(e).empty=!1:c(e).unusedTokens.push(o),$(o,r,e)):e._strict&&!r&&c(e).unusedTokens.push(o);c(e).charsLeftOver=u-l,a.length>0&&c(e).unusedInput.push(a),c(e).bigHour===!0&&e._a[cr]<=12&&e._a[cr]>0&&(c(e).bigHour=void 0),e._a[cr]=Et(e._locale,e._a[cr],e._meridiem),_t(e),Z(e)}function Et(t,e,n){var r;return null==n?e:null!=t.meridiemHour?t.meridiemHour(e,n):null!=t.isPM?(r=t.isPM(n),r&&12>e&&(e+=12),r||12!==e||(e=0),e):e}function xt(t){var e,n,r,i,o;if(0===t._f.length)return c(t).invalidFormat=!0,void(t._d=new Date(NaN));for(i=0;io)&&(r=o,n=e));s(t,n||e)}function Ct(t){if(!t._d){var e=T(t._i);t._a=[e.year,e.month,e.day||e.date,e.hour,e.minute,e.second,e.millisecond],_t(t)}}function kt(t){var e=new p(Z(At(t)));return e._nextDay&&(e.add(1,"d"),e._nextDay=void 0),e}function At(t){var e=t._i,i=t._f;return t._locale=t._locale||C(t._l),null===e||void 0===i&&""===e?h({nullInput:!0}):("string"==typeof e&&(t._i=e=t._locale.preparse(e)),d(e)?new p(Z(e)):(n(i)?xt(t):i?wt(t):r(e)?t._d=e:Tt(t),t))}function Tt(e){var o=e._i;void 0===o?e._d=new Date:r(o)?e._d=new Date(+o):"string"==typeof o?rt(e):n(o)?(e._a=i(o.slice(0),function(t){return parseInt(t,10)}),_t(e)):"object"==typeof o?Ct(e):"number"==typeof o?e._d=new Date(o):t.createFromInputFallback(e)}function St(t,e,n,r,i){var o={};return"boolean"==typeof n&&(r=n,n=void 0),o._isAMomentObject=!0,o._useUTC=o._isUTC=i,o._l=n,o._i=t,o._f=e,o._strict=r,kt(o)}function Dt(t,e,n,r){return St(t,e,n,r,!1)}function Mt(t,e){var r,i;if(1===e.length&&n(e[0])&&(e=e[0]),!e.length)return Dt();for(r=e[0],i=1;it&&(t=-t,n="-"),n+F(~~(t/60),2)+e+F(~~t%60,2)})}function Nt(t){var e=(t||"").match(er)||[],n=e[e.length-1]||[],r=(n+"").match(Cr)||["-",0,0],i=+(60*r[1])+m(r[2]);return"+"===r[0]?i:-i}function It(e,n){var i,o;return n._isUTC?(i=n.clone(),o=(d(e)||r(e)?+e:+Dt(e))-+i,i._d.setTime(+i._d+o),t.updateOffset(i,!1),i):Dt(e).local()}function Lt(t){return 15*-Math.round(t._d.getTimezoneOffset()/15)}function Pt(e,n){var r,i=this._offset||0;return null!=e?("string"==typeof e&&(e=Nt(e)),Math.abs(e)<16&&(e=60*e),!this._isUTC&&n&&(r=Lt(this)),this._offset=e,this._isUTC=!0,null!=r&&this.add(r,"m"),i!==e&&(!n||this._changeInProgress?ee(this,Jt(e-i,"m"),1,!1):this._changeInProgress||(this._changeInProgress=!0,t.updateOffset(this,!0),this._changeInProgress=null)),this):this._isUTC?i:Lt(this)}function Ut(t,e){return null!=t?("string"!=typeof t&&(t=-t),this.utcOffset(t,e),this):-this.utcOffset()}function Vt(t){return this.utcOffset(0,t)}function qt(t){return this._isUTC&&(this.utcOffset(0,t),this._isUTC=!1,t&&this.subtract(Lt(this),"m")),this}function Yt(){return this._tzm?this.utcOffset(this._tzm):"string"==typeof this._i&&this.utcOffset(Nt(this._i)),this}function $t(t){return t=t?Dt(t).utcOffset():0,(this.utcOffset()-t)%60===0}function zt(){return this.utcOffset()>this.clone().month(0).utcOffset()||this.utcOffset()>this.clone().month(5).utcOffset()}function Ht(){if("undefined"!=typeof this._isDSTShifted)return this._isDSTShifted;var t={};if(f(t,this),t=At(t),t._a){var e=t._isUTC?a(t._a):Dt(t._a);this._isDSTShifted=this.isValid()&&y(t._a,e.toArray())>0}else this._isDSTShifted=!1;return this._isDSTShifted}function Wt(){return!this._isUTC}function Gt(){return this._isUTC}function Xt(){return this._isUTC&&0===this._offset}function Jt(t,e){var n,r,i,s=t,a=null;return jt(t)?s={ms:t._milliseconds,d:t._days,M:t._months}:"number"==typeof t?(s={},e?s[e]=t:s.milliseconds=t):(a=kr.exec(t))?(n="-"===a[1]?-1:1,s={y:0,d:m(a[ur])*n,h:m(a[cr])*n,m:m(a[lr])*n,s:m(a[hr])*n,ms:m(a[fr])*n}):(a=Ar.exec(t))?(n="-"===a[1]?-1:1,s={y:Kt(a[2],n),M:Kt(a[3],n),d:Kt(a[4],n),h:Kt(a[5],n),m:Kt(a[6],n),s:Kt(a[7],n),w:Kt(a[8],n)}):null==s?s={}:"object"==typeof s&&("from"in s||"to"in s)&&(i=Qt(Dt(s.from),Dt(s.to)),s={},s.ms=i.milliseconds,s.M=i.months),r=new Rt(s),jt(t)&&o(t,"_locale")&&(r._locale=t._locale),r}function Kt(t,e){var n=t&&parseFloat(t.replace(",","."));return(isNaN(n)?0:n)*e}function Zt(t,e){var n={milliseconds:0,months:0};return n.months=e.month()-t.month()+12*(e.year()-t.year()),t.clone().add(n.months,"M").isAfter(e)&&--n.months,n.milliseconds=+e-+t.clone().add(n.months,"M"),n}function Qt(t,e){var n;return e=It(e,t),t.isBefore(e)?n=Zt(t,e):(n=Zt(e,t),n.milliseconds=-n.milliseconds,n.months=-n.months),n}function te(t,e){return function(n,r){var i,o;return null===r||isNaN(+r)||(et(e,"moment()."+e+"(period, number) is deprecated. Please use moment()."+e+"(number, period)."),o=n,n=r,r=o),n="string"==typeof n?+n:n,i=Jt(n,r),ee(this,i,t),this}}function ee(e,n,r,i){var o=n._milliseconds,s=n._days,a=n._months;i=null==i?!0:i,o&&e._d.setTime(+e._d+o*r),s&&M(e,"Date",D(e,"Date")+s*r),a&&X(e,D(e,"Month")+a*r),i&&t.updateOffset(e,s||a)}function ne(t,e){var n=t||Dt(),r=It(n,this).startOf("day"),i=this.diff(r,"days",!0),o=-6>i?"sameElse":-1>i?"lastWeek":0>i?"lastDay":1>i?"sameDay":2>i?"nextDay":7>i?"nextWeek":"sameElse";return this.format(e&&e[o]||this.localeData().calendar(o,this,Dt(n)))}function re(){return new p(this)}function ie(t,e){var n;return e=A("undefined"!=typeof e?e:"millisecond"),"millisecond"===e?(t=d(t)?t:Dt(t),+this>+t):(n=d(t)?+t:+Dt(t),n<+this.clone().startOf(e))}function oe(t,e){var n;return e=A("undefined"!=typeof e?e:"millisecond"),"millisecond"===e?(t=d(t)?t:Dt(t),+t>+this):(n=d(t)?+t:+Dt(t),+this.clone().endOf(e)e-o?(n=t.clone().add(i-1,"months"),r=(e-o)/(o-n)):(n=t.clone().add(i+1,"months"),r=(e-o)/(n-o)),-(i+r)}function le(){return this.clone().locale("en").format("ddd MMM DD YYYY HH:mm:ss [GMT]ZZ")}function he(){var t=this.clone().utc();return 0e;e++)if(this._weekdaysParse[e]||(n=Dt([2e3,1]).day(e),r="^"+this.weekdays(n,"")+"|^"+this.weekdaysShort(n,"")+"|^"+this.weekdaysMin(n,""),this._weekdaysParse[e]=new RegExp(r.replace(".",""),"i")),this._weekdaysParse[e].test(t))return e}function Ve(t){var e=this._isUTC?this._d.getUTCDay():this._d.getDay();return null!=t?(t=Ne(t,this.localeData()),this.add(t-e,"d")):e}function qe(t){var e=(this.day()+7-this.localeData()._week.dow)%7;return null==t?e:this.add(t-e,"d")}function Ye(t){return null==t?this.day()||7:this.day(this.day()%7?t:t-7)}function $e(t,e){R(t,0,0,function(){return this.localeData().meridiem(this.hours(),this.minutes(),e)})}function ze(t,e){return e._meridiemParse}function He(t){return"p"===(t+"").toLowerCase().charAt(0)}function We(t,e,n){return t>11?n?"pm":"PM":n?"am":"AM"}function Ge(t,e){e[fr]=m(1e3*("0."+t))}function Xe(){return this._isUTC?"UTC":""}function Je(){return this._isUTC?"Coordinated Universal Time":""}function Ke(t){return Dt(1e3*t)}function Ze(){return Dt.apply(null,arguments).parseZone()}function Qe(t,e,n){var r=this._calendar[t];return"function"==typeof r?r.call(e,n):r}function tn(t){var e=this._longDateFormat[t],n=this._longDateFormat[t.toUpperCase()];return e||!n?e:(this._longDateFormat[t]=n.replace(/MMMM|MM|DD|dddd/g,function(t){return t.slice(1)}),this._longDateFormat[t])}function en(){return this._invalidDate}function nn(t){return this._ordinal.replace("%d",t)}function rn(t){return t}function on(t,e,n,r){var i=this._relativeTime[n];return"function"==typeof i?i(t,e,n,r):i.replace(/%d/i,t)}function sn(t,e){var n=this._relativeTime[t>0?"future":"past"];return"function"==typeof n?n(e):n.replace(/%s/i,e)}function an(t){var e,n;for(n in t)e=t[n],"function"==typeof e?this[n]=e:this["_"+n]=e;this._ordinalParseLenient=new RegExp(this._ordinalParse.source+"|"+/\d{1,2}/.source)}function un(t,e,n,r){var i=C(),o=a().set(r,e);return i[n](o,t)}function cn(t,e,n,r,i){if("number"==typeof t&&(e=t,t=void 0),t=t||"",null!=e)return un(t,e,n,i);var o,s=[];for(o=0;r>o;o++)s[o]=un(t,o,n,i);return s}function ln(t,e){return cn(t,e,"months",12,"month")}function hn(t,e){return cn(t,e,"monthsShort",12,"month")}function fn(t,e){return cn(t,e,"weekdays",7,"day")}function pn(t,e){return cn(t,e,"weekdaysShort",7,"day")}function dn(t,e){return cn(t,e,"weekdaysMin",7,"day")}function gn(){var t=this._data;return this._milliseconds=Xr(this._milliseconds),this._days=Xr(this._days),this._months=Xr(this._months),t.milliseconds=Xr(t.milliseconds),t.seconds=Xr(t.seconds),t.minutes=Xr(t.minutes),t.hours=Xr(t.hours),t.months=Xr(t.months),t.years=Xr(t.years),this}function mn(t,e,n,r){var i=Jt(e,n);return t._milliseconds+=r*i._milliseconds,t._days+=r*i._days,t._months+=r*i._months,t._bubble()}function yn(t,e){return mn(this,t,e,1)}function vn(t,e){return mn(this,t,e,-1)}function _n(t){return 0>t?Math.floor(t):Math.ceil(t)}function bn(){var t,e,n,r,i,o=this._milliseconds,s=this._days,a=this._months,u=this._data;return o>=0&&s>=0&&a>=0||0>=o&&0>=s&&0>=a||(o+=864e5*_n(En(a)+s),s=0,a=0),u.milliseconds=o%1e3,t=g(o/1e3),u.seconds=t%60,e=g(t/60),u.minutes=e%60,n=g(e/60),u.hours=n%24,s+=g(n/24),i=g(wn(s)),a+=i,s-=_n(En(i)),r=g(a/12),a%=12,u.days=s,u.months=a,u.years=r,this}function wn(t){return 4800*t/146097}function En(t){return 146097*t/4800}function xn(t){var e,n,r=this._milliseconds;if(t=A(t),"month"===t||"year"===t)return e=this._days+r/864e5,n=this._months+wn(e),"month"===t?n:n/12;switch(e=this._days+Math.round(En(this._months)),t){case"week":return e/7+r/6048e5;case"day":return e+r/864e5;case"hour":return 24*e+r/36e5;case"minute":return 1440*e+r/6e4;case"second":return 86400*e+r/1e3;case"millisecond":return Math.floor(864e5*e)+r;default:throw new Error("Unknown unit "+t)}}function Cn(){return this._milliseconds+864e5*this._days+this._months%12*2592e6+31536e6*m(this._months/12)}function kn(t){return function(){return this.as(t)}}function An(t){return t=A(t),this[t+"s"]()}function Tn(t){return function(){return this._data[t]}}function Sn(){return g(this.days()/7)}function Dn(t,e,n,r,i){return i.relativeTime(e||1,!!n,t,r)}function Mn(t,e,n){var r=Jt(t).abs(),i=hi(r.as("s")),o=hi(r.as("m")),s=hi(r.as("h")),a=hi(r.as("d")),u=hi(r.as("M")),c=hi(r.as("y")),l=i0,l[4]=n,Dn.apply(null,l)}function On(t,e){return void 0===fi[t]?!1:void 0===e?fi[t]:(fi[t]=e,!0)}function Fn(t){var e=this.localeData(),n=Mn(this,!t,e);return t&&(n=e.pastFuture(+this,n)),e.postformat(n)}function Rn(){var t,e,n,r=pi(this._milliseconds)/1e3,i=pi(this._days),o=pi(this._months);t=g(r/60),e=g(t/60),r%=60,t%=60,n=g(o/12),o%=12;var s=n,a=o,u=i,c=e,l=t,h=r,f=this.asSeconds();return f?(0>f?"-":"")+"P"+(s?s+"Y":"")+(a?a+"M":"")+(u?u+"D":"")+(c||l||h?"T":"")+(c?c+"H":"")+(l?l+"M":"")+(h?h+"S":""):"P0D"}var jn,Bn,Nn=t.momentProperties=[],In=!1,Ln={},Pn={},Un=/(\[[^\[]*\])|(\\)?(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,9}|x|X|zz?|ZZ?|.)/g,Vn=/(\[[^\[]*\])|(\\)?(LTS|LT|LL?L?L?|l{1,4})/g,qn={},Yn={},$n=/\d/,zn=/\d\d/,Hn=/\d{3}/,Wn=/\d{4}/,Gn=/[+-]?\d{6}/,Xn=/\d\d?/,Jn=/\d{1,3}/,Kn=/\d{1,4}/,Zn=/[+-]?\d{1,6}/,Qn=/\d+/,tr=/[+-]?\d+/,er=/Z|[+-]\d\d:?\d\d/gi,nr=/[+-]?\d+(\.\d{1,3})?/,rr=/[0-9]*['a-z\u00A0-\u05FF\u0700-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]+|[\u0600-\u06FF\/]+(\s*?[\u0600-\u06FF]+){1,2}/i,ir={},or={},sr=0,ar=1,ur=2,cr=3,lr=4,hr=5,fr=6;R("M",["MM",2],"Mo",function(){return this.month()+1}),R("MMM",0,0,function(t){return this.localeData().monthsShort(this,t)}),R("MMMM",0,0,function(t){return this.localeData().months(this,t)}),k("month","M"),P("M",Xn),P("MM",Xn,zn),P("MMM",rr),P("MMMM",rr),q(["M","MM"],function(t,e){e[ar]=m(t)-1}),q(["MMM","MMMM"],function(t,e,n,r){var i=n._locale.monthsParse(t,r,n._strict);null!=i?e[ar]=i:c(n).invalidMonth=t});var pr="January_February_March_April_May_June_July_August_September_October_November_December".split("_"),dr="Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec".split("_"),gr={};t.suppressDeprecationWarnings=!1;var mr=/^\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)?)?$/,yr=[["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}/]],vr=[["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/]],_r=/^\/?Date\((\-?\d+)/i;t.createFromInputFallback=tt("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(t){t._d=new Date(t._i+(t._useUTC?" UTC":""))}),R(0,["YY",2],0,function(){return this.year()%100}),R(0,["YYYY",4],0,"year"),R(0,["YYYYY",5],0,"year"),R(0,["YYYYYY",6,!0],0,"year"),k("year","y"),P("Y",tr),P("YY",Xn,zn),P("YYYY",Kn,Wn),P("YYYYY",Zn,Gn),P("YYYYYY",Zn,Gn),q(["YYYYY","YYYYYY"],sr),q("YYYY",function(e,n){n[sr]=2===e.length?t.parseTwoDigitYear(e):m(e)}),q("YY",function(e,n){n[sr]=t.parseTwoDigitYear(e)}),t.parseTwoDigitYear=function(t){return m(t)+(m(t)>68?1900:2e3)};var br=S("FullYear",!1);R("w",["ww",2],"wo","week"),R("W",["WW",2],"Wo","isoWeek"),k("week","w"),k("isoWeek","W"),P("w",Xn),P("ww",Xn,zn),P("W",Xn),P("WW",Xn,zn),Y(["w","ww","W","WW"],function(t,e,n,r){e[r.substr(0,1)]=m(t)});var wr={dow:0,doy:6};R("DDD",["DDDD",3],"DDDo","dayOfYear"),k("dayOfYear","DDD"),
-P("DDD",Jn),P("DDDD",Hn),q(["DDD","DDDD"],function(t,e,n){n._dayOfYear=m(t)}),t.ISO_8601=function(){};var Er=tt("moment().min is deprecated, use moment.min instead. https://github.com/moment/moment/issues/1548",function(){var t=Dt.apply(null,arguments);return this>t?this:t}),xr=tt("moment().max is deprecated, use moment.max instead. https://github.com/moment/moment/issues/1548",function(){var t=Dt.apply(null,arguments);return t>this?this:t});Bt("Z",":"),Bt("ZZ",""),P("Z",er),P("ZZ",er),q(["Z","ZZ"],function(t,e,n){n._useUTC=!0,n._tzm=Nt(t)});var Cr=/([\+\-]|\d\d)/gi;t.updateOffset=function(){};var kr=/(\-)?(?:(\d*)\.)?(\d+)\:(\d+)(?:\:(\d+)\.?(\d{3})?)?/,Ar=/^(-)?P(?:(?:([0-9,.]*)Y)?(?:([0-9,.]*)M)?(?:([0-9,.]*)D)?(?:T(?:([0-9,.]*)H)?(?:([0-9,.]*)M)?(?:([0-9,.]*)S)?)?|([0-9,.]*)W)$/;Jt.fn=Rt.prototype;var Tr=te(1,"add"),Sr=te(-1,"subtract");t.defaultFormat="YYYY-MM-DDTHH:mm:ssZ";var Dr=tt("moment().lang() is deprecated. Instead, use moment().localeData() to get the language configuration. Use moment().locale() to change languages.",function(t){return void 0===t?this.localeData():this.locale(t)});R(0,["gg",2],0,function(){return this.weekYear()%100}),R(0,["GG",2],0,function(){return this.isoWeekYear()%100}),De("gggg","weekYear"),De("ggggg","weekYear"),De("GGGG","isoWeekYear"),De("GGGGG","isoWeekYear"),k("weekYear","gg"),k("isoWeekYear","GG"),P("G",tr),P("g",tr),P("GG",Xn,zn),P("gg",Xn,zn),P("GGGG",Kn,Wn),P("gggg",Kn,Wn),P("GGGGG",Zn,Gn),P("ggggg",Zn,Gn),Y(["gggg","ggggg","GGGG","GGGGG"],function(t,e,n,r){e[r.substr(0,2)]=m(t)}),Y(["gg","GG"],function(e,n,r,i){n[i]=t.parseTwoDigitYear(e)}),R("Q",0,0,"quarter"),k("quarter","Q"),P("Q",$n),q("Q",function(t,e){e[ar]=3*(m(t)-1)}),R("D",["DD",2],"Do","date"),k("date","D"),P("D",Xn),P("DD",Xn,zn),P("Do",function(t,e){return t?e._ordinalParse:e._ordinalParseLenient}),q(["D","DD"],ur),q("Do",function(t,e){e[ur]=m(t.match(Xn)[0],10)});var Mr=S("Date",!0);R("d",0,"do","day"),R("dd",0,0,function(t){return this.localeData().weekdaysMin(this,t)}),R("ddd",0,0,function(t){return this.localeData().weekdaysShort(this,t)}),R("dddd",0,0,function(t){return this.localeData().weekdays(this,t)}),R("e",0,0,"weekday"),R("E",0,0,"isoWeekday"),k("day","d"),k("weekday","e"),k("isoWeekday","E"),P("d",Xn),P("e",Xn),P("E",Xn),P("dd",rr),P("ddd",rr),P("dddd",rr),Y(["dd","ddd","dddd"],function(t,e,n){var r=n._locale.weekdaysParse(t);null!=r?e.d=r:c(n).invalidWeekday=t}),Y(["d","e","E"],function(t,e,n,r){e[r]=m(t)});var Or="Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),Fr="Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"),Rr="Su_Mo_Tu_We_Th_Fr_Sa".split("_");R("H",["HH",2],0,"hour"),R("h",["hh",2],0,function(){return this.hours()%12||12}),$e("a",!0),$e("A",!1),k("hour","h"),P("a",ze),P("A",ze),P("H",Xn),P("h",Xn),P("HH",Xn,zn),P("hh",Xn,zn),q(["H","HH"],cr),q(["a","A"],function(t,e,n){n._isPm=n._locale.isPM(t),n._meridiem=t}),q(["h","hh"],function(t,e,n){e[cr]=m(t),c(n).bigHour=!0});var jr=/[ap]\.?m?\.?/i,Br=S("Hours",!0);R("m",["mm",2],0,"minute"),k("minute","m"),P("m",Xn),P("mm",Xn,zn),q(["m","mm"],lr);var Nr=S("Minutes",!1);R("s",["ss",2],0,"second"),k("second","s"),P("s",Xn),P("ss",Xn,zn),q(["s","ss"],hr);var Ir=S("Seconds",!1);R("S",0,0,function(){return~~(this.millisecond()/100)}),R(0,["SS",2],0,function(){return~~(this.millisecond()/10)}),R(0,["SSS",3],0,"millisecond"),R(0,["SSSS",4],0,function(){return 10*this.millisecond()}),R(0,["SSSSS",5],0,function(){return 100*this.millisecond()}),R(0,["SSSSSS",6],0,function(){return 1e3*this.millisecond()}),R(0,["SSSSSSS",7],0,function(){return 1e4*this.millisecond()}),R(0,["SSSSSSSS",8],0,function(){return 1e5*this.millisecond()}),R(0,["SSSSSSSSS",9],0,function(){return 1e6*this.millisecond()}),k("millisecond","ms"),P("S",Jn,$n),P("SS",Jn,zn),P("SSS",Jn,Hn);var Lr;for(Lr="SSSS";Lr.length<=9;Lr+="S")P(Lr,Qn);for(Lr="S";Lr.length<=9;Lr+="S")q(Lr,Ge);var Pr=S("Milliseconds",!1);R("z",0,0,"zoneAbbr"),R("zz",0,0,"zoneName");var Ur=p.prototype;Ur.add=Tr,Ur.calendar=ne,Ur.clone=re,Ur.diff=ue,Ur.endOf=be,Ur.format=fe,Ur.from=pe,Ur.fromNow=de,Ur.to=ge,Ur.toNow=me,Ur.get=O,Ur.invalidAt=Se,Ur.isAfter=ie,Ur.isBefore=oe,Ur.isBetween=se,Ur.isSame=ae,Ur.isValid=Ae,Ur.lang=Dr,Ur.locale=ye,Ur.localeData=ve,Ur.max=xr,Ur.min=Er,Ur.parsingFlags=Te,Ur.set=O,Ur.startOf=_e,Ur.subtract=Sr,Ur.toArray=Ce,Ur.toObject=ke,Ur.toDate=xe,Ur.toISOString=he,Ur.toJSON=he,Ur.toString=le,Ur.unix=Ee,Ur.valueOf=we,Ur.year=br,Ur.isLeapYear=ut,Ur.weekYear=Oe,Ur.isoWeekYear=Fe,Ur.quarter=Ur.quarters=Be,Ur.month=J,Ur.daysInMonth=K,Ur.week=Ur.weeks=pt,Ur.isoWeek=Ur.isoWeeks=dt,Ur.weeksInYear=je,Ur.isoWeeksInYear=Re,Ur.date=Mr,Ur.day=Ur.days=Ve,Ur.weekday=qe,Ur.isoWeekday=Ye,Ur.dayOfYear=mt,Ur.hour=Ur.hours=Br,Ur.minute=Ur.minutes=Nr,Ur.second=Ur.seconds=Ir,Ur.millisecond=Ur.milliseconds=Pr,Ur.utcOffset=Pt,Ur.utc=Vt,Ur.local=qt,Ur.parseZone=Yt,Ur.hasAlignedHourOffset=$t,Ur.isDST=zt,Ur.isDSTShifted=Ht,Ur.isLocal=Wt,Ur.isUtcOffset=Gt,Ur.isUtc=Xt,Ur.isUTC=Xt,Ur.zoneAbbr=Xe,Ur.zoneName=Je,Ur.dates=tt("dates accessor is deprecated. Use date instead.",Mr),Ur.months=tt("months accessor is deprecated. Use month instead",J),Ur.years=tt("years accessor is deprecated. Use year instead",br),Ur.zone=tt("moment().zone is deprecated, use moment().utcOffset instead. https://github.com/moment/moment/issues/1779",Ut);var Vr=Ur,qr={sameDay:"[Today at] LT",nextDay:"[Tomorrow at] LT",nextWeek:"dddd [at] LT",lastDay:"[Yesterday at] LT",lastWeek:"[Last] dddd [at] LT",sameElse:"L"},Yr={LTS:"h:mm:ss A",LT:"h:mm A",L:"MM/DD/YYYY",LL:"MMMM D, YYYY",LLL:"MMMM D, YYYY h:mm A",LLLL:"dddd, MMMM D, YYYY h:mm A"},$r="Invalid date",zr="%d",Hr=/\d{1,2}/,Wr={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"},Gr=v.prototype;Gr._calendar=qr,Gr.calendar=Qe,Gr._longDateFormat=Yr,Gr.longDateFormat=tn,Gr._invalidDate=$r,Gr.invalidDate=en,Gr._ordinal=zr,Gr.ordinal=nn,Gr._ordinalParse=Hr,Gr.preparse=rn,Gr.postformat=rn,Gr._relativeTime=Wr,Gr.relativeTime=on,Gr.pastFuture=sn,Gr.set=an,Gr.months=H,Gr._months=pr,Gr.monthsShort=W,Gr._monthsShort=dr,Gr.monthsParse=G,Gr.week=lt,Gr._week=wr,Gr.firstDayOfYear=ft,Gr.firstDayOfWeek=ht,Gr.weekdays=Ie,Gr._weekdays=Or,Gr.weekdaysMin=Pe,Gr._weekdaysMin=Rr,Gr.weekdaysShort=Le,Gr._weekdaysShort=Fr,Gr.weekdaysParse=Ue,Gr.isPM=He,Gr._meridiemParse=jr,Gr.meridiem=We,E("en",{ordinalParse:/\d{1,2}(th|st|nd|rd)/,ordinal:function(t){var e=t%10,n=1===m(t%100/10)?"th":1===e?"st":2===e?"nd":3===e?"rd":"th";return t+n}}),t.lang=tt("moment.lang is deprecated. Use moment.locale instead.",E),t.langData=tt("moment.langData is deprecated. Use moment.localeData instead.",C);var Xr=Math.abs,Jr=kn("ms"),Kr=kn("s"),Zr=kn("m"),Qr=kn("h"),ti=kn("d"),ei=kn("w"),ni=kn("M"),ri=kn("y"),ii=Tn("milliseconds"),oi=Tn("seconds"),si=Tn("minutes"),ai=Tn("hours"),ui=Tn("days"),ci=Tn("months"),li=Tn("years"),hi=Math.round,fi={s:45,m:45,h:22,d:26,M:11},pi=Math.abs,di=Rt.prototype;di.abs=gn,di.add=yn,di.subtract=vn,di.as=xn,di.asMilliseconds=Jr,di.asSeconds=Kr,di.asMinutes=Zr,di.asHours=Qr,di.asDays=ti,di.asWeeks=ei,di.asMonths=ni,di.asYears=ri,di.valueOf=Cn,di._bubble=bn,di.get=An,di.milliseconds=ii,di.seconds=oi,di.minutes=si,di.hours=ai,di.days=ui,di.weeks=Sn,di.months=ci,di.years=li,di.humanize=Fn,di.toISOString=Rn,di.toString=Rn,di.toJSON=Rn,di.locale=ye,di.localeData=ve,di.toIsoString=tt("toIsoString() is deprecated. Please use toISOString() instead (notice the capitals)",Rn),di.lang=Dr,R("X",0,0,"unix"),R("x",0,0,"valueOf"),P("x",tr),P("X",nr),q("X",function(t,e,n){n._d=new Date(1e3*parseFloat(t,10))}),q("x",function(t,e,n){n._d=new Date(m(t))}),t.version="2.10.6",e(Dt),t.fn=Vr,t.min=Ot,t.max=Ft,t.utc=a,t.unix=Ke,t.months=ln,t.isDate=r,t.locale=E,t.invalid=h,t.duration=Jt,t.isMoment=d,t.weekdays=fn,t.parseZone=Ze,t.localeData=C,t.isDuration=jt,t.monthsShort=hn,t.weekdaysMin=dn,t.defineLocale=x,t.weekdaysShort=pn,t.normalizeUnits=A,t.relativeTimeThreshold=On;var gi=t;return gi}),function(t,e){"function"==typeof define&&define.amd?define([],function(){return e(t)}):"object"==typeof exports?module.exports=e(t):t.Polyglot=e(t)}(this,function(t){"use strict";function e(t){t=t||{},this.phrases={},this.extend(t.phrases||{}),this.currentLocale=t.locale||"en",this.allowMissing=!!t.allowMissing,this.warn=t.warn||u}function n(t){var e,n,r,i={};for(e in t)if(t.hasOwnProperty(e)){n=t[e];for(r in n)i[n[r]]=e}return i}function r(t){return l.call(t,d,"")}function i(t,e,n){var i,o,a;return null!=n&&t?(o=t.split(h),a=o[s(e,n)]||o[0],i=r(a)):i=t,i}function o(t){var e=n(p);return e[t]||e.en}function s(t,e){return f[o(t)](e)}function a(t,e){for(var n in e)if("_"!==n&&e.hasOwnProperty(n)){var r=e[n];"string"==typeof r&&(r=l.call(e[n],g,m)),t=l.call(t,new RegExp("%\\{"+n+"\\}","g"),r)}return t}function u(e){t.console&&t.console.warn&&t.console.warn("WARNING: "+e)}function c(t){var e={};for(var n in t)e[n]=t[n];return e}var l=String.prototype.replace;e.VERSION="0.4.5",e.prototype.locale=function(t){return t&&(this.currentLocale=t),this.currentLocale},e.prototype.extend=function(t,e){var n;for(var r in t)t.hasOwnProperty(r)&&(n=t[r],e&&(r=e+"."+r),"object"==typeof n?this.extend(n,r):this.phrases[r]=n)},e.prototype.unset=function(t,e){var n;if("string"==typeof t)delete this.phrases[t];else for(var r in t)t.hasOwnProperty(r)&&(n=t[r],e&&(r=e+"."+r),"object"==typeof n?this.unset(n,r):delete this.phrases[r])},e.prototype.clear=function(){this.phrases={}},e.prototype.replace=function(t){this.clear(),this.extend(t)},e.prototype.t=function(t,e){var n,r;return e=null==e?{}:e,"number"==typeof e&&(e={smart_count:e}),"string"==typeof this.phrases[t]?n=this.phrases[t]:"string"==typeof e._?n=e._:this.allowMissing?n=t:(this.warn('Missing translation for key: "'+t+'"'),r=t),"string"==typeof n&&(e=c(e),r=i(n,this.currentLocale,e.smart_count),r=a(r,e)),r},e.prototype.has=function(t){return t in this.phrases};var h="||||",f={chinese:function(t){return 0},german:function(t){return 1!==t?1:0},french:function(t){return t>1?1:0},russian:function(t){return t%10===1&&t%100!==11?0:t%10>=2&&4>=t%10&&(10>t%100||t%100>=20)?1:2},czech:function(t){return 1===t?0:t>=2&&4>=t?1:2},polish:function(t){return 1===t?0:t%10>=2&&4>=t%10&&(10>t%100||t%100>=20)?1:2},icelandic:function(t){return t%10!==1||t%100===11?1:0}},p={chinese:["fa","id","ja","ko","lo","ms","th","tr","zh"],german:["da","de","en","es","fi","el","he","hu","it","nl","no","pt","sv"],french:["fr","tl","pt-br"],russian:["hr","ru"],czech:["cs"],polish:["pl"],icelandic:["is"]},d=/^\s+|\s+$/g,g=/\$/g,m="$$$$";return e}),function(t){var e="object"==typeof exports&&exports,n="object"==typeof module&&module&&module.exports==e&&module,r="object"==typeof global&&global;(r.global===r||r.window===r)&&(t=r);var i=String.fromCharCode,o=function(t){return t.replace(/[\t\x20]$/gm,"").replace(/=?(?:\r\n?|\n)/g,"").replace(/=([a-fA-F0-9]{2})/g,function(t,e){var n=parseInt(e,16);return i(n)})},s=function(t){return t.replace(/\x20$/,"=20").replace(/\t$/,"=09")},a=/[\0-\b\n-\x1F=\x7F-\uD7FF\uDC00-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF]/g,u=function(t){for(var e=t.replace(a,function(t){if(t>"ÿ")throw RangeError("`quotedPrintable.encode()` expects extended ASCII input only. Don’t forget to encode the input first using a character encoding like UTF-8.");var e=t.charCodeAt(0),n=e.toString(16).toUpperCase();return"="+("0"+n).slice(-2)}),n=e.split(/\r\n?|\n/g),r=-1,i=n.length,o=[];++rl;){var f=e.slice(l,l+c);/=$/.test(f)?(f=f.slice(0,c-1),l+=c-1):/=[A-F0-9]$/.test(f)?(f=f.slice(0,c-2),l+=c-2):l+=c,o.push(f)}var p=f.length;return/[\t\x20]$/.test(f)&&(o.pop(),c+1>=p+2?o.push(s(f)):o.push(f.slice(0,p-1),s(f.slice(p-1,p)))),o.join("=\r\n")},c={encode:u,decode:o,version:"0.2.1"};if("function"==typeof define&&"object"==typeof define.amd&&define.amd)define(function(){return c});else if(e&&!e.nodeType)if(n)n.exports=c;else for(var l in c)c.hasOwnProperty(l)&&(e[l]=c[l]);else t.quotedPrintable=c}(this),function(t){function e(t){for(var e,n,r=[],i=0,o=t.length;o>i;)e=t.charCodeAt(i++),e>=55296&&56319>=e&&o>i?(n=t.charCodeAt(i++),56320==(64512&n)?r.push(((1023&e)<<10)+(1023&n)+65536):(r.push(e),i--)):r.push(e);return r}function n(t){for(var e,n=t.length,r=-1,i="";++r65535&&(e-=65536,i+=g(e>>>10&1023|55296),e=56320|1023&e),i+=g(e);return i}function r(t,e){return g(t>>e&63|128)}function i(t){if(0==(4294967168&t))return g(t);var e="";return 0==(4294965248&t)?e=g(t>>6&31|192):0==(4294901760&t)?(e=g(t>>12&15|224),e+=r(t,6)):0==(4292870144&t)&&(e=g(t>>18&7|240),e+=r(t,12),e+=r(t,6)),e+=g(63&t|128)}function o(t){for(var n,r=e(t),o=r.length,s=-1,a="";++s=p)throw Error("Invalid byte index");var t=255&f[d];if(d++,128==(192&t))return 63&t;throw Error("Invalid continuation byte")}function a(){var t,e,n,r,i;if(d>p)throw Error("Invalid byte index");if(d==p)return!1;if(t=255&f[d],d++,0==(128&t))return t;if(192==(224&t)){var e=s();if(i=(31&t)<<6|e,i>=128)return i;throw Error("Invalid continuation byte")}if(224==(240&t)){if(e=s(),n=s(),i=(15&t)<<12|e<<6|n,i>=2048)return i;throw Error("Invalid continuation byte")}if(240==(248&t)&&(e=s(),n=s(),r=s(),i=(15&t)<<18|e<<12|n<<6|r,i>=65536&&1114111>=i))return i;throw Error("Invalid UTF-8 detected")}function u(t){f=e(t),p=f.length,d=0;for(var r,i=[];(r=a())!==!1;)i.push(r);return n(i)}var c="object"==typeof exports&&exports,l="object"==typeof module&&module&&module.exports==c&&module,h="object"==typeof global&&global;(h.global===h||h.window===h)&&(t=h);var f,p,d,g=String.fromCharCode,m={version:"2.0.0",encode:o,decode:u};if("function"==typeof define&&"object"==typeof define.amd&&define.amd)define(function(){return m});else if(c&&!c.nodeType)if(l)l.exports=m;else{var y={},v=y.hasOwnProperty;for(var _ in m)v.call(m,_)&&(c[_]=m[_])}else t.utf8=m}(this),function(t){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=t();else if("function"==typeof define&&define.amd)define([],t);else{var e;e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this,e.jade=t()}}(function(){return function t(e,n,r){function i(s,a){if(!n[s]){if(!e[s]){var u="function"==typeof require&&require;if(!a&&u)return u(s,!0);if(o)return o(s,!0);var c=new Error("Cannot find module '"+s+"'");throw c.code="MODULE_NOT_FOUND",c}var l=n[s]={exports:{}};e[s][0].call(l.exports,function(t){var n=e[s][1][t];return i(n?n:t)},l,l.exports,t,e,n,r)}return n[s].exports}for(var o="function"==typeof require&&require,s=0;s":">",'"':"""},u=/[&<>"]/g;n.escape=s,n.rethrow=function l(e,n,r,i){if(!(e instanceof Error))throw e;if(!("undefined"==typeof window&&n||i))throw e.message+=" on line "+r,e;try{i=i||t("fs").readFileSync(n,"utf8")}catch(o){l(e,null,r)}var s=3,a=i.split("\n"),u=Math.max(r-s,0),c=Math.min(a.length,r+s),s=a.slice(u,c).map(function(t,e){var n=e+u+1;return(n==r?" > ":" ")+n+"| "+t}).join("\n");throw e.path=n,e.message=(n||"Jade")+":"+r+"\n"+s+"\n\n"+e.message,e},n.DebugItem=function(t,e){this.lineno=t,this.filename=e}},{fs:2}],2:[function(t,e,n){},{}]},{},[1])(1)});var ColorHash=function(){function t(t){var e,n,r,i;for(e=0,i=Math.pow(2,32),n=0,r=t.length;r>n;n++)e=(31*e+t.charCodeAt(n))%i;return e}function e(e,n){var r,i;return r=o[n]||o.base,i=t(e),"#"+r[i%r.length]}function n(t,e){o[t]=e}function r(t){return scheme[t]}function i(t){"base"!==t&&delete o[t]}var o={base:["00bb3f","238c47","007929","37dd6f","63dd8d","0f4fa8","284c7e","05316d","4380d3","6996d3","ff9f00","bf8930","a66800","ffb740","ffca73","ff2800","bf4630","a61a00","ff5d40","ff8973"]};return{addScheme:n,getScheme:r,deleteScheme:i,getHash:t,getColor:e}}(),saveAs=saveAs||function(t){"use strict";if("undefined"==typeof navigator||!/MSIE [1-9]\./.test(navigator.userAgent)){var e=t.document,n=function(){return t.URL||t.webkitURL||t},r=e.createElementNS("http://www.w3.org/1999/xhtml","a"),i="download"in r,o=function(t){var e=new MouseEvent("click");t.dispatchEvent(e)},s=/Version\/[\d\.]+.*Safari/.test(navigator.userAgent),a=t.webkitRequestFileSystem,u=t.requestFileSystem||a||t.mozRequestFileSystem,c=function(e){(t.setImmediate||t.setTimeout)(function(){throw e},0)},l="application/octet-stream",h=0,f=500,p=function(e){var r=function(){"string"==typeof e?n().revokeObjectURL(e):e.remove()};t.chrome?r():setTimeout(r,f)},d=function(t,e,n){e=[].concat(e);for(var r=e.length;r--;){var i=t["on"+e[r]];if("function"==typeof i)try{i.call(t,n||t)}catch(o){c(o)}}},g=function(t){return/^\s*(?:text\/\S*|application\/xml|\S*\/\S*\+xml)\s*;.*charset\s*=\s*utf-8/i.test(t.type)?new Blob(["\ufeff",t],{type:t.type}):t},m=function(e,c,f){f||(e=g(e));var m,y,v,_=this,b=e.type,w=!1,E=function(){d(_,"writestart progress write writeend".split(" "))},x=function(){if(y&&s&&"undefined"!=typeof FileReader){var r=new FileReader;return r.onloadend=function(){var t=r.result;y.location.href="data:attachment/file"+t.slice(t.search(/[,;]/)),_.readyState=_.DONE,E()},r.readAsDataURL(e),void(_.readyState=_.INIT)}if((w||!m)&&(m=n().createObjectURL(e)),y)y.location.href=m;else{var i=t.open(m,"_blank");void 0==i&&s&&(t.location.href=m)}_.readyState=_.DONE,E(),p(m)},C=function(t){return function(){return _.readyState!==_.DONE?t.apply(this,arguments):void 0}},k={create:!0,exclusive:!1};return _.readyState=_.INIT,c||(c="download"),i?(m=n().createObjectURL(e),r.href=m,r.download=c,void setTimeout(function(){o(r),E(),p(m),_.readyState=_.DONE})):(t.chrome&&b&&b!==l&&(v=e.slice||e.webkitSlice,e=v.call(e,0,e.size,l),w=!0),a&&"download"!==c&&(c+=".download"),(b===l||a)&&(y=t),u?(h+=e.size,void u(t.TEMPORARY,h,C(function(t){t.root.getDirectory("saved",k,C(function(t){var n=function(){t.getFile(c,k,C(function(t){t.createWriter(C(function(n){n.onwriteend=function(e){y.location.href=t.toURL(),_.readyState=_.DONE,d(_,"writeend",e),p(t)},n.onerror=function(){var t=n.error;t.code!==t.ABORT_ERR&&x()},"writestart progress write abort".split(" ").forEach(function(t){n["on"+t]=_["on"+t]}),n.write(e),_.abort=function(){n.abort(),_.readyState=_.DONE},_.readyState=_.WRITING}),x)}),x)};t.getFile(c,{create:!1},C(function(t){t.remove(),n()}),C(function(t){t.code===t.NOT_FOUND_ERR?n():x()}))}),x)}),x)):void x())},y=m.prototype,v=function(t,e,n){return new m(t,e,n)};return"undefined"!=typeof navigator&&navigator.msSaveOrOpenBlob?function(t,e,n){return n||(t=g(t)),navigator.msSaveOrOpenBlob(t,e||"download")}:(y.abort=function(){var t=this;t.readyState=t.DONE,d(t,"abort")},y.readyState=y.INIT=0,y.WRITING=1,y.DONE=2,y.error=y.onwritestart=y.onprogress=y.onwrite=y.onabort=y.onerror=y.onwriteend=null,v)}}("undefined"!=typeof self&&self||"undefined"!=typeof window&&window||this.content);"undefined"!=typeof module&&module.exports?module.exports.saveAs=saveAs:"undefined"!=typeof define&&null!==define&&null!=define.amd&&define([],function(){return saveAs}),function(t){if("function"==typeof bootstrap)bootstrap("backboneprojections",t);else if("object"==typeof exports)module.exports=t();else if("function"==typeof define&&define.amd)define(t);else if("undefined"!=typeof ses){if(!ses.ok())return;ses.makeBackboneProjections=t}else"undefined"!=typeof window?window.BackboneProjections=t():global.BackboneProjections=t()}(function(){return function(t,e,n){function r(n,o){if(!e[n]){if(!t[n]){var s="function"==typeof require&&require;if(!o&&s)return s(n,!0);if(i)return i(n,!0);throw new Error("Cannot find module '"+n+"'")}var a=e[n]={exports:{}};t[n][0].call(a.exports,function(e){var i=t[n][1][e];return r(i?i:e)},a,a.exports)}return e[n].exports}for(var i="function"==typeof require&&require,o=0;on?1:n>t?-1:0}),t.slice(0,this.options.cap)},e.prototype.resize=function(t){var e,n,r,i,o;if(this.options.cap>t)for(this.options.cap=t,o=this.models,n=i=o.length-1;i>=0&&(r=o[n],!(t>n));n=i+=-1)this.remove(r);else this.options.cape;e++)t=r[e],i.push(this.decideOn(t));return i},e.prototype.decideOn=function(t){if(this.contains(t)){if(!this.options.filter(t))return this.remove(t)}else if(this.options.filter(t))return this.add(t)},e}(r),n.FilteredCollection=n.Filtered},{backbone:"backbone",underscore:"underscore"}],"lib/sorted.js":[function(t,e,n){var r,i,o={}.hasOwnProperty,s=function(t,e){function n(){this.constructor=t}for(var r in e)o.call(e,r)&&(t[r]=e[r]);return n.prototype=e.prototype,t.prototype=new n,t.__super__=e.prototype,t};r=(("undefined"!=typeof window&&null!==window?window.Backbone:void 0)||t("backbone")).Collection,i=(("undefined"!=typeof window&&null!==window?window._:void 0)||t("underscore")).extend,n.Sorted=function(t){function e(t,n){var r=this;if(null==n&&(n={}),!n.comparator)throw new Error("provide a comparator");this.underlying=t,this.model=t.model,this.comparator=n.comparator,this.options=i({},t.options,n),e.__super__.constructor.call(this,this.underlying.models,n),this.listenTo(this.underlying,{reset:function(){return r.reset(r.underlying.models)},remove:function(t){return r.remove(t)},add:function(t){return r.add(t)}})}return s(e,t),e}(r),n.Reversed=function(t){function e(t,n){null==n&&(n={}),n.comparator=function(e){return-t.indexOf(e)},e.__super__.constructor.call(this,t,n),this.listenTo(this.underlying,{sort:this.sort})}return s(e,t),e}(n.Sorted),n.SortedCollection=n.Sorted,n.ReversedCollection=n.Reversed},{backbone:"backbone",underscore:"underscore"}]},{},["lib/index.js"])("lib/index.js")}),function(){var t=function(t,n){function r(){this.constructor=t}for(var i in n)e.call(n,i)&&(t[i]=n[i]);return r.prototype=n.prototype,t.prototype=new r,t.__super__=n.prototype,t},e={}.hasOwnProperty,n=[].slice,r=[].indexOf||function(t){for(var e=0,n=this.length;n>e;e++)if(e in this&&this[e]===t)return e;return-1};!function(t){var e,n;return n="object"==typeof self&&self.self===self&&self||"object"==typeof global&&global.global===global&&global,"function"==typeof define&&define.amd?define(["backbone"],function(e){return t(n,e)}):"undefined"!=typeof exports?(e=require("backbone"),module.exports=t(n,e)):t(n,n.Backbone)}(function(e,i){var o;return Object.defineProperty(Object.prototype,"setValueOf",{__proto__:null,value:function(t,e){return t.split(".").reduce(function(t,n,r,i){var o;return o=r===i.length-1?e:null!=t[n]?t[n]:"number"===+n?[]:{},t[n]=o},this)}}),i.ViewModel=o=function(e){function i(t,e){var r;this.model=(null!=e?e.model:void 0)||null,r=this._buildMappedAttributes(),i.__super__.constructor.call(this,_.extend({},t,r),e),this.listenTo(this.model,"all",function(){var t;return t=1<=arguments.length?n.call(arguments,0):[],this.trigger.apply(this,t)}),this.proxyMethods(),this.bindEntityEvents()}return t(i,e),i.prototype.proxyMethods=function(){var t,e,n,r,i;if(this.model){for(r=_.result(this,"proxy",{}),i=[],t=0,e=r.length;e>t;t++)n=r[t],i.push(this[n]=this.model[n].bind(this.model));return i}},i.prototype.bindEntityEvents=function(){var t,e,n,r,i,o;e=_.result(this,"events",{}),o=[];for(t in e)i=e[t],_.isFunction(i)?o.push(this.listenTo(this,t,i)):(r=i.split(/\s+/),o.push(function(){var e,i,o;for(o=[],e=0,i=r.length;i>e;e++)n=r[e],this[n]?o.push(this.listenTo(this,t,this[n])):o.push(void 0);return o}.call(this)));return o},i.prototype.sync=function(){},i.prototype.reset=function(){var t,e,n,i;e=_.result(this,"defaults",{}),n=_.result(this,"map",{}),i=_.union(_.keys(e),_.keys(n));for(t in this.attributes)r.call(i,t)<0&&this.unset(t);return this.trigger("reset")},i.prototype.save=function(t,e,n){var r,i;return null==t||"object"==typeof t?(r=t,n=e):(r={})[t]=e,n||(n={}),r&&this.set(r),i=_.reduce(this.attributes,function(t){return function(e,n,r){var i;return i="saveMapped"+r[0].toUpperCase()+r.slice(1),null!=t.map[r]&&_.isFunction(t[i])?_.extend(e,t[i]()):null==t.defaults[r]&&null==t.map[r]&&(e[r]=n),e}}(this),{}),n.wait=!0,n.success=function(t){return function(){return t.trigger("save")}}(this),this.trigger("before:save"),this.model.save(i,n)},i.prototype.destroy=function(t){var e;return e=function(e){return function(){return e.stopListening(),e.trigger("destroy",e,e.collection,t)}}(this),this.model.destroy(_.extend({},t,{wait:!0,success:e}))},i.prototype._buildMappedAttributes=function(){return this.map?Object.keys(this.map).reduce(function(t){return function(e,n){var r,i,o;return o="getMapped"+n[0].toUpperCase()+n.slice(1),_.isFunction(t[o])?(r=t.map[n].split(" "),i=function(e){var i,s,a;return s=_.defaults({},e,{immediate:!0,reset:!0}),i=r.map(function(e){return t.model.get(e)}),a=t[o].apply(t,i),s.immediate&&t.set(n,a,{reset:s.reset}),a},t.listenTo(t,"reset",i),r.map(function(e){return t.listenTo(t.model,"change:"+e,i)}),e[n]=i({immediate:!1}),e):e}}(this),{}):{}},i.prototype.toJSON=function(){return this.model?_.extend(this.model.toJSON(),_.clone(this.attributes)):_.clone(this.attributes)},i.prototype.get=function(t){var e;return null!=this.attributes[t]?this.attributes[t]:null!=(e=this.model)?e.get(t):void 0},i.prototype.set=function(t,e,n){var r,o,s,a;if(null==t)return this;if("object"==typeof t?(o=t,n=e):(o={})[t]=e,n||(n={}),!n.reset)for(r in o)a=o[r],s=a&&_.isObject(a)&&!_.isArray(a),s&&_.isObject(this.attributes[r])&&(o[r]=_.extend({},this.attributes[r],a));return i.__super__.set.call(this,o,n)},i}(i.Model)})}.call(this),function(){var t,e,n=function(t,e){return function(){return t.apply(e,arguments)}};t=function(){function t(){this.processStack=n(this.processStack,this),this.callbackFactory=n(this.callbackFactory,this),this.resume=n(this.resume,this),this.pause=n(this.pause,this);var t,e;try{this.connect()}catch(e){t=e,console.log("Error while connecting to socket.io"),console.log(t.stack)}this.collections=[],this.singlemodels=new Backbone.Collection,this.stack=[],this.ignore=[],this.paused=0}return t.prototype.models={},t.prototype.events=[],t.prototype.shouldFetchCreated=function(t){return!0},t.prototype.onRemoteCreate=function(t){},t.prototype.onRemoteUpdate=function(t,e){},t.prototype.onRemoteDelete=function(t,e){},t.prototype.connect=function(){var t,e,n,r,i,o,s;for(s=window.location.origin,r="/"+window.location.pathname.substring(1)+"socket.io",this.socket=io(s,{path:r,reconnectionDelayMax:6e4,reconectionDelay:2e3,reconnectionAttempts:3}),i=this.events,o=[],e=0,n=i.length;n>e;e++)t=i[e],o.push(this.socket.on(t,this.callbackFactory(t)));return o},t.prototype.watch=function(t){return 0===this.collections.length&&(this.collection=t),this.collections.push(t),t.socketListener=this,this.watchOne(t)},t.prototype.stopWatching=function(t){var e,n,r,i,o;for(o=this.collections,n=r=0,i=o.length;i>r;n=++r)if(e=o[n],e===t)return this.collections.splice(n,1)},t.prototype.watchOne=function(t){return this.singlemodels.add(t),t.on("request",this.pause),t.on("sync",this.resume),t.on("destroy",this.resume),t.on("error",this.resume)},t.prototype.pause=function(t,e,n){var r,i;if(n.ignoreMySocketNotification){if(i=t.isNew()?"create":"update",r=this.getDoctypeOf(t),null==r)return;return this.ignore.push({doctype:r,operation:i,model:t}),this.paused=this.paused+1}},t.prototype.resume=function(t,e,n){
-return n.ignoreMySocketNotification&&(this.paused=this.paused-1,this.paused<=0)?(this.processStack(),this.paused=0):void 0},t.prototype.getDoctypeOf=function(t){var e,n,r;r=this.models;for(n in r)if(e=r[n],t instanceof e)return n},t.prototype.cleanStack=function(){var t,e,n,r,i,o;for(e=0,r=[];e0;)t.push(this.process(this.stack.shift()));return t},t.prototype.process=function(t){var e,n,r,i;switch(e=t.doctype,i=t.operation,n=t.id,i){case"create":if(!this.shouldFetchCreated(n))return;return r=new this.models[e]({id:n}),r.fetch({success:function(t){return function(e){return t.onRemoteCreate(e)}}(this)});case"update":return(r=this.singlemodels.get(n))&&r.fetch({success:function(t){return function(e){return e.changedAttributes()?t.onRemoteUpdate(e,null):void 0}}(this)}),this.collections.forEach(function(t){return function(e){return(r=e.get(n))?r.fetch({success:function(n){return n.changedAttributes()?t.onRemoteUpdate(n,e):void 0}}):void 0}}(this));case"delete":return(r=this.singlemodels.get(n))&&this.onRemoteDelete(r,this.singlemodels),this.collections.forEach(function(t){return function(e){return(r=e.get(n))?t.onRemoteDelete(r,e):void 0}}(this))}},t}(),e=("undefined"!=typeof module&&null!==module?module.exports:void 0)||window,e.CozySocketListener=t}.call(this),function(){var t,e,n,r,i,o,s,a,u,c,l,h,f,p,d,g,m,y,v,_,b,w,E,x,C,k,A,T,S,D,M,O,F=[].indexOf||function(t){for(var e=0,n=this.length;n>e;e++)if(e in this&&this[e]===t)return e;return-1},R=[].slice;("undefined"!=typeof module&&null!==module?module.exports:void 0)?(O=require("utf8"),D=require("quoted-printable")):(O=window.utf8,D=window.quotedPrintable),M={begin:/^BEGIN:VCARD$/i,end:/^END:VCARD$/i,beginNonVCard:/^BEGIN:(.*)$/i,endNonVCard:/^END:(.*)$/i,simple:/^(version|fn|n|title|org|note|categories|bday|url|nickname|uid|tz|lang|geo|gender|kind)(;CHARSET=UTF-8)?(;ENCODING=QUOTED-PRINTABLE)?\:(.+)$/i,composedkey:/^item(\d{1,2})\.([^\:]+):(.+)$/,complex:/^([^\:\;]+);([^\:]+)\:(.+)$/,property:/^(.+)=(.+)$/,extended:/^X-([^\:]+)\:(.+)$/i,applebday:/^(version|fn|n|title|org|note|categories|bday|url);value=date:(.+)$/i,android:/^x-android-custom\:(.+)$/i},r=["skype","skype-username","aim","msn","yahoo","qq","google-talk","gtalk","icq","jabber","sip","gad"],i=["aim","jabber","msn","yahoo","icq"],a=["phonetic-first-name","phonetic-middle-name","phonetic-last-name"],t=["custom","assistant","brother","child","domestic partner","father","friend","manager","mother","parent","partner","referred by","relative","sister","spouse"],e=["fn","bday","org","title","url","note","nickname","uid"],n=["tz","lang","geo","gender","kind"],u={twitter:"http://twitter.com/",facebook:"http://facebook.com/",flickr:"http://www.flickr.com/photos/",linkedin:"http://www.linkedin.com/in/",myspace:"http://www.myspace.com/",sina:"http://weibo.com/n/"},s={msn:"MSN:msnim",skype:"Skype:skype","google-talk":"GoogleTalk:xmpp",googletalk:"GoogleTalk:xmpp",gtalk:"GoogleTalk:xmpp",facebook:"Facebook:xmpp",aim:"AIM:aim",yahoo:"Yahoo:aim",icq:"ICQ:aim",jabber:"Jabber:xmpp",qq:"QQ:x-apple",gadugadu:"GaduGadu:x-apple"},o={msn:"MSN",skype:"Skype","google-talk":"GoogleTalk",googletalk:"GoogleTalk",gtalk:"GoogleTalk",facebook:"Facebook",aim:"AIM",yahoo:"Yahoo:",icq:"ICQ",jabber:"Jabber",qq:"QQ",gadugadu:"GaduGadu"},S=function(t){var e,n,r,i,o;return r=/^(\d{4})[-\/](\d{2})[-\/](\d{2})$/.exec(t),null===r?!1:(o=parseInt(r[1]),n=parseInt(r[2]-1),e=parseInt(r[3]),t=new Date(o,n,e),i=t.getDate()===e,i=i&&t.getMonth()===n,i=i&&t.getFullYear()===o)},l=function(t){return""+t.charAt(0).toUpperCase()+t.toLowerCase().slice(1)},T=function(e,n,r){var i,o,s;if(n=n.toLowerCase().replace("_"," "),"anniversary"===n)i=1;else if("died"===n)i=2;else{for(i=0,o=t.length;o>i&&t[i]!==n;)i++;i===o&&(n=null)}return n?(s="X-ANDROID-CUSTOM:vnd.android.cursor.item/",""+s+e+";"+r+";"+i+";;;;;;;;;;;;;"):null},c=function(){function i(t){this.reset(),t&&this.read(t)}return i.prototype.reset=function(){return this.contacts=[],this.currentContact=null,this.currentDatapoint=null,this.currentIndex=null,this.currentVersion="3.0"},i.prototype.storeCurrentDatapoint=function(){return this.currentDatapoint?(this.currentContact.datapoints.push(this.currentDatapoint),this.currentDatapoint=null):void 0},i.prototype.addDatapoint=function(t,e,n){return this.storeCurrentDatapoint(),this.currentContact.datapoints.push({name:t,type:e,value:n})},i.prototype.addTypeProperty=function(t,e){return null!=t.type&&"internet"!==t.type?t.type=t.type+" "+e:t.type=e},i.prototype.storeCurrentContact=function(){var t;return null==this.currentContact.n&&null==this.currentContact.fn&&console.error("There should be at least a N field or a FN field"),(null==this.currentContact.n||""===(t=this.currentContact.n)||";;;;"===t)&&(this.currentContact.n=i.fnToN(this.currentContact.fn).join(";")),(null==this.currentContact.fn||""===this.currentContact.fn)&&(this.currentContact.fn=i.nToFN(this.currentContact.n)),this.contacts.push(this.currentContact)},i.prototype.read=function(t){var e,n,r,i,o;for(i=this.splitLines(t),o=[],e=0,n=i.length;n>e;e++)r=i[e],o.push(this.handleLine(r));return o},i.prototype.splitLines=function(t){var e,n,r;return r=t.split(/\r?\n/),n=[],e=!1,r.forEach(function(t){var r;return null!=t&&""!==t?" "===t[0]||e?(" "===t[0]&&(t=t.slice(1)),e&&("="===t[t.length-1]?t=t.slice(0,-1):e=!1),r=n.length-1,r>=0?n[r]=n[r]+t:n.push(t)):(/^(.+)ENCODING=QUOTED-PRINTABLE(.+)=$/i.test(t)&&(e=!0,t=t.slice(0,-1)),n.push(t)):void 0}),n},i.prototype.handleLine=function(t){if(this.nonVCard){if(M.endNonVCard.test(t)&&t.match(M.endNonVCard)[1]===this.nonVCard)return this.nonVCard=!1}else{if(M.begin.test(t))return this.currentContact={datapoints:[]};if(M.beginNonVCard.test(t))return this.nonVCard=t.match(M.beginNonVCard)[1];if(M.end.test(t))return this.storeCurrentDatapoint(),this.storeCurrentContact();if(M.simple.test(t))return this.handleSimpleLine(t);if(M.applebday.test(t))return this.handleSimpleLine(t,!0);if(M.android.test(t))return this.handleAndroidLine(t);if(M.extended.test(t))return this.handleExtendedLine(t);if(M.composedkey.test(t))return this.handleComposedLine(t);if(M.complex.test(t))return this.handleComplexLine(t)}},i.prototype.handleSimpleLine=function(t,r){var o,s,a,u,c,l,h,f,p,d;return null==r&&(r=!1),r?(l=t.match(M.applebday),o=l[0],s=l[1],p=l[2]):(h=t.match(M.simple),o=h[0],s=h[1],f=h[2],c=h[3],p=h[4]),null!=c&&(p=i.unquotePrintable(p)),p=i.unescapeText(p),s=s.toLowerCase(),"version"===s?this.currentversion=p:"rev"===s?this.currentContact.revision=p:"categories"===s?this.currentContact.tags=p.split(/(?!\\),/).map(i.unescapeText):"n"===s?(a=p.split(/(?!\\);/),5===a.length?this.currentContact.n=p:(u=["","","","",""],a.length<=5?a.forEach(function(t,e){return u[e]=t}):6===a.length?(u.push(""),a.forEach(function(t,e){return u[e]=t})):u[2]=a.join(" "),this.currentContact.n=u.join(";"))):F.call(e,s)>=0?"org"===s?(d=p.split(";"),2===d.length?(this.currentContact.org=d[0],this.currentContact.department=d[1]):this.currentContact.org=p):this.currentContact[s.toLowerCase()]=p:F.call(n,s)>=0?this.currentContact[s.toLowerCase()]=p:void 0},i.prototype.handleExtendedLine=function(t){var e,n,i,o,s,u,c,l,h,f,p,d,g;if(l=t.match(M.extended),e=l[0],o=l[1],g=l[2],null!=o){if(o=o.toLowerCase(),F.call(r,o)>=0)return this.currentContact.datapoints.push({name:"chat",type:o,value:g});if(F.call(a,o)>=0)return o=o.replace(/-/g," "),this.currentContact.datapoints.push({name:"about",type:o,value:g});if(0===o.indexOf("socialprofile")){for(s=o.split(";"),n={},i=0,c=s.length;c>i;i++)u=s[i],h=u.split("="),n[h[0].replace("x-","")]=h[1];if(n.user||(n.user=g),n.type&&n.user)return f=n.type,p=n.user,this.currentContact.datapoints.push({name:"social",type:f,value:p})}else if("activity-alert"===o)return d=g.split(","),d.length>1&&(f=d.splice(0,1)[0],f=f.split("=")[1].replace(/\\/g,""),g=d.join(",")),this.currentContact.datapoints.push({name:"alerts",type:f,value:g})}},i.prototype.handleAndroidLine=function(e){var n,r,i,o,s,a,u;switch(o=e.match(M.android),n=o[0],i=o[1],r=i.split(";"),r[0].replace("vnd.android.cursor.item/","")){case"contact_event":return u=r[1],a="0"===(s=r[2])||"2"===s?r[3]:"1"===r[2]?"anniversary":"birthday",this.currentContact.datapoints.push({name:"about",type:a,value:u});case"relation":return u=r[1],a=t[+r[2]],"custom"===a&&(a=r[3]),this.currentContact.datapoints.push({name:"relation",type:a,value:u});case"nickname":return u=r[1],this.currentContact.nickname=u}},i.prototype.handleCurrentSpecialCases=function(){var t,e,n;return t=this.currentDatapoint,e=null!=t?t.type:void 0,F.call(r,e)>=0&&(t.name="chat",null!=t["x-service-type"]&&(t.value=t.value.split(":")[1],n=t["x-service-type"],F.call(r,n)<0&&(t.type=t["x-service-type"]))),"impp"===(null!=t?t.name:void 0)?(t.name="chat",t.value=t.value.split(":")[1]):void 0},i.prototype.handleComposedLine=function(t){var e,n,r,o,s,a,u;return a=t.match(M.composedkey),e=a[0],n=a[1],o=a[2],u=a[3],null!==this.currentIndex&&this.currentIndex===n&&this.currentDatapoint||(this.handleCurrentSpecialCases(),this.storeCurrentDatapoint(),this.currentDatapoint={}),this.currentIndex=n,o=o.split(";"),r=o[0],s=o.splice(1),u=u.split(";"),1===u.length&&(u=u[0].replace("_$!<","").replace(">!$_","").replace("\\:",":")),r=r.toLowerCase(),"x-ablabel"===r||"x-abadr"===r?this.addTypeProperty(this.currentDatapoint,u.toLowerCase()):(this.handleProperties(this.currentDatapoint,s),"x-abdate"===r&&(r="about"),"x-abrelatednames"===r&&(r="relation"),"adr"===r&&(u=Array.isArray(u)?u.map(i.unescapeText):["","",i.unescapeText(u),"","","",""]),this.currentDatapoint.name=r.toLowerCase(),this.currentDatapoint.value=u)},i.prototype.handleComplexLine=function(t){var e,n,r,o,s,a;return o=t.match(M.complex),e=o[0],n=o[1],r=o[2],a=o[3],this.storeCurrentDatapoint(),this.currentDatapoint={},a=a.split(";"),1===a.length&&(a=a[0]),n=n.toLowerCase(),"photo"===n?(this.currentContact.photo=a,this.currentDatapoint=null):"email"===(s=!n)||"tel"===s||"adr"===s||"url"===s?this.currentDatapoint=null:(this.currentDatapoint.name=n,"adr"===n&&(a=Array.isArray(a)?a.map(i.unescapeText):["","",i.unescapeText(a),"","","",""]),this.handleProperties(this.currentDatapoint,r.split(";")),"quoted-printable"===this.currentDatapoint.encoding&&(a=Array.isArray(a)?a.map(i.unquotePrintable):i.unquotePrintable(a),delete this.currentDatapoint.encoding),this.currentDatapoint.value=a)},i.prototype.handleProperties=function(t,e){var n,r,i,o,s,a,u,c,l;for(l=[],r=0,i=e.length;i>r;r++)u=e[r],(o=u.match(M.property))?(n=o[0],s=o[1],c=o[2],c=c.toLowerCase(),a=t[s.toLowerCase()],null!=a&&"internet"!==a&&(c=a+" "+c)):"PREF"===u?(s="pref",c=!0,null!=t.type?t.type=t.type+" "+u.toLowerCase():t.type=u.toLowerCase()):(s="type",c=null!=t.type?t.type+" "+u.toLowerCase():u.toLowerCase()),"type"===s&&"pref"===c&&(s="pref",c=!0),l.push(t[s.toLowerCase()]=c);return l},i}(),c.unquotePrintable=function(t){var e,n;t=t||"";try{return O.decode(D.decode(t))}catch(n){return e=n,t}},c.escapeText=function(t){var e;return null==t?t:(e=t.replace(/([,;\\])/gi,"\\$1"),e=e.replace(/\n/g,"\\n"))},c.unescapeText=function(t){var e;return null==t?t:(e=t.replace(/\\n/gi,"\n"),e=e.replace(/\\([,;\\])/gi,"$1"))},c.toVCF=function(t,e,n){var r,i,o,s,a,u,l,T,S,D,M,O,F,R,j;null==e&&(e=null),null==n&&(n="google"),a=0,D=["BEGIN:VCARD"],D.push("VERSION:3.0"),k(D,t),null!=t.revision&&E(D,t),null!=t.n&&v(D,t),d(D,t),y(D,t),null!=t.tags&&t.tags.length>0&&C(D,t),M=t.datapoints;for(s in M)if(i=M[s],null!=i.name&&null!=i.value){if(l=i.name.toUpperCase(),F=(null!=(O=i.type)?O.toUpperCase():void 0)||null,j=i.value,j=Array.isArray(j)?j.map(c.escapeText):c.escapeText(j),o="",null!=F)for(R=F.split(" "),u=0,T=R.length;T>u;u++)r=R[u],o+=";TYPE="+r;switch(S={out:D,type:F,formattedType:o,value:j,mode:n,itemCounter:a,key:l},l){case"ABOUT":a=h(S);break;case"OTHER":a=_(S);break;case"CHAT":a=g(S);break;case"URL":a=A(S);break;case"RELATION":a=w(S);break;case"ADR":a=f(S);break;case"SOCIAL":a=x(S);break;case"ALERTS":a=p(S);break;default:a=m(S)}}return null!=e&&b(D,e),D.push("END:VCARD"),D.join("\n")+"\n"},k=function(t,e){var n,r;return r=e.carddavuri,n=(null!=r?r.substring(0,r.length-4):void 0)||e.id,null!=n?t.push("UID:"+n):void 0},d=function(t,n){var r,i,o,s,a,u;for(a=[],i=0,o=e.length;o>i;i++)s=e[i],u=n[s],u&&(u=c.escapeText(u)),"org"===s&&null!=n.department&&n.department.length>0&&(r=c.escapeText(n.department),u=u+";"+r),u?a.push(t.push(s.toUpperCase()+":"+u)):a.push(void 0);return a},y=function(t,e){var r,i,o,s,a;for(s=[],r=0,i=n.length;i>r;r++)o=n[r],a=e[o],a&&(a=c.escapeText(a)),a?s.push(t.push(o.toUpperCase()+":"+a)):s.push(void 0);return s},v=function(t,e){return t.push("N:"+e.n)},E=function(t,e){return"date"==typeof e.revision?t.push("REV:"+e.revision.toISOString()):t.push("REV:"+e.revision)},C=function(t,e){var n;return n=e.tags.map(c.escapeText).join(","),t.push("CATEGORIES:"+n)},h=function(t){var e,n,r,i,o,s;return i=t.out,o=t.type,e=t.formattedType,s=t.value,r=t.mode,n=t.itemCounter,"DIED"===o||"ANNIVERSARY"===o?"android"===r?i.push(T("contact_event",o,s)):(n++,i.push("item"+n+".X-ABDATE:"+s),e=l(o),i.push("item"+n+".X-ABLabel:"+e)):0===o.indexOf("PHONETIC")?i.push("X-"+o.replace(/\s/g,"-")+":"+s):S(s)?(n++,i.push("item"+n+".X-ABDATE:"+s),e=l(o),i.push("item"+n+".X-ABLabel:"+e)):i.push("X-"+o+":"+s),n},_=function(t){var e,n,r,i,o,s;return i=t.out,o=t.type,e=t.formattedType,s=t.value,r=t.mode,n=t.itemCounter,i.push("X-EVENT"+e+":"+s),n},g=function(t){var e,n,r,i,o,a,u,c;return o=t.out,u=t.type,e=t.formattedType,c=t.value,i=t.mode,n=t.itemCounter,"SKYPE"===u&&"android"===i?o.push("X-SKYPE-USERNAME:"+c):"ios"===i?(n++,a=s[u.toLowerCase()],null!=a?(r="item"+n+".IMPP;",r+="X-SERVICE-TYPE="+a+":"+c,o.push(r)):(u=l(u.toLowerCase()),r="item"+n+".IMPP;",r+="X-SERVICE-TYPE="+u+":x-apple:"+c,o.push(r))):o.push("X-"+u+":"+c),n},A=function(t){var e,n,r,i,o,s;return i=t.out,o=t.type,e=t.formattedType,s=t.value,r=t.mode,n=t.itemCounter,null!=o?(n++,i.push("item"+n+".URL:"+s),"PROFILE"!==o&&"BLOG"!==o?(e=l(o.toLowerCase()),("ios"!==r||"HOME"!==o&&"WORK"!==o&&"OTHER"!==o)&&"ios"===r?i.push("item"+n+".X-ABLabel:"+e):i.push("item"+n+".X-ABLabel:_$!<"+e+">!$_")):i.push("item"+n+".X-ABLabel:"+o)):i.push("URL:"+s),n},w=function(t){var e,n,r,i,o,s,a;return o=t.out,s=t.type,e=t.formattedType,a=t.value,i=t.mode,n=t.itemCounter,"android"===i?(r=T("relation",s,a),r&&o.push(r)):(n++,o.push("item"+n+".X-ABRELATEDNAMES:"+a),e=l(s.toLowerCase()),o.push("item"+n+".X-ABLabel:_$!<"+e+">!$_")),n},f=function(t){var e,n,r,i,o,s,a;return o=t.out,s=t.type,e=t.formattedType,a=t.value,i=t.mode,n=t.itemCounter,r=t.key,Array.isArray(a)&&(a=a.join(";")),o.push(""+r+e+":"+a),n},x=function(t){var e,n,r,i,o,s,a,c,h,f;return o=t.out,a=t.type,e=t.formattedType,f=t.value,i=t.mode,n=t.itemCounter,r=t.key,c=f,h=u[a.toLowerCase()],null!=h?c=""+h+f:(e=l(a.toLowerCase()),e=";TYPE="+e),s="X-SOCIALPROFILE"+e+";x-user="+f+":"+c,o.push(s),n},p=function(t){var e,n,r,i,o,s,a,u;return o=t.out,a=t.type,e=t.formattedType,u=t.value,i=t.mode,n=t.itemCounter,r=t.key,a=a.toLowerCase(),u=u.replace(/\\\\\\/g,"\\"),s="X-ACTIVITY-ALERT:type="+a+"\\,"+u,o.push(s),n},m=function(t){var e,n,r,i,o,s,a;return o=t.out,s=t.type,e=t.formattedType,a=t.value,i=t.mode,n=t.itemCounter,r=t.key,o.push(""+r+e+":"+a),n},b=function(t,e){var n,r;return n=e.match(/.{1,75}/g).join("\n "),r="PHOTO;ENCODING=B;TYPE=JPEG;VALUE=BINARY:\n "+n,t.push(r)},c.nToFN=function(t){var e,n,r,i,o,s;return t=t||[],e=t[0],n=t[1],r=t[2],o=t[3],s=t[4],i=[o,n,r,e,s],i=i.filter(function(t){return null!=t&&""!==t}),i.join(" ")},c.fnToN=function(t){return t=t||"",["",t,"","",""]},c.fnToNLastnameNFirstname=function(t){var e,n,r,i,o,s;return t=t||"",s=t.split(" "),n=s[0],i=3<=s.length?R.call(s,1,r=s.length-1):(r=1,[]),e=s[r++],o=[e,n,i.join(" "),"",""]},c.adrArrayToString=function(t){var e,n,r,i;return t=t||[],i=function(t){return t=t.filter(function(t){return null!=t&&""!==t}),t.join(", ")},r=i(t.slice(0,3)),e=i(t.slice(3,7)),n=r,""!==e&&(n+="\n"+e),n},c.adrStringToArray=function(t){return t=t||"",["","",t,"","","",""]},("undefined"!=typeof module&&null!==module?module.exports:void 0)?module.exports=c:window.VCardParser=c}.call(this),function(){var t;t={AA:/[\uA732]/g,A:/[\u0041\u24B6\uFF21\u00C0\u00C1\u00C2\u1EA6\u1EA4\u1EAA\u1EA8\u00C3\u0100\u0102\u1EB0\u1EAE\u1EB4\u1EB2\u0226\u01E0\u00C4\u01DE\u1EA2\u00C5\u01FA\u01CD\u0200\u0202\u1EA0\u1EAC\u1EB6\u1E00\u0104\u023A\u2C6F]/g,AE:/[\u00C6\u01FC\u01E2]/g,AO:/[\uA734]/g,AU:/[\uA736]/g,AV:/[\uA738\uA73A]/g,AY:/[\uA73C]/g,B:/[\u0042\u24B7\uFF22\u1E02\u1E04\u1E06\u0243\u0182\u0181]/g,C:/[\u0043\u24B8\uFF23\u0106\u0108\u010A\u010C\u00C7\u1E08\u0187\u023B\uA73E]/g,D:/[\u0044\u24B9\uFF24\u1E0A\u010E\u1E0C\u1E10\u1E12\u1E0E\u0110\u018B\u018A\u0189\uA779]/g,DZ:/[\u01F1\u01C4]/g,Dz:/[\u01F2\u01C5]/g,E:/[\u0045\u24BA\uFF25\u00C8\u00C9\u00CA\u1EC0\u1EBE\u1EC4\u1EC2\u1EBC\u0112\u1E14\u1E16\u0114\u0116\u00CB\u1EBA\u011A\u0204\u0206\u1EB8\u1EC6\u0228\u1E1C\u0118\u1E18\u1E1A\u0190\u018E]/g,F:/[\u0046\u24BB\uFF26\u1E1E\u0191\uA77B]/g,G:/[\u0047\u24BC\uFF27\u01F4\u011C\u1E20\u011E\u0120\u01E6\u0122\u01E4\u0193\uA7A0\uA77D\uA77E]/g,H:/[\u0048\u24BD\uFF28\u0124\u1E22\u1E26\u021E\u1E24\u1E28\u1E2A\u0126\u2C67\u2C75\uA78D]/g,I:/[\u0049\u24BE\uFF29\u00CC\u00CD\u00CE\u0128\u012A\u012C\u0130\u00CF\u1E2E\u1EC8\u01CF\u0208\u020A\u1ECA\u012E\u1E2C\u0197]/g,J:/[\u004A\u24BF\uFF2A\u0134\u0248]/g,K:/[\u004B\u24C0\uFF2B\u1E30\u01E8\u1E32\u0136\u1E34\u0198\u2C69\uA740\uA742\uA744\uA7A2]/g,L:/[\u004C\u24C1\uFF2C\u013F\u0139\u013D\u1E36\u1E38\u013B\u1E3C\u1E3A\u0141\u023D\u2C62\u2C60\uA748\uA746\uA780]/g,LJ:/[\u01C7]/g,Lj:/[\u01C8]/g,M:/[\u004D\u24C2\uFF2D\u1E3E\u1E40\u1E42\u2C6E\u019C]/g,N:/[\u004E\u24C3\uFF2E\u01F8\u0143\u00D1\u1E44\u0147\u1E46\u0145\u1E4A\u1E48\u0220\u019D\uA790\uA7A4]/g,NJ:/[\u01CA]/g,Nj:/[\u01CB]/g,O:/[\u004F\u24C4\uFF2F\u00D2\u00D3\u00D4\u1ED2\u1ED0\u1ED6\u1ED4\u00D5\u1E4C\u022C\u1E4E\u014C\u1E50\u1E52\u014E\u022E\u0230\u00D6\u022A\u1ECE\u0150\u01D1\u020C\u020E\u01A0\u1EDC\u1EDA\u1EE0\u1EDE\u1EE2\u1ECC\u1ED8\u01EA\u01EC\u00D8\u01FE\u0186\u019F\uA74A\uA74C]/g,OE:/[\u0152]/g,OI:/[\u01A2]/g,OO:/[\uA74E]/g,OU:/[\u0222]/g,P:/[\u0050\u24C5\uFF30\u1E54\u1E56\u01A4\u2C63\uA750\uA752\uA754]/g,Q:/[\u0051\u24C6\uFF31\uA756\uA758\u024A]/g,R:/[\u0052\u24C7\uFF32\u0154\u1E58\u0158\u0210\u0212\u1E5A\u1E5C\u0156\u1E5E\u024C\u2C64\uA75A\uA7A6\uA782]/g,S:/[\u0053\u24C8\uFF33\u1E9E\u015A\u1E64\u015C\u1E60\u0160\u1E66\u1E62\u1E68\u0218\u015E\u2C7E\uA7A8\uA784]/g,T:/[\u0054\u24C9\uFF34\u1E6A\u0164\u1E6C\u021A\u0162\u1E70\u1E6E\u0166\u01AC\u01AE\u023E\uA786]/g,TZ:/[\uA728]/g,U:/[\u0055\u24CA\uFF35\u00D9\u00DA\u00DB\u0168\u1E78\u016A\u1E7A\u016C\u00DC\u01DB\u01D7\u01D5\u01D9\u1EE6\u016E\u0170\u01D3\u0214\u0216\u01AF\u1EEA\u1EE8\u1EEE\u1EEC\u1EF0\u1EE4\u1E72\u0172\u1E76\u1E74\u0244]/g,V:/[\u0056\u24CB\uFF36\u1E7C\u1E7E\u01B2\uA75E\u0245]/g,VY:/[\uA760]/g,W:/[\u0057\u24CC\uFF37\u1E80\u1E82\u0174\u1E86\u1E84\u1E88\u2C72]/g,X:/[\u0058\u24CD\uFF38\u1E8A\u1E8C]/g,Y:/[\u0059\u24CE\uFF39\u1EF2\u00DD\u0176\u1EF8\u0232\u1E8E\u0178\u1EF6\u1EF4\u01B3\u024E\u1EFE]/g,Z:/[\u005A\u24CF\uFF3A\u0179\u1E90\u017B\u017D\u1E92\u1E94\u01B5\u0224\u2C7F\u2C6B\uA762]/g,a:/[\u0061\u24D0\uFF41\u1E9A\u00E0\u00E1\u00E2\u1EA7\u1EA5\u1EAB\u1EA9\u00E3\u0101\u0103\u1EB1\u1EAF\u1EB5\u1EB3\u0227\u01E1\u00E4\u01DF\u1EA3\u00E5\u01FB\u01CE\u0201\u0203\u1EA1\u1EAD\u1EB7\u1E01\u0105\u2C65\u0250]/g,aa:/[\uA733]/g,ae:/[\u00E6\u01FD\u01E3]/g,ao:/[\uA735]/g,au:/[\uA737]/g,av:/[\uA739\uA73B]/g,ay:/[\uA73D]/g,b:/[\u0062\u24D1\uFF42\u1E03\u1E05\u1E07\u0180\u0183\u0253]/g,c:/[\u0063\u24D2\uFF43\u0107\u0109\u010B\u010D\u00E7\u1E09\u0188\u023C\uA73F\u2184]/g,d:/[\u0064\u24D3\uFF44\u1E0B\u010F\u1E0D\u1E11\u1E13\u1E0F\u0111\u018C\u0256\u0257\uA77A]/g,dz:/[\u01F3\u01C6]/g,e:/[\u0065\u24D4\uFF45\u00E8\u00E9\u00EA\u1EC1\u1EBF\u1EC5\u1EC3\u1EBD\u0113\u1E15\u1E17\u0115\u0117\u00EB\u1EBB\u011B\u0205\u0207\u1EB9\u1EC7\u0229\u1E1D\u0119\u1E19\u1E1B\u0247\u025B\u01DD]/g,f:/[\u0066\u24D5\uFF46\u1E1F\u0192\uA77C]/g,g:/[\u0067\u24D6\uFF47\u01F5\u011D\u1E21\u011F\u0121\u01E7\u0123\u01E5\u0260\uA7A1\u1D79\uA77F]/g,h:/[\u0068\u24D7\uFF48\u0125\u1E23\u1E27\u021F\u1E25\u1E29\u1E2B\u1E96\u0127\u2C68\u2C76\u0265]/g,hv:/[\u0195]/g,i:/[\u0069\u24D8\uFF49\u00EC\u00ED\u00EE\u0129\u012B\u012D\u00EF\u1E2F\u1EC9\u01D0\u0209\u020B\u1ECB\u012F\u1E2D\u0268\u0131]/g,j:/[\u006A\u24D9\uFF4A\u0135\u01F0\u0249]/g,k:/[\u006B\u24DA\uFF4B\u1E31\u01E9\u1E33\u0137\u1E35\u0199\u2C6A\uA741\uA743\uA745\uA7A3]/g,l:/[\u006C\u24DB\uFF4C\u0140\u013A\u013E\u1E37\u1E39\u013C\u1E3D\u1E3B\u017F\u0142\u019A\u026B\u2C61\uA749\uA781\uA747]/g,lj:/[\u01C9]/g,m:/[\u006D\u24DC\uFF4D\u1E3F\u1E41\u1E43\u0271\u026F]/g,n:/[\u006E\u24DD\uFF4E\u01F9\u0144\u00F1\u1E45\u0148\u1E47\u0146\u1E4B\u1E49\u019E\u0272\u0149\uA791\uA7A5]/g,nj:/[\u01CC]/g,o:/[\u006F\u24DE\uFF4F\u00F2\u00F3\u00F4\u1ED3\u1ED1\u1ED7\u1ED5\u00F5\u1E4D\u022D\u1E4F\u014D\u1E51\u1E53\u014F\u022F\u0231\u00F6\u022B\u1ECF\u0151\u01D2\u020D\u020F\u01A1\u1EDD\u1EDB\u1EE1\u1EDF\u1EE3\u1ECD\u1ED9\u01EB\u01ED\u00F8\u01FF\u0254\uA74B\uA74D\u0275]/g,oe:/[\u0153]/g,oi:/[\u01A3]/g,ou:/[\u0223]/g,oo:/[\uA74F]/g,p:/[\u0070\u24DF\uFF50\u1E55\u1E57\u01A5\u1D7D\uA751\uA753\uA755]/g,q:/[\u0071\u24E0\uFF51\u024B\uA757\uA759]/g,r:/[\u0072\u24E1\uFF52\u0155\u1E59\u0159\u0211\u0213\u1E5B\u1E5D\u0157\u1E5F\u024D\u027D\uA75B\uA7A7\uA783]/g,s:/[\u0073\u24E2\uFF53\u00DF\u015B\u1E65\u015D\u1E61\u0161\u1E67\u1E63\u1E69\u0219\u015F\u023F\uA7A9\uA785\u1E9B]/g,t:/[\u0074\u24E3\uFF54\u1E6B\u1E97\u0165\u1E6D\u021B\u0163\u1E71\u1E6F\u0167\u01AD\u0288\u2C66\uA787]/g,tz:/[\uA729]/g,u:/[\u0075\u24E4\uFF55\u00F9\u00FA\u00FB\u0169\u1E79\u016B\u1E7B\u016D\u00FC\u01DC\u01D8\u01D6\u01DA\u1EE7\u016F\u0171\u01D4\u0215\u0217\u01B0\u1EEB\u1EE9\u1EEF\u1EED\u1EF1\u1EE5\u1E73\u0173\u1E77\u1E75\u0289]/g,v:/[\u0076\u24E5\uFF56\u1E7D\u1E7F\u028B\uA75F\u028C]/g,vy:/[\uA761]/g,w:/[\u0077\u24E6\uFF57\u1E81\u1E83\u0175\u1E87\u1E85\u1E98\u1E89\u2C73]/g,x:/[\u0078\u24E7\uFF58\u1E8B\u1E8D]/g,y:/[\u0079\u24E8\uFF59\u1EF3\u00FD\u0177\u1EF9\u0233\u1E8F\u00FF\u1EF7\u1E99\u1EF5\u01B4\u024F\u1EFF]/g,z:/[\u007A\u24E9\uFF5A\u017A\u1E91\u017C\u017E\u1E93\u1E95\u01B6\u0225\u0240\u2C6C\uA763]/},String.prototype.toAscii=function(){var e;return e=this.match(/[a-zA-Z\s]/g),e&&e.length!==this.length?Object.keys(t).reduce(function(e,n){return e.replace(t[n],n)},this):this.slice()}}.call(this),function(t){"function"==typeof define&&define.amd?define(["underscore","backbone"],t):"object"==typeof exports?module.exports=t(require("underscore"),require("backbone")):t(_,Backbone)}(function(t,e){return e.SubRoute=e.Router.extend({constructor:function(n,r){this.routes=t.clone(this.routes)||{},this.prefix=n=n||"",this.separator="/"===n.slice(-1)?"":"/",this.createTrailingSlashRoutes=r&&r.createTrailingSlashRoutes,e.Router.prototype.constructor.call(this,r);var i;i=e.history.fragment?e.history.getFragment(e.history.fragment):e.history.getHash(),t.every(this.routes,function(t,n){return i.match(e.Router.prototype._routeToRegExp(n))?(e.history.loadUrl(i),!1):!0},this),this.postInitialize&&this.postInitialize(r)},navigate:function(t,n){"/"!=t.substr(0,1)&&0!==t.indexOf(this.prefix.substr(0,this.prefix.length-1))&&(t=this.prefix+(t?this.separator:"")+t),e.Router.prototype.navigate.call(this,t,n)},route:function(t,n,r){"/"===t.substr(0)&&(t=t.substr(1,t.length));var i=this.prefix;return t&&t.length>0&&(this.prefix.length>0&&(i+=this.separator),i+=t),this.createTrailingSlashRoutes&&(this.routes[i+"/"]=n,e.Router.prototype.route.call(this,i+"/",n,r)),delete this.routes[t],this.routes[i]=n,e.Router.prototype.route.call(this,i,n,r)}}),e.SubRoute}),!function(t){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=t();else if("function"==typeof define&&define.amd)define([],t);else{var e;"undefined"!=typeof window?e=window:"undefined"!=typeof global?e=global:"undefined"!=typeof self&&(e=self),e.io=t()}}(function(){var t;return function e(t,n,r){function i(s,a){if(!n[s]){if(!t[s]){var u="function"==typeof require&&require;if(!a&&u)return u(s,!0);if(o)return o(s,!0);throw new Error("Cannot find module '"+s+"'")}var c=n[s]={exports:{}};t[s][0].call(c.exports,function(e){var n=t[s][1][e];return i(n?n:e)},c,c.exports,e,t,n,r)}return n[s].exports}for(var o="function"==typeof require&&require,s=0;s0&&!this.encoding){var t=this.packetBuffer.shift();this.packet(t)}},r.prototype.cleanup=function(){for(var t;t=this.subs.shift();)t.destroy();this.packetBuffer=[],this.encoding=!1,this.decoder.destroy()},r.prototype.close=r.prototype.disconnect=function(){this.skipReconnect=!0,this.backoff.reset(),this.readyState="closed",this.engine&&this.engine.close()},r.prototype.onclose=function(t){l("close"),this.cleanup(),this.backoff.reset(),this.readyState="closed",this.emit("close",t),this._reconnection&&!this.skipReconnect&&this.reconnect()},r.prototype.reconnect=function(){if(this.reconnecting||this.skipReconnect)return this;var t=this;if(this.backoff.attempts>=this._reconnectionAttempts)l("reconnect failed"),this.backoff.reset(),this.emitAll("reconnect_failed"),this.reconnecting=!1;else{var e=this.backoff.duration();l("will wait %dms before reconnect attempt",e),this.reconnecting=!0;var n=setTimeout(function(){t.skipReconnect||(l("attempting reconnect"),t.emitAll("reconnect_attempt",t.backoff.attempts),t.emitAll("reconnecting",t.backoff.attempts),t.skipReconnect||t.open(function(e){e?(l("reconnect attempt error"),t.reconnecting=!1,t.reconnect(),t.emitAll("reconnect_error",e.data)):(l("reconnect success"),t.onreconnect())}))},e);this.subs.push({destroy:function(){clearTimeout(n)}})}},r.prototype.onreconnect=function(){var t=this.backoff.attempts;this.reconnecting=!1,this.backoff.reset(),this.updateSocketIds(),this.emitAll("reconnect",t)}},{"./on":4,"./socket":5,"./url":6,backo2:7,"component-bind":8,"component-emitter":9,debug:10,"engine.io-client":11,indexof:40,"object-component":41,"socket.io-parser":44}],4:[function(t,e,n){function r(t,e,n){return t.on(e,n),{destroy:function(){t.removeListener(e,n)}}}e.exports=r},{}],5:[function(t,e,n){function r(t,e){this.io=t,this.nsp=e,this.json=this,this.ids=0,this.acks={},this.io.autoConnect&&this.open(),this.receiveBuffer=[],this.sendBuffer=[],this.connected=!1,this.disconnected=!0}var i=t("socket.io-parser"),o=t("component-emitter"),s=t("to-array"),a=t("./on"),u=t("component-bind"),c=t("debug")("socket.io-client:socket"),l=t("has-binary");e.exports=n=r;var h={connect:1,connect_error:1,connect_timeout:1,disconnect:1,error:1,reconnect:1,reconnect_attempt:1,reconnect_failed:1,reconnect_error:1,reconnecting:1},f=o.prototype.emit;
-o(r.prototype),r.prototype.subEvents=function(){if(!this.subs){var t=this.io;this.subs=[a(t,"open",u(this,"onopen")),a(t,"packet",u(this,"onpacket")),a(t,"close",u(this,"onclose"))]}},r.prototype.open=r.prototype.connect=function(){return this.connected?this:(this.subEvents(),this.io.open(),"open"==this.io.readyState&&this.onopen(),this)},r.prototype.send=function(){var t=s(arguments);return t.unshift("message"),this.emit.apply(this,t),this},r.prototype.emit=function(t){if(h.hasOwnProperty(t))return f.apply(this,arguments),this;var e=s(arguments),n=i.EVENT;l(e)&&(n=i.BINARY_EVENT);var r={type:n,data:e};return"function"==typeof e[e.length-1]&&(c("emitting packet with ack id %d",this.ids),this.acks[this.ids]=e.pop(),r.id=this.ids++),this.connected?this.packet(r):this.sendBuffer.push(r),this},r.prototype.packet=function(t){t.nsp=this.nsp,this.io.packet(t)},r.prototype.onopen=function(){c("transport is open - connecting"),"/"!=this.nsp&&this.packet({type:i.CONNECT})},r.prototype.onclose=function(t){c("close (%s)",t),this.connected=!1,this.disconnected=!0,delete this.id,this.emit("disconnect",t)},r.prototype.onpacket=function(t){if(t.nsp==this.nsp)switch(t.type){case i.CONNECT:this.onconnect();break;case i.EVENT:this.onevent(t);break;case i.BINARY_EVENT:this.onevent(t);break;case i.ACK:this.onack(t);break;case i.BINARY_ACK:this.onack(t);break;case i.DISCONNECT:this.ondisconnect();break;case i.ERROR:this.emit("error",t.data)}},r.prototype.onevent=function(t){var e=t.data||[];c("emitting event %j",e),null!=t.id&&(c("attaching ack callback to event"),e.push(this.ack(t.id))),this.connected?f.apply(this,e):this.receiveBuffer.push(e)},r.prototype.ack=function(t){var e=this,n=!1;return function(){if(!n){n=!0;var r=s(arguments);c("sending ack %j",r);var o=l(r)?i.BINARY_ACK:i.ACK;e.packet({type:o,id:t,data:r})}}},r.prototype.onack=function(t){c("calling ack %s with %j",t.id,t.data);var e=this.acks[t.id];e.apply(this,t.data),delete this.acks[t.id]},r.prototype.onconnect=function(){this.connected=!0,this.disconnected=!1,this.emit("connect"),this.emitBuffered()},r.prototype.emitBuffered=function(){var t;for(t=0;t0&&t.jitter<=1?t.jitter:0,this.attempts=0}e.exports=r,r.prototype.duration=function(){var t=this.ms*Math.pow(this.factor,this.attempts++);if(this.jitter){var e=Math.random(),n=Math.floor(e*this.jitter*t);t=0==(1&Math.floor(10*e))?t-n:t+n}return 0|Math.min(t,this.max)},r.prototype.reset=function(){this.attempts=0},r.prototype.setMin=function(t){this.ms=t},r.prototype.setMax=function(t){this.max=t},r.prototype.setJitter=function(t){this.jitter=t}},{}],8:[function(t,e,n){var r=[].slice;e.exports=function(t,e){if("string"==typeof e&&(e=t[e]),"function"!=typeof e)throw new Error("bind() requires a function");var n=r.call(arguments,2);return function(){return e.apply(t,n.concat(r.call(arguments)))}}},{}],9:[function(t,e,n){function r(t){return t?i(t):void 0}function i(t){for(var e in r.prototype)t[e]=r.prototype[e];return t}e.exports=r,r.prototype.on=r.prototype.addEventListener=function(t,e){return this._callbacks=this._callbacks||{},(this._callbacks[t]=this._callbacks[t]||[]).push(e),this},r.prototype.once=function(t,e){function n(){r.off(t,n),e.apply(this,arguments)}var r=this;return this._callbacks=this._callbacks||{},n.fn=e,this.on(t,n),this},r.prototype.off=r.prototype.removeListener=r.prototype.removeAllListeners=r.prototype.removeEventListener=function(t,e){if(this._callbacks=this._callbacks||{},0==arguments.length)return this._callbacks={},this;var n=this._callbacks[t];if(!n)return this;if(1==arguments.length)return delete this._callbacks[t],this;for(var r,i=0;ir;++r)n[r].apply(this,e)}return this},r.prototype.listeners=function(t){return this._callbacks=this._callbacks||{},this._callbacks[t]||[]},r.prototype.hasListeners=function(t){return!!this.listeners(t).length}},{}],10:[function(t,e,n){function r(t){return r.enabled(t)?function(e){e=i(e);var n=new Date,o=n-(r[t]||n);r[t]=n,e=t+" "+e+" +"+r.humanize(o),window.console&&console.log&&Function.prototype.apply.call(console.log,console,arguments)}:function(){}}function i(t){return t instanceof Error?t.stack||t.message:t}e.exports=r,r.names=[],r.skips=[],r.enable=function(t){try{localStorage.debug=t}catch(e){}for(var n=(t||"").split(/[\s,]+/),i=n.length,o=0;i>o;o++)t=n[o].replace("*",".*?"),"-"===t[0]?r.skips.push(new RegExp("^"+t.substr(1)+"$")):r.names.push(new RegExp("^"+t+"$"))},r.disable=function(){r.enable("")},r.humanize=function(t){var e=1e3,n=6e4,r=60*n;return t>=r?(t/r).toFixed(1)+"h":t>=n?(t/n).toFixed(1)+"m":t>=e?(t/e|0)+"s":t+"ms"},r.enabled=function(t){for(var e=0,n=r.skips.length;n>e;e++)if(r.skips[e].test(t))return!1;for(var e=0,n=r.names.length;n>e;e++)if(r.names[e].test(t))return!0;return!1};try{window.localStorage&&r.enable(localStorage.debug)}catch(o){}},{}],11:[function(t,e,n){e.exports=t("./lib/")},{"./lib/":12}],12:[function(t,e,n){e.exports=t("./socket"),e.exports.parser=t("engine.io-parser")},{"./socket":13,"engine.io-parser":25}],13:[function(t,e,n){(function(n){function r(t,e){if(!(this instanceof r))return new r(t,e);if(e=e||{},t&&"object"==typeof t&&(e=t,t=null),t&&(t=l(t),e.host=t.host,e.secure="https"==t.protocol||"wss"==t.protocol,e.port=t.port,t.query&&(e.query=t.query)),this.secure=null!=e.secure?e.secure:n.location&&"https:"==location.protocol,e.host){var i=e.host.split(":");e.hostname=i.shift(),i.length?e.port=i.pop():e.port||(e.port=this.secure?"443":"80")}this.agent=e.agent||!1,this.hostname=e.hostname||(n.location?location.hostname:"localhost"),this.port=e.port||(n.location&&location.port?location.port:this.secure?443:80),this.query=e.query||{},"string"==typeof this.query&&(this.query=f.decode(this.query)),this.upgrade=!1!==e.upgrade,this.path=(e.path||"/engine.io").replace(/\/$/,"")+"/",this.forceJSONP=!!e.forceJSONP,this.jsonp=!1!==e.jsonp,this.forceBase64=!!e.forceBase64,this.enablesXDR=!!e.enablesXDR,this.timestampParam=e.timestampParam||"t",this.timestampRequests=e.timestampRequests,this.transports=e.transports||["polling","websocket"],this.readyState="",this.writeBuffer=[],this.callbackBuffer=[],this.policyPort=e.policyPort||843,this.rememberUpgrade=e.rememberUpgrade||!1,this.binaryType=null,this.onlyBinaryUpgrades=e.onlyBinaryUpgrades,this.pfx=e.pfx||null,this.key=e.key||null,this.passphrase=e.passphrase||null,this.cert=e.cert||null,this.ca=e.ca||null,this.ciphers=e.ciphers||null,this.rejectUnauthorized=e.rejectUnauthorized||null,this.open()}function i(t){var e={};for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n]);return e}var o=t("./transports"),s=t("component-emitter"),a=t("debug")("engine.io-client:socket"),u=t("indexof"),c=t("engine.io-parser"),l=t("parseuri"),h=t("parsejson"),f=t("parseqs");e.exports=r,r.priorWebsocketSuccess=!1,s(r.prototype),r.protocol=c.protocol,r.Socket=r,r.Transport=t("./transport"),r.transports=t("./transports"),r.parser=t("engine.io-parser"),r.prototype.createTransport=function(t){a('creating transport "%s"',t);var e=i(this.query);e.EIO=c.protocol,e.transport=t,this.id&&(e.sid=this.id);var n=new o[t]({agent:this.agent,hostname:this.hostname,port:this.port,secure:this.secure,path:this.path,query:e,forceJSONP:this.forceJSONP,jsonp:this.jsonp,forceBase64:this.forceBase64,enablesXDR:this.enablesXDR,timestampRequests:this.timestampRequests,timestampParam:this.timestampParam,policyPort:this.policyPort,socket:this,pfx:this.pfx,key:this.key,passphrase:this.passphrase,cert:this.cert,ca:this.ca,ciphers:this.ciphers,rejectUnauthorized:this.rejectUnauthorized});return n},r.prototype.open=function(){var t;if(this.rememberUpgrade&&r.priorWebsocketSuccess&&-1!=this.transports.indexOf("websocket"))t="websocket";else{if(0==this.transports.length){var e=this;return void setTimeout(function(){e.emit("error","No transports available")},0)}t=this.transports[0]}this.readyState="opening";var t;try{t=this.createTransport(t)}catch(n){return this.transports.shift(),void this.open()}t.open(),this.setTransport(t)},r.prototype.setTransport=function(t){a("setting transport %s",t.name);var e=this;this.transport&&(a("clearing existing transport %s",this.transport.name),this.transport.removeAllListeners()),this.transport=t,t.on("drain",function(){e.onDrain()}).on("packet",function(t){e.onPacket(t)}).on("error",function(t){e.onError(t)}).on("close",function(){e.onClose("transport close")})},r.prototype.probe=function(t){function e(){if(f.onlyBinaryUpgrades){var e=!this.supportsBinary&&f.transport.supportsBinary;h=h||e}h||(a('probe transport "%s" opened',t),l.send([{type:"ping",data:"probe"}]),l.once("packet",function(e){if(!h)if("pong"==e.type&&"probe"==e.data){if(a('probe transport "%s" pong',t),f.upgrading=!0,f.emit("upgrading",l),!l)return;r.priorWebsocketSuccess="websocket"==l.name,a('pausing current transport "%s"',f.transport.name),f.transport.pause(function(){h||"closed"!=f.readyState&&(a("changing transport and sending upgrade packet"),c(),f.setTransport(l),l.send([{type:"upgrade"}]),f.emit("upgrade",l),l=null,f.upgrading=!1,f.flush())})}else{a('probe transport "%s" failed',t);var n=new Error("probe error");n.transport=l.name,f.emit("upgradeError",n)}}))}function n(){h||(h=!0,c(),l.close(),l=null)}function i(e){var r=new Error("probe error: "+e);r.transport=l.name,n(),a('probe transport "%s" failed because of error: %s',t,e),f.emit("upgradeError",r)}function o(){i("transport closed")}function s(){i("socket closed")}function u(t){l&&t.name!=l.name&&(a('"%s" works - aborting "%s"',t.name,l.name),n())}function c(){l.removeListener("open",e),l.removeListener("error",i),l.removeListener("close",o),f.removeListener("close",s),f.removeListener("upgrading",u)}a('probing transport "%s"',t);var l=this.createTransport(t,{probe:1}),h=!1,f=this;r.priorWebsocketSuccess=!1,l.once("open",e),l.once("error",i),l.once("close",o),this.once("close",s),this.once("upgrading",u),l.open()},r.prototype.onOpen=function(){if(a("socket open"),this.readyState="open",r.priorWebsocketSuccess="websocket"==this.transport.name,this.emit("open"),this.flush(),"open"==this.readyState&&this.upgrade&&this.transport.pause){a("starting upgrade probes");for(var t=0,e=this.upgrades.length;e>t;t++)this.probe(this.upgrades[t])}},r.prototype.onPacket=function(t){if("opening"==this.readyState||"open"==this.readyState)switch(a('socket receive: type "%s", data "%s"',t.type,t.data),this.emit("packet",t),this.emit("heartbeat"),t.type){case"open":this.onHandshake(h(t.data));break;case"pong":this.setPing();break;case"error":var e=new Error("server error");e.code=t.data,this.emit("error",e);break;case"message":this.emit("data",t.data),this.emit("message",t.data)}else a('packet received with socket readyState "%s"',this.readyState)},r.prototype.onHandshake=function(t){this.emit("handshake",t),this.id=t.sid,this.transport.query.sid=t.sid,this.upgrades=this.filterUpgrades(t.upgrades),this.pingInterval=t.pingInterval,this.pingTimeout=t.pingTimeout,this.onOpen(),"closed"!=this.readyState&&(this.setPing(),this.removeListener("heartbeat",this.onHeartbeat),this.on("heartbeat",this.onHeartbeat))},r.prototype.onHeartbeat=function(t){clearTimeout(this.pingTimeoutTimer);var e=this;e.pingTimeoutTimer=setTimeout(function(){"closed"!=e.readyState&&e.onClose("ping timeout")},t||e.pingInterval+e.pingTimeout)},r.prototype.setPing=function(){var t=this;clearTimeout(t.pingIntervalTimer),t.pingIntervalTimer=setTimeout(function(){a("writing ping packet - expecting pong within %sms",t.pingTimeout),t.ping(),t.onHeartbeat(t.pingTimeout)},t.pingInterval)},r.prototype.ping=function(){this.sendPacket("ping")},r.prototype.onDrain=function(){for(var t=0;tn;n++)~u(this.transports,t[n])&&e.push(t[n]);return e}}).call(this,"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"./transport":14,"./transports":15,"component-emitter":9,debug:22,"engine.io-parser":25,indexof:40,parsejson:32,parseqs:33,parseuri:34}],14:[function(t,e,n){function r(t){this.path=t.path,this.hostname=t.hostname,this.port=t.port,this.secure=t.secure,this.query=t.query,this.timestampParam=t.timestampParam,this.timestampRequests=t.timestampRequests,this.readyState="",this.agent=t.agent||!1,this.socket=t.socket,this.enablesXDR=t.enablesXDR,this.pfx=t.pfx,this.key=t.key,this.passphrase=t.passphrase,this.cert=t.cert,this.ca=t.ca,this.ciphers=t.ciphers,this.rejectUnauthorized=t.rejectUnauthorized}var i=t("engine.io-parser"),o=t("component-emitter");e.exports=r,o(r.prototype),r.timestamps=0,r.prototype.onError=function(t,e){var n=new Error(t);return n.type="TransportError",n.description=e,this.emit("error",n),this},r.prototype.open=function(){return("closed"==this.readyState||""==this.readyState)&&(this.readyState="opening",this.doOpen()),this},r.prototype.close=function(){return("opening"==this.readyState||"open"==this.readyState)&&(this.doClose(),this.onClose()),this},r.prototype.send=function(t){if("open"!=this.readyState)throw new Error("Transport not open");this.write(t)},r.prototype.onOpen=function(){this.readyState="open",this.writable=!0,this.emit("open")},r.prototype.onData=function(t){var e=i.decodePacket(t,this.socket.binaryType);this.onPacket(e)},r.prototype.onPacket=function(t){this.emit("packet",t)},r.prototype.onClose=function(){this.readyState="closed",this.emit("close")}},{"component-emitter":9,"engine.io-parser":25}],15:[function(t,e,n){(function(e){function r(t){var n,r=!1,a=!1,u=!1!==t.jsonp;if(e.location){var c="https:"==location.protocol,l=location.port;l||(l=c?443:80),r=t.hostname!=location.hostname||l!=t.port,a=t.secure!=c}if(t.xdomain=r,t.xscheme=a,n=new i(t),"open"in n&&!t.forceJSONP)return new o(t);if(!u)throw new Error("JSONP disabled");return new s(t)}var i=t("xmlhttprequest"),o=t("./polling-xhr"),s=t("./polling-jsonp"),a=t("./websocket");n.polling=r,n.websocket=a}).call(this,"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"./polling-jsonp":16,"./polling-xhr":17,"./websocket":19,xmlhttprequest:20}],16:[function(t,e,n){(function(n){function r(){}function i(t){o.call(this,t),this.query=this.query||{},a||(n.___eio||(n.___eio=[]),a=n.___eio),this.index=a.length;var e=this;a.push(function(t){e.onData(t)}),this.query.j=this.index,n.document&&n.addEventListener&&n.addEventListener("beforeunload",function(){e.script&&(e.script.onerror=r)},!1)}var o=t("./polling"),s=t("component-inherit");e.exports=i;var a,u=/\n/g,c=/\\n/g;s(i,o),i.prototype.supportsBinary=!1,i.prototype.doClose=function(){this.script&&(this.script.parentNode.removeChild(this.script),this.script=null),this.form&&(this.form.parentNode.removeChild(this.form),this.form=null,this.iframe=null),o.prototype.doClose.call(this)},i.prototype.doPoll=function(){var t=this,e=document.createElement("script");this.script&&(this.script.parentNode.removeChild(this.script),this.script=null),e.async=!0,e.src=this.uri(),e.onerror=function(e){t.onError("jsonp poll error",e)};var n=document.getElementsByTagName("script")[0];n.parentNode.insertBefore(e,n),this.script=e;var r="undefined"!=typeof navigator&&/gecko/i.test(navigator.userAgent);r&&setTimeout(function(){var t=document.createElement("iframe");document.body.appendChild(t),document.body.removeChild(t)},100)},i.prototype.doWrite=function(t,e){function n(){r(),e()}function r(){if(i.iframe)try{i.form.removeChild(i.iframe)}catch(t){i.onError("jsonp polling iframe removal error",t)}try{var e='