text: pbjsChunk([66],{135:function(e,i,r){e.exports=r(136)},136:function(e,i,r){"use strict";var t=Object.assign||function(e){for(var i=1;i<arguments.length;i++){var r=arguments[i];for(var t in r)Object.prototype.hasOwnProperty.call(r,t)&&(e[t]=r[t])}return e},s=r(4),n=r(0),d=r(3),a=r(2),u=r(5),o=r(7).default,l=r(1),p="improvedigital",c=function(){var e=new o(p);e.idClient=new h("hb");e.getNormalizedBidRequest=function(e){var i=n.getBidIdParameter("placementCode",e)||null,r=n.getBidIdParameter("placementId",e.params)||null,t=null,s=null;null===r&&(t=n.getBidIdParameter("publisherId",e.params)||null,s=n.getBidIdParameter("placementKey",e.params)||null);var d=n.getBidIdParameter("keyValues",e.params)||null,a=n.getBidIdParameter("size",e.params)||null,u=n.getBidIdParameter("bidId",e),o={};return r?o.placementId=r:(t&&(o.publisherId=t),s&&(o.placementKey=s)),d&&(o.keyValues=d),a&&a.w&&a.h&&(o.size={},o.size.h=a.h,o.size.w=a.w),u&&(o.id=u),i&&(o.adUnitId=i),o};var i=function(e){var i=d.createBid(s.STATUS.NO_BID,e);i.bidderCode=p,a.addBidResponse(e.placementCode,i)};return pbjs.improveDigitalResponse=function(e){var r=n.getBidderRequestAllAdUnits(p);r&&r.bids&&r.bids.length>0&&n._each(r.bids,(function(r){var t=e.bid||[];n._each(t,(function(e){if(e.id===r.bidId){if(!e.price||null===e.price)return void i(r);if(e.errorCode&&0!==e.errorCode)return void i(r);if(!e.adm||null===e.adm||"string"!=typeof e.adm)return void i(r);var t=d.createBid(s.STATUS.GOOD,r),u="",o=e.sync&&e.sync.length>0?e.sync:[];n._each(o,(function(e){var i=e.replace(/\//g,"\\/");u=u+(""===u?'document.writeln("':"")+'<img src=\\"'+i+'\\" style=\\"display:none\\"/>'})),u+=""===u?"":'")';var l="";e.nurl&&e.nurl.length>0&&(l='<img src="'+e.nurl+'" width="0" height="0" style="display:none">'),t.ad=l+"<script>"+e.adm+u+"<\/script>",t.bidderCode=p,t.cpm=parseFloat(e.price),t.width=e.w,t.height=e.h,a.addBidResponse(r.placementCode,t)}}))}))},e.callBids=function(e){var i=this,r=e.bids||[],t=n.getTopWindowLocation(),s={singleRequestMode:!1,httpRequestType:this.idClient.CONSTANTS.HTTP_REQUEST_TYPE.GET,callback:"pbjs.improveDigitalResponse",secure:"https:"===t.protocol?1:0,libVersion:this.LIB_VERSION},d=r.map((function(e){var r=i.getNormalizedBidRequest(e);return e.params&&e.params.singleRequest&&(s.singleRequestMode=!0),r})),a=this.idClient.createRequest(d,s);a.errors&&a.errors.length>0&&n.logError("ID WARNING 0x01"),a&&a.requests&&a.requests[0]&&n._each(a.requests,(function(e){e.url&&u.loadScript(e.url,null)}))},t(this,{LIB_VERSION:"3.0.5",idClient:e.idClient,getNormalizedBidRequest:e.getNormalizedBidRequest,callBids:e.callBids})};function h(e){this.CONSTANTS={HTTP_REQUEST_TYPE:{GET:0,POST:1},HTTP_SECURITY:{STANDARD:0,SECURE:1},AD_SERVER_BASE_URL:"ad.360yield.com",END_POINT:e||"hb",AD_SERVER_URL_PARAM:"?jsonp=",CLIENT_VERSION:"JS-4.0.2",MAX_URL_LENGTH:2083,ERROR_CODES:{BAD_HTTP_REQUEST_TYPE_PARAM:1,MISSING_PLACEMENT_PARAMS:2,LIB_VERSION_MISSING:3}},this.getErrorReturn=function(e){return{idMappings:{},requests:{},errorCode:e}},this.createRequest=function(e,i,r){if(i.httpRequestType!==this.CONSTANTS.HTTP_REQUEST_TYPE.GET)return this.getErrorReturn(this.CONSTANTS.ERROR_CODES.BAD_HTTP_REQUEST_TYPE_PARAM);if(!i.libVersion)return this.getErrorReturn(this.CONSTANTS.ERROR_CODES.LIB_VERSION_MISSING);var t=[],s=void 0,d=void 0;if(n.isArray(e))for(d=0;d<e.length;d++)s=this.createImpressionObject(e[d]),t.push(s);else s=this.createImpressionObject(e),t.push(s);var a={idMappings:[],requests:[]},u=null,o=(1===i.secure?"https":"http")+"://"+this.CONSTANTS.AD_SERVER_BASE_URL+"/"+this.CONSTANTS.END_POINT+this.CONSTANTS.AD_SERVER_URL_PARAM,l={bid_request:this.createBasicBidRequestObject(i,r)};for(d=0;d<t.length;d++)if((s=t[d]).errorCode)(u=u||[]).push({errorCode:s.errorCode,adUnitId:s.adUnitId});else{a.idMappings.push({adUnitId:s.adUnitId,id:s.impressionObject.id}),l.bid_request.imp=l.bid_request.imp||[],l.bid_request.imp.push(s.impressionObject);var p=encodeURIComponent(o+JSON.stringify(l));i.singleRequestMode||(a.requests.push({url:o+encodeURIComponent(JSON.stringify(l))}),l={bid_request:this.createBasicBidRequestObject(i,r)}),p.length>this.CONSTANTS.MAX_URL_LENGTH&&l.bid_request.imp.length>1&&(l.bid_request.imp.pop(),a.requests.push({url:o+encodeURIComponent(JSON.stringify(l))}),(l={bid_request:this.createBasicBidRequestObject(i,r)}).bid_request.imp=[],l.bid_request.imp.push(s.impressionObject))}return l.bid_request&&l.bid_request.imp&&l.bid_request.imp.length>0&&(a.requests=a.requests||[],a.requests.push({url:o+encodeURIComponent(JSON.stringify(l))})),u&&(a.errors=u),a},this.createBasicBidRequestObject=function(e,i){var r={};if(e.requestId?r.id=e.requestId:r.id=n.getUniqueIdentifierStr(),e.domain&&(r.domain=e.domain),e.page&&(r.page=e.page),e.ref&&(r.ref=e.ref),e.callback&&(r.callback=e.callback),"secure"in e&&(r.secure=e.secure),e.libVersion&&(r.version=e.libVersion+"-"+this.CONSTANTS.CLIENT_VERSION),i)for(var t in i)r[t]=i[t];return r},this.createImpressionObject=function(e){var i={},r={};if(i.impressionObject=r,e.id?r.id=e.id:r.id=n.getUniqueIdentifierStr(),e.adUnitId&&(i.adUnitId=e.adUnitId),e.placementId&&(r.pid=e.placementId),e.publisherId&&(r.pubid=e.publisherId),e.placementKey&&(r.pkey=e.placementKey),e.transactionId&&(r.tid=e.transactionId),e.keyValues)for(var t in e.keyValues)for(var s=0;s<e.keyValues[t].length;s++)r.kvw=r.kvw||{},r.kvw[t]=r.kvw[t]||[],r.kvw[t].push(e.keyValues[t][s]);return e.size&&e.size.w&&e.size.h?(r.banner={},r.banner.w=e.size.w,r.banner.h=e.size.h):r.banner={},r.pid||r.pubid||r.pkey||r.banner&&r.banner.w&&r.banner.h||(i.impressionObject=null,i.errorCode=this.CONSTANTS.ERROR_CODES.MISSING_PLACEMENT_PARAMS),i}}c.createNew=function(){return new c},l.registerBidAdapter(new c,p),e.exports=c,i.ImproveDigitalAdServerJSClient=h}},[135]);