ceProperties};return a}();self.$RuntimeConfig=new v(function(){if(self.getServiceWorkerGlobalClientConfigData&&"function"===typeof self.getServiceWorkerGlobalClientConfigData){var a=self.getServiceWorkerGlobalClientConfigData(),b;if(b=!!a)if((b=e(a,["deviceProperties"]))&&"object"===typeof b){var d=e(b,["appType"]);if(d&&"string"===typeof d){var c=e(b,["deviceType"]);b=c&&"string"===typeof c?p(b,d):!1}else b=!1}else b=!1;if(b&&
q(a))return a}a=new h("InvalidConfigDataReceived","Missing runtime config data");l(a);throw a;}())})();var AUI_JS_DEBUG=!1;(function(){var c=[],f=0,d=function(a){return function(){var b=f++;c.push([a,[].slice.call(arguments,0),b,{time:Date.now()}]);return d(b)}},e=function(a,b){a=d(a);b&&(a=a("instance",b));return a};e._s=c;this.csa=e})();var AUI_JS_DEBUG=!1;
(function(){var a=this&&this.__assign||function(){a=Object.assign||function(e){for(var b,c=1,a=arguments.length;c<a;c++){b=arguments[c];for(var d in b)Object.prototype.hasOwnProperty.call(b,d)&&(e[d]=b[d])}return e};return a.apply(this,arguments)},g=a(a({},{Application:"RetailServiceWorker"}),{"Events.SushiEndpoint":"https://unagi.amazon.com/1/events/com.amazon.csm.csa.prod"}),f=this&&this.__assign||function(){f=Object.assign||function(e){for(var b,c=1,a=arguments.length;c<a;c++){b=arguments[c];for(var d in b)Object.prototype.hasOwnProperty.call(b,
d)&&(e[d]=b[d])}return e};return f.apply(this,arguments)};(function(){if(!g)throw Error("Could not initialize CSA config");var a=self.$RuntimeConfig.getMarketplaceProperties().getMarketplaceId();csa("Config",f(f({},g),{ObfuscatedMarketplaceId:a}))})()})();var AUI_JS_DEBUG=!1;
(function(){var F=self;(function(a){function b(a,d){return x(a,d)}function g(a,d){var e=m[a]||{};v(e,d);m[a]=e;y++;h(r,0)}function c(a,d,e){var b=!0;d=l(d);e&&e.buffered&&(b=(z[a]||[]).every(function(a){return!1!==d(a)}));return b?(B[a]||(B[a]=[]),B[a].push(d),function(){var e=B[a];e&&e.splice(e.indexOf(d),1)}):E}function n(a,d){d=l(d);return a in G?(d(G[a]),E):c(a,function(a){d(a);return!1})}function p(a,d){x("Errors")("logError",a);if(w.DEBUG)throw d||a;}function f(){return Math.abs(4294967295*Math.random()|
0).toString(36)}function l(a,d){return function(){try{return a.apply(this,arguments)}catch(D){p(D.message||D,D)}}}function h(d,e){return a.setTimeout(l(d),e)}function r(){for(var a=0;a<k.length;){var b=k[a],q=b[0]in m;if(!q&&!A){e=k.length;return}q?(e=a,k.splice(a,1),t(b)):a++}d=y}function t(a){var d=m[a[0]],e=a[1],b=e[0];if(!d||!d[b])return p("Undefined function: "+d+"/"+b);q=a[3];m[a[2]]=d[b].apply(d,e.slice(1))||{};q=0}function u(){A=1;r()}function v(a,d){C(d).forEach(function(e){a[e]=d[e]})}var x=
a.csa,w={},m={},k=a.csa._s,e=0,y=0,d=-1,q,A,B={},G={},z={},C=Object.keys,E=function(){};n("$beforeunload",u);g("Config",{instance:function(a){v(w,a)}});x.plugin=l(function(a){a(b)});b.config=w;b.register=g;b.on=c;b.once=n;b.blank=E;b.emit=function(a,d,e){for(var b=B[a]||[],q=0;q<b.length;)!1===b[q](d)?b.splice(q,1):q++;G[a]=d||{};e&&e.buffered&&(z[a]||(z[a]=[]),100<=z[a].length&&z[a].shift(),z[a].push(d||{}))};b.UUID=function(){return[f(),f(),f(),f()].join("-")};b.time=function(a){var d=q?new Date(q.time):
new Date;return"ISO"===a?d.toISOString():d.getTime()};b.error=p;b.warn=function(a,d){x("Errors")("logWarn",a);if(w.DEBUG)throw d||a;};b.exec=l;b.timeout=h;b.interval=function(d,e){return a.setInterval(l(d),e)};b.global=a;a.csa._s.push=function(a){a[0]in m&&(!k.length||A)?(t(a),k.length&&d!==y&&r()):k.splice(e++,0,a)};r();h(function(){h(u,w.SkipMissingPluginsTimeout||5E3)},1)})("undefined"!==typeof F?F:global);csa.plugin(function(a){var b=a.exec,g=a.global,c=a.on;a.raf=function(a){if(g.requestAnimationFrame)return g.requestAnimationFrame(b(a))};
a.on=function(b,g,f,l){if(b&&"function"===typeof b.addEventListener){var h=a.exec(f);b.addEventListener(g,h,l);return function(){b.removeEventListener(g,h,l)}}return"string"===typeof b?c(b,g,f,l):a.blank}});csa.plugin(function(a){function b(b,g){try{var c=a.global[b];p[g]=!!c;c=c||{}}catch(t){c={},p[g]=!1}return c}function g(){c||(c=b("localStorage","local"));n||(n=b("sessionStorage","session"))}var c,n,p={},f=a.exec;a.store=f(function(a,b,f){g();f=f&&f.session?n:c;if(!a)return Object.keys(f);if(!b)return f[a];
f[a]=b});a.storageSupport=f(function(){g();return p});a.deleteStored=f(function(a,b){g();b=b&&b.session?n:c;if("function"===typeof a)for(var f in b)b.hasOwnProperty(f)&&a(f,b[f])&&delete b[f];else delete b[a]})});csa.plugin(function(a){a.types={ovl:function(a){var b=[];if(a)for(var c in a)a.hasOwnProperty(c)&&b.push(a[c]);return b}}});csa.plugin(function(a){function b(b){return function(c){a("Metrics",{producerId:"csa",dimensions:{message:c}})("recordMetric",b,1)}}function g(b){function c(c){g=a.UUID();
f={messageId:g,schemaId:b.schemaId||"\x3cns\x3e.Error.5",errorMessage:c.m||null,attribution:c.attribution||null,logLevel:"FATAL",url:null,file:null,line:null,column:null,stack:c.s||[],context:c.cinfo||{},metadata:{}};c.logLevel&&(f.logLevel=""+c.logLevel);h.forEach(function(a){c[a]&&(f.metadata[a]=c[a])});if("INFO"===c.logLevel)return f;Object.keys(r).forEach(function(a){if("number"===typeof c[r[a]]||"string"===typeof c[r[a]])f[a]=""+c[r[a]]});return f}var g,f,l=a("Events",{producerId:b.producerId}),
h=["name","type","csm","adb"],r={url:"pageURL",file:"f",line:"l",column:"c"};this.log=function(a){a:{if(a)for(g in a){var g=!1;break a}g=!0}g||(g=b.logOptions||{ent:{page:["pageType","subPageType","requestId"]}},l("log",c(a),g))}}a.register("Errors",{instance:function(a){return new g(a||{})},logError:b("jsError"),logWarn:b("jsWarn")})});csa.plugin(function(a){function b(b,c,d){k(c,function(e){var q="all"===d||(d||{})[e];e in b||(b[e]={version:1,id:c[e].id||a.UUID()});g(b[e],c[e],q)})}function g(b,
c,d){k(c,function(e){var g="string"!==typeof c[e]&&"version"!==e?a.error("Attribute is not of type string: "+e):!0===d||1===d?!0:"id"===e||-1!==(d||[]).indexOf(e);g&&(b[e]=c[e])})}function c(a,b,d){k(b,function(b){b=a[b];if(b.schemaId){var e={},c={};e.id=b.id;e.producerId=b.producerId||d;e.schemaId=b.schemaId;e.version=b.version++;e.attributes=c;n(e);g(c,b,1);p(c);w("log",e)}})}function n(b){var e=b.timestamp;"number"===typeof e&&(e=(new Date(e)).toISOString());e=e||a.time("ISO");b.timestamp=e;b.messageId=
b.messageId||a.UUID();b.application=t;b.obfuscatedMarketplaceId=l.ObfuscatedMarketplaceId||"UNKNOWN";b.schemaId=b.schemaId.replace("\x3cns\x3e",r)}function p(a){delete a.version;delete a.schemaId;delete a.producerId}function f(e){var g={};this.log=function(d,c){var f={},q=(c||{}).ent;if(!d)return a.error("The event cannot be undefined");if("string"!==typeof d.schemaId)return a.error("A valid schema id is required for the event");n(d);b(f,m,q);b(f,g,q);b(f,d.entities||{},q);k(f,function(a){p(f[a])});
d.producerId=e.producerId;d.entities=f;v&&(d.lob=x,e&&e.lob&&(d.lob=e.lob),c&&c.lob&&(d.lob=c.lob));w("log",d,c)};this.setEntity=function(a){u&&delete a.session;b(g,a,"all");c(g,a,e.producerId)}}var l=a.config,h=(a.global.location||{}).host,r=l["Events.Namespace"]||"csa_other",t=l.Application||"Other"+(h?":"+h:""),u=l["Transport.AnonymizeRequests"]||!1,v=l.DecorateWithLOB||!1,x=l.lob||"0",w=a("Transport"),m={},k=function(a,b){Object.keys(a).forEach(b)};l["KillSwitch.Events"]||a.register("Events",
{setEntity:function(a){u&&delete a.session;b(m,a,"all");c(m,a,"csa")},removeEntity:function(a){delete m[a]},instance:function(a){return new f(a)}})});csa.plugin(function(a){function b(a){return"function"===typeof a}function g(a){return a&&"object"===typeof a}function c(a){return"string"===typeof a||a instanceof String}function n(a,c,g,f){var d=e&&e[l[a]||"log"];h&&h.TRACE&&b(d)&&d("[CSA:ServiceWorker] "+c,g,f);"le"===a?y("logError",c+" "+g+" "+f):"lw"===a&&y("logWarn",c+" "+g+" "+f)}function p(a,
c,e){var d=a.clientId||(a.source||{}).id,g;n("i","Got fetch-check message from clientId: ",d);d&&k.clients&&(g=k.clients.get(d).then(function(a){a&&b(a.postMessage)&&(n("i","Sending fetch-check success message back to clientId: ",d),a.postMessage({client:d,message:{_messageType:e,success:!0}}))}));return g}function f(a){var d=a.body&&(c(a.body)?a.body:JSON.stringify(a.body)),e=a.url,f=a.headers||w||{"Content-Type":a.type||x||"application/json; charset\x3dUTF-8"};n("i","Got fetch message: ",e,d);if(d&&
e&&b(k.fetch)){if(r)try{var h=JSON.parse(d);h.events&&h.events.length&&b(h.events.forEach)&&h.events.forEach(function(a){g(a)&&g(a.data)&&(a=a.data,"entities"in a&&g(a.entities)?a.entities.transport={type:"ServiceWorker"}:"attributes"in a&&g(a.attributes)&&(a.attributes.transportType="ServiceWorker"))});d=JSON.stringify(h)}catch(C){n("e","Failed to tag entities for fetch request payload: ",C)}a={method:a.httpMethod||t||"POST",body:d,headers:f,credentials:a.credentials||u||"include",mode:a.mode||v||
"cors"};var l=k.fetch(e,a).catch(function(a){n("e","Failed to send fetch request: ",a)});n("i","Sending fetch message: ",e,a)}return l}var l={e:"error",le:"error",w:"warn",lw:"warn",i:"log"},h=a.config||{},r=h["ServiceWorker.Entities.Tag"],t=h["ServiceWorker.HTTP.Method"],u=h["ServiceWorker.HTTP.Credentials"],v=h["ServiceWorker.HTTP.Mode"],x=h["ServiceWorker.HTTP.Content-Type"],w=h["ServiceWorker.HTTP.AllHeaders"],m=a.global||{},k=m.self,e=m.console;m=a.on;var y=a("Errors");k&&(a.isSW=!0,m(k,"message",
function(a){if(a){var c=a.data||{},d=c._messageType;if("fetch"===d)var e=f(c);else if("fetch-check"===d)e=p(a,c,d);else if("config"===d){d=c.config;c=c.replace;if(d){if(c)h=d;else for(var g in d)d.hasOwnProperty(g)&&(h[g]=d[g]);n("i","Config updated: ",h)}e=void 0}else d&&n("le","Unknown event type:",d);e&&b(a.waitUntil)&&a.waitUntil(e)}}),m(k,"install",function(a){a&&b(a.waitUntil)&&b(k.skipWaiting)&&a.waitUntil(k.skipWaiting)}),m(k,"activate",function(a){a&&b(a.waitUntil)&&k.clients&&b(k.clients.claim)&&
a.waitUntil(k.clients.claim())}),a.register("ServiceWorker",{fetch:f}))});csa.plugin(function(a){function b(a){J=function(b,c,d){if(b.post&&(b=b.post(c))){b._messageType="fetch";if(m)k("fetch",b);else if(a)a.postMessage(b);else return 0;d();return 1}return 0}}function g(a,c){C(a,"message",function(a){(a=((a||{}).data||{}).message)&&"fetch-check"===a._messageType&&a.success&&b(c)});c.postMessage({_messageType:"fetch-check"})}function c(){var a=B&&B.serviceWorker;if(a){var b=a.controller;b?g(a,b):(C(a,
"controllerchange",function(){var b=a.controller;b&&g(a,b)}),x&&a.register(x))}}function n(b){(a.store()||[]).forEach(function(c){if(0===c.indexOf("csa.cajun."))try{var d=a.store(c);a.deleteStored(c);JSON.parse(d).forEach(b)}catch(M){a.error(M)}})}function p(b){if(864E5<a.time()-+new Date(b.timestamp))return a.warn("Event is too old: "+b);y<u&&(b.messageId in e||(e[b.messageId]=b,y++),"function"===typeof b.__merge&&b.__merge(e[b.messageId]),!H&&t&&(b=D,D=Math.min(b*K,L),H=z(f,b)))}function f(){d.forEach(function(a){var b=
[];F(e).forEach(function(c){c=e[c];a.accepts(c)&&b.push(c)});b.length&&(a.chunks?a.chunks(b).forEach(function(b){l(a,b)}):l(a,b))});e={};H=0}function l(b,c){var d=a.UUID(),e=function(){a.deleteStored("csa.cajun."+d)};a.store("csa.cajun."+d,JSON.stringify(c));[J,h,r].some(function(a){try{return a(b,c,e)}catch(N){}})}function h(a,b,c){var d=A.navigator||{},e=A.cordova||{};if(!d.sendBeacon||!a.post)return 0;a.preflight&&e&&"ios"===e.platformId&&!q&&((new Image).src=a.preflight().url,q=1);a=a.post(b);
if(!a.type&&d.sendBeacon(a.url,a.body))return c(),1}function r(b,c,d){function e(a,b,c){h.open("POST",a);h.withCredentials=!0;c&&h.setRequestHeader("Content-Type",c);h.send(b)}if(!b.post)return 0;b=b.post(c);var g=b.url,f=b.body,k=b.type,h=new XMLHttpRequest,l=0;h.onload=function(){299>h.status?d():a.config["Transport.XHRRetries"]&&3>l&&(l++,z(function(){e(g,f,k)},l*v))};e(g,f,k);return 1}var t=0,u=a.config["Transport.BufferSize"]||2E3,v=a.config["Transport.RetryDelay"]||1500,x=a.config["Transport.ServiceWorker.JSCodePath"],
w=a.config["Transport.ServiceWorker.Enabled"],m=a.isSW,k=a("ServiceWorker"),e={},y=0,d=[],q,A=a.global,B=A.navigator,G=A.document,z=a.timeout,C=a.on,E=a.once,F=A.Object.keys,I=a.config["Transport.FlushInterval"]||5E3,D=I,K=a.config["Transport.FlushInterval.BackoffFactor"]||1,L=a.config["Transport.FlushInterval.BackoffLimit"]||3E4,H=0,J=a.blank;F&&(m?b():w&&c(),E("$afterload",function(){t=1;n(p);C(G,"visibilitychange",f,!1);f()}),E("$afterunload",function(){t=1;f()}),C("$afterPageTransition",function(){y=
0;D=I}),a.register("Transport",{log:p,register:function(a){d.push(a)}}))});csa.plugin(function(a){var b=a.config["Events.SushiEndpoint"];a("Transport")("register",{accepts:function(a){return a.schemaId},post:function(a){a=a.map(function(a){return{data:a}});return{url:b,body:JSON.stringify({events:a})}},preflight:function(){var a=/\/\/(.*?)\//.exec(b),c;a&&a[1]&&(c="https://"+a[1]+"/ping");return{url:c}},chunks:function(a){for(var b=[];500<a.length;)b.push(a.splice(0,500));b.push(a);return b}})});
csa.plugin(function(a){function b(b){function c(){r=a.UUID();t=a.UUID();u={}}var p=b.producerId,f=b.logger,l=f||a("Events",{producerId:p}),h=(b||{}).dimensions||{},r,t,u={},v=-1;if(!p&&!f)return a.error("Either a producer id or custom logger must be defined");this.recordMetric=function(a,f){var m=b.logOptions||{ent:{page:["pageType","subPageType","requestId"]}};m.debugMetric=b.debugMetric;v!==g&&(c(),v=g);l("log",{messageId:r,schemaId:b.schemaId||"\x3cns\x3e.Metric.3",metrics:{},dimensions:h,__merge:function(b){b.metrics[a]=
f}},m)};this.recordCounter=function(f,h){var m=b.logOptions||{ent:{page:["pageType","subPageType","requestId"]}};if("string"!=typeof f||"number"!=typeof h||!isFinite(h))return a.error("Invalid type given for counter name or counter value: "+f+"/"+h);v!==g&&(c(),v=g);f in u||(u[f]={});var k=u[f];"f"in k||(k.f=h);k.c=(k.c||0)+1;k.s=(k.s||0)+h;k.l=h;l("log",{messageId:t,schemaId:b.schemaId||"\x3cns\x3e.InternalCounters.2",c:{},__merge:function(a){f in a.c||(a.c[f]={});k.fs||(k.fs=1,a.c[f].f=k.f);1<k.c&&
(a.c[f].s=k.s,a.c[f].l=k.l,a.c[f].c=k.c)}},m)}}var g=0;a.config["KillSwitch.Metrics"]||((new b({producerId:"csa"})).recordMetric("baselineMetricEvent",1),a.on("$beforePageTransition",function(){g++}),a.register("Metrics",{instance:function(a){return new b(a||{})}}))});csa.plugin(function(a){function b(){p=a.UUID()}function g(b){b=b||{};var c=b.producerId,f=b.logger,g=f||a("Events",{producerId:c});if(!c&&!f)return a.error("Either a producer id or custom logger must be defined");this.mark=function(c,
f){var h=("undefined"===typeof f?a.time():f)-n;g("log",{messageId:p,schemaId:b.schemaId||"\x3cns\x3e.Timer.1",markers:{},__merge:function(a){a.markers[c]=h}},b.logOptions)}}var c=(a.global.performance||{}).timing,n=(c||{}).navigationStart||a.time(),p;c&&(b(),a.on("$beforePageTransition",b),a.register("Timers",{instance:function(a){return new g(a||{})}}))});csa.plugin(function(a){a.emit("$afterload")})})();var AUI_JS_DEBUG=!1;
(function(G){var H=this&&this.__spreadArray||function(d,b,a){if(a||2===arguments.length)for(var c=0,e=b.length,h;c<e;c++)!h&&c in b||(h||(h=Array.prototype.slice.call(b,0,c)),h[c]=b[c]);return d.concat(h||Array.prototype.slice.call(b))},I=function(d,b,a){for(var c=[],e=3;e<arguments.length;e++)c[e-3]=arguments[e];A.isDebugVerbose&&console.debug.apply(console,H(["%cServiceWorkerMetric%c%c".concat(d,"%c%c").concat(b,"%c ").concat(a),"background-color: #3333ff; color: #FFFFFF; padding: 5px","color: auto",
"background-color: #77ACA2; color: #FFFFFF; padding: 5px","color: auto","background-color: #F5F3BB; padding: 5px","color: auto"],c,!1))},J=Date.now(),l=function(d){setTimeout(d,0)},x=function(d,b,a,c){d.push(b);b="function"===typeof c;for(a=Math.max(a,0);d.length>a;){var e=d.shift();b&&c(e)}},v;(function(d){d.format=function(b){return"".concat("Telemetry",":SW:").concat(b).toLowerCase()}})(v||(v={}));var q;(function(d){d.isObject=function(b){return!!b&&"object"===typeof b&&!Array.isArray(b)};d.isNonEmptyString=
function(b){return"string"===typeof b&&0<b.length};d.matchesPattern=function(b,a){return"string"===typeof b&&a.test(b)}})(q||(q={}));var K=this&&this.__spreadArray||function(d,b,a){if(a||2===arguments.length)for(var c=0,e=b.length,h;c<e;c++)!h&&c in b||(h||(h=Array.prototype.slice.call(b,0,c)),h[c]=b[c]);return d.concat(h||Array.prototype.slice.call(b))},p=function(){function d(){}d.prototype.print=function(b,a){for(var c=[],e=2;e<arguments.length;e++)c[e-2]=arguments[e];I.apply(void 0,K([this.constructor.name,
b,a],c,!1))};d.prototype.printCtor=function(b){this.print("constructor","\x3c\x3c\x3c %o",b)};return d}(),A;(function(d){d.isDebug=AUI_JS_DEBUG;d.isDebugVerbose=d.isDebug&&!1})(A||(A={}));var L=this&&this.__extends||function(){var d=function(b,a){d=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(a,b){a.__proto__=b}||function(a,b){for(var c in b)Object.prototype.hasOwnProperty.call(b,c)&&(a[c]=b[c])};return d(b,a)};return function(b,a){function c(){this.constructor=b}if("function"!==
typeof a&&null!==a)throw new TypeError("Class extends value "+String(a)+" is not a constructor or null");d(b,a);b.prototype=null===a?Object.create(a):(c.prototype=a.prototype,new c)}}(),D=function(d){function b(a,c,b,h){c=d.call(this,c||a)||this;c.name="Telemetry".concat(a,"Error");c.attribution=b||"AmazonServiceWorkerTelemetryClientLib";c.logLevel=h;return c}L(b,d);return b}(Error),r;(function(d){d.create=function(b,a,c,e){return new D(b.toString(),a,c,e)}})(r||(r={}));var z;(function(d){d.USER_DENIED_PERMISSION=
/The user denied permission to use Service Worker/i;d.SERVICE_WORKER_FETCH_API_FAILED=/^Failed to fetch$/i;d.NETWORK_ERROR=/network error/i})(z||(z={}));var B;(function(d){d.isNonCustomerImpactingError=function(b){var a;if(a=b instanceof Error||b instanceof ErrorEvent)b=b.message,a=q.matchesPattern(b,z.USER_DENIED_PERMISSION)||q.matchesPattern(b,z.SERVICE_WORKER_FETCH_API_FAILED)||q.matchesPattern(b,z.NETWORK_ERROR);return a}})(B||(B={}));var M=this&&this.__extends||function(){var d=function(b,a){d=
Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(a,b){a.__proto__=b}||function(a,b){for(var c in b)Object.prototype.hasOwnProperty.call(b,c)&&(a[c]=b[c])};return d(b,a)};return function(b,a){function c(){this.constructor=b}if("function"!==typeof a&&null!==a)throw new TypeError("Class extends value "+String(a)+" is not a constructor or null");d(b,a);b.prototype=null===a?Object.create(a):(c.prototype=a.prototype,new c)}}(),E=function(d){function b(a,b,e){var c=d.call(this)||this;c._swGlobal=
a;c._messageCommand=b;c._clientMessageHandler=e;c._addClientMessageListener();return c}M(b,d);b.prototype._addClientMessageListener=function(){var a=this;this._swGlobal.addEventListener("message",function(b){a._onMessageReceived(b)})};b.prototype._onMessageReceived=function(a){if(a.origin===this._swGlobal.location.origin){var b=a.source;b instanceof WindowClient&&(a=a.data,q.isObject(a)&&"retail_service_worker_messaging"===a.feature&&a.command===this._messageCommand&&this._clientMessageHandler(a,
b))}};return b}(p),N=this&&this.__extends||function(){var d=function(b,a){d=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(a,b){a.__proto__=b}||function(a,b){for(var c in b)Object.prototype.hasOwnProperty.call(b,c)&&(a[c]=b[c])};return d(b,a)};return function(b,a){function c(){this.constructor=b}if("function"!==typeof a&&null!==a)throw new TypeError("Class extends value "+String(a)+" is not a constructor or null");d(b,a);b.prototype=null===a?Object.create(a):(c.prototype=a.prototype,
new c)}}(),O=function(d){function b(a){var b=d.call(this)||this;b._clientDataList=[];new E(a,"page_loaded",b._onClientLoaded.bind(b));return b}N(b,d);b.prototype.getRequestIDForClient=function(a){return(a=this.getClientDataForClient(a))?a.requestID:void 0};b.prototype.getSessionIDForClient=function(a){return(a=this.getClientDataForClient(a))?a.sessionID:void 0};b.prototype.getForesterURLForClient=function(a){return(a=this.getClientDataForClient(a))?a.foresterURL:void 0};b.prototype.getClientDataForClient=
function(a){for(var b,e=0;e<this._clientDataList.length;e++){var h=this._clientDataList[e];if(h.clientID===a){b=h;break}}return b};b.prototype._onClientLoaded=function(a,b){if(!a.data||!q.isNonEmptyString(a.data.rid))throw r.create("InvalidPostbackDataOnPageLoad","Incorrect postback data received on page load",void 0,"ERROR");this.print("processMessage","Page loaded message received from client ".concat(b.id),a);this._saveClientData(a.data,b.id)};b.prototype._saveClientData=function(a,c){x(this._clientDataList,
{clientID:c,requestID:a.rid,sessionID:a.sid,marketplaceID:a.mid,foresterURL:a.furl,pageType:a.pty,subPageType:a.spty},b._MAX_CLIENTS)};b._MAX_CLIENTS=50;return b}(p),P=this&&this.__extends||function(){var d=function(b,a){d=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(a,b){a.__proto__=b}||function(a,b){for(var c in b)Object.prototype.hasOwnProperty.call(b,c)&&(a[c]=b[c])};return d(b,a)};return function(b,a){function c(){this.constructor=b}if("function"!==typeof a&&null!==a)throw new TypeError("Class extends value "+
String(a)+" is not a constructor or null");d(b,a);b.prototype=null===a?Object.create(a):(c.prototype=a.prototype,new c)}}(),t=this&&this.__awaiter||function(d,b,a,c){function e(b){return b instanceof a?b:new a(function(a){a(b)})}return new (a||(a=Promise))(function(a,g){function h(a){try{m(c.next(a))}catch(n){g(n)}}function k(a){try{m(c["throw"](a))}catch(n){g(n)}}function m(b){b.done?a(b.value):e(b.value).then(h,k)}m((c=c.apply(d,b||[])).next())})},u=this&&this.__generator||function(d,b){function a(a){return function(b){return c([a,
b])}}function c(a){if(h)throw new TypeError("Generator is already executing.");for(;e;)try{if(h=1,g&&(f=a[0]&2?g["return"]:a[0]?g["throw"]||((f=g["return"])&&f.call(g),0):g.next)&&!(f=f.call(g,a[1])).done)return f;if(g=0,f)a=[a[0]&2,f.value];switch(a[0]){case 0:case 1:f=a;break;case 4:return e.label++,{value:a[1],done:!1};case 5:e.label++;g=a[1];a=[0];continue;case 7:a=e.ops.pop();e.trys.pop();continue;default:if(!(f=e.trys,f=0<f.length&&f[f.length-1])&&(6===a[0]||2===a[0])){e=0;continue}if(3===a[0]&&
(!f||a[1]>f[0]&&a[1]<f[3]))e.label=a[1];else if(6===a[0]&&e.label<f[1])e.label=f[1],f=a;else if(f&&e.label<f[2])e.label=f[2],e.ops.push(a);else{f[2]&&e.ops.pop();e.trys.pop();continue}}a=b.call(d,e)}catch(w){a=[6,w],g=0}finally{h=f=0}if(a[0]&5)throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}var e={label:0,sent:function(){if(f[0]&1)throw f[1];return f[1]},trys:[],ops:[]},h,g,f,k;return k={next:a(0),"throw":a(1),"return":a(2)},"function"===typeof Symbol&&(k[Symbol.iterator]=function(){return this}),
k},Q=function(d){function b(a){var c=d.call(this)||this;c._swGlobal=a;c._clientReadyList=[];c._bufferedCounters=[];c._bufferedTags=[];c._bufferedWeblabTriggers=[];c._bufferedInternalCounters=[];new E(a,b._POSTBACK_MESSAGE_COMMAND,c._onClientReady.bind(c));return c}P(b,d);b.prototype.count=function(a,c,e){var d=this;void 0===c&&(c=1);l(function(){return t(d,void 0,void 0,function(){var d,h;return u(this,function(f){switch(f.label){case 0:return e?[3,2]:[4,this._logCounterWithoutClient(a,c)];case 1:return f.sent(),
[2];case 2:if(!this._isClientReady(e))return this._bufferCounter({clientID:e,name:a,value:c}),[2];f.label=3;case 3:return f.trys.push([3,5,,6]),[4,this._getClient(e)];case 4:return d=f.sent(),this._postMessage(d,{feature:b._POSTBACK_MESSAGE_FEATURE,command:b._MESSAGING_COMMAND_COUNTER,data:{name:a,value:c}}),[3,6];case 5:return h=f.sent(),this.countInternal(v.format(b._CLIENT_UNAVAILABLE_COUNTER)),this.print("counter",h.message),[3,6];case 6:return[2]}})})})};b.prototype.countInternal=function(a,
c){var e=this;void 0===c&&(c=1);l(function(){return t(e,void 0,void 0,function(){var e;return u(this,function(d){switch(d.label){case 0:return[4,this._getLastAvailableClient()];case 1:if(e=d.sent())return this._postMessage(e,{feature:b._POSTBACK_MESSAGE_FEATURE,command:b._MESSAGING_COMMAND_COUNTER,data:{name:a,value:c}}),[2];x(this._bufferedInternalCounters,{name:a,value:c},b._MAX_INTERNAL_COUNTERS);return[2]}})})})};b.prototype.tag=function(a,c){var e=this;l(function(){return t(e,void 0,void 0,function(){var e,
d;return u(this,function(f){switch(f.label){case 0:if(!this._isClientReady(c))return this._bufferTag({clientID:c,name:a}),[2];f.label=1;case 1:return f.trys.push([1,3,,4]),[4,this._getClient(c)];case 2:return e=f.sent(),this._postMessage(e,{feature:b._POSTBACK_MESSAGE_FEATURE,command:b._MESSAGING_COMMAND_TAG,data:{tag:a}}),[3,4];case 3:return d=f.sent(),this.countInternal(v.format(b._CLIENT_UNAVAILABLE_COUNTER),1),this.print("tag",d.message),[3,4];case 4:return[2]}})})})};b.prototype.weblabTrigger=
function(a,c,e){var d=this;l(function(){return t(d,void 0,void 0,function(){var d,f;return u(this,function(h){switch(h.label){case 0:if(!this._isClientReady(e))return this._bufferWeblabTrigger({clientID:e,name:a,treatment:c}),[2];h.label=1;case 1:return h.trys.push([1,3,,4]),[4,this._getClient(e)];case 2:return d=h.sent(),this._postMessage(d,{feature:b._POSTBACK_MESSAGE_FEATURE,command:b._MESSAGING_COMMAND_WEBLAB_TRIGGER,data:{weblab:a,treatment:c}}),[3,4];case 3:return f=h.sent(),this.countInternal(v.format(b._CLIENT_UNAVAILABLE_COUNTER)),
this.print("weblabtrigger",f.message),[3,4];case 4:return[2]}})})})};b.prototype._isClientReady=function(a){return-1!==this._clientReadyList.indexOf(a)};b.prototype._onClientReady=function(a,c){this.print("processMessage","message ready event received from ".concat(c.id));x(this._clientReadyList,c.id,b._MAX_CLIENTS);this._flushMetricForClient(c)};b.prototype._flushMetricForClient=function(a){var b=this;l(function(){b._drainBufferedCounter(a)});l(function(){b._drainBufferedTags(a)});l(function(){b._drainBufferedWeblabTriggers(a)});
l(function(){b._drainBufferedInternalCounter(a)})};b.prototype._drainBufferedCounter=function(a){for(var c=this,e=[],d=a.id,g=function(h){var g=f._bufferedCounters[h];if(g.clientID&&d!==g.clientID)return e.push(g),"continue";l(function(){return t(c,void 0,void 0,function(){return u(this,function(c){this._postMessage(a,{feature:b._POSTBACK_MESSAGE_FEATURE,command:b._MESSAGING_COMMAND_COUNTER,data:{name:g.name,value:g.value}});return[2]})})})},f=this,k=0;k<this._bufferedCounters.length;k++)g(k);this._bufferedCounters=
e};b.prototype._drainBufferedTags=function(a){for(var c=this,e=[],d=a.id,g=function(h){var g=f._bufferedTags[h];if(d!==g.clientID)return e.push(g),"continue";l(function(){return t(c,void 0,void 0,function(){return u(this,function(c){this._postMessage(a,{feature:b._POSTBACK_MESSAGE_FEATURE,command:b._MESSAGING_COMMAND_TAG,data:{tag:g.name}});return[2]})})})},f=this,k=0;k<this._bufferedTags.length;k++)g(k);this._bufferedTags=e};b.prototype._drainBufferedWeblabTriggers=function(a){for(var c=this,e=[],
d=a.id,g=function(h){var g=f._bufferedWeblabTriggers[h];if(d!==g.clientID)return e.push(g),"continue";l(function(){return t(c,void 0,void 0,function(){return u(this,function(c){this._postMessage(a,{feature:b._POSTBACK_MESSAGE_FEATURE,command:b._MESSAGING_COMMAND_WEBLAB_TRIGGER,data:{weblab:g.name,treatment:g.treatment}});return[2]})})})},f=this,k=0;k<this._bufferedWeblabTriggers.length;k++)g(k);this._bufferedWeblabTriggers=e};b.prototype._drainBufferedInternalCounter=function(a){for(var c=this,e=
function(e){var h=d._bufferedInternalCounters[e];l(function(){return t(c,void 0,void 0,function(){return u(this,function(c){this._postMessage(a,{feature:b._POSTBACK_MESSAGE_FEATURE,command:b._MESSAGING_COMMAND_COUNTER,data:{name:h.name,value:h.value}});return[2]})})})},d=this,g=0;g<this._bufferedInternalCounters.length;g++)e(g);this._bufferedInternalCounters=[]};b.prototype._bufferCounter=function(a){var c=this;x(this._bufferedCounters,a,b._MAX_COUNTERS,function(){c.countInternal(v.format("counter:buffer:overflow"))})};
b.prototype._bufferTag=function(a){var c=this;x(this._bufferedTags,a,b._MAX_TAGS,function(){c.countInternal(v.format("tag:buffer:overflow"))})};b.prototype._bufferWeblabTrigger=function(a){var c=this;x(this._bufferedWeblabTriggers,a,b._MAX_WEBLAB_TRIGGERS,function(){c.countInternal(v.format("weblabTrigger:buffer:overflow"))})};b.prototype._postMessage=function(a,b){a.postMessage(b)};b.prototype._logCounterWithoutClient=function(a,c){return t(this,void 0,void 0,function(){var e;return u(this,function(d){switch(d.label){case 0:return[4,
this._getLastAvailableClient()];case 1:if(e=d.sent())return this._postMessage(e,{feature:b._POSTBACK_MESSAGE_FEATURE,command:b._MESSAGING_COMMAND_COUNTER,data:{name:a,value:c}}),[2];this._bufferCounter({clientID:void 0,name:a,value:c});return[2]}})})};b.prototype._getLastAvailableClient=function(){return t(this,void 0,void 0,function(){var a,b,e,d;return u(this,function(c){switch(c.label){case 0:b=a=this._clientReadyList.length-1,c.label=1;case 1:if(!(0<=b))return[3,6];c.label=2;case 2:return c.trys.push([2,
4,,5]),[4,this._getClient(this._clientReadyList[b])];case 3:return(e=c.sent())?[2,e]:[3,5];case 4:return d=c.sent(),this.print("Looking for last available client",d.message),[3,5];case 5:return b--,[3,1];case 6:return[2]}})})};b.prototype._getClient=function(a){return t(this,void 0,void 0,function(){var b;return u(this,function(c){switch(c.label){case 0:return[4,this._swGlobal.clients.get(a)];case 1:if(b=c.sent())return[2,b];throw r.create("ClientNotFound","Client ".concat(a," not found"));}})})};
b._MAX_CLIENTS=50;b._MAX_COUNTERS=400;b._MAX_TAGS=100;b._MAX_WEBLAB_TRIGGERS=100;b._MAX_INTERNAL_COUNTERS=50;b._POSTBACK_MESSAGE_FEATURE="retail_service_worker_messaging";b._POSTBACK_MESSAGE_COMMAND="client_messaging_ready";b._MESSAGING_COMMAND_COUNTER="log_counter";b._MESSAGING_COMMAND_TAG="log_tag";b._MESSAGING_COMMAND_WEBLAB_TRIGGER="log_weblab_trigger";b._CLIENT_UNAVAILABLE_COUNTER="client:unavailable";return b}(p),R=this&&this.__extends||function(){var d=function(b,a){d=Object.setPrototypeOf||
{__proto__:[]}instanceof Array&&function(a,b){a.__proto__=b}||function(a,b){for(var c in b)Object.prototype.hasOwnProperty.call(b,c)&&(a[c]=b[c])};return d(b,a)};return function(b,a){function c(){this.constructor=b}if("function"!==typeof a&&null!==a)throw new TypeError("Class extends value "+String(a)+" is not a constructor or null");d(b,a);b.prototype=null===a?Object.create(a):(c.prototype=a.prototype,new c)}}(),S=function(d){function b(a){var b=d.call(this)||this;b._clientPostback=new Q(a);b._clientDataProvider=
new O(a);return b}R(b,d);b.prototype.getClientPostback=function(){return this._clientPostback};b.prototype.getClientDataProvider=function(){return this._clientDataProvider};return b}(p),y;(function(d){d.Mshop="mshop";d.Mweb="mweb";d.Desktop="desktop"})(y||(y={}));var C;(C||(C={})).INLatency="in-latency";var T=function(){function d(b,a){this._swGlobal=b;this._clientConfig=a;this._deviceType=this._resolveDeviceType()}d.prototype.count=function(b,a){b={schemaId:this._clientConfig.counterConfig.schemaId,
deviceType:this._deviceType,counterName:b,counterValue:a.toString()};csa("Events",{producerId:this._clientConfig.counterConfig.producerId})("log",b)};d.prototype._resolveDeviceType=function(){if(!this._swGlobal.$RuntimeConfig)return y.Desktop;var b=this._swGlobal.$RuntimeConfig.getDeviceProperties();return"mshop"===b.getAppType()?y.Mshop:"desktop"!==b.getDeviceType()?y.Mweb:y.Desktop};return d}(),U={counterConfig:{producerId:C.INLatency,schemaId:"ServiceWorkerTelemetry.Counter.3"}},V=function(){csa.plugin(function(d){var b=
d.config;d=["Application","Events.SushiEndpoint","ObfuscatedMarketplaceId"];if(!b||"object"!==typeof b||!d.every(function(a){return!!b[a]}))throw r.create("InvalidCSAConfiguration");})},W=/\(?([^\s]*):(\d+):(\d+)\)?/,X=this&&this.__extends||function(){var d=function(b,a){d=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(a,b){a.__proto__=b}||function(a,b){for(var c in b)Object.prototype.hasOwnProperty.call(b,c)&&(a[c]=b[c])};return d(b,a)};return function(b,a){function c(){this.constructor=
b}if("function"!==typeof a&&null!==a)throw new TypeError("Class extends value "+String(a)+" is not a constructor or null");d(b,a);b.prototype=null===a?Object.create(a):(c.prototype=a.prototype,new c)}}(),Y=function(d){function b(a){var b=d.call(this)||this;b.printCtor(arguments);b._defaultAttribution=a;return b}X(b,d);b.prototype.generateErrorRecord=function(a,b,e,d){var c=this._getError(a),f=this._generateStackFrames(c);b={m:this._getErrorMessage(c),name:c.name,logLevel:this._getErrorLogLevel(c,
b),attribution:this._getErrorAttribution(c,e),s:f,t:Date.now()-J};if(a=a instanceof ErrorEvent?this._getErrorLocationFromErrorEvent(a):this._getErrorLocationFromStackFrames(f))b.f=a.fileName,b.l=a.lineNumber,b.c=a.colNumber;d&&(b.cinfo=d);return b};b.prototype._getError=function(a){return a instanceof ErrorEvent?a.error:a};b.prototype._generateStackFrames=function(a){var c=[];a=a.stack?a.stack.trim():"";if(!a)return c;a=a.split("\n");for(var e,d=0;d<a.length&&c.length<b.MAX_STACK_DEPTH;)(e=a[d++].trim())&&
c.push(e);return c};b.prototype._getErrorMessage=function(a){return(a=a.message.trim())?a:"Unknown Error"};b.prototype._getErrorLogLevel=function(a,b){return b||a.logLevel||"FATAL"};b.prototype._getErrorAttribution=function(a,b){return b||a.attribution||this._defaultAttribution};b.prototype._getErrorLocationFromErrorEvent=function(a){return{fileName:a.filename,lineNumber:String(a.lineno),colNumber:String(a.colno)}};b.prototype._getErrorLocationFromStackFrames=function(a){if((a=(1<a.length?a[1]:"").match(W))&&
4===a.length)return{fileName:a[1],lineNumber:a[2],colNumber:a[3]}};b.MAX_STACK_DEPTH=20;return b}(p),Z=this&&this.__extends||function(){var d=function(b,a){d=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(a,b){a.__proto__=b}||function(a,b){for(var c in b)Object.prototype.hasOwnProperty.call(b,c)&&(a[c]=b[c])};return d(b,a)};return function(b,a){function c(){this.constructor=b}if("function"!==typeof a&&null!==a)throw new TypeError("Class extends value "+String(a)+" is not a constructor or null");
d(b,a);b.prototype=null===a?Object.create(a):(c.prototype=a.prototype,new c)}}(),aa=function(d){function b(a,b,e,h){var c=d.call(this)||this;c._errorCount=0;c.printCtor(arguments);c._swGlobal=a;c._foresterClient=e;c._foresterErrorRecordGenerator=new Y(b);c._clientDataProvider=h.getClientDataProvider();c._addGlobalErrorListener();c._startErrorCountResetTimer();return c}Z(b,d);b.prototype.record=function(a,b,e,d,g){this._isNotError(a)||this._hasErrorCountThresholdBreached()?this.print("record","ERROR NOT LOGGED. Received error is not valid or error threshold is breached."):
(this._errorCount++,!b&&B.isNonCustomerImpactingError(a)&&(b="ERROR"),this._recordErrorForClient(a,b,e,d,g),this._logThresholdReached())};b.prototype._addGlobalErrorListener=function(){var a=this;this._swGlobal.addEventListener("error",function(b){l(function(){a.print("globalErrorListener","error event captured",b);a.record(b)})});this._swGlobal.addEventListener("unhandledrejection",function(b){l(function(){b.reason instanceof Error&&(a.print("globalErrorListener","promise rejection error captured",
b),a.record(b.reason))})})};b.prototype._startErrorCountResetTimer=function(){var a=this;setInterval(function(){a._errorCount=0},1E3*b.RESET_ERROR_COUNT_SECONDS)};b.prototype._recordErrorForClient=function(a,b,e,d,g){if(g&&(g.clientID||g.requestID)){var c;g.clientID&&(c=this._clientDataProvider.getClientDataForClient(g.clientID));g.requestID&&(c?c.requestID=g.requestID:c={clientID:g.clientID||"",requestID:g.requestID});this._recordError(a,b,e,d,c)}else this._recordError(a,b,e,d)};b.prototype._recordError=
function(a,b,e,d,g){a=this._foresterErrorRecordGenerator.generateErrorRecord(a,b,e,d);this.print("recordError","Generated error record",a);this._foresterClient.log(a,g);this._logToConsole(a)};b.prototype._logThresholdReached=function(){this._errorCount===b.MAX_ERROR_COUNT&&this._recordError(r.create("ErrorRecordThresholdReached"))};b.prototype._isNotError=function(a){return!(a instanceof Error||a instanceof ErrorEvent)};b.prototype._hasErrorCountThresholdBreached=function(){return this._errorCount>=
b.MAX_ERROR_COUNT};b.prototype._logToConsole=function(a){console.error("SW Telemetry trapped error %o",a)};b.MAX_ERROR_COUNT=50;b.RESET_ERROR_COUNT_SECONDS=60;return b}(p),ba=this&&this.__extends||function(){var d=function(b,a){d=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(a,b){a.__proto__=b}||function(a,b){for(var c in b)Object.prototype.hasOwnProperty.call(b,c)&&(a[c]=b[c])};return d(b,a)};return function(b,a){function c(){this.constructor=b}if("function"!==typeof a&&null!==
a)throw new TypeError("Class extends value "+String(a)+" is not a constructor or null");d(b,a);b.prototype=null===a?Object.create(a):(c.prototype=a.prototype,new c)}}(),ca=this&&this.__awaiter||function(d,b,a,c){function e(b){return b instanceof a?b:new a(function(a){a(b)})}return new (a||(a=Promise))(function(a,g){function f(a){try{m(c.next(a))}catch(n){g(n)}}function h(a){try{m(c["throw"](a))}catch(n){g(n)}}function m(b){b.done?a(b.value):e(b.value).then(f,h)}m((c=c.apply(d,b||[])).next())})},da=
this&&this.__generator||function(d,b){function a(a){return function(b){return c([a,b])}}function c(a){if(h)throw new TypeError("Generator is already executing.");for(;e;)try{if(h=1,g&&(f=a[0]&2?g["return"]:a[0]?g["throw"]||((f=g["return"])&&f.call(g),0):g.next)&&!(f=f.call(g,a[1])).done)return f;if(g=0,f)a=[a[0]&2,f.value];switch(a[0]){case 0:case 1:f=a;break;case 4:return e.label++,{value:a[1],done:!1};case 5:e.label++;g=a[1];a=[0];continue;case 7:a=e.ops.pop();e.trys.pop();continue;default:if(!(f=
e.trys,f=0<f.length&&f[f.length-1])&&(6===a[0]||2===a[0])){e=0;continue}if(3===a[0]&&(!f||a[1]>f[0]&&a[1]<f[3]))e.label=a[1];else if(6===a[0]&&e.label<f[1])e.label=f[1],f=a;else if(f&&e.label<f[2])e.label=f[2],e.ops.push(a);else{f[2]&&e.ops.pop();e.trys.pop();continue}}a=b.call(d,e)}catch(w){a=[6,w],g=0}finally{h=f=0}if(a[0]&5)throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}var e={label:0,sent:function(){if(f[0]&1)throw f[1];return f[1]},trys:[],ops:[]},h,g,f,k;return k={next:a(0),"throw":a(1),
"return":a(2)},"function"===typeof Symbol&&(k[Symbol.iterator]=function(){return this}),k},ea=function(d){function b(){var a=d.call(this)||this;a.printCtor(arguments);return a}ba(b,d);b.prototype.postLogs=function(a,b){return ca(this,void 0,void 0,function(){var c,d,g;return da(this,function(e){switch(e.label){case 0:c=this._getPostbackURL(a),d=this._getRequestOptions(b),e.label=1;case 1:return e.trys.push([1,3,,4]),[4,fetch(c,d)];case 2:return e.sent(),this.print("postLogs","Forester logs posted successfully"),
[3,4];case 3:throw g=e.sent(),this.print("postMetrics","Forester log request failed",g),g;case 4:return[2]}})})};b.prototype._getPostbackURL=function(a){return b.URL_ENDPOINT.replace("{{endpoint}}",a)};b.prototype._getRequestOptions=function(a){return{method:"POST",mode:"no-cors",credentials:"include",body:a}};b.URL_ENDPOINT="//{{endpoint}}/1/batch/1/OE/";return b}(p),fa=this&&this.__extends||function(){var d=function(b,a){d=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(a,b){a.__proto__=
b}||function(a,b){for(var c in b)Object.prototype.hasOwnProperty.call(b,c)&&(a[c]=b[c])};return d(b,a)};return function(b,a){function c(){this.constructor=b}if("function"!==typeof a&&null!==a)throw new TypeError("Class extends value "+String(a)+" is not a constructor or null");d(b,a);b.prototype=null===a?Object.create(a):(c.prototype=a.prototype,new c)}}(),ha=function(d){function b(){var a=d.call(this)||this;a._syntheticRequestID=b._generateRequestID();return a}fa(b,d);b._generateRequestID=function(){for(var a=
"RSW";20>a.length;)a+=Math.floor(9007199254740991*Math.random()).toString();return a.substring(0,20)};b.prototype.getSyntheticRequestID=function(){return this._syntheticRequestID};return b}(p),ia=this&&this.__extends||function(){var d=function(b,a){d=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(a,b){a.__proto__=b}||function(a,b){for(var c in b)Object.prototype.hasOwnProperty.call(b,c)&&(a[c]=b[c])};return d(b,a)};return function(b,a){function c(){this.constructor=b}if("function"!==
typeof a&&null!==a)throw new TypeError("Class extends value "+String(a)+" is not a constructor or null");d(b,a);b.prototype=null===a?Object.create(a):(c.prototype=a.prototype,new c)}}(),ja=this&&this.__awaiter||function(d,b,a,c){function e(b){return b instanceof a?b:new a(function(a){a(b)})}return new (a||(a=Promise))(function(a,g){function f(a){try{m(c.next(a))}catch(n){g(n)}}function h(a){try{m(c["throw"](a))}catch(n){g(n)}}function m(b){b.done?a(b.value):e(b.value).then(f,h)}m((c=c.apply(d,b||
[])).next())})},ka=this&&this.__generator||function(d,b){function a(a){return function(b){return c([a,b])}}function c(a){if(h)throw new TypeError("Generator is already executing.");for(;e;)try{if(h=1,g&&(f=a[0]&2?g["return"]:a[0]?g["throw"]||((f=g["return"])&&f.call(g),0):g.next)&&!(f=f.call(g,a[1])).done)return f;if(g=0,f)a=[a[0]&2,f.value];switch(a[0]){case 0:case 1:f=a;break;case 4:return e.label++,{value:a[1],done:!1};case 5:e.label++;g=a[1];a=[0];continue;case 7:a=e.ops.pop();e.trys.pop();continue;
default:if(!(f=e.trys,f=0<f.length&&f[f.length-1])&&(6===a[0]||2===a[0])){e=0;continue}if(3===a[0]&&(!f||a[1]>f[0]&&a[1]<f[3]))e.label=a[1];else if(6===a[0]&&e.label<f[1])e.label=f[1],f=a;else if(f&&e.label<f[2])e.label=f[2],e.ops.push(a);else{f[2]&&e.ops.pop();e.trys.pop();continue}}a=b.call(d,e)}catch(w){a=[6,w],g=0}finally{h=f=0}if(a[0]&5)throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}var e={label:0,sent:function(){if(f[0]&1)throw f[1];return f[1]},trys:[],ops:[]},h,g,f,k;return k={next:a(0),
"throw":a(1),"return":a(2)},"function"===typeof Symbol&&(k[Symbol.iterator]=function(){return this}),k},la=function(d){function b(a){var c=d.call(this)||this;c.printCtor(arguments);c._swGlobal=a;void c._retrieveSessionIDFromCookieStore();c._syntheticSessionID=b._generateSyntheticSessionID();return c}ia(b,d);b._generateSyntheticSessionID=function(){for(var a="";14>a.length;)a+=Math.floor(9007199254740991*Math.random()).toString();return"000-".concat(a.substring(0,7),"-").concat(a.substring(7,14))};
b.prototype.getSessionID=function(){return this._cachedSessionID||this._syntheticSessionID};b.prototype._retrieveSessionIDFromCookieStore=function(){return ja(this,void 0,void 0,function(){var a,b;return ka(this,function(c){switch(c.label){case 0:if(!("cookieStore"in this._swGlobal&&"get"in this._swGlobal.cookieStore))return[2];c.label=1;case 1:return c.trys.push([1,3,,4]),[4,this._swGlobal.cookieStore.get("session-id")];case 2:return(a=c.sent())&&a.value&&(this._cacheSessionID(a.value),this.print("retrieveSessionIDFromCookieStore",
"Retrieved session id from cookie store ".concat(this._cachedSessionID))),[3,4];case 3:return b=c.sent(),this.print("retrieveSessionIDFromCookieStore","Failed to retrieve cookie from cookie store",b),[3,4];case 4:return[2]}})})};b.prototype._cacheSessionID=function(a){a&&(this._cachedSessionID=a)};return b}(p),ma=this&&this.__extends||function(){var d=function(b,a){d=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(a,b){a.__proto__=b}||function(a,b){for(var c in b)Object.prototype.hasOwnProperty.call(b,
c)&&(a[c]=b[c])};return d(b,a)};return function(b,a){function c(){this.constructor=b}if("function"!==typeof a&&null!==a)throw new TypeError("Class extends value "+String(a)+" is not a constructor or null");d(b,a);b.prototype=null===a?Object.create(a):(c.prototype=a.prototype,new c)}}(),na=function(d){function b(a,b){var c=d.call(this)||this;c.printCtor(arguments);c._swGlobal=a;c._config=b;c._requestIDGenerator=new ha;c._sessionIDProvider=new la(c._swGlobal);return c}ma(b,d);b.prototype.getRequestID=
function(a){return a&&a.requestID?a.requestID:this._requestIDGenerator.getSyntheticRequestID()};b.prototype.getSessionID=function(a){return a&&a.sessionID?a.sessionID:this._sessionIDProvider.getSessionID()};b.prototype.getForesterEndpoint=function(a){return a&&a.foresterURL?a.foresterURL:this._config.foresterEndpoint};return b}(p),oa=this&&this.__extends||function(){var d=function(b,a){d=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(a,b){a.__proto__=b}||function(a,b){for(var c in b)Object.prototype.hasOwnProperty.call(b,
c)&&(a[c]=b[c])};return d(b,a)};return function(b,a){function c(){this.constructor=b}if("function"!==typeof a&&null!==a)throw new TypeError("Class extends value "+String(a)+" is not a constructor or null");d(b,a);b.prototype=null===a?Object.create(a):(c.prototype=a.prototype,new c)}}(),pa=this&&this.__awaiter||function(d,b,a,c){function e(b){return b instanceof a?b:new a(function(a){a(b)})}return new (a||(a=Promise))(function(a,g){function f(a){try{m(c.next(a))}catch(n){g(n)}}function h(a){try{m(c["throw"](a))}catch(n){g(n)}}
function m(b){b.done?a(b.value):e(b.value).then(f,h)}m((c=c.apply(d,b||[])).next())})},qa=this&&this.__generator||function(d,b){function a(a){return function(b){return c([a,b])}}function c(a){if(h)throw new TypeError("Generator is already executing.");for(;e;)try{if(h=1,g&&(f=a[0]&2?g["return"]:a[0]?g["throw"]||((f=g["return"])&&f.call(g),0):g.next)&&!(f=f.call(g,a[1])).done)return f;if(g=0,f)a=[a[0]&2,f.value];switch(a[0]){case 0:case 1:f=a;break;case 4:return e.label++,{value:a[1],done:!1};case 5:e.label++;
g=a[1];a=[0];continue;case 7:a=e.ops.pop();e.trys.pop();continue;default:if(!(f=e.trys,f=0<f.length&&f[f.length-1])&&(6===a[0]||2===a[0])){e=0;continue}if(3===a[0]&&(!f||a[1]>f[0]&&a[1]<f[3]))e.label=a[1];else if(6===a[0]&&e.label<f[1])e.label=f[1],f=a;else if(f&&e.label<f[2])e.label=f[2],e.ops.push(a);else{f[2]&&e.ops.pop();e.trys.pop();continue}}a=b.call(d,e)}catch(w){a=[6,w],g=0}finally{h=f=0}if(a[0]&5)throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}var e={label:0,sent:function(){if(f[0]&1)throw f[1];
return f[1]},trys:[],ops:[]},h,g,f,k;return k={next:a(0),"throw":a(1),"return":a(2)},"function"===typeof Symbol&&(k[Symbol.iterator]=function(){return this}),k},ra=function(d){function b(a,b){var c=d.call(this)||this;c._logQueue=[];c._retryCount=0;c.printCtor(arguments);c._config=b;c._swGlobal=a;c._requestContextProvider=new na(c._swGlobal,c._config);c._foresterRequest=new ea;return c}oa(b,d);b.prototype.log=function(a,b){var c=this._requestContextProvider.getRequestID(b),d=this._requestContextProvider.getSessionID(b);
a={r:c,s:d,m:this._config.marketplaceID,sn:this._config.siteName,c:this._config.channel,data:a};this.print("log","Forester log created",a);this._send([a],b)};b.prototype._send=function(a,b){var c=this,d=this._groupLogs(a);Object.keys(d).forEach(function(a){c.print("send","Sending data for group ".concat(a));void c._sendGroupedLog(d[a],b)})};b.prototype._groupLogs=function(a){var b={};a.forEach(function(a){var c=a.r+a.s+a.m;b[c]||(b[c]=[]);b[c].push(a)});return b};b.prototype._sendGroupedLog=function(a,
b){return pa(this,void 0,void 0,function(){var c,d,g,f;return qa(this,function(e){switch(e.label){case 0:c=this._createPayload(a),d=this._requestContextProvider.getForesterEndpoint(b),e.label=1;case 1:return e.trys.push([1,3,,4]),[4,this._foresterRequest.postLogs(d,c)];case 2:return e.sent(),this._clearLogQueue(),[3,4];case 3:return g=e.sent(),this.print("sendGroupLog","error log posting failed",g),(f=this._logQueue).push.apply(f,a),void 0===this._flushTimeoutID&&this._scheduleRetry(),[3,4];case 4:return[2]}})})};
b.prototype._createPayload=function(a){a=this._buildPostBodyLog(a);try{var b=JSON.stringify(a);if(a.reqs){var d={csmCount:{counter:"foresterPayloadSize",t:0,value:b.length}};d.csmCount.value+=JSON.stringify(d).length;a.reqs.push(d);this.print("createPayload","Payload generated",b);b=JSON.stringify(a)}return b}catch(h){throw new D("ForesterPayloadConversion","Error while converting forester log to payload: ".concat(h));}};b.prototype._buildPostBodyLog=function(a){var b=[],d=a[0];a.forEach(function(a){var c=
{};c[a.c]=a.data;b.push(c)});return{rid:d.r,sid:d.s,mid:d.m,sn:d.sn,reqs:b}};b.prototype._clearLogQueue=function(){this._logQueue.length&&this._flushLogs();this._retryCount=0;this._clearFlushTimeout()};b.prototype._scheduleRetry=function(){var a=this;this._retryCount>=b.MAX_RETRY_COUNT||(this._flushTimeoutID=setTimeout(function(){a._flushLogs();a._clearFlushTimeout()},b.DEFAULT_FLUSH_TIMEOUT_MS*Math.pow(2,this._retryCount)),this._retryCount++)};b.prototype._flushLogs=function(){var a=this;l(function(){a._logQueue.length&&
a._send(a._logQueue.splice(0))})};b.prototype._clearFlushTimeout=function(){"number"===typeof this._flushTimeoutID&&clearTimeout(this._flushTimeoutID);this._flushTimeoutID=void 0};b.MAX_RETRY_COUNT=5;b.DEFAULT_FLUSH_TIMEOUT_MS=1E3;return b}(p),sa=this&&this.__extends||function(){var d=function(b,a){d=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(a,b){a.__proto__=b}||function(a,b){for(var c in b)Object.prototype.hasOwnProperty.call(b,c)&&(a[c]=b[c])};return d(b,a)};return function(b,
a){function c(){this.constructor=b}if("function"!==typeof a&&null!==a)throw new TypeError("Class extends value "+String(a)+" is not a constructor or null");d(b,a);b.prototype=null===a?Object.create(a):(c.prototype=a.prototype,new c)}}(),ta=function(d){function b(a,b){var c=d.call(this)||this;c._clientPostback=a.getClientPostback();c._csaClient=b;return c}sa(b,d);b.prototype.count=function(a,b,d){void 0===b&&(b=1);this._clientPostback.count(a,b,d)};b.prototype.tag=function(a,b){this._clientPostback.tag(a,
b)};b.prototype.weblabTrigger=function(a,b,d){this._clientPostback.weblabTrigger(a,b,d)};b.prototype.mark=function(a,b,d){var c=performance.now();this.count(a,c-b,d)};return b}(p),ua=this&&this.__extends||function(){var d=function(b,a){d=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(a,b){a.__proto__=b}||function(a,b){for(var c in b)Object.prototype.hasOwnProperty.call(b,c)&&(a[c]=b[c])};return d(b,a)};return function(b,a){function c(){this.constructor=b}if("function"!==typeof a&&
null!==a)throw new TypeError("Class extends value "+String(a)+" is not a constructor or null");d(b,a);b.prototype=null===a?Object.create(a):(c.prototype=a.prototype,new c)}}(),va=function(d){function b(a,b,e){var c=d.call(this)||this;c.printCtor(arguments);c._swGlobal=a;c._errorRecorder=b;c._metricRecorder=e;c._attachTelemetryToGlobalContext();return c}ua(b,d);b.prototype.count=function(a,b,d){var c=this;l(function(){var e=d&&q.isNonEmptyString(d.clientID)?d.clientID:void 0;c._metricRecorder.count(a,
b,e)})};b.prototype.tag=function(a,b){var c=this;if(!b||!q.isNonEmptyString(b.clientID))throw r.create("ClientIDMissing","Client id missing for tag ".concat(a));l(function(){c._metricRecorder.tag(a,b.clientID)})};b.prototype.weblabTrigger=function(a,b,d){var c=this;if(!d||!q.isNonEmptyString(d.clientID))throw r.create("ClientIDMissing","Client id missing for triggering weblab ".concat(a,", treatment ").concat(b));l(function(){c._metricRecorder.weblabTrigger(a,b,d.clientID)})};b.prototype.mark=function(a,
b,d){var c=this;l(function(){var e=d&&q.isNonEmptyString(d.clientID)?d.clientID:void 0;c._metricRecorder.mark(a,b,e)})};b.prototype.error=function(a,b,d,h,g){var c=this;l(function(){c._errorRecorder.record(a,b,d,h,g)})};b.prototype._attachTelemetryToGlobalContext=function(){this._swGlobal.$TM=this};return b}(p),F=!1,wa=function(d){if(!d||"object"!==typeof d)throw r.create("InvalidForesterConfiguration");["channel","foresterEndpoint","marketplaceID","siteName","attribution"].forEach(function(b){b=
d[b];if("string"!==typeof b||!b.length)throw r.create("InvalidForesterConfiguration");})};G.init=function(d){if(F)throw r.create("DuplicateLibraryInitialization");wa(d.foresterConfig);V();var b=d.swGlobal||self,a=d.foresterConfig,c=new ra(b,a);d=new S(b);a=new aa(b,a.attribution,c,d);c=new T(b,U);d=new ta(d,c);new va(b,a,d);F=!0}})(this.ServiceWorkerTelemetry=this.ServiceWorkerTelemetry||{});var AUI_JS_DEBUG=!1;
(function(c){var a=this&&this.__assign||function(){a=Object.assign||function(a){for(var b,d=1,c=arguments.length;d<c;d++){b=arguments[d];for(var e in b)Object.prototype.hasOwnProperty.call(b,e)&&(a[e]=b[e])}return a};return a.apply(this,arguments)},f=a({marketplaceID:"ATVPDKIKX0DER",foresterEndpoint:"fls-na.amazon.com"},{channel:"jserr-rw",attribution:"RetailServiceWorker",siteName:self.location.hostname});c.foresterConfig=f})(this.ServiceWorkerTelemetryConfiguration=this.ServiceWorkerTelemetryConfiguration||{});(function(){(function(Rb){function Sb(h,b,a){if(N.isDebugVerbose){var e=a.value;a.value=function(){for(var a=[],g=0;g<arguments.length;g++)a[g]=arguments[g];g=this.constructor.name===h.constructor.name?this.constructor.name:"".concat(this.constructor.name," (").concat(h.constructor.name,")");C.print(g,b,"".concat("\x3c\x3c\x3c"," %o"),a);C.rightShift();a=e.apply(this,a);C.leftShift();C.print(g,b,"".concat("\x3e\x3e\x3e"," %o"),a);return a};return a}}function k(){for(var h=[],b=0;b<arguments.length;b++)h[b]=
arguments[b];switch(h.length){case 3:if("number"!==typeof h[2])return Sb(h[0],h[1],h[2]);default:throw r.create("UnsupportedLogDecorator");}}var W;(function(h){h.isMShop=function(){return!1};h.getCountryCode=function(b){b=b.$RuntimeConfig&&"function"===typeof b.$RuntimeConfig.getMarketplaceProperties?b.$RuntimeConfig.getMarketplaceProperties():void 0;if(b&&"function"===typeof b.getCountryCode)return b.getCountryCode()}})(W||(W={}));var u;(function(h){var b="AmazonLightsaberServiceWorkerClientLib-1.0.999.0".match(/^([^\-]+)\-((\w+\.\w+)(?:\.\w+)*)$/);
var a=b&&b[1]&&b[2]&&b[3]?b.slice(1):["unknown","unknown","unknown"];b=a[0];var e=a[1];a=a[2];h.NAMESPACE="Lightsaber";h.NAMESPACE_UCASE=h.NAMESPACE.toUpperCase();h.NAMESPACE_LCASE=h.NAMESPACE.toLowerCase();h.NAMESPACE_SHORT="lsbr";h.BRAZIL_NAME=b;h.FULL_VERSION=e;h.VERSION=a;h.HELP_LINK="https://tiny.amazon.com/171he0ngb"})(u||(u={}));var X;(function(h){h.pushClamped=function(b,a,e,c){b.push(a);a="function"===typeof c;for(e=Math.max(e,0);b.length>e;){var g=b.shift();a&&c(g)}}})(X||(X={}));var ma;
(function(h){h.removeHeadersWithPrefix=function(b,a){var e=new Headers(b);e.forEach(function(c,b){0===b.indexOf(a)&&e.delete(b)});return e};h.getCommonHTMLHeaders=function(b){var a=new Headers({"content-type":"text/html; charset\x3dutf-8","x-content-type-options":"nosniff","x-frame-options":"SAMEORIGIN","x-xss-protection":"1"});b&&b.forEach(function(b,c){a.set(c,b)});return a}})(ma||(ma={}));var Tb=this&&this.__awaiter||function(h,b,a,e){function c(c){return c instanceof a?c:new a(function(a){a(c)})}
return new (a||(a=Promise))(function(a,f){function d(a){try{l(e.next(a))}catch(m){f(m)}}function g(a){try{l(e["throw"](a))}catch(m){f(m)}}function l(b){b.done?a(b.value):c(b.value).then(d,g)}l((e=e.apply(h,b||[])).next())})},Ub=this&&this.__generator||function(h,b){function a(a){return function(c){return e([a,c])}}function e(a){if(g)throw new TypeError("Generator is already executing.");for(;c;)try{if(g=1,f&&(d=a[0]&2?f["return"]:a[0]?f["throw"]||((d=f["return"])&&d.call(f),0):f.next)&&!(d=d.call(f,
a[1])).done)return d;if(f=0,d)a=[a[0]&2,d.value];switch(a[0]){case 0:case 1:d=a;break;case 4:return c.label++,{value:a[1],done:!1};case 5:c.label++;f=a[1];a=[0];continue;case 7:a=c.ops.pop();c.trys.pop();continue;default:if(!(d=c.trys,d=0<d.length&&d[d.length-1])&&(6===a[0]||2===a[0])){c=0;continue}if(3===a[0]&&(!d||a[1]>d[0]&&a[1]<d[3]))c.label=a[1];else if(6===a[0]&&c.label<d[1])c.label=d[1],d=a;else if(d&&c.label<d[2])c.label=d[2],c.ops.push(a);else{d[2]&&c.ops.pop();c.trys.pop();continue}}a=b.call(h,
c)}catch(p){a=[6,p],f=0}finally{g=d=0}if(a[0]&5)throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}var c={label:0,sent:function(){if(d[0]&1)throw d[1];return d[1]},trys:[],ops:[]},g,f,d,n;return n={next:a(0),"throw":a(1),"return":a(2)},"function"===typeof Symbol&&(n[Symbol.iterator]=function(){return this}),n},Vb=this&&this.__spreadArray||function(h,b,a){if(a||2===arguments.length)for(var e=0,c=b.length,g;e<c;e++)!g&&e in b||(g||(g=Array.prototype.slice.call(b,0,e)),g[e]=b[e]);return h.concat(g||Array.prototype.slice.call(b))},
Q;(function(h){var b=this;h.replaceAsync=function(a,e,c){return Tb(b,void 0,void 0,function(){var b,f;return Ub(this,function(d){switch(d.label){case 0:if("function"!==typeof c)return[2,a.replace(e,c)];b=[];a.replace(e,function(a){for(var d=[],e=1;e<arguments.length;e++)d[e-1]=arguments[e];d=c.call.apply(c,Vb([void 0,a],d,!1));b.push(d);return""});return[4,Promise.all(b)];case 1:return f=d.sent(),[2,a.replace(e,function(){return f.shift()})]}})})};h.pad=function(a,b,c){a=a.toString();return"function"===
typeof a.padStart?a.padStart(b,c):a};h.generateRandomSequence=function(a,b){for(var c="";c.length<a;)c+=Math.floor(9007199254740991*Math.random()).toString(b);return c.substring(0,a)}})(Q||(Q={}));var Wb=this&&this.__spreadArray||function(h,b,a){if(a||2===arguments.length)for(var e=0,c=b.length,g;e<c;e++)!g&&e in b||(g||(g=Array.prototype.slice.call(b,0,e)),g[e]=b[e]);return h.concat(g||Array.prototype.slice.call(b))},C;(function(h){var b=0,a=function(){var a=new Date,c=Q.pad(a.getHours(),2,"0"),
b=Q.pad(a.getMinutes(),2,"0"),f=Q.pad(a.getSeconds(),2,"0");a=Q.pad(a.getMilliseconds(),3,"0");return"".concat(c,":").concat(b,":").concat(f,".").concat(a)};h.print=function(e,c,g){for(var f=[],d=3;d<arguments.length;d++)f[d-3]=arguments[d];N.isDebugVerbose&&(d="  ".repeat(b||0),console.debug.apply(console,Wb(["%c".concat(a(),"%c%c").concat(u.NAMESPACE,"%c  ").concat(d,"%c").concat(e,"%c%c").concat(c,"%c ").concat(g),"background-color: #e1eaeb; color: #fff; padding: 5px 8px","color: auto; font-weight: normal",
"background-color: #3498db; color: #fff; padding: 5px 8px","color: auto; font-weight: normal","background-color: #f39c12; color: #fff; padding: 5px 8px","color: auto; font-weight: normal","background-color: #e1eaeb; padding: 5px 8px","color: auto; font-weight: normal"],f,!1)))};h.rightShift=function(){return 25>=b?b++:b};h.leftShift=function(){return 1<=b?b--:b}})(C||(C={}));var ta;(function(h){var b=W.isMShop()?"SMA":"SW";h.format=function(a){return"".concat(u.NAMESPACE,":").concat(b,":").concat(a).toLowerCase()}})(ta||
(ta={}));var Xb=this&&this.__extends||function(){var h=function(b,a){h=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(a,c){a.__proto__=c}||function(a,c){for(var b in c)Object.prototype.hasOwnProperty.call(c,b)&&(a[b]=c[b])};return h(b,a)};return function(b,a){function e(){this.constructor=b}if("function"!==typeof a&&null!==a)throw new TypeError("Class extends value "+String(a)+" is not a constructor or null");h(b,a);b.prototype=null===a?Object.create(a):(e.prototype=a.prototype,new e)}}(),
Yb=function(h){function b(a,e,c,g,f){c=h.call(this,b._getMessage(a,g,e,c))||this;c.name="".concat(u.NAMESPACE,"Error");c.code=a;c.data=e;c.logLevel=f;return c}Xb(b,h);b._getMessage=function(a,b,c,g){b=b?"- ".concat(b,"."):"";if(void 0!==c){var e=I.serialize(c);"{}"===e&&"function"===typeof c.toString&&(e=c.toString());b="".concat(b," Occurred with ").concat(e,".").trim()}g&&(c=g.stack?"".concat(g.stack):"".concat(g),b="".concat(b," Caused by ").concat(c).trim());return"".concat(a," ").concat(b)};
return b}(Error),r;(function(h){h.create=function(b,a,e,c,g){return new Yb(b.toString(),a,e,c,g)};h.wrap=function(b,a,e,c,g){return b.hasOwnProperty("code")?b:h.create(a,e,b,c,g)}})(r||(r={}));var K;(function(h){h.matchesCode=function(b,a){return b instanceof Error&&b.hasOwnProperty("code")&&b.code===a};h.matchesSignature=function(b,a){return b instanceof Error&&q.matchesPattern(b.message,a)}})(K||(K={}));var Y;(function(h){h.NETWORK_ERROR=/network error/i;h.FAILED_TO_FETCH=/failed to fetch/i;h.UNEXPECTED_INTERNAL_ERROR=
/Unexpected internal error/i})(Y||(Y={}));var nb=this&&this.__awaiter||function(h,b,a,e){function c(c){return c instanceof a?c:new a(function(a){a(c)})}return new (a||(a=Promise))(function(a,f){function d(a){try{l(e.next(a))}catch(m){f(m)}}function g(a){try{l(e["throw"](a))}catch(m){f(m)}}function l(b){b.done?a(b.value):c(b.value).then(d,g)}l((e=e.apply(h,b||[])).next())})},ob=this&&this.__generator||function(h,b){function a(a){return function(c){return e([a,c])}}function e(a){if(g)throw new TypeError("Generator is already executing.");
for(;c;)try{if(g=1,f&&(d=a[0]&2?f["return"]:a[0]?f["throw"]||((d=f["return"])&&d.call(f),0):f.next)&&!(d=d.call(f,a[1])).done)return d;if(f=0,d)a=[a[0]&2,d.value];switch(a[0]){case 0:case 1:d=a;break;case 4:return c.label++,{value:a[1],done:!1};case 5:c.label++;f=a[1];a=[0];continue;case 7:a=c.ops.pop();c.trys.pop();continue;default:if(!(d=c.trys,d=0<d.length&&d[d.length-1])&&(6===a[0]||2===a[0])){c=0;continue}if(3===a[0]&&(!d||a[1]>d[0]&&a[1]<d[3]))c.label=a[1];else if(6===a[0]&&c.label<d[1])c.label=
d[1],d=a;else if(d&&c.label<d[2])c.label=d[2],c.ops.push(a);else{d[2]&&c.ops.pop();c.trys.pop();continue}}a=b.call(h,c)}catch(p){a=[6,p],f=0}finally{g=d=0}if(a[0]&5)throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}var c={label:0,sent:function(){if(d[0]&1)throw d[1];return d[1]},trys:[],ops:[]},g,f,d,n;return n={next:a(0),"throw":a(1),"return":a(2)},"function"===typeof Symbol&&(n[Symbol.iterator]=function(){return this}),n},ua;(function(h){var b=this;h.getResponseWithRelay=function(a){return nb(b,
void 0,void 0,function(){var b;return ob(this,function(c){switch(c.label){case 0:if(!a.preloadResponse)return[2,fetch(a.request)];c.label=1;case 1:return c.trys.push([1,3,,4]),[4,a.preloadResponse];case 2:return(b=c.sent())?[2,b]:[2,fetch(a.request)];case 3:return c.sent(),[2,fetch(a.request)];case 4:return[2]}})})};h.getResponseWithoutRelay=function(a){return nb(b,void 0,void 0,function(){var b;return ob(this,function(c){switch(c.label){case 0:if(!a.preloadResponse)throw r.create("PreloadResponseUnsupported");
return[4,a.preloadResponse];case 1:b=c.sent();if(!b)throw r.create("PreloadResponseUnexpected");return[2,b]}})})}})(ua||(ua={}));var Ia=this&&this.__assign||function(){Ia=Object.assign||function(h){for(var b,a=1,e=arguments.length;a<e;a++){b=arguments[a];for(var c in b)Object.prototype.hasOwnProperty.call(b,c)&&(h[c]=b[c])}return h};return Ia.apply(this,arguments)},Zb=this&&this.__awaiter||function(h,b,a,e){function c(c){return c instanceof a?c:new a(function(a){a(c)})}return new (a||(a=Promise))(function(a,
f){function d(a){try{l(e.next(a))}catch(m){f(m)}}function g(a){try{l(e["throw"](a))}catch(m){f(m)}}function l(b){b.done?a(b.value):c(b.value).then(d,g)}l((e=e.apply(h,b||[])).next())})},$b=this&&this.__generator||function(h,b){function a(a){return function(c){return e([a,c])}}function e(a){if(g)throw new TypeError("Generator is already executing.");for(;c;)try{if(g=1,f&&(d=a[0]&2?f["return"]:a[0]?f["throw"]||((d=f["return"])&&d.call(f),0):f.next)&&!(d=d.call(f,a[1])).done)return d;if(f=0,d)a=[a[0]&
2,d.value];switch(a[0]){case 0:case 1:d=a;break;case 4:return c.label++,{value:a[1],done:!1};case 5:c.label++;f=a[1];a=[0];continue;case 7:a=c.ops.pop();c.trys.pop();continue;default:if(!(d=c.trys,d=0<d.length&&d[d.length-1])&&(6===a[0]||2===a[0])){c=0;continue}if(3===a[0]&&(!d||a[1]>d[0]&&a[1]<d[3]))c.label=a[1];else if(6===a[0]&&c.label<d[1])c.label=d[1],d=a;else if(d&&c.label<d[2])c.label=d[2],c.ops.push(a);else{d[2]&&c.ops.pop();c.trys.pop();continue}}a=b.call(h,c)}catch(p){a=[6,p],f=0}finally{g=
d=0}if(a[0]&5)throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}var c={label:0,sent:function(){if(d[0]&1)throw d[1];return d[1]},trys:[],ops:[]},g,f,d,n;return n={next:a(0),"throw":a(1),"return":a(2)},"function"===typeof Symbol&&(n[Symbol.iterator]=function(){return this}),n},ea;(function(h){h.shallow=function(b){return Ia({},b)};(function(b){var a=this;b.json=function(a){return JSON.parse(JSON.stringify(a))};b.structuredCloneAsync=function(b){return Zb(a,void 0,void 0,function(){return $b(this,function(a){return[2,
new Promise(function(a){var c=new MessageChannel;c.port1.postMessage(b);c.port2.onmessage=function(c){a(c.data)}})]})})}})(h.deep||(h.deep={}))})(ea||(ea={}));var ac=this&&this.__awaiter||function(h,b,a,e){function c(c){return c instanceof a?c:new a(function(a){a(c)})}return new (a||(a=Promise))(function(a,f){function d(a){try{l(e.next(a))}catch(m){f(m)}}function g(a){try{l(e["throw"](a))}catch(m){f(m)}}function l(b){b.done?a(b.value):c(b.value).then(d,g)}l((e=e.apply(h,b||[])).next())})},bc=this&&
this.__generator||function(h,b){function a(a){return function(c){return e([a,c])}}function e(a){if(g)throw new TypeError("Generator is already executing.");for(;c;)try{if(g=1,f&&(d=a[0]&2?f["return"]:a[0]?f["throw"]||((d=f["return"])&&d.call(f),0):f.next)&&!(d=d.call(f,a[1])).done)return d;if(f=0,d)a=[a[0]&2,d.value];switch(a[0]){case 0:case 1:d=a;break;case 4:return c.label++,{value:a[1],done:!1};case 5:c.label++;f=a[1];a=[0];continue;case 7:a=c.ops.pop();c.trys.pop();continue;default:if(!(d=c.trys,
d=0<d.length&&d[d.length-1])&&(6===a[0]||2===a[0])){c=0;continue}if(3===a[0]&&(!d||a[1]>d[0]&&a[1]<d[3]))c.label=a[1];else if(6===a[0]&&c.label<d[1])c.label=d[1],d=a;else if(d&&c.label<d[2])c.label=d[2],c.ops.push(a);else{d[2]&&c.ops.pop();c.trys.pop();continue}}a=b.call(h,c)}catch(p){a=[6,p],f=0}finally{g=d=0}if(a[0]&5)throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}var c={label:0,sent:function(){if(d[0]&1)throw d[1];return d[1]},trys:[],ops:[]},g,f,d,n;return n={next:a(0),"throw":a(1),"return":a(2)},
"function"===typeof Symbol&&(n[Symbol.iterator]=function(){return this}),n},O;(function(h){var b=this;h.validateIsUsable=function(a){if(!(a instanceof Response))throw r.create("ResponseInvalid");if("opaqueredirect"===a.type)throw r.create("ResponseOpaqueRedirect");if(!(a.body instanceof ReadableStream))throw r.create("ResponseBodyInvalid");if(a.bodyUsed||a.body.locked)throw r.create("ResponseBodyUnusable");};h.validateIsOK=function(a){if(!(a instanceof Response))throw r.create("ResponseInvalid");
if(!a.ok||206===a.status)throw r.create("ResponseNotOK");};h.matchPatterns=function(a,e){return ac(b,void 0,void 0,function(){var c;return bc(this,function(b){switch(b.label){case 0:return h.validateIsUsable(a),h.validateIsOK(a),[4,a.text()];case 1:return c=b.sent(),[2,e.map(function(a){return c.match(a)})]}})})}})(O||(O={}));var I;(function(h){h.serialize=function(b,a){void 0===a&&(a=!1);try{return a?JSON.stringify(b,void 0,4):JSON.stringify(b)}catch(e){return C.print("SafeJSON","encode","JSON stringify failed, input\x3d".concat(b)),
"{}"}};h.deserialize=function(b){try{return JSON.parse(b)}catch(a){return C.print("SafeJSON","decode","JSON parse failed, input\x3d".concat(b)),{}}}})(I||(I={}));var J;(function(h){h.parse=function(b,a){try{return new URL(b,a)}catch(e){C.print("SafeURL","parse","URL parse failed, input\x3d".concat(b))}};h.encode=function(b){return(b=h.parse(b))?b.href:void 0}})(J||(J={}));var P;(function(h){h.encode=function(b){return encodeURIComponent(b)};h.encodeRFC3986=function(b){return h.encode(b).replace(/[!'()*]/g,
function(a){return"%".concat(a.charCodeAt(0).toString(16).toUpperCase())})};h.decode=function(b){try{return decodeURIComponent(b)}catch(a){C.print("SafeURIEncode","decode","decodeURIComponent failed, input\x3d".concat(b))}}})(P||(P={}));var Ja;(function(h){h.onlyWordChars=function(b){return b.replace(/[^\w]+/gim,"")}})(Ja||(Ja={}));var cc=this&&this.__awaiter||function(h,b,a,e){function c(c){return c instanceof a?c:new a(function(a){a(c)})}return new (a||(a=Promise))(function(a,f){function d(a){try{l(e.next(a))}catch(m){f(m)}}
function g(a){try{l(e["throw"](a))}catch(m){f(m)}}function l(b){b.done?a(b.value):c(b.value).then(d,g)}l((e=e.apply(h,b||[])).next())})},dc=this&&this.__generator||function(h,b){function a(a){return function(c){return e([a,c])}}function e(a){if(g)throw new TypeError("Generator is already executing.");for(;c;)try{if(g=1,f&&(d=a[0]&2?f["return"]:a[0]?f["throw"]||((d=f["return"])&&d.call(f),0):f.next)&&!(d=d.call(f,a[1])).done)return d;if(f=0,d)a=[a[0]&2,d.value];switch(a[0]){case 0:case 1:d=a;break;
case 4:return c.label++,{value:a[1],done:!1};case 5:c.label++;f=a[1];a=[0];continue;case 7:a=c.ops.pop();c.trys.pop();continue;default:if(!(d=c.trys,d=0<d.length&&d[d.length-1])&&(6===a[0]||2===a[0])){c=0;continue}if(3===a[0]&&(!d||a[1]>d[0]&&a[1]<d[3]))c.label=a[1];else if(6===a[0]&&c.label<d[1])c.label=d[1],d=a;else if(d&&c.label<d[2])c.label=d[2],c.ops.push(a);else{d[2]&&c.ops.pop();c.trys.pop();continue}}a=b.call(h,c)}catch(p){a=[6,p],f=0}finally{g=d=0}if(a[0]&5)throw a[1];return{value:a[0]?a[1]:
void 0,done:!0}}var c={label:0,sent:function(){if(d[0]&1)throw d[1];return d[1]},trys:[],ops:[]},g,f,d,n;return n={next:a(0),"throw":a(1),"return":a(2)},"function"===typeof Symbol&&(n[Symbol.iterator]=function(){return this}),n},na;(function(h){var b=this;h.drain=function(a,e){return cc(b,void 0,void 0,function(){var c,b;return dc(this,function(g){switch(g.label){case 0:return c=a.getReader(),[4,c.read()];case 1:b=g.sent(),g.label=2;case 2:if(b.done)return[3,4];e(b.value);return[4,c.read()];case 3:return b=
g.sent(),[3,2];case 4:return[2]}})})}})(na||(na={}));var Ka=this&&this.__awaiter||function(h,b,a,e){function c(c){return c instanceof a?c:new a(function(a){a(c)})}return new (a||(a=Promise))(function(a,f){function d(a){try{l(e.next(a))}catch(m){f(m)}}function g(a){try{l(e["throw"](a))}catch(m){f(m)}}function l(b){b.done?a(b.value):c(b.value).then(d,g)}l((e=e.apply(h,b||[])).next())})},La=this&&this.__generator||function(h,b){function a(a){return function(c){return e([a,c])}}function e(a){if(g)throw new TypeError("Generator is already executing.");
for(;c;)try{if(g=1,f&&(d=a[0]&2?f["return"]:a[0]?f["throw"]||((d=f["return"])&&d.call(f),0):f.next)&&!(d=d.call(f,a[1])).done)return d;if(f=0,d)a=[a[0]&2,d.value];switch(a[0]){case 0:case 1:d=a;break;case 4:return c.label++,{value:a[1],done:!1};case 5:c.label++;f=a[1];a=[0];continue;case 7:a=c.ops.pop();c.trys.pop();continue;default:if(!(d=c.trys,d=0<d.length&&d[d.length-1])&&(6===a[0]||2===a[0])){c=0;continue}if(3===a[0]&&(!d||a[1]>d[0]&&a[1]<d[3]))c.label=a[1];else if(6===a[0]&&c.label<d[1])c.label=
d[1],d=a;else if(d&&c.label<d[2])c.label=d[2],c.ops.push(a);else{d[2]&&c.ops.pop();c.trys.pop();continue}}a=b.call(h,c)}catch(p){a=[6,p],f=0}finally{g=d=0}if(a[0]&5)throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}var c={label:0,sent:function(){if(d[0]&1)throw d[1];return d[1]},trys:[],ops:[]},g,f,d,n;return n={next:a(0),"throw":a(1),"return":a(2)},"function"===typeof Symbol&&(n[Symbol.iterator]=function(){return this}),n},t;(function(h){var b=this;h.queueTask=function(a,b){setTimeout(a,b||0)};h.wait=
function(a){return Ka(b,void 0,void 0,function(){return La(this,function(b){return[2,new Promise(function(c){setTimeout(c,a)})]})})};h.nextTask=function(){return Ka(b,void 0,void 0,function(){return La(this,function(a){return[2,h.wait(0)]})})};h.queueMicrotask=function(a){Promise.resolve().then(function(){a()})};h.nextMicrotask=function(){return Ka(b,void 0,void 0,function(){return La(this,function(a){return[2,Promise.resolve()]})})}})(t||(t={}));var E;(function(h){h.getEpoch=function(){return Date.now()};
h.getEpochSeconds=function(b){void 0===b&&(b=h.getEpoch());return Math.round(b/1E3)};h.getUTCDate=function(b){void 0===b&&(b=h.getEpoch());return(new Date(b)).toUTCString()};h.getPerfNow=function(){return performance.now()}})(E||(E={}));var q;(function(h){h.isObject=function(b){return!!b&&"object"===typeof b&&!Array.isArray(b)};h.isNonEmptyString=function(b){return"string"===typeof b&&0<b.length};h.isPositiveInteger=function(b){return"number"===typeof b&&Math.floor(b)===b&&0<=b&&Infinity!==b};h.isFunction=
function(b){return"function"===typeof b};h.isBoolean=function(b){return!0===b||!1===b};h.isNonEmptyArray=function(b){return Array.isArray(b)&&0<b.length};h.isOneOf=function(b,a){return-1!==a.indexOf(b)};h.isArrayWhereEvery=function(b,a){return Array.isArray(b)&&b.every(a)};h.isUndefinedOr=function(b,a){return void 0===b||a};h.matchesPattern=function(b,a){return"string"===typeof b&&a.test(b)};h.isURL=function(b){return"string"===typeof b&&!!J.parse(b)}})(q||(q={}));var z;(function(h){var b=function(a,
b,c){return c?"\x3c".concat(b,' id\x3d"').concat(c,'"\x3e').concat(a,"\x3c/").concat(b,"\x3e"):"\x3c".concat(b,"\x3e").concat(a,"\x3c/").concat(b,"\x3e")};h.div=function(a,e){return b(a,"div",e)};h.style=function(a,e){return b(a,"style",e)};h.script=function(a,e,c){if(!e)return b("(function(){".concat(a,";})();"),"script",c);e=I.serialize(e);e=P.encodeRFC3986(e);return b('(function(){var model\x3dJSON.parse(decodeURIComponent("'.concat(e,'"));').concat(a,";})();"),"script",c)}})(z||(z={}));var Ma;
(function(h){h.escapeRegExp=function(b){return b.replace(/[.*+?^${}()|[\]\\]/g,"\\$\x26")}})(Ma||(Ma={}));var ec=this&&this.__spreadArray||function(h,b,a){if(a||2===arguments.length)for(var e=0,c=b.length,g;e<c;e++)!g&&e in b||(g||(g=Array.prototype.slice.call(b,0,e)),g[e]=b[e]);return h.concat(g||Array.prototype.slice.call(b))},v=function(){function h(){}h.prototype.log=function(b,a){for(var e=[],c=2;c<arguments.length;c++)e[c-2]=arguments[c];C.print.apply(C,ec([this.constructor.name,b,a],e,!1))};
h.prototype.logCtor=function(b){this.log("constructor","\x3c\x3c\x3c %o",b)};return h}(),N;(function(h){h.isDebug=!1;h.isDebugVerbose=h.isDebug&&!1})(N||(N={}));var fc=this&&this.__extends||function(){var h=function(b,a){h=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(a,c){a.__proto__=c}||function(a,c){for(var b in c)Object.prototype.hasOwnProperty.call(c,b)&&(a[b]=c[b])};return h(b,a)};return function(b,a){function e(){this.constructor=b}if("function"!==typeof a&&null!==a)throw new TypeError("Class extends value "+
String(a)+" is not a constructor or null");h(b,a);b.prototype=null===a?Object.create(a):(e.prototype=a.prototype,new e)}}(),R=this&&this.__assign||function(){R=Object.assign||function(h){for(var b,a=1,e=arguments.length;a<e;a++){b=arguments[a];for(var c in b)Object.prototype.hasOwnProperty.call(b,c)&&(h[c]=b[c])}return h};return R.apply(this,arguments)},S=this&&this.__decorate||function(h,b,a,e){var c=arguments.length,g=3>c?b:null===e?e=Object.getOwnPropertyDescriptor(b,a):e,f;if("object"===typeof Reflect&&
"function"===typeof Reflect.decorate)g=Reflect.decorate(h,b,a,e);else for(var d=h.length-1;0<=d;d--)if(f=h[d])g=(3>c?f(g):3<c?f(b,a,g):f(b,a))||g;return 3<c&&g&&Object.defineProperty(b,a,g),g},pb=function(h){function b(a,b){var c=h.call(this)||this;c.logCtor(arguments);c._swGlobal=a;c._requireNavigationPreloadSupport=b.usePreloadResponseOnlyForServerResponseOnNavigations;c._logToPageProxy();return c}fc(b,h);b.isCookieStoreSupported=function(a){return"cookieStore"in a&&"function"===typeof a.cookieStore.get};
b.prototype.validate=function(){if(!this._isBasicOK())throw r.create("UnsupportedBrowserContext");var a=this._getFeatureFailures();if(0!==a.length)throw r.create("APIUnsupported",{failures:a});};b.prototype.supports=function(){return this._isBasicOK()&&this._isFeatureOK()};b.prototype._isBasicOK=function(){return 0===this._getBasicFailures().length};b.prototype._isFeatureOK=function(){return 0===this._getFeatureFailures().length};b.prototype._getBasicFailures=function(){var a=this._swGlobal,b={Global:!!a,
ServiceWorkerGlobalScope:"ServiceWorkerGlobalScope"in a,ServiceWorkerRegistration:"ServiceWorkerRegistration"in a,Promise:"Promise"in a};return Object.keys(b).filter(function(a){return!b[a]})};b.prototype._getFeatureFailures=function(){var a=this._swGlobal,b={URL:"URL"in a,Headers:"Headers"in a,Request:"Request"in a,Response:"Response"in a,ReadableStream:"ReadableStream"in a,TextDecoder:"TextDecoder"in a,TextEncoder:"TextEncoder"in a,Uint8Array:"Uint8Array"in a,caches:"caches"in a,clients:"clients"in
a,WindowClient:"WindowClient"in a,performance:"performance"in a};b.Request&&(b=R(R({},b),{RequestMethod:"method"in Request.prototype,RequestMode:"mode"in Request.prototype,RequestDestination:"destination"in Request.prototype,RequestCredentials:"credentials"in Request.prototype,RequestRedirect:"redirect"in Request.prototype,RequestHeaders:"headers"in Request.prototype,RequestIsHistoryNavigation:"isHistoryNavigation"in Request.prototype}));b.Response&&(b=R(R({},b),{ResponseBody:"body"in Response.prototype,
ResponseType:"type"in Response.prototype,ResponseHeaders:"headers"in Response.prototype,ResponseRedirect:"function"===typeof Response.redirect}));this._requireNavigationPreloadSupport&&(b=R(R({},b),{NavigationPreload:"NavigationPreloadManager"in a&&"navigationPreload"in ServiceWorkerRegistration.prototype&&"function"===typeof NavigationPreloadManager.prototype.getState&&a.registration&&a.registration.navigationPreload&&a.registration.navigationPreload.getState()instanceof Promise}));return Object.keys(b).filter(function(a){return!b[a]})};
b.prototype._logToPageProxy=function(){var a=this;this._isBasicOK()&&this._swGlobal.addEventListener("aui-sw:page-proxy:feature-tags:request",function(b){b=b.detail.callback;var c=[];c.push("Version:".concat(u.VERSION));c.push("Supported:".concat(a._isFeatureOK()?"Yes":"No"));b(Promise.resolve(c.map(function(a){return ta.format("Client:".concat(a))})))})};S([k],b.prototype,"validate",null);S([k],b.prototype,"supports",null);S([k],b.prototype,"_isBasicOK",null);S([k],b.prototype,"_isFeatureOK",null);
S([k],b.prototype,"_getBasicFailures",null);S([k],b.prototype,"_getFeatureFailures",null);S([k],b.prototype,"_logToPageProxy",null);S([k],b,"isCookieStoreSupported",null);return b}(v),fa;(function(h){h.create=function(b){return{timeOriginEpoch:E.getEpoch(),timeOriginPerfNow:E.getPerfNow(),clientId:b||"unknown",errorContext:{BuildVersion:u.FULL_VERSION}}}})(fa||(fa={}));var gc=this&&this.__extends||function(){var h=function(b,a){h=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(a,c){a.__proto__=
c}||function(a,c){for(var b in c)Object.prototype.hasOwnProperty.call(c,b)&&(a[b]=c[b])};return h(b,a)};return function(b,a){function e(){this.constructor=b}if("function"!==typeof a&&null!==a)throw new TypeError("Class extends value "+String(a)+" is not a constructor or null");h(b,a);b.prototype=null===a?Object.create(a):(e.prototype=a.prototype,new e)}}(),D=this&&this.__decorate||function(h,b,a,e){var c=arguments.length,g=3>c?b:null===e?e=Object.getOwnPropertyDescriptor(b,a):e,f;if("object"===typeof Reflect&&
"function"===typeof Reflect.decorate)g=Reflect.decorate(h,b,a,e);else for(var d=h.length-1;0<=d;d--)if(f=h[d])g=(3>c?f(g):3<c?f(b,a,g):f(b,a))||g;return 3<c&&g&&Object.defineProperty(b,a,g),g},G=this&&this.__awaiter||function(h,b,a,e){function c(c){return c instanceof a?c:new a(function(a){a(c)})}return new (a||(a=Promise))(function(a,f){function d(a){try{l(e.next(a))}catch(m){f(m)}}function g(a){try{l(e["throw"](a))}catch(m){f(m)}}function l(b){b.done?a(b.value):c(b.value).then(d,g)}l((e=e.apply(h,
b||[])).next())})},H=this&&this.__generator||function(h,b){function a(a){return function(c){return e([a,c])}}function e(a){if(g)throw new TypeError("Generator is already executing.");for(;c;)try{if(g=1,f&&(d=a[0]&2?f["return"]:a[0]?f["throw"]||((d=f["return"])&&d.call(f),0):f.next)&&!(d=d.call(f,a[1])).done)return d;if(f=0,d)a=[a[0]&2,d.value];switch(a[0]){case 0:case 1:d=a;break;case 4:return c.label++,{value:a[1],done:!1};case 5:c.label++;f=a[1];a=[0];continue;case 7:a=c.ops.pop();c.trys.pop();
continue;default:if(!(d=c.trys,d=0<d.length&&d[d.length-1])&&(6===a[0]||2===a[0])){c=0;continue}if(3===a[0]&&(!d||a[1]>d[0]&&a[1]<d[3]))c.label=a[1];else if(6===a[0]&&c.label<d[1])c.label=d[1],d=a;else if(d&&c.label<d[2])c.label=d[2],c.ops.push(a);else{d[2]&&c.ops.pop();c.trys.pop();continue}}a=b.call(h,c)}catch(p){a=[6,p],f=0}finally{g=d=0}if(a[0]&5)throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}var c={label:0,sent:function(){if(d[0]&1)throw d[1];return d[1]},trys:[],ops:[]},g,f,d,n;return n=
{next:a(0),"throw":a(1),"return":a(2)},"function"===typeof Symbol&&(n[Symbol.iterator]=function(){return this}),n},hc=function(h){function b(a,e,c,g,f,d){var n=h.call(this)||this;n.logCtor(arguments);n._swGlobal=a;n._metricsService=e;n._plugins=c;n._cacheFullName="".concat(b._CACHE_NAME_PREFIX).concat(g);n._cacheFullNameWithVersion="".concat(n._cacheFullName,"V").concat(f);n._errorLoggingScope="CacheOperator:".concat(g);d&&n._cleanupCache();t.queueMicrotask(function(){return G(n,void 0,void 0,function(){return H(this,
function(a){switch(a.label){case 0:return[4,this._primeCache()];case 1:return a.sent(),[2]}})})});return n}gc(b,h);b.prototype.read=function(a,b,c){return G(this,void 0,void 0,function(){var e,f,d,h,l,p;return H(this,function(g){switch(g.label){case 0:e=this._toInternalRequest(b),f=ea.shallow(c),d=0,g.label=1;case 1:if(!(d<this._plugins.length))return[3,4];h=this._plugins[d];return"function"!==typeof h.requestWillBeUsed?[3,3]:[4,h.requestWillBeUsed("read",e,f)];case 2:p=g.sent(),e=p[0],f=p[1],g.label=
3;case 3:return d++,[3,1];case 4:return[4,this._read(a,e,this._getInternalCacheQueryOptions())];case 5:l=g.sent(),d=this._plugins.length-1,g.label=6;case 6:if(!(0<=d))return[3,9];h=this._plugins[d];return"function"!==typeof h.responseWillBeUsed?[3,8]:[4,h.responseWillBeUsed(e,l,f)];case 7:l=g.sent(),g.label=8;case 8:return d--,[3,6];case 9:return[2,l]}})})};b.prototype.write=function(a,b,c,g){return G(this,void 0,void 0,function(){var e,d,h,l,p,k,q;return H(this,function(f){switch(f.label){case 0:e=
this._toInternalRequest(b),d=this._cloneResponse(a,c),h=ea.shallow(g),l=0,f.label=1;case 1:if(!(l<this._plugins.length))return[3,7];p=this._plugins[l];return"function"!==typeof p.requestWillBeUsed?[3,3]:[4,p.requestWillBeUsed("write",e,h)];case 2:q=f.sent(),e=q[0],h=q[1],f.label=3;case 3:return"function"!==typeof p.cacheWillUpdate?[3,5]:[4,p.cacheWillUpdate(e,d,h)];case 4:d=f.sent(),f.label=5;case 5:if(void 0===d)return this.log("write","Cancelled by ".concat(p.getName(),' plugin via "cacheWillUpdate" hook')),
[2];f.label=6;case 6:return l++,[3,1];case 7:return[4,this._read(a,e,this._getInternalCacheQueryOptions())];case 8:return k=f.sent(),[4,this._write(a,e,d)];case 9:f.sent(),l=this._plugins.length-1,f.label=10;case 10:if(!(0<=l))return[3,13];p=this._plugins[l];return"function"!==typeof p.cacheDidUpdate?[3,12]:[4,p.cacheDidUpdate(e,k,d,h)];case 11:f.sent(),f.label=12;case 12:return l--,[3,10];case 13:return[2]}})})};b.prototype.evict=function(a,b,c){return G(this,void 0,void 0,function(){var e,f,d,h,
l,p,k;return H(this,function(g){switch(g.label){case 0:e=this._toInternalRequest(b),f=ea.shallow(c),d=0,g.label=1;case 1:if(!(d<this._plugins.length))return[3,4];h=this._plugins[d];return"function"!==typeof h.requestWillBeUsed?[3,3]:[4,h.requestWillBeUsed("evict",e,f)];case 2:k=g.sent(),e=k[0],f=k[1],g.label=3;case 3:return d++,[3,1];case 4:return[4,this._read(a,e,this._getInternalCacheQueryOptions())];case 5:return l=g.sent(),[4,this._evict(a,e,this._getInternalCacheQueryOptions())];case 6:p=g.sent();
if(!p)return[2,p];d=this._plugins.length-1;g.label=7;case 7:if(!(0<=d))return[3,10];h=this._plugins[d];return"function"!==typeof h.cacheDidUpdate?[3,9]:[4,h.cacheDidUpdate(e,l,void 0,f)];case 8:g.sent(),g.label=9;case 9:return d--,[3,7];case 10:return[2,p]}})})};b.prototype.exists=function(a,b,c){return G(this,void 0,void 0,function(){var e;return H(this,function(g){switch(g.label){case 0:return[4,this.read(a,b,c)];case 1:return e=g.sent(),[2,!!e]}})})};b.prototype._read=function(a,b,c){return G(this,
void 0,void 0,function(){var e,f;return H(this,function(d){switch(d.label){case 0:return d.trys.push([0,2,,3]),[4,this._getCache(a)];case 1:return e=d.sent(),[2,e.match(b,c)];case 2:throw f=d.sent(),this._metricsService.error(a,f,this._errorLoggingScope),this._metricsService.countError(a,f,this._errorLoggingScope),f;case 3:return[2]}})})};b.prototype._write=function(a,b,c){return G(this,void 0,void 0,function(){var e,f,d,h,l;return H(this,function(g){switch(g.label){case 0:return g.trys.push([0,4,
,5]),[4,t.nextTask()];case 1:g.sent();if("GET"!==b.method)throw r.create("RequestMethodNotGet",{method:b.method});e=J.parse(b.url);if(!e)throw r.create("InvalidURL",{url:b.url});f=e.protocol;if("http:"!==f&&"https:"!==f)throw r.create("RequestURLSchemeNonHTTP",{scheme:f});O.validateIsUsable(c);O.validateIsOK(c);return[4,this._getCache(a)];case 2:return d=g.sent(),[4,d.put(b,c)];case 3:return g.sent(),[3,5];case 4:throw h=g.sent(),l=K.matchesSignature(h,Y.NETWORK_ERROR),this._metricsService.error(a,
h,this._errorLoggingScope,l?"ERROR":void 0),this._metricsService.countError(a,h,l?"".concat("NetworkError",":").concat(this._errorLoggingScope):this._errorLoggingScope),h;case 5:return[2]}})})};b.prototype._evict=function(a,b,c){return G(this,void 0,void 0,function(){var e,f;return H(this,function(d){switch(d.label){case 0:return d.trys.push([0,3,,4]),[4,t.nextTask()];case 1:return d.sent(),[4,this._getCache(a)];case 2:return e=d.sent(),[2,e.delete(b,c)];case 3:throw f=d.sent(),this._metricsService.error(a,
f,this._errorLoggingScope),this._metricsService.countError(a,f,this._errorLoggingScope),f;case 4:return[2]}})})};b.prototype._getCache=function(a){return G(this,void 0,void 0,function(){var b,c,g;return H(this,function(e){switch(e.label){case 0:if(this._cache)return[2,this._cache];b=E.getPerfNow();return[4,this._swGlobal.caches.open(this._cacheFullNameWithVersion)];case 1:return c=e.sent(),g="".concat(this._errorLoggingScope,":CacheOpen"),this._metricsService.mark(a,g,b),this._metricsService.tag(a,
g),this._cache||(this._cache=c),[2,this._cache]}})})};b.prototype._primeCache=function(){return G(this,void 0,void 0,function(){var a,b,c,g;return H(this,function(e){switch(e.label){case 0:a=fa.create(),e.label=1;case 1:return e.trys.push([1,3,,4]),[4,this._getCache(a)];case 2:return e.sent(),[3,4];case 3:return b=e.sent(),c=r.create("CacheOpen",{cacheName:this._cacheFullNameWithVersion},b),g=K.matchesSignature(b,Y.UNEXPECTED_INTERNAL_ERROR),this._metricsService.error(a,c,this._errorLoggingScope,
g?"ERROR":void 0),[3,4];case 4:return[2]}})})};b.prototype._cleanupCache=function(){var a=this,b=function(){return G(a,void 0,void 0,function(){var a,b,e;return H(this,function(c){switch(c.label){case 0:return[4,this._swGlobal.caches.keys()];case 1:a=c.sent(),b=0,c.label=2;case 2:if(!(b<a.length))return[3,5];e=a[b];return 0!==e.indexOf(this._cacheFullName)||e===this._cacheFullNameWithVersion?[3,4]:[4,this._swGlobal.caches.delete(e)];case 3:c.sent(),c.label=4;case 4:return b++,[3,2];case 5:return[2]}})})};
this._swGlobal.addEventListener("activate",function(a){a.waitUntil(b())})};b.prototype._toInternalRequest=function(a){a=P.encode("string"===typeof a?a:a.url);a="https://".concat(u.NAMESPACE_LCASE,"?key\x3d").concat(a);return new Request(a,{method:"GET"})};b.prototype._cloneResponse=function(a,b){try{return b.clone()}catch(c){throw b=r.wrap(c,"ResponseClone"),this._metricsService.error(a,b,this._errorLoggingScope),this._metricsService.countError(a,b,this._errorLoggingScope),b;}};b.prototype._getInternalCacheQueryOptions=
function(){return{ignoreMethod:!1,ignoreSearch:!1,ignoreVary:!0}};b._CACHE_NAME_PREFIX=u.NAMESPACE;D([k],b.prototype,"read",null);D([k],b.prototype,"write",null);D([k],b.prototype,"evict",null);D([k],b.prototype,"exists",null);D([k],b.prototype,"_read",null);D([k],b.prototype,"_write",null);D([k],b.prototype,"_evict",null);D([k],b.prototype,"_getCache",null);D([k],b.prototype,"_primeCache",null);D([k],b.prototype,"_cleanupCache",null);D([k],b.prototype,"_toInternalRequest",null);D([k],b.prototype,
"_cloneResponse",null);D([k],b.prototype,"_getInternalCacheQueryOptions",null);return b}(v),Na;(function(h){var b=/(?:^|(?:\s*,\s*))([^\x00-\x20\(\)<>@,;:\\"\/\[\]\?=\{\}\x7F]+)(?:=(?:([^\x00-\x20\(\)<>@,;:\\"\/\[\]\?=\{\}\x7F]+)|(?:"((?:[^"\\]|\\.)*)")))?/g;h.parseCacheControl=function(a){var e={};a=a.get("cache-control");if(!a)return e;a.replace(b,function(a,b,f,d){a=f||d;e[b]=a?a.toLowerCase():!0;return""});e["max-age"]&&(a=parseInt(e["max-age"],10),isNaN(a)?delete e["max-age"]:e["max-age"]=a);
return e};h.hasLightsaberNoStore=function(a){return h.parseCacheControl(a.headers).hasOwnProperty("lightsaber-no-store")}})(Na||(Na={}));var va;(function(h){var b="x-amz-".concat(u.NAMESPACE_LCASE,"-");h.REQUEST_ID_OPF_HEADER="x-amz-rid";h.getLibHeader=function(a){return"".concat(b).concat(a).trim().toLowerCase()};h.getClientOnlyLibHeader=function(a){return"".concat(b,"clientonly-").concat(a).trim().toLowerCase()};h.removeLibHeaders=function(a){return ma.removeHeadersWithPrefix(a,b)}})(va||(va={}));
var Oa;(function(h){var b=va.getLibHeader("client-version");h.appendClientVersion=function(a){a.append(b,u.VERSION)}})(Oa||(Oa={}));var Pa;(function(h){h.getParamName=function(){return"lsskpint"};h.getParam=function(b){return b.searchParams.get("lsskpint")};h.setParam=function(b,a){b.searchParams.append("lsskpint",a)}})(Pa||(Pa={}));var x;(function(h){h.cacheControl=Na;h.clientInfo=Oa;h.shared=va;h.skipIntercept=Pa})(x||(x={}));var ic=this&&this.__extends||function(){var h=function(b,a){h=Object.setPrototypeOf||
{__proto__:[]}instanceof Array&&function(a,c){a.__proto__=c}||function(a,c){for(var b in c)Object.prototype.hasOwnProperty.call(c,b)&&(a[b]=c[b])};return h(b,a)};return function(b,a){function e(){this.constructor=b}if("function"!==typeof a&&null!==a)throw new TypeError("Class extends value "+String(a)+" is not a constructor or null");h(b,a);b.prototype=null===a?Object.create(a):(e.prototype=a.prototype,new e)}}(),oa=this&&this.__decorate||function(h,b,a,e){var c=arguments.length,g=3>c?b:null===e?
e=Object.getOwnPropertyDescriptor(b,a):e,f;if("object"===typeof Reflect&&"function"===typeof Reflect.decorate)g=Reflect.decorate(h,b,a,e);else for(var d=h.length-1;0<=d;d--)if(f=h[d])g=(3>c?f(g):3<c?f(b,a,g):f(b,a))||g;return 3<c&&g&&Object.defineProperty(b,a,g),g},Qa=function(h){function b(){var a=h.call(this)||this;a.logCtor(arguments);return a}ic(b,h);b.prototype.getName=function(){return this.NAME};b.prototype.getPrefixedHeaderName=function(a){return x.shared.getClientOnlyLibHeader(a)};b.prototype.encodeHeaderValue=
function(a){return P.encode(I.serialize(a))};b.prototype.decodeHeaderValue=function(a){return(a=P.decode(a))?I.deserialize(a):void 0};b.prototype.updateResponseHeaders=function(a,b){return new Response(a.body,{headers:b,status:a.status,statusText:a.statusText})};oa([k],b.prototype,"getName",null);oa([k],b.prototype,"getPrefixedHeaderName",null);oa([k],b.prototype,"encodeHeaderValue",null);oa([k],b.prototype,"decodeHeaderValue",null);oa([k],b.prototype,"updateResponseHeaders",null);return b}(v),jc=
this&&this.__extends||function(){var h=function(b,a){h=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(a,c){a.__proto__=c}||function(a,c){for(var b in c)Object.prototype.hasOwnProperty.call(c,b)&&(a[b]=c[b])};return h(b,a)};return function(b,a){function e(){this.constructor=b}if("function"!==typeof a&&null!==a)throw new TypeError("Class extends value "+String(a)+" is not a constructor or null");h(b,a);b.prototype=null===a?Object.create(a):(e.prototype=a.prototype,new e)}}(),wa=this&&
this.__decorate||function(h,b,a,e){var c=arguments.length,g=3>c?b:null===e?e=Object.getOwnPropertyDescriptor(b,a):e,f;if("object"===typeof Reflect&&"function"===typeof Reflect.decorate)g=Reflect.decorate(h,b,a,e);else for(var d=h.length-1;0<=d;d--)if(f=h[d])g=(3>c?f(g):3<c?f(b,a,g):f(b,a))||g;return 3<c&&g&&Object.defineProperty(b,a,g),g},qb=this&&this.__awaiter||function(h,b,a,e){function c(c){return c instanceof a?c:new a(function(a){a(c)})}return new (a||(a=Promise))(function(a,f){function d(a){try{l(e.next(a))}catch(m){f(m)}}
function g(a){try{l(e["throw"](a))}catch(m){f(m)}}function l(b){b.done?a(b.value):c(b.value).then(d,g)}l((e=e.apply(h,b||[])).next())})},rb=this&&this.__generator||function(h,b){function a(a){return function(c){return e([a,c])}}function e(a){if(g)throw new TypeError("Generator is already executing.");for(;c;)try{if(g=1,f&&(d=a[0]&2?f["return"]:a[0]?f["throw"]||((d=f["return"])&&d.call(f),0):f.next)&&!(d=d.call(f,a[1])).done)return d;if(f=0,d)a=[a[0]&2,d.value];switch(a[0]){case 0:case 1:d=a;break;
case 4:return c.label++,{value:a[1],done:!1};case 5:c.label++;f=a[1];a=[0];continue;case 7:a=c.ops.pop();c.trys.pop();continue;default:if(!(d=c.trys,d=0<d.length&&d[d.length-1])&&(6===a[0]||2===a[0])){c=0;continue}if(3===a[0]&&(!d||a[1]>d[0]&&a[1]<d[3]))c.label=a[1];else if(6===a[0]&&c.label<d[1])c.label=d[1],d=a;else if(d&&c.label<d[2])c.label=d[2],c.ops.push(a);else{d[2]&&c.ops.pop();c.trys.pop();continue}}a=b.call(h,c)}catch(p){a=[6,p],f=0}finally{g=d=0}if(a[0]&5)throw a[1];return{value:a[0]?a[1]:
void 0,done:!0}}var c={label:0,sent:function(){if(d[0]&1)throw d[1];return d[1]},trys:[],ops:[]},g,f,d,n;return n={next:a(0),"throw":a(1),"return":a(2)},"function"===typeof Symbol&&(n[Symbol.iterator]=function(){return this}),n},kc=function(h){function b(){var a=h.call(this)||this;a.NAME="MaxAge";a.logCtor(arguments);a._header="".concat(h.prototype.getPrefixedHeaderName.call(a,a.NAME));return a}jc(b,h);b.prototype.cacheWillUpdate=function(a,b,c){return qb(this,void 0,void 0,function(){var a,e;return rb(this,
function(d){if(!b)return[2,b];a={startSeconds:this._getRequestStartTimestampSeconds(c),deltaSeconds:this._getMaxAgeSeconds(c)};if(0>a.startSeconds||0>a.deltaSeconds)return[2];e=new Headers(b.headers||{});e.append(this._header,this.encodeHeaderValue(a));return[2,this.updateResponseHeaders(b,e)]})})};b.prototype.responseWillBeUsed=function(a,b,c){return qb(this,void 0,void 0,function(){var a,c,d,e;return rb(this,function(g){if(!b)return[2,b];a=b.headers.get(this._header);if(!a)return[2];c=this.decodeHeaderValue(a);
if(!c||"number"!==typeof c.startSeconds||"number"!==typeof c.deltaSeconds)return[2];d=c.startSeconds+c.deltaSeconds;e=E.getEpochSeconds();return d<e?[2]:[2,b]})})};b.prototype._getRequestStartTimestampSeconds=function(a){return a&&"number"===typeof a.requestStartTimestampSeconds?a.requestStartTimestampSeconds:-1};b.prototype._getMaxAgeSeconds=function(a){return a&&"number"===typeof a.maxAgeSeconds?a.maxAgeSeconds:-1};wa([k],b.prototype,"cacheWillUpdate",null);wa([k],b.prototype,"responseWillBeUsed",
null);wa([k],b.prototype,"_getRequestStartTimestampSeconds",null);wa([k],b.prototype,"_getMaxAgeSeconds",null);return b}(Qa),lc=this&&this.__extends||function(){var h=function(b,a){h=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(a,c){a.__proto__=c}||function(a,c){for(var b in c)Object.prototype.hasOwnProperty.call(c,b)&&(a[b]=c[b])};return h(b,a)};return function(b,a){function e(){this.constructor=b}if("function"!==typeof a&&null!==a)throw new TypeError("Class extends value "+String(a)+
" is not a constructor or null");h(b,a);b.prototype=null===a?Object.create(a):(e.prototype=a.prototype,new e)}}(),Ra=this&&this.__assign||function(){Ra=Object.assign||function(h){for(var b,a=1,e=arguments.length;a<e;a++){b=arguments[a];for(var c in b)Object.prototype.hasOwnProperty.call(b,c)&&(h[c]=b[c])}return h};return Ra.apply(this,arguments)},pa=this&&this.__decorate||function(h,b,a,e){var c=arguments.length,g=3>c?b:null===e?e=Object.getOwnPropertyDescriptor(b,a):e,f;if("object"===typeof Reflect&&
"function"===typeof Reflect.decorate)g=Reflect.decorate(h,b,a,e);else for(var d=h.length-1;0<=d;d--)if(f=h[d])g=(3>c?f(g):3<c?f(b,a,g):f(b,a))||g;return 3<c&&g&&Object.defineProperty(b,a,g),g},sb=this&&this.__awaiter||function(h,b,a,e){function c(c){return c instanceof a?c:new a(function(a){a(c)})}return new (a||(a=Promise))(function(a,f){function d(a){try{l(e.next(a))}catch(m){f(m)}}function g(a){try{l(e["throw"](a))}catch(m){f(m)}}function l(b){b.done?a(b.value):c(b.value).then(d,g)}l((e=e.apply(h,
b||[])).next())})},tb=this&&this.__generator||function(h,b){function a(a){return function(c){return e([a,c])}}function e(a){if(g)throw new TypeError("Generator is already executing.");for(;c;)try{if(g=1,f&&(d=a[0]&2?f["return"]:a[0]?f["throw"]||((d=f["return"])&&d.call(f),0):f.next)&&!(d=d.call(f,a[1])).done)return d;if(f=0,d)a=[a[0]&2,d.value];switch(a[0]){case 0:case 1:d=a;break;case 4:return c.label++,{value:a[1],done:!1};case 5:c.label++;f=a[1];a=[0];continue;case 7:a=c.ops.pop();c.trys.pop();
continue;default:if(!(d=c.trys,d=0<d.length&&d[d.length-1])&&(6===a[0]||2===a[0])){c=0;continue}if(3===a[0]&&(!d||a[1]>d[0]&&a[1]<d[3]))c.label=a[1];else if(6===a[0]&&c.label<d[1])c.label=d[1],d=a;else if(d&&c.label<d[2])c.label=d[2],c.ops.push(a);else{d[2]&&c.ops.pop();c.trys.pop();continue}}a=b.call(h,c)}catch(p){a=[6,p],f=0}finally{g=d=0}if(a[0]&5)throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}var c={label:0,sent:function(){if(d[0]&1)throw d[1];return d[1]},trys:[],ops:[]},g,f,d,n;return n=
{next:a(0),"throw":a(1),"return":a(2)},"function"===typeof Symbol&&(n[Symbol.iterator]=function(){return this}),n},mc=function(h){function b(){var a=h.call(this)||this;a.NAME="ValidationKeys";a.logCtor(arguments);a._header="".concat(h.prototype.getPrefixedHeaderName.call(a,a.NAME));return a}lc(b,h);b.prototype.cacheWillUpdate=function(a,b,c){return sb(this,void 0,void 0,function(){var a,e;return tb(this,function(d){if(!b)return[2,b];a=this._getKeysFromOptions(c);e=new Headers(b.headers||{});e.append(this._header,
this.encodeHeaderValue(a));return[2,this.updateResponseHeaders(b,e)]})})};b.prototype.responseWillBeUsed=function(a,b,c){return sb(this,void 0,void 0,function(){var a,e,d;return tb(this,function(g){if(!b)return[2,b];try{return a=this._getKeysFromResponse(b),e=this._getKeysFromOptions(c),d=this._doKeysMatch(a,e),[2,d?b:void 0]}catch(l){}return[2]})})};b.prototype._getKeysFromOptions=function(a){if(!a)return{};var b=a.validationKeys;if("object"!==typeof b||null===b)return{};Object.keys(b).forEach(function(a){var c=
b[a];if(!("string"===typeof a&&"string"===typeof c&&0<a.length))throw r.create("InvalidKeyPair",{key:a,value:c},void 0,"Key:value pairs must all be non-empty string:string");});return Ra({},b)};b.prototype._getKeysFromResponse=function(a){a=a.headers.get(this._header);if(!a)return{};var b=this.decodeHeaderValue(a);if(b)return b;throw r.create("UnreadableHeader",{key:this._header,value:a});};b.prototype._doKeysMatch=function(a,b){return Object.keys(a).every(function(c){return b.hasOwnProperty(c)&&
a[c]===b[c]})};pa([k],b.prototype,"cacheWillUpdate",null);pa([k],b.prototype,"responseWillBeUsed",null);pa([k],b.prototype,"_getKeysFromOptions",null);pa([k],b.prototype,"_getKeysFromResponse",null);pa([k],b.prototype,"_doKeysMatch",null);return b}(Qa),nc=this&&this.__extends||function(){var h=function(b,a){h=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(a,c){a.__proto__=c}||function(a,c){for(var b in c)Object.prototype.hasOwnProperty.call(c,b)&&(a[b]=c[b])};return h(b,a)};return function(b,
a){function e(){this.constructor=b}if("function"!==typeof a&&null!==a)throw new TypeError("Class extends value "+String(a)+" is not a constructor or null");h(b,a);b.prototype=null===a?Object.create(a):(e.prototype=a.prototype,new e)}}(),Sa=this&&this.__decorate||function(h,b,a,e){var c=arguments.length,g=3>c?b:null===e?e=Object.getOwnPropertyDescriptor(b,a):e,f;if("object"===typeof Reflect&&"function"===typeof Reflect.decorate)g=Reflect.decorate(h,b,a,e);else for(var d=h.length-1;0<=d;d--)if(f=h[d])g=
(3>c?f(g):3<c?f(b,a,g):f(b,a))||g;return 3<c&&g&&Object.defineProperty(b,a,g),g},oc=this&&this.__awaiter||function(h,b,a,e){function c(c){return c instanceof a?c:new a(function(a){a(c)})}return new (a||(a=Promise))(function(a,f){function d(a){try{l(e.next(a))}catch(m){f(m)}}function g(a){try{l(e["throw"](a))}catch(m){f(m)}}function l(b){b.done?a(b.value):c(b.value).then(d,g)}l((e=e.apply(h,b||[])).next())})},pc=this&&this.__generator||function(h,b){function a(a){return function(c){return e([a,c])}}
function e(a){if(g)throw new TypeError("Generator is already executing.");for(;c;)try{if(g=1,f&&(d=a[0]&2?f["return"]:a[0]?f["throw"]||((d=f["return"])&&d.call(f),0):f.next)&&!(d=d.call(f,a[1])).done)return d;if(f=0,d)a=[a[0]&2,d.value];switch(a[0]){case 0:case 1:d=a;break;case 4:return c.label++,{value:a[1],done:!1};case 5:c.label++;f=a[1];a=[0];continue;case 7:a=c.ops.pop();c.trys.pop();continue;default:if(!(d=c.trys,d=0<d.length&&d[d.length-1])&&(6===a[0]||2===a[0])){c=0;continue}if(3===a[0]&&
(!d||a[1]>d[0]&&a[1]<d[3]))c.label=a[1];else if(6===a[0]&&c.label<d[1])c.label=d[1],d=a;else if(d&&c.label<d[2])c.label=d[2],c.ops.push(a);else{d[2]&&c.ops.pop();c.trys.pop();continue}}a=b.call(h,c)}catch(p){a=[6,p],f=0}finally{g=d=0}if(a[0]&5)throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}var c={label:0,sent:function(){if(d[0]&1)throw d[1];return d[1]},trys:[],ops:[]},g,f,d,n;return n={next:a(0),"throw":a(1),"return":a(2)},"function"===typeof Symbol&&(n[Symbol.iterator]=function(){return this}),
n},qc=function(h){function b(){var a=h.call(this)||this;a.NAME="Metadata";a.logCtor(arguments);a._header="".concat(h.prototype.getPrefixedHeaderName.call(a,a.NAME));return a}nc(b,h);b.prototype.cacheWillUpdate=function(a,b,c){return oc(this,void 0,void 0,function(){var a,e;return pc(this,function(d){if(!b)return[2,b];a={requestStartTimestampSeconds:this._getRequestStartTimestampSeconds(c),attribution:this._getAttribution(c)};e=new Headers(b.headers||{});e.append(this._header,this.encodeHeaderValue(a));
return[2,this.updateResponseHeaders(b,e)]})})};b.prototype._getRequestStartTimestampSeconds=function(a){return a&&"number"===typeof a.requestStartTimestampSeconds?a.requestStartTimestampSeconds:E.getEpochSeconds()};b.prototype._getAttribution=function(a){return a&&"string"===typeof a.attribution?a.attribution:"unknown"};Sa([k],b.prototype,"cacheWillUpdate",null);Sa([k],b.prototype,"_getRequestStartTimestampSeconds",null);Sa([k],b.prototype,"_getAttribution",null);return b}(Qa),rc=this&&this.__extends||
function(){var h=function(b,a){h=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(a,c){a.__proto__=c}||function(a,c){for(var b in c)Object.prototype.hasOwnProperty.call(c,b)&&(a[b]=c[b])};return h(b,a)};return function(b,a){function e(){this.constructor=b}if("function"!==typeof a&&null!==a)throw new TypeError("Class extends value "+String(a)+" is not a constructor or null");h(b,a);b.prototype=null===a?Object.create(a):(e.prototype=a.prototype,new e)}}(),T=this&&this.__decorate||function(h,
b,a,e){var c=arguments.length,g=3>c?b:null===e?e=Object.getOwnPropertyDescriptor(b,a):e,f;if("object"===typeof Reflect&&"function"===typeof Reflect.decorate)g=Reflect.decorate(h,b,a,e);else for(var d=h.length-1;0<=d;d--)if(f=h[d])g=(3>c?f(g):3<c?f(b,a,g):f(b,a))||g;return 3<c&&g&&Object.defineProperty(b,a,g),g},xa=this&&this.__awaiter||function(h,b,a,e){function c(c){return c instanceof a?c:new a(function(a){a(c)})}return new (a||(a=Promise))(function(a,f){function d(a){try{l(e.next(a))}catch(m){f(m)}}
function g(a){try{l(e["throw"](a))}catch(m){f(m)}}function l(b){b.done?a(b.value):c(b.value).then(d,g)}l((e=e.apply(h,b||[])).next())})},ya=this&&this.__generator||function(h,b){function a(a){return function(c){return e([a,c])}}function e(a){if(g)throw new TypeError("Generator is already executing.");for(;c;)try{if(g=1,f&&(d=a[0]&2?f["return"]:a[0]?f["throw"]||((d=f["return"])&&d.call(f),0):f.next)&&!(d=d.call(f,a[1])).done)return d;if(f=0,d)a=[a[0]&2,d.value];switch(a[0]){case 0:case 1:d=a;break;
case 4:return c.label++,{value:a[1],done:!1};case 5:c.label++;f=a[1];a=[0];continue;case 7:a=c.ops.pop();c.trys.pop();continue;default:if(!(d=c.trys,d=0<d.length&&d[d.length-1])&&(6===a[0]||2===a[0])){c=0;continue}if(3===a[0]&&(!d||a[1]>d[0]&&a[1]<d[3]))c.label=a[1];else if(6===a[0]&&c.label<d[1])c.label=d[1],d=a;else if(d&&c.label<d[2])c.label=d[2],c.ops.push(a);else{d[2]&&c.ops.pop();c.trys.pop();continue}}a=b.call(h,c)}catch(p){a=[6,p],f=0}finally{g=d=0}if(a[0]&5)throw a[1];return{value:a[0]?a[1]:
void 0,done:!0}}var c={label:0,sent:function(){if(d[0]&1)throw d[1];return d[1]},trys:[],ops:[]},g,f,d,n;return n={next:a(0),"throw":a(1),"return":a(2)},"function"===typeof Symbol&&(n[Symbol.iterator]=function(){return this}),n},sc=function(h){function b(a,b,c){var e=h.call(this)||this;e.logCtor(arguments);e._initCacheOperators(a,b,c);return e}rc(b,h);b.prototype.read=function(a,b,c,g){return xa(this,void 0,void 0,function(){return ya(this,function(e){return[2,this._getCacheOperator(b).read(a,c,g)]})})};
b.prototype.write=function(a,b,c,g,f){return xa(this,void 0,void 0,function(){return ya(this,function(d){return[2,this._getCacheOperator(b).write(a,c,g,f)]})})};b.prototype.evict=function(a,b,c,g){return xa(this,void 0,void 0,function(){return ya(this,function(e){return[2,this._getCacheOperator(b).evict(a,c,g)]})})};b.prototype.exists=function(a,b,c,g){return xa(this,void 0,void 0,function(){return ya(this,function(e){return[2,this._getCacheOperator(b).exists(a,c,g)]})})};b.prototype._getCacheOperator=
function(a){if(!this._cacheOperators[a])throw r.create("UnrecognizedCacheName",{name:a});return this._cacheOperators[a]};b.prototype._initCacheOperators=function(a,b,c){var e=this;this._validateNoDuplicateCaches(c);this._cacheOperators={};c.forEach(function(c){var d=c.name,g=c.version,f=c.dontCleanOldVersions,h=Array.isArray(c.plugins)?c.plugins.map(function(a){return e._createPluginInstance(a)}):[];e._cacheOperators[c.name]=new hc(a,b,h,d,g,!f)})};b.prototype._createPluginInstance=function(a){switch(a){case "MaxAge":return new kc;
case "ValidationKeys":return new mc;case "Metadata":return new qc;default:throw r.create("UnrecognizedCachePlugin",{name:a});}};b.prototype._validateNoDuplicateCaches=function(a){var b={};a.forEach(function(a){if(b.hasOwnProperty(a.name))throw r.create("DuplicateCacheName",{name:a.name});b[a.name]=!0})};T([k],b.prototype,"read",null);T([k],b.prototype,"write",null);T([k],b.prototype,"evict",null);T([k],b.prototype,"exists",null);T([k],b.prototype,"_getCacheOperator",null);T([k],b.prototype,"_initCacheOperators",
null);T([k],b.prototype,"_createPluginInstance",null);T([k],b.prototype,"_validateNoDuplicateCaches",null);return b}(v),tc=this&&this.__extends||function(){var h=function(b,a){h=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(a,c){a.__proto__=c}||function(a,c){for(var b in c)Object.prototype.hasOwnProperty.call(c,b)&&(a[b]=c[b])};return h(b,a)};return function(b,a){function e(){this.constructor=b}if("function"!==typeof a&&null!==a)throw new TypeError("Class extends value "+String(a)+
" is not a constructor or null");h(b,a);b.prototype=null===a?Object.create(a):(e.prototype=a.prototype,new e)}}(),ub=this&&this.__decorate||function(h,b,a,e){var c=arguments.length,g=3>c?b:null===e?e=Object.getOwnPropertyDescriptor(b,a):e,f;if("object"===typeof Reflect&&"function"===typeof Reflect.decorate)g=Reflect.decorate(h,b,a,e);else for(var d=h.length-1;0<=d;d--)if(f=h[d])g=(3>c?f(g):3<c?f(b,a,g):f(b,a))||g;return 3<c&&g&&Object.defineProperty(b,a,g),g},vb=this&&this.__awaiter||function(h,b,
a,e){function c(c){return c instanceof a?c:new a(function(a){a(c)})}return new (a||(a=Promise))(function(a,f){function d(a){try{l(e.next(a))}catch(m){f(m)}}function g(a){try{l(e["throw"](a))}catch(m){f(m)}}function l(b){b.done?a(b.value):c(b.value).then(d,g)}l((e=e.apply(h,b||[])).next())})},wb=this&&this.__generator||function(h,b){function a(a){return function(c){return e([a,c])}}function e(a){if(g)throw new TypeError("Generator is already executing.");for(;c;)try{if(g=1,f&&(d=a[0]&2?f["return"]:
a[0]?f["throw"]||((d=f["return"])&&d.call(f),0):f.next)&&!(d=d.call(f,a[1])).done)return d;if(f=0,d)a=[a[0]&2,d.value];switch(a[0]){case 0:case 1:d=a;break;case 4:return c.label++,{value:a[1],done:!1};case 5:c.label++;f=a[1];a=[0];continue;case 7:a=c.ops.pop();c.trys.pop();continue;default:if(!(d=c.trys,d=0<d.length&&d[d.length-1])&&(6===a[0]||2===a[0])){c=0;continue}if(3===a[0]&&(!d||a[1]>d[0]&&a[1]<d[3]))c.label=a[1];else if(6===a[0]&&c.label<d[1])c.label=d[1],d=a;else if(d&&c.label<d[2])c.label=
d[2],c.ops.push(a);else{d[2]&&c.ops.pop();c.trys.pop();continue}}a=b.call(h,c)}catch(p){a=[6,p],f=0}finally{g=d=0}if(a[0]&5)throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}var c={label:0,sent:function(){if(d[0]&1)throw d[1];return d[1]},trys:[],ops:[]},g,f,d,n;return n={next:a(0),"throw":a(1),"return":a(2)},"function"===typeof Symbol&&(n[Symbol.iterator]=function(){return this}),n},uc=function(h){function b(a){var b=h.call(this)||this;b._swGlobal=a;return b}tc(b,h);b.prototype.getCookie=function(a){return vb(this,
void 0,void 0,function(){return wb(this,function(b){if(!pb.isCookieStoreSupported(this._swGlobal))throw r.create("UnsupportedCookieStoreAPI",{cookie:a},void 0,void 0,"WARN");return[2,this._swGlobal.cookieStore.get(a)]})})};b.prototype.getCookieValue=function(a){return vb(this,void 0,void 0,function(){var b;return wb(this,function(c){switch(c.label){case 0:return[4,this.getCookie(a)];case 1:return b=c.sent(),[2,b&&b.value?b.value:void 0]}})})};ub([k],b.prototype,"getCookie",null);ub([k],b.prototype,
"getCookieValue",null);return b}(v),vc=this&&this.__extends||function(){var h=function(b,a){h=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(a,c){a.__proto__=c}||function(a,c){for(var b in c)Object.prototype.hasOwnProperty.call(c,b)&&(a[b]=c[b])};return h(b,a)};return function(b,a){function e(){this.constructor=b}if("function"!==typeof a&&null!==a)throw new TypeError("Class extends value "+String(a)+" is not a constructor or null");h(b,a);b.prototype=null===a?Object.create(a):(e.prototype=
a.prototype,new e)}}(),za=this&&this.__decorate||function(h,b,a,e){var c=arguments.length,g=3>c?b:null===e?e=Object.getOwnPropertyDescriptor(b,a):e,f;if("object"===typeof Reflect&&"function"===typeof Reflect.decorate)g=Reflect.decorate(h,b,a,e);else for(var d=h.length-1;0<=d;d--)if(f=h[d])g=(3>c?f(g):3<c?f(b,a,g):f(b,a))||g;return 3<c&&g&&Object.defineProperty(b,a,g),g},xb=this&&this.__awaiter||function(h,b,a,e){function c(c){return c instanceof a?c:new a(function(a){a(c)})}return new (a||(a=Promise))(function(a,
f){function d(a){try{l(e.next(a))}catch(m){f(m)}}function g(a){try{l(e["throw"](a))}catch(m){f(m)}}function l(b){b.done?a(b.value):c(b.value).then(d,g)}l((e=e.apply(h,b||[])).next())})},yb=this&&this.__generator||function(h,b){function a(a){return function(c){return e([a,c])}}function e(a){if(g)throw new TypeError("Generator is already executing.");for(;c;)try{if(g=1,f&&(d=a[0]&2?f["return"]:a[0]?f["throw"]||((d=f["return"])&&d.call(f),0):f.next)&&!(d=d.call(f,a[1])).done)return d;if(f=0,d)a=[a[0]&
2,d.value];switch(a[0]){case 0:case 1:d=a;break;case 4:return c.label++,{value:a[1],done:!1};case 5:c.label++;f=a[1];a=[0];continue;case 7:a=c.ops.pop();c.trys.pop();continue;default:if(!(d=c.trys,d=0<d.length&&d[d.length-1])&&(6===a[0]||2===a[0])){c=0;continue}if(3===a[0]&&(!d||a[1]>d[0]&&a[1]<d[3]))c.label=a[1];else if(6===a[0]&&c.label<d[1])c.label=d[1],d=a;else if(d&&c.label<d[2])c.label=d[2],c.ops.push(a);else{d[2]&&c.ops.pop();c.trys.pop();continue}}a=b.call(h,c)}catch(p){a=[6,p],f=0}finally{g=
d=0}if(a[0]&5)throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}var c={label:0,sent:function(){if(d[0]&1)throw d[1];return d[1]},trys:[],ops:[]},g,f,d,n;return n={next:a(0),"throw":a(1),"return":a(2)},"function"===typeof Symbol&&(n[Symbol.iterator]=function(){return this}),n},wc=function(h){function b(a){var b=h.call(this)||this;b._cookieProvider=new uc(a);if(a=W.getCountryCode(a))b._countryCode=a.toLowerCase();return b}vc(b,h);b.prototype.getRecognition=function(){return xb(this,void 0,void 0,function(){var a;
return yb(this,function(b){try{if(!this._countryCode)throw r.create("CountryCodeNotFound");a=this._getRecognitionCookieName();return[2,this._cookieProvider.getCookieValue(a)]}catch(c){throw r.create("FailedToRetrieveRecognitionCookie",void 0,c);}})})};b.prototype.getLanguage=function(){return xb(this,void 0,void 0,function(){var a;return yb(this,function(b){try{if(!this._countryCode)throw r.create("CountryCodeNotFound");a=this._getLanguageCookieName();return[2,this._cookieProvider.getCookieValue(a)]}catch(c){throw r.create("FailedToRetrieveLanguageCookie",
void 0,c);}})})};b.prototype._getRecognitionCookieName=function(){return this._isUSMarketplace()?"x-main":"x-acb".concat(this._countryCode)};b.prototype._getLanguageCookieName=function(){return this._isUSMarketplace()?"lc-main":"lc-acb".concat(this._countryCode)};b.prototype._isUSMarketplace=function(){return this._countryCode===b.US_COUNTRY_CODE};b.US_COUNTRY_CODE="us";za([k],b.prototype,"getRecognition",null);za([k],b.prototype,"getLanguage",null);za([k],b.prototype,"_getRecognitionCookieName",
null);za([k],b.prototype,"_getLanguageCookieName",null);return b}(v),xc=this&&this.__extends||function(){var h=function(b,a){h=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(a,c){a.__proto__=c}||function(a,c){for(var b in c)Object.prototype.hasOwnProperty.call(c,b)&&(a[b]=c[b])};return h(b,a)};return function(b,a){function e(){this.constructor=b}if("function"!==typeof a&&null!==a)throw new TypeError("Class extends value "+String(a)+" is not a constructor or null");h(b,a);b.prototype=
null===a?Object.create(a):(e.prototype=a.prototype,new e)}}(),Ta=this&&this.__decorate||function(h,b,a,e){var c=arguments.length,g=3>c?b:null===e?e=Object.getOwnPropertyDescriptor(b,a):e,f;if("object"===typeof Reflect&&"function"===typeof Reflect.decorate)g=Reflect.decorate(h,b,a,e);else for(var d=h.length-1;0<=d;d--)if(f=h[d])g=(3>c?f(g):3<c?f(b,a,g):f(b,a))||g;return 3<c&&g&&Object.defineProperty(b,a,g),g},zb=this&&this.__awaiter||function(h,b,a,e){function c(c){return c instanceof a?c:new a(function(a){a(c)})}
return new (a||(a=Promise))(function(a,f){function d(a){try{l(e.next(a))}catch(m){f(m)}}function g(a){try{l(e["throw"](a))}catch(m){f(m)}}function l(b){b.done?a(b.value):c(b.value).then(d,g)}l((e=e.apply(h,b||[])).next())})},Ab=this&&this.__generator||function(h,b){function a(a){return function(c){return e([a,c])}}function e(a){if(g)throw new TypeError("Generator is already executing.");for(;c;)try{if(g=1,f&&(d=a[0]&2?f["return"]:a[0]?f["throw"]||((d=f["return"])&&d.call(f),0):f.next)&&!(d=d.call(f,
a[1])).done)return d;if(f=0,d)a=[a[0]&2,d.value];switch(a[0]){case 0:case 1:d=a;break;case 4:return c.label++,{value:a[1],done:!1};case 5:c.label++;f=a[1];a=[0];continue;case 7:a=c.ops.pop();c.trys.pop();continue;default:if(!(d=c.trys,d=0<d.length&&d[d.length-1])&&(6===a[0]||2===a[0])){c=0;continue}if(3===a[0]&&(!d||a[1]>d[0]&&a[1]<d[3]))c.label=a[1];else if(6===a[0]&&c.label<d[1])c.label=d[1],d=a;else if(d&&c.label<d[2])c.label=d[2],c.ops.push(a);else{d[2]&&c.ops.pop();c.trys.pop();continue}}a=b.call(h,
c)}catch(p){a=[6,p],f=0}finally{g=d=0}if(a[0]&5)throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}var c={label:0,sent:function(){if(d[0]&1)throw d[1];return d[1]},trys:[],ops:[]},g,f,d,n;return n={next:a(0),"throw":a(1),"return":a(2)},"function"===typeof Symbol&&(n[Symbol.iterator]=function(){return this}),n},Ua=function(h){function b(a){var b=h.call(this)||this;b._customerContext=new wc(a);return b}xc(b,h);b.prototype.compute=function(a){return zb(this,void 0,void 0,function(){var b,c,g,f,d;return Ab(this,
function(e){switch(e.label){case 0:b={},c=0,e.label=1;case 1:if(!(c<a.length))return[3,4];g=a[c];f=b;d=g;return[4,this._getValueForKey(g)];case 2:f[d]=e.sent(),e.label=3;case 3:return c++,[3,1];case 4:return[2,b]}})})};b.prototype._getValueForKey=function(a){return zb(this,void 0,void 0,function(){var b,c,g;return Ab(this,function(e){switch(e.label){case 0:b=a;switch(b){case "clientlibversion":return[3,1];case "recognition":return[3,2];case "language":return[3,4];case "marketplace":return[3,6];case "session":return[3,
6];case "ubid":return[3,6]}return[3,7];case 1:return[2,u.VERSION];case 2:return[4,this._customerContext.getRecognition()];case 3:return c=e.sent(),[2,this._getValueOrUnknown(c)];case 4:return[4,this._customerContext.getLanguage()];case 5:return g=e.sent(),[2,this._getValueOrUnknown(g)];case 6:return[2,"unknown"];case 7:throw r.create("UnrecognizedCacheValidationKey",{key:a});}})})};b.prototype._getValueOrUnknown=function(a){return"string"===typeof a&&0<a.length?a:"unknown"};Ta([k],b.prototype,"compute",
null);Ta([k],b.prototype,"_getValueForKey",null);Ta([k],b.prototype,"_getValueOrUnknown",null);return b}(v),yc=this&&this.__extends||function(){var h=function(b,a){h=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(a,c){a.__proto__=c}||function(a,c){for(var b in c)Object.prototype.hasOwnProperty.call(c,b)&&(a[b]=c[b])};return h(b,a)};return function(b,a){function e(){this.constructor=b}if("function"!==typeof a&&null!==a)throw new TypeError("Class extends value "+String(a)+" is not a constructor or null");
h(b,a);b.prototype=null===a?Object.create(a):(e.prototype=a.prototype,new e)}}(),Bb=this&&this.__decorate||function(h,b,a,e){var c=arguments.length,g=3>c?b:null===e?e=Object.getOwnPropertyDescriptor(b,a):e,f;if("object"===typeof Reflect&&"function"===typeof Reflect.decorate)g=Reflect.decorate(h,b,a,e);else for(var d=h.length-1;0<=d;d--)if(f=h[d])g=(3>c?f(g):3<c?f(b,a,g):f(b,a))||g;return 3<c&&g&&Object.defineProperty(b,a,g),g},zc=function(h){function b(){return null!==h&&h.apply(this,arguments)||
this}yc(b,h);b.prototype.stripRefMarkersFromPath=function(a){return a.replace(/\/ref_?=[^\/]*/gi,"")||"/"};b.prototype.stripLanguageFolderFromPath=function(a){return a.replace(/^\/\-\/[^\/]+/i,"")||"/"};Bb([k],b.prototype,"stripRefMarkersFromPath",null);Bb([k],b.prototype,"stripLanguageFolderFromPath",null);return b}(v),Ac=this&&this.__extends||function(){var h=function(b,a){h=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(a,c){a.__proto__=c}||function(a,c){for(var b in c)Object.prototype.hasOwnProperty.call(c,
b)&&(a[b]=c[b])};return h(b,a)};return function(b,a){function e(){this.constructor=b}if("function"!==typeof a&&null!==a)throw new TypeError("Class extends value "+String(a)+" is not a constructor or null");h(b,a);b.prototype=null===a?Object.create(a):(e.prototype=a.prototype,new e)}}(),Cb=this&&this.__decorate||function(h,b,a,e){var c=arguments.length,g=3>c?b:null===e?e=Object.getOwnPropertyDescriptor(b,a):e,f;if("object"===typeof Reflect&&"function"===typeof Reflect.decorate)g=Reflect.decorate(h,
b,a,e);else for(var d=h.length-1;0<=d;d--)if(f=h[d])g=(3>c?f(g):3<c?f(b,a,g):f(b,a))||g;return 3<c&&g&&Object.defineProperty(b,a,g),g},Db=function(h){function b(a,b,c){void 0===b&&(b=!0);void 0===c&&(c=!0);var e=h.call(this)||this;e.logCtor(arguments);e._pattern=a;e._stripRefMarkers=b;e._stripLanguageFolder=c;return e}Ac(b,h);b.prototype.match=function(a,b,c){return(a=J.parse(a.url))?this._pattern.test(this._getNormalizedPath(a.pathname)):!1};b.prototype._getNormalizedPath=function(a){this._stripRefMarkers&&
(a=this.stripRefMarkersFromPath(a));this._stripLanguageFolder&&(a=this.stripLanguageFolderFromPath(a));return a};Cb([k],b.prototype,"match",null);Cb([k],b.prototype,"_getNormalizedPath",null);return b}(zc),Bc=this&&this.__extends||function(){var h=function(b,a){h=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(a,b){a.__proto__=b}||function(a,b){for(var c in b)Object.prototype.hasOwnProperty.call(b,c)&&(a[c]=b[c])};return h(b,a)};return function(b,a){function e(){this.constructor=b}
if("function"!==typeof a&&null!==a)throw new TypeError("Class extends value "+String(a)+" is not a constructor or null");h(b,a);b.prototype=null===a?Object.create(a):(e.prototype=a.prototype,new e)}}(),Aa=this&&this.__decorate||function(h,b,a,e){var c=arguments.length,g=3>c?b:null===e?e=Object.getOwnPropertyDescriptor(b,a):e,f;if("object"===typeof Reflect&&"function"===typeof Reflect.decorate)g=Reflect.decorate(h,b,a,e);else for(var d=h.length-1;0<=d;d--)if(f=h[d])g=(3>c?f(g):3<c?f(b,a,g):f(b,a))||
g;return 3<c&&g&&Object.defineProperty(b,a,g),g},Va=this&&this.__awaiter||function(h,b,a,e){function c(b){return b instanceof a?b:new a(function(a){a(b)})}return new (a||(a=Promise))(function(a,f){function d(a){try{l(e.next(a))}catch(m){f(m)}}function g(a){try{l(e["throw"](a))}catch(m){f(m)}}function l(b){b.done?a(b.value):c(b.value).then(d,g)}l((e=e.apply(h,b||[])).next())})},Wa=this&&this.__generator||function(h,b){function a(a){return function(b){return e([a,b])}}function e(a){if(g)throw new TypeError("Generator is already executing.");
for(;c;)try{if(g=1,f&&(d=a[0]&2?f["return"]:a[0]?f["throw"]||((d=f["return"])&&d.call(f),0):f.next)&&!(d=d.call(f,a[1])).done)return d;if(f=0,d)a=[a[0]&2,d.value];switch(a[0]){case 0:case 1:d=a;break;case 4:return c.label++,{value:a[1],done:!1};case 5:c.label++;f=a[1];a=[0];continue;case 7:a=c.ops.pop();c.trys.pop();continue;default:if(!(d=c.trys,d=0<d.length&&d[d.length-1])&&(6===a[0]||2===a[0])){c=0;continue}if(3===a[0]&&(!d||a[1]>d[0]&&a[1]<d[3]))c.label=a[1];else if(6===a[0]&&c.label<d[1])c.label=
d[1],d=a;else if(d&&c.label<d[2])c.label=d[2],c.ops.push(a);else{d[2]&&c.ops.pop();c.trys.pop();continue}}a=b.call(h,c)}catch(p){a=[6,p],f=0}finally{g=d=0}if(a[0]&5)throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}var c={label:0,sent:function(){if(d[0]&1)throw d[1];return d[1]},trys:[],ops:[]},g,f,d,n;return n={next:a(0),"throw":a(1),"return":a(2)},"function"===typeof Symbol&&(n[Symbol.iterator]=function(){return this}),n},Xa=function(h){function b(a,b,c){var e=h.call(this)||this;e.logCtor(arguments);
e._url=a;e._requestInit=b;e._libVersionHeader=c;return e}Bc(b,h);b.prototype.getResponse=function(){return Va(this,void 0,void 0,function(){var a,b;return Wa(this,function(c){switch(c.label){case 0:return c.trys.push([0,2,,3]),[4,fetch(this._url,this._getRequestInit(this._requestInit))];case 1:return a=c.sent(),[3,3];case 2:throw b=c.sent(),r.wrap(b,"FailedToFetch",{url:this._url,requestInit:this._requestInit});case 3:if("opaqueredirect"===a.type)throw r.create("ResponseOpaqueRedirect",{url:a.url,
status:a.status});if(!a.ok)throw r.create("ResponseNotOK",{url:a.url,status:a.status});return[2,a]}})})};b.prototype.getResponseText=function(){return Va(this,void 0,void 0,function(){var a;return Wa(this,function(b){switch(b.label){case 0:return[4,this.getResponse()];case 1:return a=b.sent(),[2,a.text()]}})})};b.prototype.getResponseJson=function(){return Va(this,void 0,void 0,function(){var a,b,c;return Wa(this,function(e){switch(e.label){case 0:return[4,this.getResponse()];case 1:a=e.sent(),e.label=
2;case 2:return e.trys.push([2,4,,5]),[4,a.json()];case 3:return b=e.sent(),[3,5];case 4:throw c=e.sent(),r.wrap(c,"ResponseNotJSON",{url:a.url});case 5:return[2,b]}})})};b.prototype._getRequestInit=function(a){a=a||{};a.method||(a.method="GET");if(this._libVersionHeader){var b=new Headers(a.headers||{});x.clientInfo.appendClientVersion(b);a.headers=b}return a};Aa([k],b.prototype,"getResponse",null);Aa([k],b.prototype,"getResponseText",null);Aa([k],b.prototype,"getResponseJson",null);Aa([k],b.prototype,
"_getRequestInit",null);return b}(v),Cc=this&&this.__extends||function(){var h=function(b,a){h=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(a,b){a.__proto__=b}||function(a,b){for(var c in b)Object.prototype.hasOwnProperty.call(b,c)&&(a[c]=b[c])};return h(b,a)};return function(b,a){function e(){this.constructor=b}if("function"!==typeof a&&null!==a)throw new TypeError("Class extends value "+String(a)+" is not a constructor or null");h(b,a);b.prototype=null===a?Object.create(a):(e.prototype=
a.prototype,new e)}}(),U=this&&this.__decorate||function(h,b,a,e){var c=arguments.length,g=3>c?b:null===e?e=Object.getOwnPropertyDescriptor(b,a):e,f;if("object"===typeof Reflect&&"function"===typeof Reflect.decorate)g=Reflect.decorate(h,b,a,e);else for(var d=h.length-1;0<=d;d--)if(f=h[d])g=(3>c?f(g):3<c?f(b,a,g):f(b,a))||g;return 3<c&&g&&Object.defineProperty(b,a,g),g},Ya=this&&this.__awaiter||function(h,b,a,e){function c(b){return b instanceof a?b:new a(function(a){a(b)})}return new (a||(a=Promise))(function(a,
f){function d(a){try{l(e.next(a))}catch(m){f(m)}}function g(a){try{l(e["throw"](a))}catch(m){f(m)}}function l(b){b.done?a(b.value):c(b.value).then(d,g)}l((e=e.apply(h,b||[])).next())})},Za=this&&this.__generator||function(h,b){function a(a){return function(b){return e([a,b])}}function e(a){if(g)throw new TypeError("Generator is already executing.");for(;c;)try{if(g=1,f&&(d=a[0]&2?f["return"]:a[0]?f["throw"]||((d=f["return"])&&d.call(f),0):f.next)&&!(d=d.call(f,a[1])).done)return d;if(f=0,d)a=[a[0]&
2,d.value];switch(a[0]){case 0:case 1:d=a;break;case 4:return c.label++,{value:a[1],done:!1};case 5:c.label++;f=a[1];a=[0];continue;case 7:a=c.ops.pop();c.trys.pop();continue;default:if(!(d=c.trys,d=0<d.length&&d[d.length-1])&&(6===a[0]||2===a[0])){c=0;continue}if(3===a[0]&&(!d||a[1]>d[0]&&a[1]<d[3]))c.label=a[1];else if(6===a[0]&&c.label<d[1])c.label=d[1],d=a;else if(d&&c.label<d[2])c.label=d[2],c.ops.push(a);else{d[2]&&c.ops.pop();c.trys.pop();continue}}a=b.call(h,c)}catch(p){a=[6,p],f=0}finally{g=
d=0}if(a[0]&5)throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}var c={label:0,sent:function(){if(d[0]&1)throw d[1];return d[1]},trys:[],ops:[]},g,f,d,n;return n={next:a(0),"throw":a(1),"return":a(2)},"function"===typeof Symbol&&(n[Symbol.iterator]=function(){return this}),n},Dc=function(h){function b(a,b,c){var e=h.call(this)||this;e.logCtor(arguments);e._swGlobal=a;e._cacheService=b;e._metricsService=c;e._errorLoggingScope="PrefetchExecutor";return e}Cc(b,h);b.prototype.prefetch=function(a,b,c){return Ya(this,
void 0,void 0,function(){var e,f,d,h,l,p,k,q,r,u,v,Eb,w,x,y;return Za(this,function(g){switch(g.label){case 0:return e=b.prefetch,f=e.endpoint,d=e.mode,h=e.delay,[4,t.wait(1E3*h)];case 1:g.sent();l=a.storage;p=l.cacheName;k=l.cacheKey;q=l.validationKeys;if("cache-miss"!==d)return[3,5];g.label=2;case 2:return g.trys.push([2,4,,5]),[4,this._exists(p,k,q,c)];case 3:return(r=g.sent())?[2,{ok:!1,exitCode:"Exists"}]:[3,5];case 4:return g.sent(),[2,{ok:!1,exitCode:"CacheError"}];case 5:return[4,this._hasPrefetchCredit()];
case 6:u=g.sent();if(!u)return[2,{ok:!1,exitCode:"NoCredit"}];v=this._getPrefetchURL(f,a.name,b.label);if(!v)return[2,{ok:!1,exitCode:"InvalidURL"}];Eb=E.getEpochSeconds();g.label=7;case 7:return g.trys.push([7,9,,10]),[4,(new Xa(v,this._getPrefetchRequestInit())).getResponse()];case 8:return w=g.sent(),[2,{ok:!0,requestStartTimestampSeconds:Eb,response:w}];case 9:return x=g.sent(),y=K.matchesCode(x,"FailedToFetch"),this._metricsService.error(c,x,this._errorLoggingScope,y?"ERROR":void 0),this._metricsService.countError(c,
x,y?"".concat("FailedToFetch",":").concat(this._errorLoggingScope):this._errorLoggingScope),[2,{ok:!1,exitCode:"NetworkError"}];case 10:return[2]}})})};b.prototype._exists=function(a,b,c,g){return Ya(this,void 0,void 0,function(){var e,d,h,l;return Za(this,function(f){switch(f.label){case 0:return d=(e=this._cacheService).exists,h=[g,a,b],l={},[4,(new Ua(this._swGlobal)).compute(c)];case 1:return[2,d.apply(e,h.concat([(l.validationKeys=f.sent(),l)]))]}})})};b.prototype._hasPrefetchCredit=function(){return Ya(this,
void 0,void 0,function(){return Za(this,function(a){return[2,!0]})})};b.prototype._getPrefetchURL=function(a,e,c){if(a=J.parse(a,this._swGlobal.location.href)){var g=this._getPageShellClass(a);this._addQueryParam(a,b._QUERY_PARAM_PAGE_SHELL,g);this._addQueryParam(a,b._QUERY_PARAM_CACHE_POP_RULE,e);this._addQueryParam(a,b._QUERY_PARAM_CACHE_POP_RULE_TRIGGER,c);this._addQueryParam(a,b._QUERY_PARAM_REF_TAG,this._getRefTag(g,e,c),!1);return a.href}};b.prototype._addQueryParam=function(a,b,c,g){void 0===
g&&(g=!0);g&&a.searchParams.delete(b);a.searchParams.append(b,c)};b.prototype._getPageShellClass=function(a){a=a.searchParams.get(b._QUERY_PARAM_PAGE_SHELL);a||(a=b._PAGE_SHELL_TYPE_DEFAULT);return a};b.prototype._getRefTag=function(a,e,c){return"".concat(b._REF_TAG_PREFIX,"_").concat(a.substr(0,16).toLocaleLowerCase(),"_").concat(e.substr(0,16).toLocaleLowerCase(),"_").concat(c.substr(0,16).toLocaleLowerCase())};b.prototype._getPrefetchRequestInit=function(){return{method:"GET",mode:"same-origin",
credentials:"same-origin",redirect:"error",headers:{accept:"text/html,application/xhtml+xml,*/*;q\x3d0.9"}}};b._QUERY_PARAM_PAGE_SHELL="ls_pg_sh";b._QUERY_PARAM_CACHE_POP_RULE="ls_cp_rl";b._QUERY_PARAM_CACHE_POP_RULE_TRIGGER="ls_cp_rl_tr";b._QUERY_PARAM_REF_TAG="ref_";b._PAGE_SHELL_TYPE_DEFAULT="default";b._REF_TAG_PREFIX=u.NAMESPACE_SHORT;U([k],b.prototype,"prefetch",null);U([k],b.prototype,"_exists",null);U([k],b.prototype,"_hasPrefetchCredit",null);U([k],b.prototype,"_getPrefetchURL",null);U([k],
b.prototype,"_addQueryParam",null);U([k],b.prototype,"_getPageShellClass",null);U([k],b.prototype,"_getRefTag",null);U([k],b.prototype,"_getPrefetchRequestInit",null);return b}(v),Ec=function(h){return z.div([z.style('body,html{font-family:"Amazon Ember",Arial,sans-serif;background:#fff}.main{position:fixed;bottom:0;left:0;right:0;padding:50px 0;text-align:center}.main-image{width:50%}.subline{font-size:.75rem;color:#999;margin:10px 0}.button{display:block;font-size:1rem;padding:10px;width:80%;margin:10px auto;border:1px solid #ccc;border-radius:5px;box-shadow:0 3px 0 #ccc;background:#fff}.button:active{border-color:#12626d;background-color:#edfcff}.hidden{display:none}'),
'\x3cdiv class\x3d"main hidden" id\x3d"fallback-content-container"\x3e\x3cimg class\x3d"main-image" src\x3d"data:image/jpeg;base64, "\x3e\x3ch3 class\x3d"headline"\x3eOOPS!\x3c/h3\x3e\x3ch3 class\x3d"headline"\x3eSomething went wrong.\x3c/h3\x3e\x3cbutton class\x3d"button" id\x3d"try-again"\x3eTRY AGAIN\x3c/button\x3e\x3cp class\x3d"subline"\x3eCS2. Error occurred of type S-2.\x3c/div\x3e',
z.script('!function(e,r){"use strict";var t\x3de.failingUrl,n\x3de.referrerUrl,o\x3de.errorCode,a\x3de.description,c\x3de.fallbackContentTimeout;r.setTimeout(function(){var e\x3ddocument.getElementById("fallback-content-container");if(e){var t\x3ddocument.getElementById("try-again");t\x26\x26t.addEventListener("click",function(){r.location.reload()}),e.classList.remove("hidden")}},c),r.appErrorWebAppInterface\x26\x26"function"\x3d\x3dtypeof r.appErrorWebAppInterface.showError\x26\x26(r.appErrorWebAppInterface.called\x3d!0,r.appErrorWebAppInterface.showError(t,o,a,n))}(model,window);',
h)].join("\n"))},Fc=function(h){return z.script('!function(e,t){"use strict";function n(e){t.ue\x26\x26"function"\x3d\x3dtypeof t.ue.tag\x26\x26t.ue.tag(e)}function a(e){return[o,"Page"].concat(e).join(":").toLowerCase()}var o\x3de.namespace;try{var c\x3de.globalObjectName,r\x3de.contentFragmentName,m\x3de.contentFragmentData;c\x26\x26(t[c]\x3dt[c]||{},t[c].contentFragments\x3dt[c].contentFragments||{},t[c].contentFragments[r]\x3dm);var g\x3d"lightsaber:content-fragment:model:"+r,l\x3d{bubbles:!0,cancelable:!1,detail:m},i\x3dnew CustomEvent(g,l);t.dispatchEvent(i);var u\x3dt.AmazonUIPageJS?t.AmazonUIPageJS:t.P;u\x26\x26"function"\x3d\x3dtypeof u.declare\x26\x26u.declare(g,m)}catch(s){n(a(["ContentFragment","Model","Fail"]))}}(model,window);',
h)},Gc=function(h){return z.script('!function(t,e){"use strict";function i(t){return t.replace(/(%[0-9A-Z]{2})+/g,decodeURIComponent)}function o(t){for(var e\x3ddocument.cookie?document.cookie.split(";"):[],o\x3d0;o\x3ce.length;o++){var n\x3de[o].trim().split("\x3d"),r\x3di(n[0]);if(t\x3d\x3d\x3dr){var u\x3dn.slice(1).join("\x3d");return i(u)}}}function n(t){return[s,"Page","CsmReset"].concat(t).join(":").toLowerCase()}function r(t){e.ue\x26\x26"function"\x3d\x3dtypeof e.ue.tag\x26\x26e.ue.tag(t)}function u(i,o){return e.csa\x26\x26"function"\x3d\x3dtypeof e.csa?(e.csa("Config",{"CacheDetection.RequestID":i}),e.csa("Events")("setEntity",{page:{requestId:i},session:{id:o}}),void r(n([t.attribution,"OK","CSA"]))):void r(n([t.attribution,"Fail","CSA"]))}function a(i,o){return e.ue\x26\x26"function"\x3d\x3dtypeof e.ue.reset?(e.ue.reset(i,o,s.toLowerCase()),"string"\x3d\x3dtypeof e.ue.oid\x26\x26e.ue.oid!\x3d\x3di\x26\x26(e.ue.oid\x3di),void r("T1"\x3d\x3d\x3dt.treatment?n([t.attribution,"OK","UE"]):n(["OK"]))):void r(n("T1"\x3d\x3d\x3dt.treatment?[t.attribution,"Fail","UE"]:["Fail","API"]))}var s\x3dt.namespace,c\x3dt.requestId;if(!c)return void r(n(["Fail","RID"]));var d\x3do("session-id");return d?(a(c,d),void u(c,d)):void r(n(["Fail","SID"]))}(model,window);',
h)},Hc=function(h){return z.div([z.style("#lightsaber-debug-info-container{display:none;padding:10px;background:#cfcfcf;border-top:1px solid #d6d6d6;position:fixed;bottom:0;left:0;right:0;max-height:300px;overflow:scroll;z-index:9999}#lightsaber-debug-info-learn-more{display:block;text-decoration:none}#lightsaber-debug-info-metadata-container{display:block;background:#d6d6d6;border:1px dashed #666;margin:10px 0 0;padding:10px;overflow:scroll}#lightsaber-debug-info-close-btn{position:absolute;top:10px;right:10px;cursor:pointer;color:#900}"),
'\x3cdiv id\x3d"lightsaber-debug-info-container"\x3e\x3ch4 id\x3d"lightsaber-debug-info-title"\x3eLightsaber Debug Info\x3c/h4\x3e\x3ca id\x3d"lightsaber-debug-info-learn-more" href\x3d"#" target\x3d"_blank" rel\x3d"noopener noreferrer"\x3eLearn More\x3c/a\x3e\x3cpre id\x3d"lightsaber-debug-info-metadata-container"\x3e\x3c/pre\x3e\x3cdiv id\x3d"lightsaber-debug-info-close-btn"\x3e[X]\x3c/div\x3e\x3c/div\x3e',z.script('!function(e,t){"use strict";function n(e){console.debug("["+o+" Debug]",e)}var o\x3de.namespace,r\x3ddocument.querySelector("#lightsaber-debug-info-container"),i\x3ddocument.querySelector("#lightsaber-debug-info-metadata-container"),c\x3ddocument.querySelector("#lightsaber-debug-info-close-btn"),u\x3ddocument.querySelector("#lightsaber-debug-info-learn-more");if(!(r\x26\x26i\x26\x26c\x26\x26u))return void n("Encountered unexpected DOM issue for Debug Tool, exiting...");u.setAttribute("href",e.learnMoreLink);var l\x3dt[e.globalObjectName];i.textContent\x3de.globalObjectName+" \x3d "+JSON.stringify(l,void 0,2),c.addEventListener("click",function(){r.remove()}),r.style.display\x3d"block"}(model,window);',
h)].join("\n"))},Ic=function(h){return z.style(h.stylesheetContent)},Jc=function(h){return z.script('!function(e,t){"use strict";function a(e){t.ue\x26\x26"function"\x3d\x3dtypeof t.ue.tag\x26\x26t.ue.tag(e)}function n(e,a){t.ue\x26\x26"function"\x3d\x3dtypeof t.ue.count\x26\x26t.ue.count(e,a)}function i(e){return[r,"Page"].concat(e).join(":").toLowerCase()}var r\x3de.namespace;try{var c\x3d!!e.hit,o\x3de.meta,u\x3de.globalObjectName,f\x3de.pModulePrefix;u\x26\x26(t[u]\x3dt[u]||{},t[u].hit\x3dc,t[u].meta\x3do),t.P\x26\x26t.P.declare\x26\x26(t.P.declare(f+"hit",c),t.P.declare(f+"meta",o));var m\x3do.navigationRule,g\x3do.responseStrategy,l\x3do.fetchEventTimeOrigin,p\x3dt.performance\x26\x26(performance.timeOrigin||performance.timing.navigationStart);if(!(m\x26\x26g\x26\x26g.name\x26\x26l\x26\x26p))return;a(i(["Hit"]));var v\x3do.fetchEventTimeOrigin-p;n(i([m,g.name,"SWFetchDelta"]),v)}catch(d){a(i(["Metadata","Fail"]))}}(model,window);',
h)},Kc=function(h){return z.script('!function(e,a){"use strict";function n(e){try{var a\x3dnew URL(o),n\x3da.searchParams.get(s),r\x3dn?n+"_"+e:e;return a.searchParams.set(s,r),a.href}catch(t){return o}}function r(){m\x3d!0,c?a.location.replace(n("vlr")):a.location.assign(n("vla"))}function t(){var e\x3da.AmazonUIPageJS?a.AmazonUIPageJS:a.P,t\x3de\x26\x26"function"\x3d\x3dtypeof e.when;if(!t)return void r();var o\x3da.setTimeout(r,u);e.when("mash").execute(function(e){m||(a.clearTimeout(o),c?e.navstack.begin().replace({url:n("vmr")}).end():e.navigate({url:n("vmn")}))})}var o\x3de.url,c\x3de.replaceHistory,i\x3de.useMash,u\x3de.mashTimeout,s\x3de.tagParamName,m\x3d!1;i?t():r()}(model,window);',
h)},Lc=function(h){return z.script('!function(e,o){"use strict";if(o.performance\x26\x26o.ue\x26\x26"function"\x3d\x3dtypeof o.ue.count){var n\x3do.performance.now(),c\x3d[e.namespace,"Page"].concat(e.counter).join(":").toLowerCase();o.ue.count(c,n)}}(model,window);',h)},Fb=function(h){return z.script('!function(e,t){"use strict";function n(e){return[a,"Page","PModule"].concat(e).join(":").toLowerCase()}function o(e,n){t.ue\x26\x26"function"\x3d\x3dtypeof t.ue.count\x26\x26t.ue.count(e,n)}function r(e){return"function"\x3d\x3dtypeof e}var a\x3de.namespace,s\x3dt.AmazonUIPageJS?t.AmazonUIPageJS:t.P;s\x26\x26"function"\x3d\x3dtypeof s.register\x26\x26e.markers.forEach(function(e){try{s.register(e),s.when(e).execute(function(){var n\x3d"lightsaber:page:pmodule:"+e;r(t.uex)\x26\x26t.uex("ld",n,{wb:1})})}catch(a){var u\x3da\x26\x26a.message\x26\x26"string"\x3d\x3dtypeof a.message\x26\x26r(a.message.toLowerCase)\x26\x26r(a.message.indexOf);if(u\x26\x26-1!\x3d\x3da.message.toLowerCase().indexOf("already registered"))return void o(n(["ReRegister",e]),1);throw a}})}(model,window);',
h)},Mc=this&&this.__extends||function(){var h=function(b,a){h=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(a,b){a.__proto__=b}||function(a,b){for(var c in b)Object.prototype.hasOwnProperty.call(b,c)&&(a[c]=b[c])};return h(b,a)};return function(b,a){function e(){this.constructor=b}if("function"!==typeof a&&null!==a)throw new TypeError("Class extends value "+String(a)+" is not a constructor or null");h(b,a);b.prototype=null===a?Object.create(a):(e.prototype=a.prototype,new e)}}(),
Ba=this&&this.__decorate||function(h,b,a,e){var c=arguments.length,g=3>c?b:null===e?e=Object.getOwnPropertyDescriptor(b,a):e,f;if("object"===typeof Reflect&&"function"===typeof Reflect.decorate)g=Reflect.decorate(h,b,a,e);else for(var d=h.length-1;0<=d;d--)if(f=h[d])g=(3>c?f(g):3<c?f(b,a,g):f(b,a))||g;return 3<c&&g&&Object.defineProperty(b,a,g),g},Nc=this&&this.__awaiter||function(h,b,a,e){function c(b){return b instanceof a?b:new a(function(a){a(b)})}return new (a||(a=Promise))(function(a,f){function d(a){try{l(e.next(a))}catch(m){f(m)}}
function g(a){try{l(e["throw"](a))}catch(m){f(m)}}function l(b){b.done?a(b.value):c(b.value).then(d,g)}l((e=e.apply(h,b||[])).next())})},Oc=this&&this.__generator||function(h,b){function a(a){return function(b){return e([a,b])}}function e(a){if(g)throw new TypeError("Generator is already executing.");for(;c;)try{if(g=1,f&&(d=a[0]&2?f["return"]:a[0]?f["throw"]||((d=f["return"])&&d.call(f),0):f.next)&&!(d=d.call(f,a[1])).done)return d;if(f=0,d)a=[a[0]&2,d.value];switch(a[0]){case 0:case 1:d=a;break;
case 4:return c.label++,{value:a[1],done:!1};case 5:c.label++;f=a[1];a=[0];continue;case 7:a=c.ops.pop();c.trys.pop();continue;default:if(!(d=c.trys,d=0<d.length&&d[d.length-1])&&(6===a[0]||2===a[0])){c=0;continue}if(3===a[0]&&(!d||a[1]>d[0]&&a[1]<d[3]))c.label=a[1];else if(6===a[0]&&c.label<d[1])c.label=d[1],d=a;else if(d&&c.label<d[2])c.label=d[2],c.ops.push(a);else{d[2]&&c.ops.pop();c.trys.pop();continue}}a=b.call(h,c)}catch(p){a=[6,p],f=0}finally{g=d=0}if(a[0]&5)throw a[1];return{value:a[0]?a[1]:
void 0,done:!0}}var c={label:0,sent:function(){if(d[0]&1)throw d[1];return d[1]},trys:[],ops:[]},g,f,d,n;return n={next:a(0),"throw":a(1),"return":a(2)},"function"===typeof Symbol&&(n[Symbol.iterator]=function(){return this}),n},Z=function(h){function b(a,b){var c=h.call(this)||this;c.logCtor(arguments);c.eventOptions=a;c.metricsService=b;return c}Mc(b,h);b.prototype.getResponse=function(){return Nc(this,void 0,void 0,function(){var a;return Oc(this,function(b){try{return this.metricsService.count(this.eventOptions,
"Transmog:Use:".concat(this.NAME)),[2,this.transmog()]}catch(c){throw a=r.wrap(c,"Transmog",void 0,'Unexpected error while running "'.concat(this.NAME,'" transmog')),this.metricsService.error(this.eventOptions,a,this.getErrorLoggingScope()),this.metricsService.countError(this.eventOptions,a,this.getErrorLoggingScope()),a;}})})};b.prototype.getInit=function(a,b,c){void 0===a&&(a=200);return{status:a,statusText:b,headers:ma.getCommonHTMLHeaders(c)}};b.prototype.renderTemplate=function(a,b){try{var c=
a(b).trim()}catch(g){a=r.wrap(g,"TemplateRender",{view:a,model:b},'Template render failed while running "'.concat(this.NAME,'" transmog')),this.metricsService.error(this.eventOptions,a,this.getErrorLoggingScope()),this.metricsService.countError(this.eventOptions,a,this.getErrorLoggingScope()),c="\x3c!-- ".concat(a," --\x3e")}return N.isDebug?["","\x3c!-- ".concat(u.NAMESPACE,":Feature:").concat(this.NAME," --\x3e"),c,"\x3c!-- ".concat(u.NAMESPACE,":EndFeature:").concat(this.NAME," --\x3e"),""].join("\n"):
c};b.prototype.getErrorLoggingScope=function(){return"".concat(this.NAME,"ResponseTransmog")};Ba([k],b.prototype,"getResponse",null);Ba([k],b.prototype,"getInit",null);Ba([k],b.prototype,"renderTemplate",null);Ba([k],b.prototype,"getErrorLoggingScope",null);return b}(v),Pc=this&&this.__extends||function(){var h=function(b,a){h=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(a,b){a.__proto__=b}||function(a,b){for(var c in b)Object.prototype.hasOwnProperty.call(b,c)&&(a[c]=b[c])};return h(b,
a)};return function(b,a){function e(){this.constructor=b}if("function"!==typeof a&&null!==a)throw new TypeError("Class extends value "+String(a)+" is not a constructor or null");h(b,a);b.prototype=null===a?Object.create(a):(e.prototype=a.prototype,new e)}}(),Ca=this&&this.__decorate||function(h,b,a,e){var c=arguments.length,g=3>c?b:null===e?e=Object.getOwnPropertyDescriptor(b,a):e,f;if("object"===typeof Reflect&&"function"===typeof Reflect.decorate)g=Reflect.decorate(h,b,a,e);else for(var d=h.length-
1;0<=d;d--)if(f=h[d])g=(3>c?f(g):3<c?f(b,a,g):f(b,a))||g;return 3<c&&g&&Object.defineProperty(b,a,g),g},$a=this&&this.__awaiter||function(h,b,a,e){function c(b){return b instanceof a?b:new a(function(a){a(b)})}return new (a||(a=Promise))(function(a,f){function d(a){try{l(e.next(a))}catch(m){f(m)}}function g(a){try{l(e["throw"](a))}catch(m){f(m)}}function l(b){b.done?a(b.value):c(b.value).then(d,g)}l((e=e.apply(h,b||[])).next())})},ab=this&&this.__generator||function(h,b){function a(a){return function(b){return e([a,
b])}}function e(a){if(g)throw new TypeError("Generator is already executing.");for(;c;)try{if(g=1,f&&(d=a[0]&2?f["return"]:a[0]?f["throw"]||((d=f["return"])&&d.call(f),0):f.next)&&!(d=d.call(f,a[1])).done)return d;if(f=0,d)a=[a[0]&2,d.value];switch(a[0]){case 0:case 1:d=a;break;case 4:return c.label++,{value:a[1],done:!1};case 5:c.label++;f=a[1];a=[0];continue;case 7:a=c.ops.pop();c.trys.pop();continue;default:if(!(d=c.trys,d=0<d.length&&d[d.length-1])&&(6===a[0]||2===a[0])){c=0;continue}if(3===a[0]&&
(!d||a[1]>d[0]&&a[1]<d[3]))c.label=a[1];else if(6===a[0]&&c.label<d[1])c.label=d[1],d=a;else if(d&&c.label<d[2])c.label=d[2],c.ops.push(a);else{d[2]&&c.ops.pop();c.trys.pop();continue}}a=b.call(h,c)}catch(p){a=[6,p],f=0}finally{g=d=0}if(a[0]&5)throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}var c={label:0,sent:function(){if(d[0]&1)throw d[1];return d[1]},trys:[],ops:[]},g,f,d,n;return n={next:a(0),"throw":a(1),"return":a(2)},"function"===typeof Symbol&&(n[Symbol.iterator]=function(){return this}),
n},Qc=function(h){function b(a,b,c,g,f){var d=h.call(this,a,b)||this;d.NAME="ContentFragment";d.logCtor(arguments);d._name=c;d._serializableData=f;d._predefinedContent=g;d._textEncoder=new TextEncoder;return d}Pc(b,h);b.prototype.transmog=function(){return $a(this,void 0,void 0,function(){return ab(this,function(a){return[2,new Response(this._getOutputStream(),this.getInit())]})})};b.prototype._getOutputStream=function(){var a=this;return new ReadableStream({start:function(b){return $a(a,void 0,void 0,
function(){return ab(this,function(a){switch(a.label){case 0:return[4,this._toOutputStream(this._predefinedContent,b)];case 1:return a.sent(),[4,this._toOutputStream(this._getWrappedSerializedData(),b)];case 2:return a.sent(),b.close(),[2]}})})}})};b.prototype._toOutputStream=function(a,b){return $a(this,void 0,void 0,function(){var c;return ab(this,function(e){switch(e.label){case 0:return"string"===typeof a?(c=this._textEncoder.encode(a),b.enqueue(c),[2]):a.body instanceof ReadableStream?[4,na.drain(a.body,
function(a){b.enqueue(a)})]:[2];case 1:return e.sent(),[2]}})})};b.prototype._getWrappedSerializedData=function(){return this.renderTemplate(Fc,{namespace:u.NAMESPACE,globalObjectName:"$".concat(u.NAMESPACE),contentFragmentName:this._name,contentFragmentData:ea.deep.json(this._serializableData)})};Ca([k],b.prototype,"transmog",null);Ca([k],b.prototype,"_getOutputStream",null);Ca([k],b.prototype,"_toOutputStream",null);Ca([k],b.prototype,"_getWrappedSerializedData",null);return b}(Z),Rc=this&&this.__extends||
function(){var h=function(b,a){h=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(a,b){a.__proto__=b}||function(a,b){for(var c in b)Object.prototype.hasOwnProperty.call(b,c)&&(a[c]=b[c])};return h(b,a)};return function(b,a){function e(){this.constructor=b}if("function"!==typeof a&&null!==a)throw new TypeError("Class extends value "+String(a)+" is not a constructor or null");h(b,a);b.prototype=null===a?Object.create(a):(e.prototype=a.prototype,new e)}}(),bb=this&&this.__decorate||function(h,
b,a,e){var c=arguments.length,g=3>c?b:null===e?e=Object.getOwnPropertyDescriptor(b,a):e,f;if("object"===typeof Reflect&&"function"===typeof Reflect.decorate)g=Reflect.decorate(h,b,a,e);else for(var d=h.length-1;0<=d;d--)if(f=h[d])g=(3>c?f(g):3<c?f(b,a,g):f(b,a))||g;return 3<c&&g&&Object.defineProperty(b,a,g),g},ha=function(h){function b(a,b,c,g){void 0===g&&(g=!0);var e=h.call(this,a,b)||this;e.logCtor(arguments);O.validateIsUsable(c);g&&O.validateIsOK(c);e._source=e._getClonedResponse(c);return e}
Rc(b,h);b.prototype.getSource=function(a){void 0===a&&(a=!1);if(!this._source)throw r.create("ResponseInvalid");return a?this._source:this._getClonedResponse(this._source)};b.prototype.getSourceInit=function(){if(!this._source)throw r.create("ResponseInvalid");return this.getInit(this._source.status,this._source.statusText,this._source.headers)};b.prototype._getClonedResponse=function(a){try{return a.clone()}catch(e){throw a=r.wrap(e,"ResponseClone"),this.metricsService.error(this.eventOptions,a,
this.getErrorLoggingScope()),this.metricsService.countError(this.eventOptions,a,this.getErrorLoggingScope()),a;}};bb([k],b.prototype,"getSource",null);bb([k],b.prototype,"getSourceInit",null);bb([k],b.prototype,"_getClonedResponse",null);return b}(Z),Sc=this&&this.__extends||function(){var h=function(b,a){h=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(a,b){a.__proto__=b}||function(a,b){for(var c in b)Object.prototype.hasOwnProperty.call(b,c)&&(a[c]=b[c])};return h(b,a)};return function(b,
a){function e(){this.constructor=b}if("function"!==typeof a&&null!==a)throw new TypeError("Class extends value "+String(a)+" is not a constructor or null");h(b,a);b.prototype=null===a?Object.create(a):(e.prototype=a.prototype,new e)}}(),cb=this&&this.__decorate||function(h,b,a,e){var c=arguments.length,g=3>c?b:null===e?e=Object.getOwnPropertyDescriptor(b,a):e,f;if("object"===typeof Reflect&&"function"===typeof Reflect.decorate)g=Reflect.decorate(h,b,a,e);else for(var d=h.length-1;0<=d;d--)if(f=h[d])g=
(3>c?f(g):3<c?f(b,a,g):f(b,a))||g;return 3<c&&g&&Object.defineProperty(b,a,g),g},Tc=this&&this.__awaiter||function(h,b,a,e){function c(b){return b instanceof a?b:new a(function(a){a(b)})}return new (a||(a=Promise))(function(a,f){function d(a){try{l(e.next(a))}catch(m){f(m)}}function g(a){try{l(e["throw"](a))}catch(m){f(m)}}function l(b){b.done?a(b.value):c(b.value).then(d,g)}l((e=e.apply(h,b||[])).next())})},Uc=this&&this.__generator||function(h,b){function a(a){return function(b){return e([a,b])}}
function e(a){if(g)throw new TypeError("Generator is already executing.");for(;c;)try{if(g=1,f&&(d=a[0]&2?f["return"]:a[0]?f["throw"]||((d=f["return"])&&d.call(f),0):f.next)&&!(d=d.call(f,a[1])).done)return d;if(f=0,d)a=[a[0]&2,d.value];switch(a[0]){case 0:case 1:d=a;break;case 4:return c.label++,{value:a[1],done:!1};case 5:c.label++;f=a[1];a=[0];continue;case 7:a=c.ops.pop();c.trys.pop();continue;default:if(!(d=c.trys,d=0<d.length&&d[d.length-1])&&(6===a[0]||2===a[0])){c=0;continue}if(3===a[0]&&
(!d||a[1]>d[0]&&a[1]<d[3]))c.label=a[1];else if(6===a[0]&&c.label<d[1])c.label=d[1],d=a;else if(d&&c.label<d[2])c.label=d[2],c.ops.push(a);else{d[2]&&c.ops.pop();c.trys.pop();continue}}a=b.call(h,c)}catch(p){a=[6,p],f=0}finally{g=d=0}if(a[0]&5)throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}var c={label:0,sent:function(){if(d[0]&1)throw d[1];return d[1]},trys:[],ops:[]},g,f,d,n;return n={next:a(0),"throw":a(1),"return":a(2)},"function"===typeof Symbol&&(n[Symbol.iterator]=function(){return this}),
n},Vc=function(h){function b(a,b,c,g){var e=h.call(this,a,b,c)||this;e.NAME="EagerLoadJSMarker";e.markers=g;e.logCtor(arguments);return e}Sc(b,h);b.prototype.transmog=function(){return Tc(this,void 0,void 0,function(){var a,b;return Uc(this,function(c){switch(c.label){case 0:return a=this.getSource(),[4,a.text()];case 1:return b=c.sent(),[2,new Response(this._getHTML(b),this.getSourceInit())]}})})};b.prototype._getHTML=function(a){a=this._replaceMarkers(a);return a+=this.renderTemplate(Fb,{markers:this.markers.map(function(a){return"".concat(a,
".").concat(u.NAMESPACE_LCASE)})})};b.prototype._replaceMarkers=function(a){var b=this,c=a;this.markers.forEach(function(a){try{var e=new RegExp(Ma.escapeRegExp(b._getAUILoaderWithMarkerString(a)),"g");c=c.replace(e,b._getAUILoaderWithMarkerString("".concat(a,".").concat(u.NAMESPACE_LCASE)))}catch(d){a=r.create("EagerLoadJSMarkerReplacementFailed",a,d),b.metricsService.error(b.eventOptions,a,b.NAME)}});return c};b.prototype._getAUILoaderWithMarkerString=function(a){return b.AUI_JS_LOADER_PREFIX+a+
b.AUI_JS_LOADER_SUFFIX};b.AUI_JS_LOADER_PREFIX="(window.AmazonUIPageJS ? AmazonUIPageJS : P).when('";b.AUI_JS_LOADER_SUFFIX="').execute(function() {";cb([k],b.prototype,"transmog",null);cb([k],b.prototype,"_getHTML",null);cb([k],b.prototype,"_replaceMarkers",null);return b}(ha),Wc=this&&this.__extends||function(){var h=function(b,a){h=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(a,b){a.__proto__=b}||function(a,b){for(var c in b)Object.prototype.hasOwnProperty.call(b,c)&&(a[c]=b[c])};
return h(b,a)};return function(b,a){function e(){this.constructor=b}if("function"!==typeof a&&null!==a)throw new TypeError("Class extends value "+String(a)+" is not a constructor or null");h(b,a);b.prototype=null===a?Object.create(a):(e.prototype=a.prototype,new e)}}(),Gb=this&&this.__decorate||function(h,b,a,e){var c=arguments.length,g=3>c?b:null===e?e=Object.getOwnPropertyDescriptor(b,a):e,f;if("object"===typeof Reflect&&"function"===typeof Reflect.decorate)g=Reflect.decorate(h,b,a,e);else for(var d=
h.length-1;0<=d;d--)if(f=h[d])g=(3>c?f(g):3<c?f(b,a,g):f(b,a))||g;return 3<c&&g&&Object.defineProperty(b,a,g),g},db=this&&this.__awaiter||function(h,b,a,e){function c(b){return b instanceof a?b:new a(function(a){a(b)})}return new (a||(a=Promise))(function(a,f){function d(a){try{l(e.next(a))}catch(m){f(m)}}function g(a){try{l(e["throw"](a))}catch(m){f(m)}}function l(b){b.done?a(b.value):c(b.value).then(d,g)}l((e=e.apply(h,b||[])).next())})},eb=this&&this.__generator||function(h,b){function a(a){return function(b){return e([a,
b])}}function e(a){if(g)throw new TypeError("Generator is already executing.");for(;c;)try{if(g=1,f&&(d=a[0]&2?f["return"]:a[0]?f["throw"]||((d=f["return"])&&d.call(f),0):f.next)&&!(d=d.call(f,a[1])).done)return d;if(f=0,d)a=[a[0]&2,d.value];switch(a[0]){case 0:case 1:d=a;break;case 4:return c.label++,{value:a[1],done:!1};case 5:c.label++;f=a[1];a=[0];continue;case 7:a=c.ops.pop();c.trys.pop();continue;default:if(!(d=c.trys,d=0<d.length&&d[d.length-1])&&(6===a[0]||2===a[0])){c=0;continue}if(3===a[0]&&
(!d||a[1]>d[0]&&a[1]<d[3]))c.label=a[1];else if(6===a[0]&&c.label<d[1])c.label=d[1],d=a;else if(d&&c.label<d[2])c.label=d[2],c.ops.push(a);else{d[2]&&c.ops.pop();c.trys.pop();continue}}a=b.call(h,c)}catch(p){a=[6,p],f=0}finally{g=d=0}if(a[0]&5)throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}var c={label:0,sent:function(){if(d[0]&1)throw d[1];return d[1]},trys:[],ops:[]},g,f,d,n;return n={next:a(0),"throw":a(1),"return":a(2)},"function"===typeof Symbol&&(n[Symbol.iterator]=function(){return this}),
n},Xc=function(h){function b(a,b,c){var e=h.call(this,a,b,c)||this;e.NAME="InlinedStylesheet";e.logCtor(arguments);return e}Wc(b,h);b.prototype.transmog=function(){return db(this,void 0,void 0,function(){var a,e,c,g,f,d=this;return eb(this,function(h){switch(h.label){case 0:return a=this.getSource(),[4,a.text()];case 1:e=h.sent(),h.label=2;case 2:return h.trys.push([2,4,,5]),[4,Q.replaceAsync(e,b.NEEDLE_PATTERN,function(a,b){return db(d,void 0,void 0,function(){return eb(this,function(a){return[2,
this._getInlinedStyles(b)]})})})];case 3:return c=h.sent(),[3,5];case 4:return g=h.sent(),f=K.matchesCode(g,"FailedToFetch"),this.metricsService.error(this.eventOptions,g,this.getErrorLoggingScope(),f?"ERROR":void 0),this.metricsService.countError(this.eventOptions,g,f?"".concat("FailedToFetch",":").concat(this.getErrorLoggingScope()):this.getErrorLoggingScope()),c=e,[3,5];case 5:return[2,new Response(c,this.getSourceInit())]}})})};b.prototype._getInlinedStyles=function(a){return db(this,void 0,void 0,
function(){var b;return eb(this,function(c){switch(c.label){case 0:return[4,(new Xa(a)).getResponseText()];case 1:return b=c.sent(),[2,this.renderTemplate(Ic,{stylesheetUrl:a,stylesheetContent:b})]}})})};b.NEEDLE_PATTERN=/<link.+rel="stylesheet".+href="([^"]+)".*\/>/gi;Gb([k],b.prototype,"transmog",null);Gb([k],b.prototype,"_getInlinedStyles",null);return b}(ha),Yc=this&&this.__extends||function(){var h=function(b,a){h=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(a,b){a.__proto__=
b}||function(a,b){for(var c in b)Object.prototype.hasOwnProperty.call(b,c)&&(a[c]=b[c])};return h(b,a)};return function(b,a){function e(){this.constructor=b}if("function"!==typeof a&&null!==a)throw new TypeError("Class extends value "+String(a)+" is not a constructor or null");h(b,a);b.prototype=null===a?Object.create(a):(e.prototype=a.prototype,new e)}}(),Hb=this&&this.__decorate||function(h,b,a,e){var c=arguments.length,g=3>c?b:null===e?e=Object.getOwnPropertyDescriptor(b,a):e,f;if("object"===typeof Reflect&&
"function"===typeof Reflect.decorate)g=Reflect.decorate(h,b,a,e);else for(var d=h.length-1;0<=d;d--)if(f=h[d])g=(3>c?f(g):3<c?f(b,a,g):f(b,a))||g;return 3<c&&g&&Object.defineProperty(b,a,g),g},Zc=this&&this.__awaiter||function(h,b,a,e){function c(b){return b instanceof a?b:new a(function(a){a(b)})}return new (a||(a=Promise))(function(a,f){function d(a){try{l(e.next(a))}catch(m){f(m)}}function g(a){try{l(e["throw"](a))}catch(m){f(m)}}function l(b){b.done?a(b.value):c(b.value).then(d,g)}l((e=e.apply(h,
b||[])).next())})},$c=this&&this.__generator||function(h,b){function a(a){return function(b){return e([a,b])}}function e(a){if(g)throw new TypeError("Generator is already executing.");for(;c;)try{if(g=1,f&&(d=a[0]&2?f["return"]:a[0]?f["throw"]||((d=f["return"])&&d.call(f),0):f.next)&&!(d=d.call(f,a[1])).done)return d;if(f=0,d)a=[a[0]&2,d.value];switch(a[0]){case 0:case 1:d=a;break;case 4:return c.label++,{value:a[1],done:!1};case 5:c.label++;f=a[1];a=[0];continue;case 7:a=c.ops.pop();c.trys.pop();
continue;default:if(!(d=c.trys,d=0<d.length&&d[d.length-1])&&(6===a[0]||2===a[0])){c=0;continue}if(3===a[0]&&(!d||a[1]>d[0]&&a[1]<d[3]))c.label=a[1];else if(6===a[0]&&c.label<d[1])c.label=d[1],d=a;else if(d&&c.label<d[2])c.label=d[2],c.ops.push(a);else{d[2]&&c.ops.pop();c.trys.pop();continue}}a=b.call(h,c)}catch(p){a=[6,p],f=0}finally{g=d=0}if(a[0]&5)throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}var c={label:0,sent:function(){if(d[0]&1)throw d[1];return d[1]},trys:[],ops:[]},g,f,d,n;return n=
{next:a(0),"throw":a(1),"return":a(2)},"function"===typeof Symbol&&(n[Symbol.iterator]=function(){return this}),n},ad=function(h){function b(a,b,c){var e=h.call(this,a,b,c)||this;e.NAME="ShoppingPortalLoadJSMarker";e.logCtor(arguments);return e}Yc(b,h);b.prototype.transmog=function(){return Zc(this,void 0,void 0,function(){var a,b;return $c(this,function(c){switch(c.label){case 0:return a=this.getSource(),[4,a.text()];case 1:return b=c.sent(),[2,new Response(this._getHTML(b),this.getSourceInit())]}})})};
b.prototype._getHTML=function(a){a=a.replace(b.LOAD_JS_PATTERN,b.LOAD_JS_REPLACER).replace(b.CRIT_LOAD_JS_PATTERN,b.CRIT_LOAD_JS_REPLACER);return a+=this.renderTemplate(Fb,{markers:[b.LOAD_JS_REPLACER,b.CRIT_LOAD_JS_REPLACER]})};b.LOAD_JS_PATTERN=/\bsp\.load\.js\b/g;b.LOAD_JS_REPLACER="sp.load.js.".concat(u.NAMESPACE_LCASE);b.CRIT_LOAD_JS_PATTERN=/\bsp\.load\.critical\.js\b/g;b.CRIT_LOAD_JS_REPLACER="sp.load.critical.js.".concat(u.NAMESPACE_LCASE);Hb([k],b.prototype,"transmog",null);Hb([k],b.prototype,
"_getHTML",null);return b}(ha),bd=this&&this.__extends||function(){var h=function(b,a){h=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(a,b){a.__proto__=b}||function(a,b){for(var c in b)Object.prototype.hasOwnProperty.call(b,c)&&(a[c]=b[c])};return h(b,a)};return function(b,a){function e(){this.constructor=b}if("function"!==typeof a&&null!==a)throw new TypeError("Class extends value "+String(a)+" is not a constructor or null");h(b,a);b.prototype=null===a?Object.create(a):(e.prototype=
a.prototype,new e)}}(),fb=this&&this.__decorate||function(h,b,a,e){var c=arguments.length,g=3>c?b:null===e?e=Object.getOwnPropertyDescriptor(b,a):e,f;if("object"===typeof Reflect&&"function"===typeof Reflect.decorate)g=Reflect.decorate(h,b,a,e);else for(var d=h.length-1;0<=d;d--)if(f=h[d])g=(3>c?f(g):3<c?f(b,a,g):f(b,a))||g;return 3<c&&g&&Object.defineProperty(b,a,g),g},cd=this&&this.__awaiter||function(h,b,a,e){function c(b){return b instanceof a?b:new a(function(a){a(b)})}return new (a||(a=Promise))(function(a,
f){function d(a){try{l(e.next(a))}catch(m){f(m)}}function g(a){try{l(e["throw"](a))}catch(m){f(m)}}function l(b){b.done?a(b.value):c(b.value).then(d,g)}l((e=e.apply(h,b||[])).next())})},dd=this&&this.__generator||function(h,b){function a(a){return function(b){return e([a,b])}}function e(a){if(g)throw new TypeError("Generator is already executing.");for(;c;)try{if(g=1,f&&(d=a[0]&2?f["return"]:a[0]?f["throw"]||((d=f["return"])&&d.call(f),0):f.next)&&!(d=d.call(f,a[1])).done)return d;if(f=0,d)a=[a[0]&
2,d.value];switch(a[0]){case 0:case 1:d=a;break;case 4:return c.label++,{value:a[1],done:!1};case 5:c.label++;f=a[1];a=[0];continue;case 7:a=c.ops.pop();c.trys.pop();continue;default:if(!(d=c.trys,d=0<d.length&&d[d.length-1])&&(6===a[0]||2===a[0])){c=0;continue}if(3===a[0]&&(!d||a[1]>d[0]&&a[1]<d[3]))c.label=a[1];else if(6===a[0]&&c.label<d[1])c.label=d[1],d=a;else if(d&&c.label<d[2])c.label=d[2],c.ops.push(a);else{d[2]&&c.ops.pop();c.trys.pop();continue}}a=b.call(h,c)}catch(p){a=[6,p],f=0}finally{g=
d=0}if(a[0]&5)throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}var c={label:0,sent:function(){if(d[0]&1)throw d[1];return d[1]},trys:[],ops:[]},g,f,d,n;return n={next:a(0),"throw":a(1),"return":a(2)},"function"===typeof Symbol&&(n[Symbol.iterator]=function(){return this}),n},ed=function(h){function b(a,b,c){var e=h.call(this,a,b,c)||this;e.NAME="SyntheticRequestId";e.logCtor(arguments);return e}bd(b,h);b.prototype.transmog=function(){return cd(this,void 0,void 0,function(){var a,e,c,g,f,d;return dd(this,
function(h){switch(h.label){case 0:a=this.getSource();e=a.headers.get(x.shared.REQUEST_ID_OPF_HEADER);if(!e)return[2,new Response(a.body,this.getSourceInit())];c="".concat(b.SYNTHETIC_PREFIX).concat(Q.generateRandomSequence(b.SEQUENCE_LENGTH,b.SEQUENCE_RADIX)).toUpperCase();return[4,a.text()];case 1:return g=h.sent(),f=this._getHTML(g,e,c),d=this._getResponseInit(e,c),[2,new Response(f,d)]}})})};b.prototype._getHTML=function(a,b,c){b=new RegExp("".concat(b),"g");return a.replace(b,c)};b.prototype._getResponseInit=
function(a,b){var c=this.getSourceInit();c.headers instanceof Headers&&(c.headers.append(x.shared.getLibHeader("original-rid"),a),c.headers.delete(x.shared.REQUEST_ID_OPF_HEADER),c.headers.append(x.shared.REQUEST_ID_OPF_HEADER,b));return c};b.SYNTHETIC_PREFIX=u.NAMESPACE_UCASE;b.SEQUENCE_LENGTH=20-b.SYNTHETIC_PREFIX.length;b.SEQUENCE_RADIX=36;fb([k],b.prototype,"transmog",null);fb([k],b.prototype,"_getHTML",null);fb([k],b.prototype,"_getResponseInit",null);return b}(ha),fd=this&&this.__extends||function(){var h=
function(b,a){h=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(a,b){a.__proto__=b}||function(a,b){for(var c in b)Object.prototype.hasOwnProperty.call(b,c)&&(a[c]=b[c])};return h(b,a)};return function(b,a){function e(){this.constructor=b}if("function"!==typeof a&&null!==a)throw new TypeError("Class extends value "+String(a)+" is not a constructor or null");h(b,a);b.prototype=null===a?Object.create(a):(e.prototype=a.prototype,new e)}}(),gd=this&&this.__decorate||function(h,b,a,e){var c=
arguments.length,g=3>c?b:null===e?e=Object.getOwnPropertyDescriptor(b,a):e,f;if("object"===typeof Reflect&&"function"===typeof Reflect.decorate)g=Reflect.decorate(h,b,a,e);else for(var d=h.length-1;0<=d;d--)if(f=h[d])g=(3>c?f(g):3<c?f(b,a,g):f(b,a))||g;return 3<c&&g&&Object.defineProperty(b,a,g),g},hd=this&&this.__awaiter||function(h,b,a,e){function c(b){return b instanceof a?b:new a(function(a){a(b)})}return new (a||(a=Promise))(function(a,f){function d(a){try{l(e.next(a))}catch(m){f(m)}}function g(a){try{l(e["throw"](a))}catch(m){f(m)}}
function l(b){b.done?a(b.value):c(b.value).then(d,g)}l((e=e.apply(h,b||[])).next())})},id=this&&this.__generator||function(h,b){function a(a){return function(b){return e([a,b])}}function e(a){if(g)throw new TypeError("Generator is already executing.");for(;c;)try{if(g=1,f&&(d=a[0]&2?f["return"]:a[0]?f["throw"]||((d=f["return"])&&d.call(f),0):f.next)&&!(d=d.call(f,a[1])).done)return d;if(f=0,d)a=[a[0]&2,d.value];switch(a[0]){case 0:case 1:d=a;break;case 4:return c.label++,{value:a[1],done:!1};case 5:c.label++;
f=a[1];a=[0];continue;case 7:a=c.ops.pop();c.trys.pop();continue;default:if(!(d=c.trys,d=0<d.length&&d[d.length-1])&&(6===a[0]||2===a[0])){c=0;continue}if(3===a[0]&&(!d||a[1]>d[0]&&a[1]<d[3]))c.label=a[1];else if(6===a[0]&&c.label<d[1])c.label=d[1],d=a;else if(d&&c.label<d[2])c.label=d[2],c.ops.push(a);else{d[2]&&c.ops.pop();c.trys.pop();continue}}a=b.call(h,c)}catch(p){a=[6,p],f=0}finally{g=d=0}if(a[0]&5)throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}var c={label:0,sent:function(){if(d[0]&1)throw d[1];
return d[1]},trys:[],ops:[]},g,f,d,n;return n={next:a(0),"throw":a(1),"return":a(2)},"function"===typeof Symbol&&(n[Symbol.iterator]=function(){return this}),n},jd=function(h){function b(a,b,c){var e=h.call(this,a,b)||this;e.NAME="DebugInfo";e.logCtor(arguments);e._pageUrl=c;return e}fd(b,h);b.prototype.transmog=function(){return hd(this,void 0,void 0,function(){var a,b,c;return id(this,function(e){a=J.parse(this._pageUrl);b="".concat(u.NAMESPACE_LCASE,"Debug");c=!!a&&a.searchParams.has(b)&&N.isDebug;
return[2,new Response(c?this.renderTemplate(Hc,{namespace:u.NAMESPACE,globalObjectName:"$".concat(u.NAMESPACE),learnMoreLink:u.HELP_LINK}):"",this.getInit())]})})};gd([k],b.prototype,"transmog",null);return b}(Z),kd=this&&this.__extends||function(){var h=function(b,a){h=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(a,b){a.__proto__=b}||function(a,b){for(var c in b)Object.prototype.hasOwnProperty.call(b,c)&&(a[c]=b[c])};return h(b,a)};return function(b,a){function e(){this.constructor=
b}if("function"!==typeof a&&null!==a)throw new TypeError("Class extends value "+String(a)+" is not a constructor or null");h(b,a);b.prototype=null===a?Object.create(a):(e.prototype=a.prototype,new e)}}(),aa=this&&this.__decorate||function(h,b,a,e){var c=arguments.length,g=3>c?b:null===e?e=Object.getOwnPropertyDescriptor(b,a):e,f;if("object"===typeof Reflect&&"function"===typeof Reflect.decorate)g=Reflect.decorate(h,b,a,e);else for(var d=h.length-1;0<=d;d--)if(f=h[d])g=(3>c?f(g):3<c?f(b,a,g):f(b,a))||
g;return 3<c&&g&&Object.defineProperty(b,a,g),g},gb=this&&this.__awaiter||function(h,b,a,e){function c(b){return b instanceof a?b:new a(function(a){a(b)})}return new (a||(a=Promise))(function(a,f){function d(a){try{l(e.next(a))}catch(m){f(m)}}function g(a){try{l(e["throw"](a))}catch(m){f(m)}}function l(b){b.done?a(b.value):c(b.value).then(d,g)}l((e=e.apply(h,b||[])).next())})},hb=this&&this.__generator||function(h,b){function a(a){return function(b){return e([a,b])}}function e(a){if(g)throw new TypeError("Generator is already executing.");
for(;c;)try{if(g=1,f&&(d=a[0]&2?f["return"]:a[0]?f["throw"]||((d=f["return"])&&d.call(f),0):f.next)&&!(d=d.call(f,a[1])).done)return d;if(f=0,d)a=[a[0]&2,d.value];switch(a[0]){case 0:case 1:d=a;break;case 4:return c.label++,{value:a[1],done:!1};case 5:c.label++;f=a[1];a=[0];continue;case 7:a=c.ops.pop();c.trys.pop();continue;default:if(!(d=c.trys,d=0<d.length&&d[d.length-1])&&(6===a[0]||2===a[0])){c=0;continue}if(3===a[0]&&(!d||a[1]>d[0]&&a[1]<d[3]))c.label=a[1];else if(6===a[0]&&c.label<d[1])c.label=
d[1],d=a;else if(d&&c.label<d[2])c.label=d[2],c.ops.push(a);else{d[2]&&c.ops.pop();c.trys.pop();continue}}a=b.call(h,c)}catch(p){a=[6,p],f=0}finally{g=d=0}if(a[0]&5)throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}var c={label:0,sent:function(){if(d[0]&1)throw d[1];return d[1]},trys:[],ops:[]},g,f,d,n;return n={next:a(0),"throw":a(1),"return":a(2)},"function"===typeof Symbol&&(n[Symbol.iterator]=function(){return this}),n},Ib=function(h){function b(a,b,c,g,f,d,n){var e=h.call(this,a,b,c)||this;e.logCtor(arguments);
e.needle=g;e.needleLength=g.length;e.needleHeaderKey=f;e.inclusive=d;e.needleWasFound=!1;e.buffer="";e._drainBufferAtEnd=n;e._textEncoder=new TextEncoder;e._textDecoder=new TextDecoder("utf-8",{fatal:!0});return e}kd(b,h);b.prototype.transmog=function(){return gb(this,void 0,void 0,function(){var a,b;return hb(this,function(c){a=this.getSource();b=a.body;return[2,new Response(this._getOutputStream(b),this._getResponseInit())]})})};b.prototype.decode=function(a){return this._textDecoder.decode(a,{stream:!0})};
b.prototype.encode=function(a){return this._textEncoder.encode(a)};b.prototype.scan=function(a){return a.indexOf(this.needle)};b.prototype._getOutputStream=function(a){var b=this;return new ReadableStream({start:function(c){return gb(b,void 0,void 0,function(){return hb(this,function(b){switch(b.label){case 0:return[4,this._toOutputStream(a,c)];case 1:return b.sent(),[2]}})})}})};b.prototype._toOutputStream=function(a,b){return gb(this,void 0,void 0,function(){var c,e,f,d=this;return hb(this,function(g){switch(g.label){case 0:return g.trys.push([0,
2,,3]),[4,na.drain(a,function(a){d.processChunk(b,a)})];case 1:g.sent();this._drainBufferAtEnd&&(b.enqueue(this.encode(this.buffer)),this.buffer="");if(!this.needleWasFound)throw r.create("StreamTransformMissingDelimiter");b.close();return[3,3];case 2:return c=g.sent(),e=r.wrap(c,"StreamTransform",void 0,'Stream processing failed while running "'.concat(this.NAME,'" transmog')),f=K.matchesSignature(c,Y.NETWORK_ERROR),this.metricsService.error(this.eventOptions,e,this.getErrorLoggingScope(),f?"ERROR":
void 0),this.metricsService.countError(this.eventOptions,e,f?"".concat("NetworkError",":").concat(this.getErrorLoggingScope()):this.getErrorLoggingScope()),b.error(e),[3,3];case 3:return[2]}})})};b.prototype._getResponseInit=function(){var a=this.getSourceInit();if(!this.needleHeaderKey)return a;var b=new Headers(a.headers||{});b.append(x.shared.getClientOnlyLibHeader(this.needleHeaderKey),P.encode(this.needle));a.headers=b;return a};aa([k],b.prototype,"transmog",null);aa([k],b.prototype,"decode",
null);aa([k],b.prototype,"encode",null);aa([k],b.prototype,"scan",null);aa([k],b.prototype,"_getOutputStream",null);aa([k],b.prototype,"_toOutputStream",null);aa([k],b.prototype,"_getResponseInit",null);return b}(ha),ld=this&&this.__extends||function(){var h=function(b,a){h=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(a,b){a.__proto__=b}||function(a,b){for(var c in b)Object.prototype.hasOwnProperty.call(b,c)&&(a[c]=b[c])};return h(b,a)};return function(b,a){function e(){this.constructor=
b}if("function"!==typeof a&&null!==a)throw new TypeError("Class extends value "+String(a)+" is not a constructor or null");h(b,a);b.prototype=null===a?Object.create(a):(e.prototype=a.prototype,new e)}}(),md=this&&this.__decorate||function(h,b,a,e){var c=arguments.length,g=3>c?b:null===e?e=Object.getOwnPropertyDescriptor(b,a):e,f;if("object"===typeof Reflect&&"function"===typeof Reflect.decorate)g=Reflect.decorate(h,b,a,e);else for(var d=h.length-1;0<=d;d--)if(f=h[d])g=(3>c?f(g):3<c?f(b,a,g):f(b,a))||
g;return 3<c&&g&&Object.defineProperty(b,a,g),g},nd=function(h){function b(a,b,c,g,f){void 0===f&&(f=!1);var d=h.call(this,a,b,c,g,void 0,f,!1)||this;d.NAME="AfterSingleDelimiter";d.logCtor(arguments);return d}ld(b,h);b.prototype.processChunk=function(a,b){if(this.needleWasFound)a.enqueue(b);else{b=this.decode(b);b=this.buffer+b;var c=this.scan(b);-1===c?this.buffer=b.slice(-this.needleLength+1):(b=b.slice(this.inclusive?c:c+this.needleLength),a.enqueue(this.encode(b)),this.buffer="",this.needleWasFound=
!0)}};md([k],b.prototype,"processChunk",null);return b}(Ib),od=this&&this.__extends||function(){var h=function(b,a){h=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(a,b){a.__proto__=b}||function(a,b){for(var c in b)Object.prototype.hasOwnProperty.call(b,c)&&(a[c]=b[c])};return h(b,a)};return function(b,a){function e(){this.constructor=b}if("function"!==typeof a&&null!==a)throw new TypeError("Class extends value "+String(a)+" is not a constructor or null");h(b,a);b.prototype=null===
a?Object.create(a):(e.prototype=a.prototype,new e)}}(),pd=this&&this.__decorate||function(h,b,a,e){var c=arguments.length,g=3>c?b:null===e?e=Object.getOwnPropertyDescriptor(b,a):e,f;if("object"===typeof Reflect&&"function"===typeof Reflect.decorate)g=Reflect.decorate(h,b,a,e);else for(var d=h.length-1;0<=d;d--)if(f=h[d])g=(3>c?f(g):3<c?f(b,a,g):f(b,a))||g;return 3<c&&g&&Object.defineProperty(b,a,g),g},qd=function(h){function b(a,b,c,g,f,d){void 0===d&&(d=!0);var e=h.call(this,a,b,c,g,f,d,!0)||this;
e.NAME="BeforeSingleDelimiter";e.logCtor(arguments);return e}od(b,h);b.prototype.processChunk=function(a,b){if(!this.needleWasFound){b=this.decode(b);b=this.buffer+b;var c=this.scan(b);-1===c?(c=b.substring(0,b.length-this.needleLength+1),a.enqueue(this.encode(c)),this.buffer=b.slice(-this.needleLength+1)):(b=b.substring(0,this.inclusive?c+this.needleLength:c),a.enqueue(this.encode(b)),this.buffer="",this.needleWasFound=!0)}};pd([k],b.prototype,"processChunk",null);return b}(Ib),rd=this&&this.__extends||
function(){var h=function(b,a){h=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(a,b){a.__proto__=b}||function(a,b){for(var c in b)Object.prototype.hasOwnProperty.call(b,c)&&(a[c]=b[c])};return h(b,a)};return function(b,a){function e(){this.constructor=b}if("function"!==typeof a&&null!==a)throw new TypeError("Class extends value "+String(a)+" is not a constructor or null");h(b,a);b.prototype=null===a?Object.create(a):(e.prototype=a.prototype,new e)}}(),Jb=this&&this.__decorate||function(h,
b,a,e){var c=arguments.length,g=3>c?b:null===e?e=Object.getOwnPropertyDescriptor(b,a):e,f;if("object"===typeof Reflect&&"function"===typeof Reflect.decorate)g=Reflect.decorate(h,b,a,e);else for(var d=h.length-1;0<=d;d--)if(f=h[d])g=(3>c?f(g):3<c?f(b,a,g):f(b,a))||g;return 3<c&&g&&Object.defineProperty(b,a,g),g},sd=this&&this.__awaiter||function(h,b,a,e){function c(b){return b instanceof a?b:new a(function(a){a(b)})}return new (a||(a=Promise))(function(a,f){function d(a){try{l(e.next(a))}catch(m){f(m)}}
function g(a){try{l(e["throw"](a))}catch(m){f(m)}}function l(b){b.done?a(b.value):c(b.value).then(d,g)}l((e=e.apply(h,b||[])).next())})},td=this&&this.__generator||function(h,b){function a(a){return function(b){return e([a,b])}}function e(a){if(g)throw new TypeError("Generator is already executing.");for(;c;)try{if(g=1,f&&(d=a[0]&2?f["return"]:a[0]?f["throw"]||((d=f["return"])&&d.call(f),0):f.next)&&!(d=d.call(f,a[1])).done)return d;if(f=0,d)a=[a[0]&2,d.value];switch(a[0]){case 0:case 1:d=a;break;
case 4:return c.label++,{value:a[1],done:!1};case 5:c.label++;f=a[1];a=[0];continue;case 7:a=c.ops.pop();c.trys.pop();continue;default:if(!(d=c.trys,d=0<d.length&&d[d.length-1])&&(6===a[0]||2===a[0])){c=0;continue}if(3===a[0]&&(!d||a[1]>d[0]&&a[1]<d[3]))c.label=a[1];else if(6===a[0]&&c.label<d[1])c.label=d[1],d=a;else if(d&&c.label<d[2])c.label=d[2],c.ops.push(a);else{d[2]&&c.ops.pop();c.trys.pop();continue}}a=b.call(h,c)}catch(p){a=[6,p],f=0}finally{g=d=0}if(a[0]&5)throw a[1];return{value:a[0]?a[1]:
void 0,done:!0}}var c={label:0,sent:function(){if(d[0]&1)throw d[1];return d[1]},trys:[],ops:[]},g,f,d,n;return n={next:a(0),"throw":a(1),"return":a(2)},"function"===typeof Symbol&&(n[Symbol.iterator]=function(){return this}),n},ud=function(h){function b(a,b,c,g,f,d){var e=h.call(this,a,b)||this;e.NAME="AppError";e.logCtor(arguments);e._failingUrl=c;e._errorCode=g;e._description=f;e._referrerUrl=d;return e}rd(b,h);b.prototype.transmog=function(){return sd(this,void 0,void 0,function(){return td(this,
function(a){return[2,new Response(this.renderTemplate(Ec,{failingUrl:this._getSafeUrl(this._failingUrl),errorCode:this._errorCode,description:this._description,referrerUrl:this._getSafeUrl(this._referrerUrl),fallbackContentTimeout:b.HTML_FALLBACK_UI_TIMEOUT}),this.getInit())]})})};b.prototype._getSafeUrl=function(a){return a?J.encode(a)||"unknown":""};b.HTML_FALLBACK_UI_TIMEOUT=500;Jb([k],b.prototype,"transmog",null);Jb([k],b.prototype,"_getSafeUrl",null);return b}(Z),vd=this&&this.__extends||function(){var h=
function(b,a){h=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(a,b){a.__proto__=b}||function(a,b){for(var c in b)Object.prototype.hasOwnProperty.call(b,c)&&(a[c]=b[c])};return h(b,a)};return function(b,a){function e(){this.constructor=b}if("function"!==typeof a&&null!==a)throw new TypeError("Class extends value "+String(a)+" is not a constructor or null");h(b,a);b.prototype=null===a?Object.create(a):(e.prototype=a.prototype,new e)}}(),wd=this&&this.__decorate||function(h,b,a,e){var c=
arguments.length,g=3>c?b:null===e?e=Object.getOwnPropertyDescriptor(b,a):e,f;if("object"===typeof Reflect&&"function"===typeof Reflect.decorate)g=Reflect.decorate(h,b,a,e);else for(var d=h.length-1;0<=d;d--)if(f=h[d])g=(3>c?f(g):3<c?f(b,a,g):f(b,a))||g;return 3<c&&g&&Object.defineProperty(b,a,g),g},xd=this&&this.__awaiter||function(h,b,a,e){function c(b){return b instanceof a?b:new a(function(a){a(b)})}return new (a||(a=Promise))(function(a,f){function d(a){try{l(e.next(a))}catch(m){f(m)}}function g(a){try{l(e["throw"](a))}catch(m){f(m)}}
function l(b){b.done?a(b.value):c(b.value).then(d,g)}l((e=e.apply(h,b||[])).next())})},yd=this&&this.__generator||function(h,b){function a(a){return function(b){return e([a,b])}}function e(a){if(g)throw new TypeError("Generator is already executing.");for(;c;)try{if(g=1,f&&(d=a[0]&2?f["return"]:a[0]?f["throw"]||((d=f["return"])&&d.call(f),0):f.next)&&!(d=d.call(f,a[1])).done)return d;if(f=0,d)a=[a[0]&2,d.value];switch(a[0]){case 0:case 1:d=a;break;case 4:return c.label++,{value:a[1],done:!1};case 5:c.label++;
f=a[1];a=[0];continue;case 7:a=c.ops.pop();c.trys.pop();continue;default:if(!(d=c.trys,d=0<d.length&&d[d.length-1])&&(6===a[0]||2===a[0])){c=0;continue}if(3===a[0]&&(!d||a[1]>d[0]&&a[1]<d[3]))c.label=a[1];else if(6===a[0]&&c.label<d[1])c.label=d[1],d=a;else if(d&&c.label<d[2])c.label=d[2],c.ops.push(a);else{d[2]&&c.ops.pop();c.trys.pop();continue}}a=b.call(h,c)}catch(p){a=[6,p],f=0}finally{g=d=0}if(a[0]&5)throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}var c={label:0,sent:function(){if(d[0]&1)throw d[1];
return d[1]},trys:[],ops:[]},g,f,d,n;return n={next:a(0),"throw":a(1),"return":a(2)},"function"===typeof Symbol&&(n[Symbol.iterator]=function(){return this}),n},zd=function(h){function b(a,b,c,g){var e=h.call(this,a,b,c,!1)||this;e.NAME="CSMTokens";e.logCtor(arguments);e._attribution=g;return e}vd(b,h);b.prototype.transmog=function(){return xd(this,void 0,void 0,function(){var a,b,c;return yd(this,function(e){a=this.getSource();b=a.headers.get(x.shared.REQUEST_ID_OPF_HEADER);b||(c=r.create("RequestIdHeaderMissing"),
this.metricsService.error(this.eventOptions,c,this.getErrorLoggingScope()),this.metricsService.countError(this.eventOptions,c,this.getErrorLoggingScope()));this.eventOptions.errorContext.CSMTokensOPFRequestID=b||"unknown";return[2,new Response(this.renderTemplate(Gc,{namespace:u.NAMESPACE,requestId:b,attribution:this._attribution,treatment:"C"}),this.getInit())]})})};wd([k],b.prototype,"transmog",null);return b}(ha),Ad=this&&this.__extends||function(){var h=function(b,a){h=Object.setPrototypeOf||
{__proto__:[]}instanceof Array&&function(a,b){a.__proto__=b}||function(a,b){for(var c in b)Object.prototype.hasOwnProperty.call(b,c)&&(a[c]=b[c])};return h(b,a)};return function(b,a){function e(){this.constructor=b}if("function"!==typeof a&&null!==a)throw new TypeError("Class extends value "+String(a)+" is not a constructor or null");h(b,a);b.prototype=null===a?Object.create(a):(e.prototype=a.prototype,new e)}}(),Bd=this&&this.__decorate||function(h,b,a,e){var c=arguments.length,g=3>c?b:null===e?
e=Object.getOwnPropertyDescriptor(b,a):e,f;if("object"===typeof Reflect&&"function"===typeof Reflect.decorate)g=Reflect.decorate(h,b,a,e);else for(var d=h.length-1;0<=d;d--)if(f=h[d])g=(3>c?f(g):3<c?f(b,a,g):f(b,a))||g;return 3<c&&g&&Object.defineProperty(b,a,g),g},Cd=this&&this.__awaiter||function(h,b,a,e){function c(b){return b instanceof a?b:new a(function(a){a(b)})}return new (a||(a=Promise))(function(a,f){function d(a){try{l(e.next(a))}catch(m){f(m)}}function g(a){try{l(e["throw"](a))}catch(m){f(m)}}
function l(b){b.done?a(b.value):c(b.value).then(d,g)}l((e=e.apply(h,b||[])).next())})},Dd=this&&this.__generator||function(h,b){function a(a){return function(b){return e([a,b])}}function e(a){if(g)throw new TypeError("Generator is already executing.");for(;c;)try{if(g=1,f&&(d=a[0]&2?f["return"]:a[0]?f["throw"]||((d=f["return"])&&d.call(f),0):f.next)&&!(d=d.call(f,a[1])).done)return d;if(f=0,d)a=[a[0]&2,d.value];switch(a[0]){case 0:case 1:d=a;break;case 4:return c.label++,{value:a[1],done:!1};case 5:c.label++;
f=a[1];a=[0];continue;case 7:a=c.ops.pop();c.trys.pop();continue;default:if(!(d=c.trys,d=0<d.length&&d[d.length-1])&&(6===a[0]||2===a[0])){c=0;continue}if(3===a[0]&&(!d||a[1]>d[0]&&a[1]<d[3]))c.label=a[1];else if(6===a[0]&&c.label<d[1])c.label=d[1],d=a;else if(d&&c.label<d[2])c.label=d[2],c.ops.push(a);else{d[2]&&c.ops.pop();c.trys.pop();continue}}a=b.call(h,c)}catch(p){a=[6,p],f=0}finally{g=d=0}if(a[0]&5)throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}var c={label:0,sent:function(){if(d[0]&1)throw d[1];
return d[1]},trys:[],ops:[]},g,f,d,n;return n={next:a(0),"throw":a(1),"return":a(2)},"function"===typeof Symbol&&(n[Symbol.iterator]=function(){return this}),n},Ed=function(h){function b(a,b,c,g,f){var d=h.call(this,a,b)||this;d.NAME="PageMetadata";d.logCtor(arguments);d._navigationRuleName=c;d._responseStrategy=g;d._responseStrategyDetails=f;return d}Ad(b,h);b.prototype.transmog=function(){return Cd(this,void 0,void 0,function(){return Dd(this,function(a){return[2,new Response(this.renderTemplate(Jc,
{namespace:u.NAMESPACE,hit:!0,meta:{fetchEventTimeOrigin:this.eventOptions.timeOriginEpoch,navigationRule:this._navigationRuleName,responseStrategy:{name:this._responseStrategy,details:this._responseStrategyDetails},clientLib:{version:u.VERSION}},globalObjectName:"$".concat(u.NAMESPACE),pModulePrefix:"".concat(u.NAMESPACE_LCASE,"-")}),this.getInit())]})})};Bd([k],b.prototype,"transmog",null);return b}(Z),Fd=this&&this.__extends||function(){var h=function(b,a){h=Object.setPrototypeOf||{__proto__:[]}instanceof
Array&&function(a,b){a.__proto__=b}||function(a,b){for(var c in b)Object.prototype.hasOwnProperty.call(b,c)&&(a[c]=b[c])};return h(b,a)};return function(b,a){function e(){this.constructor=b}if("function"!==typeof a&&null!==a)throw new TypeError("Class extends value "+String(a)+" is not a constructor or null");h(b,a);b.prototype=null===a?Object.create(a):(e.prototype=a.prototype,new e)}}(),Gd=this&&this.__decorate||function(h,b,a,e){var c=arguments.length,g=3>c?b:null===e?e=Object.getOwnPropertyDescriptor(b,
a):e,f;if("object"===typeof Reflect&&"function"===typeof Reflect.decorate)g=Reflect.decorate(h,b,a,e);else for(var d=h.length-1;0<=d;d--)if(f=h[d])g=(3>c?f(g):3<c?f(b,a,g):f(b,a))||g;return 3<c&&g&&Object.defineProperty(b,a,g),g},Hd=this&&this.__awaiter||function(h,b,a,e){function c(b){return b instanceof a?b:new a(function(a){a(b)})}return new (a||(a=Promise))(function(a,f){function d(a){try{l(e.next(a))}catch(m){f(m)}}function g(a){try{l(e["throw"](a))}catch(m){f(m)}}function l(b){b.done?a(b.value):
c(b.value).then(d,g)}l((e=e.apply(h,b||[])).next())})},Id=this&&this.__generator||function(h,b){function a(a){return function(b){return e([a,b])}}function e(a){if(g)throw new TypeError("Generator is already executing.");for(;c;)try{if(g=1,f&&(d=a[0]&2?f["return"]:a[0]?f["throw"]||((d=f["return"])&&d.call(f),0):f.next)&&!(d=d.call(f,a[1])).done)return d;if(f=0,d)a=[a[0]&2,d.value];switch(a[0]){case 0:case 1:d=a;break;case 4:return c.label++,{value:a[1],done:!1};case 5:c.label++;f=a[1];a=[0];continue;
case 7:a=c.ops.pop();c.trys.pop();continue;default:if(!(d=c.trys,d=0<d.length&&d[d.length-1])&&(6===a[0]||2===a[0])){c=0;continue}if(3===a[0]&&(!d||a[1]>d[0]&&a[1]<d[3]))c.label=a[1];else if(6===a[0]&&c.label<d[1])c.label=d[1],d=a;else if(d&&c.label<d[2])c.label=d[2],c.ops.push(a);else{d[2]&&c.ops.pop();c.trys.pop();continue}}a=b.call(h,c)}catch(p){a=[6,p],f=0}finally{g=d=0}if(a[0]&5)throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}var c={label:0,sent:function(){if(d[0]&1)throw d[1];return d[1]},
trys:[],ops:[]},g,f,d,n;return n={next:a(0),"throw":a(1),"return":a(2)},"function"===typeof Symbol&&(n[Symbol.iterator]=function(){return this}),n},Jd=function(h){function b(a,b,c){var e=h.call(this,a,b)||this;e.NAME="PerformanceCounter";e.logCtor(arguments);e._counter=c;return e}Fd(b,h);b.prototype.transmog=function(){return Hd(this,void 0,void 0,function(){return Id(this,function(a){return[2,new Response(this.renderTemplate(Lc,{namespace:u.NAMESPACE,counter:this._counter}),this.getInit())]})})};
Gd([k],b.prototype,"transmog",null);return b}(Z),Kd=this&&this.__extends||function(){var h=function(b,a){h=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(a,b){a.__proto__=b}||function(a,b){for(var c in b)Object.prototype.hasOwnProperty.call(b,c)&&(a[c]=b[c])};return h(b,a)};return function(b,a){function e(){this.constructor=b}if("function"!==typeof a&&null!==a)throw new TypeError("Class extends value "+String(a)+" is not a constructor or null");h(b,a);b.prototype=null===a?Object.create(a):
(e.prototype=a.prototype,new e)}}(),ib=this&&this.__decorate||function(h,b,a,e){var c=arguments.length,g=3>c?b:null===e?e=Object.getOwnPropertyDescriptor(b,a):e,f;if("object"===typeof Reflect&&"function"===typeof Reflect.decorate)g=Reflect.decorate(h,b,a,e);else for(var d=h.length-1;0<=d;d--)if(f=h[d])g=(3>c?f(g):3<c?f(b,a,g):f(b,a))||g;return 3<c&&g&&Object.defineProperty(b,a,g),g},Ld=this&&this.__awaiter||function(h,b,a,e){function c(b){return b instanceof a?b:new a(function(a){a(b)})}return new (a||
(a=Promise))(function(a,f){function d(a){try{l(e.next(a))}catch(m){f(m)}}function g(a){try{l(e["throw"](a))}catch(m){f(m)}}function l(b){b.done?a(b.value):c(b.value).then(d,g)}l((e=e.apply(h,b||[])).next())})},Md=this&&this.__generator||function(h,b){function a(a){return function(b){return e([a,b])}}function e(a){if(g)throw new TypeError("Generator is already executing.");for(;c;)try{if(g=1,f&&(d=a[0]&2?f["return"]:a[0]?f["throw"]||((d=f["return"])&&d.call(f),0):f.next)&&!(d=d.call(f,a[1])).done)return d;
if(f=0,d)a=[a[0]&2,d.value];switch(a[0]){case 0:case 1:d=a;break;case 4:return c.label++,{value:a[1],done:!1};case 5:c.label++;f=a[1];a=[0];continue;case 7:a=c.ops.pop();c.trys.pop();continue;default:if(!(d=c.trys,d=0<d.length&&d[d.length-1])&&(6===a[0]||2===a[0])){c=0;continue}if(3===a[0]&&(!d||a[1]>d[0]&&a[1]<d[3]))c.label=a[1];else if(6===a[0]&&c.label<d[1])c.label=d[1],d=a;else if(d&&c.label<d[2])c.label=d[2],c.ops.push(a);else{d[2]&&c.ops.pop();c.trys.pop();continue}}a=b.call(h,c)}catch(p){a=
[6,p],f=0}finally{g=d=0}if(a[0]&5)throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}var c={label:0,sent:function(){if(d[0]&1)throw d[1];return d[1]},trys:[],ops:[]},g,f,d,n;return n={next:a(0),"throw":a(1),"return":a(2)},"function"===typeof Symbol&&(n[Symbol.iterator]=function(){return this}),n},Nd=function(h){function b(a,b,c,g,f,d){var e=h.call(this,a,b)||this;e.NAME="PageNavigate";e.logCtor(arguments);e._targetUrl=c;e._useHTTPStatusCodesForRedirects=g;e._replaceHistory=f;e._skipIntercept=d;return e}
Kd(b,h);b.prototype.transmog=function(){return Ld(this,void 0,void 0,function(){return Md(this,function(a){return[2,this._useHTTPStatusCodesForRedirects?Response.redirect(this._getTargetURL(),b.HTTP_REDIRECT_STATUS_CODE):new Response(this.renderTemplate(Kc,{useMash:W.isMShop(),mashTimeout:b.MASH_READY_TIMEOUT,url:this._getTargetURL(),replaceHistory:this._replaceHistory,tagParamName:this._getSkipInterceptParamName()}),this.getInit())]})})};b.prototype._getTargetURL=function(){var a=J.parse(this._targetUrl);
if(!a)throw a=r.create("InvalidURL",{targetUrl:this._targetUrl}),this.metricsService.error(this.eventOptions,a,this.getErrorLoggingScope()),this.metricsService.countError(this.eventOptions,a,this.getErrorLoggingScope()),a;"string"===typeof this._skipIntercept&&this._skipIntercept.length&&x.skipIntercept.setParam(a,this._skipIntercept);return a.href};b.prototype._getSkipInterceptParamName=function(){return x.skipIntercept.getParamName()};b.HTTP_REDIRECT_STATUS_CODE=302;b.MASH_READY_TIMEOUT=3E3;ib([k],
b.prototype,"transmog",null);ib([k],b.prototype,"_getTargetURL",null);ib([k],b.prototype,"_getSkipInterceptParamName",null);return b}(Z),Od=this&&this.__extends||function(){var h=function(b,a){h=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(a,b){a.__proto__=b}||function(a,b){for(var c in b)Object.prototype.hasOwnProperty.call(b,c)&&(a[c]=b[c])};return h(b,a)};return function(b,a){function e(){this.constructor=b}if("function"!==typeof a&&null!==a)throw new TypeError("Class extends value "+
String(a)+" is not a constructor or null");h(b,a);b.prototype=null===a?Object.create(a):(e.prototype=a.prototype,new e)}}(),jb=this&&this.__decorate||function(h,b,a,e){var c=arguments.length,g=3>c?b:null===e?e=Object.getOwnPropertyDescriptor(b,a):e,f;if("object"===typeof Reflect&&"function"===typeof Reflect.decorate)g=Reflect.decorate(h,b,a,e);else for(var d=h.length-1;0<=d;d--)if(f=h[d])g=(3>c?f(g):3<c?f(b,a,g):f(b,a))||g;return 3<c&&g&&Object.defineProperty(b,a,g),g},Kb=this&&this.__awaiter||function(h,
b,a,e){function c(b){return b instanceof a?b:new a(function(a){a(b)})}return new (a||(a=Promise))(function(a,f){function d(a){try{l(e.next(a))}catch(m){f(m)}}function g(a){try{l(e["throw"](a))}catch(m){f(m)}}function l(b){b.done?a(b.value):c(b.value).then(d,g)}l((e=e.apply(h,b||[])).next())})},Lb=this&&this.__generator||function(h,b){function a(a){return function(b){return e([a,b])}}function e(a){if(g)throw new TypeError("Generator is already executing.");for(;c;)try{if(g=1,f&&(d=a[0]&2?f["return"]:
a[0]?f["throw"]||((d=f["return"])&&d.call(f),0):f.next)&&!(d=d.call(f,a[1])).done)return d;if(f=0,d)a=[a[0]&2,d.value];switch(a[0]){case 0:case 1:d=a;break;case 4:return c.label++,{value:a[1],done:!1};case 5:c.label++;f=a[1];a=[0];continue;case 7:a=c.ops.pop();c.trys.pop();continue;default:if(!(d=c.trys,d=0<d.length&&d[d.length-1])&&(6===a[0]||2===a[0])){c=0;continue}if(3===a[0]&&(!d||a[1]>d[0]&&a[1]<d[3]))c.label=a[1];else if(6===a[0]&&c.label<d[1])c.label=d[1],d=a;else if(d&&c.label<d[2])c.label=
d[2],c.ops.push(a);else{d[2]&&c.ops.pop();c.trys.pop();continue}}a=b.call(h,c)}catch(p){a=[6,p],f=0}finally{g=d=0}if(a[0]&5)throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}var c={label:0,sent:function(){if(d[0]&1)throw d[1];return d[1]},trys:[],ops:[]},g,f,d,n;return n={next:a(0),"throw":a(1),"return":a(2)},"function"===typeof Symbol&&(n[Symbol.iterator]=function(){return this}),n},Pd=function(h){function b(a,b,c){var e=h.call(this)||this;e.logCtor(arguments);e._swGlobal=a;e._cacheService=b;e._metricsService=
c;e._errorLoggingScope="CacheWriter";return e}Od(b,h);b.prototype.write=function(a,b,c){return Kb(this,void 0,void 0,function(){var e,f,d,h,l,p,k,q,r,t,u,v;return Lb(this,function(g){switch(g.label){case 0:return g.trys.push([0,3,,4]),e=b.storage,f=e.cacheName,d=e.cacheKey,h=e.maxAge,l=e.validationKeys,[4,Promise.all([this._getTransmoggedResponse(a,b.transmogs,c),(new Ua(this._swGlobal)).compute(l)])];case 1:return p=g.sent(),k=p[0],q=p[1],[4,this._cacheService.write(c.eventOptions,f,d,k,{maxAgeSeconds:h,
requestStartTimestampSeconds:c.requestStartTimestampSeconds,attribution:c.attribution,validationKeys:q})];case 2:return g.sent(),[3,4];case 3:throw r=g.sent(),t=K.matchesSignature(r,Y.FAILED_TO_FETCH),u=K.matchesSignature(r,Y.NETWORK_ERROR),v=t||u||!1,this._metricsService.error(c.eventOptions,r,this._errorLoggingScope,v?"ERROR":void 0),this._metricsService.countError(c.eventOptions,r,t?"".concat("FailedToFetch",":").concat(this._errorLoggingScope):u?"".concat("NetworkError",":").concat(this._errorLoggingScope):
this._errorLoggingScope),r;case 4:return[2]}})})};b.prototype._getTransmoggedResponse=function(a,b,c){return Kb(this,void 0,void 0,function(){var e,f;return Lb(this,function(d){switch(d.label){case 0:if(!b)return[2,a];e=a;f=0;d.label=1;case 1:return f<b.length?[4,this._getTransmog(e,b[f],c).getResponse()]:[3,4];case 2:e=d.sent(),d.label=3;case 3:return f++,[3,1];case 4:return[2,e]}})})};b.prototype._getTransmog=function(a,b,c){switch(b.name){case "BeforeSingleDelimiter":return new qd(c.eventOptions,
this._metricsService,a,b.delimiter,b.delimiterKey,b.inclusive);case "EagerLoadJSMarker":return new Vc(c.eventOptions,this._metricsService,a,b.markers);case "InlinedStylesheet":return new Xc(c.eventOptions,this._metricsService,a);case "ShoppingPortalLoadJSMarker":return new ad(c.eventOptions,this._metricsService,a);case "SyntheticRequestId":return new ed(c.eventOptions,this._metricsService,a);default:throw r.create("UnrecognizedTransmog",b);}};jb([k],b.prototype,"write",null);jb([k],b.prototype,"_getTransmoggedResponse",
null);jb([k],b.prototype,"_getTransmog",null);return b}(v),Qd=this&&this.__extends||function(){var h=function(b,a){h=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(a,b){a.__proto__=b}||function(a,b){for(var c in b)Object.prototype.hasOwnProperty.call(b,c)&&(a[c]=b[c])};return h(b,a)};return function(b,a){function e(){this.constructor=b}if("function"!==typeof a&&null!==a)throw new TypeError("Class extends value "+String(a)+" is not a constructor or null");h(b,a);b.prototype=null===
a?Object.create(a):(e.prototype=a.prototype,new e)}}(),qa=this&&this.__decorate||function(h,b,a,e){var c=arguments.length,g=3>c?b:null===e?e=Object.getOwnPropertyDescriptor(b,a):e,f;if("object"===typeof Reflect&&"function"===typeof Reflect.decorate)g=Reflect.decorate(h,b,a,e);else for(var d=h.length-1;0<=d;d--)if(f=h[d])g=(3>c?f(g):3<c?f(b,a,g):f(b,a))||g;return 3<c&&g&&Object.defineProperty(b,a,g),g},Mb=this&&this.__awaiter||function(h,b,a,e){function c(b){return b instanceof a?b:new a(function(a){a(b)})}
return new (a||(a=Promise))(function(a,f){function d(a){try{l(e.next(a))}catch(m){f(m)}}function g(a){try{l(e["throw"](a))}catch(m){f(m)}}function l(b){b.done?a(b.value):c(b.value).then(d,g)}l((e=e.apply(h,b||[])).next())})},Nb=this&&this.__generator||function(h,b){function a(a){return function(b){return e([a,b])}}function e(a){if(g)throw new TypeError("Generator is already executing.");for(;c;)try{if(g=1,f&&(d=a[0]&2?f["return"]:a[0]?f["throw"]||((d=f["return"])&&d.call(f),0):f.next)&&!(d=d.call(f,
a[1])).done)return d;if(f=0,d)a=[a[0]&2,d.value];switch(a[0]){case 0:case 1:d=a;break;case 4:return c.label++,{value:a[1],done:!1};case 5:c.label++;f=a[1];a=[0];continue;case 7:a=c.ops.pop();c.trys.pop();continue;default:if(!(d=c.trys,d=0<d.length&&d[d.length-1])&&(6===a[0]||2===a[0])){c=0;continue}if(3===a[0]&&(!d||a[1]>d[0]&&a[1]<d[3]))c.label=a[1];else if(6===a[0]&&c.label<d[1])c.label=d[1],d=a;else if(d&&c.label<d[2])c.label=d[2],c.ops.push(a);else{d[2]&&c.ops.pop();c.trys.pop();continue}}a=b.call(h,
c)}catch(p){a=[6,p],f=0}finally{g=d=0}if(a[0]&5)throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}var c={label:0,sent:function(){if(d[0]&1)throw d[1];return d[1]},trys:[],ops:[]},g,f,d,n;return n={next:a(0),"throw":a(1),"return":a(2)},"function"===typeof Symbol&&(n[Symbol.iterator]=function(){return this}),n},Ob=function(h){function b(a,b,c,g){var e=h.call(this)||this;e.logCtor(arguments);e.cacheService=b;e.metricsService=c;e.cachePopulationRules=g;e.cacheWriter=new Pd(a,b,c);return e}Qd(b,h);b.prototype.logTagAndCount=
function(a,b,c,g,f){g="CachePop:".concat(this.NAME,":").concat(g);a="".concat(g,":").concat(a.name,":").concat(b.label);this.metricsService.count(c,g,f);this.metricsService.count(c,a,f);this.metricsService.tag(c,a)};b.prototype.logMark=function(a,b,c,g){g="CachePop:".concat(this.NAME,":").concat(g);a="".concat(g,":").concat(a.name,":").concat(b.label);this.metricsService.mark(c,a)};b.prototype.isResponseValidForCaching=function(a,b){return Mb(this,void 0,void 0,function(){var c;return Nb(this,function(e){switch(e.label){case 0:try{O.validateIsUsable(a),
O.validateIsOK(a)}catch(f){return[2,{valid:!1,reason:"Unusable"}]}return x.cacheControl.hasLightsaberNoStore(a)?[2,{valid:!1,reason:"NoStore"}]:(c=this._skipCachingAXModeContent(b))?[4,this._isAXModeContent(a)]:[3,2];case 1:c=e.sent(),e.label=2;case 2:return c?[2,{valid:!1,reason:"AXModeContent"}]:[2,{valid:!0}]}})})};b.prototype._skipCachingAXModeContent=function(a){return!!(a.flags||{}).dontCacheAXModeContent};b.prototype._isAXModeContent=function(a){return Mb(this,void 0,void 0,function(){var b,
c;return Nb(this,function(e){switch(e.label){case 0:return b=[/ue_sid\s*=\s*['"]000-0000000-8675309['"]/gi,/\/1\/batch\/1\/OP\/[A-Z0-9]+:000-0000000-8675309:/gi],[4,O.matchPatterns(a.clone(),b)];case 1:return c=e.sent(),[2,!c.every(function(a){return null===a})]}})})};qa([k],b.prototype,"logTagAndCount",null);qa([k],b.prototype,"logMark",null);qa([k],b.prototype,"isResponseValidForCaching",null);qa([k],b.prototype,"_skipCachingAXModeContent",null);qa([k],b.prototype,"_isAXModeContent",null);return b}(v),
Rd=this&&this.__extends||function(){var h=function(b,a){h=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(a,b){a.__proto__=b}||function(a,b){for(var c in b)Object.prototype.hasOwnProperty.call(b,c)&&(a[c]=b[c])};return h(b,a)};return function(b,a){function e(){this.constructor=b}if("function"!==typeof a&&null!==a)throw new TypeError("Class extends value "+String(a)+" is not a constructor or null");h(b,a);b.prototype=null===a?Object.create(a):(e.prototype=a.prototype,new e)}}(),kb=
this&&this.__decorate||function(h,b,a,e){var c=arguments.length,g=3>c?b:null===e?e=Object.getOwnPropertyDescriptor(b,a):e,f;if("object"===typeof Reflect&&"function"===typeof Reflect.decorate)g=Reflect.decorate(h,b,a,e);else for(var d=h.length-1;0<=d;d--)if(f=h[d])g=(3>c?f(g):3<c?f(b,a,g):f(b,a))||g;return 3<c&&g&&Object.defineProperty(b,a,g),g},Sd=this&&this.__awaiter||function(h,b,a,e){function c(b){return b instanceof a?b:new a(function(a){a(b)})}return new (a||(a=Promise))(function(a,f){function d(a){try{l(e.next(a))}catch(m){f(m)}}
function g(a){try{l(e["throw"](a))}catch(m){f(m)}}function l(b){b.done?a(b.value):c(b.value).then(d,g)}l((e=e.apply(h,b||[])).next())})},Td=this&&this.__generator||function(h,b){function a(a){return function(b){return e([a,b])}}function e(a){if(g)throw new TypeError("Generator is already executing.");for(;c;)try{if(g=1,f&&(d=a[0]&2?f["return"]:a[0]?f["throw"]||((d=f["return"])&&d.call(f),0):f.next)&&!(d=d.call(f,a[1])).done)return d;if(f=0,d)a=[a[0]&2,d.value];switch(a[0]){case 0:case 1:d=a;break;
case 4:return c.label++,{value:a[1],done:!1};case 5:c.label++;f=a[1];a=[0];continue;case 7:a=c.ops.pop();c.trys.pop();continue;default:if(!(d=c.trys,d=0<d.length&&d[d.length-1])&&(6===a[0]||2===a[0])){c=0;continue}if(3===a[0]&&(!d||a[1]>d[0]&&a[1]<d[3]))c.label=a[1];else if(6===a[0]&&c.label<d[1])c.label=d[1],d=a;else if(d&&c.label<d[2])c.label=d[2],c.ops.push(a);else{d[2]&&c.ops.pop();c.trys.pop();continue}}a=b.call(h,c)}catch(p){a=[6,p],f=0}finally{g=d=0}if(a[0]&5)throw a[1];return{value:a[0]?a[1]:
void 0,done:!0}}var c={label:0,sent:function(){if(d[0]&1)throw d[1];return d[1]},trys:[],ops:[]},g,f,d,n;return n={next:a(0),"throw":a(1),"return":a(2)},"function"===typeof Symbol&&(n[Symbol.iterator]=function(){return this}),n},Ud=function(h){function b(a,b,c,g){var e=h.call(this,a,b,c,g)||this;e.NAME="Prefetch";e.logCtor(arguments);e._prefetchExecutor=new Dc(a,b,c);return e}Rd(b,h);b.prototype.run=function(a){var b=this,c=a.detail.eventOptions,g=this._getMatchingRulesForTrigger(a);c.errorContext.CachePopulationRulesForPrefetchOnRouteTrigger=
I.serialize(g);g.forEach(function(e){var d=e.rule,g=e.trigger;t.queueTask(function(){return Sd(b,void 0,void 0,function(){var b,e;return Td(this,function(f){switch(f.label){case 0:return this.logTagAndCount(d,g,c,"Intent"),[4,this._prefetchExecutor.prefetch(d,g,a.detail.eventOptions)];case 1:return b=f.sent(),b.ok?[4,this.isResponseValidForCaching(b.response,d)]:(this.logTagAndCount(d,g,c,"Fail:".concat(b.exitCode)),[2]);case 2:e=f.sent();if(!e.valid)return this.logTagAndCount(d,g,c,"Fail:Invalid:".concat(e.reason)),
[2];this.logTagAndCount(d,g,c,"Write");f.label=3;case 3:return f.trys.push([3,5,,6]),[4,this.cacheWriter.write(b.response,d,{eventOptions:a.detail.eventOptions,requestStartTimestampSeconds:b.requestStartTimestampSeconds,attribution:g.label})];case 4:return f.sent(),this.logTagAndCount(d,g,c,"Success"),[3,6];case 5:return f.sent(),this.logTagAndCount(d,g,c,"Fail:Write"),[3,6];case 6:return[2]}})})})})};b.prototype._getMatchingRulesForTrigger=function(a){var b=this,c=[];this.cachePopulationRules.forEach(function(e){for(var g=
0;g<e.triggers.length;g++){var d=e.triggers[g];if("PrefetchOnRoute"===d.name&&b._createPrefetchOnRouteMatcher(d).match(a.detail.request)){c.push({rule:e,trigger:d});break}}});return c};b.prototype._createPrefetchOnRouteMatcher=function(a){switch(a.routeMatcher.name){case "URLPathRoute":return a=a.routeMatcher,new Db(a.pattern,a.stripRefMarkers,a.stripLanguageFolder);default:throw r.create("UnrecognizedRouteMatcher",a.routeMatcher);}};kb([k],b.prototype,"run",null);kb([k],b.prototype,"_getMatchingRulesForTrigger",
null);kb([k],b.prototype,"_createPrefetchOnRouteMatcher",null);return b}(Ob),Vd=this&&this.__extends||function(){var h=function(b,a){h=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(a,b){a.__proto__=b}||function(a,b){for(var c in b)Object.prototype.hasOwnProperty.call(b,c)&&(a[c]=b[c])};return h(b,a)};return function(b,a){function e(){this.constructor=b}if("function"!==typeof a&&null!==a)throw new TypeError("Class extends value "+String(a)+" is not a constructor or null");h(b,a);
b.prototype=null===a?Object.create(a):(e.prototype=a.prototype,new e)}}(),Pb=this&&this.__decorate||function(h,b,a,e){var c=arguments.length,g=3>c?b:null===e?e=Object.getOwnPropertyDescriptor(b,a):e,f;if("object"===typeof Reflect&&"function"===typeof Reflect.decorate)g=Reflect.decorate(h,b,a,e);else for(var d=h.length-1;0<=d;d--)if(f=h[d])g=(3>c?f(g):3<c?f(b,a,g):f(b,a))||g;return 3<c&&g&&Object.defineProperty(b,a,g),g},Wd=this&&this.__awaiter||function(h,b,a,e){function c(b){return b instanceof a?
b:new a(function(a){a(b)})}return new (a||(a=Promise))(function(a,f){function d(a){try{l(e.next(a))}catch(m){f(m)}}function g(a){try{l(e["throw"](a))}catch(m){f(m)}}function l(b){b.done?a(b.value):c(b.value).then(d,g)}l((e=e.apply(h,b||[])).next())})},Xd=this&&this.__generator||function(h,b){function a(a){return function(b){return e([a,b])}}function e(a){if(g)throw new TypeError("Generator is already executing.");for(;c;)try{if(g=1,f&&(d=a[0]&2?f["return"]:a[0]?f["throw"]||((d=f["return"])&&d.call(f),
0):f.next)&&!(d=d.call(f,a[1])).done)return d;if(f=0,d)a=[a[0]&2,d.value];switch(a[0]){case 0:case 1:d=a;break;case 4:return c.label++,{value:a[1],done:!1};case 5:c.label++;f=a[1];a=[0];continue;case 7:a=c.ops.pop();c.trys.pop();continue;default:if(!(d=c.trys,d=0<d.length&&d[d.length-1])&&(6===a[0]||2===a[0])){c=0;continue}if(3===a[0]&&(!d||a[1]>d[0]&&a[1]<d[3]))c.label=a[1];else if(6===a[0]&&c.label<d[1])c.label=d[1],d=a;else if(d&&c.label<d[2])c.label=d[2],c.ops.push(a);else{d[2]&&c.ops.pop();c.trys.pop();
continue}}a=b.call(h,c)}catch(p){a=[6,p],f=0}finally{g=d=0}if(a[0]&5)throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}var c={label:0,sent:function(){if(d[0]&1)throw d[1];return d[1]},trys:[],ops:[]},g,f,d,n;return n={next:a(0),"throw":a(1),"return":a(2)},"function"===typeof Symbol&&(n[Symbol.iterator]=function(){return this}),n},Yd=function(h){function b(a,b,c,g){var e=h.call(this,a,b,c,g)||this;e.NAME="ResponseRuleNavigationUpdate";e.logCtor(arguments);return e}Vd(b,h);b.prototype.run=function(a){var b=
this,c=a.detail,g=c.eventOptions,f=c.serverResponse;a=this._getMatchingRulesForTrigger(a);g.errorContext.CachePopulationRulesForResponseRuleNavigationUpdateTrigger=I.serialize(a);a.forEach(function(a){var c=a.rule,d=a.trigger;b.logMark(c,d,g,"Trigger:Start");t.queueTask(function(){return Wd(b,void 0,void 0,function(){var a;return Xd(this,function(b){switch(b.label){case 0:return this.logTagAndCount(c,d,g,"Intent"),[4,this.isResponseValidForCaching(f,c)];case 1:a=b.sent();if(!a.valid)return this.logTagAndCount(c,
d,g,"Fail:Invalid:".concat(a.reason)),[2];b.label=2;case 2:return b.trys.push([2,4,,5]),this.logMark(c,d,g,"Write:Start"),[4,this.cacheWriter.write(f.clone(),c,{eventOptions:g,requestStartTimestampSeconds:E.getEpochSeconds(g.timeOriginEpoch),attribution:d.label})];case 3:return b.sent(),this.logMark(c,d,g,"Write:Success"),this.logTagAndCount(c,d,g,"Success"),[3,5];case 4:return b.sent(),this.logMark(c,d,g,"Write:Fail"),this.logTagAndCount(c,d,g,"Fail:Write"),[3,5];case 5:return[2]}})})})})};b.prototype._getMatchingRulesForTrigger=
function(a){var b=[];this.cachePopulationRules.forEach(function(c){for(var e=0;e<c.triggers.length;e++){var f=c.triggers[e];if("ResponseRuleNavigationUpdate"===f.name&&f.responseRuleName===a.detail.ruleName){b.push({rule:c,trigger:f});break}}});return b};Pb([k],b.prototype,"run",null);Pb([k],b.prototype,"_getMatchingRulesForTrigger",null);return b}(Ob),Zd=this&&this.__extends||function(){var h=function(b,a){h=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(a,b){a.__proto__=b}||function(a,
b){for(var c in b)Object.prototype.hasOwnProperty.call(b,c)&&(a[c]=b[c])};return h(b,a)};return function(b,a){function e(){this.constructor=b}if("function"!==typeof a&&null!==a)throw new TypeError("Class extends value "+String(a)+" is not a constructor or null");h(b,a);b.prototype=null===a?Object.create(a):(e.prototype=a.prototype,new e)}}(),$d=this&&this.__decorate||function(h,b,a,e){var c=arguments.length,g=3>c?b:null===e?e=Object.getOwnPropertyDescriptor(b,a):e,f;if("object"===typeof Reflect&&
"function"===typeof Reflect.decorate)g=Reflect.decorate(h,b,a,e);else for(var d=h.length-1;0<=d;d--)if(f=h[d])g=(3>c?f(g):3<c?f(b,a,g):f(b,a))||g;return 3<c&&g&&Object.defineProperty(b,a,g),g},ae=function(h){function b(a,b,c,g,f){var d=h.call(this)||this;d.logCtor(arguments);d._responseRuleNavigationUpdateTrigger=new Yd(a,b,c,f);d._prefetchOnRouteTrigger=new Ud(a,b,c,f);g.subscribe("ResponseRuleNavigation",d);g.subscribe("Navigation",d);return d}Zd(b,h);b.prototype.notifyEvent=function(a){switch(a.name){case "ResponseRuleNavigation":this._responseRuleNavigationUpdateTrigger.run(a);
break;case "Navigation":this._prefetchOnRouteTrigger.run(a)}};$d([k],b.prototype,"notifyEvent",null);return b}(v),be=this&&this.__extends||function(){var h=function(b,a){h=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(a,b){a.__proto__=b}||function(a,b){for(var c in b)Object.prototype.hasOwnProperty.call(b,c)&&(a[c]=b[c])};return h(b,a)};return function(b,a){function e(){this.constructor=b}if("function"!==typeof a&&null!==a)throw new TypeError("Class extends value "+String(a)+" is not a constructor or null");
h(b,a);b.prototype=null===a?Object.create(a):(e.prototype=a.prototype,new e)}}(),Da=this&&this.__decorate||function(h,b,a,e){var c=arguments.length,g=3>c?b:null===e?e=Object.getOwnPropertyDescriptor(b,a):e,f;if("object"===typeof Reflect&&"function"===typeof Reflect.decorate)g=Reflect.decorate(h,b,a,e);else for(var d=h.length-1;0<=d;d--)if(f=h[d])g=(3>c?f(g):3<c?f(b,a,g):f(b,a))||g;return 3<c&&g&&Object.defineProperty(b,a,g),g},Ea=function(h){function b(){return null!==h&&h.apply(this,arguments)||
this}be(b,h);b.prototype.filter=function(a){var b=this;return a.filter(function(a){var c=b.isValid(a);c||b.log("filter","Invalid:",a);return c})};b.prototype.isValidRouteMatcher=function(a){var b=q.isObject,c=q.isNonEmptyString,g=q.isUndefinedOr,f=q.isBoolean;if(!b(a)||!c(a.name))return!1;switch(a.name){case "URLPathRoute":return a.pattern instanceof RegExp&&g(a.stripRefMarkers,f(a.stripRefMarkers))&&g(a.stripLanguageFolder,f(a.stripLanguageFolder));default:return!1}};b.prototype.isValidValidationKeys=
function(a){var b=q.isArrayWhereEvery,c=q.isOneOf;return b(a,function(a){return c(a,"marketplace language recognition session ubid clientlibversion".split(" "))})};b.prototype.isValidForHeaderField=function(a){var b=q.matchesPattern;return b(a,/^[\w\-]+$/)};Da([k],b.prototype,"filter",null);Da([k],b.prototype,"isValidRouteMatcher",null);Da([k],b.prototype,"isValidValidationKeys",null);Da([k],b.prototype,"isValidForHeaderField",null);return b}(v),ce=this&&this.__extends||function(){var h=function(b,
a){h=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(a,b){a.__proto__=b}||function(a,b){for(var c in b)Object.prototype.hasOwnProperty.call(b,c)&&(a[c]=b[c])};return h(b,a)};return function(b,a){function e(){this.constructor=b}if("function"!==typeof a&&null!==a)throw new TypeError("Class extends value "+String(a)+" is not a constructor or null");h(b,a);b.prototype=null===a?Object.create(a):(e.prototype=a.prototype,new e)}}(),de=this&&this.__decorate||function(h,b,a,e){var c=arguments.length,
g=3>c?b:null===e?e=Object.getOwnPropertyDescriptor(b,a):e,f;if("object"===typeof Reflect&&"function"===typeof Reflect.decorate)g=Reflect.decorate(h,b,a,e);else for(var d=h.length-1;0<=d;d--)if(f=h[d])g=(3>c?f(g):3<c?f(b,a,g):f(b,a))||g;return 3<c&&g&&Object.defineProperty(b,a,g),g},ee=function(h){function b(){return null!==h&&h.apply(this,arguments)||this}ce(b,h);b.prototype.isValid=function(a){var b=q.isObject,c=q.isNonEmptyString,g=q.isPositiveInteger,f=q.isUndefinedOr,d=q.isBoolean,h=q.isOneOf,
l=q.isArrayWhereEvery;return b(a)&&c(a.name)&&g(a.version)&&f(a.dontCleanOldVersions,d(a.dontCleanOldVersions))&&f(a.plugins,l(a.plugins,function(a){return h(a,["MaxAge","ValidationKeys","Metadata"])}))};de([k],b.prototype,"isValid",null);return b}(Ea),fe=this&&this.__extends||function(){var h=function(b,a){h=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(a,b){a.__proto__=b}||function(a,b){for(var c in b)Object.prototype.hasOwnProperty.call(b,c)&&(a[c]=b[c])};return h(b,a)};return function(b,
a){function e(){this.constructor=b}if("function"!==typeof a&&null!==a)throw new TypeError("Class extends value "+String(a)+" is not a constructor or null");h(b,a);b.prototype=null===a?Object.create(a):(e.prototype=a.prototype,new e)}}(),ge=this&&this.__decorate||function(h,b,a,e){var c=arguments.length,g=3>c?b:null===e?e=Object.getOwnPropertyDescriptor(b,a):e,f;if("object"===typeof Reflect&&"function"===typeof Reflect.decorate)g=Reflect.decorate(h,b,a,e);else for(var d=h.length-1;0<=d;d--)if(f=h[d])g=
(3>c?f(g):3<c?f(b,a,g):f(b,a))||g;return 3<c&&g&&Object.defineProperty(b,a,g),g},he=function(h){function b(){return null!==h&&h.apply(this,arguments)||this}fe(b,h);b.prototype.isValid=function(a){var b=q.isObject,c=q.isNonEmptyString,g=q.isURL;return b(a)&&c(a.name)&&g(a.url)};ge([k],b.prototype,"isValid",null);return b}(Ea),ie=this&&this.__extends||function(){var h=function(b,a){h=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(a,b){a.__proto__=b}||function(a,b){for(var c in b)Object.prototype.hasOwnProperty.call(b,
c)&&(a[c]=b[c])};return h(b,a)};return function(b,a){function e(){this.constructor=b}if("function"!==typeof a&&null!==a)throw new TypeError("Class extends value "+String(a)+" is not a constructor or null");h(b,a);b.prototype=null===a?Object.create(a):(e.prototype=a.prototype,new e)}}(),ia=this&&this.__decorate||function(h,b,a,e){var c=arguments.length,g=3>c?b:null===e?e=Object.getOwnPropertyDescriptor(b,a):e,f;if("object"===typeof Reflect&&"function"===typeof Reflect.decorate)g=Reflect.decorate(h,
b,a,e);else for(var d=h.length-1;0<=d;d--)if(f=h[d])g=(3>c?f(g):3<c?f(b,a,g):f(b,a))||g;return 3<c&&g&&Object.defineProperty(b,a,g),g},je=function(h){function b(){return null!==h&&h.apply(this,arguments)||this}ie(b,h);b.prototype.isValid=function(a){var b=this,c=q.isObject,g=q.isNonEmptyString,f=q.isNonEmptyArray,d=q.isUndefinedOr,h=q.isArrayWhereEvery;return c(a)&&g(a.name)&&f(a.triggers)&&h(a.triggers,function(a){return b._isValidTrigger(a)})&&d(a.transmogs,h(a.transmogs,function(a){return b._isValidTransmog(a)}))&&
this._isValidStorage(a.storage)&&this._isValidFlags(a.flags)};b.prototype._isValidTrigger=function(a){var b=q.isObject,c=q.isNonEmptyString;if(!b(a)||!c(a.name)||!c(a.label))return!1;switch(a.name){case "ResponseRuleNavigationUpdate":return c(a.responseRuleName);case "PrefetchOnRoute":return this.isValidRouteMatcher(a.routeMatcher)&&this._isValidPrefetch(a.prefetch);default:return!1}};b.prototype._isValidPrefetch=function(a){var b=q.isObject,c=q.isNonEmptyString,g=q.isOneOf,f=q.isPositiveInteger;
return b(a)&&c(a.endpoint)&&g(a.mode,["cache-miss","always"])&&f(a.delay)};b.prototype._isValidTransmog=function(a){var b=q.isObject,c=q.isNonEmptyString,g=q.isUndefinedOr,f=q.isBoolean,d=q.isArrayWhereEvery,h=q.isNonEmptyArray;if(!b(a)||!c(a.name))return!1;switch(a.name){case "BeforeSingleDelimiter":return c(a.delimiter)&&this.isValidForHeaderField(a.delimiterKey)&&g(a.inclusive,f(a.inclusive));case "EagerLoadJSMarker":return h(a.markers)&&d(a.markers,c);case "InlinedStylesheet":case "ShoppingPortalLoadJSMarker":case "SyntheticRequestId":return!0;
default:return!1}};b.prototype._isValidStorage=function(a){var b=q.isObject,c=q.isNonEmptyString,g=q.isPositiveInteger;return b(a)&&c(a.cacheName)&&c(a.cacheKey)&&g(a.maxAge)&&this.isValidValidationKeys(a.validationKeys)};b.prototype._isValidFlags=function(a){var b=q.isObject,c=q.isUndefinedOr,g=q.isArrayWhereEvery,f=q.isOneOf,d=q.isBoolean;return c(a,b(a)&&g(Object.keys(a),function(a){return f(a,["dontCacheAXModeContent"])})&&c(a.dontCacheAXModeContent,d(a.dontCacheAXModeContent)))};ia([k],b.prototype,
"isValid",null);ia([k],b.prototype,"_isValidTrigger",null);ia([k],b.prototype,"_isValidPrefetch",null);ia([k],b.prototype,"_isValidTransmog",null);ia([k],b.prototype,"_isValidStorage",null);ia([k],b.prototype,"_isValidFlags",null);return b}(Ea),ke=this&&this.__extends||function(){var h=function(b,a){h=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(a,b){a.__proto__=b}||function(a,b){for(var c in b)Object.prototype.hasOwnProperty.call(b,c)&&(a[c]=b[c])};return h(b,a)};return function(b,
a){function e(){this.constructor=b}if("function"!==typeof a&&null!==a)throw new TypeError("Class extends value "+String(a)+" is not a constructor or null");h(b,a);b.prototype=null===a?Object.create(a):(e.prototype=a.prototype,new e)}}(),ra=this&&this.__decorate||function(h,b,a,e){var c=arguments.length,g=3>c?b:null===e?e=Object.getOwnPropertyDescriptor(b,a):e,f;if("object"===typeof Reflect&&"function"===typeof Reflect.decorate)g=Reflect.decorate(h,b,a,e);else for(var d=h.length-1;0<=d;d--)if(f=h[d])g=
(3>c?f(g):3<c?f(b,a,g):f(b,a))||g;return 3<c&&g&&Object.defineProperty(b,a,g),g},le=function(h){function b(){return null!==h&&h.apply(this,arguments)||this}ke(b,h);b.prototype.isValid=function(a){var b=this,c=q.isObject,g=q.isNonEmptyString,f=q.isNonEmptyArray,d=q.isUndefinedOr,h=q.isBoolean,l=q.isArrayWhereEvery;return c(a)&&g(a.name)&&f(a.routeMatchers)&&l(a.routeMatchers,function(a){return b.isValidRouteMatcher(a)})&&d(a.weblabTriggers,l(a.weblabTriggers,function(a){return b._isValidWeblabTrigger(a)}))&&
h(a.respond)&&this._isValidResponseStrategy(a.responseStrategy)};b.prototype._isValidWeblabTrigger=function(a){var b=q.isObject,c=q.isNonEmptyString;return b(a)&&c(a.name)&&c(a.treatment)};b.prototype._isValidResponseStrategy=function(a){var b=this,c=q.isObject,g=q.isNonEmptyString,f=q.isUndefinedOr,d=q.isBoolean,h=q.isArrayWhereEvery,l=q.isOneOf;if(!c(a)||!g(a.name))return!1;switch(a.name){case "SingleDelimiter":return h(a.pageShells,function(a){return g(a.cacheName)&&g(a.cacheKey)&&b.isValidValidationKeys(a.validationKeys)&&
b.isValidForHeaderField(a.delimiterKey)&&b._isValidSkeleton(a.skeleton)})&&f(a.noPageShell,c(a.noPageShell)&&this._isValidSkeleton(a.noPageShell.skeleton))&&f(a.flags,c(a.flags)&&h(Object.keys(a.flags),function(b){var c=a.flags[b];return l(b,["passthrough","flushFullOnMissingDelimiter"])&&f(c,d(c))}));default:return!1}};b.prototype._isValidSkeleton=function(a){var b=this,c=q.isObject,g=q.isBoolean,f=q.isNonEmptyString,d=q.isPositiveInteger,h=q.isUndefinedOr,l=q.isOneOf,k=q.isArrayWhereEvery;return h(a,
!!a&&c(a)&&f(a.name)&&h(a.prewarm,l(a.prewarm,["http-cache","memory","none"]))&&h(a.race,g(a.race))&&h(a.data,c(a.data))&&c(a.hooks)&&k(Object.keys(a.hooks),function(c){return b._isValidSkeletonHook(a.hooks[c])})&&c(a.hooks.remove)&&c(a.hooks.remove.whenAny)&&d(a.hooks.remove.whenAny.timeout))};b.prototype._isValidSkeletonHook=function(a){var b=q.isObject,c=q.isNonEmptyString,g=q.isPositiveInteger,f=q.isOneOf,d=q.isArrayWhereEvery,h=function(a){return b(a)&&c(a.value)&&g(a.delay)};return d(Object.keys(a),
function(b){var e=a[b];return f(b,["whenAny"])&&d(Object.keys(e),function(a){var b=e[a];return"timeout"===a&&g(b)||f(a,["domEvent","auiModule","idMatches","selectorMatches"])&&(c(b)||h(b)||d(b,function(a){return c(a)||h(a)}))})})};ra([k],b.prototype,"isValid",null);ra([k],b.prototype,"_isValidWeblabTrigger",null);ra([k],b.prototype,"_isValidResponseStrategy",null);ra([k],b.prototype,"_isValidSkeleton",null);ra([k],b.prototype,"_isValidSkeletonHook",null);return b}(Ea),me=this&&this.__extends||function(){var h=
function(b,a){h=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(a,b){a.__proto__=b}||function(a,b){for(var c in b)Object.prototype.hasOwnProperty.call(b,c)&&(a[c]=b[c])};return h(b,a)};return function(b,a){function e(){this.constructor=b}if("function"!==typeof a&&null!==a)throw new TypeError("Class extends value "+String(a)+" is not a constructor or null");h(b,a);b.prototype=null===a?Object.create(a):(e.prototype=a.prototype,new e)}}(),V=this&&this.__decorate||function(h,b,a,e){var c=
arguments.length,g=3>c?b:null===e?e=Object.getOwnPropertyDescriptor(b,a):e,f;if("object"===typeof Reflect&&"function"===typeof Reflect.decorate)g=Reflect.decorate(h,b,a,e);else for(var d=h.length-1;0<=d;d--)if(f=h[d])g=(3>c?f(g):3<c?f(b,a,g):f(b,a))||g;return 3<c&&g&&Object.defineProperty(b,a,g),g},lb=this&&this.__awaiter||function(h,b,a,e){function c(b){return b instanceof a?b:new a(function(a){a(b)})}return new (a||(a=Promise))(function(a,f){function d(a){try{l(e.next(a))}catch(m){f(m)}}function g(a){try{l(e["throw"](a))}catch(m){f(m)}}
function l(b){b.done?a(b.value):c(b.value).then(d,g)}l((e=e.apply(h,b||[])).next())})},mb=this&&this.__generator||function(h,b){function a(a){return function(b){return e([a,b])}}function e(a){if(g)throw new TypeError("Generator is already executing.");for(;c;)try{if(g=1,f&&(d=a[0]&2?f["return"]:a[0]?f["throw"]||((d=f["return"])&&d.call(f),0):f.next)&&!(d=d.call(f,a[1])).done)return d;if(f=0,d)a=[a[0]&2,d.value];switch(a[0]){case 0:case 1:d=a;break;case 4:return c.label++,{value:a[1],done:!1};case 5:c.label++;
f=a[1];a=[0];continue;case 7:a=c.ops.pop();c.trys.pop();continue;default:if(!(d=c.trys,d=0<d.length&&d[d.length-1])&&(6===a[0]||2===a[0])){c=0;continue}if(3===a[0]&&(!d||a[1]>d[0]&&a[1]<d[3]))c.label=a[1];else if(6===a[0]&&c.label<d[1])c.label=d[1],d=a;else if(d&&c.label<d[2])c.label=d[2],c.ops.push(a);else{d[2]&&c.ops.pop();c.trys.pop();continue}}a=b.call(h,c)}catch(p){a=[6,p],f=0}finally{g=d=0}if(a[0]&5)throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}var c={label:0,sent:function(){if(d[0]&1)throw d[1];
return d[1]},trys:[],ops:[]},g,f,d,n;return n={next:a(0),"throw":a(1),"return":a(2)},"function"===typeof Symbol&&(n[Symbol.iterator]=function(){return this}),n},ne=function(h){function b(a,b,c){var e=h.call(this)||this;e._computed={};e._memoryCache={};e.logCtor(arguments);e._metricsService=a;e._errorLoggingScope="ContentFragmentService";e._init(c,b);return e}me(b,h);b.prototype.render=function(a,b,c){return lb(this,void 0,void 0,function(){var e,f;return mb(this,function(d){switch(d.label){case 0:return e=
this._getContentFragmentConfig(b),e?(f=this._fetchFromMemory(e.name))?[3,2]:[4,this._fetchFromNetwork(a,e)]:[2];case 1:f=d.sent(),d.label=2;case 2:return f?[2,(new Qc(a,this._metricsService,b,f,c)).getResponse()]:[2]}})})};b.prototype.prewarm=function(a,b,c){var e=this,f=this._getContentFragmentConfig(b);if(f)switch(c){case "http-cache":case "memory":t.queueTask(function(){return lb(e,void 0,void 0,function(){var d;return mb(this,function(e){switch(e.label){case 0:return[4,this._fetchFromNetwork(a,
f,!0)];case 1:return d=e.sent(),"memory"===c&&this._cacheInMemory(b,d),[2]}})})})}};b.prototype.notifyEvent=function(a){switch(a.name){case "ContentFragmentSpeculation":this.prewarm(a.detail.eventOptions,a.detail.name,a.detail.prewarm)}};b.prototype._fetchFromNetwork=function(a,b,c){void 0===c&&(c=!1);return lb(this,void 0,void 0,function(){var e;return mb(this,function(g){switch(g.label){case 0:return g.trys.push([0,2,,3]),[4,(new Xa(b.url)).getResponse()];case 1:return[2,g.sent()];case 2:return e=
g.sent(),this._metricsService.countError(a,e,c?"".concat(this._errorLoggingScope,":Prewarming"):this._errorLoggingScope),[2];case 3:return[2]}})})};b.prototype._fetchFromMemory=function(a){return(a=this._memoryCache[a])?a.clone():void 0};b.prototype._cacheInMemory=function(a,b){b&&(this._memoryCache[a]=b)};b.prototype._getContentFragmentConfig=function(a){return this._computed[a]};b.prototype._init=function(a,b){var c=this;a.forEach(function(a){c._computed[a.name]=a});b.subscribe("ContentFragmentSpeculation",
this)};V([k],b.prototype,"render",null);V([k],b.prototype,"prewarm",null);V([k],b.prototype,"notifyEvent",null);V([k],b.prototype,"_fetchFromNetwork",null);V([k],b.prototype,"_fetchFromMemory",null);V([k],b.prototype,"_cacheInMemory",null);V([k],b.prototype,"_getContentFragmentConfig",null);V([k],b.prototype,"_init",null);return b}(v),oe=this&&this.__extends||function(){var h=function(b,a){h=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(a,b){a.__proto__=b}||function(a,b){for(var c in b)Object.prototype.hasOwnProperty.call(b,
c)&&(a[c]=b[c])};return h(b,a)};return function(b,a){function e(){this.constructor=b}if("function"!==typeof a&&null!==a)throw new TypeError("Class extends value "+String(a)+" is not a constructor or null");h(b,a);b.prototype=null===a?Object.create(a):(e.prototype=a.prototype,new e)}}(),ja=this&&this.__decorate||function(h,b,a,e){var c=arguments.length,g=3>c?b:null===e?e=Object.getOwnPropertyDescriptor(b,a):e,f;if("object"===typeof Reflect&&"function"===typeof Reflect.decorate)g=Reflect.decorate(h,
b,a,e);else for(var d=h.length-1;0<=d;d--)if(f=h[d])g=(3>c?f(g):3<c?f(b,a,g):f(b,a))||g;return 3<c&&g&&Object.defineProperty(b,a,g),g},pe=function(h){function b(){var a=h.call(this)||this;a.logCtor(arguments);a._subscriptionsByEvents={};a._subscriptionCount=0;return a}oe(b,h);b.prototype.publish=function(a){var b=this,c=this._subscriptionsByEvents[this._getInternalEventName(a.name)];c&&Object.keys(c).forEach(function(e){var g=c[e];g.once&&b.unsubscribe(e);b._notify(a,g)})};b.prototype.subscribe=function(a,
b,c,g){void 0===c&&(c="async");a=this._getInternalEventName(a);var e=this._getUniqueSubscriptionId();b={subscriptionId:e,mode:c,subscriber:b,once:g};this._subscriptionsByEvents.hasOwnProperty(a)||(this._subscriptionsByEvents[a]={});this._subscriptionsByEvents[a][e]=b;return e};b.prototype.unsubscribe=function(a){var b=this;Object.keys(this._subscriptionsByEvents).forEach(function(c){var e=b._subscriptionsByEvents[c];Object.keys(e).forEach(function(b){b===a&&delete e[b]})})};b.prototype._notify=function(a,
b){var c=function(){b.subscriber.notifyEvent(a)};"sync"===b.mode?c():t.queueTask(c)};b.prototype._getUniqueSubscriptionId=function(){return"".concat(this._subscriptionCount++)};b.prototype._getInternalEventName=function(a){return"".concat(u.NAMESPACE,":").concat(a)};ja([k],b.prototype,"publish",null);ja([k],b.prototype,"subscribe",null);ja([k],b.prototype,"unsubscribe",null);ja([k],b.prototype,"_notify",null);ja([k],b.prototype,"_getUniqueSubscriptionId",null);ja([k],b.prototype,"_getInternalEventName",
null);return b}(v),qe=this&&this.__extends||function(){var h=function(b,a){h=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(a,b){a.__proto__=b}||function(a,b){for(var c in b)Object.prototype.hasOwnProperty.call(b,c)&&(a[c]=b[c])};return h(b,a)};return function(b,a){function e(){this.constructor=b}if("function"!==typeof a&&null!==a)throw new TypeError("Class extends value "+String(a)+" is not a constructor or null");h(b,a);b.prototype=null===a?Object.create(a):(e.prototype=a.prototype,
new e)}}(),re=this&&this.__decorate||function(h,b,a,e){var c=arguments.length,g=3>c?b:null===e?e=Object.getOwnPropertyDescriptor(b,a):e,f;if("object"===typeof Reflect&&"function"===typeof Reflect.decorate)g=Reflect.decorate(h,b,a,e);else for(var d=h.length-1;0<=d;d--)if(f=h[d])g=(3>c?f(g):3<c?f(b,a,g):f(b,a))||g;return 3<c&&g&&Object.defineProperty(b,a,g),g},se=function(h){function b(a,b,c){var e=h.call(this)||this;e.logCtor(arguments);e.swGlobal=a;e.metricsService=b;e.eventBus=c;e._initFetchHandling();
return e}qe(b,h);b.prototype._initFetchHandling=function(){var a=this;this.swGlobal.addEventListener("fetch",function(b){if(a.filter(b)){var c=fa.create(b.resultingClientId);a.handle(c,b);a.publishEvent(c,b)}})};re([k],b.prototype,"_initFetchHandling",null);return b}(v),te=this&&this.__extends||function(){var h=function(b,a){h=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(a,b){a.__proto__=b}||function(a,b){for(var c in b)Object.prototype.hasOwnProperty.call(b,c)&&(a[c]=b[c])};return h(b,
a)};return function(b,a){function e(){this.constructor=b}if("function"!==typeof a&&null!==a)throw new TypeError("Class extends value "+String(a)+" is not a constructor or null");h(b,a);b.prototype=null===a?Object.create(a):(e.prototype=a.prototype,new e)}}(),Fa=this&&this.__decorate||function(h,b,a,e){var c=arguments.length,g=3>c?b:null===e?e=Object.getOwnPropertyDescriptor(b,a):e,f;if("object"===typeof Reflect&&"function"===typeof Reflect.decorate)g=Reflect.decorate(h,b,a,e);else for(var d=h.length-
1;0<=d;d--)if(f=h[d])g=(3>c?f(g):3<c?f(b,a,g):f(b,a))||g;return 3<c&&g&&Object.defineProperty(b,a,g),g},ue=function(h){function b(a,b,c,g,f){var d=h.call(this,a,c,g)||this;d.logCtor(arguments);d._requireNavigationPreloadSupport=f.usePreloadResponseOnlyForServerResponseOnNavigations;d._navigationResponseService=b;return d}te(b,h);b.prototype.filter=function(a){a=a.request;var b=a.destination,c=a.method,g=a.isHistoryNavigation;return"navigate"===a.mode&&"document"===b&&"GET"===c&&!g};b.prototype.handle=
function(a,b){this._shouldSkipInterception(a,b)||this._navigationResponseService.respond(a,b)};b.prototype.publishEvent=function(a,b){this.eventBus.publish({name:"Navigation",detail:{request:b.request,eventOptions:a}})};b.prototype._shouldSkipInterception=function(a,b){return this._hasSkipInterceptUrlParam(a,b)||this._requiresButDoesNotSupportNavigationPreload(b)};b.prototype._hasSkipInterceptUrlParam=function(a,b){var c=this,e=(b=J.parse(b.request.url))?x.skipIntercept.getParam(b):"NoURL";e&&t.queueTask(function(){var b=
Ja.onlyWordChars(e).substr(0,50);c.metricsService.tag(a,"SkipIntercept");c.metricsService.tag(a,"".concat("SkipIntercept",":").concat(b))});return!!e};b.prototype._requiresButDoesNotSupportNavigationPreload=function(a){return this._requireNavigationPreloadSupport&&!a.preloadResponse};Fa([k],b.prototype,"handle",null);Fa([k],b.prototype,"publishEvent",null);Fa([k],b.prototype,"_hasSkipInterceptUrlParam",null);Fa([k],b.prototype,"_requiresButDoesNotSupportNavigationPreload",null);return b}(se),ve=this&&
this.__extends||function(){var h=function(b,a){h=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(a,b){a.__proto__=b}||function(a,b){for(var c in b)Object.prototype.hasOwnProperty.call(b,c)&&(a[c]=b[c])};return h(b,a)};return function(b,a){function e(){this.constructor=b}if("function"!==typeof a&&null!==a)throw new TypeError("Class extends value "+String(a)+" is not a constructor or null");h(b,a);b.prototype=null===a?Object.create(a):(e.prototype=a.prototype,new e)}}(),Ga=this&&this.__decorate||
function(h,b,a,e){var c=arguments.length,g=3>c?b:null===e?e=Object.getOwnPropertyDescriptor(b,a):e,f;if("object"===typeof Reflect&&"function"===typeof Reflect.decorate)g=Reflect.decorate(h,b,a,e);else for(var d=h.length-1;0<=d;d--)if(f=h[d])g=(3>c?f(g):3<c?f(b,a,g):f(b,a))||g;return 3<c&&g&&Object.defineProperty(b,a,g),g},we=function(h){function b(a,b){var c=h.call(this)||this;c.logCtor(arguments);c._swGlobal=a;c._eventBus=b;c._ready=[];c._listenForClientReady();return c}ve(b,h);b.prototype.isReady=
function(a){return-1!==this._ready.indexOf(a)};b.prototype._listenForClientReady=function(){var a=this;this._swGlobal.addEventListener("message",function(b){a._onMessageReceived(b)})};b.prototype._onMessageReceived=function(a){if(a.origin===this._swGlobal.location.origin){var e=a.source;e instanceof WindowClient&&"string"===typeof e.id&&"function"===typeof e.postMessage&&(a=a.data)&&"object"===typeof a&&a.feature===b._CLIENT_MESSAGE_FEATURE&&a.command===b._CLIENT_MESSAGE_COMMAND&&this._markReady(e.id)}};
b.prototype._markReady=function(a){X.pushClamped(this._ready,a,b._MAX_CLIENTS);this._eventBus.publish({name:"ClientReady",detail:{eventOptions:fa.create(a)}})};b._MAX_CLIENTS=50;b._CLIENT_MESSAGE_FEATURE="retail_service_worker_messaging";b._CLIENT_MESSAGE_COMMAND="client_messaging_ready";Ga([k],b.prototype,"isReady",null);Ga([k],b.prototype,"_listenForClientReady",null);Ga([k],b.prototype,"_onMessageReceived",null);Ga([k],b.prototype,"_markReady",null);return b}(v),xe=this&&this.__extends||function(){var h=
function(b,a){h=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(a,b){a.__proto__=b}||function(a,b){for(var c in b)Object.prototype.hasOwnProperty.call(b,c)&&(a[c]=b[c])};return h(b,a)};return function(b,a){function e(){this.constructor=b}if("function"!==typeof a&&null!==a)throw new TypeError("Class extends value "+String(a)+" is not a constructor or null");h(b,a);b.prototype=null===a?Object.create(a):(e.prototype=a.prototype,new e)}}(),w=this&&this.__decorate||function(h,b,a,e){var c=
arguments.length,g=3>c?b:null===e?e=Object.getOwnPropertyDescriptor(b,a):e,f;if("object"===typeof Reflect&&"function"===typeof Reflect.decorate)g=Reflect.decorate(h,b,a,e);else for(var d=h.length-1;0<=d;d--)if(f=h[d])g=(3>c?f(g):3<c?f(b,a,g):f(b,a))||g;return 3<c&&g&&Object.defineProperty(b,a,g),g},F=this&&this.__awaiter||function(h,b,a,e){function c(b){return b instanceof a?b:new a(function(a){a(b)})}return new (a||(a=Promise))(function(a,f){function d(a){try{l(e.next(a))}catch(m){f(m)}}function g(a){try{l(e["throw"](a))}catch(m){f(m)}}
function l(b){b.done?a(b.value):c(b.value).then(d,g)}l((e=e.apply(h,b||[])).next())})},L=this&&this.__generator||function(h,b){function a(a){return function(b){return e([a,b])}}function e(a){if(g)throw new TypeError("Generator is already executing.");for(;c;)try{if(g=1,f&&(d=a[0]&2?f["return"]:a[0]?f["throw"]||((d=f["return"])&&d.call(f),0):f.next)&&!(d=d.call(f,a[1])).done)return d;if(f=0,d)a=[a[0]&2,d.value];switch(a[0]){case 0:case 1:d=a;break;case 4:return c.label++,{value:a[1],done:!1};case 5:c.label++;
f=a[1];a=[0];continue;case 7:a=c.ops.pop();c.trys.pop();continue;default:if(!(d=c.trys,d=0<d.length&&d[d.length-1])&&(6===a[0]||2===a[0])){c=0;continue}if(3===a[0]&&(!d||a[1]>d[0]&&a[1]<d[3]))c.label=a[1];else if(6===a[0]&&c.label<d[1])c.label=d[1],d=a;else if(d&&c.label<d[2])c.label=d[2],c.ops.push(a);else{d[2]&&c.ops.pop();c.trys.pop();continue}}a=b.call(h,c)}catch(p){a=[6,p],f=0}finally{g=d=0}if(a[0]&5)throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}var c={label:0,sent:function(){if(d[0]&1)throw d[1];
return d[1]},trys:[],ops:[]},g,f,d,n;return n={next:a(0),"throw":a(1),"return":a(2)},"function"===typeof Symbol&&(n[Symbol.iterator]=function(){return this}),n},ye=function(h){function b(a,b){var c=h.call(this)||this;c.logCtor(arguments);c._swGlobal=a;c.reset();b.subscribe("ClientReady",c);c._clientReadyPublisher=new we(a,b);return c}xe(b,h);b.prototype.reset=function(){this._bufferedCounters=[];this._bufferedTags=[];this._bufferedErrors=[];this._bufferedWeblabTriggers=[]};b.prototype.counter=function(a,
b,c){var e=this;this._clientReadyPublisher.isReady(a)?t.queueTask(function(){return F(e,void 0,void 0,function(){var e,d;return L(this,function(g){switch(g.label){case 0:return g.trys.push([0,2,,3]),[4,this._getClient(a)];case 1:return e=g.sent(),this._postCounter(e,b,c),[3,3];case 2:return d=g.sent(),this.log("counter",d.message),[3,3];case 3:return[2]}})})}):this._bufferCounter(a,b,c)};b.prototype.tag=function(a,b){var c=this;this._clientReadyPublisher.isReady(a)?t.queueTask(function(){return F(c,
void 0,void 0,function(){var c,e;return L(this,function(d){switch(d.label){case 0:return d.trys.push([0,2,,3]),[4,this._getClient(a)];case 1:return c=d.sent(),this._postTag(c,b),[3,3];case 2:return e=d.sent(),this.log("tag",e.message),[3,3];case 3:return[2]}})})}):this._bufferTag(a,b)};b.prototype.error=function(a,b,c,g){var e=this;this._clientReadyPublisher.isReady(a)?t.queueTask(function(){return F(e,void 0,void 0,function(){var d,e;return L(this,function(f){switch(f.label){case 0:return f.trys.push([0,
2,,3]),[4,this._getClient(a)];case 1:return d=f.sent(),this._postError(d,b,c,g),[3,3];case 2:return e=f.sent(),this.log("tag",e.message),[3,3];case 3:return[2]}})})}):this._bufferError(a,b,c,g)};b.prototype.weblabTrigger=function(a,b,c){var e=this;this._clientReadyPublisher.isReady(a)?t.queueTask(function(){return F(e,void 0,void 0,function(){var e,d;return L(this,function(g){switch(g.label){case 0:return g.trys.push([0,2,,3]),[4,this._getClient(a)];case 1:return e=g.sent(),this._postWeblabTrigger(e,
b,c),[3,3];case 2:return d=g.sent(),this.log("weblabtrigger",d.message),[3,3];case 3:return[2]}})})}):this._bufferWeblabTrigger(a,b,c)};b.prototype.notifyEvent=function(a){var b=this;switch(a.name){case "ClientReady":t.queueTask(function(){return F(b,void 0,void 0,function(){var b,e,f,d=this;return L(this,function(c){switch(c.label){case 0:return c.trys.push([0,2,,3]),b=a.detail.eventOptions.clientId,[4,this._getClient(b)];case 1:return e=c.sent(),t.queueTask(function(){d._drainBufferedCounters(e)}),
t.queueTask(function(){d._drainBufferedTags(e)}),t.queueTask(function(){d._drainBufferedErrors(e)}),t.queueTask(function(){d._drainBufferedWeblabTriggers(e)}),[3,3];case 2:return f=c.sent(),this.log("notifyEvent",f.message),[3,3];case 3:return[2]}})})})}};b.prototype._bufferCounter=function(a,e,c){X.pushClamped(this._bufferedCounters,{clientId:a,name:e,value:c},b._MAX_COUNTERS)};b.prototype._bufferTag=function(a,e){X.pushClamped(this._bufferedTags,{clientId:a,name:e},b._MAX_TAGS)};b.prototype._bufferError=
function(a,e,c,g){X.pushClamped(this._bufferedErrors,{clientId:a,message:e,attribution:c,level:g},b._MAX_ERRORS)};b.prototype._bufferWeblabTrigger=function(a,e,c){X.pushClamped(this._bufferedWeblabTriggers,{clientId:a,name:e,treatment:c},b._MAX_WEBLAB_TRIGGERS)};b.prototype._drainBufferedCounters=function(a){for(var b=this,c=[],g=function(d){var e=f._bufferedCounters[d];if(a.id!==e.clientId)return c.push(e),"continue";t.queueTask(function(){return F(b,void 0,void 0,function(){return L(this,function(b){this._postCounter(a,
e.name,e.value);return[2]})})})},f=this,d=0;d<this._bufferedCounters.length;d++)g(d);this._bufferedCounters=c};b.prototype._drainBufferedTags=function(a){for(var b=this,c=[],g=function(d){var e=f._bufferedTags[d];if(a.id!==e.clientId)return c.push(e),"continue";t.queueTask(function(){return F(b,void 0,void 0,function(){return L(this,function(b){this._postTag(a,e.name);return[2]})})})},f=this,d=0;d<this._bufferedTags.length;d++)g(d);this._bufferedTags=c};b.prototype._drainBufferedErrors=function(a){for(var b=
this,c=[],g=function(d){var e=f._bufferedErrors[d];if(a.id!==e.clientId)return c.push(e),"continue";t.queueTask(function(){return F(b,void 0,void 0,function(){return L(this,function(b){this._postError(a,e.message,e.attribution,e.level);return[2]})})})},f=this,d=0;d<this._bufferedErrors.length;d++)g(d);this._bufferedErrors=c};b.prototype._drainBufferedWeblabTriggers=function(a){for(var b=this,c=[],g=function(d){var e=f._bufferedWeblabTriggers[d];if(a.id!==e.clientId)return c.push(e),"continue";t.queueTask(function(){return F(b,
void 0,void 0,function(){return L(this,function(b){this._postWeblabTrigger(a,e.name,e.treatment);return[2]})})})},f=this,d=0;d<this._bufferedWeblabTriggers.length;d++)g(d);this._bufferedWeblabTriggers=c};b.prototype._postCounter=function(a,b,c){b=this._createClientCounterMessage(b,c);this._postMessageToClient(a,b)};b.prototype._postTag=function(a,b){b=this._createClientTagMessage(b);this._postMessageToClient(a,b)};b.prototype._postError=function(a,b,c,g){b=this._createClientErrorMessage(b,c,g);this._postMessageToClient(a,
b)};b.prototype._postWeblabTrigger=function(a,b,c){b=this._createClientWeblabTriggerMessage(b,c);this._postMessageToClient(a,b)};b.prototype._createClientCounterMessage=function(a,e){return{feature:b._MESSAGING_FEATURE,command:b._MESSAGING_COMMAND_COUNTER,data:{name:a,value:e}}};b.prototype._createClientTagMessage=function(a){return{feature:b._MESSAGING_FEATURE,command:b._MESSAGING_COMMAND_TAG,data:{tag:a}}};b.prototype._createClientErrorMessage=function(a,e,c){return{feature:b._MESSAGING_FEATURE,
command:b._MESSAGING_COMMAND_ERROR,data:{message:a,attribution:e,level:c}}};b.prototype._createClientWeblabTriggerMessage=function(a,e){return{feature:b._MESSAGING_FEATURE,command:b._MESSAGING_COMMAND_WEBLAB_TRIGGER,data:{weblab:a,treatment:e}}};b.prototype._postMessageToClient=function(a,b){a.postMessage(b)};b.prototype._getClient=function(a){return F(this,void 0,void 0,function(){var b;return L(this,function(c){switch(c.label){case 0:return[4,this._swGlobal.clients.get(a)];case 1:if(b=c.sent())return[2,
b];throw r.create("ClientNotFound",{clientId:a});}})})};b._MAX_COUNTERS=400;b._MAX_TAGS=100;b._MAX_ERRORS=100;b._MAX_WEBLAB_TRIGGERS=100;b._MESSAGING_FEATURE="retail_service_worker_messaging";b._MESSAGING_COMMAND_COUNTER="log_counter";b._MESSAGING_COMMAND_TAG="log_tag";b._MESSAGING_COMMAND_ERROR="log_error";b._MESSAGING_COMMAND_WEBLAB_TRIGGER="log_weblab_trigger";w([k],b.prototype,"reset",null);w([k],b.prototype,"counter",null);w([k],b.prototype,"tag",null);w([k],b.prototype,"error",null);w([k],b.prototype,
"weblabTrigger",null);w([k],b.prototype,"notifyEvent",null);w([k],b.prototype,"_bufferCounter",null);w([k],b.prototype,"_bufferTag",null);w([k],b.prototype,"_bufferError",null);w([k],b.prototype,"_bufferWeblabTrigger",null);w([k],b.prototype,"_drainBufferedCounters",null);w([k],b.prototype,"_drainBufferedTags",null);w([k],b.prototype,"_drainBufferedErrors",null);w([k],b.prototype,"_drainBufferedWeblabTriggers",null);w([k],b.prototype,"_postCounter",null);w([k],b.prototype,"_postTag",null);w([k],b.prototype,
"_postWeblabTrigger",null);w([k],b.prototype,"_createClientCounterMessage",null);w([k],b.prototype,"_createClientTagMessage",null);w([k],b.prototype,"_createClientErrorMessage",null);w([k],b.prototype,"_createClientWeblabTriggerMessage",null);w([k],b.prototype,"_postMessageToClient",null);w([k],b.prototype,"_getClient",null);return b}(v),ze=this&&this.__extends||function(){var h=function(b,a){h=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(a,b){a.__proto__=b}||function(a,b){for(var c in b)Object.prototype.hasOwnProperty.call(b,
c)&&(a[c]=b[c])};return h(b,a)};return function(b,a){function e(){this.constructor=b}if("function"!==typeof a&&null!==a)throw new TypeError("Class extends value "+String(a)+" is not a constructor or null");h(b,a);b.prototype=null===a?Object.create(a):(e.prototype=a.prototype,new e)}}(),ba=this&&this.__decorate||function(h,b,a,e){var c=arguments.length,g=3>c?b:null===e?e=Object.getOwnPropertyDescriptor(b,a):e,f;if("object"===typeof Reflect&&"function"===typeof Reflect.decorate)g=Reflect.decorate(h,
b,a,e);else for(var d=h.length-1;0<=d;d--)if(f=h[d])g=(3>c?f(g):3<c?f(b,a,g):f(b,a))||g;return 3<c&&g&&Object.defineProperty(b,a,g),g},Ae=function(h){function b(a,b){var c=h.call(this)||this;c.logCtor(arguments);c._clientPostbacks=new ye(a,b);c._clientPostbacks.reset();a.$TM&&(c._globalTelemetryClient=a.$TM);return c}ze(b,h);b.prototype.count=function(a,b,c){var e=this;void 0===c&&(c=1);t.queueTask(function(){var g=e._getFormattedName(b);e._globalTelemetryClient&&q.isFunction(e._globalTelemetryClient.count)?
e._globalTelemetryClient.count(g,c,{clientID:a.clientId}):e._clientPostbacks.counter(a.clientId,g,c)})};b.prototype.mark=function(a,b,c){var e=E.getPerfNow();this.count(a,b,e-(c?c:a.timeOriginPerfNow))};b.prototype.tag=function(a,b){var c=this;t.queueTask(function(){var e=c._getFormattedName(b);c._clientPostbacks.tag(a.clientId,e)})};b.prototype.error=function(a,b,c,g){var e=this;t.queueTask(function(){if(e._globalTelemetryClient&&q.isFunction(e._globalTelemetryClient.error)){var d=u.BRAZIL_NAME+
(c?":".concat(c):""),f=null!==g&&void 0!==g?g:b.logLevel||"FATAL",h=Object.keys(a.errorContext).map(function(b){return"".concat(b," \x3d ").concat(a.errorContext[b])}).join("\n\n");e._globalTelemetryClient.error(b,f,d,h)}else e.countError(a,r.create("MissingDependencyTelemetry"))})};b.prototype.countError=function(a,b,c){var e=this;t.queueTask(function(){var g=b.code,d=b.name;d=g?"".concat(d,":").concat(g):d;d=c?"".concat(d,":").concat(c):d;e.count(a,"Error:".concat(d),1)})};b.prototype.weblabTrigger=
function(a,b,c){var e=this;t.queueTask(function(){e._clientPostbacks.weblabTrigger(a.clientId,b,c)})};b.prototype._getFormattedName=function(a){return ta.format(a)};ba([k],b.prototype,"count",null);ba([k],b.prototype,"mark",null);ba([k],b.prototype,"tag",null);ba([k],b.prototype,"error",null);ba([k],b.prototype,"countError",null);ba([k],b.prototype,"weblabTrigger",null);ba([k],b.prototype,"_getFormattedName",null);return b}(v),Be=this&&this.__extends||function(){var h=function(b,a){h=Object.setPrototypeOf||
{__proto__:[]}instanceof Array&&function(a,b){a.__proto__=b}||function(a,b){for(var c in b)Object.prototype.hasOwnProperty.call(b,c)&&(a[c]=b[c])};return h(b,a)};return function(b,a){function e(){this.constructor=b}if("function"!==typeof a&&null!==a)throw new TypeError("Class extends value "+String(a)+" is not a constructor or null");h(b,a);b.prototype=null===a?Object.create(a):(e.prototype=a.prototype,new e)}}(),ca=this&&this.__decorate||function(h,b,a,e){var c=arguments.length,g=3>c?b:null===e?
e=Object.getOwnPropertyDescriptor(b,a):e,f;if("object"===typeof Reflect&&"function"===typeof Reflect.decorate)g=Reflect.decorate(h,b,a,e);else for(var d=h.length-1;0<=d;d--)if(f=h[d])g=(3>c?f(g):3<c?f(b,a,g):f(b,a))||g;return 3<c&&g&&Object.defineProperty(b,a,g),g},Ce=function(h){function b(a,b,c,g){var e=h.call(this)||this;e.logCtor(arguments);e._eventOptions=b;e._metricsService=a;e._responseStrategyName=c;e._responseRuleName=g;e._errorLoggingScope="".concat(e._responseStrategyName,"ResponseStrategy");
return e}Be(b,h);b.prototype.getMetricName=function(a){return"".concat(this._responseRuleName,":").concat(this._responseStrategyName,":").concat(a)};b.prototype.logCount=function(a,b){this._metricsService.count(this._eventOptions,this.getMetricName(a),b)};b.prototype.logMark=function(a){this._metricsService.mark(this._eventOptions,this.getMetricName(a))};b.prototype.logTag=function(a){this._metricsService.tag(this._eventOptions,this.getMetricName(a))};b.prototype.logTagAndCount=function(a){this.logTag(a);
this.logCount(a)};b.prototype.logCountError=function(a){this._metricsService.countError(this._eventOptions,a,this._errorLoggingScope)};b.prototype.logError=function(a,b){this._metricsService.error(this._eventOptions,a,this._errorLoggingScope,b)};ca([k],b.prototype,"getMetricName",null);ca([k],b.prototype,"logCount",null);ca([k],b.prototype,"logMark",null);ca([k],b.prototype,"logTag",null);ca([k],b.prototype,"logTagAndCount",null);ca([k],b.prototype,"logCountError",null);ca([k],b.prototype,"logError",
null);return b}(v),De=this&&this.__extends||function(){var h=function(b,a){h=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(a,b){a.__proto__=b}||function(a,b){for(var c in b)Object.prototype.hasOwnProperty.call(b,c)&&(a[c]=b[c])};return h(b,a)};return function(b,a){function e(){this.constructor=b}if("function"!==typeof a&&null!==a)throw new TypeError("Class extends value "+String(a)+" is not a constructor or null");h(b,a);b.prototype=null===a?Object.create(a):(e.prototype=a.prototype,
new e)}}(),Ee=this&&this.__decorate||function(h,b,a,e){var c=arguments.length,g=3>c?b:null===e?e=Object.getOwnPropertyDescriptor(b,a):e,f;if("object"===typeof Reflect&&"function"===typeof Reflect.decorate)g=Reflect.decorate(h,b,a,e);else for(var d=h.length-1;0<=d;d--)if(f=h[d])g=(3>c?f(g):3<c?f(b,a,g):f(b,a))||g;return 3<c&&g&&Object.defineProperty(b,a,g),g},Fe=this&&this.__awaiter||function(h,b,a,e){function c(b){return b instanceof a?b:new a(function(a){a(b)})}return new (a||(a=Promise))(function(a,
f){function d(a){try{l(e.next(a))}catch(m){f(m)}}function g(a){try{l(e["throw"](a))}catch(m){f(m)}}function l(b){b.done?a(b.value):c(b.value).then(d,g)}l((e=e.apply(h,b||[])).next())})},Ge=this&&this.__generator||function(h,b){function a(a){return function(b){return e([a,b])}}function e(a){if(g)throw new TypeError("Generator is already executing.");for(;c;)try{if(g=1,f&&(d=a[0]&2?f["return"]:a[0]?f["throw"]||((d=f["return"])&&d.call(f),0):f.next)&&!(d=d.call(f,a[1])).done)return d;if(f=0,d)a=[a[0]&
2,d.value];switch(a[0]){case 0:case 1:d=a;break;case 4:return c.label++,{value:a[1],done:!1};case 5:c.label++;f=a[1];a=[0];continue;case 7:a=c.ops.pop();c.trys.pop();continue;default:if(!(d=c.trys,d=0<d.length&&d[d.length-1])&&(6===a[0]||2===a[0])){c=0;continue}if(3===a[0]&&(!d||a[1]>d[0]&&a[1]<d[3]))c.label=a[1];else if(6===a[0]&&c.label<d[1])c.label=d[1],d=a;else if(d&&c.label<d[2])c.label=d[2],c.ops.push(a);else{d[2]&&c.ops.pop();c.trys.pop();continue}}a=b.call(h,c)}catch(p){a=[6,p],f=0}finally{g=
d=0}if(a[0]&5)throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}var c={label:0,sent:function(){if(d[0]&1)throw d[1];return d[1]},trys:[],ops:[]},g,f,d,k;return k={next:a(0),"throw":a(1),"return":a(2)},"function"===typeof Symbol&&(k[Symbol.iterator]=function(){return this}),k},He=function(h){function b(a,b,c,g,f,d,k){var e=h.call(this)||this;e.logCtor(arguments);e.name=a;e.cacheService=b;e.metricsService=c;e.contentFragmentService=g;e.eventBus=f;e.eventOptions=d;e.responseRuleName=k;e.metricsHelper=
new Ce(c,d,e.name,k);return e}De(b,h);b.prototype.getResponse=function(){return Fe(this,void 0,void 0,function(){var a=this;return Ge(this,function(b){t.queueTask(function(){a.metricsHelper.logTagAndCount("Execute")});return[2,this.build()]})})};Ee([k],b.prototype,"getResponse",null);return b}(v),Ie=this&&this.__extends||function(){var h=function(b,a){h=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(a,b){a.__proto__=b}||function(a,b){for(var c in b)Object.prototype.hasOwnProperty.call(b,
c)&&(a[c]=b[c])};return h(b,a)};return function(b,a){function e(){this.constructor=b}if("function"!==typeof a&&null!==a)throw new TypeError("Class extends value "+String(a)+" is not a constructor or null");h(b,a);b.prototype=null===a?Object.create(a):(e.prototype=a.prototype,new e)}}(),sa=this&&this.__decorate||function(h,b,a,e){var c=arguments.length,g=3>c?b:null===e?e=Object.getOwnPropertyDescriptor(b,a):e,f;if("object"===typeof Reflect&&"function"===typeof Reflect.decorate)g=Reflect.decorate(h,
b,a,e);else for(var d=h.length-1;0<=d;d--)if(f=h[d])g=(3>c?f(g):3<c?f(b,a,g):f(b,a))||g;return 3<c&&g&&Object.defineProperty(b,a,g),g},Je=this&&this.__awaiter||function(h,b,a,e){function c(b){return b instanceof a?b:new a(function(a){a(b)})}return new (a||(a=Promise))(function(a,f){function d(a){try{l(e.next(a))}catch(m){f(m)}}function g(a){try{l(e["throw"](a))}catch(m){f(m)}}function l(b){b.done?a(b.value):c(b.value).then(d,g)}l((e=e.apply(h,b||[])).next())})},Ke=this&&this.__generator||function(h,
b){function a(a){return function(b){return e([a,b])}}function e(a){if(g)throw new TypeError("Generator is already executing.");for(;c;)try{if(g=1,f&&(d=a[0]&2?f["return"]:a[0]?f["throw"]||((d=f["return"])&&d.call(f),0):f.next)&&!(d=d.call(f,a[1])).done)return d;if(f=0,d)a=[a[0]&2,d.value];switch(a[0]){case 0:case 1:d=a;break;case 4:return c.label++,{value:a[1],done:!1};case 5:c.label++;f=a[1];a=[0];continue;case 7:a=c.ops.pop();c.trys.pop();continue;default:if(!(d=c.trys,d=0<d.length&&d[d.length-
1])&&(6===a[0]||2===a[0])){c=0;continue}if(3===a[0]&&(!d||a[1]>d[0]&&a[1]<d[3]))c.label=a[1];else if(6===a[0]&&c.label<d[1])c.label=d[1],d=a;else if(d&&c.label<d[2])c.label=d[2],c.ops.push(a);else{d[2]&&c.ops.pop();c.trys.pop();continue}}a=b.call(h,c)}catch(p){a=[6,p],f=0}finally{g=d=0}if(a[0]&5)throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}var c={label:0,sent:function(){if(d[0]&1)throw d[1];return d[1]},trys:[],ops:[]},g,f,d,k;return k={next:a(0),"throw":a(1),"return":a(2)},"function"===typeof Symbol&&
(k[Symbol.iterator]=function(){return this}),k},Le=function(h){function b(a,b,c,g,f,d){var e=h.call(this)||this;e.logCtor(arguments);e._swGlobal=a;e._cacheService=b;e._metricsHelper=c;e._eventBus=g;e._eventOptions=f;e._responseRuleName=d;return e}Ie(b,h);b.prototype.getPageShellFromCache=function(a){return Je(this,void 0,void 0,function(){var b,c,g,f,d,h,l,k,m,q,r,u,v=this;return Ke(this,function(e){switch(e.label){case 0:return b=a.cacheName,c=a.cacheKey,g=a.validationKeys,f=a.delimiterKey,d=a.skeleton,
k=(l=this._cacheService).read,m=[this._eventOptions,b,c],u={},[4,(new Ua(this._swGlobal)).compute(g)];case 1:return[4,k.apply(l,m.concat([(u.validationKeys=e.sent(),u)]))];case 2:h=e.sent();if(!h)return[2];r=(q=h.headers.get(x.shared.getClientOnlyLibHeader(f)))?P.decode(q):void 0;return r?[2,{delimiter:r,response:h,skeleton:d}]:(t.queueTask(function(){v._metricsHelper.logTagAndCount("PageShellCacheMiss:Delimiter")}),[2])}})})};b.prototype.getFilteredPageShellHeaders=function(a){return x.shared.removeLibHeaders(a.headers)};
b.prototype.getPageShellMetadata=function(a){return(a=(a=(a=a.headers.get(x.shared.getClientOnlyLibHeader("metadata")))?P.decode(a):void 0)?I.deserialize(a):void 0)?{attribution:a.attribution||"unknown",staleness:"number"===typeof a.requestStartTimestampSeconds?E.getEpochSeconds(this._eventOptions.timeOriginEpoch)-a.requestStartTimestampSeconds:void 0}:{attribution:"unknown"}};b.prototype.queuePageShellMetadataMetrics=function(a){var b=this;t.queueTask(function(){var c=b.getPageShellMetadata(a);b._metricsHelper.logTagAndCount("CachePopAttribution:".concat(c.attribution));
c.staleness&&b._metricsHelper.logCount("PageShellStaleness",c.staleness)})};b.prototype.queuePageShellUpdate=function(a,b){var c=this;t.queueTask(function(){c._metricsHelper.logCount("Queue:PageShellUpdate");c._metricsHelper.logCount("Queue:PageShellUpdate:".concat(b?"OnHit":"OnMiss"));c._eventBus.publish({name:"ResponseRuleNavigation",detail:{eventOptions:c._eventOptions,serverResponse:a,ruleName:c._responseRuleName}})})};sa([k],b.prototype,"getPageShellFromCache",null);sa([k],b.prototype,"getFilteredPageShellHeaders",
null);sa([k],b.prototype,"getPageShellMetadata",null);sa([k],b.prototype,"queuePageShellMetadataMetrics",null);sa([k],b.prototype,"queuePageShellUpdate",null);return b}(v),Me=this&&this.__extends||function(){var h=function(b,a){h=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(a,b){a.__proto__=b}||function(a,b){for(var c in b)Object.prototype.hasOwnProperty.call(b,c)&&(a[c]=b[c])};return h(b,a)};return function(b,a){function e(){this.constructor=b}if("function"!==typeof a&&null!==
a)throw new TypeError("Class extends value "+String(a)+" is not a constructor or null");h(b,a);b.prototype=null===a?Object.create(a):(e.prototype=a.prototype,new e)}}(),da=this&&this.__decorate||function(h,b,a,e){var c=arguments.length,g=3>c?b:null===e?e=Object.getOwnPropertyDescriptor(b,a):e,f;if("object"===typeof Reflect&&"function"===typeof Reflect.decorate)g=Reflect.decorate(h,b,a,e);else for(var d=h.length-1;0<=d;d--)if(f=h[d])g=(3>c?f(g):3<c?f(b,a,g):f(b,a))||g;return 3<c&&g&&Object.defineProperty(b,
a,g),g},ka=this&&this.__awaiter||function(h,b,a,e){function c(b){return b instanceof a?b:new a(function(a){a(b)})}return new (a||(a=Promise))(function(a,f){function d(a){try{l(e.next(a))}catch(m){f(m)}}function g(a){try{l(e["throw"](a))}catch(m){f(m)}}function l(b){b.done?a(b.value):c(b.value).then(d,g)}l((e=e.apply(h,b||[])).next())})},la=this&&this.__generator||function(h,b){function a(a){return function(b){return e([a,b])}}function e(a){if(g)throw new TypeError("Generator is already executing.");
for(;c;)try{if(g=1,f&&(d=a[0]&2?f["return"]:a[0]?f["throw"]||((d=f["return"])&&d.call(f),0):f.next)&&!(d=d.call(f,a[1])).done)return d;if(f=0,d)a=[a[0]&2,d.value];switch(a[0]){case 0:case 1:d=a;break;case 4:return c.label++,{value:a[1],done:!1};case 5:c.label++;f=a[1];a=[0];continue;case 7:a=c.ops.pop();c.trys.pop();continue;default:if(!(d=c.trys,d=0<d.length&&d[d.length-1])&&(6===a[0]||2===a[0])){c=0;continue}if(3===a[0]&&(!d||a[1]>d[0]&&a[1]<d[3]))c.label=a[1];else if(6===a[0]&&c.label<d[1])c.label=
d[1],d=a;else if(d&&c.label<d[2])c.label=d[2],c.ops.push(a);else{d[2]&&c.ops.pop();c.trys.pop();continue}}a=b.call(h,c)}catch(p){a=[6,p],f=0}finally{g=d=0}if(a[0]&5)throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}var c={label:0,sent:function(){if(d[0]&1)throw d[1];return d[1]},trys:[],ops:[]},g,f,d,k;return k={next:a(0),"throw":a(1),"return":a(2)},"function"===typeof Symbol&&(k[Symbol.iterator]=function(){return this}),k},Ne=function(h){function b(a,b,c){var e=h.call(this)||this;e.logCtor(arguments);
e._metricsService=a;e._metricsHelper=b;e._responseRuleName=c;return e}Me(b,h);b.prototype.fetchServerResponse=function(a,b){return ka(this,void 0,void 0,function(){return la(this,function(c){return[2,b?ua.getResponseWithoutRelay(a):ua.getResponseWithRelay(a)]})})};b.prototype.readServerResponse=function(a,b,c,g,f,d){void 0===g&&(g="unknown");return ka(this,void 0,void 0,function(){var e,h,k,m;return la(this,function(l){switch(l.label){case 0:return l.trys.push([0,2,,3]),[4,c];case 1:return e=l.sent(),
[3,3];case 2:h=l.sent();if(K.matchesCode(h,"PreloadResponseUnexpected")){this._logError(h);if(!d)throw h;return[2,this._getReloadBypassFallbackContent(a,b,f,"prx_".concat(g))]}if(K.matchesCode(h,"PreloadResponseUnsupported")){this._logError(h);if(!d)throw h;return[2,this._getErrorFallbackContent(a,b,f,"pru_".concat(g))]}k=r.create("FailedToFetch",void 0,h);this._logError(k,"ERROR");if(!d)throw k;return[2,this._getErrorFallbackContent(a,b,f,"flf_".concat(g))];case 3:if(!(e instanceof Response)){m=
r.create("ResponseInvalid");this._logError(m);if(!d)throw m;return[2,this._getErrorFallbackContent(a,b,f,"riv_".concat(g))]}return"opaqueredirect"===e.type?[2,f?{unrecoverable:!0,parseable:!1,response:e}:this._getReloadBypassFallbackContent(a,b,f,"opr_".concat(g))]:200!==e.status?[2,{unrecoverable:!1,parseable:!1,response:e}]:[2,{unrecoverable:!1,parseable:!0,response:e}]}})})};b.prototype._getErrorFallbackContent=function(a,b,c,g){return ka(this,void 0,void 0,function(){var e,d;return la(this,function(f){switch(f.label){case 0:if(!W.isMShop())return[3,
2];d={unrecoverable:!0,parseable:!1};return[4,this._getAppErrorFragment(a,b)];case 1:return e=(d.response=f.sent(),d),[3,3];case 2:e=this._getReloadBypassFallbackContent(a,b,c,g),f.label=3;case 3:return[2,e]}})})};b.prototype._getReloadBypassFallbackContent=function(a,b,c,g){return ka(this,void 0,void 0,function(){var e;return la(this,function(d){switch(d.label){case 0:return e={unrecoverable:!0,parseable:!1},[4,this._getReloadBypassFragment(a,b,c,g)];case 1:return[2,(e.response=d.sent(),e)]}})})};
b.prototype._getAppErrorFragment=function(a,b){return ka(this,void 0,void 0,function(){return la(this,function(c){this._metricsHelper.logCount("Emit:AppErrorFragment");return[2,(new ud(b,this._metricsService,a.request.url,"-1","net::ERR_FAILED",a.request.referrer)).getResponse()]})})};b.prototype._getReloadBypassFragment=function(a,b,c,g){return ka(this,void 0,void 0,function(){return la(this,function(e){this._metricsHelper.logCount("Emit:ReloadFragment");return[2,(new Nd(b,this._metricsService,a.request.url,
c,!0,"erf_".concat(this._responseRuleName,"_").concat(g))).getResponse()]})})};b.prototype._logError=function(a,b){var c=this;t.queueTask(function(){c._metricsHelper.logError(a,b);c._metricsHelper.logCountError(a)})};da([k],b.prototype,"fetchServerResponse",null);da([k],b.prototype,"readServerResponse",null);da([k],b.prototype,"_getErrorFallbackContent",null);da([k],b.prototype,"_getReloadBypassFallbackContent",null);da([k],b.prototype,"_getAppErrorFragment",null);da([k],b.prototype,"_getReloadBypassFragment",
null);da([k],b.prototype,"_logError",null);return b}(v),Oe=this&&this.__extends||function(){var h=function(b,a){h=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(a,b){a.__proto__=b}||function(a,b){for(var c in b)Object.prototype.hasOwnProperty.call(b,c)&&(a[c]=b[c])};return h(b,a)};return function(b,a){function e(){this.constructor=b}if("function"!==typeof a&&null!==a)throw new TypeError("Class extends value "+String(a)+" is not a constructor or null");h(b,a);b.prototype=null===a?
Object.create(a):(e.prototype=a.prototype,new e)}}(),A=this&&this.__decorate||function(h,b,a,e){var c=arguments.length,g=3>c?b:null===e?e=Object.getOwnPropertyDescriptor(b,a):e,f;if("object"===typeof Reflect&&"function"===typeof Reflect.decorate)g=Reflect.decorate(h,b,a,e);else for(var d=h.length-1;0<=d;d--)if(f=h[d])g=(3>c?f(g):3<c?f(b,a,g):f(b,a))||g;return 3<c&&g&&Object.defineProperty(b,a,g),g},y=this&&this.__awaiter||function(h,b,a,e){function c(b){return b instanceof a?b:new a(function(a){a(b)})}
return new (a||(a=Promise))(function(a,f){function d(a){try{k(e.next(a))}catch(m){f(m)}}function g(a){try{k(e["throw"](a))}catch(m){f(m)}}function k(b){b.done?a(b.value):c(b.value).then(d,g)}k((e=e.apply(h,b||[])).next())})},B=this&&this.__generator||function(h,b){function a(a){return function(b){return e([a,b])}}function e(a){if(g)throw new TypeError("Generator is already executing.");for(;c;)try{if(g=1,f&&(d=a[0]&2?f["return"]:a[0]?f["throw"]||((d=f["return"])&&d.call(f),0):f.next)&&!(d=d.call(f,
a[1])).done)return d;if(f=0,d)a=[a[0]&2,d.value];switch(a[0]){case 0:case 1:d=a;break;case 4:return c.label++,{value:a[1],done:!1};case 5:c.label++;f=a[1];a=[0];continue;case 7:a=c.ops.pop();c.trys.pop();continue;default:if(!(d=c.trys,d=0<d.length&&d[d.length-1])&&(6===a[0]||2===a[0])){c=0;continue}if(3===a[0]&&(!d||a[1]>d[0]&&a[1]<d[3]))c.label=a[1];else if(6===a[0]&&c.label<d[1])c.label=d[1],d=a;else if(d&&c.label<d[2])c.label=d[2],c.ops.push(a);else{d[2]&&c.ops.pop();c.trys.pop();continue}}a=b.call(h,
c)}catch(p){a=[6,p],f=0}finally{g=d=0}if(a[0]&5)throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}var c={label:0,sent:function(){if(d[0]&1)throw d[1];return d[1]},trys:[],ops:[]},g,f,d,k;return k={next:a(0),"throw":a(1),"return":a(2)},"function"===typeof Symbol&&(k[Symbol.iterator]=function(){return this}),k},Pe=function(h){function b(a,b,c,g,f,d,k,l,p,m,q,r){var e=h.call(this,"SingleDelimiter",b,c,g,f,k,p)||this;e.logCtor(arguments);e._event=d;e._usePreloadResponseOnly=l;e._pageShellsConfig=m;e._noPageShellConfig=
q||{};e._flags=r||{};e._pageShellController=new Le(a,b,e.metricsHelper,f,k,p);e._serverResponseController=new Ne(c,e.metricsHelper,p);return e}Oe(b,h);b.prototype.build=function(){return y(this,void 0,void 0,function(){var a,b,c=this;return B(this,function(e){switch(e.label){case 0:return a=this._serverResponseController.fetchServerResponse(this._event,this._usePreloadResponseOnly),t.queueTask(function(){c.metricsHelper.logTagAndCount("Passthrough:".concat(!!c._flags.passthrough))}),this._flags.passthrough?
[3,2]:[4,this._getPageShell(this._pageShellsConfig)];case 1:if(b=e.sent())return[2,this._getPageShellAssembledResponse(b,a)];if(this._noPageShellConfig.skeleton)return[2,this._getNoPageShellAssembledResponse(this._noPageShellConfig,a)];e.label=2;case 2:return[2,this._getNonAssembledResponse(a)]}})})};b.prototype._getPageShell=function(a){return y(this,void 0,void 0,function(){var b,c,g,f=this;return B(this,function(d){switch(d.label){case 0:this.metricsHelper.logMark("Query:PageShell"),c=0,d.label=
1;case 1:if(!(c<a.length))return[3,6];d.label=2;case 2:return d.trys.push([2,4,,5]),[4,this._pageShellController.getPageShellFromCache(a[c])];case 3:return(b=d.sent())?[3,6]:[3,5];case 4:return g=d.sent(),t.queueTask(function(){f.metricsHelper.logError(g);f.metricsHelper.logCountError(g);f.metricsHelper.logTagAndCount("PageShellCacheMiss:CacheError")}),[3,5];case 5:return c++,[3,1];case 6:return this.metricsHelper.logMark("Arrived:PageShell"),t.queueTask(function(){f.metricsHelper.logTagAndCount("PageShellCache".concat(b?
"Hit":"Miss"))}),b&&this._pageShellController.queuePageShellMetadataMetrics(b.response),[2,b]}})})};b.prototype._getNonAssembledResponse=function(a){return y(this,void 0,void 0,function(){var b,c,g,f=this;return B(this,function(d){switch(d.label){case 0:return[4,this._serverResponseController.readServerResponse(this._event,this.eventOptions,a,"sdrsm",!0,!0)];case 1:return b=d.sent(),this.metricsHelper.logMark("Arrived:ServerResponse"),c=[],this._flags.passthrough&&c.push(function(){return y(f,void 0,
void 0,function(){return B(this,function(a){switch(a.label){case 0:return[4,this._getPageShell(this._pageShellsConfig)];case 1:return a.sent(),[2]}})})}),b.parseable&&(g=b.response.clone(),c.push(function(){return y(f,void 0,void 0,function(){return B(this,function(a){this._pageShellController.queuePageShellUpdate(g,!1);return[2]})})})),t.queueTask(function(){return y(f,void 0,void 0,function(){var a;return B(this,function(b){switch(b.label){case 0:a=0,b.label=1;case 1:return a<c.length?[4,c[a]()]:
[3,4];case 2:b.sent(),b.label=3;case 3:return a++,[3,1];case 4:return[2]}})})}),[2,b.response]}})})};b.prototype._getPageShellAssembledResponse=function(a,b){return y(this,void 0,void 0,function(){return B(this,function(c){return[2,new Response(this._getPageShellAssembledResponseOutputStream(a,b),this._getPageShellAssembledResponseInit(a))]})})};b.prototype._getNoPageShellAssembledResponse=function(a,b){return y(this,void 0,void 0,function(){return B(this,function(c){return[2,new Response(this._getNoPageShellAssembledResponseOutputStream(a,
b),this._getNoPageShellAssembledResponseInit())]})})};b.prototype._getPageShellAssembledResponseInit=function(a){return{status:200,statusText:"OK",headers:this._pageShellController.getFilteredPageShellHeaders(a.response)}};b.prototype._getNoPageShellAssembledResponseInit=function(){return{status:200,statusText:"OK",headers:ma.getCommonHTMLHeaders()}};b.prototype._getPageShellAssembledResponseOutputStream=function(a,b){var c=this;return new ReadableStream({start:function(e){return y(c,void 0,void 0,
function(){var c,d,g,h,k,m,q,r,u,t,v,w,x,y,z,A,D,C,E,G,H,I,J,F;return B(this,function(f){switch(f.label){case 0:return f.trys.push([0,24,,25]),c=this._toOutputStream("PageShell",a.response,e),d=this._serverResponseController.readServerResponse(this._event,this.eventOptions,b,"sdrs",!1,!0),g=this._getSkeletonFragment(a,d),[4,c];case 1:return f.sent(),[4,g];case 2:return(h=f.sent())?[4,this._toOutputStream("Skeleton",h,e)]:[3,4];case 3:f.sent(),f.label=4;case 4:return k=this._toOutputStream,m=["ShellRenderPerfCounter"],
[4,this._getPerfCounterFragment(this.metricsHelper.getMetricName("ShellRender"))];case 5:return[4,k.apply(this,m.concat([f.sent(),e]))];case 6:return f.sent(),[4,d];case 7:return q=f.sent(),r=q.unrecoverable,u=q.parseable,t=q.response,this.metricsHelper.logMark("Arrived:ServerResponse"),r?[4,this._toOutputStream("ServerResponse",t,e)]:[3,9];case 8:return f.sent(),e.close(),[2];case 9:return v=this._getCSMTokensFragment(a.response,t),w=this._getPageMetadataFragment(a.response,t),x=u?this._getAfterDelimiterFragment(a,
t):Promise.resolve(t.clone()),y=this._toOutputStream,z=["CSMTokens"],[4,v];case 10:return[4,y.apply(this,z.concat([f.sent(),e]))];case 11:return f.sent(),A=this._toOutputStream,D=["PageMetadata"],[4,w];case 12:return[4,A.apply(this,D.concat([f.sent(),e]))];case 13:f.sent(),C=!1,f.label=14;case 14:return f.trys.push([14,17,,20]),E=this._toOutputStream,G=["AfterDelimiter"],[4,x];case 15:return[4,E.apply(this,G.concat([f.sent(),e]))];case 16:return f.sent(),[3,20];case 17:H=f.sent();if(!K.matchesCode(H,
"StreamTransformMissingDelimiter"))return[3,19];C=!0;this.metricsHelper.logTagAndCount("MissingDelimiter");return this._flags.flushFullOnMissingDelimiter?[4,this._toOutputStream("MissingDelimiterFallback",t.clone(),e)]:[3,19];case 18:f.sent(),f.label=19;case 19:return[3,20];case 20:if(!N.isDebug)return[3,23];I=this._toOutputStream;J=["DebugInfo"];return[4,this._getDebugInfoFragment()];case 21:return[4,I.apply(this,J.concat([f.sent(),e]))];case 22:f.sent(),f.label=23;case 23:e.close();this.metricsHelper.logTagAndCount("ServerResponseStatus:".concat(t.status));
if(!u||C)return[2];this._pageShellController.queuePageShellUpdate(t,!0);return[3,25];case 24:throw F=f.sent(),e.close(),this.metricsHelper.logError(F),this.metricsHelper.logCountError(F),F;case 25:return[2]}})})}})};b.prototype._getNoPageShellAssembledResponseOutputStream=function(a,b){var c=this;return new ReadableStream({start:function(e){return y(c,void 0,void 0,function(){var c,d,g,h,k,m,q,r,t,u;return B(this,function(f){switch(f.label){case 0:return f.trys.push([0,9,,10]),c=this._serverResponseController.readServerResponse(this._event,
this.eventOptions,b,"sdrsn",!1,!0),d=this._getSkeletonFragment(a,c),[4,d];case 1:return(g=f.sent())?[4,this._toOutputStream("Skeleton",g,e)]:[3,3];case 2:f.sent(),f.label=3;case 3:return[4,c];case 4:return h=f.sent(),k=h.unrecoverable,m=h.parseable,q=h.response,this.metricsHelper.logMark("Arrived:ServerResponse"),[4,this._toOutputStream("ServerResponse",q.clone(),e)];case 5:f.sent();if(k)return e.close(),[2];if(!N.isDebug)return[3,8];r=this._toOutputStream;t=["DebugInfo"];return[4,this._getDebugInfoFragment()];
case 6:return[4,r.apply(this,t.concat([f.sent(),e]))];case 7:f.sent(),f.label=8;case 8:e.close();this.metricsHelper.logTagAndCount("ServerResponseStatus:".concat(q.status));if(!m)return[2];this._pageShellController.queuePageShellUpdate(q,!1);return[3,10];case 9:throw u=f.sent(),e.close(),this.metricsHelper.logError(u),this.metricsHelper.logCountError(u),u;case 10:return[2]}})})}})};b.prototype._toOutputStream=function(a,b,c){return y(this,void 0,void 0,function(){var e=this;return B(this,function(g){switch(g.label){case 0:if(!(b.body instanceof
ReadableStream))throw r.create("ResponseBodyInvalid");return[4,na.drain(b.body,function(a){e._processChunk(a,c)})];case 1:return g.sent(),this.metricsHelper.logMark("Flushed:".concat(a)),[2]}})})};b.prototype._processChunk=function(a,b){b.enqueue(a)};b.prototype._getSkeletonFragment=function(a,b){return y(this,void 0,void 0,function(){var c,e,f,d,h,k,p;return B(this,function(g){switch(g.label){case 0:c=a.skeleton;if(!c)return[2];e=c.data||{};f=c.hooks;d=this.contentFragmentService.render(this.eventOptions,
c.name,{data:e,hooks:f});return c.race?[4,Promise.race([d,b])]:[3,2];case 1:return k=g.sent(),[3,4];case 2:return[4,d];case 3:k=g.sent(),g.label=4;case 4:return h=k,p=h instanceof Response,this.metricsHelper.logMark("Arrived:Skeleton"),this.metricsHelper.logTag("Skeleton:Race:".concat(!!c.race)),this.metricsHelper.logTag("Skeleton:Render:".concat(p)),[2,p?h:void 0]}})})};b.prototype._getCSMTokensFragment=function(a,b){return y(this,void 0,void 0,function(){var c;return B(this,function(e){c=this._pageShellController.getPageShellMetadata(a);
return[2,(new zd(this.eventOptions,this.metricsService,b,c.attribution)).getResponse()]})})};b.prototype._getPageMetadataFragment=function(a,b){return y(this,void 0,void 0,function(){var c,e,f,d,h,k,p;return B(this,function(g){c=this._pageShellController.getPageShellMetadata(a);e=b.ok;f=b.type;d=b.status;h=b.redirected;k=b.headers.get(x.shared.REQUEST_ID_OPF_HEADER);p={attribution:c.attribution,staleness:c.staleness,serverResponse:{ok:e,type:f,status:d,redirected:h,requestId:k}};return[2,(new Ed(this.eventOptions,
this.metricsService,this.responseRuleName,this.name,p)).getResponse()]})})};b.prototype._getPerfCounterFragment=function(a){return y(this,void 0,void 0,function(){return B(this,function(b){return[2,(new Jd(this.eventOptions,this.metricsService,a)).getResponse()]})})};b.prototype._getAfterDelimiterFragment=function(a,b){return y(this,void 0,void 0,function(){return B(this,function(c){return[2,(new nd(this.eventOptions,this.metricsService,b,a.delimiter)).getResponse()]})})};b.prototype._getDebugInfoFragment=
function(){return y(this,void 0,void 0,function(){return B(this,function(a){return[2,(new jd(this.eventOptions,this.metricsService,this._event.request.url)).getResponse()]})})};A([k],b.prototype,"build",null);A([k],b.prototype,"_getPageShellAssembledResponse",null);A([k],b.prototype,"_getNoPageShellAssembledResponse",null);A([k],b.prototype,"_getPageShellAssembledResponseInit",null);A([k],b.prototype,"_getNoPageShellAssembledResponseInit",null);A([k],b.prototype,"_getPageShellAssembledResponseOutputStream",
null);A([k],b.prototype,"_getNoPageShellAssembledResponseOutputStream",null);A([k],b.prototype,"_toOutputStream",null);A([k],b.prototype,"_processChunk",null);A([k],b.prototype,"_getSkeletonFragment",null);A([k],b.prototype,"_getCSMTokensFragment",null);A([k],b.prototype,"_getPageMetadataFragment",null);A([k],b.prototype,"_getPerfCounterFragment",null);A([k],b.prototype,"_getAfterDelimiterFragment",null);A([k],b.prototype,"_getDebugInfoFragment",null);return b}(He),Qe=this&&this.__extends||function(){var h=
function(b,a){h=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(a,b){a.__proto__=b}||function(a,b){for(var c in b)Object.prototype.hasOwnProperty.call(b,c)&&(a[c]=b[c])};return h(b,a)};return function(b,a){function e(){this.constructor=b}if("function"!==typeof a&&null!==a)throw new TypeError("Class extends value "+String(a)+" is not a constructor or null");h(b,a);b.prototype=null===a?Object.create(a):(e.prototype=a.prototype,new e)}}(),Re=function(h){function b(a,b,c,g){var e=h.call(this)||
this;e.logCtor(arguments);e.cacheService=a;e.metricsService=b;e.contentFragmentService=c;e.eventBus=g;return e}Qe(b,h);return b}(v),Se=this&&this.__extends||function(){var h=function(b,a){h=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(a,b){a.__proto__=b}||function(a,b){for(var c in b)Object.prototype.hasOwnProperty.call(b,c)&&(a[c]=b[c])};return h(b,a)};return function(b,a){function e(){this.constructor=b}if("function"!==typeof a&&null!==a)throw new TypeError("Class extends value "+
String(a)+" is not a constructor or null");h(b,a);b.prototype=null===a?Object.create(a):(e.prototype=a.prototype,new e)}}(),M=this&&this.__decorate||function(h,b,a,e){var c=arguments.length,g=3>c?b:null===e?e=Object.getOwnPropertyDescriptor(b,a):e,f;if("object"===typeof Reflect&&"function"===typeof Reflect.decorate)g=Reflect.decorate(h,b,a,e);else for(var d=h.length-1;0<=d;d--)if(f=h[d])g=(3>c?f(g):3<c?f(b,a,g):f(b,a))||g;return 3<c&&g&&Object.defineProperty(b,a,g),g},Te=function(h){function b(a,
b,c,g,f,d,k){var e=h.call(this,b,c,g,f)||this;e.logCtor(arguments);e._swGlobal=a;e._usePreloadResponseOnlyForServerResponseOnNavigations=k.usePreloadResponseOnlyForServerResponseOnNavigations;e._errorLoggingScope="NavigationResponseService";e._initNavigationRules(d);e._speculateContentFragmentUsage();return e}Se(b,h);b.prototype.respond=function(a,b){try{for(var c=0;c<this._navigationRules.length;c++){var e=this._navigationRules[c];if(this._doesRuleMatch(e.routeMatchers,a,b)){a.errorContext.NavigationResponseRule=
e.src;a.errorContext.NavigationURL=b.request.url;var f=e.name;this._triggerWeblabs(e.weblabs,a);if(!e.respond){this._logTag(a,!1,f);break}var d=this._createResponseStrategy(f,e.strategy,a,b);this._logMark(a,!0,f);b.respondWith(d.getResponse());this._logMark(a,!1,f);this._logTag(a,!0,f);break}}}catch(n){throw this.metricsService.error(a,n,this._errorLoggingScope),this.metricsService.countError(a,n,this._errorLoggingScope),n;}};b.prototype._initNavigationRules=function(a){var b=this;this._navigationRules=
a.map(function(a){return{name:a.name,routeMatchers:a.routeMatchers.map(function(a){return b._createRouteMatcher(a)}),weblabs:a.weblabTriggers,respond:a.respond,strategy:a.responseStrategy,src:I.serialize(a)}})};b.prototype._speculateContentFragmentUsage=function(){var a=this;this._navigationRules.forEach(function(b){switch(b.strategy.name){case "SingleDelimiter":b.strategy.pageShells.forEach(function(b){b.skeleton&&a._publishSpeculatedContentFragmentUsage(b.skeleton)}),b.strategy.noPageShell&&b.strategy.noPageShell.skeleton&&
a._publishSpeculatedContentFragmentUsage(b.strategy.noPageShell.skeleton)}})};b.prototype._publishSpeculatedContentFragmentUsage=function(a){var b=a.name;a=a.prewarm;this.eventBus.publish({name:"ContentFragmentSpeculation",detail:{eventOptions:fa.create(),name:b,prewarm:a}})};b.prototype._doesRuleMatch=function(a,b,c){for(var e=0;e<a.length;e++)if(a[e].match(c.request,c,b))return!0;return!1};b.prototype._createRouteMatcher=function(a){switch(a.name){case "URLPathRoute":return new Db(a.pattern,a.stripRefMarkers,
a.stripLanguageFolder);default:throw r.create("UnrecognizedRouteMatcher",a);}};b.prototype._createResponseStrategy=function(a,b,c,g){switch(b.name){case "SingleDelimiter":return new Pe(this._swGlobal,this.cacheService,this.metricsService,this.contentFragmentService,this.eventBus,g,c,this._usePreloadResponseOnlyForServerResponseOnNavigations,a,b.pageShells,b.noPageShell,b.flags);default:throw r.create("UnrecognizedResponseStrategy",b);}};b.prototype._triggerWeblabs=function(a,b){var c=this;a&&t.queueTask(function(){a.forEach(function(a){c.metricsService.weblabTrigger(b,
a.name,a.treatment)})})};b.prototype._logTag=function(a,b,c){var e=this;t.queueTask(function(){var f=b?"Active":"Inactive";e.metricsService.tag(a,"Respond:".concat(f));e.metricsService.tag(a,"Respond:".concat(f,":").concat(c))})};b.prototype._logMark=function(a,b,c){b=b?"Before":"After";this.metricsService.mark(a,"Respond:".concat(b));this.metricsService.mark(a,"Respond:".concat(b,":").concat(c))};M([k],b.prototype,"respond",null);M([k],b.prototype,"_initNavigationRules",null);M([k],b.prototype,"_speculateContentFragmentUsage",
null);M([k],b.prototype,"_publishSpeculatedContentFragmentUsage",null);M([k],b.prototype,"_doesRuleMatch",null);M([k],b.prototype,"_createRouteMatcher",null);M([k],b.prototype,"_createResponseStrategy",null);M([k],b.prototype,"_triggerWeblabs",null);M([k],b.prototype,"_logTag",null);M([k],b.prototype,"_logMark",null);return b}(Re),Ue=this&&this.__extends||function(){var h=function(b,a){h=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(a,b){a.__proto__=b}||function(a,b){for(var c in b)Object.prototype.hasOwnProperty.call(b,
c)&&(a[c]=b[c])};return h(b,a)};return function(b,a){function e(){this.constructor=b}if("function"!==typeof a&&null!==a)throw new TypeError("Class extends value "+String(a)+" is not a constructor or null");h(b,a);b.prototype=null===a?Object.create(a):(e.prototype=a.prototype,new e)}}(),Ha=this&&this.__assign||function(){Ha=Object.assign||function(h){for(var b,a=1,e=arguments.length;a<e;a++){b=arguments[a];for(var c in b)Object.prototype.hasOwnProperty.call(b,c)&&(h[c]=b[c])}return h};return Ha.apply(this,
arguments)},Qb=!1,Ve=function(h){function b(a){var b=h.call(this)||this;b.logCtor(arguments);b._checkAlreadyStarted();b._logDebugInfo(a);var c=b._getGlobal(a),g=b._getFlags(a);if(!b._isSupported(c,g))return b;var f=b._getConfig(a);b._startServices(c,g,f);return b}Ue(b,h);b.prototype._checkAlreadyStarted=function(){if(Qb)throw r.create("DuplicateLibraryInitialization");Qb=!0};b.prototype._logDebugInfo=function(a){N.isDebugVerbose&&this.log("_logDebugInfo","Lib Init",{startTimeSeconds:E.getEpochSeconds(),
libInfo:u,options:a})};b.prototype._getGlobal=function(a){return a.serviceWorkerGlobal||self};b.prototype._getFlags=function(a){var b={usePreloadResponseOnlyForServerResponseOnNavigations:W.isMShop()};return Ha(Ha({},b),a.flags)};b.prototype._getConfig=function(a){a=a.configuration;if(!(a&&Array.isArray(a.caches)&&Array.isArray(a.cachePopulationRules)&&Array.isArray(a.navigationResponseRules)))throw r.create("InvalidInitializationConfiguration",{config:a});return{caches:(new ee).filter(a.caches),
cachePopulationRules:(new je).filter(a.cachePopulationRules),navigationResponseRules:(new le).filter(a.navigationResponseRules),contentFragments:(new he).filter(a.contentFragments)}};b.prototype._isSupported=function(a,b){a=new pb(a,b);try{return a.validate(),!0}catch(c){return this.log("_isSupported","".concat(c)),!1}};b.prototype._startServices=function(a,b,c){var e=new pe,f=new Ae(a,e),d=new sc(a,f,c.caches),h=new ne(f,e,c.contentFragments);h=new Te(a,d,f,h,e,c.navigationResponseRules,b);new ae(a,
d,f,e,c.cachePopulationRules);new ue(a,h,f,e,b)};return b}(v);Rb.init=function(h){new Ve(h)}})(this.Lightsaber=this.Lightsaber||{})})();(function(c){var d=[],e=[],f=[],g=[],b=function(a,b){Array.isArray(b)&&a.push.apply(a,b.filter(function(a){return!!a}))};c.register=function(a){b(d,a.caches);b(e,a.cachePopulationRules);b(f,a.navigationResponseRules);b(g,a.contentFragments)};c.getConfig=function(){return{caches:d,cachePopulationRules:e,navigationResponseRules:f,contentFragments:g}}})(this.LightsaberConfiguration=this.LightsaberConfiguration||{});(function(){LightsaberConfiguration.register({caches:[{name:"PageShell",version:3,plugins:["MaxAge","ValidationKeys","Metadata"]}]})})();(function(){var e=function(){try{var d=JSON.parse(decodeURIComponent("%5B%7B%22name%22%3A%22homepage.mweb.common.no-page-shell.wave-pulse%22%2C%22url%22%3A%22https%3A%2F%2Fm.media-amazon.com%2Fimages%2FS%2Fsash%2FS0NM8jwVYeSaEOM.html%3FLightsaberSkeleton%3Dhomepage.mweb.common.no-page-shell.wave-pulse%22%7D%2C%7B%22name%22%3A%22homepage.mweb.common.no-page-shell.static%22%2C%22url%22%3A%22https%3A%2F%2Fm.media-amazon.com%2Fimages%2FS%2Fsash%2FLMkTy4fygzBoJmU.html%3FLightsaberSkeleton%3Dhomepage.mweb.common.no-page-shell.static%22%7D%2C%7B%22name%22%3A%22homepage.app.common.no-page-shell.wave-pulse%22%2C%22url%22%3A%22https%3A%2F%2Fm.media-amazon.com%2Fimages%2FS%2Fsash%2FPZqvjaaMjVfvgqk.html%3FLightsaberSkeleton%3Dhomepage.app.common.no-page-shell.wave-pulse%22%7D%2C%7B%22name%22%3A%22homepage.app.common.no-page-shell.static%22%2C%22url%22%3A%22https%3A%2F%2Fm.media-amazon.com%2Fimages%2FS%2Fsash%2FAjN9H6mG4yulq3u.html%3FLightsaberSkeleton%3Dhomepage.app.common.no-page-shell.static%22%7D%2C%7B%22name%22%3A%22dummy.nav.parameters.test.detail.mweb.common.static%22%2C%22url%22%3A%22https%3A%2F%2Fm.media-amazon.com%2Fimages%2FS%2Fsash%2FcrLqqBq60BJjedr.html%3FLightsaberSkeleton%3Ddummy.nav.parameters.test.detail.mweb.common.static%22%7D%2C%7B%22name%22%3A%22dummy.nav.parameters.test.detail.mweb.common.no-page-shell.wave-pulse%22%2C%22url%22%3A%22https%3A%2F%2Fm.media-amazon.com%2Fimages%2FS%2Fsash%2F_teAnSa6g_KZnI0.html%3FLightsaberSkeleton%3Ddummy.nav.parameters.test.detail.mweb.common.no-page-shell.wave-pulse%22%7D%2C%7B%22name%22%3A%22detail.mweb.common.wave-vertical%22%2C%22url%22%3A%22https%3A%2F%2Fm.media-amazon.com%2Fimages%2FS%2Fsash%2FqSsoD6ID_S8R1FU.html%3FLightsaberSkeleton%3Ddetail.mweb.common.wave-vertical%22%7D%2C%7B%22name%22%3A%22detail.mweb.common.wave-pulse%22%2C%22url%22%3A%22https%3A%2F%2Fm.media-amazon.com%2Fimages%2FS%2Fsash%2FdDtXU06aR8vfXbN.html%3FLightsaberSkeleton%3Ddetail.mweb.common.wave-pulse%22%7D%2C%7B%22name%22%3A%22detail.mweb.common.wave-horizontal%22%2C%22url%22%3A%22https%3A%2F%2Fm.media-amazon.com%2Fimages%2FS%2Fsash%2FzSOEJTym8KGQVTt.html%3FLightsaberSkeleton%3Ddetail.mweb.common.wave-horizontal%22%7D%2C%7B%22name%22%3A%22detail.mweb.common.static%22%2C%22url%22%3A%22https%3A%2F%2Fm.media-amazon.com%2Fimages%2FS%2Fsash%2FbL6hFqXi0s4tjiO.html%3FLightsaberSkeleton%3Ddetail.mweb.common.static%22%7D%2C%7B%22name%22%3A%22detail.mweb.common.no-page-shell.wave-vertical%22%2C%22url%22%3A%22https%3A%2F%2Fm.media-amazon.com%2Fimages%2FS%2Fsash%2FaXRNHvEE-IDAYxR.html%3FLightsaberSkeleton%3Ddetail.mweb.common.no-page-shell.wave-vertical%22%7D%2C%7B%22name%22%3A%22detail.mweb.common.no-page-shell.wave-pulse%22%2C%22url%22%3A%22https%3A%2F%2Fm.media-amazon.com%2Fimages%2FS%2Fsash%2F2fa9MSkBhjMh-GQ.html%3FLightsaberSkeleton%3Ddetail.mweb.common.no-page-shell.wave-pulse%22%7D%2C%7B%22name%22%3A%22detail.mweb.common.no-page-shell.wave-horizontal%22%2C%22url%22%3A%22https%3A%2F%2Fm.media-amazon.com%2Fimages%2FS%2Fsash%2Frhzozv_gGZmOK2A.html%3FLightsaberSkeleton%3Ddetail.mweb.common.no-page-shell.wave-horizontal%22%7D%2C%7B%22name%22%3A%22detail.mweb.common.no-page-shell.static%22%2C%22url%22%3A%22https%3A%2F%2Fm.media-amazon.com%2Fimages%2FS%2Fsash%2FxhiN3cpt2NflQv_.html%3FLightsaberSkeleton%3Ddetail.mweb.common.no-page-shell.static%22%7D%2C%7B%22name%22%3A%22detail.app.common.wave-vertical%22%2C%22url%22%3A%22https%3A%2F%2Fm.media-amazon.com%2Fimages%2FS%2Fsash%2FjgbroU1NIwDnKN1.html%3FLightsaberSkeleton%3Ddetail.app.common.wave-vertical%22%7D%2C%7B%22name%22%3A%22detail.app.common.wave-pulse%22%2C%22url%22%3A%22https%3A%2F%2Fm.media-amazon.com%2Fimages%2FS%2Fsash%2FU-Gd8JVJWgoefhw.html%3FLightsaberSkeleton%3Ddetail.app.common.wave-pulse%22%7D%2C%7B%22name%22%3A%22detail.app.common.wave-horizontal%22%2C%22url%22%3A%22https%3A%2F%2Fm.media-amazon.com%2Fimages%2FS%2Fsash%2FkSdD3q44kY0OkRn.html%3FLightsaberSkeleton%3Ddetail.app.common.wave-horizontal%22%7D%2C%7B%22name%22%3A%22detail.app.common.static%22%2C%22url%22%3A%22https%3A%2F%2Fm.media-amazon.com%2Fimages%2FS%2Fsash%2FXGk6YN6lgUbMtkr.html%3FLightsaberSkeleton%3Ddetail.app.common.static%22%7D%2C%7B%22name%22%3A%22detail.app.common.no-page-shell.wave-vertical%22%2C%22url%22%3A%22https%3A%2F%2Fm.media-amazon.com%2Fimages%2FS%2Fsash%2Fsr1dLLRtx33FiEa.html%3FLightsaberSkeleton%3Ddetail.app.common.no-page-shell.wave-vertical%22%7D%2C%7B%22name%22%3A%22detail.app.common.no-page-shell.wave-pulse%22%2C%22url%22%3A%22https%3A%2F%2Fm.media-amazon.com%2Fimages%2FS%2Fsash%2FKq4SCBcRsiB_Phx.html%3FLightsaberSkeleton%3Ddetail.app.common.no-page-shell.wave-pulse%22%7D%2C%7B%22name%22%3A%22detail.app.common.no-page-shell.wave-horizontal%22%2C%22url%22%3A%22https%3A%2F%2Fm.media-amazon.com%2Fimages%2FS%2Fsash%2Fc2CEn-r27Yh2WXx.html%3FLightsaberSkeleton%3Ddetail.app.common.no-page-shell.wave-horizontal%22%7D%2C%7B%22name%22%3A%22detail.app.common.no-page-shell.static%22%2C%22url%22%3A%22https%3A%2F%2Fm.media-amazon.com%2Fimages%2FS%2Fsash%2Fz-kNIOZ5ntToFU9.html%3FLightsaberSkeleton%3Ddetail.app.common.no-page-shell.static%22%7D%5D"))}catch(g){d=
[]}return{contentFragments:(this&&this.__spreadArray||function(d,b,e){if(e||2===arguments.length)for(var a=0,f=b.length,c;a<f;a++)!c&&a in b||(c||(c=Array.prototype.slice.call(b,0,a)),c[a]=b[a]);return d.concat(c||Array.prototype.slice.call(b))})([],d,!0)}}();LightsaberConfiguration.register(e)})();(function(){LightsaberConfiguration.register({cachePopulationRules:[void 0],navigationResponseRules:[void 0]})})();(function(){LightsaberConfiguration.register({cachePopulationRules:[void 0],navigationResponseRules:[void 0]})})();(function(){LightsaberConfiguration.register({cachePopulationRules:[void 0],navigationResponseRules:[void 0]})})();(function(){LightsaberConfiguration.register({cachePopulationRules:[void 0],navigationResponseRules:[void 0]})})();(function(){LightsaberConfiguration.register({cachePopulationRules:[void 0],navigationResponseRules:[void 0]})})();(function(){LightsaberConfiguration.register({cachePopulationRules:[void 0],navigationResponseRules:[void 0]})})();(function(){LightsaberConfiguration.register({cachePopulationRules:[void 0],navigationResponseRules:[void 0]})})();(function(){LightsaberConfiguration.register({cachePopulationRules:[void 0],navigationResponseRules:[void 0]})})();(function(){LightsaberConfiguration.register({cachePopulationRules:[void 0],navigationResponseRules:[void 0]})})();(function(){LightsaberConfiguration.register({cachePopulationRules:[void 0,void 0]})})();(function(){LightsaberConfiguration.register({navigationResponseRules:[void 0]})})();var AUI_JS_DEBUG=!1;(function(a){a.init=function(){}})(this.LightsaberShadow=this.LightsaberShadow||{});(function(){})();var WPN_CL_PNAFV="AmazonWebPushNotificationsClientLib-1.0.6334.0",AUI_JS_DEBUG=!1;(function(a){a.init=function(a){}})(this.WebPushNotifications=this.WebPushNotifications||{});var AUI_JS_DEBUG=!1;
(function(){var e=this&&this.__extends||function(){var b=function(c,a){b=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(a,b){a.__proto__=b}||function(a,b){for(var c in b)Object.prototype.hasOwnProperty.call(b,c)&&(a[c]=b[c])};return b(c,a)};return function(c,a){function d(){this.constructor=c}if("function"!==typeof a&&null!==a)throw new TypeError("Class extends value "+String(a)+" is not a constructor or null");b(c,a);c.prototype=null===a?Object.create(a):(d.prototype=a.prototype,
new d)}}();(function(b){function c(a){a=b.call(this,a)||this;Object.setPrototypeOf(a,c.prototype);return a}e(c,b);return c})(Error);self.addEventListener("install",function(b){AUI_JS_DEBUG&&console.log("[SW] ".concat("Installed"));b.waitUntil(self.skipWaiting())});self.addEventListener("activate",function(b){AUI_JS_DEBUG&&console.log("[SW] ".concat("Activated"));b.waitUntil(self.clients.claim())})})();ØA
—Eoúô