window.yasrTrueFalseStringConvertion=function(e){return null!=e&&""!==e||(e=!1),"true"!==e&&"1"!==e||(e=!0),"false"!==e&&"0"!==e||(e=!1),e},window.yasrValidJson=function(e){try{const t=JSON.parse(e);if(t&&"object"==typeof t)return t}catch(e){console.error("Not a valid Json Element"),console.log(e)}return!1},window.yasrSetRaterValue=function(e,t,r=!1,i=.1,a=!0,n=!1,o=!1){let s;s=r||document.getElementById(t),e=parseInt(e),raterJs({starSize:e,showToolTip:!1,element:s,step:i,readOnly:a,rating:n,rateCallback:o})},window.raterJs=function(e){let t=!0;if(void 0===e.element||null===e.element)return void console.info("missing rating element");if(null!==e.element&&e.element.classList.contains("yasr-star-rating"))return;if(void 0!==e.showToolTip&&(t=!!e.showToolTip),void 0!==e.step&&(e.step<=0||e.step>1))throw new Error("step must be a number between 0 and 1");let r,i,a=5,n=e.starSize||16,o=e.step||1,s=e.onHover,l=e.onLeave,u=yasrTrueFalseStringConvertion(yasrWindowVar.isRtl),d=e.element;d.classList.add("yasr-star-rating");let c=document.createElement("div");c.classList.add("yasr-star-value"),c.style.backgroundSize=n+"px",d.appendChild(c),d.style.width=n*a+"px",d.style.height=n+"px",d.style.backgroundSize=n+"px";let f,v,y,m=e.rateCallback,g=!!e.readOnly,p=!1,b=e.isBusyText;if(f=void 0!==e.disableText?e.disableText:"{rating}/{maxRating}",g||(d.style.cursor="pointer"),y=void 0!==e.ratingText?e.ratingText:"{rating}/{maxRating}",e.rating)E(e.rating);else{var w=d.dataset.rating;w&&E(+w)}function h(e){if(!0===g||!0===p)return;let i;if(!0===u){let t=this.getBoundingClientRect(),r=e.pageX-t.left,a=d.offsetWidth;i=(a-r)/(a/100)}else i=e.offsetX/d.offsetWidth*100;if(i<101){if(1===o)v=Math.ceil(i/100*a);else{let e=i/100*a;for(let t=0;;t+=o)if(t>=e){v=t;break}}if(v>5&&(v=5),d.querySelector(".yasr-star-value").style.width=v/a*100+"%",t){let e=y.replace("{rating}",v);e=e.replace("{maxRating}",a),d.setAttribute("data-title",e)}"function"==typeof s&&s(v,r)}}function x(e){void 0!==r?(d.querySelector(".yasr-star-value").style.width=r/a*100+"%",d.setAttribute("data-rating",r)):(d.querySelector(".yasr-star-value").style.width="0%",d.removeAttribute("data-rating")),"function"==typeof l&&l(v,r)}function S(e){!0!==g&&!0!==p&&(void 0===m&&!1===typeof m||(p=!0,i=v,void 0===b?d.removeAttribute("data-title"):d.setAttribute("data-title",b),m.call(this,i,(function(){!1===g&&d.removeAttribute("data-title"),p=!1}))))}function T(){if(g=!0,t&&f){let e=f.replace("{rating}",r);e=e.replace("{maxRating}",a),d.setAttribute("data-title",e)}else d.removeAttribute("data-title")}function E(e){if(-1===e&&(e=void 0),"number"!=typeof e&&void 0!==e)throw new Error("Value must be a number or undefined.");e<0&&(e=0),e>5&&(e=5),r=e,d.querySelector(".yasr-star-value").style.width=e/a*100+"%",d.setAttribute("data-rating",e)}void 0===r&&(d.querySelector(".yasr-star-value").style.width="0px"),g&&T(),d.addEventListener("mousemove",h),d.addEventListener("mouseleave",x);let A={setRating:E,getRating:function(){return r},disable:T,enable:function(){g=!1,d.removeAttribute("data-title")},dispose:function(){d.removeEventListener("mousemove",h),d.removeEventListener("mouseleave",x),d.removeEventListener("click",S)}};return d.addEventListener("click",S.bind(A)),A};
(()=>{"use strict";const t=["yasr-rater-stars","yasr-multiset-visitors-rater"];for(let r=0;r<t.length;r++)e(t[r]);function e(t){const e=document.getElementsByClassName(t);e.length>0&&("yasr-rater-stars"===t&&function(t){for(let e=0;e<t.length;e++)if(!1===t.item(e).classList.contains("yasr-star-rating")){const r=t.item(e),s=r.id,i=r.getAttribute("data-rater-starsize");yasrSetRaterValue(i,s,r)}}(e),"yasr-multiset-visitors-rater"===t&&function(t){let e="",s=[];const i=document.getElementById("yasr-pro-multiset-review-rating");for(let r=0;r<t.length;r++)!function(r){if(!1!==t.item(r).classList.contains("yasr-star-rating"))return;let a=t.item(r),n=a.id,o=a.getAttribute("data-rater-readonly"),l=a.getAttribute("data-rater-starsize");l||(l=16),o=yasrTrueFalseStringConvertion(o);const c=function(t,r){const n=a.getAttribute("data-rater-postid"),o=a.getAttribute("data-rater-setid"),l=a.getAttribute("data-rater-set-field-id");t=t.toFixed(1);const c=parseInt(t);this.setRating(c),e={postid:n,setid:o,field:l,rating:c},s.push(e),i&&(i.value=JSON.stringify(s)),r()};yasrSetRaterValue(l,n,a,1,o,!1,c)}(r);!function(t){const e=document.getElementsByClassName("yasr-send-visitor-multiset");for(let s=0;s<e.length;s++)e[s].addEventListener("click",(function(){const e=this.getAttribute("data-postid"),s=this.getAttribute("data-setid"),i=this.getAttribute("data-nonce"),a=document.getElementById(`yasr-send-visitor-multiset-${e}-${s}`),n=document.getElementById(`yasr-loader-multiset-visitor-${e}-${s}`);a.style.display="none",n.style.display="block";const o={action:"yasr_visitor_multiset_field_vote",post_id:e,rating:JSON.stringify(t),set_id:s};!0===JSON.parse(yasrWindowVar.isUserLoggedIn)&&Object.assign(o,{nonce:i});r(new URLSearchParams(o).toString(),n)}))}(s)}(e))}function r(t,e){fetch(yasrWindowVar.ajaxurl,{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded"},body:t}).then((t=>{if(!0===t.ok)return t.json();throw new Error("Ajax Call Failed.")})).then((t=>{if("object"!=typeof t||Array.isArray(t)||null===t)throw new Error(`The response is not an object, response is: ${t}`);if(Object.hasOwn(t,"status")){if("success"!==t.status)throw new Error(t.text);e.innerText=t.text}})).catch((t=>{e.innerText="Ajax Call Failed",console.error("Fetch network error",t)})).catch((t=>{e.innerText=t,console.error("Error with the Query",t)}))}})();
var exalt=exalt||{};
if(! Element.prototype.closest){
Element.prototype.closest=function(s){
var el=this;
do {
if(el.matches(s) ){
return el;
}
el=el.parentElement||el.parentNode;
} while(el!==null&&el.nodeType===1);
return null;
};}
if(window.NodeList&&! NodeList.prototype.forEach){
NodeList.prototype.forEach=function(callback, thisArg){
var i;
var len=this.length;
thisArg=thisArg||window;
for(i=0; i < len; i++){
callback.call(thisArg, this[ i ], i, this);
}};}
exalt.menuAccessKeyboard={
init: function(){
this.focusMenuWithChildren();
},
focusMenuWithChildren: function(){
var links, i, len,
menus=document.querySelectorAll('.exalt-menu');
if(! menus.length){
return false;
}
menus.forEach(function(menu){
links=menu.getElementsByTagName('a');
for(i=0, len=links.length; i < len; i++){
links[i].addEventListener('focus', toggleFocus, true);
links[i].addEventListener('blur', toggleFocus, true);
}});
function toggleFocus(){
var self=this;
while(-1===self.className.indexOf('exalt-menu') ){
if('li'===self.tagName.toLowerCase()){
if(-1!==self.className.indexOf('focus') ){
self.className=self.className.replace(' focus', '');
}else{
self.className +=' focus';
}}
self=self.parentElement;
}}
}};
exalt.searchToggle={
init: function(){
this.addListener();
},
toggle: function(element){
var searchBoxContainer=element.parentElement,
header=document.getElementById('masthead'),
searchBoxContainer=searchBoxContainer.querySelector('#exalt-search-box'),
inputField=searchBoxContainer.querySelector('input.search-field');
header.classList.toggle('hide-header-search');
searchBoxContainer.classList.toggle('active');
if(searchBoxContainer.classList.contains('active') ){
inputField.focus();
}},
addListener: function(){
var searchButton=document.getElementById('exalt-search-toggle');
if(! searchButton){
return false;
}
var self=this;
searchButton.addEventListener('click', function(){
self.toggle(this);
});
}};
exalt.slideOutSidebar={
init: function(){
this.addListeners();
},
createOverlay: function(maskId){
var mask=document.createElement('div');
mask.setAttribute('class', 'exalt-overlay-mask');
mask.setAttribute('id', maskId);
document.body.appendChild(mask);
},
removeOverlay: function(maskId){
var mask=document.getElementById(maskId);
mask.parentNode.removeChild(mask);
},
addListeners: function(){
var _doc=document,
body=_doc.body,
slideOutToggles=_doc.querySelectorAll('.exalt-slideout-toggle');
if(! slideOutToggles.length){
return false;
}
var slideOutSidebar=_doc.getElementById('exalt-slideout-sidebar');
if(! slideOutSidebar){
return false;
}
var closeBtn=slideOutSidebar.querySelector('.exalt-slideout-toggle'),
header=_doc.getElementById('masthead'),
openBtn=header.querySelector('.exalt-slideout-toggle'),
self=this;
function handleSidebarKeydown(e){
var focusableElements=slideOutSidebar.querySelectorAll('a, button, input, select, textarea, [tabindex]:not([tabindex="-1"])');
var firstFocusable=focusableElements[0];
var lastFocusable=focusableElements[focusableElements.length - 1];
if(e.key==='Tab'){
if(e.shiftKey&&document.activeElement===firstFocusable){
e.preventDefault();
lastFocusable.focus();
}else if(!e.shiftKey&&document.activeElement===lastFocusable){
e.preventDefault();
firstFocusable.focus();
}}
}
slideOutSidebar.addEventListener('keydown', handleSidebarKeydown);
slideOutToggles.forEach(function(button){
button.addEventListener('click', function(){
if(body.classList.contains('slideout-opened') ){
body.classList.remove('slideout-opened');
openBtn.focus();
self.removeOverlay('exalt-slideout-mask');
}else{
body.classList.add('slideout-opened');
closeBtn.focus();
self.createOverlay('exalt-slideout-mask');
}});
});
document.addEventListener('click', function(e){
if(e.target&&e.target.className==='exalt-overlay-mask'){
var maskId=e.target.id;
body.classList.remove('slideout-opened');
self.removeOverlay(maskId);
}});
}};
exalt.mobileMenu={
init: function(){
this.addListeners();
},
createOverlay: function(maskId){
var mask=document.createElement('div');
mask.setAttribute('class', 'exalt-overlay-mask');
mask.setAttribute('id', maskId);
document.body.appendChild(mask);
},
removeOverlay: function(maskId){
var mask=document.getElementById(maskId);
mask.parentNode.removeChild(mask);
},
addListeners: function(){
var _doc=document,
menuToggleButtons=_doc.querySelectorAll('.exalt-mobile-menu-toggle'),
body=_doc.body,
mobileMenuSidebar=_doc.getElementById('exalt-mobile-sidebar');
if(! mobileMenuSidebar){
return false;
}
var mobileMenuSidebarCloseBtn=mobileMenuSidebar.querySelector('.exalt-mobile-menu-toggle'),
header=_doc.getElementById('masthead'),
mobileMenuSidebarOpenBtn=header.querySelector('.exalt-mobile-menu-toggle'),
self=this;
menuToggleButtons.forEach(function(button){
button.addEventListener('click', function(){
if(body.classList.contains('mobile-menu-opened') ){
body.classList.remove('mobile-menu-opened');
mobileMenuSidebarOpenBtn.focus();
self.removeOverlay('exalt-mobile-menu-mask');
}else{
body.classList.add('mobile-menu-opened');
mobileMenuSidebarCloseBtn.focus();
self.createOverlay('exalt-mobile-menu-mask');
}});
});
function handleSidebarKeydown(e){
var focusableElements=mobileMenuSidebar.querySelectorAll('a, button, input, select, textarea, [tabindex]:not([tabindex="-1"])');
var firstFocusable=focusableElements[0];
var lastFocusable=focusableElements[focusableElements.length - 1];
if(e.key==='Tab'){
if(e.shiftKey&&document.activeElement===firstFocusable){
e.preventDefault();
lastFocusable.focus();
}else if(!e.shiftKey&&document.activeElement===lastFocusable){
e.preventDefault();
firstFocusable.focus();
}}
}
mobileMenuSidebar.addEventListener('keydown', handleSidebarKeydown);
document.addEventListener('click', function(e){
if(e.target&&e.target.className==='exalt-overlay-mask'){
var maskId=e.target.id;
body.classList.remove('mobile-menu-opened');
self.removeOverlay(maskId);
}});
}};
exalt.mobileMenuToggle={
init: function(){
this.toggle();
},
performToggle: function(element){
var target=element.dataset.toggleTarget,
parentNavContainer=element.closest('.exalt-mobile-menu');
activeClass='toggled-on';
targetElement=parentNavContainer.querySelector(target);
element.classList.toggle(activeClass);
exaltToggleAttribute(element, 'aria-expanded', 'true', 'false');
targetElement.classList.toggle(activeClass);
},
toggle: function(){
var self=this;
document.querySelectorAll('*[data-toggle-target]').forEach(function(element){
element.addEventListener('click', function(event){
event.preventDefault();
self.performToggle(element);
});
});
}};
function exaltToggleAttribute(element, attribute, trueVal, falseVal){
if(trueVal===undefined){
trueVal=true;
}
if(falseVal===undefined){
falseVal=false;
}
if(element.getAttribute(attribute)!==trueVal){
element.setAttribute(attribute, trueVal);
}else{
element.setAttribute(attribute, falseVal);
}}
function exaltDomReady(fn){
if(typeof fn!=='function'){
return;
}
if(document.readyState==='interactive'||document.readyState==='complete'){
return fn();
}
document.addEventListener('DOMContentLoaded', fn, false);
}
exaltDomReady(function(){
exalt.menuAccessKeyboard.init();
exalt.searchToggle.init();
exalt.mobileMenu.init();
exalt.mobileMenuToggle.init();
exalt.slideOutSidebar.init();
});
window.addComment=function(v){var I,C,h,E=v.document,b={commentReplyClass:"comment-reply-link",commentReplyTitleId:"reply-title",cancelReplyId:"cancel-comment-reply-link",commentFormId:"commentform",temporaryFormId:"wp-temp-form-div",parentIdFieldId:"comment_parent",postIdFieldId:"comment_post_ID"},e=v.MutationObserver||v.WebKitMutationObserver||v.MozMutationObserver,r="querySelector"in E&&"addEventListener"in v,n=!!E.documentElement.dataset;function t(){d(),e&&new e(o).observe(E.body,{childList:!0,subtree:!0})}function d(e){if(r&&(I=g(b.cancelReplyId),C=g(b.commentFormId),I)){I.addEventListener("touchstart",l),I.addEventListener("click",l);function t(e){if((e.metaKey||e.ctrlKey)&&13===e.keyCode&&"a"!==E.activeElement.tagName.toLowerCase())return C.removeEventListener("keydown",t),e.preventDefault(),C.submit.click(),!1}C&&C.addEventListener("keydown",t);for(var n,d=function(e){var t=b.commentReplyClass;e&&e.childNodes||(e=E);e=E.getElementsByClassName?e.getElementsByClassName(t):e.querySelectorAll("."+t);return e}(e),o=0,i=d.length;o<i;o++)(n=d[o]).addEventListener("touchstart",a),n.addEventListener("click",a)}}function l(e){var t,n,d=g(b.temporaryFormId);d&&h&&(g(b.parentIdFieldId).value="0",t=d.textContent,d.parentNode.replaceChild(h,d),this.style.display="none",n=(d=(d=g(b.commentReplyTitleId))&&d.firstChild)&&d.nextSibling,d&&d.nodeType===Node.TEXT_NODE&&t&&(n&&"A"===n.nodeName&&n.id!==b.cancelReplyId&&(n.style.display=""),d.textContent=t),e.preventDefault())}function a(e){var t=g(b.commentReplyTitleId),t=t&&t.firstChild.textContent,n=this,d=m(n,"belowelement"),o=m(n,"commentid"),i=m(n,"respondelement"),r=m(n,"postid"),n=m(n,"replyto")||t;d&&o&&i&&r&&!1===v.addComment.moveForm(d,o,i,r,n)&&e.preventDefault()}function o(e){for(var t=e.length;t--;)if(e[t].addedNodes.length)return void d()}function m(e,t){return n?e.dataset[t]:e.getAttribute("data-"+t)}function g(e){return E.getElementById(e)}return r&&"loading"!==E.readyState?t():r&&v.addEventListener("DOMContentLoaded",t,!1),{init:d,moveForm:function(e,t,n,d,o){var i,r,l,a,m,c,s,e=g(e),n=(h=g(n),g(b.parentIdFieldId)),y=g(b.postIdFieldId),p=g(b.commentReplyTitleId),u=(p=p&&p.firstChild)&&p.nextSibling;if(e&&h&&n){void 0===o&&(o=p&&p.textContent),a=h,m=b.temporaryFormId,c=g(m),s=(s=g(b.commentReplyTitleId))?s.firstChild.textContent:"",c||((c=E.createElement("div")).id=m,c.style.display="none",c.textContent=s,a.parentNode.insertBefore(c,a)),d&&y&&(y.value=d),n.value=t,I.style.display="",e.parentNode.insertBefore(h,e.nextSibling),p&&p.nodeType===Node.TEXT_NODE&&(u&&"A"===u.nodeName&&u.id!==b.cancelReplyId&&(u.style.display="none"),p.textContent=o),I.onclick=function(){return!1};try{for(var f=0;f<C.elements.length;f++)if(i=C.elements[f],r=!1,"getComputedStyle"in v?l=v.getComputedStyle(i):E.documentElement.currentStyle&&(l=i.currentStyle),(i.offsetWidth<=0&&i.offsetHeight<=0||"hidden"===l.visibility)&&(r=!0),"hidden"!==i.type&&!i.disabled&&!r){i.focus();break}}catch(e){}return!1}}}}(window);
(function(){
var supportsPassive=false;
try {
var opts=Object.defineProperty({}, 'passive', {
get:function(){
supportsPassive=true;
}});
window.addEventListener('testPassive', null, opts);
window.removeEventListener('testPassive', null, opts);
} catch(e){}
function init(){
var input_begin='';
var keydowns={};
var lastKeyup=null;
var lastKeydown=null;
var keypresses=[];
var modifierKeys=[];
var correctionKeys=[];
var lastMouseup=null;
var lastMousedown=null;
var mouseclicks=[];
var mouseclickCoordinates=[];
var mousemoveTimer=null;
var lastMousemoveX=null;
var lastMousemoveY=null;
var mousemoveStart=null;
var mousemoves=[];
var touchmoveCountTimer=null;
var touchmoveCount=0;
var lastTouchEnd=null;
var lastTouchStart=null;
var touchEvents=[];
var scrollCountTimer=null;
var scrollCount=0;
var correctionKeyCodes=[ 'Backspace', 'Delete', 'ArrowUp', 'ArrowDown', 'ArrowLeft', 'ArrowRight', 'Home', 'End', 'PageUp', 'PageDown' ];
var modifierKeyCodes=[ 'Shift', 'CapsLock' ];
var forms=document.querySelectorAll('form[method=post]');
for(var i=0; i < forms.length; i++){
var form=forms[i];
var formAction=form.getAttribute('action');
if(formAction){
if(formAction.indexOf('http://')==0||formAction.indexOf('https://')==0){
if(formAction.indexOf('http://' + window.location.hostname + '/')!=0&&formAction.indexOf('https://' + window.location.hostname + '/')!=0){
continue;
}}
}
form.addEventListener('submit', function (){
var ak_bkp=prepare_array_for_request(keypresses);
var ak_bmc=prepare_array_for_request(mouseclicks);
var ak_bte=prepare_array_for_request(touchEvents);
var ak_bmm=prepare_array_for_request(mousemoves);
var ak_bcc=prepare_array_for_request(mouseclickCoordinates);
var input_fields={
'bib': input_begin,
'bfs': Date.now(),
'bkpc': keypresses.length,
'bkp': ak_bkp,
'bmc': ak_bmc,
'bmcc': mouseclicks.length,
'bmk': modifierKeys.join(';'),
'bck': correctionKeys.join(';'),
'bmmc': mousemoves.length,
'btmc': touchmoveCount,
'bsc': scrollCount,
'bte': ak_bte,
'btec':touchEvents.length,
'bmm':ak_bmm,
'bcc':ak_bcc
};
var akismet_field_prefix='ak_';
if(this.getElementsByClassName){
var possible_akismet_containers=this.getElementsByClassName('akismet-fields-container');
for(var containerIndex=0; containerIndex < possible_akismet_containers.length; containerIndex++){
var container=possible_akismet_containers.item(containerIndex);
if(container.getAttribute('data-prefix') ){
akismet_field_prefix=container.getAttribute('data-prefix');
break;
}}
}
for(var field_name in input_fields){
var field=document.createElement('input');
field.setAttribute('type', 'hidden');
field.setAttribute('name', akismet_field_prefix + field_name);
field.setAttribute('value', input_fields[ field_name ]);
this.appendChild(field);
}}, supportsPassive ? { passive: true }:false);
form.addEventListener('keydown', function(e){
if(e.key in keydowns){
return;
}
var keydownTime=(new Date()).getTime();
keydowns[ e.key ]=[ keydownTime ];
if(! input_begin){
input_begin=keydownTime;
}
var lastKeyEvent=Math.max(lastKeydown, lastKeyup);
if(lastKeyEvent){
keydowns[ e.key ].push(keydownTime - lastKeyEvent);
}
lastKeydown=keydownTime;
}, supportsPassive ? { passive: true }:false);
form.addEventListener('keyup', function(e){
if(!(e.key in keydowns) ){
return;
}
var keyupTime=(new Date()).getTime();
if('TEXTAREA'===e.target.nodeName||'INPUT'===e.target.nodeName){
if(-1!==modifierKeyCodes.indexOf(e.key) ){
modifierKeys.push(keypresses.length - 1);
}else if(-1!==correctionKeyCodes.indexOf(e.key) ){
correctionKeys.push(keypresses.length - 1);
}else{
var keydownTime=keydowns[ e.key ][0];
var keypress=[];
keypress.push(keyupTime - keydownTime);
if(keydowns[ e.key ].length > 1){
keypress.push(keydowns[ e.key ][1]);
}
keypresses.push(keypress);
}}
delete keydowns[ e.key ];
lastKeyup=keyupTime;
}, supportsPassive ? { passive: true }:false);
form.addEventListener("focusin", function(e){
lastKeydown=null;
lastKeyup=null;
keydowns={};}, supportsPassive ? { passive: true }:false);
form.addEventListener("focusout", function(e){
lastKeydown=null;
lastKeyup=null;
keydowns={};}, supportsPassive ? { passive: true }:false);
}
document.addEventListener('mousedown', function(e){
lastMousedown=(new Date()).getTime();
var mouseclickCoordinate=[];
var rect=e.target.getBoundingClientRect();
var relativeX=e.clientX - rect.left;
var relativeY=e.clientY - rect.top;
mouseclickCoordinate.push(Math.round(relativeX) );
mouseclickCoordinate.push(Math.round(relativeY) );
mouseclickCoordinate.push(rect.width > 0 ? Math.round(relativeX / rect.width * 100):0);
mouseclickCoordinate.push(rect.height > 0 ? Math.round(relativeY / rect.height * 100):0);
mouseclickCoordinates.push(mouseclickCoordinate);
}, supportsPassive ? { passive: true }:false);
document.addEventListener('mouseup', function(e){
if(! lastMousedown){
return;
}
var now=(new Date()).getTime();
var mouseclick=[];
mouseclick.push(now - lastMousedown);
if(lastMouseup){
mouseclick.push(lastMousedown - lastMouseup);
}
mouseclicks.push(mouseclick);
lastMouseup=now;
lastKeydown=null;
lastKeyup=null;
keydowns={};}, supportsPassive ? { passive: true }:false);
document.addEventListener('mousemove', function(e){
if(mousemoveTimer){
clearTimeout(mousemoveTimer);
mousemoveTimer=null;
}else{
mousemoveStart=(new Date()).getTime();
lastMousemoveX=e.offsetX;
lastMousemoveY=e.offsetY;
}
mousemoveTimer=setTimeout(function(theEvent, originalMousemoveStart){
var now=(new Date()).getTime() - 500;
var mousemove=[];
mousemove.push(now - originalMousemoveStart);
mousemove.push(Math.round(Math.sqrt(Math.pow(theEvent.offsetX - lastMousemoveX, 2) +
Math.pow(theEvent.offsetY - lastMousemoveY, 2)
)
)
);
if(mousemove[1] > 0){
mousemoves.push(mousemove);
}
mousemoveStart=null;
mousemoveTimer=null;
}, 500, e, mousemoveStart);
}, supportsPassive ? { passive: true }:false);
document.addEventListener('touchmove', function(e){
if(touchmoveCountTimer){
clearTimeout(touchmoveCountTimer);
}
touchmoveCountTimer=setTimeout(function (){
touchmoveCount++;
}, 500);
}, supportsPassive ? { passive: true }:false);
document.addEventListener('touchstart', function(e){
lastTouchStart=(new Date()).getTime();
}, supportsPassive ? { passive: true }:false);
document.addEventListener('touchend', function(e){
if(! lastTouchStart){
return;
}
var now=(new Date()).getTime();
var touchEvent=[];
touchEvent.push(now - lastTouchStart);
if(lastTouchEnd){
touchEvent.push(lastTouchStart - lastTouchEnd);
}
touchEvents.push(touchEvent);
lastTouchEnd=now;
lastKeydown=null;
lastKeyup=null;
keydowns={};}, supportsPassive ? { passive: true }:false);
document.addEventListener('scroll', function(e){
if(scrollCountTimer){
clearTimeout(scrollCountTimer);
}
scrollCountTimer=setTimeout(function (){
scrollCount++;
}, 500);
}, supportsPassive ? { passive: true }:false);
}
function prepare_array_for_request(a, limit){
if(! limit){
limit=100;
}
var rv='';
if(a.length > 0){
var random_starting_point=Math.max(0, Math.floor(Math.random() * a.length - limit) );
for(var i=0; i < limit&&i < a.length; i++){
var entry=a[ random_starting_point + i ];
rv +=entry.join(',') + ';';
}}
return rv;
}
if(document.readyState!=='loading'){
init();
}else{
document.addEventListener('DOMContentLoaded', init);
}})();