OwlCyberSecurity - MANAGER
Edit File: beat.min.js
window.imagify=window.imagify||{},function(I,h,w){w.imagify.beat=new function(){var e,n,t,i,a=I(h),o={suspend:!1,suspendEnabled:!0,screenId:"",url:"",lastTick:0,queue:{},mainInterval:60,tempInterval:0,originalInterval:0,minimalInterval:0,countdown:0,connecting:!1,connectionError:!1,errorcount:0,hasConnected:!1,hasFocus:!0,userActivity:0,userActivityEvents:!1,checkFocusTimer:0,beatTimer:0};function r(){return(new Date).getTime()}function c(e){var n,t=e.src;if(!t||!/^https?:\/\//.test(t)||(n=w.location.origin||w.location.protocol+"//"+w.location.host,0===t.indexOf(n)))try{if(e.contentWindow.document)return 1}catch(e){}}function s(){o.hasFocus&&!document.hasFocus()?d():!o.hasFocus&&document.hasFocus()&&v()}function u(e,n){var t;if(e){switch(e){case"abort":break;case"timeout":t=!0;break;case"error":if(503===n&&o.hasConnected){t=!0;break}case"parsererror":case"empty":case"unknown":o.errorcount++,2<o.errorcount&&o.hasConnected&&(t=!0)}t&&!b()&&(o.connectionError=!0,a.trigger("imagifybeat-connection-lost",[e,n]),w.wp.hooks)&&w.wp.hooks.doAction("imagifybeat.connection-lost",e,n)}}function m(){var e;o.connecting||o.suspend||(o.lastTick=r(),e=I.extend({},o.queue),o.queue={},a.trigger("imagifybeat-send",[e]),w.wp.hooks&&w.wp.hooks.doAction("imagifybeat.send",e),e={data:e,interval:o.tempInterval?o.tempInterval/1e3:o.mainInterval/1e3,_nonce:"object"==typeof w.imagifybeatSettings?w.imagifybeatSettings.nonce:"",action:"imagifybeat",screen_id:o.screenId,has_focus:o.hasFocus},"customize"===o.screenId&&(e.wp_customize="on"),o.connecting=!0,o.xhr=I.ajax({url:o.url,type:"post",timeout:6e4,data:e,dataType:"json"}).always(function(){o.connecting=!1,l()}).done(function(e,n,t){var i;e?(o.hasConnected=!0,b()&&(o.errorcount=0,o.connectionError=!1,a.trigger("imagifybeat-connection-restored"),w.wp.hooks)&&w.wp.hooks.doAction("imagifybeat.connection-restored"),e.nonces_expired&&(a.trigger("imagifybeat-nonces-expired"),w.wp.hooks)&&w.wp.hooks.doAction("imagifybeat.nonces-expired"),e.imagifybeat_interval&&(i=e.imagifybeat_interval,delete e.imagifybeat_interval),e.imagifybeat_nonce&&"object"==typeof w.imagifybeatSettings&&(w.imagifybeatSettings.nonce=e.imagifybeat_nonce,delete e.imagifybeat_nonce),a.trigger("imagifybeat-tick",[e,n,t]),w.wp.hooks&&w.wp.hooks.doAction("imagifybeat.tick",e,n,t),i&&p(i)):u("empty")}).fail(function(e,n,t){u(n||"unknown",e.status),a.trigger("imagifybeat-error",[e,n,t]),w.wp.hooks&&w.wp.hooks.doAction("imagifybeat.error",e,n,t)}))}function l(){var e=r()-o.lastTick,n=o.mainInterval;o.suspend||(!o.hasFocus&&o.suspendEnabled?n=12e4:0<o.countdown&&o.tempInterval&&(n=o.tempInterval,o.countdown--,o.countdown<1)&&(o.tempInterval=0),o.minimalInterval&&n<o.minimalInterval&&(n=o.minimalInterval),w.clearTimeout(o.beatTimer),e<n?o.beatTimer=w.setTimeout(function(){m()},n-e):m())}function d(){o.hasFocus=!1}function v(){o.userActivity=r(),o.suspend=!1,o.hasFocus||(o.hasFocus=!0,l())}function f(){o.userActivityEvents=!1,a.off(".imagifybeat-active"),I("iframe").each(function(e,n){c(n)&&I(n.contentWindow).off(".imagifybeat-active")}),v()}function g(){var e=o.userActivity?r()-o.userActivity:0;3e5<e&&o.hasFocus&&d(),o.suspendEnabled&&6e5<e&&(o.suspend=!0),o.userActivityEvents||(a.on("mouseover.imagifybeat-active keyup.imagifybeat-active touchend.imagifybeat-active",function(){f()}),I("iframe").each(function(e,n){c(n)&&I(n.contentWindow).on("mouseover.imagifybeat-active keyup.imagifybeat-active touchend.imagifybeat-active",function(){f()})}),o.userActivityEvents=!0)}function b(){return o.connectionError}function y(){o.suspendEnabled=!1}function p(e,n){var t,i=o.tempInterval||o.mainInterval;if(e){switch(e){case"fast":case 5:t=5e3;break;case 15:t=15e3;break;case 30:t=3e4;break;case 60:t=6e4;break;case 120:t=12e4;break;case"long-polling":return o.mainInterval=0;default:t=o.originalInterval}5e3===(t=o.minimalInterval&&t<o.minimalInterval?o.minimalInterval:t)?(n=parseInt(n,10)||30,o.countdown=n=n<1||30<n?30:n,o.tempInterval=t):(o.countdown=0,o.tempInterval=0,o.mainInterval=t),t!==i&&l()}return o.tempInterval?o.tempInterval/1e3:o.mainInterval/1e3}return"string"==typeof w.pagenow&&(o.screenId=w.pagenow),"string"==typeof w.ajaxurl&&(o.url=w.ajaxurl),"object"==typeof w.imagifybeatSettings&&(e=w.imagifybeatSettings,!o.url&&e.ajaxurl&&(o.url=e.ajaxurl),e.interval&&(o.mainInterval=e.interval,o.mainInterval<15?o.mainInterval=15:120<o.mainInterval&&(o.mainInterval=120)),e.minimalInterval&&(e.minimalInterval=parseInt(e.minimalInterval,10),o.minimalInterval=0<e.minimalInterval&&e.minimalInterval<=600?1e3*e.minimalInterval:0),o.minimalInterval&&o.mainInterval<o.minimalInterval&&(o.mainInterval=o.minimalInterval),o.screenId||(o.screenId=e.screenId||"front"),"disable"===e.suspension)&&y(),o.mainInterval=1e3*o.mainInterval,o.originalInterval=o.mainInterval,void 0!==document.hidden?(n="hidden",i="visibilitychange",t="visibilityState"):void 0!==document.msHidden?(n="msHidden",i="msvisibilitychange",t="msVisibilityState"):void 0!==document.webkitHidden&&(n="webkitHidden",i="webkitvisibilitychange",t="webkitVisibilityState"),n&&(document[n]&&(o.hasFocus=!1),a.on(i+".imagifybeat",function(){"hidden"===document[t]?(d(),w.clearInterval(o.checkFocusTimer)):(v(),document.hasFocus&&(o.checkFocusTimer=w.setInterval(s,1e4)))})),document.hasFocus&&(o.checkFocusTimer=w.setInterval(s,1e4)),I(w).on("unload.imagifybeat",function(){o.suspend=!0,o.xhr&&4!==o.xhr.readyState&&o.xhr.abort()}),w.setInterval(g,3e4),a.ready(function(){o.lastTick=r(),l()}),{hasFocus:function(){return o.hasFocus},connectNow:function(){o.lastTick=0,l()},disableSuspend:y,enableSuspend:function(){o.suspendEnabled=!0},interval:p,resetInterval:function(){return p(o.originalInterval)},hasConnectionError:b,enqueue:function(e,n,t){return!!e&&!(t&&this.isQueued(e)||(o.queue[e]=n,0))},dequeue:function(e){e&&delete o.queue[e]},isQueued:function(e){if(e)return Object.prototype.hasOwnProperty.call(o.queue,e)},getQueuedItem:function(e){return e&&this.isQueued(e)?o.queue[e]:void 0}}}}(jQuery,document,window);