Download as txt, pdf, or txt
Download as txt, pdf, or txt
You are on page 1of 2

(function(){/*

Copyright The Closure Library Authors.


SPDX-License-Identifier: Apache-2.0
*/
'use strict';function g(){return new h(a=>a(void 0))}function l(a,b){if(!a.h)if(b
instanceof h)m(b,c=>{l(a,c)});else{a.h=!0;a.i=b;for(b=0;b<a.g.length;+
+b)n(a,a.g[b]);a.g=[]}}function m(a,b){new h(c=>{n(a,e=>{c(b(e))})})}function
n(a,b){a.h?b(a.i):a.g.push(b)}class h{constructor(a){this.h=!
1;this.g=[];a(b=>{l(this,b)})}};function p(a){if(!a)throw Error("functionToExecute
must not be truthy.");};function q(){return/\d+\.\d+\.\d+(-.*)?/.test("1.3.3-
google_20200427")}function r(){const a=["1","3","3"],b=["1","0","3"];for(let
c=0;3>c;c++){const e=parseInt(a[c],10),d=parseInt(b[c],10);if(e>d)break;else
if(e<d)return!1}return!0};function t(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 u(a){return new
v(a.omid_message_guid,a.omid_message_method,a.omid_message_version,a.omid_message_a
rgs)}
function w(a){const b={["omid_message_guid"]:a.h,["omid_message_method"]:a.method,
["omid_message_version"]:a.version};void 0!==a.g&&(b.omid_message_args=a.g);return
b}class v{constructor(a,b,c,e)
{this.h=a;this.method=b;this.version=c;this.g=e}};class x{constructor(a)
{this.h=a}};function y(a,b){return a&&(a[b]||(a[b]={}))};function z()
{return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,a=>{{let
b=16*Math.random()|0;a="y"===a?(b&3|8).toString(16):b.toString(16)}return
a})};function A(...a){B(()=>{throw Error("Could not complete the test successfully
- ",...a);},()=>console.error(...a))}function B(a,b){"undefined"!==typeof
jasmine&&jasmine?a():"undefined"!==typeof
console&&console&&console.error&&b()};const C=eval("this");var D=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 C&&C)return C;throw Error("Could not determine
global object context.");}();function E(a){try{return a.frames?!!
a.frames.omid_v1_present:!1}catch(b){return!1}};class F extends x{constructor(a)
{super(a);this.handleExportedMessage=F.prototype.i.bind(this)}sendMessage(a,b=this.
h){if(!b)throw Error("Message destination must be defined at construction time or
when sending the message.");b.handleExportedMessage(w(a),this)}i(a,b)
{t(a)&&this.g&&this.g(u(a),b)}};function G(a){return null!=a&&"undefined"!==typeof
a.top&&null!=a.top}function H(a){if(a===D)return!1;try{if("undefined"===typeof
a.location.hostname)return!0}catch(b){return!0}return!1};class I extends
x{constructor(a,b=D){super(b);a.addEventListener("message",c=>{if("object"===typeof
c.data){var
e=c.data;t(e)&&c.source&&this.g&&this.g(u(e),c.source)}})}sendMessage(a,b=this.h)
{if(!b)throw Error("Message destination must be defined at construction time or
when sending the message.");b.postMessage(w(a),"*")}};const
J=["omid","v1_VerificationServiceCommunication"],K=["omidVerificationProperties","s
erviceWindow"];function L(a,b){return b.reduce((c,e)=>c&&c[e],a)};function
M(a,b,c,...e){if(a.g){var d=z();c&&(a.i[d]=c);c=q()&&r()?
e:JSON.stringify(e);a.g.sendMessage(new v(d,`VerificationService.${b}`,"1.3.3-
google_20200427",c))}}function N(a,b){p(b);a.h?a.h.registerSessionObserver(b,void
0,a.j):M(a,"addSessionListener",b,void 0,a.j)}function O(a,b){p(b);a.h?
a.h.addEventListener("geometryChange",b):M(a,"addEventListener",b,"geometryChange")
}
class P{constructor(a){if(!a){var b;"undefined"===typeof b&&"undefined"!==typeof
window&&window&&(b=window);b=G(b)?b:D;a=[];var c=L(b,K);c&&a.push(c);a.push(G(b)?
b.top:D);a:{for(const f of a){b:{a=b;c=f;var e=E;if(!H(c))try{const k=L(c,J);if(k)
{var d=new F(k);break b}}catch(k){}d=e(c)?new I(a,c):null}if(a=d)break
a}a=null}}if(this.g=a)this.g.g=this.l.bind(this);else
if(d=(d=D.omid3p)&&"function"===typeof
d.registerSessionObserver&&"function"===typeof d.addEventListener?
d:null)this.h=d;this.i={};this.j=
(d=D.omidVerificationProperties)?d.injectionId:void 0}l(a){const
b=a.method,c=a.h;a=a.g;if("response"===b&&this.i[c]){var e=q()&&r()?a?a:
[]:a&&"string"===typeof a?JSON.parse(a):
[];this.i[c].apply(this,e)}"error"===b&&window.console&&A(a)}}
(function(a,b,c="undefined"===typeof omidExports?null:omidExports)
{c&&(a=a.split("."),a.slice(0,a.length-1).reduce(y,c)[a[a.length-1]]=b)})
("OmidVerificationClient",P);function Q(a){a.i?(a.g=new h(b=>{const c=new
h(d=>{N(a.h,f=>{"sessionStart"==f.type&&d("app"==f.data.context.environment)})}),e=
new h(d=>{O(a.h,f=>{f=f.data;const k=f.adView.reasons;k&&-1!=k.indexOf("hidden")||
(f=f.adView,f=f.onScreenContainerGeometry||f.onScreenGeometry,(f=!!
(f&&f.width&&f.height))&&d())})});m(c,d=>{d?m(e,()=>{b()}):b()})}),m(a.g,()=>{a.i=!
1})):a.g=g()}class R{constructor(){var a=this.h=new P;this.j=!(!a.g&&!
a.h);this.g=null;this.i=this.j}};window.omrhp=function(a){var b=m,c=new R;c.g||
Q(c);b(c.g,a)};}).call(this);

You might also like