tea-time
Version:
Unit test: Tea Time!
1 lines • 565 kB
JavaScript
(function(e){if(typeof exports==="object"&&typeof module!=="undefined"){module.exports=e()}else if(typeof define==="function"&&define.amd){define([],e)}else{var t;if(typeof window!=="undefined"){t=window}else if(typeof global!=="undefined"){t=global}else if(typeof self!=="undefined"){t=self}else{t=this}t.createTeaTime=e()}})(function(){var D,e,t;return function(){function f(s,o,a){function l(r,e){if(!o[r]){if(!s[r]){var t="function"==typeof require&&require;if(!e&&t)return t(r,!0);if(u)return u(r,!0);var n=new Error("Cannot find module '"+r+"'");throw n.code="MODULE_NOT_FOUND",n}var i=o[r]={exports:{}};s[r][0].call(i.exports,function(e){var t=s[r][1][e];return l(t||e)},i,i.exports,f,s,o,a)}return o[r].exports}for(var u="function"==typeof require&&require,e=0;e<a.length;e++)l(a[e]);return l}return f}()({1:[function(f,e,t){(function(r,u){(function(){"use strict";if(r.browser){return}const i=f("@cronvel/falafel");const o=f("fs");function t(e){Object.defineProperties(this,{directoryWhiteList:{value:null,writable:true,enumerable:true},pathBlackList:{value:null,writable:true,enumerable:true},ecmaVersion:{value:9,writable:true,enumerable:true},currentFile:{value:null,writable:true,enumerable:true},tracking:{value:{},writable:true,enumerable:true},trackingArea:{value:[],writable:true,enumerable:true},isTracking:{value:false,writable:true,enumerable:true},package:{value:null,writable:true,enumerable:true},warningComments:{value:{},writable:true,enumerable:true},warningCommentCount:{value:0,writable:true,enumerable:true}});var t=r.cwd();try{this.package=f(t+"/package.json")}catch(e){if(e.code==="MODULE_NOT_FOUND"){throw new Error("[Cover] No package.json found")}else{throw new Error("[Cover] Error in the package.json: "+e)}}if(this.package.config&&this.package.config["tea-time"]){if(Array.isArray(this.package.config["tea-time"].coverDir)){this.directoryWhiteList=this.package.config["tea-time"].coverDir.map(e=>{return t+"/"+e+"/"})}if(Array.isArray(this.package.config["tea-time"].coverIgnore)){this.pathBlackList=this.package.config["tea-time"].coverIgnore.map(e=>{return t+"/"+e})}}f.extensions[".js"]=this.requireJs.bind(this);u[l]=this}e.exports=t;t.create=(...e)=>new t(...e);var a=f.extensions[".js"];var s=["ExpressionStatement","BreakStatement","ContinueStatement","VariableDeclaration","ReturnStatement","ThrowStatement","TryStatement","FunctionDeclaration","IfStatement","WhileStatement","DoWhileStatement","ForStatement","ForInStatement","ForOfStatement","SwitchStatement","WithStatement"];var n=["IfStatement","WhileStatement","DoWhileStatement","ForStatement","ForInStatement","ForOfStatement","WithStatement"];var l="__TEA_TIME_COVER__";t.prototype.requireJs=function e(t,r){var n=this.isTracking;if((!this.directoryWhiteList||!this.directoryWhiteList.length)&&(!this.pathBlackList||!this.pathBlackList.length)){return a(t,r)}if(this.directoryWhiteList&&this.directoryWhiteList.length){if(!this.directoryWhiteList.some(e=>r.indexOf(e)===0)){return a(t,r)}}if(this.pathBlackList&&this.pathBlackList.length){if(this.pathBlackList.some(e=>r===e)){return a(t,r)}}var i=o.readFileSync(r,"utf8");var s=this.instrument(i,r);this.isTracking=true;t._compile(s,r);this.isTracking=n};t.prototype.instrument=function e(t,r){this.tracking[r]={area:[],sourceLines:t.split("\n")};this.currentFile=r;var n=i(t,{locations:true,comment:true,ecmaVersion:this.ecmaVersion,allowHashBang:true,allowReturnOutsideFunction:true,preserveParens:true,onComment:this.onComment.bind(this)},this.injectTrackingCode.bind(this,r));this.currentFile=null;return n};t.prototype.start=function e(){this.isTracking=true};t.prototype.stop=function e(){this.isTracking=false};t.prototype.onComment=function e(t,r,n,i,s,o){var a=r.match(/^(\s*\/!\\\s*)+(.+?)(\s*\/!\\\s*)*$/m);if(!a){return}if(!this.warningComments[this.currentFile]){this.warningComments[this.currentFile]=[]}this.warningComments[this.currentFile].push({comment:a[2],line:s.line});this.warningCommentCount++};t.prototype.track=function e(t){if(!this.isTracking){return}this.trackingArea[t].count++};t.prototype.initTracking=function e(t,r){var n=this.trackingArea.length;this.trackingArea[n]={count:0,location:{start:{line:r.loc.start.line-1,column:r.loc.start.column-1},end:{line:r.loc.end.line-1,column:r.loc.end.column-1}}};this.tracking[t].area[this.tracking[t].area.length]=this.trackingArea[n];return n};t.prototype.injectTrackingCode=function e(t,r){if(!r.loc||!r.loc.start||!r.loc.end){throw new Error("Node without location")}this.injectBraces(r);this.injectStatementTrackingCode(t,r);this.injectConditionTrackingCode(t,r)};t.prototype.injectBraces=function e(t){var r;if(n.indexOf(t.type)!==-1){if(t.consequent&&t.consequent.type!=="BlockStatement"){t.consequent.update("{\n"+t.consequent.source()+"}\n")}else if(t.body&&t.body.type!=="BlockStatement"){t.body.update("{\n"+t.body.source()+"}\n")}if(t.alternate&&t.alternate.type!=="BlockStatement"){t.alternate.update("{\n"+t.alternate.source()+"}\n")}}return false};t.prototype.injectStatementTrackingCode=function e(t,r){var n;if(s.indexOf(r.type)!==-1&&r.parent.type!=="LabeledStatement"){if(r.type==="VariableDeclaration"&&(r.parent.type==="ForStatement"||r.parent.type==="ForInStatement"||r.parent.type==="ForOfStatement")||r.type==="ExpressionStatement"&&r.parent.type==="Program"&&r.expression.type==="Literal"&&r.expression.value==="use strict"){return false}n=this.initTracking(t,r);r.update(l+".track( "+n+" ) ; "+r.source());return true}return false};t.prototype.injectConditionTrackingCode=function e(t,r){var n;if(r.type==="LogicalExpression"&&(r.operator==="&&"||r.operator==="||")){if(r.left.type!=="LogicalExpression"){n=this.initTracking(t,r.left);r.left.update("("+l+".track( "+n+" ) || "+r.left.source()+")")}if(r.right.type!=="LogicalExpression"){n=this.initTracking(t,r.right);r.right.update("("+l+".track( "+n+" ) || "+r.right.source()+")")}return true}return false};t.prototype.injectBlockTrackingCode=function e(t,r){var n;if(r.type==="Program"){n=this.initTracking(t,r);r.update(l+".track( "+n+" ) ; "+r.source());return true}else if(r.type==="BlockStatement"){n=this.initTracking(t,r);r.update("{"+l+".track( "+n+" ) ; "+r.source().slice(1));return true}return false};t.prototype.getCoverage=function e(){var t,r,n,i,s,o,a;var l={uncoveredFiles:{},lineCount:0,uncoveredLineCount:0,areaCount:0,uncoveredAreaCount:0,warningCommentCount:this.warningCommentCount,warningComments:this.warningComments};for(t in this.tracking){l.lineCount+=this.tracking[t].sourceLines.length;l.areaCount+=this.tracking[t].area.length;for(r=0,n=this.tracking[t].area.length;r<n;r++){s=this.tracking[t].area[r];if(!s.count){if(!l.uncoveredFiles[t]){l.uncoveredFiles[t]={source:this.tracking[t].sourceLines,lines:[],areaCount:this.tracking[t].area.length,uncoveredAreaCount:0}}l.uncoveredAreaCount++;l.uncoveredFiles[t].uncoveredAreaCount++;if(s.location.start.line===s.location.end.line){o=l.uncoveredFiles[t].lines[s.location.start.line]=[];for(i=s.location.start.column;i<=s.location.end.column;i++){o[i]=true}}else{o=l.uncoveredFiles[t].lines[s.location.start.line]=[];a=this.tracking[t].sourceLines[s.location.start.line].length;for(i=s.location.start.column;i<a;i++){o[i]=true}o=l.uncoveredFiles[t].lines[s.location.end.line]=[];for(i=0;i<=s.location.end.column;i++){o[i]=true}}for(i=s.location.start.line+1;i<s.location.end.line;i++){l.uncoveredFiles[t].lines[i]=true}}}if(l.uncoveredFiles[t]){l.uncoveredFiles[t].rate=1-l.uncoveredFiles[t].uncoveredAreaCount/l.uncoveredFiles[t].areaCount;l.uncoveredLineCount+=l.uncoveredFiles[t].lines.reduce((e,t)=>{return e+(t?1:0)},0)}}l.rate=1-l.uncoveredAreaCount/l.areaCount;return l}}).call(this)}).call(this,f("_process"),typeof global!=="undefined"?global:typeof self!=="undefined"?self:typeof window!=="undefined"?window:{})},{"@cronvel/falafel":9,_process:87,fs:35}],2:[function(l,u,e){(function(a){(function(){"use strict";const e=l("nextgen-events");const t=l("async-try-catch");t.substitute();const c=t.try;const h=l("seventh");const r=l("./Cover.js");const n=l("logfella");const i=n.global.use("test");function s(e){this.timeout=e.timeout||2e3;this.slowTime=e.slowTime||75;this.suite=s.createSuite();this.grep=Array.isArray(e.grep)?e.grep:[];this.igrep=Array.isArray(e.igrep)?e.igrep:[];this.allowConsole=!!e.allowConsole;this.huntConsole=!!e.huntConsole;this.bail=!!e.bail;this.showDiff=e.showDiff!==false;this.skipOptional=!!e.skipOptional;this.cover=e.cover&&r.create(e.cover);this.registeredTestOptions=[];this.testOptions=e.testOptions||{};this.token=e.token||null;this.acceptTokens=e.acceptTokens||null;this.startTime=0;this.testCount=0;this.done=0;this.ok=0;this.fail=0;this.optionalFail=0;this.skip=0;this.assertionOk=0;this.assertionFail=0;this.errors=[];this.orphanError=null;this.onceUncaughtException=e.onceUncaughtException;this.offUncaughtException=e.offUncaughtException;this.registerStack=[this.suite];this.cliManager=e.cliManager||null}s.prototype=Object.create(e.prototype);s.prototype.constructor=s;u.exports=s;s.create=(...e)=>new s(...e);s.reporterAliases={oneline:"one-line",one:"one-line",error:"error-report",err:"error-report",coverage:"coverage-report",cov:"coverage-report","cov-sum":"coverage-summary",wcom:"warning-comments-report","wcom-sum":"warning-comments-summary",pan:"panel",bar:"progress",vocal:"voice"};s.populateOptionsWithArgs=function(e,t){var r,n,i;e.cover=t.cover;e.showDiff=t.diff!==false;if(!e.reporters){if(e.cover){e.reporters=["classic","coverage-report","warning-comments-summary"]}else{e.reporters=["classic"]}}if(!e.clientReporters){e.clientReporters=["classic"]}if(t.huntConsole!==undefined){e.huntConsole=t.huntConsole}else if(t.console!==undefined){e.allowConsole=t.console}if(t.bail){e.bail=true}if(t.skipOptional){e.skipOptional=true}if(t.timeout&&(i=parseInt(t.timeout,10))){e.timeout=i}if(t.slow&&(i=parseInt(t.slow,10))){e.slowTime=i}if(t.opt){e.testOptions=t.opt}if(t.reporter){e.reporters=t.reporter}if(t.addReporter){e.reporters.push(...t.addReporter)}e.reporters=e.reporters.map(e=>{return s.reporterAliases[e]||e});if(t.clientReporter){e.clientReporters=t.clientReporter}e.grep=[];e.sourceGrep=[];if(!t.grep){t.grep=[]}for(r=0,n=t.grep.length;r<n;r++){e.grep.push(new RegExp(t.grep[r],"i"));e.sourceGrep.push(t.grep[r])}e.igrep=[];e.sourceIGrep=[];if(!t.igrep){t.igrep=[]}for(r=0,n=t.igrep.length;r<n;r++){e.igrep.push(new RegExp(t.igrep[r],"i"));e.sourceIGrep.push(t.igrep[r])}if(t.token){e.token=t.token}};s.prototype.init=function(){a.asyncTry=c;a.suite=a.describe=a.context=s.registerSuite.bind(this);a.test=a.it=a.specify=s.registerTest.bind(this);a.test.skip=s.registerSkipTest.bind(this);a.test.optional=s.registerOptionalTest.bind(this);a.test.opt=s.registerOptionalTest.bind(this);a.test.next=s.registerOptionalTest.bind(this);a.setup=a.beforeEach=s.registerHook.bind(this,"setup");a.teardown=a.afterEach=s.registerHook.bind(this,"teardown");a.suiteSetup=a.before=s.registerHook.bind(this,"suiteSetup");a.suiteTeardown=a.after=s.registerHook.bind(this,"suiteTeardown");a.expect=l("doormen/lib/expect.js").factory({ok:()=>this.assertionOkHook(),fail:()=>this.assertionFailHook()});a.testOption=s.registerTestOption.bind(this);a.getTestOption=e=>this.testOptions[e];a.log=(...e)=>i.hdebug(...e);if(this.huntConsole){s.huntConsole()}else if(!this.allowConsole){s.disableConsole()}};s.registerTestOption=function(...e){this.registeredTestOptions.push(...e)};s.disableConsole=function(){Object.keys(console).forEach(e=>{if(typeof console[e]==="function"){console[e]=function(){}}})};s.huntConsole=function(){Object.keys(console).forEach(e=>{if(typeof console[e]==="function"){console[e]=()=>{throw new o(e)}}})};function o(e){this.message="The console."+e+"() function was used!";e=console[e];if(Error.captureStackTrace){Error.captureStackTrace(this,e)}else{Object.defineProperty(this,"stack",{value:Error().stack,enumerable:true,configurable:true})}}o.prototype=Object.create(Error.prototype);o.prototype.constructor=o;o.prototype.name="ConsoleError";s.createSuite=function(e){var t=[];t.title=e;t.parent=null;t.suiteSetup=[];t.suiteTeardown=[];t.setup=[];t.teardown=[];t.order=0;return t};s.sortSuite=function(e){e.sort((e,t)=>{var r=Array.isArray(e)?1:0;var n=Array.isArray(t)?1:0;if(r-n){return r-n}return e.order-t.order})};s.prototype.run=async function(){var e,t;s.sortSuite(this.suite);await this.waitForEmit("ready");this.emit("start",this.testCount);if(this.cover){this.cover.start()}this.startTime=Date.now();try{await this.runSuite(this.suite,0)}catch(e){}e=Date.now()-this.startTime;if(this.cover){t=this.cover.getCoverage()}this.emit("report",{ok:this.ok,fail:this.fail,optionalFail:this.optionalFail,skip:this.skip,assertionOk:this.assertionOk,assertionFail:this.assertionFail,coverageRate:t&&t.rate,duration:e});if(this.fail+this.optionalFail){this.emit("errorReport",this.errors)}if(this.cover){this.emit("coverageReport",t)}this.emit("end");return h.timeLimit(1e4,this.waitForEmit("exit"))};s.prototype.runSuite=async function(t,r){if(r){this.emit("enterSuite",{title:t.title,depth:r-1})}try{await this.runHooks(t.suiteSetup,r)}catch(e){this.patchError(e);this.errors.push({title:e.hookFn.title+"["+e.hookFn.hookType+"]",type:e.hookFn.hookType,fn:e.hookFn,error:e});this.failSuite(t,r,"suiteSetup",e.hookFn,e);try{await this.runHooks(t.suiteTeardown,r)}catch(e){}if(r){this.emit("exitSuite",{title:t.title,depth:r-1})}throw e}try{await this.runSuiteTests(t,r)}catch(e){try{await this.runHooks(t.suiteTeardown,r)}catch(e){}if(r){this.emit("exitSuite",{title:t.title,depth:r-1})}throw e}try{await this.runHooks(t.suiteTeardown,r)}catch(e){this.patchError(e);this.errors.push({title:e.hookFn.title+"["+e.hookFn.hookType+"]",type:e.hookFn.hookType,fn:e.hookFn,error:e});if(r){this.emit("exitSuite",{title:t.title,depth:r-1})}throw e}};s.prototype.runSuiteTests=async function(t,r){return h.forEach(t,async e=>{try{if(Array.isArray(e)){await this.runSuite(e,r+1)}else{await this.runTest(t,r,e)}}catch(e){if(this.bail){throw e}}})};s.prototype.failSuite=function(e,t,r,n,i){var s,o,a,l;for(s=0,o=e.length;s<o;s++){if(Array.isArray(e[s])){this.failSuite(e[s],t+1,r,n,i)}this.done++;this.fail++;a=e[s];l={title:a.title,type:a.name,optional:a.optional,depth:t,fn:a,errorType:r,error:i,errorFn:n};this.emit("fail",l)}};s.prototype.runTest=async function(e,t,r){this.testInProgress=r;var n={title:r.title,type:r.name,optional:r.optional,depth:t,fn:r,duration:null,slow:null,error:null,errorType:null,errorFn:null};if(typeof r!=="function"){this.done++;this.skip++;this.emit("skip",n);return}var i=e,s=e.setup,o=e.teardown;while(i.parent){i=i.parent;s=i.setup.concat(s);o=i.teardown.concat(o)}var a=e=>{this.done++;this.patchError(e);this.errors.push({title:(e.hookFn?e.hookFn.title+"["+e.hookFn.hookType+"] ":"")+n.title,type:n.errorType,fn:r,optional:n.optional,error:e});if(n.optional){this.optionalFail++;this.emit("optionalFail",n)}else{this.fail++;this.emit("fail",n)}if(this.bail){throw e}};var l=()=>{this.done++;this.ok++;this.emit("ok",n)};try{await this.runHooks(s,t)}catch(e){n.errorType="setup";n.error=e;n.errorFn=e.hookFn;try{await this.runHooks(o,t)}catch(e){}a(e);return}this.orphanError=null;this.emit("enterTest",n);try{Object.assign(n,await this.runTestFn(r))}catch(e){Object.assign(n,e.data);n.error=e;n.errorType="test";n.errorFn=r;this.emit("exitTest",n);try{await this.runHooks(o,t)}catch(e){}a(e);return}this.emit("exitTest",n);try{await this.runHooks(o,t)}catch(e){n.errorType="teardown";n.error=e;n.errorFn=e.hookFn;a(e);return}l()};s.prototype.runTestFn=function(n){var i,s=false,o=null,t,a=this.slowTime;var l=new h;var u={timeout:e=>{if(s){return}if(o!==null){clearTimeout(o);o=null}o=setTimeout(()=>{if(this.orphanError){r(this.orphanError);return}var e=new Error("Test timeout (local)");e.testTimeout=true;r(e)},e)},slow:e=>{a=e}};if(n.length){t=()=>{return new h((t,r)=>{var e=n.call(u,e=>{return e?r(e):t()});if(h.isThenable(e)){r(new Error("Bad test: mixing the Promise/thenable and the callback interface"))}})}}else{t=n}var r=e=>{var t=Date.now()-i;this.offUncaughtException(f);if(s){return}s=true;if(this.cover){this.cover.stop()}if(o!==null){clearTimeout(o);o=null}var r={duration:t,slow:Math.floor(t/a)};if(e){e.data=r;l.reject(e)}else{l.resolve(r)}};var f=e=>{e.uncaught=true;r(e)};o=setTimeout(()=>{if(this.orphanError){r(this.orphanError);return}var e=new Error("Test timeout");e.testTimeout=true;r(e)},this.timeout);this.onceUncaughtException(f);c(()=>{if(this.cover){this.cover.start()}i=Date.now();var e=t.call(u);if(h.isThenable(e)){h.resolve(e).callback(r);return}r()}).catch(e=>{if(s){this.orphanError=e}r(e)});return l};s.prototype.runHooks=function(e,n){return h.forEach(e,t=>{var r={hookType:t.hookType,title:t.title,depth:n,fn:t};this.emit("enterHook",r);return this.runHookFn(t).then(()=>{this.emit("exitHook",r)},e=>{e.hookFn=t;this.emit("exitHook",r);throw e})})};s.prototype.runHookFn=function(n){var t,r=false;var i=new h;if(n.length){t=()=>{return new h((t,r)=>{var e=n(e=>{return e?r(e):t()});if(h.isThenable(e)){r(new Error("Bad test: mixing the Promise/thenable and the callback interface"))}})}}else{t=n}var s=e=>{this.offUncaughtException(o);if(r){return}r=true;if(e){i.reject(e)}else{i.resolve()}};var o=e=>{e.uncaught=true;s(e)};this.onceUncaughtException(o);c(()=>{var e=t();if(h.isThenable(e)){h.resolve(e).callback(s);return}s()}).catch(e=>{if(r){this.orphanError=e}s(e)});return i};s.prototype.assertionOkHook=function(){this.assertionOk++;this.emit("assertionOk")};s.prototype.assertionFailHook=function(){this.assertionFail++;this.emit("assertionFail")};s.registerSuite=function(e,t){if(!e||typeof e!=="string"||typeof t!=="function"){throw new Error("Usage is suite( title , fn )")}var r=this.registerStack[this.registerStack.length-1];var n=s.createSuite(e);this.registerStack.push(n);t();this.registerStack.pop();if(!n.length){return}n.order=r.length;n.parent=r;s.sortSuite(n);r.push(n)};s.registerTest=function(e,t,r){var n,i,s,o,a,l;if(!e||typeof e!=="string"){throw new Error("Usage is test( title , [fn] , [optional] )")}l=this.registerStack[this.registerStack.length-1];for(n=0,i=this.grep.length;n<i;n++){a=false;if(e.match(this.grep[n])){continue}for(s=1,o=this.registerStack.length;s<o;s++){if(this.registerStack[s].title.match(this.grep[n])){a=true;break}}if(!a){return}}for(n=0,i=this.igrep.length;n<i;n++){if(e.match(this.igrep[n])){return}for(s=1,o=this.registerStack.length;s<o;s++){if(this.registerStack[s].title.match(this.igrep[n])){return}}}this.testCount++;if(typeof t!=="function"){t={}}t.title=e;t.optional=!!r;t.order=l.length;l.push(t)};s.registerSkipTest=function(e){return s.registerTest.call(this,e)};s.registerOptionalTest=function(e,t){return this.skipOptional?s.registerTest.call(this,e):s.registerTest.call(this,e,t,true)};s.registerHook=function(e,t,r){var n;if(typeof t==="function"){r=t;t=undefined}else if(typeof r!=="function"){throw new Error("Usage is hook( [title] , fn )")}r.title=t||r.name||"[no name]";r.hookType=e;n=this.registerStack[this.registerStack.length-1];n[e].push(r)};s.prototype.patchError=function(e){var t,r,n;if(!e.stack){return}n=e.stack;if(!Array.isArray(n)){n=e.stack.split("\n")}for(t=0,r=n.length;t<r;t++){if(n[t].match(/(^|\/)tea-time\.(min\.)?js/)){n=n.slice(0,t);break}}e.stack=n.join("\n")}}).call(this)}).call(this,typeof global!=="undefined"?global:typeof self!=="undefined"?self:typeof window!=="undefined"?window:{})},{"./Cover.js":1,"async-try-catch":31,"doormen/lib/expect.js":48,logfella:75,"nextgen-events":78,seventh:100}],3:[function(e,t,r){"use strict";const n=e("tree-kit/lib/dotPath.js");function i(e,t){if(!t){t=Object.create(i.prototype,{teaTime:{value:e,enumerable:true}})}document.querySelector("body").insertAdjacentHTML("beforeend",'<div class="tea-time-classic-reporter" style="background-color:black;color:white"></div>');t.container=document.querySelector("div.tea-time-classic-reporter");t.teaTime.on("enterSuite",i.enterSuite.bind(t));t.teaTime.on("ok",i.ok.bind(t));t.teaTime.on("fail",i.fail.bind(t));t.teaTime.on("optionalFail",i.optionalFail.bind(t));t.teaTime.on("skip",i.skip.bind(t));t.teaTime.on("report",i.report.bind(t));t.teaTime.on("errorReport",i.errorReport.bind(t));return t}t.exports=i;function s(){(document.querySelector("div.tea-time-classic-reporter p:last-child")||document.querySelector("div.tea-time-classic-reporter h4:last-child")||document.querySelector("div.tea-time-classic-reporter pre:last-child")).scrollIntoView()}function o(e){return"margin-left:"+(1+2*e)+"%;"}const a="color:grey;";const l="color:green;";const u="color:red;";const f="color:brown;";const c="color:blue;";const h="color:magenta;";const p="color:grey;";const d="color:yellow;";const y="color:red;";const m="color:brown;font-weight:bold;";const g="color:red;font-weight:bold;";const v="background-color:red;color:white;font-weight:bold;";const b="background-color:grey;color:white;";const w="background-color:green;color:white;font-weight:bold;";const k="background-color:red;color:white;font-weight:bold;";i.enterSuite=function e(t){this.container.insertAdjacentHTML("beforeend",'<h4 class="tea-time-classic-reporter" style="'+o(t.depth)+'">'+t.title+"</h4>");s()};i.ok=function e(t){var r="✔ "+t.title;if(!t.slow){r+=' <span style="'+p+'">('+t.duration+"ms)</span>"}else if(t.slow===1){r+=' <span style="'+d+'">('+t.duration+"ms)</span>"}else{r+=' <span style="'+y+'">('+t.duration+"ms)</span>"}this.container.insertAdjacentHTML("beforeend",'<p class="tea-time-classic-reporter" style="'+l+o(t.depth)+'">'+r+"</p>");s()};i.fail=function e(t){var r="✘ "+t.title;if(t.duration!==undefined){if(!t.slow){r+=' <span style="'+p+'">('+t.duration+"ms)</span>"}else if(t.slow===1){r+=' <span style="'+d+'">('+t.duration+"ms)</span>"}else{r+=' <span style="'+y+'">('+t.duration+"ms)</span>"}}this.container.insertAdjacentHTML("beforeend",'<p class="tea-time-classic-reporter" style="'+u+o(t.depth)+'">'+r+"</p>");s()};i.optionalFail=function e(t){var r="✘ "+t.title;if(t.duration!==undefined){if(!t.slow){r+=' <span style="'+p+'">('+t.duration+"ms)</span>"}else if(t.slow===1){r+=' <span style="'+d+'">('+t.duration+"ms)</span>"}else{r+=' <span style="'+y+'">('+t.duration+"ms)</span>"}}this.container.insertAdjacentHTML("beforeend",'<p class="tea-time-classic-reporter" style="'+f+o(t.depth)+'">'+r+"</p>");s()};i.skip=function e(t){var r="· "+t.title;this.container.insertAdjacentHTML("beforeend",'<p class="tea-time-classic-reporter" style="'+c+o(t.depth)+'">'+r+"</p>");s()};i.report=function e(t){this.container.insertAdjacentHTML("beforeend","<hr />"+'<p class="tea-time-classic-reporter" style="font-weight:bold;'+l+o(1)+'">'+t.ok+(t.assertionOk?"|"+t.assertionOk:"")+" passing "+(t.duration<2e3?'<span style="'+a+'">('+Math.floor(t.duration)+"ms)</span>":'<span style="'+a+'">('+Math.floor(t.duration/1e3)+"."+Math.floor(t.duration%1e3)+"s)</span>")+"</p>"+'<p class="tea-time-classic-reporter" style="font-weight:bold;'+u+o(1)+'">'+t.fail+(t.assertionFail?"|"+t.assertionFail:"")+" failing</p>"+(t.optionalFail?'<p class="tea-time-classic-reporter" style="font-weight:bold;'+f+o(1)+'">'+t.optionalFail+" opt failing</p>":"")+(t.skip?'<p class="tea-time-classic-reporter" style="font-weight:bold;'+c+o(1)+'">'+t.skip+" pending</p>":"")+(t.coverageRate!==undefined?'<p class="tea-time-classic-reporter" style="font-weight:bold;'+t.coverageStyle+o(1)+'">'+Math.round(t.coverageRate*100)+"% coverage</p>":""));s()};i.errorReport=function e(t){var r,n,i="";i+='<h4 class="tea-time-classic-reporter" style="'+g+o(0)+'">== Errors ==</h4>';for(r=0;r<t.length;r++){n=t[r];i+='<p class="tea-time-classic-reporter" style="'+(n.optional?m:g)+o(1)+'">'+(r+1)+" ) ";switch(n.type){case"test":if(n.error.testTimeout){i+='<span style="'+v+'">TEST TIMEOUT</span> '}break;case"setup":i+='<span style="'+v+'">SETUP HOOK</span> ';break;case"teardown":i+='<span style="'+v+'">TEARDOWN HOOK</span> ';break;case"suiteSetup":i+='<span style="'+v+'">SUITE SETUP HOOK</span> ';break;case"suiteTeardown":i+='<span style="'+v+'">SUITE TEARDOWN HOOK</span> ';break}if(n.error.uncaught){i+='<span style="'+v+'">UNCAUGHT EXCEPTION</span> '}i+=n.title;i+="</p>";i+=this.reportOneError(n.error)}this.container.insertAdjacentHTML("beforeend","<hr />"+i);s()};i.prototype.reportOneError=function e(t){var r="";if(t.showDiff===true||t.showDiff===undefined&&"expected"in t&&"actual"in t){r+='<p class="tea-time-classic-reporter" style="'+o(2)+'">'+'<span style="'+w+'">expected</span><span style="'+k+'">actual</span>'+"</p>";r+='<pre class="tea-time-classic-reporter"; style="'+o(2)+'">';r+=this.teaTime.htmlColorDiff(t.actual,t.expected);r+="</pre>"}if(typeof t.expectationPath==="string"&&(t.showPathDiff===true||t.showPathDiff===undefined&&"expected"in t&&"actual"in t)){r+='<p class="tea-time-classic-reporter" style="'+o(2)+'">'+'<span style="'+b+'">at [.'+t.expectationPath+"]</span> "+'<span style="'+w+'">expected</span><span style="'+k+'">actual</span>'+"</p>";r+='<pre class="tea-time-classic-reporter"; style="'+o(2)+'">';r+=this.teaTime.htmlColorDiff(n.get(t.actual,t.expectationPath),n.get(t.expected,t.expectationPath));r+="</pre>"}r+='<pre class="tea-time-classic-reporter" style="'+o(2)+'">'+this.teaTime.inspect.inspectError({style:"html"},t)+"</pre>";return r}},{"tree-kit/lib/dotPath.js":122}],4:[function(e,t,r){"use strict";function n(e,t){if(!t){t=Object.create(n.prototype,{teaTime:{value:e,enumerable:true}})}t.teaTime.on("ok",n.ok.bind(t));t.teaTime.on("fail",n.fail.bind(t));t.teaTime.on("optionalFail",n.optionalFail.bind(t));t.teaTime.on("skip",n.skip.bind(t));t.teaTime.on("report",n.report.bind(t));return t}t.exports=n;n.ok=function e(t){console.log("OK:",t.title,"("+t.duration+")")};n.fail=function e(t){console.log("Fail:",t.title,t.duration!==undefined?"("+t.duration+")":"")};n.optionalFail=function e(t){console.log("Opt fail:",t.title,t.duration!==undefined?"("+t.duration+")":"")};n.skip=function e(t){console.log("Pending:",t.title)};n.report=function e(t){console.log("Report -- ok: "+t.ok+(t.assertionOk?"|"+t.assertionOk:"")+" fail: "+t.fail+(t.assertionFail?"|"+t.assertionFail:"")+" opt fail: "+t.optionalFail+" pending: "+t.skip," coverage: "+(typeof t.coverageRate==="number"?Math.round(t.coverageRate*100)+"%":"n/a"))}},{}],5:[function(e,t,r){"use strict";function n(e,t){if(!t){t=Object.create(n.prototype,{teaTime:{value:e,enumerable:true}})}t.teaTime.on("ready",{fn:n.ready.bind(t),async:true});t.teaTime.on("start",n.forward.bind(t,"start"));t.teaTime.on("enterSuite",n.forward.bind(t,"enterSuite"));t.teaTime.on("exitSuite",n.forward.bind(t,"exitSuite"));t.teaTime.on("enterTest",n.forward.bind(t,"enterTest"));t.teaTime.on("exitTest",n.forward.bind(t,"exitTest"));t.teaTime.on("ok",n.forward.bind(t,"ok"));t.teaTime.on("fail",n.forward.bind(t,"fail"));t.teaTime.on("optionalFail",n.forward.bind(t,"optionalFail"));t.teaTime.on("skip",n.forward.bind(t,"skip"));t.teaTime.on("assertionOk",n.forward.bind(t,"assertionOk"));t.teaTime.on("assertionFail",n.forward.bind(t,"assertionFail"));t.teaTime.on("report",n.forward.bind(t,"report"));t.teaTime.on("errorReport",n.forward.bind(t,"errorReport"));t.teaTime.on("exit",n.exit.bind(t,"exit"));return t}t.exports=n;n.ready=function e(t){var r=this;this.ws=new WebSocket("ws://127.0.0.1:7357/"+this.teaTime.token);this.ws.onopen=function e(){n.forward.call(r,"ready");console.log("Websocket opened!");t()};this.ws.onclose=function e(){console.log("Websocket closed!")}};n.forward=function e(t,...r){this.teaTime.prepareSerialize(r);this.ws.send(JSON.stringify({event:t,args:r}))};n.exit=function e(t){n.forward.call(this,"exit");this.ws.close()}},{}],6:[function(t,e,r){"use strict";const n=t("./TeaTime.js");const i=t("./diff.js");const s=t("./htmlColorDiff.js");const o=t("string-kit/lib/inspect.js");const a=t("dom-kit");const l=t("url");function u(){var e={onceUncaughtException:function(s){window.onerror=function(e,t,r,n,i){window.onerror=function(){};s(i);return true}},offUncaughtException:function(){window.onerror=function(){}},allowConsole:true};n.populateOptionsWithArgs(e,l.parse(window.location.href,true).query);window.teaTime=new n(e);window.teaTime.init();window.teaTime.diff=i;window.teaTime.htmlColorDiff=s;window.teaTime.inspect=o;window.teaTime.prepareSerialize=f;window.teaTime.reporters={console:t("./browser-reporters/console.js"),classic:t("./browser-reporters/classic.js"),websocket:t("./browser-reporters/websocket.js")};e.reporters.forEach(e=>{window.teaTime.reporters[e](window.teaTime)});if(e.ws){window.teaTime.ws=true}return window.teaTime}e.exports=u;function f(e){var t,r,n,i,s;if(!e||typeof e!=="object"){return}if(Array.isArray(e)){for(t=0,r=e.length;t<r;t++){f(e[t])}return}i=Object.getPrototypeOf(e);s=i&&i.constructor.name;if(s&&s!=="Object"){e.__prototype=s}if(e instanceof Error){Object.defineProperties(e,{__prototype:{value:e.constructor.name,enumerable:true,writable:true,configurable:true},name:{value:e.name,enumerable:true,writable:true,configurable:true},message:{value:e.message,enumerable:true,writable:true,configurable:true},type:{value:e.type||e.constructor.name,enumerable:true,writable:true,configurable:true},stack:{value:e.stack,enumerable:true,writable:true,configurable:true}})}n=Object.keys(e);for(t=0,r=n.length;t<r;t++){f(e[n[t]])}}u();a.ready(()=>{window.teaTime.run()})},{"./TeaTime.js":2,"./browser-reporters/classic.js":3,"./browser-reporters/console.js":4,"./browser-reporters/websocket.js":5,"./diff.js":7,"./htmlColorDiff.js":8,"dom-kit":40,"string-kit/lib/inspect.js":108,url:128}],7:[function(e,t,r){"use strict";const a=e("string-kit/lib/inspect.js").inspect;const l=e("diff");const u={minimalPlusConstructor:true,depth:10,maxLength:1e3,outputMaxLength:1e4,sort:true};function i(e,t){var r="",n=i.raw(e,t,true);n.forEach(e=>{r+=e.value.replace(/^(?!$)/gm,()=>{if(e.added){return"++"}else if(e.removed){return"--"}return" "})});return r}t.exports=i;i.raw=function(e,t,r){var n,i;var s=a(u,e);var o=a(u,t);if(!r){i=Math.abs(s.length-o.length)+.05*Math.max(s.length,o.length);if(i<100){n=l.diffChars(s,o);i=0;n.forEach(e=>{if(e.added||e.removed){i+=15+e.value.length}});if(i<80){return n}}}n=l.diffLines(s,o);return n}},{diff:39,"string-kit/lib/inspect.js":108}],8:[function(e,t,r){"use strict";const s=e("./diff.js").raw;t.exports=function e(t,r){var n="",i=s(t,r);i.forEach(e=>{if(e.added){n+=e.value.replace(/^(\s*)(\S(?:[^\n]*\S)?)(\s*)$/gm,(e,t,r,n)=>{return t+'<span style="background-color:green;color:white">'+r+"</span>"+n})}else if(e.removed){n+=e.value.replace(/^(\s*)(\S(?:[^\n]*\S)?)(\s*)$/gm,(e,t,r,n)=>{return t+'<span style="background-color:red;color:white">'+r+"</span>"+n})}else{n+='<span style="color:grey">'+e.value+"</span>"}});return n}},{"./diff.js":7}],9:[function(e,t,r){var a=e("acorn");var l=e("isarray");var u=e("object-keys");var f=e("foreach");var c=e("util");t.exports=function(e,t,i){if(typeof t==="function"){i=t;t={}}if(e&&typeof e==="object"&&e.constructor.name==="Buffer"){e=e.toString()}else if(e&&typeof e==="object"){t=e;e=t.source;delete t.source}e=e===undefined?t.source:e;if(typeof e!=="string")e=String(e);var r=t.parser||a;var n=r.parse(e,t);var s={chunks:e.split(""),toString:function(){return s.chunks.join("")},inspect:function(){return s.toString()}};if(c.inspect.custom){s[c.inspect.custom]=s.toString}var o=0;(function r(n,e){h(n,e,s.chunks);f(u(n),function(e){if(e==="parent")return;var t=n[e];if(l(t)){f(t,function(e){if(e&&typeof e.type==="string"){r(e,n)}})}else if(t&&typeof t.type==="string"){r(t,n)}});i(n)})(n,undefined);return s};function h(r,e,n){r.parent=e;r.source=function(){return n.slice(r.start,r.end).join("")};if(r.update&&typeof r.update==="object"){var t=r.update;f(u(t),function(e){i[e]=t[e]});r.update=i}else{r.update=i}function i(e){n[r.start]=e;for(var t=r.start+1;t<r.end;t++){n[t]=""}}}},{acorn:30,foreach:57,isarray:71,"object-keys":83,util:132}],10:[function(e,t,r){function n(e){this.options=e||{locator:{}}}n.prototype.parseFromString=function(e,t){var r=this.options;var n=new y;var i=r.domBuilder||new c;var s=r.errorHandler;var o=r.locator;var a=r.xmlns||{};var l=/\/x?html?$/.test(t);var u=l?d.entityMap:{lt:"<",gt:">",amp:"&",quot:'"',apos:"'"};if(o){i.setDocumentLocator(o)}n.errorHandler=f(s,i,o);n.domBuilder=r.domBuilder||i;if(l){a[""]="http://www.w3.org/1999/xhtml"}a.xml=a.xml||"http://www.w3.org/XML/1998/namespace";if(e){n.parse(e,a,u)}else{n.errorHandler.error("invalid doc source")}return i.doc};function f(n,e,i){if(!n){if(e instanceof c){return e}n=e}var s={};var o=n instanceof Function;i=i||{};function t(t){var r=n[t];if(!r&&o){r=n.length==2?function(e){n(t,e)}:n}s[t]=r&&function(e){r("[xmldom "+t+"]\t"+e+a(i))}||function(){}}t("warning");t("error");t("fatalError");return s}function c(){this.cdata=false}function h(e,t){t.lineNumber=e.lineNumber;t.columnNumber=e.columnNumber}c.prototype={startDocument:function(){this.doc=(new s).createDocument(null,null,null);if(this.locator){this.doc.documentURI=this.locator.systemId}},startElement:function(e,t,r,n){var i=this.doc;var s=i.createElementNS(e,r||t);var o=n.length;p(this,s);this.currentElement=s;this.locator&&h(this.locator,s);for(var a=0;a<o;a++){var e=n.getURI(a);var l=n.getValue(a);var r=n.getQName(a);var u=i.createAttributeNS(e,r);this.locator&&h(n.getLocator(a),u);u.value=u.nodeValue=l;s.setAttributeNode(u)}},endElement:function(e,t,r){var n=this.currentElement;var i=n.tagName;this.currentElement=n.parentNode},startPrefixMapping:function(e,t){},endPrefixMapping:function(e){},processingInstruction:function(e,t){var r=this.doc.createProcessingInstruction(e,t);this.locator&&h(this.locator,r);p(this,r)},ignorableWhitespace:function(e,t,r){},characters:function(e,t,r){e=i.apply(this,arguments);if(e){if(this.cdata){var n=this.doc.createCDATASection(e)}else{var n=this.doc.createTextNode(e)}if(this.currentElement){this.currentElement.appendChild(n)}else if(/^\s*$/.test(e)){this.doc.appendChild(n)}this.locator&&h(this.locator,n)}},skippedEntity:function(e){},endDocument:function(){this.doc.normalize()},setDocumentLocator:function(e){if(this.locator=e){e.lineNumber=0}},comment:function(e,t,r){e=i.apply(this,arguments);var n=this.doc.createComment(e);this.locator&&h(this.locator,n);p(this,n)},startCDATA:function(){this.cdata=true},endCDATA:function(){this.cdata=false},startDTD:function(e,t,r){var n=this.doc.implementation;if(n&&n.createDocumentType){var i=n.createDocumentType(e,t,r);this.locator&&h(this.locator,i);p(this,i)}},warning:function(e){console.warn("[xmldom warning]\t"+e,a(this.locator))},error:function(e){console.error("[xmldom error]\t"+e,a(this.locator))},fatalError:function(e){console.error("[xmldom fatalError]\t"+e,a(this.locator));throw e}};function a(e){if(e){return"\n@"+(e.systemId||"")+"#[line:"+e.lineNumber+",col:"+e.columnNumber+"]"}}function i(e,t,r){if(typeof e=="string"){return e.substr(t,r)}else{if(e.length>=t+r||t){return new java.lang.String(e,t,r)+""}return e}}"endDTD,startEntity,endEntity,attributeDecl,elementDecl,externalEntityDecl,internalEntityDecl,resolveEntity,getExternalSubset,notationDecl,unparsedEntityDecl".replace(/\w+/g,function(e){c.prototype[e]=function(){return null}});function p(e,t){if(!e.currentElement){e.doc.appendChild(t)}else{e.currentElement.appendChild(t)}}var d=e("./entities");var y=e("./sax").XMLReader;var s=r.DOMImplementation=e("./dom").DOMImplementation;r.XMLSerializer=e("./dom").XMLSerializer;r.DOMParser=n},{"./dom":11,"./entities":12,"./sax":29}],11:[function(e,R,t){"use strict";const a=e("string-kit");function i(t,r){Object.getOwnPropertyNames(t).forEach(e=>{Object.defineProperty(r,e,Object.getOwnPropertyDescriptor(t,e))})}function r(e,t){var r=e.prototype;if(!(r instanceof t)){function n(){}n.prototype=t.prototype;n=new n;i(r,n);e.prototype=r=n}if(r.constructor!=e){if(typeof e!="function"){console.error("unknow Class:"+e)}r.constructor=e}}var D="http://www.w3.org/1999/xhtml";var n={};var v=n.ELEMENT_NODE=1;var b=n.ATTRIBUTE_NODE=2;var w=n.TEXT_NODE=3;var k=n.CDATA_SECTION_NODE=4;var x=n.ENTITY_REFERENCE_NODE=5;var F=n.ENTITY_NODE=6;var E=n.PROCESSING_INSTRUCTION_NODE=7;var B=n.COMMENT_NODE=8;var U=n.DOCUMENT_NODE=9;var V=n.DOCUMENT_TYPE_NODE=10;var S=n.DOCUMENT_FRAGMENT_NODE=11;var q=n.NOTATION_NODE=12;var s={};var o={};var z=s.INDEX_SIZE_ERR=(o[1]="Index size error",1);var W=s.DOMSTRING_SIZE_ERR=(o[2]="DOMString size error",2);var G=s.HIERARCHY_REQUEST_ERR=(o[3]="Hierarchy request error",3);var H=s.WRONG_DOCUMENT_ERR=(o[4]="Wrong document",4);var $=s.INVALID_CHARACTER_ERR=(o[5]="Invalid character",5);var Y=s.NO_DATA_ALLOWED_ERR=(o[6]="No data allowed",6);var X=s.NO_MODIFICATION_ALLOWED_ERR=(o[7]="No modification allowed",7);var K=s.NOT_FOUND_ERR=(o[8]="Not found",8);var Z=s.NOT_SUPPORTED_ERR=(o[9]="Not supported",9);var J=s.INUSE_ATTRIBUTE_ERR=(o[10]="Attribute in use",10);var Q=s.INVALID_STATE_ERR=(o[11]="Invalid state",11);var ee=s.SYNTAX_ERR=(o[12]="Syntax error",12);var te=s.INVALID_MODIFICATION_ERR=(o[13]="Invalid modification",13);var re=s.NAMESPACE_ERR=(o[14]="Invalid namespace",14);var ne=s.INVALID_ACCESS_ERR=(o[15]="Invalid access",15);function l(e,t){if(t instanceof Error){var r=t}else{r=this;Error.call(this,o[e]);this.message=o[e];if(Error.captureStackTrace)Error.captureStackTrace(this,l)}r.code=e;if(t)this.message=this.message+": "+t;return r}l.prototype=Error.prototype;i(s,l);function c(){}c.prototype={length:0,item:function(e){return this[e]||null},toString:function(e,t){for(var r=[],n=0;n<this.length;n++){I(this[n],r,e,t)}return r.join("")}};function u(e,t){this._node=e;this._refresh=t;f(this)}function f(e){var t=e._node._inc||e._node.ownerDocument._inc;if(e._inc!=t){var r=e._refresh(e._node);Ee(e,"length",r.length);i(r,e);e._inc=t}}u.prototype.item=function(e){f(this);return this[e]};r(u,c);function h(){}function ie(e,t){var r=e.length;while(r--){if(e[r]===t){return r}}}function se(e,t,r,n){if(n){t[ie(t,n)]=r}else{t[t.length++]=r}if(e){r.ownerElement=e;var i=e.ownerDocument;if(i){n&&fe(i,e,n);ue(i,e,r)}}}function oe(e,t,r){var n=ie(t,r);if(n>=0){var i=t.length-1;while(n<i){t[n]=t[++n]}t.length=i;if(e){var s=e.ownerDocument;if(s){fe(s,e,r);r.ownerElement=null}}}else{throw l(K,new Error(e.tagName+"@"+r))}}h.prototype={length:0,item:c.prototype.item,getNamedItem:function(e){var t=this.length;while(t--){var r=this[t];if(r.nodeName==e){return r}}},setNamedItem:function(e){var t=e.ownerElement;if(t&&t!=this._ownerElement){throw new l(J)}var r=this.getNamedItem(e.nodeName);se(this._ownerElement,this,e,r);return r},setNamedItemNS:function(e){var t=e.ownerElement,r;if(t&&t!=this._ownerElement){throw new l(J)}r=this.getNamedItemNS(e.namespaceURI,e.localName);se(this._ownerElement,this,e,r);return r},removeNamedItem:function(e){var t=this.getNamedItem(e);oe(this._ownerElement,this,t);return t},removeNamedItemNS:function(e,t){var r=this.getNamedItemNS(e,t);oe(this._ownerElement,this,r);return r},getNamedItemNS:function(e,t){var r=this.length;while(r--){var n=this[r];if(n.localName==t&&n.namespaceURI==e){return n}}return null}};function ae(e){this._features={};if(e){for(var t in e){this._features=e[t]}}}ae.prototype={hasFeature:function(e,t){var r=this._features[e.toLowerCase()];if(r&&(!t||t in r)){return true}else{return false}},createDocument:function(e,t,r){var n=new y;n.implementation=this;n.childNodes=new c;n.doctype=r;if(r){n.appendChild(r)}if(t){var i=n.createElementNS(e,t);n.appendChild(i)}return n},createDocumentType:function(e,t,r){var n=new j;n.name=e;n.nodeName=e;n.publicId=t;n.systemId=r;return n}};function p(){}p.prototype={firstChild:null,lastChild:null,previousSibling:null,nextSibling:null,attributes:null,parentNode:null,childNodes:null,ownerDocument:null,nodeValue:null,namespaceURI:null,prefix:null,localName:null,insertBefore:function(e,t){return he(this,e,t)},replaceChild:function(e,t){this.insertBefore(e,t);if(t){this.removeChild(t)}},removeChild:function(e){return ce(this,e)},appendChild:function(e){return this.insertBefore(e,null)},hasChildNodes:function(){return this.firstChild!=null},cloneNode:function(e){return M(this.ownerDocument||this,this,e)},normalize:function(){var e=this.firstChild;while(e){var t=e.nextSibling;if(t&&t.nodeType==w&&e.nodeType==w){this.removeChild(t);e.appendData(t.data)}else{e.normalize();e=t}}},isSupported:function(e,t){return this.ownerDocument.implementation.hasFeature(e,t)},hasAttributes:function(){return this.attributes.length>0},lookupPrefix:function(e){var t=this;while(t){var r=t._nsMap;if(r){for(var n in r){if(r[n]==e){return n}}}t=t.nodeType==b?t.ownerDocument:t.parentNode}return null},lookupNamespaceURI:function(e){var t=this;while(t){var r=t._nsMap;if(r){if(e in r){return r[e]}}t=t.nodeType==b?t.ownerDocument:t.parentNode}return null},isDefaultNamespace:function(e){var t=this.lookupPrefix(e);return t==null}};function le(e){return e=="<"&&"<"||e==">"&&">"||e=="&"&&"&"||e=='"'&&"""||"&#"+e.charCodeAt()+";"}i(n,p);i(n,p.prototype);function d(e,t){if(t(e)){return true}if(e=e.firstChild){do{if(d(e,t)){return true}}while(e=e.nextSibling)}}function y(){}function ue(e,t,r){e&&e._inc++;var n=r.namespaceURI;if(n=="http://www.w3.org/2000/xmlns/"){t._nsMap[r.prefix?r.localName:""]=r.value}}function fe(e,t,r,n){e&&e._inc++;var i=r.namespaceURI;if(i=="http://www.w3.org/2000/xmlns/"){delete t._nsMap[r.prefix?r.localName:""]}}function m(e,t,r){if(e&&e._inc){e._inc++;var n=t.childNodes;if(r){n[n.length++]=r}else{var i=t.firstChild;var s=0;while(i){n[s++]=i;i=i.nextSibling}n.length=s}}}function ce(e,t){var r=t.previousSibling;var n=t.nextSibling;if(r){r.nextSibling=n}else{e.firstChild=n}if(n){n.previousSibling=r}else{e.lastChild=r}m(e.ownerDocument,e);return t}function he(e,t,r){var n=t.parentNode;if(n){n.removeChild(t)}if(t.nodeType===S){var i=t.firstChild;if(i==null){return t}var s=t.lastChild}else{i=s=t}var o=r?r.previousSibling:e.lastChild;i.previousSibling=o;s.nextSibling=r;if(o){o.nextSibling=i}else{e.firstChild=i}if(r==null){e.lastChild=s}else{r.previousSibling=s}do{i.parentNode=e}while(i!==s&&(i=i.nextSibling));m(e.ownerDocument||e,e);if(t.nodeType==S){t.firstChild=t.lastChild=null}return t}function pe(e,t){var r=t.parentNode;if(r){var n=e.lastChild;r.removeChild(t);var n=e.lastChild}var n=e.lastChild;t.parentNode=e;t.previousSibling=n;t.nextSibling=null;if(n){n.nextSibling=t}else{e.firstChild=t}e.lastChild=t;m(e.ownerDocument,e,t);return t}y.prototype={nodeName:"#document",nodeType:U,doctype:null,documentElement:null,_inc:1,insertBefore:function(e,t){if(e.nodeType==S){var r=e.firstChild;while(r){var n=r.nextSibling;this.insertBefore(r,t);r=n}return e}if(this.documentElement==null&&e.nodeType==v){this.documentElement=e}return he(this,e,t),e.ownerDocument=this,e},removeChild:function(e){if(this.documentElement==e){this.documentElement=null}return ce(this,e)},importNode:function(e,t){return xe(this,e,t)},getElementById:function(t){var r=null;d(this.documentElement,function(e){if(e.nodeType==v){if(e.getAttribute("id")==t){r=e;return true}}});return r},createElement:function(e){var t=new g;t.ownerDocument=this;t.nodeName=e;t.tagName=e;t.childNodes=new c;var r=t.attributes=new h;r._ownerElement=t;return t},createDocumentFragment:function(){var e=new L;e.ownerDocument=this;e.childNodes=new c;return e},createTextNode:function(e){var t=new T;t.ownerDocument=this;t.appendData(e);return t},createComment:function(e){var t=new C;t.ownerDocument=this;t.appendData(e);return t},createCDATASection:function(e){var t=new O;t.ownerDocument=this;t.appendData(e);return t},createProcessingInstruction:function(e,t){var r=new P;r.ownerDocument=this;r.tagName=r.target=e;r.nodeValue=r.data=t;return r},createAttribute:function(e){var t=new A;t.ownerDocument=this;t.name=e;t.nodeName=e;t.localName=e;t.specified=true;return t},createEntityReference:function(e){var t=new N;t.ownerDocument=this;t.nodeName=e;return t},createElementNS:function(e,t){var r=new g;var n=t.split(":");var i=r.attributes=new h;r.childNodes=new c;r.ownerDocument=this;r.nodeName=t;r.tagName=t;r.namespaceURI=e;if(n.length==2){r.prefix=n[0];r.localName=n[1]}else{r.localName=t}i._ownerElement=r;return r},createAttributeNS:function(e,t){var r=new A;var n=t.split(":");r.ownerDocument=this;r.nodeName=t;r.name=t;r.namespaceURI=e;r.specified=true;if(n.length==2){r.prefix=n[0];r.localName=n[1]}else{r.localName=t}return r},querySelector:function(e){return this.nwmatcher.first(e,this)},querySelectorAll:function(e){return this.nwmatcher.select(e,this)}};const de=e("nwmatcher");Object.defineProperty(y.prototype,"nwmatcher",{configurable:true,get:function(){var e;var t={};t.document=this;t.document.addEventListener=function(){};try{e=de(t)}catch(e){return null}Object.defineProperty(this,"nwmatcher",{value:e});return e}});r(y,p);function g(){this._nsMap={};this.classList=new ye(this);this.style=new Proxy(this,me)}g.prototype={nodeType:v,hasAttribute:function(e){return this.getAttributeNode(e)!=null},getAttribute:function(e){var t=this.getAttributeNode(e);return t&&t.value||""},getAttributeNode:function(e){return this.attributes.getNamedItem(e)},setAttribute:function(e,t){var r=this.ownerDocument.createAttribute(e);r.value=r.nodeValue=""+t;this.setAttributeNode(r)},removeAttribute:function(e){var t=this.getAttributeNode(e);t&&this.removeAttributeNode(t)},appendChild:function(e){if(e.nodeType===S){return this.insertBefore(e,null)}else{return pe(this,e)}},setAttributeNode:function(e){return this.attributes.setNamedItem(e)},setAttributeNodeNS:function(e){return this.attributes.setNamedItemNS(e)},removeAttributeNode:function(e){return this.attributes.removeNamedItem(e.nodeName)},removeAttributeNS:function(e,t){var r=this.getAttributeNodeNS(e,t);r&&this.removeAttributeNode(r)},hasAttributeNS:function(e,t){return this.getAttributeNodeNS(e,t)!=null},getAttributeNS:function(e,t){var r=this.getAttributeNodeNS(e,t);return r&&r.value||""},setAttributeNS:function(e,t,r){var n=this.ownerDocument.createAttributeNS(e,t);n.value=n.nodeValue=""+r;this.setAttributeNode(n)},getAttributeNodeNS:function(e,t){return this.attributes.getNamedItemNS(e,t)},getElementsByTagName:function(n){return new u(this,function(t){var r=[];d(t,function(e){if(e!==t&&e.nodeType==v&&(n==="*"||e.tagName==n)){r.push(e)}});return r})},getElementsByTagNameNS:function(n,i){return new u(this,function(t){var r=[];d(t,function(e){if(e!==t&&e.nodeType===v&&(n==="*"||e.namespaceURI===n)&&(i==="*"||e.localName==i)){r.push(e)}});return r})},querySelector:function(e){return this.ownerDocument.nwmatcher.first(e,this)},querySelectorAll:function(e){return this.ownerDocument.nwmatcher.select(e,this)}};y.prototype.getElementsByTagName=g.prototype.getElementsByTagName;y.prototype.getElementsByTagNameNS=g.prototype.getElementsByTagNameNS;r(g,p);function ye(e){this.__element=e}ye.prototype={add:function(e){var t=this.__element.getAttribute("class").trim();if(t){t=t.split(/ +/);if(t.indexOf(e)===-1){t.push(e);this.__element.setAttribute("class",t.join(" "))}}else{this.__element.setAttribute("class",e)}},remove:function(e){var t,r=this.__element.getAttribute("class").trim();if(r){r=r.split(/ +/);t=r.indexOf(e);if(t!==-1){r.splice(t,1);this.__element.setAttribute("class",r.join(" "))}}}};const me={get:function(e,t){var r=e.getAttribute("style").trim();if(!r){return}t=a.camelCaseToDashed(t);var n=r.match(new RegExp("(?:^|;) *"+t+" *: *([^;]+?) *(?:;|$)"));if(n){return n[1]}else{return undefined}},set:function(e,i,s,t){var r=e.getAttribute("style").trim();i=a.camelCaseToDashed(i);if(!r){if(s){e.setAttribute("style",i+":"+s)}return true}var o=false;r=r.replace(new RegExp("(^|;) *"+i+" *: *([^;]+?) *(;|$)"),(e,t,r,n)=>{o=true;if(s){return t+i+":"+s+n}else{return t}});if(o){e.setAttribute("style",r.trim())}else if(s){e.setAttribute("style",r+";"+i+":"+s)}return true}};function A(){}A.prototype.nodeType=b;r(A,p);function _(){}_.prototype={data:"",substringData:function(e,t){return this.data.substring(e,e+t)},appendData:function(e){e=this.data+e;this.nodeValue=this.data=e;this.length=e.length},insertData:function(e,t){this.replaceData(e,0,t)},appendChild:function(e){throw new Error(o[G])},deleteData:function(e,t){this.replaceData(e,t,"")},replaceData:function(e,t,r){var n=this.data.substring(0,e);var i=this.data.substring(e+t);r=n+r+i;this.nodeValue=this.data=r;this.length=r.length}};r(_,p);function T(){}T.prototype={nodeName:"#text",nodeType:w,splitText:function(e){var t=this.data;var r=t.substring(e);t=t.substring(0,e);this.data=this.nodeValue=t;this.length=t.length;var n=this.ownerDocument.createTextNode(r);if(this.parentNode){this.parentNode.insertBefore(n,this.nextSibling)}return n}};r(T,_);function C(){}C.prototype={nodeName:"#comment",nodeType:B};r(C,_);function O(){}O.prototype={nodeName:"#cdata-section",nodeType:k};r(O,_);function j(){}j.prototype.nodeType=V;r(j,p);function ge(){}ge.prototype.nodeType=q;r(ge,p);function ve(){}ve.prototype.nodeType=F;r(ve,p);function N(){}N.prototype.nodeType=x;r(N,p);function L(){}L.prototype.nodeName="#document-fragment";L.prototype.nodeType=S;r(L,p);function P(){}P.prototype.nodeType=E;r(P,p);function be(){}be.prototype.serializeToString=function(e,t,r){return we.call(e,t,r)};p.prototype.toString=we;function we(e,t){var r=[];var n=this.nodeType==9&&this.documentElement||this;var i=n.prefix;var s=n.namespaceURI;if(s&&i==null){var i=n.lookupPrefix(s);if(i==null){var o=[{namespace:s,prefix:null}]}}I(this,r,e,t,o);return r.join("")}function ke(e,t,r){var n=e.prefix||"";var i=e.namespaceURI;if(!n&&!i){return false}if(n==="xml"&&i==="http://www.w3.org/XML/1998/namespace"||i=="http://www.w3.org/2000/xmlns/"){return false}var s=r.length;while(s--){var o=r[s];if(o.prefix==n){return o.namespace!=i}}return true}function I(e,t,r,n,i){if(n){e=n(e);if(e){if(typeof e=="string"){t.push(e);return}}else{return}}switch(e.nodeType){case v:if(!i)i=[];var s=i.length;var o=e.attributes;var a=o.length;var l=e.firstChild;var u=e.tagName;r=D===e.namespaceURI||r;t.push("<",u);for(var f=0;f<a;f++){var c=o.item(f);if(c.prefix=="xmlns"){i.push({prefix:c.localName,namespace:c.v