From 9a95028cdb4299f45a7e8b3068ca2e16cac12769 Mon Sep 17 00:00:00 2001 From: Bubobubobubobubo Date: Thu, 24 Aug 2023 10:32:01 +0000 Subject: [PATCH] deploy: ddd98bc87311e2898a80c975699c084e10b96017 --- .../{index-b720847b.js => index-08545bbe.js} | 98 +++++++++++-------- index.html | 2 +- 2 files changed, 58 insertions(+), 42 deletions(-) rename assets/{index-b720847b.js => index-08545bbe.js} (97%) diff --git a/assets/index-b720847b.js b/assets/index-08545bbe.js similarity index 97% rename from assets/index-b720847b.js rename to assets/index-08545bbe.js index 76ecfbf..45be733 100644 --- a/assets/index-b720847b.js +++ b/assets/index-08545bbe.js @@ -136,16 +136,69 @@ Click on the Topos logo in the top bar. Your URL will change to something much l `,bk=` # Time -Time in Topos can be **paused** and/or **resetted**. Musical time is flowing at a given **BPM** (_beats per minute_) like a regular drum machine. There are three core values that you will often interact with in one form or another: +Time in Topos is flowing just like on a drum machine. Topos is counting bars, beats and pulses. The time can be **paused**, **resumed** and/or **resetted**. Pulses are flowing at a given **BPM** (_beats per minute_). There are three core values that you will often interact with in one form or another: - **bars**: how many bars have elapsed since the origin of time. - **beats**: how many beats have elapsed since the beginning of the bar. - **pulse**: how many pulses have elapsed since the last beat. -To change the tempo, use the bpm(number) function. You can interact with time using interface buttons, keyboard shortcuts but also by using the play(), pause() and stop() functions. You will soon learn how to manipulate time to your liking for backtracking, jumping forward, etc... The traditional timeline model has little value when you can script everything. +To change the tempo, use the bpm(number) function. The transport is controlled by the interface buttons, by the keyboard shortcuts or using the play(), pause() and stop() functions. You will soon learn how to manipulate time to your liking for backtracking, jumping forward, etc... The traditional timeline model has little value when you can script everything. **Note:** the bpm(number) function can serve both for getting and setting the **BPM** value. +## Simple rhythms + +Let's study two very simple rhythmic functions, mod(n: ...number[]) and onbeat(...n:number[]). They are both easy to understand and powerful enough to get you to play your first rhythms. + +- mod(...n: number[]): this function will return true every _n_ pulsations. The value 1 will return true at the beginning of each beat. Floating point numbers like 0.5 or 0.25 are also accepted. Multiple values can be passed to mod to generate more complex rhythms. + + +\`\`\`javascript + mod(1) :: sound('kick').out() // A kickdrum played every beat + mod(.5) :: sound('kick').out() // A kickdrum played twice per beat + mod(.25) :: sound('kick').out() // A kickdrum played four times every beat + mod(1/3) :: sound('kick').out() // A funnier ratio! + mod(1, 2.5)::sound('hh').out() // A great high-hat pattern + mod(1,3.25,2.5)::snd('hh').out() // A somewhat weirder pattern +\`\`\` + +- onbeat(...n: number[]): By default, the bar is set in 4/4 with four beats per bar. The onbeat function allows you to lock on to a specific beat to execute some code. It can accept multiple arguments. It's usage is very straightforward and not hard to understand. You can pass integers or floating point numbers. + +\`\`\`javascript + onbeat(1,2,3,4)::snd('kick').out() // Bassdrum on each beat + onbeat(2,4)::snd('snare').out() // Snare on acccentuated beats + onbeat(1.5,2.5,3.5, 3.75)::snd('hat').out() // Cool high-hats +\`\`\` + +## Rhythm generators + +We included a bunch of popular rhythm generators in Topos such as the euclidian rhythms algorithms or the one to generate rhythms based on a binary sequence. They all work using _iterators_ that you will gradually learn to use for iterating over lists. Note that they are levaraging mod(...n:number[]) that you just learned about! + +- euclid(iterator: number, pulses: number, length: number, rotate: number): boolean: generates true or false values from an euclidian rhythm sequence. This algorithm is very popular in the electronic music making world. + +\`\`\`javascript + mod(.5) && euclid($(1), 5, 8) && snd('kick').out() + mod(.5) && euclid($(2), 2, 8) && snd('sd').out() +\`\`\` + +- bin(iterator: number, n: number): boolean: a binary rhythm generator. It transforms the given number into its binary representation (_e.g_ 34 becomes 100010). It then returns a boolean value based on the iterator in order to generate a rhythm. + + +\`\`\`javascript + mod(.5) && bin($(1), 34) && snd('kick').out() + mod(.5) && bin($(2), 48) && snd('sd').out() +\`\`\` + +If you don't find it spicy enough, you can add some more probabilities to your rhythms by taking advantage of the probability functions. See the functions documentation page to learn more about them. + +\`\`\`javascript + prob(60)::mod(.5) && euclid($(1), 5, 8) && snd('kick').out() + prob(60)::mod(.5) && euclid($(2), 3, 8) && snd('sd').out() + prob(80)::mod(.5) && sound('hh').out() +\`\`\` + +## Larger time divisions + ## Pulses To make a beat, you need a certain number of time grains or **pulses**. The **pulse** is also known as the [PPQN](https://en.wikipedia.org/wiki/Pulses_per_quarter_note). By default, Topos is using a _pulses per quarter note_ of 48. You can change it by using the ppqn(number) function. It means that the lowest possible rhythmic value is 1/48 of a quarter note. That's plenty of time already. @@ -172,25 +225,7 @@ Every script can access the current time by using the following functions: These values are **extremely useful** to craft more complex syntax or to write musical scores. However, Topos is also offering more high-level sequencing functions to make it easier to play music. -## Useful Basic Functions - -Some functions can be leveraged to play rhythms without thinking too much about the clock. Learn them well: - -- beat(...values: number[]): returns true on the given beat. You can add any number of beat values, (_e.g._ onbeat(1.2,1.5,2.3,2.5)). The function will return true only for a given pulse, which makes this function very useful for drumming. - -\`\`\`javascript - onbeat(1,2,3,4) && sound('bd').out() - onbeat(.5,.75,1) && sound('hh').out() - onbeat(3) && sound('sd').out() -\`\`\` - -- mod(...values: number[]): returns true if the current pulse is a multiple of the given value. You can add any number of values, (_e.g._ mod(.25,.75)). Note that 1 will equal to ppqn() pulses by default. Thus, mod(.5) for a **PPQN** of 48 will be 24 pulses. - -\`\`\`javascript - mod(1) && sound('bd').out() - mod(pick(.25,.5)) && sound('hh').out() - mod(.5) && sound('jvbass').out() -\`\`\` +## To document! - onbar(...values: number[]): returns true if the bar is currently equal to any of the specified values. - modbar(...values: number[]) or bmod(...): returns true if the bar is currently a multiple of any of the specified values. @@ -200,25 +235,6 @@ Some functions can be leveraged to play rhythms without thinking too much about - divbar(chunk: number): returns true for every pulse in intervals of given number of bars - divseq(...values: number[]): returns true for every pulse in intervals of given number of beats returning different value each time. -## Rhythm generators - -We included a bunch of popular rhythm generators in Topos such as the euclidian rhythms algorithms or the one to generate rhythms based on a binary sequence. They all work using _iterators_ that you will gradually learn to use for iterating over lists. - -- euclid(iterator: number, pulses: number, length: number, rotate: number): boolean: generates true or false values from an euclidian rhythm sequence. This algorithm is very popular in the electronic music making world. - -\`\`\`javascript - mod(.5) && euclid($(1), 5, 8) && snd('kick').out() - mod(.5) && euclid($(2), 2, 8) && snd('sd').out() -\`\`\` - -- bin(iterator: number, n: number): boolean: a binary rhythm generator. It transforms the given number into its binary representation (_e.g_ 34 becomes 100010). It then returns a boolean value based on the iterator in order to generate a rhythm. - - -\`\`\`javascript - mod(.5) && euclid($(1), 34) && snd('kick').out() - mod(.5) && euclid($(2), 48) && snd('sd').out() -\`\`\` - ## Using time as a conditional You can use the time functions as conditionals. The following example will play a pattern A for 2 bars and a pattern B for 2 bars: @@ -629,7 +645,7 @@ Topos is made to be controlled entirely with a keyboard. It is recommanded to st `+u.line+" | "+g+` `+m+" | "+t("",l.column-1," ")+t("",v,"^")}else a+=` at `+d}return a},e.buildMessage=function(i,a){var s={literal:function(g){return'"'+l(g.text)+'"'},class:function(g){var b=g.parts.map(function(v){return Array.isArray(v)?u(v[0])+"-"+u(v[1]):u(v)});return"["+(g.inverted?"^":"")+b.join("")+"]"},any:function(){return"any character"},end:function(){return"end of input"},other:function(g){return g.description}};function o(g){return g.charCodeAt(0).toString(16).toUpperCase()}function l(g){return 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(b){return"\\x0"+o(b)}).replace(/[\x10-\x1F\x7F-\x9F]/g,function(b){return"\\x"+o(b)})}function u(g){return g.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(b){return"\\x0"+o(b)}).replace(/[\x10-\x1F\x7F-\x9F]/g,function(b){return"\\x"+o(b)})}function d(g){return s[g.type](g)}function f(g){var b=g.map(d),v,y;if(b.sort(),b.length>0){for(v=1,y=1;v>",A="<<",D="<",M=">",w="_",B="?",re=":",ie="r",j=/^[0-9]/,J=/^[ \n\r\t]/,L=/^[mklpdcwyhnqaefsxtgujzo]/,G=vt("-",!1),Z=$n([["0","9"]],!1,!1),z=vt(".",!1),ce=qn("whitespace"),ue=$n([" ",` -`,"\r"," "],!1,!1),Te=vt(",",!1),Pe=vt("|",!1),Ve=$n(["m","k","l","p","d","c","w","y","h","n","q","a","e","f","s","x","t","g","u","j","z","o"],!1,!1),Re=vt("(",!1),Ie=vt(")",!1),le=vt("+",!1),Me=vt("*",!1),je=vt("/",!1),He=vt("%",!1),rt=vt("^",!1),ft=vt("&",!1),Ct=vt(">>",!1),Vt=vt("<<",!1),ht=vt("<",!1),Nt=vt(">",!1),kt=vt("_",!1),Qr=vt("?",!1),Fe=vt(":",!1),Mr=vt("r",!1),st=function(U){return U.filter(K=>K)},$e=function(){return parseFloat(Tr())},Pr=function(){return parseInt(Tr())},nr=function(){},mr=function(){return Yk[Tr()]},V=function(U){return U.filter(K=>K)},he=function(U){return vr(oM,{items:U})},ve=function(U,K,ae){return vr(lM,{left:U,operation:K,right:ae})},Ce=function(U){return U},Ke=function(U){return vr(Lm,{items:U})},Ee=function(U){return vr(iM,{octave:U})},Gt=function(){return Tr().split("").reduce((U,K)=>U+(K==="^"?1:-1),0)},ot=function(){return vr(FS,{seededRandom:a.seededRandom})},bt=function(U,K){return vr(FS,{min:U,max:K,seededRandom:a.seededRandom})},en=function(U,K){return vr(sM,{item:U,times:K})},lt=function(U){return vr(aM,{duration:U})},Wt=function(U){return vr(Dh,{duration:U})},St=function(U,K,ae){const _e=U?a.nodeOptions.octave+U:a.nodeOptions.octave;return vr(Ki,{duration:K,pitch:ae,octave:_e})},we=function(U,K){return vr(nM,{pitches:[U].concat(K)})},H=0,Ot=0,nt=[{line:1,column:1}],Qt=0,cr=[],ze=0,Ge={},Dt;if("startRule"in a){if(!(a.startRule in l))throw new Error(`Can't start parsing from rule "`+a.startRule+'".');u=l[a.startRule]}function Tr(){return i.substring(Ot,H)}function yi(){return $t(Ot,H)}function vt(U,K){return{type:"literal",text:U,ignoreCase:K}}function $n(U,K,ae){return{type:"class",parts:U,inverted:K,ignoreCase:ae}}function tn(){return{type:"end"}}function qn(U){return{type:"other",description:U}}function rn(U){var K=nt[U],ae;if(K)return K;for(ae=U-1;!nt[ae];)ae--;for(K=nt[ae],K={line:K.line,column:K.column};aeQt&&(Qt=H,cr=[]),cr.push(U))}function ni(U,K,ae){return new e(e.buildMessage(U,K),U,K,ae)}function Y(){var U,K,ae=H*24+0,_e=Ge[ae];return _e?(H=_e.nextPos,_e.result):(U=H,K=ye(),K!==s&&(Ot=U,K=st(K)),U=K,Ge[ae]={nextPos:H,result:U},U)}function ee(){var U,K,ae,_e,Le,Je,yr,An=H*24+1,Ri=Ge[An];if(Ri)return H=Ri.nextPos,Ri.result;for(U=H,K=H,i.charCodeAt(H)===45?(ae=d,H++):(ae=s,ze===0&&We(G)),ae===s&&(ae=null),_e=[],j.test(i.charAt(H))?(Le=i.charAt(H),H++):(Le=s,ze===0&&We(Z));Le!==s;)_e.push(Le),j.test(i.charAt(H))?(Le=i.charAt(H),H++):(Le=s,ze===0&&We(Z));if(i.charCodeAt(H)===46?(Le=f,H++):(Le=s,ze===0&&We(z)),Le!==s){if(Je=[],j.test(i.charAt(H))?(yr=i.charAt(H),H++):(yr=s,ze===0&&We(Z)),yr!==s)for(;yr!==s;)Je.push(yr),j.test(i.charAt(H))?(yr=i.charAt(H),H++):(yr=s,ze===0&&We(Z));else Je=s;Je!==s?(ae=[ae,_e,Le,Je],K=ae):(H=K,K=s)}else H=K,K=s;if(K===s)if(K=H,i.charCodeAt(H)===46?(ae=f,H++):(ae=s,ze===0&&We(z)),ae!==s){if(_e=[],j.test(i.charAt(H))?(Le=i.charAt(H),H++):(Le=s,ze===0&&We(Z)),Le!==s)for(;Le!==s;)_e.push(Le),j.test(i.charAt(H))?(Le=i.charAt(H),H++):(Le=s,ze===0&&We(Z));else _e=s;_e!==s?(ae=[ae,_e],K=ae):(H=K,K=s)}else H=K,K=s;return K!==s&&(Ot=U,K=$e()),U=K,Ge[An]={nextPos:H,result:U},U}function se(){var U,K,ae=H*24+2,_e=Ge[ae];return _e?(H=_e.nextPos,_e.result):(U=H,i.charCodeAt(H)===45?H++:ze===0&&We(G),j.test(i.charAt(H))?(K=i.charAt(H),H++):(K=s,ze===0&&We(Z)),K!==s?(Ot=U,U=Pr()):(H=U,U=s),Ge[ae]={nextPos:H,result:U},U)}function fe(){var U,K,ae=H*24+3,_e=Ge[ae];return _e?(H=_e.nextPos,_e.result):(ze++,U=H,J.test(i.charAt(H))?(K=i.charAt(H),H++):(K=s,ze===0&&We(ue)),K!==s&&(Ot=U,K=nr()),U=K,ze--,U===s&&(K=s,ze===0&&We(ce)),Ge[ae]={nextPos:H,result:U},U)}function Se(){var U,K,ae=H*24+7,_e=Ge[ae];return _e?(H=_e.nextPos,_e.result):(U=H,L.test(i.charAt(H))?(K=i.charAt(H),H++):(K=s,ze===0&&We(Ve)),K!==s&&(Ot=U,K=mr()),U=K,Ge[ae]={nextPos:H,result:U},U)}function xe(){var U,K=H*24+8,ae=Ge[K];return ae?(H=ae.nextPos,ae.result):(U=Se(),U===s&&(U=ee()),Ge[K]={nextPos:H,result:U},U)}function ye(){var U,K,ae,_e=H*24+9,Le=Ge[_e];if(Le)return H=Le.nextPos,Le.result;if(U=H,K=[],ae=Ai(),ae===s&&(ae=_r(),ae===s&&(ae=dt(),ae===s&&(ae=ii(),ae===s&&(ae=ai())))),ae!==s)for(;ae!==s;)K.push(ae),ae=Ai(),ae===s&&(ae=_r(),ae===s&&(ae=dt(),ae===s&&(ae=ii(),ae===s&&(ae=ai()))));else K=s;return K!==s&&(Ot=U,K=V(K)),U=K,Ge[_e]={nextPos:H,result:U},U}function dt(){var U,K,ae,_e,Le=H*24+10,Je=Ge[Le];return Je?(H=Je.nextPos,Je.result):(U=H,i.charCodeAt(H)===40?(K=b,H++):(K=s,ze===0&&We(Re)),K!==s?(ae=ye(),ae!==s?(i.charCodeAt(H)===41?(_e=v,H++):(_e=s,ze===0&&We(Ie)),_e!==s?(Ot=U,U=he(ae)):(H=U,U=s)):(H=U,U=s)):(H=U,U=s),Ge[Le]={nextPos:H,result:U},U)}function _r(){var U,K,ae,_e,Le=H*24+11,Je=Ge[Le];return Je?(H=Je.nextPos,Je.result):(U=H,K=dt(),K!==s?(ae=$r(),ae!==s?(_e=dt(),_e!==s?(Ot=U,U=ve(K,ae,_e)):(H=U,U=s)):(H=U,U=s)):(H=U,U=s),Ge[Le]={nextPos:H,result:U},U)}function $r(){var U,K=H*24+12,ae=Ge[K];return ae?(H=ae.nextPos,ae.result):(i.charCodeAt(H)===43?(U=y,H++):(U=s,ze===0&&We(le)),U===s&&(i.charCodeAt(H)===45?(U=d,H++):(U=s,ze===0&&We(G)),U===s&&(i.charCodeAt(H)===42?(U=N,H++):(U=s,ze===0&&We(Me)),U===s&&(i.charCodeAt(H)===47?(U=F,H++):(U=s,ze===0&&We(je)),U===s&&(i.charCodeAt(H)===37?(U=X,H++):(U=s,ze===0&&We(He)),U===s&&(i.charCodeAt(H)===94?(U=p,H++):(U=s,ze===0&&We(rt)),U===s&&(i.charCodeAt(H)===124?(U=g,H++):(U=s,ze===0&&We(Pe)),U===s&&(i.charCodeAt(H)===38?(U=E,H++):(U=s,ze===0&&We(ft)),U===s&&(i.substr(H,2)===O?(U=O,H+=2):(U=s,ze===0&&We(Ct)),U===s&&(i.substr(H,2)===A?(U=A,H+=2):(U=s,ze===0&&We(Vt))))))))))),Ge[K]={nextPos:H,result:U},U)}function ii(){var U,K,ae=H*24+13,_e=Ge[ae];return _e?(H=_e.nextPos,_e.result):(U=H,K=ra(),K===s&&(K=na(),K===s&&(K=si(),K===s&&(K=Va(),K===s&&(K=fe(),K===s&&(K=za(),K===s&&(K=Ha(),K===s&&(K=ta(),K===s&&(K=dt())))))))),K!==s&&(Ot=U,K=Ce(K)),U=K,Ge[ae]={nextPos:H,result:U},U)}function ai(){var U,K,ae,_e,Le=H*24+14,Je=Ge[Le];return Je?(H=Je.nextPos,Je.result):(U=H,i.charCodeAt(H)===60?(K=D,H++):(K=s,ze===0&&We(ht)),K!==s?(ae=ye(),ae!==s?(i.charCodeAt(H)===62?(_e=M,H++):(_e=s,ze===0&&We(Nt)),_e!==s?(Ot=U,U=Ke(ae)):(H=U,U=s)):(H=U,U=s)):(H=U,U=s),Ge[Le]={nextPos:H,result:U},U)}function Va(){var U,K,ae=H*24+15,_e=Ge[ae];return _e?(H=_e.nextPos,_e.result):(U=H,K=Br(),K!==s&&(Ot=U,K=Ee(K)),U=K,Ge[ae]={nextPos:H,result:U},U)}function Br(){var U,K,ae,_e=H*24+16,Le=Ge[_e];if(Le)return H=Le.nextPos,Le.result;if(U=H,K=[],i.charCodeAt(H)===94?(ae=p,H++):(ae=s,ze===0&&We(rt)),ae===s&&(i.charCodeAt(H)===95?(ae=w,H++):(ae=s,ze===0&&We(kt))),ae!==s)for(;ae!==s;)K.push(ae),i.charCodeAt(H)===94?(ae=p,H++):(ae=s,ze===0&&We(rt)),ae===s&&(i.charCodeAt(H)===95?(ae=w,H++):(ae=s,ze===0&&We(kt)));else K=s;return K!==s&&(Ot=U,K=Gt()),U=K,Ge[_e]={nextPos:H,result:U},U}function Ha(){var U,K,ae=H*24+17,_e=Ge[ae];return _e?(H=_e.nextPos,_e.result):(U=H,i.charCodeAt(H)===63?(K=B,H++):(K=s,ze===0&&We(Qr)),K!==s&&(Ot=U,K=ot()),U=K,Ge[ae]={nextPos:H,result:U},U)}function ta(){var U,K,ae,_e,Le,Je,yr=H*24+18,An=Ge[yr];return An?(H=An.nextPos,An.result):(U=H,i.charCodeAt(H)===40?(K=b,H++):(K=s,ze===0&&We(Re)),K!==s?(ae=se(),ae!==s?(i.charCodeAt(H)===44?(_e=m,H++):(_e=s,ze===0&&We(Te)),_e!==s?(Le=se(),Le!==s?(i.charCodeAt(H)===41?(Je=v,H++):(Je=s,ze===0&&We(Ie)),Je!==s?(Ot=U,U=bt(ae,Le)):(H=U,U=s)):(H=U,U=s)):(H=U,U=s)):(H=U,U=s)):(H=U,U=s),Ge[yr]={nextPos:H,result:U},U)}function Ai(){var U,K,ae,_e,Le=H*24+19,Je=Ge[Le];return Je?(H=Je.nextPos,Je.result):(U=H,K=ii(),K!==s?(i.charCodeAt(H)===58?(ae=re,H++):(ae=s,ze===0&&We(Fe)),ae!==s?(_e=se(),_e!==s?(Ot=U,U=en(K,_e)):(H=U,U=s)):(H=U,U=s)):(H=U,U=s),Ge[Le]={nextPos:H,result:U},U)}function za(){var U,K,ae=H*24+20,_e=Ge[ae];return _e?(H=_e.nextPos,_e.result):(U=H,K=xe(),K!==s&&(Ot=U,K=lt(K)),U=K,Ge[ae]={nextPos:H,result:U},U)}function ra(){var U,K,ae,_e=H*24+21,Le=Ge[_e];return Le?(H=Le.nextPos,Le.result):(U=H,K=xe(),K===s&&(K=null),i.charCodeAt(H)===114?(ae=ie,H++):(ae=s,ze===0&&We(Mr)),ae!==s?(Ot=U,U=Wt(K)):(H=U,U=s),Ge[_e]={nextPos:H,result:U},U)}function si(){var U,K,ae,_e,Le=H*24+22,Je=Ge[Le];return Je?(H=Je.nextPos,Je.result):(U=H,K=Br(),K===s&&(K=null),ae=xe(),ae===s&&(ae=null),_e=se(),_e!==s?(Ot=U,U=St(K,ae,_e)):(H=U,U=s),Ge[Le]={nextPos:H,result:U},U)}function na(){var U,K,ae,_e,Le=H*24+23,Je=Ge[Le];if(Je)return H=Je.nextPos,Je.result;if(U=H,K=si(),K!==s){if(ae=[],_e=si(),_e!==s)for(;_e!==s;)ae.push(_e),_e=si();else ae=s;ae!==s?(Ot=U,U=we(K,ae)):(H=U,U=s)}else H=U,U=s;return Ge[Le]={nextPos:H,result:U},U}var Cr=a.nodeOptions||{};function vr(U,K){K.text=Tr(),K.location=yi();for(var ae in Cr)(K[ae]===void 0||K[ae]===null)&&(K[ae]=Cr[ae]);return new U(K)}if(Dt=u(),Dt!==s&&H===i.length)return Dt;throw Dt!==s&&He.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"))}retrograde(){return this.evaluated=this.evaluated.reverse(),this}scale(e){return this.isInOptions("scaleName",e)?this:(this.update({scale:e}),this)}key(e){return console.log("KEY?",this.isInOptions("key",e)),this.isInOptions("key",e)?this:(this.update({key:e}),this)}octave(e){return this.isInOptions("octave",e)?this:(this.update({octave:e}),this)}isInOptions(e,t){return this.options.nodeOptions&&this.options.nodeOptions[e]===t}next(){this.index++,this.counter++;const e=this.evaluated[this.index%this.evaluated.length];return this.redo>0&&this.index>=this.evaluated.length*this.redo&&(this.update(),this.index=0),e}applyTransformations(){var e;(e=this.globalOptions)!=null&&e.retrograde&&(this.evaluated=this.evaluated.reverse())}clone(){return Al(this)}notStarted(){return this.index<0}peek(){return this.evaluated[this.index-1||0]}hasStarted(){return this.index>=0}evaluate(e={}){const t=this.values.map(r=>r.evaluate(e)).flat(1/0).filter(r=>r!==void 0);return t.forEach((r,i)=>{r._next=i0?i-1:t.length-1}),t}}const dM=n=>{let e={};return rM.forEach(t=>{if(n[t]!==void 0){const r=n[t];e[t]=r,delete n[t]}}),e};class pM{constructor(){R(this,"midiAccess",null);R(this,"midiOutputs",[]);R(this,"currentOutputIndex",0);R(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."),this.currentOutputIndex=-1)}catch(e){console.error("Failed to initialize MIDI:",e)}}getCurrentMidiPort(){return this.midiOutputs.length>0&&this.currentOutputIndex>=0&&this.currentOutputIndex0&&this.currentOutputIndex>=0&&this.currentOutputIndex=this.midiOutputs.length?(console.error(`Invalid MIDI output index. Index must be in the range 0-${this.midiOutputs.length-1}.`),this.currentOutputIndex):e;{const t=this.midiOutputs.findIndex(r=>r.name===e);return t!==-1?t:(console.error(`MIDI output "${e}" not found.`),this.currentOutputIndex)}}listMidiOutputs(){console.log("Available MIDI Outputs:"),this.midiOutputs.forEach((e,t)=>{console.log(`${t+1}. ${e.name}`)})}sendMidiNote(e,t,r,i,a=this.currentOutputIndex,s=void 0){typeof a=="string"&&(a=this.getMidiOutputIndex(a));const o=this.midiOutputs[a];if(e=Math.min(Math.max(e,0),127),o){const l=[144+t,e,r],u=[128+t,e,0];o.send(l),s&&this.sendPitchBend(s,t,a);const d=setTimeout(()=>{o.send(u),s&&this.sendPitchBend(8192,t,a),delete this.scheduledNotes[e]},(i-.02)*1e3);this.scheduledNotes[e]=d}else console.error("MIDI output not available.")}sendSysExMessage(e){const t=this.midiOutputs[this.currentOutputIndex];t?t.send(e):console.error("MIDI output not available.")}sendPitchBend(e,t,r=this.currentOutputIndex){(e<0||e>16383)&&console.error("Invalid pitch bend value. Value must be in the range 0-16383."),(t<0||t>15)&&console.error("Invalid MIDI channel. Channel must be in the range 0-15."),typeof r=="string"&&(r=this.getMidiOutputIndex(r));const i=this.midiOutputs[r];if(i){const a=e&127,s=e>>7&127;i.send([224|t,a,s])}else console.error("MIDI output not available.")}sendProgramChange(e,t){const r=this.midiOutputs[this.currentOutputIndex];r?r.send([192+t,e]):console.error("MIDI output not available.")}sendMidiControlChange(e,t,r){const i=this.midiOutputs[this.currentOutputIndex];i?i.send([176+r,e,t]):console.error("MIDI output not available.")}panic(){const e=this.midiOutputs[this.currentOutputIndex];if(e){for(const t in this.scheduledNotes){const r=this.scheduledNotes[t];clearTimeout(r),e.send([128,parseInt(t),0])}this.scheduledNotes={}}else console.error("MIDI output not available.")}}class fM{constructor(e,t,r){R(this,"min");R(this,"max");R(this,"wrap");R(this,"position");this.min=e,this.max=t,this.wrap=r,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 hM={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 mM(n,e="major",t=4){const r=hM[e];if(!r)throw new Error(`Unknown scale ${e}`);let i=n%r.length;i<0&&(i+=r.length);let a=Math.floor(n/r.length);return 60+(t+a)*12+r[i]}class km{constructor(e){R(this,"seedValue");R(this,"randomGen",Math.random);R(this,"app");R(this,"values",{});R(this,"odds",(e,t)=>this.randomGen()this.odds(.025,e));R(this,"rarely",e=>this.odds(.1,e));R(this,"scarcely",e=>this.odds(.25,e));R(this,"sometimes",e=>this.odds(.5,e));R(this,"often",e=>this.odds(.75,e));R(this,"frequently",e=>this.odds(.9,e));R(this,"almostAlways",e=>this.odds(.985,e));R(this,"modify",e=>e(this));R(this,"seed",e=>(this.seedValue=e.toString(),this.randomGen=this.app.api.localSeededRandom(this.seedValue),this));R(this,"clear",()=>(this.app.api.clearLocalSeed(this.seedValue),this));R(this,"apply",e=>this.modify(e));R(this,"duration",e=>(this.values.duration=e,this));this.app=e,this.app.api.currentSeed&&(this.randomGen=this.app.api.randomGen)}}class Gy extends km{constructor(t){super(t);R(this,"octave",t=>(this.values.octave=t,this.update(),this));R(this,"key",t=>(this.values.key=t,this.update(),this));R(this,"scale",t=>(Dm(t)?(this.values.scaleName=t,this.values.parsedScale=Zi(t)):this.values.parsedScale=wm(t),this.update(),this));R(this,"freq",t=>{this.values.freq=t;const r=zk(t);return r%1!==0?(this.values.note=Math.floor(r),this.values.bend=Uy(r)[1]):this.values.note=r,this});R(this,"update",()=>{})}}let Nr=[],_M=(n,e)=>{let t,r=[],i={lc:0,l:e||0,value:n,set(a){i.value=a,i.notify()},get(){return i.lc||i.listen(()=>{})(),i.value},notify(a){t=r;let s=!Nr.length;for(let o=0;o{r===t&&(r=r.slice());let o=r.indexOf(a);~o&&(r.splice(o,2),i.lc--,i.lc||i.off())}},subscribe(a,s){let o=i.listen(a,s);return a(i.value),o},off(){}};return i},gM=(n={})=>{let e=_M(n);return e.setKey=function(t,r){typeof r>"u"?t in e.value&&(e.value={...e.value},delete e.value[t],e.notify(t)):e.value[t]!==r&&(e.value={...e.value,[t]:r},e.notify(t))},e};if(typeof DelayNode<"u"){class n extends DelayNode{constructor(t,r,i,a){super(t),r=Math.abs(r),this.delayTime.value=i;const s=t.createGain();s.gain.value=Math.min(Math.abs(a),.995),this.feedback=s.gain;const o=t.createGain();return o.gain.value=r,this.delayGain=o,this.connect(s),this.connect(o),s.connect(this),this.connect=l=>o.connect(l),this}start(t){this.delayGain.gain.setValueAtTime(this.delayGain.gain.value,t+this.delayTime.value)}}AudioContext.prototype.createFeedbackDelay=function(e,t,r){return new n(this,e,t,r)}}typeof AudioContext<"u"&&(AudioContext.prototype.impulseResponse=function(n,e=1){const t=this.sampleRate*n,r=this.createBuffer(e,t,this.sampleRate),i=r.getChannelData(0);for(let a=0;a(e.buffer=this.impulseResponse(t),e.duration=n,e),e.setDuration(n),e});var YS={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 n extends GainNode{constructor(t,r){if(super(t),!YS[r])throw new Error("vowel: unknown vowel "+r);const{gains:i,qs:a,freqs:s}=YS[r],o=t.createGain();for(let l=0;l<5;l++){const u=t.createGain();u.gain.value=i[l];const d=t.createBiquadFilter();d.type="bandpass",d.Q.value=a[l],d.frequency.value=s[l],this.connect(d),d.connect(u),u.connect(o)}return o.gain.value=8,this.connect=l=>o.connect(l),this}}AudioContext.prototype.createVowelFilter=function(e){return new n(this,e)}}const SM=n=>{var i;if(typeof n!="string")return[];const[e,t="",r]=((i=n.match(/^([a-gA-G])([#bsf]*)([0-9]*)$/))==null?void 0:i.slice(1))||[];return e?[e,t,r?Number(r):void 0]:[]},OM={c:0,d:2,e:4,f:5,g:7,a:9,b:11},EM={"#":1,b:-1,s:1,f:-1},Mm=(n,e=3)=>{const[t,r,i=e]=SM(n);if(!t)throw new Error('not a note: "'+n+'"');const a=OM[t.toLowerCase()],s=(r==null?void 0:r.split("").reduce((o,l)=>o+EM[l],0))||0;return(Number(i)+1)*12+a+s},bM=n=>Math.pow(2,(n-69)/12)*440,TM=(n,e,t)=>Math.min(Math.max(n,e),t),CM=n=>12*Math.log(n/440)/Math.LN2+69,vM=(n,e)=>{if(typeof n!="object")throw new Error("valueToMidi: expected object value");let{freq:t,note:r}=n;if(typeof t=="number")return CM(t);if(typeof r=="string")return Mm(r);if(typeof r=="number")return r;if(!e)throw new Error("valueToMidi: expected freq or note to be set");return e},yM="data:application/javascript;base64,Ly8gTElDRU5TRSBHTlUgR2VuZXJhbCBQdWJsaWMgTGljZW5zZSB2My4wIHNlZSBodHRwczovL2dpdGh1Yi5jb20vZGt0cjAvV2ViRGlydC9ibG9iL21haW4vTElDRU5TRQovLyBhbGwgdGhlIGNyZWRpdCBnb2VzIHRvIGRrdHIwJ3Mgd2ViZGlydDogaHR0cHM6Ly9naXRodWIuY29tL2RrdHIwL1dlYkRpcnQvYmxvYi81Y2UzZDY5ODM2MmM1NGQ2ZTFiNjhhY2M0N2ViMjk1NWFjNjJjNzkzL2Rpc3QvQXVkaW9Xb3JrbGV0cy5qcwovLyA8MwoKY2xhc3MgQ29hcnNlUHJvY2Vzc29yIGV4dGVuZHMgQXVkaW9Xb3JrbGV0UHJvY2Vzc29yIHsKICBzdGF0aWMgZ2V0IHBhcmFtZXRlckRlc2NyaXB0b3JzKCkgewogICAgcmV0dXJuIFt7IG5hbWU6ICdjb2Fyc2UnLCBkZWZhdWx0VmFsdWU6IDEgfV07CiAgfQoKICBjb25zdHJ1Y3RvcigpIHsKICAgIHN1cGVyKCk7CiAgICB0aGlzLm5vdFN0YXJ0ZWQgPSB0cnVlOwogIH0KCiAgcHJvY2VzcyhpbnB1dHMsIG91dHB1dHMsIHBhcmFtZXRlcnMpIHsKICAgIGNvbnN0IGlucHV0ID0gaW5wdXRzWzBdOwogICAgY29uc3Qgb3V0cHV0ID0gb3V0cHV0c1swXTsKICAgIGNvbnN0IGNvYXJzZSA9IHBhcmFtZXRlcnMuY29hcnNlOwogICAgY29uc3QgYmxvY2tTaXplID0gMTI4OwogICAgY29uc3QgaGFzSW5wdXQgPSAhKGlucHV0WzBdID09PSB1bmRlZmluZWQpOwogICAgaWYgKGhhc0lucHV0KSB7CiAgICAgIHRoaXMubm90U3RhcnRlZCA9IGZhbHNlOwogICAgICBvdXRwdXRbMF1bMF0gPSBpbnB1dFswXVswXTsKICAgICAgZm9yIChsZXQgbiA9IDE7IG4gPCBibG9ja1NpemU7IG4rKykgewogICAgICAgIGZvciAobGV0IG8gPSAwOyBvIDwgb3V0cHV0Lmxlbmd0aDsgbysrKSB7CiAgICAgICAgICBvdXRwdXRbb11bbl0gPSBuICUgY29hcnNlID09IDAgPyBpbnB1dFswXVtuXSA6IG91dHB1dFtvXVtuIC0gMV07CiAgICAgICAgfQogICAgICB9CiAgICB9CiAgICByZXR1cm4gdGhpcy5ub3RTdGFydGVkIHx8IGhhc0lucHV0OwogIH0KfQoKcmVnaXN0ZXJQcm9jZXNzb3IoJ2NvYXJzZS1wcm9jZXNzb3InLCBDb2Fyc2VQcm9jZXNzb3IpOwoKY2xhc3MgQ3J1c2hQcm9jZXNzb3IgZXh0ZW5kcyBBdWRpb1dvcmtsZXRQcm9jZXNzb3IgewogIHN0YXRpYyBnZXQgcGFyYW1ldGVyRGVzY3JpcHRvcnMoKSB7CiAgICByZXR1cm4gW3sgbmFtZTogJ2NydXNoJywgZGVmYXVsdFZhbHVlOiAwIH1dOwogIH0KCiAgY29uc3RydWN0b3IoKSB7CiAgICBzdXBlcigpOwogICAgdGhpcy5ub3RTdGFydGVkID0gdHJ1ZTsKICB9CgogIHByb2Nlc3MoaW5wdXRzLCBvdXRwdXRzLCBwYXJhbWV0ZXJzKSB7CiAgICBjb25zdCBpbnB1dCA9IGlucHV0c1swXTsKICAgIGNvbnN0IG91dHB1dCA9IG91dHB1dHNbMF07CiAgICBjb25zdCBjcnVzaCA9IHBhcmFtZXRlcnMuY3J1c2g7CiAgICBjb25zdCBibG9ja1NpemUgPSAxMjg7CiAgICBjb25zdCBoYXNJbnB1dCA9ICEoaW5wdXRbMF0gPT09IHVuZGVmaW5lZCk7CiAgICBpZiAoaGFzSW5wdXQpIHsKICAgICAgdGhpcy5ub3RTdGFydGVkID0gZmFsc2U7CiAgICAgIGlmIChjcnVzaC5sZW5ndGggPT09IDEpIHsKICAgICAgICBjb25zdCB4ID0gTWF0aC5wb3coMiwgY3J1c2hbMF0gLSAxKTsKICAgICAgICBmb3IgKGxldCBuID0gMDsgbiA8IGJsb2NrU2l6ZTsgbisrKSB7CiAgICAgICAgICBjb25zdCB2YWx1ZSA9IE1hdGgucm91bmQoaW5wdXRbMF1bbl0gKiB4KSAvIHg7CiAgICAgICAgICBmb3IgKGxldCBvID0gMDsgbyA8IG91dHB1dC5sZW5ndGg7IG8rKykgewogICAgICAgICAgICBvdXRwdXRbb11bbl0gPSB2YWx1ZTsKICAgICAgICAgIH0KICAgICAgICB9CiAgICAgIH0gZWxzZSB7CiAgICAgICAgZm9yIChsZXQgbiA9IDA7IG4gPCBibG9ja1NpemU7IG4rKykgewogICAgICAgICAgbGV0IHggPSBNYXRoLnBvdygyLCBjcnVzaFtuXSAtIDEpOwogICAgICAgICAgY29uc3QgdmFsdWUgPSBNYXRoLnJvdW5kKGlucHV0WzBdW25dICogeCkgLyB4OwogICAgICAgICAgZm9yIChsZXQgbyA9IDA7IG8gPCBvdXRwdXQubGVuZ3RoOyBvKyspIHsKICAgICAgICAgICAgb3V0cHV0W29dW25dID0gdmFsdWU7CiAgICAgICAgICB9CiAgICAgICAgfQogICAgICB9CiAgICB9CiAgICByZXR1cm4gdGhpcy5ub3RTdGFydGVkIHx8IGhhc0lucHV0OwogIH0KfQpyZWdpc3RlclByb2Nlc3NvcignY3J1c2gtcHJvY2Vzc29yJywgQ3J1c2hQcm9jZXNzb3IpOwoKY2xhc3MgU2hhcGVQcm9jZXNzb3IgZXh0ZW5kcyBBdWRpb1dvcmtsZXRQcm9jZXNzb3IgewogIHN0YXRpYyBnZXQgcGFyYW1ldGVyRGVzY3JpcHRvcnMoKSB7CiAgICByZXR1cm4gW3sgbmFtZTogJ3NoYXBlJywgZGVmYXVsdFZhbHVlOiAwIH1dOwogIH0KCiAgY29uc3RydWN0b3IoKSB7CiAgICBzdXBlcigpOwogICAgdGhpcy5ub3RTdGFydGVkID0gdHJ1ZTsKICB9CgogIHByb2Nlc3MoaW5wdXRzLCBvdXRwdXRzLCBwYXJhbWV0ZXJzKSB7CiAgICBjb25zdCBpbnB1dCA9IGlucHV0c1swXTsKICAgIGNvbnN0IG91dHB1dCA9IG91dHB1dHNbMF07CiAgICBjb25zdCBzaGFwZTAgPSBwYXJhbWV0ZXJzLnNoYXBlWzBdOwogICAgY29uc3Qgc2hhcGUxID0gc2hhcGUwIDwgMSA/IHNoYXBlMCA6IDEuMCAtIDRlLTEwOwogICAgY29uc3Qgc2hhcGUgPSAoMi4wICogc2hhcGUxKSAvICgxLjAgLSBzaGFwZTEpOwogICAgY29uc3QgYmxvY2tTaXplID0gMTI4OwogICAgY29uc3QgaGFzSW5wdXQgPSAhKGlucHV0WzBdID09PSB1bmRlZmluZWQpOwogICAgaWYgKGhhc0lucHV0KSB7CiAgICAgIHRoaXMubm90U3RhcnRlZCA9IGZhbHNlOwogICAgICBmb3IgKGxldCBuID0gMDsgbiA8IGJsb2NrU2l6ZTsgbisrKSB7CiAgICAgICAgY29uc3QgdmFsdWUgPSAoKDEgKyBzaGFwZSkgKiBpbnB1dFswXVtuXSkgLyAoMSArIHNoYXBlICogTWF0aC5hYnMoaW5wdXRbMF1bbl0pKTsKICAgICAgICBmb3IgKGxldCBvID0gMDsgbyA8IG91dHB1dC5sZW5ndGg7IG8rKykgewogICAgICAgICAgb3V0cHV0W29dW25dID0gdmFsdWU7CiAgICAgICAgfQogICAgICB9CiAgICB9CiAgICByZXR1cm4gdGhpcy5ub3RTdGFydGVkIHx8IGhhc0lucHV0OwogIH0KfQoKcmVnaXN0ZXJQcm9jZXNzb3IoJ3NoYXBlLXByb2Nlc3NvcicsIFNoYXBlUHJvY2Vzc29yKTsK";function Rl(n){const e=Gr().createGain();return e.gain.value=n,e}const AM=({s:n,freq:e,t})=>{const r=Gr().createOscillator();return r.type=n||"triangle",r.frequency.value=Number(e),r.start(t),{node:r,stop:i=>r.stop(i)}},Qy=(n,e,t,r,i,a)=>{const s=Gr().createGain();return s.gain.setValueAtTime(0,a),s.gain.linearRampToValueAtTime(i,a+n),s.gain.linearRampToValueAtTime(t*i,a+n+e),{node:s,stop:o=>{s.gain.setValueAtTime(t*i,o),s.gain.linearRampToValueAtTime(0,o+r)}}},Yc=(n,e,t)=>{const r=Gr().createBiquadFilter();return r.type=n,r.frequency.value=e,r.Q.value=t,r};let RM=n=>console.log(n);const Ya=(...n)=>RM(...n),Pm=gM();function $y(n,e,t={}){Pm.setKey(n,{onTrigger:e,data:t})}function GS(n){return Pm.get()[n]}let Gc;const Gr=()=>(Gc||(Gc=new AudioContext),Gc);let Io;const Bm=()=>{const n=Gr();return Io||(Io=n.createGain(),Io.connect(n.destination)),Io};let Qc;function IM(){return Qc||(Qc=Gr().audioWorklet.addModule(yM),Qc)}function $c(n,e,t){const r=new AudioWorkletNode(n,e);return Object.entries(t).forEach(([i,a])=>{r.parameters.get(i).value=a}),r}async function NM(n={}){const{disableWorklets:e=!1}=n;typeof window<"u"&&(await Gr().resume(),e?console.log("disableWorklets: AudioWorklet effects coarse, crush and shape are skipped!"):await IM().catch(t=>{console.warn("could not load AudioWorklet effects coarse, crush and shape",t)}))}async function DM(n){return new Promise(e=>{document.addEventListener("click",async function t(){await NM(n),e(),document.removeEventListener("click",t)})})}let xi={};function wM(n,e,t,r){var i;if(t=TM(t,0,.98),!xi[n]){const a=Gr().createFeedbackDelay(1,e,t);(i=a.start)==null||i.call(a,r),a.connect(Bm()),xi[n]=a}return xi[n].delayTime.value!==e&&xi[n].delayTime.setValueAtTime(e,r),xi[n].feedback.value!==t&&xi[n].feedback.setValueAtTime(t,r),xi[n]}let Li={};function xM(n,e=2){if(!Li[n]){const t=Gr().createReverb(e);t.connect(Bm()),Li[n]=t}return Li[n].duration!==e&&(Li[n]=Li[n].setDuration(e),Li[n].duration=e),Li[n]}function QS(n,e,t){const r=Rl(t);return n.connect(r),r.connect(e),r}const LM=async(n,e,t)=>{const r=Gr();if(typeof n!="object")throw new Error(`expected hap.value to be an object, but got "${n}". Hint: append .note() or .s() to the end`,"error");let i=r.currentTime+e,{s:a="triangle",bank:s,source:o,gain:l=.8,cutoff:u,resonance:d=1,hcutoff:f,hresonance:m=1,bandf:g,bandq:b=1,coarse:v,crush:y,shape:N,pan:F,vowel:X,delay:p=0,delayfeedback:E=.5,delaytime:O=.25,orbit:A=1,room:D,size:M=2,velocity:w=1}=n;l*=w;let B=[];const re=()=>{B.forEach(Z=>Z==null?void 0:Z.disconnect())};s&&a&&(a=`${s}_${a}`);let ie;if(o)ie=o(i,n,t);else if(GS(a)){const{onTrigger:Z}=GS(a),z=await Z(i,n,re);z&&(ie=z.node,z.stop(i+t))}else throw new Error(`sound ${a} not found! Is it loaded?`);if(!ie)return;if(r.currentTime>i){Ya("[webaudio] skip hap: still loading",r.currentTime-i);return}const j=[];if(j.push(ie),j.push(Rl(l)),u!==void 0&&j.push(Yc("lowpass",u,d)),f!==void 0&&j.push(Yc("highpass",f,m)),g!==void 0&&j.push(Yc("bandpass",g,b)),X!==void 0&&j.push(r.createVowelFilter(X)),v!==void 0&&j.push($c(r,"coarse-processor",{coarse:v})),y!==void 0&&j.push($c(r,"crush-processor",{crush:y})),N!==void 0&&j.push($c(r,"shape-processor",{shape:N})),F!==void 0){const Z=r.createStereoPanner();Z.pan.value=2*F-1,j.push(Z)}const J=Rl(1);j.push(J),J.connect(Bm());let L;if(p>0&&O>0&&E>0){const Z=wM(A,O,E,i);L=QS(J,Z,p)}let G;if(D>0&&M>0){const Z=xM(A,M);G=QS(J,Z,D)}j.slice(1).reduce((Z,z)=>Z.connect(z),j[0]),B=j.concat([L,G])},qc={};function kM(n,e){var t=e?1e3:1024;if(n=t);return n.toFixed(1)+" "+r[i]}const MM=async(n,e,t,r,i,a,s)=>{let o=0;i!==void 0&&t!==void 0&&Ya("[sampler] hap has note and freq. ignoring note","warning");let l=vM({freq:i,note:t},36);o=l-36;const u=Gr();let d;if(Array.isArray(a))d=a[e%a.length];else{const b=y=>Mm(y)-l,v=Object.keys(a).filter(y=>!y.startsWith("_")).reduce((y,N,F)=>!y||Math.abs(b(N)){const i=t?`sound "${t}:${r}"`:"sample";if(!qc[n]){Ya(`[sampler] load ${i}..`,"load-sample",{url:n});const a=Date.now();qc[n]=fetch(n).then(s=>s.arrayBuffer()).then(async s=>{const o=Date.now()-a,l=kM(s.byteLength);return Ya(`[sampler] load ${i}... done! loaded ${l} in ${o}ms`,"loaded-sample",{url:n}),await e.decodeAudioData(s)})}return qc[n]};function BM(n){const e=Gr(),t=e.createBuffer(n.numberOfChannels,n.length,e.sampleRate);for(let r=0;rObject.entries(n).forEach(([r,i])=>{if(typeof i=="string"&&(i=[i]),typeof i!="object")throw new Error("wrong sample map format for "+r);t=i._base||t;const a=s=>(t+s).replace("github:","https://raw.githubusercontent.com/");Array.isArray(i)?i=i.map(a):i=Object.fromEntries(Object.entries(i).map(([s,o])=>[s,(typeof o=="string"?[o]:o).map(a)])),e(r,i)});let FM={};function YM(n){const e=Object.entries(FM).find(([t])=>n.startsWith(t));if(e)return e[1]}const Il=async(n,e=n._base||"",t={})=>{if(typeof n=="string"){const a=YM(n);if(a)return a(n);if(n.startsWith("github:")){let[o,l]=n.split("github:");l=l.endsWith("/")?l.slice(0,-1):l,n=`https://raw.githubusercontent.com/${l}/strudel.json`}if(typeof fetch!="function")return;const s=n.split("/").slice(0,-1).join("/");return typeof fetch>"u"?void 0:fetch(n).then(o=>o.json()).then(o=>Il(o,e||o._base||s,t)).catch(o=>{throw console.error(o),new Error(`error loading "${n}"`)})}const{prebake:r,tag:i}=t;UM(n,(a,s)=>$y(a,(o,l,u)=>GM(o,l,u,s),{type:"sample",samples:s,baseUrl:e,prebake:r,tag:i}),e)},$S=[];async function GM(n,e,t,r,i){const{s:a,freq:s,unit:o,nudge:l=0,cut:u,loop:d,clip:f=void 0,n:m=0,note:g,speed:b=1,begin:v=0,end:y=1}=e;if(b===0)return;const N=Gr(),{attack:F=.001,decay:X=.001,sustain:p=1,release:E=.001}=e,O=n+l,A=await MM(a,m,g,b,s,r,i);if(N.currentTime>n){Ya(`[sampler] still loading sound "${a}:${m}"`,"highlight");return}if(!A){Ya(`[sampler] could not load "${a}:${m}"`,"error");return}A.playbackRate.value=Math.abs(b)*A.playbackRate.value,o==="c"&&(A.playbackRate.value=A.playbackRate.value*A.buffer.duration*1);const D=v*A.buffer.duration;A.start(O,D);const M=A.buffer.duration/A.playbackRate.value,{node:w,stop:B}=Qy(F,X,p,E,1,n);A.connect(w);const re=N.createGain();w.connect(re),A.onended=function(){A.disconnect(),w.disconnect(),re.disconnect(),t()};const ie={node:re,bufferSource:A,stop:(j,J=f===void 0)=>{let L=j;J&&(L=n+(y-v)*M),A.stop(L+E),B(L)}};if(u!==void 0){const j=$S[u];j&&(j.node.gain.setValueAtTime(1,O),j.node.gain.linearRampToValueAtTime(0,O+.01)),$S[u]=ie}return ie}const QM=(n,e=1,t="sine")=>{const r=Gr(),i=r.createOscillator();i.type=t,i.frequency.value=n,i.start();const a=new GainNode(r,{gain:e});return i.connect(a),{node:a,stop:s=>i.stop(s)}},$M=(n,e,t,r="sine")=>{const i=n.frequency.value*e,a=i*t;return QM(i,a,r)};function qM(){["sine","square","triangle","sawtooth"].forEach(n=>{$y(n,(e,t,r)=>{const{attack:i=.001,decay:a=.05,sustain:s=.6,release:o=.01,fmh:l=1,fmi:u}=t;let{n:d,note:f,freq:m}=t;d=f||d||36,typeof d=="string"&&(d=Mm(d)),!m&&typeof d=="number"&&(m=bM(d));const{node:g,stop:b}=AM({t:e,s:n,freq:m});let v;if(u){const{node:X,stop:p}=$M(g,l,u);X.connect(g.frequency),v=p}const y=Rl(.3),{node:N,stop:F}=Qy(i,a,s,o,1,e);return g.onended=()=>{g.disconnect(),y.disconnect(),r()},{node:g.connect(y).connect(N),stop:X=>{F(X);let p=X+o;b(p),v==null||v(p)}}},{type:"synth",prebake:!0})})}class qy extends Gy{constructor(t,r){super(r);R(this,"attack",t=>(this.values.attack=t,this));R(this,"atk",this.attack);R(this,"decay",t=>(this.values.decay=t,this));R(this,"dec",this.decay);R(this,"release",t=>(this.values.release=t,this));R(this,"rel",this.release);R(this,"unit",t=>(this.values.unit=t,this));R(this,"freq",t=>(this.values.freq=t,this));R(this,"fm",t=>{if(typeof t=="number")this.values.fmi=t;else{let r=t.split(":");this.values.fmi=parseFloat(r[0]),r.length>1&&(this.values.fmh=parseFloat(r[1]))}return this});R(this,"sound",t=>(this.values.s=t,this));R(this,"fmi",t=>(this.values.fmi=t,this));R(this,"fmh",t=>(this.values.fmh=t,this));R(this,"nudge",t=>(this.values.nudge=t,this));R(this,"cut",t=>(this.values.cut=t,this));R(this,"loop",t=>(this.values.loop=t,this));R(this,"clip",t=>(this.values.clip=t,this));R(this,"n",t=>(this.values.n=t,this));R(this,"note",t=>(this.values.note=t,this));R(this,"speed",t=>(this.values.speed=t,this));R(this,"begin",t=>(this.values.begin=t,this));R(this,"end",t=>(this.values.end=t,this));R(this,"gain",t=>(this.values.gain=t,this));R(this,"cutoff",t=>(this.values.cutoff=t,this));R(this,"lpf",this.cutoff);R(this,"resonance",t=>(this.values.resonance=t,this));R(this,"lpq",this.resonance);R(this,"hcutoff",t=>(this.values.hcutoff=t,this));R(this,"hpf",this.hcutoff);R(this,"hresonance",t=>(this.values.hresonance=t,this));R(this,"hpq",this.hresonance);R(this,"bandf",t=>(this.values.bandf=t,this));R(this,"bpf",this.bandf);R(this,"bandq",t=>(this.values.bandq=t,this));R(this,"bpq",this.bandq);R(this,"coarse",t=>(this.values.coarse=t,this));R(this,"crush",t=>(this.values.crush=t,this));R(this,"shape",t=>(this.values.shape=t,this));R(this,"pan",t=>(this.values.pan=t,this));R(this,"vowel",t=>(this.values.vowel=t,this));R(this,"delay",t=>(this.values.delay=t,this));R(this,"delayfeedback",t=>(this.values.delayfeedback=t,this));R(this,"delayfb",this.delayfeedback);R(this,"delaytime",t=>(this.values.delaytime=t,this));R(this,"delayt",this.delaytime);R(this,"orbit",t=>(this.values.orbit=t,this));R(this,"room",t=>(this.values.room=t,this));R(this,"size",t=>(this.values.size=t,this));R(this,"velocity",t=>(this.values.velocity=t,this));R(this,"vel",this.velocity);R(this,"modify",t=>{const r=t(this);return r instanceof Object?r:(t(this.values),this)});R(this,"sustain",t=>(this.values.dur=t,this));R(this,"sus",this.sustain);R(this,"update",()=>{if(this.values.key&&this.values.pitch&&this.values.parsedScale&&this.values.octave){const[t,r]=xm(this.values.key,this.values.pitch,this.values.parsedScale,this.values.octave);this.values.freq=Ps(t)}});R(this,"out",()=>LM(this.values,this.app.clock.pulse_duration,this.values.dur||.5));this.app=r,typeof t=="string"?this.values={s:t,dur:.5}:this.values=t}}class Vy extends Gy{constructor(t,r){super(r);R(this,"midiConnection");R(this,"note",t=>(this.values.note=t,this));R(this,"sustain",t=>(this.values.sustain=t,this));R(this,"channel",t=>(this.values.channel=t,this));R(this,"port",t=>(this.values.port=this.midiConnection.getMidiOutputIndex(t),this));R(this,"add",t=>(this.values.note+=t,this));R(this,"modify",t=>{const r=t(this);return r instanceof Object?r:(t(this.values),this)});R(this,"bend",t=>(this.values.bend=t,this));R(this,"random",(t=0,r=127)=>(t=Math.min(Math.max(t,0),127),r=Math.min(Math.max(r,0),127),this.values.note=Math.floor(this.randomGen()*(r-t+1))+t,this));R(this,"update",()=>{if(this.values.key&&this.values.pitch&&this.values.parsedScale&&this.values.octave){const[t,r]=xm(this.values.key,this.values.pitch,this.values.parsedScale,this.values.octave);this.values.note=t,this.values.freq=Ps(t),r&&(this.values.bend=r)}});R(this,"out",()=>{const t=this.values.note?this.values.note:60,r=this.values.channel?this.values.channel:0,i=this.values.velocity?this.values.velocity:100,a=this.values.sustain?this.values.sustain*this.app.clock.pulse_duration*this.app.api.ppqn():this.app.clock.pulse_duration*this.app.api.ppqn(),s=this.values.bend?this.values.bend:void 0,o=this.values.port?this.midiConnection.getMidiOutputIndex(this.values.port):this.midiConnection.getCurrentMidiPortIndex();this.midiConnection.sendMidiNote(t,r,i,a,o,s)});this.app=r,typeof t=="number"?this.values.note=t:this.values=t,this.midiConnection=r.api.MidiConnection}}const ss=typeof performance=="object"&&performance&&typeof performance.now=="function"?performance:Date,Hy=new Set,wh=typeof process=="object"&&process?process:{},zy=(n,e,t,r)=>{typeof wh.emitWarning=="function"?wh.emitWarning(n,e,t,r):console.error(`[${t}] ${e}: ${n}`)};let Nl=globalThis.AbortController,qS=globalThis.AbortSignal;var DT;if(typeof Nl>"u"){qS=class{constructor(){R(this,"onabort");R(this,"_onabort",[]);R(this,"reason");R(this,"aborted",!1)}addEventListener(r,i){this._onabort.push(i)}},Nl=class{constructor(){R(this,"signal",new qS);e()}abort(r){var i,a;if(!this.signal.aborted){this.signal.reason=r,this.signal.aborted=!0;for(const s of this.signal._onabort)s(r);(a=(i=this.signal).onabort)==null||a.call(i,r)}}};let n=((DT=wh.env)==null?void 0:DT.LRU_CACHE_IGNORE_AC_WARNING)!=="1";const e=()=>{n&&(n=!1,zy("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 VM=n=>!Hy.has(n),ci=n=>n&&n===Math.floor(n)&&n>0&&isFinite(n),Wy=n=>ci(n)?n<=Math.pow(2,8)?Uint8Array:n<=Math.pow(2,16)?Uint16Array:n<=Math.pow(2,32)?Uint32Array:n<=Number.MAX_SAFE_INTEGER?Vo:null:null;class Vo extends Array{constructor(e){super(e),this.fill(0)}}var va;const Pi=class Pi{constructor(e,t){R(this,"heap");R(this,"length");if(!Q(Pi,va))throw new TypeError("instantiate Stack using Stack.create(n)");this.heap=new t(e),this.length=0}static create(e){const t=Wy(e);if(!t)return[];Qe(Pi,va,!0);const r=new Pi(e,t);return Qe(Pi,va,!1),r}push(e){this.heap[this.length++]=e}pop(){return this.heap[--this.length]}};va=new WeakMap,tt(Pi,va,!1);let xh=Pi;var _n,Hr,gn,Sn,ya,Kt,On,jt,xt,et,Dr,zr,Sr,sr,En,or,Hn,zn,bn,Tn,mi,wr,Fs,kh,Gi,Wn,Ys,Wr,Ml,Xy,Qi,Aa,Gs,xn,ui,Ln,di,Qs,Mh,Ra,Ho,Ia,zo,At,Mt,$s,Ph,$i,fs;const Qm=class Qm{constructor(e){tt(this,Fs);tt(this,Ml);tt(this,xn);tt(this,Ln);tt(this,Qs);tt(this,Ra);tt(this,Ia);tt(this,At);tt(this,$s);tt(this,$i);tt(this,_n,void 0);tt(this,Hr,void 0);tt(this,gn,void 0);tt(this,Sn,void 0);tt(this,ya,void 0);R(this,"ttl");R(this,"ttlResolution");R(this,"ttlAutopurge");R(this,"updateAgeOnGet");R(this,"updateAgeOnHas");R(this,"allowStale");R(this,"noDisposeOnSet");R(this,"noUpdateTTL");R(this,"maxEntrySize");R(this,"sizeCalculation");R(this,"noDeleteOnFetchRejection");R(this,"noDeleteOnStaleGet");R(this,"allowStaleOnFetchAbort");R(this,"allowStaleOnFetchRejection");R(this,"ignoreFetchAbort");tt(this,Kt,void 0);tt(this,On,void 0);tt(this,jt,void 0);tt(this,xt,void 0);tt(this,et,void 0);tt(this,Dr,void 0);tt(this,zr,void 0);tt(this,Sr,void 0);tt(this,sr,void 0);tt(this,En,void 0);tt(this,or,void 0);tt(this,Hn,void 0);tt(this,zn,void 0);tt(this,bn,void 0);tt(this,Tn,void 0);tt(this,mi,void 0);tt(this,wr,void 0);tt(this,Gi,()=>{});tt(this,Wn,()=>{});tt(this,Ys,()=>{});tt(this,Wr,()=>!1);tt(this,Qi,e=>{});tt(this,Aa,(e,t,r)=>{});tt(this,Gs,(e,t,r,i)=>{if(r||i)throw new TypeError("cannot set size without setting maxSize or maxEntrySize on cache");return 0});const{max:t=0,ttl:r,ttlResolution:i=1,ttlAutopurge:a,updateAgeOnGet:s,updateAgeOnHas:o,allowStale:l,dispose:u,disposeAfter:d,noDisposeOnSet:f,noUpdateTTL:m,maxSize:g=0,maxEntrySize:b=0,sizeCalculation:v,fetchMethod:y,noDeleteOnFetchRejection:N,noDeleteOnStaleGet:F,allowStaleOnFetchRejection:X,allowStaleOnFetchAbort:p,ignoreFetchAbort:E}=e;if(t!==0&&!ci(t))throw new TypeError("max option must be a nonnegative integer");const O=t?Wy(t):Array;if(!O)throw new Error("invalid max value: "+t);if(Qe(this,_n,t),Qe(this,Hr,g),this.maxEntrySize=b||Q(this,Hr),this.sizeCalculation=v,this.sizeCalculation){if(!Q(this,Hr)&&!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(y!==void 0&&typeof y!="function")throw new TypeError("fetchMethod must be a function if specified");if(Qe(this,ya,y),Qe(this,mi,!!y),Qe(this,jt,new Map),Qe(this,xt,new Array(t).fill(void 0)),Qe(this,et,new Array(t).fill(void 0)),Qe(this,Dr,new O(t)),Qe(this,zr,new O(t)),Qe(this,Sr,0),Qe(this,sr,0),Qe(this,En,xh.create(t)),Qe(this,Kt,0),Qe(this,On,0),typeof u=="function"&&Qe(this,gn,u),typeof d=="function"?(Qe(this,Sn,d),Qe(this,or,[])):(Qe(this,Sn,void 0),Qe(this,or,void 0)),Qe(this,Tn,!!Q(this,gn)),Qe(this,wr,!!Q(this,Sn)),this.noDisposeOnSet=!!f,this.noUpdateTTL=!!m,this.noDeleteOnFetchRejection=!!N,this.allowStaleOnFetchRejection=!!X,this.allowStaleOnFetchAbort=!!p,this.ignoreFetchAbort=!!E,this.maxEntrySize!==0){if(Q(this,Hr)!==0&&!ci(Q(this,Hr)))throw new TypeError("maxSize must be a positive integer if specified");if(!ci(this.maxEntrySize))throw new TypeError("maxEntrySize must be a positive integer if specified");Ue(this,Ml,Xy).call(this)}if(this.allowStale=!!l,this.noDeleteOnStaleGet=!!F,this.updateAgeOnGet=!!s,this.updateAgeOnHas=!!o,this.ttlResolution=ci(i)||i===0?i:1,this.ttlAutopurge=!!a,this.ttl=r||0,this.ttl){if(!ci(this.ttl))throw new TypeError("ttl must be a positive integer if specified");Ue(this,Fs,kh).call(this)}if(Q(this,_n)===0&&this.ttl===0&&Q(this,Hr)===0)throw new TypeError("At least one of max, maxSize, or ttl is required");if(!this.ttlAutopurge&&!Q(this,_n)&&!Q(this,Hr)){const A="LRU_CACHE_UNBOUNDED";VM(A)&&(Hy.add(A),zy("TTL caching without ttlAutopurge, max, or maxSize can result in unbounded memory consumption.","UnboundedCacheWarning",A,Qm))}}static unsafeExposeInternals(e){return{starts:Q(e,zn),ttls:Q(e,bn),sizes:Q(e,Hn),keyMap:Q(e,jt),keyList:Q(e,xt),valList:Q(e,et),next:Q(e,Dr),prev:Q(e,zr),get head(){return Q(e,Sr)},get tail(){return Q(e,sr)},free:Q(e,En),isBackgroundFetch:t=>{var r;return Ue(r=e,At,Mt).call(r,t)},backgroundFetch:(t,r,i,a)=>{var s;return Ue(s=e,Ia,zo).call(s,t,r,i,a)},moveToTail:t=>{var r;return Ue(r=e,$i,fs).call(r,t)},indexes:t=>{var r;return Ue(r=e,xn,ui).call(r,t)},rindexes:t=>{var r;return Ue(r=e,Ln,di).call(r,t)},isStale:t=>{var r;return Q(r=e,Wr).call(r,t)}}}get max(){return Q(this,_n)}get maxSize(){return Q(this,Hr)}get calculatedSize(){return Q(this,On)}get size(){return Q(this,Kt)}get fetchMethod(){return Q(this,ya)}get dispose(){return Q(this,gn)}get disposeAfter(){return Q(this,Sn)}getRemainingTTL(e){return Q(this,jt).has(e)?1/0:0}*entries(){for(const e of Ue(this,xn,ui).call(this))Q(this,et)[e]!==void 0&&Q(this,xt)[e]!==void 0&&!Ue(this,At,Mt).call(this,Q(this,et)[e])&&(yield[Q(this,xt)[e],Q(this,et)[e]])}*rentries(){for(const e of Ue(this,Ln,di).call(this))Q(this,et)[e]!==void 0&&Q(this,xt)[e]!==void 0&&!Ue(this,At,Mt).call(this,Q(this,et)[e])&&(yield[Q(this,xt)[e],Q(this,et)[e]])}*keys(){for(const e of Ue(this,xn,ui).call(this)){const t=Q(this,xt)[e];t!==void 0&&!Ue(this,At,Mt).call(this,Q(this,et)[e])&&(yield t)}}*rkeys(){for(const e of Ue(this,Ln,di).call(this)){const t=Q(this,xt)[e];t!==void 0&&!Ue(this,At,Mt).call(this,Q(this,et)[e])&&(yield t)}}*values(){for(const e of Ue(this,xn,ui).call(this))Q(this,et)[e]!==void 0&&!Ue(this,At,Mt).call(this,Q(this,et)[e])&&(yield Q(this,et)[e])}*rvalues(){for(const e of Ue(this,Ln,di).call(this))Q(this,et)[e]!==void 0&&!Ue(this,At,Mt).call(this,Q(this,et)[e])&&(yield Q(this,et)[e])}[Symbol.iterator](){return this.entries()}find(e,t={}){for(const r of Ue(this,xn,ui).call(this)){const i=Q(this,et)[r],a=Ue(this,At,Mt).call(this,i)?i.__staleWhileFetching:i;if(a!==void 0&&e(a,Q(this,xt)[r],this))return this.get(Q(this,xt)[r],t)}}forEach(e,t=this){for(const r of Ue(this,xn,ui).call(this)){const i=Q(this,et)[r],a=Ue(this,At,Mt).call(this,i)?i.__staleWhileFetching:i;a!==void 0&&e.call(t,a,Q(this,xt)[r],this)}}rforEach(e,t=this){for(const r of Ue(this,Ln,di).call(this)){const i=Q(this,et)[r],a=Ue(this,At,Mt).call(this,i)?i.__staleWhileFetching:i;a!==void 0&&e.call(t,a,Q(this,xt)[r],this)}}purgeStale(){let e=!1;for(const t of Ue(this,Ln,di).call(this,{allowStale:!0}))Q(this,Wr).call(this,t)&&(this.delete(Q(this,xt)[t]),e=!0);return e}dump(){const e=[];for(const t of Ue(this,xn,ui).call(this,{allowStale:!0})){const r=Q(this,xt)[t],i=Q(this,et)[t],a=Ue(this,At,Mt).call(this,i)?i.__staleWhileFetching:i;if(a===void 0||r===void 0)continue;const s={value:a};if(Q(this,bn)&&Q(this,zn)){s.ttl=Q(this,bn)[t];const o=ss.now()-Q(this,zn)[t];s.start=Math.floor(Date.now()-o)}Q(this,Hn)&&(s.size=Q(this,Hn)[t]),e.unshift([r,s])}return e}load(e){this.clear();for(const[t,r]of e){if(r.start){const i=Date.now()-r.start;r.start=ss.now()-i}this.set(t,r.value,r)}}set(e,t,r={}){var m,g,b,v,y;if(t===void 0)return this.delete(e),this;const{ttl:i=this.ttl,start:a,noDisposeOnSet:s=this.noDisposeOnSet,sizeCalculation:o=this.sizeCalculation,status:l}=r;let{noUpdateTTL:u=this.noUpdateTTL}=r;const d=Q(this,Gs).call(this,e,t,r.size||0,o);if(this.maxEntrySize&&d>this.maxEntrySize)return l&&(l.set="miss",l.maxEntrySizeExceeded=!0),this.delete(e),this;let f=Q(this,Kt)===0?void 0:Q(this,jt).get(e);if(f===void 0)f=Q(this,Kt)===0?Q(this,sr):Q(this,En).length!==0?Q(this,En).pop():Q(this,Kt)===Q(this,_n)?Ue(this,Ra,Ho).call(this,!1):Q(this,Kt),Q(this,xt)[f]=e,Q(this,et)[f]=t,Q(this,jt).set(e,f),Q(this,Dr)[Q(this,sr)]=f,Q(this,zr)[f]=Q(this,sr),Qe(this,sr,f),io(this,Kt)._++,Q(this,Aa).call(this,f,d,l),l&&(l.set="add"),u=!1;else{Ue(this,$i,fs).call(this,f);const N=Q(this,et)[f];if(t!==N){if(Q(this,mi)&&Ue(this,At,Mt).call(this,N)){N.__abortController.abort(new Error("replaced"));const{__staleWhileFetching:F}=N;F!==void 0&&!s&&(Q(this,Tn)&&((m=Q(this,gn))==null||m.call(this,F,e,"set")),Q(this,wr)&&((g=Q(this,or))==null||g.push([F,e,"set"])))}else s||(Q(this,Tn)&&((b=Q(this,gn))==null||b.call(this,N,e,"set")),Q(this,wr)&&((v=Q(this,or))==null||v.push([N,e,"set"])));if(Q(this,Qi).call(this,f),Q(this,Aa).call(this,f,d,l),Q(this,et)[f]=t,l){l.set="replace";const F=N&&Ue(this,At,Mt).call(this,N)?N.__staleWhileFetching:N;F!==void 0&&(l.oldValue=F)}}else l&&(l.set="update")}if(i!==0&&!Q(this,bn)&&Ue(this,Fs,kh).call(this),Q(this,bn)&&(u||Q(this,Ys).call(this,f,i,a),l&&Q(this,Wn).call(this,l,f)),!s&&Q(this,wr)&&Q(this,or)){const N=Q(this,or);let F;for(;F=N==null?void 0:N.shift();)(y=Q(this,Sn))==null||y.call(this,...F)}return this}pop(){var e;try{for(;Q(this,Kt);){const t=Q(this,et)[Q(this,Sr)];if(Ue(this,Ra,Ho).call(this,!0),Ue(this,At,Mt).call(this,t)){if(t.__staleWhileFetching)return t.__staleWhileFetching}else if(t!==void 0)return t}}finally{if(Q(this,wr)&&Q(this,or)){const t=Q(this,or);let r;for(;r=t==null?void 0:t.shift();)(e=Q(this,Sn))==null||e.call(this,...r)}}}has(e,t={}){const{updateAgeOnHas:r=this.updateAgeOnHas,status:i}=t,a=Q(this,jt).get(e);if(a!==void 0){const s=Q(this,et)[a];if(Ue(this,At,Mt).call(this,s)&&s.__staleWhileFetching===void 0)return!1;if(Q(this,Wr).call(this,a))i&&(i.has="stale",Q(this,Wn).call(this,i,a));else return r&&Q(this,Gi).call(this,a),i&&(i.has="hit",Q(this,Wn).call(this,i,a)),!0}else i&&(i.has="miss");return!1}peek(e,t={}){const{allowStale:r=this.allowStale}=t,i=Q(this,jt).get(e);if(i!==void 0&&(r||!Q(this,Wr).call(this,i))){const a=Q(this,et)[i];return Ue(this,At,Mt).call(this,a)?a.__staleWhileFetching:a}}async fetch(e,t={}){const{allowStale:r=this.allowStale,updateAgeOnGet:i=this.updateAgeOnGet,noDeleteOnStaleGet:a=this.noDeleteOnStaleGet,ttl:s=this.ttl,noDisposeOnSet:o=this.noDisposeOnSet,size:l=0,sizeCalculation:u=this.sizeCalculation,noUpdateTTL:d=this.noUpdateTTL,noDeleteOnFetchRejection:f=this.noDeleteOnFetchRejection,allowStaleOnFetchRejection:m=this.allowStaleOnFetchRejection,ignoreFetchAbort:g=this.ignoreFetchAbort,allowStaleOnFetchAbort:b=this.allowStaleOnFetchAbort,context:v,forceRefresh:y=!1,status:N,signal:F}=t;if(!Q(this,mi))return N&&(N.fetch="get"),this.get(e,{allowStale:r,updateAgeOnGet:i,noDeleteOnStaleGet:a,status:N});const X={allowStale:r,updateAgeOnGet:i,noDeleteOnStaleGet:a,ttl:s,noDisposeOnSet:o,size:l,sizeCalculation:u,noUpdateTTL:d,noDeleteOnFetchRejection:f,allowStaleOnFetchRejection:m,allowStaleOnFetchAbort:b,ignoreFetchAbort:g,status:N,signal:F};let p=Q(this,jt).get(e);if(p===void 0){N&&(N.fetch="miss");const E=Ue(this,Ia,zo).call(this,e,p,X,v);return E.__returned=E}else{const E=Q(this,et)[p];if(Ue(this,At,Mt).call(this,E)){const w=r&&E.__staleWhileFetching!==void 0;return N&&(N.fetch="inflight",w&&(N.returnedStale=!0)),w?E.__staleWhileFetching:E.__returned=E}const O=Q(this,Wr).call(this,p);if(!y&&!O)return N&&(N.fetch="hit"),Ue(this,$i,fs).call(this,p),i&&Q(this,Gi).call(this,p),N&&Q(this,Wn).call(this,N,p),E;const A=Ue(this,Ia,zo).call(this,e,p,X,v),M=A.__staleWhileFetching!==void 0&&r;return N&&(N.fetch=O?"stale":"refresh",M&&O&&(N.returnedStale=!0)),M?A.__staleWhileFetching:A.__returned=A}}get(e,t={}){const{allowStale:r=this.allowStale,updateAgeOnGet:i=this.updateAgeOnGet,noDeleteOnStaleGet:a=this.noDeleteOnStaleGet,status:s}=t,o=Q(this,jt).get(e);if(o!==void 0){const l=Q(this,et)[o],u=Ue(this,At,Mt).call(this,l);return s&&Q(this,Wn).call(this,s,o),Q(this,Wr).call(this,o)?(s&&(s.get="stale"),u?(s&&r&&l.__staleWhileFetching!==void 0&&(s.returnedStale=!0),r?l.__staleWhileFetching:void 0):(a||this.delete(e),s&&r&&(s.returnedStale=!0),r?l:void 0)):(s&&(s.get="hit"),u?l.__staleWhileFetching:(Ue(this,$i,fs).call(this,o),i&&Q(this,Gi).call(this,o),l))}else s&&(s.get="miss")}delete(e){var r,i,a,s;let t=!1;if(Q(this,Kt)!==0){const o=Q(this,jt).get(e);if(o!==void 0)if(t=!0,Q(this,Kt)===1)this.clear();else{Q(this,Qi).call(this,o);const l=Q(this,et)[o];Ue(this,At,Mt).call(this,l)?l.__abortController.abort(new Error("deleted")):(Q(this,Tn)||Q(this,wr))&&(Q(this,Tn)&&((r=Q(this,gn))==null||r.call(this,l,e,"delete")),Q(this,wr)&&((i=Q(this,or))==null||i.push([l,e,"delete"]))),Q(this,jt).delete(e),Q(this,xt)[o]=void 0,Q(this,et)[o]=void 0,o===Q(this,sr)?Qe(this,sr,Q(this,zr)[o]):o===Q(this,Sr)?Qe(this,Sr,Q(this,Dr)[o]):(Q(this,Dr)[Q(this,zr)[o]]=Q(this,Dr)[o],Q(this,zr)[Q(this,Dr)[o]]=Q(this,zr)[o]),io(this,Kt)._--,Q(this,En).push(o)}}if(Q(this,wr)&&((a=Q(this,or))!=null&&a.length)){const o=Q(this,or);let l;for(;l=o==null?void 0:o.shift();)(s=Q(this,Sn))==null||s.call(this,...l)}return t}clear(){var e,t,r;for(const i of Ue(this,Ln,di).call(this,{allowStale:!0})){const a=Q(this,et)[i];if(Ue(this,At,Mt).call(this,a))a.__abortController.abort(new Error("deleted"));else{const s=Q(this,xt)[i];Q(this,Tn)&&((e=Q(this,gn))==null||e.call(this,a,s,"delete")),Q(this,wr)&&((t=Q(this,or))==null||t.push([a,s,"delete"]))}}if(Q(this,jt).clear(),Q(this,et).fill(void 0),Q(this,xt).fill(void 0),Q(this,bn)&&Q(this,zn)&&(Q(this,bn).fill(0),Q(this,zn).fill(0)),Q(this,Hn)&&Q(this,Hn).fill(0),Qe(this,Sr,0),Qe(this,sr,0),Q(this,En).length=0,Qe(this,On,0),Qe(this,Kt,0),Q(this,wr)&&Q(this,or)){const i=Q(this,or);let a;for(;a=i==null?void 0:i.shift();)(r=Q(this,Sn))==null||r.call(this,...a)}}};_n=new WeakMap,Hr=new WeakMap,gn=new WeakMap,Sn=new WeakMap,ya=new WeakMap,Kt=new WeakMap,On=new WeakMap,jt=new WeakMap,xt=new WeakMap,et=new WeakMap,Dr=new WeakMap,zr=new WeakMap,Sr=new WeakMap,sr=new WeakMap,En=new WeakMap,or=new WeakMap,Hn=new WeakMap,zn=new WeakMap,bn=new WeakMap,Tn=new WeakMap,mi=new WeakMap,wr=new WeakMap,Fs=new WeakSet,kh=function(){const e=new Vo(Q(this,_n)),t=new Vo(Q(this,_n));Qe(this,bn,e),Qe(this,zn,t),Qe(this,Ys,(a,s,o=ss.now())=>{if(t[a]=s!==0?o:0,e[a]=s,s!==0&&this.ttlAutopurge){const l=setTimeout(()=>{Q(this,Wr).call(this,a)&&this.delete(Q(this,xt)[a])},s+1);l.unref&&l.unref()}}),Qe(this,Gi,a=>{t[a]=e[a]!==0?ss.now():0}),Qe(this,Wn,(a,s)=>{if(e[s]){const o=e[s],l=t[s];a.ttl=o,a.start=l,a.now=r||i();const u=a.now-l;a.remainingTTL=o-u}});let r=0;const i=()=>{const a=ss.now();if(this.ttlResolution>0){r=a;const s=setTimeout(()=>r=0,this.ttlResolution);s.unref&&s.unref()}return a};this.getRemainingTTL=a=>{const s=Q(this,jt).get(a);if(s===void 0)return 0;const o=e[s],l=t[s];if(o===0||l===0)return 1/0;const u=(r||i())-l;return o-u},Qe(this,Wr,a=>e[a]!==0&&t[a]!==0&&(r||i())-t[a]>e[a])},Gi=new WeakMap,Wn=new WeakMap,Ys=new WeakMap,Wr=new WeakMap,Ml=new WeakSet,Xy=function(){const e=new Vo(Q(this,_n));Qe(this,On,0),Qe(this,Hn,e),Qe(this,Qi,t=>{Qe(this,On,Q(this,On)-e[t]),e[t]=0}),Qe(this,Gs,(t,r,i,a)=>{if(Ue(this,At,Mt).call(this,r))return 0;if(!ci(i))if(a){if(typeof a!="function")throw new TypeError("sizeCalculation must be a function");if(i=a(r,t),!ci(i))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 i}),Qe(this,Aa,(t,r,i)=>{if(e[t]=r,Q(this,Hr)){const a=Q(this,Hr)-e[t];for(;Q(this,On)>a;)Ue(this,Ra,Ho).call(this,!0)}Qe(this,On,Q(this,On)+e[t]),i&&(i.entrySize=r,i.totalCalculatedSize=Q(this,On))})},Qi=new WeakMap,Aa=new WeakMap,Gs=new WeakMap,xn=new WeakSet,ui=function*({allowStale:e=this.allowStale}={}){if(Q(this,Kt))for(let t=Q(this,sr);!(!Ue(this,Qs,Mh).call(this,t)||((e||!Q(this,Wr).call(this,t))&&(yield t),t===Q(this,Sr)));)t=Q(this,zr)[t]},Ln=new WeakSet,di=function*({allowStale:e=this.allowStale}={}){if(Q(this,Kt))for(let t=Q(this,Sr);!(!Ue(this,Qs,Mh).call(this,t)||((e||!Q(this,Wr).call(this,t))&&(yield t),t===Q(this,sr)));)t=Q(this,Dr)[t]},Qs=new WeakSet,Mh=function(e){return e!==void 0&&Q(this,jt).get(Q(this,xt)[e])===e},Ra=new WeakSet,Ho=function(e){var a,s;const t=Q(this,Sr),r=Q(this,xt)[t],i=Q(this,et)[t];return Q(this,mi)&&Ue(this,At,Mt).call(this,i)?i.__abortController.abort(new Error("evicted")):(Q(this,Tn)||Q(this,wr))&&(Q(this,Tn)&&((a=Q(this,gn))==null||a.call(this,i,r,"evict")),Q(this,wr)&&((s=Q(this,or))==null||s.push([i,r,"evict"]))),Q(this,Qi).call(this,t),e&&(Q(this,xt)[t]=void 0,Q(this,et)[t]=void 0,Q(this,En).push(t)),Q(this,Kt)===1?(Qe(this,Sr,Qe(this,sr,0)),Q(this,En).length=0):Qe(this,Sr,Q(this,Dr)[t]),Q(this,jt).delete(r),io(this,Kt)._--,t},Ia=new WeakSet,zo=function(e,t,r,i){const a=t===void 0?void 0:Q(this,et)[t];if(Ue(this,At,Mt).call(this,a))return a;const s=new Nl,{signal:o}=r;o==null||o.addEventListener("abort",()=>s.abort(o.reason),{signal:s.signal});const l={signal:s.signal,options:r,context:i},u=(v,y=!1)=>{const{aborted:N}=s.signal,F=r.ignoreFetchAbort&&v!==void 0;if(r.status&&(N&&!y?(r.status.fetchAborted=!0,r.status.fetchError=s.signal.reason,F&&(r.status.fetchAbortIgnored=!0)):r.status.fetchResolved=!0),N&&!F&&!y)return f(s.signal.reason);const X=g;return Q(this,et)[t]===g&&(v===void 0?X.__staleWhileFetching?Q(this,et)[t]=X.__staleWhileFetching:this.delete(e):(r.status&&(r.status.fetchUpdated=!0),this.set(e,v,l.options))),v},d=v=>(r.status&&(r.status.fetchRejected=!0,r.status.fetchError=v),f(v)),f=v=>{const{aborted:y}=s.signal,N=y&&r.allowStaleOnFetchAbort,F=N||r.allowStaleOnFetchRejection,X=F||r.noDeleteOnFetchRejection,p=g;if(Q(this,et)[t]===g&&(!X||p.__staleWhileFetching===void 0?this.delete(e):N||(Q(this,et)[t]=p.__staleWhileFetching)),F)return r.status&&p.__staleWhileFetching!==void 0&&(r.status.returnedStale=!0),p.__staleWhileFetching;if(p.__returned===p)throw v},m=(v,y)=>{var F;const N=(F=Q(this,ya))==null?void 0:F.call(this,e,a,l);N&&N instanceof Promise&&N.then(X=>v(X===void 0?void 0:X),y),s.signal.addEventListener("abort",()=>{(!r.ignoreFetchAbort||r.allowStaleOnFetchAbort)&&(v(void 0),r.allowStaleOnFetchAbort&&(v=X=>u(X,!0)))})};r.status&&(r.status.fetchDispatched=!0);const g=new Promise(m).then(u,d),b=Object.assign(g,{__abortController:s,__staleWhileFetching:a,__returned:void 0});return t===void 0?(this.set(e,b,{...l.options,status:void 0}),t=Q(this,jt).get(e)):Q(this,et)[t]=b,b},At=new WeakSet,Mt=function(e){if(!Q(this,mi))return!1;const t=e;return!!t&&t instanceof Promise&&t.hasOwnProperty("__staleWhileFetching")&&t.__abortController instanceof Nl},$s=new WeakSet,Ph=function(e,t){Q(this,zr)[t]=e,Q(this,Dr)[e]=t},$i=new WeakSet,fs=function(e){e!==Q(this,sr)&&(e===Q(this,Sr)?Qe(this,Sr,Q(this,Dr)[e]):Ue(this,$s,Ph).call(this,Q(this,zr)[e],Q(this,Dr)[e]),Ue(this,$s,Ph).call(this,Q(this,sr),e),Qe(this,sr,e))};let Lh=Qm;const Pl=class Pl{constructor(){R(this,"_fallbackMethod",()=>this);R(this,"out",()=>{})}};R(Pl,"createSkipProxy",()=>{const e=new Pl;return new Proxy(e,{get(t,r,i){return typeof t[r]>"u"?t._fallbackMethod:t[r]},set(t,r,i,a){return!1}})});let Dl=Pl;const Bl=class Bl extends km{constructor(t,r){super(r);R(this,"_fallbackMethod",()=>this);R(this,"out",()=>{});this.values.duration=t}};R(Bl,"createRestProxy",(t,r)=>{const i=new Bl(t,r);return new Proxy(i,{get(a,s,o){return typeof a[s]>"u"?a._fallbackMethod:a[s]},set(a,s,o,l){return!1}})});let wl=Bl;class HM extends km{constructor(t,r,i){super(i);R(this,"input");R(this,"ziffers");R(this,"callTime",0);R(this,"played",!1);R(this,"current");R(this,"retro",!1);R(this,"tick",0);R(this,"next",()=>(this.current=this.ziffers.next(),this.played=!0,this.current));R(this,"pulseToSecond",t=>this.app.clock.convertPulseToSecond(t));R(this,"areWeThereYet",()=>{const t=this.ziffers.notStarted()||this.pulseToSecond(this.app.api.epulse())>this.pulseToSecond(this.callTime)+this.current.duration*this.pulseToSecond(this.app.api.ppqn()*4);return t?this.tick=0:this.tick++,t});R(this,"out",()=>{});this.app=i,this.input=t,this.ziffers=new uM(t,r)}sound(t){if(this.areWeThereYet()){const r=this.next();if(r instanceof Ki){const i=r.getExisting("freq","pitch","key","scale","octave");return new qy(i,this.app).sound(t)}else if(r instanceof Dh)return wl.createRestProxy(r.duration,this.app)}else return Dl.createSkipProxy()}midi(t=void 0){if(this.areWeThereYet()){const r=this.next();if(r instanceof Ki){const i=r.getExisting("note","pitch","bend","key","scale","octave"),a=new Vy(i,this.app);return t?a.note(t):a}else if(r instanceof Dh)return wl.createRestProxy(r.duration,this.app)}else return Dl.createSkipProxy()}scale(t){return this.ziffers.scale(t),this}key(t){return this.ziffers.key(t),this}octave(t){return this.ziffers.octave(t),this}retrograde(){return this.tick===0&&this.ziffers.index===0&&this.ziffers.retrograde(),this}}Array.prototype.palindrome=function(n){let e=Array.from(this),t=Array.from(this.reverse());return e.concat(t)};Array.prototype.random=function(n){return this[Math.floor(Math.random()*this.length)]};Array.prototype.loop=function(n){return this[n%this.length]};Array.prototype.rand=Array.prototype.random;Array.prototype.in=function(n){return this.includes(n)};async function zM(){return Promise.all([DM(),Il("github:Bubobubobubobubo/Topos-Samples/main"),Il("github:tidalcycles/Dirt-Samples/master").then(()=>qM())])}zM();const WM=(...n)=>n.map(e=>JSON.stringify(e)).join(",");class XM{constructor(e){R(this,"variables",{});R(this,"counters",{});R(this,"_drunk",new fM(-100,100,!1));R(this,"randomGen",Math.random);R(this,"currentSeed");R(this,"localSeeds",new Map);R(this,"patternCache",new Lh({max:1e3,ttl:1e3*60*5}));R(this,"errorTimeoutID",0);R(this,"MidiConnection",new pM);R(this,"load");R(this,"_reportError",e=>{console.log(e),clearTimeout(this.errorTimeoutID),this.app.error_line.innerHTML=e,this.app.error_line.classList.remove("hidden"),this.errorTimeoutID=setTimeout(()=>this.app.error_line.classList.add("hidden"),2e3)});R(this,"time",()=>this.app.audioContext.currentTime);R(this,"play",()=>{this.app.setButtonHighlighting("play",!0),this.app.clock.start()});R(this,"pause",()=>{this.app.setButtonHighlighting("pause",!0),this.app.clock.pause()});R(this,"stop",()=>{this.app.setButtonHighlighting("stop",!0),this.app.clock.stop()});R(this,"silence",this.stop);R(this,"hush",this.stop);R(this,"mouseX",()=>this.app._mouseX);R(this,"mouseY",()=>this.app._mouseY);R(this,"noteX",()=>Math.floor(this.app._mouseX/document.body.clientWidth*127));R(this,"noteY",()=>Math.floor(this.app._mouseY/document.body.clientHeight*127));R(this,"script",(...e)=>{e.forEach(t=>{vl(this.app,this.app.universes[this.app.selected_universe].locals[t])})});R(this,"s",this.script);R(this,"clear_script",e=>{this.app.universes[this.app.selected_universe].locals[e]={candidate:"",committed:"",evaluations:0}});R(this,"cs",this.clear_script);R(this,"copy_script",(e,t)=>{this.app.universes[this.app.selected_universe].locals[t]=this.app.universes[this.app.selected_universe].locals[e]});R(this,"cps",this.copy_script);R(this,"midi_outputs",()=>(console.log(this.MidiConnection.listMidiOutputs()),this.MidiConnection.midiOutputs));R(this,"midi_output",e=>{e?this.MidiConnection.switchMidiOutput(e):console.log(this.MidiConnection.getCurrentMidiPort())});R(this,"midi",(e=60)=>new Vy(e,this.app));R(this,"sysex",e=>{this.MidiConnection.sendSysExMessage(e)});R(this,"sy",this.sysex);R(this,"pitch_bend",(e,t)=>{this.MidiConnection.sendPitchBend(e,t)});R(this,"program_change",(e,t)=>{this.MidiConnection.sendProgramChange(e,t)});R(this,"pc",this.program_change);R(this,"midi_clock",()=>{this.MidiConnection.sendMidiClock()});R(this,"control_change",({control:e=20,value:t=0,channel:r=0})=>{this.MidiConnection.sendMidiControlChange(e,t,r)});R(this,"cc",this.control_change);R(this,"midi_panic",()=>{this.MidiConnection.panic()});R(this,"z",(e,t={})=>{const r=WM(e,t);let i;return this.app.api.patternCache.has(r)?i=this.app.api.patternCache.get(r):(i=new HM(e,t,this.app),this.app.api.patternCache.set(r,i)),(i&&i.ziffers.index===-1||i.played)&&(i.callTime=this.epulse(),i.played=!1),i});R(this,"counter",(e,t,r)=>(e in this.counters?(this.counters[e].limit!==t&&(this.counters[e].value=0,this.counters[e].limit=t),this.counters[e].step!==r&&(this.counters[e].step=r??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:r??1,limit:t},this.counters[e].value));R(this,"$",this.counter);R(this,"drunk",e=>e!==void 0?(this._drunk.position=e,this._drunk.getPosition()):(this._drunk.step(),this._drunk.getPosition()));R(this,"drunk_max",e=>{this._drunk.max=e});R(this,"drunk_min",e=>{this._drunk.min=e});R(this,"drunk_wrap",e=>{this._drunk.toggleWrap(e)});R(this,"variable",(e,t)=>typeof e=="string"&&t===void 0?this.variables[e]:(this.variables[e]=t,this.variables[e]));R(this,"v",this.variable);R(this,"delete_variable",e=>{delete this.variables[e]});R(this,"dv",this.delete_variable);R(this,"clear_variables",()=>{this.variables={}});R(this,"cv",this.clear_variables);R(this,"div",e=>{const t=this.epulse();return Math.floor(t/Math.floor(e*this.ppqn()))%2===0});R(this,"divbar",e=>{const t=this.bar()-1;return Math.floor(t/e)%2===0});R(this,"divseq",(...e)=>{const t=e[0],r=e.slice(1),i=this.epulse(),a=Math.floor(i/Math.floor(t*this.ppqn()));return r[a%r.length]});R(this,"pick",(...e)=>e[Math.floor(this.randomGen()*e.length)]);R(this,"seqbeat",(...e)=>e[this.ebeat()%e.length]);R(this,"mel",(e,t)=>t[e%t.length]);R(this,"seqbar",(...e)=>e[(this.app.clock.time_position.bar+1)%e.length]);R(this,"seqpulse",(...e)=>e[this.app.clock.time_position.pulse%e.length]);R(this,"randI",(e,t)=>Math.floor(this.randomGen()*(t-e+1))+e);R(this,"rand",(e,t)=>this.randomGen()*(t-e)+e);R(this,"irand",this.randI);R(this,"rI",this.randI);R(this,"r",this.rand);R(this,"ir",this.randI);R(this,"seed",e=>{typeof e=="number"&&(e=e.toString()),this.currentSeed!==e&&(this.currentSeed=e,this.randomGen=Nh(e))});R(this,"localSeededRandom",e=>{if(typeof e=="number"&&(e=e.toString()),this.localSeeds.has(e))return this.localSeeds.get(e);const t=Nh(e);return this.localSeeds.set(e,t),t});R(this,"clearLocalSeed",(e=void 0)=>{e&&this.localSeeds.delete(e.toString()),this.localSeeds.clear()});R(this,"quantize",(e,t)=>{if(t.length===0)return e;let r=t[0];return t.forEach(i=>{Math.abs(i-e)Math.min(Math.max(e,t),r));R(this,"cmp",this.clamp);R(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));R(this,"tempo",this.bpm);R(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));R(this,"ppqn",e=>e===void 0?this.app.clock.ppqn:(e<1&&console.log(`Setting ppqn to ${e}`),this.app.clock.ppqn=e,e));R(this,"time_signature",(e,t)=>{this.app.clock.time_signature=[e,t]});R(this,"odds",(e,t=15)=>this.randomGen()this.randomGen()<.025*this.ppqn()/(this.ppqn()*e));R(this,"rarely",(e=15)=>this.randomGen()<.1*this.ppqn()/(this.ppqn()*e));R(this,"scarcely",(e=15)=>this.randomGen()<.25*this.ppqn()/(this.ppqn()*e));R(this,"sometimes",(e=15)=>this.randomGen()<.5*this.ppqn()/(this.ppqn()*e));R(this,"often",(e=15)=>this.randomGen()<.75*this.ppqn()/(this.ppqn()*e));R(this,"frequently",(e=15)=>this.randomGen()<.9*this.ppqn()/(this.ppqn()*e));R(this,"almostAlways",(e=15)=>this.randomGen()<.985*this.ppqn()/(this.ppqn()*e));R(this,"dice",e=>Math.floor(this.randomGen()*e)+1);R(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);R(this,"bar",()=>this.app.clock.time_position.bar);R(this,"tick",()=>this.app.clock.tick);R(this,"pulse",()=>this.app.clock.time_position.pulse);R(this,"beat",()=>this.app.clock.time_position.beat);R(this,"ebeat",()=>this.app.clock.beats_since_origin);R(this,"epulse",()=>this.app.clock.pulses_since_origin);R(this,"onbar",(e,...t)=>{const r=[...Array(e).keys()].map(i=>i+1);return console.log(t.some(i=>r.includes(i%e))),t.some(i=>r.includes(i%e))});R(this,"onbeat",(...e)=>{let t=[];return e.forEach(r=>{r=r%this.app.clock.time_signature[0]+1;let i=Math.floor(r),a=r-i;t.push(i===this.app.clock.time_position.beat&&this.app.clock.time_position.pulse===a*this.app.clock.ppqn)}),t.some(r=>r==!0)});R(this,"prob",e=>this.randomGen()*100this.randomGen()>.5);R(this,"min",(...e)=>Math.min(...e));R(this,"max",(...e)=>Math.max(...e));R(this,"mean",(...e)=>e.reduce((r,i)=>r+i,0)/e.length);R(this,"limit",(e,t,r)=>Math.min(Math.max(e,t),r));R(this,"delay",(e,t)=>{setTimeout(t,e)});R(this,"delayr",(e,t,r)=>{[...Array(t).keys()].map(a=>e*a).forEach((a,s)=>{setTimeout(r,a)})});R(this,"mod",(...e)=>e.map(r=>this.epulse()%Math.floor(r*this.ppqn())===0).some(r=>r===!0));R(this,"modpulse",(...e)=>e.map(r=>this.epulse()%r===0).some(r=>r===!0));R(this,"pmod",this.modpulse);R(this,"modbar",(...e)=>e.map(r=>this.bar()%Math.floor(r*this.ppqn())===0).some(r=>r===!0));R(this,"bmod",this.modbar);R(this,"euclid",(e,t,r,i=0)=>this._euclidean_cycle(t,r,i)[e%r]);R(this,"eu",this.euclid);R(this,"bin",(e,t)=>{let i=t.toString(2).split("").map(a=>a==="1");return i[e%i.length]});R(this,"line",(e,t,r=1)=>{const i=[];if(t>e&&r>0||tMath.sin(this.app.clock.ctx.currentTime*Math.PI*2*e)+t);R(this,"usine",(e=1,t=0)=>(this.sine(e,t)+1)/2);R(this,"saw",(e=1,t=0)=>this.app.clock.ctx.currentTime*e%1*2-1+t);R(this,"usaw",(e=1,t=0)=>(this.saw(e,t)+1)/2);R(this,"triangle",(e=1,t=0)=>Math.abs(this.saw(e,t))*2-1);R(this,"utriangle",(e=1,t=0)=>(this.triangle(e,t)+1)/2);R(this,"square",(e=1,t=0,r=.5)=>{const i=1/e;return(Date.now()/1e3+t)%i/i(this.square(e,t,r)+1)/2);R(this,"noise",()=>this.randomGen()*2-1);R(this,"abs",Math.abs);R(this,"sound",e=>new qy(e,this.app));R(this,"snd",this.sound);R(this,"samples",Il);R(this,"soundMap",Pm);R(this,"log",console.log);R(this,"scale",mM);R(this,"rate",e=>{});this.app=e}_euclidean_cycle(e,t,r=0){if(e==t)return Array.from({length:t},()=>!0);function i(o,l){const u=o.length,d=(l+1)%u;return o[l]>o[d]}if(e>=t)return[!0];const a=Array.from({length:t},(o,l)=>(e*(l-1)%t+t)%t);let s=a.map((o,l)=>i(a,l));return r!=0&&(s=s.slice(r).concat(s.slice(0,r))),s}}var Wo=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Zy(n){return n&&n.__esModule&&Object.prototype.hasOwnProperty.call(n,"default")?n.default:n}var Ky={exports:{}};(function(n){(function(){function e(p){var E={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(p===!1)return JSON.parse(JSON.stringify(E));var O={};for(var A in E)E.hasOwnProperty(A)&&(O[A]=E[A].defaultValue);return O}function t(){var p=e(!0),E={};for(var O in p)p.hasOwnProperty(O)&&(E[O]=!0);return E}var r={},i={},a={},s=e(!0),o="vanilla",l={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:t()};r.helper={},r.extensions={},r.setOption=function(p,E){return s[p]=E,this},r.getOption=function(p){return s[p]},r.getOptions=function(){return s},r.resetOptions=function(){s=e(!0)},r.setFlavor=function(p){if(!l.hasOwnProperty(p))throw Error(p+" flavor was not found");r.resetOptions();var E=l[p];o=p;for(var O in E)E.hasOwnProperty(O)&&(s[O]=E[O])},r.getFlavor=function(){return o},r.getFlavorOptions=function(p){if(l.hasOwnProperty(p))return l[p]},r.getDefaultOptions=function(p){return e(p)},r.subParser=function(p,E){if(r.helper.isString(p))if(typeof E<"u")i[p]=E;else{if(i.hasOwnProperty(p))return i[p];throw Error("SubParser named "+p+" not registered!")}},r.extension=function(p,E){if(!r.helper.isString(p))throw Error("Extension 'name' must be a string");if(p=r.helper.stdExtName(p),r.helper.isUndefined(E)){if(!a.hasOwnProperty(p))throw Error("Extension named "+p+" is not registered!");return a[p]}else{typeof E=="function"&&(E=E()),r.helper.isArray(E)||(E=[E]);var O=u(E,p);if(O.valid)a[p]=E;else throw Error(O.error)}},r.getAllExtensions=function(){return a},r.removeExtension=function(p){delete a[p]},r.resetExtensions=function(){a={}};function u(p,E){var O=E?"Error in "+E+" extension->":"Error in unnamed extension",A={valid:!0,error:""};r.helper.isArray(p)||(p=[p]);for(var D=0;D"u"},r.helper.forEach=function(p,E){if(r.helper.isUndefined(p))throw new Error("obj param is required");if(r.helper.isUndefined(E))throw new Error("callback param is required");if(!r.helper.isFunction(E))throw new Error("callback param must be a function/closure");if(typeof p.forEach=="function")p.forEach(E);else if(r.helper.isArray(p))for(var O=0;O").replace(/&/g,"&")};var f=function(p,E,O,A){var D=A||"",M=D.indexOf("g")>-1,w=new RegExp(E+"|"+O,"g"+D.replace(/g/g,"")),B=new RegExp(E,D.replace(/g/g,"")),re=[],ie,j,J,L,G;do for(ie=0;J=w.exec(p);)if(B.test(J[0]))ie++||(j=w.lastIndex,L=j-J[0].length);else if(ie&&!--ie){G=J.index+J[0].length;var Z={left:{start:L,end:j},match:{start:j,end:J.index},right:{start:J.index,end:G},wholeMatch:{start:L,end:G}};if(re.push(Z),!M)return re}while(ie&&(w.lastIndex=j));return re};r.helper.matchRecursiveRegExp=function(p,E,O,A){for(var D=f(p,E,O,A),M=[],w=0;w0){var ie=[];w[0].wholeMatch.start!==0&&ie.push(p.slice(0,w[0].wholeMatch.start));for(var j=0;j=0?A+(O||0):A},r.helper.splitAtIndex=function(p,E){if(!r.helper.isString(p))throw"InvalidArgumentError: first parameter of showdown.helper.regexIndexOf function must be a string";return[p.substring(0,E),p.substring(E)]},r.helper.encodeEmailAddress=function(p){var E=[function(O){return"&#"+O.charCodeAt(0)+";"},function(O){return"&#x"+O.charCodeAt(0).toString(16)+";"},function(O){return O}];return p=p.replace(/./g,function(O){if(O==="@")O=E[Math.floor(Math.random()*2)](O);else{var A=Math.random();O=A>.9?E[2](O):A>.45?E[1](O):E[0](O)}return O}),p},r.helper.padEnd=function(E,O,A){return O=O>>0,A=String(A||" "),E.length>O?String(E):(O=O-E.length,O>A.length&&(A+=A.repeat(O/A.length)),String(E)+A.slice(0,O))},typeof console>"u"&&(console={warn:function(p){alert(p)},log:function(p){alert(p)},error:function(p){throw p}}),r.helper.regexes={asteriskDashAndColon:/([*_:~])/g},r.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`},r.Converter=function(p){var E={},O=[],A=[],D={},M=o,w={parsed:{},raw:"",format:""};B();function B(){p=p||{};for(var L in s)s.hasOwnProperty(L)&&(E[L]=s[L]);if(typeof p=="object")for(var G in p)p.hasOwnProperty(G)&&(E[G]=p[G]);else throw Error("Converter expects the passed parameter to be an object, but "+typeof p+" was passed instead.");E.extensions&&r.helper.forEach(E.extensions,re)}function re(L,G){if(G=G||null,r.helper.isString(L))if(L=r.helper.stdExtName(L),G=L,r.extensions[L]){console.warn("DEPRECATION WARNING: "+L+" is an old extension that uses a deprecated loading method.Please inform the developer that the extension should be updated!"),ie(r.extensions[L],L);return}else if(!r.helper.isUndefined(a[L]))L=a[L];else throw Error('Extension "'+L+'" could not be loaded. It was either not found or is not a valid extension.');typeof L=="function"&&(L=L()),r.helper.isArray(L)||(L=[L]);var Z=u(L,G);if(!Z.valid)throw Error(Z.error);for(var z=0;z>",!1),Vt=vt("<<",!1),ht=vt("<",!1),Nt=vt(">",!1),kt=vt("_",!1),Qr=vt("?",!1),Fe=vt(":",!1),Mr=vt("r",!1),st=function(U){return U.filter(K=>K)},$e=function(){return parseFloat(Tr())},Pr=function(){return parseInt(Tr())},nr=function(){},mr=function(){return Yk[Tr()]},V=function(U){return U.filter(K=>K)},he=function(U){return vr(oM,{items:U})},ve=function(U,K,ae){return vr(lM,{left:U,operation:K,right:ae})},Ce=function(U){return U},Ke=function(U){return vr(Lm,{items:U})},Ee=function(U){return vr(iM,{octave:U})},Gt=function(){return Tr().split("").reduce((U,K)=>U+(K==="^"?1:-1),0)},ot=function(){return vr(FS,{seededRandom:a.seededRandom})},bt=function(U,K){return vr(FS,{min:U,max:K,seededRandom:a.seededRandom})},en=function(U,K){return vr(sM,{item:U,times:K})},lt=function(U){return vr(aM,{duration:U})},Wt=function(U){return vr(Dh,{duration:U})},St=function(U,K,ae){const _e=U?a.nodeOptions.octave+U:a.nodeOptions.octave;return vr(Ki,{duration:K,pitch:ae,octave:_e})},we=function(U,K){return vr(nM,{pitches:[U].concat(K)})},H=0,Ot=0,nt=[{line:1,column:1}],Qt=0,cr=[],ze=0,Ge={},Dt;if("startRule"in a){if(!(a.startRule in l))throw new Error(`Can't start parsing from rule "`+a.startRule+'".');u=l[a.startRule]}function Tr(){return i.substring(Ot,H)}function yi(){return $t(Ot,H)}function vt(U,K){return{type:"literal",text:U,ignoreCase:K}}function $n(U,K,ae){return{type:"class",parts:U,inverted:K,ignoreCase:ae}}function tn(){return{type:"end"}}function qn(U){return{type:"other",description:U}}function rn(U){var K=nt[U],ae;if(K)return K;for(ae=U-1;!nt[ae];)ae--;for(K=nt[ae],K={line:K.line,column:K.column};aeQt&&(Qt=H,cr=[]),cr.push(U))}function ni(U,K,ae){return new e(e.buildMessage(U,K),U,K,ae)}function Y(){var U,K,ae=H*24+0,_e=Ge[ae];return _e?(H=_e.nextPos,_e.result):(U=H,K=ye(),K!==s&&(Ot=U,K=st(K)),U=K,Ge[ae]={nextPos:H,result:U},U)}function ee(){var U,K,ae,_e,Le,Je,yr,An=H*24+1,Ri=Ge[An];if(Ri)return H=Ri.nextPos,Ri.result;for(U=H,K=H,i.charCodeAt(H)===45?(ae=d,H++):(ae=s,ze===0&&We(G)),ae===s&&(ae=null),_e=[],j.test(i.charAt(H))?(Le=i.charAt(H),H++):(Le=s,ze===0&&We(Z));Le!==s;)_e.push(Le),j.test(i.charAt(H))?(Le=i.charAt(H),H++):(Le=s,ze===0&&We(Z));if(i.charCodeAt(H)===46?(Le=f,H++):(Le=s,ze===0&&We(z)),Le!==s){if(Je=[],j.test(i.charAt(H))?(yr=i.charAt(H),H++):(yr=s,ze===0&&We(Z)),yr!==s)for(;yr!==s;)Je.push(yr),j.test(i.charAt(H))?(yr=i.charAt(H),H++):(yr=s,ze===0&&We(Z));else Je=s;Je!==s?(ae=[ae,_e,Le,Je],K=ae):(H=K,K=s)}else H=K,K=s;if(K===s)if(K=H,i.charCodeAt(H)===46?(ae=f,H++):(ae=s,ze===0&&We(z)),ae!==s){if(_e=[],j.test(i.charAt(H))?(Le=i.charAt(H),H++):(Le=s,ze===0&&We(Z)),Le!==s)for(;Le!==s;)_e.push(Le),j.test(i.charAt(H))?(Le=i.charAt(H),H++):(Le=s,ze===0&&We(Z));else _e=s;_e!==s?(ae=[ae,_e],K=ae):(H=K,K=s)}else H=K,K=s;return K!==s&&(Ot=U,K=$e()),U=K,Ge[An]={nextPos:H,result:U},U}function se(){var U,K,ae=H*24+2,_e=Ge[ae];return _e?(H=_e.nextPos,_e.result):(U=H,i.charCodeAt(H)===45?H++:ze===0&&We(G),j.test(i.charAt(H))?(K=i.charAt(H),H++):(K=s,ze===0&&We(Z)),K!==s?(Ot=U,U=Pr()):(H=U,U=s),Ge[ae]={nextPos:H,result:U},U)}function fe(){var U,K,ae=H*24+3,_e=Ge[ae];return _e?(H=_e.nextPos,_e.result):(ze++,U=H,J.test(i.charAt(H))?(K=i.charAt(H),H++):(K=s,ze===0&&We(ue)),K!==s&&(Ot=U,K=nr()),U=K,ze--,U===s&&(K=s,ze===0&&We(ce)),Ge[ae]={nextPos:H,result:U},U)}function Se(){var U,K,ae=H*24+7,_e=Ge[ae];return _e?(H=_e.nextPos,_e.result):(U=H,L.test(i.charAt(H))?(K=i.charAt(H),H++):(K=s,ze===0&&We(Ve)),K!==s&&(Ot=U,K=mr()),U=K,Ge[ae]={nextPos:H,result:U},U)}function xe(){var U,K=H*24+8,ae=Ge[K];return ae?(H=ae.nextPos,ae.result):(U=Se(),U===s&&(U=ee()),Ge[K]={nextPos:H,result:U},U)}function ye(){var U,K,ae,_e=H*24+9,Le=Ge[_e];if(Le)return H=Le.nextPos,Le.result;if(U=H,K=[],ae=Ai(),ae===s&&(ae=_r(),ae===s&&(ae=dt(),ae===s&&(ae=ii(),ae===s&&(ae=ai())))),ae!==s)for(;ae!==s;)K.push(ae),ae=Ai(),ae===s&&(ae=_r(),ae===s&&(ae=dt(),ae===s&&(ae=ii(),ae===s&&(ae=ai()))));else K=s;return K!==s&&(Ot=U,K=V(K)),U=K,Ge[_e]={nextPos:H,result:U},U}function dt(){var U,K,ae,_e,Le=H*24+10,Je=Ge[Le];return Je?(H=Je.nextPos,Je.result):(U=H,i.charCodeAt(H)===40?(K=b,H++):(K=s,ze===0&&We(Re)),K!==s?(ae=ye(),ae!==s?(i.charCodeAt(H)===41?(_e=v,H++):(_e=s,ze===0&&We(Ie)),_e!==s?(Ot=U,U=he(ae)):(H=U,U=s)):(H=U,U=s)):(H=U,U=s),Ge[Le]={nextPos:H,result:U},U)}function _r(){var U,K,ae,_e,Le=H*24+11,Je=Ge[Le];return Je?(H=Je.nextPos,Je.result):(U=H,K=dt(),K!==s?(ae=$r(),ae!==s?(_e=dt(),_e!==s?(Ot=U,U=ve(K,ae,_e)):(H=U,U=s)):(H=U,U=s)):(H=U,U=s),Ge[Le]={nextPos:H,result:U},U)}function $r(){var U,K=H*24+12,ae=Ge[K];return ae?(H=ae.nextPos,ae.result):(i.charCodeAt(H)===43?(U=y,H++):(U=s,ze===0&&We(le)),U===s&&(i.charCodeAt(H)===45?(U=d,H++):(U=s,ze===0&&We(G)),U===s&&(i.charCodeAt(H)===42?(U=N,H++):(U=s,ze===0&&We(Me)),U===s&&(i.charCodeAt(H)===47?(U=F,H++):(U=s,ze===0&&We(je)),U===s&&(i.charCodeAt(H)===37?(U=X,H++):(U=s,ze===0&&We(He)),U===s&&(i.charCodeAt(H)===94?(U=p,H++):(U=s,ze===0&&We(rt)),U===s&&(i.charCodeAt(H)===124?(U=g,H++):(U=s,ze===0&&We(Pe)),U===s&&(i.charCodeAt(H)===38?(U=E,H++):(U=s,ze===0&&We(ft)),U===s&&(i.substr(H,2)===O?(U=O,H+=2):(U=s,ze===0&&We(Ct)),U===s&&(i.substr(H,2)===A?(U=A,H+=2):(U=s,ze===0&&We(Vt))))))))))),Ge[K]={nextPos:H,result:U},U)}function ii(){var U,K,ae=H*24+13,_e=Ge[ae];return _e?(H=_e.nextPos,_e.result):(U=H,K=ra(),K===s&&(K=na(),K===s&&(K=si(),K===s&&(K=Va(),K===s&&(K=fe(),K===s&&(K=za(),K===s&&(K=Ha(),K===s&&(K=ta(),K===s&&(K=dt())))))))),K!==s&&(Ot=U,K=Ce(K)),U=K,Ge[ae]={nextPos:H,result:U},U)}function ai(){var U,K,ae,_e,Le=H*24+14,Je=Ge[Le];return Je?(H=Je.nextPos,Je.result):(U=H,i.charCodeAt(H)===60?(K=D,H++):(K=s,ze===0&&We(ht)),K!==s?(ae=ye(),ae!==s?(i.charCodeAt(H)===62?(_e=M,H++):(_e=s,ze===0&&We(Nt)),_e!==s?(Ot=U,U=Ke(ae)):(H=U,U=s)):(H=U,U=s)):(H=U,U=s),Ge[Le]={nextPos:H,result:U},U)}function Va(){var U,K,ae=H*24+15,_e=Ge[ae];return _e?(H=_e.nextPos,_e.result):(U=H,K=Br(),K!==s&&(Ot=U,K=Ee(K)),U=K,Ge[ae]={nextPos:H,result:U},U)}function Br(){var U,K,ae,_e=H*24+16,Le=Ge[_e];if(Le)return H=Le.nextPos,Le.result;if(U=H,K=[],i.charCodeAt(H)===94?(ae=p,H++):(ae=s,ze===0&&We(rt)),ae===s&&(i.charCodeAt(H)===95?(ae=w,H++):(ae=s,ze===0&&We(kt))),ae!==s)for(;ae!==s;)K.push(ae),i.charCodeAt(H)===94?(ae=p,H++):(ae=s,ze===0&&We(rt)),ae===s&&(i.charCodeAt(H)===95?(ae=w,H++):(ae=s,ze===0&&We(kt)));else K=s;return K!==s&&(Ot=U,K=Gt()),U=K,Ge[_e]={nextPos:H,result:U},U}function Ha(){var U,K,ae=H*24+17,_e=Ge[ae];return _e?(H=_e.nextPos,_e.result):(U=H,i.charCodeAt(H)===63?(K=B,H++):(K=s,ze===0&&We(Qr)),K!==s&&(Ot=U,K=ot()),U=K,Ge[ae]={nextPos:H,result:U},U)}function ta(){var U,K,ae,_e,Le,Je,yr=H*24+18,An=Ge[yr];return An?(H=An.nextPos,An.result):(U=H,i.charCodeAt(H)===40?(K=b,H++):(K=s,ze===0&&We(Re)),K!==s?(ae=se(),ae!==s?(i.charCodeAt(H)===44?(_e=m,H++):(_e=s,ze===0&&We(Te)),_e!==s?(Le=se(),Le!==s?(i.charCodeAt(H)===41?(Je=v,H++):(Je=s,ze===0&&We(Ie)),Je!==s?(Ot=U,U=bt(ae,Le)):(H=U,U=s)):(H=U,U=s)):(H=U,U=s)):(H=U,U=s)):(H=U,U=s),Ge[yr]={nextPos:H,result:U},U)}function Ai(){var U,K,ae,_e,Le=H*24+19,Je=Ge[Le];return Je?(H=Je.nextPos,Je.result):(U=H,K=ii(),K!==s?(i.charCodeAt(H)===58?(ae=re,H++):(ae=s,ze===0&&We(Fe)),ae!==s?(_e=se(),_e!==s?(Ot=U,U=en(K,_e)):(H=U,U=s)):(H=U,U=s)):(H=U,U=s),Ge[Le]={nextPos:H,result:U},U)}function za(){var U,K,ae=H*24+20,_e=Ge[ae];return _e?(H=_e.nextPos,_e.result):(U=H,K=xe(),K!==s&&(Ot=U,K=lt(K)),U=K,Ge[ae]={nextPos:H,result:U},U)}function ra(){var U,K,ae,_e=H*24+21,Le=Ge[_e];return Le?(H=Le.nextPos,Le.result):(U=H,K=xe(),K===s&&(K=null),i.charCodeAt(H)===114?(ae=ie,H++):(ae=s,ze===0&&We(Mr)),ae!==s?(Ot=U,U=Wt(K)):(H=U,U=s),Ge[_e]={nextPos:H,result:U},U)}function si(){var U,K,ae,_e,Le=H*24+22,Je=Ge[Le];return Je?(H=Je.nextPos,Je.result):(U=H,K=Br(),K===s&&(K=null),ae=xe(),ae===s&&(ae=null),_e=se(),_e!==s?(Ot=U,U=St(K,ae,_e)):(H=U,U=s),Ge[Le]={nextPos:H,result:U},U)}function na(){var U,K,ae,_e,Le=H*24+23,Je=Ge[Le];if(Je)return H=Je.nextPos,Je.result;if(U=H,K=si(),K!==s){if(ae=[],_e=si(),_e!==s)for(;_e!==s;)ae.push(_e),_e=si();else ae=s;ae!==s?(Ot=U,U=we(K,ae)):(H=U,U=s)}else H=U,U=s;return Ge[Le]={nextPos:H,result:U},U}var Cr=a.nodeOptions||{};function vr(U,K){K.text=Tr(),K.location=yi();for(var ae in Cr)(K[ae]===void 0||K[ae]===null)&&(K[ae]=Cr[ae]);return new U(K)}if(Dt=u(),Dt!==s&&H===i.length)return Dt;throw Dt!==s&&He.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"))}retrograde(){return this.evaluated=this.evaluated.reverse(),this}scale(e){return this.isInOptions("scaleName",e)?this:(this.update({scale:e}),this)}key(e){return console.log("KEY?",this.isInOptions("key",e)),this.isInOptions("key",e)?this:(this.update({key:e}),this)}octave(e){return this.isInOptions("octave",e)?this:(this.update({octave:e}),this)}isInOptions(e,t){return this.options.nodeOptions&&this.options.nodeOptions[e]===t}next(){this.index++,this.counter++;const e=this.evaluated[this.index%this.evaluated.length];return this.redo>0&&this.index>=this.evaluated.length*this.redo&&(this.update(),this.index=0),e}applyTransformations(){var e;(e=this.globalOptions)!=null&&e.retrograde&&(this.evaluated=this.evaluated.reverse())}clone(){return Al(this)}notStarted(){return this.index<0}peek(){return this.evaluated[this.index-1||0]}hasStarted(){return this.index>=0}evaluate(e={}){const t=this.values.map(r=>r.evaluate(e)).flat(1/0).filter(r=>r!==void 0);return t.forEach((r,i)=>{r._next=i0?i-1:t.length-1}),t}}const dM=n=>{let e={};return rM.forEach(t=>{if(n[t]!==void 0){const r=n[t];e[t]=r,delete n[t]}}),e};class pM{constructor(){R(this,"midiAccess",null);R(this,"midiOutputs",[]);R(this,"currentOutputIndex",0);R(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."),this.currentOutputIndex=-1)}catch(e){console.error("Failed to initialize MIDI:",e)}}getCurrentMidiPort(){return this.midiOutputs.length>0&&this.currentOutputIndex>=0&&this.currentOutputIndex0&&this.currentOutputIndex>=0&&this.currentOutputIndex=this.midiOutputs.length?(console.error(`Invalid MIDI output index. Index must be in the range 0-${this.midiOutputs.length-1}.`),this.currentOutputIndex):e;{const t=this.midiOutputs.findIndex(r=>r.name===e);return t!==-1?t:(console.error(`MIDI output "${e}" not found.`),this.currentOutputIndex)}}listMidiOutputs(){console.log("Available MIDI Outputs:"),this.midiOutputs.forEach((e,t)=>{console.log(`${t+1}. ${e.name}`)})}sendMidiNote(e,t,r,i,a=this.currentOutputIndex,s=void 0){typeof a=="string"&&(a=this.getMidiOutputIndex(a));const o=this.midiOutputs[a];if(e=Math.min(Math.max(e,0),127),o){const l=[144+t,e,r],u=[128+t,e,0];o.send(l),s&&this.sendPitchBend(s,t,a);const d=setTimeout(()=>{o.send(u),s&&this.sendPitchBend(8192,t,a),delete this.scheduledNotes[e]},(i-.02)*1e3);this.scheduledNotes[e]=d}else console.error("MIDI output not available.")}sendSysExMessage(e){const t=this.midiOutputs[this.currentOutputIndex];t?t.send(e):console.error("MIDI output not available.")}sendPitchBend(e,t,r=this.currentOutputIndex){(e<0||e>16383)&&console.error("Invalid pitch bend value. Value must be in the range 0-16383."),(t<0||t>15)&&console.error("Invalid MIDI channel. Channel must be in the range 0-15."),typeof r=="string"&&(r=this.getMidiOutputIndex(r));const i=this.midiOutputs[r];if(i){const a=e&127,s=e>>7&127;i.send([224|t,a,s])}else console.error("MIDI output not available.")}sendProgramChange(e,t){const r=this.midiOutputs[this.currentOutputIndex];r?r.send([192+t,e]):console.error("MIDI output not available.")}sendMidiControlChange(e,t,r){const i=this.midiOutputs[this.currentOutputIndex];i?i.send([176+r,e,t]):console.error("MIDI output not available.")}panic(){const e=this.midiOutputs[this.currentOutputIndex];if(e){for(const t in this.scheduledNotes){const r=this.scheduledNotes[t];clearTimeout(r),e.send([128,parseInt(t),0])}this.scheduledNotes={}}else console.error("MIDI output not available.")}}class fM{constructor(e,t,r){R(this,"min");R(this,"max");R(this,"wrap");R(this,"position");this.min=e,this.max=t,this.wrap=r,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 hM={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 mM(n,e="major",t=4){const r=hM[e];if(!r)throw new Error(`Unknown scale ${e}`);let i=n%r.length;i<0&&(i+=r.length);let a=Math.floor(n/r.length);return 60+(t+a)*12+r[i]}class km{constructor(e){R(this,"seedValue");R(this,"randomGen",Math.random);R(this,"app");R(this,"values",{});R(this,"odds",(e,t)=>this.randomGen()this.odds(.025,e));R(this,"rarely",e=>this.odds(.1,e));R(this,"scarcely",e=>this.odds(.25,e));R(this,"sometimes",e=>this.odds(.5,e));R(this,"often",e=>this.odds(.75,e));R(this,"frequently",e=>this.odds(.9,e));R(this,"almostAlways",e=>this.odds(.985,e));R(this,"modify",e=>e(this));R(this,"seed",e=>(this.seedValue=e.toString(),this.randomGen=this.app.api.localSeededRandom(this.seedValue),this));R(this,"clear",()=>(this.app.api.clearLocalSeed(this.seedValue),this));R(this,"apply",e=>this.modify(e));R(this,"duration",e=>(this.values.duration=e,this));this.app=e,this.app.api.currentSeed&&(this.randomGen=this.app.api.randomGen)}}class Gy extends km{constructor(t){super(t);R(this,"octave",t=>(this.values.octave=t,this.update(),this));R(this,"key",t=>(this.values.key=t,this.update(),this));R(this,"scale",t=>(Dm(t)?(this.values.scaleName=t,this.values.parsedScale=Zi(t)):this.values.parsedScale=wm(t),this.update(),this));R(this,"freq",t=>{this.values.freq=t;const r=zk(t);return r%1!==0?(this.values.note=Math.floor(r),this.values.bend=Uy(r)[1]):this.values.note=r,this});R(this,"update",()=>{})}}let Nr=[],_M=(n,e)=>{let t,r=[],i={lc:0,l:e||0,value:n,set(a){i.value=a,i.notify()},get(){return i.lc||i.listen(()=>{})(),i.value},notify(a){t=r;let s=!Nr.length;for(let o=0;o{r===t&&(r=r.slice());let o=r.indexOf(a);~o&&(r.splice(o,2),i.lc--,i.lc||i.off())}},subscribe(a,s){let o=i.listen(a,s);return a(i.value),o},off(){}};return i},gM=(n={})=>{let e=_M(n);return e.setKey=function(t,r){typeof r>"u"?t in e.value&&(e.value={...e.value},delete e.value[t],e.notify(t)):e.value[t]!==r&&(e.value={...e.value,[t]:r},e.notify(t))},e};if(typeof DelayNode<"u"){class n extends DelayNode{constructor(t,r,i,a){super(t),r=Math.abs(r),this.delayTime.value=i;const s=t.createGain();s.gain.value=Math.min(Math.abs(a),.995),this.feedback=s.gain;const o=t.createGain();return o.gain.value=r,this.delayGain=o,this.connect(s),this.connect(o),s.connect(this),this.connect=l=>o.connect(l),this}start(t){this.delayGain.gain.setValueAtTime(this.delayGain.gain.value,t+this.delayTime.value)}}AudioContext.prototype.createFeedbackDelay=function(e,t,r){return new n(this,e,t,r)}}typeof AudioContext<"u"&&(AudioContext.prototype.impulseResponse=function(n,e=1){const t=this.sampleRate*n,r=this.createBuffer(e,t,this.sampleRate),i=r.getChannelData(0);for(let a=0;a(e.buffer=this.impulseResponse(t),e.duration=n,e),e.setDuration(n),e});var YS={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 n extends GainNode{constructor(t,r){if(super(t),!YS[r])throw new Error("vowel: unknown vowel "+r);const{gains:i,qs:a,freqs:s}=YS[r],o=t.createGain();for(let l=0;l<5;l++){const u=t.createGain();u.gain.value=i[l];const d=t.createBiquadFilter();d.type="bandpass",d.Q.value=a[l],d.frequency.value=s[l],this.connect(d),d.connect(u),u.connect(o)}return o.gain.value=8,this.connect=l=>o.connect(l),this}}AudioContext.prototype.createVowelFilter=function(e){return new n(this,e)}}const SM=n=>{var i;if(typeof n!="string")return[];const[e,t="",r]=((i=n.match(/^([a-gA-G])([#bsf]*)([0-9]*)$/))==null?void 0:i.slice(1))||[];return e?[e,t,r?Number(r):void 0]:[]},OM={c:0,d:2,e:4,f:5,g:7,a:9,b:11},EM={"#":1,b:-1,s:1,f:-1},Mm=(n,e=3)=>{const[t,r,i=e]=SM(n);if(!t)throw new Error('not a note: "'+n+'"');const a=OM[t.toLowerCase()],s=(r==null?void 0:r.split("").reduce((o,l)=>o+EM[l],0))||0;return(Number(i)+1)*12+a+s},bM=n=>Math.pow(2,(n-69)/12)*440,TM=(n,e,t)=>Math.min(Math.max(n,e),t),CM=n=>12*Math.log(n/440)/Math.LN2+69,vM=(n,e)=>{if(typeof n!="object")throw new Error("valueToMidi: expected object value");let{freq:t,note:r}=n;if(typeof t=="number")return CM(t);if(typeof r=="string")return Mm(r);if(typeof r=="number")return r;if(!e)throw new Error("valueToMidi: expected freq or note to be set");return e},yM="data:application/javascript;base64,Ly8gTElDRU5TRSBHTlUgR2VuZXJhbCBQdWJsaWMgTGljZW5zZSB2My4wIHNlZSBodHRwczovL2dpdGh1Yi5jb20vZGt0cjAvV2ViRGlydC9ibG9iL21haW4vTElDRU5TRQovLyBhbGwgdGhlIGNyZWRpdCBnb2VzIHRvIGRrdHIwJ3Mgd2ViZGlydDogaHR0cHM6Ly9naXRodWIuY29tL2RrdHIwL1dlYkRpcnQvYmxvYi81Y2UzZDY5ODM2MmM1NGQ2ZTFiNjhhY2M0N2ViMjk1NWFjNjJjNzkzL2Rpc3QvQXVkaW9Xb3JrbGV0cy5qcwovLyA8MwoKY2xhc3MgQ29hcnNlUHJvY2Vzc29yIGV4dGVuZHMgQXVkaW9Xb3JrbGV0UHJvY2Vzc29yIHsKICBzdGF0aWMgZ2V0IHBhcmFtZXRlckRlc2NyaXB0b3JzKCkgewogICAgcmV0dXJuIFt7IG5hbWU6ICdjb2Fyc2UnLCBkZWZhdWx0VmFsdWU6IDEgfV07CiAgfQoKICBjb25zdHJ1Y3RvcigpIHsKICAgIHN1cGVyKCk7CiAgICB0aGlzLm5vdFN0YXJ0ZWQgPSB0cnVlOwogIH0KCiAgcHJvY2VzcyhpbnB1dHMsIG91dHB1dHMsIHBhcmFtZXRlcnMpIHsKICAgIGNvbnN0IGlucHV0ID0gaW5wdXRzWzBdOwogICAgY29uc3Qgb3V0cHV0ID0gb3V0cHV0c1swXTsKICAgIGNvbnN0IGNvYXJzZSA9IHBhcmFtZXRlcnMuY29hcnNlOwogICAgY29uc3QgYmxvY2tTaXplID0gMTI4OwogICAgY29uc3QgaGFzSW5wdXQgPSAhKGlucHV0WzBdID09PSB1bmRlZmluZWQpOwogICAgaWYgKGhhc0lucHV0KSB7CiAgICAgIHRoaXMubm90U3RhcnRlZCA9IGZhbHNlOwogICAgICBvdXRwdXRbMF1bMF0gPSBpbnB1dFswXVswXTsKICAgICAgZm9yIChsZXQgbiA9IDE7IG4gPCBibG9ja1NpemU7IG4rKykgewogICAgICAgIGZvciAobGV0IG8gPSAwOyBvIDwgb3V0cHV0Lmxlbmd0aDsgbysrKSB7CiAgICAgICAgICBvdXRwdXRbb11bbl0gPSBuICUgY29hcnNlID09IDAgPyBpbnB1dFswXVtuXSA6IG91dHB1dFtvXVtuIC0gMV07CiAgICAgICAgfQogICAgICB9CiAgICB9CiAgICByZXR1cm4gdGhpcy5ub3RTdGFydGVkIHx8IGhhc0lucHV0OwogIH0KfQoKcmVnaXN0ZXJQcm9jZXNzb3IoJ2NvYXJzZS1wcm9jZXNzb3InLCBDb2Fyc2VQcm9jZXNzb3IpOwoKY2xhc3MgQ3J1c2hQcm9jZXNzb3IgZXh0ZW5kcyBBdWRpb1dvcmtsZXRQcm9jZXNzb3IgewogIHN0YXRpYyBnZXQgcGFyYW1ldGVyRGVzY3JpcHRvcnMoKSB7CiAgICByZXR1cm4gW3sgbmFtZTogJ2NydXNoJywgZGVmYXVsdFZhbHVlOiAwIH1dOwogIH0KCiAgY29uc3RydWN0b3IoKSB7CiAgICBzdXBlcigpOwogICAgdGhpcy5ub3RTdGFydGVkID0gdHJ1ZTsKICB9CgogIHByb2Nlc3MoaW5wdXRzLCBvdXRwdXRzLCBwYXJhbWV0ZXJzKSB7CiAgICBjb25zdCBpbnB1dCA9IGlucHV0c1swXTsKICAgIGNvbnN0IG91dHB1dCA9IG91dHB1dHNbMF07CiAgICBjb25zdCBjcnVzaCA9IHBhcmFtZXRlcnMuY3J1c2g7CiAgICBjb25zdCBibG9ja1NpemUgPSAxMjg7CiAgICBjb25zdCBoYXNJbnB1dCA9ICEoaW5wdXRbMF0gPT09IHVuZGVmaW5lZCk7CiAgICBpZiAoaGFzSW5wdXQpIHsKICAgICAgdGhpcy5ub3RTdGFydGVkID0gZmFsc2U7CiAgICAgIGlmIChjcnVzaC5sZW5ndGggPT09IDEpIHsKICAgICAgICBjb25zdCB4ID0gTWF0aC5wb3coMiwgY3J1c2hbMF0gLSAxKTsKICAgICAgICBmb3IgKGxldCBuID0gMDsgbiA8IGJsb2NrU2l6ZTsgbisrKSB7CiAgICAgICAgICBjb25zdCB2YWx1ZSA9IE1hdGgucm91bmQoaW5wdXRbMF1bbl0gKiB4KSAvIHg7CiAgICAgICAgICBmb3IgKGxldCBvID0gMDsgbyA8IG91dHB1dC5sZW5ndGg7IG8rKykgewogICAgICAgICAgICBvdXRwdXRbb11bbl0gPSB2YWx1ZTsKICAgICAgICAgIH0KICAgICAgICB9CiAgICAgIH0gZWxzZSB7CiAgICAgICAgZm9yIChsZXQgbiA9IDA7IG4gPCBibG9ja1NpemU7IG4rKykgewogICAgICAgICAgbGV0IHggPSBNYXRoLnBvdygyLCBjcnVzaFtuXSAtIDEpOwogICAgICAgICAgY29uc3QgdmFsdWUgPSBNYXRoLnJvdW5kKGlucHV0WzBdW25dICogeCkgLyB4OwogICAgICAgICAgZm9yIChsZXQgbyA9IDA7IG8gPCBvdXRwdXQubGVuZ3RoOyBvKyspIHsKICAgICAgICAgICAgb3V0cHV0W29dW25dID0gdmFsdWU7CiAgICAgICAgICB9CiAgICAgICAgfQogICAgICB9CiAgICB9CiAgICByZXR1cm4gdGhpcy5ub3RTdGFydGVkIHx8IGhhc0lucHV0OwogIH0KfQpyZWdpc3RlclByb2Nlc3NvcignY3J1c2gtcHJvY2Vzc29yJywgQ3J1c2hQcm9jZXNzb3IpOwoKY2xhc3MgU2hhcGVQcm9jZXNzb3IgZXh0ZW5kcyBBdWRpb1dvcmtsZXRQcm9jZXNzb3IgewogIHN0YXRpYyBnZXQgcGFyYW1ldGVyRGVzY3JpcHRvcnMoKSB7CiAgICByZXR1cm4gW3sgbmFtZTogJ3NoYXBlJywgZGVmYXVsdFZhbHVlOiAwIH1dOwogIH0KCiAgY29uc3RydWN0b3IoKSB7CiAgICBzdXBlcigpOwogICAgdGhpcy5ub3RTdGFydGVkID0gdHJ1ZTsKICB9CgogIHByb2Nlc3MoaW5wdXRzLCBvdXRwdXRzLCBwYXJhbWV0ZXJzKSB7CiAgICBjb25zdCBpbnB1dCA9IGlucHV0c1swXTsKICAgIGNvbnN0IG91dHB1dCA9IG91dHB1dHNbMF07CiAgICBjb25zdCBzaGFwZTAgPSBwYXJhbWV0ZXJzLnNoYXBlWzBdOwogICAgY29uc3Qgc2hhcGUxID0gc2hhcGUwIDwgMSA/IHNoYXBlMCA6IDEuMCAtIDRlLTEwOwogICAgY29uc3Qgc2hhcGUgPSAoMi4wICogc2hhcGUxKSAvICgxLjAgLSBzaGFwZTEpOwogICAgY29uc3QgYmxvY2tTaXplID0gMTI4OwogICAgY29uc3QgaGFzSW5wdXQgPSAhKGlucHV0WzBdID09PSB1bmRlZmluZWQpOwogICAgaWYgKGhhc0lucHV0KSB7CiAgICAgIHRoaXMubm90U3RhcnRlZCA9IGZhbHNlOwogICAgICBmb3IgKGxldCBuID0gMDsgbiA8IGJsb2NrU2l6ZTsgbisrKSB7CiAgICAgICAgY29uc3QgdmFsdWUgPSAoKDEgKyBzaGFwZSkgKiBpbnB1dFswXVtuXSkgLyAoMSArIHNoYXBlICogTWF0aC5hYnMoaW5wdXRbMF1bbl0pKTsKICAgICAgICBmb3IgKGxldCBvID0gMDsgbyA8IG91dHB1dC5sZW5ndGg7IG8rKykgewogICAgICAgICAgb3V0cHV0W29dW25dID0gdmFsdWU7CiAgICAgICAgfQogICAgICB9CiAgICB9CiAgICByZXR1cm4gdGhpcy5ub3RTdGFydGVkIHx8IGhhc0lucHV0OwogIH0KfQoKcmVnaXN0ZXJQcm9jZXNzb3IoJ3NoYXBlLXByb2Nlc3NvcicsIFNoYXBlUHJvY2Vzc29yKTsK";function Rl(n){const e=Gr().createGain();return e.gain.value=n,e}const AM=({s:n,freq:e,t})=>{const r=Gr().createOscillator();return r.type=n||"triangle",r.frequency.value=Number(e),r.start(t),{node:r,stop:i=>r.stop(i)}},Qy=(n,e,t,r,i,a)=>{const s=Gr().createGain();return s.gain.setValueAtTime(0,a),s.gain.linearRampToValueAtTime(i,a+n),s.gain.linearRampToValueAtTime(t*i,a+n+e),{node:s,stop:o=>{s.gain.setValueAtTime(t*i,o),s.gain.linearRampToValueAtTime(0,o+r)}}},Yc=(n,e,t)=>{const r=Gr().createBiquadFilter();return r.type=n,r.frequency.value=e,r.Q.value=t,r};let RM=n=>console.log(n);const Ya=(...n)=>RM(...n),Pm=gM();function $y(n,e,t={}){Pm.setKey(n,{onTrigger:e,data:t})}function GS(n){return Pm.get()[n]}let Gc;const Gr=()=>(Gc||(Gc=new AudioContext),Gc);let Io;const Bm=()=>{const n=Gr();return Io||(Io=n.createGain(),Io.connect(n.destination)),Io};let Qc;function IM(){return Qc||(Qc=Gr().audioWorklet.addModule(yM),Qc)}function $c(n,e,t){const r=new AudioWorkletNode(n,e);return Object.entries(t).forEach(([i,a])=>{r.parameters.get(i).value=a}),r}async function NM(n={}){const{disableWorklets:e=!1}=n;typeof window<"u"&&(await Gr().resume(),e?console.log("disableWorklets: AudioWorklet effects coarse, crush and shape are skipped!"):await IM().catch(t=>{console.warn("could not load AudioWorklet effects coarse, crush and shape",t)}))}async function DM(n){return new Promise(e=>{document.addEventListener("click",async function t(){await NM(n),e(),document.removeEventListener("click",t)})})}let xi={};function wM(n,e,t,r){var i;if(t=TM(t,0,.98),!xi[n]){const a=Gr().createFeedbackDelay(1,e,t);(i=a.start)==null||i.call(a,r),a.connect(Bm()),xi[n]=a}return xi[n].delayTime.value!==e&&xi[n].delayTime.setValueAtTime(e,r),xi[n].feedback.value!==t&&xi[n].feedback.setValueAtTime(t,r),xi[n]}let Li={};function xM(n,e=2){if(!Li[n]){const t=Gr().createReverb(e);t.connect(Bm()),Li[n]=t}return Li[n].duration!==e&&(Li[n]=Li[n].setDuration(e),Li[n].duration=e),Li[n]}function QS(n,e,t){const r=Rl(t);return n.connect(r),r.connect(e),r}const LM=async(n,e,t)=>{const r=Gr();if(typeof n!="object")throw new Error(`expected hap.value to be an object, but got "${n}". Hint: append .note() or .s() to the end`,"error");let i=r.currentTime+e,{s:a="triangle",bank:s,source:o,gain:l=.8,cutoff:u,resonance:d=1,hcutoff:f,hresonance:m=1,bandf:g,bandq:b=1,coarse:v,crush:y,shape:N,pan:F,vowel:X,delay:p=0,delayfeedback:E=.5,delaytime:O=.25,orbit:A=1,room:D,size:M=2,velocity:w=1}=n;l*=w;let B=[];const re=()=>{B.forEach(Z=>Z==null?void 0:Z.disconnect())};s&&a&&(a=`${s}_${a}`);let ie;if(o)ie=o(i,n,t);else if(GS(a)){const{onTrigger:Z}=GS(a),z=await Z(i,n,re);z&&(ie=z.node,z.stop(i+t))}else throw new Error(`sound ${a} not found! Is it loaded?`);if(!ie)return;if(r.currentTime>i){Ya("[webaudio] skip hap: still loading",r.currentTime-i);return}const j=[];if(j.push(ie),j.push(Rl(l)),u!==void 0&&j.push(Yc("lowpass",u,d)),f!==void 0&&j.push(Yc("highpass",f,m)),g!==void 0&&j.push(Yc("bandpass",g,b)),X!==void 0&&j.push(r.createVowelFilter(X)),v!==void 0&&j.push($c(r,"coarse-processor",{coarse:v})),y!==void 0&&j.push($c(r,"crush-processor",{crush:y})),N!==void 0&&j.push($c(r,"shape-processor",{shape:N})),F!==void 0){const Z=r.createStereoPanner();Z.pan.value=2*F-1,j.push(Z)}const J=Rl(1);j.push(J),J.connect(Bm());let L;if(p>0&&O>0&&E>0){const Z=wM(A,O,E,i);L=QS(J,Z,p)}let G;if(D>0&&M>0){const Z=xM(A,M);G=QS(J,Z,D)}j.slice(1).reduce((Z,z)=>Z.connect(z),j[0]),B=j.concat([L,G])},qc={};function kM(n,e){var t=e?1e3:1024;if(n=t);return n.toFixed(1)+" "+r[i]}const MM=async(n,e,t,r,i,a,s)=>{let o=0;i!==void 0&&t!==void 0&&Ya("[sampler] hap has note and freq. ignoring note","warning");let l=vM({freq:i,note:t},36);o=l-36;const u=Gr();let d;if(Array.isArray(a))d=a[e%a.length];else{const b=y=>Mm(y)-l,v=Object.keys(a).filter(y=>!y.startsWith("_")).reduce((y,N,F)=>!y||Math.abs(b(N)){const i=t?`sound "${t}:${r}"`:"sample";if(!qc[n]){Ya(`[sampler] load ${i}..`,"load-sample",{url:n});const a=Date.now();qc[n]=fetch(n).then(s=>s.arrayBuffer()).then(async s=>{const o=Date.now()-a,l=kM(s.byteLength);return Ya(`[sampler] load ${i}... done! loaded ${l} in ${o}ms`,"loaded-sample",{url:n}),await e.decodeAudioData(s)})}return qc[n]};function BM(n){const e=Gr(),t=e.createBuffer(n.numberOfChannels,n.length,e.sampleRate);for(let r=0;rObject.entries(n).forEach(([r,i])=>{if(typeof i=="string"&&(i=[i]),typeof i!="object")throw new Error("wrong sample map format for "+r);t=i._base||t;const a=s=>(t+s).replace("github:","https://raw.githubusercontent.com/");Array.isArray(i)?i=i.map(a):i=Object.fromEntries(Object.entries(i).map(([s,o])=>[s,(typeof o=="string"?[o]:o).map(a)])),e(r,i)});let FM={};function YM(n){const e=Object.entries(FM).find(([t])=>n.startsWith(t));if(e)return e[1]}const Il=async(n,e=n._base||"",t={})=>{if(typeof n=="string"){const a=YM(n);if(a)return a(n);if(n.startsWith("github:")){let[o,l]=n.split("github:");l=l.endsWith("/")?l.slice(0,-1):l,n=`https://raw.githubusercontent.com/${l}/strudel.json`}if(typeof fetch!="function")return;const s=n.split("/").slice(0,-1).join("/");return typeof fetch>"u"?void 0:fetch(n).then(o=>o.json()).then(o=>Il(o,e||o._base||s,t)).catch(o=>{throw console.error(o),new Error(`error loading "${n}"`)})}const{prebake:r,tag:i}=t;UM(n,(a,s)=>$y(a,(o,l,u)=>GM(o,l,u,s),{type:"sample",samples:s,baseUrl:e,prebake:r,tag:i}),e)},$S=[];async function GM(n,e,t,r,i){const{s:a,freq:s,unit:o,nudge:l=0,cut:u,loop:d,clip:f=void 0,n:m=0,note:g,speed:b=1,begin:v=0,end:y=1}=e;if(b===0)return;const N=Gr(),{attack:F=.001,decay:X=.001,sustain:p=1,release:E=.001}=e,O=n+l,A=await MM(a,m,g,b,s,r,i);if(N.currentTime>n){Ya(`[sampler] still loading sound "${a}:${m}"`,"highlight");return}if(!A){Ya(`[sampler] could not load "${a}:${m}"`,"error");return}A.playbackRate.value=Math.abs(b)*A.playbackRate.value,o==="c"&&(A.playbackRate.value=A.playbackRate.value*A.buffer.duration*1);const D=v*A.buffer.duration;A.start(O,D);const M=A.buffer.duration/A.playbackRate.value,{node:w,stop:B}=Qy(F,X,p,E,1,n);A.connect(w);const re=N.createGain();w.connect(re),A.onended=function(){A.disconnect(),w.disconnect(),re.disconnect(),t()};const ie={node:re,bufferSource:A,stop:(j,J=f===void 0)=>{let L=j;J&&(L=n+(y-v)*M),A.stop(L+E),B(L)}};if(u!==void 0){const j=$S[u];j&&(j.node.gain.setValueAtTime(1,O),j.node.gain.linearRampToValueAtTime(0,O+.01)),$S[u]=ie}return ie}const QM=(n,e=1,t="sine")=>{const r=Gr(),i=r.createOscillator();i.type=t,i.frequency.value=n,i.start();const a=new GainNode(r,{gain:e});return i.connect(a),{node:a,stop:s=>i.stop(s)}},$M=(n,e,t,r="sine")=>{const i=n.frequency.value*e,a=i*t;return QM(i,a,r)};function qM(){["sine","square","triangle","sawtooth"].forEach(n=>{$y(n,(e,t,r)=>{const{attack:i=.001,decay:a=.05,sustain:s=.6,release:o=.01,fmh:l=1,fmi:u}=t;let{n:d,note:f,freq:m}=t;d=f||d||36,typeof d=="string"&&(d=Mm(d)),!m&&typeof d=="number"&&(m=bM(d));const{node:g,stop:b}=AM({t:e,s:n,freq:m});let v;if(u){const{node:X,stop:p}=$M(g,l,u);X.connect(g.frequency),v=p}const y=Rl(.3),{node:N,stop:F}=Qy(i,a,s,o,1,e);return g.onended=()=>{g.disconnect(),y.disconnect(),r()},{node:g.connect(y).connect(N),stop:X=>{F(X);let p=X+o;b(p),v==null||v(p)}}},{type:"synth",prebake:!0})})}class qy extends Gy{constructor(t,r){super(r);R(this,"attack",t=>(this.values.attack=t,this));R(this,"atk",this.attack);R(this,"decay",t=>(this.values.decay=t,this));R(this,"dec",this.decay);R(this,"release",t=>(this.values.release=t,this));R(this,"rel",this.release);R(this,"unit",t=>(this.values.unit=t,this));R(this,"freq",t=>(this.values.freq=t,this));R(this,"fm",t=>{if(typeof t=="number")this.values.fmi=t;else{let r=t.split(":");this.values.fmi=parseFloat(r[0]),r.length>1&&(this.values.fmh=parseFloat(r[1]))}return this});R(this,"sound",t=>(this.values.s=t,this));R(this,"fmi",t=>(this.values.fmi=t,this));R(this,"fmh",t=>(this.values.fmh=t,this));R(this,"nudge",t=>(this.values.nudge=t,this));R(this,"cut",t=>(this.values.cut=t,this));R(this,"loop",t=>(this.values.loop=t,this));R(this,"clip",t=>(this.values.clip=t,this));R(this,"n",t=>(this.values.n=t,this));R(this,"note",t=>(this.values.note=t,this));R(this,"speed",t=>(this.values.speed=t,this));R(this,"begin",t=>(this.values.begin=t,this));R(this,"end",t=>(this.values.end=t,this));R(this,"gain",t=>(this.values.gain=t,this));R(this,"cutoff",t=>(this.values.cutoff=t,this));R(this,"lpf",this.cutoff);R(this,"resonance",t=>(this.values.resonance=t,this));R(this,"lpq",this.resonance);R(this,"hcutoff",t=>(this.values.hcutoff=t,this));R(this,"hpf",this.hcutoff);R(this,"hresonance",t=>(this.values.hresonance=t,this));R(this,"hpq",this.hresonance);R(this,"bandf",t=>(this.values.bandf=t,this));R(this,"bpf",this.bandf);R(this,"bandq",t=>(this.values.bandq=t,this));R(this,"bpq",this.bandq);R(this,"coarse",t=>(this.values.coarse=t,this));R(this,"crush",t=>(this.values.crush=t,this));R(this,"shape",t=>(this.values.shape=t,this));R(this,"pan",t=>(this.values.pan=t,this));R(this,"vowel",t=>(this.values.vowel=t,this));R(this,"delay",t=>(this.values.delay=t,this));R(this,"delayfeedback",t=>(this.values.delayfeedback=t,this));R(this,"delayfb",this.delayfeedback);R(this,"delaytime",t=>(this.values.delaytime=t,this));R(this,"delayt",this.delaytime);R(this,"orbit",t=>(this.values.orbit=t,this));R(this,"room",t=>(this.values.room=t,this));R(this,"size",t=>(this.values.size=t,this));R(this,"velocity",t=>(this.values.velocity=t,this));R(this,"vel",this.velocity);R(this,"modify",t=>{const r=t(this);return r instanceof Object?r:(t(this.values),this)});R(this,"sustain",t=>(this.values.dur=t,this));R(this,"sus",this.sustain);R(this,"update",()=>{if(this.values.key&&this.values.pitch&&this.values.parsedScale&&this.values.octave){const[t,r]=xm(this.values.key,this.values.pitch,this.values.parsedScale,this.values.octave);this.values.freq=Ps(t)}});R(this,"out",()=>LM(this.values,this.app.clock.pulse_duration,this.values.dur||.5));this.app=r,typeof t=="string"?this.values={s:t,dur:.5}:this.values=t}}class Vy extends Gy{constructor(t,r){super(r);R(this,"midiConnection");R(this,"note",t=>(this.values.note=t,this));R(this,"sustain",t=>(this.values.sustain=t,this));R(this,"channel",t=>(this.values.channel=t,this));R(this,"port",t=>(this.values.port=this.midiConnection.getMidiOutputIndex(t),this));R(this,"add",t=>(this.values.note+=t,this));R(this,"modify",t=>{const r=t(this);return r instanceof Object?r:(t(this.values),this)});R(this,"bend",t=>(this.values.bend=t,this));R(this,"random",(t=0,r=127)=>(t=Math.min(Math.max(t,0),127),r=Math.min(Math.max(r,0),127),this.values.note=Math.floor(this.randomGen()*(r-t+1))+t,this));R(this,"update",()=>{if(this.values.key&&this.values.pitch&&this.values.parsedScale&&this.values.octave){const[t,r]=xm(this.values.key,this.values.pitch,this.values.parsedScale,this.values.octave);this.values.note=t,this.values.freq=Ps(t),r&&(this.values.bend=r)}});R(this,"out",()=>{const t=this.values.note?this.values.note:60,r=this.values.channel?this.values.channel:0,i=this.values.velocity?this.values.velocity:100,a=this.values.sustain?this.values.sustain*this.app.clock.pulse_duration*this.app.api.ppqn():this.app.clock.pulse_duration*this.app.api.ppqn(),s=this.values.bend?this.values.bend:void 0,o=this.values.port?this.midiConnection.getMidiOutputIndex(this.values.port):this.midiConnection.getCurrentMidiPortIndex();this.midiConnection.sendMidiNote(t,r,i,a,o,s)});this.app=r,typeof t=="number"?this.values.note=t:this.values=t,this.midiConnection=r.api.MidiConnection}}const ss=typeof performance=="object"&&performance&&typeof performance.now=="function"?performance:Date,Hy=new Set,wh=typeof process=="object"&&process?process:{},zy=(n,e,t,r)=>{typeof wh.emitWarning=="function"?wh.emitWarning(n,e,t,r):console.error(`[${t}] ${e}: ${n}`)};let Nl=globalThis.AbortController,qS=globalThis.AbortSignal;var DT;if(typeof Nl>"u"){qS=class{constructor(){R(this,"onabort");R(this,"_onabort",[]);R(this,"reason");R(this,"aborted",!1)}addEventListener(r,i){this._onabort.push(i)}},Nl=class{constructor(){R(this,"signal",new qS);e()}abort(r){var i,a;if(!this.signal.aborted){this.signal.reason=r,this.signal.aborted=!0;for(const s of this.signal._onabort)s(r);(a=(i=this.signal).onabort)==null||a.call(i,r)}}};let n=((DT=wh.env)==null?void 0:DT.LRU_CACHE_IGNORE_AC_WARNING)!=="1";const e=()=>{n&&(n=!1,zy("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 VM=n=>!Hy.has(n),ci=n=>n&&n===Math.floor(n)&&n>0&&isFinite(n),Wy=n=>ci(n)?n<=Math.pow(2,8)?Uint8Array:n<=Math.pow(2,16)?Uint16Array:n<=Math.pow(2,32)?Uint32Array:n<=Number.MAX_SAFE_INTEGER?Vo:null:null;class Vo extends Array{constructor(e){super(e),this.fill(0)}}var va;const Pi=class Pi{constructor(e,t){R(this,"heap");R(this,"length");if(!Q(Pi,va))throw new TypeError("instantiate Stack using Stack.create(n)");this.heap=new t(e),this.length=0}static create(e){const t=Wy(e);if(!t)return[];Qe(Pi,va,!0);const r=new Pi(e,t);return Qe(Pi,va,!1),r}push(e){this.heap[this.length++]=e}pop(){return this.heap[--this.length]}};va=new WeakMap,tt(Pi,va,!1);let xh=Pi;var _n,Hr,gn,Sn,ya,Kt,On,jt,xt,et,Dr,zr,Sr,sr,En,or,Hn,zn,bn,Tn,mi,wr,Fs,kh,Gi,Wn,Ys,Wr,Ml,Xy,Qi,Aa,Gs,xn,ui,Ln,di,Qs,Mh,Ra,Ho,Ia,zo,At,Mt,$s,Ph,$i,fs;const Qm=class Qm{constructor(e){tt(this,Fs);tt(this,Ml);tt(this,xn);tt(this,Ln);tt(this,Qs);tt(this,Ra);tt(this,Ia);tt(this,At);tt(this,$s);tt(this,$i);tt(this,_n,void 0);tt(this,Hr,void 0);tt(this,gn,void 0);tt(this,Sn,void 0);tt(this,ya,void 0);R(this,"ttl");R(this,"ttlResolution");R(this,"ttlAutopurge");R(this,"updateAgeOnGet");R(this,"updateAgeOnHas");R(this,"allowStale");R(this,"noDisposeOnSet");R(this,"noUpdateTTL");R(this,"maxEntrySize");R(this,"sizeCalculation");R(this,"noDeleteOnFetchRejection");R(this,"noDeleteOnStaleGet");R(this,"allowStaleOnFetchAbort");R(this,"allowStaleOnFetchRejection");R(this,"ignoreFetchAbort");tt(this,Kt,void 0);tt(this,On,void 0);tt(this,jt,void 0);tt(this,xt,void 0);tt(this,et,void 0);tt(this,Dr,void 0);tt(this,zr,void 0);tt(this,Sr,void 0);tt(this,sr,void 0);tt(this,En,void 0);tt(this,or,void 0);tt(this,Hn,void 0);tt(this,zn,void 0);tt(this,bn,void 0);tt(this,Tn,void 0);tt(this,mi,void 0);tt(this,wr,void 0);tt(this,Gi,()=>{});tt(this,Wn,()=>{});tt(this,Ys,()=>{});tt(this,Wr,()=>!1);tt(this,Qi,e=>{});tt(this,Aa,(e,t,r)=>{});tt(this,Gs,(e,t,r,i)=>{if(r||i)throw new TypeError("cannot set size without setting maxSize or maxEntrySize on cache");return 0});const{max:t=0,ttl:r,ttlResolution:i=1,ttlAutopurge:a,updateAgeOnGet:s,updateAgeOnHas:o,allowStale:l,dispose:u,disposeAfter:d,noDisposeOnSet:f,noUpdateTTL:m,maxSize:g=0,maxEntrySize:b=0,sizeCalculation:v,fetchMethod:y,noDeleteOnFetchRejection:N,noDeleteOnStaleGet:F,allowStaleOnFetchRejection:X,allowStaleOnFetchAbort:p,ignoreFetchAbort:E}=e;if(t!==0&&!ci(t))throw new TypeError("max option must be a nonnegative integer");const O=t?Wy(t):Array;if(!O)throw new Error("invalid max value: "+t);if(Qe(this,_n,t),Qe(this,Hr,g),this.maxEntrySize=b||Q(this,Hr),this.sizeCalculation=v,this.sizeCalculation){if(!Q(this,Hr)&&!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(y!==void 0&&typeof y!="function")throw new TypeError("fetchMethod must be a function if specified");if(Qe(this,ya,y),Qe(this,mi,!!y),Qe(this,jt,new Map),Qe(this,xt,new Array(t).fill(void 0)),Qe(this,et,new Array(t).fill(void 0)),Qe(this,Dr,new O(t)),Qe(this,zr,new O(t)),Qe(this,Sr,0),Qe(this,sr,0),Qe(this,En,xh.create(t)),Qe(this,Kt,0),Qe(this,On,0),typeof u=="function"&&Qe(this,gn,u),typeof d=="function"?(Qe(this,Sn,d),Qe(this,or,[])):(Qe(this,Sn,void 0),Qe(this,or,void 0)),Qe(this,Tn,!!Q(this,gn)),Qe(this,wr,!!Q(this,Sn)),this.noDisposeOnSet=!!f,this.noUpdateTTL=!!m,this.noDeleteOnFetchRejection=!!N,this.allowStaleOnFetchRejection=!!X,this.allowStaleOnFetchAbort=!!p,this.ignoreFetchAbort=!!E,this.maxEntrySize!==0){if(Q(this,Hr)!==0&&!ci(Q(this,Hr)))throw new TypeError("maxSize must be a positive integer if specified");if(!ci(this.maxEntrySize))throw new TypeError("maxEntrySize must be a positive integer if specified");Ue(this,Ml,Xy).call(this)}if(this.allowStale=!!l,this.noDeleteOnStaleGet=!!F,this.updateAgeOnGet=!!s,this.updateAgeOnHas=!!o,this.ttlResolution=ci(i)||i===0?i:1,this.ttlAutopurge=!!a,this.ttl=r||0,this.ttl){if(!ci(this.ttl))throw new TypeError("ttl must be a positive integer if specified");Ue(this,Fs,kh).call(this)}if(Q(this,_n)===0&&this.ttl===0&&Q(this,Hr)===0)throw new TypeError("At least one of max, maxSize, or ttl is required");if(!this.ttlAutopurge&&!Q(this,_n)&&!Q(this,Hr)){const A="LRU_CACHE_UNBOUNDED";VM(A)&&(Hy.add(A),zy("TTL caching without ttlAutopurge, max, or maxSize can result in unbounded memory consumption.","UnboundedCacheWarning",A,Qm))}}static unsafeExposeInternals(e){return{starts:Q(e,zn),ttls:Q(e,bn),sizes:Q(e,Hn),keyMap:Q(e,jt),keyList:Q(e,xt),valList:Q(e,et),next:Q(e,Dr),prev:Q(e,zr),get head(){return Q(e,Sr)},get tail(){return Q(e,sr)},free:Q(e,En),isBackgroundFetch:t=>{var r;return Ue(r=e,At,Mt).call(r,t)},backgroundFetch:(t,r,i,a)=>{var s;return Ue(s=e,Ia,zo).call(s,t,r,i,a)},moveToTail:t=>{var r;return Ue(r=e,$i,fs).call(r,t)},indexes:t=>{var r;return Ue(r=e,xn,ui).call(r,t)},rindexes:t=>{var r;return Ue(r=e,Ln,di).call(r,t)},isStale:t=>{var r;return Q(r=e,Wr).call(r,t)}}}get max(){return Q(this,_n)}get maxSize(){return Q(this,Hr)}get calculatedSize(){return Q(this,On)}get size(){return Q(this,Kt)}get fetchMethod(){return Q(this,ya)}get dispose(){return Q(this,gn)}get disposeAfter(){return Q(this,Sn)}getRemainingTTL(e){return Q(this,jt).has(e)?1/0:0}*entries(){for(const e of Ue(this,xn,ui).call(this))Q(this,et)[e]!==void 0&&Q(this,xt)[e]!==void 0&&!Ue(this,At,Mt).call(this,Q(this,et)[e])&&(yield[Q(this,xt)[e],Q(this,et)[e]])}*rentries(){for(const e of Ue(this,Ln,di).call(this))Q(this,et)[e]!==void 0&&Q(this,xt)[e]!==void 0&&!Ue(this,At,Mt).call(this,Q(this,et)[e])&&(yield[Q(this,xt)[e],Q(this,et)[e]])}*keys(){for(const e of Ue(this,xn,ui).call(this)){const t=Q(this,xt)[e];t!==void 0&&!Ue(this,At,Mt).call(this,Q(this,et)[e])&&(yield t)}}*rkeys(){for(const e of Ue(this,Ln,di).call(this)){const t=Q(this,xt)[e];t!==void 0&&!Ue(this,At,Mt).call(this,Q(this,et)[e])&&(yield t)}}*values(){for(const e of Ue(this,xn,ui).call(this))Q(this,et)[e]!==void 0&&!Ue(this,At,Mt).call(this,Q(this,et)[e])&&(yield Q(this,et)[e])}*rvalues(){for(const e of Ue(this,Ln,di).call(this))Q(this,et)[e]!==void 0&&!Ue(this,At,Mt).call(this,Q(this,et)[e])&&(yield Q(this,et)[e])}[Symbol.iterator](){return this.entries()}find(e,t={}){for(const r of Ue(this,xn,ui).call(this)){const i=Q(this,et)[r],a=Ue(this,At,Mt).call(this,i)?i.__staleWhileFetching:i;if(a!==void 0&&e(a,Q(this,xt)[r],this))return this.get(Q(this,xt)[r],t)}}forEach(e,t=this){for(const r of Ue(this,xn,ui).call(this)){const i=Q(this,et)[r],a=Ue(this,At,Mt).call(this,i)?i.__staleWhileFetching:i;a!==void 0&&e.call(t,a,Q(this,xt)[r],this)}}rforEach(e,t=this){for(const r of Ue(this,Ln,di).call(this)){const i=Q(this,et)[r],a=Ue(this,At,Mt).call(this,i)?i.__staleWhileFetching:i;a!==void 0&&e.call(t,a,Q(this,xt)[r],this)}}purgeStale(){let e=!1;for(const t of Ue(this,Ln,di).call(this,{allowStale:!0}))Q(this,Wr).call(this,t)&&(this.delete(Q(this,xt)[t]),e=!0);return e}dump(){const e=[];for(const t of Ue(this,xn,ui).call(this,{allowStale:!0})){const r=Q(this,xt)[t],i=Q(this,et)[t],a=Ue(this,At,Mt).call(this,i)?i.__staleWhileFetching:i;if(a===void 0||r===void 0)continue;const s={value:a};if(Q(this,bn)&&Q(this,zn)){s.ttl=Q(this,bn)[t];const o=ss.now()-Q(this,zn)[t];s.start=Math.floor(Date.now()-o)}Q(this,Hn)&&(s.size=Q(this,Hn)[t]),e.unshift([r,s])}return e}load(e){this.clear();for(const[t,r]of e){if(r.start){const i=Date.now()-r.start;r.start=ss.now()-i}this.set(t,r.value,r)}}set(e,t,r={}){var m,g,b,v,y;if(t===void 0)return this.delete(e),this;const{ttl:i=this.ttl,start:a,noDisposeOnSet:s=this.noDisposeOnSet,sizeCalculation:o=this.sizeCalculation,status:l}=r;let{noUpdateTTL:u=this.noUpdateTTL}=r;const d=Q(this,Gs).call(this,e,t,r.size||0,o);if(this.maxEntrySize&&d>this.maxEntrySize)return l&&(l.set="miss",l.maxEntrySizeExceeded=!0),this.delete(e),this;let f=Q(this,Kt)===0?void 0:Q(this,jt).get(e);if(f===void 0)f=Q(this,Kt)===0?Q(this,sr):Q(this,En).length!==0?Q(this,En).pop():Q(this,Kt)===Q(this,_n)?Ue(this,Ra,Ho).call(this,!1):Q(this,Kt),Q(this,xt)[f]=e,Q(this,et)[f]=t,Q(this,jt).set(e,f),Q(this,Dr)[Q(this,sr)]=f,Q(this,zr)[f]=Q(this,sr),Qe(this,sr,f),io(this,Kt)._++,Q(this,Aa).call(this,f,d,l),l&&(l.set="add"),u=!1;else{Ue(this,$i,fs).call(this,f);const N=Q(this,et)[f];if(t!==N){if(Q(this,mi)&&Ue(this,At,Mt).call(this,N)){N.__abortController.abort(new Error("replaced"));const{__staleWhileFetching:F}=N;F!==void 0&&!s&&(Q(this,Tn)&&((m=Q(this,gn))==null||m.call(this,F,e,"set")),Q(this,wr)&&((g=Q(this,or))==null||g.push([F,e,"set"])))}else s||(Q(this,Tn)&&((b=Q(this,gn))==null||b.call(this,N,e,"set")),Q(this,wr)&&((v=Q(this,or))==null||v.push([N,e,"set"])));if(Q(this,Qi).call(this,f),Q(this,Aa).call(this,f,d,l),Q(this,et)[f]=t,l){l.set="replace";const F=N&&Ue(this,At,Mt).call(this,N)?N.__staleWhileFetching:N;F!==void 0&&(l.oldValue=F)}}else l&&(l.set="update")}if(i!==0&&!Q(this,bn)&&Ue(this,Fs,kh).call(this),Q(this,bn)&&(u||Q(this,Ys).call(this,f,i,a),l&&Q(this,Wn).call(this,l,f)),!s&&Q(this,wr)&&Q(this,or)){const N=Q(this,or);let F;for(;F=N==null?void 0:N.shift();)(y=Q(this,Sn))==null||y.call(this,...F)}return this}pop(){var e;try{for(;Q(this,Kt);){const t=Q(this,et)[Q(this,Sr)];if(Ue(this,Ra,Ho).call(this,!0),Ue(this,At,Mt).call(this,t)){if(t.__staleWhileFetching)return t.__staleWhileFetching}else if(t!==void 0)return t}}finally{if(Q(this,wr)&&Q(this,or)){const t=Q(this,or);let r;for(;r=t==null?void 0:t.shift();)(e=Q(this,Sn))==null||e.call(this,...r)}}}has(e,t={}){const{updateAgeOnHas:r=this.updateAgeOnHas,status:i}=t,a=Q(this,jt).get(e);if(a!==void 0){const s=Q(this,et)[a];if(Ue(this,At,Mt).call(this,s)&&s.__staleWhileFetching===void 0)return!1;if(Q(this,Wr).call(this,a))i&&(i.has="stale",Q(this,Wn).call(this,i,a));else return r&&Q(this,Gi).call(this,a),i&&(i.has="hit",Q(this,Wn).call(this,i,a)),!0}else i&&(i.has="miss");return!1}peek(e,t={}){const{allowStale:r=this.allowStale}=t,i=Q(this,jt).get(e);if(i!==void 0&&(r||!Q(this,Wr).call(this,i))){const a=Q(this,et)[i];return Ue(this,At,Mt).call(this,a)?a.__staleWhileFetching:a}}async fetch(e,t={}){const{allowStale:r=this.allowStale,updateAgeOnGet:i=this.updateAgeOnGet,noDeleteOnStaleGet:a=this.noDeleteOnStaleGet,ttl:s=this.ttl,noDisposeOnSet:o=this.noDisposeOnSet,size:l=0,sizeCalculation:u=this.sizeCalculation,noUpdateTTL:d=this.noUpdateTTL,noDeleteOnFetchRejection:f=this.noDeleteOnFetchRejection,allowStaleOnFetchRejection:m=this.allowStaleOnFetchRejection,ignoreFetchAbort:g=this.ignoreFetchAbort,allowStaleOnFetchAbort:b=this.allowStaleOnFetchAbort,context:v,forceRefresh:y=!1,status:N,signal:F}=t;if(!Q(this,mi))return N&&(N.fetch="get"),this.get(e,{allowStale:r,updateAgeOnGet:i,noDeleteOnStaleGet:a,status:N});const X={allowStale:r,updateAgeOnGet:i,noDeleteOnStaleGet:a,ttl:s,noDisposeOnSet:o,size:l,sizeCalculation:u,noUpdateTTL:d,noDeleteOnFetchRejection:f,allowStaleOnFetchRejection:m,allowStaleOnFetchAbort:b,ignoreFetchAbort:g,status:N,signal:F};let p=Q(this,jt).get(e);if(p===void 0){N&&(N.fetch="miss");const E=Ue(this,Ia,zo).call(this,e,p,X,v);return E.__returned=E}else{const E=Q(this,et)[p];if(Ue(this,At,Mt).call(this,E)){const w=r&&E.__staleWhileFetching!==void 0;return N&&(N.fetch="inflight",w&&(N.returnedStale=!0)),w?E.__staleWhileFetching:E.__returned=E}const O=Q(this,Wr).call(this,p);if(!y&&!O)return N&&(N.fetch="hit"),Ue(this,$i,fs).call(this,p),i&&Q(this,Gi).call(this,p),N&&Q(this,Wn).call(this,N,p),E;const A=Ue(this,Ia,zo).call(this,e,p,X,v),M=A.__staleWhileFetching!==void 0&&r;return N&&(N.fetch=O?"stale":"refresh",M&&O&&(N.returnedStale=!0)),M?A.__staleWhileFetching:A.__returned=A}}get(e,t={}){const{allowStale:r=this.allowStale,updateAgeOnGet:i=this.updateAgeOnGet,noDeleteOnStaleGet:a=this.noDeleteOnStaleGet,status:s}=t,o=Q(this,jt).get(e);if(o!==void 0){const l=Q(this,et)[o],u=Ue(this,At,Mt).call(this,l);return s&&Q(this,Wn).call(this,s,o),Q(this,Wr).call(this,o)?(s&&(s.get="stale"),u?(s&&r&&l.__staleWhileFetching!==void 0&&(s.returnedStale=!0),r?l.__staleWhileFetching:void 0):(a||this.delete(e),s&&r&&(s.returnedStale=!0),r?l:void 0)):(s&&(s.get="hit"),u?l.__staleWhileFetching:(Ue(this,$i,fs).call(this,o),i&&Q(this,Gi).call(this,o),l))}else s&&(s.get="miss")}delete(e){var r,i,a,s;let t=!1;if(Q(this,Kt)!==0){const o=Q(this,jt).get(e);if(o!==void 0)if(t=!0,Q(this,Kt)===1)this.clear();else{Q(this,Qi).call(this,o);const l=Q(this,et)[o];Ue(this,At,Mt).call(this,l)?l.__abortController.abort(new Error("deleted")):(Q(this,Tn)||Q(this,wr))&&(Q(this,Tn)&&((r=Q(this,gn))==null||r.call(this,l,e,"delete")),Q(this,wr)&&((i=Q(this,or))==null||i.push([l,e,"delete"]))),Q(this,jt).delete(e),Q(this,xt)[o]=void 0,Q(this,et)[o]=void 0,o===Q(this,sr)?Qe(this,sr,Q(this,zr)[o]):o===Q(this,Sr)?Qe(this,Sr,Q(this,Dr)[o]):(Q(this,Dr)[Q(this,zr)[o]]=Q(this,Dr)[o],Q(this,zr)[Q(this,Dr)[o]]=Q(this,zr)[o]),io(this,Kt)._--,Q(this,En).push(o)}}if(Q(this,wr)&&((a=Q(this,or))!=null&&a.length)){const o=Q(this,or);let l;for(;l=o==null?void 0:o.shift();)(s=Q(this,Sn))==null||s.call(this,...l)}return t}clear(){var e,t,r;for(const i of Ue(this,Ln,di).call(this,{allowStale:!0})){const a=Q(this,et)[i];if(Ue(this,At,Mt).call(this,a))a.__abortController.abort(new Error("deleted"));else{const s=Q(this,xt)[i];Q(this,Tn)&&((e=Q(this,gn))==null||e.call(this,a,s,"delete")),Q(this,wr)&&((t=Q(this,or))==null||t.push([a,s,"delete"]))}}if(Q(this,jt).clear(),Q(this,et).fill(void 0),Q(this,xt).fill(void 0),Q(this,bn)&&Q(this,zn)&&(Q(this,bn).fill(0),Q(this,zn).fill(0)),Q(this,Hn)&&Q(this,Hn).fill(0),Qe(this,Sr,0),Qe(this,sr,0),Q(this,En).length=0,Qe(this,On,0),Qe(this,Kt,0),Q(this,wr)&&Q(this,or)){const i=Q(this,or);let a;for(;a=i==null?void 0:i.shift();)(r=Q(this,Sn))==null||r.call(this,...a)}}};_n=new WeakMap,Hr=new WeakMap,gn=new WeakMap,Sn=new WeakMap,ya=new WeakMap,Kt=new WeakMap,On=new WeakMap,jt=new WeakMap,xt=new WeakMap,et=new WeakMap,Dr=new WeakMap,zr=new WeakMap,Sr=new WeakMap,sr=new WeakMap,En=new WeakMap,or=new WeakMap,Hn=new WeakMap,zn=new WeakMap,bn=new WeakMap,Tn=new WeakMap,mi=new WeakMap,wr=new WeakMap,Fs=new WeakSet,kh=function(){const e=new Vo(Q(this,_n)),t=new Vo(Q(this,_n));Qe(this,bn,e),Qe(this,zn,t),Qe(this,Ys,(a,s,o=ss.now())=>{if(t[a]=s!==0?o:0,e[a]=s,s!==0&&this.ttlAutopurge){const l=setTimeout(()=>{Q(this,Wr).call(this,a)&&this.delete(Q(this,xt)[a])},s+1);l.unref&&l.unref()}}),Qe(this,Gi,a=>{t[a]=e[a]!==0?ss.now():0}),Qe(this,Wn,(a,s)=>{if(e[s]){const o=e[s],l=t[s];a.ttl=o,a.start=l,a.now=r||i();const u=a.now-l;a.remainingTTL=o-u}});let r=0;const i=()=>{const a=ss.now();if(this.ttlResolution>0){r=a;const s=setTimeout(()=>r=0,this.ttlResolution);s.unref&&s.unref()}return a};this.getRemainingTTL=a=>{const s=Q(this,jt).get(a);if(s===void 0)return 0;const o=e[s],l=t[s];if(o===0||l===0)return 1/0;const u=(r||i())-l;return o-u},Qe(this,Wr,a=>e[a]!==0&&t[a]!==0&&(r||i())-t[a]>e[a])},Gi=new WeakMap,Wn=new WeakMap,Ys=new WeakMap,Wr=new WeakMap,Ml=new WeakSet,Xy=function(){const e=new Vo(Q(this,_n));Qe(this,On,0),Qe(this,Hn,e),Qe(this,Qi,t=>{Qe(this,On,Q(this,On)-e[t]),e[t]=0}),Qe(this,Gs,(t,r,i,a)=>{if(Ue(this,At,Mt).call(this,r))return 0;if(!ci(i))if(a){if(typeof a!="function")throw new TypeError("sizeCalculation must be a function");if(i=a(r,t),!ci(i))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 i}),Qe(this,Aa,(t,r,i)=>{if(e[t]=r,Q(this,Hr)){const a=Q(this,Hr)-e[t];for(;Q(this,On)>a;)Ue(this,Ra,Ho).call(this,!0)}Qe(this,On,Q(this,On)+e[t]),i&&(i.entrySize=r,i.totalCalculatedSize=Q(this,On))})},Qi=new WeakMap,Aa=new WeakMap,Gs=new WeakMap,xn=new WeakSet,ui=function*({allowStale:e=this.allowStale}={}){if(Q(this,Kt))for(let t=Q(this,sr);!(!Ue(this,Qs,Mh).call(this,t)||((e||!Q(this,Wr).call(this,t))&&(yield t),t===Q(this,Sr)));)t=Q(this,zr)[t]},Ln=new WeakSet,di=function*({allowStale:e=this.allowStale}={}){if(Q(this,Kt))for(let t=Q(this,Sr);!(!Ue(this,Qs,Mh).call(this,t)||((e||!Q(this,Wr).call(this,t))&&(yield t),t===Q(this,sr)));)t=Q(this,Dr)[t]},Qs=new WeakSet,Mh=function(e){return e!==void 0&&Q(this,jt).get(Q(this,xt)[e])===e},Ra=new WeakSet,Ho=function(e){var a,s;const t=Q(this,Sr),r=Q(this,xt)[t],i=Q(this,et)[t];return Q(this,mi)&&Ue(this,At,Mt).call(this,i)?i.__abortController.abort(new Error("evicted")):(Q(this,Tn)||Q(this,wr))&&(Q(this,Tn)&&((a=Q(this,gn))==null||a.call(this,i,r,"evict")),Q(this,wr)&&((s=Q(this,or))==null||s.push([i,r,"evict"]))),Q(this,Qi).call(this,t),e&&(Q(this,xt)[t]=void 0,Q(this,et)[t]=void 0,Q(this,En).push(t)),Q(this,Kt)===1?(Qe(this,Sr,Qe(this,sr,0)),Q(this,En).length=0):Qe(this,Sr,Q(this,Dr)[t]),Q(this,jt).delete(r),io(this,Kt)._--,t},Ia=new WeakSet,zo=function(e,t,r,i){const a=t===void 0?void 0:Q(this,et)[t];if(Ue(this,At,Mt).call(this,a))return a;const s=new Nl,{signal:o}=r;o==null||o.addEventListener("abort",()=>s.abort(o.reason),{signal:s.signal});const l={signal:s.signal,options:r,context:i},u=(v,y=!1)=>{const{aborted:N}=s.signal,F=r.ignoreFetchAbort&&v!==void 0;if(r.status&&(N&&!y?(r.status.fetchAborted=!0,r.status.fetchError=s.signal.reason,F&&(r.status.fetchAbortIgnored=!0)):r.status.fetchResolved=!0),N&&!F&&!y)return f(s.signal.reason);const X=g;return Q(this,et)[t]===g&&(v===void 0?X.__staleWhileFetching?Q(this,et)[t]=X.__staleWhileFetching:this.delete(e):(r.status&&(r.status.fetchUpdated=!0),this.set(e,v,l.options))),v},d=v=>(r.status&&(r.status.fetchRejected=!0,r.status.fetchError=v),f(v)),f=v=>{const{aborted:y}=s.signal,N=y&&r.allowStaleOnFetchAbort,F=N||r.allowStaleOnFetchRejection,X=F||r.noDeleteOnFetchRejection,p=g;if(Q(this,et)[t]===g&&(!X||p.__staleWhileFetching===void 0?this.delete(e):N||(Q(this,et)[t]=p.__staleWhileFetching)),F)return r.status&&p.__staleWhileFetching!==void 0&&(r.status.returnedStale=!0),p.__staleWhileFetching;if(p.__returned===p)throw v},m=(v,y)=>{var F;const N=(F=Q(this,ya))==null?void 0:F.call(this,e,a,l);N&&N instanceof Promise&&N.then(X=>v(X===void 0?void 0:X),y),s.signal.addEventListener("abort",()=>{(!r.ignoreFetchAbort||r.allowStaleOnFetchAbort)&&(v(void 0),r.allowStaleOnFetchAbort&&(v=X=>u(X,!0)))})};r.status&&(r.status.fetchDispatched=!0);const g=new Promise(m).then(u,d),b=Object.assign(g,{__abortController:s,__staleWhileFetching:a,__returned:void 0});return t===void 0?(this.set(e,b,{...l.options,status:void 0}),t=Q(this,jt).get(e)):Q(this,et)[t]=b,b},At=new WeakSet,Mt=function(e){if(!Q(this,mi))return!1;const t=e;return!!t&&t instanceof Promise&&t.hasOwnProperty("__staleWhileFetching")&&t.__abortController instanceof Nl},$s=new WeakSet,Ph=function(e,t){Q(this,zr)[t]=e,Q(this,Dr)[e]=t},$i=new WeakSet,fs=function(e){e!==Q(this,sr)&&(e===Q(this,Sr)?Qe(this,Sr,Q(this,Dr)[e]):Ue(this,$s,Ph).call(this,Q(this,zr)[e],Q(this,Dr)[e]),Ue(this,$s,Ph).call(this,Q(this,sr),e),Qe(this,sr,e))};let Lh=Qm;const Pl=class Pl{constructor(){R(this,"_fallbackMethod",()=>this);R(this,"out",()=>{})}};R(Pl,"createSkipProxy",()=>{const e=new Pl;return new Proxy(e,{get(t,r,i){return typeof t[r]>"u"?t._fallbackMethod:t[r]},set(t,r,i,a){return!1}})});let Dl=Pl;const Bl=class Bl extends km{constructor(t,r){super(r);R(this,"_fallbackMethod",()=>this);R(this,"out",()=>{});this.values.duration=t}};R(Bl,"createRestProxy",(t,r)=>{const i=new Bl(t,r);return new Proxy(i,{get(a,s,o){return typeof a[s]>"u"?a._fallbackMethod:a[s]},set(a,s,o,l){return!1}})});let wl=Bl;class HM extends km{constructor(t,r,i){super(i);R(this,"input");R(this,"ziffers");R(this,"callTime",0);R(this,"played",!1);R(this,"current");R(this,"retro",!1);R(this,"tick",0);R(this,"next",()=>(this.current=this.ziffers.next(),this.played=!0,this.current));R(this,"pulseToSecond",t=>this.app.clock.convertPulseToSecond(t));R(this,"areWeThereYet",()=>{const t=this.ziffers.notStarted()||this.pulseToSecond(this.app.api.epulse())>this.pulseToSecond(this.callTime)+this.current.duration*this.pulseToSecond(this.app.api.ppqn()*4);return t?this.tick=0:this.tick++,t});R(this,"out",()=>{});this.app=i,this.input=t,this.ziffers=new uM(t,r)}sound(t){if(this.areWeThereYet()){const r=this.next();if(r instanceof Ki){const i=r.getExisting("freq","pitch","key","scale","octave");return new qy(i,this.app).sound(t)}else if(r instanceof Dh)return wl.createRestProxy(r.duration,this.app)}else return Dl.createSkipProxy()}midi(t=void 0){if(this.areWeThereYet()){const r=this.next();if(r instanceof Ki){const i=r.getExisting("note","pitch","bend","key","scale","octave"),a=new Vy(i,this.app);return t?a.note(t):a}else if(r instanceof Dh)return wl.createRestProxy(r.duration,this.app)}else return Dl.createSkipProxy()}scale(t){return this.ziffers.scale(t),this}key(t){return this.ziffers.key(t),this}octave(t){return this.ziffers.octave(t),this}retrograde(){return this.tick===0&&this.ziffers.index===0&&this.ziffers.retrograde(),this}}Array.prototype.palindrome=function(n){let e=Array.from(this),t=Array.from(this.reverse());return e.concat(t)};Array.prototype.random=function(n){return this[Math.floor(Math.random()*this.length)]};Array.prototype.loop=function(n){return this[n%this.length]};Array.prototype.rand=Array.prototype.random;Array.prototype.in=function(n){return this.includes(n)};async function zM(){return Promise.all([DM(),Il("github:Bubobubobubobubo/Topos-Samples/main"),Il("github:tidalcycles/Dirt-Samples/master").then(()=>qM())])}zM();const WM=(...n)=>n.map(e=>JSON.stringify(e)).join(",");class XM{constructor(e){R(this,"variables",{});R(this,"counters",{});R(this,"_drunk",new fM(-100,100,!1));R(this,"randomGen",Math.random);R(this,"currentSeed");R(this,"localSeeds",new Map);R(this,"patternCache",new Lh({max:1e3,ttl:1e3*60*5}));R(this,"errorTimeoutID",0);R(this,"MidiConnection",new pM);R(this,"load");R(this,"_reportError",e=>{console.log(e),clearTimeout(this.errorTimeoutID),this.app.error_line.innerHTML=e,this.app.error_line.classList.remove("hidden"),this.errorTimeoutID=setTimeout(()=>this.app.error_line.classList.add("hidden"),2e3)});R(this,"time",()=>this.app.audioContext.currentTime);R(this,"play",()=>{this.app.setButtonHighlighting("play",!0),this.app.clock.start()});R(this,"pause",()=>{this.app.setButtonHighlighting("pause",!0),this.app.clock.pause()});R(this,"stop",()=>{this.app.setButtonHighlighting("stop",!0),this.app.clock.stop()});R(this,"silence",this.stop);R(this,"hush",this.stop);R(this,"mouseX",()=>this.app._mouseX);R(this,"mouseY",()=>this.app._mouseY);R(this,"noteX",()=>Math.floor(this.app._mouseX/document.body.clientWidth*127));R(this,"noteY",()=>Math.floor(this.app._mouseY/document.body.clientHeight*127));R(this,"script",(...e)=>{e.forEach(t=>{vl(this.app,this.app.universes[this.app.selected_universe].locals[t])})});R(this,"s",this.script);R(this,"clear_script",e=>{this.app.universes[this.app.selected_universe].locals[e]={candidate:"",committed:"",evaluations:0}});R(this,"cs",this.clear_script);R(this,"copy_script",(e,t)=>{this.app.universes[this.app.selected_universe].locals[t]=this.app.universes[this.app.selected_universe].locals[e]});R(this,"cps",this.copy_script);R(this,"midi_outputs",()=>(console.log(this.MidiConnection.listMidiOutputs()),this.MidiConnection.midiOutputs));R(this,"midi_output",e=>{e?this.MidiConnection.switchMidiOutput(e):console.log(this.MidiConnection.getCurrentMidiPort())});R(this,"midi",(e=60)=>new Vy(e,this.app));R(this,"sysex",e=>{this.MidiConnection.sendSysExMessage(e)});R(this,"sy",this.sysex);R(this,"pitch_bend",(e,t)=>{this.MidiConnection.sendPitchBend(e,t)});R(this,"program_change",(e,t)=>{this.MidiConnection.sendProgramChange(e,t)});R(this,"pc",this.program_change);R(this,"midi_clock",()=>{this.MidiConnection.sendMidiClock()});R(this,"control_change",({control:e=20,value:t=0,channel:r=0})=>{this.MidiConnection.sendMidiControlChange(e,t,r)});R(this,"cc",this.control_change);R(this,"midi_panic",()=>{this.MidiConnection.panic()});R(this,"z",(e,t={})=>{const r=WM(e,t);let i;return this.app.api.patternCache.has(r)?i=this.app.api.patternCache.get(r):(i=new HM(e,t,this.app),this.app.api.patternCache.set(r,i)),(i&&i.ziffers.index===-1||i.played)&&(i.callTime=this.epulse(),i.played=!1),i});R(this,"counter",(e,t,r)=>(e in this.counters?(this.counters[e].limit!==t&&(this.counters[e].value=0,this.counters[e].limit=t),this.counters[e].step!==r&&(this.counters[e].step=r??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:r??1,limit:t},this.counters[e].value));R(this,"$",this.counter);R(this,"drunk",e=>e!==void 0?(this._drunk.position=e,this._drunk.getPosition()):(this._drunk.step(),this._drunk.getPosition()));R(this,"drunk_max",e=>{this._drunk.max=e});R(this,"drunk_min",e=>{this._drunk.min=e});R(this,"drunk_wrap",e=>{this._drunk.toggleWrap(e)});R(this,"variable",(e,t)=>typeof e=="string"&&t===void 0?this.variables[e]:(this.variables[e]=t,this.variables[e]));R(this,"v",this.variable);R(this,"delete_variable",e=>{delete this.variables[e]});R(this,"dv",this.delete_variable);R(this,"clear_variables",()=>{this.variables={}});R(this,"cv",this.clear_variables);R(this,"div",e=>{const t=this.epulse();return Math.floor(t/Math.floor(e*this.ppqn()))%2===0});R(this,"babou",e=>{const t=this.epulse(),r=Math.floor(e*this.ppqn());return t%r===0});R(this,"divbar",e=>{const t=this.bar()-1;return Math.floor(t/e)%2===0});R(this,"divseq",(...e)=>{const t=e[0],r=e.slice(1),i=this.epulse(),a=Math.floor(i/Math.floor(t*this.ppqn()));return r[a%r.length]});R(this,"pick",(...e)=>e[Math.floor(this.randomGen()*e.length)]);R(this,"seqbeat",(...e)=>e[this.ebeat()%e.length]);R(this,"mel",(e,t)=>t[e%t.length]);R(this,"seqbar",(...e)=>e[(this.app.clock.time_position.bar+1)%e.length]);R(this,"seqpulse",(...e)=>e[this.app.clock.time_position.pulse%e.length]);R(this,"randI",(e,t)=>Math.floor(this.randomGen()*(t-e+1))+e);R(this,"rand",(e,t)=>this.randomGen()*(t-e)+e);R(this,"irand",this.randI);R(this,"rI",this.randI);R(this,"r",this.rand);R(this,"ir",this.randI);R(this,"seed",e=>{typeof e=="number"&&(e=e.toString()),this.currentSeed!==e&&(this.currentSeed=e,this.randomGen=Nh(e))});R(this,"localSeededRandom",e=>{if(typeof e=="number"&&(e=e.toString()),this.localSeeds.has(e))return this.localSeeds.get(e);const t=Nh(e);return this.localSeeds.set(e,t),t});R(this,"clearLocalSeed",(e=void 0)=>{e&&this.localSeeds.delete(e.toString()),this.localSeeds.clear()});R(this,"quantize",(e,t)=>{if(t.length===0)return e;let r=t[0];return t.forEach(i=>{Math.abs(i-e)Math.min(Math.max(e,t),r));R(this,"cmp",this.clamp);R(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));R(this,"tempo",this.bpm);R(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));R(this,"ppqn",e=>e===void 0?this.app.clock.ppqn:(e<1&&console.log(`Setting ppqn to ${e}`),this.app.clock.ppqn=e,e));R(this,"time_signature",(e,t)=>{this.app.clock.time_signature=[e,t]});R(this,"odds",(e,t=15)=>this.randomGen()this.randomGen()<.025*this.ppqn()/(this.ppqn()*e));R(this,"rarely",(e=15)=>this.randomGen()<.1*this.ppqn()/(this.ppqn()*e));R(this,"scarcely",(e=15)=>this.randomGen()<.25*this.ppqn()/(this.ppqn()*e));R(this,"sometimes",(e=15)=>this.randomGen()<.5*this.ppqn()/(this.ppqn()*e));R(this,"often",(e=15)=>this.randomGen()<.75*this.ppqn()/(this.ppqn()*e));R(this,"frequently",(e=15)=>this.randomGen()<.9*this.ppqn()/(this.ppqn()*e));R(this,"almostAlways",(e=15)=>this.randomGen()<.985*this.ppqn()/(this.ppqn()*e));R(this,"dice",e=>Math.floor(this.randomGen()*e)+1);R(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);R(this,"bar",()=>this.app.clock.time_position.bar);R(this,"tick",()=>this.app.clock.tick);R(this,"pulse",()=>this.app.clock.time_position.pulse);R(this,"beat",()=>this.app.clock.time_position.beat);R(this,"ebeat",()=>this.app.clock.beats_since_origin);R(this,"epulse",()=>this.app.clock.pulses_since_origin);R(this,"onbar",(e,...t)=>{let r=this.bar()%e+1;return t.some(i=>i==r)});R(this,"onbeat",(...e)=>{let t=[];return e.forEach(r=>{r=r%this.app.clock.time_signature[0]+1;let i=Math.floor(r),a=r-i;t.push(i===this.app.clock.time_position.beat&&this.app.clock.time_position.pulse===a*this.app.clock.ppqn)}),t.some(r=>r==!0)});R(this,"prob",e=>this.randomGen()*100this.randomGen()>.5);R(this,"min",(...e)=>Math.min(...e));R(this,"max",(...e)=>Math.max(...e));R(this,"mean",(...e)=>e.reduce((r,i)=>r+i,0)/e.length);R(this,"limit",(e,t,r)=>Math.min(Math.max(e,t),r));R(this,"delay",(e,t)=>{setTimeout(t,e)});R(this,"delayr",(e,t,r)=>{[...Array(t).keys()].map(a=>e*a).forEach((a,s)=>{setTimeout(r,a)})});R(this,"mod",(...e)=>e.map(r=>this.epulse()%Math.floor(r*this.ppqn())===0).some(r=>r===!0));R(this,"modpulse",(...e)=>e.map(r=>this.epulse()%r===0).some(r=>r===!0));R(this,"pmod",this.modpulse);R(this,"modbar",(...e)=>e.map(r=>this.bar()%Math.floor(r*this.ppqn())===0).some(r=>r===!0));R(this,"bmod",this.modbar);R(this,"euclid",(e,t,r,i=0)=>this._euclidean_cycle(t,r,i)[e%r]);R(this,"eu",this.euclid);R(this,"bin",(e,t)=>{let i=t.toString(2).split("").map(a=>a==="1");return i[e%i.length]});R(this,"line",(e,t,r=1)=>{const i=[];if(t>e&&r>0||tMath.sin(this.app.clock.ctx.currentTime*Math.PI*2*e)+t);R(this,"usine",(e=1,t=0)=>(this.sine(e,t)+1)/2);R(this,"saw",(e=1,t=0)=>this.app.clock.ctx.currentTime*e%1*2-1+t);R(this,"usaw",(e=1,t=0)=>(this.saw(e,t)+1)/2);R(this,"triangle",(e=1,t=0)=>Math.abs(this.saw(e,t))*2-1);R(this,"utriangle",(e=1,t=0)=>(this.triangle(e,t)+1)/2);R(this,"square",(e=1,t=0,r=.5)=>{const i=1/e;return(Date.now()/1e3+t)%i/i(this.square(e,t,r)+1)/2);R(this,"noise",()=>this.randomGen()*2-1);R(this,"abs",Math.abs);R(this,"sound",e=>new qy(e,this.app));R(this,"snd",this.sound);R(this,"samples",Il);R(this,"soundMap",Pm);R(this,"log",console.log);R(this,"scale",mM);R(this,"rate",e=>{});this.app=e}_euclidean_cycle(e,t,r=0){if(e==t)return Array.from({length:t},()=>!0);function i(o,l){const u=o.length,d=(l+1)%u;return o[l]>o[d]}if(e>=t)return[!0];const a=Array.from({length:t},(o,l)=>(e*(l-1)%t+t)%t);let s=a.map((o,l)=>i(a,l));return r!=0&&(s=s.slice(r).concat(s.slice(0,r))),s}}var Wo=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Zy(n){return n&&n.__esModule&&Object.prototype.hasOwnProperty.call(n,"default")?n.default:n}var Ky={exports:{}};(function(n){(function(){function e(p){var E={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(p===!1)return JSON.parse(JSON.stringify(E));var O={};for(var A in E)E.hasOwnProperty(A)&&(O[A]=E[A].defaultValue);return O}function t(){var p=e(!0),E={};for(var O in p)p.hasOwnProperty(O)&&(E[O]=!0);return E}var r={},i={},a={},s=e(!0),o="vanilla",l={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:t()};r.helper={},r.extensions={},r.setOption=function(p,E){return s[p]=E,this},r.getOption=function(p){return s[p]},r.getOptions=function(){return s},r.resetOptions=function(){s=e(!0)},r.setFlavor=function(p){if(!l.hasOwnProperty(p))throw Error(p+" flavor was not found");r.resetOptions();var E=l[p];o=p;for(var O in E)E.hasOwnProperty(O)&&(s[O]=E[O])},r.getFlavor=function(){return o},r.getFlavorOptions=function(p){if(l.hasOwnProperty(p))return l[p]},r.getDefaultOptions=function(p){return e(p)},r.subParser=function(p,E){if(r.helper.isString(p))if(typeof E<"u")i[p]=E;else{if(i.hasOwnProperty(p))return i[p];throw Error("SubParser named "+p+" not registered!")}},r.extension=function(p,E){if(!r.helper.isString(p))throw Error("Extension 'name' must be a string");if(p=r.helper.stdExtName(p),r.helper.isUndefined(E)){if(!a.hasOwnProperty(p))throw Error("Extension named "+p+" is not registered!");return a[p]}else{typeof E=="function"&&(E=E()),r.helper.isArray(E)||(E=[E]);var O=u(E,p);if(O.valid)a[p]=E;else throw Error(O.error)}},r.getAllExtensions=function(){return a},r.removeExtension=function(p){delete a[p]},r.resetExtensions=function(){a={}};function u(p,E){var O=E?"Error in "+E+" extension->":"Error in unnamed extension",A={valid:!0,error:""};r.helper.isArray(p)||(p=[p]);for(var D=0;D"u"},r.helper.forEach=function(p,E){if(r.helper.isUndefined(p))throw new Error("obj param is required");if(r.helper.isUndefined(E))throw new Error("callback param is required");if(!r.helper.isFunction(E))throw new Error("callback param must be a function/closure");if(typeof p.forEach=="function")p.forEach(E);else if(r.helper.isArray(p))for(var O=0;O").replace(/&/g,"&")};var f=function(p,E,O,A){var D=A||"",M=D.indexOf("g")>-1,w=new RegExp(E+"|"+O,"g"+D.replace(/g/g,"")),B=new RegExp(E,D.replace(/g/g,"")),re=[],ie,j,J,L,G;do for(ie=0;J=w.exec(p);)if(B.test(J[0]))ie++||(j=w.lastIndex,L=j-J[0].length);else if(ie&&!--ie){G=J.index+J[0].length;var Z={left:{start:L,end:j},match:{start:j,end:J.index},right:{start:J.index,end:G},wholeMatch:{start:L,end:G}};if(re.push(Z),!M)return re}while(ie&&(w.lastIndex=j));return re};r.helper.matchRecursiveRegExp=function(p,E,O,A){for(var D=f(p,E,O,A),M=[],w=0;w0){var ie=[];w[0].wholeMatch.start!==0&&ie.push(p.slice(0,w[0].wholeMatch.start));for(var j=0;j=0?A+(O||0):A},r.helper.splitAtIndex=function(p,E){if(!r.helper.isString(p))throw"InvalidArgumentError: first parameter of showdown.helper.regexIndexOf function must be a string";return[p.substring(0,E),p.substring(E)]},r.helper.encodeEmailAddress=function(p){var E=[function(O){return"&#"+O.charCodeAt(0)+";"},function(O){return"&#x"+O.charCodeAt(0).toString(16)+";"},function(O){return O}];return p=p.replace(/./g,function(O){if(O==="@")O=E[Math.floor(Math.random()*2)](O);else{var A=Math.random();O=A>.9?E[2](O):A>.45?E[1](O):E[0](O)}return O}),p},r.helper.padEnd=function(E,O,A){return O=O>>0,A=String(A||" "),E.length>O?String(E):(O=O-E.length,O>A.length&&(A+=A.repeat(O/A.length)),String(E)+A.slice(0,O))},typeof console>"u"&&(console={warn:function(p){alert(p)},log:function(p){alert(p)},error:function(p){throw p}}),r.helper.regexes={asteriskDashAndColon:/([*_:~])/g},r.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`},r.Converter=function(p){var E={},O=[],A=[],D={},M=o,w={parsed:{},raw:"",format:""};B();function B(){p=p||{};for(var L in s)s.hasOwnProperty(L)&&(E[L]=s[L]);if(typeof p=="object")for(var G in p)p.hasOwnProperty(G)&&(E[G]=p[G]);else throw Error("Converter expects the passed parameter to be an object, but "+typeof p+" was passed instead.");E.extensions&&r.helper.forEach(E.extensions,re)}function re(L,G){if(G=G||null,r.helper.isString(L))if(L=r.helper.stdExtName(L),G=L,r.extensions[L]){console.warn("DEPRECATION WARNING: "+L+" is an old extension that uses a deprecated loading method.Please inform the developer that the extension should be updated!"),ie(r.extensions[L],L);return}else if(!r.helper.isUndefined(a[L]))L=a[L];else throw Error('Extension "'+L+'" could not be loaded. It was either not found or is not a valid extension.');typeof L=="function"&&(L=L()),r.helper.isArray(L)||(L=[L]);var Z=u(L,G);if(!Z.valid)throw Error(Z.error);for(var z=0;z Topos - +