/*! @amzn/apswebapstaglibrary - web-client-bundle - v24.1107.1713 - 2024-11-07 17:13:35 */ !function(){"use strict";var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};function e(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function o(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(o.prototype=n.prototype,new o)}var n=function(){return n=Object.assign||function(t){for(var e,n=1,o=arguments.length;n=0;c--)(r=t[c])&&(a=(i<3?r(a):i>3?r(e,n,a):r(e,n))||a);return i>3&&a&&Object.defineProperty(e,n,a),a}function i(t,e,n,o){return new(n||(n=Promise))((function(r,i){function a(t){try{s(o.next(t))}catch(t){i(t)}}function c(t){try{s(o.throw(t))}catch(t){i(t)}}function s(t){var e;t.done?r(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,c)}s((o=o.apply(t,e||[])).next())}))}function a(t,e){var n,o,r,i={label:0,sent:function(){if(1&r[0])throw r[1];return r[1]},trys:[],ops:[]},a=Object.create(("function"==typeof Iterator?Iterator:Object).prototype);return a.next=c(0),a.throw=c(1),a.return=c(2),"function"==typeof Symbol&&(a[Symbol.iterator]=function(){return this}),a;function c(c){return function(s){return function(c){if(n)throw new TypeError("Generator is already executing.");for(;a&&(a=0,c[0]&&(i=0)),i;)try{if(n=1,o&&(r=2&c[0]?o.return:c[0]?o.throw||((r=o.return)&&r.call(o),0):o.next)&&!(r=r.call(o,c[1])).done)return r;switch(o=0,r&&(c=[2&c[0],r.value]),c[0]){case 0:case 1:r=c;break;case 4:return i.label++,{value:c[1],done:!1};case 5:i.label++,o=c[1],c=[0];continue;case 7:c=i.ops.pop(),i.trys.pop();continue;default:if(!(r=i.trys,(r=r.length>0&&r[r.length-1])||6!==c[0]&&2!==c[0])){i=0;continue}if(3===c[0]&&(!r||c[1]>r[0]&&c[1]=t.length&&(t=void 0),{value:t&&t[o++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}function s(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var o,r,i=n.call(t),a=[];try{for(;(void 0===e||e-- >0)&&!(o=i.next()).done;)a.push(o.value)}catch(t){r={error:t}}finally{try{o&&!o.done&&(n=i.return)&&n.call(i)}finally{if(r)throw r.error}}return a}function u(t,e,n){if(n||2===arguments.length)for(var o,r=0,i=e.length;r=0&&t<=1?t:1};"number"==typeof(null==t?void 0:t.error)&&this._sampleRates.set("error",e(t.error)),"number"==typeof(null==t?void 0:t.feat)&&this._sampleRates.set("feat",e(t.feat))},t.prototype.clearAndUpdateEventProcessingInterval=function(t){var e=this;"number"!=typeof t||t<=0||t!==this._intervalDelayInMs&&(clearInterval(this._intervalId),this._intervalId=setInterval((function(){try{e.processEventRecords()}catch(t){}}),t),this._intervalDelayInMs=t)},t.prototype.processEventRecords=function(){for(var t=[],e=Array.from(this._recordQueues.keys()),n=function(n){var r=e[n],i=o._recordQueues.get(r),a=o._sampleRates.get(r);if(void 0===i||i.length<=0)return"continue";if(void 0===a||0===a)return i.length>=o._queueLimit&&(i.length=0,o.logEvent({eventCategory:r,eventName:"queue limit reached"})),"continue";var c=i.filter((function(t){return void 0!==t&&a>=Math.random()}));i.length=0,t.push.apply(t,u([],s(c),!1))},o=this,r=0;rthis.STACK_MAX_LENGTH){var e="[...]";return t.stack.substring(0,this.STACK_MAX_LENGTH-e.length)+e}return t.stack}catch(t){return"NO STACK: ERROR ON RETRIEVAL"}},t.prototype.getErrorName=function(t){var e="unknown";try{"string"==typeof t?e=t:void 0!==t.name&&(e=t.name)}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.prototype.getErrorMessage=function(t){var e="unknown";try{"string"==typeof t?e=t:void 0!==t.message&&(e=t.message)}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.prototype.getErrorContext=function(t){var e,n="unknown";try{"string"!=typeof t&&"context"in t&&(n=null!==(e=t.context)&&void 0!==e?e:"")}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}(),A=new _;!function(t){t.push="push",t.listenerSuccess="listenerSuccess",t.direct="direct"}(b||(b={})),function(t){t.internal="internal",t.apstag="apstag",t.webpage="webpage",t.dtbm="dtbm"}(w||(w={})),function(t){t.completed="completed",t.waiting="waiting",t.cancelled="cancelled"}(E||(E={})),function(t){t.started="started",t.error="error",t.unknown="unknown",t.deactivated="deactivated"}(C||(C={}));var I=n(n({},E),C),k=new Map([["_config/config/didLoad",function(t){var e=t.account;return t.customEvent,i(void 0,void 0,void 0,(function(){return a(this,(function(t){return e.write("config/loaded",!0),[2,E.completed]}))}))}],["_config/requestViewerCountry/define",function(t){var e=t.account,n=t.customEvent;return i(void 0,void 0,void 0,(function(){var t,o;return a(this,(function(r){if(void 0===(null===(o=n.detail)||void 0===o?void 0:o.code))throw new Error("Missing country code");if("string"!=typeof(t=n.detail.code)||0===t.trim().length)throw new Error('Invalid country code: "'.concat(t,'"'));return e.update(S,(function(){return t})),[2,E.completed]}))}))}]]),P="apstag/configuration/fetch",L=new Map([[P,function(t){var e=t.account;return t.customEvent,i(void 0,void 0,void 0,(function(){var t;return a(this,(function(n){switch(n.label){case 0:return(t=e.globalContext.document.createElement("script")).setAttribute("src","".concat("https://config.aps.amazon-adsystem.com/configs/").concat(e.id)),t.setAttribute("type","text/javascript"),t.setAttribute("async","async"),e.globalContext.document.head.appendChild(t),[4,new Promise((function(e,n){t.addEventListener("load",(function(){e()})),t.addEventListener("error",(function(t){n(t)}))}))];case 1:return n.sent(),[2,E.completed]}}))}))}]]),R="consent/GPPData",j="consent/isGPPListenerRegistered",D={key:"consent/isTCFAPIListenerRegistered",default:!1},N={key:"consent/TCData",default:void 0};function O(t,e){var n,o;return"string"==typeof(null==e?void 0:e.tcString)&&(null==e?void 0:e.tcString.length)>0||!0===(null===(o=null===(n=null==t?void 0:t.globalContext)||void 0===n?void 0:n.apstag)||void 0===o?void 0:o.isGDPRRegion)||!0===(null==e?void 0:e.gdprApplies)}function M(t,e){var n,o,r,i,a;return!0===(null===(o=null===(n=t.vendor)||void 0===n?void 0:n.consents)||void 0===o?void 0:o[793])&&(i=e,a=null===(r=t.purpose)||void 0===r?void 0:r.consents,(null!=i?i:[]).reduce((function(t,e){return t&&!0===(null==a?void 0:a[e])}),!0))}var T=function(t,e){var o={tcData:e,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 e,n=t.account,o=t.tcData,r=t.consents;if(!O(n,o))return!0;if("object"!=typeof o)return!1;if((null!==(e=o.tcfPolicyVersion)&&void 0!==e?e:0)<2)return!1;if(o.useNonStandardStacks)return!1;if(!o.isServiceSpecific)return!1;var i=!1;return r.forEach((function(t){var e,n,a;switch(null===(a=null===(n=null===(e=o.publisher)||void 0===e?void 0:e.restrictions)||void 0===n?void 0:n[t])||void 0===a?void 0:a[793]){case 0:case 2:i=!0;break;default:M(o,r)||(i=!0)}})),!i}(n(n({},o),{account:t}))})),tcCF:r((function(){return 0===function(t){var e,n=t.tcData,o=t.consents;if(0===(null!=o?o:[]).length)return["No consents param passed"];var r=[];try{if("object"!=typeof n){var i="";try{i=JSON.stringify(n)}catch(t){}r.push("Invalid tcData: ".concat(i))}return!1===n.gdprApplies?[]:((null!==(e=n.tcfPolicyVersion)&&void 0!==e?e:0)<2&&r.push("tcData version not supported: ".concat(n.tcfPolicyVersion)),n.useNonStandardStacks&&r.push("tcData's useNonStandardStacks should not be true"),n.isServiceSpecific||r.push("tcData needs to be service specific"),o.forEach((function(t){var e,i,a;switch(null===(a=null===(i=null===(e=n.publisher)||void 0===e?void 0:e.restrictions)||void 0===i?void 0:i[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:M(n,o)||r.push("Invalid publisher restrictions default, consent ".concat(t))}})),r)}catch(t){if(r.length>0)return r;throw t}}(o).length})),PRA:r((function(){return O(t,e)}))}},U={consent_gppapi_attemptSync:"consent/gppapi/attemptSync",consent_gppapi_didChange:"consent/gppapi/didChange",consent_gppapi_syncData:"consent/gppapi/syncData",consent_tcfapi_attemptSync:"consent/tcfapi/attemptSync",consent_tcfapi_didChange:"consent/tcfapi/didChange"},q=new Map([[U.consent_gppapi_attemptSync,function(t){var e=t.account;return i(void 0,void 0,void 0,(function(){var t;return a(this,(function(n){switch(n.label){case 0:return void 0===e.globalContext.__gpp||!0===e.read(j)?[2,E.cancelled]:[4,e.record(U.consent_gppapi_syncData)];case 1:return n.sent(),t=e.globalContext.__gpp("addEventListener",(function(t){"error"!==(null==t?void 0:t.eventName)&&e.record(U.consent_gppapi_didChange,{eventListener:t,fromAddEvent:!0}).catch((function(t){}))})),e.write(j,"listenerRegistered"===(null==t?void 0:t.eventName)&&!0===(null==t?void 0:t.data)),[2,E.completed]}}))}))}],[U.consent_gppapi_didChange,function(t){var e=t.account,n=t.customEvent;return i(void 0,void 0,void 0,(function(){var t,o;return a(this,(function(r){switch(r.label){case 0:return[4,e.record(U.consent_gppapi_syncData,{eventListener:null===(t=n.detail)||void 0===t?void 0:t.eventListener,fromAddEvent:null===(o=n.detail)||void 0===o?void 0:o.fromAddEvent})];case 1:return r.sent(),[2,E.completed]}}))}))}],[U.consent_gppapi_syncData,function(t){var e=t.account,o=t.customEvent;return i(void 0,void 0,void 0,(function(){var t,r,i,c,u,l,d,v,f,p,g,h,m,y,b;return a(this,(function(a){return(null!==(g=null===(p=null===(f=null===(v=o.detail)||void 0===v?void 0:v.eventListener)||void 0===f?void 0:f.pingData)||void 0===p?void 0:p.gppString)&&void 0!==g?g:"").length>0?(t=null===(m=null===(h=o.detail)||void 0===h?void 0:h.eventListener)||void 0===m?void 0:m.pingData,c="addEventListener"):(l=s(function(t){var e,n,o;try{var r=t.globalContext.__gpp("ping",(function(t,e){e&&"object"==typeof t&&(n=t)}));void 0===n&&(null!==(e=null==r?void 0:r.gppString)&&void 0!==e?e:"").length>0&&(n=r)}catch(t){o="E:ping: ".concat(t)}return[n,o]}(e),2),t=l[0],i=l[1],c="ping","object"!=typeof t&&(d=s(function(t){var e,o;try{var r=t.globalContext.__gpp("getGPPData");e=n(n({},r),r.pingData)}catch(t){o="E:getGPPData: ".concat(t)}return[e,o]}(e),2),t=d[0],r=d[1],c="getGPPData")),u={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:i,gppVersion:null==t?void 0:t.gppVersion,cmpId:null==t?void 0:t.cmpId,method:c,fromAddEvent:null===(b=o.detail)||void 0===b?void 0:b.fromAddEvent}},e.write(R,t),[2,{status:E.completed,analytics:u}]}))}))}],[U.consent_tcfapi_attemptSync,function(t){var e=t.account;return i(void 0,void 0,void 0,(function(){var t;return a(this,(function(n){return t=e.use(D),void 0===e.globalContext.__tcfapi||t?[2,E.cancelled]:(e.globalContext.__tcfapi("addEventListener",2,(function(t,n){e.record(U.consent_tcfapi_didChange,{tcData:t,success:n}).catch((function(t){}))})),[2,E.completed])}))}))}],[U.consent_tcfapi_didChange,function(t){var e=t.account,n=t.customEvent;return i(void 0,void 0,void 0,(function(){var t,o,r,i;return a(this,(function(a){return t=null===(r=n.detail)||void 0===r?void 0:r.success,e.update(D,(function(e){return e||!0===t})),o=null===(i=n.detail)||void 0===i?void 0:i.tcData,e.update(N,(function(e){return void 0!==o||!0===t?o:e})),"object"!=typeof o?[2,E.completed]:[2,{status:E.completed,analytics:T(e,o)}]}))}))}]]);function z(t,e,o,r){void 0===o&&(o="root"),void 0===r&&(r=".");var i={set:function(t,e){throw new Error('Cannot set property "'.concat(String(e),'": object is read-only'))},deleteProperty:function(t,e){throw new Error('Cannot delete property "'.concat(String(e),'": object is read-only'))},defineProperty:function(t,e){throw new Error('Cannot define property "'.concat(String(e),'": object is read-only'))},setPrototypeOf:function(t){throw new Error("Cannot set prototype: object is read-only")}},a=e[o];if(void 0===a)throw new Error('Unauthorized usage for "'.concat(o,'": No validator has been defined'));if(null===a)return t;try{a(t,o)}catch(t){throw new Error('Validation failed for "'.concat(o,'": ').concat(t.message))}if(t instanceof Set)return t.forEach((function(t){z(t,e,"".concat(o,".value"))})),t;if(t instanceof Map)return t.forEach((function(t,n){z(n,e,"".concat(o,".key")),z(t,e,"".concat(o,".value"))})),t;if(Array.isArray(t))return t.map((function(t){return z(t,e,"".concat(o,"[]"))}));if("function"==typeof t)return new Proxy(t,{apply:function(t,n,r){return z(t.apply(n,r),e,"".concat(o,"()"))}});try{var c=n(n({},i),{get:function(t,n,i){var a=Reflect.get(t,n,i);return"asymmetricMatch"===n||"symbol"==typeof n?a:z(a,e,"".concat(o).concat(r).concat(String(n)))}});return new Proxy(t,c)}catch(e){return t}}var B=function(t){if("number"!=typeof t)throw new Error("must be a number")},F=function(t){if("boolean"!=typeof t)throw new Error("must be a boolean")},H=function(t){if("object"!=typeof t||null===t||Array.isArray(t))throw new Error("must be a standard object")};function J(t){return function(e,n){if(t===W)throw new Error("isAny cannot be used within isOptional");null!=e&&t(e,n)}}var W=function(){},V=function(){function t(t){var e=t.scope,n=t.object,o=t.action,r=t.validators,i=t.handler;this.throwIfInvalid(e,n,o),this.name="".concat(e,"/").concat(n,"/").concat(o),this.handler=this.wrapHandler(i,r)}return t.prototype.wrapHandler=function(t,e){var o=this;return function(r){return i(o,void 0,void 0,(function(){var o,i;return a(this,(function(a){switch(a.label){case 0:return o=n(n({},o=r),{detail:z(o.customEvent.detail,null!==(i=null==e?void 0:e.detail)&&void 0!==i?i:{detail:W},"detail")}),[4,t(o)];case 1:return[2,a.sent()]}}))}))}},t.prototype.throwIfInvalid=function(t,e,n){var o=/^[a-z0-9][a-zA-Z0-9]*$/;if(!o.test(t)||!o.test(e)||!o.test(n))throw new Error("scope, object, and action must be alphanumeric and start with a lowercase. Received: ".concat(t,", ").concat(e,", ").concat(n));if(/[A-Z]/.test(n)&&!/^(will|did)/i.test(n))throw new Error("action must be a single verb (or a single verb prefixed by 'will' or 'did'). Received: ".concat(n))},t}();function G(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 Q="debugSession/end",K="prepend/events",Y="populator/ran",X={key:"consent/hasPurposeOneConsent",default:!1},Z=function(){function t(t){var e=this;this.getItem=function(t){var n=e.globalContext.document.cookie.split("; ").reduce((function(e,n){var o=n.split("=");return o[0]===t?decodeURIComponent(o.slice(1).join("=")):e}),"");return n.length>0?n:null},this.removeItem=function(t,n){void 0===n&&(n="/"),e.setItem(t,"",0,n)},this.setItem=function(t,n,o,r){void 0===r&&(r="/");var i=new Date(o);if(!e.isValidDate(i))throw new Error("Invalid expiration date");e.globalContext.document.cookie="".concat(t,"=").concat(n,"; expires=").concat(i.toUTCString(),"; path=").concat(r,";")},this.globalContext=t}return t.prototype.isValidDate=function(t){return t instanceof Date&&!isNaN(t)},t}(),$=["scope/objectName",Q,K];function tt(t){return null===t||"object"!=typeof t?t:t instanceof Date?new Date(t.getTime()):t instanceof Array?t.reduce((function(t,e){return t.push(tt(e)),t}),[]):t instanceof Set?Array.from(t.values()).reduce((function(t,e){return t.add(tt(e)),t}),new Set):t instanceof Map?Array.from(t.entries()).reduce((function(t,e){return t.set(e[0],tt(e[1])),t}),new Map):t instanceof Object?Object.keys(t).reduce((function(e,n){return e[n]=tt(t[n]),e}),{}):t}var et=function(){function t(t,e){var n,o,r=null!==(n=null==e?void 0:e.rootName)&&void 0!==n?n:yt.rootName;this.globalContext=null!==(o=null==e?void 0:e.globalContext)&&void 0!==o?o:yt.globalContext;var i=this.globalContext[r].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,e){return i(this,void 0,void 0,(function(){var o=this;return a(this,(function(r){switch(r.label){case 0:return[4,new Promise((function(r,i){o.queue.push(new CustomEvent(t,{detail:n({resolve:r,reject:i,source:w.internal},e)}))}))];case 1:return[2,r.sent()]}}))}))},t.prototype.recordListener=function(t,e){return i(this,void 0,void 0,(function(){var o=this;return a(this,(function(r){switch(r.label){case 0:return[4,new Promise((function(r,i){o.queue.push(new CustomEvent(t.name,{detail:n({resolve:r,reject:i,source:w.internal},e)}))}))];case 1:return[2,r.sent()]}}))}))},t.prototype.recordListenerNonBlocking=function(t,e){this.recordListener(t,e).catch((function(t){}))},t.prototype.read=function(t,e){var n,o,r,i,a=this.store.get(t);if(void 0!==a)return a;if(void 0!==(null==e?void 0:e.persist)&&e.persist){var c=this.readLocalStorage(t,{usePrefix:!0});if(void 0!==c)return c}var l=null===(o=null===(n=null==e?void 0:e.default)||void 0===n?void 0:n.generators)||void 0===o?void 0:o.get(t);return void 0!==l?l.apply(void 0,u([],s(null!==(i=null===(r=null==e?void 0:e.default)||void 0===r?void 0:r.args)&&void 0!==i?i:[]),!1)):void 0},t.prototype.write=function(t,e,n){this.store.set(t,e),void 0!==(null==n?void 0:n.persist)&&n.persist&&this.writeLocalStorage(t,e,{usePrefix:!0})},t.prototype.use=function(t,e){var n,o=this.store.get(t.key);if(void 0!==o)n=o;else if(void 0!==(null==e?void 0:e.persist)&&e.persist){var r=this.readLocalStorage(t.key,{usePrefix:!0});null!=r&&(n=r)}var i=null!=n?n:t.default;if("function"==typeof i||!1===(null==e?void 0:e.structuredClone))return i;try{return structuredClone(i)}catch(t){try{return tt(i)}catch(t){return A.logCoreError({id:"Core.library.Account.use",account:null,error:t}),i}}},t.prototype.update=function(t,e,n){var o=e(this.use(t,n));if(void 0!==t.postProcessor&&(o=t.postProcessor(o)),this.store.set(t.key,o),void 0!==(null==n?void 0:n.persist)&&n.persist){if("string"!=typeof o)throw new Error("".concat(JSON.stringify(o)," must be a string to be writtable to browser storage"));this.writeLocalStorage(t.key,o,{usePrefix:!0})}},t.prototype.delete=function(t,e){this.store.delete(t),void 0!==(null==e?void 0:e.persist)&&e.persist&&this.deleteLocalStorage(t,{usePrefix:!0})},t.prototype.remove=function(t,e){this.store.delete(t.key),void 0!==(null==e?void 0:e.persist)&&e.persist&&this.deleteLocalStorage(t.key,{usePrefix:!0})},t.prototype.executeFuncWithConsent=function(t,e){if(!this.isAllowedToAccessInfoOnDevice())throw new Error("Invalid consent. API requires consent before execution.");return e.apply(t)},t.prototype.recordErrorEvent=function(t){A.logError(n(n({},t),{account:this}))},t.prototype.recordStatusChangeEvent=function(t){A.logFeature({id:t.id,account:this,feature:t.status,props:n({},t.props)})},t.prototype.recordGenericEvent=function(t){A.logFeature({id:t.id,account:this,feature:t.id,props:n({},t.props)})},t.prototype.isAllowedToAccessInfoOnDevice=function(){return this.updateUserConsent(),this.use(X)},t.prototype.isAPStagAllowedToAccessInfoOnDevice=function(){return!0===this.globalContext.apstag._atsaaiod()},t.prototype.updateUserConsent=function(){try{var t=this.isAPStagAllowedToAccessInfoOnDevice();this.update(X,(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 e=!1;try{e=this.isAllowedToAccessInfoOnDevice()}catch(t){}return e||$.includes(t)},t.prototype.readCookieStorage=function(t,e){var n;if(!this.isBrowserStorageAllowed(t))throw new Error("".concat(t," is not allowed to be read from cookie storage"));var o=null!==(n=null==e?void 0:e.usePrefix)&&void 0!==n&&n?this.getPersistedItemName(t):t;return new Z(this.globalContext).getItem(o)},t.prototype.readLocalStorage=function(t,e){var n;if(!this.isBrowserStorageAllowed(t))throw new Error("".concat(t," is not allowed to be read from browser storage"));var o=null!==(n=null==e?void 0:e.usePrefix)&&void 0!==n&&n?this.getPersistedItemName(t):t;if(o in this.globalContext.localStorage)return this.globalContext.localStorage.getItem(o)},t.prototype.writeLocalStorage=function(t,e,n){var o;if(!this.isBrowserStorageAllowed(t))throw new Error("".concat(t," is not allowed to be written to browser storage"));if("string"!=typeof e)throw new Error("".concat(JSON.stringify(e)," must be a string to be writtable to browser storage"));var r=null!==(o=null==n?void 0:n.usePrefix)&&void 0!==o&&o?this.getPersistedItemName(t):t;this.globalContext.localStorage.setItem(r,e)},t.prototype.deleteLocalStorage=function(t,e){var n;if(!this.isBrowserStorageAllowed(t))throw new Error("".concat(t," is not allowed to be touched/deleted in browser storage"));var o=null!==(n=null==e?void 0:e.usePrefix)&&void 0!==n&&n?this.getPersistedItemName(t):t;this.globalContext.localStorage.removeItem(o)},t.prototype.readSessionStorage=function(t,e){var n;if(!this.isBrowserStorageAllowed(t))throw new Error("".concat(t," is not allowed to be read from browser storage"));var o=null!==(n=null==e?void 0:e.usePrefix)&&void 0!==n&&n?this.getPersistedItemName(t):t;if(o in this.globalContext.sessionStorage)return this.globalContext.sessionStorage.getItem(o)},t.prototype.writeSessionStorage=function(t,e,n){var o;if(!this.isBrowserStorageAllowed(t))throw new Error("".concat(t," is not allowed to be written to browser storage"));if("string"!=typeof e)throw new Error("".concat(JSON.stringify(e)," must be a string to be writable to browser storage"));var r=null!==(o=null==n?void 0:n.usePrefix)&&void 0!==o&&o?this.getPersistedItemName(t):t;this.globalContext.sessionStorage.setItem(r,e)},t.prototype.deleteSessionStorage=function(t,e){var n;if(!this.isBrowserStorageAllowed(t))throw new Error("".concat(t," is not allowed to be touched/deleted in browser storage"));var o=null!==(n=null==e?void 0:e.usePrefix)&&void 0!==n&&n?this.getPersistedItemName(t):t;this.globalContext.sessionStorage.removeItem(o)},t}(),nt="_system",ot=function(t){function n(e,n){return t.call(this,nt,{globalContext:e,rootName:n})||this}return e(n,t),n}(et);function rt(t){var e=function(t,e){throw void 0!==t.context?t.context="".concat(e," > ").concat(t.context):t.context=e,t};return function(n,o,r){var i=r.value;return r.value=function(){for(var n=[],o=0;o150){var o=n.slice(-100);t.store.set(v,o)}}},t.prototype.recordProcessedEvents=function(t){var e,n=null!==(e=t.store.get(v))&&void 0!==e?e:[];n.push.apply(n,u([],s(t.queue.filter((function(t){return void 0!==t.status&&vt.includes(t.status)}))),!1)),t.store.set(v,n)},t.prototype.cleanUpAccountQueue=function(t){var e;(e=t.queue).splice.apply(e,u([0,t.queue.length],s(t.queue.filter((function(t){return void 0===t.status||!vt.includes(t.status)}))),!1))},t.prototype.archive=function(){var t=this;this.getAccounts().forEach((function(e){t.recordProcessedEvents(e),t.limitHistoryLength(e),t.cleanUpAccountQueue(e)}))},t.prototype.filterExternalEvents=function(t){return null==t?void 0:t.filter((function(t){var e,n;return(null===(e=t.detail)||void 0===e?void 0:e.source)!==w.internal&&(null===(n=t.detail)||void 0===n?void 0:n.source)!==w.apstag&&t.status!==I.waiting}))},t.prototype.getNumberOfExternalEvents=function(t){var e,n=this.filterExternalEvents(t);return null!==(e=null==n?void 0:n.length)&&void 0!==e?e:0},t.prototype.updateExternalEventCount=function(t){var e=this.getNumberOfExternalEvents(t);this.incrementStoreItemCountBy(g,e)},t.prototype.throwOnInfiniteLoop=function(){var t=this,e=h;this.incrementStoreItemCountBy(e,1);var n=this.readStoreItemCount(e);if(n>1e4)throw new Error("Too many dispatches. Aborting");n%100==0&&(new ot).recordGenericEvent({id:"Core.library.Dispatcher.throwOnInfiniteLoop",props:{recentDispatchesCount:n}}),setTimeout((function(){t.resetStoreItemCount(e)}),100)},t.prototype.dispatch=function(t){var e,n,o,r,i,a=this,c=t.reason;try{this.throwOnInfiniteLoop(),y()&&st.info('# Dispatch from method "'.concat(c.method,'" on event "').concat(null!==(n=null===(e=c.events)||void 0===e?void 0:e[0].type)&&void 0!==n?n:"undefined",'" with source "').concat(null!==(i=null===(r=null===(o=c.events)||void 0===o?void 0:o[0].detail)||void 0===r?void 0:r.source)&&void 0!==i?i:"undefined",'"\n_________________________________________')),this.updateExternalEventCount(c.events),this.getAccounts().forEach((function(t){return a.dispatchAccount(t,c)})),this.archive()}catch(t){throw(new ot).recordErrorEvent({id:"Core.library.Dispatcher.dispatch",error:t}),t}},t}(),pt=function(){function t(t,e){this.globalContext=t,this.rootName=e}return t.prototype.subscribe=function(t){try{var e=new ot,n=null!=e.store.get(d)?e.store.get(d):new Map;e.store.set(d,new Map(u(u([],s(n),!1),s(t),!1)))}catch(t){throw(new ot).recordErrorEvent({id:"Core.library.Subscriber.subscribe",error:t}),t}},t}(),gt=function(){function t(t,e){this.globalContext=t,this.rootName=e}return t.prototype.populate=function(){try{var t=new ot,e=!1;try{e=JSON.parse(t.read(Y))}catch(t){}if(e)return;t.write(Y,JSON.stringify(!0)),this.populateFromPrependStore(),this.populateFromQueryParams()}catch(t){(new ot).recordErrorEvent({id:"Core.library.Populator.populate",error:t})}},t.prototype.populateFromPrependStore=function(){var t=this;this.globalContext[this.rootName].forEach((function(e,n){var o,r,i=new et(n,{globalContext:t.globalContext,rootName:t.rootName}),a=null!==(r=i.read(K,{persist:!0}))&&void 0!==r?r:"[]";i.write(K,JSON.stringify([]));try{var c=JSON.parse(a);if(0===c.length)return;(o=i.queue).push.apply(o,u([],s(c.map(mt)),!1))}catch(t){console.error("Error processing prepended events",t)}}))},t.prototype.populateFromQueryParams=function(){var t,e,n=null===(e=null===(t=this.globalContext)||void 0===t?void 0:t.location)||void 0===e?void 0:e.search,o=new URLSearchParams(n),r=this.globalContext[this.rootName],i=r.get(nt);ht(o,"aps.trigger").forEach((function(t){i.queue.push(mt(t))})),ht(o,"aps.triggerFor",!0).forEach((function(t){void 0!==t.accountId&&r.has(t.accountId)&&r.get(t.accountId).queue.push(mt(t))}));var a=ht(o,"aps_event");r.forEach((function(t){a.forEach((function(e){t.queue.push(mt(e))}))}))},t}(),ht=function(t,e,n){void 0===n&&(n=!1);var o=t.getAll(e),r=[];return o.forEach((function(t){var e,o=t.split(",");n&&(e=o.shift());var i=o.shift();if(void 0!==i&&i.length>0){var a=decodeURIComponent(o.join(",")),c=void 0;if(a.length>0)try{c=JSON.parse(a)}catch(t){console.error("Error processing query param event",i,c)}r.push({eventName:i.replace(/_/g,"/"),eventDetail:c,accountId:e})}})),r},mt=function(t){var e;return new CustomEvent(t.eventName,{detail:n({},null!==(e=t.eventDetail)&&void 0!==e?e:{})})},yt={globalContext:window,rootName:"_aps"},bt=function(){function t(t){this.ID=t,this.clear()}return t.prototype.clear=function(){var t=this;(new ot).update(lt,(function(e){return e.delete(t.ID),e}))},t.prototype.recordListener=function(t,e){var n=this;(new ot).update(lt,(function(o){var r=o.get(n.ID);return void 0!==r?r.push([t.name,e]):o.set(n.ID,[[t.name,e]]),o}))},t}(),wt=function(){function t(t,e){void 0===t&&(t=yt.globalContext),void 0===e&&(e=yt.rootName),this.dispatcher=new ft(t,e),this.equiper=new at(t,e,this.dispatcher),this.subscriber=new pt(t,e),this.populator=new gt(t,e),this.globalContext=t,this.rootName=e}return t.prototype.createAccount=function(t){var e;if(void 0===t)throw new Error("accountID must be provided");this.globalContext[this.rootName]=null!==(e=this.globalContext[this.rootName])&&void 0!==e?e:new Map;var n=this.globalContext[this.rootName],o={store:new Map,queue:[]};return!1===n.has(t)&&n.set(t,o),new et(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 e=t.reason;this.dispatcher.dispatch({reason:e})},t.prototype.populate=function(){this.populator.populate()},t.prototype.load=function(t){var e=t.listeners;this.equip(),this.subscribe(e),this.dispatch({reason:{method:b.direct}}),this.populate()},t.prototype.registerEventSource=function(t){return this.equip(),new bt(t)},r([rt("HASH#Core.library.UserSpace.subscribe")],t.prototype,"subscribe",null),r([rt("HASH#Core.library.UserSpace.equip")],t.prototype,"equip",null),r([rt("HASH#Core.library.UserSpace.dispatch")],t.prototype,"dispatch",null),r([rt("HASH#Core.library.UserSpace.populate")],t.prototype,"populate",null),r([rt("HASH#Core.library.UserSpace.load")],t.prototype,"load",null),r([rt("HASH#Core.library.UserSpace.registerEventSource")],t.prototype,"registerEventSource",null),t}(),Et="vnd_prx_segments",Ct="aps_targeting_comscore",xt=new V({scope:"cxm",object:"comscore",action:"set",handler:function(t){var e=t.account;return t.customEvent,i(void 0,void 0,void 0,(function(){return a(this,(function(t){return[2,{status:St(e)}]}))}))}}),St=function(t){var e=t.readSessionStorage(Ct);if(t.deleteSessionStorage(Ct),null==e)return E.cancelled;try{var n=JSON.parse(e)[Et];if(null==n)throw new Error;return t.globalContext.googletag.pubads().getSlots().forEach((function(t){t.setTargeting(Et,n)})),E.completed}catch(t){throw new Error("Malformed targeting object at ".concat(Ct))}},_t="aps_targeting_ias",At=new V({scope:"cxm",object:"ias",action:"set",handler:function(t){var e=t.account;return t.customEvent,i(void 0,void 0,void 0,(function(){return a(this,(function(t){return[2,{status:It(e)}]}))}))}}),It=function(t){var e=t.readSessionStorage(_t);if(t.deleteSessionStorage(_t),null==e)return E.cancelled;try{var n=JSON.parse(e),o=t.globalContext.googletag;o.pubads().getSlots().forEach((function(t){var e=n.targeting.slots[t.getSlotElementId()];null!=e&&Object.keys(e).forEach((function(n){t.setTargeting(n,e[n])}))}));var r=n.targeting,i=r.brandSafety,a=r.fr,c=r.custom;return null!=i&&Object.keys(i).forEach((function(t){o.pubads().setTargeting(t,i[t])})),null!=c&&Object.keys(c).forEach((function(t){var e=c[t];Array.isArray(e)?e.forEach((function(e){o.pubads().setTargeting(t,e)})):o.pubads().setTargeting(t,e)})),null!=a&&o.pubads().setTargeting("fr",a),E.completed}catch(t){throw new Error("Malformed targeting object at ".concat(_t))}},kt="aps_targeting_illuma",Pt=new V({scope:"cxm",object:"illuma",action:"set",handler:function(t){var e=t.account;return t.customEvent,i(void 0,void 0,void 0,(function(){return a(this,(function(t){return[2,{status:Lt(e)}]}))}))}}),Lt=function(t){var e=t.readSessionStorage(kt);if(t.deleteSessionStorage(kt),null==e)return E.cancelled;var n=JSON.parse(e).results;if(null==n)throw new Error("Malformed targeting object at ".concat(kt));var o=t.globalContext.googletag;return Object.keys(n).forEach((function(t){var e=n[t];o.pubads().setTargeting("".concat("illuma_").concat(t),JSON.stringify(e))})),E.completed},Rt=new V({scope:"cxm",object:"contextual",action:"set",handler:function(t){var e=t.account;return t.customEvent,i(void 0,void 0,void 0,(function(){return a(this,(function(t){switch(t.label){case 0:return[4,Promise.all([e.recordListener(xt),e.recordListener(At),e.recordListener(Pt)])];case 1:return t.sent(),[2,{status:E.completed}]}}))}))}}),jt=G([xt,Rt,At,Pt]),Dt={key:"customPlacement/hints",default:{}},Nt={key:"customPlacement/bidResponses",default:{}},Ot=function(){function t(t,e,o){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,e){return n(n({},t),e)}),{})},this.getContainerStyles=function(t){try{if(!t)return{};var e=window.getComputedStyle(t),n="--aps-custom-container-",o=new Map;return o.set("".concat(n,"width"),e.width),o.set("".concat(n,"margin"),e.margin),o.set("".concat(n,"padding"),e.padding),Object.fromEntries(o.entries())}catch(t){return{}}},this.slotProps=t,this.rawResponse=e,this._document=o}return t.prototype.getTagStyle=function(t){var e=this._document.getElementsByTagName(t);if(e&&e[0]){var n=window.getComputedStyle(this._document.getElementsByTagName(t)[0]),o=new Map,r="--aps-custom-page-";return o.set("".concat(r).concat(t,"-color"),n.color),o.set("".concat(r).concat(t,"-fontFamily"),n.fontFamily),o.set("".concat(r).concat(t,"-fontSize"),n.fontSize),o.set("".concat(r).concat(t,"-fontWeight"),n.fontWeight),o.set("".concat(r).concat(t,"-lineHeight"),n.lineHeight),Object.fromEntries(o)}return{}},t.prototype.getDynamicFrameBodyHeight=function(t,e,o){var r;if(e){null==e||e.contentWindow;var i=(null==e?void 0:e.contentDocument)||(null===(r=null==e?void 0:e.contentWindow)||void 0===r?void 0:r.document),a=null==i?void 0:i.body.scrollHeight;e.style.height="".concat(a,"px");try{var c=n(n({},this.getPageStyles()),this.getContainerStyles(t));Object.keys(c).forEach((function(t){null==i||i.documentElement.style.setProperty(t,c[t])}))}catch(t){}}},t.prototype.render=function(t){return this._renderInIframe(t)},t.prototype._renderInIframe=function(t){var e,n,o,r=this;if(!this.rawResponse||!this.slotProps)return!1;try{var i=this.rawResponse.size.split("x"),a=(null===(e=this.rawResponse.targeting)||void 0===e?void 0:e.amzniid)||this.rawResponse.amzniid,c=(null===(n=this.rawResponse.targeting)||void 0===n?void 0:n.amznadm)||this.rawResponse.amznadm;if(!a)return!1;var s=this.slotProps._element;if(this.slotProps.location&&this.slotProps.id){var u=this._document.createElement("div");null===(o=this._document.getElementById(this.slotProps.id))||void 0===o||o.insertAdjacentElement(this.slotProps.location,u),s=u}if(!s)return!1;var l=this._document.createElement("iframe");return l.style.marginLeft="0",l.style.marginTop="0",l.style.height="".concat(i[1],"px"),l.style.width="100%",l.setAttribute("data-testid","amzn-asr-ad"),l.setAttribute("scrolling","no"),l.setAttribute("frameborder","0"),l.onload=function(){return r.getDynamicFrameBodyHeight(s,l,c?"amznadm":"admi")},l.srcdoc=c||"",t&&t.clickPrefix&&(l.srcdoc=l.srcdoc.replace(this.CLICK_PREFIX_MACRO,t.clickPrefix)),s.appendChild(l),this.updateSlotAttribute("status","rendered"),!0}catch(t){throw new Error("CustomPlacements: Error while rendering")}},t.prototype.updateSlotAttribute=function(t,e){var n;null===(n=this.slotProps._element)||void 0===n||n.setAttribute("data-aps-custom-".concat(t),e)},t}(),Mt={key:"customPlacement/timings",default:[]},Tt=function(t,e,n,o){void 0===n&&(n=0),void 0===o&&(o=0);try{var r={effectiveType:null==e?void 0:e.effectiveType,rtt:null==e?void 0:e.rtt,downlink:null==e?void 0:e.downlink},i=function(t,e,n){try{var o=isNaN(e)||0===e?t.body.clientWidth:e,r=isNaN(n)||0===n?t.body.clientHeight:n;return"".concat(o,"x").concat(r)}catch(t){}return"x"}(t,n,o);return{connection:r,screen:i}}catch(t){return{}}};var Ut=function(t,e,n){t.update(Mt,(function(t){return t.push({time:performance.now(),key:"".concat(e,"/").concat(n)}),t}))},qt="customPlacements",zt=new V({scope:"customPlacement",object:"hint",action:"process",validators:{},handler:function(t){var e=t.account;return t.detail,t.customEvent,i(void 0,void 0,void 0,(function(){var t,n,o;return a(this,(function(r){return t=function(t){var n;Ut(e,qt,"hint/process/".concat(t));var o=e.use(Dt),r=e.use(Nt);null!==(n=o[t].isRendered)&&void 0!==n&&n||(Object.values(r).forEach((function(n){var r;if(null===(r=n.isRendered)||void 0===r||!r){var i=e.globalContext.document.getElementById(t);if(null!=i){var a=new Ot({id:t,_element:i},n,e.globalContext.document);Ut(e,qt,"widget/render/".concat(t)),a.render(o[t].hintMetadata)&&(n.isRendered=!0,o[t].isRendered=!0)}}})),e.update(Dt,(function(){return o})),e.update(Nt,(function(){return r})))},n=e.use(Dt),Object.keys(n).filter((function(t){return n[t].default})).forEach(t),Object.keys(n).filter((function(t){return!n[t].default})).forEach(t),[2,{status:E.completed,analytics:{browserInfo:Tt(e.globalContext.document,null===(o=e.globalContext.navigator)||void 0===o?void 0:o.connection,e.globalContext.innerWidth,e.globalContext.innerHeight)}}]}))}))}}),Bt=new V({scope:"customPlacement",object:"hint",action:"define",validators:{},handler:function(t){var e=t.account;t.detail;var n=t.customEvent;return i(void 0,void 0,void 0,(function(){var t,o,r,i,c,s,u;return a(this,(function(a){if(void 0===(null===(s=n.detail)||void 0===s?void 0:s.id))throw new Error("Hint `id` must be defined");return t=n.detail,o=t.id,r=t.isDefault,i=t.hintMetadata,Ut(e,qt,"hint/define/".concat(o)),(c=e.use(Dt))[o]={default:"default"===r,isRendered:!1,hintMetadata:null!=i?i:{}},e.update(Dt,(function(){return c})),e.recordListenerNonBlocking(zt),[2,{status:E.completed,analytics:{browserInfo:Tt(e.globalContext.document,null===(u=e.globalContext.navigator)||void 0===u?void 0:u.connection,e.globalContext.innerWidth,e.globalContext.innerHeight)}}]}))}))}}),Ft={key:"customPlacement/placementResponseDispatched",default:!1},Ht={key:"customPlacement/placementResponse",default:void 0},Jt={key:"customPlacement/contextURL",default:void 0},Wt={key:"customPlacement/placementEndpoint",default:"https://c.aps.amazon-adsystem.com/e/placements"},Vt={key:"ad/context",default:void 0},Gt=new V({scope:"customPlacement",object:"placement",action:"fetch",validators:{},handler:function(t){var e=t.account;return t.detail,t.customEvent,i(void 0,void 0,void 0,(function(){var t,n;return a(this,(function(o){switch(o.label){case 0:return Ut(e,qt,"placementFetch/start"),[4,Yt(e)];case 1:return t=o.sent(),Ut(e,qt,"placementFetch/end"),[2,{status:E.completed,value:{placementResponse:t},analytics:{browserInfo:Tt(e.globalContext.document,null===(n=e.globalContext.navigator)||void 0===n?void 0:n.connection,e.globalContext.innerWidth,e.globalContext.innerHeight)}}]}}))}))}});function Qt(t){var e=t.use(Vt);return void 0!==e&&"user"in e?(e.user,o(e,["user"])):e}function Kt(t,e){try{var n=null!=e?e:function(t){var e,n;try{if(void 0!==(null===(e=t.globalContext.top)||void 0===e?void 0:e.location.href))return null===(n=t.globalContext.top)||void 0===n?void 0:n.location.href}catch(t){}try{if(t.globalContext.top!==t.globalContext.self)return t.globalContext.document.referrer}catch(t){}return}(t);if(void 0!==n)return encodeURIComponent(n)}catch(t){}return""}function Yt(t){return i(this,void 0,void 0,(function(){var e,n,o,r,i;return a(this,(function(a){switch(a.label){case 0:return e={ortb2:Qt(t)},n=t.use(Jt),o=t.use(Wt),r=Kt(t,n),i=encodeURIComponent(JSON.stringify(e)),[4,fetch("".concat(o,"?account=").concat(t.id,"&u=").concat(r,"&sg=").concat(i))];case 1:return[4,a.sent().json()];case 2:return[2,a.sent()]}}))}))}var Xt={key:"customPlacement/bidEndpoint",default:"c.aps.amazon-adsystem.com"},Zt={key:"customPlacement/bidIsKey",default:"86355855cc6ed9e335d0382c8563aa10"},$t=new V({scope:"customPlacement",object:"bids",action:"fetch",validators:{},handler:function(t){var e=t.account;return t.detail,t.customEvent,i(void 0,void 0,void 0,(function(){var t,n,o,r;return a(this,(function(i){switch(i.label){case 0:return t=Tt(e.globalContext.document,null===(o=e.globalContext.navigator)||void 0===o?void 0:o.connection,e.globalContext.innerWidth,e.globalContext.innerHeight),void 0===(null===(r=e.globalContext.apstag)||void 0===r?void 0:r.fetchBids)?[2,{status:E.waiting,analytics:{browserInfo:t}}]:(Ut(e,qt,"fetchBids/start"),[4,te(e)]);case 1:return n=i.sent(),Ut(e,qt,"fetchBids/end"),[2,{status:E.completed,value:{bidResponses:n},analytics:{browserInfo:t}}]}}))}))}});function te(t){return i(this,void 0,void 0,(function(){var e,n,o;return a(this,(function(r){switch(r.label){case 0:return 6e4,e={slots:[{slotID:"93b7dd52-a8ce-11ed-afa1-0242ac120002:1",sizes:[[999,999]]}],timeout:6e4,_endpointDomain:t.use(Xt),params:{program:"apscustom",is:t.use(Zt)}},n={pubID:t.id,isSelfServePub:36===t.id.length,deals:!0},o=t.use(Jt),[4,new Promise((function(r){var i;null===(i=t.globalContext.apstag)||void 0===i||i.fetchBids(e,(function(t){r(t)}),{initConfig:n,contextURL:o})}))];case 1:return[2,r.sent()]}}))}))}var ee=new V({scope:"customPlacement",object:"service",action:"enable",validators:{},handler:function(t){var e=t.account;return t.detail,t.customEvent,i(void 0,void 0,void 0,(function(){var t;return a(this,(function(n){switch(n.label){case 0:return Ut(e,qt,"service/enable"),e.update(Ft,(function(){return!1})),[4,Promise.all([e.recordListener(Gt).then((function(t){var n=t.placementResponse;ne(e,!0,n),e.update(Ht,(function(){return n}))})),e.recordListener($t).then((function(t){t.bidResponses.forEach((function(t){var n,o,r=null!==(o=null===(n=t.targeting)||void 0===n?void 0:n.amzniid)&&void 0!==o?o:t.amzniid,i=!1;if(""!==r){var a=e.use(Nt);a[r]=t,e.update(Nt,(function(){return a})),i=!0}ne(e,!1,{aps:[{active:i,dispatchEventOnValidBid:!0}]})}))})).then((function(){e.recordListenerNonBlocking(zt)}))])];case 1:return n.sent(),[2,{status:E.completed,analytics:{browserInfo:Tt(e.globalContext.document,null===(t=e.globalContext.navigator)||void 0===t?void 0:t.connection,e.globalContext.innerWidth,e.globalContext.innerHeight)}}]}}))}))}});function ne(t,e,n){var o;if(!t.use(Ft)){var r=null===(o=null==n?void 0:n.aps)||void 0===o?void 0:o.find((function(t){return t.dispatchEventOnValidBid}));e&&void 0!==r||(Ut(t,qt,"placementResponseEvent/dispatch"),t.record("customPlacement/placement/didRespond",n).catch((function(t){})),t.update(Ft,(function(){return!0})))}}var oe=new Map(u([],s(G([Bt,$t,zt,ee,Gt])),!1)),re=function(t){function n(e){var n=t.call(this,e.message)||this;return n.message='Could not read vendor data because: "'.concat(e.message,'"'),n}return e(n,t),n}(Error),ie={key:"cxm/vendors",default:{}},ae="__tamLIResolveResult",ce={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 se(t){var e=[],n={user:{ext:{eids:e}}};return Object.entries(ce).forEach((function(n){var o=n[0],r=n[1];if(void 0!==t[o]){var i={source:r.source,uids:[{id:t[o]}]};!0!==r.noExtraDefaults&&(i.uids[0].atype=3,i.uids[0].ext={provider:"liveintent.com"}),e.push(i)}})),n}var ue="arcobj1",le="arcobj2";var de="cohort_ids";var ve={cxm_vendors_set:"cxm/vendors/set",cxm_liveintent_set:"cxm/liveintent/set",cxm_arcspan_set:"cxm/arcspan/set",cxm_anonymised_set:"cxm/anomymised/set"},fe=new Map([[ve.cxm_vendors_set,function(t){var e=t.account;return i(void 0,void 0,void 0,(function(){return a(this,(function(t){switch(t.label){case 0:return[4,Promise.all([e.record(ve.cxm_liveintent_set),e.record(ve.cxm_arcspan_set),e.record(ve.cxm_anonymised_set)])];case 1:return t.sent(),[2,E.completed]}}))}))}],[ve.cxm_liveintent_set,function(t){var e=t.account;return t.customEvent,i(void 0,void 0,void 0,(function(){var t;return a(this,(function(o){try{t=function(t){var e,n,o;try{o=t.readLocalStorage(ae)}catch(t){if(t instanceof Error)throw new re(t)}if(null!=o&&(void 0===t.globalContext.liModuleEnabled&&(t.globalContext.liModuleEnabled=Math.random()<.95,null===(n=null===(e=t.globalContext)||void 0===e?void 0:e.googletag)||void 0===n||n.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=se(JSON.parse(o))}catch(t){r=se(JSON.parse(decodeURIComponent(o)))}if(void 0!==r)return{data:{default:r}}}}(e)}catch(t){if(t instanceof re)return[2,{status:E.cancelled,analytics:{statusReason:t.message}}];throw t}return void 0===t?[2,E.cancelled]:(e.update(ie,(function(e){var o;return n(n({},e),((o={}).liveintent=t,o))})),[2,E.completed])}))}))}],[ve.cxm_arcspan_set,function(t){var e=t.account;return i(void 0,void 0,void 0,(function(){var t;return a(this,(function(o){return t=function(t){var e=t.globalContext[ue],n=t.globalContext[le],o=[],r=[],i=[];if(void 0!==e){if(void 0!==e.page_iab_codes.text&&(o=o.concat(e.page_iab_codes.text)),void 0!==e.page_iab_codes.images&&(o=o.concat(e.page_iab_codes.images)),void 0!==e.page_keywords){var a="string"==typeof e.page_keywords?e.page_keywords.split(","):e.page_keywords;i=i.concat(a),void 0!==(null==n?void 0:n.compcohorts)&&(i=i.concat(n.compcohorts))}void 0!==e.page_iab_newcodes.text&&(r=u([],s(new Set(u(u([],s(r),!1),s(e.page_iab_newcodes.text),!1))),!1)),void 0!==e.page_iab_newcodes.images&&(r=u([],s(new Set(u(u([],s(r),!1),s(e.page_iab_newcodes.images),!1))),!1));var c={name:"arcspan",segment:[],ext:{segtax:6}};r.forEach((function(t){c.segment=c.segment.concat({id:t})}));var l={data:[]};return l.data=l.data.concat(c),{data:{default:{site:{name:"arcspan",cat:o,sectioncat:o,pagecat:o,keywords:i.toString(),content:l,domain:new URL(t.globalContext.location.href).hostname,page:t.globalContext.location.href,ref:t.globalContext.document.referrer}}}}}}(e),void 0===t?[2,E.cancelled]:(e.update(ie,(function(e){return n(n({},e),{arcspan:t})})),[2,E.completed])}))}))}],[ve.cxm_anonymised_set,function(t){var e=t.account;return t.customEvent,i(void 0,void 0,void 0,(function(){var t;return a(this,(function(o){try{t=function(t){var e;try{e=t.readLocalStorage(de)}catch(t){if(t instanceof Error)throw new re(t)}if("string"==typeof e){for(var n=JSON.parse(e),o="",r=0;r1}(e))?[2,E.completed]:function(t){var e=t.read(Q,{persist:!0});return void 0!==e&&new Date>=new Date(Number(e))}(e)?(function(t){t.delete(Q,{persist:!0}),function(t){var e;null===(e=t.globalContext.apstagDEBUG)||void 0===e||delete e.url}(t)}(e),[2,E.completed]):(function(t){t.record(nn.debug_events_show).catch((function(t){})),t.record(nn.debug_store_show).catch((function(t){}))}(e),[2,E.waiting])}))}))}],[nn.debug_listeners_show,function(t){return t.account,i(void 0,void 0,void 0,(function(){var t,e,n;return a(this,(function(o){return t=new ot,e=t.store.get(d),n=u([],s(e.entries()),!1),console.groupCollapsed("⌂ Listeners"),console.table(n),console.groupEnd(),[2,E.completed]}))}))}]]),rn=[en],an=new Map(u(u([],s(on),!1),s(G(rn)),!1)),cn="deviceSignal/sua";!function(t){t[t.unspecifiedUnknown=0]="unspecifiedUnknown",t[t.lowEntropy=1]="lowEntropy",t[t.highEntropy=2]="highEntropy"}(tn||(tn={}));var sn=["brands","mobile","platform"],un=["architecture","bitness","fullVersionList","model","platformVersion"];function ln(t,e,n){return i(this,void 0,void 0,(function(){var o;return a(this,(function(r){switch(r.label){case 0:return r.trys.push([0,2,,3]),[4,n.getHighEntropyValues(u(u([],s(sn),!1),s(un),!1))];case 1:return o=r.sent(),t.write(e,JSON.stringify(dn(o)),{persist:!0}),[3,3];case 2:return r.sent(),[3,3];case 3:return[2,E.completed]}}))}))}function dn(t){var e,n,o={};return o.architecture=t.architecture,o.bitness=t.bitness,o.mobile=t.mobile?1:0,o.model=t.model,o.source=function(t){if(un.some((function(e){return t[e]})))return tn.highEntropy;if(sn.some((function(e){return t[e]})))return tn.lowEntropy;return tn.unspecifiedUnknown}(t),"string"==typeof t.platform&&(o.platform={brand:t.platform,version:null===(e=t.platformVersion)||void 0===e?void 0:e.split(".")}),Array.isArray(t.fullVersionList)?n=t.fullVersionList:Array.isArray(t.brands)&&(n=t.brands),n instanceof Array&&(o.browsers=n.map((function(t){var e;return{brand:t.brand,version:null===(e=t.version)||void 0===e?void 0:e.split(".")}}))),o}var vn,fn,pn,gn="deviceSignal/sua/set",hn=new Map([[gn,function(t){var e=t.account;return i(void 0,void 0,void 0,(function(){var t,n,o,r,i;return a(this,(function(a){switch(a.label){case 0:return t=cn,n=null===(r=e.globalContext.navigator)||void 0===r?void 0:r.userAgentData,"string"==typeof(o=e.read(t,{persist:!0}))?e.write(t,o):n instanceof Object&&function(t,e,n){t.write(e,JSON.stringify(dn(n)))}(e,t,n),!1!==(null===(i=e.globalContext.apstag)||void 0===i?void 0:i.isGDPRRegion)?[2,E.completed]:"function"!=typeof(null==n?void 0:n.getHighEntropyValues)?[3,2]:[4,ln(e,t,n)];case 1:a.sent(),a.label=2;case 2:return[2,E.completed]}}))}))}]]),mn={key:"deviceSignal/cookieDeprecationLabel",default:void 0},yn=new V({scope:"deviceSignal",object:"cookieDeprecationLabel",action:"set",handler:function(t){var e=t.account;return t.customEvent,i(void 0,void 0,void 0,(function(){var t,n;return a(this,(function(o){switch(o.label){case 0:return void 0===(null==(t=e.globalContext.navigator.cookieDeprecationLabel)?void 0:t.getValue)||"function"!=typeof t.getValue?[2,{status:E.cancelled}]:[4,e.executeFuncWithConsent(t,t.getValue)];case 1:return void 0===(n=o.sent())||""===n?[2,{status:E.cancelled}]:(e.update(mn,(function(){return n})),[2,{status:E.completed,analytics:{gcdl:n}}])}}))}))}}),bn=G([yn]);!function(t){t.OpenRTB3_0="OpenRTB3_0"}(vn||(vn={})),function(t){t.Display="display",t.Video="video",t.MultiFormat="multi-format"}(fn||(fn={})),function(t){t.Googletag="googletag",t.AppNexus="appnexus",t.SAS="sas"}(pn||(pn={}));var wn=function(t){var e,o={id:t.slotID,spec:{placement:{tagid:null!==(e=t.slotName)&&void 0!==e?e:t.slotID}}};return void 0!==t.floor&&(o.flr=t.floor.value,o.flrcur=t.floor.currency),void 0!==t.slotParams&&(o.spec.placement.ext=t.slotParams),o.spec.placement=n(n({},o.spec.placement),En(t)),o},En=function(t){var e={};return t.mediaType===fn.MultiFormat?e=Cn(t.multiFormatProperties,t.companions):t.mediaType===fn.Video?(e.video={},void 0!==t.sizes&&t.sizes.length>0&&(e.video={w:t.sizes[0][0],h:t.sizes[0][1]}),void 0!==t.companions&&t.companions.length>0&&(e.video.comp=t.companions.map((function(t){return{id:t}})))):t.mediaType===fn.Display&&(e.display={},void 0!==t.sizes&&t.sizes.length>0&&(e.display.displayfmt=t.sizes.map((function(t){return{w:t[0],h:t[1]}})))),e},Cn=function(t,e){var n,o={};if(void 0!==t&&(void 0!==t.display&&(o.display={displayfmt:void 0!==t.display.sizes?t.display.sizes.map((function(t){return{w:t[0],h:t[1]}})):void 0}),void 0!==t.video)){var r=null===(n=t.video.sizes)||void 0===n?void 0:n[0];o.video={w:void 0!==r?r[0]:void 0,h:void 0!==r?r[1]:void 0},void 0!==e&&(o.video.comp=e.map((function(t){return{id:t}})))}return o},xn=function(t,e){var n={};return Object.keys(t).forEach((function(o){"object"==typeof t[o]&&null!==t[o]&&(o===e?Object.assign(n,t[o]):Object.assign(n,xn(t[o],e)))})),n},Sn=function(t){var e=xn(t,"ext");return Object.entries(e).forEach((function(t){var n=s(t,2),o=n[0],r=n[1];"string"!=typeof r&&(e[o]=JSON.stringify(r))})),0!==Object.keys(e).length?e:void 0},_n=function(t){var e,o=An(t),r={mediaType:o};return o===fn.MultiFormat?r=n(n({},r),In(t)):o===fn.Display?r.sizes=kn(t.display):o===fn.Video&&(r.sizes=Pn(t.video),void 0!==(null===(e=t.video)||void 0===e?void 0:e.comp)&&(r.companions=Ln(t.video))),r},An=function(t){return void 0!==t.video&&void 0!==t.display?fn.MultiFormat:void 0!==t.video?fn.Video:fn.Display},In=function(t){var e={multiFormatProperties:{}};return void 0!==t.video&&(e.multiFormatProperties.video={sizes:Pn(t.video)},void 0!==t.video.comp&&(e.companions=Ln(t.video))),void 0!==t.display&&(e.multiFormatProperties.display={sizes:kn(t.display)}),e},kn=function(t){var e=[];return void 0!==t&&(void 0!==t.displayfmt&&t.displayfmt.length>0&&(e=u(u([],s(e),!1),s(t.displayfmt.map((function(t){return[t.w,t.h]}))),!1)),void 0!==t.h&&void 0!==t.w&&(e=u(u([],s(e),!1),[[t.w,t.h]],!1))),e},Pn=function(t){var e=[];return void 0!==t&&void 0!==t.h&&void 0!==t.w&&(e=u(u([],s(e),!1),[[t.w,t.h]],!1)),e},Ln=function(t){var e;return void 0!==(null==t?void 0:t.comp)&&t.comp.length>0&&(e=t.comp.map((function(t){return t.id}))),e};function Rn(t){return t.get=function(){for(var t=[],e=0;e0?n[i]=Vn(a,e[i]):n[i]=function(t,e){var n,o=e.cattax,r=e[t];return(null!==(n=Jn[o])&&void 0!==n?n:[]).length>0&&("cat"===t||"sectcat"===t||"sectioncat"===t||"pagecat"===t)&&Array.isArray(r)?r.filter((function(t){return!Jn[o].includes("".concat(t))})):r}(i,e)}return n}),{});return n},Gn=function(t,e,n,o){var r,i,a,c=n.globalContext.document.createElement("iframe"),s=null===(r=e.get("amznsz"))||void 0===r?void 0:r.split("x"),u=e.get("amzniid"),l=t;if(!(void 0===u||void 0===l||void 0===s||s.length<2)){c.style.marginLeft="0",c.style.marginTop="0",c.style.height="".concat(s[1],"px"),c.style.width="100%",c.setAttribute("scrolling","no"),c.setAttribute("frameborder","0");var d=n.globalContext.document.createElement("div"),v=null!==(i=null==o?void 0:o.location)&&void 0!==i?i:"afterend",f=n.globalContext.document.getElementById(l);if(null!=f){f.insertAdjacentElement(v,d),d.appendChild(c);var p=null===(a=null==c?void 0:c.contentWindow)||void 0===a?void 0:a.document;void 0!==p&&(p.open(),p.write('