(function(){/* Copyright The Closure Library Authors. SPDX-License-Identifier: Apache-2.0 */ 'use strict';var g=this||self;/* SPDX-License-Identifier: Apache-2.0 */ function h(a){h[" "](a);return a}h[" "]=function(){};function l(a){let b=g,c=0;for(;b&&40>c++;){var f=!1;try{var d;if(d=!!b&&null!=b.location.href)b:{try{h(b.foo);d=!0;break b}catch(e){}d=!1}f=d}catch(e){f=!1}if(f&&a(b))break;a:{try{const e=b.parent;if(e&&e!=b){b=e;break a}}catch(e){}b=null}}};function m(){return new n(a=>a(void 0))}function p(a,b){if(!a.h)if(b instanceof n)b.then(c=>{p(a,c)});else{a.h=!0;a.i=b;for(b=0;b{p(this,b)})}then(a){return new n(b=>{q(this,c=>{b(a(c))})})}};function r(a){if(!a)throw Error("functionToExecute must not be truthy.");};function t(){return/\d+\.\d+\.\d+(-.*)?/.test("1.3.3-google_20200427")}function u(){const a=["1","3","3"],b=["1","0","3"];for(let c=0;3>c;c++){const f=parseInt(a[c],10),d=parseInt(b[c],10);if(f>d)break;else if(f{let b=16*Math.random()|0;return"y"===a?(b&3|8).toString(16):b.toString(16)})};function C(...a){D(()=>{throw Error("Could not complete the test successfully - ",...a);},()=>console.error(...a))}function D(a,b){"undefined"!==typeof jasmine&&jasmine?a():"undefined"!==typeof console&&console&&console.error&&b()};const E=eval("this");var F=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 E&&E)return E;throw Error("Could not determine global object context.");}();function G(a){try{return a.frames?!!a.frames.omid_v1_present:!1}catch(b){return!1}};class H extends z{constructor(a){super(a);this.handleExportedMessage=H.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(y(a),this)}i(a,b){v(a)&&this.g&&this.g(w(a),b)}};function I(a){return null!=a&&"undefined"!==typeof a.top&&null!=a.top}function J(a){if(a===F)return!1;try{if("undefined"===typeof a.location.hostname)return!0}catch(b){return!0}return!1};class K extends z{constructor(a,b=F){super(b);a.addEventListener("message",c=>{if("object"===typeof c.data){var f=c.data;v(f)&&c.source&&this.g&&this.g(w(f),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(y(a),"*")}};const L=["omid","v1_VerificationServiceCommunication"],M=["omidVerificationProperties","serviceWindow"];function N(a,b){return b.reduce((c,f)=>c&&c[f],a)};function O(a,b,c,...f){if(a.g){var d=B();c&&(a.h[d]=c);c=t()&&u()?f:JSON.stringify(f);a.g.sendMessage(new x(d,`VerificationService.${b}`,"1.3.3-google_20200427",c))}} class P{constructor(a){if(!a){var b;"undefined"===typeof b&&"undefined"!==typeof window&&window&&(b=window);b=I(b)?b:F;a=[];var c=N(b,M);c&&a.push(c);a.push(I(b)?b.top:F);a:{for(const e of a){b:{a=b;c=e;var f=G;if(!J(c))try{const k=N(c,L);if(k){var d=new H(k);break b}}catch(k){}d=f(c)?new K(a,c):null}if(a=d)break a}a=null}}if(this.g=a)this.g.g=this.j.bind(this);else if(d=(d=F.omid3p)&&"function"===typeof d.registerSessionObserver&&"function"===typeof d.addEventListener?d:null)this.omid3p=d;this.h= {};this.i=(d=F.omidVerificationProperties)?d.injectionId:void 0}registerSessionObserver(a,b){r(a);this.omid3p?this.omid3p.registerSessionObserver(a,b,this.i):O(this,"addSessionListener",a,b,this.i)}addEventListener(a,b){if(!a)throw Error("Value for eventType is undefined, null or blank.");if("string"!==typeof a&&!(a instanceof String))throw Error("Value for eventType is not a string.");if(""===a.trim())throw Error("Value for eventType is empty string.");r(b);this.omid3p?this.omid3p.addEventListener(a, b):O(this,"addEventListener",b,a)}j(a){const b=a.method,c=a.h;a=a.g;if("response"===b&&this.h[c]){var f=t()&&u()?a?a:[]:a&&"string"===typeof a?JSON.parse(a):[];this.h[c].apply(this,f)}"error"===b&&window.console&&C(a)}}(function(a,b,c="undefined"===typeof omidExports?null:omidExports){c&&(a=a.split("."),a.slice(0,a.length-1).reduce(A,c)[a[a.length-1]]=b)})("OmidVerificationClient",P);function Q(){let a=null;l(b=>(b=b.mraid)&&b.IS_GMA_SDK?(a=b,!0):!1);return a}function R(){return new n(a=>{g.document.readyState&&"complete"===g.document.readyState?a():g.addEventListener("load",a)})}function S(){return new n(a=>{const b=Q();b&&("loading"===b.getState()?b.addEventListener("ready",()=>{a(b)}):a(b))})} function T(){return new n(a=>{R().then(()=>{S().then(b=>{const c=(f,d)=>{0{const c=new n(d=>{a.i.registerSessionObserver(e=>{"sessionStart"==e.type&&(e=e.data,d("app"==e.context.environment),e.context.omidNativeInfo&&(a.g.sdk=e.context.omidNativeInfo.partnerName))})}),f=new n(d=>{a.i.addEventListener("geometryChange",e=>{e=e.data;const k=e.adView.reasons;k&&-1!=k.indexOf("hidden")||(e=e.adView,(e=e.onScreenContainerGeometry||e.onScreenGeometry)&&e.width&&e.height&&d())})});c.then(d=>{d?(f.then(()=>{a.g.src=1;b(a.g)}),T().then(()=>{a.g.src= 2;b(a.g)})):b()})}),a.h.then(()=>{a.j=!1})):a.h=m()}class V{constructor(){var a=this.i=new P;this.l=!(!a.g&&!a.omid3p);this.h=null;this.j=this.l;this.g={}}};window.omrhp=function(a){var b=new V;b.h||U(b);b.h.then(a)};}).call(this);