Created
June 15, 2016 17:45
-
-
Save arlipman/0e3f95bcea324f9eb9d806cc5b3fa45f to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| if(window && !window.tldr){ window.tldr = {}; }if(window && window.tldr && !window.tldr.write){ window.tldr.write = function(el){ window.tldr_write_element = el; }; }!function e(t,n,r){function i(o,c){if(!n[o]){if(!t[o]){var l="function"==typeof require&&require;if(!c&&l)return l(o,!0);if(a)return a(o,!0);var u=new Error("Cannot find module '"+o+"'");throw u.code="MODULE_NOT_FOUND",u}var s=n[o]={exports:{} };t[o][0].call(s.exports,function(e){var n=t[o][1][e];return i(n?n:e)},s,s.exports,e,t,n,r)}return n[o].exports}for(var a="function"==typeof require&&require,o=0;o<r.length;o++)i(r[o]);return i}({1:[function(e,t,n){!function(e){"use strict";e.console=e.console||{};for(var t,n,r=e.console,i={},a=function(){},o="memory".split(","),c="assert,clear,count,debug,dir,dirxml,error,exception,group,groupCollapsed,groupEnd,info,log,markTimeline,profile,profiles,profileEnd,show,table,time,timeEnd,timeline,timelineEnd,timeStamp,trace,warn".split(",");t=o.pop();)r[t]||(r[t]=i);for(;n=c.pop();)r[n]||(r[n]=a)}("undefined"==typeof window?this:window)},{}],2:[function(e,t,n){"use strict";var r=n.TLDR_EVENTS={previewClick:"previewClick",internalReady:"internalReady"},i=n.event_handlers={},a=n.fired_events=[],o=n.MessageBroker={on:function(e,t,n){e in r&&(i[e]||(i[e]=[]),i[e].push(t),n&&o.has_fired(e)&&t())},trigger:function(e,t){if(-1==a.indexOf(e)&&a.push(e),i[e])for(var n=i[e].length;n--;)i[e][n](t)},has_fired:function(e){return a.indexOf(e)>-1} } },{}],3:[function(e,t,n){(function(e){"use strict";function n(e,t){if(t=t||"tldr",e.substr(0,3)!==String.fromCharCode(42)+String.fromCharCode(123)+String.fromCharCode(123))return e;var n=r(),i=n?n.src:"";if(i.indexOf("?")>-1&&i.indexOf("ns=")>-1){var a=i.split("?")[1].split("&");for(var o in a){var c=a[o].split("="),l=c[0],u=c[1];if("ns"==l)return u} }return t}var r=function(){try{if(document.currentScript)return document.currentScript;var e=document.getElementsByTagName("SCRIPT");return e[e.length-1]}catch(t){return null} },i=n("tldr","tldr");e&&!e[i]&&(e[i]={}),t.exports=i}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],4:[function(e,t,n){(function(e){"use strict";function t(e){var t=/^\s*<!(?:\[CDATA\[|--)|(?:\]\]|--)>\s*$/g;return(e.text||e.textContent||e.innerHTML||"").replace(t,"")}function r(e){for(var n=e.querySelectorAll("script"),r=n.length,i=0;r>i;i++){var a=n[i],o=document.createElement("script");o.innerHTML=t(a);for(var c=a.attributes,l=c.length;l--;)o.setAttribute(c[l].name,c[l].value);a.parentNode.replaceChild(o,a)} }function i(e,t){e.contentWindow.postMessage({type:t},"*")}function a(e,t,n){function a(e,t,n){e.attachEvent?e.attachEvent(t,n):e.addEventListener(t,n)}function o(e,n){function i(e,t){var n="<style>"+t+"</style>";return n+'<div className="link-list"><a id="tldr-click-out" className="link-item" target="_blank" href="#"><div><span className="link-image"><img src="'+e.icon.url+'"></img></span><span className="link-text">'+e.Title+'</span><span className="link-description" style="display:none;">'+e.Description+'</span><span className="link-sponsor">InMobi</span></div></a></div>'}function o(e){return e.preventDefault(),s.reportAndHandleAdClick(),!1}function c(e){s=e;var r=document.getElementById("tldr-placement-"+t);r.innerHTML=i(e,n);var c=document.getElementById("tldr-click-out");a(c,"click",o)}function l(){var n=document.createElement("div");n.id="tldr-placement-"+t,d.parentNode.insertBefore(n,d);var r={siteid:e,onSuccess:c,onError:window.tldr.placement["nextProvider"+t]};window._inmobi.getNativeAd(n,r)}function u(){var e='<script src="http://cf.cdn.inmobi.com/ad/inmobi.js"></script>',t=document.createElement("div");document.head.appendChild(t),t.innerHTML=e,r(t);var n=setInterval(function(){window._inmobi&&(l(),clearInterval(n))},5)}var s;u()}function c(e){if(d.style.display="none","common"==e.data.provider)return s=document.createElement("div"),d.parentNode.insertBefore(s,d.nextSibling),s.innerHTML=e.data.tags,void r(s);if("inmobi"==e.data.provider)return o(e.data.tags,e.data.styling);if(-1==e.data.tags.indexOf("postrelease")||!window.PostRelease){if(s=document.createElement("div"),e.data.tags.indexOf("connatix")>-1){s.style.display="none",document.head.appendChild(s),window.addEventListener("connatix_no_content",function(n){try{var r=e.data.tags,i=n.connatixArgs.token;r.indexOf(i)>-1&&window.tldr.placement["nextProvider"+t]()}catch(a){} });var n=document.createElement("div");n.id="tldr-placement-"+t,d.parentNode.insertBefore(n,d)}else e.data.tags.indexOf("jsrdn")>-1?(s.style.display="none",document.head.appendChild(s)):d.parentNode.insertBefore(s,d);s.innerHTML=e.data.tags,r(s)}u="3lift"==e.data.provider?function(){for(var e=0;e<s.childNodes.length;e++){var t=s.childNodes[e];if("DIV"==t.nodeName)return t}return null}:function(){return document.querySelectorAll(e.data.selector)} }function l(r){if(r&&r.data&&r.data.type&&t==r.data.placement_id&&r.data.random_seed==n){if(f)return void i(d,"unload");switch(r.data.type){case"external-script-ad":return c(r);case"external-passback":return window.tldr.placement["nextProvider"+t]();case"tldr-collapse-ad":return document.getElementById(e).style.display="none"} } }var u=null,s=null,d=document.getElementById(e),f=!1;window.addEventListener("message",l),window.tldr||(window.tldr={}),window.tldr.placement=window.tldr.placement||{},window.tldr.placement.nextProvider=function(e){e=e||t;var n=window.tldr.placement["nextProvider"+e];n?n():console.error("Placement does not exist on page: "+e)},window.tldr.placement["nextProvider"+t]?f=!0:window.tldr.placement["nextProvider"+t]=function(){i(d,"unload"),d.style.display="block"} }var o={};e&&!e.tldrCrossWindowsStorage&&(e.tldrCrossWindowsStorage=!0,e.addEventListener("message",function(e){e&&e.data&&"storeValue"===e.data.kind&&(o[e.data.key]=e.data.value,e.source.postMessage({kind:"responseValue",id:e.data.id,value:e.data.value},"*")),e&&e.data&&"requestValue"===e.data.kind&&e.source.postMessage({kind:"responseValue",id:e.data.id,value:o[e.data.key]},"*")},!1));var c=n;c.PlacementProxy=a}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],5:[function(e,t,n){(function(t){"use strict";function r(e,t,n,o,c,l,u){var s=e.parentNode,d=2;return a(e)?9===s.nodeType?!0:"0"===i(e,"opacity")||"none"===i(e,"display")||"hidden"===i(e,"visibility")?!1:("undefined"!=typeof t&&"undefined"!=typeof n&&"undefined"!=typeof o&&"undefined"!=typeof c&&"undefined"!=typeof l&&"undefined"!=typeof u||(t=e.offsetTop,c=e.offsetLeft,o=t+e.offsetHeight,n=c+e.offsetWidth,l=e.offsetWidth,u=e.offsetHeight),s?"hidden"!==i(s,"overflow")&&"scroll"!==i(s,"overflow")||!(c+d>s.offsetWidth+s.scrollLeft||c+l-d<s.scrollLeft||t+d>s.offsetHeight+s.scrollTop||t+u-d<s.scrollTop)?(e.offsetParent===s&&(c+=s.offsetLeft,t+=s.offsetTop),r(s,t,n,o,c,l,u)):!1:!0):!1}function i(e,t){return l.getComputedStyle?document.defaultView.getComputedStyle(e,null)[t]:e.currentStyle?e.currentStyle[t]:void 0}function a(e){for(;e=e.parentNode;)if(e==document)return!0;return!1}var o=e("./namespace.js");t&&o&&!t[o]&&(t[o]={});var c=n,l=t,u=l[o];c.get_refer=function(){var e=document.referrer,t=document.location.host;try{if(e&&""!==e)return e.split("//")[1].split("/")[0]}catch(n){}return t},c.contains=function(e,t){for(var n=0;n<e.length;n++)if(e[n]===t)return!0;return!1},c.coerce_bool=function(e){return e===!0?!0:"0"===e?!1:"1"===e?!0:"true"===e?!0:"string"==typeof e&&"false"!==e},c.shallow_copy=function(e,t){for(var n in e)t[n]=e[n]},c.get_url=function(){return encodeURI(l.location.href)},c.get_path=function(){return encodeURIComponent(l.location.pathname)},c.ctime=function(){return(new Date).getTime()},c.log=function(e){l.console&&l.console.log&&-1!==l.location.search.indexOf("debug_"+o)},c.insert_script=function(e){var t=document.createElement("script");t.src=e;var n=document.getElementsByTagName("script");if(n.length>0)return n[0].parentNode.insertBefore(t,n[0]);var r=document.getElementsByTagName("head");if(r.length>0)return r[0].appendChild(t);try{var i=document.childNodes;if(i.length>0)return i[0].appendChild(t)}catch(a){} },c.wrap_global=function(e,t){var n=function(e){};l[e]&&(n=l[e]),l[e]=function(e){t(e),n(e)} },c.quartile=function(e,t){if(0===e||0===t)return 1;var n=e/t;return.25>n?1:.5>n?2:.75>n?3:4},c.write_tracking_tag=function(e){var t=document.createElement("div");t.style.position="absolute",t.style.left="0px",t.style.top="0px",t.style.visibility="hidden",document&&document.body?(document.body.appendChild(t),t.innerHTML=e):setTimeout(function(){c.write_tracking_tag(e)},1e3)},c.DefaultWrapper=function(e){var t=c.ctime(),n=e.impression_id;return{getPlaytime:function(){var e=c.ctime();return e-t},contentLength:function(){return 3e4},setupVideo:function(){},reset:function(){t=c.ctime();var r=Math.floor(1e3*Math.random());e.impression_id=n+"-"+r.toString()},play:function(){} } };var s;c.getPlaytimeMonitor=function(e){return s?s:s=c.DefaultWrapper(e)};var d=[],f=!1,_=50;c.runOnLoad=function(e){f?e():null!==d&&d.push(e)},c.checkLoad=function(){if(document&&document.body){if(null!==d){for(var e=d.length;e--;)d[e]();d=null,f=!0} }else setTimeout(c.checkLoad,_)},setTimeout(c.checkLoad,_);var p=e("../core/message-broker.js"),g=p.MessageBroker,m=p.TLDR_EVENTS,v=[];c.add_to_queue=function(e,t){if(!g.has_fired(m.internalReady))return g.on(m.internalReady,function(){c.add_to_queue(e,t)});var n=c.make_url(e,t);v.push(n)},c.create_new_img=function(e){var t=document.createElement("IMG");t.style.width="1px",t.style.height="1px",document.body.appendChild(t),t.src=e},c.pop_queue=function(){for(var e=_;v.length>0;){var t=v.pop();c.create_new_img(t)}setTimeout(c.pop_queue,e)},setTimeout(c.pop_queue,_),c.get_current_script=function(){if(document.currentScript)return document.currentScript;var e=document.getElementsByTagName("SCRIPT");return e[e.length-1]},c.start_tag=function(e,t,n){var r="<"+e+" ";for(var i in t)r+=i+"='"+t[i]+"' ";return r+=n?"single"==n?"/>":"></"+e+">":">"},c.generate_random=function(){var e=(new Date).getTime(),t=Math.random();return e.toString()+t.toFixed(4).toString()},c.make_url=function(e,t){return t.random=c.generate_random(),e+"?"+c.obj_2_qs(t)},c.obj_2_qs=function(e){var t="";for(var n in e){var r=e[n];"function"==typeof r&&(r=r()),t+=n+"="+encodeURIComponent(r)+"&"}return t},c.timeout_iterator=function(){var e=0,t=0;return{next:function(){return e+=1,3>e?500:8>e?1e3:20>e?1e4:2e4},last:function(){return t} } },c.prepend=function(e,t){var n=t;return n.unshift(e),n},c.takeWhile=function(e,t){for(var n=[],r=0;r<t.length&&e(t[r]);r++)n.push(t[r]);return n},c.remove_leading_slash=function(e){return 0===e.indexOf("/")?e.substring(1):e},c.remove_trailing_slash=function(e){return"/"==e[e.length-1]?e.substring(0,e.length-1):e},c.watcher=function(e,t,n){var r,i=function(){e()&&t()},a=function(){r||(r=setInterval(i,n))};return{stop:function(){r&&clearInterval(r)},checkNow:i,start:a} },c.calculate_threshold=function(e,t,n){return null!==e.playtime_threshold?t/1e3>=e.playtime_threshold:!0};var h={};c.tldr_post_message=function(e,t,n,r,i){r||(r=5),i||(i=!0),h[t]||(h[t]=0),c.add_to_queue(e.endpoint+"post-message",{key:t,value:n,ack:h[t],timeout:r,one_use:Boolean(i)}),h[t]+=1};var w={},y={};c.tldr_get_message=function(e,t,n){w[t]||(w[t]=0),y[t]=n;var r=c.make_url(e.endpoint+"get-message",{key:t,callback:"window._"+o+"_mcf",ack:w[t],timeout:5});w[t]+=1,c.insert_script(r)},l["_"+o+"_mcf"]=function(e){if("key"in e&&e.key in y){var t=y[e.key];return e.success?t(!0,e.key,e.value):void t(!1,e.status)} },c.coerce_javascript_symbols=function(e){if("null"===e)return null;if("undefined"!==e)return e},c.doc_write=function(e){var t=arguments.length<=1||void 0===arguments[1]?{}:arguments[1],n=null;t&&t.public_key||console.warn("config.public_key is empty");try{for(var r=document.body.getElementsByTagName("SCRIPT"),i=0;i<r.length;i++){var a=r[i];if(a.src&&-1!==a.src.indexOf("thoughtleadr")&&-1!==a.src.indexOf(t.public_key)&&null===a.getAttribute("initialized")){a.setAttribute("initialized",!0),n=a;break} } }catch(o){console.error(o)}if(!n)return console.error("Unable to retrieve the currentScript. Fallback to document.write();"),void document.write(e);var c=document.createElement("div");n.parentNode.insertBefore(c,n.nextSibling),c.innerHTML=e},c.get_title=function(){var e=document.getElementsByTagName("TITLE");if(e.length>0)try{return e[0].text}catch(t){}return""},c.get_flash_version=function(){try{try{var e=new ActiveXObject("ShockwaveFlash.ShockwaveFlash.6");try{e.AllowScriptAccess="always"}catch(t){return"6,0,0"} }catch(t){}return new ActiveXObject("ShockwaveFlash.ShockwaveFlash").GetVariable("$version").replace(/\D+/g,",").match(/^,?(.+),?$/)[1]}catch(t){try{if(navigator.mimeTypes["application/x-shockwave-flash"].enabledPlugin)return(navigator.plugins["Shockwave Flash 2.0"]||navigator.plugins["Shockwave Flash"]).description.replace(/\D+/g,",").match(/^,?(.+),?$/)[1]}catch(t){} }return"0,0,0"},c.get_pixel_height=function(){return l.outerHeight},c.get_pixel_width=function(){return l.outerWidth},c.expand_object=function(e,t){for(var n in t)e[n]=t[n];return e},c.get_iframe_params=function(e,t){return c.expand_object(t,{loc:e.location,debug:e.debug,from_domain:c.get_refer(),imp:e.impression_id,os:e.os,uid:e.uid}),c.expand_object(t,{uw:e.fullpage_width,uh:e.fullpage_height,title:c.get_title(),fv:c.get_flash_version(),dw:c.get_pixel_width(),dh:c.get_pixel_height(),utcOffset:(new Date).getTimezoneOffset()}),t},c.direct_iframe_write=function(e,t){if(e.ad_available||e.ds_available){var n,r;e.ad_available?r=e.iframe_direct_url:e.ds_available&&(r=c.getIframeDirectDsUrl(e,e.ds_account_id));var i=c.get_iframe_params(e,{page_id:e.ad_id}),a=c.make_url(r,i);n=c.start_tag("iframe",{id:o+"-iframe",src:a,width:e.fullpage_width,height:e.fullpage_height,imp:e.impression_id,frameborder:"0"},"double"),e.tracking_tag&&(n+=e.tracking_tag),t?t.innerHTML=n:c.doc_write(n,e),c.tldr_get_message(e,"height:"+e.impression_id,function(e,t,n){e&&(document.getElementById(o+"-iframe").height=n)})} };var b=e("./placement-proxy.js").PlacementProxy;c.targeting_iframe_write=function(e,t,n,r){if(e.ad_available||e.ds_available||e.fallback_tag){var i,a=o+"-promoted-"+e.public_key;if(e.ad_available||e.ds_available&&!e.fallback_tag){var l="";e.ad_available?l=e.iframe_targeting_url:e.ds_available&&(l=c.getIframeTargetingDsUrl(e));var u=Math.random(),s=c.get_iframe_params(e,{page_id:c.get_path(),cmu:e.expanded_click_macro,cb:e.cachebuster,rd:u});e.ds_account_id&&(s.ds_account_id=e.ds_account_id);var d=c.make_url(l,s);i=c.start_tag("iframe",{id:a,src:d,width:n||e.preview_width,height:r||e.preview_height,frameborder:"0",scrolling:"no"},"double"),e.tracking_tag&&(i+=e.tracking_tag)}else i=e.fallback_tag;t?t.innerHTML=i:c.doc_write(i,e),!e.ad_available&&e.ds_available&&b(a,e.public_key,u);var f=e.ds_account_id,_=document.getElementById(a);if(_.contentWindow&&_.contentWindow.postMessage)var p=0,g=setInterval(function(){try{c.isVisible(_)?p+=1:p=0}catch(e){p=3}p>=3&&(_.contentWindow.postMessage({visible:!0,ds_account_id:f},"*"),clearInterval(g))},1e3)} };var k=["a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z"];c.convertStringToInt=function(e){e=e.toLowerCase();for(var t=0;t<k.length;t++)e=e.replace(new RegExp(k[t],"g"),t.toString());return parseInt(e,10)},c.getContentIndex=function(e,t){var n=e.impression_id,r=n.split("-")[6];r=c.convertStringToInt(r);var i=r/1e12;return Math.floor(i*t)},c.isDemandSourceAd=function(e){return e.ds_account_id&&!e.ad_id},c.getIframeTargetingDsUrl=function(e){return e.endpoint+e.public_key+"/iframe_targeting_ds/"},c.getIframeDirectDsUrl=function(e,t){return e.endpoint+e.public_key+"/iframe_direct_ds/"+t},c.localStorageAvail=function(){return"localStorage"in l&&null!==l.localStorage};var x=o+"-uid";c.getLocalStorageUID=function(){return x in l.localStorage?l.localStorage[x]:null},c.setLocalStorageUID=function(e){l.localStorage[x]=e},c.setNamespaceProperty=function(e,t){u[e]=t},c.getNamespaceProperty=function(e){return u[e]},c.setNamespaceProperties=function(e){for(var t in e)u[t]=e[t]},c.isVisible=function(e){try{var t=r(e);return t}catch(n){return!1} } }).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"../core/message-broker.js":2,"./namespace.js":3,"./placement-proxy.js":4}],6:[function(e,t,n){"use strict";e("console-polyfill");var r=e("../core/utils.js").setNamespaceProperties,i=e("../std/preview_iframe");r(i)},{"../core/utils.js":5,"../std/preview_iframe":8,"console-polyfill":1}],7:[function(require,module,exports){"use strict";function expect_param(e,t){return""===e||"undefined"===e||null===e||void 0===e?t():escape(e)}var u=require("../core/utils"),coerce_javascript_symbols=u.coerce_javascript_symbols,coerce_bool=u.coerce_bool,get_refer=u.get_refer,get_url=u.get_url,get_path=u.get_path,cookie=require("./../../shared/aefrecookie.js").AefreCookie,setNamespaceProperty=u.setNamespaceProperty,mb=require("../core/message-broker.js"),MessageBroker=mb.MessageBroker,TLDR_EVENTS=mb.TLDR_EVENTS,config=exports.config={thumbnail_url:"null",image_url:"null",impression_id:"1466012506-914581-05f4bcea-73b5-4e0b-a490-b57d7020fae9",impression_group:"bad1c7ab-cdd8-4db0-b295-9e2f249b7ca5",root_url:"//a.thoughtleadr.com/",title_text:"null",caption_text:"null",debug:"false",ad_id:"0",ds_account_id:"null",ad_available:coerce_bool("false"),ds_available:coerce_bool("true"),page_views:"0",upvotes:"0",downvotes:"0",comments:"0",refer:get_refer(),location:expect_param("",get_url),location_parameter:"",sponsor_url:"",sponsor_logo:"null",embed_code:"null",playtime_threshold:"null",preview_width:"100%",preview_height:"122",fullpage_width:"100%",fullpage_height:"122",media_type:"null",public_key:"409f537aa78c06a3bb0d80a0e3bed8bd0cda77dde84387e0aa6de6bbdb312012",from_domain:expect_param("",get_refer),autowrite:coerce_bool("1"),sponsor_name:"null",sponsor_link:"null",page_id:expect_param("",get_path),tracking_tag:coerce_javascript_symbols("null"),preview_tracking_tag:coerce_javascript_symbols("null"),fullpage_click_url:coerce_javascript_symbols("null"),preview_click_url:coerce_javascript_symbols("null"),cachebuster:"",expanded_click_macro:"",fallback_tag:coerce_javascript_symbols("null"),os:"",uid:"e925b978-4d8e-0d04-0b03-96865a676d39\"};setNamespaceProperty("config",config);try{config.demand_sources=eval("(null)")}catch(ex){}cookie(config.uid,function(e){config.uid=e,MessageBroker.trigger(TLDR_EVENTS.internalReady)}),config.endpoint=config.root_url+"v2/",config.iframe_targeting_url=config.endpoint+config.public_key+"/iframe_targeting/"+config.ad_id,config.iframe_direct_url=config.endpoint+config.public_key+"/iframe_direct/"+config.ad_id;var impression_types=exports.impression_types={fullpage:"fullpage",preview:"gallery"},click_types=exports.click_types={thumbnail:"gallery",upvote:"upvote",downvote:"downvote",comment:"comment",fb_share:"fb_share",tumblr_share:"tumblr_share",twitter_share:"twitter_share",reddit_share:"reddit_share",stumble_share:"stumble_share",email_share:"email_share",other_share:"other_share",google_share:"google_share",pinterest_share:"pinterest_share"} },{"../core/message-broker.js":2,"../core/utils":5,"./../../shared/aefrecookie.js":9}],8:[function(e,t,n){(function(t){"use strict";function r(){var e="tldr-promoted-"+a.public_key;s.activeElement==s.getElementById(e)&&m.trigger(_.previewClick),u.removeEventListener("blur",r)}var i=e("./config"),a=i.config,o=(i.impression_types,i.click_types,e("../core/utils")),c=(o.get_refer,o.contains,o.get_url,o.get_path,o.ctime,o.log,o.insert_script,o.wrap_global,o.quartile,o.write_tracking_tag,o.runOnLoad,o.checkLoad,o.add_to_queue,o.create_new_img,o.pop_queue,o.start_tag,o.make_url,o.obj_2_qs,o.timeout_iterator,o.prepend,o.takeWhile,o.remove_leading_slash,o.remove_trailing_slash,o.watcher,o.calculate_threshold,o.tldr_post_message,o.tldr_get_message,o.coerce_javascript_symbols,o.direct_iframe_write),l=o.targeting_iframe_write,u=(o.getPlaytimeMonitor,t),s=u.document,d=e("../core/message-broker.js"),f=d.MessageBroker,_=d.TLDR_EVENTS,p=d.event_handlers,g=d.fired_events,m={ad_available:function(){return a.ad_available||a.ds_available||a.fallback_tag},get_ad_region_id:function(){return a.public_key},write:function(e,t,n){return l(a,e,t,n)},write_preview:function(e,t,n){return l(a,e,t,n)},write_fullpage:function(e,t,n){return c(a,e,t,n)},on:f.on,trigger:f.trigger,events:_,_event_handlers_:p,_fired_events_:g};m.on(_.internalReady,function(){u.focus(),u.addEventListener("blur",r)}),o.shallow_copy(m,n),a.autowrite?m.write():u.tldr_write_element&&m.write(u.tldr_write_element)}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"../core/message-broker.js":2,"../core/utils":5,"./config":7}],9:[function(e,t,n){"use strict";function r(){function e(){try{return"localStorage"in window&&null!==window.localStorage}catch(e){return!1} }var t="tldr-uid",n=!1;return{load:function(t){n=e(),t()},is_supported:function(){return n},get_id:function(e){if(!n)return e(null);var r=null;try{r=window.localStorage[t]}catch(i){}return e(r)},set_id:function(e,r){if(!n)return r("Not supported");try{window.localStorage[t]=e,r()}catch(i){r("localstorage unavailable")} } } }function i(){var e=!1,t=window.sessionStorage,n="tldr-uid";return{load:function(n){e=!!t,n()},is_supported:function(){return e},get_id:function(r){if(!e)return r(null);var i=null;try{t.getItem(n)}catch(a){}return r(i)},set_id:function(r,i){if(!e)return i("Not supported");try{t.setItem(n,r),i()}catch(a){i("Not supported")} } } }function a(){var e=!1,t=null,n="uid";return{load:function(n){if(e=!!window.openDatabase)try{t=window.openDatabase("sqlite_evercookie","","evercookie",1048576)}catch(r){e=!1}n()},is_supported:function(){return e},get_id:function(r){return e?void t.transaction(function(e){e.executeSql("SELECT value FROM cache WHERE name=?",[n],function(e,t){r(t.rows.length>=1?t.rows.item(0).value:null)},function(e,t){r(null)})}):r(null)},set_id:function(r,i){e&&t.transaction(function(e){e.executeSql("CREATE TABLE IF NOT EXISTS cache(id INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT, name TEXT NOT NULL, value TEXT NOT NULL, UNIQUE (name))",[],function(e,t){},function(e,t){i("Error creating table.")}),e.executeSql("INSERT OR REPLACE INTO cache(name, value) VALUES(?, ?)",[n,r],function(e,t){i(null)},function(e,t){i("Error setting value in table.")})})} } }var o=function(e,t){return{onComplete:function(){e--,0===e&&t()} } },c=function(e,t,n){function r(e,r){t(e,function(e){i[r]=e,++o>=a&&n(i)})}for(var i=[],a=e.length,o=0,c=0;a>c;c++)i[c]=null,r(e[c],c)};n.AefreCookie=function(e,t){function n(e){for(var n=0;n<u.length;n++)u[n].set_id(e,function(){});t(e)}function l(){var r=u.slice(0);u=[];for(var i=0;i<r.length;i++)r[i].is_supported()&&u.push(r[i]);if(0===u.length)return t(e);var a=function(e,t){e.get_id(t)};c(u,a,function(t){for(var r=null,i=0;i<t.length;i++)if(t[i]){r=t[i];break}n(r?r:e)})}for(var u=[r(),i(),a()],s=o(u.length,l),d=0;d<u.length;d++)u[d].load(s.onComplete)} },{}]},{},[6]); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment