zone.min.js 25.6 KB
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t():"function"==typeof define&&define.amd?define(t):t()}(this,function(){"use strict";function e(e,t){for(var n=e.length-1;n>=0;n--)"function"==typeof e[n]&&(e[n]=Zone.current.wrap(e[n],t+"_"+n));return e}function t(t,n){for(var r=t.constructor.name,o=function(o){var a=n[o],i=t[a];i&&(t[a]=function(t){return function(){return t.apply(this,e(arguments,r+"."+a))}}(i))},a=0;a<n.length;a++)o(a)}function n(e,t){var n=Object.getOwnPropertyDescriptor(e,t)||{enumerable:!0,configurable:!0},r=Object.getOwnPropertyDescriptor(e,"original"+t);!r&&n.get&&Object.defineProperty(e,"original"+t,{enumerable:!1,configurable:!0,get:n.get}),delete n.writable,delete n.value;var o=t.substr(2),a="_"+t;n.set=function(e){if(this[a]&&this.removeEventListener(o,this[a]),"function"==typeof e){var t=function(t){var n;n=e.apply(this,arguments),void 0==n||n||t.preventDefault()};this[a]=t,this.addEventListener(o,t,!1)}else this[a]=null},n.get=function(){var e=this[a]||null;return null===e&&r&&r.get&&(e=r.get.apply(this,arguments),e&&(n.set.apply(this,[e]),"function"==typeof this.removeAttribute&&this.removeAttribute(t))),this[a]||null},Object.defineProperty(e,t,n)}function r(e,t){var r=[];for(var o in e)"on"==o.substr(0,2)&&r.push(o);for(var a=0;a<r.length;a++)n(e,r[a]);if(t)for(var i=0;i<t.length;i++)n(e,"on"+t[i])}function o(e,t,n,r,o){var a=e[Z];if(a)for(var i=0;i<a.length;i++){var s=a[i],c=s.data,u=c.handler;if((c.handler===t||u.listener===t)&&c.useCapturing===r&&c.eventName===n)return o&&a.splice(i,1),s}return null}function a(e,t,n){var r=e[Z];r||(r=e[Z]=[]),n?r.unshift(t):r.push(t)}function i(e,t,n,r,i,s){function c(e){var t=e.data;return a(t.target,e,i),t.invokeAddFunc(l,e)}function u(e){var t=e.data;return o(t.target,e.invoke,t.eventName,t.useCapturing,!0),t.invokeRemoveFunc(f,e)}void 0===n&&(n=!0),void 0===r&&(r=!1),void 0===i&&(i=!1),void 0===s&&(s=I);var l=O(e),f=O(t),p=!n&&void 0;return function(t,n){var a=s(t,n);a.useCapturing=a.useCapturing||p;var i=null;"function"==typeof a.handler?i=a.handler:a.handler&&a.handler.handleEvent&&(i=function(e){return a.handler.handleEvent(e)});var f=!1;try{f=a.handler&&"[object FunctionWrapper]"===a.handler.toString()}catch(h){return}if(!i||f)return a.invokeAddFunc(l,a.handler);if(!r){var d=o(a.target,a.handler,a.eventName,a.useCapturing,!1);if(d)return a.invokeAddFunc(l,d)}var v=Zone.current,k=a.target.constructor.name+"."+e+":"+a.eventName;v.scheduleEventTask(k,i,a,c,u)}}function s(e,t,n){void 0===t&&(t=!0),void 0===n&&(n=I);var r=O(e),a=!t&&void 0;return function(e,t){var i=n(e,t);i.useCapturing=i.useCapturing||a;var s=o(i.target,i.handler,i.eventName,i.useCapturing,!0);s?s.zone.cancelTask(s):i.invokeRemoveFunc(r,i.handler)}}function c(e,t,n,r){return void 0===t&&(t=z),void 0===n&&(n=C),void 0===r&&(r=I),!(!e||!e[t])&&(f(e,t,function(){return i(t,n,!0,!1,!1,r)}),f(e,n,function(){return s(n,!0,r)}),!0)}function u(t){var n=E[t];if(n){E[t]=function(){var r=e(arguments,t);switch(r.length){case 0:this[L]=new n;break;case 1:this[L]=new n(r[0]);break;case 2:this[L]=new n(r[0],r[1]);break;case 3:this[L]=new n(r[0],r[1],r[2]);break;case 4:this[L]=new n(r[0],r[1],r[2],r[3]);break;default:throw new Error("Arg list too long.")}};var r,o=new n(function(){});for(r in o)"XMLHttpRequest"===t&&"responseBlob"===r||!function(e){"function"==typeof o[e]?E[t].prototype[e]=function(){return this[L][e].apply(this[L],arguments)}:Object.defineProperty(E[t].prototype,e,{set:function(n){"function"==typeof n?this[L][e]=Zone.current.wrap(n,t+"."+e):this[L][e]=n},get:function(){return this[L][e]}})}(r);for(r in n)"prototype"!==r&&n.hasOwnProperty(r)&&(E[t][r]=n[r])}}function l(e,t){try{return Function("f","return function "+e+"(){return f(this, arguments)}")(t)}catch(n){return function(){return t(this,arguments)}}}function f(e,t,n){for(var r=e;r&&Object.getOwnPropertyNames(r).indexOf(t)===-1;)r=Object.getPrototypeOf(r);!r&&e[t]&&(r=e);var o,a=O(t);return r&&!(o=r[a])&&(o=r[a]=r[t],r[t]=l(t,n(o,a,t))),o}function p(e,t,n,r){function o(t){var n=t.data;return n.args[0]=function(){t.invoke.apply(this,arguments),delete c[n.handleId]},n.handleId=i.apply(e,n.args),c[n.handleId]=t,t}function a(e){return delete c[e.data.handleId],s(e.data.handleId)}var i=null,s=null;t+=r,n+=r;var c={};i=f(e,t,function(n){return function(i,s){if("function"==typeof s[0]){var c=Zone.current,u={handleId:null,isPeriodic:"Interval"===r,delay:"Timeout"===r||"Interval"===r?s[1]||0:null,args:s},l=c.scheduleMacroTask(t,s[0],u,o,a);if(!l)return l;var f=l.data.handleId;return f.ref&&f.unref&&(l.ref=f.ref.bind(f),l.unref=f.unref.bind(f)),l}return n.apply(e,s)}}),s=f(e,n,function(t){return function(n,r){var o="number"==typeof r[0]?c[r[0]]:r[0];o&&"string"==typeof o.type?(o.cancelFn&&o.data.isPeriodic||0===o.runCount)&&o.zone.cancelTask(o):t.apply(e,r)}})}function h(){Object.defineProperty=function(e,t,n){if(v(e,t))throw new TypeError("Cannot assign to read only property '"+t+"' of "+e);var r=n.configurable;return"prototype"!==t&&(n=k(e,t,n)),g(e,t,n,r)},Object.defineProperties=function(e,t){return Object.keys(t).forEach(function(n){Object.defineProperty(e,n,t[n])}),e},Object.create=function(e,t){return"object"!=typeof t||Object.isFrozen(t)||Object.keys(t).forEach(function(n){t[n]=k(e,n,t[n])}),H(e,t)},Object.getOwnPropertyDescriptor=function(e,t){var n=M(e,t);return v(e,t)&&(n.configurable=!1),n}}function d(e,t,n){var r=n.configurable;return n=k(e,t,n),g(e,t,n,r)}function v(e,t){return e&&e[R]&&e[R][t]}function k(e,t,n){return n.configurable=!0,n.configurable||(e[R]||F(e,R,{writable:!0,value:{}}),e[R][t]=!0),n}function g(e,t,n,r){try{return F(e,t,n)}catch(o){if(!n.configurable)throw o;"undefined"==typeof r?delete n.configurable:n.configurable=r;try{return F(e,t,n)}catch(o){var a=null;try{a=JSON.stringify(n)}catch(o){a=a.toString()}console.log("Attempting to configure '"+t+"' with descriptor '"+a+"' on object '"+e+"' and got error, giving up: "+o)}}}function y(e){var t=[],n=e.wtf;n?t=x.split(",").map(function(e){return"HTML"+e+"Element"}).concat(q):e[A]?t.push(A):t=q;for(var r=0;r<t.length;r++){var o=e[t[r]];c(o&&o.prototype)}}function b(e){var t=e.WebSocket;e.EventTarget||c(t.prototype),e.WebSocket=function(e,n){var o,a=arguments.length>1?new t(e,n):new t(e),i=Object.getOwnPropertyDescriptor(a,"onmessage");return i&&i.configurable===!1?(o=Object.create(a),["addEventListener","removeEventListener","send","close"].forEach(function(e){o[e]=function(){return a[e].apply(a,arguments)}})):o=a,r(o,["close","error","message","open"]),o};for(var n in t)e.WebSocket[n]=t[n]}function m(e){if(!P){var t="undefined"!=typeof WebSocket;T()?(j&&r(HTMLElement.prototype,B),r(XMLHttpRequest.prototype,null),"undefined"!=typeof IDBIndex&&(r(IDBIndex.prototype,null),r(IDBRequest.prototype,null),r(IDBOpenDBRequest.prototype,null),r(IDBDatabase.prototype,null),r(IDBTransaction.prototype,null),r(IDBCursor.prototype,null)),t&&r(WebSocket.prototype,null)):(w(),u("XMLHttpRequest"),t&&b(e))}}function T(){if(j&&!Object.getOwnPropertyDescriptor(HTMLElement.prototype,"onclick")&&"undefined"!=typeof Element){var e=Object.getOwnPropertyDescriptor(Element.prototype,"onclick");if(e&&!e.configurable)return!1}var t=Object.getOwnPropertyDescriptor(XMLHttpRequest.prototype,"onreadystatechange");Object.defineProperty(XMLHttpRequest.prototype,"onreadystatechange",{enumerable:!0,configurable:!0,get:function(){return!0}});var n=new XMLHttpRequest,r=!!n.onreadystatechange;return Object.defineProperty(XMLHttpRequest.prototype,"onreadystatechange",t||{}),r}function w(){for(var e=function(e){var t=B[e],n="on"+t;self.addEventListener(t,function(e){var t,r,o=e.target;for(r=o?o.constructor.name+"."+n:"unknown."+n;o;)o[n]&&!o[n][N]&&(t=Zone.current.wrap(o[n],r),t[N]=o[n],o[n]=t),o=o.parentElement},!0)},t=0;t<B.length;t++)e(t)}function _(e){if(j&&"registerElement"in e.document){var t=document.registerElement,n=["createdCallback","attachedCallback","detachedCallback","attributeChangedCallback"];document.registerElement=function(e,r){return r&&r.prototype&&n.forEach(function(e){var t="Document.registerElement::"+e;if(r.prototype.hasOwnProperty(e)){var n=Object.getOwnPropertyDescriptor(r.prototype,e);n&&n.value?(n.value=Zone.current.wrap(n.value,t),d(r.prototype,e,n)):r.prototype[e]=Zone.current.wrap(r.prototype[e],t)}else r.prototype[e]&&(r.prototype[e]=Zone.current.wrap(r.prototype[e],t))}),t.apply(document,[e,r])}}}function S(e){function t(e){var t=e[J];return t}function n(e){self[$]=!1;var t=e.data,n=t.target[Y];n&&t.target.removeEventListener("readystatechange",n);var r=t.target[Y]=function(){t.target.readyState===t.target.DONE&&!t.aborted&&self[$]&&e.invoke()};t.target.addEventListener("readystatechange",r);var o=t.target[J];return o||(t.target[J]=e),i.apply(t.target,t.args),self[$]=!0,e}function r(){}function o(e){var t=e.data;return t.aborted=!0,s.apply(t.target,t.args)}var a=f(e.XMLHttpRequest.prototype,"open",function(){return function(e,t){return e[Q]=0==t[2],a.apply(e,t)}}),i=f(e.XMLHttpRequest.prototype,"send",function(){return function(e,t){var a=Zone.current;if(e[Q])return i.apply(e,t);var s={target:e,isPeriodic:!1,delay:null,args:t,aborted:!1};return a.scheduleMacroTask("XMLHttpRequest.send",r,s,n,o)}}),s=f(e.XMLHttpRequest.prototype,"abort",function(e){return function(e,n){var r=t(e);if(r&&"string"==typeof r.type){if(null==r.cancelFn||r.data&&r.data.aborted)return;r.zone.cancelTask(r)}}})}var O=(function(e){function t(e){return"__zone_symbol__"+e}function n(){0===D&&0===S.length&&(e[m]?e[m].resolve(0)[T](a):e[b](a,0))}function r(e){n(),S.push(e)}function o(e){var t=e&&e.rejection;t&&console.error("Unhandled Promise rejection:",t instanceof Error?t.message:t,"; Zone:",e.zone.name,"; Task:",e.task&&e.task.source,"; Value:",t,t instanceof Error?t.stack:void 0),console.error(e)}function a(){if(!O){for(O=!0;S.length;){var e=S;S=[];for(var t=0;t<e.length;t++){var n=e[t];try{n.zone.runTask(n,null,null)}catch(r){o(r)}}}for(;E.length;)for(var a=function(){var e=E.shift();try{e.zone.runGuarded(function(){throw e})}catch(t){o(t)}};E.length;)a();O=!1}}function i(e){return e&&e.then}function s(e){return e}function c(e){return F.reject(e)}function u(e,t){return function(n){l(e,t,n)}}function l(e,t,r){if(e[P]===z)if(r instanceof F&&r.hasOwnProperty(P)&&r.hasOwnProperty(j)&&r[P]!==z)f(r),l(e,r[P],r[j]);else if(i(r))r.then(u(e,t),u(e,!1));else{e[P]=t;var o=e[j];e[j]=r;for(var a=0;a<o.length;)p(e,o[a++],o[a++],o[a++],o[a++]);if(0==o.length&&t==I){e[P]=L;try{throw new Error("Uncaught (in promise): "+r+(r&&r.stack?"\n"+r.stack:""))}catch(s){var c=s;c.rejection=r,c.promise=e,c.zone=v.current,c.task=v.currentTask,E.push(c),n()}}}return e}function f(e){if(e[P]===L){e[P]=I;for(var t=0;t<E.length;t++)if(e===E[t].promise){E.splice(t,1);break}}}function p(e,t,n,r,o){f(e);var a=e[P]?r||s:o||c;t.scheduleMicroTask(Z,function(){try{l(n,!0,t.run(a,null,[e[j]]))}catch(r){l(n,!1,r)}})}function h(e){var n=e.prototype,r=n[t("then")]=n.then;n.then=function(e,t){var n=this;return new F(function(e,t){r.call(n,e,t)}).then(e,t)}}function d(){if(!(this instanceof d))return d.apply(Object.create(d.prototype),arguments);var e=A.apply(this,arguments);if(this[t("error")]=e,e.originalStack=e.stack,d[N]&&e.originalStack){for(var n=e.originalStack.split("\n"),r=w,o=0;n[o]!==q&&o<n.length;)o++;for(;o<n.length&&r;o++){var a=n[o];if(a.trim()){var i=B.hasOwnProperty(a)&&B[a];i===x.blackList?(n.splice(o,1),o--):i===x.transition?r.parent?(n[o]+=" ["+r.parent.zone.name+" => "+r.zone.name+"]",r=r.parent):r=null:n[o]+=" ["+r.zone.name+"]"}}e.stack=e.zoneAwareStack=n.join("\n")}return Object.defineProperties(this,K(Object.getPrototypeOf(this))),this}if(e.Zone)throw new Error("Zone already loaded.");var v=function(){function t(e,t){this._properties=null,this._parent=e,this._name=t?t.name||"unnamed":"<root>",this._properties=t&&t.properties||{},this._zoneDelegate=new k(this,this._parent&&this._parent._zoneDelegate,t)}return t.assertZonePatched=function(){if(e.Promise!==F)throw new Error("Zone.js has detected that ZoneAwarePromise `(window|global).Promise` has been overwritten.\nMost likely cause is that a Promise polyfill has been loaded after Zone.js (Polyfilling Promise api is not necessary when zone.js is loaded. If you must load one, do so before loading zone.js.)")},Object.defineProperty(t,"current",{get:function(){return w.zone},enumerable:!0,configurable:!0}),Object.defineProperty(t,"currentTask",{get:function(){return _},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"parent",{get:function(){return this._parent},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"name",{get:function(){return this._name},enumerable:!0,configurable:!0}),t.prototype.get=function(e){var t=this.getZoneWith(e);if(t)return t._properties[e]},t.prototype.getZoneWith=function(e){for(var t=this;t;){if(t._properties.hasOwnProperty(e))return t;t=t._parent}return null},t.prototype.fork=function(e){if(!e)throw new Error("ZoneSpec required!");return this._zoneDelegate.fork(this,e)},t.prototype.wrap=function(e,t){if("function"!=typeof e)throw new Error("Expecting function got: "+e);var n=this._zoneDelegate.intercept(this,e,t),r=this;return function(){return r.runGuarded(n,this,arguments,t)}},t.prototype.run=function(e,t,n,r){void 0===t&&(t=null),void 0===n&&(n=null),void 0===r&&(r=null),w=new y(w,this);try{return this._zoneDelegate.invoke(this,e,t,n,r)}finally{w=w.parent}},t.prototype.runGuarded=function(e,t,n,r){void 0===t&&(t=null),void 0===n&&(n=null),void 0===r&&(r=null),w=new y(w,this);try{try{return this._zoneDelegate.invoke(this,e,t,n,r)}catch(o){if(this._zoneDelegate.handleError(this,o))throw o}}finally{w=w.parent}},t.prototype.runTask=function(e,t,n){if(e.runCount++,e.zone!=this)throw new Error("A task can only be run in the zone which created it! (Creation: "+e.zone.name+"; Execution: "+this.name+")");var r=_;_=e,w=new y(w,this);try{"macroTask"==e.type&&e.data&&!e.data.isPeriodic&&(e.cancelFn=null);try{return this._zoneDelegate.invokeTask(this,e,t,n)}catch(o){if(this._zoneDelegate.handleError(this,o))throw o}}finally{w=w.parent,_=r}},t.prototype.scheduleMicroTask=function(e,t,n,r){return this._zoneDelegate.scheduleTask(this,new g("microTask",this,e,t,n,r,null))},t.prototype.scheduleMacroTask=function(e,t,n,r,o){return this._zoneDelegate.scheduleTask(this,new g("macroTask",this,e,t,n,r,o))},t.prototype.scheduleEventTask=function(e,t,n,r,o){return this._zoneDelegate.scheduleTask(this,new g("eventTask",this,e,t,n,r,o))},t.prototype.cancelTask=function(e){var t=this._zoneDelegate.cancelTask(this,e);return e.runCount=-1,e.cancelFn=null,t},t}();v.__symbol__=t;var k=function(){function e(e,t,n){this._taskCounts={microTask:0,macroTask:0,eventTask:0},this.zone=e,this._parentDelegate=t,this._forkZS=n&&(n&&n.onFork?n:t._forkZS),this._forkDlgt=n&&(n.onFork?t:t._forkDlgt),this._forkCurrZone=n&&(n.onFork?this.zone:t.zone),this._interceptZS=n&&(n.onIntercept?n:t._interceptZS),this._interceptDlgt=n&&(n.onIntercept?t:t._interceptDlgt),this._interceptCurrZone=n&&(n.onIntercept?this.zone:t.zone),this._invokeZS=n&&(n.onInvoke?n:t._invokeZS),this._invokeDlgt=n&&(n.onInvoke?t:t._invokeDlgt),this._invokeCurrZone=n&&(n.onInvoke?this.zone:t.zone),this._handleErrorZS=n&&(n.onHandleError?n:t._handleErrorZS),this._handleErrorDlgt=n&&(n.onHandleError?t:t._handleErrorDlgt),this._handleErrorCurrZone=n&&(n.onHandleError?this.zone:t.zone),this._scheduleTaskZS=n&&(n.onScheduleTask?n:t._scheduleTaskZS),this._scheduleTaskDlgt=n&&(n.onScheduleTask?t:t._scheduleTaskDlgt),this._scheduleTaskCurrZone=n&&(n.onScheduleTask?this.zone:t.zone),this._invokeTaskZS=n&&(n.onInvokeTask?n:t._invokeTaskZS),this._invokeTaskDlgt=n&&(n.onInvokeTask?t:t._invokeTaskDlgt),this._invokeTaskCurrZone=n&&(n.onInvokeTask?this.zone:t.zone),this._cancelTaskZS=n&&(n.onCancelTask?n:t._cancelTaskZS),this._cancelTaskDlgt=n&&(n.onCancelTask?t:t._cancelTaskDlgt),this._cancelTaskCurrZone=n&&(n.onCancelTask?this.zone:t.zone),this._hasTaskZS=n&&(n.onHasTask?n:t._hasTaskZS),this._hasTaskDlgt=n&&(n.onHasTask?t:t._hasTaskDlgt),this._hasTaskCurrZone=n&&(n.onHasTask?this.zone:t.zone)}return e.prototype.fork=function(e,t){return this._forkZS?this._forkZS.onFork(this._forkDlgt,this.zone,e,t):new v(e,t)},e.prototype.intercept=function(e,t,n){return this._interceptZS?this._interceptZS.onIntercept(this._interceptDlgt,this._interceptCurrZone,e,t,n):t},e.prototype.invoke=function(e,t,n,r,o){return this._invokeZS?this._invokeZS.onInvoke(this._invokeDlgt,this._invokeCurrZone,e,t,n,r,o):t.apply(n,r)},e.prototype.handleError=function(e,t){return!this._handleErrorZS||this._handleErrorZS.onHandleError(this._handleErrorDlgt,this._handleErrorCurrZone,e,t)},e.prototype.scheduleTask=function(e,t){try{if(this._scheduleTaskZS)return this._scheduleTaskZS.onScheduleTask(this._scheduleTaskDlgt,this._scheduleTaskCurrZone,e,t);if(t.scheduleFn)t.scheduleFn(t);else{if("microTask"!=t.type)throw new Error("Task is missing scheduleFn.");r(t)}return t}finally{e==this.zone&&this._updateTaskCount(t.type,1)}},e.prototype.invokeTask=function(e,t,n,r){try{return this._invokeTaskZS?this._invokeTaskZS.onInvokeTask(this._invokeTaskDlgt,this._invokeTaskCurrZone,e,t,n,r):t.callback.apply(n,r)}finally{e!=this.zone||"eventTask"==t.type||t.data&&t.data.isPeriodic||this._updateTaskCount(t.type,-1)}},e.prototype.cancelTask=function(e,t){var n;if(this._cancelTaskZS)n=this._cancelTaskZS.onCancelTask(this._cancelTaskDlgt,this._cancelTaskCurrZone,e,t);else{if(!t.cancelFn)throw new Error("Task does not support cancellation, or is already canceled.");n=t.cancelFn(t)}return e==this.zone&&this._updateTaskCount(t.type,-1),n},e.prototype.hasTask=function(e,t){return this._hasTaskZS&&this._hasTaskZS.onHasTask(this._hasTaskDlgt,this._hasTaskCurrZone,e,t)},e.prototype._updateTaskCount=function(e,t){var n=this._taskCounts,r=n[e],o=n[e]=r+t;if(o<0)throw new Error("More tasks executed then were scheduled.");if(0==r||0==o){var a={microTask:n.microTask>0,macroTask:n.macroTask>0,eventTask:n.eventTask>0,change:e};try{this.hasTask(this.zone,a)}finally{this._parentDelegate&&this._parentDelegate._updateTaskCount(e,t)}}},e}(),g=function(){function e(e,t,n,r,o,i,s){this.runCount=0,this.type=e,this.zone=t,this.source=n,this.data=o,this.scheduleFn=i,this.cancelFn=s,this.callback=r;var c=this;this.invoke=function(){D++;try{return t.runTask(c,this,arguments)}finally{1==D&&a(),D--}}}return e.prototype.toString=function(){return this.data&&"undefined"!=typeof this.data.handleId?this.data.handleId:Object.prototype.toString.call(this)},e.prototype.toJSON=function(){return{type:this.type,source:this.source,data:this.data,zone:this.zone.name,invoke:this.invoke,scheduleFn:this.scheduleFn,cancelFn:this.cancelFn,runCount:this.runCount,callback:this.callback}},e}(),y=function(){function e(e,t){this.parent=e,this.zone=t}return e}(),b=t("setTimeout"),m=t("Promise"),T=t("then"),w=new y(null,new v(null,null)),_=null,S=[],O=!1,E=[],D=0,P=t("state"),j=t("value"),Z="Promise.then",z=null,C=!0,I=!1,L=0,F=function(){function e(t){var n=this;if(!(n instanceof e))throw new Error("Must be an instanceof Promise.");n[P]=z,n[j]=[];try{t&&t(u(n,C),u(n,I))}catch(r){l(n,!1,r)}}return e.toString=function(){return"function ZoneAwarePromise() { [native code] }"},e.resolve=function(e){return l(new this(null),C,e)},e.reject=function(e){return l(new this(null),I,e)},e.race=function(e){function t(e){a&&(a=r(e))}function n(e){a&&(a=o(e))}for(var r,o,a=new this(function(e,t){n=[e,t],r=n[0],o=n[1];var n}),s=0,c=e;s<c.length;s++){var u=c[s];i(u)||(u=this.resolve(u)),u.then(t,n)}return a},e.all=function(e){for(var t,n,r=new this(function(e,r){t=e,n=r}),o=0,a=[],s=0,c=e;s<c.length;s++){var u=c[s];i(u)||(u=this.resolve(u)),u.then(function(e){return function(n){a[e]=n,o--,o||t(a)}}(o),n),o++}return o||t(a),r},e.prototype.then=function(e,t){var n=new this.constructor(null),r=v.current;return this[P]==z?this[j].push(r,n,e,t):p(this,r,n,e,t),n},e.prototype["catch"]=function(e){return this.then(null,e)},e}();F.resolve=F.resolve,F.reject=F.reject,F.race=F.race,F.all=F.all;var M=e[t("Promise")]=e.Promise;if(e.Promise=F,M&&(h(M),"undefined"!=typeof e.fetch)){var H=void 0;try{H=e.fetch()}catch(R){H=e.fetch("about:blank")}H.then(function(){return null},function(){return null}),H.constructor!=M&&H.constructor!=F&&h(H.constructor)}Promise[v.__symbol__("uncaughtPromiseErrors")]=E;var x;!function(e){e[e.blackList=0]="blackList",e[e.transition=1]="transition"}(x||(x={}));var q,A=e[t("Error")]=e.Error,B={};e.Error=d;var N="stackRewrite",W=function(e,n){if(!e[n]){var r=t(n);e[n]={configurable:!0,enumerable:!0,get:function(){if(!this[r]){var e=this[t("error")];e&&(this[r]=e[n])}return this[r]},set:function(e){this[r]=e}}}},X=function(e,n){e[n]||(e[n]={configurable:!0,enumerable:!0,writable:!0,value:function(){var e=this[t("error")],r=e&&e[n]||this[n];if(r)return r.apply(e,arguments)}})},G=function(){for(var e=Object.create(null),t=new A,n=Object.getOwnPropertyNames(t),r=0;r<n.length;r++){var o=n[r];Object.prototype.hasOwnProperty.call(t,o)&&W(e,o)}var a=A.prototype;if(a)for(var i=Object.getOwnPropertyNames(a),r=0;r<i.length;r++){var o=i[r];"constructor"!==o&&"toString"!==o&&"toSource"!==o&&W(e,o)}return W(e,"originalStack"),W(e,"zoneAwareStack"),X(e,"toString"),X(e,"toSource"),e},U=G(),K=function(e){if(e===d.prototype)return U;var t=Object.create(null),n=Object.getOwnPropertyNames(U),r=Object.getOwnPropertyNames(e);return n.forEach(function(e){0===r.filter(function(t){return t===e}).length&&(t[e]=U[e])}),t};d.prototype=A.prototype,d[v.__symbol__("blacklistedStackFrames")]=B,d[N]=!1,A.hasOwnProperty("stackTraceLimit")&&(A.stackTraceLimit=Math.max(A.stackTraceLimit,15),Object.defineProperty(d,"stackTraceLimit",{get:function(){return A.stackTraceLimit},set:function(e){return A.stackTraceLimit=e}})),A.hasOwnProperty("captureStackTrace")&&Object.defineProperty(d,"captureStackTrace",{value:function(e,t){A.captureStackTrace(e,t)}}),Object.defineProperty(d,"prepareStackTrace",{get:function(){return A.prepareStackTrace},set:function(e){return e&&"function"==typeof e?A.prepareStackTrace=function(t,n){if(n)for(var r=0;r<n.length;r++){var o=n[r];if("zoneCaptureStackTrace"===o.getFunctionName()){n.splice(r,1);break}}return e.apply(this,[t,n])}:A.prepareStackTrace=e}});var V=v.current.fork({name:"detect",onInvoke:function(e,t,n,r,o,a,i){return e.invoke(n,r,o,a,i)},onHandleError:function(e,t,n,r){if(r.originalStack&&Error===d)for(var o=r.originalStack.split(/\n/),a=!1,i=!1,s=!1;o.length;){var c=o.shift();if(/:\d+:\d+/.test(c)){var u=c.split("(")[0].split("@")[0],l=x.transition;if(u.indexOf("ZoneAwareError")!==-1&&(q=c),u.indexOf("runGuarded")!==-1?i=!0:u.indexOf("runTask")!==-1?s=!0:u.indexOf("run")!==-1?a=!0:l=x.blackList,B[c]=l,a&&i&&s){d[N]=!0;break}}}return!1}}),J=function(){V.run(function(){V.runGuarded(function(){throw new Error("blacklistStackFrames")})})};return V.runTask(V.scheduleMacroTask("detect",J,null,function(){return null},null)),e.Zone=v}("object"==typeof window&&window||"object"==typeof self&&self||global),function(e){return"__zone_symbol__"+e}),E="object"==typeof window&&window||"object"==typeof self&&self||global,D="undefined"!=typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope,P=!("nw"in E)&&"undefined"!=typeof process&&"[object process]"==={}.toString.call(process),j=!P&&!D&&!("undefined"==typeof window||!window.HTMLElement),Z=O("eventTasks"),z="addEventListener",C="removeEventListener",I=function(e,t){return{useCapturing:t[2],eventName:t[0],handler:t[1],target:e||E,name:t[0],invokeAddFunc:function(e,t){return t&&t.invoke?this.target[e](this.eventName,t.invoke,this.useCapturing):this.target[e](this.eventName,t,this.useCapturing)},invokeRemoveFunc:function(e,t){return t&&t.invoke?this.target[e](this.eventName,t.invoke,this.useCapturing):this.target[e](this.eventName,t,this.useCapturing)}}},L=(i(z,C),s(C),O("originalInstance")),F=Object[O("defineProperty")]=Object.defineProperty,M=Object[O("getOwnPropertyDescriptor")]=Object.getOwnPropertyDescriptor,H=Object.create,R=O("unconfigurables"),x="Anchor,Area,Audio,BR,Base,BaseFont,Body,Button,Canvas,Content,DList,Directory,Div,Embed,FieldSet,Font,Form,Frame,FrameSet,HR,Head,Heading,Html,IFrame,Image,Input,Keygen,LI,Label,Legend,Link,Map,Marquee,Media,Menu,Meta,Meter,Mod,OList,Object,OptGroup,Option,Output,Paragraph,Pre,Progress,Quote,Script,Select,Source,Span,Style,TableCaption,TableCell,TableCol,Table,TableRow,TableSection,TextArea,Title,Track,UList,Unknown,Video",q="ApplicationCache,EventSource,FileReader,InputMethodContext,MediaController,MessagePort,Node,Performance,SVGElementInstance,SharedWorker,TextTrack,TextTrackCue,TextTrackList,WebKitNamedFlow,Window,Worker,WorkerGlobalScope,XMLHttpRequest,XMLHttpRequestEventTarget,XMLHttpRequestUpload,IDBRequest,IDBOpenDBRequest,IDBDatabase,IDBTransaction,IDBCursor,DBIndex,WebSocket".split(","),A="EventTarget",B="copy cut paste abort blur focus canplay canplaythrough change click contextmenu dblclick drag dragend dragenter dragleave dragover dragstart drop durationchange emptied ended input invalid keydown keypress keyup load loadeddata loadedmetadata loadstart message mousedown mouseenter mouseleave mousemove mouseout mouseover mouseup pause play playing progress ratechange reset scroll seeked seeking select show stalled submit suspend timeupdate volumechange waiting mozfullscreenchange mozfullscreenerror mozpointerlockchange mozpointerlockerror error webglcontextrestored webglcontextlost webglcontextcreationerror".split(" "),N=O("unbound"),W="set",X="clear",G=["alert","prompt","confirm"],U="object"==typeof window&&window||"object"==typeof self&&self||global;p(U,W,X,"Timeout"),p(U,W,X,"Interval"),p(U,W,X,"Immediate"),p(U,"request","cancel","AnimationFrame"),p(U,"mozRequest","mozCancel","AnimationFrame"),p(U,"webkitRequest","webkitCancel","AnimationFrame");for(var K=0;K<G.length;K++){var V=G[K];f(U,V,function(e,t,n){return function(t,r){return Zone.current.run(e,U,r,n)}})}y(U),m(U),u("MutationObserver"),u("WebKitMutationObserver"),u("FileReader"),h(),_(U),S(U);var J=O("xhrTask"),Q=O("xhrSync"),Y=O("xhrListener"),$=O("xhrScheduled");U.navigator&&U.navigator.geolocation&&t(U.navigator.geolocation,["getCurrentPosition","watchPosition"])});