From a0b57a0d2116fa4bae8da75e4b2f99e425962800 Mon Sep 17 00:00:00 2001 From: Bubobubobubobubo Date: Mon, 21 Aug 2023 10:25:52 +0000 Subject: [PATCH] deploy: bc0b3f8b91ac705d2a7f5c3e5488ae63d6029f0e --- assets/{index-be072419.js => index-1e4a7962.js} | 2 +- index.html | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) rename assets/{index-be072419.js => index-1e4a7962.js} (97%) diff --git a/assets/index-be072419.js b/assets/index-1e4a7962.js similarity index 97% rename from assets/index-be072419.js rename to assets/index-1e4a7962.js index f1fb940..5888941 100644 --- a/assets/index-be072419.js +++ b/assets/index-1e4a7962.js @@ -536,7 +536,7 @@ Topos is made to be controlled entirely with a keyboard. It is recommanded to st `+o.line+" | "+p+` `+u+" | "+peg$padEnd("",s.column-1," ")+peg$padEnd("",g,"^")}else e+=` at `+l}return e},peg$SyntaxError.buildMessage=function(a,e){var r={literal:function(p){return'"'+s(p.text)+'"'},class:function(p){var h=p.parts.map(function(g){return Array.isArray(g)?o(g[0])+"-"+o(g[1]):o(g)});return"["+(p.inverted?"^":"")+h.join("")+"]"},any:function(){return"any character"},end:function(){return"end of input"},other:function(p){return p.description}};function n(p){return p.charCodeAt(0).toString(16).toUpperCase()}function s(p){return p.replace(/\\/g,"\\\\").replace(/"/g,'\\"').replace(/\0/g,"\\0").replace(/\t/g,"\\t").replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/[\x00-\x0F]/g,function(h){return"\\x0"+n(h)}).replace(/[\x10-\x1F\x7F-\x9F]/g,function(h){return"\\x"+n(h)})}function o(p){return p.replace(/\\/g,"\\\\").replace(/\]/g,"\\]").replace(/\^/g,"\\^").replace(/-/g,"\\-").replace(/\0/g,"\\0").replace(/\t/g,"\\t").replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/[\x00-\x0F]/g,function(h){return"\\x0"+n(h)}).replace(/[\x10-\x1F\x7F-\x9F]/g,function(h){return"\\x"+n(h)})}function l(p){return r[p.type](p)}function c(p){var h=p.map(l),g,b;if(h.sort(),h.length>0){for(g=1,b=1;g",peg$c9="[",peg$c10="+",peg$c11="*",peg$c12="%",peg$c13="&",peg$c14="|",peg$c15="<<",peg$c16=">>",peg$r0=/^[' '\t\r\n]/,peg$r1=/^[0-9]/,peg$e0=peg$classExpectation(["'"," ","'"," ","\r",` -`],!1,!1),peg$e1=peg$literalExpectation("(",!1),peg$e2=peg$literalExpectation(",",!1),peg$e3=peg$literalExpectation(")",!1),peg$e4=peg$classExpectation([["0","9"]],!1,!1),peg$e5=peg$literalExpectation(".",!1),peg$e6=peg$literalExpectation("-",!1),peg$e7=peg$literalExpectation("/",!1),peg$e8=peg$literalExpectation("\\",!1),peg$e9=peg$literalExpectation("<",!1),peg$e10=peg$literalExpectation(">",!1),peg$e11=peg$literalExpectation("[",!1),peg$e12=peg$literalExpectation("+",!1),peg$e13=peg$literalExpectation("*",!1),peg$e14=peg$literalExpectation("%",!1),peg$e15=peg$literalExpectation("&",!1),peg$e16=peg$literalExpectation("|",!1),peg$e17=peg$literalExpectation("<<",!1),peg$e18=peg$literalExpectation(">>",!1),peg$f0=function(a){return centsToSemitones(a.filter(e=>e))},peg$f1=function(){},peg$f2=function(a,e){return Math.floor(Math.random()*(e-a+1)+a)},peg$f3=function(a,e){return Math.random()*(e-a)+a},peg$f4=function(){return parseFloat(text())},peg$f5=function(){return parseInt(text())},peg$f6=function(a){return ratioToCents(a)},peg$f7=function(a,e){return a/e},peg$f8=function(a,e){return Math.pow(2,a/e)},peg$f9=function(a,e,r,n){var s=n?r/n:r;return Math.pow(s,a/e)},peg$f10=function(a,e){return parseFloat(a.toString()+"."+e.toString())},peg$f11=function(a){return a.filter(e=>e)},peg$f12=function(a){return monzoToCents(a)},peg$f13=function(){return eval(text())},peg$currPos=0,peg$savedPos=0,peg$posDetailsCache=[{line:1,column:1}],peg$maxFailPos=0,peg$maxFailExpected=[],peg$resultsCache={},peg$result;if("startRule"in options){if(!(options.startRule in peg$startRuleFunctions))throw new Error(`Can't start parsing from rule "`+options.startRule+'".');peg$startRuleFunction=peg$startRuleFunctions[options.startRule]}function text(){return input.substring(peg$savedPos,peg$currPos)}function peg$literalExpectation(a,e){return{type:"literal",text:a,ignoreCase:e}}function peg$classExpectation(a,e,r){return{type:"class",parts:a,inverted:e,ignoreCase:r}}function peg$endExpectation(){return{type:"end"}}function peg$computePosDetails(a){var e=peg$posDetailsCache[a],r;if(e)return e;for(r=a-1;!peg$posDetailsCache[r];)r--;for(e=peg$posDetailsCache[r],e={line:e.line,column:e.column};rpeg$maxFailPos&&(peg$maxFailPos=peg$currPos,peg$maxFailExpected=[]),peg$maxFailExpected.push(a))}function peg$buildStructuredError(a,e,r){return new peg$SyntaxError(peg$SyntaxError.buildMessage(a,e),a,e,r)}function peg$parselines(){var a,e,r,n=peg$currPos*17+0,s=peg$resultsCache[n];if(s)return peg$currPos=s.nextPos,s.result;if(a=peg$currPos,e=[],r=peg$parseratio(),r===peg$FAILED&&(r=peg$parsevalue(),r===peg$FAILED&&(r=peg$parsemonzo(),r===peg$FAILED&&(r=peg$parseoperation(),r===peg$FAILED&&(r=peg$parsesep())))),r!==peg$FAILED)for(;r!==peg$FAILED;)e.push(r),r=peg$parseratio(),r===peg$FAILED&&(r=peg$parsevalue(),r===peg$FAILED&&(r=peg$parsemonzo(),r===peg$FAILED&&(r=peg$parseoperation(),r===peg$FAILED&&(r=peg$parsesep()))));else e=peg$FAILED;return e!==peg$FAILED&&(peg$savedPos=a,e=peg$f0(e)),a=e,peg$resultsCache[n]={nextPos:peg$currPos,result:a},a}function peg$parsesep(){var a,e,r=peg$currPos*17+1,n=peg$resultsCache[r];return n?(peg$currPos=n.nextPos,n.result):(a=peg$currPos,peg$r0.test(input.charAt(peg$currPos))?(e=input.charAt(peg$currPos),peg$currPos++):(e=peg$FAILED,peg$fail(peg$e0)),e!==peg$FAILED&&(peg$savedPos=a,e=peg$f1()),a=e,peg$resultsCache[r]={nextPos:peg$currPos,result:a},a)}function peg$parsevalue(){var a,e=peg$currPos*17+2,r=peg$resultsCache[e];return r?(peg$currPos=r.nextPos,r.result):(a=peg$parsefloat(),a===peg$FAILED&&(a=peg$parseint(),a===peg$FAILED&&(a=peg$parserandom_int(),a===peg$FAILED&&(a=peg$parserandom_float()))),peg$resultsCache[e]={nextPos:peg$currPos,result:a},a)}function peg$parserandom_int(){var a,e,r,n,s,o,l=peg$currPos*17+3,c=peg$resultsCache[l];return c?(peg$currPos=c.nextPos,c.result):(a=peg$currPos,input.charCodeAt(peg$currPos)===40?(e=peg$c0,peg$currPos++):(e=peg$FAILED,peg$fail(peg$e1)),e!==peg$FAILED?(r=peg$parseint(),r!==peg$FAILED?(input.charCodeAt(peg$currPos)===44?(n=peg$c1,peg$currPos++):(n=peg$FAILED,peg$fail(peg$e2)),n!==peg$FAILED?(s=peg$parseint(),s!==peg$FAILED?(input.charCodeAt(peg$currPos)===41?(o=peg$c2,peg$currPos++):(o=peg$FAILED,peg$fail(peg$e3)),o!==peg$FAILED?(peg$savedPos=a,a=peg$f2(r,s)):(peg$currPos=a,a=peg$FAILED)):(peg$currPos=a,a=peg$FAILED)):(peg$currPos=a,a=peg$FAILED)):(peg$currPos=a,a=peg$FAILED)):(peg$currPos=a,a=peg$FAILED),peg$resultsCache[l]={nextPos:peg$currPos,result:a},a)}function peg$parserandom_float(){var a,e,r,n,s,o,l=peg$currPos*17+4,c=peg$resultsCache[l];return c?(peg$currPos=c.nextPos,c.result):(a=peg$currPos,input.charCodeAt(peg$currPos)===40?(e=peg$c0,peg$currPos++):(e=peg$FAILED,peg$fail(peg$e1)),e!==peg$FAILED?(r=peg$parsefloat(),r!==peg$FAILED?(input.charCodeAt(peg$currPos)===44?(n=peg$c1,peg$currPos++):(n=peg$FAILED,peg$fail(peg$e2)),n!==peg$FAILED?(s=peg$parsefloat(),s!==peg$FAILED?(input.charCodeAt(peg$currPos)===41?(o=peg$c2,peg$currPos++):(o=peg$FAILED,peg$fail(peg$e3)),o!==peg$FAILED?(peg$savedPos=a,a=peg$f3(r,s)):(peg$currPos=a,a=peg$FAILED)):(peg$currPos=a,a=peg$FAILED)):(peg$currPos=a,a=peg$FAILED)):(peg$currPos=a,a=peg$FAILED)):(peg$currPos=a,a=peg$FAILED),peg$resultsCache[l]={nextPos:peg$currPos,result:a},a)}function peg$parsefloat(){var a,e,r,n,s,o,l,c=peg$currPos*17+5,u=peg$resultsCache[c];if(u)return peg$currPos=u.nextPos,u.result;if(a=peg$currPos,e=peg$currPos,r=[],peg$r1.test(input.charAt(peg$currPos))?(n=input.charAt(peg$currPos),peg$currPos++):(n=peg$FAILED,peg$fail(peg$e4)),n!==peg$FAILED)for(;n!==peg$FAILED;)r.push(n),peg$r1.test(input.charAt(peg$currPos))?(n=input.charAt(peg$currPos),peg$currPos++):(n=peg$FAILED,peg$fail(peg$e4));else r=peg$FAILED;if(r!==peg$FAILED?(input.charCodeAt(peg$currPos)===46?(n=peg$c3,peg$currPos++):(n=peg$FAILED,peg$fail(peg$e5)),n!==peg$FAILED?(r=[r,n],e=r):(peg$currPos=e,e=peg$FAILED)):(peg$currPos=e,e=peg$FAILED),e===peg$FAILED){for(e=peg$currPos,input.charCodeAt(peg$currPos)===45?(r=peg$c4,peg$currPos++):(r=peg$FAILED,peg$fail(peg$e6)),r===peg$FAILED&&(r=null),n=[],peg$r1.test(input.charAt(peg$currPos))?(s=input.charAt(peg$currPos),peg$currPos++):(s=peg$FAILED,peg$fail(peg$e4));s!==peg$FAILED;)n.push(s),peg$r1.test(input.charAt(peg$currPos))?(s=input.charAt(peg$currPos),peg$currPos++):(s=peg$FAILED,peg$fail(peg$e4));if(input.charCodeAt(peg$currPos)===46?(s=peg$c3,peg$currPos++):(s=peg$FAILED,peg$fail(peg$e5)),s!==peg$FAILED){if(o=[],peg$r1.test(input.charAt(peg$currPos))?(l=input.charAt(peg$currPos),peg$currPos++):(l=peg$FAILED,peg$fail(peg$e4)),l!==peg$FAILED)for(;l!==peg$FAILED;)o.push(l),peg$r1.test(input.charAt(peg$currPos))?(l=input.charAt(peg$currPos),peg$currPos++):(l=peg$FAILED,peg$fail(peg$e4));else o=peg$FAILED;o!==peg$FAILED?(r=[r,n,s,o],e=r):(peg$currPos=e,e=peg$FAILED)}else peg$currPos=e,e=peg$FAILED;if(e===peg$FAILED)if(e=peg$currPos,input.charCodeAt(peg$currPos)===46?(r=peg$c3,peg$currPos++):(r=peg$FAILED,peg$fail(peg$e5)),r!==peg$FAILED){if(n=[],peg$r1.test(input.charAt(peg$currPos))?(s=input.charAt(peg$currPos),peg$currPos++):(s=peg$FAILED,peg$fail(peg$e4)),s!==peg$FAILED)for(;s!==peg$FAILED;)n.push(s),peg$r1.test(input.charAt(peg$currPos))?(s=input.charAt(peg$currPos),peg$currPos++):(s=peg$FAILED,peg$fail(peg$e4));else n=peg$FAILED;n!==peg$FAILED?(r=[r,n],e=r):(peg$currPos=e,e=peg$FAILED)}else peg$currPos=e,e=peg$FAILED}return e!==peg$FAILED&&(peg$savedPos=a,e=peg$f4()),a=e,peg$resultsCache[c]={nextPos:peg$currPos,result:a},a}function peg$parseint(){var a,e,r,n=peg$currPos*17+6,s=peg$resultsCache[n];if(s)return peg$currPos=s.nextPos,s.result;if(a=peg$currPos,input.charCodeAt(peg$currPos)===45?peg$currPos++:peg$fail(peg$e6),e=[],peg$r1.test(input.charAt(peg$currPos))?(r=input.charAt(peg$currPos),peg$currPos++):(r=peg$FAILED,peg$fail(peg$e4)),r!==peg$FAILED)for(;r!==peg$FAILED;)e.push(r),peg$r1.test(input.charAt(peg$currPos))?(r=input.charAt(peg$currPos),peg$currPos++):(r=peg$FAILED,peg$fail(peg$e4));else e=peg$FAILED;return e!==peg$FAILED?(peg$savedPos=a,a=peg$f5()):(peg$currPos=a,a=peg$FAILED),peg$resultsCache[n]={nextPos:peg$currPos,result:a},a}function peg$parseratio(){var a,e,r=peg$currPos*17+7,n=peg$resultsCache[r];return n?(peg$currPos=n.nextPos,n.result):(a=peg$currPos,e=peg$parseedji_ratio(),e===peg$FAILED&&(e=peg$parseedo_ratio(),e===peg$FAILED&&(e=peg$parsefrac_ratio(),e===peg$FAILED&&(e=peg$parsedecimal_ratio()))),e!==peg$FAILED&&(peg$savedPos=a,e=peg$f6(e)),a=e,peg$resultsCache[r]={nextPos:peg$currPos,result:a},a)}function peg$parsefrac_ratio(){var a,e,r,n,s=peg$currPos*17+8,o=peg$resultsCache[s];return o?(peg$currPos=o.nextPos,o.result):(a=peg$currPos,e=peg$parseint(),e===peg$FAILED&&(e=peg$parserandom_int()),e!==peg$FAILED?(input.charCodeAt(peg$currPos)===47?(r=peg$c5,peg$currPos++):(r=peg$FAILED,peg$fail(peg$e7)),r!==peg$FAILED?(n=peg$parseint(),n===peg$FAILED&&(n=peg$parserandom_int()),n!==peg$FAILED?(peg$savedPos=a,a=peg$f7(e,n)):(peg$currPos=a,a=peg$FAILED)):(peg$currPos=a,a=peg$FAILED)):(peg$currPos=a,a=peg$FAILED),peg$resultsCache[s]={nextPos:peg$currPos,result:a},a)}function peg$parseedo_ratio(){var a,e,r,n,s=peg$currPos*17+9,o=peg$resultsCache[s];return o?(peg$currPos=o.nextPos,o.result):(a=peg$currPos,e=peg$parseint(),e===peg$FAILED&&(e=peg$parserandom_int()),e!==peg$FAILED?(input.charCodeAt(peg$currPos)===92?(r=peg$c6,peg$currPos++):(r=peg$FAILED,peg$fail(peg$e8)),r!==peg$FAILED?(n=peg$parseint(),n===peg$FAILED&&(n=peg$parserandom_int()),n!==peg$FAILED?(peg$savedPos=a,a=peg$f8(e,n)):(peg$currPos=a,a=peg$FAILED)):(peg$currPos=a,a=peg$FAILED)):(peg$currPos=a,a=peg$FAILED),peg$resultsCache[s]={nextPos:peg$currPos,result:a},a)}function peg$parseedji_ratio(){var a,e,r,n,s,o,l,c,u=peg$currPos*17+10,p=peg$resultsCache[u];return p?(peg$currPos=p.nextPos,p.result):(a=peg$currPos,e=peg$parseint(),e===peg$FAILED&&(e=peg$parserandom_int()),e!==peg$FAILED?(input.charCodeAt(peg$currPos)===92?(r=peg$c6,peg$currPos++):(r=peg$FAILED,peg$fail(peg$e8)),r!==peg$FAILED?(n=peg$parseint(),n===peg$FAILED&&(n=peg$parserandom_int()),n!==peg$FAILED?(input.charCodeAt(peg$currPos)===60?(s=peg$c7,peg$currPos++):(s=peg$FAILED,peg$fail(peg$e9)),s!==peg$FAILED?(o=peg$parseint(),o===peg$FAILED&&(o=peg$parserandom_int()),o!==peg$FAILED?(input.charCodeAt(peg$currPos)===47?peg$currPos++:peg$fail(peg$e7),l=peg$parseint(),l===peg$FAILED&&(l=peg$parserandom_int()),l===peg$FAILED&&(l=null),input.charCodeAt(peg$currPos)===62?(c=peg$c8,peg$currPos++):(c=peg$FAILED,peg$fail(peg$e10)),c!==peg$FAILED?(peg$savedPos=a,a=peg$f9(e,n,o,l)):(peg$currPos=a,a=peg$FAILED)):(peg$currPos=a,a=peg$FAILED)):(peg$currPos=a,a=peg$FAILED)):(peg$currPos=a,a=peg$FAILED)):(peg$currPos=a,a=peg$FAILED)):(peg$currPos=a,a=peg$FAILED),peg$resultsCache[u]={nextPos:peg$currPos,result:a},a)}function peg$parsedecimal_ratio(){var a,e,r,n,s=peg$currPos*17+11,o=peg$resultsCache[s];return o?(peg$currPos=o.nextPos,o.result):(a=peg$currPos,e=peg$parseint(),e!==peg$FAILED?(input.charCodeAt(peg$currPos)===44?(r=peg$c1,peg$currPos++):(r=peg$FAILED,peg$fail(peg$e2)),r!==peg$FAILED?(n=peg$parseint(),n!==peg$FAILED?(peg$savedPos=a,a=peg$f10(e,n)):(peg$currPos=a,a=peg$FAILED)):(peg$currPos=a,a=peg$FAILED)):(peg$currPos=a,a=peg$FAILED),peg$resultsCache[s]={nextPos:peg$currPos,result:a},a)}function peg$parseints(){var a,e,r,n=peg$currPos*17+12,s=peg$resultsCache[n];if(s)return peg$currPos=s.nextPos,s.result;if(a=peg$currPos,e=[],r=peg$parseint(),r===peg$FAILED&&(r=peg$parsesep()),r!==peg$FAILED)for(;r!==peg$FAILED;)e.push(r),r=peg$parseint(),r===peg$FAILED&&(r=peg$parsesep());else e=peg$FAILED;return e!==peg$FAILED&&(peg$savedPos=a,e=peg$f11(e)),a=e,peg$resultsCache[n]={nextPos:peg$currPos,result:a},a}function peg$parsemonzo(){var a,e,r,n,s=peg$currPos*17+13,o=peg$resultsCache[s];return o?(peg$currPos=o.nextPos,o.result):(a=peg$currPos,input.charCodeAt(peg$currPos)===91?(e=peg$c9,peg$currPos++):(e=peg$FAILED,peg$fail(peg$e11)),e!==peg$FAILED?(r=peg$parseints(),r!==peg$FAILED?(input.charCodeAt(peg$currPos)===62?(n=peg$c8,peg$currPos++):(n=peg$FAILED,peg$fail(peg$e10)),n!==peg$FAILED?(peg$savedPos=a,a=peg$f12(r)):(peg$currPos=a,a=peg$FAILED)):(peg$currPos=a,a=peg$FAILED)):(peg$currPos=a,a=peg$FAILED),peg$resultsCache[s]={nextPos:peg$currPos,result:a},a)}function peg$parseoperation(){var a,e,r,n,s,o,l,c=peg$currPos*17+14,u=peg$resultsCache[c];if(u)return peg$currPos=u.nextPos,u.result;if(a=peg$currPos,e=peg$parsevalue(),e===peg$FAILED&&(e=peg$parseratio(),e===peg$FAILED&&(e=peg$parsemonzo(),e===peg$FAILED)))for(e=[],r=peg$parsesep();r!==peg$FAILED;)e.push(r),r=peg$parsesep();if(e!==peg$FAILED){if(r=[],n=peg$currPos,s=peg$parseoperator(),s!==peg$FAILED){if(o=peg$parsevalue(),o===peg$FAILED&&(o=peg$parseratio(),o===peg$FAILED&&(o=peg$parsemonzo(),o===peg$FAILED&&(o=peg$parsesub_operations(),o===peg$FAILED&&(o=peg$parseoperation(),o===peg$FAILED)))))for(o=[],l=peg$parsesep();l!==peg$FAILED;)o.push(l),l=peg$parsesep();o!==peg$FAILED?(s=[s,o],n=s):(peg$currPos=n,n=peg$FAILED)}else peg$currPos=n,n=peg$FAILED;if(n!==peg$FAILED)for(;n!==peg$FAILED;)if(r.push(n),n=peg$currPos,s=peg$parseoperator(),s!==peg$FAILED){if(o=peg$parsevalue(),o===peg$FAILED&&(o=peg$parseratio(),o===peg$FAILED&&(o=peg$parsemonzo(),o===peg$FAILED&&(o=peg$parsesub_operations(),o===peg$FAILED&&(o=peg$parseoperation(),o===peg$FAILED)))))for(o=[],l=peg$parsesep();l!==peg$FAILED;)o.push(l),l=peg$parsesep();o!==peg$FAILED?(s=[s,o],n=s):(peg$currPos=n,n=peg$FAILED)}else peg$currPos=n,n=peg$FAILED;else r=peg$FAILED;r!==peg$FAILED?(peg$savedPos=a,a=peg$f13()):(peg$currPos=a,a=peg$FAILED)}else peg$currPos=a,a=peg$FAILED;return peg$resultsCache[c]={nextPos:peg$currPos,result:a},a}function peg$parseoperator(){var a,e=peg$currPos*17+15,r=peg$resultsCache[e];return r?(peg$currPos=r.nextPos,r.result):(input.charCodeAt(peg$currPos)===43?(a=peg$c10,peg$currPos++):(a=peg$FAILED,peg$fail(peg$e12)),a===peg$FAILED&&(input.charCodeAt(peg$currPos)===45?(a=peg$c4,peg$currPos++):(a=peg$FAILED,peg$fail(peg$e6)),a===peg$FAILED&&(input.charCodeAt(peg$currPos)===42?(a=peg$c11,peg$currPos++):(a=peg$FAILED,peg$fail(peg$e13)),a===peg$FAILED&&(input.charCodeAt(peg$currPos)===37?(a=peg$c12,peg$currPos++):(a=peg$FAILED,peg$fail(peg$e14)),a===peg$FAILED&&(input.charCodeAt(peg$currPos)===38?(a=peg$c13,peg$currPos++):(a=peg$FAILED,peg$fail(peg$e15)),a===peg$FAILED&&(input.charCodeAt(peg$currPos)===124?(a=peg$c14,peg$currPos++):(a=peg$FAILED,peg$fail(peg$e16)),a===peg$FAILED&&(input.substr(peg$currPos,2)===peg$c15?(a=peg$c15,peg$currPos+=2):(a=peg$FAILED,peg$fail(peg$e17)),a===peg$FAILED&&(input.substr(peg$currPos,2)===peg$c16?(a=peg$c16,peg$currPos+=2):(a=peg$FAILED,peg$fail(peg$e18))))))))),peg$resultsCache[e]={nextPos:peg$currPos,result:a},a)}function peg$parsesub_operations(){var a,e,r,n,s=peg$currPos*17+16,o=peg$resultsCache[s];return o?(peg$currPos=o.nextPos,o.result):(a=peg$currPos,input.charCodeAt(peg$currPos)===40?(e=peg$c0,peg$currPos++):(e=peg$FAILED,peg$fail(peg$e1)),e!==peg$FAILED?(r=peg$parseoperation(),r!==peg$FAILED?(input.charCodeAt(peg$currPos)===41?(n=peg$c2,peg$currPos++):(n=peg$FAILED,peg$fail(peg$e3)),n!==peg$FAILED?(e=[e,r,n],a=e):(peg$currPos=a,a=peg$FAILED)):(peg$currPos=a,a=peg$FAILED)):(peg$currPos=a,a=peg$FAILED),peg$resultsCache[s]={nextPos:peg$currPos,result:a},a)}if(peg$result=peg$startRuleFunction(),peg$result!==peg$FAILED&&peg$currPos===input.length)return peg$result;throw peg$result!==peg$FAILED&&peg$currPos{typeof PROCESS.emitWarning=="function"?PROCESS.emitWarning(a,e,r,n):console.error(`[${r}] ${e}: ${a}`)};let AC=globalThis.AbortController,AS=globalThis.AbortSignal;var Li;if(typeof AC>"u"){AS=class{constructor(){_e(this,"onabort");_e(this,"_onabort",[]);_e(this,"reason");_e(this,"aborted",!1)}addEventListener(n,s){this._onabort.push(s)}},AC=class{constructor(){_e(this,"signal",new AS);e()}abort(n){var s,o;if(!this.signal.aborted){this.signal.reason=n,this.signal.aborted=!0;for(const l of this.signal._onabort)l(n);(o=(s=this.signal).onabort)==null||o.call(s,n)}}};let a=((Li=PROCESS.env)==null?void 0:Li.LRU_CACHE_IGNORE_AC_WARNING)!=="1";const e=()=>{a&&(a=!1,emitWarning("AbortController is not defined. If using lru-cache in node 14, load an AbortController polyfill from the `node-abort-controller` package. A minimal polyfill is provided for use by LRUCache.fetch(), but it should not be relied upon in other contexts (eg, passing it to other APIs that use AbortController/AbortSignal might have undesirable effects). You may disable this with LRU_CACHE_IGNORE_AC_WARNING=1 in the env.","NO_ABORT_CONTROLLER","ENOTSUP",e))}}const shouldWarn=a=>!warned.has(a),isPosInt=a=>a&&a===Math.floor(a)&&a>0&&isFinite(a),getUintArray=a=>isPosInt(a)?a<=Math.pow(2,8)?Uint8Array:a<=Math.pow(2,16)?Uint16Array:a<=Math.pow(2,32)?Uint32Array:a<=Number.MAX_SAFE_INTEGER?ZeroArray:null:null;class ZeroArray extends Array{constructor(e){super(e),this.fill(0)}}var Ln;const fn=class fn{constructor(e,r){_e(this,"heap");_e(this,"length");if(!Oe(fn,Ln))throw new TypeError("instantiate Stack using Stack.create(n)");this.heap=new r(e),this.length=0}static create(e){const r=getUintArray(e);if(!r)return[];Ot(fn,Ln,!0);const n=new fn(e,r);return Ot(fn,Ln,!1),n}push(e){this.heap[this.length++]=e}pop(){return this.heap[--this.length]}};Ln=new WeakMap,Lt(fn,Ln,!1);let Stack=fn;var wr,Tr,Lr,xr,xn,nr,Pr,ir,Ht,Nt,_r,Cr,dr,sr,kr,or,zr,Wr,Mr,Br,sn,Sr,Hn,Ei,gn,Xr,zn,vr,si,Pi,mn,Pn,Wn,Gr,nn,Qr,an,Xn,Oi,kn,ii,Mn,ai,Qt,Xt,Zn,bi,_n,Vn;const Ti=class Ti{constructor(e){Lt(this,Hn);Lt(this,si);Lt(this,Gr);Lt(this,Qr);Lt(this,Xn);Lt(this,kn);Lt(this,Mn);Lt(this,Qt);Lt(this,Zn);Lt(this,_n);Lt(this,wr,void 0);Lt(this,Tr,void 0);Lt(this,Lr,void 0);Lt(this,xr,void 0);Lt(this,xn,void 0);_e(this,"ttl");_e(this,"ttlResolution");_e(this,"ttlAutopurge");_e(this,"updateAgeOnGet");_e(this,"updateAgeOnHas");_e(this,"allowStale");_e(this,"noDisposeOnSet");_e(this,"noUpdateTTL");_e(this,"maxEntrySize");_e(this,"sizeCalculation");_e(this,"noDeleteOnFetchRejection");_e(this,"noDeleteOnStaleGet");_e(this,"allowStaleOnFetchAbort");_e(this,"allowStaleOnFetchRejection");_e(this,"ignoreFetchAbort");Lt(this,nr,void 0);Lt(this,Pr,void 0);Lt(this,ir,void 0);Lt(this,Ht,void 0);Lt(this,Nt,void 0);Lt(this,_r,void 0);Lt(this,Cr,void 0);Lt(this,dr,void 0);Lt(this,sr,void 0);Lt(this,kr,void 0);Lt(this,or,void 0);Lt(this,zr,void 0);Lt(this,Wr,void 0);Lt(this,Mr,void 0);Lt(this,Br,void 0);Lt(this,sn,void 0);Lt(this,Sr,void 0);Lt(this,gn,()=>{});Lt(this,Xr,()=>{});Lt(this,zn,()=>{});Lt(this,vr,()=>!1);Lt(this,mn,e=>{});Lt(this,Pn,(e,r,n)=>{});Lt(this,Wn,(e,r,n,s)=>{if(n||s)throw new TypeError("cannot set size without setting maxSize or maxEntrySize on cache");return 0});const{max:r=0,ttl:n,ttlResolution:s=1,ttlAutopurge:o,updateAgeOnGet:l,updateAgeOnHas:c,allowStale:u,dispose:p,disposeAfter:h,noDisposeOnSet:g,noUpdateTTL:b,maxSize:y=0,maxEntrySize:P=0,sizeCalculation:Y,fetchMethod:F,noDeleteOnFetchRejection:H,noDeleteOnStaleGet:Ee,allowStaleOnFetchRejection:ke,allowStaleOnFetchAbort:f,ignoreFetchAbort:D}=e;if(r!==0&&!isPosInt(r))throw new TypeError("max option must be a nonnegative integer");const N=r?getUintArray(r):Array;if(!N)throw new Error("invalid max value: "+r);if(Ot(this,wr,r),Ot(this,Tr,y),this.maxEntrySize=P||Oe(this,Tr),this.sizeCalculation=Y,this.sizeCalculation){if(!Oe(this,Tr)&&!this.maxEntrySize)throw new TypeError("cannot set sizeCalculation without setting maxSize or maxEntrySize");if(typeof this.sizeCalculation!="function")throw new TypeError("sizeCalculation set to non-function")}if(F!==void 0&&typeof F!="function")throw new TypeError("fetchMethod must be a function if specified");if(Ot(this,xn,F),Ot(this,sn,!!F),Ot(this,ir,new Map),Ot(this,Ht,new Array(r).fill(void 0)),Ot(this,Nt,new Array(r).fill(void 0)),Ot(this,_r,new N(r)),Ot(this,Cr,new N(r)),Ot(this,dr,0),Ot(this,sr,0),Ot(this,kr,Stack.create(r)),Ot(this,nr,0),Ot(this,Pr,0),typeof p=="function"&&Ot(this,Lr,p),typeof h=="function"?(Ot(this,xr,h),Ot(this,or,[])):(Ot(this,xr,void 0),Ot(this,or,void 0)),Ot(this,Br,!!Oe(this,Lr)),Ot(this,Sr,!!Oe(this,xr)),this.noDisposeOnSet=!!g,this.noUpdateTTL=!!b,this.noDeleteOnFetchRejection=!!H,this.allowStaleOnFetchRejection=!!ke,this.allowStaleOnFetchAbort=!!f,this.ignoreFetchAbort=!!D,this.maxEntrySize!==0){if(Oe(this,Tr)!==0&&!isPosInt(Oe(this,Tr)))throw new TypeError("maxSize must be a positive integer if specified");if(!isPosInt(this.maxEntrySize))throw new TypeError("maxEntrySize must be a positive integer if specified");gt(this,si,Pi).call(this)}if(this.allowStale=!!u,this.noDeleteOnStaleGet=!!Ee,this.updateAgeOnGet=!!l,this.updateAgeOnHas=!!c,this.ttlResolution=isPosInt(s)||s===0?s:1,this.ttlAutopurge=!!o,this.ttl=n||0,this.ttl){if(!isPosInt(this.ttl))throw new TypeError("ttl must be a positive integer if specified");gt(this,Hn,Ei).call(this)}if(Oe(this,wr)===0&&this.ttl===0&&Oe(this,Tr)===0)throw new TypeError("At least one of max, maxSize, or ttl is required");if(!this.ttlAutopurge&&!Oe(this,wr)&&!Oe(this,Tr)){const B="LRU_CACHE_UNBOUNDED";shouldWarn(B)&&(warned.add(B),emitWarning("TTL caching without ttlAutopurge, max, or maxSize can result in unbounded memory consumption.","UnboundedCacheWarning",B,Ti))}}static unsafeExposeInternals(e){return{starts:Oe(e,Wr),ttls:Oe(e,Mr),sizes:Oe(e,zr),keyMap:Oe(e,ir),keyList:Oe(e,Ht),valList:Oe(e,Nt),next:Oe(e,_r),prev:Oe(e,Cr),get head(){return Oe(e,dr)},get tail(){return Oe(e,sr)},free:Oe(e,kr),isBackgroundFetch:r=>{var n;return gt(n=e,Qt,Xt).call(n,r)},backgroundFetch:(r,n,s,o)=>{var l;return gt(l=e,Mn,ai).call(l,r,n,s,o)},moveToTail:r=>{var n;return gt(n=e,_n,Vn).call(n,r)},indexes:r=>{var n;return gt(n=e,Gr,nn).call(n,r)},rindexes:r=>{var n;return gt(n=e,Qr,an).call(n,r)},isStale:r=>{var n;return Oe(n=e,vr).call(n,r)}}}get max(){return Oe(this,wr)}get maxSize(){return Oe(this,Tr)}get calculatedSize(){return Oe(this,Pr)}get size(){return Oe(this,nr)}get fetchMethod(){return Oe(this,xn)}get dispose(){return Oe(this,Lr)}get disposeAfter(){return Oe(this,xr)}getRemainingTTL(e){return Oe(this,ir).has(e)?1/0:0}*entries(){for(const e of gt(this,Gr,nn).call(this))Oe(this,Nt)[e]!==void 0&&Oe(this,Ht)[e]!==void 0&&!gt(this,Qt,Xt).call(this,Oe(this,Nt)[e])&&(yield[Oe(this,Ht)[e],Oe(this,Nt)[e]])}*rentries(){for(const e of gt(this,Qr,an).call(this))Oe(this,Nt)[e]!==void 0&&Oe(this,Ht)[e]!==void 0&&!gt(this,Qt,Xt).call(this,Oe(this,Nt)[e])&&(yield[Oe(this,Ht)[e],Oe(this,Nt)[e]])}*keys(){for(const e of gt(this,Gr,nn).call(this)){const r=Oe(this,Ht)[e];r!==void 0&&!gt(this,Qt,Xt).call(this,Oe(this,Nt)[e])&&(yield r)}}*rkeys(){for(const e of gt(this,Qr,an).call(this)){const r=Oe(this,Ht)[e];r!==void 0&&!gt(this,Qt,Xt).call(this,Oe(this,Nt)[e])&&(yield r)}}*values(){for(const e of gt(this,Gr,nn).call(this))Oe(this,Nt)[e]!==void 0&&!gt(this,Qt,Xt).call(this,Oe(this,Nt)[e])&&(yield Oe(this,Nt)[e])}*rvalues(){for(const e of gt(this,Qr,an).call(this))Oe(this,Nt)[e]!==void 0&&!gt(this,Qt,Xt).call(this,Oe(this,Nt)[e])&&(yield Oe(this,Nt)[e])}[Symbol.iterator](){return this.entries()}find(e,r={}){for(const n of gt(this,Gr,nn).call(this)){const s=Oe(this,Nt)[n],o=gt(this,Qt,Xt).call(this,s)?s.__staleWhileFetching:s;if(o!==void 0&&e(o,Oe(this,Ht)[n],this))return this.get(Oe(this,Ht)[n],r)}}forEach(e,r=this){for(const n of gt(this,Gr,nn).call(this)){const s=Oe(this,Nt)[n],o=gt(this,Qt,Xt).call(this,s)?s.__staleWhileFetching:s;o!==void 0&&e.call(r,o,Oe(this,Ht)[n],this)}}rforEach(e,r=this){for(const n of gt(this,Qr,an).call(this)){const s=Oe(this,Nt)[n],o=gt(this,Qt,Xt).call(this,s)?s.__staleWhileFetching:s;o!==void 0&&e.call(r,o,Oe(this,Ht)[n],this)}}purgeStale(){let e=!1;for(const r of gt(this,Qr,an).call(this,{allowStale:!0}))Oe(this,vr).call(this,r)&&(this.delete(Oe(this,Ht)[r]),e=!0);return e}dump(){const e=[];for(const r of gt(this,Gr,nn).call(this,{allowStale:!0})){const n=Oe(this,Ht)[r],s=Oe(this,Nt)[r],o=gt(this,Qt,Xt).call(this,s)?s.__staleWhileFetching:s;if(o===void 0||n===void 0)continue;const l={value:o};if(Oe(this,Mr)&&Oe(this,Wr)){l.ttl=Oe(this,Mr)[r];const c=perf.now()-Oe(this,Wr)[r];l.start=Math.floor(Date.now()-c)}Oe(this,zr)&&(l.size=Oe(this,zr)[r]),e.unshift([n,l])}return e}load(e){this.clear();for(const[r,n]of e){if(n.start){const s=Date.now()-n.start;n.start=perf.now()-s}this.set(r,n.value,n)}}set(e,r,n={}){var b,y,P,Y,F;if(r===void 0)return this.delete(e),this;const{ttl:s=this.ttl,start:o,noDisposeOnSet:l=this.noDisposeOnSet,sizeCalculation:c=this.sizeCalculation,status:u}=n;let{noUpdateTTL:p=this.noUpdateTTL}=n;const h=Oe(this,Wn).call(this,e,r,n.size||0,c);if(this.maxEntrySize&&h>this.maxEntrySize)return u&&(u.set="miss",u.maxEntrySizeExceeded=!0),this.delete(e),this;let g=Oe(this,nr)===0?void 0:Oe(this,ir).get(e);if(g===void 0)g=Oe(this,nr)===0?Oe(this,sr):Oe(this,kr).length!==0?Oe(this,kr).pop():Oe(this,nr)===Oe(this,wr)?gt(this,kn,ii).call(this,!1):Oe(this,nr),Oe(this,Ht)[g]=e,Oe(this,Nt)[g]=r,Oe(this,ir).set(e,g),Oe(this,_r)[Oe(this,sr)]=g,Oe(this,Cr)[g]=Oe(this,sr),Ot(this,sr,g),ni(this,nr)._++,Oe(this,Pn).call(this,g,h,u),u&&(u.set="add"),p=!1;else{gt(this,_n,Vn).call(this,g);const H=Oe(this,Nt)[g];if(r!==H){if(Oe(this,sn)&>(this,Qt,Xt).call(this,H)){H.__abortController.abort(new Error("replaced"));const{__staleWhileFetching:Ee}=H;Ee!==void 0&&!l&&(Oe(this,Br)&&((b=Oe(this,Lr))==null||b.call(this,Ee,e,"set")),Oe(this,Sr)&&((y=Oe(this,or))==null||y.push([Ee,e,"set"])))}else l||(Oe(this,Br)&&((P=Oe(this,Lr))==null||P.call(this,H,e,"set")),Oe(this,Sr)&&((Y=Oe(this,or))==null||Y.push([H,e,"set"])));if(Oe(this,mn).call(this,g),Oe(this,Pn).call(this,g,h,u),Oe(this,Nt)[g]=r,u){u.set="replace";const Ee=H&>(this,Qt,Xt).call(this,H)?H.__staleWhileFetching:H;Ee!==void 0&&(u.oldValue=Ee)}}else u&&(u.set="update")}if(s!==0&&!Oe(this,Mr)&>(this,Hn,Ei).call(this),Oe(this,Mr)&&(p||Oe(this,zn).call(this,g,s,o),u&&Oe(this,Xr).call(this,u,g)),!l&&Oe(this,Sr)&&Oe(this,or)){const H=Oe(this,or);let Ee;for(;Ee=H==null?void 0:H.shift();)(F=Oe(this,xr))==null||F.call(this,...Ee)}return this}pop(){var e;try{for(;Oe(this,nr);){const r=Oe(this,Nt)[Oe(this,dr)];if(gt(this,kn,ii).call(this,!0),gt(this,Qt,Xt).call(this,r)){if(r.__staleWhileFetching)return r.__staleWhileFetching}else if(r!==void 0)return r}}finally{if(Oe(this,Sr)&&Oe(this,or)){const r=Oe(this,or);let n;for(;n=r==null?void 0:r.shift();)(e=Oe(this,xr))==null||e.call(this,...n)}}}has(e,r={}){const{updateAgeOnHas:n=this.updateAgeOnHas,status:s}=r,o=Oe(this,ir).get(e);if(o!==void 0){const l=Oe(this,Nt)[o];if(gt(this,Qt,Xt).call(this,l)&&l.__staleWhileFetching===void 0)return!1;if(Oe(this,vr).call(this,o))s&&(s.has="stale",Oe(this,Xr).call(this,s,o));else return n&&Oe(this,gn).call(this,o),s&&(s.has="hit",Oe(this,Xr).call(this,s,o)),!0}else s&&(s.has="miss");return!1}peek(e,r={}){const{allowStale:n=this.allowStale}=r,s=Oe(this,ir).get(e);if(s!==void 0&&(n||!Oe(this,vr).call(this,s))){const o=Oe(this,Nt)[s];return gt(this,Qt,Xt).call(this,o)?o.__staleWhileFetching:o}}async fetch(e,r={}){const{allowStale:n=this.allowStale,updateAgeOnGet:s=this.updateAgeOnGet,noDeleteOnStaleGet:o=this.noDeleteOnStaleGet,ttl:l=this.ttl,noDisposeOnSet:c=this.noDisposeOnSet,size:u=0,sizeCalculation:p=this.sizeCalculation,noUpdateTTL:h=this.noUpdateTTL,noDeleteOnFetchRejection:g=this.noDeleteOnFetchRejection,allowStaleOnFetchRejection:b=this.allowStaleOnFetchRejection,ignoreFetchAbort:y=this.ignoreFetchAbort,allowStaleOnFetchAbort:P=this.allowStaleOnFetchAbort,context:Y,forceRefresh:F=!1,status:H,signal:Ee}=r;if(!Oe(this,sn))return H&&(H.fetch="get"),this.get(e,{allowStale:n,updateAgeOnGet:s,noDeleteOnStaleGet:o,status:H});const ke={allowStale:n,updateAgeOnGet:s,noDeleteOnStaleGet:o,ttl:l,noDisposeOnSet:c,size:u,sizeCalculation:p,noUpdateTTL:h,noDeleteOnFetchRejection:g,allowStaleOnFetchRejection:b,allowStaleOnFetchAbort:P,ignoreFetchAbort:y,status:H,signal:Ee};let f=Oe(this,ir).get(e);if(f===void 0){H&&(H.fetch="miss");const D=gt(this,Mn,ai).call(this,e,f,ke,Y);return D.__returned=D}else{const D=Oe(this,Nt)[f];if(gt(this,Qt,Xt).call(this,D)){const W=n&&D.__staleWhileFetching!==void 0;return H&&(H.fetch="inflight",W&&(H.returnedStale=!0)),W?D.__staleWhileFetching:D.__returned=D}const N=Oe(this,vr).call(this,f);if(!F&&!N)return H&&(H.fetch="hit"),gt(this,_n,Vn).call(this,f),s&&Oe(this,gn).call(this,f),H&&Oe(this,Xr).call(this,H,f),D;const B=gt(this,Mn,ai).call(this,e,f,ke,Y),se=B.__staleWhileFetching!==void 0&&n;return H&&(H.fetch=N?"stale":"refresh",se&&N&&(H.returnedStale=!0)),se?B.__staleWhileFetching:B.__returned=B}}get(e,r={}){const{allowStale:n=this.allowStale,updateAgeOnGet:s=this.updateAgeOnGet,noDeleteOnStaleGet:o=this.noDeleteOnStaleGet,status:l}=r,c=Oe(this,ir).get(e);if(c!==void 0){const u=Oe(this,Nt)[c],p=gt(this,Qt,Xt).call(this,u);return l&&Oe(this,Xr).call(this,l,c),Oe(this,vr).call(this,c)?(l&&(l.get="stale"),p?(l&&n&&u.__staleWhileFetching!==void 0&&(l.returnedStale=!0),n?u.__staleWhileFetching:void 0):(o||this.delete(e),l&&n&&(l.returnedStale=!0),n?u:void 0)):(l&&(l.get="hit"),p?u.__staleWhileFetching:(gt(this,_n,Vn).call(this,c),s&&Oe(this,gn).call(this,c),u))}else l&&(l.get="miss")}delete(e){var n,s,o,l;let r=!1;if(Oe(this,nr)!==0){const c=Oe(this,ir).get(e);if(c!==void 0)if(r=!0,Oe(this,nr)===1)this.clear();else{Oe(this,mn).call(this,c);const u=Oe(this,Nt)[c];gt(this,Qt,Xt).call(this,u)?u.__abortController.abort(new Error("deleted")):(Oe(this,Br)||Oe(this,Sr))&&(Oe(this,Br)&&((n=Oe(this,Lr))==null||n.call(this,u,e,"delete")),Oe(this,Sr)&&((s=Oe(this,or))==null||s.push([u,e,"delete"]))),Oe(this,ir).delete(e),Oe(this,Ht)[c]=void 0,Oe(this,Nt)[c]=void 0,c===Oe(this,sr)?Ot(this,sr,Oe(this,Cr)[c]):c===Oe(this,dr)?Ot(this,dr,Oe(this,_r)[c]):(Oe(this,_r)[Oe(this,Cr)[c]]=Oe(this,_r)[c],Oe(this,Cr)[Oe(this,_r)[c]]=Oe(this,Cr)[c]),ni(this,nr)._--,Oe(this,kr).push(c)}}if(Oe(this,Sr)&&((o=Oe(this,or))!=null&&o.length)){const c=Oe(this,or);let u;for(;u=c==null?void 0:c.shift();)(l=Oe(this,xr))==null||l.call(this,...u)}return r}clear(){var e,r,n;for(const s of gt(this,Qr,an).call(this,{allowStale:!0})){const o=Oe(this,Nt)[s];if(gt(this,Qt,Xt).call(this,o))o.__abortController.abort(new Error("deleted"));else{const l=Oe(this,Ht)[s];Oe(this,Br)&&((e=Oe(this,Lr))==null||e.call(this,o,l,"delete")),Oe(this,Sr)&&((r=Oe(this,or))==null||r.push([o,l,"delete"]))}}if(Oe(this,ir).clear(),Oe(this,Nt).fill(void 0),Oe(this,Ht).fill(void 0),Oe(this,Mr)&&Oe(this,Wr)&&(Oe(this,Mr).fill(0),Oe(this,Wr).fill(0)),Oe(this,zr)&&Oe(this,zr).fill(0),Ot(this,dr,0),Ot(this,sr,0),Oe(this,kr).length=0,Ot(this,Pr,0),Ot(this,nr,0),Oe(this,Sr)&&Oe(this,or)){const s=Oe(this,or);let o;for(;o=s==null?void 0:s.shift();)(n=Oe(this,xr))==null||n.call(this,...o)}}};wr=new WeakMap,Tr=new WeakMap,Lr=new WeakMap,xr=new WeakMap,xn=new WeakMap,nr=new WeakMap,Pr=new WeakMap,ir=new WeakMap,Ht=new WeakMap,Nt=new WeakMap,_r=new WeakMap,Cr=new WeakMap,dr=new WeakMap,sr=new WeakMap,kr=new WeakMap,or=new WeakMap,zr=new WeakMap,Wr=new WeakMap,Mr=new WeakMap,Br=new WeakMap,sn=new WeakMap,Sr=new WeakMap,Hn=new WeakSet,Ei=function(){const e=new ZeroArray(Oe(this,wr)),r=new ZeroArray(Oe(this,wr));Ot(this,Mr,e),Ot(this,Wr,r),Ot(this,zn,(o,l,c=perf.now())=>{if(r[o]=l!==0?c:0,e[o]=l,l!==0&&this.ttlAutopurge){const u=setTimeout(()=>{Oe(this,vr).call(this,o)&&this.delete(Oe(this,Ht)[o])},l+1);u.unref&&u.unref()}}),Ot(this,gn,o=>{r[o]=e[o]!==0?perf.now():0}),Ot(this,Xr,(o,l)=>{if(e[l]){const c=e[l],u=r[l];o.ttl=c,o.start=u,o.now=n||s();const p=o.now-u;o.remainingTTL=c-p}});let n=0;const s=()=>{const o=perf.now();if(this.ttlResolution>0){n=o;const l=setTimeout(()=>n=0,this.ttlResolution);l.unref&&l.unref()}return o};this.getRemainingTTL=o=>{const l=Oe(this,ir).get(o);if(l===void 0)return 0;const c=e[l],u=r[l];if(c===0||u===0)return 1/0;const p=(n||s())-u;return c-p},Ot(this,vr,o=>e[o]!==0&&r[o]!==0&&(n||s())-r[o]>e[o])},gn=new WeakMap,Xr=new WeakMap,zn=new WeakMap,vr=new WeakMap,si=new WeakSet,Pi=function(){const e=new ZeroArray(Oe(this,wr));Ot(this,Pr,0),Ot(this,zr,e),Ot(this,mn,r=>{Ot(this,Pr,Oe(this,Pr)-e[r]),e[r]=0}),Ot(this,Wn,(r,n,s,o)=>{if(gt(this,Qt,Xt).call(this,n))return 0;if(!isPosInt(s))if(o){if(typeof o!="function")throw new TypeError("sizeCalculation must be a function");if(s=o(n,r),!isPosInt(s))throw new TypeError("sizeCalculation return invalid (expect positive integer)")}else throw new TypeError("invalid size value (must be positive integer). When maxSize or maxEntrySize is used, sizeCalculation or size must be set.");return s}),Ot(this,Pn,(r,n,s)=>{if(e[r]=n,Oe(this,Tr)){const o=Oe(this,Tr)-e[r];for(;Oe(this,Pr)>o;)gt(this,kn,ii).call(this,!0)}Ot(this,Pr,Oe(this,Pr)+e[r]),s&&(s.entrySize=n,s.totalCalculatedSize=Oe(this,Pr))})},mn=new WeakMap,Pn=new WeakMap,Wn=new WeakMap,Gr=new WeakSet,nn=function*({allowStale:e=this.allowStale}={}){if(Oe(this,nr))for(let r=Oe(this,sr);!(!gt(this,Xn,Oi).call(this,r)||((e||!Oe(this,vr).call(this,r))&&(yield r),r===Oe(this,dr)));)r=Oe(this,Cr)[r]},Qr=new WeakSet,an=function*({allowStale:e=this.allowStale}={}){if(Oe(this,nr))for(let r=Oe(this,dr);!(!gt(this,Xn,Oi).call(this,r)||((e||!Oe(this,vr).call(this,r))&&(yield r),r===Oe(this,sr)));)r=Oe(this,_r)[r]},Xn=new WeakSet,Oi=function(e){return e!==void 0&&Oe(this,ir).get(Oe(this,Ht)[e])===e},kn=new WeakSet,ii=function(e){var o,l;const r=Oe(this,dr),n=Oe(this,Ht)[r],s=Oe(this,Nt)[r];return Oe(this,sn)&>(this,Qt,Xt).call(this,s)?s.__abortController.abort(new Error("evicted")):(Oe(this,Br)||Oe(this,Sr))&&(Oe(this,Br)&&((o=Oe(this,Lr))==null||o.call(this,s,n,"evict")),Oe(this,Sr)&&((l=Oe(this,or))==null||l.push([s,n,"evict"]))),Oe(this,mn).call(this,r),e&&(Oe(this,Ht)[r]=void 0,Oe(this,Nt)[r]=void 0,Oe(this,kr).push(r)),Oe(this,nr)===1?(Ot(this,dr,Ot(this,sr,0)),Oe(this,kr).length=0):Ot(this,dr,Oe(this,_r)[r]),Oe(this,ir).delete(n),ni(this,nr)._--,r},Mn=new WeakSet,ai=function(e,r,n,s){const o=r===void 0?void 0:Oe(this,Nt)[r];if(gt(this,Qt,Xt).call(this,o))return o;const l=new AC,{signal:c}=n;c==null||c.addEventListener("abort",()=>l.abort(c.reason),{signal:l.signal});const u={signal:l.signal,options:n,context:s},p=(Y,F=!1)=>{const{aborted:H}=l.signal,Ee=n.ignoreFetchAbort&&Y!==void 0;if(n.status&&(H&&!F?(n.status.fetchAborted=!0,n.status.fetchError=l.signal.reason,Ee&&(n.status.fetchAbortIgnored=!0)):n.status.fetchResolved=!0),H&&!Ee&&!F)return g(l.signal.reason);const ke=y;return Oe(this,Nt)[r]===y&&(Y===void 0?ke.__staleWhileFetching?Oe(this,Nt)[r]=ke.__staleWhileFetching:this.delete(e):(n.status&&(n.status.fetchUpdated=!0),this.set(e,Y,u.options))),Y},h=Y=>(n.status&&(n.status.fetchRejected=!0,n.status.fetchError=Y),g(Y)),g=Y=>{const{aborted:F}=l.signal,H=F&&n.allowStaleOnFetchAbort,Ee=H||n.allowStaleOnFetchRejection,ke=Ee||n.noDeleteOnFetchRejection,f=y;if(Oe(this,Nt)[r]===y&&(!ke||f.__staleWhileFetching===void 0?this.delete(e):H||(Oe(this,Nt)[r]=f.__staleWhileFetching)),Ee)return n.status&&f.__staleWhileFetching!==void 0&&(n.status.returnedStale=!0),f.__staleWhileFetching;if(f.__returned===f)throw Y},b=(Y,F)=>{var Ee;const H=(Ee=Oe(this,xn))==null?void 0:Ee.call(this,e,o,u);H&&H instanceof Promise&&H.then(ke=>Y(ke===void 0?void 0:ke),F),l.signal.addEventListener("abort",()=>{(!n.ignoreFetchAbort||n.allowStaleOnFetchAbort)&&(Y(void 0),n.allowStaleOnFetchAbort&&(Y=ke=>p(ke,!0)))})};n.status&&(n.status.fetchDispatched=!0);const y=new Promise(b).then(p,h),P=Object.assign(y,{__abortController:l,__staleWhileFetching:o,__returned:void 0});return r===void 0?(this.set(e,P,{...u.options,status:void 0}),r=Oe(this,ir).get(e)):Oe(this,Nt)[r]=P,P},Qt=new WeakSet,Xt=function(e){if(!Oe(this,sn))return!1;const r=e;return!!r&&r instanceof Promise&&r.hasOwnProperty("__staleWhileFetching")&&r.__abortController instanceof AC},Zn=new WeakSet,bi=function(e,r){Oe(this,Cr)[r]=e,Oe(this,_r)[e]=r},_n=new WeakSet,Vn=function(e){e!==Oe(this,sr)&&(e===Oe(this,dr)?Ot(this,dr,Oe(this,_r)[e]):gt(this,Zn,bi).call(this,Oe(this,Cr)[e],Oe(this,_r)[e]),gt(this,Zn,bi).call(this,Oe(this,sr),e),Ot(this,sr,e))};let LRUCache=Ti;const zcache=new LRUCache({max:1e3,ttl:1e3*60*5});class Ziffers{constructor(e,r={}){_e(this,"values");_e(this,"evaluated");_e(this,"options");_e(this,"index",0);_e(this,"redo");_e(this,"_current");r={...DEFAULT_OPTIONS,...r},r.scale&&(typeof r.scale=="string"&&(isScale(r.scale)?(r.scaleName=r.scale,r.scale=getScale(r.scale)):r.scale=parse(r.scale)),r.parsedScale=r.scale,delete r.scale),r.redo!==void 0?this.redo=r.redo:this.redo=1,r&&r.seed&&(r.randomSeed=r.seed,r.seededRandom=seededRandom(r.seed)),this.options={nodeOptions:r};try{this.values=parse$1(e,this.options),this.evaluated=this.evaluate()}catch(n){console.log(n),this.values=[],this.evaluated=[]}}update(){this.evaluated=this.evaluate()}pitches(){return this.evaluated.map(e=>e.collect("pitch"))}notes(){return this.evaluated.map(e=>e.collect("note"))}freqs(){return this.evaluated.map(e=>e.collect("freq"))}durations(){return this.evaluated.map(e=>e.collect("duration"))}next(){if(this.redo>0&&this.index>=this.evaluated.length*this.redo&&(this.update(),this._current=void 0,this.index=0),this._current!==void 0){const r=this.evaluated[this._current%this.evaluated.length];r.modifiedEvent&&r.modifiedEvent==null,this._current=this._current+1r.evaluate()).flat(1/0).filter(r=>r!==void 0);return e.forEach((r,n)=>{r._next=n0?n-1:e.length-1}),e}}const generateCacheKey=(...a)=>a.map(e=>JSON.stringify(e)).join(","),cachedCall=(a,e)=>{const r=generateCacheKey(a,e);if(zcache.has(r))return zcache.get(r);{const n=new Ziffers(a,e);return zcache.set(r,n),n}},cachedPattern=(a,e={})=>cachedCall(a,e);class MidiConnection{constructor(){_e(this,"midiAccess",null);_e(this,"midiOutputs",[]);_e(this,"currentOutputIndex",0);_e(this,"scheduledNotes",{});this.initializeMidiAccess()}async initializeMidiAccess(){try{this.midiAccess=await navigator.requestMIDIAccess(),this.midiOutputs=Array.from(this.midiAccess.outputs.values()),this.midiOutputs.length===0&&console.warn("No MIDI outputs available.")}catch(e){console.error("Failed to initialize MIDI:",e)}}getCurrentMidiPort(){return this.midiOutputs.length>0&&this.currentOutputIndex>=0&&this.currentOutputIndexn.name===e);return r!==-1?(this.currentOutputIndex=r,!0):(console.error(`MIDI output "${e}" not found.`),!1)}listMidiOutputs(){console.log("Available MIDI Outputs:"),this.midiOutputs.forEach((e,r)=>{console.log(`${r+1}. ${e.name}`)})}sendMidiNote(e,r,n,s){const o=this.midiOutputs[this.currentOutputIndex];if(e=Math.min(Math.max(e,0),127),o){const l=[144+r,e,n],c=[128+r,e,0];o.send(l);const u=setTimeout(()=>{o.send(c),delete this.scheduledNotes[e]},(s-.02)*1e3);this.scheduledNotes[e]=u}else console.error("MIDI output not available.")}sendSysExMessage(e){const r=this.midiOutputs[this.currentOutputIndex];r?r.send(e):console.error("MIDI output not available.")}sendPitchBend(e,r){(e<0||e>16383)&&console.error("Invalid pitch bend value. Value must be in the range 0-16383."),(r<0||r>15)&&console.error("Invalid MIDI channel. Channel must be in the range 0-15.");const n=this.midiOutputs[this.currentOutputIndex];if(n){const s=e&127,o=e>>7&127;n.send([224|r,s,o])}else console.error("MIDI output not available.")}sendProgramChange(e,r){const n=this.midiOutputs[this.currentOutputIndex];n?n.send([192+r,e]):console.error("MIDI output not available.")}sendMidiControlChange(e,r,n){const s=this.midiOutputs[this.currentOutputIndex];s?s.send([176+n,e,r]):console.error("MIDI output not available.")}panic(){const e=this.midiOutputs[this.currentOutputIndex];if(e){for(const r in this.scheduledNotes){const n=this.scheduledNotes[r];clearTimeout(n),e.send([128,parseInt(r),0])}this.scheduledNotes={}}else console.error("MIDI output not available.")}}class DrunkWalk{constructor(e,r,n){_e(this,"min");_e(this,"max");_e(this,"wrap");_e(this,"position");this.min=e,this.max=r,this.wrap=n,this.position=0}step(){const e=Math.floor(Math.random()*3)-1;this.position+=e,this.wrap?this.position>this.max?this.position=this.min:this.positionthis.max&&(this.position=this.max)}getPosition(){return this.position}toggleWrap(e){this.wrap=e}}const SCALES={major:[0,2,4,5,7,9,11],naturalMinor:[0,2,3,5,7,8,10],harmonicMinor:[0,2,3,5,7,8,11],melodicMinor:[0,2,3,5,7,9,11],dorian:[0,2,3,5,7,9,10],phrygian:[0,1,3,5,7,8,10],lydian:[0,2,4,6,7,9,11],mixolydian:[0,2,4,5,7,9,10],aeolian:[0,2,3,5,7,8,10],locrian:[0,1,3,5,6,8,10],wholeTone:[0,2,4,6,8,10],majorPentatonic:[0,2,4,7,9],minorPentatonic:[0,3,5,7,10],chromatic:[0,1,2,3,4,5,6,7,8,9,10,11],blues:[0,3,5,6,7,10],diminished:[0,2,3,5,6,8,9,11],neapolitanMinor:[0,1,3,5,7,8,11],neapolitanMajor:[0,1,3,5,7,9,11],enigmatic:[0,1,4,6,8,10,11],doubleHarmonic:[0,1,4,5,7,8,11],octatonic:[0,2,3,5,6,8,9,11],bebopDominant:[0,2,4,5,7,9,10,11],bebopMajor:[0,2,4,5,7,8,9,11],bebopMinor:[0,2,3,5,7,8,9,11],bebopDorian:[0,2,3,4,5,7,9,10],harmonicMajor:[0,2,4,5,7,8,11],hungarianMinor:[0,2,3,6,7,8,11],hungarianMajor:[0,3,4,6,7,9,10],oriental:[0,1,4,5,6,9,10],romanianMinor:[0,2,3,6,7,9,10],spanishGypsy:[0,1,4,5,7,8,10],jewish:[0,1,4,5,7,8,10],hindu:[0,2,4,5,7,8,10],japanese:[0,1,5,7,8],hirajoshi:[0,2,3,7,8],kumoi:[0,2,3,7,9],inSen:[0,1,5,7,10],iwato:[0,1,5,6,10],yo:[0,2,5,7,9],minorBlues:[0,3,5,6,7,10],algerian:[0,2,3,5,6,7,8,11],augmented:[0,3,4,7,8,11],balinese:[0,1,3,7,8],byzantine:[0,1,4,5,7,8,11],chinese:[0,4,6,7,11],egyptian:[0,2,5,7,10],eightToneSpanish:[0,1,3,4,5,6,8,10],hawaiian:[0,2,3,5,7,9,10],hindustan:[0,2,4,5,7,8,10],persian:[0,1,4,5,6,8,11],eastIndianPurvi:[0,1,4,6,7,8,11],orientalA:[0,1,4,5,6,9,10]};function scale(a,e="major",r=4){const n=SCALES[e];if(!n)throw new Error(`Unknown scale ${e}`);let s=a%n.length;s<0&&(s+=n.length);let o=Math.floor(a/n.length);return 60+(r+o)*12+n[s]}let listenerQueue=[],atom=(a,e)=>{let r,n=[],s={lc:0,l:e||0,value:a,set(o){s.value=o,s.notify()},get(){return s.lc||s.listen(()=>{})(),s.value},notify(o){r=n;let l=!listenerQueue.length;for(let c=0;c{n===r&&(n=n.slice());let c=n.indexOf(o);~c&&(n.splice(c,2),s.lc--,s.lc||s.off())}},subscribe(o,l){let c=s.listen(o,l);return o(s.value),c},off(){}};return s},map=(a={})=>{let e=atom(a);return e.setKey=function(r,n){typeof n>"u"?r in e.value&&(e.value={...e.value},delete e.value[r],e.notify(r)):e.value[r]!==n&&(e.value={...e.value,[r]:n},e.notify(r))},e};if(typeof DelayNode<"u"){class a extends DelayNode{constructor(r,n,s,o){super(r),n=Math.abs(n),this.delayTime.value=s;const l=r.createGain();l.gain.value=Math.min(Math.abs(o),.995),this.feedback=l.gain;const c=r.createGain();return c.gain.value=n,this.delayGain=c,this.connect(l),this.connect(c),l.connect(this),this.connect=u=>c.connect(u),this}start(r){this.delayGain.gain.setValueAtTime(this.delayGain.gain.value,r+this.delayTime.value)}}AudioContext.prototype.createFeedbackDelay=function(e,r,n){return new a(this,e,r,n)}}typeof AudioContext<"u"&&(AudioContext.prototype.impulseResponse=function(a,e=1){const r=this.sampleRate*a,n=this.createBuffer(e,r,this.sampleRate),s=n.getChannelData(0);for(let o=0;o(e.buffer=this.impulseResponse(r),e.duration=a,e),e.setDuration(a),e});var U={a:{freqs:[660,1120,2750,3e3,3350],gains:[1,.5012,.0708,.0631,.0126],qs:[80,90,120,130,140]},e:{freqs:[440,1800,2700,3e3,3300],gains:[1,.1995,.1259,.1,.1],qs:[70,80,100,120,120]},i:{freqs:[270,1850,2900,3350,3590],gains:[1,.0631,.0631,.0158,.0158],qs:[40,90,100,120,120]},o:{freqs:[430,820,2700,3e3,3300],gains:[1,.3162,.0501,.0794,.01995],qs:[40,80,100,120,120]},u:{freqs:[370,630,2750,3e3,3400],gains:[1,.1,.0708,.0316,.01995],qs:[40,60,100,120,120]}};if(typeof GainNode<"u"){class a extends GainNode{constructor(r,n){if(super(r),!U[n])throw new Error("vowel: unknown vowel "+n);const{gains:s,qs:o,freqs:l}=U[n],c=r.createGain();for(let u=0;u<5;u++){const p=r.createGain();p.gain.value=s[u];const h=r.createBiquadFilter();h.type="bandpass",h.Q.value=o[u],h.frequency.value=l[u],this.connect(h),h.connect(p),p.connect(c)}return c.gain.value=8,this.connect=u=>c.connect(u),this}}AudioContext.prototype.createVowelFilter=function(e){return new a(this,e)}}const re=a=>{var s;if(typeof a!="string")return[];const[e,r="",n]=((s=a.match(/^([a-gA-G])([#bsf]*)([0-9]*)$/))==null?void 0:s.slice(1))||[];return e?[e,r,n?Number(n):void 0]:[]},ie={c:0,d:2,e:4,f:5,g:7,a:9,b:11},ae={"#":1,b:-1,s:1,f:-1},q=(a,e=3)=>{const[r,n,s=e]=re(a);if(!r)throw new Error('not a note: "'+a+'"');const o=ie[r.toLowerCase()],l=(n==null?void 0:n.split("").reduce((c,u)=>c+ae[u],0))||0;return(Number(s)+1)*12+o+l},ge=a=>Math.pow(2,(a-69)/12)*440,de=(a,e,r)=>Math.min(Math.max(a,e),r),ue=a=>12*Math.log(a/440)/Math.LN2+69,le=(a,e)=>{if(typeof a!="object")throw new Error("valueToMidi: expected object value");let{freq:r,note:n}=a;if(typeof r=="number")return ue(r);if(typeof n=="string")return q(n);if(typeof n=="number")return n;if(!e)throw new Error("valueToMidi: expected freq or note to be set");return e},Ie="data:application/javascript;base64,Ly8gTElDRU5TRSBHTlUgR2VuZXJhbCBQdWJsaWMgTGljZW5zZSB2My4wIHNlZSBodHRwczovL2dpdGh1Yi5jb20vZGt0cjAvV2ViRGlydC9ibG9iL21haW4vTElDRU5TRQovLyBhbGwgdGhlIGNyZWRpdCBnb2VzIHRvIGRrdHIwJ3Mgd2ViZGlydDogaHR0cHM6Ly9naXRodWIuY29tL2RrdHIwL1dlYkRpcnQvYmxvYi81Y2UzZDY5ODM2MmM1NGQ2ZTFiNjhhY2M0N2ViMjk1NWFjNjJjNzkzL2Rpc3QvQXVkaW9Xb3JrbGV0cy5qcwovLyA8MwoKY2xhc3MgQ29hcnNlUHJvY2Vzc29yIGV4dGVuZHMgQXVkaW9Xb3JrbGV0UHJvY2Vzc29yIHsKICBzdGF0aWMgZ2V0IHBhcmFtZXRlckRlc2NyaXB0b3JzKCkgewogICAgcmV0dXJuIFt7IG5hbWU6ICdjb2Fyc2UnLCBkZWZhdWx0VmFsdWU6IDEgfV07CiAgfQoKICBjb25zdHJ1Y3RvcigpIHsKICAgIHN1cGVyKCk7CiAgICB0aGlzLm5vdFN0YXJ0ZWQgPSB0cnVlOwogIH0KCiAgcHJvY2VzcyhpbnB1dHMsIG91dHB1dHMsIHBhcmFtZXRlcnMpIHsKICAgIGNvbnN0IGlucHV0ID0gaW5wdXRzWzBdOwogICAgY29uc3Qgb3V0cHV0ID0gb3V0cHV0c1swXTsKICAgIGNvbnN0IGNvYXJzZSA9IHBhcmFtZXRlcnMuY29hcnNlOwogICAgY29uc3QgYmxvY2tTaXplID0gMTI4OwogICAgY29uc3QgaGFzSW5wdXQgPSAhKGlucHV0WzBdID09PSB1bmRlZmluZWQpOwogICAgaWYgKGhhc0lucHV0KSB7CiAgICAgIHRoaXMubm90U3RhcnRlZCA9IGZhbHNlOwogICAgICBvdXRwdXRbMF1bMF0gPSBpbnB1dFswXVswXTsKICAgICAgZm9yIChsZXQgbiA9IDE7IG4gPCBibG9ja1NpemU7IG4rKykgewogICAgICAgIGZvciAobGV0IG8gPSAwOyBvIDwgb3V0cHV0Lmxlbmd0aDsgbysrKSB7CiAgICAgICAgICBvdXRwdXRbb11bbl0gPSBuICUgY29hcnNlID09IDAgPyBpbnB1dFswXVtuXSA6IG91dHB1dFtvXVtuIC0gMV07CiAgICAgICAgfQogICAgICB9CiAgICB9CiAgICByZXR1cm4gdGhpcy5ub3RTdGFydGVkIHx8IGhhc0lucHV0OwogIH0KfQoKcmVnaXN0ZXJQcm9jZXNzb3IoJ2NvYXJzZS1wcm9jZXNzb3InLCBDb2Fyc2VQcm9jZXNzb3IpOwoKY2xhc3MgQ3J1c2hQcm9jZXNzb3IgZXh0ZW5kcyBBdWRpb1dvcmtsZXRQcm9jZXNzb3IgewogIHN0YXRpYyBnZXQgcGFyYW1ldGVyRGVzY3JpcHRvcnMoKSB7CiAgICByZXR1cm4gW3sgbmFtZTogJ2NydXNoJywgZGVmYXVsdFZhbHVlOiAwIH1dOwogIH0KCiAgY29uc3RydWN0b3IoKSB7CiAgICBzdXBlcigpOwogICAgdGhpcy5ub3RTdGFydGVkID0gdHJ1ZTsKICB9CgogIHByb2Nlc3MoaW5wdXRzLCBvdXRwdXRzLCBwYXJhbWV0ZXJzKSB7CiAgICBjb25zdCBpbnB1dCA9IGlucHV0c1swXTsKICAgIGNvbnN0IG91dHB1dCA9IG91dHB1dHNbMF07CiAgICBjb25zdCBjcnVzaCA9IHBhcmFtZXRlcnMuY3J1c2g7CiAgICBjb25zdCBibG9ja1NpemUgPSAxMjg7CiAgICBjb25zdCBoYXNJbnB1dCA9ICEoaW5wdXRbMF0gPT09IHVuZGVmaW5lZCk7CiAgICBpZiAoaGFzSW5wdXQpIHsKICAgICAgdGhpcy5ub3RTdGFydGVkID0gZmFsc2U7CiAgICAgIGlmIChjcnVzaC5sZW5ndGggPT09IDEpIHsKICAgICAgICBjb25zdCB4ID0gTWF0aC5wb3coMiwgY3J1c2hbMF0gLSAxKTsKICAgICAgICBmb3IgKGxldCBuID0gMDsgbiA8IGJsb2NrU2l6ZTsgbisrKSB7CiAgICAgICAgICBjb25zdCB2YWx1ZSA9IE1hdGgucm91bmQoaW5wdXRbMF1bbl0gKiB4KSAvIHg7CiAgICAgICAgICBmb3IgKGxldCBvID0gMDsgbyA8IG91dHB1dC5sZW5ndGg7IG8rKykgewogICAgICAgICAgICBvdXRwdXRbb11bbl0gPSB2YWx1ZTsKICAgICAgICAgIH0KICAgICAgICB9CiAgICAgIH0gZWxzZSB7CiAgICAgICAgZm9yIChsZXQgbiA9IDA7IG4gPCBibG9ja1NpemU7IG4rKykgewogICAgICAgICAgbGV0IHggPSBNYXRoLnBvdygyLCBjcnVzaFtuXSAtIDEpOwogICAgICAgICAgY29uc3QgdmFsdWUgPSBNYXRoLnJvdW5kKGlucHV0WzBdW25dICogeCkgLyB4OwogICAgICAgICAgZm9yIChsZXQgbyA9IDA7IG8gPCBvdXRwdXQubGVuZ3RoOyBvKyspIHsKICAgICAgICAgICAgb3V0cHV0W29dW25dID0gdmFsdWU7CiAgICAgICAgICB9CiAgICAgICAgfQogICAgICB9CiAgICB9CiAgICByZXR1cm4gdGhpcy5ub3RTdGFydGVkIHx8IGhhc0lucHV0OwogIH0KfQpyZWdpc3RlclByb2Nlc3NvcignY3J1c2gtcHJvY2Vzc29yJywgQ3J1c2hQcm9jZXNzb3IpOwoKY2xhc3MgU2hhcGVQcm9jZXNzb3IgZXh0ZW5kcyBBdWRpb1dvcmtsZXRQcm9jZXNzb3IgewogIHN0YXRpYyBnZXQgcGFyYW1ldGVyRGVzY3JpcHRvcnMoKSB7CiAgICByZXR1cm4gW3sgbmFtZTogJ3NoYXBlJywgZGVmYXVsdFZhbHVlOiAwIH1dOwogIH0KCiAgY29uc3RydWN0b3IoKSB7CiAgICBzdXBlcigpOwogICAgdGhpcy5ub3RTdGFydGVkID0gdHJ1ZTsKICB9CgogIHByb2Nlc3MoaW5wdXRzLCBvdXRwdXRzLCBwYXJhbWV0ZXJzKSB7CiAgICBjb25zdCBpbnB1dCA9IGlucHV0c1swXTsKICAgIGNvbnN0IG91dHB1dCA9IG91dHB1dHNbMF07CiAgICBjb25zdCBzaGFwZTAgPSBwYXJhbWV0ZXJzLnNoYXBlWzBdOwogICAgY29uc3Qgc2hhcGUxID0gc2hhcGUwIDwgMSA/IHNoYXBlMCA6IDEuMCAtIDRlLTEwOwogICAgY29uc3Qgc2hhcGUgPSAoMi4wICogc2hhcGUxKSAvICgxLjAgLSBzaGFwZTEpOwogICAgY29uc3QgYmxvY2tTaXplID0gMTI4OwogICAgY29uc3QgaGFzSW5wdXQgPSAhKGlucHV0WzBdID09PSB1bmRlZmluZWQpOwogICAgaWYgKGhhc0lucHV0KSB7CiAgICAgIHRoaXMubm90U3RhcnRlZCA9IGZhbHNlOwogICAgICBmb3IgKGxldCBuID0gMDsgbiA8IGJsb2NrU2l6ZTsgbisrKSB7CiAgICAgICAgY29uc3QgdmFsdWUgPSAoKDEgKyBzaGFwZSkgKiBpbnB1dFswXVtuXSkgLyAoMSArIHNoYXBlICogTWF0aC5hYnMoaW5wdXRbMF1bbl0pKTsKICAgICAgICBmb3IgKGxldCBvID0gMDsgbyA8IG91dHB1dC5sZW5ndGg7IG8rKykgewogICAgICAgICAgb3V0cHV0W29dW25dID0gdmFsdWU7CiAgICAgICAgfQogICAgICB9CiAgICB9CiAgICByZXR1cm4gdGhpcy5ub3RTdGFydGVkIHx8IGhhc0lucHV0OwogIH0KfQoKcmVnaXN0ZXJQcm9jZXNzb3IoJ3NoYXBlLXByb2Nlc3NvcicsIFNoYXBlUHJvY2Vzc29yKTsK";function j(a){const e=I().createGain();return e.gain.value=a,e}const Ce=({s:a,freq:e,t:r})=>{const n=I().createOscillator();return n.type=a||"triangle",n.frequency.value=Number(e),n.start(r),{node:n,stop:s=>n.stop(s)}},ne=(a,e,r,n,s,o)=>{const l=I().createGain();return l.gain.setValueAtTime(0,o),l.gain.linearRampToValueAtTime(s,o+a),l.gain.linearRampToValueAtTime(r*s,o+a+e),{node:l,stop:c=>{l.gain.setValueAtTime(r*s,c),l.gain.linearRampToValueAtTime(0,c+n)}}},x=(a,e,r)=>{const n=I().createBiquadFilter();return n.type=a,n.frequency.value=e,n.Q.value=r,n};let te=a=>console.log(a);const v=(...a)=>te(...a),E=map();function oe(a,e,r={}){E.setKey(a,{onTrigger:e,data:r})}function $(a){return E.get()[a]}let J;const I=()=>(J||(J=new AudioContext),J);let S;const Q=()=>{const a=I();return S||(S=a.createGain(),S.connect(a.destination)),S};let k;function fe(){return k||(k=I().audioWorklet.addModule(Ie),k)}function O(a,e,r){const n=new AudioWorkletNode(a,e);return Object.entries(r).forEach(([s,o])=>{n.parameters.get(s).value=o}),n}async function he$2(a={}){const{disableWorklets:e=!1}=a;typeof window<"u"&&(await I().resume(),e?console.log("disableWorklets: AudioWorklet effects coarse, crush and shape are skipped!"):await fe().catch(r=>{console.warn("could not load AudioWorklet effects coarse, crush and shape",r)}))}async function Ke(a){return new Promise(e=>{document.addEventListener("click",async function r(){await he$2(a),e(),document.removeEventListener("click",r)})})}let R={};function Ae(a,e,r,n){var s;if(r=de(r,0,.98),!R[a]){const o=I().createFeedbackDelay(1,e,r);(s=o.start)==null||s.call(o,n),o.connect(Q()),R[a]=o}return R[a].delayTime.value!==e&&R[a].delayTime.setValueAtTime(e,n),R[a].feedback.value!==r&&R[a].feedback.setValueAtTime(r,n),R[a]}let V={};function pe(a,e=2){if(!V[a]){const r=I().createReverb(e);r.connect(Q()),V[a]=r}return V[a].duration!==e&&(V[a]=V[a].setDuration(e),V[a].duration=e),V[a]}function _(a,e,r){const n=j(r);return a.connect(n),n.connect(e),n}const be=async(a,e,r)=>{const n=I();if(typeof a!="object")throw new Error(`expected hap.value to be an object, but got "${a}". Hint: append .note() or .s() to the end`,"error");let s=n.currentTime+e,{s:o="triangle",bank:l,source:c,gain:u=.8,cutoff:p,resonance:h=1,hcutoff:g,hresonance:b=1,bandf:y,bandq:P=1,coarse:Y,crush:F,shape:H,pan:Ee,vowel:ke,delay:f=0,delayfeedback:D=.5,delaytime:N=.25,orbit:B=1,room:z,size:se=2,velocity:W=1}=a;u*=W;let Se=[];const We=()=>{Se.forEach(Me=>Me==null?void 0:Me.disconnect())};l&&o&&(o=`${l}_${o}`);let Qe;if(c)Qe=c(s,a,r);else if($(o)){const{onTrigger:Me}=$(o),Pe=await Me(s,a,We);Pe&&(Qe=Pe.node,Pe.stop(s+r))}else throw new Error(`sound ${o} not found! Is it loaded?`);if(!Qe)return;if(n.currentTime>s){v("[webaudio] skip hap: still loading",n.currentTime-s);return}const Fe=[];if(Fe.push(Qe),Fe.push(j(u)),p!==void 0&&Fe.push(x("lowpass",p,h)),g!==void 0&&Fe.push(x("highpass",g,b)),y!==void 0&&Fe.push(x("bandpass",y,P)),ke!==void 0&&Fe.push(n.createVowelFilter(ke)),Y!==void 0&&Fe.push(O(n,"coarse-processor",{coarse:Y})),F!==void 0&&Fe.push(O(n,"crush-processor",{crush:F})),H!==void 0&&Fe.push(O(n,"shape-processor",{shape:H})),Ee!==void 0){const Me=n.createStereoPanner();Me.pan.value=2*Ee-1,Fe.push(Me)}const Ue=j(1);Fe.push(Ue),Ue.connect(Q());let Z;if(f>0&&N>0&&D>0){const Me=Ae(B,N,D,s);Z=_(Ue,Me,f)}let ve;if(z>0&&se>0){const Me=pe(B,se);ve=_(Ue,Me,z)}Fe.slice(1).reduce((Me,Pe)=>Me.connect(Pe),Fe[0]),Se=Fe.concat([Z,ve])},L={};function Be(a,e){var r=e?1e3:1024;if(a=r);return a.toFixed(1)+" "+n[s]}const me=async(a,e,r,n,s,o,l)=>{let c=0;s!==void 0&&r!==void 0&&v("[sampler] hap has note and freq. ignoring note","warning");let u=le({freq:s,note:r},36);c=u-36;const p=I();let h;if(Array.isArray(o))h=o[e%o.length];else{const P=F=>q(F)-u,Y=Object.keys(o).filter(F=>!F.startsWith("_")).reduce((F,H,Ee)=>!F||Math.abs(P(H)){const s=r?`sound "${r}:${n}"`:"sample";if(!L[a]){v(`[sampler] load ${s}..`,"load-sample",{url:a});const o=Date.now();L[a]=fetch(a).then(l=>l.arrayBuffer()).then(async l=>{const c=Date.now()-o,u=Be(l.byteLength);return v(`[sampler] load ${s}... done! loaded ${u} in ${c}ms`,"loaded-sample",{url:a}),await e.decodeAudioData(l)})}return L[a]};function we(a){const e=I(),r=e.createBuffer(a.numberOfChannels,a.length,e.sampleRate);for(let n=0;nObject.entries(a).forEach(([n,s])=>{if(typeof s=="string"&&(s=[s]),typeof s!="object")throw new Error("wrong sample map format for "+n);r=s._base||r;const o=l=>(r+l).replace("github:","https://raw.githubusercontent.com/");Array.isArray(s)?s=s.map(o):s=Object.fromEntries(Object.entries(s).map(([l,c])=>[l,(typeof c=="string"?[c]:c).map(o)])),e(n,s)});let ce={};function Xe(a){const e=Object.entries(ce).find(([r])=>a.startsWith(r));if(e)return e[1]}const Re=async(a,e=a._base||"",r={})=>{if(typeof a=="string"){const o=Xe(a);if(o)return o(a);if(a.startsWith("github:")){let[c,u]=a.split("github:");u=u.endsWith("/")?u.slice(0,-1):u,a=`https://raw.githubusercontent.com/${u}/strudel.json`}if(typeof fetch!="function")return;const l=a.split("/").slice(0,-1).join("/");return typeof fetch>"u"?void 0:fetch(a).then(c=>c.json()).then(c=>Re(c,e||c._base||l,r)).catch(c=>{throw console.error(c),new Error(`error loading "${a}"`)})}const{prebake:n,tag:s}=r;Ge(a,(o,l)=>oe(o,(c,u,p)=>Ve(c,u,p,l),{type:"sample",samples:l,baseUrl:e,prebake:n,tag:s}),e)},ee=[];async function Ve(a,e,r,n,s){const{s:o,freq:l,unit:c,nudge:u=0,cut:p,loop:h,clip:g=void 0,n:b=0,note:y,speed:P=1,begin:Y=0,end:F=1}=e;if(P===0)return;const H=I(),{attack:Ee=.001,decay:ke=.001,sustain:f=1,release:D=.001}=e,N=a+u,B=await me(o,b,y,P,l,n,s);if(H.currentTime>a){v(`[sampler] still loading sound "${o}:${b}"`,"highlight");return}if(!B){v(`[sampler] could not load "${o}:${b}"`,"error");return}B.playbackRate.value=Math.abs(P)*B.playbackRate.value,c==="c"&&(B.playbackRate.value=B.playbackRate.value*B.buffer.duration*1);const z=Y*B.buffer.duration;B.start(N,z);const se=B.buffer.duration/B.playbackRate.value,{node:W,stop:Se}=ne(Ee,ke,f,D,1,a);B.connect(W);const We=H.createGain();W.connect(We),B.onended=function(){B.disconnect(),W.disconnect(),We.disconnect(),r()};const Qe={node:We,bufferSource:B,stop:(Fe,Ue=g===void 0)=>{let Z=Fe;Ue&&(Z=a+(F-Y)*se),B.stop(Z+D),Se(Z)}};if(p!==void 0){const Fe=ee[p];Fe&&(Fe.node.gain.setValueAtTime(1,N),Fe.node.gain.linearRampToValueAtTime(0,N+.01)),ee[p]=Qe}return Qe}const He=(a,e=1,r="sine")=>{const n=I(),s=n.createOscillator();s.type=r,s.frequency.value=a,s.start();const o=new GainNode(n,{gain:e});return s.connect(o),{node:o,stop:l=>s.stop(l)}},Ze=(a,e,r,n="sine")=>{const s=a.frequency.value*e,o=s*r;return He(s,o,n)};function De(){["sine","square","triangle","sawtooth"].forEach(a=>{oe(a,(e,r,n)=>{const{attack:s=.001,decay:o=.05,sustain:l=.6,release:c=.01,fmh:u=1,fmi:p}=r;let{n:h,note:g,freq:b}=r;h=g||h||36,typeof h=="string"&&(h=q(h)),!b&&typeof h=="number"&&(b=ge(h));const{node:y,stop:P}=Ce({t:e,s:a,freq:b});let Y;if(p){const{node:ke,stop:f}=Ze(y,u,p);ke.connect(y.frequency),Y=f}const F=j(.3),{node:H,stop:Ee}=ne(s,o,l,c,1,e);return y.onended=()=>{y.disconnect(),F.disconnect(),n()},{node:y.connect(F).connect(H),stop:ke=>{Ee(ke);let f=ke+c;P(f),Y==null||Y(f)}}},{type:"synth",prebake:!0})})}class Sound{constructor(e,r){_e(this,"values");_e(this,"attack",e=>(this.values.attack=e,this));_e(this,"atk",this.attack);_e(this,"decay",e=>(this.values.decay=e,this));_e(this,"dec",this.decay);_e(this,"sustain",e=>(this.values.sustain=e,this));_e(this,"sus",this.sustain);_e(this,"release",e=>(this.values.release=e,this));_e(this,"rel",this.release);_e(this,"unit",e=>(this.values.unit=e,this));_e(this,"freq",e=>(this.values.freq=e,this));_e(this,"fmi",e=>(this.values.fmi=e,this));_e(this,"fmh",e=>(this.values.fmh=e,this));_e(this,"nudge",e=>(this.values.nudge=e,this));_e(this,"cut",e=>(this.values.cut=e,this));_e(this,"loop",e=>(this.values.loop=e,this));_e(this,"clip",e=>(this.values.clip=e,this));_e(this,"n",e=>(this.values.n=e,this));_e(this,"note",e=>(this.values.note=e,this));_e(this,"speed",e=>(this.values.speed=e,this));_e(this,"begin",e=>(this.values.begin=e,this));_e(this,"end",e=>(this.values.end=e,this));_e(this,"gain",e=>(this.values.gain=e,this));_e(this,"cutoff",e=>(this.values.cutoff=e,this));_e(this,"resonance",e=>(this.values.resonance=e,this));_e(this,"hcutoff",e=>(this.values.hcutoff=e,this));_e(this,"hresonance",e=>(this.values.hresonance=e,this));_e(this,"bandf",e=>(this.values.bandf=e,this));_e(this,"bandq",e=>(this.values.bandq=e,this));_e(this,"coarse",e=>(this.values.coarse=e,this));_e(this,"crush",e=>(this.values.crush=e,this));_e(this,"shape",e=>(this.values.shape=e,this));_e(this,"pan",e=>(this.values.pan=e,this));_e(this,"vowel",e=>(this.values.vowel=e,this));_e(this,"delay",e=>(this.values.delay=e,this));_e(this,"delayfeedback",e=>(this.values.delayfeedback=e,this));_e(this,"delaytime",e=>(this.values.delaytime=e,this));_e(this,"orbit",e=>(this.values.orbit=e,this));_e(this,"room",e=>(this.values.room=e,this));_e(this,"size",e=>(this.values.size=e,this));_e(this,"velocity",e=>(this.values.velocity=e,this));_e(this,"dur",e=>(this.values.dur=e,this));_e(this,"out",()=>be(this.values,this.app.clock.pulse_duration,this.values.dur));this.app=r,this.values={s:e,dur:.5}}}Array.prototype.in=function(a){return this.includes(a)};async function loadSamples(){const a="https://raw.githubusercontent.com/felixroos/dough-samples/main/";return Promise.all([Ke(),Re("github:Bubobubobubobubo/Topos-Samples/main"),Re(`${a}/tidal-drum-machines.json`),Re(`${a}/piano.json`),Re(`${a}/Dirt-Samples.json`),Re(`${a}/EmuSP12.json`),Re(`${a}/vcsl.json`),De()])}loadSamples();class UserAPI{constructor(e){_e(this,"variables",{});_e(this,"counters",{});_e(this,"_drunk",new DrunkWalk(-100,100,!1));_e(this,"MidiConnection",new MidiConnection);_e(this,"load");_e(this,"time",()=>this.app.audioContext.currentTime);_e(this,"play",()=>{this.app.setButtonHighlighting("play",!0),this.app.clock.start()});_e(this,"pause",()=>{this.app.setButtonHighlighting("pause",!0),this.app.clock.pause()});_e(this,"stop",()=>{this.app.setButtonHighlighting("stop",!0),this.app.clock.stop()});_e(this,"silence",this.stop);_e(this,"hush",this.stop);_e(this,"mouseX",()=>this.app._mouseX);_e(this,"mouseY",()=>this.app._mouseY);_e(this,"script",(...e)=>{e.forEach(r=>{tryEvaluate(this.app,this.app.universes[this.app.selected_universe].locals[r])})});_e(this,"s",this.script);_e(this,"clear_script",e=>{this.app.universes[this.app.selected_universe].locals[e]={candidate:"",committed:"",evaluations:0}});_e(this,"cs",this.clear_script);_e(this,"copy_script",(e,r)=>{this.app.universes[this.app.selected_universe].locals[r]=this.app.universes[this.app.selected_universe].locals[e]});_e(this,"cps",this.copy_script);_e(this,"midi_outputs",()=>(console.log(this.MidiConnection.listMidiOutputs()),this.MidiConnection.midiOutputs));_e(this,"midi_output",e=>{e?this.MidiConnection.switchMidiOutput(e):console.log(this.MidiConnection.getCurrentMidiPort())});_e(this,"note",(e,r={})=>{const n=r.channel?r.channel:0,s=r.velocity?r.velocity:100,o=r.duration?r.duration*Math.floor(this.app.clock.pulse_duration*this.ppqn()):this.app.clock.pulse_duration*this.ppqn();this.MidiConnection.sendMidiNote(e,n,s,o)});_e(this,"sysex",e=>{this.MidiConnection.sendSysExMessage(e)});_e(this,"pitch_bend",(e,r)=>{this.MidiConnection.sendPitchBend(e,r)});_e(this,"program_change",(e,r)=>{this.MidiConnection.sendProgramChange(e,r)});_e(this,"midi_clock",()=>{this.MidiConnection.sendMidiClock()});_e(this,"control_change",({control:e=20,value:r=0,channel:n=0})=>{this.MidiConnection.sendMidiControlChange(e,r,n)});_e(this,"midi_panic",()=>{this.MidiConnection.panic()});_e(this,"zn",(e,r={})=>{const n=cachedPattern(e,r);if(n.hasStarted()){const s=n.peek(),o=s.modifiedEvent?s.modifiedEvent:s,l=r.channel?r.channel:0,c=r.velocity?r.velocity:100,u=r.sustain?r.sustain:.5;o instanceof Pitch?(o.bend&&this.MidiConnection.sendPitchBend(o.bend,l),this.MidiConnection.sendMidiNote(o.note,l,c,u),o.bend&&this.MidiConnection.sendPitchBend(8192,l)):o instanceof Chord&&o.pitches.forEach(p=>{p.bend&&this.MidiConnection.sendPitchBend(p.bend,l),this.MidiConnection.sendMidiNote(p.note,l,c,u),p.bend&&this.MidiConnection.sendPitchBend(8192,l)}),s.modifiedEvent&&(s.modifiedEvent=void 0)}return n.next()});_e(this,"counter",(e,r,n)=>(e in this.counters?(this.counters[e].limit!==r&&(this.counters[e].value=0,this.counters[e].limit=r),this.counters[e].step!==n&&(this.counters[e].step=n??this.counters[e].step),this.counters[e].value+=this.counters[e].step,this.counters[e].limit!==void 0&&this.counters[e].value>this.counters[e].limit&&(this.counters[e].value=0)):this.counters[e]={value:0,step:n??1,limit:r},this.counters[e].value));_e(this,"$",this.counter);_e(this,"drunk",e=>e!==void 0?(this._drunk.position=e,this._drunk.getPosition()):(this._drunk.step(),this._drunk.getPosition()));_e(this,"drunk_max",e=>{this._drunk.max=e});_e(this,"drunk_min",e=>{this._drunk.min=e});_e(this,"drunk_wrap",e=>{this._drunk.toggleWrap(e)});_e(this,"variable",(e,r)=>typeof e=="string"&&r===void 0?this.variables[e]:(this.variables[e]=r,this.variables[e]));_e(this,"v",this.variable);_e(this,"delete_variable",e=>{delete this.variables[e]});_e(this,"dv",this.delete_variable);_e(this,"clear_variables",()=>{this.variables={}});_e(this,"cv",this.clear_variables);_e(this,"slice",e=>{const r=this.epulse();return Math.floor(r/Math.floor(e*this.ppqn()))%2===0});_e(this,"barslice",e=>{const r=this.bar()-1;return Math.floor(r/e)%2===0});_e(this,"seqslice",(...e)=>{const r=e[0],n=e.slice(1),s=this.epulse(),o=Math.floor(s/Math.floor(r*this.ppqn()));return n[o%n.length]});_e(this,"pick",(...e)=>e[Math.floor(Math.random()*e.length)]);_e(this,"seqbeat",(...e)=>e[this.ebeat()%e.length]);_e(this,"mel",(e,r)=>r[e%r.length]);_e(this,"seqbar",(...e)=>e[(this.app.clock.time_position.bar+1)%e.length]);_e(this,"seqpulse",(...e)=>e[this.app.clock.time_position.pulse%e.length]);_e(this,"randI",(e,r)=>Math.floor(Math.random()*(r-e+1))+e);_e(this,"rand",(e,r)=>Math.random()*(r-e)+e);_e(this,"rI",this.randI);_e(this,"r",this.rand);_e(this,"quantize",(e,r)=>{if(r.length===0)return e;let n=r[0];return r.forEach(s=>{Math.abs(s-e)Math.min(Math.max(e,r),n));_e(this,"cmp",this.clamp);_e(this,"bpm",e=>e===void 0?this.app.clock.bpm:((e<1||e>500)&&console.log(`Setting bpm to ${e}`),this.app.clock.bpm=e,e));_e(this,"tempo",this.bpm);_e(this,"bpb",e=>e===void 0?this.app.clock.time_signature[0]:(e<1&&console.log(`Setting bpb to ${e}`),this.app.clock.time_signature[0]=e,e));_e(this,"ppqn",e=>e===void 0?this.app.clock.ppqn:(e<1&&console.log(`Setting ppqn to ${e}`),this.app.clock.ppqn=e,e));_e(this,"time_signature",(e,r)=>{this.app.clock.time_signature=[e,r]});_e(this,"almostNever",()=>Math.random()>.9);_e(this,"sometimes",()=>Math.random()>.5);_e(this,"rarely",()=>Math.random()>.75);_e(this,"often",()=>Math.random()>.25);_e(this,"almostAlways",()=>Math.random()>.1);_e(this,"dice",e=>Math.floor(Math.random()*e)+1);_e(this,"i",e=>e!==void 0?(this.app.universes[this.app.selected_universe].global.evaluations=e,this.app.universes[this.app.selected_universe]):this.app.universes[this.app.selected_universe].global.evaluations);_e(this,"bar",()=>this.app.clock.time_position.bar);_e(this,"tick",()=>this.app.clock.tick);_e(this,"pulse",()=>this.app.clock.time_position.pulse);_e(this,"beat",()=>this.app.clock.time_position.beat);_e(this,"ebeat",()=>this.app.clock.beats_since_origin);_e(this,"epulse",()=>this.app.clock.pulses_since_origin);_e(this,"onbar",(e,...r)=>{const n=[...Array(e).keys()].map(s=>s+1);return console.log(r.some(s=>n.includes(s%e))),r.some(s=>n.includes(s%e))});_e(this,"onbeat",(...e)=>{let r=[];return e.forEach(n=>{n=n%this.app.clock.time_signature[0]+1;let s=Math.floor(n),o=n-s;r.push(s===this.app.clock.time_position.beat&&this.app.clock.time_position.pulse===o*this.app.clock.ppqn)}),r.some(n=>n==!0)});_e(this,"prob",e=>Math.random()*100Math.random()>.5);_e(this,"min",(...e)=>Math.min(...e));_e(this,"max",(...e)=>Math.max(...e));_e(this,"mean",(...e)=>e.reduce((n,s)=>n+s,0)/e.length);_e(this,"limit",(e,r,n)=>Math.min(Math.max(e,r),n));_e(this,"delay",(e,r)=>{setTimeout(r,e)});_e(this,"delayr",(e,r,n)=>{[...Array(r).keys()].map(o=>e*o).forEach((o,l)=>{setTimeout(n,o)})});_e(this,"mod",(...e)=>e.map(n=>this.epulse()%Math.floor(n*this.ppqn())===0).some(n=>n===!0));_e(this,"modbar",(...e)=>e.map(n=>this.bar()%Math.floor(n*this.ppqn())===0).some(n=>n===!0));_e(this,"euclid",(e,r,n,s=0)=>this._euclidean_cycle(r,n,s)[e%n]);_e(this,"ec",this.euclid);_e(this,"bin",(e,r)=>{let s=r.toString(2).split("").map(o=>o==="1");return s[e%s.length]});_e(this,"line",(e,r,n=1)=>{const s=[];if(r>e&&n>0||rMath.sin(this.app.clock.ctx.currentTime*Math.PI*2*e)+r);_e(this,"usine",(e=1,r=0)=>(this.sine(e,r)+1)/2);_e(this,"saw",(e=1,r=0)=>this.app.clock.ctx.currentTime*e%1*2-1+r);_e(this,"usaw",(e=1,r=0)=>(this.saw(e,r)+1)/2);_e(this,"triangle",(e=1,r=0)=>Math.abs(this.saw(e,r))*2-1);_e(this,"utriangle",(e=1,r=0)=>(this.triangle(e,r)+1)/2);_e(this,"square",(e=1,r=0,n=.5)=>{const s=1/e;return(Date.now()/1e3+r)%s/s(this.square(e,r,n)+1)/2);_e(this,"noise",()=>Math.random()*2-1);_e(this,"abs",Math.abs);_e(this,"sound",e=>new Sound(e,this.app));_e(this,"snd",this.sound);_e(this,"samples",Re);_e(this,"log",console.log);_e(this,"scale",scale);_e(this,"rate",e=>{});this.app=e,this.load=Re("github:tidalcycles/Dirt-Samples/master")}_euclidean_cycle(e,r,n=0){if(e==r)return Array.from({length:r},()=>!0);function s(c,u){const p=c.length,h=(u+1)%p;return c[u]>c[h]}if(e>=r)return[!0];const o=Array.from({length:r},(c,u)=>(e*(u-1)%r+r)%r);let l=o.map((c,u)=>s(o,u));return n!=0&&(l=l.slice(n).concat(l.slice(0,n))),l}}const style="";var commonjsGlobal=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function getDefaultExportFromCjs(a){return a&&a.__esModule&&Object.prototype.hasOwnProperty.call(a,"default")?a.default:a}var showdown$2={exports:{}};(function(a){(function(){function e(f){var D={omitExtraWLInCodeBlocks:{defaultValue:!1,describe:"Omit the default extra whiteline added to code blocks",type:"boolean"},noHeaderId:{defaultValue:!1,describe:"Turn on/off generated header id",type:"boolean"},prefixHeaderId:{defaultValue:!1,describe:"Add a prefix to the generated header ids. Passing a string will prefix that string to the header id. Setting to true will add a generic 'section-' prefix",type:"string"},rawPrefixHeaderId:{defaultValue:!1,describe:'Setting this option to true will prevent showdown from modifying the prefix. This might result in malformed IDs (if, for instance, the " char is used in the prefix)',type:"boolean"},ghCompatibleHeaderId:{defaultValue:!1,describe:"Generate header ids compatible with github style (spaces are replaced with dashes, a bunch of non alphanumeric chars are removed)",type:"boolean"},rawHeaderId:{defaultValue:!1,describe:`Remove only spaces, ' and " from generated header ids (including prefixes), replacing them with dashes (-). WARNING: This might result in malformed ids`,type:"boolean"},headerLevelStart:{defaultValue:!1,describe:"The header blocks level start",type:"integer"},parseImgDimensions:{defaultValue:!1,describe:"Turn on/off image dimension parsing",type:"boolean"},simplifiedAutoLink:{defaultValue:!1,describe:"Turn on/off GFM autolink style",type:"boolean"},excludeTrailingPunctuationFromURLs:{defaultValue:!1,describe:"Excludes trailing punctuation from links generated with autoLinking",type:"boolean"},literalMidWordUnderscores:{defaultValue:!1,describe:"Parse midword underscores as literal underscores",type:"boolean"},literalMidWordAsterisks:{defaultValue:!1,describe:"Parse midword asterisks as literal asterisks",type:"boolean"},strikethrough:{defaultValue:!1,describe:"Turn on/off strikethrough support",type:"boolean"},tables:{defaultValue:!1,describe:"Turn on/off tables support",type:"boolean"},tablesHeaderId:{defaultValue:!1,describe:"Add an id to table headers",type:"boolean"},ghCodeBlocks:{defaultValue:!0,describe:"Turn on/off GFM fenced code blocks support",type:"boolean"},tasklists:{defaultValue:!1,describe:"Turn on/off GFM tasklist support",type:"boolean"},smoothLivePreview:{defaultValue:!1,describe:"Prevents weird effects in live previews due to incomplete input",type:"boolean"},smartIndentationFix:{defaultValue:!1,describe:"Tries to smartly fix indentation in es6 strings",type:"boolean"},disableForced4SpacesIndentedSublists:{defaultValue:!1,describe:"Disables the requirement of indenting nested sublists by 4 spaces",type:"boolean"},simpleLineBreaks:{defaultValue:!1,describe:"Parses simple line breaks as
(GFM Style)",type:"boolean"},requireSpaceBeforeHeadingText:{defaultValue:!1,describe:"Makes adding a space between `#` and the header text mandatory (GFM Style)",type:"boolean"},ghMentions:{defaultValue:!1,describe:"Enables github @mentions",type:"boolean"},ghMentionsLink:{defaultValue:"https://github.com/{u}",describe:"Changes the link generated by @mentions. Only applies if ghMentions option is enabled.",type:"string"},encodeEmails:{defaultValue:!0,describe:"Encode e-mail addresses through the use of Character Entities, transforming ASCII e-mail addresses into its equivalent decimal entities",type:"boolean"},openLinksInNewWindow:{defaultValue:!1,describe:"Open all links in new windows",type:"boolean"},backslashEscapesHTMLTags:{defaultValue:!1,describe:"Support for HTML Tag escaping. ex:
foo
",type:"boolean"},emoji:{defaultValue:!1,describe:"Enable emoji support. Ex: `this is a :smile: emoji`",type:"boolean"},underline:{defaultValue:!1,describe:"Enable support for underline. Syntax is double or triple underscores: `__underline word__`. With this option enabled, underscores no longer parses into `` and ``",type:"boolean"},ellipsis:{defaultValue:!0,describe:"Replaces three dots with the ellipsis unicode character",type:"boolean"},completeHTMLDocument:{defaultValue:!1,describe:"Outputs a complete html document, including ``, `` and `` tags",type:"boolean"},metadata:{defaultValue:!1,describe:"Enable support for document metadata (defined at the top of the document between `«««` and `»»»` or between `---` and `---`).",type:"boolean"},splitAdjacentBlockquotes:{defaultValue:!1,describe:"Split adjacent blockquote blocks",type:"boolean"}};if(f===!1)return JSON.parse(JSON.stringify(D));var N={};for(var B in D)D.hasOwnProperty(B)&&(N[B]=D[B].defaultValue);return N}function r(){var f=e(!0),D={};for(var N in f)f.hasOwnProperty(N)&&(D[N]=!0);return D}var n={},s={},o={},l=e(!0),c="vanilla",u={github:{omitExtraWLInCodeBlocks:!0,simplifiedAutoLink:!0,excludeTrailingPunctuationFromURLs:!0,literalMidWordUnderscores:!0,strikethrough:!0,tables:!0,tablesHeaderId:!0,ghCodeBlocks:!0,tasklists:!0,disableForced4SpacesIndentedSublists:!0,simpleLineBreaks:!0,requireSpaceBeforeHeadingText:!0,ghCompatibleHeaderId:!0,ghMentions:!0,backslashEscapesHTMLTags:!0,emoji:!0,splitAdjacentBlockquotes:!0},original:{noHeaderId:!0,ghCodeBlocks:!1},ghost:{omitExtraWLInCodeBlocks:!0,parseImgDimensions:!0,simplifiedAutoLink:!0,excludeTrailingPunctuationFromURLs:!0,literalMidWordUnderscores:!0,strikethrough:!0,tables:!0,tablesHeaderId:!0,ghCodeBlocks:!0,tasklists:!0,smoothLivePreview:!0,simpleLineBreaks:!0,requireSpaceBeforeHeadingText:!0,ghMentions:!1,encodeEmails:!0},vanilla:e(!0),allOn:r()};n.helper={},n.extensions={},n.setOption=function(f,D){return l[f]=D,this},n.getOption=function(f){return l[f]},n.getOptions=function(){return l},n.resetOptions=function(){l=e(!0)},n.setFlavor=function(f){if(!u.hasOwnProperty(f))throw Error(f+" flavor was not found");n.resetOptions();var D=u[f];c=f;for(var N in D)D.hasOwnProperty(N)&&(l[N]=D[N])},n.getFlavor=function(){return c},n.getFlavorOptions=function(f){if(u.hasOwnProperty(f))return u[f]},n.getDefaultOptions=function(f){return e(f)},n.subParser=function(f,D){if(n.helper.isString(f))if(typeof D<"u")s[f]=D;else{if(s.hasOwnProperty(f))return s[f];throw Error("SubParser named "+f+" not registered!")}},n.extension=function(f,D){if(!n.helper.isString(f))throw Error("Extension 'name' must be a string");if(f=n.helper.stdExtName(f),n.helper.isUndefined(D)){if(!o.hasOwnProperty(f))throw Error("Extension named "+f+" is not registered!");return o[f]}else{typeof D=="function"&&(D=D()),n.helper.isArray(D)||(D=[D]);var N=p(D,f);if(N.valid)o[f]=D;else throw Error(N.error)}},n.getAllExtensions=function(){return o},n.removeExtension=function(f){delete o[f]},n.resetExtensions=function(){o={}};function p(f,D){var N=D?"Error in "+D+" extension->":"Error in unnamed extension",B={valid:!0,error:""};n.helper.isArray(f)||(f=[f]);for(var z=0;z"u"},n.helper.forEach=function(f,D){if(n.helper.isUndefined(f))throw new Error("obj param is required");if(n.helper.isUndefined(D))throw new Error("callback param is required");if(!n.helper.isFunction(D))throw new Error("callback param must be a function/closure");if(typeof f.forEach=="function")f.forEach(D);else if(n.helper.isArray(f))for(var N=0;N").replace(/&/g,"&")};var g=function(f,D,N,B){var z=B||"",se=z.indexOf("g")>-1,W=new RegExp(D+"|"+N,"g"+z.replace(/g/g,"")),Se=new RegExp(D,z.replace(/g/g,"")),We=[],Qe,Fe,Ue,Z,ve;do for(Qe=0;Ue=W.exec(f);)if(Se.test(Ue[0]))Qe++||(Fe=W.lastIndex,Z=Fe-Ue[0].length);else if(Qe&&!--Qe){ve=Ue.index+Ue[0].length;var Me={left:{start:Z,end:Fe},match:{start:Fe,end:Ue.index},right:{start:Ue.index,end:ve},wholeMatch:{start:Z,end:ve}};if(We.push(Me),!se)return We}while(Qe&&(W.lastIndex=Fe));return We};n.helper.matchRecursiveRegExp=function(f,D,N,B){for(var z=g(f,D,N,B),se=[],W=0;W0){var Qe=[];W[0].wholeMatch.start!==0&&Qe.push(f.slice(0,W[0].wholeMatch.start));for(var Fe=0;Fe=0?B+(N||0):B},n.helper.splitAtIndex=function(f,D){if(!n.helper.isString(f))throw"InvalidArgumentError: first parameter of showdown.helper.regexIndexOf function must be a string";return[f.substring(0,D),f.substring(D)]},n.helper.encodeEmailAddress=function(f){var D=[function(N){return"&#"+N.charCodeAt(0)+";"},function(N){return"&#x"+N.charCodeAt(0).toString(16)+";"},function(N){return N}];return f=f.replace(/./g,function(N){if(N==="@")N=D[Math.floor(Math.random()*2)](N);else{var B=Math.random();N=B>.9?D[2](N):B>.45?D[1](N):D[0](N)}return N}),f},n.helper.padEnd=function(D,N,B){return N=N>>0,B=String(B||" "),D.length>N?String(D):(N=N-D.length,N>B.length&&(B+=B.repeat(N/B.length)),String(D)+B.slice(0,N))},typeof console>"u"&&(console={warn:function(f){alert(f)},log:function(f){alert(f)},error:function(f){throw f}}),n.helper.regexes={asteriskDashAndColon:/([*_:~])/g},n.helper.emojis={"+1":"👍","-1":"👎",100:"💯",1234:"🔢","1st_place_medal":"🥇","2nd_place_medal":"🥈","3rd_place_medal":"🥉","8ball":"🎱",a:"🅰️",ab:"🆎",abc:"🔤",abcd:"🔡",accept:"🉑",aerial_tramway:"🚡",airplane:"✈️",alarm_clock:"⏰",alembic:"⚗️",alien:"👽",ambulance:"🚑",amphora:"🏺",anchor:"⚓️",angel:"👼",anger:"💢",angry:"😠",anguished:"😧",ant:"🐜",apple:"🍎",aquarius:"♒️",aries:"♈️",arrow_backward:"◀️",arrow_double_down:"⏬",arrow_double_up:"⏫",arrow_down:"⬇️",arrow_down_small:"🔽",arrow_forward:"▶️",arrow_heading_down:"⤵️",arrow_heading_up:"⤴️",arrow_left:"⬅️",arrow_lower_left:"↙️",arrow_lower_right:"↘️",arrow_right:"➡️",arrow_right_hook:"↪️",arrow_up:"⬆️",arrow_up_down:"↕️",arrow_up_small:"🔼",arrow_upper_left:"↖️",arrow_upper_right:"↗️",arrows_clockwise:"🔃",arrows_counterclockwise:"🔄",art:"🎨",articulated_lorry:"🚛",artificial_satellite:"🛰",astonished:"😲",athletic_shoe:"👟",atm:"🏧",atom_symbol:"⚛️",avocado:"🥑",b:"🅱️",baby:"👶",baby_bottle:"🍼",baby_chick:"🐤",baby_symbol:"🚼",back:"🔙",bacon:"🥓",badminton:"🏸",baggage_claim:"🛄",baguette_bread:"🥖",balance_scale:"⚖️",balloon:"🎈",ballot_box:"🗳",ballot_box_with_check:"☑️",bamboo:"🎍",banana:"🍌",bangbang:"‼️",bank:"🏦",bar_chart:"📊",barber:"💈",baseball:"⚾️",basketball:"🏀",basketball_man:"⛹️",basketball_woman:"⛹️‍♀️",bat:"🦇",bath:"🛀",bathtub:"🛁",battery:"🔋",beach_umbrella:"🏖",bear:"🐻",bed:"🛏",bee:"🐝",beer:"🍺",beers:"🍻",beetle:"🐞",beginner:"🔰",bell:"🔔",bellhop_bell:"🛎",bento:"🍱",biking_man:"🚴",bike:"🚲",biking_woman:"🚴‍♀️",bikini:"👙",biohazard:"☣️",bird:"🐦",birthday:"🎂",black_circle:"⚫️",black_flag:"🏴",black_heart:"🖤",black_joker:"🃏",black_large_square:"⬛️",black_medium_small_square:"◾️",black_medium_square:"◼️",black_nib:"✒️",black_small_square:"▪️",black_square_button:"🔲",blonde_man:"👱",blonde_woman:"👱‍♀️",blossom:"🌼",blowfish:"🐡",blue_book:"📘",blue_car:"🚙",blue_heart:"💙",blush:"😊",boar:"🐗",boat:"⛵️",bomb:"💣",book:"📖",bookmark:"🔖",bookmark_tabs:"📑",books:"📚",boom:"💥",boot:"👢",bouquet:"💐",bowing_man:"🙇",bow_and_arrow:"🏹",bowing_woman:"🙇‍♀️",bowling:"🎳",boxing_glove:"🥊",boy:"👦",bread:"🍞",bride_with_veil:"👰",bridge_at_night:"🌉",briefcase:"💼",broken_heart:"💔",bug:"🐛",building_construction:"🏗",bulb:"💡",bullettrain_front:"🚅",bullettrain_side:"🚄",burrito:"🌯",bus:"🚌",business_suit_levitating:"🕴",busstop:"🚏",bust_in_silhouette:"👤",busts_in_silhouette:"👥",butterfly:"🦋",cactus:"🌵",cake:"🍰",calendar:"📆",call_me_hand:"🤙",calling:"📲",camel:"🐫",camera:"📷",camera_flash:"📸",camping:"🏕",cancer:"♋️",candle:"🕯",candy:"🍬",canoe:"🛶",capital_abcd:"🔠",capricorn:"♑️",car:"🚗",card_file_box:"🗃",card_index:"📇",card_index_dividers:"🗂",carousel_horse:"🎠",carrot:"🥕",cat:"🐱",cat2:"🐈",cd:"💿",chains:"⛓",champagne:"🍾",chart:"💹",chart_with_downwards_trend:"📉",chart_with_upwards_trend:"📈",checkered_flag:"🏁",cheese:"🧀",cherries:"🍒",cherry_blossom:"🌸",chestnut:"🌰",chicken:"🐔",children_crossing:"🚸",chipmunk:"🐿",chocolate_bar:"🍫",christmas_tree:"🎄",church:"⛪️",cinema:"🎦",circus_tent:"🎪",city_sunrise:"🌇",city_sunset:"🌆",cityscape:"🏙",cl:"🆑",clamp:"🗜",clap:"👏",clapper:"🎬",classical_building:"🏛",clinking_glasses:"🥂",clipboard:"📋",clock1:"🕐",clock10:"🕙",clock1030:"🕥",clock11:"🕚",clock1130:"🕦",clock12:"🕛",clock1230:"🕧",clock130:"🕜",clock2:"🕑",clock230:"🕝",clock3:"🕒",clock330:"🕞",clock4:"🕓",clock430:"🕟",clock5:"🕔",clock530:"🕠",clock6:"🕕",clock630:"🕡",clock7:"🕖",clock730:"🕢",clock8:"🕗",clock830:"🕣",clock9:"🕘",clock930:"🕤",closed_book:"📕",closed_lock_with_key:"🔐",closed_umbrella:"🌂",cloud:"☁️",cloud_with_lightning:"🌩",cloud_with_lightning_and_rain:"⛈",cloud_with_rain:"🌧",cloud_with_snow:"🌨",clown_face:"🤡",clubs:"♣️",cocktail:"🍸",coffee:"☕️",coffin:"⚰️",cold_sweat:"😰",comet:"☄️",computer:"💻",computer_mouse:"🖱",confetti_ball:"🎊",confounded:"😖",confused:"😕",congratulations:"㊗️",construction:"🚧",construction_worker_man:"👷",construction_worker_woman:"👷‍♀️",control_knobs:"🎛",convenience_store:"🏪",cookie:"🍪",cool:"🆒",policeman:"👮",copyright:"©️",corn:"🌽",couch_and_lamp:"🛋",couple:"👫",couple_with_heart_woman_man:"💑",couple_with_heart_man_man:"👨‍❤️‍👨",couple_with_heart_woman_woman:"👩‍❤️‍👩",couplekiss_man_man:"👨‍❤️‍💋‍👨",couplekiss_man_woman:"💏",couplekiss_woman_woman:"👩‍❤️‍💋‍👩",cow:"🐮",cow2:"🐄",cowboy_hat_face:"🤠",crab:"🦀",crayon:"🖍",credit_card:"💳",crescent_moon:"🌙",cricket:"🏏",crocodile:"🐊",croissant:"🥐",crossed_fingers:"🤞",crossed_flags:"🎌",crossed_swords:"⚔️",crown:"👑",cry:"😢",crying_cat_face:"😿",crystal_ball:"🔮",cucumber:"🥒",cupid:"💘",curly_loop:"➰",currency_exchange:"💱",curry:"🍛",custard:"🍮",customs:"🛃",cyclone:"🌀",dagger:"🗡",dancer:"💃",dancing_women:"👯",dancing_men:"👯‍♂️",dango:"🍡",dark_sunglasses:"🕶",dart:"🎯",dash:"💨",date:"📅",deciduous_tree:"🌳",deer:"🦌",department_store:"🏬",derelict_house:"🏚",desert:"🏜",desert_island:"🏝",desktop_computer:"🖥",male_detective:"🕵️",diamond_shape_with_a_dot_inside:"💠",diamonds:"♦️",disappointed:"😞",disappointed_relieved:"😥",dizzy:"💫",dizzy_face:"😵",do_not_litter:"🚯",dog:"🐶",dog2:"🐕",dollar:"💵",dolls:"🎎",dolphin:"🐬",door:"🚪",doughnut:"🍩",dove:"🕊",dragon:"🐉",dragon_face:"🐲",dress:"👗",dromedary_camel:"🐪",drooling_face:"🤤",droplet:"💧",drum:"🥁",duck:"🦆",dvd:"📀","e-mail":"📧",eagle:"🦅",ear:"👂",ear_of_rice:"🌾",earth_africa:"🌍",earth_americas:"🌎",earth_asia:"🌏",egg:"🥚",eggplant:"🍆",eight_pointed_black_star:"✴️",eight_spoked_asterisk:"✳️",electric_plug:"🔌",elephant:"🐘",email:"✉️",end:"🔚",envelope_with_arrow:"📩",euro:"💶",european_castle:"🏰",european_post_office:"🏤",evergreen_tree:"🌲",exclamation:"❗️",expressionless:"😑",eye:"👁",eye_speech_bubble:"👁‍🗨",eyeglasses:"👓",eyes:"👀",face_with_head_bandage:"🤕",face_with_thermometer:"🤒",fist_oncoming:"👊",factory:"🏭",fallen_leaf:"🍂",family_man_woman_boy:"👪",family_man_boy:"👨‍👦",family_man_boy_boy:"👨‍👦‍👦",family_man_girl:"👨‍👧",family_man_girl_boy:"👨‍👧‍👦",family_man_girl_girl:"👨‍👧‍👧",family_man_man_boy:"👨‍👨‍👦",family_man_man_boy_boy:"👨‍👨‍👦‍👦",family_man_man_girl:"👨‍👨‍👧",family_man_man_girl_boy:"👨‍👨‍👧‍👦",family_man_man_girl_girl:"👨‍👨‍👧‍👧",family_man_woman_boy_boy:"👨‍👩‍👦‍👦",family_man_woman_girl:"👨‍👩‍👧",family_man_woman_girl_boy:"👨‍👩‍👧‍👦",family_man_woman_girl_girl:"👨‍👩‍👧‍👧",family_woman_boy:"👩‍👦",family_woman_boy_boy:"👩‍👦‍👦",family_woman_girl:"👩‍👧",family_woman_girl_boy:"👩‍👧‍👦",family_woman_girl_girl:"👩‍👧‍👧",family_woman_woman_boy:"👩‍👩‍👦",family_woman_woman_boy_boy:"👩‍👩‍👦‍👦",family_woman_woman_girl:"👩‍👩‍👧",family_woman_woman_girl_boy:"👩‍👩‍👧‍👦",family_woman_woman_girl_girl:"👩‍👩‍👧‍👧",fast_forward:"⏩",fax:"📠",fearful:"😨",feet:"🐾",female_detective:"🕵️‍♀️",ferris_wheel:"🎡",ferry:"⛴",field_hockey:"🏑",file_cabinet:"🗄",file_folder:"📁",film_projector:"📽",film_strip:"🎞",fire:"🔥",fire_engine:"🚒",fireworks:"🎆",first_quarter_moon:"🌓",first_quarter_moon_with_face:"🌛",fish:"🐟",fish_cake:"🍥",fishing_pole_and_fish:"🎣",fist_raised:"✊",fist_left:"🤛",fist_right:"🤜",flags:"🎏",flashlight:"🔦",fleur_de_lis:"⚜️",flight_arrival:"🛬",flight_departure:"🛫",floppy_disk:"💾",flower_playing_cards:"🎴",flushed:"😳",fog:"🌫",foggy:"🌁",football:"🏈",footprints:"👣",fork_and_knife:"🍴",fountain:"⛲️",fountain_pen:"🖋",four_leaf_clover:"🍀",fox_face:"🦊",framed_picture:"🖼",free:"🆓",fried_egg:"🍳",fried_shrimp:"🍤",fries:"🍟",frog:"🐸",frowning:"😦",frowning_face:"☹️",frowning_man:"🙍‍♂️",frowning_woman:"🙍",middle_finger:"🖕",fuelpump:"⛽️",full_moon:"🌕",full_moon_with_face:"🌝",funeral_urn:"⚱️",game_die:"🎲",gear:"⚙️",gem:"💎",gemini:"♊️",ghost:"👻",gift:"🎁",gift_heart:"💝",girl:"👧",globe_with_meridians:"🌐",goal_net:"🥅",goat:"🐐",golf:"⛳️",golfing_man:"🏌️",golfing_woman:"🏌️‍♀️",gorilla:"🦍",grapes:"🍇",green_apple:"🍏",green_book:"📗",green_heart:"💚",green_salad:"🥗",grey_exclamation:"❕",grey_question:"❔",grimacing:"😬",grin:"😁",grinning:"😀",guardsman:"💂",guardswoman:"💂‍♀️",guitar:"🎸",gun:"🔫",haircut_woman:"💇",haircut_man:"💇‍♂️",hamburger:"🍔",hammer:"🔨",hammer_and_pick:"⚒",hammer_and_wrench:"🛠",hamster:"🐹",hand:"✋",handbag:"👜",handshake:"🤝",hankey:"💩",hatched_chick:"🐥",hatching_chick:"🐣",headphones:"🎧",hear_no_evil:"🙉",heart:"❤️",heart_decoration:"💟",heart_eyes:"😍",heart_eyes_cat:"😻",heartbeat:"💓",heartpulse:"💗",hearts:"♥️",heavy_check_mark:"✔️",heavy_division_sign:"➗",heavy_dollar_sign:"💲",heavy_heart_exclamation:"❣️",heavy_minus_sign:"➖",heavy_multiplication_x:"✖️",heavy_plus_sign:"➕",helicopter:"🚁",herb:"🌿",hibiscus:"🌺",high_brightness:"🔆",high_heel:"👠",hocho:"🔪",hole:"🕳",honey_pot:"🍯",horse:"🐴",horse_racing:"🏇",hospital:"🏥",hot_pepper:"🌶",hotdog:"🌭",hotel:"🏨",hotsprings:"♨️",hourglass:"⌛️",hourglass_flowing_sand:"⏳",house:"🏠",house_with_garden:"🏡",houses:"🏘",hugs:"🤗",hushed:"😯",ice_cream:"🍨",ice_hockey:"🏒",ice_skate:"⛸",icecream:"🍦",id:"🆔",ideograph_advantage:"🉐",imp:"👿",inbox_tray:"📥",incoming_envelope:"📨",tipping_hand_woman:"💁",information_source:"ℹ️",innocent:"😇",interrobang:"⁉️",iphone:"📱",izakaya_lantern:"🏮",jack_o_lantern:"🎃",japan:"🗾",japanese_castle:"🏯",japanese_goblin:"👺",japanese_ogre:"👹",jeans:"👖",joy:"😂",joy_cat:"😹",joystick:"🕹",kaaba:"🕋",key:"🔑",keyboard:"⌨️",keycap_ten:"🔟",kick_scooter:"🛴",kimono:"👘",kiss:"💋",kissing:"😗",kissing_cat:"😽",kissing_closed_eyes:"😚",kissing_heart:"😘",kissing_smiling_eyes:"😙",kiwi_fruit:"🥝",koala:"🐨",koko:"🈁",label:"🏷",large_blue_circle:"🔵",large_blue_diamond:"🔷",large_orange_diamond:"🔶",last_quarter_moon:"🌗",last_quarter_moon_with_face:"🌜",latin_cross:"✝️",laughing:"😆",leaves:"🍃",ledger:"📒",left_luggage:"🛅",left_right_arrow:"↔️",leftwards_arrow_with_hook:"↩️",lemon:"🍋",leo:"♌️",leopard:"🐆",level_slider:"🎚",libra:"♎️",light_rail:"🚈",link:"🔗",lion:"🦁",lips:"👄",lipstick:"💄",lizard:"🦎",lock:"🔒",lock_with_ink_pen:"🔏",lollipop:"🍭",loop:"➿",loud_sound:"🔊",loudspeaker:"📢",love_hotel:"🏩",love_letter:"💌",low_brightness:"🔅",lying_face:"🤥",m:"Ⓜ️",mag:"🔍",mag_right:"🔎",mahjong:"🀄️",mailbox:"📫",mailbox_closed:"📪",mailbox_with_mail:"📬",mailbox_with_no_mail:"📭",man:"👨",man_artist:"👨‍🎨",man_astronaut:"👨‍🚀",man_cartwheeling:"🤸‍♂️",man_cook:"👨‍🍳",man_dancing:"🕺",man_facepalming:"🤦‍♂️",man_factory_worker:"👨‍🏭",man_farmer:"👨‍🌾",man_firefighter:"👨‍🚒",man_health_worker:"👨‍⚕️",man_in_tuxedo:"🤵",man_judge:"👨‍⚖️",man_juggling:"🤹‍♂️",man_mechanic:"👨‍🔧",man_office_worker:"👨‍💼",man_pilot:"👨‍✈️",man_playing_handball:"🤾‍♂️",man_playing_water_polo:"🤽‍♂️",man_scientist:"👨‍🔬",man_shrugging:"🤷‍♂️",man_singer:"👨‍🎤",man_student:"👨‍🎓",man_teacher:"👨‍🏫",man_technologist:"👨‍💻",man_with_gua_pi_mao:"👲",man_with_turban:"👳",tangerine:"🍊",mans_shoe:"👞",mantelpiece_clock:"🕰",maple_leaf:"🍁",martial_arts_uniform:"🥋",mask:"😷",massage_woman:"💆",massage_man:"💆‍♂️",meat_on_bone:"🍖",medal_military:"🎖",medal_sports:"🏅",mega:"📣",melon:"🍈",memo:"📝",men_wrestling:"🤼‍♂️",menorah:"🕎",mens:"🚹",metal:"🤘",metro:"🚇",microphone:"🎤",microscope:"🔬",milk_glass:"🥛",milky_way:"🌌",minibus:"🚐",minidisc:"💽",mobile_phone_off:"📴",money_mouth_face:"🤑",money_with_wings:"💸",moneybag:"💰",monkey:"🐒",monkey_face:"🐵",monorail:"🚝",moon:"🌔",mortar_board:"🎓",mosque:"🕌",motor_boat:"🛥",motor_scooter:"🛵",motorcycle:"🏍",motorway:"🛣",mount_fuji:"🗻",mountain:"⛰",mountain_biking_man:"🚵",mountain_biking_woman:"🚵‍♀️",mountain_cableway:"🚠",mountain_railway:"🚞",mountain_snow:"🏔",mouse:"🐭",mouse2:"🐁",movie_camera:"🎥",moyai:"🗿",mrs_claus:"🤶",muscle:"💪",mushroom:"🍄",musical_keyboard:"🎹",musical_note:"🎵",musical_score:"🎼",mute:"🔇",nail_care:"💅",name_badge:"📛",national_park:"🏞",nauseated_face:"🤢",necktie:"👔",negative_squared_cross_mark:"❎",nerd_face:"🤓",neutral_face:"😐",new:"🆕",new_moon:"🌑",new_moon_with_face:"🌚",newspaper:"📰",newspaper_roll:"🗞",next_track_button:"⏭",ng:"🆖",no_good_man:"🙅‍♂️",no_good_woman:"🙅",night_with_stars:"🌃",no_bell:"🔕",no_bicycles:"🚳",no_entry:"⛔️",no_entry_sign:"🚫",no_mobile_phones:"📵",no_mouth:"😶",no_pedestrians:"🚷",no_smoking:"🚭","non-potable_water":"🚱",nose:"👃",notebook:"📓",notebook_with_decorative_cover:"📔",notes:"🎶",nut_and_bolt:"🔩",o:"⭕️",o2:"🅾️",ocean:"🌊",octopus:"🐙",oden:"🍢",office:"🏢",oil_drum:"🛢",ok:"🆗",ok_hand:"👌",ok_man:"🙆‍♂️",ok_woman:"🙆",old_key:"🗝",older_man:"👴",older_woman:"👵",om:"🕉",on:"🔛",oncoming_automobile:"🚘",oncoming_bus:"🚍",oncoming_police_car:"🚔",oncoming_taxi:"🚖",open_file_folder:"📂",open_hands:"👐",open_mouth:"😮",open_umbrella:"☂️",ophiuchus:"⛎",orange_book:"📙",orthodox_cross:"☦️",outbox_tray:"📤",owl:"🦉",ox:"🐂",package:"📦",page_facing_up:"📄",page_with_curl:"📃",pager:"📟",paintbrush:"🖌",palm_tree:"🌴",pancakes:"🥞",panda_face:"🐼",paperclip:"📎",paperclips:"🖇",parasol_on_ground:"⛱",parking:"🅿️",part_alternation_mark:"〽️",partly_sunny:"⛅️",passenger_ship:"🛳",passport_control:"🛂",pause_button:"⏸",peace_symbol:"☮️",peach:"🍑",peanuts:"🥜",pear:"🍐",pen:"🖊",pencil2:"✏️",penguin:"🐧",pensive:"😔",performing_arts:"🎭",persevere:"😣",person_fencing:"🤺",pouting_woman:"🙎",phone:"☎️",pick:"⛏",pig:"🐷",pig2:"🐖",pig_nose:"🐽",pill:"💊",pineapple:"🍍",ping_pong:"🏓",pisces:"♓️",pizza:"🍕",place_of_worship:"🛐",plate_with_cutlery:"🍽",play_or_pause_button:"⏯",point_down:"👇",point_left:"👈",point_right:"👉",point_up:"☝️",point_up_2:"👆",police_car:"🚓",policewoman:"👮‍♀️",poodle:"🐩",popcorn:"🍿",post_office:"🏣",postal_horn:"📯",postbox:"📮",potable_water:"🚰",potato:"🥔",pouch:"👝",poultry_leg:"🍗",pound:"💷",rage:"😡",pouting_cat:"😾",pouting_man:"🙎‍♂️",pray:"🙏",prayer_beads:"📿",pregnant_woman:"🤰",previous_track_button:"⏮",prince:"🤴",princess:"👸",printer:"🖨",purple_heart:"💜",purse:"👛",pushpin:"📌",put_litter_in_its_place:"🚮",question:"❓",rabbit:"🐰",rabbit2:"🐇",racehorse:"🐎",racing_car:"🏎",radio:"📻",radio_button:"🔘",radioactive:"☢️",railway_car:"🚃",railway_track:"🛤",rainbow:"🌈",rainbow_flag:"🏳️‍🌈",raised_back_of_hand:"🤚",raised_hand_with_fingers_splayed:"🖐",raised_hands:"🙌",raising_hand_woman:"🙋",raising_hand_man:"🙋‍♂️",ram:"🐏",ramen:"🍜",rat:"🐀",record_button:"⏺",recycle:"♻️",red_circle:"🔴",registered:"®️",relaxed:"☺️",relieved:"😌",reminder_ribbon:"🎗",repeat:"🔁",repeat_one:"🔂",rescue_worker_helmet:"⛑",restroom:"🚻",revolving_hearts:"💞",rewind:"⏪",rhinoceros:"🦏",ribbon:"🎀",rice:"🍚",rice_ball:"🍙",rice_cracker:"🍘",rice_scene:"🎑",right_anger_bubble:"🗯",ring:"💍",robot:"🤖",rocket:"🚀",rofl:"🤣",roll_eyes:"🙄",roller_coaster:"🎢",rooster:"🐓",rose:"🌹",rosette:"🏵",rotating_light:"🚨",round_pushpin:"📍",rowing_man:"🚣",rowing_woman:"🚣‍♀️",rugby_football:"🏉",running_man:"🏃",running_shirt_with_sash:"🎽",running_woman:"🏃‍♀️",sa:"🈂️",sagittarius:"♐️",sake:"🍶",sandal:"👡",santa:"🎅",satellite:"📡",saxophone:"🎷",school:"🏫",school_satchel:"🎒",scissors:"✂️",scorpion:"🦂",scorpius:"♏️",scream:"😱",scream_cat:"🙀",scroll:"📜",seat:"💺",secret:"㊙️",see_no_evil:"🙈",seedling:"🌱",selfie:"🤳",shallow_pan_of_food:"🥘",shamrock:"☘️",shark:"🦈",shaved_ice:"🍧",sheep:"🐑",shell:"🐚",shield:"🛡",shinto_shrine:"⛩",ship:"🚢",shirt:"👕",shopping:"🛍",shopping_cart:"🛒",shower:"🚿",shrimp:"🦐",signal_strength:"📶",six_pointed_star:"🔯",ski:"🎿",skier:"⛷",skull:"💀",skull_and_crossbones:"☠️",sleeping:"😴",sleeping_bed:"🛌",sleepy:"😪",slightly_frowning_face:"🙁",slightly_smiling_face:"🙂",slot_machine:"🎰",small_airplane:"🛩",small_blue_diamond:"🔹",small_orange_diamond:"🔸",small_red_triangle:"🔺",small_red_triangle_down:"🔻",smile:"😄",smile_cat:"😸",smiley:"😃",smiley_cat:"😺",smiling_imp:"😈",smirk:"😏",smirk_cat:"😼",smoking:"🚬",snail:"🐌",snake:"🐍",sneezing_face:"🤧",snowboarder:"🏂",snowflake:"❄️",snowman:"⛄️",snowman_with_snow:"☃️",sob:"😭",soccer:"⚽️",soon:"🔜",sos:"🆘",sound:"🔉",space_invader:"👾",spades:"♠️",spaghetti:"🍝",sparkle:"❇️",sparkler:"🎇",sparkles:"✨",sparkling_heart:"💖",speak_no_evil:"🙊",speaker:"🔈",speaking_head:"🗣",speech_balloon:"💬",speedboat:"🚤",spider:"🕷",spider_web:"🕸",spiral_calendar:"🗓",spiral_notepad:"🗒",spoon:"🥄",squid:"🦑",stadium:"🏟",star:"⭐️",star2:"🌟",star_and_crescent:"☪️",star_of_david:"✡️",stars:"🌠",station:"🚉",statue_of_liberty:"🗽",steam_locomotive:"🚂",stew:"🍲",stop_button:"⏹",stop_sign:"🛑",stopwatch:"⏱",straight_ruler:"📏",strawberry:"🍓",stuck_out_tongue:"😛",stuck_out_tongue_closed_eyes:"😝",stuck_out_tongue_winking_eye:"😜",studio_microphone:"🎙",stuffed_flatbread:"🥙",sun_behind_large_cloud:"🌥",sun_behind_rain_cloud:"🌦",sun_behind_small_cloud:"🌤",sun_with_face:"🌞",sunflower:"🌻",sunglasses:"😎",sunny:"☀️",sunrise:"🌅",sunrise_over_mountains:"🌄",surfing_man:"🏄",surfing_woman:"🏄‍♀️",sushi:"🍣",suspension_railway:"🚟",sweat:"😓",sweat_drops:"💦",sweat_smile:"😅",sweet_potato:"🍠",swimming_man:"🏊",swimming_woman:"🏊‍♀️",symbols:"🔣",synagogue:"🕍",syringe:"💉",taco:"🌮",tada:"🎉",tanabata_tree:"🎋",taurus:"♉️",taxi:"🚕",tea:"🍵",telephone_receiver:"📞",telescope:"🔭",tennis:"🎾",tent:"⛺️",thermometer:"🌡",thinking:"🤔",thought_balloon:"💭",ticket:"🎫",tickets:"🎟",tiger:"🐯",tiger2:"🐅",timer_clock:"⏲",tipping_hand_man:"💁‍♂️",tired_face:"😫",tm:"™️",toilet:"🚽",tokyo_tower:"🗼",tomato:"🍅",tongue:"👅",top:"🔝",tophat:"🎩",tornado:"🌪",trackball:"🖲",tractor:"🚜",traffic_light:"🚥",train:"🚋",train2:"🚆",tram:"🚊",triangular_flag_on_post:"🚩",triangular_ruler:"📐",trident:"🔱",triumph:"😤",trolleybus:"🚎",trophy:"🏆",tropical_drink:"🍹",tropical_fish:"🐠",truck:"🚚",trumpet:"🎺",tulip:"🌷",tumbler_glass:"🥃",turkey:"🦃",turtle:"🐢",tv:"📺",twisted_rightwards_arrows:"🔀",two_hearts:"💕",two_men_holding_hands:"👬",two_women_holding_hands:"👭",u5272:"🈹",u5408:"🈴",u55b6:"🈺",u6307:"🈯️",u6708:"🈷️",u6709:"🈶",u6e80:"🈵",u7121:"🈚️",u7533:"🈸",u7981:"🈲",u7a7a:"🈳",umbrella:"☔️",unamused:"😒",underage:"🔞",unicorn:"🦄",unlock:"🔓",up:"🆙",upside_down_face:"🙃",v:"✌️",vertical_traffic_light:"🚦",vhs:"📼",vibration_mode:"📳",video_camera:"📹",video_game:"🎮",violin:"🎻",virgo:"♍️",volcano:"🌋",volleyball:"🏐",vs:"🆚",vulcan_salute:"🖖",walking_man:"🚶",walking_woman:"🚶‍♀️",waning_crescent_moon:"🌘",waning_gibbous_moon:"🌖",warning:"⚠️",wastebasket:"🗑",watch:"⌚️",water_buffalo:"🐃",watermelon:"🍉",wave:"👋",wavy_dash:"〰️",waxing_crescent_moon:"🌒",wc:"🚾",weary:"😩",wedding:"💒",weight_lifting_man:"🏋️",weight_lifting_woman:"🏋️‍♀️",whale:"🐳",whale2:"🐋",wheel_of_dharma:"☸️",wheelchair:"♿️",white_check_mark:"✅",white_circle:"⚪️",white_flag:"🏳️",white_flower:"💮",white_large_square:"⬜️",white_medium_small_square:"◽️",white_medium_square:"◻️",white_small_square:"▫️",white_square_button:"🔳",wilted_flower:"🥀",wind_chime:"🎐",wind_face:"🌬",wine_glass:"🍷",wink:"😉",wolf:"🐺",woman:"👩",woman_artist:"👩‍🎨",woman_astronaut:"👩‍🚀",woman_cartwheeling:"🤸‍♀️",woman_cook:"👩‍🍳",woman_facepalming:"🤦‍♀️",woman_factory_worker:"👩‍🏭",woman_farmer:"👩‍🌾",woman_firefighter:"👩‍🚒",woman_health_worker:"👩‍⚕️",woman_judge:"👩‍⚖️",woman_juggling:"🤹‍♀️",woman_mechanic:"👩‍🔧",woman_office_worker:"👩‍💼",woman_pilot:"👩‍✈️",woman_playing_handball:"🤾‍♀️",woman_playing_water_polo:"🤽‍♀️",woman_scientist:"👩‍🔬",woman_shrugging:"🤷‍♀️",woman_singer:"👩‍🎤",woman_student:"👩‍🎓",woman_teacher:"👩‍🏫",woman_technologist:"👩‍💻",woman_with_turban:"👳‍♀️",womans_clothes:"👚",womans_hat:"👒",women_wrestling:"🤼‍♀️",womens:"🚺",world_map:"🗺",worried:"😟",wrench:"🔧",writing_hand:"✍️",x:"❌",yellow_heart:"💛",yen:"💴",yin_yang:"☯️",yum:"😋",zap:"⚡️",zipper_mouth_face:"🤐",zzz:"💤",octocat:':octocat:',showdown:`S`},n.Converter=function(f){var D={},N=[],B=[],z={},se=c,W={parsed:{},raw:"",format:""};Se();function Se(){f=f||{};for(var Z in l)l.hasOwnProperty(Z)&&(D[Z]=l[Z]);if(typeof f=="object")for(var ve in f)f.hasOwnProperty(ve)&&(D[ve]=f[ve]);else throw Error("Converter expects the passed parameter to be an object, but "+typeof f+" was passed instead.");D.extensions&&n.helper.forEach(D.extensions,We)}function We(Z,ve){if(ve=ve||null,n.helper.isString(Z))if(Z=n.helper.stdExtName(Z),ve=Z,n.extensions[Z]){console.warn("DEPRECATION WARNING: "+Z+" is an old extension that uses a deprecated loading method.Please inform the developer that the extension should be updated!"),Qe(n.extensions[Z],Z);return}else if(!n.helper.isUndefined(o[Z]))Z=o[Z];else throw Error('Extension "'+Z+'" could not be loaded. It was either not found or is not a valid extension.');typeof Z=="function"&&(Z=Z()),n.helper.isArray(Z)||(Z=[Z]);var Me=p(Z,ve);if(!Me.valid)throw Error(Me.error);for(var Pe=0;Pe",!1),peg$e11=peg$literalExpectation("[",!1),peg$e12=peg$literalExpectation("+",!1),peg$e13=peg$literalExpectation("*",!1),peg$e14=peg$literalExpectation("%",!1),peg$e15=peg$literalExpectation("&",!1),peg$e16=peg$literalExpectation("|",!1),peg$e17=peg$literalExpectation("<<",!1),peg$e18=peg$literalExpectation(">>",!1),peg$f0=function(a){return centsToSemitones(a.filter(e=>e))},peg$f1=function(){},peg$f2=function(a,e){return Math.floor(Math.random()*(e-a+1)+a)},peg$f3=function(a,e){return Math.random()*(e-a)+a},peg$f4=function(){return parseFloat(text())},peg$f5=function(){return parseInt(text())},peg$f6=function(a){return ratioToCents(a)},peg$f7=function(a,e){return a/e},peg$f8=function(a,e){return Math.pow(2,a/e)},peg$f9=function(a,e,r,n){var s=n?r/n:r;return Math.pow(s,a/e)},peg$f10=function(a,e){return parseFloat(a.toString()+"."+e.toString())},peg$f11=function(a){return a.filter(e=>e)},peg$f12=function(a){return monzoToCents(a)},peg$f13=function(){return eval(text())},peg$currPos=0,peg$savedPos=0,peg$posDetailsCache=[{line:1,column:1}],peg$maxFailPos=0,peg$maxFailExpected=[],peg$resultsCache={},peg$result;if("startRule"in options){if(!(options.startRule in peg$startRuleFunctions))throw new Error(`Can't start parsing from rule "`+options.startRule+'".');peg$startRuleFunction=peg$startRuleFunctions[options.startRule]}function text(){return input.substring(peg$savedPos,peg$currPos)}function peg$literalExpectation(a,e){return{type:"literal",text:a,ignoreCase:e}}function peg$classExpectation(a,e,r){return{type:"class",parts:a,inverted:e,ignoreCase:r}}function peg$endExpectation(){return{type:"end"}}function peg$computePosDetails(a){var e=peg$posDetailsCache[a],r;if(e)return e;for(r=a-1;!peg$posDetailsCache[r];)r--;for(e=peg$posDetailsCache[r],e={line:e.line,column:e.column};rpeg$maxFailPos&&(peg$maxFailPos=peg$currPos,peg$maxFailExpected=[]),peg$maxFailExpected.push(a))}function peg$buildStructuredError(a,e,r){return new peg$SyntaxError(peg$SyntaxError.buildMessage(a,e),a,e,r)}function peg$parselines(){var a,e,r,n=peg$currPos*17+0,s=peg$resultsCache[n];if(s)return peg$currPos=s.nextPos,s.result;if(a=peg$currPos,e=[],r=peg$parseratio(),r===peg$FAILED&&(r=peg$parsevalue(),r===peg$FAILED&&(r=peg$parsemonzo(),r===peg$FAILED&&(r=peg$parseoperation(),r===peg$FAILED&&(r=peg$parsesep())))),r!==peg$FAILED)for(;r!==peg$FAILED;)e.push(r),r=peg$parseratio(),r===peg$FAILED&&(r=peg$parsevalue(),r===peg$FAILED&&(r=peg$parsemonzo(),r===peg$FAILED&&(r=peg$parseoperation(),r===peg$FAILED&&(r=peg$parsesep()))));else e=peg$FAILED;return e!==peg$FAILED&&(peg$savedPos=a,e=peg$f0(e)),a=e,peg$resultsCache[n]={nextPos:peg$currPos,result:a},a}function peg$parsesep(){var a,e,r=peg$currPos*17+1,n=peg$resultsCache[r];return n?(peg$currPos=n.nextPos,n.result):(a=peg$currPos,peg$r0.test(input.charAt(peg$currPos))?(e=input.charAt(peg$currPos),peg$currPos++):(e=peg$FAILED,peg$fail(peg$e0)),e!==peg$FAILED&&(peg$savedPos=a,e=peg$f1()),a=e,peg$resultsCache[r]={nextPos:peg$currPos,result:a},a)}function peg$parsevalue(){var a,e=peg$currPos*17+2,r=peg$resultsCache[e];return r?(peg$currPos=r.nextPos,r.result):(a=peg$parsefloat(),a===peg$FAILED&&(a=peg$parseint(),a===peg$FAILED&&(a=peg$parserandom_int(),a===peg$FAILED&&(a=peg$parserandom_float()))),peg$resultsCache[e]={nextPos:peg$currPos,result:a},a)}function peg$parserandom_int(){var a,e,r,n,s,o,l=peg$currPos*17+3,c=peg$resultsCache[l];return c?(peg$currPos=c.nextPos,c.result):(a=peg$currPos,input.charCodeAt(peg$currPos)===40?(e=peg$c0,peg$currPos++):(e=peg$FAILED,peg$fail(peg$e1)),e!==peg$FAILED?(r=peg$parseint(),r!==peg$FAILED?(input.charCodeAt(peg$currPos)===44?(n=peg$c1,peg$currPos++):(n=peg$FAILED,peg$fail(peg$e2)),n!==peg$FAILED?(s=peg$parseint(),s!==peg$FAILED?(input.charCodeAt(peg$currPos)===41?(o=peg$c2,peg$currPos++):(o=peg$FAILED,peg$fail(peg$e3)),o!==peg$FAILED?(peg$savedPos=a,a=peg$f2(r,s)):(peg$currPos=a,a=peg$FAILED)):(peg$currPos=a,a=peg$FAILED)):(peg$currPos=a,a=peg$FAILED)):(peg$currPos=a,a=peg$FAILED)):(peg$currPos=a,a=peg$FAILED),peg$resultsCache[l]={nextPos:peg$currPos,result:a},a)}function peg$parserandom_float(){var a,e,r,n,s,o,l=peg$currPos*17+4,c=peg$resultsCache[l];return c?(peg$currPos=c.nextPos,c.result):(a=peg$currPos,input.charCodeAt(peg$currPos)===40?(e=peg$c0,peg$currPos++):(e=peg$FAILED,peg$fail(peg$e1)),e!==peg$FAILED?(r=peg$parsefloat(),r!==peg$FAILED?(input.charCodeAt(peg$currPos)===44?(n=peg$c1,peg$currPos++):(n=peg$FAILED,peg$fail(peg$e2)),n!==peg$FAILED?(s=peg$parsefloat(),s!==peg$FAILED?(input.charCodeAt(peg$currPos)===41?(o=peg$c2,peg$currPos++):(o=peg$FAILED,peg$fail(peg$e3)),o!==peg$FAILED?(peg$savedPos=a,a=peg$f3(r,s)):(peg$currPos=a,a=peg$FAILED)):(peg$currPos=a,a=peg$FAILED)):(peg$currPos=a,a=peg$FAILED)):(peg$currPos=a,a=peg$FAILED)):(peg$currPos=a,a=peg$FAILED),peg$resultsCache[l]={nextPos:peg$currPos,result:a},a)}function peg$parsefloat(){var a,e,r,n,s,o,l,c=peg$currPos*17+5,u=peg$resultsCache[c];if(u)return peg$currPos=u.nextPos,u.result;if(a=peg$currPos,e=peg$currPos,r=[],peg$r1.test(input.charAt(peg$currPos))?(n=input.charAt(peg$currPos),peg$currPos++):(n=peg$FAILED,peg$fail(peg$e4)),n!==peg$FAILED)for(;n!==peg$FAILED;)r.push(n),peg$r1.test(input.charAt(peg$currPos))?(n=input.charAt(peg$currPos),peg$currPos++):(n=peg$FAILED,peg$fail(peg$e4));else r=peg$FAILED;if(r!==peg$FAILED?(input.charCodeAt(peg$currPos)===46?(n=peg$c3,peg$currPos++):(n=peg$FAILED,peg$fail(peg$e5)),n!==peg$FAILED?(r=[r,n],e=r):(peg$currPos=e,e=peg$FAILED)):(peg$currPos=e,e=peg$FAILED),e===peg$FAILED){for(e=peg$currPos,input.charCodeAt(peg$currPos)===45?(r=peg$c4,peg$currPos++):(r=peg$FAILED,peg$fail(peg$e6)),r===peg$FAILED&&(r=null),n=[],peg$r1.test(input.charAt(peg$currPos))?(s=input.charAt(peg$currPos),peg$currPos++):(s=peg$FAILED,peg$fail(peg$e4));s!==peg$FAILED;)n.push(s),peg$r1.test(input.charAt(peg$currPos))?(s=input.charAt(peg$currPos),peg$currPos++):(s=peg$FAILED,peg$fail(peg$e4));if(input.charCodeAt(peg$currPos)===46?(s=peg$c3,peg$currPos++):(s=peg$FAILED,peg$fail(peg$e5)),s!==peg$FAILED){if(o=[],peg$r1.test(input.charAt(peg$currPos))?(l=input.charAt(peg$currPos),peg$currPos++):(l=peg$FAILED,peg$fail(peg$e4)),l!==peg$FAILED)for(;l!==peg$FAILED;)o.push(l),peg$r1.test(input.charAt(peg$currPos))?(l=input.charAt(peg$currPos),peg$currPos++):(l=peg$FAILED,peg$fail(peg$e4));else o=peg$FAILED;o!==peg$FAILED?(r=[r,n,s,o],e=r):(peg$currPos=e,e=peg$FAILED)}else peg$currPos=e,e=peg$FAILED;if(e===peg$FAILED)if(e=peg$currPos,input.charCodeAt(peg$currPos)===46?(r=peg$c3,peg$currPos++):(r=peg$FAILED,peg$fail(peg$e5)),r!==peg$FAILED){if(n=[],peg$r1.test(input.charAt(peg$currPos))?(s=input.charAt(peg$currPos),peg$currPos++):(s=peg$FAILED,peg$fail(peg$e4)),s!==peg$FAILED)for(;s!==peg$FAILED;)n.push(s),peg$r1.test(input.charAt(peg$currPos))?(s=input.charAt(peg$currPos),peg$currPos++):(s=peg$FAILED,peg$fail(peg$e4));else n=peg$FAILED;n!==peg$FAILED?(r=[r,n],e=r):(peg$currPos=e,e=peg$FAILED)}else peg$currPos=e,e=peg$FAILED}return e!==peg$FAILED&&(peg$savedPos=a,e=peg$f4()),a=e,peg$resultsCache[c]={nextPos:peg$currPos,result:a},a}function peg$parseint(){var a,e,r,n=peg$currPos*17+6,s=peg$resultsCache[n];if(s)return peg$currPos=s.nextPos,s.result;if(a=peg$currPos,input.charCodeAt(peg$currPos)===45?peg$currPos++:peg$fail(peg$e6),e=[],peg$r1.test(input.charAt(peg$currPos))?(r=input.charAt(peg$currPos),peg$currPos++):(r=peg$FAILED,peg$fail(peg$e4)),r!==peg$FAILED)for(;r!==peg$FAILED;)e.push(r),peg$r1.test(input.charAt(peg$currPos))?(r=input.charAt(peg$currPos),peg$currPos++):(r=peg$FAILED,peg$fail(peg$e4));else e=peg$FAILED;return e!==peg$FAILED?(peg$savedPos=a,a=peg$f5()):(peg$currPos=a,a=peg$FAILED),peg$resultsCache[n]={nextPos:peg$currPos,result:a},a}function peg$parseratio(){var a,e,r=peg$currPos*17+7,n=peg$resultsCache[r];return n?(peg$currPos=n.nextPos,n.result):(a=peg$currPos,e=peg$parseedji_ratio(),e===peg$FAILED&&(e=peg$parseedo_ratio(),e===peg$FAILED&&(e=peg$parsefrac_ratio(),e===peg$FAILED&&(e=peg$parsedecimal_ratio()))),e!==peg$FAILED&&(peg$savedPos=a,e=peg$f6(e)),a=e,peg$resultsCache[r]={nextPos:peg$currPos,result:a},a)}function peg$parsefrac_ratio(){var a,e,r,n,s=peg$currPos*17+8,o=peg$resultsCache[s];return o?(peg$currPos=o.nextPos,o.result):(a=peg$currPos,e=peg$parseint(),e===peg$FAILED&&(e=peg$parserandom_int()),e!==peg$FAILED?(input.charCodeAt(peg$currPos)===47?(r=peg$c5,peg$currPos++):(r=peg$FAILED,peg$fail(peg$e7)),r!==peg$FAILED?(n=peg$parseint(),n===peg$FAILED&&(n=peg$parserandom_int()),n!==peg$FAILED?(peg$savedPos=a,a=peg$f7(e,n)):(peg$currPos=a,a=peg$FAILED)):(peg$currPos=a,a=peg$FAILED)):(peg$currPos=a,a=peg$FAILED),peg$resultsCache[s]={nextPos:peg$currPos,result:a},a)}function peg$parseedo_ratio(){var a,e,r,n,s=peg$currPos*17+9,o=peg$resultsCache[s];return o?(peg$currPos=o.nextPos,o.result):(a=peg$currPos,e=peg$parseint(),e===peg$FAILED&&(e=peg$parserandom_int()),e!==peg$FAILED?(input.charCodeAt(peg$currPos)===92?(r=peg$c6,peg$currPos++):(r=peg$FAILED,peg$fail(peg$e8)),r!==peg$FAILED?(n=peg$parseint(),n===peg$FAILED&&(n=peg$parserandom_int()),n!==peg$FAILED?(peg$savedPos=a,a=peg$f8(e,n)):(peg$currPos=a,a=peg$FAILED)):(peg$currPos=a,a=peg$FAILED)):(peg$currPos=a,a=peg$FAILED),peg$resultsCache[s]={nextPos:peg$currPos,result:a},a)}function peg$parseedji_ratio(){var a,e,r,n,s,o,l,c,u=peg$currPos*17+10,p=peg$resultsCache[u];return p?(peg$currPos=p.nextPos,p.result):(a=peg$currPos,e=peg$parseint(),e===peg$FAILED&&(e=peg$parserandom_int()),e!==peg$FAILED?(input.charCodeAt(peg$currPos)===92?(r=peg$c6,peg$currPos++):(r=peg$FAILED,peg$fail(peg$e8)),r!==peg$FAILED?(n=peg$parseint(),n===peg$FAILED&&(n=peg$parserandom_int()),n!==peg$FAILED?(input.charCodeAt(peg$currPos)===60?(s=peg$c7,peg$currPos++):(s=peg$FAILED,peg$fail(peg$e9)),s!==peg$FAILED?(o=peg$parseint(),o===peg$FAILED&&(o=peg$parserandom_int()),o!==peg$FAILED?(input.charCodeAt(peg$currPos)===47?peg$currPos++:peg$fail(peg$e7),l=peg$parseint(),l===peg$FAILED&&(l=peg$parserandom_int()),l===peg$FAILED&&(l=null),input.charCodeAt(peg$currPos)===62?(c=peg$c8,peg$currPos++):(c=peg$FAILED,peg$fail(peg$e10)),c!==peg$FAILED?(peg$savedPos=a,a=peg$f9(e,n,o,l)):(peg$currPos=a,a=peg$FAILED)):(peg$currPos=a,a=peg$FAILED)):(peg$currPos=a,a=peg$FAILED)):(peg$currPos=a,a=peg$FAILED)):(peg$currPos=a,a=peg$FAILED)):(peg$currPos=a,a=peg$FAILED),peg$resultsCache[u]={nextPos:peg$currPos,result:a},a)}function peg$parsedecimal_ratio(){var a,e,r,n,s=peg$currPos*17+11,o=peg$resultsCache[s];return o?(peg$currPos=o.nextPos,o.result):(a=peg$currPos,e=peg$parseint(),e!==peg$FAILED?(input.charCodeAt(peg$currPos)===44?(r=peg$c1,peg$currPos++):(r=peg$FAILED,peg$fail(peg$e2)),r!==peg$FAILED?(n=peg$parseint(),n!==peg$FAILED?(peg$savedPos=a,a=peg$f10(e,n)):(peg$currPos=a,a=peg$FAILED)):(peg$currPos=a,a=peg$FAILED)):(peg$currPos=a,a=peg$FAILED),peg$resultsCache[s]={nextPos:peg$currPos,result:a},a)}function peg$parseints(){var a,e,r,n=peg$currPos*17+12,s=peg$resultsCache[n];if(s)return peg$currPos=s.nextPos,s.result;if(a=peg$currPos,e=[],r=peg$parseint(),r===peg$FAILED&&(r=peg$parsesep()),r!==peg$FAILED)for(;r!==peg$FAILED;)e.push(r),r=peg$parseint(),r===peg$FAILED&&(r=peg$parsesep());else e=peg$FAILED;return e!==peg$FAILED&&(peg$savedPos=a,e=peg$f11(e)),a=e,peg$resultsCache[n]={nextPos:peg$currPos,result:a},a}function peg$parsemonzo(){var a,e,r,n,s=peg$currPos*17+13,o=peg$resultsCache[s];return o?(peg$currPos=o.nextPos,o.result):(a=peg$currPos,input.charCodeAt(peg$currPos)===91?(e=peg$c9,peg$currPos++):(e=peg$FAILED,peg$fail(peg$e11)),e!==peg$FAILED?(r=peg$parseints(),r!==peg$FAILED?(input.charCodeAt(peg$currPos)===62?(n=peg$c8,peg$currPos++):(n=peg$FAILED,peg$fail(peg$e10)),n!==peg$FAILED?(peg$savedPos=a,a=peg$f12(r)):(peg$currPos=a,a=peg$FAILED)):(peg$currPos=a,a=peg$FAILED)):(peg$currPos=a,a=peg$FAILED),peg$resultsCache[s]={nextPos:peg$currPos,result:a},a)}function peg$parseoperation(){var a,e,r,n,s,o,l,c=peg$currPos*17+14,u=peg$resultsCache[c];if(u)return peg$currPos=u.nextPos,u.result;if(a=peg$currPos,e=peg$parsevalue(),e===peg$FAILED&&(e=peg$parseratio(),e===peg$FAILED&&(e=peg$parsemonzo(),e===peg$FAILED)))for(e=[],r=peg$parsesep();r!==peg$FAILED;)e.push(r),r=peg$parsesep();if(e!==peg$FAILED){if(r=[],n=peg$currPos,s=peg$parseoperator(),s!==peg$FAILED){if(o=peg$parsevalue(),o===peg$FAILED&&(o=peg$parseratio(),o===peg$FAILED&&(o=peg$parsemonzo(),o===peg$FAILED&&(o=peg$parsesub_operations(),o===peg$FAILED&&(o=peg$parseoperation(),o===peg$FAILED)))))for(o=[],l=peg$parsesep();l!==peg$FAILED;)o.push(l),l=peg$parsesep();o!==peg$FAILED?(s=[s,o],n=s):(peg$currPos=n,n=peg$FAILED)}else peg$currPos=n,n=peg$FAILED;if(n!==peg$FAILED)for(;n!==peg$FAILED;)if(r.push(n),n=peg$currPos,s=peg$parseoperator(),s!==peg$FAILED){if(o=peg$parsevalue(),o===peg$FAILED&&(o=peg$parseratio(),o===peg$FAILED&&(o=peg$parsemonzo(),o===peg$FAILED&&(o=peg$parsesub_operations(),o===peg$FAILED&&(o=peg$parseoperation(),o===peg$FAILED)))))for(o=[],l=peg$parsesep();l!==peg$FAILED;)o.push(l),l=peg$parsesep();o!==peg$FAILED?(s=[s,o],n=s):(peg$currPos=n,n=peg$FAILED)}else peg$currPos=n,n=peg$FAILED;else r=peg$FAILED;r!==peg$FAILED?(peg$savedPos=a,a=peg$f13()):(peg$currPos=a,a=peg$FAILED)}else peg$currPos=a,a=peg$FAILED;return peg$resultsCache[c]={nextPos:peg$currPos,result:a},a}function peg$parseoperator(){var a,e=peg$currPos*17+15,r=peg$resultsCache[e];return r?(peg$currPos=r.nextPos,r.result):(input.charCodeAt(peg$currPos)===43?(a=peg$c10,peg$currPos++):(a=peg$FAILED,peg$fail(peg$e12)),a===peg$FAILED&&(input.charCodeAt(peg$currPos)===45?(a=peg$c4,peg$currPos++):(a=peg$FAILED,peg$fail(peg$e6)),a===peg$FAILED&&(input.charCodeAt(peg$currPos)===42?(a=peg$c11,peg$currPos++):(a=peg$FAILED,peg$fail(peg$e13)),a===peg$FAILED&&(input.charCodeAt(peg$currPos)===37?(a=peg$c12,peg$currPos++):(a=peg$FAILED,peg$fail(peg$e14)),a===peg$FAILED&&(input.charCodeAt(peg$currPos)===38?(a=peg$c13,peg$currPos++):(a=peg$FAILED,peg$fail(peg$e15)),a===peg$FAILED&&(input.charCodeAt(peg$currPos)===124?(a=peg$c14,peg$currPos++):(a=peg$FAILED,peg$fail(peg$e16)),a===peg$FAILED&&(input.substr(peg$currPos,2)===peg$c15?(a=peg$c15,peg$currPos+=2):(a=peg$FAILED,peg$fail(peg$e17)),a===peg$FAILED&&(input.substr(peg$currPos,2)===peg$c16?(a=peg$c16,peg$currPos+=2):(a=peg$FAILED,peg$fail(peg$e18))))))))),peg$resultsCache[e]={nextPos:peg$currPos,result:a},a)}function peg$parsesub_operations(){var a,e,r,n,s=peg$currPos*17+16,o=peg$resultsCache[s];return o?(peg$currPos=o.nextPos,o.result):(a=peg$currPos,input.charCodeAt(peg$currPos)===40?(e=peg$c0,peg$currPos++):(e=peg$FAILED,peg$fail(peg$e1)),e!==peg$FAILED?(r=peg$parseoperation(),r!==peg$FAILED?(input.charCodeAt(peg$currPos)===41?(n=peg$c2,peg$currPos++):(n=peg$FAILED,peg$fail(peg$e3)),n!==peg$FAILED?(e=[e,r,n],a=e):(peg$currPos=a,a=peg$FAILED)):(peg$currPos=a,a=peg$FAILED)):(peg$currPos=a,a=peg$FAILED),peg$resultsCache[s]={nextPos:peg$currPos,result:a},a)}if(peg$result=peg$startRuleFunction(),peg$result!==peg$FAILED&&peg$currPos===input.length)return peg$result;throw peg$result!==peg$FAILED&&peg$currPos{typeof PROCESS.emitWarning=="function"?PROCESS.emitWarning(a,e,r,n):console.error(`[${r}] ${e}: ${a}`)};let AC=globalThis.AbortController,AS=globalThis.AbortSignal;var Li;if(typeof AC>"u"){AS=class{constructor(){_e(this,"onabort");_e(this,"_onabort",[]);_e(this,"reason");_e(this,"aborted",!1)}addEventListener(n,s){this._onabort.push(s)}},AC=class{constructor(){_e(this,"signal",new AS);e()}abort(n){var s,o;if(!this.signal.aborted){this.signal.reason=n,this.signal.aborted=!0;for(const l of this.signal._onabort)l(n);(o=(s=this.signal).onabort)==null||o.call(s,n)}}};let a=((Li=PROCESS.env)==null?void 0:Li.LRU_CACHE_IGNORE_AC_WARNING)!=="1";const e=()=>{a&&(a=!1,emitWarning("AbortController is not defined. If using lru-cache in node 14, load an AbortController polyfill from the `node-abort-controller` package. A minimal polyfill is provided for use by LRUCache.fetch(), but it should not be relied upon in other contexts (eg, passing it to other APIs that use AbortController/AbortSignal might have undesirable effects). You may disable this with LRU_CACHE_IGNORE_AC_WARNING=1 in the env.","NO_ABORT_CONTROLLER","ENOTSUP",e))}}const shouldWarn=a=>!warned.has(a),isPosInt=a=>a&&a===Math.floor(a)&&a>0&&isFinite(a),getUintArray=a=>isPosInt(a)?a<=Math.pow(2,8)?Uint8Array:a<=Math.pow(2,16)?Uint16Array:a<=Math.pow(2,32)?Uint32Array:a<=Number.MAX_SAFE_INTEGER?ZeroArray:null:null;class ZeroArray extends Array{constructor(e){super(e),this.fill(0)}}var Ln;const fn=class fn{constructor(e,r){_e(this,"heap");_e(this,"length");if(!Oe(fn,Ln))throw new TypeError("instantiate Stack using Stack.create(n)");this.heap=new r(e),this.length=0}static create(e){const r=getUintArray(e);if(!r)return[];Ot(fn,Ln,!0);const n=new fn(e,r);return Ot(fn,Ln,!1),n}push(e){this.heap[this.length++]=e}pop(){return this.heap[--this.length]}};Ln=new WeakMap,Lt(fn,Ln,!1);let Stack=fn;var wr,Tr,Lr,xr,xn,nr,Pr,ir,Ht,Nt,_r,Cr,dr,sr,kr,or,zr,Wr,Mr,Br,sn,Sr,Hn,Ei,gn,Xr,zn,vr,si,Pi,mn,Pn,Wn,Gr,nn,Qr,an,Xn,Oi,kn,ii,Mn,ai,Qt,Xt,Zn,bi,_n,Vn;const Ti=class Ti{constructor(e){Lt(this,Hn);Lt(this,si);Lt(this,Gr);Lt(this,Qr);Lt(this,Xn);Lt(this,kn);Lt(this,Mn);Lt(this,Qt);Lt(this,Zn);Lt(this,_n);Lt(this,wr,void 0);Lt(this,Tr,void 0);Lt(this,Lr,void 0);Lt(this,xr,void 0);Lt(this,xn,void 0);_e(this,"ttl");_e(this,"ttlResolution");_e(this,"ttlAutopurge");_e(this,"updateAgeOnGet");_e(this,"updateAgeOnHas");_e(this,"allowStale");_e(this,"noDisposeOnSet");_e(this,"noUpdateTTL");_e(this,"maxEntrySize");_e(this,"sizeCalculation");_e(this,"noDeleteOnFetchRejection");_e(this,"noDeleteOnStaleGet");_e(this,"allowStaleOnFetchAbort");_e(this,"allowStaleOnFetchRejection");_e(this,"ignoreFetchAbort");Lt(this,nr,void 0);Lt(this,Pr,void 0);Lt(this,ir,void 0);Lt(this,Ht,void 0);Lt(this,Nt,void 0);Lt(this,_r,void 0);Lt(this,Cr,void 0);Lt(this,dr,void 0);Lt(this,sr,void 0);Lt(this,kr,void 0);Lt(this,or,void 0);Lt(this,zr,void 0);Lt(this,Wr,void 0);Lt(this,Mr,void 0);Lt(this,Br,void 0);Lt(this,sn,void 0);Lt(this,Sr,void 0);Lt(this,gn,()=>{});Lt(this,Xr,()=>{});Lt(this,zn,()=>{});Lt(this,vr,()=>!1);Lt(this,mn,e=>{});Lt(this,Pn,(e,r,n)=>{});Lt(this,Wn,(e,r,n,s)=>{if(n||s)throw new TypeError("cannot set size without setting maxSize or maxEntrySize on cache");return 0});const{max:r=0,ttl:n,ttlResolution:s=1,ttlAutopurge:o,updateAgeOnGet:l,updateAgeOnHas:c,allowStale:u,dispose:p,disposeAfter:h,noDisposeOnSet:g,noUpdateTTL:b,maxSize:y=0,maxEntrySize:P=0,sizeCalculation:Y,fetchMethod:F,noDeleteOnFetchRejection:H,noDeleteOnStaleGet:Ee,allowStaleOnFetchRejection:ke,allowStaleOnFetchAbort:f,ignoreFetchAbort:D}=e;if(r!==0&&!isPosInt(r))throw new TypeError("max option must be a nonnegative integer");const N=r?getUintArray(r):Array;if(!N)throw new Error("invalid max value: "+r);if(Ot(this,wr,r),Ot(this,Tr,y),this.maxEntrySize=P||Oe(this,Tr),this.sizeCalculation=Y,this.sizeCalculation){if(!Oe(this,Tr)&&!this.maxEntrySize)throw new TypeError("cannot set sizeCalculation without setting maxSize or maxEntrySize");if(typeof this.sizeCalculation!="function")throw new TypeError("sizeCalculation set to non-function")}if(F!==void 0&&typeof F!="function")throw new TypeError("fetchMethod must be a function if specified");if(Ot(this,xn,F),Ot(this,sn,!!F),Ot(this,ir,new Map),Ot(this,Ht,new Array(r).fill(void 0)),Ot(this,Nt,new Array(r).fill(void 0)),Ot(this,_r,new N(r)),Ot(this,Cr,new N(r)),Ot(this,dr,0),Ot(this,sr,0),Ot(this,kr,Stack.create(r)),Ot(this,nr,0),Ot(this,Pr,0),typeof p=="function"&&Ot(this,Lr,p),typeof h=="function"?(Ot(this,xr,h),Ot(this,or,[])):(Ot(this,xr,void 0),Ot(this,or,void 0)),Ot(this,Br,!!Oe(this,Lr)),Ot(this,Sr,!!Oe(this,xr)),this.noDisposeOnSet=!!g,this.noUpdateTTL=!!b,this.noDeleteOnFetchRejection=!!H,this.allowStaleOnFetchRejection=!!ke,this.allowStaleOnFetchAbort=!!f,this.ignoreFetchAbort=!!D,this.maxEntrySize!==0){if(Oe(this,Tr)!==0&&!isPosInt(Oe(this,Tr)))throw new TypeError("maxSize must be a positive integer if specified");if(!isPosInt(this.maxEntrySize))throw new TypeError("maxEntrySize must be a positive integer if specified");gt(this,si,Pi).call(this)}if(this.allowStale=!!u,this.noDeleteOnStaleGet=!!Ee,this.updateAgeOnGet=!!l,this.updateAgeOnHas=!!c,this.ttlResolution=isPosInt(s)||s===0?s:1,this.ttlAutopurge=!!o,this.ttl=n||0,this.ttl){if(!isPosInt(this.ttl))throw new TypeError("ttl must be a positive integer if specified");gt(this,Hn,Ei).call(this)}if(Oe(this,wr)===0&&this.ttl===0&&Oe(this,Tr)===0)throw new TypeError("At least one of max, maxSize, or ttl is required");if(!this.ttlAutopurge&&!Oe(this,wr)&&!Oe(this,Tr)){const B="LRU_CACHE_UNBOUNDED";shouldWarn(B)&&(warned.add(B),emitWarning("TTL caching without ttlAutopurge, max, or maxSize can result in unbounded memory consumption.","UnboundedCacheWarning",B,Ti))}}static unsafeExposeInternals(e){return{starts:Oe(e,Wr),ttls:Oe(e,Mr),sizes:Oe(e,zr),keyMap:Oe(e,ir),keyList:Oe(e,Ht),valList:Oe(e,Nt),next:Oe(e,_r),prev:Oe(e,Cr),get head(){return Oe(e,dr)},get tail(){return Oe(e,sr)},free:Oe(e,kr),isBackgroundFetch:r=>{var n;return gt(n=e,Qt,Xt).call(n,r)},backgroundFetch:(r,n,s,o)=>{var l;return gt(l=e,Mn,ai).call(l,r,n,s,o)},moveToTail:r=>{var n;return gt(n=e,_n,Vn).call(n,r)},indexes:r=>{var n;return gt(n=e,Gr,nn).call(n,r)},rindexes:r=>{var n;return gt(n=e,Qr,an).call(n,r)},isStale:r=>{var n;return Oe(n=e,vr).call(n,r)}}}get max(){return Oe(this,wr)}get maxSize(){return Oe(this,Tr)}get calculatedSize(){return Oe(this,Pr)}get size(){return Oe(this,nr)}get fetchMethod(){return Oe(this,xn)}get dispose(){return Oe(this,Lr)}get disposeAfter(){return Oe(this,xr)}getRemainingTTL(e){return Oe(this,ir).has(e)?1/0:0}*entries(){for(const e of gt(this,Gr,nn).call(this))Oe(this,Nt)[e]!==void 0&&Oe(this,Ht)[e]!==void 0&&!gt(this,Qt,Xt).call(this,Oe(this,Nt)[e])&&(yield[Oe(this,Ht)[e],Oe(this,Nt)[e]])}*rentries(){for(const e of gt(this,Qr,an).call(this))Oe(this,Nt)[e]!==void 0&&Oe(this,Ht)[e]!==void 0&&!gt(this,Qt,Xt).call(this,Oe(this,Nt)[e])&&(yield[Oe(this,Ht)[e],Oe(this,Nt)[e]])}*keys(){for(const e of gt(this,Gr,nn).call(this)){const r=Oe(this,Ht)[e];r!==void 0&&!gt(this,Qt,Xt).call(this,Oe(this,Nt)[e])&&(yield r)}}*rkeys(){for(const e of gt(this,Qr,an).call(this)){const r=Oe(this,Ht)[e];r!==void 0&&!gt(this,Qt,Xt).call(this,Oe(this,Nt)[e])&&(yield r)}}*values(){for(const e of gt(this,Gr,nn).call(this))Oe(this,Nt)[e]!==void 0&&!gt(this,Qt,Xt).call(this,Oe(this,Nt)[e])&&(yield Oe(this,Nt)[e])}*rvalues(){for(const e of gt(this,Qr,an).call(this))Oe(this,Nt)[e]!==void 0&&!gt(this,Qt,Xt).call(this,Oe(this,Nt)[e])&&(yield Oe(this,Nt)[e])}[Symbol.iterator](){return this.entries()}find(e,r={}){for(const n of gt(this,Gr,nn).call(this)){const s=Oe(this,Nt)[n],o=gt(this,Qt,Xt).call(this,s)?s.__staleWhileFetching:s;if(o!==void 0&&e(o,Oe(this,Ht)[n],this))return this.get(Oe(this,Ht)[n],r)}}forEach(e,r=this){for(const n of gt(this,Gr,nn).call(this)){const s=Oe(this,Nt)[n],o=gt(this,Qt,Xt).call(this,s)?s.__staleWhileFetching:s;o!==void 0&&e.call(r,o,Oe(this,Ht)[n],this)}}rforEach(e,r=this){for(const n of gt(this,Qr,an).call(this)){const s=Oe(this,Nt)[n],o=gt(this,Qt,Xt).call(this,s)?s.__staleWhileFetching:s;o!==void 0&&e.call(r,o,Oe(this,Ht)[n],this)}}purgeStale(){let e=!1;for(const r of gt(this,Qr,an).call(this,{allowStale:!0}))Oe(this,vr).call(this,r)&&(this.delete(Oe(this,Ht)[r]),e=!0);return e}dump(){const e=[];for(const r of gt(this,Gr,nn).call(this,{allowStale:!0})){const n=Oe(this,Ht)[r],s=Oe(this,Nt)[r],o=gt(this,Qt,Xt).call(this,s)?s.__staleWhileFetching:s;if(o===void 0||n===void 0)continue;const l={value:o};if(Oe(this,Mr)&&Oe(this,Wr)){l.ttl=Oe(this,Mr)[r];const c=perf.now()-Oe(this,Wr)[r];l.start=Math.floor(Date.now()-c)}Oe(this,zr)&&(l.size=Oe(this,zr)[r]),e.unshift([n,l])}return e}load(e){this.clear();for(const[r,n]of e){if(n.start){const s=Date.now()-n.start;n.start=perf.now()-s}this.set(r,n.value,n)}}set(e,r,n={}){var b,y,P,Y,F;if(r===void 0)return this.delete(e),this;const{ttl:s=this.ttl,start:o,noDisposeOnSet:l=this.noDisposeOnSet,sizeCalculation:c=this.sizeCalculation,status:u}=n;let{noUpdateTTL:p=this.noUpdateTTL}=n;const h=Oe(this,Wn).call(this,e,r,n.size||0,c);if(this.maxEntrySize&&h>this.maxEntrySize)return u&&(u.set="miss",u.maxEntrySizeExceeded=!0),this.delete(e),this;let g=Oe(this,nr)===0?void 0:Oe(this,ir).get(e);if(g===void 0)g=Oe(this,nr)===0?Oe(this,sr):Oe(this,kr).length!==0?Oe(this,kr).pop():Oe(this,nr)===Oe(this,wr)?gt(this,kn,ii).call(this,!1):Oe(this,nr),Oe(this,Ht)[g]=e,Oe(this,Nt)[g]=r,Oe(this,ir).set(e,g),Oe(this,_r)[Oe(this,sr)]=g,Oe(this,Cr)[g]=Oe(this,sr),Ot(this,sr,g),ni(this,nr)._++,Oe(this,Pn).call(this,g,h,u),u&&(u.set="add"),p=!1;else{gt(this,_n,Vn).call(this,g);const H=Oe(this,Nt)[g];if(r!==H){if(Oe(this,sn)&>(this,Qt,Xt).call(this,H)){H.__abortController.abort(new Error("replaced"));const{__staleWhileFetching:Ee}=H;Ee!==void 0&&!l&&(Oe(this,Br)&&((b=Oe(this,Lr))==null||b.call(this,Ee,e,"set")),Oe(this,Sr)&&((y=Oe(this,or))==null||y.push([Ee,e,"set"])))}else l||(Oe(this,Br)&&((P=Oe(this,Lr))==null||P.call(this,H,e,"set")),Oe(this,Sr)&&((Y=Oe(this,or))==null||Y.push([H,e,"set"])));if(Oe(this,mn).call(this,g),Oe(this,Pn).call(this,g,h,u),Oe(this,Nt)[g]=r,u){u.set="replace";const Ee=H&>(this,Qt,Xt).call(this,H)?H.__staleWhileFetching:H;Ee!==void 0&&(u.oldValue=Ee)}}else u&&(u.set="update")}if(s!==0&&!Oe(this,Mr)&>(this,Hn,Ei).call(this),Oe(this,Mr)&&(p||Oe(this,zn).call(this,g,s,o),u&&Oe(this,Xr).call(this,u,g)),!l&&Oe(this,Sr)&&Oe(this,or)){const H=Oe(this,or);let Ee;for(;Ee=H==null?void 0:H.shift();)(F=Oe(this,xr))==null||F.call(this,...Ee)}return this}pop(){var e;try{for(;Oe(this,nr);){const r=Oe(this,Nt)[Oe(this,dr)];if(gt(this,kn,ii).call(this,!0),gt(this,Qt,Xt).call(this,r)){if(r.__staleWhileFetching)return r.__staleWhileFetching}else if(r!==void 0)return r}}finally{if(Oe(this,Sr)&&Oe(this,or)){const r=Oe(this,or);let n;for(;n=r==null?void 0:r.shift();)(e=Oe(this,xr))==null||e.call(this,...n)}}}has(e,r={}){const{updateAgeOnHas:n=this.updateAgeOnHas,status:s}=r,o=Oe(this,ir).get(e);if(o!==void 0){const l=Oe(this,Nt)[o];if(gt(this,Qt,Xt).call(this,l)&&l.__staleWhileFetching===void 0)return!1;if(Oe(this,vr).call(this,o))s&&(s.has="stale",Oe(this,Xr).call(this,s,o));else return n&&Oe(this,gn).call(this,o),s&&(s.has="hit",Oe(this,Xr).call(this,s,o)),!0}else s&&(s.has="miss");return!1}peek(e,r={}){const{allowStale:n=this.allowStale}=r,s=Oe(this,ir).get(e);if(s!==void 0&&(n||!Oe(this,vr).call(this,s))){const o=Oe(this,Nt)[s];return gt(this,Qt,Xt).call(this,o)?o.__staleWhileFetching:o}}async fetch(e,r={}){const{allowStale:n=this.allowStale,updateAgeOnGet:s=this.updateAgeOnGet,noDeleteOnStaleGet:o=this.noDeleteOnStaleGet,ttl:l=this.ttl,noDisposeOnSet:c=this.noDisposeOnSet,size:u=0,sizeCalculation:p=this.sizeCalculation,noUpdateTTL:h=this.noUpdateTTL,noDeleteOnFetchRejection:g=this.noDeleteOnFetchRejection,allowStaleOnFetchRejection:b=this.allowStaleOnFetchRejection,ignoreFetchAbort:y=this.ignoreFetchAbort,allowStaleOnFetchAbort:P=this.allowStaleOnFetchAbort,context:Y,forceRefresh:F=!1,status:H,signal:Ee}=r;if(!Oe(this,sn))return H&&(H.fetch="get"),this.get(e,{allowStale:n,updateAgeOnGet:s,noDeleteOnStaleGet:o,status:H});const ke={allowStale:n,updateAgeOnGet:s,noDeleteOnStaleGet:o,ttl:l,noDisposeOnSet:c,size:u,sizeCalculation:p,noUpdateTTL:h,noDeleteOnFetchRejection:g,allowStaleOnFetchRejection:b,allowStaleOnFetchAbort:P,ignoreFetchAbort:y,status:H,signal:Ee};let f=Oe(this,ir).get(e);if(f===void 0){H&&(H.fetch="miss");const D=gt(this,Mn,ai).call(this,e,f,ke,Y);return D.__returned=D}else{const D=Oe(this,Nt)[f];if(gt(this,Qt,Xt).call(this,D)){const W=n&&D.__staleWhileFetching!==void 0;return H&&(H.fetch="inflight",W&&(H.returnedStale=!0)),W?D.__staleWhileFetching:D.__returned=D}const N=Oe(this,vr).call(this,f);if(!F&&!N)return H&&(H.fetch="hit"),gt(this,_n,Vn).call(this,f),s&&Oe(this,gn).call(this,f),H&&Oe(this,Xr).call(this,H,f),D;const B=gt(this,Mn,ai).call(this,e,f,ke,Y),se=B.__staleWhileFetching!==void 0&&n;return H&&(H.fetch=N?"stale":"refresh",se&&N&&(H.returnedStale=!0)),se?B.__staleWhileFetching:B.__returned=B}}get(e,r={}){const{allowStale:n=this.allowStale,updateAgeOnGet:s=this.updateAgeOnGet,noDeleteOnStaleGet:o=this.noDeleteOnStaleGet,status:l}=r,c=Oe(this,ir).get(e);if(c!==void 0){const u=Oe(this,Nt)[c],p=gt(this,Qt,Xt).call(this,u);return l&&Oe(this,Xr).call(this,l,c),Oe(this,vr).call(this,c)?(l&&(l.get="stale"),p?(l&&n&&u.__staleWhileFetching!==void 0&&(l.returnedStale=!0),n?u.__staleWhileFetching:void 0):(o||this.delete(e),l&&n&&(l.returnedStale=!0),n?u:void 0)):(l&&(l.get="hit"),p?u.__staleWhileFetching:(gt(this,_n,Vn).call(this,c),s&&Oe(this,gn).call(this,c),u))}else l&&(l.get="miss")}delete(e){var n,s,o,l;let r=!1;if(Oe(this,nr)!==0){const c=Oe(this,ir).get(e);if(c!==void 0)if(r=!0,Oe(this,nr)===1)this.clear();else{Oe(this,mn).call(this,c);const u=Oe(this,Nt)[c];gt(this,Qt,Xt).call(this,u)?u.__abortController.abort(new Error("deleted")):(Oe(this,Br)||Oe(this,Sr))&&(Oe(this,Br)&&((n=Oe(this,Lr))==null||n.call(this,u,e,"delete")),Oe(this,Sr)&&((s=Oe(this,or))==null||s.push([u,e,"delete"]))),Oe(this,ir).delete(e),Oe(this,Ht)[c]=void 0,Oe(this,Nt)[c]=void 0,c===Oe(this,sr)?Ot(this,sr,Oe(this,Cr)[c]):c===Oe(this,dr)?Ot(this,dr,Oe(this,_r)[c]):(Oe(this,_r)[Oe(this,Cr)[c]]=Oe(this,_r)[c],Oe(this,Cr)[Oe(this,_r)[c]]=Oe(this,Cr)[c]),ni(this,nr)._--,Oe(this,kr).push(c)}}if(Oe(this,Sr)&&((o=Oe(this,or))!=null&&o.length)){const c=Oe(this,or);let u;for(;u=c==null?void 0:c.shift();)(l=Oe(this,xr))==null||l.call(this,...u)}return r}clear(){var e,r,n;for(const s of gt(this,Qr,an).call(this,{allowStale:!0})){const o=Oe(this,Nt)[s];if(gt(this,Qt,Xt).call(this,o))o.__abortController.abort(new Error("deleted"));else{const l=Oe(this,Ht)[s];Oe(this,Br)&&((e=Oe(this,Lr))==null||e.call(this,o,l,"delete")),Oe(this,Sr)&&((r=Oe(this,or))==null||r.push([o,l,"delete"]))}}if(Oe(this,ir).clear(),Oe(this,Nt).fill(void 0),Oe(this,Ht).fill(void 0),Oe(this,Mr)&&Oe(this,Wr)&&(Oe(this,Mr).fill(0),Oe(this,Wr).fill(0)),Oe(this,zr)&&Oe(this,zr).fill(0),Ot(this,dr,0),Ot(this,sr,0),Oe(this,kr).length=0,Ot(this,Pr,0),Ot(this,nr,0),Oe(this,Sr)&&Oe(this,or)){const s=Oe(this,or);let o;for(;o=s==null?void 0:s.shift();)(n=Oe(this,xr))==null||n.call(this,...o)}}};wr=new WeakMap,Tr=new WeakMap,Lr=new WeakMap,xr=new WeakMap,xn=new WeakMap,nr=new WeakMap,Pr=new WeakMap,ir=new WeakMap,Ht=new WeakMap,Nt=new WeakMap,_r=new WeakMap,Cr=new WeakMap,dr=new WeakMap,sr=new WeakMap,kr=new WeakMap,or=new WeakMap,zr=new WeakMap,Wr=new WeakMap,Mr=new WeakMap,Br=new WeakMap,sn=new WeakMap,Sr=new WeakMap,Hn=new WeakSet,Ei=function(){const e=new ZeroArray(Oe(this,wr)),r=new ZeroArray(Oe(this,wr));Ot(this,Mr,e),Ot(this,Wr,r),Ot(this,zn,(o,l,c=perf.now())=>{if(r[o]=l!==0?c:0,e[o]=l,l!==0&&this.ttlAutopurge){const u=setTimeout(()=>{Oe(this,vr).call(this,o)&&this.delete(Oe(this,Ht)[o])},l+1);u.unref&&u.unref()}}),Ot(this,gn,o=>{r[o]=e[o]!==0?perf.now():0}),Ot(this,Xr,(o,l)=>{if(e[l]){const c=e[l],u=r[l];o.ttl=c,o.start=u,o.now=n||s();const p=o.now-u;o.remainingTTL=c-p}});let n=0;const s=()=>{const o=perf.now();if(this.ttlResolution>0){n=o;const l=setTimeout(()=>n=0,this.ttlResolution);l.unref&&l.unref()}return o};this.getRemainingTTL=o=>{const l=Oe(this,ir).get(o);if(l===void 0)return 0;const c=e[l],u=r[l];if(c===0||u===0)return 1/0;const p=(n||s())-u;return c-p},Ot(this,vr,o=>e[o]!==0&&r[o]!==0&&(n||s())-r[o]>e[o])},gn=new WeakMap,Xr=new WeakMap,zn=new WeakMap,vr=new WeakMap,si=new WeakSet,Pi=function(){const e=new ZeroArray(Oe(this,wr));Ot(this,Pr,0),Ot(this,zr,e),Ot(this,mn,r=>{Ot(this,Pr,Oe(this,Pr)-e[r]),e[r]=0}),Ot(this,Wn,(r,n,s,o)=>{if(gt(this,Qt,Xt).call(this,n))return 0;if(!isPosInt(s))if(o){if(typeof o!="function")throw new TypeError("sizeCalculation must be a function");if(s=o(n,r),!isPosInt(s))throw new TypeError("sizeCalculation return invalid (expect positive integer)")}else throw new TypeError("invalid size value (must be positive integer). When maxSize or maxEntrySize is used, sizeCalculation or size must be set.");return s}),Ot(this,Pn,(r,n,s)=>{if(e[r]=n,Oe(this,Tr)){const o=Oe(this,Tr)-e[r];for(;Oe(this,Pr)>o;)gt(this,kn,ii).call(this,!0)}Ot(this,Pr,Oe(this,Pr)+e[r]),s&&(s.entrySize=n,s.totalCalculatedSize=Oe(this,Pr))})},mn=new WeakMap,Pn=new WeakMap,Wn=new WeakMap,Gr=new WeakSet,nn=function*({allowStale:e=this.allowStale}={}){if(Oe(this,nr))for(let r=Oe(this,sr);!(!gt(this,Xn,Oi).call(this,r)||((e||!Oe(this,vr).call(this,r))&&(yield r),r===Oe(this,dr)));)r=Oe(this,Cr)[r]},Qr=new WeakSet,an=function*({allowStale:e=this.allowStale}={}){if(Oe(this,nr))for(let r=Oe(this,dr);!(!gt(this,Xn,Oi).call(this,r)||((e||!Oe(this,vr).call(this,r))&&(yield r),r===Oe(this,sr)));)r=Oe(this,_r)[r]},Xn=new WeakSet,Oi=function(e){return e!==void 0&&Oe(this,ir).get(Oe(this,Ht)[e])===e},kn=new WeakSet,ii=function(e){var o,l;const r=Oe(this,dr),n=Oe(this,Ht)[r],s=Oe(this,Nt)[r];return Oe(this,sn)&>(this,Qt,Xt).call(this,s)?s.__abortController.abort(new Error("evicted")):(Oe(this,Br)||Oe(this,Sr))&&(Oe(this,Br)&&((o=Oe(this,Lr))==null||o.call(this,s,n,"evict")),Oe(this,Sr)&&((l=Oe(this,or))==null||l.push([s,n,"evict"]))),Oe(this,mn).call(this,r),e&&(Oe(this,Ht)[r]=void 0,Oe(this,Nt)[r]=void 0,Oe(this,kr).push(r)),Oe(this,nr)===1?(Ot(this,dr,Ot(this,sr,0)),Oe(this,kr).length=0):Ot(this,dr,Oe(this,_r)[r]),Oe(this,ir).delete(n),ni(this,nr)._--,r},Mn=new WeakSet,ai=function(e,r,n,s){const o=r===void 0?void 0:Oe(this,Nt)[r];if(gt(this,Qt,Xt).call(this,o))return o;const l=new AC,{signal:c}=n;c==null||c.addEventListener("abort",()=>l.abort(c.reason),{signal:l.signal});const u={signal:l.signal,options:n,context:s},p=(Y,F=!1)=>{const{aborted:H}=l.signal,Ee=n.ignoreFetchAbort&&Y!==void 0;if(n.status&&(H&&!F?(n.status.fetchAborted=!0,n.status.fetchError=l.signal.reason,Ee&&(n.status.fetchAbortIgnored=!0)):n.status.fetchResolved=!0),H&&!Ee&&!F)return g(l.signal.reason);const ke=y;return Oe(this,Nt)[r]===y&&(Y===void 0?ke.__staleWhileFetching?Oe(this,Nt)[r]=ke.__staleWhileFetching:this.delete(e):(n.status&&(n.status.fetchUpdated=!0),this.set(e,Y,u.options))),Y},h=Y=>(n.status&&(n.status.fetchRejected=!0,n.status.fetchError=Y),g(Y)),g=Y=>{const{aborted:F}=l.signal,H=F&&n.allowStaleOnFetchAbort,Ee=H||n.allowStaleOnFetchRejection,ke=Ee||n.noDeleteOnFetchRejection,f=y;if(Oe(this,Nt)[r]===y&&(!ke||f.__staleWhileFetching===void 0?this.delete(e):H||(Oe(this,Nt)[r]=f.__staleWhileFetching)),Ee)return n.status&&f.__staleWhileFetching!==void 0&&(n.status.returnedStale=!0),f.__staleWhileFetching;if(f.__returned===f)throw Y},b=(Y,F)=>{var Ee;const H=(Ee=Oe(this,xn))==null?void 0:Ee.call(this,e,o,u);H&&H instanceof Promise&&H.then(ke=>Y(ke===void 0?void 0:ke),F),l.signal.addEventListener("abort",()=>{(!n.ignoreFetchAbort||n.allowStaleOnFetchAbort)&&(Y(void 0),n.allowStaleOnFetchAbort&&(Y=ke=>p(ke,!0)))})};n.status&&(n.status.fetchDispatched=!0);const y=new Promise(b).then(p,h),P=Object.assign(y,{__abortController:l,__staleWhileFetching:o,__returned:void 0});return r===void 0?(this.set(e,P,{...u.options,status:void 0}),r=Oe(this,ir).get(e)):Oe(this,Nt)[r]=P,P},Qt=new WeakSet,Xt=function(e){if(!Oe(this,sn))return!1;const r=e;return!!r&&r instanceof Promise&&r.hasOwnProperty("__staleWhileFetching")&&r.__abortController instanceof AC},Zn=new WeakSet,bi=function(e,r){Oe(this,Cr)[r]=e,Oe(this,_r)[e]=r},_n=new WeakSet,Vn=function(e){e!==Oe(this,sr)&&(e===Oe(this,dr)?Ot(this,dr,Oe(this,_r)[e]):gt(this,Zn,bi).call(this,Oe(this,Cr)[e],Oe(this,_r)[e]),gt(this,Zn,bi).call(this,Oe(this,sr),e),Ot(this,sr,e))};let LRUCache=Ti;const zcache=new LRUCache({max:1e3,ttl:1e3*60*5});class Ziffers{constructor(e,r={}){_e(this,"values");_e(this,"evaluated");_e(this,"options");_e(this,"index",0);_e(this,"redo");_e(this,"_current");r={...DEFAULT_OPTIONS,...r},r.scale&&(typeof r.scale=="string"&&(isScale(r.scale)?(r.scaleName=r.scale,r.scale=getScale(r.scale)):r.scale=parse(r.scale)),r.parsedScale=r.scale,delete r.scale),r.redo!==void 0?this.redo=r.redo:this.redo=1,r&&r.seed&&(r.randomSeed=r.seed,r.seededRandom=seededRandom(r.seed)),this.options={nodeOptions:r};try{this.values=parse$1(e,this.options),this.evaluated=this.evaluate()}catch(n){console.log(n),this.values=[],this.evaluated=[]}}update(){this.evaluated=this.evaluate()}pitches(){return this.evaluated.map(e=>e.collect("pitch"))}notes(){return this.evaluated.map(e=>e.collect("note"))}freqs(){return this.evaluated.map(e=>e.collect("freq"))}durations(){return this.evaluated.map(e=>e.collect("duration"))}next(){if(this.redo>0&&this.index>=this.evaluated.length*this.redo&&(this.update(),this._current=void 0,this.index=0),this._current!==void 0){const r=this.evaluated[this._current%this.evaluated.length];r.modifiedEvent&&r.modifiedEvent==null,this._current=this._current+1r.evaluate()).flat(1/0).filter(r=>r!==void 0);return e.forEach((r,n)=>{r._next=n0?n-1:e.length-1}),e}}const generateCacheKey=(...a)=>a.map(e=>JSON.stringify(e)).join(","),cachedCall=(a,e)=>{const r=generateCacheKey(a,e);if(zcache.has(r))return zcache.get(r);{const n=new Ziffers(a,e);return zcache.set(r,n),n}},cachedPattern=(a,e={})=>cachedCall(a,e);class MidiConnection{constructor(){_e(this,"midiAccess",null);_e(this,"midiOutputs",[]);_e(this,"currentOutputIndex",0);_e(this,"scheduledNotes",{});this.initializeMidiAccess()}async initializeMidiAccess(){try{this.midiAccess=await navigator.requestMIDIAccess(),this.midiOutputs=Array.from(this.midiAccess.outputs.values()),this.midiOutputs.length===0&&console.warn("No MIDI outputs available.")}catch(e){console.error("Failed to initialize MIDI:",e)}}getCurrentMidiPort(){return this.midiOutputs.length>0&&this.currentOutputIndex>=0&&this.currentOutputIndexn.name===e);return r!==-1?(this.currentOutputIndex=r,!0):(console.error(`MIDI output "${e}" not found.`),!1)}listMidiOutputs(){console.log("Available MIDI Outputs:"),this.midiOutputs.forEach((e,r)=>{console.log(`${r+1}. ${e.name}`)})}sendMidiNote(e,r,n,s){const o=this.midiOutputs[this.currentOutputIndex];if(e=Math.min(Math.max(e,0),127),o){const l=[144+r,e,n],c=[128+r,e,0];o.send(l);const u=setTimeout(()=>{o.send(c),delete this.scheduledNotes[e]},(s-.02)*1e3);this.scheduledNotes[e]=u}else console.error("MIDI output not available.")}sendSysExMessage(e){const r=this.midiOutputs[this.currentOutputIndex];r?r.send(e):console.error("MIDI output not available.")}sendPitchBend(e,r){(e<0||e>16383)&&console.error("Invalid pitch bend value. Value must be in the range 0-16383."),(r<0||r>15)&&console.error("Invalid MIDI channel. Channel must be in the range 0-15.");const n=this.midiOutputs[this.currentOutputIndex];if(n){const s=e&127,o=e>>7&127;n.send([224|r,s,o])}else console.error("MIDI output not available.")}sendProgramChange(e,r){const n=this.midiOutputs[this.currentOutputIndex];n?n.send([192+r,e]):console.error("MIDI output not available.")}sendMidiControlChange(e,r,n){const s=this.midiOutputs[this.currentOutputIndex];s?s.send([176+n,e,r]):console.error("MIDI output not available.")}panic(){const e=this.midiOutputs[this.currentOutputIndex];if(e){for(const r in this.scheduledNotes){const n=this.scheduledNotes[r];clearTimeout(n),e.send([128,parseInt(r),0])}this.scheduledNotes={}}else console.error("MIDI output not available.")}}class DrunkWalk{constructor(e,r,n){_e(this,"min");_e(this,"max");_e(this,"wrap");_e(this,"position");this.min=e,this.max=r,this.wrap=n,this.position=0}step(){const e=Math.floor(Math.random()*3)-1;this.position+=e,this.wrap?this.position>this.max?this.position=this.min:this.positionthis.max&&(this.position=this.max)}getPosition(){return this.position}toggleWrap(e){this.wrap=e}}const SCALES={major:[0,2,4,5,7,9,11],naturalMinor:[0,2,3,5,7,8,10],harmonicMinor:[0,2,3,5,7,8,11],melodicMinor:[0,2,3,5,7,9,11],dorian:[0,2,3,5,7,9,10],phrygian:[0,1,3,5,7,8,10],lydian:[0,2,4,6,7,9,11],mixolydian:[0,2,4,5,7,9,10],aeolian:[0,2,3,5,7,8,10],locrian:[0,1,3,5,6,8,10],wholeTone:[0,2,4,6,8,10],majorPentatonic:[0,2,4,7,9],minorPentatonic:[0,3,5,7,10],chromatic:[0,1,2,3,4,5,6,7,8,9,10,11],blues:[0,3,5,6,7,10],diminished:[0,2,3,5,6,8,9,11],neapolitanMinor:[0,1,3,5,7,8,11],neapolitanMajor:[0,1,3,5,7,9,11],enigmatic:[0,1,4,6,8,10,11],doubleHarmonic:[0,1,4,5,7,8,11],octatonic:[0,2,3,5,6,8,9,11],bebopDominant:[0,2,4,5,7,9,10,11],bebopMajor:[0,2,4,5,7,8,9,11],bebopMinor:[0,2,3,5,7,8,9,11],bebopDorian:[0,2,3,4,5,7,9,10],harmonicMajor:[0,2,4,5,7,8,11],hungarianMinor:[0,2,3,6,7,8,11],hungarianMajor:[0,3,4,6,7,9,10],oriental:[0,1,4,5,6,9,10],romanianMinor:[0,2,3,6,7,9,10],spanishGypsy:[0,1,4,5,7,8,10],jewish:[0,1,4,5,7,8,10],hindu:[0,2,4,5,7,8,10],japanese:[0,1,5,7,8],hirajoshi:[0,2,3,7,8],kumoi:[0,2,3,7,9],inSen:[0,1,5,7,10],iwato:[0,1,5,6,10],yo:[0,2,5,7,9],minorBlues:[0,3,5,6,7,10],algerian:[0,2,3,5,6,7,8,11],augmented:[0,3,4,7,8,11],balinese:[0,1,3,7,8],byzantine:[0,1,4,5,7,8,11],chinese:[0,4,6,7,11],egyptian:[0,2,5,7,10],eightToneSpanish:[0,1,3,4,5,6,8,10],hawaiian:[0,2,3,5,7,9,10],hindustan:[0,2,4,5,7,8,10],persian:[0,1,4,5,6,8,11],eastIndianPurvi:[0,1,4,6,7,8,11],orientalA:[0,1,4,5,6,9,10]};function scale(a,e="major",r=4){const n=SCALES[e];if(!n)throw new Error(`Unknown scale ${e}`);let s=a%n.length;s<0&&(s+=n.length);let o=Math.floor(a/n.length);return 60+(r+o)*12+n[s]}let listenerQueue=[],atom=(a,e)=>{let r,n=[],s={lc:0,l:e||0,value:a,set(o){s.value=o,s.notify()},get(){return s.lc||s.listen(()=>{})(),s.value},notify(o){r=n;let l=!listenerQueue.length;for(let c=0;c{n===r&&(n=n.slice());let c=n.indexOf(o);~c&&(n.splice(c,2),s.lc--,s.lc||s.off())}},subscribe(o,l){let c=s.listen(o,l);return o(s.value),c},off(){}};return s},map=(a={})=>{let e=atom(a);return e.setKey=function(r,n){typeof n>"u"?r in e.value&&(e.value={...e.value},delete e.value[r],e.notify(r)):e.value[r]!==n&&(e.value={...e.value,[r]:n},e.notify(r))},e};if(typeof DelayNode<"u"){class a extends DelayNode{constructor(r,n,s,o){super(r),n=Math.abs(n),this.delayTime.value=s;const l=r.createGain();l.gain.value=Math.min(Math.abs(o),.995),this.feedback=l.gain;const c=r.createGain();return c.gain.value=n,this.delayGain=c,this.connect(l),this.connect(c),l.connect(this),this.connect=u=>c.connect(u),this}start(r){this.delayGain.gain.setValueAtTime(this.delayGain.gain.value,r+this.delayTime.value)}}AudioContext.prototype.createFeedbackDelay=function(e,r,n){return new a(this,e,r,n)}}typeof AudioContext<"u"&&(AudioContext.prototype.impulseResponse=function(a,e=1){const r=this.sampleRate*a,n=this.createBuffer(e,r,this.sampleRate),s=n.getChannelData(0);for(let o=0;o(e.buffer=this.impulseResponse(r),e.duration=a,e),e.setDuration(a),e});var U={a:{freqs:[660,1120,2750,3e3,3350],gains:[1,.5012,.0708,.0631,.0126],qs:[80,90,120,130,140]},e:{freqs:[440,1800,2700,3e3,3300],gains:[1,.1995,.1259,.1,.1],qs:[70,80,100,120,120]},i:{freqs:[270,1850,2900,3350,3590],gains:[1,.0631,.0631,.0158,.0158],qs:[40,90,100,120,120]},o:{freqs:[430,820,2700,3e3,3300],gains:[1,.3162,.0501,.0794,.01995],qs:[40,80,100,120,120]},u:{freqs:[370,630,2750,3e3,3400],gains:[1,.1,.0708,.0316,.01995],qs:[40,60,100,120,120]}};if(typeof GainNode<"u"){class a extends GainNode{constructor(r,n){if(super(r),!U[n])throw new Error("vowel: unknown vowel "+n);const{gains:s,qs:o,freqs:l}=U[n],c=r.createGain();for(let u=0;u<5;u++){const p=r.createGain();p.gain.value=s[u];const h=r.createBiquadFilter();h.type="bandpass",h.Q.value=o[u],h.frequency.value=l[u],this.connect(h),h.connect(p),p.connect(c)}return c.gain.value=8,this.connect=u=>c.connect(u),this}}AudioContext.prototype.createVowelFilter=function(e){return new a(this,e)}}const re=a=>{var s;if(typeof a!="string")return[];const[e,r="",n]=((s=a.match(/^([a-gA-G])([#bsf]*)([0-9]*)$/))==null?void 0:s.slice(1))||[];return e?[e,r,n?Number(n):void 0]:[]},ie={c:0,d:2,e:4,f:5,g:7,a:9,b:11},ae={"#":1,b:-1,s:1,f:-1},q=(a,e=3)=>{const[r,n,s=e]=re(a);if(!r)throw new Error('not a note: "'+a+'"');const o=ie[r.toLowerCase()],l=(n==null?void 0:n.split("").reduce((c,u)=>c+ae[u],0))||0;return(Number(s)+1)*12+o+l},ge=a=>Math.pow(2,(a-69)/12)*440,de=(a,e,r)=>Math.min(Math.max(a,e),r),ue=a=>12*Math.log(a/440)/Math.LN2+69,le=(a,e)=>{if(typeof a!="object")throw new Error("valueToMidi: expected object value");let{freq:r,note:n}=a;if(typeof r=="number")return ue(r);if(typeof n=="string")return q(n);if(typeof n=="number")return n;if(!e)throw new Error("valueToMidi: expected freq or note to be set");return e},Ie="data:application/javascript;base64,Ly8gTElDRU5TRSBHTlUgR2VuZXJhbCBQdWJsaWMgTGljZW5zZSB2My4wIHNlZSBodHRwczovL2dpdGh1Yi5jb20vZGt0cjAvV2ViRGlydC9ibG9iL21haW4vTElDRU5TRQovLyBhbGwgdGhlIGNyZWRpdCBnb2VzIHRvIGRrdHIwJ3Mgd2ViZGlydDogaHR0cHM6Ly9naXRodWIuY29tL2RrdHIwL1dlYkRpcnQvYmxvYi81Y2UzZDY5ODM2MmM1NGQ2ZTFiNjhhY2M0N2ViMjk1NWFjNjJjNzkzL2Rpc3QvQXVkaW9Xb3JrbGV0cy5qcwovLyA8MwoKY2xhc3MgQ29hcnNlUHJvY2Vzc29yIGV4dGVuZHMgQXVkaW9Xb3JrbGV0UHJvY2Vzc29yIHsKICBzdGF0aWMgZ2V0IHBhcmFtZXRlckRlc2NyaXB0b3JzKCkgewogICAgcmV0dXJuIFt7IG5hbWU6ICdjb2Fyc2UnLCBkZWZhdWx0VmFsdWU6IDEgfV07CiAgfQoKICBjb25zdHJ1Y3RvcigpIHsKICAgIHN1cGVyKCk7CiAgICB0aGlzLm5vdFN0YXJ0ZWQgPSB0cnVlOwogIH0KCiAgcHJvY2VzcyhpbnB1dHMsIG91dHB1dHMsIHBhcmFtZXRlcnMpIHsKICAgIGNvbnN0IGlucHV0ID0gaW5wdXRzWzBdOwogICAgY29uc3Qgb3V0cHV0ID0gb3V0cHV0c1swXTsKICAgIGNvbnN0IGNvYXJzZSA9IHBhcmFtZXRlcnMuY29hcnNlOwogICAgY29uc3QgYmxvY2tTaXplID0gMTI4OwogICAgY29uc3QgaGFzSW5wdXQgPSAhKGlucHV0WzBdID09PSB1bmRlZmluZWQpOwogICAgaWYgKGhhc0lucHV0KSB7CiAgICAgIHRoaXMubm90U3RhcnRlZCA9IGZhbHNlOwogICAgICBvdXRwdXRbMF1bMF0gPSBpbnB1dFswXVswXTsKICAgICAgZm9yIChsZXQgbiA9IDE7IG4gPCBibG9ja1NpemU7IG4rKykgewogICAgICAgIGZvciAobGV0IG8gPSAwOyBvIDwgb3V0cHV0Lmxlbmd0aDsgbysrKSB7CiAgICAgICAgICBvdXRwdXRbb11bbl0gPSBuICUgY29hcnNlID09IDAgPyBpbnB1dFswXVtuXSA6IG91dHB1dFtvXVtuIC0gMV07CiAgICAgICAgfQogICAgICB9CiAgICB9CiAgICByZXR1cm4gdGhpcy5ub3RTdGFydGVkIHx8IGhhc0lucHV0OwogIH0KfQoKcmVnaXN0ZXJQcm9jZXNzb3IoJ2NvYXJzZS1wcm9jZXNzb3InLCBDb2Fyc2VQcm9jZXNzb3IpOwoKY2xhc3MgQ3J1c2hQcm9jZXNzb3IgZXh0ZW5kcyBBdWRpb1dvcmtsZXRQcm9jZXNzb3IgewogIHN0YXRpYyBnZXQgcGFyYW1ldGVyRGVzY3JpcHRvcnMoKSB7CiAgICByZXR1cm4gW3sgbmFtZTogJ2NydXNoJywgZGVmYXVsdFZhbHVlOiAwIH1dOwogIH0KCiAgY29uc3RydWN0b3IoKSB7CiAgICBzdXBlcigpOwogICAgdGhpcy5ub3RTdGFydGVkID0gdHJ1ZTsKICB9CgogIHByb2Nlc3MoaW5wdXRzLCBvdXRwdXRzLCBwYXJhbWV0ZXJzKSB7CiAgICBjb25zdCBpbnB1dCA9IGlucHV0c1swXTsKICAgIGNvbnN0IG91dHB1dCA9IG91dHB1dHNbMF07CiAgICBjb25zdCBjcnVzaCA9IHBhcmFtZXRlcnMuY3J1c2g7CiAgICBjb25zdCBibG9ja1NpemUgPSAxMjg7CiAgICBjb25zdCBoYXNJbnB1dCA9ICEoaW5wdXRbMF0gPT09IHVuZGVmaW5lZCk7CiAgICBpZiAoaGFzSW5wdXQpIHsKICAgICAgdGhpcy5ub3RTdGFydGVkID0gZmFsc2U7CiAgICAgIGlmIChjcnVzaC5sZW5ndGggPT09IDEpIHsKICAgICAgICBjb25zdCB4ID0gTWF0aC5wb3coMiwgY3J1c2hbMF0gLSAxKTsKICAgICAgICBmb3IgKGxldCBuID0gMDsgbiA8IGJsb2NrU2l6ZTsgbisrKSB7CiAgICAgICAgICBjb25zdCB2YWx1ZSA9IE1hdGgucm91bmQoaW5wdXRbMF1bbl0gKiB4KSAvIHg7CiAgICAgICAgICBmb3IgKGxldCBvID0gMDsgbyA8IG91dHB1dC5sZW5ndGg7IG8rKykgewogICAgICAgICAgICBvdXRwdXRbb11bbl0gPSB2YWx1ZTsKICAgICAgICAgIH0KICAgICAgICB9CiAgICAgIH0gZWxzZSB7CiAgICAgICAgZm9yIChsZXQgbiA9IDA7IG4gPCBibG9ja1NpemU7IG4rKykgewogICAgICAgICAgbGV0IHggPSBNYXRoLnBvdygyLCBjcnVzaFtuXSAtIDEpOwogICAgICAgICAgY29uc3QgdmFsdWUgPSBNYXRoLnJvdW5kKGlucHV0WzBdW25dICogeCkgLyB4OwogICAgICAgICAgZm9yIChsZXQgbyA9IDA7IG8gPCBvdXRwdXQubGVuZ3RoOyBvKyspIHsKICAgICAgICAgICAgb3V0cHV0W29dW25dID0gdmFsdWU7CiAgICAgICAgICB9CiAgICAgICAgfQogICAgICB9CiAgICB9CiAgICByZXR1cm4gdGhpcy5ub3RTdGFydGVkIHx8IGhhc0lucHV0OwogIH0KfQpyZWdpc3RlclByb2Nlc3NvcignY3J1c2gtcHJvY2Vzc29yJywgQ3J1c2hQcm9jZXNzb3IpOwoKY2xhc3MgU2hhcGVQcm9jZXNzb3IgZXh0ZW5kcyBBdWRpb1dvcmtsZXRQcm9jZXNzb3IgewogIHN0YXRpYyBnZXQgcGFyYW1ldGVyRGVzY3JpcHRvcnMoKSB7CiAgICByZXR1cm4gW3sgbmFtZTogJ3NoYXBlJywgZGVmYXVsdFZhbHVlOiAwIH1dOwogIH0KCiAgY29uc3RydWN0b3IoKSB7CiAgICBzdXBlcigpOwogICAgdGhpcy5ub3RTdGFydGVkID0gdHJ1ZTsKICB9CgogIHByb2Nlc3MoaW5wdXRzLCBvdXRwdXRzLCBwYXJhbWV0ZXJzKSB7CiAgICBjb25zdCBpbnB1dCA9IGlucHV0c1swXTsKICAgIGNvbnN0IG91dHB1dCA9IG91dHB1dHNbMF07CiAgICBjb25zdCBzaGFwZTAgPSBwYXJhbWV0ZXJzLnNoYXBlWzBdOwogICAgY29uc3Qgc2hhcGUxID0gc2hhcGUwIDwgMSA/IHNoYXBlMCA6IDEuMCAtIDRlLTEwOwogICAgY29uc3Qgc2hhcGUgPSAoMi4wICogc2hhcGUxKSAvICgxLjAgLSBzaGFwZTEpOwogICAgY29uc3QgYmxvY2tTaXplID0gMTI4OwogICAgY29uc3QgaGFzSW5wdXQgPSAhKGlucHV0WzBdID09PSB1bmRlZmluZWQpOwogICAgaWYgKGhhc0lucHV0KSB7CiAgICAgIHRoaXMubm90U3RhcnRlZCA9IGZhbHNlOwogICAgICBmb3IgKGxldCBuID0gMDsgbiA8IGJsb2NrU2l6ZTsgbisrKSB7CiAgICAgICAgY29uc3QgdmFsdWUgPSAoKDEgKyBzaGFwZSkgKiBpbnB1dFswXVtuXSkgLyAoMSArIHNoYXBlICogTWF0aC5hYnMoaW5wdXRbMF1bbl0pKTsKICAgICAgICBmb3IgKGxldCBvID0gMDsgbyA8IG91dHB1dC5sZW5ndGg7IG8rKykgewogICAgICAgICAgb3V0cHV0W29dW25dID0gdmFsdWU7CiAgICAgICAgfQogICAgICB9CiAgICB9CiAgICByZXR1cm4gdGhpcy5ub3RTdGFydGVkIHx8IGhhc0lucHV0OwogIH0KfQoKcmVnaXN0ZXJQcm9jZXNzb3IoJ3NoYXBlLXByb2Nlc3NvcicsIFNoYXBlUHJvY2Vzc29yKTsK";function j(a){const e=I().createGain();return e.gain.value=a,e}const Ce=({s:a,freq:e,t:r})=>{const n=I().createOscillator();return n.type=a||"triangle",n.frequency.value=Number(e),n.start(r),{node:n,stop:s=>n.stop(s)}},ne=(a,e,r,n,s,o)=>{const l=I().createGain();return l.gain.setValueAtTime(0,o),l.gain.linearRampToValueAtTime(s,o+a),l.gain.linearRampToValueAtTime(r*s,o+a+e),{node:l,stop:c=>{l.gain.setValueAtTime(r*s,c),l.gain.linearRampToValueAtTime(0,c+n)}}},x=(a,e,r)=>{const n=I().createBiquadFilter();return n.type=a,n.frequency.value=e,n.Q.value=r,n};let te=a=>console.log(a);const v=(...a)=>te(...a),E=map();function oe(a,e,r={}){E.setKey(a,{onTrigger:e,data:r})}function $(a){return E.get()[a]}let J;const I=()=>(J||(J=new AudioContext),J);let S;const Q=()=>{const a=I();return S||(S=a.createGain(),S.connect(a.destination)),S};let k;function fe(){return k||(k=I().audioWorklet.addModule(Ie),k)}function O(a,e,r){const n=new AudioWorkletNode(a,e);return Object.entries(r).forEach(([s,o])=>{n.parameters.get(s).value=o}),n}async function he$2(a={}){const{disableWorklets:e=!1}=a;typeof window<"u"&&(await I().resume(),e?console.log("disableWorklets: AudioWorklet effects coarse, crush and shape are skipped!"):await fe().catch(r=>{console.warn("could not load AudioWorklet effects coarse, crush and shape",r)}))}async function Ke(a){return new Promise(e=>{document.addEventListener("click",async function r(){await he$2(a),e(),document.removeEventListener("click",r)})})}let R={};function Ae(a,e,r,n){var s;if(r=de(r,0,.98),!R[a]){const o=I().createFeedbackDelay(1,e,r);(s=o.start)==null||s.call(o,n),o.connect(Q()),R[a]=o}return R[a].delayTime.value!==e&&R[a].delayTime.setValueAtTime(e,n),R[a].feedback.value!==r&&R[a].feedback.setValueAtTime(r,n),R[a]}let V={};function pe(a,e=2){if(!V[a]){const r=I().createReverb(e);r.connect(Q()),V[a]=r}return V[a].duration!==e&&(V[a]=V[a].setDuration(e),V[a].duration=e),V[a]}function _(a,e,r){const n=j(r);return a.connect(n),n.connect(e),n}const be=async(a,e,r)=>{const n=I();if(typeof a!="object")throw new Error(`expected hap.value to be an object, but got "${a}". Hint: append .note() or .s() to the end`,"error");let s=n.currentTime+e,{s:o="triangle",bank:l,source:c,gain:u=.8,cutoff:p,resonance:h=1,hcutoff:g,hresonance:b=1,bandf:y,bandq:P=1,coarse:Y,crush:F,shape:H,pan:Ee,vowel:ke,delay:f=0,delayfeedback:D=.5,delaytime:N=.25,orbit:B=1,room:z,size:se=2,velocity:W=1}=a;u*=W;let Se=[];const We=()=>{Se.forEach(Me=>Me==null?void 0:Me.disconnect())};l&&o&&(o=`${l}_${o}`);let Qe;if(c)Qe=c(s,a,r);else if($(o)){const{onTrigger:Me}=$(o),Pe=await Me(s,a,We);Pe&&(Qe=Pe.node,Pe.stop(s+r))}else throw new Error(`sound ${o} not found! Is it loaded?`);if(!Qe)return;if(n.currentTime>s){v("[webaudio] skip hap: still loading",n.currentTime-s);return}const Fe=[];if(Fe.push(Qe),Fe.push(j(u)),p!==void 0&&Fe.push(x("lowpass",p,h)),g!==void 0&&Fe.push(x("highpass",g,b)),y!==void 0&&Fe.push(x("bandpass",y,P)),ke!==void 0&&Fe.push(n.createVowelFilter(ke)),Y!==void 0&&Fe.push(O(n,"coarse-processor",{coarse:Y})),F!==void 0&&Fe.push(O(n,"crush-processor",{crush:F})),H!==void 0&&Fe.push(O(n,"shape-processor",{shape:H})),Ee!==void 0){const Me=n.createStereoPanner();Me.pan.value=2*Ee-1,Fe.push(Me)}const Ue=j(1);Fe.push(Ue),Ue.connect(Q());let Z;if(f>0&&N>0&&D>0){const Me=Ae(B,N,D,s);Z=_(Ue,Me,f)}let ve;if(z>0&&se>0){const Me=pe(B,se);ve=_(Ue,Me,z)}Fe.slice(1).reduce((Me,Pe)=>Me.connect(Pe),Fe[0]),Se=Fe.concat([Z,ve])},L={};function Be(a,e){var r=e?1e3:1024;if(a=r);return a.toFixed(1)+" "+n[s]}const me=async(a,e,r,n,s,o,l)=>{let c=0;s!==void 0&&r!==void 0&&v("[sampler] hap has note and freq. ignoring note","warning");let u=le({freq:s,note:r},36);c=u-36;const p=I();let h;if(Array.isArray(o))h=o[e%o.length];else{const P=F=>q(F)-u,Y=Object.keys(o).filter(F=>!F.startsWith("_")).reduce((F,H,Ee)=>!F||Math.abs(P(H)){const s=r?`sound "${r}:${n}"`:"sample";if(!L[a]){v(`[sampler] load ${s}..`,"load-sample",{url:a});const o=Date.now();L[a]=fetch(a).then(l=>l.arrayBuffer()).then(async l=>{const c=Date.now()-o,u=Be(l.byteLength);return v(`[sampler] load ${s}... done! loaded ${u} in ${c}ms`,"loaded-sample",{url:a}),await e.decodeAudioData(l)})}return L[a]};function we(a){const e=I(),r=e.createBuffer(a.numberOfChannels,a.length,e.sampleRate);for(let n=0;nObject.entries(a).forEach(([n,s])=>{if(typeof s=="string"&&(s=[s]),typeof s!="object")throw new Error("wrong sample map format for "+n);r=s._base||r;const o=l=>(r+l).replace("github:","https://raw.githubusercontent.com/");Array.isArray(s)?s=s.map(o):s=Object.fromEntries(Object.entries(s).map(([l,c])=>[l,(typeof c=="string"?[c]:c).map(o)])),e(n,s)});let ce={};function Xe(a){const e=Object.entries(ce).find(([r])=>a.startsWith(r));if(e)return e[1]}const Re=async(a,e=a._base||"",r={})=>{if(typeof a=="string"){const o=Xe(a);if(o)return o(a);if(a.startsWith("github:")){let[c,u]=a.split("github:");u=u.endsWith("/")?u.slice(0,-1):u,a=`https://raw.githubusercontent.com/${u}/strudel.json`}if(typeof fetch!="function")return;const l=a.split("/").slice(0,-1).join("/");return typeof fetch>"u"?void 0:fetch(a).then(c=>c.json()).then(c=>Re(c,e||c._base||l,r)).catch(c=>{throw console.error(c),new Error(`error loading "${a}"`)})}const{prebake:n,tag:s}=r;Ge(a,(o,l)=>oe(o,(c,u,p)=>Ve(c,u,p,l),{type:"sample",samples:l,baseUrl:e,prebake:n,tag:s}),e)},ee=[];async function Ve(a,e,r,n,s){const{s:o,freq:l,unit:c,nudge:u=0,cut:p,loop:h,clip:g=void 0,n:b=0,note:y,speed:P=1,begin:Y=0,end:F=1}=e;if(P===0)return;const H=I(),{attack:Ee=.001,decay:ke=.001,sustain:f=1,release:D=.001}=e,N=a+u,B=await me(o,b,y,P,l,n,s);if(H.currentTime>a){v(`[sampler] still loading sound "${o}:${b}"`,"highlight");return}if(!B){v(`[sampler] could not load "${o}:${b}"`,"error");return}B.playbackRate.value=Math.abs(P)*B.playbackRate.value,c==="c"&&(B.playbackRate.value=B.playbackRate.value*B.buffer.duration*1);const z=Y*B.buffer.duration;B.start(N,z);const se=B.buffer.duration/B.playbackRate.value,{node:W,stop:Se}=ne(Ee,ke,f,D,1,a);B.connect(W);const We=H.createGain();W.connect(We),B.onended=function(){B.disconnect(),W.disconnect(),We.disconnect(),r()};const Qe={node:We,bufferSource:B,stop:(Fe,Ue=g===void 0)=>{let Z=Fe;Ue&&(Z=a+(F-Y)*se),B.stop(Z+D),Se(Z)}};if(p!==void 0){const Fe=ee[p];Fe&&(Fe.node.gain.setValueAtTime(1,N),Fe.node.gain.linearRampToValueAtTime(0,N+.01)),ee[p]=Qe}return Qe}const He=(a,e=1,r="sine")=>{const n=I(),s=n.createOscillator();s.type=r,s.frequency.value=a,s.start();const o=new GainNode(n,{gain:e});return s.connect(o),{node:o,stop:l=>s.stop(l)}},Ze=(a,e,r,n="sine")=>{const s=a.frequency.value*e,o=s*r;return He(s,o,n)};function De(){["sine","square","triangle","sawtooth"].forEach(a=>{oe(a,(e,r,n)=>{const{attack:s=.001,decay:o=.05,sustain:l=.6,release:c=.01,fmh:u=1,fmi:p}=r;let{n:h,note:g,freq:b}=r;h=g||h||36,typeof h=="string"&&(h=q(h)),!b&&typeof h=="number"&&(b=ge(h));const{node:y,stop:P}=Ce({t:e,s:a,freq:b});let Y;if(p){const{node:ke,stop:f}=Ze(y,u,p);ke.connect(y.frequency),Y=f}const F=j(.3),{node:H,stop:Ee}=ne(s,o,l,c,1,e);return y.onended=()=>{y.disconnect(),F.disconnect(),n()},{node:y.connect(F).connect(H),stop:ke=>{Ee(ke);let f=ke+c;P(f),Y==null||Y(f)}}},{type:"synth",prebake:!0})})}class Sound{constructor(e,r){_e(this,"values");_e(this,"attack",e=>(this.values.attack=e,this));_e(this,"atk",this.attack);_e(this,"decay",e=>(this.values.decay=e,this));_e(this,"dec",this.decay);_e(this,"sustain",e=>(this.values.sustain=e,this));_e(this,"sus",this.sustain);_e(this,"release",e=>(this.values.release=e,this));_e(this,"rel",this.release);_e(this,"unit",e=>(this.values.unit=e,this));_e(this,"freq",e=>(this.values.freq=e,this));_e(this,"fmi",e=>(this.values.fmi=e,this));_e(this,"fmh",e=>(this.values.fmh=e,this));_e(this,"nudge",e=>(this.values.nudge=e,this));_e(this,"cut",e=>(this.values.cut=e,this));_e(this,"loop",e=>(this.values.loop=e,this));_e(this,"clip",e=>(this.values.clip=e,this));_e(this,"n",e=>(this.values.n=e,this));_e(this,"note",e=>(this.values.note=e,this));_e(this,"speed",e=>(this.values.speed=e,this));_e(this,"begin",e=>(this.values.begin=e,this));_e(this,"end",e=>(this.values.end=e,this));_e(this,"gain",e=>(this.values.gain=e,this));_e(this,"cutoff",e=>(this.values.cutoff=e,this));_e(this,"resonance",e=>(this.values.resonance=e,this));_e(this,"hcutoff",e=>(this.values.hcutoff=e,this));_e(this,"hresonance",e=>(this.values.hresonance=e,this));_e(this,"bandf",e=>(this.values.bandf=e,this));_e(this,"bandq",e=>(this.values.bandq=e,this));_e(this,"coarse",e=>(this.values.coarse=e,this));_e(this,"crush",e=>(this.values.crush=e,this));_e(this,"shape",e=>(this.values.shape=e,this));_e(this,"pan",e=>(this.values.pan=e,this));_e(this,"vowel",e=>(this.values.vowel=e,this));_e(this,"delay",e=>(this.values.delay=e,this));_e(this,"delayfeedback",e=>(this.values.delayfeedback=e,this));_e(this,"delaytime",e=>(this.values.delaytime=e,this));_e(this,"orbit",e=>(this.values.orbit=e,this));_e(this,"room",e=>(this.values.room=e,this));_e(this,"size",e=>(this.values.size=e,this));_e(this,"velocity",e=>(this.values.velocity=e,this));_e(this,"dur",e=>(this.values.dur=e,this));_e(this,"out",()=>be(this.values,this.app.clock.pulse_duration,this.values.dur));this.app=r,this.values={s:e,dur:.5}}}Array.prototype.in=function(a){return this.includes(a)};async function loadSamples(){return Promise.all([Ke(),Re("github:Bubobubobubobubo/Topos-Samples/main"),Re("github:tidalcycles/Dirt-Samples/master").then(()=>De())])}loadSamples();class UserAPI{constructor(e){_e(this,"variables",{});_e(this,"counters",{});_e(this,"_drunk",new DrunkWalk(-100,100,!1));_e(this,"MidiConnection",new MidiConnection);_e(this,"load");_e(this,"time",()=>this.app.audioContext.currentTime);_e(this,"play",()=>{this.app.setButtonHighlighting("play",!0),this.app.clock.start()});_e(this,"pause",()=>{this.app.setButtonHighlighting("pause",!0),this.app.clock.pause()});_e(this,"stop",()=>{this.app.setButtonHighlighting("stop",!0),this.app.clock.stop()});_e(this,"silence",this.stop);_e(this,"hush",this.stop);_e(this,"mouseX",()=>this.app._mouseX);_e(this,"mouseY",()=>this.app._mouseY);_e(this,"script",(...e)=>{e.forEach(r=>{tryEvaluate(this.app,this.app.universes[this.app.selected_universe].locals[r])})});_e(this,"s",this.script);_e(this,"clear_script",e=>{this.app.universes[this.app.selected_universe].locals[e]={candidate:"",committed:"",evaluations:0}});_e(this,"cs",this.clear_script);_e(this,"copy_script",(e,r)=>{this.app.universes[this.app.selected_universe].locals[r]=this.app.universes[this.app.selected_universe].locals[e]});_e(this,"cps",this.copy_script);_e(this,"midi_outputs",()=>(console.log(this.MidiConnection.listMidiOutputs()),this.MidiConnection.midiOutputs));_e(this,"midi_output",e=>{e?this.MidiConnection.switchMidiOutput(e):console.log(this.MidiConnection.getCurrentMidiPort())});_e(this,"note",(e,r={})=>{const n=r.channel?r.channel:0,s=r.velocity?r.velocity:100,o=r.duration?r.duration*Math.floor(this.app.clock.pulse_duration*this.ppqn()):this.app.clock.pulse_duration*this.ppqn();this.MidiConnection.sendMidiNote(e,n,s,o)});_e(this,"sysex",e=>{this.MidiConnection.sendSysExMessage(e)});_e(this,"pitch_bend",(e,r)=>{this.MidiConnection.sendPitchBend(e,r)});_e(this,"program_change",(e,r)=>{this.MidiConnection.sendProgramChange(e,r)});_e(this,"midi_clock",()=>{this.MidiConnection.sendMidiClock()});_e(this,"control_change",({control:e=20,value:r=0,channel:n=0})=>{this.MidiConnection.sendMidiControlChange(e,r,n)});_e(this,"midi_panic",()=>{this.MidiConnection.panic()});_e(this,"zn",(e,r={})=>{const n=cachedPattern(e,r);if(n.hasStarted()){const s=n.peek(),o=s.modifiedEvent?s.modifiedEvent:s,l=r.channel?r.channel:0,c=r.velocity?r.velocity:100,u=r.sustain?r.sustain:.5;o instanceof Pitch?(o.bend&&this.MidiConnection.sendPitchBend(o.bend,l),this.MidiConnection.sendMidiNote(o.note,l,c,u),o.bend&&this.MidiConnection.sendPitchBend(8192,l)):o instanceof Chord&&o.pitches.forEach(p=>{p.bend&&this.MidiConnection.sendPitchBend(p.bend,l),this.MidiConnection.sendMidiNote(p.note,l,c,u),p.bend&&this.MidiConnection.sendPitchBend(8192,l)}),s.modifiedEvent&&(s.modifiedEvent=void 0)}return n.next()});_e(this,"counter",(e,r,n)=>(e in this.counters?(this.counters[e].limit!==r&&(this.counters[e].value=0,this.counters[e].limit=r),this.counters[e].step!==n&&(this.counters[e].step=n??this.counters[e].step),this.counters[e].value+=this.counters[e].step,this.counters[e].limit!==void 0&&this.counters[e].value>this.counters[e].limit&&(this.counters[e].value=0)):this.counters[e]={value:0,step:n??1,limit:r},this.counters[e].value));_e(this,"$",this.counter);_e(this,"drunk",e=>e!==void 0?(this._drunk.position=e,this._drunk.getPosition()):(this._drunk.step(),this._drunk.getPosition()));_e(this,"drunk_max",e=>{this._drunk.max=e});_e(this,"drunk_min",e=>{this._drunk.min=e});_e(this,"drunk_wrap",e=>{this._drunk.toggleWrap(e)});_e(this,"variable",(e,r)=>typeof e=="string"&&r===void 0?this.variables[e]:(this.variables[e]=r,this.variables[e]));_e(this,"v",this.variable);_e(this,"delete_variable",e=>{delete this.variables[e]});_e(this,"dv",this.delete_variable);_e(this,"clear_variables",()=>{this.variables={}});_e(this,"cv",this.clear_variables);_e(this,"slice",e=>{const r=this.epulse();return Math.floor(r/Math.floor(e*this.ppqn()))%2===0});_e(this,"barslice",e=>{const r=this.bar()-1;return Math.floor(r/e)%2===0});_e(this,"seqslice",(...e)=>{const r=e[0],n=e.slice(1),s=this.epulse(),o=Math.floor(s/Math.floor(r*this.ppqn()));return n[o%n.length]});_e(this,"pick",(...e)=>e[Math.floor(Math.random()*e.length)]);_e(this,"seqbeat",(...e)=>e[this.ebeat()%e.length]);_e(this,"mel",(e,r)=>r[e%r.length]);_e(this,"seqbar",(...e)=>e[(this.app.clock.time_position.bar+1)%e.length]);_e(this,"seqpulse",(...e)=>e[this.app.clock.time_position.pulse%e.length]);_e(this,"randI",(e,r)=>Math.floor(Math.random()*(r-e+1))+e);_e(this,"rand",(e,r)=>Math.random()*(r-e)+e);_e(this,"rI",this.randI);_e(this,"r",this.rand);_e(this,"quantize",(e,r)=>{if(r.length===0)return e;let n=r[0];return r.forEach(s=>{Math.abs(s-e)Math.min(Math.max(e,r),n));_e(this,"cmp",this.clamp);_e(this,"bpm",e=>e===void 0?this.app.clock.bpm:((e<1||e>500)&&console.log(`Setting bpm to ${e}`),this.app.clock.bpm=e,e));_e(this,"tempo",this.bpm);_e(this,"bpb",e=>e===void 0?this.app.clock.time_signature[0]:(e<1&&console.log(`Setting bpb to ${e}`),this.app.clock.time_signature[0]=e,e));_e(this,"ppqn",e=>e===void 0?this.app.clock.ppqn:(e<1&&console.log(`Setting ppqn to ${e}`),this.app.clock.ppqn=e,e));_e(this,"time_signature",(e,r)=>{this.app.clock.time_signature=[e,r]});_e(this,"almostNever",()=>Math.random()>.9);_e(this,"sometimes",()=>Math.random()>.5);_e(this,"rarely",()=>Math.random()>.75);_e(this,"often",()=>Math.random()>.25);_e(this,"almostAlways",()=>Math.random()>.1);_e(this,"dice",e=>Math.floor(Math.random()*e)+1);_e(this,"i",e=>e!==void 0?(this.app.universes[this.app.selected_universe].global.evaluations=e,this.app.universes[this.app.selected_universe]):this.app.universes[this.app.selected_universe].global.evaluations);_e(this,"bar",()=>this.app.clock.time_position.bar);_e(this,"tick",()=>this.app.clock.tick);_e(this,"pulse",()=>this.app.clock.time_position.pulse);_e(this,"beat",()=>this.app.clock.time_position.beat);_e(this,"ebeat",()=>this.app.clock.beats_since_origin);_e(this,"epulse",()=>this.app.clock.pulses_since_origin);_e(this,"onbar",(e,...r)=>{const n=[...Array(e).keys()].map(s=>s+1);return console.log(r.some(s=>n.includes(s%e))),r.some(s=>n.includes(s%e))});_e(this,"onbeat",(...e)=>{let r=[];return e.forEach(n=>{n=n%this.app.clock.time_signature[0]+1;let s=Math.floor(n),o=n-s;r.push(s===this.app.clock.time_position.beat&&this.app.clock.time_position.pulse===o*this.app.clock.ppqn)}),r.some(n=>n==!0)});_e(this,"prob",e=>Math.random()*100Math.random()>.5);_e(this,"min",(...e)=>Math.min(...e));_e(this,"max",(...e)=>Math.max(...e));_e(this,"mean",(...e)=>e.reduce((n,s)=>n+s,0)/e.length);_e(this,"limit",(e,r,n)=>Math.min(Math.max(e,r),n));_e(this,"delay",(e,r)=>{setTimeout(r,e)});_e(this,"delayr",(e,r,n)=>{[...Array(r).keys()].map(o=>e*o).forEach((o,l)=>{setTimeout(n,o)})});_e(this,"mod",(...e)=>e.map(n=>this.epulse()%Math.floor(n*this.ppqn())===0).some(n=>n===!0));_e(this,"modbar",(...e)=>e.map(n=>this.bar()%Math.floor(n*this.ppqn())===0).some(n=>n===!0));_e(this,"euclid",(e,r,n,s=0)=>this._euclidean_cycle(r,n,s)[e%n]);_e(this,"ec",this.euclid);_e(this,"bin",(e,r)=>{let s=r.toString(2).split("").map(o=>o==="1");return s[e%s.length]});_e(this,"line",(e,r,n=1)=>{const s=[];if(r>e&&n>0||rMath.sin(this.app.clock.ctx.currentTime*Math.PI*2*e)+r);_e(this,"usine",(e=1,r=0)=>(this.sine(e,r)+1)/2);_e(this,"saw",(e=1,r=0)=>this.app.clock.ctx.currentTime*e%1*2-1+r);_e(this,"usaw",(e=1,r=0)=>(this.saw(e,r)+1)/2);_e(this,"triangle",(e=1,r=0)=>Math.abs(this.saw(e,r))*2-1);_e(this,"utriangle",(e=1,r=0)=>(this.triangle(e,r)+1)/2);_e(this,"square",(e=1,r=0,n=.5)=>{const s=1/e;return(Date.now()/1e3+r)%s/s(this.square(e,r,n)+1)/2);_e(this,"noise",()=>Math.random()*2-1);_e(this,"abs",Math.abs);_e(this,"sound",e=>new Sound(e,this.app));_e(this,"snd",this.sound);_e(this,"samples",Re);_e(this,"log",console.log);_e(this,"scale",scale);_e(this,"rate",e=>{});this.app=e,this.load=Re("github:tidalcycles/Dirt-Samples/master")}_euclidean_cycle(e,r,n=0){if(e==r)return Array.from({length:r},()=>!0);function s(c,u){const p=c.length,h=(u+1)%p;return c[u]>c[h]}if(e>=r)return[!0];const o=Array.from({length:r},(c,u)=>(e*(u-1)%r+r)%r);let l=o.map((c,u)=>s(o,u));return n!=0&&(l=l.slice(n).concat(l.slice(0,n))),l}}const style="";var commonjsGlobal=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function getDefaultExportFromCjs(a){return a&&a.__esModule&&Object.prototype.hasOwnProperty.call(a,"default")?a.default:a}var showdown$2={exports:{}};(function(a){(function(){function e(f){var D={omitExtraWLInCodeBlocks:{defaultValue:!1,describe:"Omit the default extra whiteline added to code blocks",type:"boolean"},noHeaderId:{defaultValue:!1,describe:"Turn on/off generated header id",type:"boolean"},prefixHeaderId:{defaultValue:!1,describe:"Add a prefix to the generated header ids. Passing a string will prefix that string to the header id. Setting to true will add a generic 'section-' prefix",type:"string"},rawPrefixHeaderId:{defaultValue:!1,describe:'Setting this option to true will prevent showdown from modifying the prefix. This might result in malformed IDs (if, for instance, the " char is used in the prefix)',type:"boolean"},ghCompatibleHeaderId:{defaultValue:!1,describe:"Generate header ids compatible with github style (spaces are replaced with dashes, a bunch of non alphanumeric chars are removed)",type:"boolean"},rawHeaderId:{defaultValue:!1,describe:`Remove only spaces, ' and " from generated header ids (including prefixes), replacing them with dashes (-). WARNING: This might result in malformed ids`,type:"boolean"},headerLevelStart:{defaultValue:!1,describe:"The header blocks level start",type:"integer"},parseImgDimensions:{defaultValue:!1,describe:"Turn on/off image dimension parsing",type:"boolean"},simplifiedAutoLink:{defaultValue:!1,describe:"Turn on/off GFM autolink style",type:"boolean"},excludeTrailingPunctuationFromURLs:{defaultValue:!1,describe:"Excludes trailing punctuation from links generated with autoLinking",type:"boolean"},literalMidWordUnderscores:{defaultValue:!1,describe:"Parse midword underscores as literal underscores",type:"boolean"},literalMidWordAsterisks:{defaultValue:!1,describe:"Parse midword asterisks as literal asterisks",type:"boolean"},strikethrough:{defaultValue:!1,describe:"Turn on/off strikethrough support",type:"boolean"},tables:{defaultValue:!1,describe:"Turn on/off tables support",type:"boolean"},tablesHeaderId:{defaultValue:!1,describe:"Add an id to table headers",type:"boolean"},ghCodeBlocks:{defaultValue:!0,describe:"Turn on/off GFM fenced code blocks support",type:"boolean"},tasklists:{defaultValue:!1,describe:"Turn on/off GFM tasklist support",type:"boolean"},smoothLivePreview:{defaultValue:!1,describe:"Prevents weird effects in live previews due to incomplete input",type:"boolean"},smartIndentationFix:{defaultValue:!1,describe:"Tries to smartly fix indentation in es6 strings",type:"boolean"},disableForced4SpacesIndentedSublists:{defaultValue:!1,describe:"Disables the requirement of indenting nested sublists by 4 spaces",type:"boolean"},simpleLineBreaks:{defaultValue:!1,describe:"Parses simple line breaks as
(GFM Style)",type:"boolean"},requireSpaceBeforeHeadingText:{defaultValue:!1,describe:"Makes adding a space between `#` and the header text mandatory (GFM Style)",type:"boolean"},ghMentions:{defaultValue:!1,describe:"Enables github @mentions",type:"boolean"},ghMentionsLink:{defaultValue:"https://github.com/{u}",describe:"Changes the link generated by @mentions. Only applies if ghMentions option is enabled.",type:"string"},encodeEmails:{defaultValue:!0,describe:"Encode e-mail addresses through the use of Character Entities, transforming ASCII e-mail addresses into its equivalent decimal entities",type:"boolean"},openLinksInNewWindow:{defaultValue:!1,describe:"Open all links in new windows",type:"boolean"},backslashEscapesHTMLTags:{defaultValue:!1,describe:"Support for HTML Tag escaping. ex:
foo
",type:"boolean"},emoji:{defaultValue:!1,describe:"Enable emoji support. Ex: `this is a :smile: emoji`",type:"boolean"},underline:{defaultValue:!1,describe:"Enable support for underline. Syntax is double or triple underscores: `__underline word__`. With this option enabled, underscores no longer parses into `` and ``",type:"boolean"},ellipsis:{defaultValue:!0,describe:"Replaces three dots with the ellipsis unicode character",type:"boolean"},completeHTMLDocument:{defaultValue:!1,describe:"Outputs a complete html document, including ``, `` and `` tags",type:"boolean"},metadata:{defaultValue:!1,describe:"Enable support for document metadata (defined at the top of the document between `«««` and `»»»` or between `---` and `---`).",type:"boolean"},splitAdjacentBlockquotes:{defaultValue:!1,describe:"Split adjacent blockquote blocks",type:"boolean"}};if(f===!1)return JSON.parse(JSON.stringify(D));var N={};for(var B in D)D.hasOwnProperty(B)&&(N[B]=D[B].defaultValue);return N}function r(){var f=e(!0),D={};for(var N in f)f.hasOwnProperty(N)&&(D[N]=!0);return D}var n={},s={},o={},l=e(!0),c="vanilla",u={github:{omitExtraWLInCodeBlocks:!0,simplifiedAutoLink:!0,excludeTrailingPunctuationFromURLs:!0,literalMidWordUnderscores:!0,strikethrough:!0,tables:!0,tablesHeaderId:!0,ghCodeBlocks:!0,tasklists:!0,disableForced4SpacesIndentedSublists:!0,simpleLineBreaks:!0,requireSpaceBeforeHeadingText:!0,ghCompatibleHeaderId:!0,ghMentions:!0,backslashEscapesHTMLTags:!0,emoji:!0,splitAdjacentBlockquotes:!0},original:{noHeaderId:!0,ghCodeBlocks:!1},ghost:{omitExtraWLInCodeBlocks:!0,parseImgDimensions:!0,simplifiedAutoLink:!0,excludeTrailingPunctuationFromURLs:!0,literalMidWordUnderscores:!0,strikethrough:!0,tables:!0,tablesHeaderId:!0,ghCodeBlocks:!0,tasklists:!0,smoothLivePreview:!0,simpleLineBreaks:!0,requireSpaceBeforeHeadingText:!0,ghMentions:!1,encodeEmails:!0},vanilla:e(!0),allOn:r()};n.helper={},n.extensions={},n.setOption=function(f,D){return l[f]=D,this},n.getOption=function(f){return l[f]},n.getOptions=function(){return l},n.resetOptions=function(){l=e(!0)},n.setFlavor=function(f){if(!u.hasOwnProperty(f))throw Error(f+" flavor was not found");n.resetOptions();var D=u[f];c=f;for(var N in D)D.hasOwnProperty(N)&&(l[N]=D[N])},n.getFlavor=function(){return c},n.getFlavorOptions=function(f){if(u.hasOwnProperty(f))return u[f]},n.getDefaultOptions=function(f){return e(f)},n.subParser=function(f,D){if(n.helper.isString(f))if(typeof D<"u")s[f]=D;else{if(s.hasOwnProperty(f))return s[f];throw Error("SubParser named "+f+" not registered!")}},n.extension=function(f,D){if(!n.helper.isString(f))throw Error("Extension 'name' must be a string");if(f=n.helper.stdExtName(f),n.helper.isUndefined(D)){if(!o.hasOwnProperty(f))throw Error("Extension named "+f+" is not registered!");return o[f]}else{typeof D=="function"&&(D=D()),n.helper.isArray(D)||(D=[D]);var N=p(D,f);if(N.valid)o[f]=D;else throw Error(N.error)}},n.getAllExtensions=function(){return o},n.removeExtension=function(f){delete o[f]},n.resetExtensions=function(){o={}};function p(f,D){var N=D?"Error in "+D+" extension->":"Error in unnamed extension",B={valid:!0,error:""};n.helper.isArray(f)||(f=[f]);for(var z=0;z"u"},n.helper.forEach=function(f,D){if(n.helper.isUndefined(f))throw new Error("obj param is required");if(n.helper.isUndefined(D))throw new Error("callback param is required");if(!n.helper.isFunction(D))throw new Error("callback param must be a function/closure");if(typeof f.forEach=="function")f.forEach(D);else if(n.helper.isArray(f))for(var N=0;N").replace(/&/g,"&")};var g=function(f,D,N,B){var z=B||"",se=z.indexOf("g")>-1,W=new RegExp(D+"|"+N,"g"+z.replace(/g/g,"")),Se=new RegExp(D,z.replace(/g/g,"")),We=[],Qe,Fe,Ue,Z,ve;do for(Qe=0;Ue=W.exec(f);)if(Se.test(Ue[0]))Qe++||(Fe=W.lastIndex,Z=Fe-Ue[0].length);else if(Qe&&!--Qe){ve=Ue.index+Ue[0].length;var Me={left:{start:Z,end:Fe},match:{start:Fe,end:Ue.index},right:{start:Ue.index,end:ve},wholeMatch:{start:Z,end:ve}};if(We.push(Me),!se)return We}while(Qe&&(W.lastIndex=Fe));return We};n.helper.matchRecursiveRegExp=function(f,D,N,B){for(var z=g(f,D,N,B),se=[],W=0;W0){var Qe=[];W[0].wholeMatch.start!==0&&Qe.push(f.slice(0,W[0].wholeMatch.start));for(var Fe=0;Fe=0?B+(N||0):B},n.helper.splitAtIndex=function(f,D){if(!n.helper.isString(f))throw"InvalidArgumentError: first parameter of showdown.helper.regexIndexOf function must be a string";return[f.substring(0,D),f.substring(D)]},n.helper.encodeEmailAddress=function(f){var D=[function(N){return"&#"+N.charCodeAt(0)+";"},function(N){return"&#x"+N.charCodeAt(0).toString(16)+";"},function(N){return N}];return f=f.replace(/./g,function(N){if(N==="@")N=D[Math.floor(Math.random()*2)](N);else{var B=Math.random();N=B>.9?D[2](N):B>.45?D[1](N):D[0](N)}return N}),f},n.helper.padEnd=function(D,N,B){return N=N>>0,B=String(B||" "),D.length>N?String(D):(N=N-D.length,N>B.length&&(B+=B.repeat(N/B.length)),String(D)+B.slice(0,N))},typeof console>"u"&&(console={warn:function(f){alert(f)},log:function(f){alert(f)},error:function(f){throw f}}),n.helper.regexes={asteriskDashAndColon:/([*_:~])/g},n.helper.emojis={"+1":"👍","-1":"👎",100:"💯",1234:"🔢","1st_place_medal":"🥇","2nd_place_medal":"🥈","3rd_place_medal":"🥉","8ball":"🎱",a:"🅰️",ab:"🆎",abc:"🔤",abcd:"🔡",accept:"🉑",aerial_tramway:"🚡",airplane:"✈️",alarm_clock:"⏰",alembic:"⚗️",alien:"👽",ambulance:"🚑",amphora:"🏺",anchor:"⚓️",angel:"👼",anger:"💢",angry:"😠",anguished:"😧",ant:"🐜",apple:"🍎",aquarius:"♒️",aries:"♈️",arrow_backward:"◀️",arrow_double_down:"⏬",arrow_double_up:"⏫",arrow_down:"⬇️",arrow_down_small:"🔽",arrow_forward:"▶️",arrow_heading_down:"⤵️",arrow_heading_up:"⤴️",arrow_left:"⬅️",arrow_lower_left:"↙️",arrow_lower_right:"↘️",arrow_right:"➡️",arrow_right_hook:"↪️",arrow_up:"⬆️",arrow_up_down:"↕️",arrow_up_small:"🔼",arrow_upper_left:"↖️",arrow_upper_right:"↗️",arrows_clockwise:"🔃",arrows_counterclockwise:"🔄",art:"🎨",articulated_lorry:"🚛",artificial_satellite:"🛰",astonished:"😲",athletic_shoe:"👟",atm:"🏧",atom_symbol:"⚛️",avocado:"🥑",b:"🅱️",baby:"👶",baby_bottle:"🍼",baby_chick:"🐤",baby_symbol:"🚼",back:"🔙",bacon:"🥓",badminton:"🏸",baggage_claim:"🛄",baguette_bread:"🥖",balance_scale:"⚖️",balloon:"🎈",ballot_box:"🗳",ballot_box_with_check:"☑️",bamboo:"🎍",banana:"🍌",bangbang:"‼️",bank:"🏦",bar_chart:"📊",barber:"💈",baseball:"⚾️",basketball:"🏀",basketball_man:"⛹️",basketball_woman:"⛹️‍♀️",bat:"🦇",bath:"🛀",bathtub:"🛁",battery:"🔋",beach_umbrella:"🏖",bear:"🐻",bed:"🛏",bee:"🐝",beer:"🍺",beers:"🍻",beetle:"🐞",beginner:"🔰",bell:"🔔",bellhop_bell:"🛎",bento:"🍱",biking_man:"🚴",bike:"🚲",biking_woman:"🚴‍♀️",bikini:"👙",biohazard:"☣️",bird:"🐦",birthday:"🎂",black_circle:"⚫️",black_flag:"🏴",black_heart:"🖤",black_joker:"🃏",black_large_square:"⬛️",black_medium_small_square:"◾️",black_medium_square:"◼️",black_nib:"✒️",black_small_square:"▪️",black_square_button:"🔲",blonde_man:"👱",blonde_woman:"👱‍♀️",blossom:"🌼",blowfish:"🐡",blue_book:"📘",blue_car:"🚙",blue_heart:"💙",blush:"😊",boar:"🐗",boat:"⛵️",bomb:"💣",book:"📖",bookmark:"🔖",bookmark_tabs:"📑",books:"📚",boom:"💥",boot:"👢",bouquet:"💐",bowing_man:"🙇",bow_and_arrow:"🏹",bowing_woman:"🙇‍♀️",bowling:"🎳",boxing_glove:"🥊",boy:"👦",bread:"🍞",bride_with_veil:"👰",bridge_at_night:"🌉",briefcase:"💼",broken_heart:"💔",bug:"🐛",building_construction:"🏗",bulb:"💡",bullettrain_front:"🚅",bullettrain_side:"🚄",burrito:"🌯",bus:"🚌",business_suit_levitating:"🕴",busstop:"🚏",bust_in_silhouette:"👤",busts_in_silhouette:"👥",butterfly:"🦋",cactus:"🌵",cake:"🍰",calendar:"📆",call_me_hand:"🤙",calling:"📲",camel:"🐫",camera:"📷",camera_flash:"📸",camping:"🏕",cancer:"♋️",candle:"🕯",candy:"🍬",canoe:"🛶",capital_abcd:"🔠",capricorn:"♑️",car:"🚗",card_file_box:"🗃",card_index:"📇",card_index_dividers:"🗂",carousel_horse:"🎠",carrot:"🥕",cat:"🐱",cat2:"🐈",cd:"💿",chains:"⛓",champagne:"🍾",chart:"💹",chart_with_downwards_trend:"📉",chart_with_upwards_trend:"📈",checkered_flag:"🏁",cheese:"🧀",cherries:"🍒",cherry_blossom:"🌸",chestnut:"🌰",chicken:"🐔",children_crossing:"🚸",chipmunk:"🐿",chocolate_bar:"🍫",christmas_tree:"🎄",church:"⛪️",cinema:"🎦",circus_tent:"🎪",city_sunrise:"🌇",city_sunset:"🌆",cityscape:"🏙",cl:"🆑",clamp:"🗜",clap:"👏",clapper:"🎬",classical_building:"🏛",clinking_glasses:"🥂",clipboard:"📋",clock1:"🕐",clock10:"🕙",clock1030:"🕥",clock11:"🕚",clock1130:"🕦",clock12:"🕛",clock1230:"🕧",clock130:"🕜",clock2:"🕑",clock230:"🕝",clock3:"🕒",clock330:"🕞",clock4:"🕓",clock430:"🕟",clock5:"🕔",clock530:"🕠",clock6:"🕕",clock630:"🕡",clock7:"🕖",clock730:"🕢",clock8:"🕗",clock830:"🕣",clock9:"🕘",clock930:"🕤",closed_book:"📕",closed_lock_with_key:"🔐",closed_umbrella:"🌂",cloud:"☁️",cloud_with_lightning:"🌩",cloud_with_lightning_and_rain:"⛈",cloud_with_rain:"🌧",cloud_with_snow:"🌨",clown_face:"🤡",clubs:"♣️",cocktail:"🍸",coffee:"☕️",coffin:"⚰️",cold_sweat:"😰",comet:"☄️",computer:"💻",computer_mouse:"🖱",confetti_ball:"🎊",confounded:"😖",confused:"😕",congratulations:"㊗️",construction:"🚧",construction_worker_man:"👷",construction_worker_woman:"👷‍♀️",control_knobs:"🎛",convenience_store:"🏪",cookie:"🍪",cool:"🆒",policeman:"👮",copyright:"©️",corn:"🌽",couch_and_lamp:"🛋",couple:"👫",couple_with_heart_woman_man:"💑",couple_with_heart_man_man:"👨‍❤️‍👨",couple_with_heart_woman_woman:"👩‍❤️‍👩",couplekiss_man_man:"👨‍❤️‍💋‍👨",couplekiss_man_woman:"💏",couplekiss_woman_woman:"👩‍❤️‍💋‍👩",cow:"🐮",cow2:"🐄",cowboy_hat_face:"🤠",crab:"🦀",crayon:"🖍",credit_card:"💳",crescent_moon:"🌙",cricket:"🏏",crocodile:"🐊",croissant:"🥐",crossed_fingers:"🤞",crossed_flags:"🎌",crossed_swords:"⚔️",crown:"👑",cry:"😢",crying_cat_face:"😿",crystal_ball:"🔮",cucumber:"🥒",cupid:"💘",curly_loop:"➰",currency_exchange:"💱",curry:"🍛",custard:"🍮",customs:"🛃",cyclone:"🌀",dagger:"🗡",dancer:"💃",dancing_women:"👯",dancing_men:"👯‍♂️",dango:"🍡",dark_sunglasses:"🕶",dart:"🎯",dash:"💨",date:"📅",deciduous_tree:"🌳",deer:"🦌",department_store:"🏬",derelict_house:"🏚",desert:"🏜",desert_island:"🏝",desktop_computer:"🖥",male_detective:"🕵️",diamond_shape_with_a_dot_inside:"💠",diamonds:"♦️",disappointed:"😞",disappointed_relieved:"😥",dizzy:"💫",dizzy_face:"😵",do_not_litter:"🚯",dog:"🐶",dog2:"🐕",dollar:"💵",dolls:"🎎",dolphin:"🐬",door:"🚪",doughnut:"🍩",dove:"🕊",dragon:"🐉",dragon_face:"🐲",dress:"👗",dromedary_camel:"🐪",drooling_face:"🤤",droplet:"💧",drum:"🥁",duck:"🦆",dvd:"📀","e-mail":"📧",eagle:"🦅",ear:"👂",ear_of_rice:"🌾",earth_africa:"🌍",earth_americas:"🌎",earth_asia:"🌏",egg:"🥚",eggplant:"🍆",eight_pointed_black_star:"✴️",eight_spoked_asterisk:"✳️",electric_plug:"🔌",elephant:"🐘",email:"✉️",end:"🔚",envelope_with_arrow:"📩",euro:"💶",european_castle:"🏰",european_post_office:"🏤",evergreen_tree:"🌲",exclamation:"❗️",expressionless:"😑",eye:"👁",eye_speech_bubble:"👁‍🗨",eyeglasses:"👓",eyes:"👀",face_with_head_bandage:"🤕",face_with_thermometer:"🤒",fist_oncoming:"👊",factory:"🏭",fallen_leaf:"🍂",family_man_woman_boy:"👪",family_man_boy:"👨‍👦",family_man_boy_boy:"👨‍👦‍👦",family_man_girl:"👨‍👧",family_man_girl_boy:"👨‍👧‍👦",family_man_girl_girl:"👨‍👧‍👧",family_man_man_boy:"👨‍👨‍👦",family_man_man_boy_boy:"👨‍👨‍👦‍👦",family_man_man_girl:"👨‍👨‍👧",family_man_man_girl_boy:"👨‍👨‍👧‍👦",family_man_man_girl_girl:"👨‍👨‍👧‍👧",family_man_woman_boy_boy:"👨‍👩‍👦‍👦",family_man_woman_girl:"👨‍👩‍👧",family_man_woman_girl_boy:"👨‍👩‍👧‍👦",family_man_woman_girl_girl:"👨‍👩‍👧‍👧",family_woman_boy:"👩‍👦",family_woman_boy_boy:"👩‍👦‍👦",family_woman_girl:"👩‍👧",family_woman_girl_boy:"👩‍👧‍👦",family_woman_girl_girl:"👩‍👧‍👧",family_woman_woman_boy:"👩‍👩‍👦",family_woman_woman_boy_boy:"👩‍👩‍👦‍👦",family_woman_woman_girl:"👩‍👩‍👧",family_woman_woman_girl_boy:"👩‍👩‍👧‍👦",family_woman_woman_girl_girl:"👩‍👩‍👧‍👧",fast_forward:"⏩",fax:"📠",fearful:"😨",feet:"🐾",female_detective:"🕵️‍♀️",ferris_wheel:"🎡",ferry:"⛴",field_hockey:"🏑",file_cabinet:"🗄",file_folder:"📁",film_projector:"📽",film_strip:"🎞",fire:"🔥",fire_engine:"🚒",fireworks:"🎆",first_quarter_moon:"🌓",first_quarter_moon_with_face:"🌛",fish:"🐟",fish_cake:"🍥",fishing_pole_and_fish:"🎣",fist_raised:"✊",fist_left:"🤛",fist_right:"🤜",flags:"🎏",flashlight:"🔦",fleur_de_lis:"⚜️",flight_arrival:"🛬",flight_departure:"🛫",floppy_disk:"💾",flower_playing_cards:"🎴",flushed:"😳",fog:"🌫",foggy:"🌁",football:"🏈",footprints:"👣",fork_and_knife:"🍴",fountain:"⛲️",fountain_pen:"🖋",four_leaf_clover:"🍀",fox_face:"🦊",framed_picture:"🖼",free:"🆓",fried_egg:"🍳",fried_shrimp:"🍤",fries:"🍟",frog:"🐸",frowning:"😦",frowning_face:"☹️",frowning_man:"🙍‍♂️",frowning_woman:"🙍",middle_finger:"🖕",fuelpump:"⛽️",full_moon:"🌕",full_moon_with_face:"🌝",funeral_urn:"⚱️",game_die:"🎲",gear:"⚙️",gem:"💎",gemini:"♊️",ghost:"👻",gift:"🎁",gift_heart:"💝",girl:"👧",globe_with_meridians:"🌐",goal_net:"🥅",goat:"🐐",golf:"⛳️",golfing_man:"🏌️",golfing_woman:"🏌️‍♀️",gorilla:"🦍",grapes:"🍇",green_apple:"🍏",green_book:"📗",green_heart:"💚",green_salad:"🥗",grey_exclamation:"❕",grey_question:"❔",grimacing:"😬",grin:"😁",grinning:"😀",guardsman:"💂",guardswoman:"💂‍♀️",guitar:"🎸",gun:"🔫",haircut_woman:"💇",haircut_man:"💇‍♂️",hamburger:"🍔",hammer:"🔨",hammer_and_pick:"⚒",hammer_and_wrench:"🛠",hamster:"🐹",hand:"✋",handbag:"👜",handshake:"🤝",hankey:"💩",hatched_chick:"🐥",hatching_chick:"🐣",headphones:"🎧",hear_no_evil:"🙉",heart:"❤️",heart_decoration:"💟",heart_eyes:"😍",heart_eyes_cat:"😻",heartbeat:"💓",heartpulse:"💗",hearts:"♥️",heavy_check_mark:"✔️",heavy_division_sign:"➗",heavy_dollar_sign:"💲",heavy_heart_exclamation:"❣️",heavy_minus_sign:"➖",heavy_multiplication_x:"✖️",heavy_plus_sign:"➕",helicopter:"🚁",herb:"🌿",hibiscus:"🌺",high_brightness:"🔆",high_heel:"👠",hocho:"🔪",hole:"🕳",honey_pot:"🍯",horse:"🐴",horse_racing:"🏇",hospital:"🏥",hot_pepper:"🌶",hotdog:"🌭",hotel:"🏨",hotsprings:"♨️",hourglass:"⌛️",hourglass_flowing_sand:"⏳",house:"🏠",house_with_garden:"🏡",houses:"🏘",hugs:"🤗",hushed:"😯",ice_cream:"🍨",ice_hockey:"🏒",ice_skate:"⛸",icecream:"🍦",id:"🆔",ideograph_advantage:"🉐",imp:"👿",inbox_tray:"📥",incoming_envelope:"📨",tipping_hand_woman:"💁",information_source:"ℹ️",innocent:"😇",interrobang:"⁉️",iphone:"📱",izakaya_lantern:"🏮",jack_o_lantern:"🎃",japan:"🗾",japanese_castle:"🏯",japanese_goblin:"👺",japanese_ogre:"👹",jeans:"👖",joy:"😂",joy_cat:"😹",joystick:"🕹",kaaba:"🕋",key:"🔑",keyboard:"⌨️",keycap_ten:"🔟",kick_scooter:"🛴",kimono:"👘",kiss:"💋",kissing:"😗",kissing_cat:"😽",kissing_closed_eyes:"😚",kissing_heart:"😘",kissing_smiling_eyes:"😙",kiwi_fruit:"🥝",koala:"🐨",koko:"🈁",label:"🏷",large_blue_circle:"🔵",large_blue_diamond:"🔷",large_orange_diamond:"🔶",last_quarter_moon:"🌗",last_quarter_moon_with_face:"🌜",latin_cross:"✝️",laughing:"😆",leaves:"🍃",ledger:"📒",left_luggage:"🛅",left_right_arrow:"↔️",leftwards_arrow_with_hook:"↩️",lemon:"🍋",leo:"♌️",leopard:"🐆",level_slider:"🎚",libra:"♎️",light_rail:"🚈",link:"🔗",lion:"🦁",lips:"👄",lipstick:"💄",lizard:"🦎",lock:"🔒",lock_with_ink_pen:"🔏",lollipop:"🍭",loop:"➿",loud_sound:"🔊",loudspeaker:"📢",love_hotel:"🏩",love_letter:"💌",low_brightness:"🔅",lying_face:"🤥",m:"Ⓜ️",mag:"🔍",mag_right:"🔎",mahjong:"🀄️",mailbox:"📫",mailbox_closed:"📪",mailbox_with_mail:"📬",mailbox_with_no_mail:"📭",man:"👨",man_artist:"👨‍🎨",man_astronaut:"👨‍🚀",man_cartwheeling:"🤸‍♂️",man_cook:"👨‍🍳",man_dancing:"🕺",man_facepalming:"🤦‍♂️",man_factory_worker:"👨‍🏭",man_farmer:"👨‍🌾",man_firefighter:"👨‍🚒",man_health_worker:"👨‍⚕️",man_in_tuxedo:"🤵",man_judge:"👨‍⚖️",man_juggling:"🤹‍♂️",man_mechanic:"👨‍🔧",man_office_worker:"👨‍💼",man_pilot:"👨‍✈️",man_playing_handball:"🤾‍♂️",man_playing_water_polo:"🤽‍♂️",man_scientist:"👨‍🔬",man_shrugging:"🤷‍♂️",man_singer:"👨‍🎤",man_student:"👨‍🎓",man_teacher:"👨‍🏫",man_technologist:"👨‍💻",man_with_gua_pi_mao:"👲",man_with_turban:"👳",tangerine:"🍊",mans_shoe:"👞",mantelpiece_clock:"🕰",maple_leaf:"🍁",martial_arts_uniform:"🥋",mask:"😷",massage_woman:"💆",massage_man:"💆‍♂️",meat_on_bone:"🍖",medal_military:"🎖",medal_sports:"🏅",mega:"📣",melon:"🍈",memo:"📝",men_wrestling:"🤼‍♂️",menorah:"🕎",mens:"🚹",metal:"🤘",metro:"🚇",microphone:"🎤",microscope:"🔬",milk_glass:"🥛",milky_way:"🌌",minibus:"🚐",minidisc:"💽",mobile_phone_off:"📴",money_mouth_face:"🤑",money_with_wings:"💸",moneybag:"💰",monkey:"🐒",monkey_face:"🐵",monorail:"🚝",moon:"🌔",mortar_board:"🎓",mosque:"🕌",motor_boat:"🛥",motor_scooter:"🛵",motorcycle:"🏍",motorway:"🛣",mount_fuji:"🗻",mountain:"⛰",mountain_biking_man:"🚵",mountain_biking_woman:"🚵‍♀️",mountain_cableway:"🚠",mountain_railway:"🚞",mountain_snow:"🏔",mouse:"🐭",mouse2:"🐁",movie_camera:"🎥",moyai:"🗿",mrs_claus:"🤶",muscle:"💪",mushroom:"🍄",musical_keyboard:"🎹",musical_note:"🎵",musical_score:"🎼",mute:"🔇",nail_care:"💅",name_badge:"📛",national_park:"🏞",nauseated_face:"🤢",necktie:"👔",negative_squared_cross_mark:"❎",nerd_face:"🤓",neutral_face:"😐",new:"🆕",new_moon:"🌑",new_moon_with_face:"🌚",newspaper:"📰",newspaper_roll:"🗞",next_track_button:"⏭",ng:"🆖",no_good_man:"🙅‍♂️",no_good_woman:"🙅",night_with_stars:"🌃",no_bell:"🔕",no_bicycles:"🚳",no_entry:"⛔️",no_entry_sign:"🚫",no_mobile_phones:"📵",no_mouth:"😶",no_pedestrians:"🚷",no_smoking:"🚭","non-potable_water":"🚱",nose:"👃",notebook:"📓",notebook_with_decorative_cover:"📔",notes:"🎶",nut_and_bolt:"🔩",o:"⭕️",o2:"🅾️",ocean:"🌊",octopus:"🐙",oden:"🍢",office:"🏢",oil_drum:"🛢",ok:"🆗",ok_hand:"👌",ok_man:"🙆‍♂️",ok_woman:"🙆",old_key:"🗝",older_man:"👴",older_woman:"👵",om:"🕉",on:"🔛",oncoming_automobile:"🚘",oncoming_bus:"🚍",oncoming_police_car:"🚔",oncoming_taxi:"🚖",open_file_folder:"📂",open_hands:"👐",open_mouth:"😮",open_umbrella:"☂️",ophiuchus:"⛎",orange_book:"📙",orthodox_cross:"☦️",outbox_tray:"📤",owl:"🦉",ox:"🐂",package:"📦",page_facing_up:"📄",page_with_curl:"📃",pager:"📟",paintbrush:"🖌",palm_tree:"🌴",pancakes:"🥞",panda_face:"🐼",paperclip:"📎",paperclips:"🖇",parasol_on_ground:"⛱",parking:"🅿️",part_alternation_mark:"〽️",partly_sunny:"⛅️",passenger_ship:"🛳",passport_control:"🛂",pause_button:"⏸",peace_symbol:"☮️",peach:"🍑",peanuts:"🥜",pear:"🍐",pen:"🖊",pencil2:"✏️",penguin:"🐧",pensive:"😔",performing_arts:"🎭",persevere:"😣",person_fencing:"🤺",pouting_woman:"🙎",phone:"☎️",pick:"⛏",pig:"🐷",pig2:"🐖",pig_nose:"🐽",pill:"💊",pineapple:"🍍",ping_pong:"🏓",pisces:"♓️",pizza:"🍕",place_of_worship:"🛐",plate_with_cutlery:"🍽",play_or_pause_button:"⏯",point_down:"👇",point_left:"👈",point_right:"👉",point_up:"☝️",point_up_2:"👆",police_car:"🚓",policewoman:"👮‍♀️",poodle:"🐩",popcorn:"🍿",post_office:"🏣",postal_horn:"📯",postbox:"📮",potable_water:"🚰",potato:"🥔",pouch:"👝",poultry_leg:"🍗",pound:"💷",rage:"😡",pouting_cat:"😾",pouting_man:"🙎‍♂️",pray:"🙏",prayer_beads:"📿",pregnant_woman:"🤰",previous_track_button:"⏮",prince:"🤴",princess:"👸",printer:"🖨",purple_heart:"💜",purse:"👛",pushpin:"📌",put_litter_in_its_place:"🚮",question:"❓",rabbit:"🐰",rabbit2:"🐇",racehorse:"🐎",racing_car:"🏎",radio:"📻",radio_button:"🔘",radioactive:"☢️",railway_car:"🚃",railway_track:"🛤",rainbow:"🌈",rainbow_flag:"🏳️‍🌈",raised_back_of_hand:"🤚",raised_hand_with_fingers_splayed:"🖐",raised_hands:"🙌",raising_hand_woman:"🙋",raising_hand_man:"🙋‍♂️",ram:"🐏",ramen:"🍜",rat:"🐀",record_button:"⏺",recycle:"♻️",red_circle:"🔴",registered:"®️",relaxed:"☺️",relieved:"😌",reminder_ribbon:"🎗",repeat:"🔁",repeat_one:"🔂",rescue_worker_helmet:"⛑",restroom:"🚻",revolving_hearts:"💞",rewind:"⏪",rhinoceros:"🦏",ribbon:"🎀",rice:"🍚",rice_ball:"🍙",rice_cracker:"🍘",rice_scene:"🎑",right_anger_bubble:"🗯",ring:"💍",robot:"🤖",rocket:"🚀",rofl:"🤣",roll_eyes:"🙄",roller_coaster:"🎢",rooster:"🐓",rose:"🌹",rosette:"🏵",rotating_light:"🚨",round_pushpin:"📍",rowing_man:"🚣",rowing_woman:"🚣‍♀️",rugby_football:"🏉",running_man:"🏃",running_shirt_with_sash:"🎽",running_woman:"🏃‍♀️",sa:"🈂️",sagittarius:"♐️",sake:"🍶",sandal:"👡",santa:"🎅",satellite:"📡",saxophone:"🎷",school:"🏫",school_satchel:"🎒",scissors:"✂️",scorpion:"🦂",scorpius:"♏️",scream:"😱",scream_cat:"🙀",scroll:"📜",seat:"💺",secret:"㊙️",see_no_evil:"🙈",seedling:"🌱",selfie:"🤳",shallow_pan_of_food:"🥘",shamrock:"☘️",shark:"🦈",shaved_ice:"🍧",sheep:"🐑",shell:"🐚",shield:"🛡",shinto_shrine:"⛩",ship:"🚢",shirt:"👕",shopping:"🛍",shopping_cart:"🛒",shower:"🚿",shrimp:"🦐",signal_strength:"📶",six_pointed_star:"🔯",ski:"🎿",skier:"⛷",skull:"💀",skull_and_crossbones:"☠️",sleeping:"😴",sleeping_bed:"🛌",sleepy:"😪",slightly_frowning_face:"🙁",slightly_smiling_face:"🙂",slot_machine:"🎰",small_airplane:"🛩",small_blue_diamond:"🔹",small_orange_diamond:"🔸",small_red_triangle:"🔺",small_red_triangle_down:"🔻",smile:"😄",smile_cat:"😸",smiley:"😃",smiley_cat:"😺",smiling_imp:"😈",smirk:"😏",smirk_cat:"😼",smoking:"🚬",snail:"🐌",snake:"🐍",sneezing_face:"🤧",snowboarder:"🏂",snowflake:"❄️",snowman:"⛄️",snowman_with_snow:"☃️",sob:"😭",soccer:"⚽️",soon:"🔜",sos:"🆘",sound:"🔉",space_invader:"👾",spades:"♠️",spaghetti:"🍝",sparkle:"❇️",sparkler:"🎇",sparkles:"✨",sparkling_heart:"💖",speak_no_evil:"🙊",speaker:"🔈",speaking_head:"🗣",speech_balloon:"💬",speedboat:"🚤",spider:"🕷",spider_web:"🕸",spiral_calendar:"🗓",spiral_notepad:"🗒",spoon:"🥄",squid:"🦑",stadium:"🏟",star:"⭐️",star2:"🌟",star_and_crescent:"☪️",star_of_david:"✡️",stars:"🌠",station:"🚉",statue_of_liberty:"🗽",steam_locomotive:"🚂",stew:"🍲",stop_button:"⏹",stop_sign:"🛑",stopwatch:"⏱",straight_ruler:"📏",strawberry:"🍓",stuck_out_tongue:"😛",stuck_out_tongue_closed_eyes:"😝",stuck_out_tongue_winking_eye:"😜",studio_microphone:"🎙",stuffed_flatbread:"🥙",sun_behind_large_cloud:"🌥",sun_behind_rain_cloud:"🌦",sun_behind_small_cloud:"🌤",sun_with_face:"🌞",sunflower:"🌻",sunglasses:"😎",sunny:"☀️",sunrise:"🌅",sunrise_over_mountains:"🌄",surfing_man:"🏄",surfing_woman:"🏄‍♀️",sushi:"🍣",suspension_railway:"🚟",sweat:"😓",sweat_drops:"💦",sweat_smile:"😅",sweet_potato:"🍠",swimming_man:"🏊",swimming_woman:"🏊‍♀️",symbols:"🔣",synagogue:"🕍",syringe:"💉",taco:"🌮",tada:"🎉",tanabata_tree:"🎋",taurus:"♉️",taxi:"🚕",tea:"🍵",telephone_receiver:"📞",telescope:"🔭",tennis:"🎾",tent:"⛺️",thermometer:"🌡",thinking:"🤔",thought_balloon:"💭",ticket:"🎫",tickets:"🎟",tiger:"🐯",tiger2:"🐅",timer_clock:"⏲",tipping_hand_man:"💁‍♂️",tired_face:"😫",tm:"™️",toilet:"🚽",tokyo_tower:"🗼",tomato:"🍅",tongue:"👅",top:"🔝",tophat:"🎩",tornado:"🌪",trackball:"🖲",tractor:"🚜",traffic_light:"🚥",train:"🚋",train2:"🚆",tram:"🚊",triangular_flag_on_post:"🚩",triangular_ruler:"📐",trident:"🔱",triumph:"😤",trolleybus:"🚎",trophy:"🏆",tropical_drink:"🍹",tropical_fish:"🐠",truck:"🚚",trumpet:"🎺",tulip:"🌷",tumbler_glass:"🥃",turkey:"🦃",turtle:"🐢",tv:"📺",twisted_rightwards_arrows:"🔀",two_hearts:"💕",two_men_holding_hands:"👬",two_women_holding_hands:"👭",u5272:"🈹",u5408:"🈴",u55b6:"🈺",u6307:"🈯️",u6708:"🈷️",u6709:"🈶",u6e80:"🈵",u7121:"🈚️",u7533:"🈸",u7981:"🈲",u7a7a:"🈳",umbrella:"☔️",unamused:"😒",underage:"🔞",unicorn:"🦄",unlock:"🔓",up:"🆙",upside_down_face:"🙃",v:"✌️",vertical_traffic_light:"🚦",vhs:"📼",vibration_mode:"📳",video_camera:"📹",video_game:"🎮",violin:"🎻",virgo:"♍️",volcano:"🌋",volleyball:"🏐",vs:"🆚",vulcan_salute:"🖖",walking_man:"🚶",walking_woman:"🚶‍♀️",waning_crescent_moon:"🌘",waning_gibbous_moon:"🌖",warning:"⚠️",wastebasket:"🗑",watch:"⌚️",water_buffalo:"🐃",watermelon:"🍉",wave:"👋",wavy_dash:"〰️",waxing_crescent_moon:"🌒",wc:"🚾",weary:"😩",wedding:"💒",weight_lifting_man:"🏋️",weight_lifting_woman:"🏋️‍♀️",whale:"🐳",whale2:"🐋",wheel_of_dharma:"☸️",wheelchair:"♿️",white_check_mark:"✅",white_circle:"⚪️",white_flag:"🏳️",white_flower:"💮",white_large_square:"⬜️",white_medium_small_square:"◽️",white_medium_square:"◻️",white_small_square:"▫️",white_square_button:"🔳",wilted_flower:"🥀",wind_chime:"🎐",wind_face:"🌬",wine_glass:"🍷",wink:"😉",wolf:"🐺",woman:"👩",woman_artist:"👩‍🎨",woman_astronaut:"👩‍🚀",woman_cartwheeling:"🤸‍♀️",woman_cook:"👩‍🍳",woman_facepalming:"🤦‍♀️",woman_factory_worker:"👩‍🏭",woman_farmer:"👩‍🌾",woman_firefighter:"👩‍🚒",woman_health_worker:"👩‍⚕️",woman_judge:"👩‍⚖️",woman_juggling:"🤹‍♀️",woman_mechanic:"👩‍🔧",woman_office_worker:"👩‍💼",woman_pilot:"👩‍✈️",woman_playing_handball:"🤾‍♀️",woman_playing_water_polo:"🤽‍♀️",woman_scientist:"👩‍🔬",woman_shrugging:"🤷‍♀️",woman_singer:"👩‍🎤",woman_student:"👩‍🎓",woman_teacher:"👩‍🏫",woman_technologist:"👩‍💻",woman_with_turban:"👳‍♀️",womans_clothes:"👚",womans_hat:"👒",women_wrestling:"🤼‍♀️",womens:"🚺",world_map:"🗺",worried:"😟",wrench:"🔧",writing_hand:"✍️",x:"❌",yellow_heart:"💛",yen:"💴",yin_yang:"☯️",yum:"😋",zap:"⚡️",zipper_mouth_face:"🤐",zzz:"💤",octocat:':octocat:',showdown:`S`},n.Converter=function(f){var D={},N=[],B=[],z={},se=c,W={parsed:{},raw:"",format:""};Se();function Se(){f=f||{};for(var Z in l)l.hasOwnProperty(Z)&&(D[Z]=l[Z]);if(typeof f=="object")for(var ve in f)f.hasOwnProperty(ve)&&(D[ve]=f[ve]);else throw Error("Converter expects the passed parameter to be an object, but "+typeof f+" was passed instead.");D.extensions&&n.helper.forEach(D.extensions,We)}function We(Z,ve){if(ve=ve||null,n.helper.isString(Z))if(Z=n.helper.stdExtName(Z),ve=Z,n.extensions[Z]){console.warn("DEPRECATION WARNING: "+Z+" is an old extension that uses a deprecated loading method.Please inform the developer that the extension should be updated!"),Qe(n.extensions[Z],Z);return}else if(!n.helper.isUndefined(o[Z]))Z=o[Z];else throw Error('Extension "'+Z+'" could not be loaded. It was either not found or is not a valid extension.');typeof Z=="function"&&(Z=Z()),n.helper.isArray(Z)||(Z=[Z]);var Me=p(Z,ve);if(!Me.valid)throw Error(Me.error);for(var Pe=0;Pe Topos - +