"use strict";function Preload(){window.assetsCache={},this.fontTypes={CUSTOM:"custom",BANNERSNACK:"bannersnack",GOOGLE:"google"},this.loadedSlides={},this.imagesToLoad=[],this.fontsToLoad=[],this.getFontUrl=function(a){if(a.localUrl)return"fonts/"+a.localUrl;switch(a.fontType){case this.fontTypes.BANNERSNACK:return"//"+a.fontUrl;case this.fontTypes.CUSTOM:return"//"+(a.fontFaceUrl?a.fontUrl:a.fontUrl+".ttf");case this.fontTypes.GOOGLE:var b="https://fonts.googleapis.com/css?family="+a.fontFamily.split(" ").join("+")+":"+a.fontWeight;return"italic"===a.fontStyle&&(b+="i"),this.bannerConfig.preview&&(b+="&subset=cyrillic,cyrillic-ext,greek,greek-ext,latin,latin-ext,vietnamese"),b;default:return""}},this.addFontToDOM=function(a){var b,c,d,e,f=this,g="ttf";if(a.fontType||(a.fontType=this.fontTypes.GOOGLE),b=this.getFontUrl(a),!window.assetsCache[b]){switch(this.fontsToLoad.push(b),c=function(){f.fontsToLoad.pop(),f.resolveIfAssetsLoaded()},a.fontType){case this.fontTypes.GOOGLE:e=document.createElement("link"),e.setAttribute("rel","stylesheet"),e.setAttribute("type","text/css"),e.setAttribute("href",b),e.addEventListener("load",c),e.addEventListener("error",c),document.head.appendChild(e);break;case this.fontTypes.BANNERSNACK:case this.fontTypes.CUSTOM:g=b.substr(b.lastIndexOf(".")+1),e=document.createElement("link"),e.setAttribute("rel","preload"),e.setAttribute("type","font/"+g),e.setAttribute("as","font"),e.setAttribute("href",b),e.setAttribute("crossorigin","anonymous"),e.addEventListener("load",c),e.addEventListener("error",c),document.head.appendChild(e);var h="@font-face {\nfont-family: '"+a.fontFamily+"';\nfont-style: "+a.fontStyle+";\nfont-weight: "+a.fontWeight+";\nsrc: url("+b+");\n}\n";d=document.createElement("style"),d.appendChild(document.createTextNode(h)),document.head.appendChild(d)}window.assetsCache[b]=!0}},this.getSlideId=function(a){return a.displayData?a.displayData.properties.id:a.properties.id},this.getSlideLoaded=function(a){var b=this.getSlideId(a);return!!this.loadedSlides[b]&&this.loadedSlides[b]},this.setSlideLoaded=function(a){var b=this.getSlideId(a);this.loadedSlides[b]=!0},this.resolveIfAssetsLoaded=function(){0===this.imagesToLoad.length&&0===this.fontsToLoad.length&&(this.currentSlide?this.setSlideLoaded(this.currentSlide):this.setAllSlidesLoaded(),"function"==typeof this.callback&&this.callback())},this.preloadImage=function(a,b,c){var d=this,e=a;if(b&&(e+=b),!window.assetsCache[e]){var f=new Image;this.imagesToLoad.push(f);var g=function(){d.imagesToLoad.pop(),d.resolveIfAssetsLoaded()};f.addEventListener("load",g),f.addEventListener("error",g),this.bannerConfig.preview&&c?this.setColorGroups(a,f,c):f.src=a,window.assetsCache[e]=f}},this.preloadElementAssets=function(a){if("layer"===a.type){var b;switch(a.layerType){case"shape":"image"===a.properties.backgroundColor.type&&this.preloadImage(eaUtils.getImagePathFromBackground(a.properties.backgroundColor));break;case"image":a.properties.localUrl?(b="images/"+a.properties.localUrl,this.bannerConfig.embedUrl&&(b=this.bannerConfig.embedUrl+b)):b=a.properties.url&&-1!==a.properties.url.indexOf("//")?a.properties.url:this.bannerConfig.photosUrl+a.properties.url,this.preloadImage(b);break;case"svg":b=a.properties.localUrl?"images/"+a.properties.localUrl:this.bannerConfig.s3Url+"files/"+a.properties.url,this.preloadImage(b,a.properties.id,a.properties.colorGroups);break;case"text":this.addFontToDOM(a.properties);break;case"button":this.addFontToDOM(a.properties.labelStyle)}}else if("slide"===a.type)for(var c=0;c>16,a>>8&255,255&a]},hex2rgba:function(a,b){var c="#"===a[0]?a.substr(1):a,d=this.hex2rgb(parseInt(c,16));return"rgba("+d[0]+", "+d[1]+", "+d[2]+", "+b+")"},getIEVersion:function(){if(void 0!=eaUtils.IEVersion)return eaUtils.IEVersion;var a=-1;if("Microsoft Internet Explorer"==navigator.appName){var b=navigator.userAgent;null!=new RegExp("MSIE ([0-9]{1,}[.0-9]{0,})").exec(b)&&(a=parseFloat(RegExp.$1))}return eaUtils.IEVersion=a,a},detectIE:function(){return-1!=eaUtils.getIEVersion()},_is_safari:null,isSafari:function(){return null===this._is_safari&&(this._is_safari=/Safari/.test(navigator.userAgent)&&/Apple Computer/.test(navigator.vendor)),this._is_safari},isMobile:{Android:function(){return navigator.userAgent.match(/Android/i)},BlackBerry:function(){return navigator.userAgent.match(/BlackBerry/i)},iOS:function(){return navigator.userAgent.match(/iPhone|iPad|iPod/i)},Opera:function(){return navigator.userAgent.match(/Opera Mini/i)},Windows:function(){return navigator.userAgent.match(/IEMobile/i)},any:function(){return eaUtils.isMobile.Android()||eaUtils.isMobile.BlackBerry()||eaUtils.isMobile.iOS()||eaUtils.isMobile.Opera()||eaUtils.isMobile.Windows()}},getBrowser:function(){var a,b,c,d=navigator.userAgent,e=navigator.appName,f=""+parseFloat(navigator.appVersion),g=parseInt(navigator.appVersion,10);return-1!=(b=d.indexOf("OPR/"))?(e="Opera",f=d.substring(b+4)):-1!=(b=d.indexOf("Opera Mini"))?(e="Opera Mini",f=d.substring(b+11)):-1!=(b=d.indexOf("Opera"))?(e="Opera",f=d.substring(b+6),-1!=(b=d.indexOf("Version"))&&(f=d.substring(b+8))):-1!=(b=d.indexOf("Edge"))?(e="Edge",f=d.substring(b+5)):-1!=(b=d.indexOf("MSIE"))?(e="MSIE",f=d.substring(b+5)):/x64|x32/gi.test(d)?(e="MSIE",f="12.0"):-1!=(b=d.indexOf("Chrome"))?(e="Chrome",f=d.substring(b+7)):-1!=(b=d.indexOf("Safari"))?(e="Safari",f=d.substring(b+7),-1!=(b=d.indexOf("Version"))&&(f=d.substring(b+8))):-1!=(b=d.indexOf("Firefox"))?(e="Firefox",f=d.substring(b+8)):(a=d.lastIndexOf(" ")+1)<(b=d.lastIndexOf("/"))&&(e=d.substring(a,b),f=d.substring(b+1),e.toLowerCase()==e.toUpperCase()&&(e=navigator.appName)),"Netscape"!==e||5!=f||window.ActiveXObject||(e="MSIE",f="11.0"),-1!=(c=f.indexOf(";"))&&(f=f.substring(0,c)),-1!=(c=f.indexOf(" "))&&(f=f.substring(0,c)),g=parseInt(""+f,10),isNaN(g)&&(f=""+parseFloat(navigator.appVersion),g=parseInt(navigator.appVersion,10)),isNaN(g)&&(g=0),/Chrome|Firefox|MSIE|Edge|Safari|Opera|Opera Mini/.test(e)||(e="Other",g=0),[e,g]},getOS:function(){var a,b=navigator.userAgent,c=[{s:"Windows 10",r:/(Windows 10.0|Windows NT 10.0)/},{s:"Windows 8.1",r:/(Windows 8.1|Windows NT 6.3)/},{s:"Windows 8",r:/(Windows 8|Windows NT 6.2)/},{s:"Windows 7",r:/(Windows 7|Windows NT 6.1)/},{s:"Windows Vista",r:/Windows NT 6.0/},{s:"Windows Server 2003",r:/Windows NT 5.2/},{s:"Windows XP",r:/(Windows NT 5.1|Windows XP)/},{s:"Windows 2000",r:/(Windows NT 5.0|Windows 2000)/},{s:"Windows ME",r:/(Win 9x 4.90|Windows ME)/},{s:"Windows 98",r:/(Windows 98|Win98)/},{s:"Windows 95",r:/(Windows 95|Win95|Windows_95)/},{s:"Windows NT 4.0",r:/(Windows NT 4.0|WinNT4.0|WinNT|Windows NT)/},{s:"Windows CE",r:/Windows CE/},{s:"Windows 3.11",r:/Win16/},{s:"Windows Phone",r:/Windows Phone|iemobile|WPDesktop/},{s:"Chrome OS",r:/\bCrOS\b/},{s:"Android",r:/Android/},{s:"Open BSD",r:/OpenBSD/},{s:"Sun OS",r:/SunOS/},{s:"Linux",r:/(Linux|X11)/},{s:"iOS",r:/(iPhone|iPad|iPod)/},{s:"Mac OS X",r:/Mac OS X/},{s:"Mac OS",r:/(MacPPC|MacIntel|Mac_PowerPC|Macintosh)/},{s:"QNX",r:/QNX/},{s:"UNIX",r:/UNIX/},{s:"BeOS",r:/BeOS/},{s:"OS/2",r:/OS\/2/},{s:"Search Bot",r:/(nuhk|Googlebot|Yammybot|Openbot|Slurp|MSNBot|Ask Jeeves\/Teoma|ia_archiver)/}];for(var d in c){var e=c[d];if(e.r.test(b)){a=e.s;break}}return/Windows/.test(a)&&!/Windows Phone/.test(a)&&(a="Windows"),/Mac OS/.test(a)&&(a="Macintosh"),/Windows|Windows Phone|Macintosh|Linux|Android|iOS|Chrome OS/.test(a)||(a="Other"),a},getScreenSize:function(){var a=window.devicePixelRatio||1,b=window.screen.width?window.screen.width:0,c=window.screen.height?window.screen.height:0;return eaUtils.isAndroidStockBrowser()&&(b/=a,b=Math.round(b),c/=a,c=Math.round(c)),b+"x"+c},isAndroidStockBrowser:function(){var a,b=!1,c=!1;return!("Android"!=eaUtils.getOS()||(a=navigator.userAgent.match(/firefox/i),b=a&&a.length>0,a=navigator.userAgent.match(/chrome/i),c=a&&a.length>0,b||c))},isTablet:function(){var a=navigator.userAgent.match(/(ipad|android|windows phone|silk|blackberry|iemobile)/i),b=eaUtils.getScreenSize().split("x");return!!(a&&a.length>0&&(b[0]>=960||b[1]>=960))},getDevice:function(){return eaUtils.isTablet()?"tablet":eaUtils.isMobile.any()?"mobile":"desktop"},generateLighterColor:function(a,b){if(a){void 0==b&&(b=26);var c=eaUtils.extractRGB(a);return c.r=Math.min(255,parseInt(c.r)+b),c.g=Math.min(255,parseInt(c.g)+b),c.b=Math.min(255,parseInt(c.b)+b),"#"+eaUtils.fixed2(c.r.toString(16))+eaUtils.fixed2(c.g.toString(16))+eaUtils.fixed2(c.b.toString(16))}},fixed2:function(a){return a.length<2?"0"+a:a},getTransparentImageURL:function(){return"data:image/gif;base64,R0lGODlhAQABAIAAANvf7wAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw=="},getElementStyle:function(a,b){var c;return a.currentStyle?c=a.currentStyle[b]:window.getComputedStyle&&(c=window.getComputedStyle(a,null).getPropertyValue(b)),c},addCSSById:function(a,b){var c=document.getElementsByTagName("head")[0],d=document.getElementById("eautils-css");void 0!=d&&null!=d||(d=document.createElement("style"),d.type="text/css",d.id="eautils-css",c.appendChild(d));var e;if(void 0!=eaUtils.cssStyle[b]){eaUtils.rawCssStyle="",eaUtils.cssStyle[b].css=a;for(var f=0;f0&&(d=a.gradColors[0].c,c="solid"):(c="solid",d="#fff")),"true"==String(a.useBorder)&&(b.border="1px solid "+a.borderColor),b["background-image"]="",c){case"none":break;case"image":a=this.backwardBackgroundTile(a),b=this.getImageBackgroundCSS(b,a);break;case"solid":if(d&&-1!=d.indexOf("rgba")){var e=eaUtils.getIEVersion();e>-1&&e<9&&(d=eaUtils.rgba2hex(eaUtils.extractRGBA(d),!1))}b["background-color"]=d;break;case"rgrad":case"lgrad":for(var f=a.gradColors,g=[],h=0;h0){var a=b["background-image"]=[];b["background-color"]=f[0].c,a.push("-moz-"+j+"-gradient("+k+", "+i+")"),a.push("-webkit-"+j+"-gradient("+k+", "+i+")"),a.push("-o-"+j+"-gradient("+k+", "+i+")"),a.push("-ms-"+j+"-gradient("+k+", "+i+")")}b.filter="progid:DXImageTransform.Microsoft.gradient( startColorstr='"+f[0].c+"', endColorstr='"+f[f.length-1].c+"',GradientType=0 )"}return b},getImagePathFromBackground:function(a){return a.localUrl?"images/"+a.localUrl:a.url&&-1!==a.url.indexOf("//")?a.url:bannerConfig.photosUrl+a.url},applyImageSizeOnBackground:function(a,b){var c=0,d=!1,e=this.getImagePathFromBackground(b);for(var f in b)switch(f){case"scaleMode":case"verticalAlign":case"horizontalAlign":case"contentScale":d=!0}if(d){var g=new Image;g.onload=function(d){c!=g.width&&(c=g.width),a.style.backgroundSize="","tile"==b.scaleMode&&(a.style.backgroundSize=b.contentScale*c/100+"px",a.style.visibility="visible")},g.src=e}},getImageBackgroundCSS:function(a,b){var c,d,e=this.getImagePathFromBackground(b);a["background-image"]="url("+e+")";for(var f in b)switch(f){case"scaleMode":case"verticalAlign":case"horizontalAlign":switch(b.verticalAlign){case"top":c="0";break;case"middle":c="50%";break;case"bottom":c="100%"}switch(b.horizontalAlign){case"left":d="0";break;case"center":d="50%";break;case"right":d="100%"}a["background-position"]=d+" "+c;break;case"contentOffsetX":"tile"===b.scaleMode&&(a["background-position-x"]=b[f]+"%");break;case"contentOffsetY":"tile"===b.scaleMode&&(a["background-position-y"]=b[f]+"%")}return a},getBorderCss:function(a){var b={};return a&&(1!=a.useBorder&&"true"!=a.useBorder||(b.border="1px solid "+a.borderColor)),b},applyCss:function(a,b){for(var c in b)a.style[c]=b[c]},isURLValid:function(a){return!(a.indexOf(" ")>=0||-1==a.indexOf("."))},getAppValidURL:function(a){return eaUtils.isURLValid(a)?a:EAdConfig.baseDomain},getElementUniqueId:function(){return"e_"+eaUtils.domUniqueId++},getImagePath:function(a,b,c){return a?a.replace("{hash}",b).replace("{wxh}",c):""},getUniqueId:function(){return(Math.random()+(new Date).getTime()).toString(36).replace(".","")},preloadImage:function(a,b){var c=new Image;c.onerror=c.onload=function(){b&&b()},c.src=a},isTouchDevice:function(){try{return document.createEvent("TouchEvent"),"ontouchstart"in document.documentElement}catch(a){return!1}},getSharePageURL:function(a){var b=1==a?"":"&v="+(12345+1e3*Math.random()>>0),c=URLPaths.sharePageUrlFormat.replace("{domain}",EAdConfig.shareSubdomain).replace("{hash}",EAdConfig.creativeHash);return this.getAppValidURL(c+b)},cloneObject:function(a){return JSON.parse(JSON.stringify(a))},getClickTagValue:function(){var a=window.location.search.substring(1),b=a.split("clickTag=");if(!b[1])return!1;var c=b[1].replace(/&.+$/,"");return decodeURIComponent(c)},getProtocol:function(){return"http:"!=location.protocol&&"https:"!=location.protocol?"https:":""},addProtocolToUrl:function(a){return-1==a.indexOf("://")?"http://"+a:a},getProportion:function(a,b){var c=window.innerWidth,d=window.innerHeight,e=c/a,f=d/b;return{proportion:Math.min(e,f)}}};Array.prototype.indexOf||(Array.prototype.indexOf=function(a){if(void 0===this||null===this)throw new TypeError;var b=Object(this),c=b.length>>>0;if(0===c)return-1;var d=0;if(arguments.length>0&&(d=Number(arguments[1]),d!==d?d=0:0!==d&&d!==1/0&&d!==-1/0&&(d=(d>0||-1)*Math.floor(Math.abs(d)))),d>=c)return-1;for(var e=d>=0?d:Math.max(c-Math.abs(d),0);e=0||i<0&&g<=0)&&(k=-1);var l=540*k,m=a.type+"_"+b+"_"+g+"_"+i+"_"+j+"_"+l+"_"+a.blurAmount;if(e[m])return m;var n={transform:"translateX("+g+"px) translateY("+i+"px) rotate("+l+"deg)",filter:"blur("+a.blurAmount+"px)",opacity:j/100},o={transform:"translateX(0) translateY(0) rotate(0deg)",filter:"blur(0)",opacity:"1"};return f(m,[{percent:c?0:100,props:n},{percent:c?100:0,props:o}]),m},j=function(a,b){var c="buildIn"===b,d=h(a,c),g=d.translateX,i=d.translateY,j=d.alpha,k=a.type+"_"+b+"_"+g+"_"+i+"_"+j;if(e[k])return k;var l={transform:"translateX("+g+"px) translateY("+i+"px)",opacity:j/100},m={transform:"translateX(0) translateY(0)",opacity:"1"};return f(k,[{percent:c?0:100,props:l},{percent:c?100:0,props:m}]),k},k=function(a,b){var c="buildIn"===b,d=h(a,c),g=d.translateX,i=d.translateY,j=d.alpha,k="slideBounce_"+b+"_"+g+"_"+i+"_"+j;if(e[k])return k;for(var l,m=[[0,g,i,j/100],[38,0,0,1],[55,.11*g,.11*i,1],[72,0,0,1],[81,.05*g,.05*i,1],[90,0,0,1],[95,.02*g,.02*i,1],[100,0,0,1]],n=[],o=0;l=m[o];o++){var p={transform:"translateX("+l[1]+"px) translateY("+l[2]+"px)",opacity:l[3],"animation-timing-function":o%2?"ease-out":"ease-in"};n.push({percent:c?l[0]:100-l[0],props:p})}return f(k,n),k},l=function(a,b){var c="buildIn"===b,d=h(a,c),g=d.translateX,i=d.translateY,j=d.alpha,k="slideElastic_"+b+"_"+g+"_"+i+"_"+j;if(e[k])return k;for(var l,m=[[0,g,i,j/100],[16,-.25*g,-.25*i,1],[28,.11*g,.11*i,1],[44,-.05*g,-.05*i,1],[60,.02*g,.02*i,1],[72,-.01*g,-.01*i,1],[88,.01*g,.01*i,1],[100,0,0,1]],n=[],o=0;l=m[o];o++){var p={transform:"translateX("+l[1]+"px) translateY("+l[2]+"px)",opacity:l[3]};n.push({percent:c?l[0]:100-l[0],props:p})}return f(k,n),k},m=function(a,b){var c=1,d=1,e="top left";switch(a.direction){case"l2r":c=0,e=b?"left center":"right center";break;case"r2l":c=0,e=b?"right center":"left center";break;case"t2b":d=0,e=b?"center top":"center bottom";break;case"b2t":d=0,e=b?"center bottom":"center top";break;case"center":c=0,d=0,e="center center"}return{startScaleX:c,startScaleY:d,transformOrigin:e}},n=function(a,b){var c="buildIn"===b,d=m(a,c),g=d.startScaleX,h=d.startScaleY,i=d.transformOrigin,j="scale_"+b+"_"+i.replace(" ","_")+"_"+g+"_"+h;if(e[j])return j;var k={transform:"scaleX("+g+") scaleY("+h+")","transform-origin":i},l={transform:"scaleX(1) scaleY(1)","transform-origin":i};return f(j,[{percent:c?0:100,props:k},{percent:c?100:0,props:l}]),j},o=function(a,b){var c="buildIn"===b,d=m(a,c),g=d.startScaleX,h=d.startScaleY,i=d.transformOrigin,j="scaleBounce_"+b+"_"+i.replace(" ","_")+"_"+g+"_"+h;if(e[j])return j;for(var k,l=function(a){return g||a},n=function(a){return h||a},o=[[0,g,h],[38,1,1],[55,l(.7),n(.7)],[72,1,1],[81,l(.84),n(.84)],[90,1,1],[95,l(.95),n(.95)],[100,1,1]],p=[],q=0;k=o[q];q++){var r={transform:"scaleX("+k[1]+") scaleY("+k[2]+")","transform-origin":i,"animation-timing-function":q%2?"ease-out":"ease-in"};p.push({percent:c?k[0]:100-k[0],props:r})}return f(j,p),j},p=function(a,b){var c="buildIn"===b,d=m(a,c),g=d.startScaleX,h=d.startScaleY,i=d.transformOrigin,j="scaleElastic_"+b+"_"+i.replace(" ","_")+"_"+g+"_"+h;if(e[j])return j;for(var k,l=function(a){return g||a},n=function(a){return h||a},o=[[0,g,h],[16,l(1.35),n(1.35)],[28,l(.86),n(.86)],[44,l(1.05),n(1.05)],[60,l(.98),n(.98)],[72,l(1.01),n(1.01)],[88,l(.99),n(.99)],[100,1,1]],p=[],q=0;k=o[q];q++)p.push({percent:c?k[0]:100-k[0],props:{transform:"scaleX("+k[1]+") scaleY("+k[2]+")","transform-origin":i}});return f(j,p),j},q=function(a,b){var c="buildIn"===b,d="blur_"+b+"_"+a.blurAmount;if(e[d])return d;var g={filter:"blur("+a.blurAmount+"px)",opacity:"0"},h={filter:"blur(0px)"};return f(d,[{percent:c?0:100,props:g},{percent:c?30:70,props:{opacity:1}},{percent:c?100:0,props:h}]),d},r=function(a,b){var c="buildIn"===b,d="alpha_"+b;if(e[d])return d;var g={opacity:"0",transform:"translateX(0) translateY(0)"},h={opacity:"1"};return f(d,[{percent:c?0:100,props:g},{percent:c?100:0,props:h}]),d},s=function(a){if(!a.getElementsByTagName("span").length){for(var b=a.innerHTML,c="",d=!1,e=!1,f=0;f"),d=!0,e=!1):(d&&(c+=""),d=!1,e=!0),c+=b[f];c+="",a.innerHTML=c}},t=function(a,c,d,e){var f=a.getElementsByClassName("text-content")[0];if(f){s(f);var h=f.getElementsByTagName("span"),i=(c.duration-c.wordsDuration)/(h.length-1||1);i<0&&(i=0);var j=c.wordsAppearOrder||"random",k=0,l=0;for(h=[].slice.call(h);h.length;){var m,n;"r2l"===j?m=h.pop():"l2r"===j?m=h.shift():(l=Math.floor(Math.random()*h.length),m=h.splice(l,1)[0]),n={tween:c.tween,ease:c.ease,duration:Math.min(c.wordsDuration,c.duration),blurAmount:c.blurAmount,delay:k*i+Number(c.delay)};var o=null;switch(c.type){case"alpha-words":o=r(0,d);break;case"blur-words":o=q(c,d)}if(o){var p=Number(c.duration)||1e-4,t=o+" "+Number(p)+"s "+b(c)+" "+x(n.delay+e,3)+"s both";g(m,t),m.setAttribute("word-delay",k*i)}k++}}},u=function(a,b){var c="buildIn"===b,d=parseInt(a.alphaOffset),g=0,h=0;switch(a.direction){case"l2r":g=-50;break;case"r2l":g=50;break;case"t2b":h=-50;break;case"b2t":h=50}c||(g*=-1,h*=-1);var i=a.type+"_"+b+"_"+g+"_"+h+"_"+a.zoom+"_"+d+"_"+a.blurAmount;if(e[i])return i;var j={transform:"scale("+a.zoom+") translateX("+g+"%) translateY("+h+"%)",filter:"blur("+a.blurAmount+"px)",opacity:d/100},k={transform:"scale(1)",filter:"blur(0)",opacity:"1"};return f(i,[{percent:c?0:100,props:j},{percent:c?100:0,props:k}]),i},v=function(a,b){var c="buildIn"===b,d=a.deg||80,g=0,h=0,i=parseInt(a.alphaOffset),j="1, 1, 0, 0deg";switch(c||(d*=-1),a.direction){case"bottom":g=d;break;case"top":g=-d;break;case"right":h=-d;break;case"left":h=d;break;case"topLeft":j="-1, 1, 0, "+d+"deg";break;case"topRight":j="1, 1, 0, "+-d+"deg";break;case"bottomLeft":j="1, 1, 0, "+d+"deg";break;case"bottomRight":j="-1, 1, 0, "+-d+"deg"}var k=a.type+"_"+b+"_"+a.direction+"_"+i+"_"+d;if(e[k])return k;var l={transform:"rotateX("+g+"deg) rotateY("+h+"deg) rotate3d("+j+")",opacity:i/100},m={opacity:"1"},n={transform:"rotateX(0) rotateY(0) rotate3d(1, 1, 0, 0deg)",opacity:"1"};return f(k,[{percent:c?0:100,props:l},{percent:50,props:m},{percent:c?100:0,props:n}]),k},w=function(a,b,c){var d="buildIn"===b,g=parseInt(a.alphaOffset),h=Math.round(.3*c.offsetWidth+.3*c.offsetHeight),i=45;("forward"===a.direction&&d||"backward"===a.direction&&!d)&&(i*=-1,h*=-1);var j=a.type+"_"+b+"_"+a.direction+"_"+g+"_"+h+"_"+i;if(e[j])return j;var k={transform:"translateZ("+h+"px) rotate("+i+"deg)",opacity:g/100},l={transform:"translateZ(0) rotate(0)",opacity:"1"};return f(j,[{percent:d?0:100,props:k},{percent:d?100:0,props:l}]),j},x=function(a,b){return parseFloat(a.toFixed(b))};window.eff={PLAYING_STATE:"running",clearAll:function(a){a&&a.firstChild&&g(a.firstChild,"")},clearWordsTimeout:function(a,b){for(var c,d=0;c=b[d];d++)g(c,"")},animate:function(a,c,d,e){if("none"===c.type)return void(c.onAnimationEnd&&c.onAnimationEnd());e=e||0;var f=null;switch(c.type){case"rotate":f=w(c,d,a);break;case"instant":break;case"flip":f=v(c,d);break;case"zoom":f=u(c,d);break;case"roll":f=i(c,d);break;case"slide":f=j(c,d);break;case"slideBounce":f=k(c,d);break;case"slideElastic":f=l(c,d);break;case"scale":f=n(c,d);break;case"scaleBounce":f=o(c,d);break;case"scaleElastic":f=p(c,d);break;case"blur":f=q(c,d);break;case"alpha":f=r(0,d);break;case"alpha-words":case"blur-words":f=t(a,c,d,e)}if("rotate"===c.type||"flip"===c.type){var h=Math.round(.7*a.offsetWidth+.7*a.offsetHeight)+"px";a.style.perspective=h,a.style.webkitPerspective=h}if(f){var m=Number(c.duration)||1e-4,s=f+" "+m+"s "+b(c)+" "+x(c.delay+e,3)+"s both";g(1===a.firstChild.nodeType?a.firstChild:a,s)}var y=Number(c.duration)+Number(c.delay)+e;setTimeout(function(){c.onAnimationEnd&&c.onAnimationEnd()},1e3*y)}}}();var EventDispatcher=function(){};EventDispatcher.prototype={constructor:EventDispatcher,apply:function(a){a.on=EventDispatcher.prototype.on,a.off=EventDispatcher.prototype.off,a.trigger=EventDispatcher.prototype.trigger},on:function(a,b){void 0===this._listeners&&(this._listeners={});var c,d,e=this._listeners;for(a=a.split(" "),d=0;c=a[d];d++)e[c]=e[c]||[],-1===e[c].indexOf(b)&&e[c].push(b)},off:function(a,b){if(void 0!==this._listeners){var c=this._listeners,d=c[a];if(void 0!==d){var e=d.indexOf(b);-1!==e&&d.splice(e,1)}}},trigger:function(a,b){if(void 0!==this._listeners){var c=this._listeners,d=c[a];if(void 0!==d){var e={};e.target=this,e.type=a,e.data=b;for(var f=d.length,g=0;g-1)return!0}return b.indexOf(a)>-1},Stats.prototype.track=function(){var a=this,b=this.getStatsRequestUrl(),c="bsStats_"+this.hash,d=this.isBlockedDomain(this.currentDomain);if(!d)try{ga("create","UA-15731042-32","auto"),ga("send","pageview")}catch(a){}var e={h:this.hash,c:c},f="";for(var g in e)f+=g+"="+encodeURIComponent(e[g])+"&";f=f.replace(/&$/,""),b+="?"+f,window[c]=function(b){var c=a.params;a.timestamp=c.t=b.t,a.ip=c.ip=b.ip,a.vid=c.vid=b.vid,c.et="view",a.viewTime=Math.floor((new Date).getTime()/1e3),b.premium||a.banner.showWatermark(),d||a.trackView(c)};var h=document.createElement("script");h.src=b,document.getElementsByTagName("head")[0].appendChild(h)},Stats.prototype.trackView=function(a){delete a.mp,delete a.eid,delete a.elt;var b=[];b.push(a),this.sendSQSRequest(b)},Stats.prototype.trackEvent=function(a,b){var c=this;a.addEventListener("click",function(a){var d=c.getCurrentSlideFromOverflow(b);d&&c.plan("click",d,a),c.plan("click",b,a)})},Stats.prototype.getCurrentSlideFromOverflow=function(a){return a&&a.properties&&a.properties.showOnAllSlides?a.slide.banner.currentSlide:!!(a&&a.menu&&a.menu.properties&&a.menu.properties.showOnAllSlides)&&a.menu.slide.banner.currentSlide},Stats.prototype.sendSQSRequest=function(a){this.sendData(this.sqsURL+"?Action=SendMessage&MessageBody="+encodeURIComponent(JSON.stringify(a)))},Stats.prototype.sendData=function(a){if(!a)return!1;var b=new XMLHttpRequest;b.open("GET",a,!0),b.send()},Stats.prototype.getStatsRequestUrl=function(){if(window.bannerConfig.env){if("live"===window.bannerConfig.env)return"//stats.bannersnack.com/info/";if("dev"===window.bannerConfig.env)return"//stats.dev.bannersnack.net/info/";if("local"===window.bannerConfig.env)return"//stats.dev.bannersnack.net/info/"}return"//stats.bannersnack.com/info/"},Stats.prototype.getElementType=function(a){if(!a)return!1;var b=a.displayData&&a.displayData.type;if("slide"==b)return b;if("layer"==b){var c=a.displayData&&a.displayData.layerType;return c||!1}return a.itemIndex&&a.menu?"menuItem":"banner"},BaseDisplay.prototype=new window.EventDispatcher,BaseDisplay.prototype.constructor=window.EventDispatcher,BaseDisplay.prototype.container=null,BaseDisplay.prototype.displayContainer=null,BaseDisplay.prototype.properties=null,BaseDisplay.prototype.displayData=null,BaseDisplay.prototype.buildTimeouts=[],BaseDisplay.prototype.init=function(a){return this.displayData=a,this.displayData.properties=this.parseProps(this.displayData.properties),this.trigger("init"),this},BaseDisplay.prototype.parseProps=function(a){for(var b,c=["buildIn","buildOut","transition"],d=0;b=c[d];d++)if(a[b])switch(a[b].tween){case"Bounce":case"Elastic":"scale"!==a[b].type&&"slide"!==a[b].type||(a[b].type+=a[b].tween,"Elastic"===a[b].tween&&(a[b].ease="easeOut")),a[b].tween=""}return a},BaseDisplay.prototype.render=function(){},BaseDisplay.prototype.reset=function(){window.eff.clearAll(this.container);var a,b;for(a=0;b=this.buildTimeouts[a];a++)clearTimeout(b);for(this.buildTimeouts=[],this.transform("none"),this.webkitTransform("translate3d(0,0,0)"),this.setStyle(this.container,"x,y,width,height","px"),this.container.style.opacity="1",this.container.style.display="",this.container.style.filter="",this.container.style["-webkit-filter"]="",this.container.style.animation="",this.container.style["-webkit-animation"]="",a=0;b=this.buildTimeouts[a];a++)clearTimeout(b);if(this.buildTimeouts=[],this.displayContainer){var c=void 0!==this.properties.opacity?this.properties.opacity:100;this.displayContainer.style.opacity=c/100}},BaseDisplay.prototype.createMainContainers=function(a,b,c){this.container=this.createElement("div",a),this.effHelper=this.createElement("div","eff-helper"),this.displayContainer=this.createElement(c||"div",b),this.container.appendChild(this.effHelper),this.effHelper.appendChild(this.displayContainer)},BaseDisplay.prototype.applyActions=function(a,b){var c=this;if(!a||!b)return!1;if("none"==a.type)return!1;var d="pointer";void 0!==a.useHandCursor&&0==a.useHandCursor&&(d=""),b.style.cursor=d,b.addEventListener(a.event,function(b){if(b.clickFlag)return b.clickFlag=!1,!1;if(a.disabled)return!1;if(b.clickFlag=this,"gotoSlide"==a.type){var d=c.slide.getBuildOutTime();d&&(a.disabled=!0,setTimeout(function(){a.disabled=!1},d));var e=c.slide.banner.currentSlide;switch(a.slideOrUrl){case"first":e.buildOut(c.slide.getFirstSlide());break;case"last":e.buildOut(c.slide.getLastSlide());break;case"next":e.buildOut(c.slide.getNextSlide(e));break;case"prev":e.buildOut(c.slide.getPrevSlide(e));break;default:e.buildOut(e.getSlideByHashOrId(a.slideOrUrl))}}else{var f="";f=eaUtils.getClickTagValue()?eaUtils.addProtocolToUrl(eaUtils.getClickTagValue()):window.clickTag?eaUtils.addProtocolToUrl(window.clickTag):a.slideOrUrl,window.open(f,a.target)}})},BaseDisplay.prototype.createElement=function(a,b,c,d,e){var f=e||document.createElement(a);return f.setAttribute("class",b),0!=c&&(d||this.container)&&(d||this.container).appendChild(f),f.setAttribute("id",eaUtils.getElementUniqueId()),f},BaseDisplay.prototype.setStyle=function(a,b,c){c||(c="");var d={x:"left",y:"top",labelOffsetX:"margin-left",labelOffsetY:"margin-top",lineHeight:"line-height"};b=b.split(",");for(var e in b)b.hasOwnProperty(e)&&(a.style[d[b[e]]||b[e]]=this.properties[b[e]]+c);return this},BaseDisplay.prototype.getContainer=function(){return this.container},BaseDisplay.prototype.show=function(){return this.container.style.display="",this},BaseDisplay.prototype.hide=function(){return this.container.style.display="none",this},BaseDisplay.prototype.hasClass=function(a,b){return!!a&&new RegExp("(\\s|^)"+b+"(\\s|$)").test(a.className)},BaseDisplay.prototype.removeClass=function(a,b){return this.hasClass(a,b)&&(a.className=a.className.replace(new RegExp("(\\s|^)"+b+"(\\s|$)")," ").replace(/^\s+|\s+$/g,"")),this},BaseDisplay.prototype.addClass=function(a,b){return a?(this.hasClass(a,b)||(a.className+=(a.className?" ":"")+b),this):this},BaseDisplay.prototype.toggleClass=function(a,b){return a?(this.hasClass(a,b)?this.removeClass(a,b):this.addClass(a,b),this):this},BaseDisplay.prototype.applyBackground=function(a,b){var c=eaUtils.getBackgroundCss(b);for(var d in c)switch(d){default:a.style[d]=c[d];break;case"background-image":if("lgrad"===b.type||"rgrad"===b.type)for(var e=0;eg||f&&!h&&i>g)&&(f=null)}e&&"none"!=e.type?(this.buildTimeouts.push(setTimeout(function(){b.trigger("buildInStart")},1e3*e.delay)),"instant"===e.type&&e.delay>0&&(c.style.display="none",this.buildTimeouts.push(setTimeout(function(){c.style.display=""},1e3*(e.delay+a)))),e.onAnimationEnd=function(){f&&"none"!=f.type&&(b.buildTimeouts.push(setTimeout(function(){b.trigger("buildOutStart")},1e3*f.delay)),window.eff.animate(c,f,"buildOut"),b.buildTimeouts.push(setTimeout(function(){b.trigger("buildOutEnd"),c.style.display="none"},1e3*(f.duration+f.delay))))},window.eff.animate(c,e,"buildIn",a),this.buildTimeouts.push(setTimeout(function(){b.trigger("buildInEnd")},1e3*(e.duration+e.delay+a)))):f&&"none"!=f.type&&(this.buildTimeouts.push(setTimeout(function(){b.trigger("buildOutStart")},1e3*(f.delay+a))),window.eff.animate(c,f,"buildOut",a),this.buildTimeouts.push(setTimeout(function(){b.trigger("buildOutEnd"),c.style.display="none"},1e3*(f.duration+f.delay+a))))},BaseDisplay.prototype.transform=function(a,b){b||(b=this.container),b.style["-webkit-transform"]=a,b.style["-o-transform"]=a,b.style["-ms-transform"]=a,b.style["-moz-transform"]=a,b.style.transform=a},BaseDisplay.prototype.webkitTransform=function(a,b){b||(b=this.container),b.style["-webkit-transform"]=a},BaseDisplay.prototype.createActionProperties=function(a){var b=a||this.properties&&this.properties.actions&&this.properties.actions[0];if(!b)return!1;var c="";if("gotoURL"==b.type){if(!(c=b.url))return!1;-1==c.indexOf("://")&&(c="http://"+c)}return{event:b.event,slideOrUrl:"gotoSlide"==b.type?b.slide:c,type:b.type,target:b.target,useHandCursor:b.useHandCursor}},BaseDisplay.prototype.applyExtraPropertiesForGradients=function(a){if("string"!=typeof this.properties.backgroundColor){var b=this.properties.backgroundColor.type,c=this.properties.border?this.properties.border.weight:0;if("lgrad"===b||"rgrad"===b){var d="-"+c+"px",e="calc(100% + "+2*c+"px)";eaUtils.applyCss(a,{backgroundPosition:d+" "+d,backgroundSize:e+" "+e})}}},BannerDisplay.prototype=new BaseDisplay,BannerDisplay.prototype.constructor=BannerDisplay,BannerDisplay.prototype.currentSlide=null,BannerDisplay.prototype.lastSlide=null;var scripts=document.getElementsByTagName("script");BannerDisplay.prototype.jsFileSrc=scripts[scripts.length-1].src,BannerDisplay.prototype.init=function(a,b,c,d){var e=this;if(this.container=b,this.displayContainer=this.createElement("div","bs-helper"),this.container.appendChild(this.displayContainer),this.properties=a.properties,this.config=c,this.startSlide=parseInt(c.startSlide)||0,this.noAnimation=Boolean(c.noAnimation)||!1,this.showOnlyOneSlide=Boolean(c.showOnlyOneSlide)||!1,this.preload=d,!window.bannerConfig.resourcesUrl){var f=this.jsFileSrc.split("/");f=f.slice(0,f.indexOf("js")).join("/"),window.bannerConfig.resourcesUrl=f}this.setStyle(this.container,"width,height","px"),this.setStyle(this.displayContainer,"width,height","px");var g=this.properties.backgroundColor||{};(this.properties.width<2||this.properties.height<2)&&(g.useBorder=!1),g.useBorder&&(this.displayContainer.style.left="-1px",this.displayContainer.style.top="-1px"),this.applyBackground(this.container,g),this.applyActions(this.createActionProperties(),this.container),BaseDisplay.prototype.init.call(this,a),this.initSlides(a.elements),this.container.addEventListener("click",function(){e.statsPresent&&!e.stats.isBlockedDomain(document.referrer)&&e.stats.launch()});var h=eaUtils.getProportion(this.properties.width,this.properties.height);window.addEventListener("resize",function(){h=eaUtils.getProportion(e.properties.width,e.properties.height),e.container.style.transform="scale("+h.proportion+")"}),this.properties.transform="scale("+h.proportion+")",this.properties.transformOrigin="0 0 0",this.setStyle(this.container,"transform,transformOrigin")},BannerDisplay.prototype.showImageWatermark=function(){var a=document.createElement("div");a.setAttribute("class","wtm"),document.getElementById("bs").appendChild(a);var b='div.wtm {position: absolute;right: 0;bottom: 0;z-index: 99999;background: url("'+window.bannerConfig.resourcesUrl+'/images/watermark.png"); width: 87px; height: 19px;}div.wtm:hover {cursor: pointer}';eaUtils.addCSSById(b,"bswmimg"),this._addClickWatermarkListener(a)},BannerDisplay.prototype.showWatermark=function(){var a={fontSize:"11px",fontStyle:"normal",fontFamily:"Arial, sans-serif",fontWeight:"400",cursor:"pointer",contentColor:"#fff",containerBgColor:"rgba(100, 100, 100, .8)",tooltipBgColor:"#090300",tooltipFontSize:"10px",tooltipOpacity:"0",tooltipHoverOpacity:"1",tooltipTransition:"opacity .25s",containerDistBottom:"0",containerDistRight:"-68px",containerHoverDistRight:"0",containerPosition:"absolute",containerZIndex:"999",svgFloat:"left",txtFloat:"left",tooltipPosition:"absolute",tooltipDistRight:"0",tooltipWhiteSpace:"nowrap",svgSize:"22px",svgPadding:"4px 0",txtPadding:"4px 4px 4px 0",tooltipPadding:"6px"},b=document.createElement("div"),c=document.createElementNS("http://www.w3.org/2000/svg","svg"),d=document.createElementNS("http://www.w3.org/2000/svg","path"),e=document.createElementNS("http://www.w3.org/2000/svg","path"),f=document.createElement("div"),g=document.createElement("div");d.setAttribute("d","M3.5,0l15.2,0.5c2.9,0.1,4.5,1.2,4,4l-0.9,5.1c-0.1,0.6-0.2,1.1-0.4,1.7c-0.6,2.1-7.9-7.4-10-6.8L9.2,18.2l-3.7,1.1c-2.2,0.7-3.1-1-3.3-2.5L0.1,4C-0.3,1.2,0.6-0.1,3.5,0z"),e.setAttribute("d","M27.3,17.2c-4.7-4.9-9.3-9.5-14.1-13.8h0c-0.2-0.2-0.5-0.3-0.8-0.4c-0.7-0.1-1.6,0.3-2,1.3C9.1,7.2,9.2,19.9,9.1,23.8c0,0.6-0.1,1.1,0,1.6c0.7,0,1.9,0.2,2.2,0l3.7-4.3c0.7,1.8,2.2,6,3.2,8.8c0.3,0.7,1,1,1.7,0.8c0.8-0.8,5.4-1.9,5.6-1.9c-1.2-2.7-3.9-6.9-4.9-9.8l5.6,0.5c0.3,0.1,0.7-0.5,1-1.1C27.5,18.1,27.6,17.6,27.3,17.2z M24.9,18c-1-0.1-3.3-0.3-5.7-0.5l-0.6,0l0.2,0.6l5.1,10c-1.8,0.4-3.2,0.9-4.3,1.6c0-0.1-0.1-0.2-0.1-0.3c-0.1-0.2-0.2-0.4-0.2-0.6c-0.1-0.2-0.2-0.4-0.3-0.7c0-0.1-0.1-0.2-0.1-0.2c-0.9-2.2-2.1-5.7-3-7.6c-0.3-0.7-0.7-0.9-1-0.8c-0.1,0-0.2,0.1-0.3,0.2c-0.9,1.2-2.3,3.5-2.6,4.1l-1.5-0.4c-0.3-5.8,0.5-10.9,1.2-16.9c0.2-1.5,1.3-1.1,2.3-0.7c2.7,3.5,10.9,10.6,11.3,11.6C25.2,17.6,25.3,18,24.9,18z"),f.innerText="bannersnack",g.innerText="Create banners the Snack way",c.appendChild(d),c.appendChild(e),b.appendChild(c),b.appendChild(f),document.getElementById("bs").appendChild(b),b.setAttribute("style","background-color: "+a.containerBgColor+";bottom: "+a.containerDistBottom+";color: "+a.contentColor+";cursor: "+a.cursor+";fill: "+a.contentColor+";font-family: "+a.fontFamily+";font-size: "+a.fontSize+";font-style: "+a.fontStyle+";font-weight: "+a.fontWeight+";position: "+a.containerPosition+";right: "+a.containerDistRight+";z-index: "+a.containerZIndex+";"),c.setAttribute("version","1.1"),c.setAttribute("xmlns","http://www.w3.org/2000/svg"),c.setAttribute("xmlns:xlink","http://www.w3.org/a999/xlink"),c.setAttribute("width","27"),c.setAttribute("height","31"),c.setAttribute("x","0"),c.setAttribute("y","0"),c.setAttribute("viewBox","0 0 27.6 30.9"),c.setAttribute("xml:space","preserve"),c.setAttribute("style","enable-background: new 0 0 27.6, 30.9;float: "+a.svgFloat+";height: "+a.svgSize+";padding: "+a.svgPadding+";width: "+a.svgSize+";"),f.setAttribute("style","float: "+a.txtFloat+";padding: "+a.txtPadding+";"),g.setAttribute("style","background-color: "+a.tooltipBgColor+";bottom: "+f.clientHeight+"px;font-size: "+a.tooltipFontSize+";filter: alpha(opacity="+100*a.tooltipOpacity+");opacity: "+a.tooltipOpacity+";padding: "+a.tooltipPadding+"; position: "+a.tooltipPosition+";right: "+a.tooltipDistRight+";-webkit-transition: "+a.tooltipTransition+";-moz-transition: "+a.tooltipTransition+";-o-transition: "+a.tooltipTransition+";transition: "+a.tooltipTransition+";white-space: "+a.tooltipWhiteSpace+";"),this._addClickWatermarkListener(b),b.addEventListener("mouseenter",function(){b.style.right=a.containerHoverDistRight,b.appendChild(g),setTimeout(function(){g.style.opacity=a.tooltipHoverOpacity},250)}),b.addEventListener("mouseleave",function(){b.style.right=a.containerDistRight,g.parentNode.removeChild(g),g.style.opacity=a.tooltipOpacity,setTimeout(function(){g.style.opacity=a.tooltipOpacity},250)})},BannerDisplay.prototype._addClickWatermarkListener=function(a){var b=this;a.addEventListener("click",function(a){var c="//www.bannersnack.com/?utm_source=freebanner&utm_medium=watermark1&utm_content="+b.properties.width+"x"+b.properties.height+"&utm_campaign=BannerSnackEmbed";window.open(c,"_blank"),a.stopPropagation()})},BannerDisplay.prototype.initSlides=function(a){this.slides=[];var b,c,d=[],e={properties:{},elements:[]};for(b=0;c=a[b];b++)"slide"===c.type?d.push(c):(c.properties&&(c.properties.showOnAllSlides=!0),e.elements.push(c));this.overflowSlide=new SlideDisplay,this.overflowSlide.isOverflowSlide=!0,this.overflowSlide.banner=this,this.overflowSlide.init(e,this.displayContainer);var f,g;for(b=0;g=d[b];b++)f=new SlideDisplay,f.banner=this,f.init(g,this.displayContainer),this.slides.push(f)},BannerDisplay.prototype.getWidth=function(){return this.properties.width},BannerDisplay.prototype.getHeight=function(){return this.properties.height},BannerDisplay.prototype.play=function(){this.overflowSlide.render(),this.loopsPlayed=1,this.slides[this.startSlide]&&this.slides[this.startSlide].play(null,!0)},BannerDisplay.prototype.createActionProperties=function(){var a=eaUtils.getClickTagValue();a||(a=window.clickTag||window.clickTAG||this.config&&this.config.clickTag);var b={event:"click",slideOrUrl:"",type:"gotoURL",target:"_blank",useHandCursor:!0};if(a)return b.slideOrUrl=eaUtils.addProtocolToUrl(a),b;var c=this.properties;return!!c&&(!(!c.bannerUrl||"http://"===c.bannerUrl||"https://"===c.bannerUrl)&&(b.slideOrUrl=eaUtils.addProtocolToUrl(c.bannerUrl),b.target=c.urlTarget,b.useHandCursor=c.useHandCursor,b))},ButtonDisplay.prototype=new BaseDisplay,ButtonDisplay.prototype.constructor=ButtonDisplay,ButtonDisplay.prototype.getHoverBackgroundColor=function(){var a=JSON.parse(JSON.stringify(this.properties.backgroundColor));switch(a.type){case"solid":a.scolor=eaUtils.generateLighterColor(a.scolor,10);break;case"rgrad":case"lgrad":for(var b=a.gradColors,c=0;c-1&&g.setAttribute("fill",this.properties.fillColor);for(c in a.attributes)if("fill"==c&&"url"==a.attributes[c].slice(0,3)){var h=a.attributes[c].slice(5).slice(0,-1);g.setAttribute(c,"url(#"+h+this.displayContainer.getAttribute("id")+")")}else d="className"===c?"class":c,g.setAttribute(d,a.attributes[c]);"pattern"==a.type&&g.setAttribute("id",a.attributes.id+this.displayContainer.getAttribute("id")),b.appendChild(g),a.children&&a.children.forEach(function(a){e.makeClipartItem(a,this)},g)},ImageDisplay.prototype=new BaseDisplay,ImageDisplay.prototype.constructor=BaseDisplay,ImageDisplay.prototype.init=function(a){this.triggerReadyOnRender=!1,this.properties=a.properties;var b=this.properties;this.createMainContainers("element","bs-image image-"+b.scaleMode),this.transformContainer=this.createElement("div","transform-container"),this.displayContainer.parentNode.appendChild(this.transformContainer),this.transformContainer.appendChild(this.displayContainer);var c,d=window.bannerConfig;this.properties.localUrl?(c="images/"+this.properties.localUrl,d.embedUrl&&(c=d.embedUrl+c)):c=b.url&&-1!=b.url.indexOf("//")?b.url:d.photosUrl+b.url,this.displayContainer.style.backgroundImage="url("+c+")",this.applyFilters(this.displayContainer,b.adjustColor,b.blur,b.dropShadow);var e,f;switch(b.verticalAlign){case"top":e="0";break;case"middle":e="50%";break;case"bottom":e="100%"}switch(b.horizontalAlign){case"left":f="0";break;case"center":f="50%";break;case"right":f="100%"}if(this.displayContainer.style.backgroundPosition=f+" "+e,"tile"==b.scaleMode){var g=b.contentScale;this.displayContainer.style.backgroundSize=g/100*b.oWidth+"px",this.displayContainer.style.backgroundPositionX=b.contentOffsetX+"%",this.displayContainer.style.backgroundPositionY=b.contentOffsetY+"%"}this.transformContainer.style.height="100%",this.transformContainer.style.width="100%";var h=this.getFlipString(b.flip);return this.transform("translateZ(0) rotate("+b.rotation+"deg) "+h,this.transformContainer),this.reset(),this.slide.banner.statsPresent&&this.slide.banner.stats.trackEvent(this.displayContainer,this),this.applyActions(this.createActionProperties(),this.displayContainer),BaseDisplay.prototype.init.call(this,a)},ShapeDisplay.prototype=new BaseDisplay,ShapeDisplay.prototype.constructor=ShapeDisplay,ShapeDisplay.prototype.init=function(a){var b=a.properties;if(this.properties=b,this.createMainContainers("element","shape "+b.type),eaUtils.detectIE()){var c=this.createElement("img","fakeImage");c.src=eaUtils.getTransparentImageURL(),this.displayContainer.appendChild(c)}"line"===b.type&&(b.type="rectangle",b.width=b.len,b.height=b.thick,delete b.len,delete b.thick,this.properties=b),this.container.style.width=b.width+"px",this.container.style.height=b.height+"px";var d=this.getBRadius();d&&(this.displayContainer.style.borderRadius=d+"px"),this.displayContainer.style.border=this.getBorderString(),this.applyBackground(this.displayContainer,b.backgroundColor),this.applyExtraPropertiesForGradients(this.displayContainer),this.displayData=a;var e=this.getFlipString(b.flip);return this.transform("rotate("+this.properties.rotation+"deg) "+e,this.displayContainer),this.applyFilters(this.displayContainer,!1,this.properties.blur,this.properties.dropShadow),this.reset(),this.slide.banner.statsPresent&&this.slide.banner.stats.trackEvent(this.displayContainer,this),this.applyActions(this.createActionProperties(),this.displayContainer),BaseDisplay.prototype.init.call(this,a)},SlideDisplay.prototype=new BaseDisplay,SlideDisplay.prototype.constructor=SlideDisplay,SlideDisplay.prototype.init=function(a,b){if(this.isOverflowSlide)this.container=b,this.displayContainer=b,this.resetElements();else{this.createMainContainers("slide","slide-inner"),b.appendChild(this.container);var c=a.properties;this.ah=a.ah,!this.ah&&c&&(this.ah=c.id),c.duration=parseFloat(c.duration),c.duration<.1&&(c.duration=.1);var d=c.transition=c.transition||{type:"none",delay:0,duration:.1};this.parseTransition(d),this.applyBackground(this.displayContainer,c.backgroundColor),this.reset()}return this.banner.statsPresent&&this.banner.stats.trackEvent(this.container,this),BaseDisplay.prototype.init.call(this,a)},SlideDisplay.prototype.parseTransition=function(a){switch(a.duration=parseFloat(a.duration)||0,a.delay=parseFloat(a.delay)||0,a.type){case"slide":case"slideBounce":case"slideElastic":if(!parseInt(a.slideOffset))switch(a.direction){case"r2l":case"l2r":a.slideOffset=this.banner.getWidth();break;case"t2b":case"b2t":a.slideOffset=this.banner.getHeight()}break;case"flip":"cross"===a.crosstype&&(a.deg=180)}},SlideDisplay.prototype.isFirstSlide=function(){return 0===this.banner.slides.indexOf(this)},SlideDisplay.prototype.isLastSlide=function(){return this.banner.slides.indexOf(this)===this.banner.slides.length-1},SlideDisplay.prototype.reset=function(){window.eff.clearAll(this.container);var a=this.displayContainer.style;a.zIndex=0,a.width="100%",a.height="100%",a.top="0",a.left="0",a.filter="",a["-webkit-filter"]="",a.animation="",a["-webkit-animation"]="",this.transform("none"),this.resetElements()},SlideDisplay.prototype.resetElements=function(){for(var a=0;a=b.length?this.banner.slides[0]:this.banner.slides[c+1]},SlideDisplay.prototype.getPrevSlide=function(a){a||(a=this);var b=this.banner.slides,c=b.indexOf(a);return c-1<0?this.banner.slides[this.banner.slides.length-1]:this.banner.slides[c-1]},SlideDisplay.prototype.getFirstSlide=function(){return this.banner.slides[0]},SlideDisplay.prototype.getLastSlide=function(){return this.banner.slides[this.banner.slides.length-1]},SlideDisplay.prototype.playSlideAnimation=function(a){ clearTimeout(this._buildOutTimeout);var b,c,d=this.getAnimationEl(),e=this,f=this.displayData.properties,g=this.banner.lastSlide?this.banner.lastSlide.container:null,h=this.banner.slides.length,i=0;for(b=0;b1?(this.addClass(this.container,"buildin"),i=parseFloat(a.duration)||0,g&&(g.style.display=""),"hide"!==a.crosstype?window.eff.animate(d,a,"buildIn"):g&&(g.style.zIndex="2"),setTimeout(function(){e.removeClass(e.container,"buildin"),e.trigger("buildInEnd")},1e3*a.duration)):this.trigger("buildInEnd"),f.stopSlide||this.banner.showOnlyOneSlide||(this._buildOutTimeout=setTimeout(function(){e.buildOut()},1e3*(i+f.duration))),!this.banner.noAnimation)for(b=0;b1){if(d.addClass(d.container,"buildout"),"show"!==c.crosstype){var f=eaUtils.cloneObject(c);window.eff.animate(this.getAnimationEl(),f,"buildOut")}e=setTimeout(function(){d.banner.currentSlide!==d&&(d.container.style.display="none"),d.removeClass(d.container,"buildout"),d.trigger("buildOutEnd")},1e3*c.duration)}else d.trigger("buildOutEnd");a||(a=this.getNextSlide()),a===this&&e&&(clearTimeout(e),d.removeClass(d.container,"buildout"),d.trigger("buildOutEnd")),void 0!==this.banner.properties.loopCount&&(this.banner.loopsPlayed<=this.banner.properties.loopCount||this.banner.properties.loopCount===this.LOOP_COUNT_FOREVER)?d.isLastSlide()?(++this.banner.loopsPlayed<=this.banner.properties.loopCount||this.banner.properties.loopCount===this.LOOP_COUNT_FOREVER)&&a.play(eaUtils.cloneObject(c)):a.play(eaUtils.cloneObject(c)):void 0===this.banner.properties.loopCount&&a.play(eaUtils.cloneObject(c))},SlideDisplay.prototype.getBuildOutTime=function(){var a=this.displayData.properties.transition;return a&&"none"!==a.type?1e3*a.duration:0},SlideDisplay.prototype.getSlideByHashOrId=function(a){if(!a)return!1;for(var b=this.banner.slides,c=0;c