/*! For license information please see usersync.min.js.LICENSE.txt */ (()=>{var e={34:(e,n,t)=>{var i,o,r;void 0===(o="function"==typeof(i=r=function(){function e(){for(var e=0,n={};e{"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.CMP_VERSION=n.CMP_ID=n.UUID_VERSION=n.POS_BTF=n.POS_ATF=n.ATF_AD_UNITS=n.MISSING_TAG_ID=n.TAG_ID=n.DO_NOT_TRACK=n.tokenKey=n.THIRTY_DAYS_IN_SECONDS=n.THIRTY_DAYS=n.NINETY_DAYS_IN_SECONDS=n.NINETY_DAYS=n.DEFAULT_SYNC_TTL=n.FOURTEEN_DAYS=void 0,n.FOURTEEN_DAYS=14,n.DEFAULT_SYNC_TTL=86400*n.FOURTEEN_DAYS,n.NINETY_DAYS=90,n.NINETY_DAYS_IN_SECONDS=86400*n.NINETY_DAYS,n.THIRTY_DAYS=30,n.THIRTY_DAYS_IN_SECONDS=86400*n.THIRTY_DAYS,n.tokenKey="am_tokens",n.DO_NOT_TRACK="$doNotTrack",n.TAG_ID="1363c924529b3998",n.MISSING_TAG_ID="MISSING_TAG_ID",n.ATF_AD_UNITS=["adhesion_mobile","adhesion_tablet","adhesion_desktop","sidebar_atf","leaderboard_atf","sidebar_btf","recipe_mobile","recipe_btf"],n.POS_ATF=1,n.POS_BTF=3,n.UUID_VERSION={us:"invalidate-verizon-pushes",eu:"eu-v1",ap:"ap-v1"},n.CMP_ID=31,n.CMP_VERSION=373},712:(e,n)=>{"use strict";var t;Object.defineProperty(n,"__esModule",{value:!0}),n.SyncType=void 0,function(e){e.iframe="iframe",e.pixel="pixel"}(t||(n.SyncType=t={}))},576:function(e,n,t){"use strict";var i=this&&this.__awaiter||function(e,n,t,i){return new(t||(t=Promise))((function(o,r){function a(e){try{s(i.next(e))}catch(e){r(e)}}function c(e){try{s(i.throw(e))}catch(e){r(e)}}function s(e){var n;e.done?o(e.value):(n=e.value,n instanceof t?n:new t((function(e){e(n)}))).then(a,c)}s((i=i.apply(e,n||[])).next())}))};Object.defineProperty(n,"__esModule",{value:!0}),n.readAndResolve=n.readFromAll=n.writeToAll=n.readFromCache=n.writeToCache=void 0;const o=t(34),r=t(206),a=t(310);n.writeToCache=(e,n,t)=>i(void 0,void 0,void 0,(function*(){if(!window.caches||(null==n?void 0:n.mv_uuid)===a.DO_NOT_TRACK)return;const i=yield caches.open(t),o=new Headers;o.append("Content-Type","application/json"),o.append("Accept","application/json"),o.append("Cache-Control","max-age=31557600"),i.put(e,new Response(JSON.stringify(n),{headers:o}))})),n.readFromCache=e=>i(void 0,void 0,void 0,(function*(){if(!window.caches)return null;const n=yield window.caches.open("am");if(!n)return null;const t=yield n.match(e);if(!t)return null;if(!t.ok)return null;try{return yield t.json()}catch(e){console.warn(e)}})),n.writeToAll=(e,t,r)=>i(void 0,void 0,void 0,(function*(){try{yield(0,n.writeToCache)(e,t,r)}catch(e){}return o.set(e,t,{path:"/",expires:365,secure:!0,sameSite:"None"}),o.set(e,t,{path:"/",expires:365,secure:!0,sameSite:"None"}),!0})),n.readFromAll=e=>i(void 0,void 0,void 0,(function*(){const t={};try{t.cache=yield(0,n.readFromCache)(e)}catch(e){}return t.cookie=o.getJSON(e),t})),n.readAndResolve=e=>i(void 0,void 0,void 0,(function*(){let t={};try{t=yield(0,n.readFromAll)(e)}catch(e){}if(t.cookie&&!t.cache){try{(0,n.writeToCache)(`/${r.tokenKey}`,t.cookie,r.cacheKey)}catch(e){}return t.cookie}return t.cache&&!t.cookie?(o.set(r.tokenKey,t.cache),t.cache):t.cache&&t.cookie?t.cookie:null}))},326:function(e,n){"use strict";var t=this&&this.__awaiter||function(e,n,t,i){return new(t||(t=Promise))((function(o,r){function a(e){try{s(i.next(e))}catch(e){r(e)}}function c(e){try{s(i.throw(e))}catch(e){r(e)}}function s(e){var n;e.done?o(e.value):(n=e.value,n instanceof t?n:new t((function(e){e(n)}))).then(a,c)}s((i=i.apply(e,n||[])).next())}))};Object.defineProperty(n,"__esModule",{value:!0}),n.getConsentParams=n.hasValidCMP=n.isServingNonPersonalizedAds=void 0,n.isServingNonPersonalizedAds=(e,n)=>"1"===e&&!n,n.hasValidCMP=e=>"0"===e||"1"===e&&(window.__cmp||window.__tcfapi||window.__gpp),n.getConsentParams=function(){return t(this,void 0,void 0,(function*(){var e,n,r,a,c,s,d,u,l,p;let v="";if((null===(a=null===(r=null===(n=null===(e=window.$adManagementConfig)||void 0===e?void 0:e.web)||void 0===n?void 0:n.model)||void 0===r?void 0:r.versionGroup)||void 0===a?void 0:a.name)&&(v+=`&wrapperGroup=${null===(u=null===(d=null===(s=null===(c=window.$adManagementConfig)||void 0===c?void 0:c.web)||void 0===s?void 0:s.model)||void 0===d?void 0:d.versionGroup)||void 0===u?void 0:u.name}`),window.__tcfapi){const e=yield function(e){return t(this,void 0,void 0,(function*(){return new Promise((n=>{e("getTCData",2,(e=>{e.gdprApplies?n(e.tcString):n("")}))}))}))}(window.__tcfapi);v+=`&gdpr=${e?"1":"0"}&gdpr_consent=${e}`}else v+="&gdpr=0";if(window.__uspapi&&(v+=`&us_privacy=${yield function(e){return t(this,void 0,void 0,(function*(){return new Promise((n=>{e("getUSPData",1,(e=>{(null==e?void 0:e.uspString)?n(e.uspString):n("")}))}))}))}(window.__uspapi)}`),(null===(p=null===(l=window.$adManagementConfig)||void 0===l?void 0:l.web)||void 0===p?void 0:p.cmpSource)?v+=`&cmpSource=${window.$adManagementConfig.web.cmpSource}`:v+="&cmpSource=unknown",window.__gpp){const e=yield function(e){return t(this,void 0,void 0,(function*(){return new Promise((n=>{e("ping",(t=>{"1.0"===(null==t?void 0:t.gppVersion)?e("getGPPData",(e=>{i(e.gppString)?n(o(e)):n(void 0)})):i(null==t?void 0:t.gppString)?n(o(t)):n(void 0)}))}))}))}(window.__gpp);(null==e?void 0:e.gppString)&&(v+=`&gppString=${e.gppString}&gppSections=${e.applicableSections.join(",")}&gppSid=${e.gppSid}&hasConsent=${e.hasConsent}`)}return v}))};const i=e=>!(!e||"string"!=typeof e);function o(e){var n,t,i,o;return{gppString:e.gppString,applicableSections:e.applicableSections,hasConsent:"fides"===(null===(t=null===(n=window.$adManagementConfig)||void 0===n?void 0:n.web)||void 0===t?void 0:t.cmpSource)&&!!(null===(o=null===(i=window.$adManagementConfig)||void 0===i?void 0:i.web)||void 0===o?void 0:o.hasUserConsent),gppSid:e.applicableSections[0]||-1}}},206:(e,n)=>{"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.cacheKey=n.tokenKey=void 0,n.tokenKey="am_tokens",n.cacheKey="am"},425:e=>{"use strict";e.exports=function(){var e=null,n=document.createElement("iframe");n.id="3pc";const t="mediavine".startsWith("jo")?"journeymv":"mediavine";return n.src=`https://scripts.${t}.com/sync/check`,n.style.display="none",n.style.position="fixed",function(){return null!==e?Promise.resolve(e):new Promise((function(t){window.addEventListener("message",(function i(o){"3pc.supported"!==o.data&&"3pc.unsupported"!==o.data||(e="3pc.supported"===o.data,t({supported:e,timedOut:!1}),document.body.removeChild(n),window.removeEventListener("message",i))}),!1),setTimeout((function(){null===e&&(t({supported:e=!1,timedOut:!0}),document.body.removeChild(n))}),1e3),document.body.appendChild(n)}))}}()},838:function(e,n,t){"use strict";var i=this&&this.__awaiter||function(e,n,t,i){return new(t||(t=Promise))((function(o,r){function a(e){try{s(i.next(e))}catch(e){r(e)}}function c(e){try{s(i.throw(e))}catch(e){r(e)}}function s(e){var n;e.done?o(e.value):(n=e.value,n instanceof t?n:new t((function(e){e(n)}))).then(a,c)}s((i=i.apply(e,n||[])).next())}))};Object.defineProperty(n,"__esModule",{value:!0}),n.insertUserSyncIframe=n.syncMessageHandler=void 0;const o=t(576),r=t(206),a=t(694),c=t(712),s=(null==="//exchange.mediavine.com"?void 0:"//exchange.mediavine.com".includes("jo"))?"//exchange.journeymv.com":"//exchange.mediavine.com";function d(e){try{e.startsWith("//")&&(e=`${window.location.protocol}${e}`);const n=new URL(e);return"https:"===n.protocol||"http:"===n.protocol}catch(e){return!1}}function u(e,n){if(!d(e))return;const t=document.createElement("iframe");t.setAttribute("frameborder","0"),t.setAttribute("allowtransparency","true"),t.setAttribute("marginheight","0"),t.setAttribute("marginwidth","0"),t.setAttribute("width","0"),t.setAttribute("height","0"),t.setAttribute("hspace","0"),t.setAttribute("vspace","0"),t.setAttribute("scrolling","no"),t.setAttribute("sandbox","allow-scripts allow-same-origin"),t.style.height="0px",t.style.width="0px",t.style.display="none",t.src=e,n&&(t.addEventListener("load",n),t.addEventListener("error",n)),l(t,document,"html",!0)}function l(e,n,t,i){let o;n=n||document,o=t?n.getElementsByTagName(t):n.getElementsByTagName("head");try{if(o=o.length?o:n.getElementsByTagName("body"),o.length){o=o[0];const n=i?null:o.firstChild;return o.insertBefore(e,n)}}catch(e){}}n.syncMessageHandler=function(e){var n;if((null===(n=null==e?void 0:e.origin.split(":"))||void 0===n?void 0:n[1])!==s)return;const t=[];if(e.data&&"syncUrls"===e.data.message){const{tokens:n,syncUrls:p}=e.data;if((0,o.writeToAll)(r.tokenKey,n,r.cacheKey),(0,o.writeToAll)(`${r.tokenKey}_${(0,a.getUUIDVersion)()}`,n,r.cacheKey),e.origin.split(":")[1]!==s)return void console.log("Skipping sync",e.origin.split(":")[1]);(p||[]).forEach((e=>t.push(function(e){return i(this,arguments,void 0,(function*({type:e,url:n}){return d(n)?new Promise((t=>{switch(e){case c.SyncType.iframe:u(n,t);break;case c.SyncType.pixel:!function(e,n){if(!d(e))return;const t=document.createElement("div");t.style.position="absolute",t.style.left="0px",t.style.top="0px",t.style.visibility="hidden";const i=document.createElement("img");i.src=e,i.alt="",i.width=1,i.height=1,n&&(i.addEventListener("load",n),i.addEventListener("error",n)),t.appendChild(i),l(t,document,"html",!0)}(n,t)}})):Promise.resolve()}))}(e))))}},n.insertUserSyncIframe=u},694:(e,n,t)=>{"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.tokenIsValid=n.getUUIDVersion=void 0;const i=t(310);n.getUUIDVersion=()=>{const e="us-east-1".split("-")[0];return i.UUID_VERSION[e]||i.UUID_VERSION.us},n.tokenIsValid=function(e,n){return!(!(null==e?void 0:e.mv_uuid)||(null==e?void 0:e.version)!==n)}},189:function(e,n,t){"use strict";var i=this&&this.__awaiter||function(e,n,t,i){return new(t||(t=Promise))((function(o,r){function a(e){try{s(i.next(e))}catch(e){r(e)}}function c(e){try{s(i.throw(e))}catch(e){r(e)}}function s(e){var n;e.done?o(e.value):(n=e.value,n instanceof t?n:new t((function(e){e(n)}))).then(a,c)}s((i=i.apply(e,n||[])).next())}))};Object.defineProperty(n,"__esModule",{value:!0}),n.triggerPixel=n.getUsersyncUrl=n.getAndEncodePartners=n.Usersync=void 0;const o=t(576),r=t(326),a=t(206),c=t(838),s=t(694),d=t(425),u=(null==="//exchange.mediavine.com"?void 0:"//exchange.mediavine.com".includes("jo"))?"//exchange.journeymv.com":"//exchange.mediavine.com",l={mediavine:"//exchange.mediavine.com",pubnation:"//exchange.pubnation.com",journey:"//exchange.journeymv.com"};var p;!function(e){e.init=e=>i(this,[e],void 0,(function*({slug:e,gdpr:n,gdpr_compliance:t,alternateMvUuids:i=[],s2sBidders:o}){if((0,r.isServingNonPersonalizedAds)(n,t)||!(0,r.hasValidCMP)(n))return;d().then((e=>{window.$adManagementConfig&&window.$adManagementConfig.web&&(window.$adManagementConfig.web.tpc=e)})),window.addEventListener("message",c.syncMessageHandler,!1),v();const a=Object.values(l).filter((e=>e.split(":")[1]!==u)),s=yield Promise.all(a.map((e=>m([],i,e))));yield Promise.all(s.map((e=>new Promise((n=>(0,c.insertUserSyncIframe)(e,n))))));const p=yield m(o,i,u);(0,c.insertUserSyncIframe)(p)})),e.uuidVersion=(0,s.getUUIDVersion)()}(p||(n.Usersync=p={}));const v=()=>{window.addEventListener("UsersyncWriteToAll",(e=>{(0,o.writeToAll)("am_tokens",e.detail,"am"),(0,o.writeToAll)(`am_tokens_${p.uuidVersion}`,e.detail,"am")}),!1)};function f(e){const n={};return e.forEach((e=>{var t,i,o;(null===(o=null===(i=null===(t=window.$adManagementConfig)||void 0===t?void 0:t.web)||void 0===i?void 0:i.model)||void 0===o?void 0:o[e])&&(n[e]=window.$adManagementConfig.web.model[e])})),encodeURIComponent(JSON.stringify(n))}function m(e,n){return i(this,arguments,void 0,(function*(e,n,t=u){let i=`${t}/usersync/sync?origin=${document.location.origin}&src=${t}&s2sVersion=production`;const c=yield(0,o.readAndResolve)(`${a.tokenKey}_${p.uuidVersion}`);let d;if(yield(0,o.writeToAll)(a.tokenKey,c,a.cacheKey),(0,s.tokenIsValid)(c,p.uuidVersion))d=null==c?void 0:c.mv_uuid;else for(const e of n){const n=e.get();!d&&(0,s.tokenIsValid)(n,p.uuidVersion)&&(d=n.mv_uuid)}return d&&(i=`${i}&mv_uuid=${d}&version=${p.uuidVersion}`,n.forEach((e=>e.set({mv_uuid:d,version:p.uuidVersion})))),i+=(yield(0,r.getConsentParams)()),i+=`&p=${f(e)}`,i}))}n.getAndEncodePartners=f,n.getUsersyncUrl=m,n.triggerPixel=function(e){(new Image).src=`${e}&type=pixel`}}},n={};function t(i){var o=n[i];if(void 0!==o)return o.exports;var r=n[i]={exports:{}};return e[i].call(r.exports,r,r.exports,t),r.exports}t.n=e=>{var n=e&&e.__esModule?()=>e.default:()=>e;return t.d(n,{a:n}),n},t.d=(e,n)=>{for(var i in n)t.o(n,i)&&!t.o(e,i)&&Object.defineProperty(e,i,{enumerable:!0,get:n[i]})},t.o=(e,n)=>Object.prototype.hasOwnProperty.call(e,n),(()=>{"use strict";var e=t(189);window.$adManagementConfig=window.$adManagementConfig||{},window.$adManagementConfig.web=window.$adManagementConfig.web||{},window.$adManagementConfig.web.usersyncInit=e.Usersync.init})()})();