/*! @amzn/apswebapstaglibrary - web-client-bundle - v25.205.027 - 2025-02-05 00:27:45 */ !function(){"use strict";var t=function(n,e){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var e in n)Object.prototype.hasOwnProperty.call(n,e)&&(t[e]=n[e])},t(n,e)};function n(n,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function i(){this.constructor=n}t(n,e),n.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)}var e=function(){return e=Object.assign||function(t){for(var n,e=1,i=arguments.length;e0&&r[r.length-1])||6!==u[0]&&2!==u[0])){o=0;continue}if(3===u[0]&&(!r||u[1]>r[0]&&u[1]=t.length&&(t=void 0),{value:t&&t[i++],done:!t}}};throw new TypeError(n?"Object is not iterable.":"Symbol.iterator is not defined.")}function u(t,n){var e="function"==typeof Symbol&&t[Symbol.iterator];if(!e)return t;var i,r,o=e.call(t),a=[];try{for(;(void 0===n||n-- >0)&&!(i=o.next()).done;)a.push(i.value)}catch(t){r={error:t}}finally{try{i&&!i.done&&(e=o.return)&&e.call(o)}finally{if(r)throw r.error}}return a}function c(t,n,e){if(e||2===arguments.length)for(var i,r=0,o=n.length;r=0&&t<=1?t:1};"number"==typeof(null==t?void 0:t.error)&&this.v.set("error",n(t.error)),"number"==typeof(null==t?void 0:t.feat)&&this.v.set("feat",n(t.feat))},t.prototype.clearAndUpdateEventProcessingInterval=function(t){var n=this;"number"!=typeof t||t<=0||t!==this.m&&(clearInterval(this._),this._=setInterval((function(){try{n.processEventRecords()}catch(t){}}),t),this.m=t)},t.prototype.processEventRecords=function(){for(var t=[],n=Array.from(this.p.keys()),e=function(e){var r=n[e],o=i.p.get(r),a=i.v.get(r);if(void 0===o||o.length<=0)return"continue";if(void 0===a||0===a)return o.length>=i.l&&(o.length=0,i.logEvent({eventCategory:r,eventName:"queue limit reached"})),"continue";var d=o.filter((function(t){return void 0!==t&&a>=Math.random()}));o.length=0,t.push.apply(t,c([],u(d),!1))},i=this,r=0;rthis.STACK_MAX_LENGTH){return t.stack.substring(0,this.STACK_MAX_LENGTH-5)+"[...]"}return t.stack}catch(t){return"NO STACK: ERROR ON RETRIEVAL"}},t.prototype.getErrorName=function(t){var n="unknown";try{"string"==typeof t?n=t:void 0!==t.name&&(n=t.name)}catch(t){try{n="Client Error: ".concat(t.name.toString()," - ").concat(t.message)}catch(t){n="Client Error: Unable to provide more information"}}return n},t.prototype.getErrorMessage=function(t){var n="unknown";try{"string"==typeof t?n=t:void 0!==t.message&&(n=t.message)}catch(t){try{n="Client Error: ".concat(t.name.toString()," - ").concat(t.message)}catch(t){n="Client Error: Unable to provide more information"}}return n},t.prototype.getErrorContext=function(t){var n,e="unknown";try{"string"!=typeof t&&"context"in t&&(e=null!==(n=t.context)&&void 0!==n?n:"")}catch(t){try{e="Client Error: ".concat(t.name.toString()," - ").concat(t.message)}catch(t){e="Client Error: Unable to provide more information"}}return e},t}(),b=new y;!function(t){t.postulate="postulate",t.genericError="error"}(h||(h={}));var g="25.205.027";function E(t,n,i){var r=new URL("https://prod.tahoe-analytics.publishers.advertising.a2z.com/logevent/putRecord"),o=t;try{"web-client-scenarios.aps.amazon.dev"===(null==i?void 0:i.hostname)?o=t+"-debug-only":window.Cypress&&(o=t+"-integration-test")}catch(t){}var a=e(e({},i),{eventSource:"aps_web_client_library",eventCategory:o,eventName:n,libraryVersion:g});Object.entries(a).forEach((function(t){var n=u(t,2),e=n[0],i=n[1];r.searchParams.append(e,i)})),fetch(r.toString(),{method:"GET",keepalive:!0,headers:{"x-api-key":"79db72eb0b5c7255afa54a253df24fb4a5ac916bf40b51c730df8850aa5665ca"}}).catch((function(){}))}var _,k,S,R,A={R:setInterval,A:function(){var t;return null===(t=window[j])||void 0===t?void 0:t[x]},j:function(t){var n;void 0===t&&(t=window);try{return(null===(n=t.top)||void 0===n?void 0:n.location)||{href:"unknown",hostname:"unknown"}}catch(t){return{href:"unknown",hostname:"unknown"}}},I:E,O:function(t,n){return{eventTime:I((function(){return"".concat(Date.now())})),accountID:I((function(){return null==t?void 0:t.accountID})),libraryVersion:g,url:I((function(){return n().href})),hostname:I((function(){return n().hostname})),message:I((function(){return null==t?void 0:t.message})),condition:I((function(){return null==t?void 0:t.condition}))}},C:function(t,n){var e,i;try{(null!=n?n:E)(h.genericError,"telemetry_core_failure",{errorName:null!==(e=null==t?void 0:t.name)&&void 0!==e?e:"unknown",errorMessage:null!==(i=null==t?void 0:t.message)&&void 0!==i?i:"unknown"})}catch(t){(null!=n?n:E)(h.genericError,"telemetry_core_failure")}}},j="_aps_telemetry",x="alarms";function I(t){var n;try{return null!==(n=t())&&void 0!==n?n:"undefined"}catch(t){return function(t){try{return t instanceof Error?"Access Error: ".concat(t.name," - ").concat(t.message):"Access Error: Unknown error type"}catch(t){return"Access Error: Unable to provide more information"}}(t)}}!function(t){t.push="push",t.listenerSuccess="listenerSuccess",t.direct="direct"}(_||(_={})),function(t){t.internal="internal",t.apstag="apstag",t.webpage="webpage",t.dtbm="dtbm"}(k||(k={})),function(t){t.completed="completed",t.waiting="waiting",t.cancelled="cancelled"}(S||(S={})),function(t){t.started="started",t.error="error",t.unknown="unknown",t.deactivated="deactivated",t.analytics="analytics"}(R||(R={}));var O=e(e({},S),R),C=new Map([["_config/config/didLoad",function(t){var n=t.account;return t.customEvent,r(void 0,void 0,void 0,(function(){return o(this,(function(t){return n.write("config/loaded",!0),[2,S.completed]}))}))}],["_config/requestViewerCountry/define",function(t){var n=t.account,e=t.customEvent;return r(void 0,void 0,void 0,(function(){var t,i;return o(this,(function(r){if(void 0===(null===(i=e.detail)||void 0===i?void 0:i.code))throw new Error("Missing country code");if("string"!=typeof(t=e.detail.code)||0===t.trim().length)throw new Error('Invalid country code: "'.concat(t,'"'));return n.update(w,(function(){return t})),[2,S.completed]}))}))}]]),P="apstag/configuration/fetch",M=new Map([[P,function(t){var n=t.account;return t.customEvent,r(void 0,void 0,void 0,(function(){var t;return o(this,(function(e){switch(e.label){case 0:return(t=n.globalContext.document.createElement("script")).setAttribute("src","".concat("https://config.aps.amazon-adsystem.com/configs/").concat(n.id)),t.setAttribute("type","text/javascript"),t.setAttribute("async","async"),n.globalContext.document.head.appendChild(t),[4,new Promise((function(n,e){t.addEventListener("load",(function(){n()})),t.addEventListener("error",(function(t){e(t)}))}))];case 1:return e.sent(),[2,S.completed]}}))}))}]]),T="consent/isGPPListenerRegistered",N={key:"consent/isTCFAPIListenerRegistered",default:!1},D={key:"consent/TCData",default:void 0};function U(t,n){var e,i;return"string"==typeof(null==n?void 0:n.tcString)&&(null==n?void 0:n.tcString.length)>0||!0===(null===(i=null===(e=null==t?void 0:t.globalContext)||void 0===e?void 0:e.apstag)||void 0===i?void 0:i.isGDPRRegion)||!0===(null==n?void 0:n.gdprApplies)}function L(t,n){var e,i,r,o,a;return!0===(null===(i=null===(e=t.vendor)||void 0===e?void 0:e.consents)||void 0===i?void 0:i[793])&&(o=n,a=null===(r=t.purpose)||void 0===r?void 0:r.consents,(null!=o?o:[]).reduce((function(t,n){return t&&!0===(null==a?void 0:a[n])}),!0))}var q=function(t,n){var i={tcData:n,consents:[1]},r=function(t){try{return t()}catch(t){return"error"}};return{tcT:r((function(){return t.isAPStagAllowedToAccessInfoOnDevice()})),tcCC:r((function(){return function(t){var n,e=t.account,i=t.tcData,r=t.consents;if(!U(e,i))return!0;if("object"!=typeof i)return!1;if((null!==(n=i.tcfPolicyVersion)&&void 0!==n?n:0)<2)return!1;if(i.useNonStandardStacks)return!1;if(!i.isServiceSpecific)return!1;var o=!1;return r.forEach((function(t){var n,e,a;switch(null===(a=null===(e=null===(n=i.publisher)||void 0===n?void 0:n.restrictions)||void 0===e?void 0:e[t])||void 0===a?void 0:a[793]){case 0:case 2:o=!0;break;default:L(i,r)||(o=!0)}})),!o}(e(e({},i),{account:t}))})),tcCF:r((function(){return 0===function(t){var n,e=t.tcData,i=t.consents;if(0===(null!=i?i:[]).length)return["No consents param passed"];var r=[];try{if("object"!=typeof e){var o="";try{o=JSON.stringify(e)}catch(t){}r.push("Invalid tcData: ".concat(o))}return!1===e.gdprApplies?[]:((null!==(n=e.tcfPolicyVersion)&&void 0!==n?n:0)<2&&r.push("tcData version not supported: ".concat(e.tcfPolicyVersion)),e.useNonStandardStacks&&r.push("tcData's useNonStandardStacks should not be true"),e.isServiceSpecific||r.push("tcData needs to be service specific"),i.forEach((function(t){var n,o,a;switch(null===(a=null===(o=null===(n=e.publisher)||void 0===n?void 0:n.restrictions)||void 0===o?void 0:o[t])||void 0===a?void 0:a[793]){case 0:r.push("Invalid publisher restrictions 0, consent ".concat(t));break;case 2:r.push("Invalid publisher restrictions 2, consent ".concat(t));break;default:L(e,i)||r.push("Invalid publisher restrictions default, consent ".concat(t))}})),r)}catch(t){if(r.length>0)return r;throw t}}(i).length})),PRA:r((function(){return U(t,n)}))}},V="consent/gppapi/attemptSync",F="consent/gppapi/didChange",z="consent/gppapi/syncData",J="consent/tcfapi/attemptSync",B="consent/tcfapi/didChange",G=new Map([[V,function(t){var n=t.account;return r(void 0,void 0,void 0,(function(){var t;return o(this,(function(e){switch(e.label){case 0:return void 0===n.globalContext.__gpp||!0===n.read(T)?[2,S.cancelled]:[4,n.record(z)];case 1:return e.sent(),t=n.globalContext.__gpp("addEventListener",(function(t){"error"!==(null==t?void 0:t.eventName)&&n.record(F,{eventListener:t,fromAddEvent:!0}).catch((function(t){}))})),n.write(T,"listenerRegistered"===(null==t?void 0:t.eventName)&&!0===(null==t?void 0:t.data)),[2,S.completed]}}))}))}],[F,function(t){var n=t.account,e=t.customEvent;return r(void 0,void 0,void 0,(function(){var t,i;return o(this,(function(r){switch(r.label){case 0:return[4,n.record(z,{eventListener:null===(t=e.detail)||void 0===t?void 0:t.eventListener,fromAddEvent:null===(i=e.detail)||void 0===i?void 0:i.fromAddEvent})];case 1:return r.sent(),[2,S.completed]}}))}))}],[z,function(t){var n=t.account,i=t.customEvent;return r(void 0,void 0,void 0,(function(){var t,r,a,c,d,s,l,v,f,p,h,m,w,y,b;return o(this,(function(o){return(null!==(h=null===(p=null===(f=null===(v=i.detail)||void 0===v?void 0:v.eventListener)||void 0===f?void 0:f.pingData)||void 0===p?void 0:p.gppString)&&void 0!==h?h:"").length>0?(t=null===(w=null===(m=i.detail)||void 0===m?void 0:m.eventListener)||void 0===w?void 0:w.pingData,c="addEventListener"):(s=u(function(t){var n,e,i;try{var r=t.globalContext.__gpp("ping",(function(t,n){n&&"object"==typeof t&&(e=t)}));void 0===e&&(null!==(n=null==r?void 0:r.gppString)&&void 0!==n?n:"").length>0&&(e=r)}catch(t){i="E:ping: ".concat(t)}return[e,i]}(n),2),t=s[0],a=s[1],c="ping","object"!=typeof t&&(l=u(function(t){var n,i;try{var r=t.globalContext.__gpp("getGPPData");n=e(e({},r),r.pingData)}catch(t){i="E:getGPPData: ".concat(t)}return[n,i]}(n),2),t=l[0],r=l[1],c="getGPPData")),d={gpp:{gppLength:"string"==typeof(null==t?void 0:t.gppString)?t.gppString.length:void 0,isGPPTilde:(null!==(y=null==t?void 0:t.gppString)&&void 0!==y?y:"").includes("~"),error10:r,error:a,gppVersion:null==t?void 0:t.gppVersion,cmpId:null==t?void 0:t.cmpId,method:c,fromAddEvent:null===(b=i.detail)||void 0===b?void 0:b.fromAddEvent}},n.write("consent/GPPData",t),[2,{status:S.completed,analytics:d}]}))}))}],[J,function(t){var n=t.account;return r(void 0,void 0,void 0,(function(){var t;return o(this,(function(e){return t=n.use(N),void 0===n.globalContext.__tcfapi||t?[2,S.cancelled]:(n.globalContext.__tcfapi("addEventListener",2,(function(t,e){n.record(B,{tcData:t,success:e}).catch((function(t){}))})),[2,S.completed])}))}))}],[B,function(t){var n=t.account,e=t.customEvent;return r(void 0,void 0,void 0,(function(){var t,i,r,a;return o(this,(function(o){return t=null===(r=e.detail)||void 0===r?void 0:r.success,n.update(N,(function(n){return n||!0===t})),i=null===(a=e.detail)||void 0===a?void 0:a.tcData,n.update(D,(function(n){return void 0!==i||!0===t?i:n})),"object"!=typeof i?[2,S.completed]:[2,{status:S.completed,analytics:q(n,i)}]}))}))}]]);function H(t,n,i,r){void 0===i&&(i="root"),void 0===r&&(r=".");var o={nonModifiable:{set:function(t,n){throw new Error('Cannot set property "'.concat(String(n),'": Validator does not specify this object as modifiable'))},deleteProperty:function(t,n){throw new Error('Cannot delete property "'.concat(String(n),'": Validator does not specify this object as modifiable'))},defineProperty:function(t,n){throw new Error('Cannot define property "'.concat(String(n),'": Validator does not specify this object as modifiable'))},setPrototypeOf:function(t){throw new Error("Cannot set prototype: Validator does not specify this object as modifiable")}},modifiable:{set:function(t,n,e,i){try{return Reflect.set(t,n,e,i)}catch(i){if("TypeError"===i.name)return t[n]=e,!0;throw i}}},validating:{get:function(t,e,o){if("symbol"==typeof e)return Reflect.get(t,e,o);if(function(t){if(["asymmetricMatch","nodeType"].includes(t))return!0}(e))return Reflect.get(t,e,o);var a;try{a=Reflect.get(t,e,o)}catch(n){if("TypeError"!==n.name)throw n;a=t[e]}return H(a,n,"".concat(i).concat(r).concat(String(e)))},ownKeys:function(t){return Reflect.ownKeys(t).filter((function(t){var e="".concat(i).concat(r).concat(String(t));return void 0!==n[e]}))}},function:{apply:function(t,e,r){return H(t.apply(e,r),n,"".concat(i,"()"))}}},a=function(r){if(!1===r.verifiable)return t;if(t instanceof Set)return t.forEach((function(t){H(t,n,"".concat(i,".value"))})),t;if(t instanceof Map)return t.forEach((function(t,e){H(e,n,"".concat(i,".key")),H(t,n,"".concat(i,".value"))})),t;if(Array.isArray(t))return t.map((function(t){return H(t,n,"".concat(i,"[]"))}));if("function"==typeof t)return new Proxy(t,o.function);var a=e(e({},o.validating),(null==r?void 0:r.modifiable)?o.modifiable:o.nonModifiable);try{return new Proxy(t,a)}catch(n){if("TypeError"===n.name)return t;throw n}}(function(){var r,o=n[i];if(void 0===o&&function(t,n){var i,r=function(){return!1};!function(t,n,i){var r=window;void 0===r[j]&&(r[j]={}),void 0===r[j][x]&&(r[j][x]=[]);var o=r[j][x],a=n.toString();o.push({hash:t,context:e(e({},i),{condition:a})})}(t,r,n);var o=null!==(i=null==n?void 0:n.message)&&void 0!==i?i:"Postulate violation: ".concat(t,", ").concat(r);throw new Error(o)}("ea3914",{message:'Unauthorized usage for "'.concat(i,'": No validator has been defined')}),null===o)return{verifiable:!1};try{r=o(t,i)}catch(n){var a="Error, could not convert to string";try{a="string"==typeof t?'"'+t+'"':t.toString()}catch(t){}throw new Error('Validation failed for "'.concat(i,'": ').concat(n.message," - Received: ").concat(a))}return null!=r?r:{}}());return a}var W=function(t){if("number"!=typeof t)throw new Error("must be a number")},K=function(t){if("string"!=typeof t)throw new Error("must be a string")},$=function(t){if("boolean"!=typeof t)throw new Error("must be a boolean")},Q=function(t){if("object"!=typeof t||null===t||Array.isArray(t))throw new Error("must be a standard object")},Y=function(t){if(!Array.isArray(t))throw new Error("must be an array")};function Z(t){return function(n){if(!1===t.includes(n))throw new Error("must be one of the following values: ".concat(JSON.stringify(t)))}}function X(t){return function(n,i){var r=t(n,i);return e({modifiable:!0},r)}}function tt(t){return function(n,e){if(t===et)throw new Error("isAny cannot be used within isOptional");null!=n&&t(n,e)}}var nt=function(t){if("function"!=typeof t)throw new Error("must be a function")},et=function(){},it=function(){return{verifiable:!1}},rt=function(){function t(t){var n=t.scope,e=t.object,i=t.action,r=t.validators,o=t.handler;this.throwIfInvalid(n,e,i),this.name="".concat(n,"/").concat(e,"/").concat(i),this.handler=this.wrapHandler(o,r)}return t.prototype.wrapHandler=function(t,n){var i=this;return function(a){return r(i,void 0,void 0,(function(){var i,r,u;return o(this,(function(o){switch(o.label){case 0:return i=e(e({},i=a),{detail:H(i.customEvent.detail,null!==(r=null==n?void 0:n.detail)&&void 0!==r?r:{detail:et},"detail"),context:H(i.account.globalContext,null!==(u=null==n?void 0:n.context)&&void 0!==u?u:{context:et},"context")}),[4,t(i)];case 1:return[2,o.sent()]}}))}))}},t.prototype.throwIfInvalid=function(t,n,e){var i=/^[a-z0-9][a-zA-Z0-9]*$/;if(!i.test(t)||!i.test(n)||!i.test(e))throw new Error("scope, object, and action must be alphanumeric and start with a lowercase. Received: ".concat(t,", ").concat(n,", ").concat(e));if(/[A-Z]/.test(e)&&!/^(will|did)/i.test(e))throw new Error("action must be a single verb (or a single verb prefixed by 'will' or 'did'). Received: ".concat(e))},t}();function ot(t){if(new Set(t.map((function(t){return t.name}))).size!==t.length)throw new Error("Duplicates found");return new Map(t.map((function(t){return[t.name,t.handler]})))}var at="debugSession/end",ut="prepend/events",ct="populator/ran",dt={key:"consent/hasPurposeOneConsent",default:!1},st=function(){function t(t){var n=this;this.getItem=function(t){var e=n.globalContext.document.cookie.split("; ").reduce((function(n,e){var i=e.split("=");return i[0]===t?decodeURIComponent(i.slice(1).join("=")):n}),"");return e.length>0?e:null},this.removeItem=function(t,e){void 0===e&&(e="/"),n.setItem(t,"",0,e)},this.setItem=function(t,e,i,r){void 0===r&&(r="/");var o=new Date(i);if(!n.isValidDate(o))throw new Error("Invalid expiration date");n.globalContext.document.cookie="".concat(t,"=").concat(e,"; expires=").concat(o.toUTCString(),"; path=").concat(r,";")},this.globalContext=t}return t.prototype.isValidDate=function(t){return t instanceof Date&&!isNaN(t)},t}(),lt=["scope/objectName",at,ut];function vt(t){return null===t||"object"!=typeof t?t:t instanceof Date?new Date(t.getTime()):t instanceof Array?t.reduce((function(t,n){return t.push(vt(n)),t}),[]):t instanceof Set?Array.from(t.values()).reduce((function(t,n){return t.add(vt(n)),t}),new Set):t instanceof Map?Array.from(t.entries()).reduce((function(t,n){return t.set(n[0],vt(n[1])),t}),new Map):t instanceof Object?Object.keys(t).reduce((function(n,e){return n[e]=vt(t[e]),n}),{}):t}var ft,pt=function(){function t(t,n){var e=n.rootName;this.globalContext=n.globalContext;var i=this.globalContext[e].get(t);if(null==i)throw new Error('Missing "'.concat(t,'" account in userspace object'));this.id=t,this.store=i.store,this.queue=i.queue,this.store.has("listeners")||this.store.set("listeners",new Map)}return t.prototype.record=function(t,n){return r(this,void 0,void 0,(function(){var i=this;return o(this,(function(r){switch(r.label){case 0:return[4,new Promise((function(r,o){i.queue.push(new CustomEvent(t,{detail:e({resolve:r,reject:o,source:k.internal},n)}))}))];case 1:return[2,r.sent()]}}))}))},t.prototype.recordListener=function(t,n){return r(this,void 0,void 0,(function(){var i=this;return o(this,(function(r){switch(r.label){case 0:return[4,new Promise((function(r,o){i.queue.push(new CustomEvent(t.name,{detail:e({resolve:r,reject:o,source:k.internal},n)}))}))];case 1:return[2,r.sent()]}}))}))},t.prototype.recordListenerNonBlocking=function(t,n){this.recordListener(t,n).catch((function(t){}))},t.prototype.read=function(t,n){var e,i,r,o,a=this.store.get(t);if(void 0!==a)return a;if(void 0!==(null==n?void 0:n.persist)&&n.persist){var d=this.readLocalStorage(t,{usePrefix:!0});if(void 0!==d)return d}var s=null===(i=null===(e=null==n?void 0:n.default)||void 0===e?void 0:e.generators)||void 0===i?void 0:i.get(t);return void 0!==s?s.apply(void 0,c([],u(null!==(o=null===(r=null==n?void 0:n.default)||void 0===r?void 0:r.args)&&void 0!==o?o:[]),!1)):void 0},t.prototype.write=function(t,n,e){this.store.set(t,n),void 0!==(null==e?void 0:e.persist)&&e.persist&&this.writeLocalStorage(t,n,{usePrefix:!0})},t.prototype.use=function(t,n){var e,i=this.store.get(t.key);if(void 0!==i)e=i;else if(void 0!==(null==n?void 0:n.persist)&&n.persist){var r=this.readLocalStorage(t.key,{usePrefix:!0});null!=r&&(e=r)}var o=null!=e?e:t.default;if("function"==typeof o||!1===(null==n?void 0:n.structuredClone))return o;try{return structuredClone(o)}catch(t){try{return vt(o)}catch(t){return b.logCoreError({id:"Core.library.Account.use",account:null,error:t}),o}}},t.prototype.update=function(t,n,e){var i=n(this.use(t,e));if(void 0!==t.postProcessor&&(i=t.postProcessor(i)),this.store.set(t.key,i),void 0!==(null==e?void 0:e.persist)&&e.persist){if("string"!=typeof i)throw new Error("".concat(JSON.stringify(i)," must be a string to be writtable to browser storage"));this.writeLocalStorage(t.key,i,{usePrefix:!0})}},t.prototype.delete=function(t,n){this.store.delete(t),void 0!==(null==n?void 0:n.persist)&&n.persist&&this.deleteLocalStorage(t,{usePrefix:!0})},t.prototype.remove=function(t,n){this.store.delete(t.key),void 0!==(null==n?void 0:n.persist)&&n.persist&&this.deleteLocalStorage(t.key,{usePrefix:!0})},t.prototype.executeFuncWithConsent=function(t,n){if(!this.isAllowedToAccessInfoOnDevice())throw new Error("Invalid consent. API requires consent before execution.");return n.apply(t)},t.prototype.recordErrorEvent=function(t){b.logError(e(e({},t),{account:this}))},t.prototype.recordStatusChangeEvent=function(t){b.logFeature({id:t.id,account:this,feature:t.status,props:e({},t.props)})},t.prototype.recordGenericEvent=function(t){b.logFeature({id:t.id,account:this,feature:t.id,props:e({},t.props)})},t.prototype.isAllowedToAccessInfoOnDevice=function(){return this.updateUserConsent(),this.use(dt)},t.prototype.isAPStagAllowedToAccessInfoOnDevice=function(){return!0===this.globalContext.apstag._atsaaiod()},t.prototype.updateUserConsent=function(){try{var t=this.isAPStagAllowedToAccessInfoOnDevice();this.update(dt,(function(){return t}))}catch(t){}},t.prototype.getPersistedItemName=function(t){return"".concat("aps").concat(":").concat(this.id).concat(":").concat(t)},t.prototype.isBrowserStorageAllowed=function(t){var n=!1;try{n=this.isAllowedToAccessInfoOnDevice()}catch(t){}return n||lt.includes(t)},t.prototype.setCookieStorage=function(t,n,e,i){var r,o;if(!this.isBrowserStorageAllowed(t))throw new Error("".concat(t," is not allowed to be set on cookie storage"));var a=null!==(r=null==i?void 0:i.usePrefix)&&void 0!==r&&r?this.getPersistedItemName(t):t;return new st(this.globalContext).setItem(a,n,e,null!==(o=null==i?void 0:i.path)&&void 0!==o?o:"/")},t.prototype.readCookieStorage=function(t,n){var e;if(!this.isBrowserStorageAllowed(t))throw new Error("".concat(t," is not allowed to be read from cookie storage"));var i=null!==(e=null==n?void 0:n.usePrefix)&&void 0!==e&&e?this.getPersistedItemName(t):t;return new st(this.globalContext).getItem(i)},t.prototype.readLocalStorage=function(t,n){var e;if(!this.isBrowserStorageAllowed(t))throw new Error("".concat(t," is not allowed to be read from browser storage"));var i=null!==(e=null==n?void 0:n.usePrefix)&&void 0!==e&&e?this.getPersistedItemName(t):t;if(i in this.globalContext.localStorage)return this.globalContext.localStorage.getItem(i)},t.prototype.writeLocalStorage=function(t,n,e){var i;if(!this.isBrowserStorageAllowed(t))throw new Error("".concat(t," is not allowed to be written to browser storage"));if("string"!=typeof n)throw new Error("".concat(JSON.stringify(n)," must be a string to be writtable to browser storage"));var r=null!==(i=null==e?void 0:e.usePrefix)&&void 0!==i&&i?this.getPersistedItemName(t):t;this.globalContext.localStorage.setItem(r,n)},t.prototype.deleteLocalStorage=function(t,n){var e;if(!this.isBrowserStorageAllowed(t))throw new Error("".concat(t," is not allowed to be touched/deleted in browser storage"));var i=null!==(e=null==n?void 0:n.usePrefix)&&void 0!==e&&e?this.getPersistedItemName(t):t;this.globalContext.localStorage.removeItem(i)},t.prototype.readSessionStorage=function(t,n){var e;if(!this.isBrowserStorageAllowed(t))throw new Error("".concat(t," is not allowed to be read from browser storage"));var i=null!==(e=null==n?void 0:n.usePrefix)&&void 0!==e&&e?this.getPersistedItemName(t):t;if(i in this.globalContext.sessionStorage)return this.globalContext.sessionStorage.getItem(i)},t.prototype.writeSessionStorage=function(t,n,e){var i;if(!this.isBrowserStorageAllowed(t))throw new Error("".concat(t," is not allowed to be written to browser storage"));if("string"!=typeof n)throw new Error("".concat(JSON.stringify(n)," must be a string to be writable to browser storage"));var r=null!==(i=null==e?void 0:e.usePrefix)&&void 0!==i&&i?this.getPersistedItemName(t):t;this.globalContext.sessionStorage.setItem(r,n)},t.prototype.deleteSessionStorage=function(t,n){var e;if(!this.isBrowserStorageAllowed(t))throw new Error("".concat(t," is not allowed to be touched/deleted in browser storage"));var i=null!==(e=null==n?void 0:n.usePrefix)&&void 0!==e&&e?this.getPersistedItemName(t):t;this.globalContext.sessionStorage.removeItem(i)},t}(),ht="_system",mt=function(t){function e(n,e){return t.call(this,ht,{globalContext:n,rootName:e})||this}return n(e,t),e}(pt),wt=function(){function t(t,n,e){this.globalContext=t,this.rootName=n,this.dispatcher=e}return t.prototype.getAccounts=function(){return this.globalContext[this.rootName]},t.prototype.createUserspaceRoot=function(){null==this.getAccounts()&&(this.globalContext[this.rootName]=new Map)},t.prototype.createSystemAccount=function(){!1===this.getAccounts().has(ht)&&(this.getAccounts().set(ht,{queue:[],store:new Map}),new mt(this.globalContext,this.rootName).store.set(v,Math.random()))},t.prototype.observeRootSet=function(){var t=this;this.getAccounts().set=function(n,e){Map.prototype.set.apply(this,[n,e]),t.equip()}},t.prototype.observeAccountQueuesPush=function(){var t=this;this.getAccounts().forEach((function(n){n.queue.push=function(){for(var n=[],e=0;e150){var i=e.slice(-100);t.store.set(l,i)}}},t.prototype.yt=function(t){var n,e=null!==(n=t.store.get(l))&&void 0!==n?n:[];e.push.apply(e,c([],u(t.queue.filter((function(t){return void 0!==t.status&&kt.includes(t.status)}))),!1)),t.store.set(l,e)},t.prototype.bt=function(t){var n;(n=t.queue).splice.apply(n,c([0,t.queue.length],u(t.queue.filter((function(t){return void 0===t.status||!kt.includes(t.status)}))),!1))},t.prototype.gt=function(){var t=this;this.ht().forEach((function(n){t.yt(n),t.wt(n),t.bt(n)}))},t.prototype.Et=function(t){return null==t?void 0:t.filter((function(t){var n,e;return(null===(n=t.detail)||void 0===n?void 0:n.source)!==k.internal&&(null===(e=t.detail)||void 0===e?void 0:e.source)!==k.apstag&&t.status!==O.waiting}))},t.prototype._t=function(t){var n,e=this.Et(t);return null!==(n=null==e?void 0:e.length)&&void 0!==n?n:0},t.prototype.kt=function(t){var n=this._t(t);this.G(f,n)},t.prototype.St=function(){var t=this,n="_internal/recentDispatches";this.G(n,1);var e=this.F(n);if(e>1e4)throw new Error("Too many dispatches. Aborting");e%100==0&&new mt(this.globalContext,this.rootName).recordGenericEvent({id:"C.l.D.thr",props:{recentDispatchesCount:e}}),setTimeout((function(){t.H(n)}),100)},t.prototype.P=function(t){var n,e,i,r,o,a=this,u=t.reason;try{this.St(),p()&&bt.info('# Dispatch from method "'.concat(u.method,'" on event "').concat(null!==(e=null===(n=u.events)||void 0===n?void 0:n[0].type)&&void 0!==e?e:"undefined",'" with source "').concat(null!==(o=null===(r=null===(i=u.events)||void 0===i?void 0:i[0].detail)||void 0===r?void 0:r.source)&&void 0!==o?o:"undefined",'"\n_________________________________________')),this.kt(u.events);var c=new mt(this.globalContext,this.rootName);this.ht().forEach((function(t){return a.lt(t,c,u)})),this.gt()}catch(t){throw new mt(this.globalContext,this.rootName).recordErrorEvent({id:"C.l.D.dis",error:t}),t}},t}(),Rt=function(){function t(t,n){this.globalContext=t,this.rootName=n}return t.prototype.subscribe=function(t){try{var n=new mt(this.globalContext,this.rootName),e=null!=n.store.get(s)?n.store.get(s):new Map;n.store.set(s,new Map(c(c([],u(e),!1),u(t),!1)))}catch(t){throw new mt(this.globalContext,this.rootName).recordErrorEvent({id:"Core.library.Subscriber.subscribe",error:t}),t}},t}(),At=function(){function t(t,n){this.globalContext=t,this.rootName=n}return t.prototype.populate=function(){try{var t=new mt(this.globalContext,this.rootName),n=!1;try{n=JSON.parse(t.read(ct))}catch(t){}if(n)return;t.write(ct,JSON.stringify(!0)),this.populateFromPrependStore(),this.populateFromQueryParams()}catch(t){new mt(this.globalContext,this.rootName).recordErrorEvent({id:"Core.library.Populator.populate",error:t})}},t.prototype.populateFromPrependStore=function(){var t=this;this.globalContext[this.rootName].forEach((function(n,e){var i,r,o=new pt(e,{globalContext:t.globalContext,rootName:t.rootName}),a=null!==(r=o.read(ut,{persist:!0}))&&void 0!==r?r:"[]";o.write(ut,JSON.stringify([]));try{var d=JSON.parse(a);if(0===d.length)return;(i=o.queue).push.apply(i,c([],u(d.map(xt)),!1))}catch(t){console.error("Error processing prepended events",t)}}))},t.prototype.populateFromQueryParams=function(){var t,n,e=null===(n=null===(t=this.globalContext)||void 0===t?void 0:t.location)||void 0===n?void 0:n.search,i=new URLSearchParams(e),r=this.globalContext[this.rootName],o=r.get(ht);jt(i,"aps.trigger").forEach((function(t){o.queue.push(xt(t))})),jt(i,"aps.triggerFor",!0).forEach((function(t){void 0!==t.accountId&&r.has(t.accountId)&&r.get(t.accountId).queue.push(xt(t))}));var a=jt(i,"aps_event");r.forEach((function(t){a.forEach((function(n){t.queue.push(xt(n))}))}))},t}(),jt=function(t,n,e){void 0===e&&(e=!1);var i=t.getAll(n),r=[];return i.forEach((function(t){var n,i=t.split(",");e&&(n=i.shift());var o=i.shift();if(void 0!==o&&o.length>0){var a=decodeURIComponent(i.join(",")),u=void 0;if(a.length>0)try{u=JSON.parse(a)}catch(t){console.error("Error processing query param event",o,u)}r.push({eventName:o.replace(/_/g,"/"),eventDetail:u,accountId:n})}})),r},xt=function(t){var n;return new CustomEvent(t.eventName,{detail:e({},null!==(n=t.eventDetail)&&void 0!==n?n:{})})},It={globalContext:window,rootName:"_aps"},Ot=function(){function t(t,n,e){this.ID=t,this.rootName=e,this.globalContext=n,this.clear()}return t.prototype.clear=function(){var t=this;new mt(this.globalContext,this.rootName).update(Et,(function(n){return n.delete(t.ID),n}))},t.prototype.recordListener=function(t,n){var e=this;new mt(this.globalContext,this.rootName).update(Et,(function(i){var r=i.get(e.ID);return void 0!==r?r.push([t.name,n]):i.set(e.ID,[[t.name,n]]),i}))},t}(),Ct=function(){function t(t,n){void 0===t&&(t=It.globalContext),void 0===n&&(n=It.rootName),this.dispatcher=new St(t,n),this.equiper=new wt(t,n,this.dispatcher),this.subscriber=new Rt(t,n),this.populator=new At(t,n),this.globalContext=t,this.rootName=n}return t.prototype.createAccount=function(t){var n;if(void 0===t)throw new Error("accountID must be provided");this.globalContext[this.rootName]=null!==(n=this.globalContext[this.rootName])&&void 0!==n?n:new Map;var e=this.globalContext[this.rootName],i={store:new Map,queue:[]};return!1===e.has(t)&&e.set(t,i),new pt(t,{globalContext:this.globalContext,rootName:this.rootName})},t.prototype.subscribe=function(t){this.subscriber.subscribe(t)},t.prototype.equip=function(){this.equiper.equip()},t.prototype.dispatch=function(t){var n=t.reason;this.dispatcher.P({reason:n})},t.prototype.populate=function(){this.populator.populate()},t.prototype.load=function(t){var n=t.listeners;this.equip(),this.subscribe(n),this.dispatch({reason:{method:_.direct}}),this.populate()},t.prototype.registerEventSource=function(t){return this.equip(),new Ot(t,this.globalContext,this.rootName)},t}(),Pt="vnd_prx_segments",Mt="aps_targeting_comscore",Tt=new rt({scope:"cxm",object:"comscore",action:"set",handler:function(t){var n=t.account;return t.customEvent,r(void 0,void 0,void 0,(function(){return o(this,(function(t){return[2,{status:Nt(n)}]}))}))}}),Nt=function(t){var n=t.readSessionStorage(Mt);if(t.deleteSessionStorage(Mt),null==n)return S.cancelled;try{var e=JSON.parse(n)[Pt];if(null==e)throw new Error;return t.globalContext.googletag.pubads().getSlots().forEach((function(t){t.setTargeting(Pt,e)})),S.completed}catch(t){throw new Error("Malformed targeting object at ".concat(Mt))}},Dt="aps_targeting_ias",Ut=new rt({scope:"cxm",object:"ias",action:"set",handler:function(t){var n=t.account;return t.customEvent,r(void 0,void 0,void 0,(function(){return o(this,(function(t){return[2,{status:Lt(n)}]}))}))}}),Lt=function(t){var n=t.readSessionStorage(Dt);if(t.deleteSessionStorage(Dt),null==n)return S.cancelled;try{var e=JSON.parse(n),i=t.globalContext.googletag;i.pubads().getSlots().forEach((function(t){var n=e.targeting.slots[t.getSlotElementId()];null!=n&&Object.keys(n).forEach((function(e){t.setTargeting(e,n[e])}))}));var r=e.targeting,o=r.brandSafety,a=r.fr,u=r.custom;return null!=o&&Object.keys(o).forEach((function(t){i.pubads().setTargeting(t,o[t])})),null!=u&&Object.keys(u).forEach((function(t){var n=u[t];Array.isArray(n)?n.forEach((function(n){i.pubads().setTargeting(t,n)})):i.pubads().setTargeting(t,n)})),null!=a&&i.pubads().setTargeting("fr",a),S.completed}catch(t){throw new Error("Malformed targeting object at ".concat(Dt))}},qt="aps_targeting_illuma",Vt=new rt({scope:"cxm",object:"illuma",action:"set",handler:function(t){var n=t.account;return t.customEvent,r(void 0,void 0,void 0,(function(){return o(this,(function(t){return[2,{status:Ft(n)}]}))}))}}),Ft=function(t){var n=t.readSessionStorage(qt);if(t.deleteSessionStorage(qt),null==n)return S.cancelled;var e=JSON.parse(n).results;if(null==e)throw new Error("Malformed targeting object at ".concat(qt));var i=t.globalContext.googletag;return Object.keys(e).forEach((function(t){var n=e[t];i.pubads().setTargeting("".concat("illuma_").concat(t),JSON.stringify(n))})),S.completed},zt=new rt({scope:"cxm",object:"contextual",action:"set",handler:function(t){var n=t.account;return t.customEvent,r(void 0,void 0,void 0,(function(){return o(this,(function(t){switch(t.label){case 0:return[4,Promise.all([n.recordListener(Tt),n.recordListener(Ut),n.recordListener(Vt)])];case 1:return t.sent(),[2,{status:S.completed}]}}))}))}}),Jt=ot([Tt,zt,Ut,Vt]),Bt={key:"customPlacement/hints",default:{}},Gt={key:"customPlacement/bidResponses",default:{}},Ht=function(){function t(t,n,i){var r=this;this.CLICK_PREFIX_MACRO="%%CLICK_URL_PREFIX%%",this.PROGRAM_CUSTOM_PLACEMENTS="customPlacements",this.getPageStyles=function(t){return void 0===t&&(t=["p","h1","h2"]),t.map(r.getTagStyle).filter((function(t){return Object.keys(t).length>0})).reduce((function(t,n){return e(e({},t),n)}),{})},this.getContainerStyles=function(t){try{if(!t)return{};var n=window.getComputedStyle(t),e="--aps-custom-container-",i=new Map;return i.set("".concat(e,"width"),n.width),i.set("".concat(e,"margin"),n.margin),i.set("".concat(e,"padding"),n.padding),Object.fromEntries(i.entries())}catch(t){return{}}},this.slotProps=t,this.rawResponse=n,this.Rt=i}return t.prototype.getTagStyle=function(t){var n=this.Rt.getElementsByTagName(t);if(n&&n[0]){var e=window.getComputedStyle(this.Rt.getElementsByTagName(t)[0]),i=new Map,r="--aps-custom-page-";return i.set("".concat(r).concat(t,"-color"),e.color),i.set("".concat(r).concat(t,"-fontFamily"),e.fontFamily),i.set("".concat(r).concat(t,"-fontSize"),e.fontSize),i.set("".concat(r).concat(t,"-fontWeight"),e.fontWeight),i.set("".concat(r).concat(t,"-lineHeight"),e.lineHeight),Object.fromEntries(i)}return{}},t.prototype.getDynamicFrameBodyHeight=function(t,n,i){var r;if(n){null==n||n.contentWindow;var o=(null==n?void 0:n.contentDocument)||(null===(r=null==n?void 0:n.contentWindow)||void 0===r?void 0:r.document),a=null==o?void 0:o.body.scrollHeight;n.style.height="".concat(a,"px");try{var u=e(e({},this.getPageStyles()),this.getContainerStyles(t));Object.keys(u).forEach((function(t){null==o||o.documentElement.style.setProperty(t,u[t])}))}catch(t){}}},t.prototype.render=function(t){return this.At(t)},t.prototype.At=function(t){var n,e,i,r=this;if(!this.rawResponse||!this.slotProps)return!1;try{var o=this.rawResponse.size.split("x"),a=(null===(n=this.rawResponse.targeting)||void 0===n?void 0:n.amzniid)||this.rawResponse.amzniid,u=(null===(e=this.rawResponse.targeting)||void 0===e?void 0:e.amznadm)||this.rawResponse.amznadm;if(!a)return!1;var c=this.slotProps.jt;if(this.slotProps.location&&this.slotProps.id){var d=this.Rt.createElement("div");null===(i=this.Rt.getElementById(this.slotProps.id))||void 0===i||i.insertAdjacentElement(this.slotProps.location,d),c=d}if(!c)return!1;var s=this.Rt.createElement("iframe");return s.style.marginLeft="0",s.style.marginTop="0",s.style.height="".concat(o[1],"px"),s.style.width="100%",s.setAttribute("data-testid","amzn-asr-ad"),s.setAttribute("scrolling","no"),s.setAttribute("frameborder","0"),s.onload=function(){return r.getDynamicFrameBodyHeight(c,s,u?"amznadm":"admi")},s.srcdoc=u||"",t&&t.clickPrefix&&(s.srcdoc=s.srcdoc.replace(this.CLICK_PREFIX_MACRO,t.clickPrefix)),c.appendChild(s),this.updateSlotAttribute("status","rendered"),!0}catch(t){throw new Error("CustomPlacements: Error while rendering")}},t.prototype.updateSlotAttribute=function(t,n){var e;null===(e=this.slotProps.jt)||void 0===e||e.setAttribute("data-aps-custom-".concat(t),n)},t}(),Wt={key:"customPlacement/timings",default:[]},Kt=function(t,n,e,i){void 0===e&&(e=0),void 0===i&&(i=0);try{var r={effectiveType:null==n?void 0:n.effectiveType,rtt:null==n?void 0:n.rtt,downlink:null==n?void 0:n.downlink},o=function(t,n,e){try{var i=isNaN(n)||0===n?t.body.clientWidth:n,r=isNaN(e)||0===e?t.body.clientHeight:e;return"".concat(i,"x").concat(r)}catch(t){}return"x"}(t,e,i);return{connection:r,screen:o}}catch(t){return{}}},$t=function(t,n,e){t.update(Wt,(function(t){return t.push({time:performance.now(),key:"".concat(n,"/").concat(e)}),t}))},Qt="customPlacements",Yt=new rt({scope:"customPlacement",object:"hint",action:"process",validators:{},handler:function(t){var n=t.account;return t.detail,t.customEvent,r(void 0,void 0,void 0,(function(){var t,e,i;return o(this,(function(r){return t=function(t){var e;$t(n,Qt,"hint/process/".concat(t));var i=n.use(Bt),r=n.use(Gt);null!==(e=i[t].isRendered)&&void 0!==e&&e||(Object.values(r).forEach((function(e){var r;if(null===(r=e.isRendered)||void 0===r||!r){var o=n.globalContext.document.getElementById(t);if(null!=o){var a=new Ht({id:t,jt:o},e,n.globalContext.document);$t(n,Qt,"widget/render/".concat(t)),a.render(i[t].hintMetadata)&&(e.isRendered=!0,i[t].isRendered=!0)}}})),n.update(Bt,(function(){return i})),n.update(Gt,(function(){return r})))},e=n.use(Bt),Object.keys(e).filter((function(t){return e[t].default})).forEach(t),Object.keys(e).filter((function(t){return!e[t].default})).forEach(t),[2,{status:S.completed,analytics:{browserInfo:Kt(n.globalContext.document,null===(i=n.globalContext.navigator)||void 0===i?void 0:i.connection,n.globalContext.innerWidth,n.globalContext.innerHeight)}}]}))}))}}),Zt=new rt({scope:"customPlacement",object:"hint",action:"define",validators:{},handler:function(t){var n=t.account;t.detail;var e=t.customEvent;return r(void 0,void 0,void 0,(function(){var t,i,r,a,u,c,d;return o(this,(function(o){if(void 0===(null===(c=e.detail)||void 0===c?void 0:c.id))throw new Error("Hint `id` must be defined");return t=e.detail,i=t.id,r=t.isDefault,a=t.hintMetadata,$t(n,Qt,"hint/define/".concat(i)),(u=n.use(Bt))[i]={default:"default"===r,isRendered:!1,hintMetadata:null!=a?a:{}},n.update(Bt,(function(){return u})),n.recordListenerNonBlocking(Yt),[2,{status:S.completed,analytics:{browserInfo:Kt(n.globalContext.document,null===(d=n.globalContext.navigator)||void 0===d?void 0:d.connection,n.globalContext.innerWidth,n.globalContext.innerHeight)}}]}))}))}}),Xt={key:"customPlacement/placementResponseDispatched",default:!1},tn={key:"customPlacement/placementResponse",default:void 0},nn={key:"customPlacement/contextURL",default:void 0},en={key:"customPlacement/placementEndpoint",default:"https://c.aps.amazon-adsystem.com/e/placements"},rn={key:"ad/context",default:void 0},on=new rt({scope:"customPlacement",object:"placement",action:"fetch",validators:{},handler:function(t){var n=t.account;return t.detail,t.customEvent,r(void 0,void 0,void 0,(function(){var t,e;return o(this,(function(i){switch(i.label){case 0:return $t(n,Qt,"placementFetch/start"),[4,un(n)];case 1:return t=i.sent(),$t(n,Qt,"placementFetch/end"),[2,{status:S.completed,value:{placementResponse:t},analytics:{browserInfo:Kt(n.globalContext.document,null===(e=n.globalContext.navigator)||void 0===e?void 0:e.connection,n.globalContext.innerWidth,n.globalContext.innerHeight)}}]}}))}))}});function an(t){var n=t.use(rn);return void 0!==n&&"user"in n?(n.user,i(n,["user"])):n}function un(t){return r(this,void 0,void 0,(function(){var n,e,i,r,a;return o(this,(function(o){switch(o.label){case 0:return n={ortb2:an(t)},e=t.use(nn),i=t.use(en),r=function(t,n){try{var e=null!=n?n:function(t){var n,e;try{if(void 0!==(null===(n=t.globalContext.top)||void 0===n?void 0:n.location.href))return null===(e=t.globalContext.top)||void 0===e?void 0:e.location.href}catch(t){}try{if(t.globalContext.top!==t.globalContext.self)return t.globalContext.document.referrer}catch(t){}}(t);if(void 0!==e)return encodeURIComponent(e)}catch(t){}return""}(t,e),a=encodeURIComponent(JSON.stringify(n)),[4,fetch("".concat(i,"?account=").concat(t.id,"&u=").concat(r,"&sg=").concat(a))];case 1:return[4,o.sent().json()];case 2:return[2,o.sent()]}}))}))}var cn={key:"customPlacement/bidEndpoint",default:"c.aps.amazon-adsystem.com"},dn={key:"customPlacement/bidIsKey",default:"86355855cc6ed9e335d0382c8563aa10"},sn=new rt({scope:"customPlacement",object:"bids",action:"fetch",validators:{},handler:function(t){var n=t.account;return t.detail,t.customEvent,r(void 0,void 0,void 0,(function(){var t,e,i,r;return o(this,(function(o){switch(o.label){case 0:return t=Kt(n.globalContext.document,null===(i=n.globalContext.navigator)||void 0===i?void 0:i.connection,n.globalContext.innerWidth,n.globalContext.innerHeight),void 0===(null===(r=n.globalContext.apstag)||void 0===r?void 0:r.clientFetchBids)?[2,{status:S.waiting,analytics:{browserInfo:t}}]:($t(n,Qt,"fetchBids/start"),[4,ln(n)]);case 1:return e=o.sent(),$t(n,Qt,"fetchBids/end"),[2,{status:S.completed,value:{bidResponses:e},analytics:{browserInfo:t}}]}}))}))}});function ln(t){return r(this,void 0,void 0,(function(){var n,e,i;return o(this,(function(r){switch(r.label){case 0:return n={slots:[{slotID:"93b7dd52-a8ce-11ed-afa1-0242ac120002:1",sizes:[[999,999]]}],timeout:6e4,_endpointDomain:t.use(cn),params:{program:"apscustom",is:t.use(dn)}},e={pubID:t.id,isSelfServePub:36===t.id.length,deals:!0},i=t.use(nn),[4,new Promise((function(r){var o;null===(o=t.globalContext.apstag)||void 0===o||o.clientFetchBids(n,(function(t){r(t)}),{initConfig:e,contextURL:i})}))];case 1:return[2,r.sent()]}}))}))}var vn=new rt({scope:"customPlacement",object:"service",action:"enable",validators:{},handler:function(t){var n=t.account;return t.detail,t.customEvent,r(void 0,void 0,void 0,(function(){var t;return o(this,(function(e){switch(e.label){case 0:return $t(n,Qt,"service/enable"),n.update(Xt,(function(){return!1})),[4,Promise.all([n.recordListener(on).then((function(t){var e=t.placementResponse;fn(n,!0,e),n.update(tn,(function(){return e}))})),n.recordListener(sn).then((function(t){t.bidResponses.forEach((function(t){var e,i,r=null!==(i=null===(e=t.targeting)||void 0===e?void 0:e.amzniid)&&void 0!==i?i:t.amzniid,o=!1;if(""!==r){var a=n.use(Gt);a[r]=t,n.update(Gt,(function(){return a})),o=!0}fn(n,!1,{aps:[{active:o,dispatchEventOnValidBid:!0}]})}))})).then((function(){n.recordListenerNonBlocking(Yt)}))])];case 1:return e.sent(),[2,{status:S.completed,analytics:{browserInfo:Kt(n.globalContext.document,null===(t=n.globalContext.navigator)||void 0===t?void 0:t.connection,n.globalContext.innerWidth,n.globalContext.innerHeight)}}]}}))}))}});function fn(t,n,e){var i;if(!t.use(Xt)){var r=null===(i=null==e?void 0:e.aps)||void 0===i?void 0:i.find((function(t){return t.dispatchEventOnValidBid}));n&&void 0!==r||($t(t,Qt,"placementResponseEvent/dispatch"),t.record("customPlacement/placement/didRespond",e).catch((function(t){})),t.update(Xt,(function(){return!0})))}}var pn=new Map(c([],u(ot([Zt,sn,Yt,vn,on])),!1)),hn=function(t){function e(n){var e=t.call(this,n.message)||this;return e.message='Could not read vendor data because: "'.concat(n.message,'"'),e}return n(e,t),e}(Error),mn={key:"cxm/vendors",default:{}},wn={nonId:{noExtraDefaults:!0,source:"liveintent.com"},bidswitch:{source:"bidswitch.net"},openx:{source:"openx.net"},magnite:{source:"rubiconproject.com"},medianet:{source:"media.net"},pubmatic:{source:"pubmatic.com"},index:{source:"liveintent.indexexchange.com"},uid2:{source:"uidapi.com"}};function yn(t){var n=[],e={user:{ext:{eids:n}}};return Object.entries(wn).forEach((function(e){var i=e[0],r=e[1];if(void 0!==t[i]){var o={source:r.source,uids:[{id:t[i]}]};!0!==r.noExtraDefaults&&(o.uids[0].atype=3,o.uids[0].ext={provider:"liveintent.com"}),n.push(o)}})),e}var bn="cxm/liveintent/set",gn="cxm/arcspan/set",En="cxm/anomymised/set",_n=new Map([["cxm/vendors/set",function(t){var n=t.account;return r(void 0,void 0,void 0,(function(){return o(this,(function(t){switch(t.label){case 0:return[4,Promise.all([n.record(bn),n.record(gn),n.record(En)])];case 1:return t.sent(),[2,S.completed]}}))}))}],[bn,function(t){var n=t.account;return t.customEvent,r(void 0,void 0,void 0,(function(){var t;return o(this,(function(i){try{t=function(t){var n,e,i;try{i=t.readLocalStorage("__tamLIResolveResult")}catch(t){if(t instanceof Error)throw new hn(t)}if(null!=i&&(void 0===t.globalContext.liModuleEnabled&&(t.globalContext.liModuleEnabled=Math.random()<.95,null===(e=null===(n=t.globalContext)||void 0===n?void 0:n.googletag)||void 0===e||e.cmd.push((function(){t.globalContext.googletag.pubads().setTargeting("li-module-enabled",t.globalContext.liModuleEnabled?["on"]:["off"])}))),t.globalContext.liModuleEnabled)){var r=void 0;try{r=yn(JSON.parse(i))}catch(t){r=yn(JSON.parse(decodeURIComponent(i)))}if(void 0!==r)return{data:{default:r}}}}(n)}catch(t){if(t instanceof hn)return[2,{status:S.cancelled,analytics:{statusReason:t.message}}];throw t}return void 0===t?[2,S.cancelled]:(n.update(mn,(function(n){var i;return e(e({},n),((i={}).liveintent=t,i))})),[2,S.completed])}))}))}],[gn,function(t){var n=t.account;return r(void 0,void 0,void 0,(function(){var t;return o(this,(function(i){return t=function(t){var n=t.globalContext.arcobj1,e=t.globalContext.arcobj2,i=[],r=[],o=[];if(void 0!==n){if(void 0!==n.page_iab_codes.text&&(i=i.concat(n.page_iab_codes.text)),void 0!==n.page_iab_codes.images&&(i=i.concat(n.page_iab_codes.images)),void 0!==n.page_keywords){var a="string"==typeof n.page_keywords?n.page_keywords.split(","):n.page_keywords;o=o.concat(a),void 0!==(null==e?void 0:e.compcohorts)&&(o=o.concat(e.compcohorts))}void 0!==n.page_iab_newcodes.text&&(r=c([],u(new Set(c(c([],u(r),!1),u(n.page_iab_newcodes.text),!1))),!1)),void 0!==n.page_iab_newcodes.images&&(r=c([],u(new Set(c(c([],u(r),!1),u(n.page_iab_newcodes.images),!1))),!1));var d={name:"arcspan",segment:[],ext:{segtax:6}};r.forEach((function(t){d.segment=d.segment.concat({id:t})}));var s={data:[]};return s.data=s.data.concat(d),{data:{default:{site:{name:"arcspan",cat:i,sectioncat:i,pagecat:i,keywords:o.toString(),content:s,domain:new URL(t.globalContext.location.href).hostname,page:t.globalContext.location.href,ref:t.globalContext.document.referrer}}}}}}(n),void 0===t?[2,S.cancelled]:(n.update(mn,(function(n){return e(e({},n),{arcspan:t})})),[2,S.completed])}))}))}],[En,function(t){var n=t.account;return t.customEvent,r(void 0,void 0,void 0,(function(){var t;return o(this,(function(i){try{t=function(t){var n;try{n=t.readLocalStorage("cohort_ids")}catch(t){if(t instanceof Error)throw new hn(t)}if("string"==typeof n){for(var e=JSON.parse(n),i="",r=0;r1}(n))?[2,S.completed]:function(t){var n=t.read(at,{persist:!0});return void 0!==n&&new Date>=new Date(Number(n))}(n)?(function(t){t.delete(at,{persist:!0}),function(t){var n;null===(n=t.globalContext.apstagDEBUG)||void 0===n||delete n.url}(t)}(n),[2,S.completed]):(function(t){t.record(Ue).catch((function(t){})),t.record(Ve).catch((function(t){}))}(n),[2,S.waiting])}))}))}],["debug/listeners/show",function(t){var n=t.systemAccount;return r(void 0,void 0,void 0,(function(){var t,e;return o(this,(function(i){return t=n.store.get(s),e=c([],u(t.entries()),!1),console.groupCollapsed("⌂ Listeners"),console.table(e),console.groupEnd(),[2,S.completed]}))}))}]]),Je=[De],Be=new Map(c(c([],u(ze),!1),u(ot(Je)),!1));!function(t){t[t.unspecifiedUnknown=0]="unspecifiedUnknown",t[t.lowEntropy=1]="lowEntropy",t[t.highEntropy=2]="highEntropy"}(Xn||(Xn={}));var Ge=["brands","mobile","platform"],He=["architecture","bitness","fullVersionList","model","platformVersion"];function We(t,n,e){return r(this,void 0,void 0,(function(){var i;return o(this,(function(r){switch(r.label){case 0:return r.trys.push([0,2,,3]),[4,e.getHighEntropyValues(c(c([],u(Ge),!1),u(He),!1))];case 1:return i=r.sent(),t.write(n,JSON.stringify(Ke(i)),{persist:!0}),[3,3];case 2:return r.sent(),[3,3];case 3:return[2,S.completed]}}))}))}function Ke(t){var n,e,i,r={};return r.architecture=t.architecture,r.bitness=t.bitness,r.mobile=t.mobile?1:0,r.model=t.model,r.source=(i=t,He.some((function(t){return i[t]}))?Xn.highEntropy:Ge.some((function(t){return i[t]}))?Xn.lowEntropy:Xn.unspecifiedUnknown),"string"==typeof t.platform&&(r.platform={brand:t.platform,version:null===(n=t.platformVersion)||void 0===n?void 0:n.split(".")}),Array.isArray(t.fullVersionList)?e=t.fullVersionList:Array.isArray(t.brands)&&(e=t.brands),e instanceof Array&&(r.browsers=e.map((function(t){var n;return{brand:t.brand,version:null===(n=t.version)||void 0===n?void 0:n.split(".")}}))),r}var $e,Qe="deviceSignal/sua/set",Ye=new Map([[Qe,function(t){var n=t.account;return r(void 0,void 0,void 0,(function(){var t,e,i,r,a;return o(this,(function(o){switch(o.label){case 0:return t="deviceSignal/sua",e=null===(r=n.globalContext.navigator)||void 0===r?void 0:r.userAgentData,"string"==typeof(i=n.read(t,{persist:!0}))?n.write(t,i):e instanceof Object&&function(t,n,e){t.write(n,JSON.stringify(Ke(e)))}(n,t,e),!1!==(null===(a=n.globalContext.apstag)||void 0===a?void 0:a.isGDPRRegion)?[2,S.completed]:"function"!=typeof(null==e?void 0:e.getHighEntropyValues)?[3,2]:[4,We(n,t,e)];case 1:o.sent(),o.label=2;case 2:return[2,S.completed]}}))}))}]]),Ze={key:"deviceSignal/cookieDeprecationLabel",default:void 0},Xe=new rt({scope:"deviceSignal",object:"cookieDeprecationLabel",action:"set",handler:function(t){var n=t.account;return t.customEvent,r(void 0,void 0,void 0,(function(){var t,e;return o(this,(function(i){switch(i.label){case 0:return void 0===(null==(t=n.globalContext.navigator.cookieDeprecationLabel)?void 0:t.getValue)||"function"!=typeof t.getValue?[2,{status:S.cancelled}]:[4,n.executeFuncWithConsent(t,t.getValue)];case 1:return void 0===(e=i.sent())||""===e?[2,{status:S.cancelled}]:(n.update(Ze,(function(){return e})),[2,{status:S.completed,analytics:{gcdl:e}}])}}))}))}}),ti=ot([Xe]),ni={key:"_monitoring/statusesByEventIdentifier",default:new Map},ei=function(t){var n=t.account,e=t.customEvent;return r(void 0,void 0,void 0,(function(){var t,i,r,a,u;return o(this,(function(o){if(void 0===(t=null===(u=e.detail)||void 0===u?void 0:u.eventIdentifier))throw new Error("Missing eventIdentifier parameter");return i=n.use(ni),r="".concat(e.type,":").concat(t),void 0!==(a=i.get(r))?[2,a]:[2,S.waiting]}))}))},ii=function(t){var n=t.account,e=t.customEvent;return r(void 0,void 0,void 0,(function(){var t,i,r,a,u,c;return o(this,(function(o){if(void 0===(t=null===(a=e.detail)||void 0===a?void 0:a.eventIdentifier))throw new Error("Missing eventIdentifier parameter");if(void 0===(i=null===(u=e.detail)||void 0===u?void 0:u.statusUpdate))throw new Error("Missing statusUpdate parameter");if(!(i in S))throw new Error("Invalid statusUpdate parameter. Expected one of ".concat(Object.values(S).join(", ")));if(void 0===(r=null===(c=e.detail)||void 0===c?void 0:c.pairedEvents)||r.length<1||r.some((function(t){return"string"!=typeof t})))throw new Error("Parameter pairedEvents must be a non-empty array of string");return r.forEach((function(e){var r="".concat(e,":").concat(t);n.update(ni,(function(t){return t.set(r,i)}))})),[2,S.completed]}))}))},ri=new Map([["_monitor/testing/only",ei],["_update/testing/only",ii],["_legacy/bidRequest/monitor",ei],["_legacy/bidRequest/didComplete",ii]]),oi=new rt({scope:"prebid",object:"analyticsEvent",action:"track",handler:function(t){var n=t.account,i=t.customEvent;return r(void 0,void 0,void 0,(function(){var t,r,a,u,c,d,s;return o(this,(function(o){switch(o.label){case 0:return void 0===(null===(a=i.detail)||void 0===a?void 0:a.eventType)||void 0===(null===(u=i.detail)||void 0===u?void 0:u.eventArgs)||void 0===(null===(s=null===(d=null===(c=i.detail)||void 0===c?void 0:c.config)||void 0===d?void 0:d.options)||void 0===s?void 0:s.accountID)?[2,{status:S.cancelled}]:(t={eventType:i.detail.eventType,metadata:i.detail.metadata,config:i.detail.config},[4,n.globalContext.fetch("".concat("https://prod.us-east-1.cxm-bcn.publisher-services.amazon.dev/v1/events/prebid"),ai(i.detail))]);case 1:return(r=o.sent()).ok?[2,{status:S.completed,analytics:t}]:[2,{status:S.cancelled,analytics:e(e({},t),{message:"Request failed: ".concat(r.status)})}]}}))}))}}),ai=function(t){var n={accountId:t.config.options.accountID,events:[{eventArgs:t.eventArgs,eventType:t.eventType}]};return{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(n)}},ui={key:"prebid/config",default:void 0};!function(t){t.NotStarted="NOT STARTED",t.Loading="LOADING",t.Complete="COMPLETE"}($e||($e={}));var ci,di,si={key:"prebid/configRequestState",default:$e.NotStarted},li=new rt({scope:"prebid",object:"config",action:"fetch",handler:function(t){var n=t.account,i=t.customEvent;return r(void 0,void 0,void 0,(function(){var t,r,a,u,c,d,s,l,v;return o(this,(function(o){switch(o.label){case 0:if((t=n.use(si))===$e.Loading)return[2,{status:S.waiting}];if(r={metadata:null===(v=null==i?void 0:i.detail)||void 0===v?void 0:v.metadata},t===$e.Complete&&void 0!==(a=n.use(ui)))return[2,{status:S.completed,value:JSON.parse(a),analytics:r}];o.label=1;case 1:return o.trys.push([1,4,,5]),n.update(si,(function(){return $e.Loading})),u="".concat("https://c.amazon-adsystem.com/cdn/prod/config","?src=").concat(n.id),[4,n.globalContext.fetch(u)];case 2:return c=o.sent(),n.update(si,(function(){return $e.Complete})),c.ok?[4,c.json()]:[2,{status:S.cancelled,analytics:e(e({},r),{message:"Config request failed"})}];case 3:return d=o.sent(),s=vi(n,d),n.update(ui,(function(){return JSON.stringify(s)}),{persist:!0}),[2,{status:S.completed,value:s,analytics:r}];case 4:return l=o.sent(),[2,{status:S.cancelled,analytics:e(e({},r),{message:l.message})}];case 5:return[2]}}))}))}}),vi=function(t,n){var e,i,r,o;return{analyticsConfig:{options:{accountID:t.id,sampling:null===(e=n.pbjs)||void 0===e?void 0:e.sampleRate},includeEvents:null===(i=n.pbjs)||void 0===i?void 0:i.allowedEvents},idConfig:{params:{accountID:t.id,enabled:null===(r=n.pbjs)||void 0===r?void 0:r.enabled,treatments:null===(o=n.pbjs)||void 0===o?void 0:o.treatments}}}},fi={key:"prebid/eidsConfig",default:"{}"};!function(t){t.APSSignalIQ="_apsIdTreatment",t.Audigent="hadronId",t.ID5="id5id",t.Liveramp="idl_env",t.Lotame="lotamePanoramaId",t.Pubcommon="pubcid",t.Publink="publinkId",t.ThirtyThree="33acrossId",t.Yahoo="connectId"}(di||(di={}));var pi=new Map([[Nn,di.Audigent],["id5",di.ID5],[$n,di.Liveramp],[de,di.Lotame],[we,di.Pubcommon],[ge,di.Publink],[Pn,di.ThirtyThree],[xe,di.Yahoo]]),hi=((ci={})[di.Audigent]={source:"audigent.com",atype:1},ci[di.ID5]={source:"id5-sync.com",atype:1},ci[di.Liveramp]={source:"liveramp.com",atype:3},ci[di.Lotame]={source:"crwdcntrl.net",atype:1},ci[di.Pubcommon]={source:"pubcid.org",atype:1},ci[di.Publink]={source:"epsilon.com",atype:3},ci[di.ThirtyThree]={source:"33across.com",atype:1},ci[di.Yahoo]={source:"yahoo.com",atype:3},ci),mi=new rt({scope:"prebid",object:"eidsConfig",action:"get",handler:function(t){var n=t.account,i=t.customEvent;return r(void 0,void 0,void 0,(function(){var t,r,a,u;return o(this,(function(o){return void 0===(null===(r=n.globalContext.apstag)||void 0===r?void 0:r._atsaaiod)?[2,{status:S.waiting}]:(n.update(fi,(function(){return JSON.stringify(e({},hi))}),{persist:!0}),t={metadata:null===(a=null==i?void 0:i.detail)||void 0===a?void 0:a.metadata,config:null===(u=null==i?void 0:i.detail)||void 0===u?void 0:u.config},[2,{status:S.completed,analytics:t}])}))}))}}),wi=new Set(c(["CONTROL_HOLD_OUT","CLEAN"],u(pi.keys()),!1));var yi,bi={key:"prebid/ids",default:void 0},gi=new rt({scope:"prebid",object:"ids",action:"get",handler:function(t){var n=t.account,i=t.customEvent;return r(void 0,void 0,void 0,(function(){var t,r,c,d,s,l,v,f;return o(this,(function(o){switch(o.label){case 0:return void 0===(null===(s=n.globalContext.apstag)||void 0===s?void 0:s._atsaaiod)?[2,{status:S.waiting}]:(n.recordListenerNonBlocking(Pe),void 0!==(t=n.use(kn))&&(r=Object.fromEntries(Object.entries(t).map((function(t){var n=u(t,2),e=n[0],i=n[1];return[pi.get(e),i]})))),[4,n.recordListener(li,{metadata:null===(l=null==i?void 0:i.detail)||void 0===l?void 0:l.metadata})]);case 1:return c=o.sent(),d={metadata:null===(v=null==i?void 0:i.detail)||void 0===v?void 0:v.metadata},null!==(f=c.idConfig.params.enabled)&&void 0!==f&&f?(null!=c.idConfig.params.treatments&&(r=function(t,n){if(!function(t){var n=t.reduce((function(t,n){return t+n.percent}),0),e=100===n,i=t.reduce((function(t,n){var e=n.treatment;return t&&wi.has(e)}),!0);return e&&i}(n))return t;var i=function(t){var n,e,i=100*Math.random(),r=0;try{for(var o=a(t),u=o.next();!u.done;u=o.next()){var c=u.value;if(i<=(r+=c.percent))return c.treatment}}catch(t){n={error:t}}finally{try{u&&!u.done&&(e=o.return)&&e.call(o)}finally{if(n)throw n.error}}throw new Error("Invalid treatment percentages")}(n);return function(t,n){var i,r=((i={})[di.APSSignalIQ]=n,i),o=pi.get(n);switch(n){case"CONTROL_HOLD_OUT":return e(e({},t),r);case"CLEAN":return r;default:return void 0!==o&&void 0!==(null==t?void 0:t[o])&&(r[o]=t[o]),r}}(t,i)}(r,c.idConfig.params.treatments)),n.update(bi,(function(){return r})),[2,{status:S.completed,value:r,analytics:d}]):[2,{status:S.cancelled,analytics:d}]}}))}))}}),Ei=ot([oi,li,mi,gi]),_i=function(t){return t===yi.noConsent?"AMZN-NoCookieConsent":"AMZN-Token"};!function(t){t[t.noConsent=0]="noConsent",t[t.token=1]="token"}(yi||(yi={}));var ki,Si,Ri=function(t){t.setCookieStorage(_i(yi.token),"",0),t.setCookieStorage(_i(yi.noConsent),"",0)},Ai=function(t){var n=t.account,e=t.hashedRecords,i=t.ttl,r=t.isGDPRRegion,o=t.tcString,a=t.setToken;return Ri(n),"boolean"!=typeof a&&(a=!0),ji({account:n,hashedRecords:e,ttl:i,isGDPRRegion:r,tcString:o}).then((function(t){var e=t.AIPToken,i=t.cookieExpiry;return xi({AIPToken:e,cookieExpiry:i,account:n,setToken:a})}))},ji=function(t){var n=t.account,e=t.hashedRecords,i=t.ttl,r=t.isGDPRRegion,o=t.tcString;return fetch("https://tk.amazon-adsystem.com/envelope",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(Ii({account:n,hashedRecords:e,ttl:i,isGDPRRegion:r,tcString:o}))}).then((function(t){if(!t.ok)throw new Error("Token http status error: ".concat(t.status));return t.json()}))},xi=function(t){var n=t.AIPToken,e=t.cookieExpiry,i=t.account,r=t.setToken;if("string"!=typeof n||"number"!=typeof e)throw new Error("Invalid AIPES response");if(""===n)throw i.setCookieStorage(_i(yi.noConsent),"1",e),new Error("Empty token");(r||"boolean"!=typeof r)&&i.setCookieStorage(_i(yi.token),n,e)},Ii=function(t){var n=t.account,e=t.hashedRecords,i=t.ttl,r=t.isGDPRRegion,o=t.tcString,a={publisherId:n.id,hashedRecords:e};return void 0!==i&&(a.ttl=i),r?(a.gdpr=1,o&&(a.gdprConsent=o)):a.gdpr=0,a},Oi=new rt({scope:"ad",object:"record",action:"delete",handler:function(t){var n=t.account;return r(void 0,void 0,void 0,(function(){var t;return o(this,(function(e){if(!(null===(t=n.globalContext.apstag)||void 0===t?void 0:t._atsaaiod))return[2,{status:S.waiting}];if(!n.isAllowedToAccessInfoOnDevice())throw new Error("Not allowed to access storage on device");return Ri(n),[2,{status:S.completed}]}))}))}}),Ci={detail:Q,"detail.setCookie":tt($),"detail.config":Q,"detail.config.optOut":tt($),"detail.config.ttl":tt(W),"detail.config.gdpr":tt(Q),"detail.config.gdpr.cmpTimeout":tt(W),"detail.config.gdpr.enabled":tt(et),"detail.config.gdpr.consent":tt(K),"detail.config.gdpr.cmpGlobal":tt(K),"detail.config.gdpr.cmpGlobalv2":tt(K),"detail.config.hashedRecords":Y,"detail.config.hashedRecords[]":Q,"detail.config.hashedRecords[].type":K,"detail.config.hashedRecords[].record":K,"detail.config.hashedRecords[].encrypted":tt(W),"detail.config.hashedRecords[].toJSON":et,"detail.config.hashedRecords[].$$typeof":et,"detail.config.hashedRecords[].constructor":et,"detail.config.hashedRecords[].tagName":et,"detail.config.hashedRecords[].@@__IMMUTABLE_ITERABLE__@@":et,"detail.config.hashedRecords[].@@__IMMUTABLE_RECORD__@@":et},Pi=new rt({scope:"ad",object:"record",action:"renew",validators:{detail:Ci,context:{context:Q}},handler:function(t){var n=t.account,e=t.detail;return r(void 0,void 0,void 0,(function(){var t,i,r;return o(this,(function(o){switch(o.label){case 0:if(!(null===(r=n.globalContext.apstag)||void 0===r?void 0:r._atsaaiod))return[2,{status:S.waiting}];if(void 0===(null==e?void 0:e.config))throw new Error("Missing tokenConfig object");if(!n.isAllowedToAccessInfoOnDevice())throw new Error("Not allowed to access storage on device");return t=n.globalContext.apstag.isGDPRRegion,i=n.use(D),[4,(a={account:n,hashedRecords:e.config.hashedRecords,ttl:e.config.ttl,isGDPRRegion:t,tcString:null==i?void 0:i.tcString},Ai(a))];case 1:return o.sent(),[2,{status:S.completed}]}var a}))}))}});!function(t){t.email="email"}(ki||(ki={})),function(t){t.Display="display",t.Video="video",t.MultiFormat="multi-format"}(Si||(Si={}));var Mi,Ti=/^[0-9a-fA-F]{64}$/,Ni=function(t){return Ti.test(t||"")},Di=function(t){return t.then((function(t){return Array.from(new Uint8Array(t)).map((function(t){return t.toString(16).padStart(2,"0")})).join("")})).then((function(t){return"e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855"!==t?t:""}))},Ui=function(t,n){return"string"==typeof t&&(n===ki.email?/\S+@\S+\.\S+/.test(t)||Ni(t):t.trim().length>0)},Li=function(t,n,e){return n instanceof HTMLInputElement||n instanceof HTMLTextAreaElement?Ui(n.value,e)?Di(t.globalContext.crypto.subtle.digest("SHA-256",(new t.globalContext.TextEncoder).encode(n.value||""))):Promise.resolve(""):Ui(n.innerText,e)?Di(t.globalContext.crypto.subtle.digest("SHA-256",(new t.globalContext.TextEncoder).encode(n.innerText||""))):Promise.resolve("")};!function(t){t.LOCAL_STORAGE="LOCAL",t.CSS_SELECTOR="CSS",t.URL="URL"}(Mi||(Mi={}));var qi=function(t,n,e){var i,r;void 0===n&&(n={}),function(t){var n,e=((n={})[Mi.LOCAL_STORAGE]=5,n[Mi.URL]=4,n[Mi.CSS_SELECTOR]=3,n),i={};t.forEach((function(t){i[t.method]=(i[t.method]||0)+1,t.priority=i[t.method]})),t.sort((function(t,n){return t.method===n.method?(t.priority||0)>(n.priority||0)?1:-1:e[t.method]>e[n.method]?-1:1}))}(n.methods||[]);var o,u=[],c=function(n){var i=n.method,r=n.target,a=n.type,c="";switch(i){case Mi.LOCAL_STORAGE:c=function(t,n,e){var i=t.readLocalStorage(n);return i&&Ui(i,e)?i:""}(t,r,a);break;case Mi.URL:u.push(function(t,n,e){e=null!=e?e:t.globalContext.location.href,n=n.replace(/[[\]]/g,"\\$&");var i=new RegExp("[?&#]"+n+"(=([^&#?]*)|&|#|$)").exec(e);return Array.isArray(i)&&"string"==typeof i[2]&&0!==decodeURIComponent(i[2].replace(/\+/g," ")).trim().length&&Ni(decodeURIComponent(i[2].replace(/\+/g," ")))?Promise.resolve(decodeURIComponent(i[2].replace(/\+/g," "))):new Promise((function(t){return t("")}))}(t,r).then((function(t){return{type:a,value:t}})));break;case Mi.CSS_SELECTOR:o=n}if(c.length>0)return e({value:c,type:a}),{value:void 0}};try{for(var d=a(n.methods||[]),s=d.next();!s.done;s=d.next()){var l=c(s.value);if("object"==typeof l)return l.value}}catch(t){i={error:t}}finally{try{s&&!s.done&&(r=d.return)&&r.call(d)}finally{if(i)throw i.error}}var v=function(){if(o&&(!0===o.isGlobalSubmit||"string"==typeof o.eventTarget&&"string"==typeof o.event)){var n=o.eventTarget,i=o.target,r=o.type,u=o.isGlobalSubmit,c=u?"submit":o.event;if("string"==typeof c&&0!==c.length){var d=function(o){return function(t){var n,e=t.account,i=t.e,r=t.eventTarget,o=t.event,u=t.isGlobalSubmit,c=t.target,d=t.type,s=t.onDone,l=t.listener;u||"window"===r||i.target&&"function"==typeof i.target.matches&&"string"==typeof r&&i.target.matches(r)?(u&&i instanceof Event&&i.target&&(n=i.target.querySelectorAll('input[type="email"]')),function(t,n,e,i){var r,o,u=i||t.globalContext.document.querySelectorAll(n);if(0===u.length)return new Promise((function(t){return t("")}));if(1===u.length)return Li(t,u[0],e);var c=[];try{for(var d=a(u),s=d.next();!s.done;s=d.next()){var l=s.value;c.push(Li(t,l,e))}}catch(t){r={error:t}}finally{try{s&&!s.done&&(o=d.return)&&o.call(d)}finally{if(r)throw r.error}}return Promise.all(c).then((function(t){var n,e,i=null;try{for(var r=a(t),o=r.next();!o.done;o=r.next()){var u=o.value;if(""!==u){if(null!==i&&("string"!=typeof i||i!==u))return"";i=u}}}catch(t){n={error:t}}finally{try{o&&!o.done&&(e=r.return)&&e.call(r)}finally{if(n)throw n.error}}return null!=i?i:""}))}(e,c,d,n).then((function(t){"function"==typeof l&&e.globalContext.removeEventListener(o,l),s(!(t.length<1)&&{value:t,type:d})}))):s(!1)}({account:t,e:o,event:c,eventTarget:n,isGlobalSubmit:u,target:i,type:r,onDone:e,listener:d})};t.globalContext.addEventListener(c,d)}else e(!1)}else e(!1)};if(0!==u.length)return Promise.all(u).then((function(t){var n,i;try{for(var r=a(t),o=r.next();!o.done;o=r.next()){var u=o.value;if(u.value.length>0)return void e(u)}}catch(t){n={error:t}}finally{try{o&&!o.done&&(i=r.return)&&i.call(r)}finally{if(n)throw n.error}}v()}));v()},Vi={called:!1};function Fi(t,n){return new Promise((function(e,i){if(Vi.called&&!n.overrideLimit)throw new Error("rr should only be called once per page load");Vi.called=!0;var r=0,o=function(){var a=function(){var r,o,a=t.use(D);return(!(null===(r=t.globalContext.apstag)||void 0===r?void 0:r.isGDPRRegion)||void 0!==a)&&(void 0===a||t.isAllowedToAccessInfoOnDevice()?(null===(o=qi(t,n,(function(n){if(!1===n)return e("no retrieval");Ai({account:t,hashedRecords:[{type:n.type,record:n.value}],source:"rr",tcString:null==a?void 0:a.tcString}).then((function(){e("token generated")})).catch(i)})))||void 0===o||o.catch(i),!0):"canceled")}(),u=r>6400;if(a||u)return"canceled"===a&&i(new Error("tcf timeout")),void(u&&i(new Error("interval over")));setTimeout(o,r),r=0===r?200:2*r};o()}))}var zi=new rt({scope:"ad",object:"record",action:"rr",validators:{detail:{detail:Q,"detail.config":Q,"detail.config.constructor":et,"detail.config.$$typeof":et,"detail.config.tagName":et,"detail.config.@@__IMMUTABLE_ITERABLE__@@":et,"detail.config.@@__IMMUTABLE_RECORD__@@":et,"detail.config.accountID":tt(K),"detail.config.overrideLimit":tt($),"detail.config.methods":Y,"detail.config.methods[].tagName":et,"detail.config.methods[]":X(Q),"detail.config.methods[].$$typeof":et,"detail.config.methods[].constructor":et,"detail.config.methods[].@@__IMMUTABLE_ITERABLE__@@":et,"detail.config.methods[].@@__IMMUTABLE_RECORD__@@":et,"detail.config.methods[].type":Z(Object.values(ki)),"detail.config.methods[].method":Z(Object.values(Mi)),"detail.config.methods[].target":tt(K),"detail.config.methods[].event":tt(K),"detail.config.methods[].eventTarget":tt(K),"detail.config.methods[].isGlobalSubmit":tt($),"detail.config.methods[].priority":tt(W)},context:{context:Q,"context.Promise":nt,"context.crypto":Q,"context.crypto.subtle":nt}},handler:function(t){var n=t.account,e=t.detail;return r(void 0,void 0,void 0,(function(){var t,i;return o(this,(function(r){switch(r.label){case 0:if(!(null===(i=n.globalContext.apstag)||void 0===i?void 0:i._atsaaiod))return[2,{status:S.waiting}];if(!n.isAllowedToAccessInfoOnDevice())throw new Error("Not allowed to access storage on device");return[4,Fi(n,e.config)];case 1:return t=r.sent(),[2,{status:S.completed,analytics:{rr:t}}]}}))}))}}),Ji=new rt({scope:"ad",object:"record",action:"update",validators:{detail:Ci,context:{context:Q}},handler:function(t){var n=t.account,e=t.detail;return r(void 0,void 0,void 0,(function(){var t,i,r;return o(this,(function(o){switch(o.label){case 0:if(!(null===(r=n.globalContext.apstag)||void 0===r?void 0:r._atsaaiod))return[2,{status:S.waiting}];if(!n.isAllowedToAccessInfoOnDevice())throw new Error("Not allowed to access storage on device");return t=n.globalContext.apstag.isGDPRRegion,i=n.use(D),e.config.optOut?(Ri(n),[3,3]):[3,1];case 1:return[4,Ai({account:n,hashedRecords:e.config.hashedRecords,ttl:e.config.ttl,isGDPRRegion:t,tcString:null==i?void 0:i.tcString,setToken:null==e?void 0:e.setCookie})];case 2:o.sent(),o.label=3;case 3:return[2,{status:S.completed}]}}))}))}}),Bi=ot([Oi,Pi,zi,Ji]),Gi=new Map([["ad/ASRSlot/render",function(t){var n=t.account,e=t.customEvent;return r(void 0,void 0,void 0,(function(){var t,i;return o(this,(function(r){if(void 0===(null===(t=e.detail)||void 0===t?void 0:t.id)||void 0===(null===(i=e.detail)||void 0===i?void 0:i.targeting))throw new Error("Missing event detail");return function(t,n,e,i){var r,o,a,u=e.globalContext.document.createElement("iframe"),c=null===(r=n.get("amznsz"))||void 0===r?void 0:r.split("x"),d=n.get("amzniid"),s=t;if(!(void 0===d||void 0===s||void 0===c||c.length<2)){u.style.marginLeft="0",u.style.marginTop="0",u.style.height="".concat(c[1],"px"),u.style.width="100%",u.setAttribute("scrolling","no"),u.setAttribute("frameborder","0");var l=e.globalContext.document.createElement("div"),v=null!==(o=null==i?void 0:i.location)&&void 0!==o?o:"afterend",f=e.globalContext.document.getElementById(s);if(null!=f){f.insertAdjacentElement(v,l),l.appendChild(u);var p=null===(a=null==u?void 0:u.contentWindow)||void 0===a?void 0:a.document;void 0!==p&&(p.open(),p.write('