blob: 4538e2897db82918657a6948a778d70023de79b9 [file] [log] [blame]
/**
* @license Angular v8.1.1
* (c) 2010-2019 Google LLC. https://angular.io/
* License: MIT
*/
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports,require("@angular/common"),require("@angular/core"),require("@angular/upgrade/static")):"function"==typeof define&&define.amd?define("@angular/common/upgrade",["exports","@angular/common","@angular/core","@angular/upgrade/static"],e):e(((t=t||self).ng=t.ng||{},t.ng.common=t.ng.common||{},t.ng.common.upgrade={}),t.ng.common,t.ng.core,t.ng.upgrade.static)}(this,function(t,e,r,o){"use strict";var a=function(){return(a=Object.assign||function t(e){for(var r,o=1,a=arguments.length;o<a;o++)for(var n in r=arguments[o])Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n]);return e}).apply(this,arguments)},n=/^([^?#]*)(\?([^#]*))?(#(.*))?$/,i=/^\s*[\\\/]{2,}/,s=/^\s*(javascript|mailto):/i,h={"http:":80,"https:":443,"ftp:":21},c=function(){function t(t,e,r,o,a){var n=this;this.location=e,this.platformLocation=r,this.urlCodec=o,this.locationStrategy=a,this.initalizing=!0,this.updateBrowser=!1,this.$$absUrl="",this.$$url="",this.$$host="",this.$$replace=!1,this.$$path="",this.$$search="",this.$$hash="",this.$$changeListeners=[],this.cachedState=null,this.lastBrowserUrl="",this.lastCachedState=null;var i=this.browserUrl(),s=this.urlCodec.parse(i);if("string"==typeof s)throw"Invalid URL";this.$$protocol=s.protocol,this.$$host=s.hostname,this.$$port=parseInt(s.port)||h[s.protocol]||null,this.$$parseLinkUrl(i,i),this.cacheState(),this.$$state=this.browserState(),function c(t){return!!t&&"function"==typeof t.then}
/**
* @license
* Copyright Google Inc. All Rights Reserved.
*
* Use of this source code is governed by an MIT-style license that can be
* found in the LICENSE file at https://angular.io/license
*/(t)?t.then(function(t){return n.initialize(t)}):this.initialize(t)}return t.prototype.initialize=function(t){var e=this,r=t.get("$rootScope"),o=t.get("$rootElement");o.on("click",function(t){if(!(t.ctrlKey||t.metaKey||t.shiftKey||2===t.which||2===t.button)){for(var a=t.target;a&&"a"!==a.nodeName.toLowerCase();)if(a===o[0]||!(a=a.parentNode))return;if(function n(t){return void 0!==t.href}(a)){var i=a.href,h=a.getAttribute("href");s.test(i)||!i||a.getAttribute("target")||t.isDefaultPrevented()||e.$$parseLinkUrl(i,h)&&(t.preventDefault(),e.absUrl()!==e.browserUrl()&&r.$apply())}}}),this.location.onUrlChange(function(t,o){var a=e.absUrl(),n=e.$$state;e.$$parse(t),t=e.absUrl(),e.$$state=o;var i=r.$broadcast("$locationChangeStart",t,a,o,n).defaultPrevented;e.absUrl()===t&&(i?(e.$$parse(a),e.state(n),e.setBrowserUrlWithFallback(a,!1,n)):(e.initalizing=!1,r.$broadcast("$locationChangeSuccess",t,a,o,n),e.resetBrowserUpdate()),r.$$phase||r.$digest())}),r.$watch(function(){if(e.initalizing||e.updateBrowser){e.updateBrowser=!1;var t=e.browserUrl(),o=e.absUrl(),a=e.browserState(),n=e.$$replace,i=!e.urlCodec.areEqual(t,o)||a!==e.$$state;(e.initalizing||i)&&(e.initalizing=!1,r.$evalAsync(function(){var o=e.absUrl(),s=r.$broadcast("$locationChangeStart",o,t,e.$$state,a).defaultPrevented;e.absUrl()===o&&(s?(e.$$parse(t),e.$$state=a):(i&&(e.setBrowserUrlWithFallback(o,n,a===e.$$state?null:e.$$state),e.$$replace=!1),r.$broadcast("$locationChangeSuccess",o,t,e.$$state,a)))}))}e.$$replace=!1})},t.prototype.resetBrowserUpdate=function(){this.$$replace=!1,this.$$state=this.browserState(),this.updateBrowser=!1,this.lastBrowserUrl=this.browserUrl()},t.prototype.browserUrl=function(t,e,r){if(void 0===r&&(r=null),t){var o=this.lastHistoryState===r;return t=this.urlCodec.parse(t).href,this.lastBrowserUrl===t&&o?this:(this.lastBrowserUrl=t,this.lastHistoryState=r,t=this.stripBaseUrl(this.getServerBase(),t)||t,e?this.locationStrategy.replaceState(r,"",t,""):this.locationStrategy.pushState(r,"",t,""),this.cacheState(),this)}return this.platformLocation.href},t.prototype.cacheState=function(){this.cachedState=this.platformLocation.getState(),void 0===this.cachedState&&(this.cachedState=null),
/**
* @license
* Copyright Google Inc. All Rights Reserved.
*
* Use of this source code is governed by an MIT-style license that can be
* found in the LICENSE file at https://angular.io/license
*/
function t(e,r){if(e===r)return!0;if(!e||!r)return!1;try{return!(e.prototype!==r.prototype||Array.isArray(e)&&Array.isArray(r))&&JSON.stringify(e)===JSON.stringify(r)}catch(t){return!1}}(this.cachedState,this.lastCachedState)&&(this.cachedState=this.lastCachedState),this.lastCachedState=this.cachedState,this.lastHistoryState=this.cachedState},t.prototype.browserState=function(){return this.cachedState},t.prototype.stripBaseUrl=function(t,e){if(e.startsWith(t))return e.substr(t.length)},t.prototype.getServerBase=function(){var t=this.platformLocation,e=t.port,r=t.protocol+"//"+t.hostname+(e?":"+e:"")+(this.locationStrategy.getBaseHref()||"/");return r.endsWith("/")?r:r+"/"},t.prototype.parseAppUrl=function(t){if(i.test(t))throw new Error("Bad Path - URL cannot start with double slashes: "+t);var e="/"!==t.charAt(0);e&&(t="/"+t);var r=this.urlCodec.parse(t,this.getServerBase());if("string"==typeof r)throw new Error("Bad URL - Cannot parse URL: "+t);var o=e&&"/"===r.pathname.charAt(0)?r.pathname.substring(1):r.pathname;this.$$path=this.urlCodec.decodePath(o),this.$$search=this.urlCodec.decodeSearch(r.search),this.$$hash=this.urlCodec.decodeHash(r.hash),this.$$path&&"/"!==this.$$path.charAt(0)&&(this.$$path="/"+this.$$path)},t.prototype.onChange=function(t,e){void 0===e&&(e=function(t){}),this.$$changeListeners.push([t,e])},t.prototype.$$notifyChangeListeners=function(t,e,r,o){void 0===t&&(t=""),void 0===r&&(r=""),this.$$changeListeners.forEach(function(a){var n=function i(t,e){var r="function"==typeof Symbol&&t[Symbol.iterator];if(!r)return t;var o,a,n=r.call(t),i=[];try{for(;(void 0===e||e-- >0)&&!(o=n.next()).done;)i.push(o.value)}catch(t){a={error:t}}finally{try{o&&!o.done&&(r=n.return)&&r.call(n)}finally{if(a)throw a.error}}return i}(a,2),s=n[0],h=n[1];try{s(t,e,r,o)}catch(t){h(t)}})},t.prototype.$$parse=function(t){var e;if(void 0===(e=t.startsWith("/")?t:this.stripBaseUrl(this.getServerBase(),t)))throw new Error('Invalid url "'+t+'", missing path prefix "'+this.getServerBase()+'".');this.parseAppUrl(e),this.$$path||(this.$$path="/"),this.composeUrls()},t.prototype.$$parseLinkUrl=function(t,e){if(e&&"#"===e[0])return this.hash(e.slice(1)),!0;var r,o=this.stripBaseUrl(this.getServerBase(),t);return void 0!==o?r=this.getServerBase()+o:this.getServerBase()===t+"/"&&(r=this.getServerBase()),r&&this.$$parse(r),!!r},t.prototype.setBrowserUrlWithFallback=function(t,e,r){var o=this.url(),a=this.$$state;try{this.browserUrl(t,e,r),this.$$state=this.browserState(),this.$$notifyChangeListeners(t,r,o,a)}catch(t){throw this.url(o),this.$$state=a,t}},t.prototype.composeUrls=function(){this.$$url=this.urlCodec.normalize(this.$$path,this.$$search,this.$$hash),this.$$absUrl=this.getServerBase()+this.$$url.substr(1),this.updateBrowser=!0},t.prototype.absUrl=function(){return this.$$absUrl},t.prototype.url=function(t){if("string"==typeof t){t.length||(t="/");var e=n.exec(t);return e?((e[1]||""===t)&&this.path(this.urlCodec.decodePath(e[1])),(e[2]||e[1]||""===t)&&this.search(e[3]||""),this.hash(e[5]||""),this):this}return this.$$url},t.prototype.protocol=function(){return this.$$protocol},t.prototype.host=function(){return this.$$host},t.prototype.port=function(){return this.$$port},t.prototype.path=function(t){return void 0===t?this.$$path:(t="/"===(t=null!==t?t.toString():"").charAt(0)?t:"/"+t,this.$$path=t,this.composeUrls(),this)},t.prototype.search=function(t,e){switch(arguments.length){case 0:return this.$$search;case 1:if("string"==typeof t||"number"==typeof t)this.$$search=this.urlCodec.decodeSearch(t.toString());else{if("object"!=typeof t||null===t)throw new Error("LocationProvider.search(): First argument must be a string or an object.");for(var r in t=a({},t))null==t[r]&&delete t[r];this.$$search=t}break;default:if("string"==typeof t){var o=this.search();return null==e?(delete o[t],this.search(o)):(o[t]=e,this.search(o))}}return this.composeUrls(),this},t.prototype.hash=function(t){return void 0===t?this.$$hash:(this.$$hash=null!==t?t.toString():"",this.composeUrls(),this)},t.prototype.replace=function(){return this.$$replace=!0,this},t.prototype.state=function(t){return void 0===t?this.$$state:(this.$$state=t,this)},t}(),p=function(){function t(t,e,r,o,a){this.ngUpgrade=t,this.location=e,this.platformLocation=r,this.urlCodec=o,this.locationStrategy=a}return t.prototype.$get=function(){return new c(this.ngUpgrade.$injector,this.location,this.platformLocation,this.urlCodec,this.locationStrategy)},t.prototype.hashPrefix=function(t){throw new Error("Configure LocationUpgrade through LocationUpgradeModule.config method.")},t.prototype.html5Mode=function(t){throw new Error("Configure LocationUpgrade through LocationUpgradeModule.config method.")},t}(),u=function u(){},l=function(){function t(){}return t.prototype.encodePath=function(t){for(var e=t.split("/"),r=e.length;r--;)e[r]=$(e[r].replace(/%2F/g,"/"));return function o(t){return t.replace(/\/index.html$/,"")}(((t=e.join("/"))&&"/"!==t[0]?"/":"")+t)},t.prototype.encodeSearch=function(t){return"string"==typeof t&&(t=d(t)),(t=function e(t){var e=[],r=function(r){var o=t[r];Array.isArray(o)?o.forEach(function(t){e.push(g(r,!0)+(!0===t?"":"="+g(t,!0)))}):e.push(g(r,!0)+(!0===o?"":"="+g(o,!0)))};for(var o in t)r(o);return e.length?e.join("&"):""}(t))?"?"+t:""},t.prototype.encodeHash=function(t){return(t=$(t))?"#"+t:""},t.prototype.decodePath=function(t,e){void 0===e&&(e=!0);for(var r=t.split("/"),o=r.length;o--;)r[o]=decodeURIComponent(r[o]),e&&(r[o]=r[o].replace(/\//g,"%2F"));return r.join("/")},t.prototype.decodeSearch=function(t){return d(t)},t.prototype.decodeHash=function(t){return"#"===(t=decodeURIComponent(t))[0]?t.substring(1):t},t.prototype.normalize=function(t,e,r,o){if(1===arguments.length){var a=this.parse(t,o);if("string"==typeof a)return a;var n=a.protocol+"://"+a.hostname+(a.port?":"+a.port:"");return this.normalize(this.decodePath(a.pathname),this.decodeSearch(a.search),this.decodeHash(a.hash),n)}var i=this.encodePath(t),s=e&&this.encodeSearch(e)||"",h=r&&this.encodeHash(r)||"",c=(o||"")+i;return c.length&&"/"===c[0]||(c="/"+c),c+s+h},t.prototype.areEqual=function(t,e){return this.normalize(t)===this.normalize(e)},t.prototype.parse=function(t,e){try{var r=new URL(t,e);return{href:r.href,protocol:r.protocol?r.protocol.replace(/:$/,""):"",host:r.host,search:r.search?r.search.replace(/^\?/,""):"",hash:r.hash?r.hash.replace(/^#/,""):"",hostname:r.hostname,port:r.port,pathname:"/"===r.pathname.charAt(0)?r.pathname:"/"+r.pathname}}catch(r){throw new Error("Invalid URL ("+t+") with base ("+e+")")}},t}();function f(t){try{return decodeURIComponent(t)}catch(t){return}}function d(t){var e={};return(t||"").split("&").forEach(function(t){var r,o,a;t&&(o=t=t.replace(/\+/g,"%20"),-1!==(r=t.indexOf("="))&&(o=t.substring(0,r),a=t.substring(r+1)),void 0!==(o=f(o))&&(a=void 0===a||f(a),e.hasOwnProperty(o)?Array.isArray(e[o])?e[o].push(a):e[o]=[e[o],a]:e[o]=a))}),e}function $(t){return g(t,!0).replace(/%26/gi,"&").replace(/%3D/gi,"=").replace(/%2B/gi,"+")}function g(t,e){return void 0===e&&(e=!1),encodeURIComponent(t).replace(/%40/gi,"@").replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%3B/gi,";").replace(/%20/g,e?"%20":"+")}
/**
* @license
* Copyright Google Inc. All Rights Reserved.
*
* Use of this source code is governed by an MIT-style license that can be
* found in the LICENSE file at https://angular.io/license
*/var y=new r.InjectionToken("LOCATION_UPGRADE_CONFIGURATION"),v=new r.InjectionToken("APP_BASE_HREF_RESOLVED"),m=function(){function t(){}var a;return a=t,t.config=function(t){return{ngModule:a,providers:[e.Location,{provide:c,useFactory:b,deps:[o.UpgradeModule,e.Location,e.PlatformLocation,u,e.LocationStrategy]},{provide:y,useValue:t||{}},{provide:u,useFactory:U,deps:[y]},{provide:v,useFactory:S,deps:[y,[new r.Inject(e.APP_BASE_HREF),new r.Optional]]},{provide:e.LocationStrategy,useFactory:w,deps:[e.PlatformLocation,v,y]}]}},a=function n(t,e,r,o){var a,n=arguments.length,i=n<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,r):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)i=Reflect.decorate(t,e,r,o);else for(var s=t.length-1;s>=0;s--)(a=t[s])&&(i=(n<3?a(i):n>3?a(e,r,i):a(e,r))||i);return n>3&&i&&Object.defineProperty(e,r,i),i}([r.NgModule({imports:[e.CommonModule]})],t)}();function S(t,e){return t&&null!=t.appBaseHref?t.appBaseHref:null!=e?e:""}function U(t){return new(t&&t.urlCodec||l)}function w(t,r,o){return void 0===o&&(o={}),o.useHash?new e.HashLocationStrategy(t,r):new e.PathLocationStrategy(t,r)}function b(t,e,r,o,a){return new p(t,e,r,o,a).$get()}
/**
* @license
* Copyright Google Inc. All Rights Reserved.
*
* Use of this source code is governed by an MIT-style license that can be
* found in the LICENSE file at https://angular.io/license
*/
/**
* @license
* Copyright Google Inc. All Rights Reserved.
*
* Use of this source code is governed by an MIT-style license that can be
* found in the LICENSE file at https://angular.io/license
*/
/**
* @license
* Copyright Google Inc. All Rights Reserved.
*
* Use of this source code is governed by an MIT-style license that can be
* found in the LICENSE file at https://angular.io/license
*/tangular_packages_common_upgrade_upgrade_d=b,tangular_packages_common_upgrade_upgrade_a=S,tangular_packages_common_upgrade_upgrade_c=w,tangular_packages_common_upgrade_upgrade_b=U,t.$locationShim=c,t.$locationShimProvider=p,t.LOCATION_UPGRADE_CONFIGURATION=y,t.LocationUpgradeModule=m,t.AngularJSUrlCodec=l,t.UrlCodec=u,Object.defineProperty(t,"__esModule",{value:!0})});