0% found this document useful (0 votes)
100 views

Mraid Js

This document defines functions and constants for a mobile ad SDK. It includes error codes, event types, and properties for handling MRAID functionality like setting the ad size, position, and state. Functions are defined for updating properties, validating values, broadcasting events, and more.

Uploaded by

Miguel gonzalez
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
100 views

Mraid Js

This document defines functions and constants for a mobile ad SDK. It includes error codes, event types, and properties for handling MRAID functionality like setting the ad size, position, and state. Functions are defined for updating properties, validating values, broadcasting events, and more.

Uploaded by

Miguel gonzalez
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 8

!function(n){"use strict";n.vungle=n.vungle||{}}(window);!

function(e){var t={};function
r(n){if(t[n])return t[n].exports;var o=t[n]={i:n,l:!1,exports:{}};return
e[n].call(o.exports,o,o.exports,r),o.l=!0,o.exports}r.m=e,r.c=t,r.d=function(e,t,n){r.o(e,t)||Object.de
fineProperty(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(e,t){if(1&t&&(e=r(e)),8&t)return
e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var
n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"s
tring"!=typeof e)for(var o in e)r.d(n,o,function(t){return e[t]}.bind(null,o));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=0)}([function(e,t,r){"use
strict";r.r(t);r(1),r(2),r(3),r(4)},function(e,t){!function(e){"use strict";var
t,r=e.vungle=e.vungle||{};r.error||((t=r.error=r.error||{}).bridgeError={BRG000:"Missing command
in mraidBridge.executeSDKCommand method call!",BRG001:"Vungle SDK is not ready to
process MRAID command!"},t.bridgeExtError={BRX000:"Cannot retrieve #dynamic container in
Ad Unit!"},t.mraidError={MRD000:"Cannot add listener for unknown MRAID
event!",MRD001:"Missing argument(s)! Both event and/or listener are required for method
call!",MRD002:"Unable to find listener registered for event!",MRD003:"Missing MRAID event!
Cannot remove event listener!",MRD004:"Missing object! An expand properties object is
required for method call!",MRD005:"Missing object! An orientation properties object is required
for method call!",MRD006:"Missing object! An resize properties object is required for method
call!",MRD007:"Missing URL! A URL is required for method call!",MRD008:"Ad unit is hidden
and cannot be closed!",MRD009:"Missing URL! A video/caption URL is required for method
call!",MRD010:"Ad Unit is not viewable! Please make sure isViewAble is set to
true!",MRD011:"Ad unit can only be expanded from the default or resized state!",MRD012:"Ad
unit can only be resized from the default or resized state!",MRD013:"Missing URI! A valid URI is
required for method call!",MRD015:"Invalid data/type detected when updating MRAID
properties!",MRD016:"Missing app store id! An app store id is required for method
call!"},t.mraidClientError={MRC000:"MRAID SDK error detected!",MRC001:"Missing MRAID
object in window!",MRC002:"Missing video URL! mraidClient.playVideo cannot retrieve video
URL from arguments!"},t.adTemplateError={ADT000:"Missing page template
JavaScript!",ADT001:"Error encountered loading template
configuration!"},t.gestureTrackingError={GET000:"Cannot serialize user interaction tracking
event object!"})}(window)},function(e,t){!function(e){"use strict";var
t=e.vungle=e.vungle||{},r=t.mraidCore=t.mraidCore||{},n=t.debugLog=t.debugLog||[];n&&n.push("
vungle.mraidCore
loaded."),r.consts={versions:{V1:"1.0",V2:"2.0"},states:{LOADING:"loading",DEFAULT:"default",
RESIZED:"resized",EXPANDED:"expanded",HIDDEN:"hidden"},events:{INFO:"info",READY:"re
ady",ERROR:"error",STATE_CHANGE:"stateChange",ORIENTATION_CHANGE:"orientationCh
ange",VIEWABLE_CHANGE:"viewableChange",SIZE_CHANGE:"sizeChange"},placements:{UN
KNOWN:"unknown",INLINE:"inline",INTERSTITIAL:"interstitial"},orientations:{PORTRAIT:"portra
it",LANDSCAPE:"landscape",NONE:"none"},closePositions:{CENTER:"center",TOP_LEFT:"top-l
eft",TOP_CENTER:"top-center",TOP_RIGHT:"top-right",BOTTOM_LEFT:"bottom-left",BOTTOM
_CENTER:"bottom-center",BOTTOM_RIGHT:"bottom-right"}},r.PropertiesValueObject=function(
e){var t=function(e){var t;return e&&"object"==typeof
e?(t={},Object.keys(e).forEach(function(r){t[r]=e[r]})):t=e,t};this.value=t(e),this.clone=function(){re
turn t(this.value)},this.update=function(e){if(e&&"object"==typeof e){var
t=this;Object.keys(e).forEach(function(r){t.value[r]=e[r]})}else
this.value=e}},r.EventListeners=function(e){var
t={};this.event=e,this.listenerCount=0,this.add=function(e){var
r=String(e);return!t[r]&&(t[r]=e,this.listenerCount++,!0)},this.remove=function(e){var
r=String(e);return!(!t.hasOwnProperty(r)||!t[r])&&(t[r]=null,delete
t[r],this.listenerCount--,!0)},this.removeAll=function(){var
e=this;Object.keys(t).forEach(function(r){e.remove(t[r])})},this.broadcast=function(e){var
r=this;Object.keys(t).forEach(function(n){t[n].apply(r.mraid,e)})}};var o=new
r.PropertiesValueObject(r.consts.versions.V1),i=new
r.PropertiesValueObject({width:0,height:0}),a=new
r.PropertiesValueObject({width:0,height:0}),s=new
r.PropertiesValueObject({x:0,y:0,width:0,height:0}),c=new
r.PropertiesValueObject({x:0,y:0,width:0,height:0}),d=new
r.PropertiesValueObject({width:0,height:0,useCustomClose:!1,isModal:!0}),u=new
r.PropertiesValueObject({width:0,height:0,offsetX:0,offsetY:0,customClosePosition:r.consts.close
Positions.TOP_RIGHT,allowOffscreen:!0}),l=new
r.PropertiesValueObject({allowOrientationChange:!0,forceOrientation:r.consts.orientations.NON
E}),p=new
r.PropertiesValueObject({sms:!1,tel:!1,calendar:!1,storePicture:!1,inlineVideo:!1}),m=new
r.PropertiesValueObject(r.consts.states.LOADING),f=new
r.PropertiesValueObject(r.consts.placements.UNKNOWN),E=new
r.PropertiesValueObject(!1),g=new r.PropertiesValueObject(!1),v=new
r.PropertiesValueObject(!1),y=new r.PropertiesValueObject(!1),R=new
r.PropertiesValueObject(!1),h=new r.PropertiesValueObject(!1),O=new
r.PropertiesValueObject(!1),S=new r.PropertiesValueObject(!1),C=new
r.PropertiesValueObject(!1),x=new r.PropertiesValueObject(!1),b={},P=new
r.PropertiesValueObject(""),B=new r.PropertiesValueObject(""),D=new
r.PropertiesValueObject("");r.eventListeners=b,r.propertiesHandlers={os:{update:function(e){P.up
date(e)},clone:function(){return
P.clone()}},osVersion:{update:function(e){B.update(e)},clone:function(){return
B.clone()}},sdkVersion:{update:function(e){D.update(e)},clone:function(){return
D.clone()}},incentivized:{update:function(e){g.update(e)},clone:function(){return
g.clone()}},consentRequired:{update:function(e){v.update(e)},clone:function(){return
v.clone()}},consentTitleText:{update:function(e){y.update(e)},clone:function(){return
y.clone()}},consentBodyText:{update:function(e){R.update(e)},clone:function(){return
R.clone()}},consentAcceptButtonText:{update:function(e){h.update(e)},clone:function(){return
h.clone()}},consentDenyButtonText:{update:function(e){O.update(e)},clone:function(){return
O.clone()}},version:{update:function(e){o.update(e),r.broadcastEvent(r.consts.events.INFO,"Setti
ng MRAID version to: "+String(e))},clone:function(){return
o.clone()}},maxSize:{update:function(e){i.update(e),d.update(e),r.broadcastEvent(r.consts.event
s.INFO,"Setting maxSize to: "+String(e))},clone:function(){return
i.clone()}},screenSize:{update:function(e){var
t;a.update(e),t=a.clone(),r.broadcastEvent(r.consts.events.INFO,"Setting screenSize to:
"+String(e)),r.broadcastEvent(r.consts.events.SIZE_CHANGE,t.width,t.height)},clone:function(){r
eturn
a.clone()}},defaultPosition:{update:function(e){s.update(e),r.broadcastEvent(r.consts.events.INF
O,"Setting defaultPosition to: "+String(e))},clone:function(){return
s.clone()}},currentPosition:{update:function(e){c.update(e),r.broadcastEvent(r.consts.events.INF
O,"Setting currentPosition to: "+String(e))},clone:function(){return
c.clone()}},expandProperties:{update:function(e){d.update(e),r.broadcastEvent(r.consts.events.I
NFO,"Setting expandProperties to: "+String(e))},clone:function(){return
d.clone()}},resizeProperties:{update:function(e){u.update(e),r.broadcastEvent(r.consts.events.IN
FO,"Setting resizeProperties to: "+String(e))},clone:function(){return
u.clone()}},orientationProperties:{update:function(e){l.update(e),r.broadcastEvent(r.consts.event
s.INFO,"Setting orientationProperties to: "+String(e))},clone:function(){return
l.clone()}},supports:{update:function(e){p.update(e),r.broadcastEvent(r.consts.events.INFO,"Setti
ng supports to: "+String(e))},clone:function(){return
p.clone()}},state:{update:function(e){m.update(e),r.broadcastEvent(r.consts.events.INFO,"Settin
g state to:
"+String(e)),r.broadcastEvent(r.consts.events.STATE_CHANGE,m.clone()),m.clone()===r.consts
.states.DEFAULT&&r.broadcastEvent(r.consts.events.READY)},clone:function(){return
m.clone()}},placementType:{update:function(e){f.update(e),r.broadcastEvent(r.consts.events.INF
O,"Setting placementType to: "+String(e))},clone:function(){return
f.clone()}},isViewable:{update:function(e){E.update(e),r.broadcastEvent(r.consts.events.INFO,"S
etting isViewable to:
"+String(e)),r.broadcastEvent(r.consts.events.VIEWABLE_CHANGE,E.clone())},clone:function(){
return
E.clone()}},customClose:{update:function(e){S.update(e),r.broadcastEvent(r.consts.events.INFO
,"Setting useCustomClose to: "+String(e))},clone:function(){return
S.clone()}},customPrivacy:{update:function(e){C.update(e),r.broadcastEvent(r.consts.events.INF
O,"Setting useCustomPrivacy to: "+String(e))},clone:function(){return
C.clone()}},enableBackImmediately:{update:function(e){x.update(e),r.broadcastEvent(r.consts.e
vents.INFO,"Setting enableBackImmediately to: "+String(e))},clone:function(){return
x.clone()}}},r.propertiesValidator=function(e,r,n){var o=!0;return typeof e!=typeof
r&&"useCustomClose"!==n?(o=!1,t.mraidBridgeExt&&t.mraidBridgeExt.notifyError(["MRD015",n,
e].join(":"))):"object"==typeof e&&Object.keys(e).forEach(function(e){e in
r||(o=!1,t.mraidBridgeExt&&t.mraidBridgeExt.notifyError(["MRD015",n,e].join(":")))}),o},r.broadca
stEvent=function(){var
e=Array.prototype.slice.call(arguments),t=e.shift(),r=b[t];r&&r.broadcast(e)},r.isValidMARIDEvent
=function(e){for(var t in
r.consts.events)if(r.consts.events[t]===e)return!0;return!1}}(window)},function(e,t){!function(e){"u
se strict";var
t,r=e.vungle=e.vungle||{},n=r.mraidBridge=r.mraidBridge||{},o=r.mraidBridgeExt=r.mraidBridgeEx
t||{},i=r.debugLog=r.debugLog||[],a=!1,s=!1,c=[],d=!1,u=!1,l=!1,p=!1,m=r.mraidCore.broadcastEve
nt,f=r.mraidCore.consts.states,E=r.mraidCore.consts.events;i&&i.push("vungle.mraidBridge
loaded."),n.notifyContainer=function(t){e.location=t},n.notifyPropertiesChange=function(e,t){i&&i.
push("mraidBridge.notifyPropertiesChange:"+JSON.stringify(e)),Object.keys(e).forEach(function
(t){r.mraidCore.propertiesHandlers[t]?r.mraidCore.propertiesHandlers[t].update(e[t]):n.notifyError
Event("notifyPropertiesChange","MRD015: Unhandled Property received - "+t+" - "+e[t])}),void
0!==t&&!0===t&&n.notifyContainer("mraid://propertiesChangeCompleted")},n.notifyCommandC
omplete=function(){i&&i.push("mraidBridge.notifyCommandComplete");var
e="";c.length?(e=c.shift(),n.notifyContainer(e)):s=!1},n.notifyReadyEvent=function(e){i&&i.push("
mraidBridge.notifyReadyEvent");var n=r.mraidCore.propertiesHandlers.state.clone();a=!0,void
0!==e?(d=!0,p=e.isInstalled,l=e.isDisplayIAP,u=e.isDirectDownload,t=e):r.mraidBridgeExt.notify
SuccessfulViewAd(),n!==f.DEFAULT?r.mraidCore.propertiesHandlers.state.update(f.DEFAULT):
m(E.READY)},n.notifyErrorEvent=function(e,t){i&&i.push("mraidBridge.notifyErrorEvent:"+e+":"+
t),m(E.ERROR,e,t)},n.executeSDKCommand=function(){var e,t,o,d="";if(!a)throw
n.notifyErrorEvent(d,r.error.bridgeError.BRG001),{name:"VungleMRAIDBridgeException",messa
ge:"BRG001"};if(!arguments)throw
n.notifyErrorEvent(d,r.error.bridgeError.BRG000),{name:"VungleMRAIDBridgeException",messa
ge:"BRG000"};for(d+="mraid://"+arguments[0],o=1;o<arguments.length;o+=2)e=arguments[o],t=
arguments[o+1],d+=(1===o?"?":"&")+encodeURIComponent(e),void
0!==t&&(d+="="+encodeURIComponent(t));s?c.push(d):(s=!0,n.notifyContainer(d)),i&&i.push("m
raidBridge.executeSDKCommand: "+d)},o.getReplacementTokens=function(){return
t},o.getIsVungleAd=function(){return d},o.getIsDirectDownload=function(){return
u},o.getIsDisplayIAP=function(){return l},o.getIsInstalled=function(){return
p},o.getEnableBackButtonImmediately=function(){return
r.mraidCore.propertiesHandlers.enableBackImmediately.clone()},o.fireVideoCompleteEvent=fun
ction(){i&&i.push("mraidBridgeExt.fireVideoCompleteEvent");var
t=e.document.querySelector("#dynamic"),r=new
e.Event("vungle.events.video.ended");t?t.dispatchEvent(r):o.notifyError(e.vungle.error.bridgeExt
Error.BRX000)},o.notifyPrepareStoreViewSuccess=function(){i&&i.push("mraidBridgeExt.notifyP
repareStoreViewSuccess");var t=e.document.querySelector("#dynamic"),r=new
e.Event("vungle.events.preparestore.success");t?t.dispatchEvent(r):o.notifyError(e.vungle.error.
bridgeExtError.BRX000)},o.notifyPresentStoreViewFinished=function(){i&&i.push("mraidBridgeE
xt.notifyPresentStoreViewFinished");var t=e.document.querySelector("#dynamic"),r=new
e.Event("vungle.events.preparestore.finished");t?t.dispatchEvent(r):o.notifyError(e.vungle.error.b
ridgeExtError.BRX000)},o.notifyPrepareStoreOverlayViewSuccess=function(){i&&i.push("mraidB
ridgeExt.notifyPrepareStoreOverlayViewSuccess");var
t=e.document.querySelector("#dynamic"),r=new
e.Event("vungle.events.storeoverlay.success");t?t.dispatchEvent(r):o.notifyError(e.vungle.error.b
ridgeExtError.BRX000)},o.notifyPresentStoreOverlayViewFinished=function(){i&&i.push("mraidB
ridgeExt.notifyPresentStoreOverlayViewFinished");var
t=e.document.querySelector("#dynamic"),r=new
e.Event("vungle.events.storeoverlay.finished");t?t.dispatchEvent(r):o.notifyError(e.vungle.error.b
ridgeExtError.BRX000)},o.notifyPresentStoreOverlayViewVisible=function(){i&&i.push("mraidBri
dgeExt.notifyPresentStoreOverlayViewVisible");var
t=e.document.querySelector("#dynamic"),r=new
e.Event("vungle.events.storeoverlay.visible");t?t.dispatchEvent(r):o.notifyError(e.vungle.error.bri
dgeExtError.BRX000)},o.notifyPresentStoreOverlayViewFailed=function(){i&&i.push("mraidBridg
eExt.notifyPresentStoreOverlayViewFailed");var
t=e.document.querySelector("#dynamic"),r=new
e.Event("vungle.events.storeoverlay.failed");t?t.dispatchEvent(r):o.notifyError(e.vungle.error.brid
geExtError.BRX000)},o.notifyError=function(t){i&&i.push("mraidBridgeExt.notifyError:"+t);try{r.mr
aidBridge.executeSDKCommand("error","code",t)}catch(t){"VungleMRAIDBridgeException"===t.
name?i&&i.push("%cVungleMRAIDBridgeException caught in mraidBridgeExt.notifyError!
Message: %s","color: red; font-size:
x-large",e.vungle.error.bridgeError[t.message]):i&&i.push("%cUnknown Exception caught in
mraidBridgeExt.notifyError! Message: %s","color: red; font-size:
x-large",t.message)}},o.notifyTPAT=function(e){i&&i.push("mraidBridgeExt.notifyTPATEvent:"+e)
;try{r.mraidBridge.executeSDKCommand("tpat","event",e)}catch(e){r.mraidBridge.notifyErrorEve
nt("mraidBridgeExt.notifyTPAT",e.message)}},o.consentAction=function(e){i&&i.push("mraidBrid
geExt.consentActionEvent:"+e);try{r.mraidBridge.executeSDKCommand("consentAction","event
",e)}catch(e){r.mraidBridge.notifyErrorEvent("mraidBridgeExt.consentActionEvent",e.message)}}
,o.notifyUserInteraction=function(e,t){i&&i.push("mraidBridgeExt.notifyUserInteraction");try{r.mra
idBridge.executeSDKCommand("action",e,t)}catch(e){r.mraidBridge.notifyErrorEvent("mraidBrid
geExt.notifyUserInteraction",e.message)}},o.notifyEventValuePairEvent=function(e,t){i&&i.push("
mraidBridgeExt.notifyEventValuePairEvent");var
n=e||"null",o=t||"null";try{r.mraidBridge.executeSDKCommand("actionWithValue","event",n,"value
",o)}catch(n){r.mraidBridge.notifyErrorEvent("mraidBridgeExt.notifyEventValuePairEvent",n.mes
sage)}},o.playHTML5Video=function(e){i&&i.push("mraidBridgeExt.playHTML5Video");try{r.mrai
dBridge.executeSDKCommand("playHTML5Video","selector",e)}catch(e){r.mraidBridge.notifyErr
orEvent("mraidBridgeExt.playHTML5Video",e.message)}},o.openPrivacy=function(e){i&&i.push(
"mraidBridgeExt.openPrivacy");try{r.mraidBridge.executeSDKCommand("openPrivacy","url",e)}c
atch(e){r.mraidBridge.notifyErrorEvent("mraidBridgeExt.openPrivacy",e.message)}},o.requestM
RAIDClose=function(){i&&i.push("mraidBridgeExt.requestMRAIDClose");try{var
e,t="windows"===r.mraidExt.getOS()&&(0===r.mraidExt.getOSVersion().indexOf("WinPhone81"
)||0===r.mraidExt.getOSVersion().indexOf("Win81")),n="android"===r.mraidExt.getOS()&&parse
Int(r.mraidExt.getOSVersion(),10)<=17;t||n?(e=document.createEvent("Event")).initEvent("vungl
e.events.request.close",!0,!0):e=new
Event("vungle.events.request.close"),d?document.querySelector("#dynamic").dispatchEvent(e):
r.mraidBridge.executeSDKCommand("close")}catch(e){r.mraidBridge.notifyErrorEvent("mraidBri
dgeExt.requestMRAIDClose",e.message)}},o.notifySuccessfulViewAd=function(){i&&i.push("mra
idBridgeExt.notifySuccessfulViewAd");try{r.mraidBridge.executeSDKCommand("successfulView
")}catch(e){r.mraidBridge.notifyErrorEvent("mraidBridgeExt.notifySuccessfulViewAd",e.message
)}},o.openAppInDevice=function(){i&&i.push("mraidBridgeExt.openAppInDevice");try{r.mraidBrid
ge.executeSDKCommand("openAppInDevice")}catch(e){r.mraidBridge.notifyErrorEvent("mraidB
ridgeExt.openAppInDevice",e.message)}},o.openStorePage=function(){i&&i.push("mraidBridgeE
xt.openStorePage");try{r.mraidBridge.executeSDKCommand("openStorePage")}catch(e){r.mraid
Bridge.notifyErrorEvent("mraidBridgeExt.openStorePage",e.message)}},o.cancelDownload=func
tion(){i&&i.push("mraidBridgeExt.cancelDownload");try{r.mraidBridge.executeSDKCommand("ca
ncelDownload")}catch(e){r.mraidBridge.notifyErrorEvent("mraidBridgeExt.cancelDownload",e.m
essage)}},o.getInstallationStatus=function(t){i&&i.push("mraidBridgeExt.getInstallationStatus");v
ar r=e.document.querySelector("#dynamic"),n=new
e.CustomEvent("vungle.events.installationStatus.updated",{detail:t});r?r.dispatchEvent(n):o.notif
yError(e.vungle.error.bridgeExtError.BRX000)},o.startDownloadAppOnDevice=function(){i&&i.pu
sh("mraidBridgeExt.startDownloadAppOnDevice");try{r.mraidBridge.executeSDKCommand("sta
rtDownloadAppOnDevice")}catch(e){r.mraidBridge.notifyErrorEvent("mraidBridgeExt.startDownl
oadAppOnDevice",e.message)}}}(window)},function(e,t){!function(e){"use strict";var
t=e.vungle=e.vungle||{},r=e.mraid=t.mraid=t.mraid||{},n=t.mraidExt=t.mraidExt||{},o=t.debugLog=
t.debugLog||[],i=t.mraidBridge.executeSDKCommand,a=t.mraidCore.broadcastEvent,s=t.mraidC
ore.propertiesHandlers,c=t.mraidCore.propertiesValidator,d=t.mraidCore.consts.states,u=t.mraid
Core.consts.events,l=t.mraidCore.consts.placements;o&&o.push("vungle.mraid
loaded."),r.addEventListener=function(e,r){e&&r?t.mraidCore.isValidMARIDEvent(e)?(t.mraidCor
e.eventListeners[e]||(t.mraidCore.eventListeners[e]=new
t.mraidCore.EventListeners(e)),t.mraidCore.eventListeners[e].add(r)):a(u.ERROR,"mraid.addEv
entListener",t.error.mraidError.MRD000+":"+e):a(u.ERROR,"mraid.addEventListener",t.error.mra
idError.MRD001)},r.removeEventListener=function(e,r){var
n,o=!1;e?(n=t.mraidCore.eventListeners[e],r?(n&&(o=n.remove(r)),o||a(u.ERROR,"mraid.remov
eEventListener",t.error.mraidError.MRD002+":"+e)):n&&t.mraidCore.eventListeners.removeAll(),
n&&0===n.count&&(t.mraidCore.eventListeners[e]=null,delete
t.mraidCore.eventListeners[e])):a(u.ERROR,"mraid.removeEventListener",t.error.mraidError.MR
D003)},r.getVersion=function(){return s.version.clone()},r.getMaxSize=function(){return
s.maxSize.clone()},r.getScreenSize=function(){return
s.screenSize.clone()},r.getDefaultPosition=function(){return
s.defaultPosition.clone()},r.getCurrentPosition=function(){return
s.currentPosition.clone()},r.getExpandProperties=function(){return
s.expandProperties.clone()},r.getResizeProperties=function(){return
s.resizeProperties.clone()},r.getState=function(){return
s.state.clone()},r.getPlacementType=function(){return
s.placementType.clone()},r.getOrientationProperties=function(){return
s.orientationProperties.clone()},r.setOrientationProperties=function(e){var r;"object"==typeof
e?(r=["setOrientationProperties","allowOrientationChange",e.allowOrientationChange,"forceOrie
ntation",e.forceOrientation],c(e,s.orientationProperties.clone(),"orientationProperties")&&(s.orien
tationProperties.update(e),i.apply(null,r))):(a(u.ERROR,"mraid.setOrientationProperties",t.error.
mraidError.MRD005),t.mraidBridgeExt&&t.mraidBridgeExt.notifyError("MRD005"))},r.setExpand
Properties=function(e){var r={};"object"==typeof
e?(Object.keys(e).forEach(function(t){"isModal"!==t&&(r[t]=e[t])}),c(r,s.expandProperties.clone(),
"expandProperties")&&s.expandProperties.update(r)):(a(u.ERROR,"mraid.setExpandProperties"
,t.error.mraidError.MRD004),t.mraidBridgeExt&&t.mraidBridgeExt.notifyError("MRD004"))},r.setR
esizeProperties=function(e){"object"==typeof
e?c(e,s.resizeProperties.clone(),"resizeProperties")&&s.resizeProperties.update(e):(a(u.ERROR
,"mraid.setResizeProperties",t.error.mraidError.MRD006),t.mraidBridgeExt&&t.mraidBridgeExt.n
otifyError("MRD006"))},r.open=function(e){e?i("open","url",encodeURI(e)):a(u.ERROR,"mraid.op
en",t.error.mraidError.MRD007)},r.close=function(){r.getState()!==d.HIDDEN?i("close"):a(u.ERR
OR,"mraid.close",t.error.mraidError.MRD008)},r.expand=function(e){var
r=s.customClose.clone(),n=s.placementType.clone(),o=s.state.clone(),c=["expand","useCustom
Close",r];n!==l.INLINE||o!==d.DEFAULT&&o!==d.RESIZED?a(u.ERROR,"mraid.expand",t.error.
mraidError.MRD011):(e&&(arguments.push("url"),arguments.push(encodeURI(e))),i.apply(null,c)
)},r.resize=function(){var
e=s.resize.clone(),n=["resize"],o=r.getState();o!==d.DEFAULT&&o!==d.RESIZED?(n.push("widt
h"),n.push(e.width),n.push("height"),n.push(e.height),n.push("offsetX"),n.push(e.offsetX),n.push(
"offsetY"),n.push(e.offsetY),n.push("customClosePosition"),n.push(e.customClosePosition),n.pu
sh("allowOffscreen"),n.push(e.allowOffscreen),i.apply(null,n)):a(u.ERROR,"mraid.resize",t.error.
mraidError.MRD012)},r.supports=function(e){return
s.supports.clone()[e]},r.isViewable=function(){return
s.isViewable.clone()},r.useCustomClose=function(e){c(e,s.customClose.clone(),"useCustomClos
e")&&c({useCustomClose:e},s.expandProperties.clone(),"expandProperties")&&(s.customClose.
update(e),s.expandProperties.update({useCustomClose:e}),i("useCustomClose","sdkCloseButto
n",!0===e?"invisible":!1===e?"visible":void 0===e?"gone":""))},r.playVideo=function(){var
e=arguments&&arguments[0]?arguments[0]:"",n=arguments&&arguments[1]?arguments[1]:"";r.i
sViewable()?e.length>0?i("playVideo","uri",e,"captionUrl",n):a(u.ERROR,"mraid.playVideo",t.err
or.mraidError.MRD009):a(u.ERROR,"mraid.playVideo",t.error.mraidError.MRD010)},r.createCale
ndarEvent=function(){},r.storePicture=function(e){r.isViewable()?e?a(u.ERROR,"mraid.storePict
ure",t.error.mraidError.MRD013):i("storePicture","uri",e):a(u.ERROR,"mraid.storePicture",t.error.
mraidError.MRD010)},r.getViewable=r.isViewable,n.getConsentRequired=function(){return
s.consentRequired.clone()},n.getConsentTitleText=function(){return
s.consentTitleText.clone()},n.getConsentBodyText=function(){return
s.consentBodyText.clone()},n.getConsentAcceptButtonText=function(){return
s.consentAcceptButtonText.clone()},n.getConsentDenyButtonText=function(){return
s.consentDenyButtonText.clone()},n.prepareStoreView=function(e){e?i("prepareStoreView","app
StoreId",e):a(u.ERROR,"mraid.prepareStoreView",t.error.mraidError.MRD016)},n.presentStoreVi
ew=function(e){e?i("presentStoreView","appStoreId",e):a(u.ERROR,"mraid.presentStoreView",t.
error.mraidError.MRD016)},n.prepareStoreOverlayView=function(e,r){if(e&&r){var
n=["prepareStoreOverlayView"];n.push("appStoreId"),n.push(e),Object.keys(r).forEach(function(
e){n.push(e),n.push(r[e])}),i.apply(null,n)}else
a(u.ERROR,"mraid.prepareStoreOverlayView",t.error.mraidError.MRD016)},n.presentStoreOverl
ayView=function(e,r){if(e&&r){var
n=["presentStoreOverlayView"];n.push("appStoreId"),n.push(e),Object.keys(r).forEach(function(
e){n.push(e),n.push(r[e])}),i.apply(null,n)}else
a(u.ERROR,"mraid.presentStoreOverlayView",t.error.mraidError.MRD016)},n.dismissStoreOverl
ayView=function(e){e?i("dismissStoreOverlayView","appStoreId",e):a(u.ERROR,"mraid.dismiss
StoreOverlayView",t.error.mraidError.MRD016)},n.getMraidVersion=function(){return"v4.5.0"},n.g
etOS=function(){return s.os.clone()},n.getOSVersion=function(){return
s.osVersion.clone()},n.getSDKVersion=function(){return
s.sdkVersion.clone()},n.getIncentivized=function(){return
s.incentivized.clone()},n.useCustomPrivacy=function(e){c(e,s.customPrivacy.clone(),"useCusto
mPrivacy")&&(s.customPrivacy.update(e),i("useCustomPrivacy","useCustomPrivacy",e))},r.getC
onsentRequired=n.getConsentRequired,r.getConsentTitleText=n.getConsentTitleText,r.getCons
entBodyText=n.getConsentBodyText,r.getConsentAcceptButtonText=n.getConsentAcceptButton
Text,r.getConsentDenyButtonText=n.getConsentDenyButtonText}(window)}]);

You might also like