"use strict";var _typeof=typeof Symbol==="function"&&typeof Symbol.iterator==="symbol"?function(a){return typeof a}:function(a){return a&&typeof Symbol==="function"&&a.constructor===Symbol&&a!==Symbol.prototype?"symbol":typeof a};var _createClass=function(){function a(e,c){for(var b=0;b1&&arguments[1]!==undefined?arguments[1]:document.head;var E=arguments.length>2&&arguments[2]!==undefined?arguments[2]:{};var H=document.createElement("iframe");Object.keys(E).forEach(function(I){H[I]=E[I]});F.appendChild(H);if(G){H.contentWindow.document.open();H.contentWindow.document.write(G);H.contentWindow.document.close()}}},{key:"createInvisibleIframe",value:function o(){var E=document.createElement("iframe");E.id=Math.random().toString(16).substr(2);E.height=0;E.width=0;E.border="0px";E.hspace="0";E.vspace="0";E.marginWidth="0";E.marginHeight="0";E.style.border="0";E.scrolling="no";E.frameBorder="0";E.src="about:blank";E.style.display="none";return E}},{key:"createScriptTag",value:function v(H,F,E){H=typeof H!=="undefined"?H:false;F=typeof F!=="undefined"?F:false;E=typeof E!=="undefined"?E:false;var G=document.createElement("script");if(H){G.src=H}if(F){G.innerHTML=F}if(E){G.async=true}return G}},{key:"pushTagToTag",value:function e(E,F){F.appendChild(E)}},{key:"pushScriptTagToHead",value:function p(H,G,F){var E=q.createScriptTag(H,G,F);q.pushTagToTag(E,document.head)}},{key:"buildQueryStringFromParams",value:function D(F){for(var E in F){if(F.hasOwnProperty(E)){if(!F[E]){delete F[E]}}}return Object.keys(F).map(function(G){return G+"="+F[G]}).join("&")}},{key:"kmn_ts",value:function h(){return new Date().getTime()}},{key:"url_with_querystring",value:function C(E){var G=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{};var F="?";Object.keys(G).forEach(function(H){F+=encodeURIComponent(H)+"="+encodeURIComponent(G[H])+"&"});return E+F.slice(0,-1)}},{key:"calcHash",value:function j(F,E){var G=JSON.stringify(F)+E;return q.hashCode(G)}},{key:"hashCode",value:function y(I){var H=0;if(I.length===0){return H}var E=I.length;for(var F=0;F0?H+"A":-H+"B"}},{key:"site_url",value:function t(){var F=window.location.href;var E=window.location.href;if(F.indexOf("javascript:window")!==-1||F.indexOf("about:blank")!==-1){try{F=window.parent.location.href}catch(G){F=E}}if(F.length>1024){F=F.replace(/([^:]+:\/\/[^/]+).*/,"$1")}return F}},{key:"setAttributes",value:function z(F,E){try{Object.keys(E).forEach(function(H){F.setAttribute(H,E[H])});return F}catch(G){return F}}},{key:"extend",value:function B(){var E={};for(var F=arguments.length,G=Array(F),H=0;H0){G.forEach(function(I){Object.keys(I).forEach(function(J){E[J]=E[J]||I[J]})})}return E}},{key:"spark",value:function A(H){try{var E=this.extend({v:kmn_hb_options.v,cb:kmn_cb,ds:document.readyState},H);E.d=this.site_url();this.log("sprk"+JSON.stringify(E));var G=kmn_hb_options.baseUrlStatServer;kmn_cstat_kb.save(G,E);return E}catch(F){q.log("spark ERR:"+F.message)}}},{key:"isDebug",value:function x(){try{var I=0;var F=window.location.href;var E=F.slice(F.indexOf("?")+1).split("&");for(var G=0;G3&&arguments[3]!==undefined?arguments[3]:false;if(I){var F=H.slice(-1);H.slice(0,-1).forEach(function(J){I[J]=I[J]||{};I=I[J]});I[F]=typeof I[F]!=="undefined"&&!E?I[F]:G}}},{key:"filterObj",value:function k(F,E){return Object.keys(F).filter(E).reduce(function(H,G){return H[G]=F[G],H},{})}},{key:"isLocalStorageUsable",value:function c(){return q.isStorageUsable("localStorage")}},{key:"isSessionStorageUsable",value:function u(){return q.isStorageUsable("sessionStorage")}},{key:"isStorageUsable",value:function a(F){if(typeof Storage!=="undefined"&&typeof window[F]!=="undefined"){var E="test";try{window[F].setItem(E,E);window[F].removeItem(E);return true}catch(G){}}return false}},{key:"addIfExists",value:function g(G,E,F){var H=arguments.length>3&&arguments[3]!==undefined?arguments[3]:F;if(typeof E[F]!=="undefined"){G[H]=E[F]}}},{key:"mAddIfExists",value:function r(G,E,F){F.forEach(function(H){return q.addIfExists(G,E,H)})}}]);return q}();var kmn_hb_options=KmnUtils.extend(window.kmn_hb_options||{},{debugMode:false,kmn_sa_use_option:false,prebidTimeout:window.PREBID_TIMEOUT||1000,v:"2.0.27",cdnMode:true,cdnKbVersion:"0.1",baseCdnUrl:"//s.komoona.com/kb/",maxBid:1000,minBid:0.011,minBidForCounters:0.011,saveCachedBids:true,baseUrlHbServer:"//hb.komoona.com",baseUrlS2S:"//s2s.komoona.com",baseUrlStatServer:"//stat.komoona.com/s",kmn_sa_url:"//cdn.komoona.com/scripts/kmn_sa.js",kmn_sa_options:{}});(function setCdnResponseIfItExists(a){if(a!=="$$HB CONF$$".replace(" ","_")){kmn_hb_options.cdnResponse=a}})({"data_ver":"0.1","kbidder_configs":[{"rules":[{"ruletype":"device","negate":true,"rulevalues":["mobile"]}],"value":{"hdbddata":[{"network":"sovrn","is_s2s":false,"adslots":[{"placement":"04b183dcfbec8dd77e1d45527fedcf1c","code":"S1","config":{"ssp_placementid":"511006","height":"600","width":"300"}},{"placement":"2f85eff0ca3e85a84473681c0e113cbe","code":"S1","config":{"ssp_placementid":"401684","height":"250","width":"300"}},{"placement":"637cd3ca635bf765f19ce5b27f640d38","code":"S1","config":{"ssp_placementid":"511007","height":"250","width":"970"}},{"placement":"aefc11cded81cc84253be10754295f3f","code":"S2","config":{"ssp_placementid":"445595","height":"90","width":"728"}},{"placement":"b971516498690bb003a2bbebd47b7b06","code":"S2","config":{"ssp_placementid":"445612","height":"250","width":"300"}},{"placement":"c809ad0ae9bf3180149cf837f83fae83","code":"S1","config":{"ssp_placementid":"401677","height":"600","width":"160"}},{"placement":"fcd19038264e801eb5b2f323e6a54caa","code":"S1","config":{"ssp_placementid":"401679","height":"90","width":"728"}}]},{"network":"pubmatic","is_s2s":true,"adslots":[{"placement":"04b183dcfbec8dd77e1d45527fedcf1c","code":"p1","config":{"key":"findagrave_V73C_300x600@300x600","account":"156262","is_s2s":true}},{"placement":"19b20b1bd7025586dddaf0a7cc1e9e3c","code":"p1","config":{"key":"findagrave_DJGS_320x50@320x50","account":"156262","is_s2s":true}},{"placement":"2f85eff0ca3e85a84473681c0e113cbe","code":"p6","config":{"key":"findagrave_0N0M_300x250@300x250","account":"156262","is_s2s":true}},{"placement":"520ed652e5f0e91c28d942d8e854530d","code":"p1","config":{"key":"findagrave_5O8V_320x50@320x50","account":"156262","is_s2s":true}},{"placement":"637cd3ca635bf765f19ce5b27f640d38","code":"p1","config":{"key":"findagrave_LZ5J_970x250@970x250","account":"156262","is_s2s":true}},{"placement":"aefc11cded81cc84253be10754295f3f","code":"p2","config":{"key":"findagrave_QKAX_728x90@728x90","account":"156262","is_s2s":true}},{"placement":"b971516498690bb003a2bbebd47b7b06","code":"p2","config":{"key":"findagrave_XO9J_300x250@300x250","account":"156262","is_s2s":true}},{"placement":"c809ad0ae9bf3180149cf837f83fae83","code":"p4","config":{"key":"findagrave_EZ2D_160x600@160x600","account":"156262","is_s2s":true}},{"placement":"f7016c7f6b549ad3a163a4b01f11eb7f","code":"p1","config":{"key":"findagrave_6H2V_728x90@728x90","account":"156262","is_s2s":true}},{"placement":"fcd19038264e801eb5b2f323e6a54caa","code":"p6","config":{"key":"findagrave_7X7J_728x90@728x90","account":"156262","is_s2s":true}}]},{"network":"cpx","is_s2s":false,"adslots":[{"placement":"2f85eff0ca3e85a84473681c0e113cbe","code":"l1","config":{"ssp_placementid":"10041429","size":"300x250"}},{"placement":"fcd19038264e801eb5b2f323e6a54caa","code":"l1","config":{"ssp_placementid":"10041428","size":"728x90"}}]}],"hblogic":{"placementsLogic":{"04b183dcfbec8dd77e1d45527fedcf1c":{"width":"300","height":"600","a":0.583,"c":0,"fl":{"config":{},"codes":[{"code":"p1","sample":0.01,"methods":{"npc":{"npcc":100,"npcth":0},"npr":{"active":true}}},{"code":"S1","methods":{"npc":{"npcc":25,"npcth":0}}}]}},"19b20b1bd7025586dddaf0a7cc1e9e3c":{"width":"320","height":"50","a":0.709,"c":0,"fl":{"config":{},"codes":[{"code":"p1","sample":0.01,"methods":{"npc":{"npcc":100,"npcth":0},"npr":{"active":true}}}]}},"2f85eff0ca3e85a84473681c0e113cbe":{"width":"300","height":"250","a":0.636,"c":0,"fl":{"config":{},"codes":[{"code":"l1","sample":0.01,"methods":{"npc":{"npcc":100,"npcth":0},"npr":{"active":true}}},{"code":"p6","sample":0.01,"methods":{"npc":{"npcc":100,"npcth":0},"npr":{"active":true}}},{"code":"S1","methods":{"npc":{"npcc":25,"npcth":0}}}]}},"520ed652e5f0e91c28d942d8e854530d":{"width":"320","height":"50","a":0.77,"c":0,"fl":{"config":{},"codes":[{"code":"p1","methods":{"npc":{"npcc":100,"npcth":0}}}]}},"637cd3ca635bf765f19ce5b27f640d38":{"width":"970","height":"250","a":0.78,"c":0,"fl":{"config":{},"codes":[{"code":"p1","methods":{"npc":{"npcc":100,"npcth":0}}},{"code":"S1","methods":{"npc":{"npcc":25,"npcth":0}}}]}},"aefc11cded81cc84253be10754295f3f":{"width":"728","height":"90","a":0.639,"c":0,"fl":{"config":{},"codes":[{"code":"p2","methods":{"npc":{"npcc":100,"npcth":0}}},{"code":"S2","methods":{"npc":{"npcc":25,"npcth":0}}}]}},"b971516498690bb003a2bbebd47b7b06":{"width":"300","height":"250","a":0.5,"c":0,"fl":{"config":{},"codes":[{"code":"S2","sample":0.01,"methods":{"npc":{"npcc":25,"npcth":0},"npr":{"active":true}}},{"code":"p2","sample":0.01,"methods":{"npc":{"npcc":100,"npcth":0},"npr":{"active":true}}}]}},"c809ad0ae9bf3180149cf837f83fae83":{"width":"160","height":"600","a":0.67,"c":0,"fl":{"config":{},"codes":[{"code":"S1","methods":{"npc":{"npcc":25,"npcth":0}}},{"code":"p4","sample":0.01,"methods":{"npc":{"npcc":100,"npcth":0},"npr":{"active":true}}}]}},"f7016c7f6b549ad3a163a4b01f11eb7f":{"width":"728","height":"90","a":0.755,"c":0,"fl":{"config":{},"codes":[{"code":"p1","methods":{"npc":{"npcc":100,"npcth":0}}}]}},"fcd19038264e801eb5b2f323e6a54caa":{"width":"728","height":"90","a":0.632,"c":0,"fl":{"config":{},"codes":[{"code":"S1","methods":{"npc":{"npcc":25,"npcth":0}}},{"code":"l1","sample":0.01,"methods":{"npc":{"npcc":100,"npcth":0},"npr":{"active":true}}},{"code":"p6","sample":0.01,"methods":{"npc":{"npcc":100,"npcth":0},"npr":{"active":true}}}]}}},"cid":"d3a4f6054e5fea811efdbf3a0f720398","rb":{"rate":0.25},"domain":"findagrave.com","fl":{"active":true,"methods":{"ts":{"level":2,"config":{"tsth":4000}},"npr":{"level":2,"config":{}},"npc":{"level":2,"config":{}},"gf":{"level":2,"config":{}},"qf":{"level":2,"config":{}}}},"cm":{"pubmatic":0.6,"cpx":0.8}}}}]});function KmnCstatKb(){this.createScriptElement=function(e,d){var c=document.createElement("script");var b=KmnUtils.extend(d||{},{src:e,async:true,type:"text/javascript"});if(b.hasOwnProperty("text")){c.text=b.text;delete b.text;delete b.src}KmnUtils.setAttributes(c,b);return c};this.async_js=function(d,c){try{var b=this.createScriptElement(d,c);var f=document.getElementsByTagName("head")[0];if(f){f.appendChild(b)}return b}catch(g){KmnUtils.log("async_js ERR:"+g.message)}};this.url_with_querystring=function a(b){var d=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{};var c="?";Object.keys(d).forEach(function(e){c+=encodeURIComponent(e)+"="+encodeURIComponent(d[e])+"&"});return b+c.slice(0,-1)};this.save=function(b,c){try{var d=this.url_with_querystring("",c).substring(1);var j=this;var g={success:function i(l){try{KmnUtils.log("xhr success["+l+"]");var m=l.indexOf("*/");var o=m===-1?l:l.substring(m+2);if(o.length>0){j.async_js(null,{text:o})}}catch(n){KmnUtils.log(n.message)}},error:function h(l,n){try{KmnUtils.log("xhr error["+l+"]status["+n.status+"]");j.bck(b,KmnUtils.extend(c||{},{bck:true,xhr:n.status,res:l}))}catch(m){KmnUtils.log(m.message)}}};var k={method:"POST",withCredentials:true,contentType:"application/x-www-form-urlencoded"};this.ajax(b,g,d,k)}catch(f){KmnUtils.log(f)}};this.bck=function(c,g){try{var f=this.url_with_querystring(c,g);var b=this.async_js(f,{});KmnUtils.log("bck ["+f+"]");b.onload=b.onreadystatechange=function(){var e=b.readyState;if(!e||e==="loaded"||e==="complete"){b.onload=b.onreadystatechange=null;if(b.parentNode){b.parentNode.removeChild(b)}}};return b}catch(d){}};this.ajax=function(d,g,e){var k=arguments.length>3&&arguments[3]!==undefined?arguments[3]:{};try{var f=4;var h=3000;var c=false;var b=k.method||(e?"POST":"GET");var j=void 0;if(!window.XMLHttpRequest){c=true}else{j=new window.XMLHttpRequest();if(j.responseType===undefined){c=true}}if(c){j=new window.XDomainRequest();j.onload=function(){g.success(j.responseText,j)};j.onerror=function(){g.error("error",j)};j.ontimeout=function(){g.error("timeout",j)}}else{j.onreadystatechange=function(){if(j.readyState===f){var l=j.status;if(l>=200&&l<300||l===304){g.success(j.responseText,j)}else{g.error(j.statusText,j)}}}}j.open(b,d);j.timeout=h;if(!c){if(k.withCredentials){j.withCredentials=true}if(k.preflight){j.setRequestHeader("X-Requested-With","XMLHttpRequest")}j.setRequestHeader("Content-Type",k.contentType||"text/plain")}j.send(b==="POST"&&e)}catch(i){KmnUtils.log("xhr ["+i+"]")}}}if(!window.kmn_cstat_kb){window.kmn_cstat_kb=new KmnCstatKb()}var KmnKB=function(){function k(A,z,y){var w=arguments.length>3&&arguments[3]!==undefined?arguments[3]:window.pbjs;_classCallCheck(this,k);if(w){w.kmnHdbdHandlers={};var x="";this.hdbdid=A;this.hb_placements=z;this.globalPbjsObject=w;this.kmn_bids_logic=y;if(!kmn_hb_options.cdnResponse){if(kmn_hb_options.cdnMode){x=kmn_hb_options.baseCdnUrl+kmn_hb_options.cdnKbVersion+"/"+A+".js"}else{x=kmn_hb_options.baseUrlHbServer+"/hdbd/id/"+A+"?callback=kmn_hdbd.kmnHdbdCb&cb="+kmn_cb+"&placements="+this.hb_placements.toString()}KmnUtils.log("dbg: Call hb server/cdn : "+x);KmnUtils.pushScriptTagToHead(x)}}else{KmnUtils.log("ERROR: no pbjs on page (might be using a different name which was not passed in)");KmnUtils.spark({err:"noPbjs@ctor"})}}_createClass(k,[{key:"getBidstore",value:function d(){return this.kmn_bids_logic.getBidstore()}},{key:"kmnHdbdCdnCb",value:function p(w){var x=w.kbidder_configs[0].value;if(w.kbidder_configs.length>1){(function(){var z=KmnUtils.detectMobile();var A=0;var B=false;var C=function C(){var D=0;var E=w.kbidder_configs[A];while(D0});return w}},{key:"filterPlacementLogic",value:function i(x,w){return w.filter(function(y){return x[y]}).reduce(function(y,z){y[z]=x[z];return y},{})}},{key:"filterNetworkAdslots",value:function t(w){w.forEach(function(x){x.adslots=x.adslots.filter(function(y){return window.kmn_hdbd.hb_placements.some(function(z){return y.placement===z})})});return w}},{key:"kmnHdbdCb",value:function j(x){var z=this;try{KmnUtils.logIfNeededStringify("Got response from HB server:",x);this.kmn_bids_logic.addHdbdServerResponse(x);var w=this._gatherAllHdbdData(x.hdbddata);w.forEach(function(A){try{z._handleGatheredNetworkData(A)}catch(B){KmnUtils.spark({err:"hndlr@kmnHdbdCb",msg:B.message})}});this._useCachedBids()}catch(y){KmnUtils.spark({err:"tag@kmnHdbdCb",msg:y.message})}}},{key:"_handleGatheredNetworkData",value:function u(y){var x=this;var w=[];var z=[];if(y.adslots){y.adslots.forEach(function(B){var A=x.kmn_bids_logic.applyFilterToAdSlot(B);B.filtering=A;if(A.isFiltered){KmnUtils.log("Adslot is filtered out fl="+A.fl+" flr="+A.flr+" pl="+B.placement+" code="+B.code);w.push(B)}else{KmnUtils.log("Adslot is NOT filtered out fl="+A.fl+" pl="+B.placement+" code="+B.code);z.push(B)}})}if(z.length>0){y.adslots=z;this.createHdbdHandlers(y)}if(w.length>0){this.kmn_bids_logic.addRequestData(w)}}},{key:"_gatherAllHdbdData",value:function e(x){var z=x.filter(function(B){return !B.is_s2s});var A=x.filter(function(B){return B.is_s2s});var w=[];if(z.length>0){w=k.gatherRequestsNotS2S(z)}if(A.length>0){var y=k.gatherRequestsS2S(A);w.push(y)}return w}},{key:"_useCachedBids",value:function l(){var y=this;if(this.kmn_bids_logic.isBidCaching()){var x=this.loadBidsForReuse();var w=this;Object.keys(x).filter(function(z){return x[z]}).forEach(function(A){var z=y._getCachedBidForPlacement(A);if(z){KmnUtils.log("checkingToPrebid cachedBid, code="+z.code);w.kmn_bids_logic.CheckStoredBidToPrebid(z,A)}})}}},{key:"_getCachedBidForPlacement",value:function m(z){var w=null;if(this.getBidstore()){var x=this.getBidstore().getBidstoreDataForPlacement(z);if(x){var y=Object.keys(x).filter(function(A){return x[A].rb});if(y.length===1){w=x[y[0]]}else{if(y.length>1){KmnUtils.spark({err:"tooMany@rb"})}}}}return w}},{key:"saveBidsForReuse",value:function r(w){try{if(!(w.constructor===Array)){return}var x=[];w.forEach(function(A){var z=ReuseBid.addParamsForReuse(A);x.push(z)});ReuseBid.saveBidsToStorage(x)}catch(y){KmnUtils.spark({err:"error@saveBidsForReuse",msg:y.message})}}},{key:"loadBidsForReuse",value:function a(){try{var y=KmnUtils.kmn_ts();var C=ReuseBid.loadAllFromStorage();if(Object.keys(C).length>0){var x=this.kmn_bids_logic.getBidstorePlacementIds();C=ReuseBid.filterByPlacements(C,x);var A=10;C=ReuseBid.filterByTimePassed(C,ReuseBid.minSecsToReuseBid,A);var w=KmnUtils.kmn_ts()-y;KmnUtils.log("loadBidsForReuse: loading bids for reuse took "+w+" miliseconds");KmnUtils.logIfNeededStringify("Going to save the bids after converting them to bids store objects: ",C);var z=this.kmn_bids_logic.addReuseBidsData(C,w);return z}}catch(B){KmnUtils.spark({err:"error@loadBidsForReuse",msg:B.message})}return{}}},{key:"notifyBidUsed",value:function n(y,x){var w=false;try{KmnUtils.log("notifyBidUsed called to remove: "+x+" of placement "+y);var A=ReuseBid.loadAllFromStorage();var B=ReuseBid.deleteBidFromObject(A,y,x);if(B){ReuseBid.saveAllToStorage(B);w=true}}catch(z){KmnUtils.spark({err:"err@notifyBidUsed",msg:z.message})}return w}},{key:"handlersFactory",value:function c(y){var x=null;var w=y&&y.network_server?y.network_server:null;switch(w){case"pubmatic":x=kmnPubmaticHandler;break;case"cpx":case"defy":x=kmnApnHandler;break;case"sovrn":x=kmnSovrnHandler;break;case"openx":x=kmnOpenxHandler;break;case"s2s":x=kmnS2SHandler;break;case"rhythmone":x=kmnRhythmOneHandler;break;default:KmnUtils.log("Ignoring request to create unknown handler for "+w)}return x}},{key:"createHdbdHandlers",value:function q(z){if(z&&z.network_server){var y=this.handlersFactory(z);if(y!=null){var w=this;y.startHdbdRequests(z,function x(A,B){var C=A.id;w.globalPbjsObject.kmnHdbdHandlers[C]=A;KmnUtils.log("Added handler with id "+C);w.kmn_bids_logic.addRequestData(B)})}}}},{key:"saveHdbdHandlerResponseData",value:function v(x){var w=this.kmn_bids_logic.addResponseData(x);if(kmn_hb_options.saveCachedBids){this.saveBidsForReuse(w)}}}],[{key:"start",value:function f(x,w){window.kmn_cb=KmnUtils.generateCB();if(typeof x==="undefined"&&typeof window.kmn_hb_callback!=="undefined"){x={hdbdid:window.kmn_hbid,hb_placements:window.kmn_hb_placements,hb_placement_bidids:window.kmn_hb_placement_bidids,ts_as:window.kmn_ts_as,kb_callback:window.kmn_hb_callback,encode_bid:window.kmn_encode_bid}}if(typeof x!=="undefined"){window.kmn_bids_logic=KmnBidsLogic.start(x);window.kmn_hdbd=new k(x.hdbdid,x.hb_placements,window.kmn_bids_logic,w);KmnUtils.isDebug();KmnUtils.log("dbg: head: starting KmnKB with window params params: id ["+x.hdbdid+"], placements ["+x.hb_placements+"], callback ["+x.kb_callback+"]");if(kmn_hb_options.cdnResponse){KmnUtils.log("dbg: not calling cdn! config is already here");window.kmn_hdbd.kmnHdbdCdnCb(kmn_hb_options.cdnResponse)}}}},{key:"setFl",value:function s(w,x){if(w){ImpressionFilter.block(x)}else{ImpressionFilter.unblock()}}},{key:"cs",value:function g(y,w){var x="//cdn.komoona.com/sync/";var z=void 0;var A={};switch(y){case"p":z="//ads.pubmatic.com/AdServer/js/user_sync.html";A={p:"156262",predirect:w?"":x+y+"s?"+y+"="};break;default:KmnUtils.spark({err:"unk@cs",msg:y})}if(z&&document&&document.head){var B=KmnUtils.createInvisibleIframe();B.setAttribute("id","kmn_cs_"+y);B.src=KmnUtils.url_with_querystring(z,A);KmnUtils.pushTagToTag(B,document.head)}}},{key:"gatherRequestsNotS2S",value:function o(w){w.forEach(function(y){y.network_server=y.network;if(y.adslots){for(var x=0;x4&&arguments[4]!==undefined?arguments[4]:false;return{adslot:g,cpm:e,creative_data:h,bid_id:KmnUtils.calcHash(h,g.placement),network:g.network,error:d,isAuctioned:f}}}],[{key:"startHdbdRequests",value:function c(j,h){var g=this.splitDataToAdSlotsGroups(j);for(var f=0;f<\/script>';KmnUtils.createIframe(j)}},{key:"readHdbdResponse",value:function d(h){try{var i=this._apnResponseToBids(h);window.kmn_hdbd.saveHdbdHandlerResponseData(i)}catch(j){KmnUtils.spark({err:"tag@hb_readHdbdResponse_apn",msg:j.message})}}},{key:"_apnResponseToBids",value:function b(k){var i=this;var j=k&&k.result&&k.result.ad?[k.result]:[];KmnUtils.logIfNeededStringify(this.network+" callback->bidDetailsMap:",j);var h={network_server:this.network,bids:[]};if(!j||j.length===0){h.bids.push(this._buildBidObject(this.myadSlots[0],0,{},"no bids returned from "+this.network))}else{j.forEach(function(l){var m=i._buildBidObject(i.myadSlots[0],l.cpm/10000,{creative:l.ad});h.bids.push(m)})}return h}}],[{key:"splitDataToAdSlotsGroups",value:function e(i){KmnUtils.logIfNeededStringify("dbg: split function called with ",i);var h=[];if(i.adslots){i.adslots.forEach(function(j){KmnUtils.logIfNeededStringify("dbg : adslot is ",[j]);h.push([j])})}KmnUtils.log("dbg: "+JSON.stringify(h));return h}}]);return g}(kmnBaseHandler);var kmnSovrnHandler=function(c){_inherits(f,c);function f(){_classCallCheck(this,f);return _possibleConstructorReturn(this,(f.__proto__||Object.getPrototypeOf(f)).apply(this,arguments))}_createClass(f,[{key:"generateId",value:function a(i){return"sovrn"}},{key:"createHdbdRequest",value:function g(){KmnUtils.log("creating HDBD request to sovrn");var k="window.parent.kmn_hdbd.globalPbjsObject.kmnHdbdHandlers."+this.id+".readHdbdResponse";var n={id:this.id,imp:[],site:{domain:window.location.host}};for(var l=0;l<\/script>';KmnUtils.createIframe(o)}},{key:"isHttps",value:function h(){return document.location.protocol==="https:"}},{key:"readHdbdResponse",value:function b(k){try{var i=this._sovrnResponseToBids(k);window.kmn_hdbd.saveHdbdHandlerResponseData(i)}catch(j){KmnUtils.spark({err:"tag@hb_readHdbdResponse_sovrn",msg:j.message})}}},{key:"_sovrnResponseToBids",value:function e(o){KmnUtils.logIfNeededStringify("sovrn response to bids data: ",o);var j={network_server:"sovrn",bids:[]};var p={};if(o&&o.seatbid&&o.seatbid.length>0){o.seatbid.forEach(function(i){if(i.bid){i.bid.forEach(function(q){p[q.impid]=q})}})}for(var l=0;l";i+='