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