!function(){"use strict";(window.$sf?window.onetAds:parent.onetAds).registerTemplate(function(){return{tplCode:"1746213/Banner-Standard",renderAd:function(i,d,l){var t={};function s(t,e){return!!t.className.match(new RegExp("(\\s|^)"+e+"(\\s|$)"))}t.banner=d._.template("<% if(!_.isEmpty(click)){ %> ', '_blank');\" target=\"<% (typeof target === 'undefined') ? print('_blank') : print(target) %>\" style=\"display: block; outline:none; text-decoration: none; cursor: pointer;\"> <% } %> \" width=\"<% (typeof width === 'undefined') ? print('100%') : print(width) %>\" height=\"<% (typeof height === 'undefined') ? print('100%') : print(height) %>\" style=\"display: block;\" alt=\"\" onload=\"imageLoaded(this);\"/> <% if(!_.isEmpty(click)) print('') %>"),t.iframe=d._.template(''),l.parent.dlAds=l.parent.dlAds||{},l.parent.dlAds.registerAd=l.parent.dlAds.registerAd||function(t){if(this.ads||(this.ads={}),!this.ads[t.adid]){this.ads[t.adid]=t;var i=this;try{this.messageListener||(l.parent.addEventListener("message",function(t){try{var e=JSON.parse(t.data.replace(/'/g,'"'));"all"===e.crid?l.parent.onetAds._.each(i.ads,function(t){t.postCallback(e.action,e.vars)}):i.ads[e.crid]&&i.ads[e.crid].postCallback(e.action,e.vars)}catch(t){}}),this.messageListener=!0)}catch(t){d.logError(t)}}},l.parent.dlAds.getAd=l.parent.dlAds.getAd||function(t){return!!(t&&this.ads&&this.ads[t])&&this.ads[t]},l.DlAdsConstructor=function(t,e,i,s){this.adutils=t,this.meta=e,this.ad=i,this.site=this.getSite(),this.conf=this.parseAdID(),this.adid=this.conf.creation,this.slot=this.ad.getSlot&&this.ad.getSlot()&&this.ad.getSlot().div,this.postMessages=[],this.dlAds=s,l.parent.dlAds.registerAd(this)},l.DlAdsConstructor.prototype.parseAdID=function(){var t=this.meta.adid.split(",")[0],e=this.meta.adid.split(",")[1],i=this.meta.adid.split(",")[2];return{system:t,campaign:e,creation:"adbeta"===t?"adbeta"+Date.now():i}},l.DlAdsConstructor.prototype.sendPostMessage=function(t){var e;t&&(e=t.iframe,d._.defaults(t,{crid:this.adid}),delete t.iframe,(e&&e.contentWindow||window.top).postMessage(JSON.stringify(t).replace(/"/g,"'"),"*"))},l.DlAdsConstructor.prototype.onPostMessage=function(t,e){void 0===this.postMessages[t]&&"function"==typeof e&&(this.postMessages[t]=e)},l.DlAdsConstructor.prototype.postCallback=function(e,t){try{this.postMessages[e].apply(this,[t])}catch(t){this.logger.warn("Callback for event: "+e+" not set","info")}},l.DlAdsConstructor.prototype.getSite=function(){return this.adutils.site.toLowerCase().replace("rasp_","")},l.DlAdsConstructor.prototype.isMobile=function(){return/^rasp_m|m_/.test(this.getSite(this.adutils))},l.DlAdsConstructor.prototype.getArea=function(){return this.adutils.area.toLowerCase()},l.DlAdsConstructor.prototype.generateHtmlClick=function(t){var e,i="";for(e in t)i+=t[e]?"&"+e+"="+encodeURIComponent(this.getClick(t[e])):"";return i.slice(1)},l.DlAdsConstructor.prototype.getClick=function(t){return t?this.meta.adclick+t:""},l.DlAdsConstructor.prototype.generateIframeName=function(t){t={adid:this.adid,clicks:t||"",adclick:this.meta.adclick};return JSON.stringify(t).replace(/"/g,"'")},l.DlAdsConstructor.prototype.logger={success:function(t){},info:function(t){},error:function(t){},warn:function(t){}},l.DlAdsConstructor.prototype.getSlotId=function(){return this.slot},l.DlAdsConstructor.prototype.addWatchToElement=function(t){var e=this,t=t||this.slot;if(!t)throw this.adutils._.template("[<%= tplCode %>] - slot: <%= slot %> failed!",{tplCode:this.ad.tplCode,slot:t});if(this.visibility=d.watchVisibility({elId:t}),!this.visibility)throw this.adutils._.template("[<%= tplCode %>] - add watch to slot: <%= slot %> failed!",{tplCode:this.ad.tplCode,slot:t});this.visibility.on("visible",function(){e.sendNotificationToVisibilityWatchers("visible")}),this.visibility.on("hidden",function(){e.sendNotificationToVisibilityWatchers("hidden")})},l.DlAdsConstructor.prototype.removeVisibilityWatcher=function(t){-1!==d._.indexOf(this.visibilityWatchers,t)&&(this.visibilityWatchers=d._.without(this.visibilityWatchers,t))},l.DlAdsConstructor.prototype.sendNotificationToVisibilityWatchers=function(e){this.visibilityWatchers&&d._.each(this.visibilityWatchers,function(t){t(e)})},l.DlAdsConstructor.prototype.receiveVisibilityState=function(t,e){if(!this.visibility)try{this.addWatchToElement(e)}catch(t){this.logger.error(t),this.adutils.logDebug(t)}if(this.visibilityWatchers||(this.visibilityWatchers=[]),!d._.isFunction(t))return this.logger.warn("Watcher must be a function!");this.visibilityWatchers.push(t)},l.DlAdsConstructor.prototype.getVisibilityState=function(){return this.visibility?this.visibility.state:null},l.DlAdsConstructor.prototype.sendLayerStatus=function(e){d._.each(this.dlAds.ads,function(t){"function"==typeof t.changeLayerVisibilityState&&t.changeLayerVisibilityState(e)})},l.DlAdsConstructor.prototype.getLayerStatus=function(){return this.layerStatus||"hidden"},l.DlAdsConstructor.prototype.setLayerVisibilityWatcher=function(t){if(!d._.isFunction(t))return this.logger.warn("setLayerVisibilityWatcher argument must be a function!");this.layerCallback=t,this.layerCallback(this.getLayerStatus())},l.DlAdsConstructor.prototype.changeLayerVisibilityState=function(t){t!==this.layerStatus&&d._.isFunction(this.layerCallback)&&(this.layerStatus=t,this.layerCallback(t))},l.DlAdsConstructor.prototype.embedGde=function(t){var e=this.helpers.isElement(t.contener,l)?l:!!this.helpers.isElement(t.contener,l.parent)&&l.parent;try{if(!e)throw this.adutils.logDebug("GDE param.contener must be an HTML DOM Node inside win or win.parent"),"GDE param.contener must be an HTML DOM Node iside win or win.parent";var i,s=["gde_domena","gde_id","gde_stparam","gde_inscreen","gde_fastid"];for(i in t)if(-1!==s.indexOf(i)&&t.hasOwnProperty(i)&&!t[i])throw this.adutils.logDebug(this.adutils._.template("[<%= adid %>] - GDE param: <%= i %> is undefined",{adid:this.adid,i:i})),"GDE param: "+i+" is undefined";var n,r=[["hit",t.gde_domena,t.gde_id,t.gde_stparam,t.gde_fastid],["viewable",t.gde_domena,t.gde_id,t.gde_inscreen,"_gde_isndwl_"+t.gde_inscreen]],a=["viewableConfig"],o=this.helpers.createElement("i",{style:"display: none !important; visibility: hidden !important",id:"_gde_isndwl_"+t.gde_inscreen},e.document);t.contener.appendChild(o),t.gde_custom&&(n=this.helpers.createElement("i",{style:"display: none !important; visibility: hidden !important",id:"_gde_isndwl_"+t.gde_inscreen+"-custom"},e.document),t.contener.appendChild(n),r.push(["viewable",t.gde_domena,t.gde_id,t.gde_custom,"_gde_isndwl_"+t.gde_inscreen+"-custom"])),t.gde_custom&&a.push("_gde_insdwl_"+t.gde_inscreen+"-custom"),t.gde_delay&&!isNaN(parseInt(t.gde_delay,10))&&a.push("delay",parseInt(t.gde_delay,10)),t.gde_duration&&!isNaN(parseInt(t.gde_duration,10))&&a.push("duration",parseInt(t.gde_duration,10)),t.gde_threshold&&!isNaN(parseFloat(t.gde_threshold))&&a.push("threshold",parseFloat(t.gde_threshold.replace(",","."))),r.push(a),t.gde_nc&&r.push(["nc",t.gde_nc]),t.gde_cmp&&r.push(["cmp","true"===t.gde_cmp]),e._gdeaq=(e._gdeaq||[]).concat(r),d.addScript("//"+t.gde_domena+".hit.gemius.pl/gdejs/xgde.js",e.document)}catch(t){}},l.DlAdsConstructor.prototype.helpers={getClosest:function(t,e){for(var i=e.charAt(0);t&&t!==document;t=t.parentNode){if("."===i&&this.hasClass(t,e.substr(1)))return t;if("#"===i&&t.id===e.substr(1))return t;if("["===i&&t.hasAttribute(e.substr(1,e.length-2)))return t;if(t.tagName.toLowerCase()===e)return t}return!1},createElement:function(t,e,i){var s,n=(i=i||document).createElement(t);for(s in e)"style"===s?n.setAttribute(s,e[s]):n[s]=e[s];return n},addEvent:function(t,e,i){t.addEventListener?t.addEventListener(e,i,!1):t.attachEvent&&htmlEvents["on"+e]?t.attachEvent("on"+e,i):t["on"+e]=i},removeEvent:function(t,e,i){t.removeEventListener?t.removeEventListener(e,i,!1):t.detachEvent&&htmlEvents["on"+e]?t.detachEvent("on"+e,i):t["on"+e]=null},hasClass:s,addClass:function(t,e){var i;"string"!=typeof e||(i=t.className+" "+e,s(t,e))||(t.className=i.trim())},removeClass:function(t,e){"string"==typeof e&&s(t,e)&&(e=new RegExp("(\\s|^)"+e+"(\\s|$)"),t.className=t.className.replace(e," ").trim())},replaceClass:function(t,e,i){s(t,e)&&!s(t,i)&&(e=new RegExp("(\\s|^)"+e+"(\\s|$)"),t.className=t.className.replace(e," "+i+" ").trim())},isElement:function(e,t){try{return e instanceof t.HTMLElement}catch(t){return"object"==typeof e&&1===e.nodeType&&"object"==typeof e.style&&"object"==typeof e.ownerDocument}}};var e=new l.DlAdsConstructor(d,i.meta,i,l.parent.dlAds),n=i.meta.width,r=i.meta.height,a=i.meta.width/i.meta.height,o=l.parent.document.getElementById(i.getSlot().div),c=i.fields.responsive&&"tak"===i.fields.responsive.toLowerCase(),h=i.fields.creativeBorder&&"tak"===i.fields.creativeBorder,p=i.fields.borderColor;if(o||"adtpl"!==e.site||(o=parent.document.body),c){d.addCss("html,body {width:100%; height: 100%;}",l.document),e.onPostMessage("creation_ready",function(t){"0"!==t.responsive&&(n=parseFloat(t.width),r=parseFloat(t.height),m())}),l.frameElement.style.width="1px",l.frameElement.style.minWidth="100%",l.frameElement.style.border="0px",l.frameElement.style.verticalAlign="bottom";var u=/(max-)?width\s?:\s?\d*(px|%)?;?/i;if(u.exec(o.getAttribute("style")))try{var g=o.getAttribute("style").replace(u,"");o.setAttribute("style",g)}catch(t){}u=o.querySelector(".ad_wrapper, .ad_adInfo-nativeSlot-parent");u&&(frameElement.parentNode.style.width="100%",u.style.width="100%"),e.helpers.addEvent(l,"resize",m)}function m(){var t=c?"100%":i.meta.width,e=c?o.clientWidth/a:i.meta.height;i.setContainerSize(t,e),y&&(y.height=e+"px")}function f(){var t=document.createElement("div");t.style.border="1px solid "+p,t.style.position="absolute",t.style.top="0px",t.style.boxSizing="border-box",t.style.width="100%",t.style.height="100%",t.style.pointerEvents="none",l.document.body.appendChild(t)}var g=i.fields,u={click:g.click||"",click1:g.click1||"",click2:g.click2||"",click3:g.click3||"",click4:g.click4||""},y=null;parseInt(i.meta.width),parseInt(i.meta.height);if(l.imageLoaded=function(t){n=t.naturalWidth,r=t.naturalHeight,a=n/r,m()},d.addCss("body > iframe {border: 0;border-image-width:0;}",l.document),g.urlHtml5){var _=e.generateHtmlClick(u);(y=e.helpers.createElement("div",{innerHTML:t.iframe({src:g.urlHtml5+(_?"#":"")+_,width:i.meta.width,height:i.meta.height,name:e.generateIframeName(u)})}).querySelector("iframe"))&&c&&(y.setAttribute("width","100%"),y.style.width="1px",y.style.minWidth="100%",y.style.border="0px"),h&&f(),l.document.body.appendChild(y),m(),"dfp"!==e.conf.system&&"adbeta"!==e.conf.system||(e.onPostMessage("action_measure",function(t){var e=t.action;delete t.action,i.event.fire(e,t)}),e.receiveVisibilityState(b),e.setLayerVisibilityWatcher(b))}else{if(!g.image)throw"[Banner-Standard] - creation not fonud!";h&&f(),l.document.body.appendChild(e.helpers.createElement("div",{innerHTML:t.banner({click:!!g.click&&e.getClick(g.click),image:g.image,width:c?"100%":i.meta.width,height:c?"auto":i.meta.height})}).querySelector("*")),m()}function b(t){t&&(e.sendPostMessage({iframe:y,action:t}),e.logger.info("Creation in slot "+e.slot+" is: "+t))}return e.embedGde({contener:l.document.body,gde_domena:g.gde_subdomena,gde_id:g.gde_id,gde_stparam:g.gde_stparam,gde_inscreen:g.gde_inscreen,gde_fastid:g.gde_fastid,gde_delay:i.fields.gde_delay,gde_duration:i.fields.gde_duration,gde_threshold:i.fields.gde_threshold,gde_nc:i.fields.gde_nc,gde_cmp:i.fields.gde_cmp,gde_custom:i.fields.gde_custom}),l.document.body.style.margin=0,i.fields.impressionActiveview&&(_=e.helpers.createElement("script",{src:i.fields.impressionActiveview,async:"async"},l.parent.document),l.frameElement.parentNode.appendChild(_)),!0}}})}();
//# sourceMappingURL=tpl.min.js.map