forked from bombastictranz/bombastictranz
-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcframe.js.download
2 lines (2 loc) · 16.6 KB
/
cframe.js.download
1
2
!function(){"use strict";function t(t,n){H.forEach((e=>{try{e(new K(t,n))}catch(t){}}))}function n(t,n){return-1!==function(t,n){if("string"!=typeof n)return-1;if(null==t)return-1;let e=String(t);return 0===e.length?-1:e.indexOf(n)}(t,n)}function e(t,n){void 0===n&&(n="");try{return atob(t)}catch(t){return"string"==typeof n?n:""}}function r(t){return Math.floor(Math.random()*t)}function l(t){return new Promise(t)}function u(t){let n,e,r=l(((t,r)=>{n=n=>{n instanceof Promise||null!=n&&n.then?n.then((t=>{u.v=t})):u.v=n,t(n)},e=r})),u={v:null!=t&&t!==String({})?t:null,r:n,j:e,p:r};return[u.r,u.j,()=>u.v,u.p]}function i(){return Math.floor(Math.random()*(Number.MAX_SAFE_INTEGER-10)).toString(36)}function o(){return[i(),i(),i()].join("").slice(0,18)}function c(t){let n=[];return Object.keys(t).forEach((e=>{var r;null!=t[e]&&n.push(rt(e)+"="+rt(String(null!=(r=t[e])?r:"")))})),n.join("&")}function s(t){if(null==t||t.length<2)return{};let n={};return t.replace(/^[\?#]/,"").split("&").forEach((t=>{let[e,r]=t.split("=");null!=e&&null!=r&&(n[Y(e)]=Y(r))})),n}function a(t){return Promise.reject(t)}function f(t){return Promise.resolve(t)}function d(){return G&&null!=G.ancestorOrigins?null==(t=G.ancestorOrigins)?[]:"function"==typeof Array.isArray&&Array.isArray(t)?t:"function"==typeof Array.from?Array.from(t):et.call(t):[];var t}function h(){if(Q===Q.top)return G.host;try{var t;let n=null==(t=Q.top)?void 0:t.location.host;if(null!=n)return n}catch(t){}let n=d();if(n.length>0){let t=n[n.length-1];if(null!=t){try{return p(t).host}catch(t){}return t}}return""}function p(t){try{return new URL(t)}catch(n){let e=$.createElement("a");return e.href=t,e}}function m(t){return"string"==typeof t&&t.length>0}function v(t){if("string"==typeof t)return t.replace(/\(([^\):]+):(\d+:\d+)\)/g,"($2)").replace(/at \/[\S:]+:(\d+:\d+)/g,"at $1");if(t instanceof Error)return t.message+"\n"+v(t.stack);if(t instanceof ErrorEvent)return v(t.message+" @"+t.lineno+":"+t.colno+" / "+t.type);if(t instanceof Event)return v(t.type);try{return JSON.stringify(t)}catch(t){}return String(t)}function y(t){return Math.round(100*Math.random())<=t}function g(t,n,e,r){void 0===e&&(e=$),void 0===r&&(r=[]);let l=e.createElement(t);return null!=n&&("!"===n[0]?b(l,"style",n.slice(1)):l.className=n),r&&r.length&&r.forEach((t=>{"string"!=typeof t?l.appendChild(t):l.insertAdjacentHTML("beforeend",t)})),l}function b(t,n,e){if(null!=t)try{t.setAttribute(n,String(e))}catch(t){}}function w(t,n){[].concat(n).forEach((n=>{t.appendChild(n)}))}function _(t,e,r){if(void 0===r&&(r=!1),null==t)return null;if(!1===ct().get(t))return null;try{let n=e(t);return ct().set(t,!0),n}catch(e){if(n(z(e),"Blocked a frame"))ct().set(t,!1);else if(!r)throw e}return null}function S(t,n,e){return void 0===e&&(e="*"),!0===_(t,(t=>(t.postMessage(n,e),!0)))}function x(t,n){void 0===n&&(n=st);try{return n.localStorage.getItem(t)}catch(t){return null}}function P(t,n,e){t.localStorage.setItem(n,function(t){return"string"==typeof t}(e)?e:JSON.stringify(e))}function D(t,n,e){void 0===e&&(e=st),P(e,t,n);let r=st.parent;for(;null!=r&&r!==st&&r!==top&&null!==_(r,(e=>(P(e,t,n),1)),!0);)r=r.parent;_(top,(e=>{P(e,t,n)}))}function O(){try{let t=JSON.parse(Q.name);return null!=t&&"string"==typeof t.d&&"string"==typeof t.l?t:null}catch(t){return null}}function N(t,n){return null==n||"object"!=typeof n?null!=t?t:{}:(Object.keys(n).forEach((e=>{let r=n[e];null!=r&&("string"!=typeof r||0!==r.length)&&(t[e]=r)})),t)}function k(t){return new Promise(((n,e)=>{t.oncomplete=t.onsuccess=()=>n(t.result),t.onabort=t.onerror=()=>e(t.error)}))}function j(t,n){let e=indexedDB.open(t);e.onupgradeneeded=()=>e.result.createObjectStore(n);let r=k(e);return(t,e)=>r.then((r=>e(r.transaction(n,t).objectStore(n))))}function E(){return mt||(mt=j("keyval-store","keyval")),mt}function I(){return(I=Object.assign||function(t){var n,e,r;for(n=1;n<arguments.length;n++)for(r in e=arguments[n])Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t}).apply(this,arguments)}function M(){return(M=Object.assign||function(t){var n,e,r;for(n=1;n<arguments.length;n++)for(r in e=arguments[n])Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t}).apply(this,arguments)}function C(t){let n=x(ft);null!=n&&n.length>t.length||D(ft,t)}function J(t,e){return null!=t&&/ib\.adnxs\.com/.test(t)&&("1"===(r=e.gdpr)||"true"===r||!0===r||1===r)&&!n(t,"gdpr_consent=");var r}function L(t,n){let e=new URL(t);return Mt(e).set("gdpr",z(n.gdpr)),Mt(e).set("gdpr_consent",z(n.gdpr_consent)),e.toString()}function R(t,e,r){var u;void 0===r&&(r=!1);let i=function(t,n){var e;let r=new URL(t);return function(t,n){if(Array.isArray(t))return t.forEach(n);for(;;){let e=t.next();if(e.done)break;n(e.value)}}(null==(e=r.searchParams)?[]:"undefined"!=typeof Symbol&&Symbol.iterator in e?e[Symbol.iterator]():"entries"in e?e.entries():Array.isArray(e)?e:Object.entries(e),(t=>{let[e,l]=t,u=Pt.exec(l);if(u&&u[1]){let t=n[(t=>{var n;let e=t.toLowerCase();return null!=(n=Dt[e])?n:e})(u[1])];r.searchParams.set(e,null!=t?t:"")}})),r.toString()}(t,e),o=new Ot(i);return(u=i,l(((t,e)=>{var r;r=u,S(Q.parent,"||am.ck."+r);let l=function(){var t;let n=null!=(t=_(top,(t=>t.Image)))?t:Image;return null!=n?new n:g("img","a-s")}(),i=l.className&&n(l.className,"a-s"),o=i?()=>{!function(t){if(null==t)return;let n=t.parentElement;null!=n&&n.removeChild(t)}(l)}:()=>{},c=r=>{o(),null!=r&&n(u,"ib.adnxs.com/prebid")?e(r):t(l)};l.onerror=t=>c(t),l.onload=()=>c(null),l.src=u,i&&w(l.ownerDocument.head,l)}))).then((t=>(o.ur(t.src),o))).catch((t=>!r&&J(i,e)?R(L(i,e),e,!0):(o.ur("",t),Et.ar("csynce",{bid:i,e:v(t)}),o)))}var U,A,T,W,X;const Q=window,$=Q.document,B=Q.navigator,F=Q,G=Q.location,q=Q.screen,Y=t=>{try{return decodeURIComponent(z(t))}catch(n){return z(t)}};let H=[];const Z=(n,e)=>{return Q.setTimeout((r=n,void 0===l&&(l=!1),function(){for(var n=arguments.length,e=new Array(n),u=0;u<n;u++)e[u]=arguments[u];try{return r(...e)}catch(n){l||t(lt(n),{C:"sWF"})}return null}),e);var r,l},z=String;class K extends Error{X(){var t;return null!=(t=this.extra)?t:{}}G(){}constructor(t,n){let e="string"!=typeof t;super(e?t.message:t),this.extra=n;try{e&&(this.stack=t.stack,this.Y=t.Y,this.name=t.name)}catch(t){}}}class V extends Error{constructor(t){super(t)}}const tt=(t,n)=>t instanceof V?t:t&&t instanceof Error?new K(t,n):new K(z(t),n);let nt=null,et=[].slice;const rt=n=>{try{return encodeURIComponent(z(n))}catch(e){return t(lt(e),{value:n}),""}};!function(){try{let t=d(),n=t[t.length-1];/(?:msn|microsoft|outlook)\.com/i.test(n)}catch(t){return!1}}();const lt=t=>null!=t&&t instanceof Error?t:tt(z(t));let ut=null,it="undefined"==typeof WeakMap,ot={get:()=>!1,set:()=>!1},ct=()=>it?ot:(null!=ut||(ut=new WeakMap),ut),st=function(){if(Q===Q.top)return Q;try{var t;if(null!=(null==(t=Q.top)?void 0:t.location.href))return Q.top}catch(t){}return Q}(),at=st;st.document,e("X19TdG9yYWdlREI=","_db"),null!=nt||(nt=function(){let t=h().replace(/:\d+/,"").split("."),n=/\.co\.\w{2,4}$/.test(G.host)?3:2;return t.slice(t.length-n).join(".")}()),e("c2RiX192YWx1ZXM=","_t"),e("X2dhX2JldGF1aWQ=","_g"),st.indexedDB||at.mozIndexedDB||at.webkitIndexedDB||at.msIndexedDB,function(){let t=u(null),n=l((t=>{Z((()=>{t(f([["0","0","0"],!1]))}),r(1e3))}));t[0](n)}();const ft="__amuidpb",dt="_apbsyn",ht=t=>({gdpr:null!=(U=null==t?void 0:t.gdprApplies)?U:"",gdpr_consent:null!=(A=null==t?void 0:t.tcString)?A:"",gpp:null!=(T=null==t?void 0:t.gppString)?T:"",gpp_sid:(null!=(W=null==t?void 0:t.sectionList)?W:[]).join(","),us_privacy:null!=(X=null==t?void 0:t.uspString)?X:""});class pt{Xt(){return(1e9*Math.random()).toString(36)}get(){return l(((t,n)=>{let e=this.Xt(),r=this.Ut("return"),l=Z((()=>{n(new Error("TO"))}),200),u=n=>{var i;(null==n?void 0:n.data)&&(null==(i=n.data[r])?void 0:i.callId)===e&&null!=n.data[r].returnValue&&(t(n.data[r].returnValue),clearTimeout(l),Q.removeEventListener("message",u))};Q.addEventListener("message",u),this.Vt.postMessage({[this.Ut("call")]:{command:this.method,version:this.version,callId:e}},"*")}))}Gt(){try{var t;let n=Q.top.frames[this.Ut("locator")];return null!=(t=null==n?void 0:n.parent)?t:top}catch(t){return top}}Ut(t){return"__"+this.Yt+t[0].toUpperCase()+t.slice(1)}constructor(t,n,e){var r;this.Yt=t,this.method=n,this.version=e,this.Vt=null!=(r=this.Gt())?r:Q}}let mt,vt=[new pt("tcfapi","getTCData",2),new pt("uspapi","getUSPData",1),new pt("gpp","ping",1)],yt=j("amdgt/lk","v1"),gt=t=>"amdgt_lk@"+t,bt=t=>t[1]>Date.now(),wt="https://id.a-mx.com/sync?tao=1&",_t="https://id.rtb.mx/rum?",St="amdgt@1",xt="fetch"in Q&&null!=Q.fetch?t=>fetch(t,{mode:"cors",credentials:"include"}).then((t=>t.json())):t=>new Promise(((n,e)=>{let r=new XMLHttpRequest;r.open("GET",t),r.onreadystatechange=()=>{r.readyState>=4&&200===r.status?n(JSON.parse(r.responseText)):r.readyState>=4&&e(tt(r.status))},r.onerror=e,r.withCredentials=!0,r.setRequestHeader("Content-Type","text/plain"),r.send()}));"amx".split("").map((t=>t.charCodeAt(0))).length;let Pt=/{{([^}]+)}}/,Dt={hr:"gpp"};class Ot{ur(t,n){this.error=null!=n?lt(n):void 0,this.pr=t,this.rtt=Date.now()-this.startTime}getError(){var t;return null!=(t=this.error)?t:null}mr(){return null!=this.error}constructor(t){this.url=t,this.startTime=Date.now(),this.rtt=0,this.pr=""}}let Nt=function(t){void 0===t&&(t="");let e=function(t){void 0===t&&(t="");let e=$.currentScript;if(null!=e)return e;let r=$.scripts;if(null==r)return null;for(let e=0,l=r.length;e<l;e++){let l=r[e];if(n(l.src+"","assets.a-mo.net/js/"+t))return l}return null}(t);if(null==e)return{};e.className+=" amx-aco-active ";let r=p(e.src);if(null==r)return{};let l=s(r.hash.slice(1));return I({},s(r.search.slice(1)),l,"object"==typeof _QPP_&&null!=_QPP_&&_QPP_!==F.vr?_QPP_:{})}(),kt=s(G.search.slice(1)),jt=["gdpr","gdpr_consent","gpp","gpp_sid","us_privacy"],Et=new class{getData(){return this.yr}gr(t){N(this.yr,t)}br(){let t=0;return[jt.map((t=>[t,this.yr[t]])).reduce(((n,e)=>{let[r,l]=e;return null==l||0===l.length||(n[r]=l,("gpp"===r||"us_privacy"===r||"gdpr_consent"===r)&&t++),n}),{}),t]}wr(){let[t,n]=this.br();return n>0?f(t):Promise.all(vt.map((t=>t.get().catch((()=>({})))))).then((t=>t.reduce(((t,n)=>N(t,n)),{}))).then(ht).then((t=>(this.gr(t),t)))}_r(){var t;let n=this.br()[0];return this.gdprApplies||m(n.gpp_sid)?M({},n,{do:this.yr.do}):{do:null!=(t=this.yr.do)?t:""}}Sr(t,n){return"https://1x1.a-mo.net/hbx/g_"+t+"?"+c(M({},this.yr,n,{eid:o(),ts:Date.now()}))}ar(t,n){void 0===n&&(n={}),(new Image).src=this.Sr(t,n)}constructor(){var t,e,r,l,u;this.yr=M({do:function(){let t=h();return n(t,"http")?new URL(t).host:t}(),re:$.referrer,sw:null!=(e=q.availWidth)?e:0,sh:null!=(r=q.availHeight)?r:0},kt,Nt);let i=this.yr.gdpr;this.Pr=null!=(l=this.yr.gdpr_consent)?l:"",this.gdprApplies="true"===i||"1"===i||1===i||!0===i,this.yr.m=i?"1":"0",this.yr.p=null!=(u=null==(t=this.Pr)?void 0:t.length)?u:-1}},It=[["https://ow.pubmatic.com/setuid?bidder=amx&uid=",!1,100],["https://prebid-server.rubiconproject.com/setuid?bidder=amx&uid=",!1,100]],Mt=t=>t.searchParams,Ct=t=>null!=t&&t.length>0,Jt=new class{async Dr(t,n){if(t===this.Or)return this.Or;for(let e of(this.Or=t,await async function(t,n,e){let r=[n,Date.now()+1e3*e];return await function(t,n,e){return void 0===e&&(e=E()),e("readwrite",(e=>(e.put(n,t),k(e.transaction))))}(t,r,yt),D(gt(t),JSON.stringify(r)),((t,n,e)=>{$.cookie=rt(t)+"="+rt(n)+"; Path=/; Max-Age="+e+"; SameSite=None; Secure=true"})(gt(t),n?"1":"0",e),n}(this.Nr,t,this.expiration),!n&&this.kr&&this.kr.postMessage([t,Date.now()]),this.jr))e(t,this);return this.Or}async Er(){if(null!=this.Or)return this.Or;let t=await async function(t){let n=await function(t,n){return void 0===n&&(n=E()),n("readonly",(n=>k(n.get(t))))}(t,yt);if(null!=n&&2===n.length&&bt(n))return n[0];let e=x(gt(t));if(null==e)return null;let r=JSON.parse(e);if(r&&bt(r))return r[0];let l=(t=>{let n=rt(t)+"=",e=$.cookie.indexOf(n);return-1===e?null:$.cookie.slice(e+n.length,$.cookie.indexOf(";",e))})(gt(t));return"1"===l||"0"===l?"1"===l:null}(this.Nr);return null!=t?this.Dr(t,!1):this.Dr(!1,!1)}Ir(){return this.Er()}Mr(){this.Dr(!0,!1)}constructor(t,n,e){var r,l;this.Nr=t,this.jr=n,this.expiration=e,this.Or=null,this.Cr=t=>{if(t&&t.data&&2===t.data.length){let[e,r]=t.data;var n;if("ping"===r&&null!=this.Or&&t.source!==Q)return void(null==(n=this.kr)||n.postMessage([this.Or,Date.now()]));this.Dr(e,!0)}},this.kr="undefined"==typeof BroadcastChannel?null:new BroadcastChannel("amdgt::lk::"+t),null==(r=this.kr)||r.addEventListener("message",this.Cr),null==(l=this.kr)||l.postMessage([null,"ping"]),this.Er(),e&&Z((()=>{this.Dr(!this.Or,!1)}),1e3*e)}}("cfs",[],21600);F.__am$CK=(t,e)=>{var i;i=()=>Et.wr().then(function(t,n){let e=O(),r=t.amuid;return null!=e&&m(e.a)&&null!=r&&e.a.length>r.length?()=>n(M({},t,{amuid:e.a})):m(r)?()=>n(M({},t,{amuid:r})):()=>{fetch("https://prebid.a-mo.net/getuid",{mode:"cors",credentials:"include"}).then((t=>t.json())).then((t=>{let{buyeruid:n}=t;return n})).then((t=>{if(null==t)throw tt("NOA");return t})).then((e=>{n(M({},t,{amuid:e}))})).catch((e=>{if("crypto"in Q&&null!=Q.crypto.Jr){let e=Q.crypto.Jr();return C(e),void n(M({},t,{amuid:e}))}}))}}(e,(e=>{Et.gr({cn:t.length,c3:e.amuid}),C(e.amuid);let r=Et._r(),i=null!=r?"&"+c(r):"";n(e.amuid,"#")||function(t,n){var e,r,u,i,c;let s=function(t){let n=x("_aswt_s");if(null==n)return 0;let e=parseInt(n,10);return isNaN(e)||!isFinite(e)?0:e}();if(!(Date.now()-s<216e5)){D("_aswt_s",Date.now()+"");try{(i="https://assets.a-mo.net/js/idl.js?ga="+(null!=(e=null==t?void 0:t.gdpr)?e:0)+"&gc="+(null!=(r=null==t?void 0:t.gdpr_consent)?r:"")+"&do="+(null!=(u=t.do)?u:"")+"&e=27&uid="+(null!=n?n:""),c={},null!=F._?f(F._):(null!=c&&(F._=c),l(((t,n)=>{let e=g("script");e.type="text/javascript",e.id="slc__"+o(),e.src=i;let r=!1;e.onload=()=>{r=!0,Z((()=>{let e=F._;null!=e?t(e):n(tt(500))}),150)},e.onerror=t=>{r||n(t)},$.head.appendChild(e)})))).catch((()=>{}))}catch(t){}}}(r,e.amuid);try{y(30)&&function(t){let e=x(St);if(null!=e&&!isNaN(e)&&Date.now()-parseInt(e,10)<864e5)return;let r=function(){let t=u(null);if("undefined"==typeof PerformanceObserver)return t;let e=new PerformanceObserver((r=>{r.getEntries().forEach((r=>{if(r.name===wt||n(r.name,"a-mx.com")){let l=r,u=t[2](),[i,o]=null==u?["",""]:u,c={d:[0|l.domainLookupStart,0|l.domainLookupEnd],c:[0|l.connectStart,0|l.connectEnd],ttl:0|l.duration,s:[0|l.secureConnectionStart,0|l.responseStart],r:[0|l.responseStart,0|l.responseEnd],p:0|l.transferSize,t:Date.now()},s=(null!=i&&n(i,"*")?_t+"uid="+i.split("*")[2]:_t)+o;null!=B.sendBeacon?B.sendBeacon(s,JSON.stringify(c)):fetch(s,{mode:"cors",credentials:"include",method:"POST",body:JSON.stringify(c),headers:{"Content-Type":"text/plain"}}),e.disconnect()}}))}));return e.observe({type:"resource",buffered:!0}),t}();D(St,Date.now().toString()),xt(wt+t).then((n=>{r[0]([n.id,t])})).catch((t=>{}))}(i)}catch(t){}let s=t.length>0&&null!=t.find((t=>n(t,"rubiconproject.com")))&&function(){var t,n;let e=g("iframe","magnite",$);return e.src="https://secure-assets.rubiconproject.com/utils/xapi/multi-sync.html?p=pbs-adaptmx",e.width=e.height="1",b(e,"style","display:none;"),w(null!=(n=null!=(t=$.head)?t:$.body)?n:$.documentElement,e),!0}();try{d=e.amuid,h=i,Promise.all(["cb","_cb","callback"].map((t=>function(t,e,r){if(null==t)return a(tt("NOC"));try{let u=new URL(G.href);if(u&&null!=Mt(u).get(r)){let i=Mt(u).get(r),o=rt(t),c=n(null!=i?i:"","$UID")?i.replace("$UID",null!=o?o:""):i+o,s=new URL(c),a=Mt(s);a.delete("gdpr"),a.delete("gdpr_consent"),a.delete("us_privacy");let d=s.toString()+e;return"iframe"===Mt(u).get("_cbt")?l((t=>{t(G.href=d)})):f((new Image).src=d)}}catch(t){return a(t)}return f("")}(d,h,t).catch((t=>null)))))}catch(t){}var d,h;let p=n(B.userAgent,"Safari/")&&null===B.Lr&&!n(B.userAgent,"Chrome/"),m=x(dt),v=null!=m?parseInt(m,10):0,_=Date.now()-(isNaN(v)?0:v)>36e5;if(null!=e.amuid&&_&&!p){let n=function(t,n){let e=rt(t);return It.filter((t=>{let[,,n]=t;return y(n)})).map((t=>{let[r,l]=t;return l&&""===n?null:r+e+n})).filter(Ct)}(e.amuid,i);t.push(...n),t.push("https://ib.adnxs.com/prebid/setuid?bidder=amx&uid="+rt(e.amuid)+i),D(dt,z(Date.now()))}S(parent,"||am.uk."+e.amuid);let P=null,N=Et.getData();t.forEach((t=>{J(t,N)&&(P=L(t,N))})),null!=P&&t.push(P),s&&(t=t.filter((t=>!n(t,"rubiconproject.com"))));let k=Q.parent,j=p?[]:t.map((t=>R(t,N)));j.push(f(new Ot("t1"))),Promise.all(j).then((t=>{let r=t.length,l=t.filter((t=>!t.mr())).length,u=t.reduce(((t,n)=>t+n.rtt),0)/(1*r);try{let t=x(ft),r=null!=t&&n(t,"#")?t:e.amuid;S(k,{type:"uid",Rr:["amx",r]})}catch(t){}let i=O();null==i||null==i.d||n(i.l,$.domain)||function(t){let n=!1,e=()=>{n||(n=!0,function(t){let n=JSON.stringify(localStorage),e=$.cookie;S(window,["l",$.domain,[n,e]],"https://"+t.d)}(i))};Z(e,5e3),["unload","onbeforeunload"].forEach((t=>Q.addEventListener(t,e)))}(),D("__amuidst.1",JSON.stringify({cn:r,cn2:l,cn3:u}))}))}))),Z((()=>{var t;t=i,Jt.Ir().then((n=>{n||(Jt.Mr(),t())}))}),r(300)+50)}}();
//# sourceMappingURL=cframe.js.map