')})).join("");return e.adm+t}(r):r.adm;if(null==s)return null;var d=function(e,t,r){if(null!=e.w&&e.w>1&&null!=e.h&&e.h>1)return[e.w,e.h];var n=t.m[r];return null==n?[0,0]:[n.aw,n.ah]}(r,t.data,e),c=a===i.Mk?240:300;return u(n={requestId:e,cpm:r.price,width:d[0],height:d[1],creativeId:r.crid,currency:"USD",netRevenue:!0},a===i.pX?"vastXml":"ad",s),u(n,"meta",{advertiserDomains:r.adomain,mediaType:a}),u(n,"mediaType",a),u(n,"ttl","number"==typeof r.exp?r.exp:c),n}))})).filter((function(e){return null!=e}))})))},onSetTargeting:function(e){var t,r;null!=e&&I("pbst",{A:e.bidder,w:e.width,h:e.height,bid:e.adId,c1:e.mediaType,np:e.cpm,aud:e.requestId,a:e.adUnitCode,c2:(t=e.adserverTargeting,r=[],Object.keys(t||{}).forEach((function(e){r.push(h(e)+"="+h(String(t[e])))})),h(r.join("&")))})},onTimeout:function(e){null!=e&&I("pbto",{A:e.bidder,bid:e.bidId,a:e.adUnitCode,cn:e.timeout,aud:e.auctionId})},onBidWon:function(e){null!=e&&I("pbwin",{A:e.bidder,w:e.width,h:e.height,bid:e.adId,C:e.mediaType===i.Mk?0:1,np:e.cpm,a:e.adUnitCode})}};(0,n.dX)(w),window._apPbJs.installedModules.push("amxBidAdapter")}},function(e){e(e.s=8612)}]),(self._apPbJsChunk=self._apPbJsChunk||[]).push([[254],{8578:function(e,t,r){var n,i,a,o=r(9853),s=r(4806),d=r(1125),c=r(8265);function u(){return u=Object.assign||function(e){for(var t=1;t1?t-1:0),n=1;n0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r={};u(r,this.formatKeyValues(e.keyValues)),u(r,this.formatConsentData(t));var n="";return(0,o._each)(r,(function(e,t){n+="".concat(t,"=").concat(encodeURIComponent(e),";")})),n},formatOneMobileDynamicParams:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};this.isSecureProtocol()&&(e.secure=1),u(e,this.formatConsentData(t));var r="";return(0,o._each)(e,(function(e,t){r+="&".concat(t,"=").concat(encodeURIComponent(e))})),r},buildOpenRtbRequestData:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r={id:e.params.id,imp:e.params.imp};if(this.isEUConsentRequired(t)&&((0,s.Z)(r,"regs.ext.gdpr",1),t.gdpr.consentString&&(0,s.Z)(r,"user.ext.consent",t.gdpr.consentString)),t.uspConsent&&(0,s.Z)(r,"regs.ext.us_privacy",t.uspConsent),"object"===p(e.userId)){r.user=r.user||{},r.user.ext=r.user.ext||{};var n=k(e);n.length>0&&(r.user.ext.eids=n)}return r},isEUConsentRequired:function(e){return!!(e&&e.gdpr&&e.gdpr.gdprApplies)},formatKeyValues:function(e){var t={};return(0,o._each)(e,(function(e,r){t["kv".concat(r)]=e})),t},formatConsentData:function(e){var t={};return this.isEUConsentRequired(e)&&(t.gdpr=1,e.gdpr.consentString&&(t.euconsent=e.gdpr.consentString)),e.uspConsent&&(t.us_privacy=e.uspConsent),t},parsePixelItems:function(e){var t=/\w*(?=\s)/,r=/src=("|')(.*?)\1/,n=[];if(e){var i=e.match(/(img|iframe)[\s\S]*?src\s*=\s*("|')(.*?)\2/gi);i&&i.forEach((function(e){var i=e.match(t)[0],a=e.match(r)[2];i&&a&&n.push({type:"img"===i?"image":"iframe",url:a})}))}return n},_parseBidResponse:function(e,t){var r,n;try{r=e.seatbid[0].bid[0]}catch(e){return}if(r.ext&&r.ext.encp)n=r.ext.encp;else if(null===(n=r.price)||isNaN(n))return void(0,o.logError)("Invalid price in bid response",f,r);return{bidderCode:t.bidderCode,requestId:t.bidId,ad:r.adm,cpm:n,width:r.w,height:r.h,creativeId:r.crid||0,pubapiId:e.id,currency:e.cur||"USD",dealId:r.dealid,netRevenue:!0,meta:{advertiserDomains:r&&r.adomain?r.adomain:[]},ttl:t.ttl}},isOneMobileBidder:C,isSecureProtocol:function(){return"https:"===document.location.protocol}};(0,d.dX)(D),window._apPbJs.installedModules.push("aolBidAdapter")}},function(e){e(e.s=8578)}]),(self._apPbJsChunk=self._apPbJsChunk||[]).push([[864],{3231:function(e,t,r){var n=r(9853),i=r(265),a=r(4877),o=r(8962),s=r(1125),d=r(8265),c=r(4766),u=r(1879),p=r(1929),l=r(5849),f=r(9624);function m(e){return m="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},m(e)}function g(){return g=Object.assign||function(e){for(var t=1;te.length)&&(t=e.length);for(var r=0,n=new Array(t);r0&&(S.member_id=h),c&&(S.device=d),l&&(S.app=p);var O=o.vc.getConfig("appnexusAuctionKeywords");if((0,n.isPlainObject)(O)){var A=(0,n.transformBidderParamKeywords)(O);A.length>0&&A.forEach(P),S.keywords=A}if(o.vc.getConfig("adpod.brandCategoryExclusion")&&(S.brand_category_uniqueness=!0),m.enabled&&(S.debug=m,(0,n.logInfo)("AppNexus Debug Auction Settings:\n\n"+JSON.stringify(m,null,4))),t&&t.gdprConsent&&(S.gdpr_consent={consent_string:t.gdprConsent.consentString,consent_required:t.gdprConsent.gdprApplies},t.gdprConsent.addtlConsent&&-1!==t.gdprConsent.addtlConsent.indexOf("~"))){var x=t.gdprConsent.addtlConsent,k=x.substring(x.indexOf("~")+1);S.gdpr_consent.addtl_consent=k.split(".").map((function(e){return parseInt(e,10)}))}if(t&&t.uspConsent&&(S.us_privacy=t.uspConsent),t&&t.refererInfo){var U={rd_ref:encodeURIComponent(t.refererInfo.referer),rd_top:t.refererInfo.reachedTop,rd_ifs:t.refererInfo.numIframes,rd_stk:t.refererInfo.stack.map((function(e){return encodeURIComponent(e)})).join(",")};S.referrer_detection=U}if((0,u.sE)(e,z)&&e.filter(z).forEach((function(e){var t=function(e,t){var r=t.mediaTypes.video,i=r.durationRangeSec,a=r.requireExactDuration,o=function(e){var t=e.adPodDurationSec,r=e.durationRangeSec,i=e.requireExactDuration,a=(0,n.getMinValueFromArray)(r),o=Math.floor(t/a);return i?Math.max(o,r.length):o}(t.mediaTypes.video),s=(0,n.getMaxValueFromArray)(i),d=e.filter((function(e){return e.uuid===t.bidId})),c=n.fill.apply(void 0,v(d).concat([o]));if(a){var u=Math.ceil(o/i.length),p=(0,n.chunk)(c,u);i.forEach((function(e,t){p[t].map((function(t){F(t,"minduration",e),F(t,"maxduration",e)}))}))}else c.map((function(e){return F(e,"maxduration",s)}));return c}(r,e),i=S.tags.filter((function(t){return t.uuid!==e.bidId}));S.tags=[].concat(v(i),v(t))})),e[0].userId){var L=[];V(L,(0,i.Z)(e[0],"userId.flocId.id"),"chrome.com",null),V(L,(0,i.Z)(e[0],"userId.criteoId"),"criteo.com",null),V(L,(0,i.Z)(e[0],"userId.netId"),"netid.de",null),V(L,(0,i.Z)(e[0],"userId.idl_env"),"liveramp.com",null),V(L,(0,i.Z)(e[0],"userId.tdid"),"adserver.org","TDID"),V(L,(0,i.Z)(e[0],"userId.uid2.id"),"uidapi.com","UID2"),e[0].userId.pubProvidedId&&e[0].userId.pubProvidedId.forEach((function(e){e.uids.forEach((function(t){L.push({source:e.source,id:t.id})}))})),L.length&&(S.eids=L)}r[0].publisher_id&&(S.publisher_id=r[0].publisher_id);var W=function(e,t){var r=[],i={withCredentials:!0},a="https://ib.adnxs.com/ut/v3/prebid";if(D(t)||(a="https://ib.adnxs-simple.com/ut/v3/prebid"),"TRUE"!==(0,n.getParameterByName)("apn_test").toUpperCase()&&!0!==o.vc.getConfig("apn_test")||(i.customHeaders={"X-Is-Test":1}),e.tags.length>15){var s=(0,n.deepClone)(e);(0,n.chunk)(e.tags,15).forEach((function(e){s.tags=e;var n=JSON.stringify(s);r.push({method:"POST",url:a,data:n,bidderRequest:t,options:i})}))}else{var d=JSON.stringify(e);r={method:"POST",url:a,data:d,bidderRequest:t,options:i}}return r}(S,t);return W},interpretResponse:function(e,t){var r=this,o=t.bidderRequest;e=e.body;var c=[];if(!e||e.error){var l="in response for ".concat(o.bidderCode," adapter");return e&&e.error&&(l+=": ".concat(e.error)),(0,n.logError)(l),c}if(e.tags&&e.tags.forEach((function(e){var t,l=(t=e)&&t.ads&&t.ads.length&&(0,u.sE)(t.ads,(function(e){return e.rtb}));if(l&&(!0===f.S.get(o.bidderCode,"allowZeroCpmBids")?l.cpm>=0:l.cpm>0)&&(0,u.q9)(r.supportedMediaTypes,l.ad_type)){var m=function(e,t,r){var o=(0,n.getBidRequest)(e.uuid,[r]),c={requestId:e.uuid,cpm:t.cpm,creativeId:t.creative_id,dealId:t.deal_id,currency:"USD",netRevenue:!0,ttl:300,adUnitCode:o.adUnitCode,appnexus:{buyerMemberId:t.buyer_member_id,dealPriority:t.deal_priority,dealCode:t.deal_code}};if(t.adomain&&(c.meta=g({},c.meta,{advertiserDomains:[]})),t.advertiser_id&&(c.meta=g({},c.meta,{advertiserId:t.advertiser_id})),t.buyer_member_id&&(c.meta=g({},c.meta,{dchain:function(e){return{ver:"1.0",complete:0,nodes:[{bsid:e.buyer_member_id.toString()}]}}(t)})),t.brand_id&&(c.meta=g({},c.meta,{brandId:t.brand_id})),t.rtb.video)switch(g(c,{width:t.rtb.video.player_width,height:t.rtb.video.player_height,vastImpUrl:t.notify_url,ttl:3600}),(0,i.Z)(o,"mediaTypes.video.context")){case d.Oh:var l=(0,s.Q1)(o.bidder,t.brand_category_id);c.meta=g({},c.meta,{primaryCatId:l});var f=t.deal_priority;c.video={context:d.Oh,durationSeconds:Math.floor(t.rtb.video.duration_ms/1e3),dealTier:f},c.vastUrl=t.rtb.video.asset_url;break;case p.gZ:if(c.adResponse=e,c.adResponse.ad=c.adResponse.ads[0],c.adResponse.ad.video=c.adResponse.ad.rtb.video,c.vastXml=t.rtb.video.content,t.renderer_url){var m=(0,u.sE)(r.bids,(function(t){return t.bidId===e.uuid})),v=(0,i.Z)(m,"renderer.options");c.renderer=function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},i=a.Th.install({id:t.renderer_id,url:t.renderer_url,config:r,loaded:!1,adUnitCode:e});try{i.setRender(L)}catch(e){(0,n.logWarn)("Prebid Error calling setRender on renderer",e)}return i.setEventHandlers({impression:function(){return(0,n.logMessage)("AppNexus outstream video impression event")},loaded:function(){return(0,n.logMessage)("AppNexus outstream video loaded event")},ended:function(){(0,n.logMessage)("AppNexus outstream renderer video event"),document.querySelector("#".concat(e)).style.display="none"}}),i}(c.adUnitCode,t,v)}break;case p.LD:c.vastUrl=t.notify_url+"&redir="+encodeURIComponent(t.rtb.video.asset_url)}else if(t.rtb[d.B5]){var y=t.rtb[d.B5],b=t.viewability.config.replace("src=","data-src="),h=y.javascript_trackers;null==h?h=b:(0,n.isStr)(h)?h=[h,b]:h.push(b),c[d.B5]={title:y.title,body:y.desc,body2:y.desc2,cta:y.ctatext,rating:y.rating,sponsoredBy:y.sponsored,privacyLink:y.privacy_link,address:y.address,downloads:y.downloads,likes:y.likes,phone:y.phone,price:y.price,salePrice:y.saleprice,clickUrl:y.link.url,displayUrl:y.displayurl,clickTrackers:y.link.click_trackers,impressionTrackers:y.impression_trackers,javascriptTrackers:h},y.main_img&&(c.native.image={url:y.main_img.url,height:y.main_img.height,width:y.main_img.width}),y.icon&&(c.native.icon={url:y.icon.url,height:y.icon.height,width:y.icon.width})}else{g(c,{width:t.rtb.banner.width,height:t.rtb.banner.height,ad:t.rtb.banner.content});try{if(t.rtb.trackers)for(var _=0;_|)/gm,"\t").replace(/(<\/td>|<\/th>)/gm,"\n").replace(/^ /gm,"").replace(/( \n| )/gm,"\n").replace(/(.*)<\/h1>/gm,"\n\n===== $1 =====\n\n").replace(/(.*)<\/h[2-6]>/gm,"\n\n*** $1 ***\n\n").replace(/(<([^>]+)>)/gim,""),(0,n.logMessage)("https://console.appnexus.com/docs/understanding-the-debug-auction"),(0,n.logMessage)(m)}return c},getMappingFileInfo:function(){return{url:"https://acdn.adnxs-simple.com/prebid/appnexus-mapping/mappings.json",refreshInDays:2}},getUserSyncs:function(e,t,r){if(e.iframeEnabled&&D({gdprConsent:r}))return[{type:"iframe",url:"https://acdn.adnxs.com/dmp/async_usersync.html"}]},transformBidParams:function(e,t){var r=n.transformBidderParamKeywords;if(!0===t){var a=o.vc.getConfig("s2sConfig"),s=(0,i.Z)(a,"endpoint.p1Consent");s&&s.match("/openrtb2/prebid")&&(r=K)}return e=(0,n.convertTypes)({member:"string",invCode:"string",placementId:"number",keywords:r,publisherId:"number"},e),t&&(e.use_pmt_rule="boolean"==typeof e.usePaymentRule&&e.usePaymentRule,e.usePaymentRule&&delete e.usePaymentRule,x(e.keywords)&&e.keywords.forEach(P),Object.keys(e).forEach((function(t){var r=(0,n.convertCamelToUnderscore)(t);r!==t&&(e[r]=e[t],delete e[t])}))),e},onBidWon:function(e){e.native&&function(e){var t=function(e){var t;if((0,n.isStr)(e)&&k(e))t=e;else if((0,n.isArray)(e))for(var r=0;r0)}function P(e){x(e.value)&&""===e.value[0]&&delete e.value}function k(e){var t=e.match(O),r=null!=t&&t.length>=1,n=e.match("trk.js"),i=null!=n&&n.length>=1;return e.startsWith(" |