Created
August 14, 2019 04:28
-
-
Save KelvinJin/f527eaca54e8ad53904ec196421a61f5 to your computer and use it in GitHub Desktop.
OM Tracking JS
This file contains 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
;(function(omidGlobal) { | |
'use strict';var k,aa='function'==typeof Object.defineProperties?Object.defineProperty:function(a,b,c){a!=Array.prototype&&a!=Object.prototype&&(a[b]=c.value)},m='undefined'!=typeof window&&window===this?this:'undefined'!=typeof global&&global?global:this;function ba(){ba=function(){};m.Symbol||(m.Symbol=ca)}var da=0;function ca(a){return'jscomp_symbol_'+(a||'')+da++} | |
function n(){ba();var a=m.Symbol.iterator;a||(a=m.Symbol.iterator=m.Symbol('iterator'));'function'!=typeof Array.prototype[a]&&aa(Array.prototype,a,{configurable:!0,writable:!0,value:function(){return ea(this)}});n=function(){}}function ea(a){var b=0;return fa(function(){return b<a.length?{done:!1,value:a[b++]}:{done:!0}})}function fa(a){n();a={next:a};a[m.Symbol.iterator]=function(){return this};return a}function p(a){n();ba();n();var b=a[Symbol.iterator];return b?b.call(a):ea(a)} | |
function q(a,b){function c(){}c.prototype=b.prototype;a.pa=b.prototype;a.prototype=new c;a.prototype.constructor=a;for(var d in b)if('prototype'!=d)if(Object.defineProperties){var e=Object.getOwnPropertyDescriptor(b,d);e&&Object.defineProperty(a,d,e)}else a[d]=b[d]}function r(a){if(!(a instanceof Array)){a=p(a);for(var b,c=[];!(b=a.next()).done;)c.push(b.value);a=c}return a} | |
function t(a,b){if(b){var c=m;a=a.split('.');for(var d=0;d<a.length-1;d++){var e=a[d];e in c||(c[e]={});c=c[e]}a=a[a.length-1];d=c[a];b=b(d);b!=d&&null!=b&&aa(c,a,{configurable:!0,writable:!0,value:b})}}t('Object.assign',function(a){return a?a:function(a,c){for(var b=1;b<arguments.length;b++){var e=arguments[b];if(e)for(var f in e)Object.prototype.hasOwnProperty.call(e,f)&&(a[f]=e[f])}return a}}); | |
t('Object.values',function(a){return a?a:function(a){var b=[],d;for(d in a)Object.prototype.hasOwnProperty.call(a,d)&&b.push(a[d]);return b}});t('Object.is',function(a){return a?a:function(a,c){return a===c?0!==a||1/a===1/c:a!==a&&c!==c}});t('Array.prototype.includes',function(a){return a?a:function(a,c){var b=this;b instanceof String&&(b=String(b));var e=b.length;for(c=c||0;c<e;c++)if(b[c]==a||Object.is(b[c],a))return!0;return!1}});function ha(a){return/\d+\.\d+\.\d+(-.*)?/.test(a)} | |
function ia(a){a=a.split('-')[0].split('.');for(var b=['1','0','3'],c=0;3>c;c++){var d=parseInt(a[c],10),e=parseInt(b[c],10);if(d>e)break;else if(d<e)return!1}return!0};function ja(a,b){return ha(a)&&ia(a)?b?b:[]:b&&'string'===typeof b?JSON.parse(b):[]};var u={ea:'loaded',ka:'start',Y:'firstQuartile',fa:'midpoint',la:'thirdQuartile',X:'complete',ga:'pause',ia:'resume',W:'bufferStart',V:'bufferFinish',ja:'skipped',na:'volumeChange',ha:'playerStateChange',S:'adUserInteraction'},ka={aa:'generic',ma:'video'},la={F:'native',ba:'html'},ma={F:'native',ca:'javascript',NONE:'none'},na={$:'full',da:'limited'},oa={U:'backgrounded',Z:'foregrounded'},qa={T:'app',oa:'web'};function v(a,b,c,d){this.b=a;this.method=b;this.version=c;this.a=d}function ra(a){return!!a&&void 0!==a.omid_message_guid&&void 0!==a.omid_message_method&&void 0!==a.omid_message_version&&'string'===typeof a.omid_message_guid&&'string'===typeof a.omid_message_method&&'string'===typeof a.omid_message_version&&(void 0===a.omid_message_args||void 0!==a.omid_message_args)}function sa(a){return new v(a.omid_message_guid,a.omid_message_method,a.omid_message_version,a.omid_message_args)} | |
function ta(a){var b={};b=(b.omid_message_guid=a.b,b.omid_message_method=a.method,b.omid_message_version=a.version,b);void 0!==a.a&&(b.omid_message_args=a.a);return b};function ua(a){this.b=a};function va(a){var b=a.document.createElement('iframe');b.id='omid_v1_present';b.name='omid_v1_present';b.style.display='none';a.document.body.appendChild(b)}function wa(){var a=x,b=new MutationObserver(function(c){c.forEach(function(c){'BODY'===c.addedNodes[0].nodeName&&(va(a),b.disconnect())})});b.observe(a.document.documentElement,{childList:!0})};function z(a){this.b=a;this.handleExportedMessage=z.prototype.c.bind(this)}q(z,ua);z.prototype.sendMessage=function(a,b){b=void 0===b?this.b:b;if(!b)throw Error('Message destination must be defined at construction time or when sending the message.');b.handleExportedMessage(ta(a),this)};z.prototype.c=function(a,b){ra(a)&&this.a&&this.a(sa(a),b)};function xa(){return'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g,function(a){var b=16*Math.random()|0;return'y'===a?(b&3|8).toString(16):b.toString(16)})};function A(a){for(var b=[],c=0;c<arguments.length;++c)b[c-0]=arguments[c];ya(function(){throw new (Function.prototype.bind.apply(Error,[null].concat(['Could not complete the test successfully - '],r(b))));},function(){return console.error.apply(console,[].concat(r(b)))})}function za(a){for(var b=[],c=0;c<arguments.length;++c)b[c-0]=arguments[c];ya(function(){},function(){return console.error.apply(console,[].concat(r(b)))})} | |
function ya(a,b){'undefined'!==typeof jasmine&&jasmine?a():'undefined'!==typeof console&&console&&console.error&&b()};var Aa=eval('this'),x=function(){if('undefined'!==typeof omidGlobal&&omidGlobal)return omidGlobal;if('undefined'!==typeof global&&global)return global;if('undefined'!==typeof window&&window)return window;if('undefined'!==typeof Aa&&Aa)return Aa;throw Error('Could not determine global object context.');}();function B(a,b){this.b=b=b?b:x;var c=this;a.addEventListener('message',function(a){if('object'===typeof a.data){var b=a.data;ra(b)&&a.source&&c.a&&c.a(sa(b),a.source)}})}q(B,ua);B.prototype.sendMessage=function(a,b){b=b?b:this.b;if(!b)throw Error('Message destination must be defined at construction time or when sending the message.');b.postMessage(ta(a),'*')};function Ba(a,b){this.y=this.x=0;this.width=a;this.height=b};function D(a,b){this.x=null!=a.x?a.x:a.left;this.y=null!=a.y?a.y:a.top;this.width=a.width;this.height=a.height;this.endX=this.x+this.width;this.endY=this.y+this.height;this.adSessionId=a.adSessionId||void 0;this.isFriendlyObstructionFor=a.isFriendlyObstructionFor||[];this.clipsToBounds=void 0!==a.clipsToBounds?!0===a.clipsToBounds:!0;this.childViews=a.childViews||[];this.isCreative=a.isCreative||!1;this.a=b}function Ca(a){var b={};return b.width=a.width,b.height=a.height,b} | |
function E(a){var b={};return Object.assign({},Ca(a),(b.x=a.x,b.y=a.y,b))}function F(a){var b=E(a),c={};return Object.assign({},b,(c.endX=a.endX,c.endY=a.endY,c))}function Da(a,b,c){a.x+=b;a.y+=c;a.endX+=b;a.endY+=c}D.prototype.w=function(a){if(!a)return!1;a=E(a);var b=a.y,c=a.width,d=a.height;return this.x===a.x&&this.y===b&&this.width===c&&this.height===d};function Ea(a){return a.width*a.height};function Fa(a,b){a=E(a);for(var c=[],d=[],e=0;e<b.length;e++){var f=E(b[e]),h=Math.max(a.y,f.y),g=Math.min(a.x+a.width,f.x+f.width),l=Math.min(a.y+a.height,f.y+f.height);G(c,Math.max(a.x,f.x));G(c,g);G(d,h);G(d,l)}c=c.sort(function(a,b){return a-b});d=d.sort(function(a,b){return a-b});return{P:c,R:d}}function G(a,b){-1===a.indexOf(b)&&a.push(b)};function Ga(){this.a=this.b=this.l=this.j=this.c=this.i=void 0;this.m=0;this.g=[];this.f=[];this.h=[]}Ga.prototype.w=function(a){return a?JSON.stringify(H(this))===JSON.stringify(H(a)):!1}; | |
function H(a){var b=[],c={viewport:a.i,adView:{percentageInView:a.m,reasons:a.h}};if(a.b){c.adView.geometry=E(a.b);c.adView.onScreenGeometry=E(a.a);for(var d=0;d<a.f.length;d++)b.push(E(a.f[d]));c.adView.onScreenGeometry.obstructions=b;a.j&&a.l&&(c.adView.containerGeometry=E(a.j),c.adView.onScreenContainerGeometry=E(a.l),c.adView.measuringElement=!0)}return c} | |
function Ha(a,b){b=Ca(b);a.i={};a.i.width=b.width;a.i.height=b.height;a.c={};a.c.x=0;a.c.y=0;a.c.width=b.width;a.c.height=b.height;a.c.endX=b.width;a.c.endY=b.height}function Ia(a,b){var c={};c.x=Math.max(a.x,b.x);c.y=Math.max(a.y,b.y);c.endX=Math.min(a.endX,b.endX);c.endY=Math.min(a.endY,b.endY);c.width=Math.max(0,c.endX-c.x);c.height=Math.max(0,c.endY-c.y);return c}function Ja(a,b){return a.width<b.width||a.height<b.height} | |
function Ka(a){var b=Ea(a.b);if(b){var c=Ea(a.a);var d=a.f,e=0;if(0<d.length){var f=Fa(a.a,d),h=f.P;f=f.R;for(var g=0;g<h.length-1;g++)for(var l=(h[g]+(h[g]+1))/2,J=h[g+1]-h[g],y=0;y<f.length-1;y++){for(var L=(f[y]+(f[y]+1))/2,pa=f[y+1]-f[y],W=!1,M=0;M<d.length;M++){var w=E(d[M]);if(w.x<l&&w.x+w.width>l&&w.y<L&&w.y+w.height>L){W=!0;break}}W&&(e+=Math.round(J)*Math.round(pa))}}b=Math.round((c-e)/b*100);a.m=Math.max(b,0)}} | |
function I(a,b){for(var c=!1,d=0;d<a.h.length;d++)a.h[d]===b&&(c=!0);c||a.h.push(b)};function La(){}function Ma(a,b,c,d){var e=new Ga(0);b=new D(b,!1);Ha(e,b);Na(a,b,e,d);if('backgrounded'===c)I(e,'backgrounded');else if(e.b){for(a=0;a<e.g.length;a++){c=e.g[a];if(0!==c.width&&0!==c.height&&e.a){d=F(e.a);b=d.y;var f=d.endX,h=d.endY;c=!(c.endX<=d.x||c.x>=f||c.endY<=b||c.y>=h)}else c=!1;if(c){a:{c=e.g[a];for(d=0;d<e.f.length;d++)if(e.f[d].w(c)){c=!0;break a}c=!1}c=!c}c&&(I(e,'obstructed'),e.f.push(e.g[a]))}Ka(e)}else I(e,'notFound');return e} | |
function Na(a,b,c,d){var e=b.isCreative?!0:b.adSessionId===d;if(e){c.b=b;var f=F(c.b);a=Ia(c.c,f);Ja(a,f)&&I(c,'clipped');c.a=new D(a,!1)}else if(f=!0,b.a&&(f=-1!==b.isFriendlyObstructionFor.indexOf(d)?!1:!1===b.clipsToBounds),f)for(var h=b.childViews,g=0;g<h.length;g++)f=!!c.b,Na(a,new D(h[g],f),c,d);!e&&c.b&&(b.a?-1!==b.isFriendlyObstructionFor.indexOf(d)||c.g.push(b):(e=F(b),d=F(c.a),E(c.a),a=c.a,0!==a.width&&0!==a.height&&b.clipsToBounds&&(b=Ia(d,e),Ja(b,d)&&(I(c,'clipped'),c.a=new D(b,!1)))))} | |
;function Oa(){return{apiVersion:'1.0',accessMode:'limited',environment:'app',omidJsInfo:{omidImplementer:'omsdk',serviceVersion:'1.2.17-iab1276'}}}function Pa(){this.adSessionId=null;this.c=Oa();this.l='foregrounded';this.b=this.a='none';this.f=this.h=this.g=this.C=this.B=this.m=null;this.o=!0}var K;function N(){K||(K=new Pa);return K};function Qa(a,b){this.b=a;this.c=b}m.Object.defineProperties(Qa.prototype,{a:{configurable:!0,enumerable:!0,get:function(){return this.b}},origin:{configurable:!0,enumerable:!0,get:function(){return this.c}}});function Ra(){this.b=[];this.c=[];this.g=[];this.h=[];this.f={};this.a=N()}function Sa(a){a.b=[];a.c=[];a.g=[];a.h=[];a.f={};K.adSessionId=null;K.c=Oa();K.v=void 0;K.A=void 0;K.i=null;K.u=null;K.j=null;K.l='foregrounded';K.a='none';K.b='none';K.m=null;K.B=null;K.C=null;K.g=null;K.h=null;K.f=null;K.o=!0}function Ta(a,b){a.a&&a.a.adSessionId&&!1!==Ua(b)&&a.g.filter(function(a){return a.type===b.a.type}).forEach(function(c){return a.i(c.s,b.a)})} | |
function Va(a,b,c){a.a&&a.a.adSessionId&&a.b.filter(function(a){return a.a.type===b&&Ua(a)}).map(function(a){return a.a}).forEach(c)}function Ua(a){var b=a.a.type,c=-1!==Object.values(u).indexOf(b)&&'volumeChange'!==b;return'impression'===b?a.origin===N().b:c?a.origin===N().a:!0}function Wa(a,b,c){'video'===b?Xa(a,c):(a.g.push({type:b,s:c}),Va(a,b,c))}function Xa(a,b){Object.keys(u).forEach(function(c){c=u[c];a.g.push({type:c,s:b});Va(a,c,b)})} | |
function Ya(a,b,c){a.h.push({O:c,s:b});a.c.forEach(function(d){var e=Za(d);'sessionStart'===d.a.type&&(e.data.verificationParameters=c&&a.f[c]);a.i(b,e)})}function $a(a){return a.b.some(function(a){return'impression'===a.a.type})||a.c.some(function(a){return'impression'===a.a.type})}function O(a,b,c){var d=P(a,'sessionError','native',{errorType:b,message:c});a.c.push(d);a.h.forEach(function(b){a.i(b.s,d.a)})} | |
function ab(a,b){a.f=Object.assign(a.f,b);if(b=a.a.c){var c=P(a,'sessionStart','native',{context:b});a.c.push(c);a.h.forEach(function(b){var d=b.s,f=Za(c);b=b.O;f.data.verificationParameters=b&&a.f[b];a.i(d,f)},a);bb(a)}}function cb(a){var b=a.h,c=P(a,'sessionFinish','native');a.c.push(c);Sa(a);b.forEach(function(b){return a.i(b.s,c.a)})}Ra.prototype.i=function(a,b){for(var c=[],d=1;d<arguments.length;++d)c[d-1]=arguments[d];try{a.apply(null,[].concat(r(c)))}catch(e){za(e)}}; | |
function db(a,b){var c=a.a.C;var d=(d=N().j)?H(d).viewport:void 0;var e=(e=N().j)?H(e).adView:void 0;b=P(a,'impression',b,{mediaType:c,viewport:d,adView:e});a.b.push(b);Ta(a,b)}function Q(a,b,c,d){'start'!==b&&'volumeChange'!==b||null!=(d&&d.deviceVolume)||(d.deviceVolume=a.a.m);'start'!==b&&'volumeChange'!==b||null==(d&&d.videoPlayerVolume)||(a.a.B=d.videoPlayerVolume);b=P(a,b,c,d);a.b.push(b);Ta(a,b)} | |
function bb(a){var b=a.a.a,c=a.b.filter(function(a){return Object.values(u).includes(a.a.type)&&a.origin===b}).map(function(a){return a.a}),d=a.a.adSessionId||'';c=p(c);for(var e=c.next();!e.done;e=c.next()){e=e.value;e.adSessionId||(e.adSessionId=d);for(var f=p(a.g),h=f.next();!h.done;h=f.next())h=h.value,h.type===e.type&&h.s(e)}}function eb(a,b){return'none'!==a.a.b&&a.a.b!==b?(A('Impression event is owned by '+(a.a.b+', not '+b+'.')),!1):!0} | |
function fb(a,b){return'none'!==a.a.a&&a.a.a!==b?(A('Video events are owned by '+(a.a.a+', not '+b+'.')),!1):!0}function P(a,b,c,d){return new Qa({adSessionId:a.a.adSessionId||'',timestamp:(new Date).getTime(),type:b,data:d},c)}function Za(a){a=a.a;return{adSessionId:a.adSessionId,timestamp:a.timestamp,type:a.type,data:a.data}};function R(a,b,c){'container'===b&&void 0!==a.a.v&&a.a&&null!=a.a.adSessionId&&(a.a.i=Ma(a.b,a.a.v,a.a.l,a.a.adSessionId));'creative'===b&&a.a.A&&(a.a.u=Ma(a.b,a.a.A,a.a.l,a.a.adSessionId));if(a.a.i)if(a.a.u){b=new Ga(0);var d=a.a.i,e=a.a.u,f=d.i,h=d.b,g=d.a,l=e.b;e=e.a;f&&h&&g&&l&&e&&(Ha(b,f),b.j=new D(h,!1),b.l=new D(g,!1),b.g=Object.assign([],d.g),b.f=Object.assign([],d.f),b.h=Object.assign([],d.h),d=b.j.x,f=b.j.y,l=new D(l,!1),e=new D(e,!1),Da(l,d,f),Da(e,d,f),b.b=l,b.a=Ia(e,g),-1===b.h.indexOf('backgrounded')&& | |
Ka(b))}else b=a.a.i;else b=null;g=a.a.j;if(b&&!b.w(g)||c)g=H(b),c&&(g.adView.reasons=g.adView.reasons||[c]),c=a.c,g=P(c,'geometryChange','native',{viewport:g.viewport,adView:g.adView}),c.b.push(g),Ta(c,g),a.a.j=b};function gb(a,b,c){this.g=a;this.A=b;this.u=c;this.c=N();this.a=null;this.b=this.h=void 0;this.v=!0;S(this)}function S(a){if(!a.a){var b;a:{if((b=a.g.document)&&b.getElementsByClassName&&(b=b.getElementsByClassName('omid-element'))){if(1==b.length){b=b[0];break a}1<b.length&&a.v&&(O(a.u,'generic',"More than one element with 'omid-element' class name."),a.v=!1)}b=null}b&&(b.tagName&&'video'===b.tagName.toLowerCase()?a.c.h=b:a.c.g=b,hb(a))}} | |
function hb(a){a.c.h?(a.a=a.c.h,a.m()):a.c.g&&(a.a=a.c.g,'iframe'===a.a.tagName.toLowerCase()?a.c.f&&a.m():a.m())}function ib(a){a.b&&a.h&&(a.a.tagName&&'iframe'===a.a.tagName.toLowerCase()?a.c.f&&(a.b.isCreative=!1,jb(a),kb(a)):(a.c.f?(a.b.isCreative=!1,jb(a)):a.b.isCreative=!0,kb(a)))}function kb(a){a.c.A=a.h;R(a.A,'creative')} | |
function jb(a){if(a.c.f){var b=new D(a.c.f,!1);Da(b,a.b.x,a.b.y);b.clipsToBounds=!0;b.isCreative=!0;for(var c=0;c<a.b.childViews.length;c++)if(a.b.childViews[c].isCreative){a.b.childViews[c]=b;return}a.b.childViews.push(b)}};function lb(a,b,c){return mb(a,'setInterval')(b,c)}function nb(a,b){mb(a,'clearInterval')(b)}function ob(a,b){mb(a,'clearTimeout')(b)}function mb(a,b){return a.a&&a.a[b]?a.a[b]:pb(a,b)} | |
function qb(a,b,c,d){if(a.a.document&&a.a.document.body){var e=a.a.document.createElement('img');e.width=1;e.height=1;e.style.display='none';e.src=b;c&&e.addEventListener('load',function(){return c()});d&&e.addEventListener('error',function(){return d()});a.a.document.body.appendChild(e)}else pb(a,'sendUrl')(b,c,d)}function pb(a,b){if(a.a&&a.a.omidNative&&a.a.omidNative[b])return a.a.omidNative[b].bind(a.a.omidNative);throw Error('Native interface method "'+b+'" not found.');};function rb(a,b,c,d){gb.call(this,a,b,d);this.f=void 0;this.i=c}q(rb,gb);rb.prototype.o=function(){void 0!==this.f&&(nb(this.i,this.f),this.f=void 0)};rb.prototype.m=function(){var a=this;this.a?void 0===this.f&&(this.f=lb(this.i,function(){return sb(a)},200),sb(this)):this.f=void 0}; | |
function sb(a){if(void 0!==a.f){var b=new D(new Ba(a.g.innerWidth,a.g.innerHeight),!1),c=a.a.getBoundingClientRect();if(null==c.x||isNaN(c.x))c.x=c.left;if(null==c.y||isNaN(c.y))c.y=c.top;c=new D(c,!1);b.w(a.h)&&c.w(a.b)||(a.b=c,a.b.clipsToBounds=!0,a.h=b,a.h.childViews.push(a.b),ib(a))}};function tb(a,b,c){gb.call(this,a,b,c);this.l=this.i=this.j=this.f=void 0}q(tb,gb);tb.prototype.o=function(){this.f&&this.f.disconnect();ub(this)};tb.prototype.m=function(){this.a&&(this.f||(this.f=vb(this),this.f.observe(this.a)),wb(this.a)&&xb(this))};function ub(a){a.j&&(a.j.disconnect(),a.j=void 0);a.i&&(a.i.disconnect(),a.i=void 0);a.l&&((0,a.g.removeEventListener)('resize',a.l),a.l=void 0)}function wb(a){a=a.getBoundingClientRect();return!a.width||!a.height} | |
function vb(a){return new a.g.IntersectionObserver(function(b){try{if(b.length){for(var c=b[0],d=1;d<b.length;d++)b[d].time>c.time&&(c=b[d]);b=c;a.h=new D(b.rootBounds,!1);a.b=new D(b.boundingClientRect,!1);a.b.clipsToBounds=!0;a.h.childViews.push(a.b);ib(a)}}catch(e){a.o(),O(a.u,'generic','Problem handling IntersectionObserver callback: '+e.message)}},{root:null,rootMargin:'0px',threshold:[0,.1,.2,.3,.4,.5,.6,.7,.8,.9,1]})} | |
function xb(a){a.g.ResizeObserver?a.j||(a.j=yb(a,function(){return zb(a)}),a.j.observe(a.a)):(a.l||(a.l=function(){return zb(a)},(0,a.g.addEventListener)('resize',a.l)),a.i||(a.i=new MutationObserver(function(){return zb(a)}),a.i.observe(a.a,{childList:!1,attributes:!0,subtree:!1})))}function zb(a){a.a&&!wb(a.a)&&(a.f&&a.a&&(a.f.unobserve(a.a),a.f.observe(a.a)),ub(a))}function yb(a,b){return new a.g.ResizeObserver(b)};function T(a){return'object'===typeof a}function Ab(a){return'number'===typeof a&&!isNaN(a)&&0<=a}function U(a){return'string'===typeof a}function V(a,b){return U(a)&&-1!==Object.values(b).indexOf(a)};function Bb(a){if(!a.b||!a.b.document)throw Error('OMID Service Script is not running within a window.');var b=a.a;a.a=[];for(var c=0;c<b.length;c++){var d=a,e=b[c],f=c,h=e,g=N().o;h=h.accessMode;V(h,na)&&(g='limited'==h);var l=f,J=e.resourceUrl;f=d.b.document;h=f.createElement('iframe');g&&(h.sandbox='allow-scripts');h.id='omid-verification-script-frame-'+l;h.style.display='none';g=J.replace(/"/g,'"');h.srcdoc='<html><head>\n<script type="text/javascript" src="'+g+'">\x3c/script>\n</head><body></body></html>'; | |
f.body.appendChild(h);g=e.vendorKey;e=e.verificationParameters;g=void 0===g?'':g;e=void 0===e?'':e;g&&'string'===typeof g&&''!==g&&e&&'string'===typeof e&&''!==e&&(d.c.f[g]=e)}};function Cb(a,b,c){var d=this;this.b=a;this.a=b;this.c=N();this.g=c;this.f=!1;this.registerSessionObserver(function(a){return Db(d,a)})}Cb.prototype.registerSessionObserver=function(a){Ya(this.b,a)};Cb.prototype.error=function(a,b){O(this.b,a,b)};function X(a,b,c){'impression'==b?eb(a.b,'javascript')&&(db(a.b,'javascript'),a.a&&S(a.a)):('loaded'==b?Q(a.b,b,'javascript',c):'javascript'===a.c.a&&Q(a.b,b,'javascript',c),['loaded','start'].includes(b)&&a.a&&S(a.a))} | |
function Db(a,b){if('sessionStart'===b.type){a.f=!0;try{Bb(a.g)}catch(c){A(c.message)}}'sessionFinish'===b.type&&(a.f=!1,a.registerSessionObserver(function(b){return Db(a,b)}))}Cb.prototype.setClientInfo=function(a,b,c){var d=this.c.c||{};d.omidJsInfo=Object.assign({},d.omidJsInfo,{sessionClientVersion:a,partnerName:b,partnerVersion:c});this.c.c=d;return this.c.c.omidJsInfo.serviceVersion};function Eb(a,b){b=b?b:omidGlobal;this.a=a;this.f=b;this.b=new z;this.f.omid=this.f.omid||{};this.f.omid.v1_SessionServiceCommunication=this.b;this.c=b&&b.addEventListener&&b.postMessage?new B(b):null;this.b.a=this.g.bind(this);this.c&&(this.c.a=this.h.bind(this))}Eb.prototype.g=function(a,b){Fb(this,a,b,this.b)};Eb.prototype.h=function(a,b){Fb(this,a,b,this.c)}; | |
function Fb(a,b,c,d){function e(a){for(var b=[],e=0;e<arguments.length;++e)b[e-0]=arguments[e];b=new v(f,'response',g,ha(g)&&ia(g)?b:JSON.stringify(b));d.sendMessage(b,c)}var f=b.b,h=b.method,g=b.version;b=ja(g,b.a);try{Gb(a,h,e,b)}catch(l){d.sendMessage(new v(f,'error',g,'\n name: '+l.name+'\n message: '+l.message+'\n filename: '+l.filename+'\n lineNumber: '+l.lineNumber+'\n columnNumber: '+l.columnNumber+'\n stack: '+l.stack+'\n toString(): '+l.toString()), | |
c)}} | |
function Gb(a,b,c,d){switch(b){case 'SessionService.registerAdEvents':eb(a.a.b,'javascript');break;case 'SessionService.registerVideoEvents':fb(a.a.b,'javascript');break;case 'SessionService.registerSessionObserver':a.a.registerSessionObserver(c);break;case 'SessionService.setSlotElement':c=p(d).next().value;a=a.a;a.c.g=c;a.a&&hb(a.a);break;case 'SessionService.setVideoElement':c=p(d).next().value;a=a.a;a.c.h=c;a.a&&hb(a.a);break;case 'SessionService.setElementBounds':c=p(d).next().value;a=a.a;a.c.f= | |
c;a.a&&hb(a.a);a.a&&ib(a.a);break;case 'SessionService.startSession':A('Session start from JS is not supported in mobile app.');break;case 'SessionService.finishSession':A('Session finish from JS is not supported in mobile app.');break;case 'SessionService.impressionOccurred':X(a.a,'impression');break;case 'SessionService.loaded':c=p(d).next().value;b={skippable:c.isSkippable,autoPlay:c.isAutoPlay,position:c.position};c.isSkippable&&(b.skipOffset=c.skipOffset);X(a.a,'loaded',b);break;case 'SessionService.start':b= | |
p(d);c=b.next().value;b=b.next().value;X(a.a,'start',{duration:c,videoPlayerVolume:b});break;case 'SessionService.firstQuartile':X(a.a,'firstQuartile');break;case 'SessionService.midpoint':X(a.a,'midpoint');break;case 'SessionService.thirdQuartile':X(a.a,'thirdQuartile');break;case 'SessionService.complete':X(a.a,'complete');break;case 'SessionService.pause':X(a.a,'pause');break;case 'SessionService.resume':X(a.a,'resume');break;case 'SessionService.bufferStart':X(a.a,'bufferStart');break;case 'SessionService.bufferFinish':X(a.a, | |
'bufferFinish');break;case 'SessionService.skipped':X(a.a,'skipped');break;case 'SessionService.volumeChange':c={videoPlayerVolume:p(d).next().value};X(a.a,'volumeChange',c);break;case 'SessionService.playerStateChange':c={state:p(d).next().value};X(a.a,'playerStateChange',c);break;case 'SessionService.adUserInteraction':c={interactionType:p(d).next().value};X(a.a,'adUserInteraction',c);break;case 'SessionService.setClientInfo':var e=p(d);b=e.next().value;d=e.next().value;e=e.next().value;a=a.a.setClientInfo(b, | |
d,e);c(a);break;case 'SessionService.injectVerificationScriptResources':c=p(d).next().value;a=a.a;b=a.g;b.a.push.apply(b.a,[].concat(r(c)));if(a.f)try{Bb(a.g)}catch(f){A(f.message)}break;case 'SessionService.sessionError':b=p(d),c=b.next().value,b=b.next().value,a.a.error(c,b)}};function Y(a,b,c,d,e,f){this.g=a;this.a=b;this.c=c;this.h=d;this.f=f;this.b=N()}k=Y.prototype; | |
k.G=function(a){if(a&&T(a)&&V(a.impressionOwner,ma)&&(!('videoEventsOwner'in a&&null!=a.videoEventsOwner)||V(a.videoEventsOwner,ma))){var b=a.videoEventsOwner;this.b.C=null==b||'none'===b?'display':'video';a&&null!=a.isolateVerificationScripts&&'boolean'===typeof a.isolateVerificationScripts&&(this.b.o=a.isolateVerificationScripts);b=this.a;var c=a.impressionOwner;a=a.videoEventsOwner;$a(b)?A('Impression event has occcured before the event owners have been registered.'):(b.a.b!==c&&'none'===b.a.b&& | |
(b.a.b=c),b.a.a!==a&&'none'===b.a.a&&(b.a.a=a))}}; | |
k.J=function(a,b,c){var d;if(d=T(b)){if(d=V(b.environment,qa)&&V(b.adSessionType,la))d=b.omidNativeInfo,d=T(d)?U(d.partnerName)&&U(d.partnerVersion):!1;d&&(d=b.app,d=T(d)?U(d.libraryVersion)&&U(d.appId):!1)}if(d){d=this.g;c=void 0===c?null:c;null==a&&(a=xa());d.c.adSessionId=a;a=d.c;var e=a.c||{};b.omidJsInfo=Object.assign({},e.omidJsInfo||{},b.omidJsInfo||{});e=b=Object.assign({},e,b);a.o||(a.h?(e.videoElement=a.h,e.accessMode='full'):a.g&&(e.slotElement=a.g,e.accessMode='full'));a.c=b;ab(d.b,c); | |
d.a&&S(d.a)}};k.H=function(){var a=this.g;cb(a.b);a.a.o()};k.M=function(a){T(a)&&Ab(a.x)&&Ab(a.y)&&Ab(a.width)&&Ab(a.height)&&(this.b.v=a,R(this.c,'container'))};k.N=function(a){V(a,oa)&&(this.b.l=a,'backgrounded'===a?R(this.c,'container','backgrounded'):R(this.c,'container'))};k.K=function(a){'impression'===a&&(this.D(),this.f&&S(this.f))};k.D=function(){eb(this.a,'native')&&db(this.a,'native')};k.error=function(a,b){V(a,ka)&&O(this.a,a,b)}; | |
k.I=function(a,b){fb(this.a,'native')&&V(a,u)&&(void 0===b||T(b))&&Q(this.a,a,'native',b)};k.L=function(a){if('none'!==this.a.a.a&&'number'===typeof a&&!isNaN(a)){this.b.m=a;a=this.h;var b=a.a.B;null!=b&&Q(a.b,'volumeChange','native',{videoPlayerVolume:b,deviceVolume:a.a.m})}};Y.prototype.startSession=Y.prototype.J;Y.prototype.error=Y.prototype.error;Y.prototype.finishSession=Y.prototype.H;Y.prototype.publishAdEvent=Y.prototype.K;Y.prototype.publishImpressionEvent=Y.prototype.D; | |
Y.prototype.publishVideoEvent=Y.prototype.I;Y.prototype.setNativeViewHierarchy=Y.prototype.M;Y.prototype.setState=Y.prototype.N;Y.prototype.setDeviceVolume=Y.prototype.L;Y.prototype.init=Y.prototype.G;function Hb(a,b,c){c=c?c:x;this.g=a;this.a=b;this.h={};this.f={};this.c=new z;c.omid=c.omid||{};c.omid.v1_VerificationServiceCommunication=this.c;this.b=null;c&&c.addEventListener&&c.postMessage&&(this.b=new B(c));this.c.a=this.i.bind(this);this.b&&(this.b.a=this.j.bind(this))}function Ib(a,b,c,d){qb(a.a,b,c,d)}function Jb(a,b,c,d){pb(a.a,'downloadJavaScriptResource')(b,c,d)}Hb.prototype.j=function(a,b){this.b&&Kb(this,a,b,this.b)};Hb.prototype.i=function(a,b){Kb(this,a,b,this.c)}; | |
function Kb(a,b,c,d){function e(a){for(var b=[],e=0;e<arguments.length;++e)b[e-0]=arguments[e];b=new v(f,'response',g,ha(g)&&ia(g)?b:JSON.stringify(b));d.sendMessage(b,c)}var f=b.b,h=b.method,g=b.version;b=ja(g,b.a);try{switch(h){case 'VerificationService.addEventListener':var l=p(b).next().value;Wa(a.g,l,e);break;case 'VerificationService.addSessionListener':var J=p(b).next().value;Ya(a.g,e,J);break;case 'VerificationService.sendUrl':var y=p(b).next().value;Ib(a,y,function(){return e(!0)},function(){return e(!1)}); | |
break;case 'VerificationService.setTimeout':var L=p(b),pa=L.next().value,W=L.next().value;a.h[pa]=mb(a.a,'setTimeout')(e,W);break;case 'VerificationService.clearTimeout':var M=p(b).next().value;ob(a.a,a.h[M]);break;case 'VerificationService.setInterval':var w=p(b),Sb=w.next().value,Tb=w.next().value;a.f[Sb]=lb(a.a,e,Tb);break;case 'VerificationService.clearInterval':var Ub=p(b).next().value;nb(a.a,a.f[Ub]);break;case 'VerificationService.injectJavaScriptResource':var Vb=p(b).next().value;Jb(a,Vb, | |
function(a){return e(!0,a)},function(){return e(!1)});break;case 'VerificationService.getVersion':p(b).next();var Wb=N().c.omidJsInfo;e(Wb.serviceVersion)}}catch(C){d.sendMessage(new v(f,'error',g,'\n name: '+C.name+'\n message: '+C.message+'\n filename: '+C.filename+'\n lineNumber: '+C.lineNumber+'\n columnNumber: '+C.columnNumber+'\n stack: '+C.stack+'\n toString(): '+C.toString()+'\n '),c)}};var Z=new Ra,Lb=new function(){var a;this.a=a=void 0===a?omidGlobal:a};new Hb(Z,Lb);var Mb=new function(){var a=new La;this.c=Z;this.b=a;this.a=N()},Nb;if(x){var Ob=x;Nb=Ob.IntersectionObserver&&(Ob.MutationObserver||Ob.ResizeObserver)?new tb(x,Mb,Z):new rb(x,Mb,Lb,Z)}else Nb=null;var Pb=Nb,Qb=new Cb(Z,Pb,new function(){var a=a?a:x;this.c=Z;this.b=a;this.a=[]});x.omidBridge=new Y(Qb,Z,Mb,new function(){var a=N();this.b=Z;this.a=a},0,Pb);new Eb(Qb); | |
if(x.frames&&x.document&&!('omid_v1_present'in x.frames)){var Rb;if(Rb=!x.document.body)Rb='MutationObserver'in x;Rb?wa():x.document.body?va(x):x.document.write('<iframe style="display:none" id="omid_v1_present" name="omid_v1_present"></iframe>')}; | |
}).call(this, this); | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment