ajax.cloudflare.com
2606:4700::6813:c497 

URL: https://ajax.cloudflare.com/cdn-cgi/scripts/697236fc/cloudflare-static/bot-filter.js
Submission: On June 12 via api from US

Form analysis 0 forms found in the DOM

Text Content

/* Test harness for bot filter challenge */
!function a(o,r,u){function c(e,t){if(!r[e]){if(!o[e]){var s="function"==typeof require&&require;if(!t&&s)return s(e,!0);if(h)return h(e,!0);var n=new Error("Cannot find module '"+e+"'");throw n.code="MODULE_NOT_FOUND",n}var i=r[e]={exports:{}};o[e][0].call(i.exports,function(t){return c(o[e][1][t]||t)},i,i.exports,a,o,r,u)}return r[e].exports}for(var h="function"==typeof require&&require,t=0;t<u.length;t++)c(u[t]);return c}({1:[function(t,b,e){(function(e,t){"use strict";var s,n="pending",i="settled",a="fulfilled",u="rejected",o=function(){},r=void 0!==e&&"undefined"!=typeof e.process&&"function"==typeof e.process.emit,c=void 0===t?setTimeout:t,h=[];function l(){for(var t=0;t<h.length;t++)h[t][0](h[t][1]);s=!(h=[])}function p(t,e){h.push([t,e]),s||(s=!0,c(l,0))}function f(t){var e=t.owner,s=e._state,n=e._data,i=t[s],o=t.then;if("function"==typeof i){s=a;try{n=i(n)}catch(r){y(o,r)}}_(o,n)||(s===a&&d(o,n),s===u&&y(o,n))}function _(e,s){var n;try{if(e===s)throw new TypeError("A promises callback cannot return that same promise.");if(s&&("function"==typeof s||"object"==typeof s)){var t=s.then;if("function"==typeof t)return t.call(s,function(t){n||(n=!0,s===t?m(e,t):d(e,t))},function(t){n||(n=!0,y(e,t))}),!0}}catch(i){return n||y(e,i),!0}return!1}function d(t,e){t!==e&&_(t,e)||m(t,e)}function m(t,e){t._state===n&&(t._state=i,t._data=e,p(w,t))}function y(t,e){t._state===n&&(t._state=i,t._data=e,p(v,t))}function g(t){t._then=t._then.forEach(f)}function w(t){t._state=a,g(t)}function v(t){t._state=u,g(t),!t._handled&&r&&e.process.emit("unhandledRejection",t._data,t)}function T(t){e.process.emit("rejectionHandled",t)}function E(t){if("function"!=typeof t)throw new TypeError("Promise resolver "+t+" is not a function");if(this instanceof E==!1)throw new TypeError("Failed to construct 'Promise': Please use the 'new' operator, this object constructor cannot be called as a function.");this._then=[],function o(t,e){function s(t){y(e,t)}try{t(function n(t){d(e,t)},s)}catch(i){s(i)}}(t,this)}E.prototype={constructor:E,_state:n,_then:null,_data:undefined,_handled:!1,then:function(t,e){var s={owner:this,then:new this.constructor(o),fulfilled:t,rejected:e};return!e&&!t||this._handled||(this._handled=!0,this._state===u&&r&&p(T,this)),this._state===a||this._state===u?p(f,s):this._then.push(s),s.then},"catch":function(t){return this.then(null,t)}},E.all=function(a){if(!Array.isArray(a))throw new TypeError("You must pass an array to Promise.all().");return new E(function(s,t){var n=[],i=0;function e(e){return i++,function(t){n[e]=t,--i||s(n)}}for(var o,r=0;r<a.length;r++)(o=a[r])&&"function"==typeof o.then?o.then(e(r),t):n[r]=o;i||s(n)})},E.race=function(i){if(!Array.isArray(i))throw new TypeError("You must pass an array to Promise.race().");return new E(function(t,e){for(var s,n=0;n<i.length;n++)(s=i[n])&&"function"==typeof s.then?s.then(t,e):t(s)})},E.resolve=function(e){return e&&"object"==typeof e&&e.constructor===E?e:new E(function(t){t(e)})},E.reject=function(s){return new E(function(t,e){e(s)})},b.exports=E}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{},t("timers").setImmediate)},{timers:3}],2:[function(t,e,s){var n,i,o=e.exports={};function r(){throw new Error("setTimeout has not been defined")}function a(){throw new Error("clearTimeout has not been defined")}function u(t){if(n===setTimeout)return setTimeout(t,0);if((n===r||!n)&&setTimeout)return n=setTimeout,setTimeout(t,0);try{return n(t,0)}catch(e){try{return n.call(null,t,0)}catch(e){return n.call(this,t,0)}}}!function(){try{n="function"==typeof setTimeout?setTimeout:r}catch(t){n=r}try{i="function"==typeof clearTimeout?clearTimeout:a}catch(t){i=a}}();var c,h=[],l=!1,p=-1;function f(){l&&c&&(l=!1,c.length?h=c.concat(h):p=-1,h.length&&_())}function _(){if(!l){var t=u(f);l=!0;for(var e=h.length;e;){for(c=h,h=[];++p<e;)c&&c[p].run();p=-1,e=h.length}c=null,l=!1,function s(t){if(i===clearTimeout)return clearTimeout(t);if((i===a||!i)&&clearTimeout)return i=clearTimeout,clearTimeout(t);try{return i(t)}catch(e){try{return i.call(null,t)}catch(e){return i.call(this,t)}}}(t)}}function d(t,e){this.fun=t,this.array=e}function m(){}o.nextTick=function(t){var e=new Array(arguments.length-1);if(1<arguments.length)for(var s=1;s<arguments.length;s++)e[s-1]=arguments[s];h.push(new d(t,e)),1!==h.length||l||u(_)},d.prototype.run=function(){this.fun.apply(null,this.array)},o.title="browser",o.browser=!0,o.env={},o.argv=[],o.version="",o.versions={},o.on=m,o.addListener=m,o.once=m,o.off=m,o.removeListener=m,o.removeAllListeners=m,o.emit=m,o.prependListener=m,o.prependOnceListener=m,o.listeners=function(t){return[]},o.binding=function(t){throw new Error("process.binding is not supported")},o.cwd=function(){return"/"},o.chdir=function(t){throw new Error("process.chdir is not supported")},o.umask=function(){return 0}},{}],3:[function(u,t,c){(function(t,e){var n=u("process/browser.js").nextTick,s=Function.prototype.apply,i=Array.prototype.slice,o={},r=0;function a(t,e){this._id=t,this._clearFn=e}c.setTimeout=function(){return new a(s.call(setTimeout,window,arguments),clearTimeout)},c.setInterval=function(){return new a(s.call(setInterval,window,arguments),clearInterval)},c.clearTimeout=c.clearInterval=function(t){t.close()},a.prototype.unref=a.prototype.ref=function(){},a.prototype.close=function(){this._clearFn.call(window,this._id)},c.enroll=function(t,e){clearTimeout(t._idleTimeoutId),t._idleTimeout=e},c.unenroll=function(t){clearTimeout(t._idleTimeoutId),t._idleTimeout=-1},c._unrefActive=c.active=function(t){clearTimeout(t._idleTimeoutId);var e=t._idleTimeout;0<=e&&(t._idleTimeoutId=setTimeout(function(){t._onTimeout&&t._onTimeout()},e))},c.setImmediate="function"==typeof t?t:function(t){var e=r++,s=!(arguments.length<2)&&i.call(arguments,1);return o[e]=!0,n(function(){o[e]&&(s?t.apply(null,s):t.call(null),c.clearImmediate(e))}),e},c.clearImmediate="function"==typeof e?e:function(t){delete o[t]}}).call(this,u("timers").setImmediate,u("timers").clearImmediate)},{"process/browser.js":2,timers:3}],4:[function(it,t,e){!function(h){var u="function"==typeof h.Promise?h.Promise:it("pinkie"),o={output:!0,harness_timeout:{normal:1e4,"long":6e4},test_timeout:null,message_events:["start","test_state","result","completion"]};function t(){this.name_counter=0,this.window_cache=null,this.all_loaded=!1;var s=this;this.message_events=[],this.dispatched_messages=[],this.message_functions={start:[E,A,function(t){s._dispatch("start_callback",[t],{type:"start",properties:t})}],test_state:[b,S,function(t){s._dispatch("test_state_callback",[t],{type:"test_state",test:{}})}],result:[k,N,function(t){s._dispatch("result_callback",[t],{type:"result",test:{}})}],completion:[x,I,function(t,e){s._dispatch("completion_callback",[t,e],{type:"complete",tests:[],status:""})}]},e(window,"load",function(){s.all_loaded=!0}),e(window,"message",function(t){if(t.data&&"getmessages"===t.data.type&&t.source)for(var e=0;e<s.dispatched_messages.length;++e)t.source.postMessage(s.dispatched_messages[e],"*")})}t.prototype._dispatch=function(o,r,a){this.dispatched_messages.push(a),this._forEach_windows(function(t,e){if(e){try{var s=o in t}catch(n){s=!1}if(s)try{t[o].apply(undefined,r)}catch(n){0}}(function i(t){var e,s;try{s=typeof t.postMessage,e="function"===s||"object"===s}catch(n){e=!1}return e})(t)&&t!==self&&t.postMessage(a,"*")})},t.prototype._forEach_windows=function(e){var t=this.window_cache;if(!t){t=[[self,!0]];for(var s,n=self;n!=n.parent;)s=v(n=n.parent),t.push([n,s]);(n=window.opener)&&t.push([n,v(n)]),this.window_cache=t}w(t,function(t){e.apply(null,t)})},t.prototype.on_tests_ready=function(){this.setup_messages(o.message_events),x(function(){var t=(new Date).getTime()-L.startTime,e=function s(t){return function r(t){var e,s,n,i,o=-1;for(e=0,n=t.length;e<n;e+=1){for(i=255&(o^t[e]),s=0;s<8;s+=1)1==(1&i)?i=i>>>1^3988292384:i>>>=1;o=o>>>8^i}return-1^o}(t="string"==typeof t?function e(t){return Array.prototype.map.call(t,function(t){return t.charCodeAt(0)})}(t):t)>>>0}(JSON.stringify(L.tests_actual_results));window&&window.parent&&window.parent.postMessage({type:"results",results:L.tests_actual_results,executionTimeMs:t,resultHash:e},"*")})},t.prototype.setup_messages=function(n){var i=this;w(o.message_events,function(t){var e=-1!==i.message_events.indexOf(t),s=-1!==n.indexOf(t);!e&&s?i.message_functions[t][0](i.message_functions[t][2]):e&&!s&&i.message_functions[t][1](i.message_functions[t][2])}),this.message_events=n},t.prototype.next_default_test_name=function(){var t=document.getElementsByTagName("title")[0],e=t&&t.firstChild&&t.firstChild.data||"Untitled",s=0<this.name_counter?" "+this.name_counter:"";return this.name_counter++,e+s},t.prototype.on_new_harness_properties=function(t){t.hasOwnProperty("message_events")&&this.setup_messages(t.message_events)},t.prototype.add_on_loaded_callback=function(t){e(window,"load",t)},t.prototype.test_timeout=function(){for(var t=document.getElementsByTagName("meta"),e=0;e<t.length;e++)if("timeout"==t[e].name){if("long"==t[e].content)return o.harness_timeout["long"];break}return o.harness_timeout.normal};var i=function R(){if("document"in h)return new t;throw new Error("Unsupported test environment")}();function r(t,e,s){var n=new _(e||i.next_default_test_name(),s=s||{});n.step(t,n,n),n.phase===n.phases.STARTED&&n.done()}function a(t,e,s){"function"!=typeof t&&(s=e,e=t,t=null);var n=new _(e||i.next_default_test_name(),s=s||{});return t&&n.step(t,n,n),n}function e(t,e,s){t.addEventListener(e,s,!1)}function l(t,e){return t.length>e?t.substring(0,e-3)+"...":t}g(function M(t,e,s){"string"==typeof s&&(s=[s]);for(var n=null,i=null,o=t.step_func(function(t){if(c(!!n,t.type),c(t.type,n.types[0],(n.types[0],t.type)),Array.isArray(i)&&i.push(t),1<n.types.length)n.types.shift();else{var e=n.resolve,s=i||t;i=n=null,e(s)}}),r=0;r<s.length;r++)e.addEventListener(s[r],o,!1);return this.wait_for=function(s,t){return n?u.reject("Already waiting for an event or events"):("string"==typeof s&&(s=[s]),t&&t.record&&"all"===t.record&&(i=[]),new u(function(t,e){n={types:s,resolve:t,reject:e}}))},t._add_cleanup(function a(){for(var t=0;t<s.length;t++)e.removeEventListener(s[t],o,!1)}),this},"EventWatcher"),g(r,"test"),g(a,"async_test"),g(function P(s,t,e){var n=a(t,e);L.promise_tests||(L.promise_tests=u.resolve()),L.promise_tests=L.promise_tests.then(function(){var t=new u(function(t){n._add_cleanup(t)}),e=n.step(s,n,n);return u.resolve(e).then(function(){n.done()})["catch"](n.step_func(function(t){if(t instanceof y)throw t;throw new y("Unhandled rejection with value: "+t)})),t})},"promise_test"),g(function j(t,e,s){return s.then(function(){L.tests_actual_results.push(!1)})["catch"](function(){L.tests_actual_results.push(!0)})},"promise_rejects"),g(function D(s,t,n){w(t,function(t,e){r(function(){s.apply(this,t.slice(1))},t[0],Array.isArray(n)?n[e]:n)})},"generate_tests"),g(function C(t,e){var s=null,n={};2===arguments.length?(s=t,n=e):t instanceof Function?s=t:n=t,L.setup(s,n),i.on_new_harness_properties(n)},"setup"),g(function U(){0===L.tests.length&&L.set_file_is_test(),L.file_is_test&&L.tests[0].done(),L.end_wait()},"done"),g(e,"on_event"),g(function $(t,e){var s=this,n=Array.prototype.slice.call(arguments,2);return setTimeout(function(){t.apply(s,n)},e*L.timeout_multiplier)},"step_timeout");var p={0:"0",1:"x01",2:"x02",3:"x03",4:"x04",5:"x05",6:"x06",7:"x07",8:"b",9:"t",10:"n",11:"v",12:"f",13:"r",14:"x0e",15:"x0f",16:"x10",17:"x11",18:"x12",19:"x13",20:"x14",21:"x15",22:"x16",23:"x17",24:"x18",25:"x19",26:"x1a",27:"x1b",28:"x1c",29:"x1d",30:"x1e",31:"x1f","0xfffd":"ufffd","0xfffe":"ufffe","0xffff":"uffff"};function f(e,s){if(s||(s=[]),"object"==typeof e&&null!==e){if(0<=s.indexOf(e))return"[...]";s.push(e)}if(Array.isArray(e))return"["+e.slice(0,10).map(function(t){return f(t,s)}).join(", ")+"]";switch(typeof e){case"string":for(var t in e=e.replace("\\","\\\\"),p){var n="\\"+p[t];e=e.replace(RegExp(String.fromCharCode(t),"g"),n)}return e.replace(/"/g,'\\"');case"boolean":return e;case"undefined":return String(e);case"number":return-0===e&&1/e==-Infinity?"-0":String(e);case"object":if(null===e)return"null";if(e===h.location)return'object "location"';if(function u(t){try{var e="nodeType"in t&&"nodeName"in t&&"nodeValue"in t&&"childNodes"in t}catch(s){return!1}if(e){try{t.nodeType}catch(s){return!1}return!0}return!1}(e))switch(e.nodeType){case Node.ELEMENT_NODE:for(var i="<"+e.localName,o=0;o<e.attributes.length;o++)i+=" "+e.attributes[o].name+'="'+e.attributes[o].value+'"';return"Element node "+l(i+=">"+e.innerHTML+"</"+e.localName+">",60);case Node.TEXT_NODE:return'Text node "'+l(e.data,60)+'"';case Node.PROCESSING_INSTRUCTION_NODE:return"ProcessingInstruction node with target "+f(l(e.target,60))+" and data "+f(l(e.data,60));case Node.COMMENT_NODE:return"Comment node \x3c!--"+l(e.data,60)+"--\x3e";case Node.DOCUMENT_NODE:return"Document node with "+e.childNodes.length+(1==e.childNodes.length?" child":" children");case Node.DOCUMENT_TYPE_NODE:return"DocumentType node";case Node.DOCUMENT_FRAGMENT_NODE:return"DocumentFragment node with "+e.childNodes.length+(1==e.childNodes.length?" child":" children");default:return"Node object of unknown type"}default:try{var r=[];for(var a in e)e.hasOwnProperty(a)&&r.push(a);return typeof e+" {"+r.slice(0,10).map(function(t){return l(String(t),100)+': "'+l(String(e[t]),100)+'"'}).join(", ")+"}"}catch(c){return"[stringifying object threw "+String(c)+" with type "+String(typeof c)+"]"}}}function c(t){L.tests_actual_results.push(f(t))}function s(t){L.tests_actual_results.push(t)}function _(t,e){if(L.file_is_test&&L.tests.length)throw new Error("Tried to create a test with file_is_test");this.name=t,this.phase=L.phase===L.phases.ABORTED?this.phases.COMPLETE:this.phases.INITIAL,this.status=this.NOTRUN,this.timeout_id=null,this.index=null;var s=(this.properties=e).timeout?e.timeout:o.test_timeout;this.timeout_length=null!==s?s*L.timeout_multiplier:null,this.message=null,this.stack=null,this.steps=[],this.cleanup_callbacks=[],this._user_defined_cleanup_count=0,L.push(this)}function n(e){var s=this;Object.keys(e).forEach(function(t){s[t]=e[t]}),this.index=null,this.phase=this.phases.INITIAL,this.update_state_from(e),L.push(this)}function d(t,e,s){this.running=!0,this.tests=new Array;var n=this;try{t.onerror=function(t){n.remote_error(t)}}catch(i){}this.remote=t,this.message_target=e,this.message_handler=function(t){var e=!s||s(t);n.running&&t.data&&e&&t.data.type in n.message_handlers&&n.message_handlers[t.data.type].call(n,t.data)},self.Promise&&(this.done=new u(function(t){n.doneResolve=t})),this.message_target.addEventListener("message",this.message_handler)}function m(t,e){var s,n={};for(s in t)n[s]=t[s];for(s in e)n[s]=e[s];return n}function y(t){this.message=t,this.stack=""}function g(t,e){for(var s=e.split("."),n=h,i=0;i<s.length-1;i++)s[i]in n||(n[s[i]]={}),n=n[s[i]];n[s[s.length-1]]=t}function w(t,e,s){for(var n=0;n<t.length;n++)t.hasOwnProperty(n)&&e.call(s,t[n],n,t)}function v(t){try{return!0}catch(e){return!1}}function T(){this.tests=[],this.num_pending=0,this.phases={INITIAL:0,SETUP:1,HAVE_TESTS:2,HAVE_RESULTS:3,COMPLETE:4,ABORTED:5},this.phase=this.phases.INITIAL,this.properties={},this.wait_for_finish=!1,this.processing_callbacks=!1,this.allow_uncaught_exception=!1,this.file_is_test=!1,this.timeout_multiplier=1,this.timeout_length=i.test_timeout(),this.timeout_id=null,this.start_callbacks=[],this.test_state_callbacks=[],this.test_done_callbacks=[],this.all_done_callbacks=[],this.tests_actual_results=[],this.startTime=(new Date).getTime(),this.pending_remotes=[],this.status={};var t=this;i.add_on_loaded_callback(function(){t.all_done()&&t.complete()}),this.set_timeout()}function E(t){L.start_callbacks.push(t)}function b(t){L.test_state_callbacks.push(t)}function k(t){L.test_done_callbacks.push(t)}function x(t){L.all_done_callbacks.push(t)}function O(t,e){var s=t.indexOf(e);-1<s&&t.splice(s,1)}function A(t){O(L.start_callbacks,t)}function S(t){O(L.test_state_callbacks,t)}function N(t){O(L.test_done_callbacks,t)}function I(t){O(L.all_done_callbacks,t)}g(f,"format_value"),g(c,"__c$1"),g(function H(t){for(var e=Math.min(t.length,10),s=0;s<e;s++)L.tests_actual_results.push(f(t[s]))},"__c$2"),g(function F(t,e,s){for(var n=Math.min(t.length,e.length),i=0;i<n;i++)L.tests_actual_results.push(Math.abs(t[i]-e[i])<=s)},"__c$3"),g(function V(t,e,s){L.tests_actual_results.push(Math.abs(t-e)<=s)},"__c$4"),g(function B(t,e){L.tests_actual_results.push(t<e)},"__c$5"),g(function W(t,e){L.tests_actual_results.push(e<t)},"__c$6"),g(function q(t,e){L.tests_actual_results.push(t<=e)},"__c$8"),g(function Y(t,e){L.tests_actual_results.push(e<=t)},"__c$9"),g(function G(t,e,s){L.tests_actual_results.push(e<=t&&t<=s)},"__c$10"),g(function K(t,e){L.tests_actual_results.push(t.hasOwnProperty(e))},"__c$11"),g(function J(t,e){L.tests_actual_results.push(!t.hasOwnProperty(e))},"__c$12"),g(function X(t,e){L.tests_actual_results.push(e in t)},"__c$13"),g(function z(t,e){var s=t[e];try{t[e]=s+"a",L.tests_actual_results.push(function n(t,e){return e!=e?t!=t:0===t&&0===e?1/t==1/e:t===e}(t[e],s))}finally{t[e]=s}},"__c$14"),g(function Q(t,e){try{e.call(this),L.tests_actual_results.push(!1)}catch(s){if(s instanceof y)throw s;s&&s.name&&L.tests_actual_results.push(s.name)}},"__c$15"),g(s,"__c$16"),g(function Z(s,n,t){var i=[].slice.call(arguments,3),o=[],r=!1;if(w(t,function(t){try{s.apply(this,[n,t].concat(i)),r=!0}catch(e){o.push(e.message)}}),!r)throw new y(o.join("\n\n"))},"__c$17"),(_.prototype=m({},_.statuses={PASS:0,FAIL:1,TIMEOUT:2,NOTRUN:3})).phases={INITIAL:0,STARTED:1,HAS_RESULT:2,COMPLETE:3},_.prototype.structured_clone=function(){return this._structured_clone||(this._structured_clone=m({name:String(this.name),properties:m({},this.properties),phases:m({},this.phases)},_.statuses)),this._structured_clone.status=this.status,this._structured_clone.message=this.message,this._structured_clone.stack=this.stack,this._structured_clone.index=this.index,this._structured_clone.phase=this.phase,this._structured_clone},_.prototype.step=function(t,e){if(!(this.phase>this.phases.STARTED)){this.phase=this.phases.STARTED,this.set_status(this.TIMEOUT,"Test timed out"),L.started=!0,L.notify_test_state(this),null===this.timeout_id&&this.set_timeout(),this.steps.push(t),1===arguments.length&&(e=this);try{return t.apply(e,Array.prototype.slice.call(arguments,2))}catch(i){if(this.phase>=this.phases.HAS_RESULT)return;var s=String("object"==typeof i&&null!==i?i.message:i),n=i.stack?i.stack:null;this.set_status(this.FAIL,s,n),this.phase=this.phases.HAS_RESULT,this.done()}}},_.prototype.step_func=function(t,e){var s=this;return 1===arguments.length&&(e=s),function(){return s.step.apply(s,[t,e].concat(Array.prototype.slice.call(arguments)))}},_.prototype.step_func_done=function(t,e){var s=this;return 1===arguments.length&&(e=s),function(){t&&s.step.apply(s,[t,e].concat(Array.prototype.slice.call(arguments))),s.done()}},_.prototype.unreached_func=function(t){return this.step_func(function(){s(t)})},_.prototype.step_timeout=function(t,e){var s=this,n=Array.prototype.slice.call(arguments,2);return setTimeout(this.step_func(function(){return t.apply(s,n)}),e*L.timeout_multiplier)},_.prototype._add_cleanup=function(t){this.cleanup_callbacks.push(t)},_.prototype.add_cleanup=function(t){this._user_defined_cleanup_count+=1,this._add_cleanup(t)},_.prototype.set_timeout=function(){if(null!==this.timeout_length){var t=this;this.timeout_id=setTimeout(function(){t.timeout()},this.timeout_length)}},_.prototype.set_status=function(t,e,s){this.status=t,this.message=e,this.stack=s||null},_.prototype.force_timeout=_.prototype.timeout=function(){this.timeout_id=null,this.set_status(this.TIMEOUT,"Test timed out"),this.phase=this.phases.HAS_RESULT,this.done()},_.prototype.done=function(){this.phase!=this.phases.COMPLETE&&(this.phase<=this.phases.STARTED&&this.set_status(this.PASS,null),this.phase=this.phases.COMPLETE,h.clearTimeout&&clearTimeout(this.timeout_id),L.result(this),this.cleanup())},_.prototype.cleanup=function(){var t,s=0;w(this.cleanup_callbacks,function(t){try{t()}catch(e){L.phase=L.phases.ABORTED,s+=1}}),0<s&&(t=this._user_defined_cleanup_count,L.status.status=L.status.ERROR,L.status.message="Test named '"+this.name+"' specified "+t+" 'cleanup' function"+(1<t?"s":"")+", and "+s+" failed.",L.status.stack=null)},n.prototype.structured_clone=function(){var s={};return Object.keys(this).forEach(function(t){var e=this[t];s[t]="object"==typeof e&&null!==e?m({},e):e}.bind(this)),s.phases=m({},this.phases),s},n.prototype.cleanup=function(){},n.prototype.phases=_.prototype.phases,n.prototype.update_state_from=function(t){this.status=t.status,this.message=t.message,this.stack=t.stack,this.phase===this.phases.INITIAL&&(this.phase=this.phases.STARTED)},n.prototype.done=function(){this.phase=this.phases.COMPLETE},d.prototype.remote_error=function(t){var e=t.message||String(t),s=t.filename?" "+t.filename:"";this.remote_done({status:{status:L.status.ERROR,message:"Error in remote"+s+": "+e,stack:t.stack}}),t.preventDefault&&t.preventDefault()},d.prototype.message_handlers={test_state:d.prototype.test_state=function(t){var e=this.tests[t.test.index];e||(e=new n(t.test),this.tests[t.test.index]=e),e.update_state_from(t.test),L.notify_test_state(e)},result:d.prototype.test_done=function(t){var e=this.tests[t.test.index];e.update_state_from(t.test),e.done(),L.result(e)},complete:d.prototype.remote_done=function(t){null===L.status.status&&t.status.status!==t.status.OK&&(L.status.status=t.status.status,L.status.message=t.status.message,L.status.stack=t.status.stack),this.message_target.removeEventListener("message",this.message_handler),this.running=!1,this.remote=null,this.message_target=null,this.doneResolve&&this.doneResolve(),L.all_done()&&L.complete()}},g(y,"AssertionError"),y.prototype=function tt(t){function e(){}return e.prototype=t,new e}(Error.prototype),T.prototype.setup=function(t,e){if(!(this.phase>=this.phases.HAVE_RESULTS)){for(var s in this.phase<this.phases.SETUP&&(this.phase=this.phases.SETUP),this.properties=e)if(e.hasOwnProperty(s)){var n=e[s];"allow_uncaught_exception"==s?this.allow_uncaught_exception=n:"explicit_done"==s&&n?this.wait_for_finish=!0:"explicit_timeout"==s&&n?(this.timeout_length=null,this.timeout_id&&clearTimeout(this.timeout_id)):"timeout_multiplier"==s&&(this.timeout_multiplier=n)}if(t)try{t()}catch(i){this.status.status=this.status.ERROR,this.status.message=String(i),this.status.stack=i.stack?i.stack:null}this.set_timeout()}},T.prototype.set_file_is_test=function(){if(0<this.tests.length)throw new Error("Tried to set file as test after creating a test");this.wait_for_finish=!0,this.file_is_test=!0,a()},T.prototype.set_timeout=function(){if(h.clearTimeout){var t=this;clearTimeout(this.timeout_id),null!==this.timeout_length&&(this.timeout_id=setTimeout(function(){t.timeout()},this.timeout_length))}},T.prototype.timeout=function(){null===this.status.status&&(this.status.status=this.status.TIMEOUT),this.complete()},T.prototype.end_wait=function(){this.wait_for_finish=!1,this.all_done()&&this.complete()},T.prototype.push=function(t){this.phase<this.phases.HAVE_TESTS&&this.start(),this.num_pending++,t.index=this.tests.push(t),this.notify_test_state(t)},T.prototype.notify_test_state=function(e){var s=this;w(this.test_state_callbacks,function(t){t(e,s)})},T.prototype.all_done=function(){return this.phase===this.phases.ABORTED||0<this.tests.length&&i.all_loaded&&0===this.num_pending&&!this.wait_for_finish&&!this.processing_callbacks&&!this.pending_remotes.some(function(t){return t.running})},T.prototype.start=function(){this.phase=this.phases.HAVE_TESTS,this.notify_start()},T.prototype.notify_start=function(){var e=this;w(this.start_callbacks,function(t){t(e.properties)})},T.prototype.result=function(t){this.phase>this.phases.HAVE_RESULTS||(this.phase=this.phases.HAVE_RESULTS,this.num_pending--,this.notify_result(t))},T.prototype.notify_result=function(e){var s=this;this.processing_callbacks=!0,w(this.test_done_callbacks,function(t){t(e,s)}),this.processing_callbacks=!1,s.all_done()&&s.complete()},T.prototype.complete=function(){if(this.phase!==this.phases.COMPLETE){this.phase=this.phases.COMPLETE;var e=this;this.tests.forEach(function(t){t.phase<t.phases.COMPLETE&&(e.notify_result(t),t.cleanup(),t.phase=t.phases.COMPLETE)}),this.notify_complete()}},T.prototype.find_duplicates=function(){var e={},s=[];return w(this.tests,function(t){t.name in e&&-1===s.indexOf(t.name)&&s.push(t.name),e[t.name]=!0}),s},T.prototype.notify_complete=function(){var t,e=this;null===this.status.status&&((t=this.find_duplicates()).length?(this.status.status=this.status.ERROR,this.status.message=t.length+" duplicate test name"+(1<t.length?"s":"")+': "'+t.join('", "')+'"'):this.status.status=this.status.OK),w(this.all_done_callbacks,function(t){t(e.tests,e.status,L.tests_actual_results)})},T.prototype.create_remote_worker=function(t){var e;if(function n(t){return"ServiceWorker"in h&&"[object ServiceWorker]"==Object.prototype.toString.call(t)}(t))if(window.MessageChannel){var s=new MessageChannel;(e=s.port1).start(),t.postMessage({type:"connect"},[s.port2])}else e=navigator.serviceWorker,t.postMessage({type:"connect"});else!function i(t){return"SharedWorker"in h&&t instanceof SharedWorker}(t)?e=t:(e=t.port).start();return new d(t,e)},T.prototype.create_remote_window=function(e){return e.postMessage({type:"getmessages"},"*"),new d(e,window,function(t){return t.source===e})},T.prototype.fetch_tests_from_worker=function(t){if(!(this.phase>=this.phases.COMPLETE)){var e=this.create_remote_worker(t);return this.pending_remotes.push(e),e.done}},g(function et(t){return L.fetch_tests_from_worker(t)},"fetch_tests_from_worker"),T.prototype.fetch_tests_from_window=function(t){this.phase>=this.phases.COMPLETE||this.pending_remotes.push(this.create_remote_window(t))},g(function st(t){L.fetch_tests_from_window(t)},"fetch_tests_from_window"),g(function nt(){null===L.timeout_length&&L.timeout()},"timeout"),g(E,"add_start_callback"),g(b,"add_test_state_callback"),g(k,"add_result_callback"),g(x,"add_completion_callback");var L=new T;i.on_tests_ready()}(window)},{pinkie:1}]},{},[4]);