prebid-universal-creative 1.9.0 → 1.13.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/creative.js +3 -3
- package/dist/creative.max.js +86 -15
- package/dist/load-cookie-with-consent.html +1 -1
- package/dist/load-cookie.html +1 -1
- package/dist/native-render.js +3 -3
- package/dist/native-trk.js +3 -3
- package/dist/prebid-mobile-rewarded-vast.xml +22 -0
- package/dist/uid.js +2 -2
- package/gulpfile.js +9 -4
- package/package.json +1 -1
- package/src/cookieSync.js +27 -3
- package/src/cookieSyncWithConsent.js +46 -4
- package/src/renderingManager.js +64 -5
- package/src/utils.js +24 -15
- package/static/prebid-mobile-rewarded-vast.xml +22 -0
- package/test/spec/renderingManager_spec.js +84 -0
- package/testpages/amp_cookiesync.html +1 -1
- package/testpages/amp_cookiesync_with_consent.html +1 -1
package/dist/creative.js
CHANGED
@@ -1,3 +1,3 @@
|
|
1
|
-
/* prebid-universal-creative v1.
|
2
|
-
Updated : 2021-
|
3
|
-
!function(r){var n={};function o(t){if(n[t])return n[t].exports;var e=n[t]={i:t,l:!1,exports:{}};return r[t].call(e.exports,e,e.exports,o),e.l=!0,e.exports}o.m=r,o.c=n,o.d=function(t,e,r){o.o(t,e)||Object.defineProperty(t,e,{configurable:!1,enumerable:!0,get:r})},o.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return o.d(e,"a",e),e},o.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},o.p="",o(o.s=1)}([function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.getEmptyIframe=function(t,e){var r=document.createElement("iframe");return r.setAttribute("frameborder",0),r.setAttribute("scrolling","no"),r.setAttribute("marginheight",0),r.setAttribute("marginwidth",0),r.setAttribute("TOPMARGIN",0),r.setAttribute("LEFTMARGIN",0),r.setAttribute("allowtransparency","true"),r.setAttribute("width",e),r.setAttribute("height",t),r},e.insertElement=function(t,e,r){var n;e=e||document,n=r?e.getElementsByTagName(r):e.getElementsByTagName("head");try{(n=n.length?n:e.getElementsByTagName("body")).length&&(n=n[0]).insertBefore(t,n.firstChild)}catch(t){}}},function(t,e,r){"use strict";var n=r(2),o=r(5);window.ucTag=window.ucTag||{};var i=(0,o.newEnvironment)(window),a=(0,n.newRenderingManager)(window,i);window.ucTag.renderAd=a.renderAd},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.newRenderingManager=function(h,s){function f(t){if(t){var e=t.split("x").map(Number);!function(n,o){if(s.isSafeFrame()){var i=h.innerWidth,a=h.innerHeight;i===n&&a===o||(h.$sf.ext.register(n,o,function(t){var e=n-i,r=o-a;h.$sf.ext.expand({r:e,b:r,push:!0})}),h.parent.postMessage({sentinel:"amp",type:"embed-size",width:n,height:o},"*"))}}(e[0],e[1])}else console.log("Targeting key hb_size not found to resize creative")}function n(t,e,r,n,o,i){var a=2<arguments.length&&void 0!==r?r:"",s=3<arguments.length?n:void 0,c=4<arguments.length?o:void 0,u=5<arguments.length?i:void 0,l="Prebid_";if(a.substr(0,l.length)===l)!function(t){var e=h.localStorage.getItem(t);d(!0)(e)}(a),f(s);else{var p="".concat(function(t,e){var r=void 0===e||""===e?v:e;return"https://".concat(void 0===t||""===t?m:t).concat(r)}(t,e),"?uuid=").concat(a);f(s),y.sendRequest(p,d(u,c))}}function d(s,c){return function(t){var e=function(t){var e;try{e=JSON.parse(t)}catch(t){console.log("Error parsing response from cache host: ".concat(t))}return e}(t),r=y.getCreativeCommentMarkup(e),n=e.width?e.width:e.w,o=e.height?e.height:e.h;if(e.wurl&&(0,y.triggerPixel)(decodeURIComponent(e.wurl)),e.adm)e.adm=c?e.adm.replace("${AUCTION_PRICE}",c):e.adm.replace("${AUCTION_PRICE}",""),r+=s?u(e.adm,n,o):e.adm,e.nurl&&(r+=y.createTrackPixelHtml(decodeURIComponent(e.nurl))),y.writeAdHtml(r);else if(e.nurl)if(s){r+=u(y.loadScript(h,e.nurl).outerHTML,n,o),y.writeAdHtml(r)}else{var i=e.nurl,a=y.getCreativeComment(e);g.insertElement(a,document,"body"),y.writeAdUrl(i,n,o)}e.burl&&y.triggerBurl(e.burl)}}function u(t,e,r){var n=y.getUUID();return'<div id="'.concat(n,'" style="border-style: none; position: absolute; width:100%; height:100%;">\n <div id="').concat(n,'_inner" style="margin: 0 auto; width:').concat(e,"px; height:").concat(r,'px; position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%);">').concat(t,"</div>\n </div>")}return{renderAd:function(t,e){var r=y.transformAuctionTargetingData(e);s.isMobileApp(r.env)?n(r.cacheHost,r.cachePath,r.uuid,r.size,r.hbPb,!0):s.isAmp(r.uuid)?n(r.cacheHost,r.cachePath,r.uuid,r.size,r.hbPb):s.canLocatePrebid()?function(t,e){for(var r=h,n=0;n<10;n++)if((r=r.parent).pbjs)try{r.pbjs.renderAd(t,e);break}catch(t){continue}}(t,r.adId):function(p,t,e){var r,n=1<arguments.length&&void 0!==t?t:"",o=2<arguments.length?e:void 0,i=h.location,a=y.parseUrl(o),f=a.protocol+"://"+a.host,s=n||h.location.hostname,c=i.protocol+"//"+s;function u(t){var e=t.message?"message":"data",r={};try{r=JSON.parse(t[e])}catch(t){return}var n=t.origin||t.originalEvent.origin;if(r.message&&"Prebid Response"===r.message&&f===n&&r.adId===p&&(r.ad||r.adUrl)){var o=h.document.body,i=r.ad,a=r.adUrl,s=r.width,c=r.height;if("video"===r.mediaType)console.log("Error trying to write ad.");else if(i){var u=g.getEmptyIframe(r.height,r.width);o.appendChild(u),u.contentDocument.open(),u.contentDocument.write(i),u.contentDocument.close()}else if(a){var l=g.getEmptyIframe(c,s);l.style.display="inline",l.style.overflow="hidden",l.src=a,g.insertElement(l,document,"body")}else console.log("Error trying to write ad. No ad for bid response id: ".concat(id))}}h.addEventListener("message",u,!1),r=JSON.stringify({message:"Prebid Request",adId:p,adServerDomain:c}),h.parent.postMessage(r,f)}(r.adId,r.adServerDomain,r.pubUrl)}}};var y=n(r(3)),g=n(r(0));function a(){if("function"!=typeof WeakMap)return null;var t=new WeakMap;return a=function(){return t},t}function n(t){if(t&&t.__esModule)return t;var e=a();if(e&&e.has(t))return e.get(t);var r={};if(null!=t){var n=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var o in t)if(Object.prototype.hasOwnProperty.call(t,o)){var i=n?Object.getOwnPropertyDescriptor(t,o):null;i&&(i.get||i.set)?Object.defineProperty(r,o,i):r[o]=t[o]}}return r.default=t,e&&e.set(t,r),r}var m="prebid.adnxs.com",v="/pbc/v1/cache"},function(t,n,e){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.triggerPixel=function(t,e){var r=new Image;e&&"function"==typeof e&&(r.addEventListener("load",e),r.addEventListener("error",e));r.src=t},n.createTrackPixelHtml=function(t){if(!t)return"";var e=encodeURI(t);return'<div style="position:absolute;left:0px;top:0px;visibility:hidden;"><img src="'.concat(e,'"></div>')},n.writeAdUrl=function(t,e,r){var n=o.getEmptyIframe(r,e);n.src=t,document.body.appendChild(n)},n.writeAdHtml=function(t){r(document.body,t)},n.sendRequest=function(t,e){var r=new XMLHttpRequest;r.addEventListener("load",function(){e(r.responseText)}),r.open("GET",t),r.send()},n.getUUID=function(){var r=(new Date).getTime();return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(t){var e=(r+16*Math.random())%16|0;return r=Math.floor(r/16),("x"===t?e:3&e|8).toString(16)})},n.loadScript=function(t,e,r){var n=t.document,o=n.createElement("script");o.type="text/javascript",r&&"function"==typeof r&&(o.readyState?o.onreadystatechange=function(){"loaded"!==o.readyState&&"complete"!==o.readyState||(o.onreadystatechange=null,r())}:o.onload=function(){r()});o.src=e;var i=n.getElementsByTagName("head");(i=i.length?i:n.getElementsByTagName("body")).length&&(i=i[0]).insertBefore(o,i.firstChild);return o},n.getCreativeComment=function(t){return document.createComment("Creative ".concat(t.crid," served by Prebid.js Header Bidding"))},n.getCreativeCommentMarkup=function(t){var e=n.getCreativeComment(t),r=document.createElement("div");return r.appendChild(e),r.innerHTML},n.transformAuctionTargetingData=function(e){var r={hb_adid:"adId",hb_cache_host:"cacheHost",hb_cache_path:"cachePath",hb_cache_id:"uuid",hb_format:"mediaType",hb_env:"env",hb_size:"size",hb_pb:"hbPb"};function t(t){return!(!e[t]||!(function(t){return i(t,"Object")}(e[t])&&0<Object.keys(e[t]).length||s(e[t])&&""!==e[t]))}var n={},o={};t("targetingMap")?o=function(e){var r={};return Object.keys(e).forEach(function(t){Array.isArray(e[t])&&0<e[t].length&&(r[t]=e[t][0])}),r}(e.targetingMap):t("targetingKeywords")&&(o=function(t){var o={},e=t.split(",");return 0<e.length&&e.forEach(function(t){var e=t.split(":");if(2===e.length){var r=e[0],n=e[1];o[r]=n}}),o}(e.targetingKeywords));return function(e){Object.keys(e).forEach(function(t){n[r[t]||t]=e[t]})}(o),Object.keys(e).forEach(function(t){"targetingMap"!==t&&"targetingKeywords"!==t&&s(e[t])&&""!==e[t]&&(n[t]=e[t])}),n},n.parseUrl=function(t){var e=document.createElement("a");return e.href=decodeURIComponent(t),{href:e.href,protocol:(e.protocol||"").replace(/:$/,""),hostname:e.hostname,port:+e.port,pathname:e.pathname.replace(/^(?!\/)/,"/"),hash:(e.hash||"").replace(/^#/,""),host:(e.host||window.location.host).replace(/:(443|80)$/,"")}};var o=function(t){if(t&&t.__esModule)return t;var e=a();if(e&&e.has(t))return e.get(t);var r={};if(null!=t){var n=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var o in t)if(Object.prototype.hasOwnProperty.call(t,o)){var i=n?Object.getOwnPropertyDescriptor(t,o):null;i&&(i.get||i.set)?Object.defineProperty(r,o,i):r[o]=t[o]}}r.default=t,e&&e.set(t,r);return r}(e(0));function a(){if("function"!=typeof WeakMap)return null;var t=new WeakMap;return a=function(){return t},t}var r=e(4);function i(t,e){return Object.prototype.toString.call(t)==="[object "+e+"]"}function s(t){return i(t,"String")}},function(t,e,r){var n;n=function(){return o={},r.m=n=[function(t,e,r){"use strict";var n,o=r(1),i=(n=o)&&n.__esModule?n:{default:n};t.exports=i.default},function(t,e,r){"use strict";e.__esModule=!0;var s=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var r=arguments[e];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(t[n]=r[n])}return t};e.default=d;var n,o=r(2),c=(n=o)&&n.__esModule?n:{default:n},i=function(t){{if(t&&t.__esModule)return t;var e={};if(null!=t)for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e.default=t,e}}(r(4));function u(){}var a={afterAsync:u,afterDequeue:u,afterStreamStart:u,afterWrite:u,autoFix:!0,beforeEnqueue:u,beforeWriteToken:function(t){return t},beforeWrite:function(t){return t},done:u,error:function(t){throw new Error(t.msg)},releaseAsync:!1},l=0,p=[],f=null;function h(){var t=p.shift();if(t){var e=i.last(t);e.afterDequeue(),t.stream=function(t,e,n){(f=new c.default(t,n)).id=l++,f.name=n.name||f.id,d.streams[f.name]=f;var r=t.ownerDocument,o={close:r.close,open:r.open,write:r.write,writeln:r.writeln};function i(t){t=n.beforeWrite(t),f.write(t),n.afterWrite(t)}s(r,{close:u,open:u,write:function(){for(var t=arguments.length,e=Array(t),r=0;r<t;r++)e[r]=arguments[r];return i(e.join(""))},writeln:function(){for(var t=arguments.length,e=Array(t),r=0;r<t;r++)e[r]=arguments[r];return i(e.join("")+"\n")}});var a=f.win.onerror||u;return f.win.onerror=function(t,e,r){n.error({msg:t+" - "+e+": "+r}),a.apply(f.win,[t,e,r])},f.write(e,function(){s(r,o),f.win.onerror=a,n.done(),f=null,h()}),f}.apply(void 0,t),e.afterStreamStart()}}function d(t,e,r){if(i.isFunction(r))r={done:r};else if("clear"===r)return p=[],f=null,void(l=0);r=i.defaults(r,a);var n=[t=/^#/.test(t)?window.document.getElementById(t.substr(1)):t.jquery?t[0]:t,e,r];return t.postscribe={cancel:function(){n.stream?n.stream.abort():n[1]=u}},r.beforeEnqueue(n),p.push(n),f||h(),t.postscribe}s(d,{streams:{},queue:p,WriteStream:c.default})},function(t,e,r){"use strict";e.__esModule=!0;var n,s=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var r=arguments[e];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(t[n]=r[n])}return t},o=r(3),i=(n=o)&&n.__esModule?n:{default:n},a=function(t){{if(t&&t.__esModule)return t;var e={};if(null!=t)for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e.default=t,e}}(r(4));var l="data-ps-",p="ps-style",f="ps-script";function c(t,e){var r=l+e,n=t.getAttribute(r);return a.existy(n)?String(n):n}function u(t,e,r){var n=2<arguments.length&&void 0!==r?r:null,o=l+e;a.existy(n)&&""!==n?t.setAttribute(o,n):t.removeAttribute(o)}var h=(d.prototype.write=function(){var t;for((t=this.writeQueue).push.apply(t,arguments);!this.deferredRemote&&this.writeQueue.length;){var e=this.writeQueue.shift();a.isFunction(e)?this._callFunction(e):this._writeImpl(e)}},d.prototype._callFunction=function(t){var e={type:"function",value:t.name||t.toString()};this._onScriptStart(e),t.call(this.win,this.doc),this._onScriptDone(e)},d.prototype._writeImpl=function(t){this.parser.append(t);for(var e=void 0,r=void 0,n=void 0,o=[];(e=this.parser.readToken())&&!(r=a.isScript(e))&&!(n=a.isStyle(e));)(e=this.options.beforeWriteToken(e))&&o.push(e);0<o.length&&this._writeStaticTokens(o),r&&this._handleScriptToken(e),n&&this._handleStyleToken(e)},d.prototype._writeStaticTokens=function(t){var e=this._buildChunk(t);return e.actual?(e.html=this.proxyHistory+e.actual,this.proxyHistory+=e.proxy,this.proxyRoot.innerHTML=e.html,this._walkChunk(),e):null},d.prototype._buildChunk=function(t){for(var e=this.actuals.length,r=[],n=[],o=[],i=t.length,a=0;a<i;a++){var s=t[a],c=s.toString();if(r.push(c),s.attrs){if(!/^noscript$/i.test(s.tagName)){var u=e++;n.push(c.replace(/(\/?>)/," "+l+"id="+u+" $1")),s.attrs.id!==f&&s.attrs.id!==p&&o.push("atomicTag"===s.type?"":"<"+s.tagName+" "+l+"proxyof="+u+(s.unary?" />":">"))}}else n.push(c),o.push("endTag"===s.type?c:"")}return{tokens:t,raw:r.join(""),actual:n.join(""),proxy:o.join("")}},d.prototype._walkChunk=function(){for(var t=void 0,e=[this.proxyRoot];a.existy(t=e.shift());){var r=1===t.nodeType;if(!r||!c(t,"proxyof")){r&&u(this.actuals[c(t,"id")]=t,"id");var n=t.parentNode&&c(t.parentNode,"proxyof");n&&this.actuals[n].appendChild(t)}e.unshift.apply(e,a.toArray(t.childNodes))}},d.prototype._handleScriptToken=function(t){var e=this,r=this.parser.clear();r&&this.writeQueue.unshift(r),t.src=t.attrs.src||t.attrs.SRC,(t=this.options.beforeWriteToken(t))&&(t.src&&this.scriptStack.length?this.deferredRemote=t:this._onScriptStart(t),this._writeScriptToken(t,function(){e._onScriptDone(t)}))},d.prototype._handleStyleToken=function(t){var e=this.parser.clear();e&&this.writeQueue.unshift(e),t.type=t.attrs.type||t.attrs.TYPE||"text/css",(t=this.options.beforeWriteToken(t))&&this._writeStyleToken(t),e&&this.write()},d.prototype._writeStyleToken=function(t){var e=this._buildStyle(t);this._insertCursor(e,p),t.content&&(e.styleSheet&&!e.sheet?e.styleSheet.cssText=t.content:e.appendChild(this.doc.createTextNode(t.content)))},d.prototype._buildStyle=function(t){var r=this.doc.createElement(t.tagName);return r.setAttribute("type",t.type),a.eachKey(t.attrs,function(t,e){r.setAttribute(t,e)}),r},d.prototype._insertCursor=function(t,e){this._writeImpl('<span id="'+e+'"/>');var r=this.doc.getElementById(e);r&&r.parentNode.replaceChild(t,r)},d.prototype._onScriptStart=function(t){t.outerWrites=this.writeQueue,this.writeQueue=[],this.scriptStack.unshift(t)},d.prototype._onScriptDone=function(t){t===this.scriptStack[0]?(this.scriptStack.shift(),this.write.apply(this,t.outerWrites),!this.scriptStack.length&&this.deferredRemote&&(this._onScriptStart(this.deferredRemote),this.deferredRemote=null)):this.options.error({msg:"Bad script nesting or script finished twice"})},d.prototype._writeScriptToken=function(t,e){var r=this._buildScript(t),n=this._shouldRelease(r),o=this.options.afterAsync;t.src&&(r.src=t.src,this._scriptLoadHandler(r,n?o:function(){e(),o()}));try{this._insertCursor(r,f),r.src&&!n||e()}catch(t){this.options.error(t),e()}},d.prototype._buildScript=function(t){var r=this.doc.createElement(t.tagName);return a.eachKey(t.attrs,function(t,e){r.setAttribute(t,e)}),t.content&&(r.text=t.content),r},d.prototype._scriptLoadHandler=function(e,r){function n(){e=e.onload=e.onreadystatechange=e.onerror=null}var o=this.options.error;function t(){n(),null!=r&&r(),r=null}function i(t){n(),o(t),null!=r&&r(),r=null}function a(t,e){var r=t["on"+e];null!=r&&(t["_on"+e]=r)}a(e,"load"),a(e,"error"),s(e,{onload:function(){if(e._onload)try{e._onload.apply(this,Array.prototype.slice.call(arguments,0))}catch(t){i({msg:"onload handler failed "+t+" @ "+e.src})}t()},onerror:function(){if(e._onerror)try{e._onerror.apply(this,Array.prototype.slice.call(arguments,0))}catch(t){return void i({msg:"onerror handler failed "+t+" @ "+e.src})}i({msg:"remote script failed "+e.src})},onreadystatechange:function(){/^(loaded|complete)$/.test(e.readyState)&&t()}})},d.prototype._shouldRelease=function(t){return!/^script$/i.test(t.nodeName)||!!(this.options.releaseAsync&&t.src&&t.hasAttribute("async"))},d);function d(t){var e=1<arguments.length&&void 0!==arguments[1]?arguments[1]:{};!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,d),this.root=t,this.options=e,this.doc=t.ownerDocument,this.win=this.doc.defaultView||this.doc.parentWindow,this.parser=new i.default("",{autoFix:e.autoFix}),this.actuals=[t],this.proxyHistory="",this.proxyRoot=this.doc.createElement(t.nodeName),this.scriptStack=[],this.writeQueue=[],u(this.proxyRoot,"proxyof",0)}e.default=h},function(t,e,r){var n;n=function(){return o={},r.m=n=[function(t,e,r){"use strict";var n,o=r(1),i=(n=o)&&n.__esModule?n:{default:n};t.exports=i.default},function(t,e,r){"use strict";e.__esModule=!0;var n,a=u(r(2)),o=u(r(3)),i=r(6),s=(n=i)&&n.__esModule?n:{default:n},c=r(5);function u(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e.default=t,e}var l={comment:/^<!--/,endTag:/^<\//,atomicTag:/^<\s*(script|style|noscript|iframe|textarea)[\s\/>]/i,startTag:/^</,chars:/^[^<]/},p=(f.prototype.append=function(t){this.stream+=t},f.prototype.prepend=function(t){this.stream=t+this.stream},f.prototype._readTokenImpl=function(){var t=this._peekTokenImpl();if(t)return this.stream=this.stream.slice(t.length),t},f.prototype._peekTokenImpl=function(){for(var t in l)if(l.hasOwnProperty(t)&&l[t].test(this.stream)){var e=o[t](this.stream);if(e)return"startTag"===e.type&&/script|style/i.test(e.tagName)?null:(e.text=this.stream.substr(0,e.length),e)}},f.prototype.peekToken=function(){return this._peekToken()},f.prototype.readToken=function(){return this._readToken()},f.prototype.readTokens=function(t){for(var e=void 0;e=this.readToken();)if(t[e.type]&&!1===t[e.type](e))return},f.prototype.clear=function(){var t=this.stream;return this.stream="",t},f.prototype.rest=function(){return this.stream},f);function f(){var t=this,e=0<arguments.length&&void 0!==arguments[0]?arguments[0]:"",r=1<arguments.length&&void 0!==arguments[1]?arguments[1]:{};!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,f),this.stream=e;var n=!1,o={};for(var i in a)a.hasOwnProperty(i)&&(r.autoFix&&(o[i+"Fix"]=!0),n=n||o[i+"Fix"]);n?(this._readToken=(0,s.default)(this,o,function(){return t._readTokenImpl()}),this._peekToken=(0,s.default)(this,o,function(){return t._peekTokenImpl()})):(this._readToken=this._readTokenImpl,this._peekToken=this._peekTokenImpl)}for(var h in(e.default=p).tokenToString=function(t){return t.toString()},p.escapeAttributes=function(t){var e={};for(var r in t)t.hasOwnProperty(r)&&(e[r]=(0,c.escapeQuotes)(t[r],null));return e},p.supports=a)a.hasOwnProperty(h)&&(p.browserHasFlaw=p.browserHasFlaw||!a[h]&&h)},function(t,e){"use strict";var r=!(e.__esModule=!0),n=!1,o=window.document.createElement("div");try{var i="<P><I></P></I>";o.innerHTML=i,e.tagSoup=r=o.innerHTML!==i}catch(t){e.tagSoup=r=!1}try{o.innerHTML="<P><i><P></P></i></P>",e.selfClose=n=2===o.childNodes.length}catch(t){e.selfClose=n=!1}o=null,e.tagSoup=r,e.selfClose=n},function(t,e,r){"use strict";e.__esModule=!0;var a="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t};e.comment=function(t){var e=t.indexOf("--\x3e");if(0<=e)return new s.CommentToken(t.substr(4,e-1),e+3)},e.chars=function(t){var e=t.indexOf("<");return new s.CharsToken(0<=e?e:t.length)},e.startTag=o,e.atomicTag=function(t){var e=o(t);if(e){var r=t.slice(e.length);if(r.match(new RegExp("</\\s*"+e.tagName+"\\s*>","i"))){var n=r.match(new RegExp("([\\s\\S]*?)</\\s*"+e.tagName+"\\s*>","i"));if(n)return new s.AtomicTagToken(e.tagName,n[0].length+e.length,e.attrs,e.booleanAttrs,n[1])}}},e.endTag=function(t){var e=t.match(c.endTag);if(e)return new s.EndTagToken(e[1],e[0].length)};var s=r(4),c={startTag:/^<([\-A-Za-z0-9_]+)((?:\s+[\w\-]+(?:\s*=?\s*(?:(?:"[^"]*")|(?:'[^']*')|[^>\s]+))?)*)\s*(\/?)>/,endTag:/^<\/([\-A-Za-z0-9_]+)[^>]*>/,attr:/(?:([\-A-Za-z0-9_]+)\s*=\s*(?:(?:"((?:\\.|[^"])*)")|(?:'((?:\\.|[^'])*)')|([^>\s]+)))|(?:([\-A-Za-z0-9_]+)(\s|$)+)/g,fillAttr:/^(checked|compact|declare|defer|disabled|ismap|multiple|nohref|noresize|noshade|nowrap|readonly|selected)$/i};function o(t){var r,n,o;if(-1!==t.indexOf(">")){var e=t.match(c.startTag);if(e){var i=(r={},n={},o=e[2],e[2].replace(c.attr,function(t,e){arguments[2]||arguments[3]||arguments[4]||arguments[5]?arguments[5]?(r[arguments[5]]="",n[arguments[5]]=!0):r[e]=arguments[2]||arguments[3]||arguments[4]||c.fillAttr.test(e)&&e||"":r[e]="",o=o.replace(t,"")}),{v:new s.StartTagToken(e[1],e[0].length,r,n,!!e[3],o.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,""))});if("object"===(void 0===i?"undefined":a(i)))return i.v}}}},function(t,e,r){"use strict";e.__esModule=!0,e.EndTagToken=e.AtomicTagToken=e.StartTagToken=e.TagToken=e.CharsToken=e.CommentToken=e.Token=void 0;var a=r(5);function s(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}e.Token=function t(e,r){s(this,t),this.type=e,this.length=r,this.text=""},e.CommentToken=(n.prototype.toString=function(){return"\x3c!--"+this.content},n);function n(t,e){s(this,n),this.type="comment",this.length=e||(t?t.length:0),this.text="",this.content=t}e.CharsToken=(o.prototype.toString=function(){return this.text},o);function o(t){s(this,o),this.type="chars",this.length=t,this.text=""}var i=e.TagToken=(c.formatTag=function(t,e){var r=1<arguments.length&&void 0!==e?e:null,n="<"+t.tagName;for(var o in t.attrs)if(t.attrs.hasOwnProperty(o)){n+=" "+o;var i=t.attrs[o];void 0!==t.booleanAttrs&&void 0!==t.booleanAttrs[o]||(n+='="'+(0,a.escapeQuotes)(i)+'"')}return t.rest&&(n+=" "+t.rest),t.unary&&!t.html5Unary?n+="/>":n+=">",null!=r&&(n+=r+"</"+t.tagName+">"),n},c);function c(t,e,r,n,o){s(this,c),this.type=t,this.length=r,this.text="",this.tagName=e,this.attrs=n,this.booleanAttrs=o,this.unary=!1,this.html5Unary=!1}e.StartTagToken=(u.prototype.toString=function(){return i.formatTag(this)},u);function u(t,e,r,n,o,i){s(this,u),this.type="startTag",this.length=e,this.text="",this.tagName=t,this.attrs=r,this.booleanAttrs=n,this.html5Unary=!1,this.unary=o,this.rest=i}e.AtomicTagToken=(l.prototype.toString=function(){return i.formatTag(this,this.content)},l);function l(t,e,r,n,o){s(this,l),this.type="atomicTag",this.length=e,this.text="",this.tagName=t,this.attrs=r,this.booleanAttrs=n,this.unary=!1,this.html5Unary=!1,this.content=o}e.EndTagToken=(p.prototype.toString=function(){return"</"+this.tagName+">"},p);function p(t,e){s(this,p),this.type="endTag",this.length=e,this.text="",this.tagName=t}},function(t,e){"use strict";e.__esModule=!0,e.escapeQuotes=function(t){var e=1<arguments.length&&void 0!==arguments[1]?arguments[1]:"";return t?t.replace(/([^"]*)"/g,function(t,e){return/\\/.test(e)?e+'"':e+'\\"'}):e}},function(t,e){"use strict";e.__esModule=!0,e.default=function(r,n,e){var o=function(){var t=[];return t.last=function(){return this[this.length-1]},t.lastTagNameEq=function(t){var e=this.last();return e&&e.tagName&&e.tagName.toUpperCase()===t.toUpperCase()},t.containsTagName=function(t){for(var e,r=0;e=this[r];r++)if(e.tagName===t)return!0;return!1},t}(),i={startTag:function(t){var e=t.tagName;"TR"===e.toUpperCase()&&o.lastTagNameEq("TABLE")?(r.prepend("<TBODY>"),a()):n.selfCloseFix&&s.test(e)&&o.containsTagName(e)?o.lastTagNameEq(e)?u(r,o):(r.prepend("</"+t.tagName+">"),a()):t.unary||o.push(t)},endTag:function(t){o.last()?n.tagSoupFix&&!o.lastTagNameEq(t.tagName)?u(r,o):o.pop():n.tagSoupFix&&(e(),a())}};function a(){var t=function(t,e){var r=t.stream,n=c(e());return t.stream=r,n}(r,e);t&&i[t.type]&&i[t.type](t)}return function(){return a(),c(e())}};var r=/^(AREA|BASE|BASEFONT|BR|COL|FRAME|HR|IMG|INPUT|ISINDEX|LINK|META|PARAM|EMBED)$/i,s=/^(COLGROUP|DD|DT|LI|OPTIONS|P|TD|TFOOT|TH|THEAD|TR)$/i;function c(t){return t&&"startTag"===t.type&&(t.unary=r.test(t.tagName)||t.unary,t.html5Unary=!/\/>$/.test(t.text)),t}function u(t,e){var r=e.pop();t.prepend("</"+r.tagName+">")}}],r.c=o,r.p="",r(0);function r(t){if(o[t])return o[t].exports;var e=o[t]={exports:{},id:t,loaded:!1};return n[t].call(e.exports,e,e.exports,r),e.loaded=!0,e.exports}var n,o},t.exports=n()},function(t,e){"use strict";e.__esModule=!0;var n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t};function o(t){return null!=t}function i(t,e,r){var n=void 0,o=t&&t.length||0;for(n=0;n<o;n++)e.call(r,t[n],n)}function a(t,e,r){for(var n in t)t.hasOwnProperty(n)&&e.call(r,n,t[n])}function r(t,e){return!(!t||"startTag"!==t.type&&"atomicTag"!==t.type||!("tagName"in t))&&!!~t.tagName.toLowerCase().indexOf(e)}e.existy=o,e.isFunction=function(t){return"function"==typeof t},e.each=i,e.eachKey=a,e.defaults=function(r,t){return r=r||{},a(t,function(t,e){o(r[t])||(r[t]=e)}),r},e.toArray=function(r){try{return Array.prototype.slice.call(r)}catch(t){var e=function(){var e=[];return i(r,function(t){e.push(t)}),{v:e}}();if("object"===(void 0===e?"undefined":n(e)))return e.v}},e.last=function(t){return t[t.length-1]},e.isTag=r,e.isScript=function(t){return r(t,"script")},e.isStyle=function(t){return r(t,"style")}}],r.c=o,r.p="",r(0);function r(t){if(o[t])return o[t].exports;var e=o[t]={exports:{},id:t,loaded:!1};return n[t].call(e.exports,e,e.exports,r),e.loaded=!0,e.exports}var n,o},t.exports=n()},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.newEnvironment=function(r){function e(){return r.top!==r&&!function(t){try{return t.top.location.toString(),!0}catch(t){return!1}}(r)}return{isMobileApp:function(t){return t&&"mobile-app"===t},isCrossDomain:e,isSafeFrame:function(){return!(!r.$sf||!r.$sf.ext)},isAmp:function(t){return"string"==typeof t&&""!==t&&e()},canLocatePrebid:function(){for(var t=!1,e=r;!t;){try{if(e.pbjs){t=!0;break}}catch(t){}if(e===window.top)break;e=e.parent}return t}}}}]);
|
1
|
+
/* prebid-universal-creative v1.13.0
|
2
|
+
Updated : 2021-12-09 */
|
3
|
+
!function(r){var n={};function o(t){if(n[t])return n[t].exports;var e=n[t]={i:t,l:!1,exports:{}};return r[t].call(e.exports,e,e.exports,o),e.l=!0,e.exports}o.m=r,o.c=n,o.d=function(t,e,r){o.o(t,e)||Object.defineProperty(t,e,{configurable:!1,enumerable:!0,get:r})},o.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return o.d(e,"a",e),e},o.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},o.p="",o(o.s=1)}([function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.getEmptyIframe=function(t,e){var r=document.createElement("iframe");return r.setAttribute("frameborder",0),r.setAttribute("scrolling","no"),r.setAttribute("marginheight",0),r.setAttribute("marginwidth",0),r.setAttribute("TOPMARGIN",0),r.setAttribute("LEFTMARGIN",0),r.setAttribute("allowtransparency","true"),r.setAttribute("width",e),r.setAttribute("height",t),r},e.insertElement=function(t,e,r){var n;e=e||document,n=r?e.getElementsByTagName(r):e.getElementsByTagName("head");try{(n=n.length?n:e.getElementsByTagName("body")).length&&(n=n[0]).insertBefore(t,n.firstChild)}catch(t){}}},function(t,e,r){"use strict";var n=r(2),o=r(5);window.ucTag=window.ucTag||{};var i=(0,o.newEnvironment)(window),a=(0,n.newRenderingManager)(window,i);window.ucTag.renderAd=a.renderAd},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.newRenderingManager=function(d,s){function f(t){if(t){var e=t.split("x").map(Number);!function(n,o){if(s.isSafeFrame()){var i=d.innerWidth,a=d.innerHeight;i===n&&a===o||(d.$sf.ext.register(n,o,function(t){var e=n-i,r=o-a;d.$sf.ext.expand({r:e,b:r,push:!0})}),d.parent.postMessage({sentinel:"amp",type:"embed-size",width:n,height:o},"*"))}}(e[0],e[1])}else console.log("Targeting key hb_size not found to resize creative")}function n(t,e,r,n,o,i){var a=2<arguments.length&&void 0!==r?r:"",s=3<arguments.length?n:void 0,c=4<arguments.length?o:void 0,u=5<arguments.length?i:void 0,l="Prebid_";if(a.substr(0,l.length)===l)!function(t){var e=d.localStorage.getItem(t);h(!0)(e)}(a),f(s);else{var p="".concat(function(t,e){var r=void 0===e||""===e?v:e;return"https://".concat(void 0===t||""===t?g:t).concat(r)}(t,e),"?uuid=").concat(a);f(s),m.sendRequest(p,h(u,c))}}function h(u,l){return function(t){var e=function(t){var e;try{e=JSON.parse(t)}catch(t){console.log("Error parsing response from cache host: ".concat(t))}return e}(t),r=e.price||l,n=m.getCreativeCommentMarkup(e),o=e.width?e.width:e.w,i=e.height?e.height:e.h;if(e.wurl&&(0,m.triggerPixel)(decodeURIComponent(e.wurl)),e.adm){if(e.adm=r?e.adm.replace("${AUCTION_PRICE}",r):e.adm.replace("${AUCTION_PRICE}",""),n+=u?p(e.adm,o,i):e.adm,e.nurl&&(n+=m.createTrackPixelHtml(decodeURIComponent(e.nurl))),e.burl){var a=function(){m.triggerPixel(e.burl)};if(u)m.loadScript(d,"mraid.js",function(){!function(e){function r(t){0<t&&(mraid.removeEventListener("exposureChange",r),e())}function n(t){t&&(mraid.removeEventListener("viewableChange",n),e())}function o(){d.MRAID_ENV&&3<=parseFloat(d.MRAID_ENV.version)?mraid.addEventListener("exposureChange",r):d.MRAID_ENV&&parseFloat(d.MRAID_ENV.version)<3&&(mraid.isViewable()?e():mraid.addEventListener("viewableChange",n))}return!(!d.mraid||!d.MRAID_ENV)&&("loading"==mraid.getState()?mraid.addEventListener("ready",function t(){mraid.removeEventListener("ready",t),o()}):o(),!0)}(a)&&a()},a);else a()}m.writeAdHtml(n)}else if(e.nurl)if(u){n+=p(m.loadScript(d,e.nurl).outerHTML,o,i),m.writeAdHtml(n)}else{var s=e.nurl,c=m.getCreativeComment(e);y.insertElement(c,document,"body"),m.writeAdUrl(s,o,i)}}}function p(t,e,r){var n=m.getUUID();return'<div id="'.concat(n,'" style="border-style: none; position: absolute; width:100%; height:100%;">\n <div id="').concat(n,'_inner" style="margin: 0 auto; width:').concat(e,"px; height:").concat(r,'px; position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%);">').concat(t,"</div>\n </div>")}return{renderAd:function(t,e){var r=m.transformAuctionTargetingData(e);s.isMobileApp(r.env)?n(r.cacheHost,r.cachePath,r.uuid,r.size,r.hbPb,!0):s.isAmp(r.uuid)?n(r.cacheHost,r.cachePath,r.uuid,r.size,r.hbPb):s.canLocatePrebid()?function(t,e){for(var r=d,n=0;n<10;n++)if((r=r.parent).pbjs)try{r.pbjs.renderAd(t,e);break}catch(t){continue}}(t,r.adId):function(p,t,e){var r,n=1<arguments.length&&void 0!==t?t:"",o=2<arguments.length?e:void 0,i=d.location,a=m.parseUrl(o),f=a.protocol+"://"+a.host,s=n||d.location.hostname,c=i.protocol+"//"+s;function u(t){var e=t.message?"message":"data",r={};try{r=JSON.parse(t[e])}catch(t){return}var n=t.origin||t.originalEvent.origin;if(r.message&&"Prebid Response"===r.message&&f===n&&r.adId===p&&(r.ad||r.adUrl)){var o=d.document.body,i=r.ad,a=r.adUrl,s=r.width,c=r.height;if("video"===r.mediaType)console.log("Error trying to write ad.");else if(i){var u=y.getEmptyIframe(r.height,r.width);o.appendChild(u),u.contentDocument.open(),u.contentDocument.write(i),u.contentDocument.close()}else if(a){var l=y.getEmptyIframe(c,s);l.style.display="inline",l.style.overflow="hidden",l.src=a,y.insertElement(l,document,"body")}else console.log("Error trying to write ad. No ad for bid response id: ".concat(id))}}d.addEventListener("message",u,!1),r=JSON.stringify({message:"Prebid Request",adId:p,adServerDomain:c}),d.parent.postMessage(r,f)}(r.adId,r.adServerDomain,r.pubUrl)}}};var m=n(r(3)),y=n(r(0));function a(){if("function"!=typeof WeakMap)return null;var t=new WeakMap;return a=function(){return t},t}function n(t){if(t&&t.__esModule)return t;var e=a();if(e&&e.has(t))return e.get(t);var r={};if(null!=t){var n=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var o in t)if(Object.prototype.hasOwnProperty.call(t,o)){var i=n?Object.getOwnPropertyDescriptor(t,o):null;i&&(i.get||i.set)?Object.defineProperty(r,o,i):r[o]=t[o]}}return r.default=t,e&&e.set(t,r),r}var g="prebid.adnxs.com",v="/pbc/v1/cache"},function(t,n,e){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.triggerPixel=function(t,e){var r=new Image;e&&"function"==typeof e&&(r.addEventListener("load",e),r.addEventListener("error",e));r.src=t},n.createTrackPixelHtml=function(t){if(!t)return"";var e=encodeURI(t);return'<div style="position:absolute;left:0px;top:0px;visibility:hidden;"><img src="'.concat(e,'"></div>')},n.writeAdUrl=function(t,e,r){var n=o.getEmptyIframe(r,e);n.src=t,document.body.appendChild(n)},n.writeAdHtml=function(t){r(document.body,t,{error:console.error})},n.sendRequest=function(t,e){var r=new XMLHttpRequest;r.addEventListener("load",function(){e(r.responseText)}),r.open("GET",t),r.send()},n.getUUID=function(){var r=(new Date).getTime();return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(t){var e=(r+16*Math.random())%16|0;return r=Math.floor(r/16),("x"===t?e:3&e|8).toString(16)})},n.loadScript=function(t,e,r,n){var o=t.document,i=o.createElement("script");i.type="text/javascript",r&&"function"==typeof r&&(i.readyState?i.onreadystatechange=function(){"loaded"!==i.readyState&&"complete"!==i.readyState||(i.onreadystatechange=null,r())}:i.onload=function(){r()});n&&"function"==typeof n&&(i.onerror=function(){n()});i.src=e;var a=o.getElementsByTagName("head");(a=a.length?a:o.getElementsByTagName("body")).length&&(a=a[0]).insertBefore(i,a.firstChild);return i},n.getCreativeComment=function(t){return document.createComment("Creative ".concat(t.crid," served by Prebid.js Header Bidding"))},n.getCreativeCommentMarkup=function(t){var e=n.getCreativeComment(t),r=document.createElement("div");return r.appendChild(e),r.innerHTML},n.transformAuctionTargetingData=function(e){var r={hb_adid:"adId",hb_cache_host:"cacheHost",hb_cache_path:"cachePath",hb_cache_id:"uuid",hb_format:"mediaType",hb_env:"env",hb_size:"size",hb_pb:"hbPb"};function t(t){return!(!e[t]||!(function(t){return i(t,"Object")}(e[t])&&0<Object.keys(e[t]).length||s(e[t])&&""!==e[t]))}var n={},o={};t("targetingMap")?o=function(e){var r={};return Object.keys(e).forEach(function(t){Array.isArray(e[t])&&0<e[t].length&&(r[t]=e[t][0])}),r}(e.targetingMap):t("targetingKeywords")&&(o=function(t){var o={},e=t.split(",");return 0<e.length&&e.forEach(function(t){var e=t.split(":");if(2===e.length){var r=e[0],n=e[1];o[r]=n}}),o}(e.targetingKeywords));return function(e){Object.keys(e).forEach(function(t){n[r[t]||t]=e[t]})}(o),Object.keys(e).forEach(function(t){"targetingMap"!==t&&"targetingKeywords"!==t&&s(e[t])&&""!==e[t]&&(n[t]=e[t])}),n},n.parseUrl=function(t){var e=document.createElement("a");return e.href=decodeURIComponent(t),{href:e.href,protocol:(e.protocol||"").replace(/:$/,""),hostname:e.hostname,port:+e.port,pathname:e.pathname.replace(/^(?!\/)/,"/"),hash:(e.hash||"").replace(/^#/,""),host:(e.host||window.location.host).replace(/:(443|80)$/,"")}};var o=function(t){if(t&&t.__esModule)return t;var e=a();if(e&&e.has(t))return e.get(t);var r={};if(null!=t){var n=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var o in t)if(Object.prototype.hasOwnProperty.call(t,o)){var i=n?Object.getOwnPropertyDescriptor(t,o):null;i&&(i.get||i.set)?Object.defineProperty(r,o,i):r[o]=t[o]}}r.default=t,e&&e.set(t,r);return r}(e(0));function a(){if("function"!=typeof WeakMap)return null;var t=new WeakMap;return a=function(){return t},t}var r=e(4);function i(t,e){return Object.prototype.toString.call(t)==="[object "+e+"]"}function s(t){return i(t,"String")}},function(t,e,r){var n;n=function(){return o={},r.m=n=[function(t,e,r){"use strict";var n,o=r(1),i=(n=o)&&n.__esModule?n:{default:n};t.exports=i.default},function(t,e,r){"use strict";e.__esModule=!0;var s=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var r=arguments[e];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(t[n]=r[n])}return t};e.default=h;var n,o=r(2),c=(n=o)&&n.__esModule?n:{default:n},i=function(t){{if(t&&t.__esModule)return t;var e={};if(null!=t)for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e.default=t,e}}(r(4));function u(){}var a={afterAsync:u,afterDequeue:u,afterStreamStart:u,afterWrite:u,autoFix:!0,beforeEnqueue:u,beforeWriteToken:function(t){return t},beforeWrite:function(t){return t},done:u,error:function(t){throw new Error(t.msg)},releaseAsync:!1},l=0,p=[],f=null;function d(){var t=p.shift();if(t){var e=i.last(t);e.afterDequeue(),t.stream=function(t,e,n){(f=new c.default(t,n)).id=l++,f.name=n.name||f.id,h.streams[f.name]=f;var r=t.ownerDocument,o={close:r.close,open:r.open,write:r.write,writeln:r.writeln};function i(t){t=n.beforeWrite(t),f.write(t),n.afterWrite(t)}s(r,{close:u,open:u,write:function(){for(var t=arguments.length,e=Array(t),r=0;r<t;r++)e[r]=arguments[r];return i(e.join(""))},writeln:function(){for(var t=arguments.length,e=Array(t),r=0;r<t;r++)e[r]=arguments[r];return i(e.join("")+"\n")}});var a=f.win.onerror||u;return f.win.onerror=function(t,e,r){n.error({msg:t+" - "+e+": "+r}),a.apply(f.win,[t,e,r])},f.write(e,function(){s(r,o),f.win.onerror=a,n.done(),f=null,d()}),f}.apply(void 0,t),e.afterStreamStart()}}function h(t,e,r){if(i.isFunction(r))r={done:r};else if("clear"===r)return p=[],f=null,void(l=0);r=i.defaults(r,a);var n=[t=/^#/.test(t)?window.document.getElementById(t.substr(1)):t.jquery?t[0]:t,e,r];return t.postscribe={cancel:function(){n.stream?n.stream.abort():n[1]=u}},r.beforeEnqueue(n),p.push(n),f||d(),t.postscribe}s(h,{streams:{},queue:p,WriteStream:c.default})},function(t,e,r){"use strict";e.__esModule=!0;var n,s=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var r=arguments[e];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(t[n]=r[n])}return t},o=r(3),i=(n=o)&&n.__esModule?n:{default:n},a=function(t){{if(t&&t.__esModule)return t;var e={};if(null!=t)for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e.default=t,e}}(r(4));var l="data-ps-",p="ps-style",f="ps-script";function c(t,e){var r=l+e,n=t.getAttribute(r);return a.existy(n)?String(n):n}function u(t,e,r){var n=2<arguments.length&&void 0!==r?r:null,o=l+e;a.existy(n)&&""!==n?t.setAttribute(o,n):t.removeAttribute(o)}var d=(h.prototype.write=function(){var t;for((t=this.writeQueue).push.apply(t,arguments);!this.deferredRemote&&this.writeQueue.length;){var e=this.writeQueue.shift();a.isFunction(e)?this._callFunction(e):this._writeImpl(e)}},h.prototype._callFunction=function(t){var e={type:"function",value:t.name||t.toString()};this._onScriptStart(e),t.call(this.win,this.doc),this._onScriptDone(e)},h.prototype._writeImpl=function(t){this.parser.append(t);for(var e=void 0,r=void 0,n=void 0,o=[];(e=this.parser.readToken())&&!(r=a.isScript(e))&&!(n=a.isStyle(e));)(e=this.options.beforeWriteToken(e))&&o.push(e);0<o.length&&this._writeStaticTokens(o),r&&this._handleScriptToken(e),n&&this._handleStyleToken(e)},h.prototype._writeStaticTokens=function(t){var e=this._buildChunk(t);return e.actual?(e.html=this.proxyHistory+e.actual,this.proxyHistory+=e.proxy,this.proxyRoot.innerHTML=e.html,this._walkChunk(),e):null},h.prototype._buildChunk=function(t){for(var e=this.actuals.length,r=[],n=[],o=[],i=t.length,a=0;a<i;a++){var s=t[a],c=s.toString();if(r.push(c),s.attrs){if(!/^noscript$/i.test(s.tagName)){var u=e++;n.push(c.replace(/(\/?>)/," "+l+"id="+u+" $1")),s.attrs.id!==f&&s.attrs.id!==p&&o.push("atomicTag"===s.type?"":"<"+s.tagName+" "+l+"proxyof="+u+(s.unary?" />":">"))}}else n.push(c),o.push("endTag"===s.type?c:"")}return{tokens:t,raw:r.join(""),actual:n.join(""),proxy:o.join("")}},h.prototype._walkChunk=function(){for(var t=void 0,e=[this.proxyRoot];a.existy(t=e.shift());){var r=1===t.nodeType;if(!r||!c(t,"proxyof")){r&&u(this.actuals[c(t,"id")]=t,"id");var n=t.parentNode&&c(t.parentNode,"proxyof");n&&this.actuals[n].appendChild(t)}e.unshift.apply(e,a.toArray(t.childNodes))}},h.prototype._handleScriptToken=function(t){var e=this,r=this.parser.clear();r&&this.writeQueue.unshift(r),t.src=t.attrs.src||t.attrs.SRC,(t=this.options.beforeWriteToken(t))&&(t.src&&this.scriptStack.length?this.deferredRemote=t:this._onScriptStart(t),this._writeScriptToken(t,function(){e._onScriptDone(t)}))},h.prototype._handleStyleToken=function(t){var e=this.parser.clear();e&&this.writeQueue.unshift(e),t.type=t.attrs.type||t.attrs.TYPE||"text/css",(t=this.options.beforeWriteToken(t))&&this._writeStyleToken(t),e&&this.write()},h.prototype._writeStyleToken=function(t){var e=this._buildStyle(t);this._insertCursor(e,p),t.content&&(e.styleSheet&&!e.sheet?e.styleSheet.cssText=t.content:e.appendChild(this.doc.createTextNode(t.content)))},h.prototype._buildStyle=function(t){var r=this.doc.createElement(t.tagName);return r.setAttribute("type",t.type),a.eachKey(t.attrs,function(t,e){r.setAttribute(t,e)}),r},h.prototype._insertCursor=function(t,e){this._writeImpl('<span id="'+e+'"/>');var r=this.doc.getElementById(e);r&&r.parentNode.replaceChild(t,r)},h.prototype._onScriptStart=function(t){t.outerWrites=this.writeQueue,this.writeQueue=[],this.scriptStack.unshift(t)},h.prototype._onScriptDone=function(t){t===this.scriptStack[0]?(this.scriptStack.shift(),this.write.apply(this,t.outerWrites),!this.scriptStack.length&&this.deferredRemote&&(this._onScriptStart(this.deferredRemote),this.deferredRemote=null)):this.options.error({msg:"Bad script nesting or script finished twice"})},h.prototype._writeScriptToken=function(t,e){var r=this._buildScript(t),n=this._shouldRelease(r),o=this.options.afterAsync;t.src&&(r.src=t.src,this._scriptLoadHandler(r,n?o:function(){e(),o()}));try{this._insertCursor(r,f),r.src&&!n||e()}catch(t){this.options.error(t),e()}},h.prototype._buildScript=function(t){var r=this.doc.createElement(t.tagName);return a.eachKey(t.attrs,function(t,e){r.setAttribute(t,e)}),t.content&&(r.text=t.content),r},h.prototype._scriptLoadHandler=function(e,r){function n(){e=e.onload=e.onreadystatechange=e.onerror=null}var o=this.options.error;function t(){n(),null!=r&&r(),r=null}function i(t){n(),o(t),null!=r&&r(),r=null}function a(t,e){var r=t["on"+e];null!=r&&(t["_on"+e]=r)}a(e,"load"),a(e,"error"),s(e,{onload:function(){if(e._onload)try{e._onload.apply(this,Array.prototype.slice.call(arguments,0))}catch(t){i({msg:"onload handler failed "+t+" @ "+e.src})}t()},onerror:function(){if(e._onerror)try{e._onerror.apply(this,Array.prototype.slice.call(arguments,0))}catch(t){return void i({msg:"onerror handler failed "+t+" @ "+e.src})}i({msg:"remote script failed "+e.src})},onreadystatechange:function(){/^(loaded|complete)$/.test(e.readyState)&&t()}})},h.prototype._shouldRelease=function(t){return!/^script$/i.test(t.nodeName)||!!(this.options.releaseAsync&&t.src&&t.hasAttribute("async"))},h);function h(t){var e=1<arguments.length&&void 0!==arguments[1]?arguments[1]:{};!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,h),this.root=t,this.options=e,this.doc=t.ownerDocument,this.win=this.doc.defaultView||this.doc.parentWindow,this.parser=new i.default("",{autoFix:e.autoFix}),this.actuals=[t],this.proxyHistory="",this.proxyRoot=this.doc.createElement(t.nodeName),this.scriptStack=[],this.writeQueue=[],u(this.proxyRoot,"proxyof",0)}e.default=d},function(t,e,r){var n;n=function(){return o={},r.m=n=[function(t,e,r){"use strict";var n,o=r(1),i=(n=o)&&n.__esModule?n:{default:n};t.exports=i.default},function(t,e,r){"use strict";e.__esModule=!0;var n,a=u(r(2)),o=u(r(3)),i=r(6),s=(n=i)&&n.__esModule?n:{default:n},c=r(5);function u(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e.default=t,e}var l={comment:/^<!--/,endTag:/^<\//,atomicTag:/^<\s*(script|style|noscript|iframe|textarea)[\s\/>]/i,startTag:/^</,chars:/^[^<]/},p=(f.prototype.append=function(t){this.stream+=t},f.prototype.prepend=function(t){this.stream=t+this.stream},f.prototype._readTokenImpl=function(){var t=this._peekTokenImpl();if(t)return this.stream=this.stream.slice(t.length),t},f.prototype._peekTokenImpl=function(){for(var t in l)if(l.hasOwnProperty(t)&&l[t].test(this.stream)){var e=o[t](this.stream);if(e)return"startTag"===e.type&&/script|style/i.test(e.tagName)?null:(e.text=this.stream.substr(0,e.length),e)}},f.prototype.peekToken=function(){return this._peekToken()},f.prototype.readToken=function(){return this._readToken()},f.prototype.readTokens=function(t){for(var e=void 0;e=this.readToken();)if(t[e.type]&&!1===t[e.type](e))return},f.prototype.clear=function(){var t=this.stream;return this.stream="",t},f.prototype.rest=function(){return this.stream},f);function f(){var t=this,e=0<arguments.length&&void 0!==arguments[0]?arguments[0]:"",r=1<arguments.length&&void 0!==arguments[1]?arguments[1]:{};!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,f),this.stream=e;var n=!1,o={};for(var i in a)a.hasOwnProperty(i)&&(r.autoFix&&(o[i+"Fix"]=!0),n=n||o[i+"Fix"]);n?(this._readToken=(0,s.default)(this,o,function(){return t._readTokenImpl()}),this._peekToken=(0,s.default)(this,o,function(){return t._peekTokenImpl()})):(this._readToken=this._readTokenImpl,this._peekToken=this._peekTokenImpl)}for(var d in(e.default=p).tokenToString=function(t){return t.toString()},p.escapeAttributes=function(t){var e={};for(var r in t)t.hasOwnProperty(r)&&(e[r]=(0,c.escapeQuotes)(t[r],null));return e},p.supports=a)a.hasOwnProperty(d)&&(p.browserHasFlaw=p.browserHasFlaw||!a[d]&&d)},function(t,e){"use strict";var r=!(e.__esModule=!0),n=!1,o=window.document.createElement("div");try{var i="<P><I></P></I>";o.innerHTML=i,e.tagSoup=r=o.innerHTML!==i}catch(t){e.tagSoup=r=!1}try{o.innerHTML="<P><i><P></P></i></P>",e.selfClose=n=2===o.childNodes.length}catch(t){e.selfClose=n=!1}o=null,e.tagSoup=r,e.selfClose=n},function(t,e,r){"use strict";e.__esModule=!0;var a="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t};e.comment=function(t){var e=t.indexOf("--\x3e");if(0<=e)return new s.CommentToken(t.substr(4,e-1),e+3)},e.chars=function(t){var e=t.indexOf("<");return new s.CharsToken(0<=e?e:t.length)},e.startTag=o,e.atomicTag=function(t){var e=o(t);if(e){var r=t.slice(e.length);if(r.match(new RegExp("</\\s*"+e.tagName+"\\s*>","i"))){var n=r.match(new RegExp("([\\s\\S]*?)</\\s*"+e.tagName+"\\s*>","i"));if(n)return new s.AtomicTagToken(e.tagName,n[0].length+e.length,e.attrs,e.booleanAttrs,n[1])}}},e.endTag=function(t){var e=t.match(c.endTag);if(e)return new s.EndTagToken(e[1],e[0].length)};var s=r(4),c={startTag:/^<([\-A-Za-z0-9_]+)((?:\s+[\w\-]+(?:\s*=?\s*(?:(?:"[^"]*")|(?:'[^']*')|[^>\s]+))?)*)\s*(\/?)>/,endTag:/^<\/([\-A-Za-z0-9_]+)[^>]*>/,attr:/(?:([\-A-Za-z0-9_]+)\s*=\s*(?:(?:"((?:\\.|[^"])*)")|(?:'((?:\\.|[^'])*)')|([^>\s]+)))|(?:([\-A-Za-z0-9_]+)(\s|$)+)/g,fillAttr:/^(checked|compact|declare|defer|disabled|ismap|multiple|nohref|noresize|noshade|nowrap|readonly|selected)$/i};function o(t){var r,n,o;if(-1!==t.indexOf(">")){var e=t.match(c.startTag);if(e){var i=(r={},n={},o=e[2],e[2].replace(c.attr,function(t,e){arguments[2]||arguments[3]||arguments[4]||arguments[5]?arguments[5]?(r[arguments[5]]="",n[arguments[5]]=!0):r[e]=arguments[2]||arguments[3]||arguments[4]||c.fillAttr.test(e)&&e||"":r[e]="",o=o.replace(t,"")}),{v:new s.StartTagToken(e[1],e[0].length,r,n,!!e[3],o.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,""))});if("object"===(void 0===i?"undefined":a(i)))return i.v}}}},function(t,e,r){"use strict";e.__esModule=!0,e.EndTagToken=e.AtomicTagToken=e.StartTagToken=e.TagToken=e.CharsToken=e.CommentToken=e.Token=void 0;var a=r(5);function s(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}e.Token=function t(e,r){s(this,t),this.type=e,this.length=r,this.text=""},e.CommentToken=(n.prototype.toString=function(){return"\x3c!--"+this.content},n);function n(t,e){s(this,n),this.type="comment",this.length=e||(t?t.length:0),this.text="",this.content=t}e.CharsToken=(o.prototype.toString=function(){return this.text},o);function o(t){s(this,o),this.type="chars",this.length=t,this.text=""}var i=e.TagToken=(c.formatTag=function(t,e){var r=1<arguments.length&&void 0!==e?e:null,n="<"+t.tagName;for(var o in t.attrs)if(t.attrs.hasOwnProperty(o)){n+=" "+o;var i=t.attrs[o];void 0!==t.booleanAttrs&&void 0!==t.booleanAttrs[o]||(n+='="'+(0,a.escapeQuotes)(i)+'"')}return t.rest&&(n+=" "+t.rest),t.unary&&!t.html5Unary?n+="/>":n+=">",null!=r&&(n+=r+"</"+t.tagName+">"),n},c);function c(t,e,r,n,o){s(this,c),this.type=t,this.length=r,this.text="",this.tagName=e,this.attrs=n,this.booleanAttrs=o,this.unary=!1,this.html5Unary=!1}e.StartTagToken=(u.prototype.toString=function(){return i.formatTag(this)},u);function u(t,e,r,n,o,i){s(this,u),this.type="startTag",this.length=e,this.text="",this.tagName=t,this.attrs=r,this.booleanAttrs=n,this.html5Unary=!1,this.unary=o,this.rest=i}e.AtomicTagToken=(l.prototype.toString=function(){return i.formatTag(this,this.content)},l);function l(t,e,r,n,o){s(this,l),this.type="atomicTag",this.length=e,this.text="",this.tagName=t,this.attrs=r,this.booleanAttrs=n,this.unary=!1,this.html5Unary=!1,this.content=o}e.EndTagToken=(p.prototype.toString=function(){return"</"+this.tagName+">"},p);function p(t,e){s(this,p),this.type="endTag",this.length=e,this.text="",this.tagName=t}},function(t,e){"use strict";e.__esModule=!0,e.escapeQuotes=function(t){var e=1<arguments.length&&void 0!==arguments[1]?arguments[1]:"";return t?t.replace(/([^"]*)"/g,function(t,e){return/\\/.test(e)?e+'"':e+'\\"'}):e}},function(t,e){"use strict";e.__esModule=!0,e.default=function(r,n,e){var o=function(){var t=[];return t.last=function(){return this[this.length-1]},t.lastTagNameEq=function(t){var e=this.last();return e&&e.tagName&&e.tagName.toUpperCase()===t.toUpperCase()},t.containsTagName=function(t){for(var e,r=0;e=this[r];r++)if(e.tagName===t)return!0;return!1},t}(),i={startTag:function(t){var e=t.tagName;"TR"===e.toUpperCase()&&o.lastTagNameEq("TABLE")?(r.prepend("<TBODY>"),a()):n.selfCloseFix&&s.test(e)&&o.containsTagName(e)?o.lastTagNameEq(e)?u(r,o):(r.prepend("</"+t.tagName+">"),a()):t.unary||o.push(t)},endTag:function(t){o.last()?n.tagSoupFix&&!o.lastTagNameEq(t.tagName)?u(r,o):o.pop():n.tagSoupFix&&(e(),a())}};function a(){var t=function(t,e){var r=t.stream,n=c(e());return t.stream=r,n}(r,e);t&&i[t.type]&&i[t.type](t)}return function(){return a(),c(e())}};var r=/^(AREA|BASE|BASEFONT|BR|COL|FRAME|HR|IMG|INPUT|ISINDEX|LINK|META|PARAM|EMBED)$/i,s=/^(COLGROUP|DD|DT|LI|OPTIONS|P|TD|TFOOT|TH|THEAD|TR)$/i;function c(t){return t&&"startTag"===t.type&&(t.unary=r.test(t.tagName)||t.unary,t.html5Unary=!/\/>$/.test(t.text)),t}function u(t,e){var r=e.pop();t.prepend("</"+r.tagName+">")}}],r.c=o,r.p="",r(0);function r(t){if(o[t])return o[t].exports;var e=o[t]={exports:{},id:t,loaded:!1};return n[t].call(e.exports,e,e.exports,r),e.loaded=!0,e.exports}var n,o},t.exports=n()},function(t,e){"use strict";e.__esModule=!0;var n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t};function o(t){return null!=t}function i(t,e,r){var n=void 0,o=t&&t.length||0;for(n=0;n<o;n++)e.call(r,t[n],n)}function a(t,e,r){for(var n in t)t.hasOwnProperty(n)&&e.call(r,n,t[n])}function r(t,e){return!(!t||"startTag"!==t.type&&"atomicTag"!==t.type||!("tagName"in t))&&!!~t.tagName.toLowerCase().indexOf(e)}e.existy=o,e.isFunction=function(t){return"function"==typeof t},e.each=i,e.eachKey=a,e.defaults=function(r,t){return r=r||{},a(t,function(t,e){o(r[t])||(r[t]=e)}),r},e.toArray=function(r){try{return Array.prototype.slice.call(r)}catch(t){var e=function(){var e=[];return i(r,function(t){e.push(t)}),{v:e}}();if("object"===(void 0===e?"undefined":n(e)))return e.v}},e.last=function(t){return t[t.length-1]},e.isTag=r,e.isScript=function(t){return r(t,"script")},e.isStyle=function(t){return r(t,"style")}}],r.c=o,r.p="",r(0);function r(t){if(o[t])return o[t].exports;var e=o[t]={exports:{},id:t,loaded:!1};return n[t].call(e.exports,e,e.exports,r),e.loaded=!0,e.exports}var n,o},t.exports=n()},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.newEnvironment=function(r){function e(){return r.top!==r&&!function(t){try{return t.top.location.toString(),!0}catch(t){return!1}}(r)}return{isMobileApp:function(t){return t&&"mobile-app"===t},isCrossDomain:e,isSafeFrame:function(){return!(!r.$sf||!r.$sf.ext)},isAmp:function(t){return"string"==typeof t&&""!==t&&e()},canLocatePrebid:function(){for(var t=!1,e=r;!t;){try{if(e.pbjs){t=!0;break}}catch(t){}if(e===window.top)break;e=e.parent}return t}}}}]);
|
package/dist/creative.max.js
CHANGED
@@ -375,6 +375,7 @@ function newRenderingManager(win, environment) {
|
|
375
375
|
function responseCallback(isMobileApp, hbPb) {
|
376
376
|
return function (response) {
|
377
377
|
var bidObject = parseResponse(response);
|
378
|
+
var auctionPrice = bidObject.price || hbPb;
|
378
379
|
var ad = utils.getCreativeCommentMarkup(bidObject);
|
379
380
|
var width = bidObject.width ? bidObject.width : bidObject.w;
|
380
381
|
var height = bidObject.height ? bidObject.height : bidObject.h; // When Prebid Universal Creative reads from Prebid Cache, we need to have it check for the existence of the wurl parameter. If it exists, hit it.
|
@@ -384,9 +385,9 @@ function newRenderingManager(win, environment) {
|
|
384
385
|
}
|
385
386
|
|
386
387
|
if (bidObject.adm) {
|
387
|
-
if (
|
388
|
-
// replace ${AUCTION_PRICE} macro with the hb_pb.
|
389
|
-
bidObject.adm = bidObject.adm.replace('${AUCTION_PRICE}',
|
388
|
+
if (auctionPrice) {
|
389
|
+
// replace ${AUCTION_PRICE} macro with the bidObject.price or hb_pb.
|
390
|
+
bidObject.adm = bidObject.adm.replace('${AUCTION_PRICE}', auctionPrice);
|
390
391
|
} else {
|
391
392
|
/*
|
392
393
|
From OpenRTB spec 2.5: If the source value is an optional parameter that was not specified, the macro will simply be removed (i.e., replaced with a zero-length string).
|
@@ -400,6 +401,26 @@ function newRenderingManager(win, environment) {
|
|
400
401
|
ad += utils.createTrackPixelHtml(decodeURIComponent(bidObject.nurl));
|
401
402
|
}
|
402
403
|
|
404
|
+
if (bidObject.burl) {
|
405
|
+
var triggerBurl = function triggerBurl() {
|
406
|
+
utils.triggerPixel(bidObject.burl);
|
407
|
+
};
|
408
|
+
|
409
|
+
if (isMobileApp) {
|
410
|
+
var mraidScript = utils.loadScript(win, 'mraid.js', function () {
|
411
|
+
// Success loading MRAID
|
412
|
+
var result = registerMRAIDViewableEvent(triggerBurl);
|
413
|
+
|
414
|
+
if (!result) {
|
415
|
+
triggerBurl(); // Error registering event
|
416
|
+
}
|
417
|
+
}, triggerBurl // Error loading MRAID
|
418
|
+
);
|
419
|
+
} else {
|
420
|
+
triggerBurl(); // Not a mobile app
|
421
|
+
}
|
422
|
+
}
|
423
|
+
|
403
424
|
utils.writeAdHtml(ad);
|
404
425
|
} else if (bidObject.nurl) {
|
405
426
|
if (isMobileApp) {
|
@@ -413,10 +434,6 @@ function newRenderingManager(win, environment) {
|
|
413
434
|
utils.writeAdUrl(nurl, width, height);
|
414
435
|
}
|
415
436
|
}
|
416
|
-
|
417
|
-
if (bidObject.burl) {
|
418
|
-
utils.triggerBurl(bidObject.burl);
|
419
|
-
}
|
420
437
|
};
|
421
438
|
}
|
422
439
|
|
@@ -497,6 +514,51 @@ function newRenderingManager(win, environment) {
|
|
497
514
|
}
|
498
515
|
}
|
499
516
|
|
517
|
+
function registerMRAIDViewableEvent(callback) {
|
518
|
+
function exposureChangeListener(exposure) {
|
519
|
+
if (exposure > 0) {
|
520
|
+
mraid.removeEventListener('exposureChange', exposureChangeListener);
|
521
|
+
callback();
|
522
|
+
}
|
523
|
+
}
|
524
|
+
|
525
|
+
function viewableChangeListener(viewable) {
|
526
|
+
if (viewable) {
|
527
|
+
mraid.removeEventListener('viewableChange', viewableChangeListener);
|
528
|
+
callback();
|
529
|
+
}
|
530
|
+
}
|
531
|
+
|
532
|
+
function registerViewableChecks() {
|
533
|
+
if (win.MRAID_ENV && parseFloat(win.MRAID_ENV.version) >= 3) {
|
534
|
+
mraid.addEventListener('exposureChange', exposureChangeListener);
|
535
|
+
} else if (win.MRAID_ENV && parseFloat(win.MRAID_ENV.version) < 3) {
|
536
|
+
if (mraid.isViewable()) {
|
537
|
+
callback();
|
538
|
+
} else {
|
539
|
+
mraid.addEventListener('viewableChange', viewableChangeListener);
|
540
|
+
}
|
541
|
+
}
|
542
|
+
}
|
543
|
+
|
544
|
+
function readyListener() {
|
545
|
+
mraid.removeEventListener('ready', readyListener);
|
546
|
+
registerViewableChecks();
|
547
|
+
}
|
548
|
+
|
549
|
+
if (win.mraid && win.MRAID_ENV) {
|
550
|
+
if (mraid.getState() == 'loading') {
|
551
|
+
mraid.addEventListener('ready', readyListener);
|
552
|
+
} else {
|
553
|
+
registerViewableChecks();
|
554
|
+
}
|
555
|
+
|
556
|
+
return true;
|
557
|
+
} else {
|
558
|
+
return false;
|
559
|
+
}
|
560
|
+
}
|
561
|
+
|
500
562
|
return {
|
501
563
|
renderAd: renderAd
|
502
564
|
};
|
@@ -565,7 +627,9 @@ function writeAdUrl(adUrl, width, height) {
|
|
565
627
|
}
|
566
628
|
|
567
629
|
function writeAdHtml(markup) {
|
568
|
-
postscribe(document.body, markup
|
630
|
+
postscribe(document.body, markup, {
|
631
|
+
error: console.error
|
632
|
+
});
|
569
633
|
}
|
570
634
|
|
571
635
|
function sendRequest(url, callback) {
|
@@ -591,24 +655,31 @@ function getUUID() {
|
|
591
655
|
|
592
656
|
;
|
593
657
|
|
594
|
-
function loadScript(currentWindow, tagSrc,
|
658
|
+
function loadScript(currentWindow, tagSrc, successCallback, errorCallback) {
|
595
659
|
var doc = currentWindow.document;
|
596
660
|
var scriptTag = doc.createElement('script');
|
597
|
-
scriptTag.type = 'text/javascript'; // Execute
|
661
|
+
scriptTag.type = 'text/javascript'; // Execute success callback if necessary
|
598
662
|
|
599
|
-
if (
|
663
|
+
if (successCallback && typeof successCallback === 'function') {
|
600
664
|
if (scriptTag.readyState) {
|
601
665
|
scriptTag.onreadystatechange = function () {
|
602
666
|
if (scriptTag.readyState === 'loaded' || scriptTag.readyState === 'complete') {
|
603
667
|
scriptTag.onreadystatechange = null;
|
604
|
-
|
668
|
+
successCallback();
|
605
669
|
}
|
606
670
|
};
|
607
671
|
} else {
|
608
672
|
scriptTag.onload = function () {
|
609
|
-
|
673
|
+
successCallback();
|
610
674
|
};
|
611
675
|
}
|
676
|
+
} // Execute error callback if necessary
|
677
|
+
|
678
|
+
|
679
|
+
if (errorCallback && typeof errorCallback === 'function') {
|
680
|
+
scriptTag.onerror = function () {
|
681
|
+
errorCallback();
|
682
|
+
};
|
612
683
|
}
|
613
684
|
|
614
685
|
scriptTag.src = tagSrc; //add the new script tag to the page
|
@@ -627,7 +698,7 @@ function loadScript(currentWindow, tagSrc, callback) {
|
|
627
698
|
;
|
628
699
|
/**
|
629
700
|
* Return comment element
|
630
|
-
* @param {*} bid
|
701
|
+
* @param {*} bid
|
631
702
|
*/
|
632
703
|
|
633
704
|
function getCreativeComment(bid) {
|
@@ -635,7 +706,7 @@ function getCreativeComment(bid) {
|
|
635
706
|
}
|
636
707
|
/**
|
637
708
|
* Returns comment element markup
|
638
|
-
* @param {*} bid
|
709
|
+
* @param {*} bid
|
639
710
|
*/
|
640
711
|
|
641
712
|
|
@@ -7,7 +7,7 @@
|
|
7
7
|
<title>Document</title>
|
8
8
|
<script type="text/javascript">
|
9
9
|
// cookie-sync start
|
10
|
-
!function(n){var r={};function o(
|
10
|
+
!function(n){var r={};function o(e){if(r[e])return r[e].exports;var t=r[e]={i:e,l:!1,exports:{}};return n[e].call(t.exports,t,t.exports,o),t.l=!0,t.exports}o.m=n,o.c=r,o.d=function(e,t,n){o.o(e,t)||Object.defineProperty(e,t,{configurable:!1,enumerable:!0,get:n})},o.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return o.d(t,"a",t),t},o.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},o.p="",o(o.s=0)}([function(e,t,n){"use strict";var o=function(e){if(e&&e.__esModule)return e;var t=s();if(t&&t.has(e))return t.get(e);var n={};if(null!=e){var r=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var o in e)if(Object.prototype.hasOwnProperty.call(e,o)){var i=r?Object.getOwnPropertyDescriptor(e,o):null;i&&(i.get||i.set)?Object.defineProperty(n,o,i):n[o]=e[o]}}n.default=e,t&&t.set(e,n);return n}(n(1));function s(){if("function"!=typeof WeakMap)return null;var e=new WeakMap;return s=function(){return e},e}function u(){return(u=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}function d(e){return(d="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})(e)}var r,i,a,c={rubicon:"https://prebid-server.rubiconproject.com/cookie_sync",appnexus:"https://prebid.adnxs.com/pbs/v1/cookie_sync"},f=function(e){var t="https://prebid.adnxs.com/pbs/v1/cookie_sync";if(!e)return t;var n=c[e]||decodeURIComponent(e)||"";return x(n)?n:t}(E("endpoint",window.location.search)),l=function(e){if(e){var t=e.split(",").reduce(function(e,t){var n=t.split(":");return 2===n.length&&""!==n[0]&&""!==n[1]&&(e[n[0]]=/^\d+$/.test(n[1])?parseInt(n[1]):n[1]),e},{});return t&&Object.keys(t).length?t:void 0}}(E("args",window.location.search)),p=(r=E("source",window.location.search))&&"amp"===r.toLowerCase(),g=function(e){if(e){var t=e.split(",").filter(function(e){return!!e});if(0<t.length)return t}}(E("bidders",window.location.search)),y=E("max_sync_count",window.location.search),m=function(e){if(isNaN(e)||e<0)return 9007199254740991;return e}(parseInt(y||10,10)),b=(i=parseInt(E("timeout",window.location.search),10),isNaN(i)||i!==parseInt(i,10)?1e4:i),h=0!==(a=parseInt(E("defaultGdprScope",window.location.search),10))&&1!==a?1:a,v={},w=!1;function x(e){return new RegExp(/^(?:(?:(?:https?|ftp):)?\/\/)(?:\S+(?::\S*)?@)?(?:(?!(?:10|127)(?:\.\d{1,3}){3})(?!(?:169\.254|192\.168)(?:\.\d{1,3}){2})(?!172\.(?:1[6-9]|2\d|3[0-1])(?:\.\d{1,3}){2})(?:[1-9]\d?|1\d\d|2[01]\d|22[0-3])(?:\.(?:1?\d{1,2}|2[0-4]\d|25[0-5])){2}(?:\.(?:[1-9]\d?|1\d\d|2[0-4]\d|25[0-4]))|(?:(?:[a-z0-9\u00a1-\uffff][a-z0-9\u00a1-\uffff_-]{0,62})?[a-z0-9\u00a1-\uffff]\.)+(?:[a-z\u00a1-\uffff]{2,}\.?))(?::\d{2,5})?(?:[/?#]\S*)?$/i).test(e)}function O(e,t,n,r){t&&x(t)?"image"===e||"redirect"===e?(console.log('Invoking image pixel user sync for bidder: "'.concat(n,'"')),function(e,t){var n=new Image;n.addEventListener("load",t),n.addEventListener("error",t),n.src=e}(t,r)):"iframe"==e?(console.log('Invoking iframe pixel user sync for bidder: "'.concat(n,'"')),function(e,t,n){if(!e)return;var r=o.getEmptyIframe(0,0);r.id="sync_".concat(t,"_").concat(Date.now()),r.src=e,r.onload=n,o.insertElement(r,document,"html")}(t,n,r)):(console.log('User sync type "'.concat(e,'" not supported for bidder: "').concat(n,'"')),r()):(console.log('No valid sync url for bidder "'.concat(n,'": ').concat(t)),r())}function _(e){var t=JSON.parse(e);"ok"!==t.status&&"no_cookie"!==t.status||t.bidder_status&&!function e(t){if(0!==t.length){var n=t.pop();n.no_cookie?O(n.usersync.type,n.usersync.url,n.bidder,e.bind(null,t)):e(t)}}(t.bidder_status)}function E(e,t){var n=new RegExp("[\\?&]"+e+"=([^&#]*)").exec(t);return null===n?"":decodeURIComponent(n[1].replace(/\+/g," "))}function S(e){var t=e&&"object"===d(e)?e:{};return t.limit=m,p&&(t.filterSettings={iframe:{bidders:"*",filter:"exclude"}}),g&&(t.bidders=g),t=function(e){return v.consentMetadata&&(v.consentMetadata.gdprApplies?(e.gdpr=1,e.gdpr_consent=v.consentString||""):e.gdpr=0),e}(t),JSON.stringify(t)}function T(){w=!0,function(e,t,n,r){var o=3<arguments.length&&void 0!==r?r:{};try{var i,s=o.method||(n?"POST":"GET"),a="object"===d(t)?t:{success:function(){console.log("xhr success")},error:function(e){console.log("xhr error",null,e)}};if("function"==typeof t&&(a.success=t),(i=new window.XMLHttpRequest).onreadystatechange=function(){if(4===i.readyState){var e=i.status;200<=e&&e<300||304===e?a.success(i.responseText,i):a.error(i.statusText,i)}},i.ontimeout=function(){console.log("xhr timeout after ",i.timeout,"ms")},"GET"===s&&n){var c=parseURL(e,o);u(c.search,n),e=formatURL(c)}i.open(s,e),i.timeout=3e3,o.withCredentials&&(i.withCredentials=!0),o.preflight&&i.setRequestHeader("X-Requested-With","XMLHttpRequest"),i.setRequestHeader("Content-Type",o.contentType||"text/plain"),"POST"===s&&n?i.send(n):i.send()}catch(e){console.log("xhr construction",e)}}(f,_,S(l),{withCredentials:!0})}var j=setTimeout(function(){w||(h||T(),console.log("Message listener timed out. No consent data was returned."))},b);window.addEventListener("message",function(e){"consent-data"===e.data.type&&(v=e.data,clearTimeout(j),w||T())},!1),window.parent.postMessage({sentinel:"amp",type:"send-consent-data"},"*")},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getEmptyIframe=function(e,t){var n=document.createElement("iframe");return n.setAttribute("frameborder",0),n.setAttribute("scrolling","no"),n.setAttribute("marginheight",0),n.setAttribute("marginwidth",0),n.setAttribute("TOPMARGIN",0),n.setAttribute("LEFTMARGIN",0),n.setAttribute("allowtransparency","true"),n.setAttribute("width",t),n.setAttribute("height",e),n},t.insertElement=function(e,t,n){var r;t=t||document,r=n?t.getElementsByTagName(n):t.getElementsByTagName("head");try{(r=r.length?r:t.getElementsByTagName("body")).length&&(r=r[0]).insertBefore(e,r.firstChild)}catch(e){}}}]);
|
11
11
|
// end.
|
12
12
|
</script>
|
13
13
|
</head>
|
package/dist/load-cookie.html
CHANGED
@@ -7,7 +7,7 @@
|
|
7
7
|
<title>Document</title>
|
8
8
|
<script type="text/javascript">
|
9
9
|
// cookie-sync start
|
10
|
-
!function(n){var r={};function o(
|
10
|
+
!function(n){var r={};function o(e){if(r[e])return r[e].exports;var t=r[e]={i:e,l:!1,exports:{}};return n[e].call(t.exports,t,t.exports,o),t.l=!0,t.exports}o.m=n,o.c=r,o.d=function(e,t,n){o.o(e,t)||Object.defineProperty(e,t,{configurable:!1,enumerable:!0,get:n})},o.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return o.d(t,"a",t),t},o.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},o.p="",o(o.s=0)}([function(e,t,n){"use strict";var o=function(e){if(e&&e.__esModule)return e;var t=c();if(t&&t.has(e))return t.get(e);var n={};if(null!=e){var r=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var o in e)if(Object.prototype.hasOwnProperty.call(e,o)){var i=r?Object.getOwnPropertyDescriptor(e,o):null;i&&(i.get||i.set)?Object.defineProperty(n,o,i):n[o]=e[o]}}n.default=e,t&&t.set(e,n);return n}(n(1));function c(){if("function"!=typeof WeakMap)return null;var e=new WeakMap;return c=function(){return e},e}function u(){return(u=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}function f(e){return(f="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})(e)}var r,i,s,a={rubicon:"https://prebid-server.rubiconproject.com/cookie_sync",appnexus:"https://prebid.adnxs.com/pbs/v1/cookie_sync"},l=function(e){var t="https://prebid.adnxs.com/pbs/v1/cookie_sync";if(!e)return t;var n=a[e]||decodeURIComponent(e)||"";return v(n)?n:t}(x("endpoint",window.location.search)),d=function(e){if(e){var t=e.split(",").reduce(function(e,t){var n=t.split(":");return 2===n.length&&""!==n[0]&&""!==n[1]&&(e[n[0]]=/^\d+$/.test(n[1])?parseInt(n[1]):n[1]),e},{});return t&&Object.keys(t).length?t:void 0}}(x("args",window.location.search)),p=function(e){if(e){var t=e.split(",").filter(function(e){return!!e});if(0<t.length)return t}}(x("bidders",window.location.search)),g=(r=x("source",window.location.search))&&"amp"===r.toLowerCase(),y=x("max_sync_count",window.location.search),m=function(e){if(isNaN(e)||e<0)return 9007199254740991;return e}(parseInt(y||10,10)),b=function(e){if(0===e||1===e)return e;console.log("Ignoring gdpr param, it should be 1 or 0")}(parseInt(x("gdpr",window.location.search),10)),h=function(e){if(e)return e;console.log("Ignoring gdpr_consent param, it should be a non empty value")}(x("gdpr_consent",window.location.search));function v(e){return new RegExp(/^(?:(?:(?:https?|ftp):)?\/\/)(?:\S+(?::\S*)?@)?(?:(?!(?:10|127)(?:\.\d{1,3}){3})(?!(?:169\.254|192\.168)(?:\.\d{1,3}){2})(?!172\.(?:1[6-9]|2\d|3[0-1])(?:\.\d{1,3}){2})(?:[1-9]\d?|1\d\d|2[01]\d|22[0-3])(?:\.(?:1?\d{1,2}|2[0-4]\d|25[0-5])){2}(?:\.(?:[1-9]\d?|1\d\d|2[0-4]\d|25[0-4]))|(?:(?:[a-z0-9\u00a1-\uffff][a-z0-9\u00a1-\uffff_-]{0,62})?[a-z0-9\u00a1-\uffff]\.)+(?:[a-z\u00a1-\uffff]{2,}\.?))(?::\d{2,5})?(?:[/?#]\S*)?$/i).test(e)}function w(e,t,n,r){t&&v(t)?"image"===e||"redirect"===e?(console.log('Invoking image pixel user sync for bidder: "'.concat(n,'"')),function(e,t){var n=new Image;n.addEventListener("load",t),n.addEventListener("error",t),n.src=e}(t,r)):"iframe"==e?(console.log('Invoking iframe pixel user sync for bidder: "'.concat(n,'"')),function(e,t,n){if(!e)return;var r=o.getEmptyIframe(0,0);r.id="sync_".concat(t,"_").concat(Date.now()),r.src=e,r.onload=n,o.insertElement(r,document,"html")}(t,n,r)):(console.log('User sync type "'.concat(e,'" not supported for bidder: "').concat(n,'"')),r()):(console.log('No valid sync url for bidder "'.concat(n,'": ').concat(t)),r())}function x(e,t){var n=new RegExp("[\\?&]"+e+"=([^&#]*)").exec(t);return null===n?"":decodeURIComponent(n[1].replace(/\+/g," "))}!function(e,t,n,r){var o=3<arguments.length&&void 0!==r?r:{};try{var i,c=o.method||(n?"POST":"GET"),s="object"===f(t)?t:{success:function(){console.log("xhr success")},error:function(e){console.log("xhr error",null,e)}};if("function"==typeof t&&(s.success=t),(i=new window.XMLHttpRequest).onreadystatechange=function(){if(4===i.readyState){var e=i.status;200<=e&&e<300||304===e?s.success(i.responseText,i):s.error(i.statusText,i)}},i.ontimeout=function(){console.log("xhr timeout after ",i.timeout,"ms")},"GET"===c&&n){var a=parseURL(e,o);u(a.search,n),e=formatURL(a)}i.open(c,e),i.timeout=3e3,o.withCredentials&&(i.withCredentials=!0),o.preflight&&i.setRequestHeader("X-Requested-With","XMLHttpRequest"),i.setRequestHeader("Content-Type",o.contentType||"text/plain"),"POST"===c&&n?i.send(n):i.send()}catch(e){console.log("xhr construction",e)}}(l,function(e){var t=JSON.parse(e);"ok"!==t.status&&"no_cookie"!==t.status||t.bidder_status&&!function e(t){if(0!==t.length){var n=t.pop();n.no_cookie?w(n.usersync.type,n.usersync.url,n.bidder,e.bind(null,t)):e(t)}}(t.bidder_status)},((s=(i=d)&&"object"===f(i)?i:{}).limit=m,b&&(s.gdpr=b),h&&(s.gdpr_consent=h),g&&(s.filterSettings={iframe:{bidders:"*",filter:"exclude"}}),p&&(s.bidders=p),JSON.stringify(s)),{withCredentials:!0})},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getEmptyIframe=function(e,t){var n=document.createElement("iframe");return n.setAttribute("frameborder",0),n.setAttribute("scrolling","no"),n.setAttribute("marginheight",0),n.setAttribute("marginwidth",0),n.setAttribute("TOPMARGIN",0),n.setAttribute("LEFTMARGIN",0),n.setAttribute("allowtransparency","true"),n.setAttribute("width",t),n.setAttribute("height",e),n},t.insertElement=function(e,t,n){var r;t=t||document,r=n?t.getElementsByTagName(n):t.getElementsByTagName("head");try{(r=r.length?r:t.getElementsByTagName("body")).length&&(r=r[0]).insertBefore(e,r.firstChild)}catch(e){}}}]);
|
11
11
|
// end.
|
12
12
|
</script>
|
13
13
|
</head>
|
package/dist/native-render.js
CHANGED
@@ -1,3 +1,3 @@
|
|
1
|
-
/* v1.
|
2
|
-
Updated : 2021-
|
3
|
-
!function(r){var n={};function a(t){if(n[t])return n[t].exports;var e=n[t]={i:t,l:!1,exports:{}};return r[t].call(e.exports,e,e.exports,a),e.l=!0,e.exports}a.m=r,a.c=n,a.d=function(t,e,r){a.o(t,e)||Object.defineProperty(t,e,{configurable:!1,enumerable:!0,get:r})},a.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return a.d(e,"a",e),e},a.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},a.p="",a(a.s=1)}([function(t,n,e){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.triggerPixel=function(t,e){var r=new Image;e&&"function"==typeof e&&(r.addEventListener("load",e),r.addEventListener("error",e));r.src=t},n.createTrackPixelHtml=function(t){if(!t)return"";var e=encodeURI(t);return'<div style="position:absolute;left:0px;top:0px;visibility:hidden;"><img src="'.concat(e,'"></div>')},n.writeAdUrl=function(t,e,r){var n=a.getEmptyIframe(r,e);n.src=t,document.body.appendChild(n)},n.writeAdHtml=function(t){r(document.body,t)},n.sendRequest=function(t,e){var r=new XMLHttpRequest;r.addEventListener("load",function(){e(r.responseText)}),r.open("GET",t),r.send()},n.getUUID=function(){var r=(new Date).getTime();return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(t){var e=(r+16*Math.random())%16|0;return r=Math.floor(r/16),("x"===t?e:3&e|8).toString(16)})},n.loadScript=function(t,e,r){var n=t.document,a=n.createElement("script");a.type="text/javascript",r&&"function"==typeof r&&(a.readyState?a.onreadystatechange=function(){"loaded"!==a.readyState&&"complete"!==a.readyState||(a.onreadystatechange=null,r())}:a.onload=function(){r()});a.src=e;var i=n.getElementsByTagName("head");(i=i.length?i:n.getElementsByTagName("body")).length&&(i=i[0]).insertBefore(a,i.firstChild);return a},n.getCreativeComment=function(t){return document.createComment("Creative ".concat(t.crid," served by Prebid.js Header Bidding"))},n.getCreativeCommentMarkup=function(t){var e=n.getCreativeComment(t),r=document.createElement("div");return r.appendChild(e),r.innerHTML},n.transformAuctionTargetingData=function(e){var r={hb_adid:"adId",hb_cache_host:"cacheHost",hb_cache_path:"cachePath",hb_cache_id:"uuid",hb_format:"mediaType",hb_env:"env",hb_size:"size",hb_pb:"hbPb"};function t(t){return!(!e[t]||!(function(t){return i(t,"Object")}(e[t])&&0<Object.keys(e[t]).length||s(e[t])&&""!==e[t]))}var n={},a={};t("targetingMap")?a=function(e){var r={};return Object.keys(e).forEach(function(t){Array.isArray(e[t])&&0<e[t].length&&(r[t]=e[t][0])}),r}(e.targetingMap):t("targetingKeywords")&&(a=function(t){var a={},e=t.split(",");return 0<e.length&&e.forEach(function(t){var e=t.split(":");if(2===e.length){var r=e[0],n=e[1];a[r]=n}}),a}(e.targetingKeywords));return function(e){Object.keys(e).forEach(function(t){n[r[t]||t]=e[t]})}(a),Object.keys(e).forEach(function(t){"targetingMap"!==t&&"targetingKeywords"!==t&&s(e[t])&&""!==e[t]&&(n[t]=e[t])}),n},n.parseUrl=function(t){var e=document.createElement("a");return e.href=decodeURIComponent(t),{href:e.href,protocol:(e.protocol||"").replace(/:$/,""),hostname:e.hostname,port:+e.port,pathname:e.pathname.replace(/^(?!\/)/,"/"),hash:(e.hash||"").replace(/^#/,""),host:(e.host||window.location.host).replace(/:(443|80)$/,"")}};var a=function(t){if(t&&t.__esModule)return t;var e=o();if(e&&e.has(t))return e.get(t);var r={};if(null!=t){var n=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var a in t)if(Object.prototype.hasOwnProperty.call(t,a)){var i=n?Object.getOwnPropertyDescriptor(t,a):null;i&&(i.get||i.set)?Object.defineProperty(r,a,i):r[a]=t[a]}}r.default=t,e&&e.set(t,r);return r}(e(3));function o(){if("function"!=typeof WeakMap)return null;var t=new WeakMap;return o=function(){return t},t}var r=e(4);function i(t,e){return Object.prototype.toString.call(t)==="[object "+e+"]"}function s(t){return i(t,"String")}},function(t,e,r){"use strict";var n=r(2);window.pbNativeTag=window.pbNativeTag||{};var a=(0,n.newNativeRenderManager)(window);window.pbNativeTag.renderNativeAd=a.renderNativeAd},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.newNativeRenderManager=function(n){var a;function i(t,e){if(""===t)console.warn("Prebid tracking event was missing 'adId'. Was adId macro set in the HTML attribute "+l+"on the ad's anchor element");else{var r={message:"Prebid Native",adId:t};"click"===e&&(r.action="click"),n.parent.postMessage(JSON.stringify(r),a)}}function o(){for(var t=function(t){return n.document.getElementsByClassName(t)||[]}(u),e=0;e<t.length;e++)t[e].addEventListener("click",function(t){i(window.pbNativeData.adId,"click")},!0)}return{renderNativeAd:function(t){window.pbNativeData=t;(0,s.transformAuctionTargetingData)(t);var e=(0,c.newNativeAssetManager)(window);if(t.hasOwnProperty("adId")){var r=(0,s.parseUrl)(window.pbNativeData.pubUrl);if(a=r.protocol+"://"+r.host,t.hasOwnProperty("rendererUrl")&&!t.rendererUrl.match(/##.*##/i)){var n=document.createElement("SCRIPT");n.src=t.rendererUrl,n.id="pb-native-renderer",document.body.appendChild(n)}e.loadAssets(t.adId,o),o(),function(t){i(t,"impression")}(t.adId)}else console.warn("Prebid Native Tag object was missing 'adId'.")}}};var s=r(0),c=r(5),u="pb-click",l="pbAdId"},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.getEmptyIframe=function(t,e){var r=document.createElement("iframe");return r.setAttribute("frameborder",0),r.setAttribute("scrolling","no"),r.setAttribute("marginheight",0),r.setAttribute("marginwidth",0),r.setAttribute("TOPMARGIN",0),r.setAttribute("LEFTMARGIN",0),r.setAttribute("allowtransparency","true"),r.setAttribute("width",e),r.setAttribute("height",t),r},e.insertElement=function(t,e,r){var n;e=e||document,n=r?e.getElementsByTagName(r):e.getElementsByTagName("head");try{(n=n.length?n:e.getElementsByTagName("body")).length&&(n=n[0]).insertBefore(t,n.firstChild)}catch(t){}}},function(t,e,r){var n;n=function(){return a={},r.m=n=[function(t,e,r){"use strict";var n,a=r(1),i=(n=a)&&n.__esModule?n:{default:n};t.exports=i.default},function(t,e,r){"use strict";e.__esModule=!0;var s=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var r=arguments[e];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(t[n]=r[n])}return t};e.default=h;var n,a=r(2),c=(n=a)&&n.__esModule?n:{default:n},i=function(t){{if(t&&t.__esModule)return t;var e={};if(null!=t)for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e.default=t,e}}(r(4));function u(){}var o={afterAsync:u,afterDequeue:u,afterStreamStart:u,afterWrite:u,autoFix:!0,beforeEnqueue:u,beforeWriteToken:function(t){return t},beforeWrite:function(t){return t},done:u,error:function(t){throw new Error(t.msg)},releaseAsync:!1},l=0,d=[],p=null;function f(){var t=d.shift();if(t){var e=i.last(t);e.afterDequeue(),t.stream=function(t,e,n){(p=new c.default(t,n)).id=l++,p.name=n.name||p.id,h.streams[p.name]=p;var r=t.ownerDocument,a={close:r.close,open:r.open,write:r.write,writeln:r.writeln};function i(t){t=n.beforeWrite(t),p.write(t),n.afterWrite(t)}s(r,{close:u,open:u,write:function(){for(var t=arguments.length,e=Array(t),r=0;r<t;r++)e[r]=arguments[r];return i(e.join(""))},writeln:function(){for(var t=arguments.length,e=Array(t),r=0;r<t;r++)e[r]=arguments[r];return i(e.join("")+"\n")}});var o=p.win.onerror||u;return p.win.onerror=function(t,e,r){n.error({msg:t+" - "+e+": "+r}),o.apply(p.win,[t,e,r])},p.write(e,function(){s(r,a),p.win.onerror=o,n.done(),p=null,f()}),p}.apply(void 0,t),e.afterStreamStart()}}function h(t,e,r){if(i.isFunction(r))r={done:r};else if("clear"===r)return d=[],p=null,void(l=0);r=i.defaults(r,o);var n=[t=/^#/.test(t)?window.document.getElementById(t.substr(1)):t.jquery?t[0]:t,e,r];return t.postscribe={cancel:function(){n.stream?n.stream.abort():n[1]=u}},r.beforeEnqueue(n),d.push(n),p||f(),t.postscribe}s(h,{streams:{},queue:d,WriteStream:c.default})},function(t,e,r){"use strict";e.__esModule=!0;var n,s=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var r=arguments[e];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(t[n]=r[n])}return t},a=r(3),i=(n=a)&&n.__esModule?n:{default:n},o=function(t){{if(t&&t.__esModule)return t;var e={};if(null!=t)for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e.default=t,e}}(r(4));var l="data-ps-",d="ps-style",p="ps-script";function c(t,e){var r=l+e,n=t.getAttribute(r);return o.existy(n)?String(n):n}function u(t,e,r){var n=2<arguments.length&&void 0!==r?r:null,a=l+e;o.existy(n)&&""!==n?t.setAttribute(a,n):t.removeAttribute(a)}var f=(h.prototype.write=function(){var t;for((t=this.writeQueue).push.apply(t,arguments);!this.deferredRemote&&this.writeQueue.length;){var e=this.writeQueue.shift();o.isFunction(e)?this._callFunction(e):this._writeImpl(e)}},h.prototype._callFunction=function(t){var e={type:"function",value:t.name||t.toString()};this._onScriptStart(e),t.call(this.win,this.doc),this._onScriptDone(e)},h.prototype._writeImpl=function(t){this.parser.append(t);for(var e=void 0,r=void 0,n=void 0,a=[];(e=this.parser.readToken())&&!(r=o.isScript(e))&&!(n=o.isStyle(e));)(e=this.options.beforeWriteToken(e))&&a.push(e);0<a.length&&this._writeStaticTokens(a),r&&this._handleScriptToken(e),n&&this._handleStyleToken(e)},h.prototype._writeStaticTokens=function(t){var e=this._buildChunk(t);return e.actual?(e.html=this.proxyHistory+e.actual,this.proxyHistory+=e.proxy,this.proxyRoot.innerHTML=e.html,this._walkChunk(),e):null},h.prototype._buildChunk=function(t){for(var e=this.actuals.length,r=[],n=[],a=[],i=t.length,o=0;o<i;o++){var s=t[o],c=s.toString();if(r.push(c),s.attrs){if(!/^noscript$/i.test(s.tagName)){var u=e++;n.push(c.replace(/(\/?>)/," "+l+"id="+u+" $1")),s.attrs.id!==p&&s.attrs.id!==d&&a.push("atomicTag"===s.type?"":"<"+s.tagName+" "+l+"proxyof="+u+(s.unary?" />":">"))}}else n.push(c),a.push("endTag"===s.type?c:"")}return{tokens:t,raw:r.join(""),actual:n.join(""),proxy:a.join("")}},h.prototype._walkChunk=function(){for(var t=void 0,e=[this.proxyRoot];o.existy(t=e.shift());){var r=1===t.nodeType;if(!r||!c(t,"proxyof")){r&&u(this.actuals[c(t,"id")]=t,"id");var n=t.parentNode&&c(t.parentNode,"proxyof");n&&this.actuals[n].appendChild(t)}e.unshift.apply(e,o.toArray(t.childNodes))}},h.prototype._handleScriptToken=function(t){var e=this,r=this.parser.clear();r&&this.writeQueue.unshift(r),t.src=t.attrs.src||t.attrs.SRC,(t=this.options.beforeWriteToken(t))&&(t.src&&this.scriptStack.length?this.deferredRemote=t:this._onScriptStart(t),this._writeScriptToken(t,function(){e._onScriptDone(t)}))},h.prototype._handleStyleToken=function(t){var e=this.parser.clear();e&&this.writeQueue.unshift(e),t.type=t.attrs.type||t.attrs.TYPE||"text/css",(t=this.options.beforeWriteToken(t))&&this._writeStyleToken(t),e&&this.write()},h.prototype._writeStyleToken=function(t){var e=this._buildStyle(t);this._insertCursor(e,d),t.content&&(e.styleSheet&&!e.sheet?e.styleSheet.cssText=t.content:e.appendChild(this.doc.createTextNode(t.content)))},h.prototype._buildStyle=function(t){var r=this.doc.createElement(t.tagName);return r.setAttribute("type",t.type),o.eachKey(t.attrs,function(t,e){r.setAttribute(t,e)}),r},h.prototype._insertCursor=function(t,e){this._writeImpl('<span id="'+e+'"/>');var r=this.doc.getElementById(e);r&&r.parentNode.replaceChild(t,r)},h.prototype._onScriptStart=function(t){t.outerWrites=this.writeQueue,this.writeQueue=[],this.scriptStack.unshift(t)},h.prototype._onScriptDone=function(t){t===this.scriptStack[0]?(this.scriptStack.shift(),this.write.apply(this,t.outerWrites),!this.scriptStack.length&&this.deferredRemote&&(this._onScriptStart(this.deferredRemote),this.deferredRemote=null)):this.options.error({msg:"Bad script nesting or script finished twice"})},h.prototype._writeScriptToken=function(t,e){var r=this._buildScript(t),n=this._shouldRelease(r),a=this.options.afterAsync;t.src&&(r.src=t.src,this._scriptLoadHandler(r,n?a:function(){e(),a()}));try{this._insertCursor(r,p),r.src&&!n||e()}catch(t){this.options.error(t),e()}},h.prototype._buildScript=function(t){var r=this.doc.createElement(t.tagName);return o.eachKey(t.attrs,function(t,e){r.setAttribute(t,e)}),t.content&&(r.text=t.content),r},h.prototype._scriptLoadHandler=function(e,r){function n(){e=e.onload=e.onreadystatechange=e.onerror=null}var a=this.options.error;function t(){n(),null!=r&&r(),r=null}function i(t){n(),a(t),null!=r&&r(),r=null}function o(t,e){var r=t["on"+e];null!=r&&(t["_on"+e]=r)}o(e,"load"),o(e,"error"),s(e,{onload:function(){if(e._onload)try{e._onload.apply(this,Array.prototype.slice.call(arguments,0))}catch(t){i({msg:"onload handler failed "+t+" @ "+e.src})}t()},onerror:function(){if(e._onerror)try{e._onerror.apply(this,Array.prototype.slice.call(arguments,0))}catch(t){return void i({msg:"onerror handler failed "+t+" @ "+e.src})}i({msg:"remote script failed "+e.src})},onreadystatechange:function(){/^(loaded|complete)$/.test(e.readyState)&&t()}})},h.prototype._shouldRelease=function(t){return!/^script$/i.test(t.nodeName)||!!(this.options.releaseAsync&&t.src&&t.hasAttribute("async"))},h);function h(t){var e=1<arguments.length&&void 0!==arguments[1]?arguments[1]:{};!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,h),this.root=t,this.options=e,this.doc=t.ownerDocument,this.win=this.doc.defaultView||this.doc.parentWindow,this.parser=new i.default("",{autoFix:e.autoFix}),this.actuals=[t],this.proxyHistory="",this.proxyRoot=this.doc.createElement(t.nodeName),this.scriptStack=[],this.writeQueue=[],u(this.proxyRoot,"proxyof",0)}e.default=f},function(t,e,r){var n;n=function(){return a={},r.m=n=[function(t,e,r){"use strict";var n,a=r(1),i=(n=a)&&n.__esModule?n:{default:n};t.exports=i.default},function(t,e,r){"use strict";e.__esModule=!0;var n,o=u(r(2)),a=u(r(3)),i=r(6),s=(n=i)&&n.__esModule?n:{default:n},c=r(5);function u(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e.default=t,e}var l={comment:/^<!--/,endTag:/^<\//,atomicTag:/^<\s*(script|style|noscript|iframe|textarea)[\s\/>]/i,startTag:/^</,chars:/^[^<]/},d=(p.prototype.append=function(t){this.stream+=t},p.prototype.prepend=function(t){this.stream=t+this.stream},p.prototype._readTokenImpl=function(){var t=this._peekTokenImpl();if(t)return this.stream=this.stream.slice(t.length),t},p.prototype._peekTokenImpl=function(){for(var t in l)if(l.hasOwnProperty(t)&&l[t].test(this.stream)){var e=a[t](this.stream);if(e)return"startTag"===e.type&&/script|style/i.test(e.tagName)?null:(e.text=this.stream.substr(0,e.length),e)}},p.prototype.peekToken=function(){return this._peekToken()},p.prototype.readToken=function(){return this._readToken()},p.prototype.readTokens=function(t){for(var e=void 0;e=this.readToken();)if(t[e.type]&&!1===t[e.type](e))return},p.prototype.clear=function(){var t=this.stream;return this.stream="",t},p.prototype.rest=function(){return this.stream},p);function p(){var t=this,e=0<arguments.length&&void 0!==arguments[0]?arguments[0]:"",r=1<arguments.length&&void 0!==arguments[1]?arguments[1]:{};!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,p),this.stream=e;var n=!1,a={};for(var i in o)o.hasOwnProperty(i)&&(r.autoFix&&(a[i+"Fix"]=!0),n=n||a[i+"Fix"]);n?(this._readToken=(0,s.default)(this,a,function(){return t._readTokenImpl()}),this._peekToken=(0,s.default)(this,a,function(){return t._peekTokenImpl()})):(this._readToken=this._readTokenImpl,this._peekToken=this._peekTokenImpl)}for(var f in(e.default=d).tokenToString=function(t){return t.toString()},d.escapeAttributes=function(t){var e={};for(var r in t)t.hasOwnProperty(r)&&(e[r]=(0,c.escapeQuotes)(t[r],null));return e},d.supports=o)o.hasOwnProperty(f)&&(d.browserHasFlaw=d.browserHasFlaw||!o[f]&&f)},function(t,e){"use strict";var r=!(e.__esModule=!0),n=!1,a=window.document.createElement("div");try{var i="<P><I></P></I>";a.innerHTML=i,e.tagSoup=r=a.innerHTML!==i}catch(t){e.tagSoup=r=!1}try{a.innerHTML="<P><i><P></P></i></P>",e.selfClose=n=2===a.childNodes.length}catch(t){e.selfClose=n=!1}a=null,e.tagSoup=r,e.selfClose=n},function(t,e,r){"use strict";e.__esModule=!0;var o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t};e.comment=function(t){var e=t.indexOf("--\x3e");if(0<=e)return new s.CommentToken(t.substr(4,e-1),e+3)},e.chars=function(t){var e=t.indexOf("<");return new s.CharsToken(0<=e?e:t.length)},e.startTag=a,e.atomicTag=function(t){var e=a(t);if(e){var r=t.slice(e.length);if(r.match(new RegExp("</\\s*"+e.tagName+"\\s*>","i"))){var n=r.match(new RegExp("([\\s\\S]*?)</\\s*"+e.tagName+"\\s*>","i"));if(n)return new s.AtomicTagToken(e.tagName,n[0].length+e.length,e.attrs,e.booleanAttrs,n[1])}}},e.endTag=function(t){var e=t.match(c.endTag);if(e)return new s.EndTagToken(e[1],e[0].length)};var s=r(4),c={startTag:/^<([\-A-Za-z0-9_]+)((?:\s+[\w\-]+(?:\s*=?\s*(?:(?:"[^"]*")|(?:'[^']*')|[^>\s]+))?)*)\s*(\/?)>/,endTag:/^<\/([\-A-Za-z0-9_]+)[^>]*>/,attr:/(?:([\-A-Za-z0-9_]+)\s*=\s*(?:(?:"((?:\\.|[^"])*)")|(?:'((?:\\.|[^'])*)')|([^>\s]+)))|(?:([\-A-Za-z0-9_]+)(\s|$)+)/g,fillAttr:/^(checked|compact|declare|defer|disabled|ismap|multiple|nohref|noresize|noshade|nowrap|readonly|selected)$/i};function a(t){var r,n,a;if(-1!==t.indexOf(">")){var e=t.match(c.startTag);if(e){var i=(r={},n={},a=e[2],e[2].replace(c.attr,function(t,e){arguments[2]||arguments[3]||arguments[4]||arguments[5]?arguments[5]?(r[arguments[5]]="",n[arguments[5]]=!0):r[e]=arguments[2]||arguments[3]||arguments[4]||c.fillAttr.test(e)&&e||"":r[e]="",a=a.replace(t,"")}),{v:new s.StartTagToken(e[1],e[0].length,r,n,!!e[3],a.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,""))});if("object"===(void 0===i?"undefined":o(i)))return i.v}}}},function(t,e,r){"use strict";e.__esModule=!0,e.EndTagToken=e.AtomicTagToken=e.StartTagToken=e.TagToken=e.CharsToken=e.CommentToken=e.Token=void 0;var o=r(5);function s(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}e.Token=function t(e,r){s(this,t),this.type=e,this.length=r,this.text=""},e.CommentToken=(n.prototype.toString=function(){return"\x3c!--"+this.content},n);function n(t,e){s(this,n),this.type="comment",this.length=e||(t?t.length:0),this.text="",this.content=t}e.CharsToken=(a.prototype.toString=function(){return this.text},a);function a(t){s(this,a),this.type="chars",this.length=t,this.text=""}var i=e.TagToken=(c.formatTag=function(t,e){var r=1<arguments.length&&void 0!==e?e:null,n="<"+t.tagName;for(var a in t.attrs)if(t.attrs.hasOwnProperty(a)){n+=" "+a;var i=t.attrs[a];void 0!==t.booleanAttrs&&void 0!==t.booleanAttrs[a]||(n+='="'+(0,o.escapeQuotes)(i)+'"')}return t.rest&&(n+=" "+t.rest),t.unary&&!t.html5Unary?n+="/>":n+=">",null!=r&&(n+=r+"</"+t.tagName+">"),n},c);function c(t,e,r,n,a){s(this,c),this.type=t,this.length=r,this.text="",this.tagName=e,this.attrs=n,this.booleanAttrs=a,this.unary=!1,this.html5Unary=!1}e.StartTagToken=(u.prototype.toString=function(){return i.formatTag(this)},u);function u(t,e,r,n,a,i){s(this,u),this.type="startTag",this.length=e,this.text="",this.tagName=t,this.attrs=r,this.booleanAttrs=n,this.html5Unary=!1,this.unary=a,this.rest=i}e.AtomicTagToken=(l.prototype.toString=function(){return i.formatTag(this,this.content)},l);function l(t,e,r,n,a){s(this,l),this.type="atomicTag",this.length=e,this.text="",this.tagName=t,this.attrs=r,this.booleanAttrs=n,this.unary=!1,this.html5Unary=!1,this.content=a}e.EndTagToken=(d.prototype.toString=function(){return"</"+this.tagName+">"},d);function d(t,e){s(this,d),this.type="endTag",this.length=e,this.text="",this.tagName=t}},function(t,e){"use strict";e.__esModule=!0,e.escapeQuotes=function(t){var e=1<arguments.length&&void 0!==arguments[1]?arguments[1]:"";return t?t.replace(/([^"]*)"/g,function(t,e){return/\\/.test(e)?e+'"':e+'\\"'}):e}},function(t,e){"use strict";e.__esModule=!0,e.default=function(r,n,e){var a=function(){var t=[];return t.last=function(){return this[this.length-1]},t.lastTagNameEq=function(t){var e=this.last();return e&&e.tagName&&e.tagName.toUpperCase()===t.toUpperCase()},t.containsTagName=function(t){for(var e,r=0;e=this[r];r++)if(e.tagName===t)return!0;return!1},t}(),i={startTag:function(t){var e=t.tagName;"TR"===e.toUpperCase()&&a.lastTagNameEq("TABLE")?(r.prepend("<TBODY>"),o()):n.selfCloseFix&&s.test(e)&&a.containsTagName(e)?a.lastTagNameEq(e)?u(r,a):(r.prepend("</"+t.tagName+">"),o()):t.unary||a.push(t)},endTag:function(t){a.last()?n.tagSoupFix&&!a.lastTagNameEq(t.tagName)?u(r,a):a.pop():n.tagSoupFix&&(e(),o())}};function o(){var t=function(t,e){var r=t.stream,n=c(e());return t.stream=r,n}(r,e);t&&i[t.type]&&i[t.type](t)}return function(){return o(),c(e())}};var r=/^(AREA|BASE|BASEFONT|BR|COL|FRAME|HR|IMG|INPUT|ISINDEX|LINK|META|PARAM|EMBED)$/i,s=/^(COLGROUP|DD|DT|LI|OPTIONS|P|TD|TFOOT|TH|THEAD|TR)$/i;function c(t){return t&&"startTag"===t.type&&(t.unary=r.test(t.tagName)||t.unary,t.html5Unary=!/\/>$/.test(t.text)),t}function u(t,e){var r=e.pop();t.prepend("</"+r.tagName+">")}}],r.c=a,r.p="",r(0);function r(t){if(a[t])return a[t].exports;var e=a[t]={exports:{},id:t,loaded:!1};return n[t].call(e.exports,e,e.exports,r),e.loaded=!0,e.exports}var n,a},t.exports=n()},function(t,e){"use strict";e.__esModule=!0;var n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t};function a(t){return null!=t}function i(t,e,r){var n=void 0,a=t&&t.length||0;for(n=0;n<a;n++)e.call(r,t[n],n)}function o(t,e,r){for(var n in t)t.hasOwnProperty(n)&&e.call(r,n,t[n])}function r(t,e){return!(!t||"startTag"!==t.type&&"atomicTag"!==t.type||!("tagName"in t))&&!!~t.tagName.toLowerCase().indexOf(e)}e.existy=a,e.isFunction=function(t){return"function"==typeof t},e.each=i,e.eachKey=o,e.defaults=function(r,t){return r=r||{},o(t,function(t,e){a(r[t])||(r[t]=e)}),r},e.toArray=function(r){try{return Array.prototype.slice.call(r)}catch(t){var e=function(){var e=[];return i(r,function(t){e.push(t)}),{v:e}}();if("object"===(void 0===e?"undefined":n(e)))return e.v}},e.last=function(t){return t[t.length-1]},e.isTag=r,e.isScript=function(t){return r(t,"script")},e.isStyle=function(t){return r(t,"style")}}],r.c=a,r.p="",r(0);function r(t){if(a[t])return a[t].exports;var e=a[t]={exports:{},id:t,loaded:!1};return n[t].call(e.exports,e,e.exports,r),e.loaded=!0,e.exports}var n,a},t.exports=n()},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.newNativeAssetManager=function(c){var u,l=0;function i(t){var e;try{e=JSON.parse(t)}catch(t){console.log("Error parsing response from cache host: ".concat(t))}return e}function r(t){var e=t.uuid,r="".concat(function(t,e){var r=void 0===e||""===e?v:e;return"https://".concat(void 0===t||""===t?n:t).concat(r)}(t.cacheHost,t.cachePath),"?uuid=").concat(e);(0,h.sendRequest)(r,function(t){var e=i(t);if(e&&e.adm){var r=i(e.adm);if(r&&r.assets){var n=function(t){var e,r=[];return t.assets.forEach(function(t){t.img?o.image[t.img.type]?r.push({key:o.image[t.img.type],value:t.img.url}):console.log("ERROR: Invalid image type for image asset"):t.data?o.data[t.data.type]?r.push({key:o.data[t.data.type],value:t.data.value}):console.log("ERROR: Invalid data type for data asset"):t.title&&r.push({key:"title",value:t.title.text})}),t.link&&(t.link.clicktrackers&&(e=t.link.clicktrackers),r.push({key:"clickUrl",value:t.link.url})),{assets:r,clicktrackers:e,imptrackers:t.imptrackers}}(r),a=f(c.document.body.innerHTML,n);c.document.body.innerHTML=a,u&&u({clickTrackers:n.clicktrackers,impTrackers:n.imptrackers})}}})}function a(n){var a=[],i=c.document,o=void 0!==c.pbNativeData;return Object.keys(s).forEach(function(t){var e=s[t],r=n&&!o?"".concat(e,":").concat(n):"".concat(e);~(~i.body.innerHTML.indexOf(r)?i.body.innerHTML.indexOf(r):i.head.innerHTML&&i.head.innerHTML.indexOf(r))&&a.push(e)}),a}function d(t,e){var r={message:"Prebid Native",action:"resizeNativeHeight",adId:t,height:e};c.parent.postMessage(JSON.stringify(r),"*")}function p(t){var e={};try{e=JSON.parse(t.data)}catch(t){return void(10<l++&&c.removeEventListener("message",p))}if("assetResponse"===e.message){var r=c.document.body.innerHTML,n=c.document.head.innerHTML,a=void 0!==c.pbNativeData;if(a&&e.adId!==c.pbNativeData.adId)return;if(n&&(c.document.head.innerHTML=f(n,e)),e.hasOwnProperty("rendererUrl")&&e.rendererUrl||a&&c.pbNativeData.hasOwnProperty("rendererUrl"))if(c.renderAd){var i=c.renderAd&&c.renderAd(e.assets)||"";c.document.body.innerHTML=r+i,u&&u(),c.removeEventListener("message",p),d(e.adId,document.body.clientHeight||document.body.offsetHeight)}else document.getElementById("pb-native-renderer")?document.getElementById("pb-native-renderer").addEventListener("load",function(){var t=c.renderAd&&c.renderAd(e.assets)||"";c.document.body.innerHTML=r+t,u&&u(),c.removeEventListener("message",p),d(e.adId,document.body.clientHeight||document.body.offsetHeight)}):(0,h.loadScript)(c,a&&c.pbNativeData.hasOwnProperty("rendererUrl")&&c.pbNativeData.rendererUrl||e.rendererUrl,function(){var t=c.renderAd&&c.renderAd(e.assets)||"";c.document.body.innerHTML=r+t,u&&u(),c.removeEventListener("message",p),d(e.adId,document.body.clientHeight||document.body.offsetHeight)});else if(e.hasOwnProperty("adTemplate")&&e.adTemplate||a&&c.pbNativeData.hasOwnProperty("adTemplate")){var o=f(a&&c.pbNativeData.hasOwnProperty("adTemplate")&&c.pbNativeData.adTemplate||e.adTemplate,e);c.document.body.innerHTML=r+o,u&&u(),c.removeEventListener("message",p),d(e.adId,document.body.clientHeight||document.body.offsetHeight)}else{var s=f(r,e);c.document.body.innerHTML=s,u&&u(),c.removeEventListener("message",p)}}}function f(t,e){var r=e.assets,a=e.adId,i=t;return(r||[]).forEach(function(t){var e=void 0!==c.pbNativeData,r=a&&!e?"".concat(s[t.key],":").concat(a):e?"##"+"".concat(s[t.key])+"##":"".concat(s[t.key]),n=new RegExp(r,"g");i=i.replace(n,t.value)}),i}return{loadAssets:function(t,e){var r=a(t),n=void 0!==c.pbNativeData;n&&c.pbNativeData.hasOwnProperty("assetsToReplace")&&c.pbNativeData.assetsToReplace.forEach(function(t){var e=t.match(/hb_native_/i)?t:s[t];e&&r.push(e)}),n&&c.pbNativeData.hasOwnProperty("requestAllAssets")&&c.pbNativeData.requestAllAssets?(u=e,function(t){c.addEventListener("message",p,!1);var e={message:"Prebid Native",action:"allAssetRequest",adId:t};c.parent.postMessage(JSON.stringify(e),"*")}(t)):0<r.length&&(u=e,function(t,e){c.addEventListener("message",p,!1);var r={message:"Prebid Native",action:"assetRequest",adId:t,assets:e};c.parent.postMessage(JSON.stringify(r),"*")}(t,r))},loadMobileAssets:function(t,e){0<a().length&&(u=e,r(t))}}};var h=r(0),s={title:"hb_native_title",body:"hb_native_body",body2:"hb_native_body2",privacyLink:"hb_native_privacy",sponsoredBy:"hb_native_brand",image:"hb_native_image",icon:"hb_native_icon",clickUrl:"hb_native_linkurl",displayUrl:"hb_native_displayurl",cta:"hb_native_cta",rating:"hb_native_rating",address:"hb_native_address",downloads:"hb_native_downloads",likes:"hb_native_likes",phone:"hb_native_phone",price:"hb_native_price",salePrice:"hb_native_saleprice",rendererUrl:"hb_renderer_url"},o={image:{1:"icon",3:"image"},data:{1:"sponsoredBy",2:"body",3:"rating",4:"likes",5:"downloads",6:"price",7:"salePrice",8:"phone",9:"address",10:"body2",11:"displayUrl",12:"cta"}},n="prebid.adnxs.com",v="/pbc/v1/cache"}]);
|
1
|
+
/* v1.13.0
|
2
|
+
Updated : 2021-12-09 */
|
3
|
+
!function(r){var n={};function a(t){if(n[t])return n[t].exports;var e=n[t]={i:t,l:!1,exports:{}};return r[t].call(e.exports,e,e.exports,a),e.l=!0,e.exports}a.m=r,a.c=n,a.d=function(t,e,r){a.o(t,e)||Object.defineProperty(t,e,{configurable:!1,enumerable:!0,get:r})},a.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return a.d(e,"a",e),e},a.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},a.p="",a(a.s=1)}([function(t,n,e){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.triggerPixel=function(t,e){var r=new Image;e&&"function"==typeof e&&(r.addEventListener("load",e),r.addEventListener("error",e));r.src=t},n.createTrackPixelHtml=function(t){if(!t)return"";var e=encodeURI(t);return'<div style="position:absolute;left:0px;top:0px;visibility:hidden;"><img src="'.concat(e,'"></div>')},n.writeAdUrl=function(t,e,r){var n=a.getEmptyIframe(r,e);n.src=t,document.body.appendChild(n)},n.writeAdHtml=function(t){r(document.body,t,{error:console.error})},n.sendRequest=function(t,e){var r=new XMLHttpRequest;r.addEventListener("load",function(){e(r.responseText)}),r.open("GET",t),r.send()},n.getUUID=function(){var r=(new Date).getTime();return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(t){var e=(r+16*Math.random())%16|0;return r=Math.floor(r/16),("x"===t?e:3&e|8).toString(16)})},n.loadScript=function(t,e,r,n){var a=t.document,o=a.createElement("script");o.type="text/javascript",r&&"function"==typeof r&&(o.readyState?o.onreadystatechange=function(){"loaded"!==o.readyState&&"complete"!==o.readyState||(o.onreadystatechange=null,r())}:o.onload=function(){r()});n&&"function"==typeof n&&(o.onerror=function(){n()});o.src=e;var i=a.getElementsByTagName("head");(i=i.length?i:a.getElementsByTagName("body")).length&&(i=i[0]).insertBefore(o,i.firstChild);return o},n.getCreativeComment=function(t){return document.createComment("Creative ".concat(t.crid," served by Prebid.js Header Bidding"))},n.getCreativeCommentMarkup=function(t){var e=n.getCreativeComment(t),r=document.createElement("div");return r.appendChild(e),r.innerHTML},n.transformAuctionTargetingData=function(e){var r={hb_adid:"adId",hb_cache_host:"cacheHost",hb_cache_path:"cachePath",hb_cache_id:"uuid",hb_format:"mediaType",hb_env:"env",hb_size:"size",hb_pb:"hbPb"};function t(t){return!(!e[t]||!(function(t){return o(t,"Object")}(e[t])&&0<Object.keys(e[t]).length||s(e[t])&&""!==e[t]))}var n={},a={};t("targetingMap")?a=function(e){var r={};return Object.keys(e).forEach(function(t){Array.isArray(e[t])&&0<e[t].length&&(r[t]=e[t][0])}),r}(e.targetingMap):t("targetingKeywords")&&(a=function(t){var a={},e=t.split(",");return 0<e.length&&e.forEach(function(t){var e=t.split(":");if(2===e.length){var r=e[0],n=e[1];a[r]=n}}),a}(e.targetingKeywords));return function(e){Object.keys(e).forEach(function(t){n[r[t]||t]=e[t]})}(a),Object.keys(e).forEach(function(t){"targetingMap"!==t&&"targetingKeywords"!==t&&s(e[t])&&""!==e[t]&&(n[t]=e[t])}),n},n.parseUrl=function(t){var e=document.createElement("a");return e.href=decodeURIComponent(t),{href:e.href,protocol:(e.protocol||"").replace(/:$/,""),hostname:e.hostname,port:+e.port,pathname:e.pathname.replace(/^(?!\/)/,"/"),hash:(e.hash||"").replace(/^#/,""),host:(e.host||window.location.host).replace(/:(443|80)$/,"")}};var a=function(t){if(t&&t.__esModule)return t;var e=i();if(e&&e.has(t))return e.get(t);var r={};if(null!=t){var n=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var a in t)if(Object.prototype.hasOwnProperty.call(t,a)){var o=n?Object.getOwnPropertyDescriptor(t,a):null;o&&(o.get||o.set)?Object.defineProperty(r,a,o):r[a]=t[a]}}r.default=t,e&&e.set(t,r);return r}(e(3));function i(){if("function"!=typeof WeakMap)return null;var t=new WeakMap;return i=function(){return t},t}var r=e(4);function o(t,e){return Object.prototype.toString.call(t)==="[object "+e+"]"}function s(t){return o(t,"String")}},function(t,e,r){"use strict";var n=r(2);window.pbNativeTag=window.pbNativeTag||{};var a=(0,n.newNativeRenderManager)(window);window.pbNativeTag.renderNativeAd=a.renderNativeAd},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.newNativeRenderManager=function(n){var a;function o(t,e){if(""===t)console.warn("Prebid tracking event was missing 'adId'. Was adId macro set in the HTML attribute "+l+"on the ad's anchor element");else{var r={message:"Prebid Native",adId:t};"click"===e&&(r.action="click"),n.parent.postMessage(JSON.stringify(r),a)}}function i(){for(var t=function(t){return n.document.getElementsByClassName(t)||[]}(u),e=0;e<t.length;e++)t[e].addEventListener("click",function(t){o(window.pbNativeData.adId,"click")},!0)}return{renderNativeAd:function(t){window.pbNativeData=t;(0,s.transformAuctionTargetingData)(t);var e=(0,c.newNativeAssetManager)(window);if(t.hasOwnProperty("adId")){var r=(0,s.parseUrl)(window.pbNativeData.pubUrl);if(a=r.protocol+"://"+r.host,t.hasOwnProperty("rendererUrl")&&!t.rendererUrl.match(/##.*##/i)){var n=document.createElement("SCRIPT");n.src=t.rendererUrl,n.id="pb-native-renderer",document.body.appendChild(n)}e.loadAssets(t.adId,i),i(),function(t){o(t,"impression")}(t.adId)}else console.warn("Prebid Native Tag object was missing 'adId'.")}}};var s=r(0),c=r(5),u="pb-click",l="pbAdId"},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.getEmptyIframe=function(t,e){var r=document.createElement("iframe");return r.setAttribute("frameborder",0),r.setAttribute("scrolling","no"),r.setAttribute("marginheight",0),r.setAttribute("marginwidth",0),r.setAttribute("TOPMARGIN",0),r.setAttribute("LEFTMARGIN",0),r.setAttribute("allowtransparency","true"),r.setAttribute("width",e),r.setAttribute("height",t),r},e.insertElement=function(t,e,r){var n;e=e||document,n=r?e.getElementsByTagName(r):e.getElementsByTagName("head");try{(n=n.length?n:e.getElementsByTagName("body")).length&&(n=n[0]).insertBefore(t,n.firstChild)}catch(t){}}},function(t,e,r){var n;n=function(){return a={},r.m=n=[function(t,e,r){"use strict";var n,a=r(1),o=(n=a)&&n.__esModule?n:{default:n};t.exports=o.default},function(t,e,r){"use strict";e.__esModule=!0;var s=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var r=arguments[e];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(t[n]=r[n])}return t};e.default=h;var n,a=r(2),c=(n=a)&&n.__esModule?n:{default:n},o=function(t){{if(t&&t.__esModule)return t;var e={};if(null!=t)for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e.default=t,e}}(r(4));function u(){}var i={afterAsync:u,afterDequeue:u,afterStreamStart:u,afterWrite:u,autoFix:!0,beforeEnqueue:u,beforeWriteToken:function(t){return t},beforeWrite:function(t){return t},done:u,error:function(t){throw new Error(t.msg)},releaseAsync:!1},l=0,d=[],p=null;function f(){var t=d.shift();if(t){var e=o.last(t);e.afterDequeue(),t.stream=function(t,e,n){(p=new c.default(t,n)).id=l++,p.name=n.name||p.id,h.streams[p.name]=p;var r=t.ownerDocument,a={close:r.close,open:r.open,write:r.write,writeln:r.writeln};function o(t){t=n.beforeWrite(t),p.write(t),n.afterWrite(t)}s(r,{close:u,open:u,write:function(){for(var t=arguments.length,e=Array(t),r=0;r<t;r++)e[r]=arguments[r];return o(e.join(""))},writeln:function(){for(var t=arguments.length,e=Array(t),r=0;r<t;r++)e[r]=arguments[r];return o(e.join("")+"\n")}});var i=p.win.onerror||u;return p.win.onerror=function(t,e,r){n.error({msg:t+" - "+e+": "+r}),i.apply(p.win,[t,e,r])},p.write(e,function(){s(r,a),p.win.onerror=i,n.done(),p=null,f()}),p}.apply(void 0,t),e.afterStreamStart()}}function h(t,e,r){if(o.isFunction(r))r={done:r};else if("clear"===r)return d=[],p=null,void(l=0);r=o.defaults(r,i);var n=[t=/^#/.test(t)?window.document.getElementById(t.substr(1)):t.jquery?t[0]:t,e,r];return t.postscribe={cancel:function(){n.stream?n.stream.abort():n[1]=u}},r.beforeEnqueue(n),d.push(n),p||f(),t.postscribe}s(h,{streams:{},queue:d,WriteStream:c.default})},function(t,e,r){"use strict";e.__esModule=!0;var n,s=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var r=arguments[e];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(t[n]=r[n])}return t},a=r(3),o=(n=a)&&n.__esModule?n:{default:n},i=function(t){{if(t&&t.__esModule)return t;var e={};if(null!=t)for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e.default=t,e}}(r(4));var l="data-ps-",d="ps-style",p="ps-script";function c(t,e){var r=l+e,n=t.getAttribute(r);return i.existy(n)?String(n):n}function u(t,e,r){var n=2<arguments.length&&void 0!==r?r:null,a=l+e;i.existy(n)&&""!==n?t.setAttribute(a,n):t.removeAttribute(a)}var f=(h.prototype.write=function(){var t;for((t=this.writeQueue).push.apply(t,arguments);!this.deferredRemote&&this.writeQueue.length;){var e=this.writeQueue.shift();i.isFunction(e)?this._callFunction(e):this._writeImpl(e)}},h.prototype._callFunction=function(t){var e={type:"function",value:t.name||t.toString()};this._onScriptStart(e),t.call(this.win,this.doc),this._onScriptDone(e)},h.prototype._writeImpl=function(t){this.parser.append(t);for(var e=void 0,r=void 0,n=void 0,a=[];(e=this.parser.readToken())&&!(r=i.isScript(e))&&!(n=i.isStyle(e));)(e=this.options.beforeWriteToken(e))&&a.push(e);0<a.length&&this._writeStaticTokens(a),r&&this._handleScriptToken(e),n&&this._handleStyleToken(e)},h.prototype._writeStaticTokens=function(t){var e=this._buildChunk(t);return e.actual?(e.html=this.proxyHistory+e.actual,this.proxyHistory+=e.proxy,this.proxyRoot.innerHTML=e.html,this._walkChunk(),e):null},h.prototype._buildChunk=function(t){for(var e=this.actuals.length,r=[],n=[],a=[],o=t.length,i=0;i<o;i++){var s=t[i],c=s.toString();if(r.push(c),s.attrs){if(!/^noscript$/i.test(s.tagName)){var u=e++;n.push(c.replace(/(\/?>)/," "+l+"id="+u+" $1")),s.attrs.id!==p&&s.attrs.id!==d&&a.push("atomicTag"===s.type?"":"<"+s.tagName+" "+l+"proxyof="+u+(s.unary?" />":">"))}}else n.push(c),a.push("endTag"===s.type?c:"")}return{tokens:t,raw:r.join(""),actual:n.join(""),proxy:a.join("")}},h.prototype._walkChunk=function(){for(var t=void 0,e=[this.proxyRoot];i.existy(t=e.shift());){var r=1===t.nodeType;if(!r||!c(t,"proxyof")){r&&u(this.actuals[c(t,"id")]=t,"id");var n=t.parentNode&&c(t.parentNode,"proxyof");n&&this.actuals[n].appendChild(t)}e.unshift.apply(e,i.toArray(t.childNodes))}},h.prototype._handleScriptToken=function(t){var e=this,r=this.parser.clear();r&&this.writeQueue.unshift(r),t.src=t.attrs.src||t.attrs.SRC,(t=this.options.beforeWriteToken(t))&&(t.src&&this.scriptStack.length?this.deferredRemote=t:this._onScriptStart(t),this._writeScriptToken(t,function(){e._onScriptDone(t)}))},h.prototype._handleStyleToken=function(t){var e=this.parser.clear();e&&this.writeQueue.unshift(e),t.type=t.attrs.type||t.attrs.TYPE||"text/css",(t=this.options.beforeWriteToken(t))&&this._writeStyleToken(t),e&&this.write()},h.prototype._writeStyleToken=function(t){var e=this._buildStyle(t);this._insertCursor(e,d),t.content&&(e.styleSheet&&!e.sheet?e.styleSheet.cssText=t.content:e.appendChild(this.doc.createTextNode(t.content)))},h.prototype._buildStyle=function(t){var r=this.doc.createElement(t.tagName);return r.setAttribute("type",t.type),i.eachKey(t.attrs,function(t,e){r.setAttribute(t,e)}),r},h.prototype._insertCursor=function(t,e){this._writeImpl('<span id="'+e+'"/>');var r=this.doc.getElementById(e);r&&r.parentNode.replaceChild(t,r)},h.prototype._onScriptStart=function(t){t.outerWrites=this.writeQueue,this.writeQueue=[],this.scriptStack.unshift(t)},h.prototype._onScriptDone=function(t){t===this.scriptStack[0]?(this.scriptStack.shift(),this.write.apply(this,t.outerWrites),!this.scriptStack.length&&this.deferredRemote&&(this._onScriptStart(this.deferredRemote),this.deferredRemote=null)):this.options.error({msg:"Bad script nesting or script finished twice"})},h.prototype._writeScriptToken=function(t,e){var r=this._buildScript(t),n=this._shouldRelease(r),a=this.options.afterAsync;t.src&&(r.src=t.src,this._scriptLoadHandler(r,n?a:function(){e(),a()}));try{this._insertCursor(r,p),r.src&&!n||e()}catch(t){this.options.error(t),e()}},h.prototype._buildScript=function(t){var r=this.doc.createElement(t.tagName);return i.eachKey(t.attrs,function(t,e){r.setAttribute(t,e)}),t.content&&(r.text=t.content),r},h.prototype._scriptLoadHandler=function(e,r){function n(){e=e.onload=e.onreadystatechange=e.onerror=null}var a=this.options.error;function t(){n(),null!=r&&r(),r=null}function o(t){n(),a(t),null!=r&&r(),r=null}function i(t,e){var r=t["on"+e];null!=r&&(t["_on"+e]=r)}i(e,"load"),i(e,"error"),s(e,{onload:function(){if(e._onload)try{e._onload.apply(this,Array.prototype.slice.call(arguments,0))}catch(t){o({msg:"onload handler failed "+t+" @ "+e.src})}t()},onerror:function(){if(e._onerror)try{e._onerror.apply(this,Array.prototype.slice.call(arguments,0))}catch(t){return void o({msg:"onerror handler failed "+t+" @ "+e.src})}o({msg:"remote script failed "+e.src})},onreadystatechange:function(){/^(loaded|complete)$/.test(e.readyState)&&t()}})},h.prototype._shouldRelease=function(t){return!/^script$/i.test(t.nodeName)||!!(this.options.releaseAsync&&t.src&&t.hasAttribute("async"))},h);function h(t){var e=1<arguments.length&&void 0!==arguments[1]?arguments[1]:{};!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,h),this.root=t,this.options=e,this.doc=t.ownerDocument,this.win=this.doc.defaultView||this.doc.parentWindow,this.parser=new o.default("",{autoFix:e.autoFix}),this.actuals=[t],this.proxyHistory="",this.proxyRoot=this.doc.createElement(t.nodeName),this.scriptStack=[],this.writeQueue=[],u(this.proxyRoot,"proxyof",0)}e.default=f},function(t,e,r){var n;n=function(){return a={},r.m=n=[function(t,e,r){"use strict";var n,a=r(1),o=(n=a)&&n.__esModule?n:{default:n};t.exports=o.default},function(t,e,r){"use strict";e.__esModule=!0;var n,i=u(r(2)),a=u(r(3)),o=r(6),s=(n=o)&&n.__esModule?n:{default:n},c=r(5);function u(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e.default=t,e}var l={comment:/^<!--/,endTag:/^<\//,atomicTag:/^<\s*(script|style|noscript|iframe|textarea)[\s\/>]/i,startTag:/^</,chars:/^[^<]/},d=(p.prototype.append=function(t){this.stream+=t},p.prototype.prepend=function(t){this.stream=t+this.stream},p.prototype._readTokenImpl=function(){var t=this._peekTokenImpl();if(t)return this.stream=this.stream.slice(t.length),t},p.prototype._peekTokenImpl=function(){for(var t in l)if(l.hasOwnProperty(t)&&l[t].test(this.stream)){var e=a[t](this.stream);if(e)return"startTag"===e.type&&/script|style/i.test(e.tagName)?null:(e.text=this.stream.substr(0,e.length),e)}},p.prototype.peekToken=function(){return this._peekToken()},p.prototype.readToken=function(){return this._readToken()},p.prototype.readTokens=function(t){for(var e=void 0;e=this.readToken();)if(t[e.type]&&!1===t[e.type](e))return},p.prototype.clear=function(){var t=this.stream;return this.stream="",t},p.prototype.rest=function(){return this.stream},p);function p(){var t=this,e=0<arguments.length&&void 0!==arguments[0]?arguments[0]:"",r=1<arguments.length&&void 0!==arguments[1]?arguments[1]:{};!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,p),this.stream=e;var n=!1,a={};for(var o in i)i.hasOwnProperty(o)&&(r.autoFix&&(a[o+"Fix"]=!0),n=n||a[o+"Fix"]);n?(this._readToken=(0,s.default)(this,a,function(){return t._readTokenImpl()}),this._peekToken=(0,s.default)(this,a,function(){return t._peekTokenImpl()})):(this._readToken=this._readTokenImpl,this._peekToken=this._peekTokenImpl)}for(var f in(e.default=d).tokenToString=function(t){return t.toString()},d.escapeAttributes=function(t){var e={};for(var r in t)t.hasOwnProperty(r)&&(e[r]=(0,c.escapeQuotes)(t[r],null));return e},d.supports=i)i.hasOwnProperty(f)&&(d.browserHasFlaw=d.browserHasFlaw||!i[f]&&f)},function(t,e){"use strict";var r=!(e.__esModule=!0),n=!1,a=window.document.createElement("div");try{var o="<P><I></P></I>";a.innerHTML=o,e.tagSoup=r=a.innerHTML!==o}catch(t){e.tagSoup=r=!1}try{a.innerHTML="<P><i><P></P></i></P>",e.selfClose=n=2===a.childNodes.length}catch(t){e.selfClose=n=!1}a=null,e.tagSoup=r,e.selfClose=n},function(t,e,r){"use strict";e.__esModule=!0;var i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t};e.comment=function(t){var e=t.indexOf("--\x3e");if(0<=e)return new s.CommentToken(t.substr(4,e-1),e+3)},e.chars=function(t){var e=t.indexOf("<");return new s.CharsToken(0<=e?e:t.length)},e.startTag=a,e.atomicTag=function(t){var e=a(t);if(e){var r=t.slice(e.length);if(r.match(new RegExp("</\\s*"+e.tagName+"\\s*>","i"))){var n=r.match(new RegExp("([\\s\\S]*?)</\\s*"+e.tagName+"\\s*>","i"));if(n)return new s.AtomicTagToken(e.tagName,n[0].length+e.length,e.attrs,e.booleanAttrs,n[1])}}},e.endTag=function(t){var e=t.match(c.endTag);if(e)return new s.EndTagToken(e[1],e[0].length)};var s=r(4),c={startTag:/^<([\-A-Za-z0-9_]+)((?:\s+[\w\-]+(?:\s*=?\s*(?:(?:"[^"]*")|(?:'[^']*')|[^>\s]+))?)*)\s*(\/?)>/,endTag:/^<\/([\-A-Za-z0-9_]+)[^>]*>/,attr:/(?:([\-A-Za-z0-9_]+)\s*=\s*(?:(?:"((?:\\.|[^"])*)")|(?:'((?:\\.|[^'])*)')|([^>\s]+)))|(?:([\-A-Za-z0-9_]+)(\s|$)+)/g,fillAttr:/^(checked|compact|declare|defer|disabled|ismap|multiple|nohref|noresize|noshade|nowrap|readonly|selected)$/i};function a(t){var r,n,a;if(-1!==t.indexOf(">")){var e=t.match(c.startTag);if(e){var o=(r={},n={},a=e[2],e[2].replace(c.attr,function(t,e){arguments[2]||arguments[3]||arguments[4]||arguments[5]?arguments[5]?(r[arguments[5]]="",n[arguments[5]]=!0):r[e]=arguments[2]||arguments[3]||arguments[4]||c.fillAttr.test(e)&&e||"":r[e]="",a=a.replace(t,"")}),{v:new s.StartTagToken(e[1],e[0].length,r,n,!!e[3],a.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,""))});if("object"===(void 0===o?"undefined":i(o)))return o.v}}}},function(t,e,r){"use strict";e.__esModule=!0,e.EndTagToken=e.AtomicTagToken=e.StartTagToken=e.TagToken=e.CharsToken=e.CommentToken=e.Token=void 0;var i=r(5);function s(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}e.Token=function t(e,r){s(this,t),this.type=e,this.length=r,this.text=""},e.CommentToken=(n.prototype.toString=function(){return"\x3c!--"+this.content},n);function n(t,e){s(this,n),this.type="comment",this.length=e||(t?t.length:0),this.text="",this.content=t}e.CharsToken=(a.prototype.toString=function(){return this.text},a);function a(t){s(this,a),this.type="chars",this.length=t,this.text=""}var o=e.TagToken=(c.formatTag=function(t,e){var r=1<arguments.length&&void 0!==e?e:null,n="<"+t.tagName;for(var a in t.attrs)if(t.attrs.hasOwnProperty(a)){n+=" "+a;var o=t.attrs[a];void 0!==t.booleanAttrs&&void 0!==t.booleanAttrs[a]||(n+='="'+(0,i.escapeQuotes)(o)+'"')}return t.rest&&(n+=" "+t.rest),t.unary&&!t.html5Unary?n+="/>":n+=">",null!=r&&(n+=r+"</"+t.tagName+">"),n},c);function c(t,e,r,n,a){s(this,c),this.type=t,this.length=r,this.text="",this.tagName=e,this.attrs=n,this.booleanAttrs=a,this.unary=!1,this.html5Unary=!1}e.StartTagToken=(u.prototype.toString=function(){return o.formatTag(this)},u);function u(t,e,r,n,a,o){s(this,u),this.type="startTag",this.length=e,this.text="",this.tagName=t,this.attrs=r,this.booleanAttrs=n,this.html5Unary=!1,this.unary=a,this.rest=o}e.AtomicTagToken=(l.prototype.toString=function(){return o.formatTag(this,this.content)},l);function l(t,e,r,n,a){s(this,l),this.type="atomicTag",this.length=e,this.text="",this.tagName=t,this.attrs=r,this.booleanAttrs=n,this.unary=!1,this.html5Unary=!1,this.content=a}e.EndTagToken=(d.prototype.toString=function(){return"</"+this.tagName+">"},d);function d(t,e){s(this,d),this.type="endTag",this.length=e,this.text="",this.tagName=t}},function(t,e){"use strict";e.__esModule=!0,e.escapeQuotes=function(t){var e=1<arguments.length&&void 0!==arguments[1]?arguments[1]:"";return t?t.replace(/([^"]*)"/g,function(t,e){return/\\/.test(e)?e+'"':e+'\\"'}):e}},function(t,e){"use strict";e.__esModule=!0,e.default=function(r,n,e){var a=function(){var t=[];return t.last=function(){return this[this.length-1]},t.lastTagNameEq=function(t){var e=this.last();return e&&e.tagName&&e.tagName.toUpperCase()===t.toUpperCase()},t.containsTagName=function(t){for(var e,r=0;e=this[r];r++)if(e.tagName===t)return!0;return!1},t}(),o={startTag:function(t){var e=t.tagName;"TR"===e.toUpperCase()&&a.lastTagNameEq("TABLE")?(r.prepend("<TBODY>"),i()):n.selfCloseFix&&s.test(e)&&a.containsTagName(e)?a.lastTagNameEq(e)?u(r,a):(r.prepend("</"+t.tagName+">"),i()):t.unary||a.push(t)},endTag:function(t){a.last()?n.tagSoupFix&&!a.lastTagNameEq(t.tagName)?u(r,a):a.pop():n.tagSoupFix&&(e(),i())}};function i(){var t=function(t,e){var r=t.stream,n=c(e());return t.stream=r,n}(r,e);t&&o[t.type]&&o[t.type](t)}return function(){return i(),c(e())}};var r=/^(AREA|BASE|BASEFONT|BR|COL|FRAME|HR|IMG|INPUT|ISINDEX|LINK|META|PARAM|EMBED)$/i,s=/^(COLGROUP|DD|DT|LI|OPTIONS|P|TD|TFOOT|TH|THEAD|TR)$/i;function c(t){return t&&"startTag"===t.type&&(t.unary=r.test(t.tagName)||t.unary,t.html5Unary=!/\/>$/.test(t.text)),t}function u(t,e){var r=e.pop();t.prepend("</"+r.tagName+">")}}],r.c=a,r.p="",r(0);function r(t){if(a[t])return a[t].exports;var e=a[t]={exports:{},id:t,loaded:!1};return n[t].call(e.exports,e,e.exports,r),e.loaded=!0,e.exports}var n,a},t.exports=n()},function(t,e){"use strict";e.__esModule=!0;var n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t};function a(t){return null!=t}function o(t,e,r){var n=void 0,a=t&&t.length||0;for(n=0;n<a;n++)e.call(r,t[n],n)}function i(t,e,r){for(var n in t)t.hasOwnProperty(n)&&e.call(r,n,t[n])}function r(t,e){return!(!t||"startTag"!==t.type&&"atomicTag"!==t.type||!("tagName"in t))&&!!~t.tagName.toLowerCase().indexOf(e)}e.existy=a,e.isFunction=function(t){return"function"==typeof t},e.each=o,e.eachKey=i,e.defaults=function(r,t){return r=r||{},i(t,function(t,e){a(r[t])||(r[t]=e)}),r},e.toArray=function(r){try{return Array.prototype.slice.call(r)}catch(t){var e=function(){var e=[];return o(r,function(t){e.push(t)}),{v:e}}();if("object"===(void 0===e?"undefined":n(e)))return e.v}},e.last=function(t){return t[t.length-1]},e.isTag=r,e.isScript=function(t){return r(t,"script")},e.isStyle=function(t){return r(t,"style")}}],r.c=a,r.p="",r(0);function r(t){if(a[t])return a[t].exports;var e=a[t]={exports:{},id:t,loaded:!1};return n[t].call(e.exports,e,e.exports,r),e.loaded=!0,e.exports}var n,a},t.exports=n()},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.newNativeAssetManager=function(c){var u,l=0;function o(t){var e;try{e=JSON.parse(t)}catch(t){console.log("Error parsing response from cache host: ".concat(t))}return e}function r(t){var e=t.uuid,r="".concat(function(t,e){var r=void 0===e||""===e?y:e;return"https://".concat(void 0===t||""===t?n:t).concat(r)}(t.cacheHost,t.cachePath),"?uuid=").concat(e);(0,h.sendRequest)(r,function(t){var e=o(t);if(e&&e.adm){var r=o(e.adm);if(r&&r.assets){var n=function(t){var e,r=[];return t.assets.forEach(function(t){t.img?i.image[t.img.type]?r.push({key:i.image[t.img.type],value:t.img.url}):console.log("ERROR: Invalid image type for image asset"):t.data?i.data[t.data.type]?r.push({key:i.data[t.data.type],value:t.data.value}):console.log("ERROR: Invalid data type for data asset"):t.title&&r.push({key:"title",value:t.title.text})}),t.link&&(t.link.clicktrackers&&(e=t.link.clicktrackers),r.push({key:"clickUrl",value:t.link.url})),{assets:r,clicktrackers:e,imptrackers:t.imptrackers}}(r),a=f(c.document.body.innerHTML,n);c.document.body.innerHTML=a,u&&u({clickTrackers:n.clicktrackers,impTrackers:n.imptrackers})}}})}function a(n){var a=[],o=c.document,i=void 0!==c.pbNativeData;return Object.keys(s).forEach(function(t){var e=s[t],r=n&&!i?"".concat(e,":").concat(n):"".concat(e);~(~o.body.innerHTML.indexOf(r)?o.body.innerHTML.indexOf(r):o.head.innerHTML&&o.head.innerHTML.indexOf(r))&&a.push(e)}),a}function d(t,e){var r={message:"Prebid Native",action:"resizeNativeHeight",adId:t,height:e};c.parent.postMessage(JSON.stringify(r),"*")}function p(t){var e={};try{e=JSON.parse(t.data)}catch(t){return void(10<l++&&c.removeEventListener("message",p))}if("assetResponse"===e.message){var r=c.document.body.innerHTML,n=c.document.head.innerHTML,a=void 0!==c.pbNativeData;if(a&&e.adId!==c.pbNativeData.adId)return;if(n&&(c.document.head.innerHTML=f(n,e)),e.hasOwnProperty("rendererUrl")&&e.rendererUrl||a&&c.pbNativeData.hasOwnProperty("rendererUrl"))if(c.renderAd){var o=c.renderAd&&c.renderAd(e.assets)||"";c.document.body.innerHTML=r+o,u&&u(),c.removeEventListener("message",p),d(e.adId,document.body.clientHeight||document.body.offsetHeight)}else document.getElementById("pb-native-renderer")?document.getElementById("pb-native-renderer").addEventListener("load",function(){var t=c.renderAd&&c.renderAd(e.assets)||"";c.document.body.innerHTML=r+t,u&&u(),c.removeEventListener("message",p),d(e.adId,document.body.clientHeight||document.body.offsetHeight)}):(0,h.loadScript)(c,a&&c.pbNativeData.hasOwnProperty("rendererUrl")&&c.pbNativeData.rendererUrl||e.rendererUrl,function(){var t=c.renderAd&&c.renderAd(e.assets)||"";c.document.body.innerHTML=r+t,u&&u(),c.removeEventListener("message",p),d(e.adId,document.body.clientHeight||document.body.offsetHeight)});else if(e.hasOwnProperty("adTemplate")&&e.adTemplate||a&&c.pbNativeData.hasOwnProperty("adTemplate")){var i=f(a&&c.pbNativeData.hasOwnProperty("adTemplate")&&c.pbNativeData.adTemplate||e.adTemplate,e);c.document.body.innerHTML=r+i,u&&u(),c.removeEventListener("message",p),d(e.adId,document.body.clientHeight||document.body.offsetHeight)}else{var s=f(r,e);c.document.body.innerHTML=s,u&&u(),c.removeEventListener("message",p)}}}function f(t,e){var r=e.assets,a=e.adId,o=t;return(r||[]).forEach(function(t){var e=void 0!==c.pbNativeData,r=a&&!e?"".concat(s[t.key],":").concat(a):e?"##"+"".concat(s[t.key])+"##":"".concat(s[t.key]),n=new RegExp(r,"g");o=o.replace(n,t.value)}),o}return{loadAssets:function(t,e){var r=a(t),n=void 0!==c.pbNativeData;n&&c.pbNativeData.hasOwnProperty("assetsToReplace")&&c.pbNativeData.assetsToReplace.forEach(function(t){var e=t.match(/hb_native_/i)?t:s[t];e&&r.push(e)}),n&&c.pbNativeData.hasOwnProperty("requestAllAssets")&&c.pbNativeData.requestAllAssets?(u=e,function(t){c.addEventListener("message",p,!1);var e={message:"Prebid Native",action:"allAssetRequest",adId:t};c.parent.postMessage(JSON.stringify(e),"*")}(t)):0<r.length&&(u=e,function(t,e){c.addEventListener("message",p,!1);var r={message:"Prebid Native",action:"assetRequest",adId:t,assets:e};c.parent.postMessage(JSON.stringify(r),"*")}(t,r))},loadMobileAssets:function(t,e){0<a().length&&(u=e,r(t))}}};var h=r(0),s={title:"hb_native_title",body:"hb_native_body",body2:"hb_native_body2",privacyLink:"hb_native_privacy",sponsoredBy:"hb_native_brand",image:"hb_native_image",icon:"hb_native_icon",clickUrl:"hb_native_linkurl",displayUrl:"hb_native_displayurl",cta:"hb_native_cta",rating:"hb_native_rating",address:"hb_native_address",downloads:"hb_native_downloads",likes:"hb_native_likes",phone:"hb_native_phone",price:"hb_native_price",salePrice:"hb_native_saleprice",rendererUrl:"hb_renderer_url"},i={image:{1:"icon",3:"image"},data:{1:"sponsoredBy",2:"body",3:"rating",4:"likes",5:"downloads",6:"price",7:"salePrice",8:"phone",9:"address",10:"body2",11:"displayUrl",12:"cta"}},n="prebid.adnxs.com",y="/pbc/v1/cache"}]);
|