text: pbjsChunk([40],{100:function(e,r,a){a(101),e.exports=a(102)},101:function(e,r,a){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.spec=void 0;var t="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},s=Object.assign||function(e){for(var r=1;r<arguments.length;r++){var a=arguments[r];for(var t in a)Object.prototype.hasOwnProperty.call(a,t)&&(e[t]=a[t])}return e},i=a(20),n=(function(e){{if(e&&e.__esModule)return e;var r={};if(null!=e)for(var a in e)Object.prototype.hasOwnProperty.call(e,a)&&(r[a]=e[a]);return r.default=e,r}})(a(0)),d=a(6),o=a(13);var p=["id","mimes","minduration","maxduration","startdelay","skippable","playback_method","frameworks"],u=["age","external_uid","segments","gender","dnt","language"],c={body:"description",cta:"ctatext",image:{serverName:"main_image",requiredParams:{required:!0},minimumParams:{sizes:[{}]}},icon:{serverName:"icon",requiredParams:{required:!0},minimumParams:{sizes:[{}]}},sponsoredBy:"sponsored_by"},m=r.spec={code:"appnexusAst",supportedMediaTypes:[o.BANNER,o.VIDEO,o.NATIVE],isBidRequestValid:function(e){return!!(e.params.placementId||e.params.member&&e.params.invCode)},buildRequests:function(e,r){var a=e.map(l),t=e.find(y),s=void 0;t&&(s={},Object.keys(t.params.user).filter((function(e){return u.includes(e)})).forEach((function(e){return s[e]=t.params.user[e]})));var i=e.find(f),n=i?parseInt(i.params.member,10):0,d={tags:[].concat(function(e){if(Array.isArray(e)){for(var r=0,a=Array(e.length);r<e.length;r++)a[r]=e[r];return a}return Array.from(e)}(a)),user:s,sdk:{source:"pbjs",version:"0.34.0"}};return n>0&&(d.member_id=n),{method:"POST",url:"//ib.adnxs.com/ut/v3/prebid",data:JSON.stringify(d),bidderRequest:r}},interpretResponse:function(e,r){var a=this,t=r.bidderRequest;e=e.body;var d=[];if(!e||e.error){var p="in response for "+t.bidderCode+" adapter";return e&&e.error&&(p+=": "+e.error),n.logError(p),d}return e.tags&&e.tags.forEach((function(e){var r,t,p=(r=e)&&r.ads&&r.ads.length&&r.ads.find((function(e){return e.rtb}));if(p&&0!==p.cpm&&a.supportedMediaTypes.includes(p.ad_type)){var u=(function(e,r){var a={requestId:e.uuid,cpm:r.cpm,creativeId:r.creative_id,dealId:r.deal_id,currency:"USD",netRevenue:!0,ttl:300};if(r.rtb.video)s(a,{width:r.rtb.video.player_width,height:r.rtb.video.player_height,vastUrl:r.rtb.video.asset_url,descriptionUrl:r.rtb.video.asset_url,ttl:3600}),r.renderer_url&&(s(a,{adResponse:e,renderer:(function(e,r){var a=i.Renderer.install({id:r.renderer_id,url:r.renderer_url,config:{adText:"AppNexus Outstream Video Ad via Prebid.js"},loaded:!1});try{a.setRender(v)}catch(e){n.logWarn("Prebid Error calling setRender on renderer",e)}return a.setEventHandlers({impression:function(){return n.logMessage("AppNexus outstream video impression event")},loaded:function(){return n.logMessage("AppNexus outstream video loaded event")},ended:function(){n.logMessage("AppNexus outstream renderer video event"),document.querySelector("#"+e).style.display="none"}}),a})(a.adUnitCode,r)}),a.adResponse.ad=a.adResponse.ads[0],a.adResponse.ad.video=a.adResponse.ad.rtb.video);else if(r.rtb[o.NATIVE]){var t=r.rtb[o.NATIVE];a[o.NATIVE]={title:t.title,body:t.desc,cta:t.ctatext,sponsoredBy:t.sponsored,image:t.main_img&&t.main_img.url,icon:t.icon&&t.icon.url,clickUrl:t.link.url,clickTrackers:t.link.click_trackers,impressionTrackers:t.impression_trackers}}else{s(a,{width:r.rtb.banner.width,height:r.rtb.banner.height,ad:r.rtb.banner.content});try{var d=r.rtb.trackers[0].impression_urls[0],p=n.createTrackPixelHtml(d);a.ad+=p}catch(e){n.logError("Error appending tracking pixel",e)}}return a})(e,p);u.mediaType=(t=p.ad_type)===o.VIDEO?o.VIDEO:t===o.NATIVE?o.NATIVE:o.BANNER,d.push(u)}})),d},getUserSyncs:function(e){if(e.iframeEnabled)return[{type:"iframe",url:"//acdn.adnxs.com/ib/static/usersync/v3/async_usersync.html"}]}};function l(e){var r,a,i,d,u={};if(u.sizes=(function(e){var r=[],a={};if(n.isArray(e)&&2===e.length&&!n.isArray(e[0]))a.width=parseInt(e[0],10),a.height=parseInt(e[1],10),r.push(a);else if("object"===(void 0===e?"undefined":t(e)))for(var s=0;s<e.length;s++){var i=e[s];(a={}).width=parseInt(i[0],10),a.height=parseInt(i[1],10),r.push(a)}return r})(e.sizes),u.primary_size=u.sizes[0],u.ad_types=[],u.uuid=e.bidId,e.params.placementId?u.id=parseInt(e.params.placementId,10):u.code=e.params.invCode,u.allow_smaller_sizes=e.params.allowSmallerSizes||!1,u.use_pmt_rule=e.params.usePaymentRule||!1,u.prebid=!0,u.disable_psa=!0,e.params.reserve&&(u.reserve=e.params.reserve),e.params.position&&(u.position={above:1,below:2}[e.params.position]||0),e.params.trafficSourceCode&&(u.traffic_source_code=e.params.trafficSourceCode),e.params.privateSizes&&(u.private_sizes=getSizes(e.params.privateSizes)),e.params.supplyType&&(u.supply_type=e.params.supplyType),e.params.pubClick&&(u.pubclick=e.params.pubClick),e.params.extInvCode&&(u.ext_inv_code=e.params.extInvCode),e.params.externalImpId&&(u.external_imp_id=e.params.externalImpId),n.isEmpty(e.params.keywords)||(u.keywords=(r=e.params.keywords,a=[],n._each(r,(function(e,r){if(n.isArray(e)){var t=[];n._each(e,(function(e){(e=n.getValueString("keywords."+r,e))&&t.push(e)})),e=t}else{if(e=n.getValueString("keywords."+r,e),!n.isStr(e))return;e=[e]}a.push({key:r,value:e})})),a)),(e.mediaType===o.NATIVE||n.deepAccess(e,"mediaTypes.native"))&&(u.ad_types.push(o.NATIVE),e.nativeParams)){var m=(i=e.nativeParams,d={},Object.keys(i).forEach((function(e){var r=c[e]&&c[e].serverName||c[e]||e,a=c[e]&&c[e].requiredParams;d[r]=s({},a,i[e]);var t=c[e]&&c[e].minimumParams;if(a&&t){var n=Object.keys(i[e]),o=Object.keys(a);0===n.filter((function(e){return!o.includes(e)})).length&&(d[r]=s({},d[r],t))}})),d);u[o.NATIVE]={layouts:[m]}}var l=n.deepAccess(e,"mediaTypes.video"),y=n.deepAccess(e,"mediaTypes.video.context");return(e.mediaType===o.VIDEO||l)&&u.ad_types.push(o.VIDEO),(e.mediaType===o.VIDEO||l&&"outstream"!==y)&&(u.require_asset_url=!0),e.params.video&&(u.video={},Object.keys(e.params.video).filter((function(e){return p.includes(e)})).forEach((function(r){return u.video[r]=e.params.video[r]}))),(n.isEmpty(e.mediaType)&&n.isEmpty(e.mediaTypes)||e.mediaType===o.BANNER||e.mediaTypes&&e.mediaTypes[o.BANNER])&&u.ad_types.push(o.BANNER),u}function y(e){return!!e.params.user}function f(e){return!!parseInt(e.params.member,10)}function v(e){e.renderer.push((function(){window.ANOutstreamVideo.renderAd({tagId:e.adResponse.tag_id,sizes:[e.getSize().split("x")],targetId:e.adUnitCode,uuid:e.adResponse.uuid,adResponse:e.adResponse,rendererOptions:e.renderer.getConfig()},function(e,r,a){e.renderer.handleVideoEvent({id:r,eventName:a})}.bind(null,e))}))}(0,d.registerBidder)(m)},102:function(e,r){}},[100]);