1 line
34 KiB
JavaScript
1 line
34 KiB
JavaScript
/*! @amzn/dtb-m.js - v2.18.0 - 2022-06-16 21:34:47 */!function(n){var i={};function r(e){if(i[e])return i[e].exports;var t=i[e]={i:e,l:!1,exports:{}};return n[e].call(t.exports,t,t.exports,r),t.l=!0,t.exports}r.m=n,r.c=i,r.d=function(e,t,n){r.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},r.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.t=function(t,e){if(1&e&&(t=r(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var i in t)r.d(n,i,function(e){return t[e]}.bind(null,i));return n},r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,"a",t),t},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.p="",r(r.s=4)}([function(e,t,n){e.exports=n(6)},function(t,e){function n(e){return(n="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)}function i(e){return"function"==typeof Symbol&&"symbol"===n(Symbol.iterator)?t.exports=i=function(e){return n(e)}:t.exports=i=function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":n(e)},t.exports.default=t.exports,t.exports.__esModule=!0,i(e)}t.exports=i,t.exports.default=t.exports,t.exports.__esModule=!0},function(e,t,n){var r=n(5);e.exports=function(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?Object(arguments[e]):{},i=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(i=i.concat(Object.getOwnPropertySymbols(n).filter(function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))),i.forEach(function(e){r(t,e,n[e])})}return t},e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t){function d(e,t,n,i,r,o,a){try{var s=e[o](a),d=s.value}catch(e){return void n(e)}s.done?t(d):Promise.resolve(d).then(i,r)}e.exports=function(s){return function(){var e=this,a=arguments;return new Promise(function(t,n){var i=s.apply(e,a);function r(e){d(i,t,n,r,o,"next",e)}function o(e){d(i,t,n,r,o,"throw",e)}r(void 0)})}},e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t,n){"use strict";n.r(t);var i=n(3),xe=n.n(i),r=n(1),Se=n.n(r),o=n(2),Le=n.n(o),a=n(0),ke=n.n(a);window.amzn=window.amzn||{},window.amzn.dtb=window.amzn.dtb||{},function(L){var k,I=!1,r=!1,_="aax-us-east.amazon-adsystem.com",A="c.amazon-adsystem.com",C=null,R=null,O=!1,P=null,z=null,o=!1,a=!1,j=null,M=null,D=null,N="https://",V="__dtbAd__",t="apsAdIframe",c=/linux.*android.*?/g.test(window.navigator.userAgent.toLowerCase()),T=/(iphone|ipod|ipad|mac).*applewebkit.*?/g.test(window.navigator.userAgent.toLowerCase()),i=!1,s=!1,B=!1,d=null,l=[100,400,500,1500,2500],W="https://dcqi4aodgg8tv.cloudfront.net/apsvideoplayersdk/latest/apsvid.js",F="https://dcqi4aodgg8tv.cloudfront.net/apsvideoplayersdk/latest/apsvid.dev.js";L.sdkType="unknown";var u="https://c.amazon-adsystem.com/bao-csm/mobile/csm.js.gz",p={nike:{sampleRate:1,currentlySampling:!1},apsLibraryError:{sampleRate:10,currentlySampling:!1},gmaSDK:{sampleRate:1,currentlySampling:!1},deepLink:{sampleRate:1,currentlySampling:!1},adRendering:{sampleRate:1,currentlySampling:!1},skAdNetworkMraid:{sampleRate:1,currentlySampling:!1},btr:{sampleRate:1,currentlySampling:!1}},H={networkCalls:{pixels:[],adm:[],imp:[],lib:[]},logs:[]},g=!1,m=!1,f=!1,v=!1;L.log=function(){var e=Array.from(arguments).join(" ");I&&console&&console.log&&!r&&console.log(e),H.logs.push(e)},X();var n,w=(n=!1,{impRendered:function(){var e=b(1);x.send(e,C)},mraid3Comparison:function(){p.nike.currentlySampling&&"3.0"===mraid.getVersion()&&(mraid.addEventListener("viewableChange",h),mraid.addEventListener("exposureChange",y),h())}});function h(){if(mraid.isViewable()&&!n){var e=b(2);x.send(e,C),n=!0,window.mraid.removeEventListener("viewableChange",h)}}function y(e){if(1<=e){var t=b(3);x.send(t,C),window.mraid.removeEventListener("exposureChange",y)}}function b(e){return{p:e,_type:"nike"}}function E(e){return"".concat(0<arguments.length&&void 0!==e?e:"cb","=").concat(I?0:Math.round(1e7*Math.random()))}var x={send:function(e,t){try{G(t?J(e,t):K(e))}catch(e){console.log(e)}},getUrl:function(e,t){try{return t?J(e,t):K(e)}catch(e){return console.log(e),null}}};function S(e){var t=JSON.stringify(function(e){var t={lv:"2.18.0",ts:I?0:Date.now(),_tl:"aps-mtag"};return Le()({},t,e)}(e));return t=function(e){return e.replace(/\\.{1}/g,"")}(t),t=encodeURIComponent(t)}function U(){return N+_+"/x/px/"}function G(e){(new Image).src=e,H.networkCalls.pixels.push(e),L.log("Pixel sent: ".concat(e))}function K(e){return U()+"p/PH/"+S(e)+"?"+E()}function J(e,t){return U()+t+"/"+S(e)+"?"+E()}function Y(e,t){var n=1<arguments.length&&void 0!==t?t:{},i=JSON.stringify(Le()({},n));L.log("".concat(e," pixel evaluation: ").concat(i)),p[e].currentlySampling&&(x.send(Le()({_type:e},n),C),n.e&&"iFrameSize"===n.e.et&&(f=!0),n.e&&"iFrameSizeValid"===n.e.et&&(v=!0))}function q(){return(q=xe()(ke.a.mark(function e(t){var n,i;return ke.a.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,fetch(t);case 3:return n=e.sent,e.next=6,n.text();case 6:i=e.sent,L.renderAd({html:i}),e.next=13;break;case 10:e.prev=10,e.t0=e.catch(0),console.log("Error retrieving static display creative",e.t0);case 13:case"end":return e.stop()}},e,null,[[0,10]])}))).apply(this,arguments)}function $(e){try{var t=parseInt(e,10);if(!isNaN(t)){if(t<=0)return!1;if(100<=t)return!0;if(100*Math.random()<=t)return!0}return!1}catch(e){return!1}}function X(e){var t=0<arguments.length&&void 0!==e?e:null;for(var n in p)p.hasOwnProperty(n)&&(p[n].currentlySampling=$(t||p[n].sampleRate))}function Q(){window.mraidBridge&&window.mraidBridge.service&&"function"==typeof window.mraidBridge.service.pushCommand&&(L.log("Native bridge present, sending signal for impFired"),window.mraidBridge.service.pushCommand({type:"mraid",subtype:"impFired",arguments:{}}))}function Z(e){Y("btr",{signal:e?"viewable-btr":"viewable-non-btr",compliant:e&&a})}function ee(e){var t=(0<arguments.length&&void 0!==e?e:{}).callerIsBTR,n=void 0!==t&&t;if(n&&!o||!n&&o)m||(Z(n),m=!0);else if(g)L.log("Impression pixel already fired.");else{L.log("Firing impression on viewable event, with Pricepoint",R,"and bidId:",C,"btr: ".concat(n));var i="".concat(N).concat(_,"/e/msdk/imp?b=").concat(C,"&ps=").concat(R).concat(function(){if(o){var e={measurementMethod:a?"btr_client":"cod_client"};return"&pj=".concat(encodeURIComponent(JSON.stringify(e)))}return""}(),"&").concat(E("rnd"));(new Image).src=i,H.networkCalls.imp.push(i),g=!0,Z(n),Q(),Y("adRendering",{adrendering:ye(),mediatype:"display"}),B&&Y("skAdNetworkMraid",{mraidfound:/\bmraid(?!.js)/.test(k.contentWindow.document.body.innerHTML)})}}function te(e){var t='{"adViewability":[{"error": {"m": "'.concat(e,'"}}], "c": "viewability", "api": "MAPP", "error": 1}'),n="".concat(N).concat(_,"/x/px/").concat(C,"/").concat(t,"?cb=").concat(Math.round(1e7*Math.random()));(new Image).src=n,H.networkCalls.pixels.push(n)}function ne(){he({isBTR:!1})}function ie(){he({isBTR:!0})}function re(){mraid.isViewable()&&(window.addEventListener("resize",ne),ne())}function oe(){mraid.isViewable()&&(window.addEventListener("resize",ie),ie())}function ae(e){e.innerHTML="",e.style.width="",e.style.height=""}function se(e){(k=document.createElement("iframe")).style.border="none",k.style.overflow="hidden",k.setAttribute("border","0"),k.setAttribute("id",t),k.sandbox="allow-forms allow-pointer-lock allow-popups allow-popups-to-escape-sandbox allow-same-origin allow-scripts allow-top-navigation-by-user-activation",e.appendChild(k)}function de(){L.log("Adding window resizing event to detect window size"),window.addEventListener("resize",me),me()}function ce(){k.contentWindow.mraid=window.mraid,k.contentWindow.amazon={},k.contentWindow.dtb=new Ee;var e=window.amzn_bridge?window.amzn_bridge:window.webkit&&window.webkit.messageHandlers&&window.webkit.messageHandlers.amzn_bridge?window.webkit.messageHandlers.amzn_bridge:null;e&&O&&(k.contentWindow.apsVidEventsBridge=e)}function le(){L.log("Adding BTR message event listener"),window.addEventListener("message",function(e){e.data&&e.data.hasOwnProperty("btr")&&"boolean"==typeof e.data.btr&&(L.log("BTR message received, isBTRCompliant is ".concat(e.data.btr)),a=e.data.btr,mraid.addEventListener("viewableChange",oe),oe())})}function ue(s,e,n,i){var d=function(e){return"string"==typeof e&&e.toLowerCase().includes("rewarded")}(D);(M||d)&&s.mraid.useCustomClose(!0);var t=s.document.createElement("style");t.innerHTML="body { margin: 0px; padding: 0px }",s.document.head.appendChild(t);var r=s.document.createElement("script");r.src=e,s.document.body.appendChild(r);var o=s.document.createElement("div");o.style="height: 100%; width: 100%; position: absolute;",o.setAttribute("id","amazon-ads-container"),s.document.body.appendChild(o),r.addEventListener("load",function(){var e=new s.AmazonVideoAds(o,{source:"mobile"}),t=i&&z?z:"https://".concat(n.vastHost,"/").concat(n.dataCenter,"/e/msdk/vast?b=").concat(n.bidId,"&").concat(E("rnd"),"&ps=").concat(n.selectedPricePoint);H&&H.networkCalls&&H.networkCalls.adm&&H.networkCalls.adm.push(t),e.fetchAds(t).then(function(r){r.init({fullscreen:!0,muted:!1,volume:.3,autoplay:!1,controls:!1,preload:"auto",replayEnabled:!1}),r.onPlayerReadyListener(function(){function e(){s.mraid.isViewable()&&!t&&(s.mraid.removeEventListener("viewableChange",e),t=!0,r.play())}var t=!1;s.mraid.addEventListener("viewableChange",e),e();s.mraid.addEventListener("viewableChange",function(){s.mraid.isViewable()?r.mute(!1):r.mute(!0)});function o(e){var t=e.eventName;if(t&&""!==t){var n={type:"apsvid",subtype:t,arguments:{}};s.apsVidEventsBridge&&(L.log("Bridging apsVideoPlayerSDK event ".concat(t," to native: ").concat(JSON.stringify(n))),s.apsVidEventsBridge.postMessage(c?JSON.stringify(n):n))}else L.log("Invalid apsvid eventName: ".concat(t))}function n(e){var t=e.eventName,n=e.adMetadata.creative,i=n.progress,r=n.duration;(d&&!a&&"AD_VIDEO_PLAYER_COMPLETED"===t||!d&&!a&&(M<=i||r<=i))&&(L.log("Sending request to native for showing close button"),s.mraid.useCustomClose(!1),a=!0,"AD_VIDEO_PLAYER_COMPLETED"===t&&o({eventName:"AD_VIDEO_PLAYER_COMPLETED"}))}var a=!1,i={AD_VIDEO_PLAYER_IMPRESSION:function(){L.log("Impression event received from apsVideoPlayerSDK, posting message"),s.top.postMessage({apsVideoPlayer:!0,event:"impression"},s.top.location.origin)},AD_VIDEO_PLAYER_PROGRESS:!d&&M?n:null,AD_VIDEO_PLAYER_COMPLETED:d?n:o};Object.keys(i).forEach(function(e){i[e]&&r.addListener(e,i[e])})}),r.startAds(2e3,{shouldVideoRemainAfterPlay:!0})}).catch(function(e){s.mraid.useCustomClose(!1),console.log("failed to get APS ads manager",e),Y("apsLibraryError",{e:{et:"fetchVASTUrlError",msg:{host:A,dc:P,pp:R}}})})})}function e(){var e={width:window.innerWidth,height:window.innerHeight};k.style.width=e.width+"px",k.style.height=e.height+"px",L.log("apsAdIframe size assigned to ".concat(e.width,"x").concat(e.height)),s||function(){L.log("Inspecting for interstitial with window size of ".concat(window.innerWidth,"x").concat(window.innerHeight)),320<=window.innerWidth&&250<window.innerHeight&&(L.log("Interstitial threshold window area detected"),s=!0,L.log("Interstitial - removing iFrame resize event to assign width/height"),window.removeEventListener("resize",me),L.log("Interstitial - adding MRAID viewableChange event listener"),mraid.addEventListener("viewableChange",t),mraid.isViewable()&&!i&&t());var e=!1;function t(){mraid.isViewable()&&(i=!0,L.log("Interstitial - MRAID isViewable is true"),L.log("Interstitial - removing MRAID viewableChange event listener"),mraid.removeEventListener("viewableChange",t),L.log("Interstitial - assigning intersitial dimensions on viewable"),k.style.width="100vw",k.style.height="100vh",window.addEventListener("resize",n),window.setTimeout(function(){e||(L.log("Interstitial - notch detection fallback running for resize not firing"),n())},100))}function n(){if(e=!0,window.removeEventListener("resize",n),function(){var e=!1,t=document.createElement("div");CSS.supports("padding-top: env(safe-area-inset-top)")?(t.style.paddingTop=r?"200pt":"env(safe-area-inset-top)",t.style.paddingBottom=r?"100pt":"env(safe-area-inset-bottom)",t.style.paddingLeft=r?"50pt":"env(safe-area-inset-left)",t.style.paddingRight=r?"40pt":"env(safe-area-inset-right)",e=!0):CSS.supports("padding-top: constant(safe-area-inset-top)")&&(t.style.paddingTop=r?"200pt":"constant(safe-area-inset-top)",t.style.paddingBottom=r?"100pt":"constant(safe-area-inset-bottom)",t.style.paddingLeft=r?"50pt":"constant(safe-area-inset-left)",t.style.paddingRight=r?"40pt":"constant(safe-area-inset-right)",e=!0);if(e){document.body.appendChild(t);var n={top:parseInt(window.getComputedStyle(t).paddingTop,10),bottom:parseInt(window.getComputedStyle(t).paddingBottom,10),left:parseInt(window.getComputedStyle(t).paddingLeft,10),right:parseInt(window.getComputedStyle(t).paddingRight,10)};for(var i in document.body.removeChild(t),n)if(0<n[i])return!0}return!1}())return L.log("Interstitial - notch detected"),void function(){k.style.position="absolute",k.style.top="50%",k.style.left="50%",k.style.transform="translate(-50%, -50%)";var a=window.innerHeight>window.innerWidth?"portrait":"landscape";L.log("Interstitial - applying sizes for notch");var s=!1,d=!1;if(T&&we()){L.log("gmaSDK detected: ".concat(window.MRAID_ENV.sdkVersion));var e=window.MRAID_ENV.sdkVersion.split(".").map(function(e){return parseInt(e,10)}),t={major:e[0],minor:e[1],patch:e[2]};(7===t.major&&46<=t.minor||7<t.major)&&(s=!0,L.log("Interstitial - disabling iOS 13 logic for notch")),(7===t.major&&49<=t.minor||7<t.major)&&(d=!0,L.log("Interstitial - using window.orientation value for device rotation"))}function n(n){var i=10,r=0,o=!1;!function e(t){L.log("Interstitial - value of window.orientation is ".concat(window.orientation)),!0===n&&!0!==t?L.log("Interstitial - initializing notch dimensions: ".concat(a)):(d?a!==(a=0===window.orientation||-180===window.orientation?"portrait":"landscape")&&(o=!0,L.log("Interstitial - window.orientation value has changed, ending polling")):a="portrait"===a?"landscape":"portrait",L.log("Interstitial - notch orientation change: ".concat(a)));"portrait"===a?(k.style.width="100vw",k.style.height=ve()&&!s?"100vh":ve()&&s?"87vh":"90vh"):(k.style.width=ve()&&s?"87vw":"90vw",k.style.height="100vh"),++r!==i?!0!==n&&d&&!o&&r<i&&window.setTimeout(function(){L.log("Interstitial - loopCount for checking orientation is ".concat(r)),e(!0)},100):L.log("Interstitial - ending polling, max loops reached")}(!1)}n(!0),window.addEventListener("orientationchange",n)}();c&&(L.log("Interstitial - adding resize event for Android to use pixels"),window.addEventListener("resize",me)),L.log("Interstitial - no notch detected")}}()}function pe(e){return ge.apply(this,arguments)}function ge(){return(ge=xe()(ke.a.mark(function e(n){var i,r,o,a=arguments;return ke.a.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(i=1<a.length&&void 0!==a[1]?a[1]:0,r=function(t){return new Promise(function(e){return setTimeout(e,l[t])})},n!==d){e.next=17;break}if(o={apsAdIframe:{calculatedWidth:parseInt(k.style.width,10),calculatedHeight:parseInt(k.style.height,10)},window:{calculatedWidth:window.innerWidth,calculatedHeight:window.innerHeight}},L.log("Inspecting apsAdIframe ".concat(o.apsAdIframe.calculatedWidth,"x").concat(o.apsAdIframe.calculatedHeight," vs window ").concat(o.window.calculatedWidth,"x").concat(o.window.calculatedHeight," | retry count ").concat(i)),o.apsAdIframe.calculatedWidth===o.window.calculatedWidth&&o.apsAdIframe.calculatedHeight===o.window.calculatedHeight||(L.log("Change detected in window size, forcing resize event"),t=void 0,(t=window.document.createEvent("UIEvents")).initUIEvent("resize",!0,!1,window,0),window.dispatchEvent(t)),i<5)return L.log("Delaying next window size detection by ".concat(l[i],"ms")),e.next=10,r(i);e.next=13;break;case 10:pe(n,i+1),e.next=15;break;case 13:return L.log("inspectWindowPoll try count exceeded, killing inspectWindowPoll instance"),e.abrupt("return");case 15:e.next=18;break;case 17:L.log("tryId mismatch with windowCheckId, killing inspectWindowPoll instance");case 18:case"end":return e.stop()}var t},e)}))).apply(this,arguments)}function me(){L.log("Entering a new instance of inspectWindowSizeForIframe"),e(),pe(d=Date.now())}function fe(){L.log("Adjusting anchor links to _top");for(var e=k.getElementsByTagName("a"),t=0;t<e.length;t++){var n=e[t];n.onclick||n.target||(n.target="_top")}}function ve(){if(T){var e=window.navigator.userAgent.match(/OS [0-9]+/g);return!!e&&13<=parseInt(e[0].match(/[0-9]+/g)[0],10)}return!1}function we(){return!("3.0"!==mraid.getVersion()||!window.MRAID_ENV||"Google Mobile Ads"!==window.MRAID_ENV.sdk||!window.MRAID_ENV.sdkVersion)}function he(e){var t=(0<arguments.length&&void 0!==e?e:{}).isBTR,n=void 0!==t&&t;window.removeEventListener("resize",n?ie:ne);var i=function(e){var t=!(0<arguments.length&&void 0!==e)||e,n=window.getComputedStyle(k),i=parseInt(n.width,10),r=parseInt(n.height,10),o=!0;return L.log("iFrame measured at ".concat(i,"x").concat(r)),i<300||r<50?(o=!1,t&&(L.log("Firing iFrameSize error pixel"),f||Y("apsLibraryError",{e:{et:"iFrameSize",msg:"".concat(i,"x").concat(r)}}))):f&&!v&&t&&(L.log("Firing iFrameSizeValid pixel"),x.send({_type:"iFrameSizeValid",size:"".concat(i,"x").concat(r)},C)),o}(!o);if(s)return i?void ee({callerIsBTR:n}):void window.addEventListener("resize",n?ie:ne);i||window.addEventListener("resize",n?ie:ne),ee({callerIsBTR:n})}function ye(){return window.MRAID_ENV&&window.MRAID_ENV.sdk?window.MRAID_ENV.sdk:window.location.host}L.dispatchAppEvent=function(e,t,n,i,r){if("fb"===i)try{admob.events.dispatchAppEvent("mDTB","facebook")}catch(e){Y("apsLibraryError",{e:{et:"mdtb-ad-rendering",msg:"admob/fb"}})}else L.loadAd(e,t,n,r)},L.toggleDebug=function(e){var t=1<arguments.length&&void 0!==arguments[1]?arguments[1]:100;switch(e){case"enable":return I=!0,void 0===window.amznDebugState&&(window.amznDebugState=H),X(t),L.log("Debug mode enabled");case"disable":return I=!1,void 0!==window.amznDebugState&&delete window.amznDebugState,X(),L.log("Debug mode disabled");case"unitTests":return r=!0,L.log("Disabling my.log console logs showing in unit tests");default:return L.log("unknown debug argument")}},L.loadAd=function(e,t,n){var i=3<arguments.length&&void 0!==arguments[3]&&arguments[3],r=4<arguments.length&&void 0!==arguments[4]?arguments[4]:{},o=r.skadn,a=void 0===o?null:o,s=r.isv,d=void 0!==s&&s,c=r.dc,l=void 0===c?null:c,u=r.cURL,p=void 0===u?null:u,g=r.ebtr,m=void 0===g?null:g,f=r.skipafter,v=void 0===f?5:f,w=r.vtype,h=void 0===w?null:w;!0===i&&(L.toggleDebug("enable"),L.log("Enabling debug mode, now all logs will be printed & http will used for connection."));var y=[{argName:"pricePoint",type:"string",value:e},{argName:"suppliedBidId",type:"string",value:t},{argName:"hostName",type:"string",value:n},{argName:"debugOn",type:"boolean",value:i},{argName:"skadn",type:"string",value:a},{argName:"isv",type:"boolean",value:d},{argName:"dc",type:"string",value:l},{argName:"cURL",type:"string",value:p},{argName:"ebtr",type:"boolean",value:m},{argName:"skipafter",type:"number",value:v},{argName:"vtype",type:"string",value:h}].reduce(function(e,t){var n=t.argName,i=t.type,r=t.value;return Se()(r)===i&&null!==r&&""!==r||(e[n]={type:i,passed:Se()(r),value:r}),e},{});y.suppliedBidId||(L.log("Setting bidId: ".concat(t)),C=t),y.hostName||-1!==n.indexOf("BAD")||(L.log("Overriding default aaxHost with: ".concat(n)),_=n),y.isv||(L.log("Setting isVideo: ".concat(d)),O=d),y.dc||(L.log("Setting dc: ".concat(l)),P=l),y.cURL||(L.log("Setting cURL: ".concat(p)),z=p),y.ebtr||(L.log("Setting overrideBTRValue: ".concat(m)),j=m),M=y.skipafter?(L.log("Invalid skipafter passed, defaulting skipafter to 5 seconds"),5):(L.log("Setting videoSkipAfter: ".concat(v)),v),y.vtype||(L.log("Setting vtype: ".concat(h)),D=h);var b=Object.keys(y).filter(function(e){return null!==y[e].value});if(0<b.length&&(b.forEach(function(e){L.log('Invalid argument passed to loadAd for "'.concat(e,'". Passed type: ').concat(y[e].passed," | correct type: ").concat(y[e].type," | value: ").concat(y[e].value))}),Y("apsLibraryError",{e:{et:"loadAdArgs",msg:b}})),y.suppliedBidId||y.pricePoint)L.log("Error","Crucial arguments incorrectly passed, aborting");else{if(L.log("Setting pricepoint: ".concat(e)),R=e,"true"===a&&T&&(we()||location.href.includes("doubleclick"))){L.log('SKAdNetwork flag passed as "true", requesting google_mobile_app_ads.js');var E=document.createElement("script");E.type="text/javascript",E.async=!0,E.src="https://media.admob.com/api/v1/google_mobile_app_ads.js",document.body.appendChild(E),H.networkCalls.lib.push(E.src),B=!0}L.log("Creating viewport meta tag and adding it to head.");var x=document.createElement("meta");if(x.name="viewport",x.content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no, viewport-fit=cover",document.head.appendChild(x),function(){var e=["getVersion","isViewable","addEventListener","removeEventListener"];0<(e=void 0===window.mraid||"object"!==Se()(window.mraid)||null===window.mraid?["mraid"].concat(e):e.filter(function(e){return"function"!=typeof window.mraid[e]})).length&&Y("apsLibraryError",{e:{et:"missingMraidMethods",msg:e}})}(),window.apsOmsdkLogs=[],window.addEventListener("message",function(e){e.data&&e.data.hasOwnProperty("apsOmsdkLog")&&window.apsOmsdkLogs.push(e.data.apsOmsdkLog)}),O&&P)!function(){var e=document.getElementById(V);if(!e)return L.log('Ad div not found. Please place an empty div with id="__dtbAd__" in the page, aborting!');ae(e),se(e),de(),ce(),window.addEventListener("message",function(e){e.data.apsVideoPlayer&&"impression"===e.data.event&&(L.log("Video impression occurred, attemping to bridge to native for impFired"),H.networkCalls.imp.push("videoImpFired"),Q(),Y("adRendering",{adrendering:ye(),mediaType:"video"}))}),k.contentWindow.apsVidCreate=ue,k.contentWindow.apsVidCreate(k.contentWindow,I?F:W,{vastHost:A,dataCenter:P,bidId:C,selectedPricePoint:R},I),fe()}();else if(I&&z)!function(e){q.apply(this,arguments)}(z);else{L.log("Making JSONP call to load the creative.");var S=document.createElement("script");S.type="text/javascript",S.src=N+_+"/e/msdk/adm?b="+C+"&ps="+R,document.body.appendChild(S),H.networkCalls.adm.push(S.src)}}},L.renderAd=function(e){if(L.ev=e.ev,e&&e.html){var t=document.getElementById(V);if(t){ae(t),se(t),de(),ce();var n=k.contentDocument||k.contentWindow.document,i=be(e.html),r="<style> body { margin: 0px; padding: 0px } </style>".concat(i);null!==j&&(e.ebtr=j),e.ebtr?(o=!0,le()):p.btr.currentlySampling&&le();if(n.open("text/html"),n.write(o||p.btr.currentlySampling?function(e){return L.log("Adding BTR script to creative"),e+"\n <script src='https://m.media-amazon.com/images/I/01ZWWIXciGL.js'><\/script>\n <script>\n function evaluateBTRCallback() {\n window.CREM.evaluateBTRCriteria(document, document.body, function(result) {\n console.log('isBTRCompliant', result.isBTRCompliant);\n window.parent.postMessage({ btr: result.isBTRCompliant }, '*');\n });\n }\n function readyStateListener() {\n if (document.readyState === 'complete') {\n evaluateBTRCallback();\n document.removeEventListener('readystatechange', readyStateListener);\n }\n }\n if (document.readyState === 'complete') {\n evaluateBTRCallback();\n } else {\n document.addEventListener('readystatechange', readyStateListener);\n }\n <\/script>"}(r):r),n.close(),fe(),!("mraid"in window))return L.log("Error","Mraid object not found, impression will not be made."),void L.log('Please include \'<script type="text/javascript" src="mraid.js"><\/script>\' in your creative.');L.log("Registering impression rendered event, with Pricepoint",R,"and bidId:",C),w.impRendered(),(!o||o&&p.btr.currentlySampling)&&(mraid.addEventListener("viewableChange",re),re()),function(){if(!0===L.ev){L.log("Injecting viewability script");var e=document.createElement("script");e.type="text/javascript",e.async=!0,e.onload=function(){if(L.log("Viewability script loaded"),window.amzncsm&&"function"==typeof window.amzncsm.rmRM){var e,t=document.getElementById(V);if(t){var n=t.getElementsByTagName("iframe");n&&0<n.length&&(e=n[0])}window.amzncsm.host=_,e?window.amzncsm.rmRM(C,e):te("ad iframe not found")}else te("amzncsm.rmRM is not a function")},e.onerror=function(){te("CSM JS loading failed")},e.src=u,document.body.appendChild(e),H.networkCalls.lib.push(u),L.log("Viewability script injected")}}(),w.mraid3Comparison(),we()&&Y("gmaSDK",{gmaversion:window.MRAID_ENV.sdkVersion})}else L.log('Ad div not found. Please place an empty div with id="__dtbAd__" in the page, aborting!')}else L.log("Looks like there is no creative in JSONP call, aborting!")};var be=function(e){var t=e.indexOf("mraid.js");return-1!==t&&(L.log("Purging extra mraid.js from the creative."),e=e.substring(0,t)+e.substring(t+8),L.log("New Creative: ",e)),e},Ee=function(){var o=mraid.open;this.sdkVersion="mDTB-js-1.0.1",this.os="Android",T&&(this.os="iOS"),"unknown"===L.sdkType&&(-1!==location.href.indexOf("mopub")?L.sdkType="mopub":-1!==location.href.indexOf("doubleclick")&&(L.sdkType="dfp")),mraid.open=function(e){if(B){L.log("SKAdNetwork flag enforced, mraid.open will dispatch click now to APS SDK");var t={bidId:C,destinationUrl:e};if(window.admob&&window.admob.events&&"function"==typeof window.admob.events.dispatchAppEvent)return window.admob.events.dispatchAppEvent("amzn_skadn",JSON.stringify(t)),void L.log("dispatch click to APS SDK successful");L.log("problem detecting bridge, proceeding without dispatch to APS SDK"),Y("apsLibraryError",{e:{et:"dispatchAppEvent",msg:"not present"}})}if("string"==typeof e){if(L.log("Original URL:",e),/^amazonmobile:\/\//g.test(e)){var n=e.split("intent=");if(1<n.length){var i=n[n.length-1],r=decodeURIComponent(i);!function(e){if("string"!=typeof e)return!1;var t=e.match(/^(?:\w+:)?\/\/(\S+)$/);if(!t)return!1;var n=t[1];return!!n&&!(!/^localhost[\:?\d]*(?:[^\:?\d]\S*)?$/.test(n)&&!/^[^\s\.]+\.\S{2,}$/.test(n))}(r)&&Y("apsLibraryError",{e:{et:"validateDLFallbackURL",msg:r}}),e="".concat("https://dl.amazon.com/redirect/ref=mm_1_aps-mobile-dl?campaignId=QALXjR&failureMode=MobileWebMostly&url=").concat(i),Y("deepLink")}}L.log("Opening URL:",e),/^http/g.test(e)&&"mopub"===L.sdkType?(L.log("Opening url using mopub native interface."),o.apply(mraid,["mopubnativebrowser://navigate?url="+encodeURIComponent(e)])):(L.log("Opening url using mraid interface."),o.apply(mraid,[e]))}},this.openUrl=mraid.open}}(window.amzn.dtb),window.aax_render_ad=window.amzn.dtb.renderAd},function(e,t){e.exports=function(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e},e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t,n){(function(e){function O(e){return(O="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 t=function(a){"use strict";var d,e=Object.prototype,l=e.hasOwnProperty,t="function"==typeof Symbol?Symbol:{},r=t.iterator||"@@iterator",n=t.asyncIterator||"@@asyncIterator",i=t.toStringTag||"@@toStringTag";function o(e,t,n){return Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{o({},"")}catch(e){o=function(e,t,n){return e[t]=n}}function s(e,t,n,i){var r=t&&t.prototype instanceof v?t:v,o=Object.create(r.prototype),a=new A(i||[]);return o._invoke=function(o,a,s){var d=c;return function(e,t){if(d===g)throw new Error("Generator is already running");if(d===m){if("throw"===e)throw t;return R()}for(s.method=e,s.arg=t;;){var n=s.delegate;if(n){var i=k(n,s);if(i){if(i===f)continue;return i}}if("next"===s.method)s.sent=s._sent=s.arg;else if("throw"===s.method){if(d===c)throw d=m,s.arg;s.dispatchException(s.arg)}else"return"===s.method&&s.abrupt("return",s.arg);d=g;var r=u(o,a,s);if("normal"===r.type){if(d=s.done?m:p,r.arg===f)continue;return{value:r.arg,done:s.done}}"throw"===r.type&&(d=m,s.method="throw",s.arg=r.arg)}}}(e,n,a),o}function u(e,t,n){try{return{type:"normal",arg:e.call(t,n)}}catch(e){return{type:"throw",arg:e}}}a.wrap=s;var c="suspendedStart",p="suspendedYield",g="executing",m="completed",f={};function v(){}function w(){}function h(){}var y={};y[r]=function(){return this};var b=Object.getPrototypeOf,E=b&&b(b(C([])));E&&E!==e&&l.call(E,r)&&(y=E);var x=h.prototype=v.prototype=Object.create(y);function S(e){["next","throw","return"].forEach(function(t){o(e,t,function(e){return this._invoke(t,e)})})}function L(d,c){var t;this._invoke=function(n,i){function e(){return new c(function(e,t){!function t(e,n,i,r){var o=u(d[e],d,n);if("throw"!==o.type){var a=o.arg,s=a.value;return s&&"object"===O(s)&&l.call(s,"__await")?c.resolve(s.__await).then(function(e){t("next",e,i,r)},function(e){t("throw",e,i,r)}):c.resolve(s).then(function(e){a.value=e,i(a)},function(e){return t("throw",e,i,r)})}r(o.arg)}(n,i,e,t)})}return t=t?t.then(e,e):e()}}function k(e,t){var n=e.iterator[t.method];if(n===d){if(t.delegate=null,"throw"===t.method){if(e.iterator.return&&(t.method="return",t.arg=d,k(e,t),"throw"===t.method))return f;t.method="throw",t.arg=new TypeError("The iterator does not provide a 'throw' method")}return f}var i=u(n,e.iterator,t.arg);if("throw"===i.type)return t.method="throw",t.arg=i.arg,t.delegate=null,f;var r=i.arg;return r?r.done?(t[e.resultName]=r.value,t.next=e.nextLoc,"return"!==t.method&&(t.method="next",t.arg=d),t.delegate=null,f):r:(t.method="throw",t.arg=new TypeError("iterator result is not an object"),t.delegate=null,f)}function I(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function _(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function A(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(I,this),this.reset(!0)}function C(t){if(t){var e=t[r];if(e)return e.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var n=-1,i=function e(){for(;++n<t.length;)if(l.call(t,n))return e.value=t[n],e.done=!1,e;return e.value=d,e.done=!0,e};return i.next=i}}return{next:R}}function R(){return{value:d,done:!0}}return w.prototype=x.constructor=h,(h.constructor=w).displayName=o(h,i,"GeneratorFunction"),a.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===w||"GeneratorFunction"===(t.displayName||t.name))},a.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,h):(e.__proto__=h,o(e,i,"GeneratorFunction")),e.prototype=Object.create(x),e},a.awrap=function(e){return{__await:e}},S(L.prototype),L.prototype[n]=function(){return this},a.AsyncIterator=L,a.async=function(e,t,n,i,r){void 0===r&&(r=Promise);var o=new L(s(e,t,n,i),r);return a.isGeneratorFunction(t)?o:o.next().then(function(e){return e.done?e.value:o.next()})},S(x),o(x,i,"Generator"),x[r]=function(){return this},x.toString=function(){return"[object Generator]"},a.keys=function(n){var i=[];for(var e in n)i.push(e);return i.reverse(),function e(){for(;i.length;){var t=i.pop();if(t in n)return e.value=t,e.done=!1,e}return e.done=!0,e}},a.values=C,A.prototype={constructor:A,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=d,this.done=!1,this.delegate=null,this.method="next",this.arg=d,this.tryEntries.forEach(_),!e)for(var t in this)"t"===t.charAt(0)&&l.call(this,t)&&!isNaN(+t.slice(1))&&(this[t]=d)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(n){if(this.done)throw n;var i=this;function e(e,t){return o.type="throw",o.arg=n,i.next=e,t&&(i.method="next",i.arg=d),!!t}for(var t=this.tryEntries.length-1;0<=t;--t){var r=this.tryEntries[t],o=r.completion;if("root"===r.tryLoc)return e("end");if(r.tryLoc<=this.prev){var a=l.call(r,"catchLoc"),s=l.call(r,"finallyLoc");if(a&&s){if(this.prev<r.catchLoc)return e(r.catchLoc,!0);if(this.prev<r.finallyLoc)return e(r.finallyLoc)}else if(a){if(this.prev<r.catchLoc)return e(r.catchLoc,!0)}else{if(!s)throw new Error("try statement without catch or finally");if(this.prev<r.finallyLoc)return e(r.finallyLoc)}}}},abrupt:function(e,t){for(var n=this.tryEntries.length-1;0<=n;--n){var i=this.tryEntries[n];if(i.tryLoc<=this.prev&&l.call(i,"finallyLoc")&&this.prev<i.finallyLoc){var r=i;break}}r&&("break"===e||"continue"===e)&&r.tryLoc<=t&&t<=r.finallyLoc&&(r=null);var o=r?r.completion:{};return o.type=e,o.arg=t,r?(this.method="next",this.next=r.finallyLoc,f):this.complete(o)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),f},finish:function(e){for(var t=this.tryEntries.length-1;0<=t;--t){var n=this.tryEntries[t];if(n.finallyLoc===e)return this.complete(n.completion,n.afterLoc),_(n),f}},catch:function(e){for(var t=this.tryEntries.length-1;0<=t;--t){var n=this.tryEntries[t];if(n.tryLoc===e){var i=n.completion;if("throw"===i.type){var r=i.arg;_(n)}return r}}throw new Error("illegal catch attempt")},delegateYield:function(e,t,n){return this.delegate={iterator:C(e),resultName:t,nextLoc:n},"next"===this.method&&(this.arg=d),f}},a}("object"===O(e)?e.exports:{});try{regeneratorRuntime=t}catch(e){Function("r","regeneratorRuntime = r")(t)}}).call(this,n(7)(e))},function(e,t){e.exports=function(e){return e.webpackPolyfill||(e.deprecate=function(){},e.paths=[],e.children||(e.children=[]),Object.defineProperty(e,"loaded",{enumerable:!0,get:function(){return e.l}}),Object.defineProperty(e,"id",{enumerable:!0,get:function(){return e.i}}),e.webpackPolyfill=1),e}}]); |