vue-piano-keyboard
Version:
A piano keyboard component for Vue.js 2+
22 lines • 273 kB
JavaScript
(function(t,e){"object"===typeof exports&&"object"===typeof module?module.exports=e():"function"===typeof define&&define.amd?define([],e):"object"===typeof exports?exports["pianoKeyboard"]=e():t["pianoKeyboard"]=e()})("undefined"!==typeof self?self:this,(function(){return function(t){var e={};function n(s){if(e[s])return e[s].exports;var i=e[s]={i:s,l:!1,exports:{}};return t[s].call(i.exports,i,i.exports,n),i.l=!0,i.exports}return n.m=t,n.c=e,n.d=function(t,e,s){n.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:s})},n.r=function(t){"undefined"!==typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},n.t=function(t,e){if(1&e&&(t=n(t)),8&e)return t;if(4&e&&"object"===typeof t&&t&&t.__esModule)return t;var s=Object.create(null);if(n.r(s),Object.defineProperty(s,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var i in t)n.d(s,i,function(e){return t[e]}.bind(null,i));return s},n.n=function(t){var e=t&&t.__esModule?function(){return t["default"]}:function(){return t};return n.d(e,"a",e),e},n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n.p="",n(n.s="fb15")}({"00ee":function(t,e,n){var s=n("b622"),i=s("toStringTag"),r={};r[i]="z",t.exports="[object z]"===String(r)},"0366":function(t,e,n){var s=n("1c0b");t.exports=function(t,e,n){if(s(t),void 0===e)return t;switch(n){case 0:return function(){return t.call(e)};case 1:return function(n){return t.call(e,n)};case 2:return function(n,s){return t.call(e,n,s)};case 3:return function(n,s,i){return t.call(e,n,s,i)}}return function(){return t.apply(e,arguments)}}},"04d1":function(t,e,n){(function(t,s){s(e,n("278c"),n("970b"),n("5bc3"))})(0,(function(t,e,n,s){"use strict";function i(t){return t&&"object"===typeof t&&"default"in t?t:{default:t}}var r=i(e),o=i(n),a=i(s),c=function(t,e,n){return{endTime:e,insertTime:n,type:"exponentialRampToValue",value:t}},u=function(t,e,n){return{endTime:e,insertTime:n,type:"linearRampToValue",value:t}},l=function(t,e){return{startTime:e,type:"setValue",value:t}},h=function(t,e,n){return{duration:n,startTime:e,type:"setValueCurve",values:t}},p=function(t,e,n){var s=n.startTime,i=n.target,r=n.timeConstant;return i+(e-i)*Math.exp((s-t)/r)},d=function(t){return"exponentialRampToValue"===t.type},f=function(t){return"linearRampToValue"===t.type},m=function(t){return d(t)||f(t)},_=function(t){return"setValue"===t.type},g=function(t){return"setValueCurve"===t.type},v=function t(e,n,s,i){var r=e[n];return void 0===r?i:m(r)||_(r)?r.value:g(r)?r.values[r.values.length-1]:p(s,t(e,n-1,r.startTime,i),r)},y=function(t,e,n,s,i){return void 0===n?[s.insertTime,i]:m(n)?[n.endTime,n.value]:_(n)?[n.startTime,n.value]:g(n)?[n.startTime+n.duration,n.values[n.values.length-1]]:[n.startTime,v(t,e-1,n.startTime,i)]},b=function(t){return"cancelAndHold"===t.type},w=function(t){return"cancelScheduledValues"===t.type},x=function(t){return b(t)||w(t)?t.cancelTime:d(t)||f(t)?t.endTime:t.startTime},T=function(t,e,n,s){var i=s.endTime,r=s.value;return n===r?r:0<n&&0<r||n<0&&r<0?n*Math.pow(r/n,(t-e)/(i-e)):0},C=function(t,e,n,s){var i=s.endTime,r=s.value;return n+(t-e)/(i-e)*(r-n)},S=function(t,e){var n=Math.floor(e),s=Math.ceil(e);return n===s?t[n]:(1-(e-n))*t[n]+(1-(s-e))*t[s]},A=function(t,e){var n=e.duration,s=e.startTime,i=e.values,r=(t-s)/n*(i.length-1);return S(i,r)},k=function(t){return"setTarget"===t.type},O=function(){function t(e){o["default"](this,t),this._automationEvents=[],this._currenTime=0,this._defaultValue=e}return a["default"](t,[{key:Symbol.iterator,value:function(){return this._automationEvents[Symbol.iterator]()}},{key:"add",value:function(t){var e=x(t);if(b(t)||w(t)){var n=this._automationEvents.findIndex((function(n){return w(t)&&g(n)?n.startTime+n.duration>=e:x(n)>=e})),s=this._automationEvents[n];if(-1!==n&&(this._automationEvents=this._automationEvents.slice(0,n)),b(t)){var i=this._automationEvents[this._automationEvents.length-1];if(void 0!==s&&m(s)){if(k(i))throw new Error("The internal list is malformed.");var r=g(i)?i.startTime+i.duration:x(i),o=g(i)?i.values[i.values.length-1]:i.value,a=d(s)?T(e,r,o,s):C(e,r,o,s),p=d(s)?c(a,e,this._currenTime):u(a,e,this._currenTime);this._automationEvents.push(p)}void 0!==i&&k(i)&&this._automationEvents.push(l(this.getValue(e),e)),void 0!==i&&g(i)&&i.startTime+i.duration>e&&(this._automationEvents[this._automationEvents.length-1]=h(new Float32Array([6,7]),i.startTime,e-i.startTime))}}else{var _=this._automationEvents.findIndex((function(t){return x(t)>e})),v=-1===_?this._automationEvents[this._automationEvents.length-1]:this._automationEvents[_-1];if(void 0!==v&&g(v)&&x(v)+v.duration>e)return!1;var y=d(t)?c(t.value,t.endTime,this._currenTime):f(t)?u(t.value,e,this._currenTime):t;if(-1===_)this._automationEvents.push(y);else{if(g(t)&&e+t.duration>x(this._automationEvents[_]))return!1;this._automationEvents.splice(_,0,y)}}return!0}},{key:"flush",value:function(t){var e=this._automationEvents.findIndex((function(e){return x(e)>t}));if(e>1){var n=this._automationEvents.slice(e-1),s=n[0];k(s)&&n.unshift(l(v(this._automationEvents,e-2,s.startTime,this._defaultValue),s.startTime)),this._automationEvents=n}}},{key:"getValue",value:function(t){if(0===this._automationEvents.length)return this._defaultValue;var e=this._automationEvents[this._automationEvents.length-1],n=this._automationEvents.findIndex((function(e){return x(e)>t})),s=this._automationEvents[n],i=x(e)<=t?e:this._automationEvents[n-1];if(void 0!==i&&k(i)&&(void 0===s||!m(s)||s.insertTime>t))return p(t,v(this._automationEvents,n-2,i.startTime,this._defaultValue),i);if(void 0!==i&&_(i)&&(void 0===s||!m(s)))return i.value;if(void 0!==i&&g(i)&&(void 0===s||!m(s)||i.startTime+i.duration>t))return t<i.startTime+i.duration?A(t,i):i.values[i.values.length-1];if(void 0!==i&&m(i)&&(void 0===s||!m(s)))return i.value;if(void 0!==s&&d(s)){var o=y(this._automationEvents,n-1,i,s,this._defaultValue),a=r["default"](o,2),c=a[0],u=a[1];return T(t,c,u,s)}if(void 0!==s&&f(s)){var l=y(this._automationEvents,n-1,i,s,this._defaultValue),h=r["default"](l,2),b=h[0],w=h[1];return C(t,b,w,s)}return this._defaultValue}}]),t}(),M=function(t){return{cancelTime:t,type:"cancelAndHold"}},E=function(t){return{cancelTime:t,type:"cancelScheduledValues"}},I=function(t,e){return{endTime:e,type:"exponentialRampToValue",value:t}},D=function(t,e){return{endTime:e,type:"linearRampToValue",value:t}},N=function(t,e,n){return{startTime:e,target:t,timeConstant:n,type:"setTarget"}};t.AutomationEventList=O,t.createCancelAndHoldAutomationEvent=M,t.createCancelScheduledValuesAutomationEvent=E,t.createExponentialRampToValueAutomationEvent=I,t.createLinearRampToValueAutomationEvent=D,t.createSetTargetAutomationEvent=N,t.createSetValueAutomationEvent=l,t.createSetValueCurveAutomationEvent=h,Object.defineProperty(t,"__esModule",{value:!0})}))},"057f":function(t,e,n){var s=n("fc6a"),i=n("241c").f,r={}.toString,o="object"==typeof window&&window&&Object.getOwnPropertyNames?Object.getOwnPropertyNames(window):[],a=function(t){try{return i(t)}catch(e){return o.slice()}};t.exports.f=function(t){return o&&"[object Window]"==r.call(t)?a(t):i(s(t))}},"06cf":function(t,e,n){var s=n("83ab"),i=n("d1e7"),r=n("5c6c"),o=n("fc6a"),a=n("c04e"),c=n("5135"),u=n("0cfb"),l=Object.getOwnPropertyDescriptor;e.f=s?l:function(t,e){if(t=o(t),e=a(e,!0),u)try{return l(t,e)}catch(n){}if(c(t,e))return r(!i.f.call(t,e),t[e])}},"0cfb":function(t,e,n){var s=n("83ab"),i=n("d039"),r=n("cc12");t.exports=!s&&!i((function(){return 7!=Object.defineProperty(r("div"),"a",{get:function(){return 7}}).a}))},"1be4":function(t,e,n){var s=n("d066");t.exports=s("document","documentElement")},"1c0b":function(t,e){t.exports=function(t){if("function"!=typeof t)throw TypeError(String(t)+" is not a function");return t}},"1c7e":function(t,e,n){var s=n("b622"),i=s("iterator"),r=!1;try{var o=0,a={next:function(){return{done:!!o++}},return:function(){r=!0}};a[i]=function(){return this},Array.from(a,(function(){throw 2}))}catch(c){}t.exports=function(t,e){if(!e&&!r)return!1;var n=!1;try{var s={};s[i]=function(){return{next:function(){return{done:n=!0}}}},t(s)}catch(c){}return n}},"1d80":function(t,e){t.exports=function(t){if(void 0==t)throw TypeError("Can't call method on "+t);return t}},"1dde":function(t,e,n){var s=n("d039"),i=n("b622"),r=n("2d00"),o=i("species");t.exports=function(t){return r>=51||!s((function(){var e=[],n=e.constructor={};return n[o]=function(){return{foo:1}},1!==e[t](Boolean).foo}))}},"23cb":function(t,e,n){var s=n("a691"),i=Math.max,r=Math.min;t.exports=function(t,e){var n=s(t);return n<0?i(n+e,0):r(n,e)}},"23e7":function(t,e,n){var s=n("da84"),i=n("06cf").f,r=n("9112"),o=n("6eeb"),a=n("ce4e"),c=n("e893"),u=n("94ca");t.exports=function(t,e){var n,l,h,p,d,f,m=t.target,_=t.global,g=t.stat;if(l=_?s:g?s[m]||a(m,{}):(s[m]||{}).prototype,l)for(h in e){if(d=e[h],t.noTargetGet?(f=i(l,h),p=f&&f.value):p=l[h],n=u(_?h:m+(g?".":"#")+h,t.forced),!n&&void 0!==p){if(typeof d===typeof p)continue;c(d,p)}(t.sham||p&&p.sham)&&r(d,"sham",!0),o(l,h,d,t)}}},"241c":function(t,e,n){var s=n("ca84"),i=n("7839"),r=i.concat("length","prototype");e.f=Object.getOwnPropertyNames||function(t){return s(t,r)}},"24fb":function(t,e,n){"use strict";function s(t,e){var n=t[1]||"",s=t[3];if(!s)return n;if(e&&"function"===typeof btoa){var r=i(s),o=s.sources.map((function(t){return"/*# sourceURL=".concat(s.sourceRoot||"").concat(t," */")}));return[n].concat(o).concat([r]).join("\n")}return[n].join("\n")}function i(t){var e=btoa(unescape(encodeURIComponent(JSON.stringify(t)))),n="sourceMappingURL=data:application/json;charset=utf-8;base64,".concat(e);return"/*# ".concat(n," */")}t.exports=function(t){var e=[];return e.toString=function(){return this.map((function(e){var n=s(e,t);return e[2]?"@media ".concat(e[2]," {").concat(n,"}"):n})).join("")},e.i=function(t,n,s){"string"===typeof t&&(t=[[null,t,""]]);var i={};if(s)for(var r=0;r<this.length;r++){var o=this[r][0];null!=o&&(i[o]=!0)}for(var a=0;a<t.length;a++){var c=[].concat(t[a]);s&&i[c[0]]||(n&&(c[2]?c[2]="".concat(n," and ").concat(c[2]):c[2]=n),e.push(c))}},e}},"25f0":function(t,e,n){"use strict";var s=n("6eeb"),i=n("825a"),r=n("d039"),o=n("ad6d"),a="toString",c=RegExp.prototype,u=c[a],l=r((function(){return"/a/b"!=u.call({source:"a",flags:"b"})})),h=u.name!=a;(l||h)&&s(RegExp.prototype,a,(function(){var t=i(this),e=String(t.source),n=t.flags,s=String(void 0===n&&t instanceof RegExp&&!("flags"in c)?o.call(t):n);return"/"+e+"/"+s}),{unsafe:!0})},"278c":function(t,e,n){var s=n("c135"),i=n("9b42"),r=n("6613"),o=n("c240");function a(t,e){return s(t)||i(t,e)||r(t,e)||o()}t.exports=a},"2d00":function(t,e,n){var s,i,r=n("da84"),o=n("342f"),a=r.process,c=a&&a.versions,u=c&&c.v8;u?(s=u.split("."),i=s[0]+s[1]):o&&(s=o.match(/Edge\/(\d+)/),(!s||s[1]>=74)&&(s=o.match(/Chrome\/(\d+)/),s&&(i=s[1]))),t.exports=i&&+i},"342f":function(t,e,n){var s=n("d066");t.exports=s("navigator","userAgent")||""},"35a1":function(t,e,n){var s=n("f5df"),i=n("3f8c"),r=n("b622"),o=r("iterator");t.exports=function(t){if(void 0!=t)return t[o]||t["@@iterator"]||i[s(t)]}},"37e8":function(t,e,n){var s=n("83ab"),i=n("9bf2"),r=n("825a"),o=n("df75");t.exports=s?Object.defineProperties:function(t,e){r(t);var n,s=o(e),a=s.length,c=0;while(a>c)i.f(t,n=s[c++],e[n]);return t}},"3bbe":function(t,e,n){var s=n("861d");t.exports=function(t){if(!s(t)&&null!==t)throw TypeError("Can't set "+String(t)+" as a prototype");return t}},"3ca3":function(t,e,n){"use strict";var s=n("6547").charAt,i=n("69f3"),r=n("7dd0"),o="String Iterator",a=i.set,c=i.getterFor(o);r(String,"String",(function(t){a(this,{type:o,string:String(t),index:0})}),(function(){var t,e=c(this),n=e.string,i=e.index;return i>=n.length?{value:void 0,done:!0}:(t=s(n,i),e.index+=t.length,{value:t,done:!1})}))},"3f8c":function(t,e){t.exports={}},"428f":function(t,e,n){var s=n("da84");t.exports=s},"44ad":function(t,e,n){var s=n("d039"),i=n("c6b6"),r="".split;t.exports=s((function(){return!Object("z").propertyIsEnumerable(0)}))?function(t){return"String"==i(t)?r.call(t,""):Object(t)}:Object},"44d2":function(t,e,n){var s=n("b622"),i=n("7c73"),r=n("9bf2"),o=s("unscopables"),a=Array.prototype;void 0==a[o]&&r.f(a,o,{configurable:!0,value:i(null)}),t.exports=function(t){a[o][t]=!0}},4930:function(t,e,n){var s=n("d039");t.exports=!!Object.getOwnPropertySymbols&&!s((function(){return!String(Symbol())}))},"499e":function(t,e,n){"use strict";function s(t,e){for(var n=[],s={},i=0;i<e.length;i++){var r=e[i],o=r[0],a=r[1],c=r[2],u=r[3],l={id:t+":"+i,css:a,media:c,sourceMap:u};s[o]?s[o].parts.push(l):n.push(s[o]={id:o,parts:[l]})}return n}n.r(e),n.d(e,"default",(function(){return f}));var i="undefined"!==typeof document;if("undefined"!==typeof DEBUG&&DEBUG&&!i)throw new Error("vue-style-loader cannot be used in a non-browser environment. Use { target: 'node' } in your Webpack config to indicate a server-rendering environment.");var r={},o=i&&(document.head||document.getElementsByTagName("head")[0]),a=null,c=0,u=!1,l=function(){},h=null,p="data-vue-ssr-id",d="undefined"!==typeof navigator&&/msie [6-9]\b/.test(navigator.userAgent.toLowerCase());function f(t,e,n,i){u=n,h=i||{};var o=s(t,e);return m(o),function(e){for(var n=[],i=0;i<o.length;i++){var a=o[i],c=r[a.id];c.refs--,n.push(c)}e?(o=s(t,e),m(o)):o=[];for(i=0;i<n.length;i++){c=n[i];if(0===c.refs){for(var u=0;u<c.parts.length;u++)c.parts[u]();delete r[c.id]}}}}function m(t){for(var e=0;e<t.length;e++){var n=t[e],s=r[n.id];if(s){s.refs++;for(var i=0;i<s.parts.length;i++)s.parts[i](n.parts[i]);for(;i<n.parts.length;i++)s.parts.push(g(n.parts[i]));s.parts.length>n.parts.length&&(s.parts.length=n.parts.length)}else{var o=[];for(i=0;i<n.parts.length;i++)o.push(g(n.parts[i]));r[n.id]={id:n.id,refs:1,parts:o}}}}function _(){var t=document.createElement("style");return t.type="text/css",o.appendChild(t),t}function g(t){var e,n,s=document.querySelector("style["+p+'~="'+t.id+'"]');if(s){if(u)return l;s.parentNode.removeChild(s)}if(d){var i=c++;s=a||(a=_()),e=y.bind(null,s,i,!1),n=y.bind(null,s,i,!0)}else s=_(),e=b.bind(null,s),n=function(){s.parentNode.removeChild(s)};return e(t),function(s){if(s){if(s.css===t.css&&s.media===t.media&&s.sourceMap===t.sourceMap)return;e(t=s)}else n()}}var v=function(){var t=[];return function(e,n){return t[e]=n,t.filter(Boolean).join("\n")}}();function y(t,e,n,s){var i=n?"":s.css;if(t.styleSheet)t.styleSheet.cssText=v(e,i);else{var r=document.createTextNode(i),o=t.childNodes;o[e]&&t.removeChild(o[e]),o.length?t.insertBefore(r,o[e]):t.appendChild(r)}}function b(t,e){var n=e.css,s=e.media,i=e.sourceMap;if(s&&t.setAttribute("media",s),h.ssrId&&t.setAttribute(p,e.id),i&&(n+="\n/*# sourceURL="+i.sources[0]+" */",n+="\n/*# sourceMappingURL=data:application/json;base64,"+btoa(unescape(encodeURIComponent(JSON.stringify(i))))+" */"),t.styleSheet)t.styleSheet.cssText=n;else{while(t.firstChild)t.removeChild(t.firstChild);t.appendChild(document.createTextNode(n))}}},"4d64":function(t,e,n){var s=n("fc6a"),i=n("50c4"),r=n("23cb"),o=function(t){return function(e,n,o){var a,c=s(e),u=i(c.length),l=r(o,u);if(t&&n!=n){while(u>l)if(a=c[l++],a!=a)return!0}else for(;u>l;l++)if((t||l in c)&&c[l]===n)return t||l||0;return!t&&-1}};t.exports={includes:o(!0),indexOf:o(!1)}},"4df4":function(t,e,n){"use strict";var s=n("0366"),i=n("7b0b"),r=n("9bdd"),o=n("e95a"),a=n("50c4"),c=n("8418"),u=n("35a1");t.exports=function(t){var e,n,l,h,p,d,f=i(t),m="function"==typeof this?this:Array,_=arguments.length,g=_>1?arguments[1]:void 0,v=void 0!==g,y=u(f),b=0;if(v&&(g=s(g,_>2?arguments[2]:void 0,2)),void 0==y||m==Array&&o(y))for(e=a(f.length),n=new m(e);e>b;b++)d=v?g(f[b],b):f[b],c(n,b,d);else for(h=y.call(f),p=h.next,n=new m;!(l=p.call(h)).done;b++)d=v?r(h,g,[l.value,b],!0):l.value,c(n,b,d);return n.length=b,n}},"50c4":function(t,e,n){var s=n("a691"),i=Math.min;t.exports=function(t){return t>0?i(s(t),9007199254740991):0}},5135:function(t,e){var n={}.hasOwnProperty;t.exports=function(t,e){return n.call(t,e)}},5692:function(t,e,n){var s=n("c430"),i=n("c6cd");(t.exports=function(t,e){return i[t]||(i[t]=void 0!==e?e:{})})("versions",[]).push({version:"3.6.5",mode:s?"pure":"global",copyright:"© 2020 Denis Pushkarev (zloirock.ru)"})},"56ef":function(t,e,n){var s=n("d066"),i=n("241c"),r=n("7418"),o=n("825a");t.exports=s("Reflect","ownKeys")||function(t){var e=i.f(o(t)),n=r.f;return n?e.concat(n(t)):e}},5899:function(t,e){t.exports="\t\n\v\f\r \u2028\u2029\ufeff"},"58a8":function(t,e,n){var s=n("1d80"),i=n("5899"),r="["+i+"]",o=RegExp("^"+r+r+"*"),a=RegExp(r+r+"*$"),c=function(t){return function(e){var n=String(s(e));return 1&t&&(n=n.replace(o,"")),2&t&&(n=n.replace(a,"")),n}};t.exports={start:c(1),end:c(2),trim:c(3)}},"5a43":function(t,e){function n(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,s=new Array(e);n<e;n++)s[n]=t[n];return s}t.exports=n},"5bc3":function(t,e){function n(t,e){for(var n=0;n<e.length;n++){var s=e[n];s.enumerable=s.enumerable||!1,s.configurable=!0,"value"in s&&(s.writable=!0),Object.defineProperty(t,s.key,s)}}function s(t,e,s){return e&&n(t.prototype,e),s&&n(t,s),t}t.exports=s},"5c6c":function(t,e){t.exports=function(t,e){return{enumerable:!(1&t),configurable:!(2&t),writable:!(4&t),value:e}}},6547:function(t,e,n){var s=n("a691"),i=n("1d80"),r=function(t){return function(e,n){var r,o,a=String(i(e)),c=s(n),u=a.length;return c<0||c>=u?t?"":void 0:(r=a.charCodeAt(c),r<55296||r>56319||c+1===u||(o=a.charCodeAt(c+1))<56320||o>57343?t?a.charAt(c):r:t?a.slice(c,c+2):o-56320+(r-55296<<10)+65536)}};t.exports={codeAt:r(!1),charAt:r(!0)}},"65f0":function(t,e,n){var s=n("861d"),i=n("e8b5"),r=n("b622"),o=r("species");t.exports=function(t,e){var n;return i(t)&&(n=t.constructor,"function"!=typeof n||n!==Array&&!i(n.prototype)?s(n)&&(n=n[o],null===n&&(n=void 0)):n=void 0),new(void 0===n?Array:n)(0===e?0:e)}},6613:function(t,e,n){n("a630"),n("fb6a"),n("b0c0"),n("d3b7"),n("25f0"),n("3ca3");var s=n("5a43");function i(t,e){if(t){if("string"===typeof t)return s(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?s(t,e):void 0}}t.exports=i},"69f3":function(t,e,n){var s,i,r,o=n("7f9a"),a=n("da84"),c=n("861d"),u=n("9112"),l=n("5135"),h=n("f772"),p=n("d012"),d=a.WeakMap,f=function(t){return r(t)?i(t):s(t,{})},m=function(t){return function(e){var n;if(!c(e)||(n=i(e)).type!==t)throw TypeError("Incompatible receiver, "+t+" required");return n}};if(o){var _=new d,g=_.get,v=_.has,y=_.set;s=function(t,e){return y.call(_,t,e),e},i=function(t){return g.call(_,t)||{}},r=function(t){return v.call(_,t)}}else{var b=h("state");p[b]=!0,s=function(t,e){return u(t,b,e),e},i=function(t){return l(t,b)?t[b]:{}},r=function(t){return l(t,b)}}t.exports={set:s,get:i,has:r,enforce:f,getterFor:m}},"6eeb":function(t,e,n){var s=n("da84"),i=n("9112"),r=n("5135"),o=n("ce4e"),a=n("8925"),c=n("69f3"),u=c.get,l=c.enforce,h=String(String).split("String");(t.exports=function(t,e,n,a){var c=!!a&&!!a.unsafe,u=!!a&&!!a.enumerable,p=!!a&&!!a.noTargetGet;"function"==typeof n&&("string"!=typeof e||r(n,"name")||i(n,"name",e),l(n).source=h.join("string"==typeof e?e:"")),t!==s?(c?!p&&t[e]&&(u=!0):delete t[e],u?t[e]=n:i(t,e,n)):u?t[e]=n:o(e,n)})(Function.prototype,"toString",(function(){return"function"==typeof this&&u(this).source||a(this)}))},7156:function(t,e,n){var s=n("861d"),i=n("d2bb");t.exports=function(t,e,n){var r,o;return i&&"function"==typeof(r=e.constructor)&&r!==n&&s(o=r.prototype)&&o!==n.prototype&&i(t,o),t}},7383:function(t,e,n){var s=n("24fb");e=s(!1),e.push([t.i,".piano-keyboard{position:relative;height:100%;width:100%}.white-note{display:flex;justify-content:center;float:left;position:relative;cursor:pointer;color:#000;height:98%;border-radius:0 0 5px 5px;box-shadow:inset 0 0 0 hsla(0,0%,100%,.8),inset -2px -5px 3px #ccc,0 0 3px rgba(0,0,0,.5)}.white-note-pressed{box-shadow:inset 2px 0 3px rgba(0,0,0,.2),inset -5px -1px 20px rgba(0,0,0,.2),0 0 3px rgba(0,0,0,.5)}.black-note{display:flex;align-items:flex-end;justify-content:center;position:absolute;cursor:pointer;height:65%;width:65%;left:68%;z-index:1;color:#fff;border-radius:0 0 3px 3px;box-shadow:inset -1px -1px 2px hsla(0,0%,100%,.2),inset 0 -5px 2px rgba(0,0,0,.5),0 2px 4px rgba(0,0,0,.5)}.black-note-pressed{box-shadow:inset -1px -1px 2px hsla(0,0%,100%,.2),inset 0 -1px 2px rgba(0,0,0,.2),0 1px 2px rgba(0,0,0,.2)}.key-group{align-self:flex-end;display:flex;flex-direction:column;align-items:center;margin-bottom:.8vw;font-size:1.2vw}.key-text{margin-top:.8vw}.key-text-on-black-note{transform:rotate(-90deg);margin:.8vw 0;margin-top:1vw}.key-input{text-align:center;width:2em;color:inherit;font-size:1vw}.unselectable{-webkit-touch-callout:none;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}",""]),t.exports=e},"73b2":function(t,e,n){"use strict";n("b6b9")},7418:function(t,e){e.f=Object.getOwnPropertySymbols},"746f":function(t,e,n){var s=n("428f"),i=n("5135"),r=n("e538"),o=n("9bf2").f;t.exports=function(t){var e=s.Symbol||(s.Symbol={});i(e,t)||o(e,t,{value:r.f(t)})}},7839:function(t,e){t.exports=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"]},"7b0b":function(t,e,n){var s=n("1d80");t.exports=function(t){return Object(s(t))}},"7c73":function(t,e,n){var s,i=n("825a"),r=n("37e8"),o=n("7839"),a=n("d012"),c=n("1be4"),u=n("cc12"),l=n("f772"),h=">",p="<",d="prototype",f="script",m=l("IE_PROTO"),_=function(){},g=function(t){return p+f+h+t+p+"/"+f+h},v=function(t){t.write(g("")),t.close();var e=t.parentWindow.Object;return t=null,e},y=function(){var t,e=u("iframe"),n="java"+f+":";return e.style.display="none",c.appendChild(e),e.src=String(n),t=e.contentWindow.document,t.open(),t.write(g("document.F=Object")),t.close(),t.F},b=function(){try{s=document.domain&&new ActiveXObject("htmlfile")}catch(e){}b=s?v(s):y();var t=o.length;while(t--)delete b[d][o[t]];return b()};a[m]=!0,t.exports=Object.create||function(t,e){var n;return null!==t?(_[d]=i(t),n=new _,_[d]=null,n[m]=t):n=b(),void 0===e?n:r(n,e)}},"7dd0":function(t,e,n){"use strict";var s=n("23e7"),i=n("9ed3"),r=n("e163"),o=n("d2bb"),a=n("d44e"),c=n("9112"),u=n("6eeb"),l=n("b622"),h=n("c430"),p=n("3f8c"),d=n("ae93"),f=d.IteratorPrototype,m=d.BUGGY_SAFARI_ITERATORS,_=l("iterator"),g="keys",v="values",y="entries",b=function(){return this};t.exports=function(t,e,n,l,d,w,x){i(n,e,l);var T,C,S,A=function(t){if(t===d&&I)return I;if(!m&&t in M)return M[t];switch(t){case g:return function(){return new n(this,t)};case v:return function(){return new n(this,t)};case y:return function(){return new n(this,t)}}return function(){return new n(this)}},k=e+" Iterator",O=!1,M=t.prototype,E=M[_]||M["@@iterator"]||d&&M[d],I=!m&&E||A(d),D="Array"==e&&M.entries||E;if(D&&(T=r(D.call(new t)),f!==Object.prototype&&T.next&&(h||r(T)===f||(o?o(T,f):"function"!=typeof T[_]&&c(T,_,b)),a(T,k,!0,!0),h&&(p[k]=b))),d==v&&E&&E.name!==v&&(O=!0,I=function(){return E.call(this)}),h&&!x||M[_]===I||c(M,_,I),p[e]=I,d)if(C={values:A(v),keys:w?I:A(g),entries:A(y)},x)for(S in C)(m||O||!(S in M))&&u(M,S,C[S]);else s({target:e,proto:!0,forced:m||O},C);return C}},"7f9a":function(t,e,n){var s=n("da84"),i=n("8925"),r=s.WeakMap;t.exports="function"===typeof r&&/native code/.test(i(r))},"825a":function(t,e,n){var s=n("861d");t.exports=function(t){if(!s(t))throw TypeError(String(t)+" is not an object");return t}},"83ab":function(t,e,n){var s=n("d039");t.exports=!s((function(){return 7!=Object.defineProperty({},1,{get:function(){return 7}})[1]}))},8418:function(t,e,n){"use strict";var s=n("c04e"),i=n("9bf2"),r=n("5c6c");t.exports=function(t,e,n){var o=s(e);o in t?i.f(t,o,r(0,n)):t[o]=n}},"861d":function(t,e){t.exports=function(t){return"object"===typeof t?null!==t:"function"===typeof t}},8875:function(t,e,n){var s,i,r;(function(n,o){i=[],s=o,r="function"===typeof s?s.apply(e,i):s,void 0===r||(t.exports=r)})("undefined"!==typeof self&&self,(function(){function t(){var e=Object.getOwnPropertyDescriptor(document,"currentScript");if(!e&&"currentScript"in document&&document.currentScript)return document.currentScript;if(e&&e.get!==t&&document.currentScript)return document.currentScript;try{throw new Error}catch(d){var n,s,i,r=/.*at [^(]*\((.*):(.+):(.+)\)$/gi,o=/@([^@]*):(\d+):(\d+)\s*$/gi,a=r.exec(d.stack)||o.exec(d.stack),c=a&&a[1]||!1,u=a&&a[2]||!1,l=document.location.href.replace(document.location.hash,""),h=document.getElementsByTagName("script");c===l&&(n=document.documentElement.outerHTML,s=new RegExp("(?:[^\\n]+?\\n){0,"+(u-2)+"}[^<]*<script>([\\d\\D]*?)<\\/script>[\\d\\D]*","i"),i=n.replace(s,"$1").trim());for(var p=0;p<h.length;p++){if("interactive"===h[p].readyState)return h[p];if(h[p].src===c)return h[p];if(c===l&&h[p].innerHTML&&h[p].innerHTML.trim()===i)return h[p]}return null}}return t}))},8925:function(t,e,n){var s=n("c6cd"),i=Function.toString;"function"!=typeof s.inspectSource&&(s.inspectSource=function(t){return i.call(t)}),t.exports=s.inspectSource},"90e3":function(t,e){var n=0,s=Math.random();t.exports=function(t){return"Symbol("+String(void 0===t?"":t)+")_"+(++n+s).toString(36)}},9112:function(t,e,n){var s=n("83ab"),i=n("9bf2"),r=n("5c6c");t.exports=s?function(t,e,n){return i.f(t,e,r(1,n))}:function(t,e,n){return t[e]=n,t}},"94ca":function(t,e,n){var s=n("d039"),i=/#|\.prototype\./,r=function(t,e){var n=a[o(t)];return n==u||n!=c&&("function"==typeof e?s(e):!!e)},o=r.normalize=function(t){return String(t).replace(i,".").toLowerCase()},a=r.data={},c=r.NATIVE="N",u=r.POLYFILL="P";t.exports=r},"970b":function(t,e){function n(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}t.exports=n},"9b42":function(t,e,n){function s(t,e){if("undefined"!==typeof Symbol&&Symbol.iterator in Object(t)){var n=[],s=!0,i=!1,r=void 0;try{for(var o,a=t[Symbol.iterator]();!(s=(o=a.next()).done);s=!0)if(n.push(o.value),e&&n.length===e)break}catch(c){i=!0,r=c}finally{try{s||null==a["return"]||a["return"]()}finally{if(i)throw r}}return n}}n("a4d3"),n("e01a"),n("d28b"),n("e260"),n("d3b7"),n("3ca3"),n("ddb0"),t.exports=s},"9bdd":function(t,e,n){var s=n("825a");t.exports=function(t,e,n,i){try{return i?e(s(n)[0],n[1]):e(n)}catch(o){var r=t["return"];throw void 0!==r&&s(r.call(t)),o}}},"9bf2":function(t,e,n){var s=n("83ab"),i=n("0cfb"),r=n("825a"),o=n("c04e"),a=Object.defineProperty;e.f=s?a:function(t,e,n){if(r(t),e=o(e,!0),r(n),i)try{return a(t,e,n)}catch(s){}if("get"in n||"set"in n)throw TypeError("Accessors not supported");return"value"in n&&(t[e]=n.value),t}},"9ed3":function(t,e,n){"use strict";var s=n("ae93").IteratorPrototype,i=n("7c73"),r=n("5c6c"),o=n("d44e"),a=n("3f8c"),c=function(){return this};t.exports=function(t,e,n){var u=e+" Iterator";return t.prototype=i(s,{next:r(1,n)}),o(t,u,!1,!0),a[u]=c,t}},a4d3:function(t,e,n){"use strict";var s=n("23e7"),i=n("da84"),r=n("d066"),o=n("c430"),a=n("83ab"),c=n("4930"),u=n("fdbf"),l=n("d039"),h=n("5135"),p=n("e8b5"),d=n("861d"),f=n("825a"),m=n("7b0b"),_=n("fc6a"),g=n("c04e"),v=n("5c6c"),y=n("7c73"),b=n("df75"),w=n("241c"),x=n("057f"),T=n("7418"),C=n("06cf"),S=n("9bf2"),A=n("d1e7"),k=n("9112"),O=n("6eeb"),M=n("5692"),E=n("f772"),I=n("d012"),D=n("90e3"),N=n("b622"),R=n("e538"),P=n("746f"),V=n("d44e"),q=n("69f3"),j=n("b727").forEach,F=E("hidden"),L="Symbol",B="prototype",W=N("toPrimitive"),U=q.set,z=q.getterFor(L),G=Object[B],X=i.Symbol,Y=r("JSON","stringify"),H=C.f,Z=S.f,$=x.f,K=A.f,Q=M("symbols"),J=M("op-symbols"),tt=M("string-to-symbol-registry"),et=M("symbol-to-string-registry"),nt=M("wks"),st=i.QObject,it=!st||!st[B]||!st[B].findChild,rt=a&&l((function(){return 7!=y(Z({},"a",{get:function(){return Z(this,"a",{value:7}).a}})).a}))?function(t,e,n){var s=H(G,e);s&&delete G[e],Z(t,e,n),s&&t!==G&&Z(G,e,s)}:Z,ot=function(t,e){var n=Q[t]=y(X[B]);return U(n,{type:L,tag:t,description:e}),a||(n.description=e),n},at=u?function(t){return"symbol"==typeof t}:function(t){return Object(t)instanceof X},ct=function(t,e,n){t===G&&ct(J,e,n),f(t);var s=g(e,!0);return f(n),h(Q,s)?(n.enumerable?(h(t,F)&&t[F][s]&&(t[F][s]=!1),n=y(n,{enumerable:v(0,!1)})):(h(t,F)||Z(t,F,v(1,{})),t[F][s]=!0),rt(t,s,n)):Z(t,s,n)},ut=function(t,e){f(t);var n=_(e),s=b(n).concat(ft(n));return j(s,(function(e){a&&!ht.call(n,e)||ct(t,e,n[e])})),t},lt=function(t,e){return void 0===e?y(t):ut(y(t),e)},ht=function(t){var e=g(t,!0),n=K.call(this,e);return!(this===G&&h(Q,e)&&!h(J,e))&&(!(n||!h(this,e)||!h(Q,e)||h(this,F)&&this[F][e])||n)},pt=function(t,e){var n=_(t),s=g(e,!0);if(n!==G||!h(Q,s)||h(J,s)){var i=H(n,s);return!i||!h(Q,s)||h(n,F)&&n[F][s]||(i.enumerable=!0),i}},dt=function(t){var e=$(_(t)),n=[];return j(e,(function(t){h(Q,t)||h(I,t)||n.push(t)})),n},ft=function(t){var e=t===G,n=$(e?J:_(t)),s=[];return j(n,(function(t){!h(Q,t)||e&&!h(G,t)||s.push(Q[t])})),s};if(c||(X=function(){if(this instanceof X)throw TypeError("Symbol is not a constructor");var t=arguments.length&&void 0!==arguments[0]?String(arguments[0]):void 0,e=D(t),n=function(t){this===G&&n.call(J,t),h(this,F)&&h(this[F],e)&&(this[F][e]=!1),rt(this,e,v(1,t))};return a&&it&&rt(G,e,{configurable:!0,set:n}),ot(e,t)},O(X[B],"toString",(function(){return z(this).tag})),O(X,"withoutSetter",(function(t){return ot(D(t),t)})),A.f=ht,S.f=ct,C.f=pt,w.f=x.f=dt,T.f=ft,R.f=function(t){return ot(N(t),t)},a&&(Z(X[B],"description",{configurable:!0,get:function(){return z(this).description}}),o||O(G,"propertyIsEnumerable",ht,{unsafe:!0}))),s({global:!0,wrap:!0,forced:!c,sham:!c},{Symbol:X}),j(b(nt),(function(t){P(t)})),s({target:L,stat:!0,forced:!c},{for:function(t){var e=String(t);if(h(tt,e))return tt[e];var n=X(e);return tt[e]=n,et[n]=e,n},keyFor:function(t){if(!at(t))throw TypeError(t+" is not a symbol");if(h(et,t))return et[t]},useSetter:function(){it=!0},useSimple:function(){it=!1}}),s({target:"Object",stat:!0,forced:!c,sham:!a},{create:lt,defineProperty:ct,defineProperties:ut,getOwnPropertyDescriptor:pt}),s({target:"Object",stat:!0,forced:!c},{getOwnPropertyNames:dt,getOwnPropertySymbols:ft}),s({target:"Object",stat:!0,forced:l((function(){T.f(1)}))},{getOwnPropertySymbols:function(t){return T.f(m(t))}}),Y){var mt=!c||l((function(){var t=X();return"[null]"!=Y([t])||"{}"!=Y({a:t})||"{}"!=Y(Object(t))}));s({target:"JSON",stat:!0,forced:mt},{stringify:function(t,e,n){var s,i=[t],r=1;while(arguments.length>r)i.push(arguments[r++]);if(s=e,(d(e)||void 0!==t)&&!at(t))return p(e)||(e=function(t,e){if("function"==typeof s&&(e=s.call(this,t,e)),!at(e))return e}),i[1]=e,Y.apply(null,i)}})}X[B][W]||k(X[B],W,X[B].valueOf),V(X,L),I[F]=!0},a630:function(t,e,n){var s=n("23e7"),i=n("4df4"),r=n("1c7e"),o=!r((function(t){Array.from(t)}));s({target:"Array",stat:!0,forced:o},{from:i})},a691:function(t,e){var n=Math.ceil,s=Math.floor;t.exports=function(t){return isNaN(t=+t)?0:(t>0?s:n)(t)}},a9e3:function(t,e,n){"use strict";var s=n("83ab"),i=n("da84"),r=n("94ca"),o=n("6eeb"),a=n("5135"),c=n("c6b6"),u=n("7156"),l=n("c04e"),h=n("d039"),p=n("7c73"),d=n("241c").f,f=n("06cf").f,m=n("9bf2").f,_=n("58a8").trim,g="Number",v=i[g],y=v.prototype,b=c(p(y))==g,w=function(t){var e,n,s,i,r,o,a,c,u=l(t,!1);if("string"==typeof u&&u.length>2)if(u=_(u),e=u.charCodeAt(0),43===e||45===e){if(n=u.charCodeAt(2),88===n||120===n)return NaN}else if(48===e){switch(u.charCodeAt(1)){case 66:case 98:s=2,i=49;break;case 79:case 111:s=8,i=55;break;default:return+u}for(r=u.slice(2),o=r.length,a=0;a<o;a++)if(c=r.charCodeAt(a),c<48||c>i)return NaN;return parseInt(r,s)}return+u};if(r(g,!v(" 0o1")||!v("0b1")||v("+0x1"))){for(var x,T=function(t){var e=arguments.length<1?0:t,n=this;return n instanceof T&&(b?h((function(){y.valueOf.call(n)})):c(n)!=g)?u(new v(w(e)),n,T):w(e)},C=s?d(v):"MAX_VALUE,MIN_VALUE,NaN,NEGATIVE_INFINITY,POSITIVE_INFINITY,EPSILON,isFinite,isInteger,isNaN,isSafeInteger,MAX_SAFE_INTEGER,MIN_SAFE_INTEGER,parseFloat,parseInt,isInteger".split(","),S=0;C.length>S;S++)a(v,x=C[S])&&!a(T,x)&&m(T,x,f(v,x));T.prototype=y,y.constructor=T,o(i,g,T)}},ad6d:function(t,e,n){"use strict";var s=n("825a");t.exports=function(){var t=s(this),e="";return t.global&&(e+="g"),t.ignoreCase&&(e+="i"),t.multiline&&(e+="m"),t.dotAll&&(e+="s"),t.unicode&&(e+="u"),t.sticky&&(e+="y"),e}},ae40:function(t,e,n){var s=n("83ab"),i=n("d039"),r=n("5135"),o=Object.defineProperty,a={},c=function(t){throw t};t.exports=function(t,e){if(r(a,t))return a[t];e||(e={});var n=[][t],u=!!r(e,"ACCESSORS")&&e.ACCESSORS,l=r(e,0)?e[0]:c,h=r(e,1)?e[1]:void 0;return a[t]=!!n&&!i((function(){if(u&&!s)return!0;var t={length:-1};u?o(t,1,{enumerable:!0,get:c}):t[1]=1,n.call(t,l,h)}))}},ae93:function(t,e,n){"use strict";var s,i,r,o=n("e163"),a=n("9112"),c=n("5135"),u=n("b622"),l=n("c430"),h=u("iterator"),p=!1,d=function(){return this};[].keys&&(r=[].keys(),"next"in r?(i=o(o(r)),i!==Object.prototype&&(s=i)):p=!0),void 0==s&&(s={}),l||c(s,h)||a(s,h,d),t.exports={IteratorPrototype:s,BUGGY_SAFARI_ITERATORS:p}},b041:function(t,e,n){"use strict";var s=n("00ee"),i=n("f5df");t.exports=s?{}.toString:function(){return"[object "+i(this)+"]"}},b0c0:function(t,e,n){var s=n("83ab"),i=n("9bf2").f,r=Function.prototype,o=r.toString,a=/^\s*function ([^ (]*)/,c="name";s&&!(c in r)&&i(r,c,{configurable:!0,get:function(){try{return o.call(this).match(a)[1]}catch(t){return""}}})},b622:function(t,e,n){var s=n("da84"),i=n("5692"),r=n("5135"),o=n("90e3"),a=n("4930"),c=n("fdbf"),u=i("wks"),l=s.Symbol,h=c?l:l&&l.withoutSetter||o;t.exports=function(t){return r(u,t)||(a&&r(l,t)?u[t]=l[t]:u[t]=h("Symbol."+t)),u[t]}},b6b9:function(t,e,n){var s=n("7383");"string"===typeof s&&(s=[[t.i,s,""]]),s.locals&&(t.exports=s.locals);var i=n("499e").default;i("69d82ba6",s,!0,{sourceMap:!1,shadowMode:!1})},b727:function(t,e,n){var s=n("0366"),i=n("44ad"),r=n("7b0b"),o=n("50c4"),a=n("65f0"),c=[].push,u=function(t){var e=1==t,n=2==t,u=3==t,l=4==t,h=6==t,p=5==t||h;return function(d,f,m,_){for(var g,v,y=r(d),b=i(y),w=s(f,m,3),x=o(b.length),T=0,C=_||a,S=e?C(d,x):n?C(d,0):void 0;x>T;T++)if((p||T in b)&&(g=b[T],v=w(g,T,y),t))if(e)S[T]=v;else if(v)switch(t){case 3:return!0;case 5:return g;case 6:return T;case 2:c.call(S,g)}else if(l)return!1;return h?-1:u||l?l:S}};t.exports={forEach:u(0),map:u(1),filter:u(2),some:u(3),every:u(4),find:u(5),findIndex:u(6)}},c04e:function(t,e,n){var s=n("861d");t.exports=function(t,e){if(!s(t))return t;var n,i;if(e&&"function"==typeof(n=t.toString)&&!s(i=n.call(t)))return i;if("function"==typeof(n=t.valueOf)&&!s(i=n.call(t)))return i;if(!e&&"function"==typeof(n=t.toString)&&!s(i=n.call(t)))return i;throw TypeError("Can't convert object to primitive value")}},c135:function(t,e){function n(t){if(Array.isArray(t))return t}t.exports=n},c240:function(t,e){function n(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}t.exports=n},c430:function(t,e){t.exports=!1},c6b6:function(t,e){var n={}.toString;t.exports=function(t){return n.call(t).slice(8,-1)}},c6cd:function(t,e,n){var s=n("da84"),i=n("ce4e"),r="__core-js_shared__",o=s[r]||i(r,{});t.exports=o},c8ba:function(t,e){var n;n=function(){return this}();try{n=n||new Function("return this")()}catch(s){"object"===typeof window&&(n=window)}t.exports=n},ca84:function(t,e,n){var s=n("5135"),i=n("fc6a"),r=n("4d64").indexOf,o=n("d012");t.exports=function(t,e){var n,a=i(t),c=0,u=[];for(n in a)!s(o,n)&&s(a,n)&&u.push(n);while(e.length>c)s(a,n=e[c++])&&(~r(u,n)||u.push(n));return u}},cc12:function(t,e,n){var s=n("da84"),i=n("861d"),r=s.document,o=i(r)&&i(r.createElement);t.exports=function(t){return o?r.createElement(t):{}}},ce4e:function(t,e,n){var s=n("da84"),i=n("9112");t.exports=function(t,e){try{i(s,t,e)}catch(n){s[t]=e}return e}},d012:function(t,e){t.exports={}},d039:function(t,e){t.exports=function(t){try{return!!t()}catch(e){return!0}}},d066:function(t,e,n){var s=n("428f"),i=n("da84"),r=function(t){return"function"==typeof t?t:void 0};t.exports=function(t,e){return arguments.length<2?r(s[t])||r(i[t]):s[t]&&s[t][e]||i[t]&&i[t][e]}},d1e7:function(t,e,n){"use strict";var s={}.propertyIsEnumerable,i=Object.getOwnPropertyDescriptor,r=i&&!s.call({1:2},1);e.f=r?function(t){var e=i(this,t);return!!e&&e.enumerable}:s},d28b:function(t,e,n){var s=n("746f");s("iterator")},d2bb:function(t,e,n){var s=n("825a"),i=n("3bbe");t.exports=Object.setPrototypeOf||("__proto__"in{}?function(){var t,e=!1,n={};try{t=Object.getOwnPropertyDescriptor(Object.prototype,"__proto__").set,t.call(n,[]),e=n instanceof Array}catch(r){}return function(n,r){return s(n),i(r),e?t.call(n,r):n.__proto__=r,n}}():void 0)},d3b7:function(t,e,n){var s=n("00ee"),i=n("6eeb"),r=n("b041");s||i(Object.prototype,"toString",r,{unsafe:!0})},d44e:function(t,e,n){var s=n("9bf2").f,i=n("5135"),r=n("b622"),o=r("toStringTag");t.exports=function(t,e,n){t&&!i(t=n?t:t.prototype,o)&&s(t,o,{configurable:!0,value:e})}},da84:function(t,e,n){(function(e){var n=function(t){return t&&t.Math==Math&&t};t.exports=n("object"==typeof globalThis&&globalThis)||n("object"==typeof window&&window)||n("object"==typeof self&&self)||n("object"==typeof e&&e)||Function("return this")()}).call(this,n("c8ba"))},ddb0:function(t,e,n){var s=n("da84"),i=n("fdbc"),r=n("e260"),o=n("9112"),a=n("b622"),c=a("iterator"),u=a("toStringTag"),l=r.values;for(var h in i){var p=s[h],d=p&&p.prototype;if(d){if(d[c]!==l)try{o(d,c,l)}catch(m){d[c]=l}if(d[u]||o(d,u,h),i[h])for(var f in r)if(d[f]!==r[f])try{o(d,f,r[f])}catch(m){d[f]=r[f]}}}},df75:function(t,e,n){var s=n("ca84"),i=n("7839");t.exports=Object.keys||function(t){return s(t,i)}},e01a:function(t,e,n){"use strict";var s=n("23e7"),i=n("83ab"),r=n("da84"),o=n("5135"),a=n("861d"),c=n("9bf2").f,u=n("e893"),l=r.Symbol;if(i&&"function"==typeof l&&(!("description"in l.prototype)||void 0!==l().description)){var h={},p=function(){var t=arguments.length<1||void 0===arguments[0]?void 0:String(arguments[0]),e=this instanceof p?new l(t):void 0===t?l():l(t);return""===t&&(h[e]=!0),e};u(p,l);var d=p.prototype=l.prototype;d.constructor=p;var f=d.toString,m="Symbol(test)"==String(l("test")),_=/^Symbol\((.*)\)[^)]+$/;c(d,"description",{configurable:!0,get:function(){var t=a(this)?this.valueOf():this,e=f.call(t);if(o(h,t))return"";var n=m?e.slice(7,-1):e.replace(_,"$1");return""===n?void 0:n}}),s({global:!0,forced:!0},{Symbol:p})}},e163:function(t,e,n){var s=n("5135"),i=n("7b0b"),r=n("f772"),o=n("e177"),a=r("IE_PROTO"),c=Object.prototype;t.exports=o?Object.getPrototypeOf:function(t){return t=i(t),s(t,a)?t[a]:"function"==typeof t.constructor&&t instanceof t.constructor?t.constructor.prototype:t instanceof Object?c:null}},e177:function(t,e,n){var s=n("d039");t.exports=!s((function(){function t(){}return t.prototype.constructor=null,Object.getPrototypeOf(new t)!==t.prototype}))},e260:function(t,e,n){"use strict";var s=n("fc6a"),i=n("44d2"),r=n("3f8c"),o=n("69f3"),a=n("7dd0"),c="Array Iterator",u=o.set,l=o.getterFor(c);t.exports=a(Array,"Array",(function(t,e){u(this,{type:c,target:s(t),index:0,kind:e})}),(function(){var t=l(this),e=t.target,n=t.kind,s=t.index++;return!e||s>=e.length?(t.target=void 0,{value:void 0,done:!0}):"keys"==n?{value:s,done:!1}:"values"==n?{value:e[s],done:!1}:{value:[s,e[s]],done:!1}}),"values"),r.Arguments=r.Array,i("keys"),i("values"),i("entries")},e538:function(t,e,n){var s=n("b622");e.f=s},e893:function(t,e,n){var s=n("5135"),i=n("56ef"),r=n("06cf"),o=n("9bf2");t.exports=function(t,e){for(var n=i(e),a=o.f,c=r.f,u=0;u<n.length;u++){var l=n[u];s(t,l)||a(t,l,c(e,l))}}},e8b5:function(t,e,n){var s=n("c6b6");t.exports=Array.isArray||function(t){return"Array"==s(t)}},e95a:function(t,e,n){var s=n("b622"),i=n("3f8c"),r=s("iterator"),o=Array.prototype;t.exports=function(t){return void 0!==t&&(i.Array===t||o[r]===t)}},f5df:function(t,e,n){var s=n("00ee"),i=n("c6b6"),r=n("b622"),o=r("toStringTag"),a="Arguments"==i(function(){return arguments}()),c=function(t,e){try{return t[e]}catch(n){}};t.exports=s?i:function(t){var e,n,s;return void 0===t?"Undefined":null===t?"Null":"string"==typeof(n=c(e=Object(t),o))?n:a?i(e):"Object"==(s=i(e))&&"function"==typeof e.callee?"Arguments":s}},f772:function(t,e,n){var s=n("5692"),i=n("90e3"),r=s("keys");t.exports=function(t){return r[t]||(r[t]=i(t))}},fb15:function(t,e,n){"use strict";if(n.r(e),"undefined"!==typeof window){var s=window.document.currentScript,i=n("8875");s=i(),"currentScript"in document||Object.defineProperty(document,"currentScript",{get:i});var r=s&&s.src.match(/(.+\/)[^/]+\.js(\?.*)?$/);r&&(n.p=r[1])}var o=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{staticClass:"piano-keyboard"},t._l(t.notes,(function(e){return n("div",{key:e.note,staticClass:"white-note",class:[e.pressed?"white-note-pressed":""],style:{width:t.whiteNoteWidthSize+"%",background:t.whiteNoteBackground(e.pressed)},on:{mousedown:function(n){return t.playNoteMouse(e)},mouseup:function(n){return t.removePressedKeyMouse(e)},mouseover:function(n){return t.playNoteHover(e)},mouseleave:function(n){return t.removePressedKey(e)}}},[e.blackNote?n("div",{staticClass:"black-note",class:[e.blackNote.pressed?"black-note-pressed":""],style:{background:t.blackNoteBackground(e.blackNote.pressed)},on:{mousedown:function(n){return n.stopPropagation(),t.playNoteMouse(e.blackNote)},mouseup:function(n){return n.stopPropagation(),t.removePressedKeyMouse(e.blackNote)},mouseover:function(n){return n.stopPropagation(),t.playNoteHover(e.blackNote)},mouseleave:function(n){return n.stopPropagation(),t.removePressedKey(e.blackNote)}}},[n("div",{staticClass:"key-group unselectable"},[t.showKeys?n("div",{staticClass:"key-input"},[t._v(" "+t._s(e.blackNote.key)+" ")]):t._e(),t.showNotes?n("div",{staticClass:"key-text key-text-on-black-note"},[t._v(" "+t._s(e.blackNote.note)+" ")]):t._e()])]):t._e(),n("div",{staticClass:"key-group unselectable"},[t.showKeys?n("div",{staticClass:"key-input"},[t._v(" "+t._s(e.key)+" ")]):t._e(),t.showNotes?n("div",{staticClass:"key-text"},[t._v(" "+t._s(e.note)+" ")]):t._e()])])})),0)},a=[];n("a9e3");const c="14.7.58";var u=n("04d1");const l=()=>new DOMException("","AbortError"),h=t=>(e,n,[s,i,r],o)=>{t(e[i],[n,s,r],t=>t[0]===n&&t[1]===s,o)},p=t=>(e,n,s)=>{const i=[];for(let t=0;t<s.numberOfInputs;t+=1)i.push(new Set);t.set(e,{activeInputs:i,outputs:new Set,passiveInputs:new WeakMap,renderer:n})},d=t=>(e,n)=>{t.set(e,{activeInputs:new Set,passiveInputs:new WeakMap,renderer:n})},f=new WeakSet,m=new WeakMap,_=new WeakMap,g=new WeakMap,v=new WeakMap,y=new WeakMap,b=new WeakMap,w=new WeakMap,x=new WeakMap,T=new WeakMap,C={construct(){return C}},S=t=>{try{const e=new Proxy(t,C);new e}catch{return!1}return!0},A=/^import(?:(?:[\s]+[\w]+|(?:[\s]+[\w]+[\s]*,)?[\s]*\{[\s]*[\w]+(?:[\s]+as[\s]+[\w]+)?(?:[\s]*,[\s]*[\w]+(?:[\s]+as[\s]+[\w]+)?)*[\s]*}|(?:[\s]+[\w]+[\s]*,)?[\s]*\*[\s]+as[\s]+[\w]+)[\s]+from)?(?:[\s]*)("([^"\\]|\\.)+"|'([^'\\]|\\.)+')(?:[\s]*);?/,k=(t,e)=>{const n=[];let s=t.replace(/^[\s]+/,""),i=s.match(A);while(null!==i){const t=i[1].slice(1,-1),r=i[0].replace(/([\s]+)?;?$/,"").replace(t,new URL(t,e).toString());n.push(r),s=s.slice(i[0].length).replace(/^[\s]+/,""),i=s.match(A)}return[n.join(";"),s]},O=t=>{if(void 0!==t&&!Array.isArray(t))throw new TypeError("The parameterDescriptors property of given value for processorCtor is not an array.")},M=t=>{if(!S(t))throw new TypeError("The given value for processorCtor should be a constructor.");if(null===t.prototype||"object"!==typeof t.prototype)throw new TypeError("The given value for processorCtor should have a prototype.")},E=(t,e,n,s,i,r,o,a,c,u,l,h)=>(p,d,f={credentials:"omit"})=>{const m=r(p),_=new URL(d,h.location.href).toString();if(void 0!==m.audioWorklet)return Promise.all([i(d),Promise.resolve(t(l,l))]).then(([t,e])=>{const[n,s]=k(t,_),i=e?s:s.replace(/\s+extends\s+AudioWorkletProcessor\s*{/," extends (class extends AudioWorkletProcessor {__b=new WeakSet();constructor(){super();(p=>p.postMessage=(q=>(m,t)=>q.call(p,m,t?t.filter(u=>!this.__b.has(u)):t))(p.postMessage))(this.port)}}){"),r=e?"":"__c = (a) => a.forEach(e=>this.__b.add(e.buffer));",c=e?"":"i.forEach(this.__c);o.forEach(this.__c);this.__c(Object.values(p));",u=`${n};(registerProcessor=>{${i}\n})((n,p)=>registerProcessor(n,class extends p{${r}process(i,o,p){${c}return super.process(i.map(j=>j.some(k=>k.length===0)?[]:j),o,p)}}))`,l=new Blob([u],{type:"application/javascript; charset=utf-8"}),h=URL.createObjectURL(l);return m.audioWorklet.addModule(h,f).then(()=>{if(a(m))return;const t=o(m);return t.audioWorklet.addModule(h,f)}).finally(()=>URL.revokeObjectURL(h))});const g=u.get(p);if(void 0!==g&&g.has(d))return Promise.resolve();const v=c.get(p);if(void 0!==v){const t=v.get(d);if(void 0!==t)return t}const y=i(d).then(t=>{const[e,s]=k(t,_),i=`${e};((a,b)=>{(a[b]=a[b]||[]).push((AudioWorkletProcessor,global,registerProcessor,sampleRate,self,window)=>{${s}\n})})(window,'_AWGS')`;return n(i)}).then(()=>{const t=h._AWGS.pop();if(void 0===t)throw new SyntaxError;s(m.currentTime,m.sampleRate,()=>t(class{},void 0,(t,n)=>{if(""===t.trim())throw e();const s=x.get(m);if(void 0!==s){if(s.has(t))throw e();M(n),O(n.parameterDescriptors),s.set(t,n)}else M(n),O(n.parameterDescriptors),x.set(m,new Map([[t,n]]))},m.sampleRate,void 0,void 0))});return void 0===v?c.set(p,new Map([[d,y]])):v.set(d,y),y.then(()=>{const t=u.get(p);void 0===t?u.set(p,new Set([d])):t.add(d)}).finally(()=>{const t=c.get(p);void 0!==t&&t.delete(d)}),y},I=(t,e)=>{const n=t.get(e);if(void 0===n)throw new Error("A value with the given key could not be found.");return n},D=(t,e)=>{const n=Array.from(t).filter(e);if(n.length>1)throw Error("More than one element was found.");if(0===n.length)throw Error("No element was found.");const[s]=n;return t.delete(s),s},N=(t,e,n,s)=>{const i=I(t,e),r=D(i,t=>t[0]===n&&t[1]===s);return 0===i.size&&t.delete(e),r},R=t=>I(b,t),P=t=>{if(f.has(t))throw new Error("The AudioNode is already stored.");f.add(t),R(t).forEach(t=>t(!0))},V=t=>"port"in t,q=t=>{if(!f.has(t))throw new Error("The AudioNode is not stored.");f.delete(t),R(t).forEach(t=>t(!1))},j=(t,e)=>{!V(t)&&e.every(t=>0===t.size)&&q(t)},F=(t,e,n,s,i,r,o,a,c,u,l,h,p)=>(d,f,m,_,g)=>{const{activeInputs:v,passiveInputs:y}=r(f),{outputs:b}=r(d),w=a(d),x=r=>{const a=c(f),u=c(d);if(r){const e=N(y,d,m,_);t(v,d,e,!1),g||h(d)||n(u,a,m,_),p(f)&&P(f)}else{const t=s(v,d,m,_);e(y,_,t,!1),g||h(d)||i(u,a,m,_);const n=o(f);0===n?l(f)&&j(f,v):setTimeout(()=>{l(f)&&j(f,v)},1e3*n)}};return!!u(b,[f,m,_],t=>t[0]===f&&t[1]===m&&t[2]===_,!0)&&(w.add(x),l(d)?t(v,d,[m,_,x],!0):e(y,_,[d,m,x],!0),!0)},L=t=>(e,n,[s,i,r],o)=>{const a=e.get(s);void 0===a?e.set(s,new Set([[i,n,r]])):t(a,[i,n,r],t=>t[0]===i&&t[1]===n,o)},B=t=>(e,n)=>{const s=t(e,{channelCount:1,channelCountMode:"explicit",channelInterpretation:"discrete",gain:0});n.connect(s).connect(e.destination);const i=()=>{n.removeEventListener("ended",i),n.disconnect(s),s.disconnect()};n.addEventListener("ended",i)},W=t=>(e,n)=>{t(e).add(n)},U={channelCount:2,channelCountMode:"max",channelInterpretation:"speakers",fftSize:2048,maxDecibels:-30,minDecibels:-100,smoothingTimeConstant:.8},z=(t,e,n,s,i,r)=>class extends t{constructor(t,n){const o=i(t),a={...U,...n},c=s(o,a),u=r(o)?e():null;super(t,!1,c,u),this._nativeAnalyserNode=c}get fftSize(){return this._nativeAnalyserNode.fftSize}set fftSize(t){this._nativeAnalyserNode.fftSize=t}get frequencyBinCount(){return this._nativeAnalyserNode.frequencyBinCount}get maxDecibels(){return this._nativeAnalyserNode.maxDecibels}set maxDecibels(t){const e=this._nativeAnalyserNode.maxDecibels;if(this._nativeAnalyserNode.maxDecibels=t,!(t>this._nativeAnalyserNode.minDecibels))throw this._nativeAnalyserNode.maxDecibels=e,n()}get minDecibels(){return this._nativeAnalyserNode.minDecibels}set minDecibels(t){const e=this._nativeAnalyserNode.minDecibels;if(this._nativeAnalyserNode.minDecibels=t,!(this._nativeAnalyserNode.maxDecibels>t))throw this._nativeAnalyserNode.minDecibels=e,n()}get smoothingTimeConstant(){return this._nativeAnalyserNode.smoothingTimeConstant}set smoothingTimeConstant(t){this._nativeAnalyserNode.smoothingTimeConstant=t}getByteFrequencyData(t){this._nativeAnalyserNode.getByteFrequencyData(t)}getByteTimeDomainData(t){this._nativeAnalyserNode.getByteTimeDomainData(t)}getFloatFrequencyData(t){this._nativeAnalyserNode.getFloatFrequencyData(t)}getFloatTimeDomainData(t){this._nativeAnalyserNode.getFloatTimeDomainData(t)}},G=(t,e)=>t.context===e,X=(t,e,n)=>()=>{const s=new WeakMap,i=async(i,r,o)=>{let a=e(i);const c=G(a,r);if(!c){const e={channelCount:a.channelCount,channelCountMode:a.channelCountMode,channelInterpretation:a.channelInterpretation,fftSize:a.fftSize,maxDecibels:a.maxDecibels,minDecibels:a.minDecibels,smoothingTimeConstant:a.smoothingTimeConstant};a=t(r,e)}return s.set(r,a),await n(i,r,a,o),a};return{render(t,e,n){const r=s.get(e);return void 0!==r?Promise.resolve(r):i(t,e,n)}}},Y=t=>{try{t.copyToChannel(new Float32Array(1),0,-1)}catch{return!1}return!0},H=()=>new DOMException("","IndexSizeError"),Z=t=>{t.getChannelData=(e=>n=>{try{return e.call(t,n)}catch(s){if(12===s.code)throw H();throw s}})(t.getChannelData)},$={numberOfChannels:1},K=(t,e,n,s,i,r,o,a)=>{let c=null;return class u{constructor(u){if(null===i)throw new Error("Missing the native OfflineAudioContext constructor.");const{length:l,numberOfChannels:h,sampleRate:p}={...$,...u};null===c&&(c=new i(1,1,44100));const d=null!==s&&e(r,r)?new s({length:l,numberOfChannels:h,sampleRate:p}):c.createBuffer(h,l,p);if(0===d.numberOfChannels)throw n();return"function"!==typeof d.copyFromChannel?(o(d),Z(d)):e(Y,()=>Y(d))||a(d),t.add(d),d}static[Symbol.hasInstance](e){return null!==e&&"object"===typeof e&&Object.getPrototypeOf(e)===u.prototype||t.has(e)}}},Q=-34028234663852886e22,J=-Q,tt=t=>f.has(t),et={buffer:null,channelCount:2,channelCountMode:"max",channelInterpretation:"speakers",loop:!1,loopEnd:0,loopStart:0,playbackRate:1},nt=(t,e,n,s,i,r,o,a)=>class extends t{constructor(t,s){const a=r(t),c={...et,...s},u=i(a,c),l=o(a),h=l?e():null;super(t,!1,u,h),this._audioBufferSourceNodeRenderer=h,this._isBufferNullified=!1,this._isBufferSet=null!==c.buffer,this._nativeAudioBufferSourceNode=u,this._onended=null,this._playbackRate=n(this,l,u.playbackRate,J,Q)}get buffer(){return this._isBufferNullified?null:this._nativeAudioBufferSourceNode.buffer}set buffer(t){if(this._nativeAudioBufferSourceNode.buffer=t,null!==t){if(this._isBufferSet)throw s();this._isBufferSet=!0}}get loop(){return this._nativeAudioBufferSourceNode.loop}set loop(t){this._nativeAudioBufferSourceNode.loop=t}get loopEnd(){return this._nativeAudioBufferSourceNode.loopEnd}set loopEnd(t){this._nativeAudioBufferSourceNode.loopEnd=t}get loopStart(){return this._nativeAudioBufferSourceNode.loopStart}set loopStart(t){this._nativeAudioBufferSourceNode.loopStart=t}get onended(){return this._onended}set onended(t){const e="function"===typeof t?a(this,t):null;this._nativeAudioBufferSourceNode.onended=e;const n=this._nativeAudioBufferSourceNode.onended;this._onended=null!==n&&n===e?t:n}get playbackRate(){return this._playbackRate}start(t=0,e=0,n){if(this._nativeAudioBufferSourceNode.start(t,e,n),null!==this._audioBufferSourceNodeRenderer&&(this._audioBufferSourceNodeRenderer.start=void 0===n?[t,e]:[t,e,n]),"closed"!==this.context.state){P(this);const t=()=>{this._nativeAudioBufferSourceNode.removeEventListener("ended",t),tt(this)&&q(this)};this._nativeAudioBufferSourceNode.addEventListener("ended",t)}}stop(t=0){this._nativeAudioBufferSourceNode.stop(t),null!==this._audioBufferSourceNodeRenderer&&(this._audioBufferSourceNodeRenderer.stop=t)}},st=(t,e,n,s,i)=>()=>{const r=new WeakMap;let o=null,a=null;const c=async(c,u,l)=>{let h=n(c);const p=G(h,u);if(!p){const t={buffer:h.buffer,channelCount:h.channelCount,channelCountMode:h.channelCountMode,channelInterpretation:h.channelInterpretation,loop:h.loop,loopEnd:h.loopEnd,loopStart:h.loopStart,playbackRate:h.playbackRate.value};h=e(u,t),null!==o&&h.start(...o),null!==a&&h.stop(a)}return r.set(u,h),p?await t(u,c.playbackRate,h.playbackRate,l):await s(u,c.playbackRate,h.playbackRate,l),await i(c,u,h,l),h};return{set start(t){o=t},set stop(t){a=t},render(t,e,n){const s=r.get(e);return void 0!==s?Promise.resolve(s):c(t,e,n)}}},it=t=>"playbackRate"in t,rt=t=>"frequency"in t&&"gain"in t,ot=t=>"offset"in t,at=t=>!("frequency"in t)&&"gain"in t,ct=t=>"detune"in t&&"frequency"in t,ut=t=>"pan"in t,lt=t=>I(m,t),ht=t=>I(g,t),pt=(t,e)=>{const{activeInputs:n}=lt(t);n.forEach(n=>n.forEach(([n])=>{e.includes(t)||pt(n,[...e,t])}));const s=it(t)?[t.playbackRate]:V(t)?Array.from(t.parameters.values()):rt(t)?[t.Q,t.detune,t.frequency,t.gain]:ot(t)?[t.offset]:at(t)?[t.gain]:ct(t)?[t.detune,t.frequency]:ut(t)?[t.pan]:[];for(const i of s){const t=ht(i);void 0!==t&&t.activeInputs.forEach(([t])=>pt(t,e))}tt(t)&&q(t)},dt=t=>{pt(t.destination,[])},ft=t=>void 0===t||"number"===typeof t||"string"===typeof t&&("balanced"===t||"interactive"===t||"playback"===t),mt=(t,e,n,s,i,r,o,a,c)=>class extends t{constructor(t={}){if(null===c)throw new Error("Missing the native AudioContext constructor.");const e=new c(t);if(null===e)throw s();if(!ft(t.latencyHint))throw new TypeError(`The provided value '${t.latencyHint}' is not a valid enum value of type AudioContextLatencyCategory.`);if(void 0!==t.sampleRate&&e.sampleRate!==t.sampleRate)throw n();super(e,2);const{latencyHint:i}=t,{sampleRate:r}=e;if(this._baseLatency="number"===typeof e.baseLatency?e.baseLatency:"balanced"===i?512/r:"interactive"===i||void 0===i?256/r:"playback"===i?1024/r:128*Math.max(2,Math.min(128,Math.round(i*r/128)))/r,this._nativeAudioContext=e,"webkitAudioContext"===c.name?(this._nativeGainNode=e.createGain(),this._nativeOscillatorNode=e.createOscillator(),this._nativeGainNode.gain.value=1e-37,this._nativeOscillatorNode.connect(this._nativeGainNode).connect(e.destination),this._nativeOscillatorNode.start()):(this._nativeGainNode=null,this._nativeOscillatorNode=null),this._state=null,"running"===e.state){this._state="suspended";const t=()=>{"suspended"===this._state&&(this._state=null),e.removeEventListener("statechange",t)};e.addEventListener("statechange",t)}}get baseLatency(){return this._baseLatency}get state(){return null!==this._state?this._state:this._nativeAudioContext.state}close(){return"closed"===this.state?this._nativeAudioContext.close().then(()=>{throw e()}):("suspended"===this._state&&(this._state=null),this._nativeAudioContext.close().then(()=>{null!==this._nativeGainNode&&null!==this._nativeOscillatorNode&&(this._nativeOscillatorNode.stop(),this._nativeGainNode.disconnect(),this._nativeOscillatorNode.disconnect()),dt(this)}))}createMediaElementSource(t){return new i(this,{mediaElement:t})}createMediaStreamDestination(){return new r(this)}createMediaStreamSource(t){return new o(this,{mediaStream:t})}createMediaStreamTrackSource(t){return new a(this,{mediaStreamTrack:t})}resume(){return"suspended"===this._state?new Promise((t,e)=>{const n=()=>{this._nativeAudioContext.removeEventListener("statechange",n),"running"===this._nativeAudioContext.state?t():this.resume().then(t,e)};this._nativeAudioContext.addEventListener("statechange",n)}):this._nativeAudioContext.resume().catch(t=>{if(void 0===t||15===t.code)throw e();throw t})}suspend(){return this._nativeAudioContext.suspend().catch(t=>{if(void 0===t)throw e();throw t})}},_t=(t,e,n,s,i,r,o,a)=>class extends t{constructor(t,n){const s=r(t),c=o(s),u=i(s,n,c),l=c?e(a):null;super(t,!1,u,l),this._isNodeOfNativeOfflineAudioContext=c,this._nativeAudioDestinationNode=u}get channelCount(){return this._nativeAudioDestinationNode.channelCount}set channelCount(t){if(this._isNodeOfNativeOfflineAudioContext)throw s();if(t>this._nativeAudioDestinationNode.maxChannelCount)throw n();this._nativeAudioDestinationNode.channelCount=t}get channelCountMode(){return this._nativeAudioDestinationNode.channelCountMode}set channelCountMode(t){if(this._isNodeOfNativeOfflineAudioContext)throw s();this._nativeAudioDestinationNode.channelCountMode=t}get maxChannelCount(){return this._nativeAudioDestinationNode.maxChannelCount}},gt=t=>{let e=null;const n=async(e,n,s)=>{const i=n.destination;return await t(e,n,i,s),i};return{render(t,s,i){return null===e&&(e=n(t,s,i)),e}}},vt=(t,e,n,s,i)=>(r,o)=>{const a=o.listener,c=()=>{const c=e(o,{channelCount:1,channelCountMode:"explicit",channelInterpretation:"speakers",numberOfInputs:9}),u=i(o),l=s(o,256,9,0),h=(e,s)=>{const i=n(o,{channelCount:1,channelCountMode:"explicit",channelInterpretation:"discrete",offset:s});return i.connect(c,0,e),i.start(),Object.defineProperty(i.offset,"defaultValue",{get(){return s}}),t({context:r},u,i.offset,J,Q)};let p=[0,0,-1,0,1,0],d=[0,0,0];return l.onaudioprocess=({inputBuffer:t})=>{const e=[t.getChannelData(0)[0],t.getChannelData(1)[0],t.getChannelData(2)[0],t.getChannelData(3)[0],t.getChannelData(4)[0],t.getChannelData(5)[0]];e.some((t,e)=>t!==p[e])&&(a.setOrientation(...e),p=e);const n=[t.getChannelData(6)[0],t.getChannelData(7)[0],t.getChannelData(8)[0]];n.some((t,e)=>t!==d[e])&&(a.setPosition(...n),d=n)},c.connect(l),{forwardX:h(0,0),forwardY:h(1,0),forwardZ:h(2,-1),positionX:h(6,0),positionY:h(7,0),positionZ:h(8,0),upX:h(3,0),upY:h(4,1),upZ:h(5,0)}},{forwardX:u,forwardY:l,forwardZ:h,positionX:p,positionY:d,positionZ:f,upX:m,upY:_,upZ:g}=void 0===a.forwardX?c():a;return{get forwardX(){return u},get forwardY(){return l},get forwardZ(){return h},get positionX(){return p},get positionY(){return d},get positionZ(){return f},get upX(){return m},get upY(){return _},get upZ(){return g}}},yt=t=>"context"in t,bt=t=>yt(t[0]),wt=(t,e,n,s)=>{for(const i of t)if(n(i)){if(s)return!1;throw Error("The set contains at least one similar element.")}return t.add(e),!0},xt=(t,e,[n,s],i)=>{wt(t,[e,n,s],t=>t[0]===e&&t[1]===n,i)},Tt=(t,[e,n,s],i)=>{const r=t.get(e);void 0===r?t.set(e,new Set([[n,s]])):wt(r,[n,s],t=>t[0]===n,i)},Ct=t=>"inputs"in t,St=(t,e,n,s)=>{if(Ct(e)){const i=e.inputs[s];return t.connect(i,n,0),[i,n,0]}return t.connect(e,n,s),[e,n,s]},At=(t,e,n)=>{for(const s of t)if(s[0]===e&&s[1]===n)return t.delete(s),s;return null},kt=(t,e,n)=>D(t,t=>t[0]===e&&t[1]===n),Ot=(t,e)=>{const n=R(t);if(!n.delete(e))throw new Error("Missing the expected event listener.")},Mt=(t,e,n)=>{const s=I(t,e),i=D(s,t=>t[0]===n);return 0===s.size&&t.delete(e),i},Et=(t,e,n,s)=>{Ct(e)?t.disconnect(e.inputs[s],n,0):t.disconnect(e,n,s)},It=t=>I(_,t),Dt=t=>I(v,t),Nt=t=>w.has(t),Rt=t=>!f.has(t),Pt=t=>new Promise(e=>{const n=t.createScriptProcessor(256,1,1),s=t.createGain(),i=t.createBuffer(1,2,44100),r=i.getChannelData(0);r[0]=1,r[1]=1;const o=t.createBufferSource();o.buffer=i,o.loop=!0,o.connect(n).connect(t.destination),o.connect(s),o.disconnect(s),n.onaudioprocess=s=>{const i=s.inputBuffer.getChannelData(0);Array.prototype.some.call(i,t=>1===t)?e(!0):e(!1),o.stop(),n.onaudioprocess=null,o.disconnect(n),n.disconnect(t.destination)},o.start()}),Vt=(t,e)=>{const n=new Map;for(const s of t)for(const t of s){const e=n.get(t);n.set(t,void 0===e?1:e+1)}n.forEach((t,n)=>e(n,t))},qt=t=>"context"in t,jt=t=>{const e=new Map;t.connect=(t=>(n,s=0,i=0)=>{const r=qt(n)?t(n,s,i):t(n,s),o=e.get(n);return void 0===o?e.set(n,[{input:i,output:s}]):o.every(t=>t.input!==i||t.output!==s)&&o.push({input:i,output:s}),r})(t.connect.bind(t)),t.disconnect=(n=>(s,i,r)=>{if(n.apply(t),void 0===s)e.clear();else if("number"===typeof s)for(const[t,n]of e){const i=n.filter(t=>t.output!==s);0===i.length?e.delete(t):e.set(t,i)}else if(e.has(s))if(void 0===i)e.delete(s);else{const t=e.get(s);if(void 0!==t){const n=t.filter(t=>t.output!==i&&(t.input!==r||void 0===r));0===n.length?e.delete(s):e.set(s,n)}}for(const[n,o]of e)o.forEach(e=>{qt(n)?t.connect(n,e.output,e.input):t.connect(n,e.output)})})(t.disconnect)},Ft=(t,e,n,s)=>{const{activeInputs:i,passiveInputs:r}=ht(e),{outputs:o}=lt(t),a=R(t),c=o=>{const a=It(t),c=Dt(e);if(o){const e=Mt(r,t,n);xt(i,t,e,!1),s||Nt(t)||a.connect(c,n)}else{const e=kt(i,t,n);Tt(r,e,!1),s||Nt(t)||a.disconnect(c,n)}};return!!wt(o,[e,n],t=>t[0]===e&&t[1]===n,!0)&&(a.add(c),tt(t)?xt(i,t,[n,c],!0):Tt(r,[t,n,c],!0),!0)},Lt=(t,e,n,s)=>{const{activeInputs:i,passiveInputs:r}=lt(e),o=At(i[s],t,n);if(null===o){const e=N(r,t,n,s);return[e[2],!1]}return[o[2],!0]},Bt=(t,e,n)=>{const{activeInputs:s,passiveInputs:i}=ht(e),r=At(s,t,n);if(null===r){const e=Mt(i,t,n);return[e[1],!1]}return[r[2],!0]},Wt=(t,e,n,s,i)=>{const[r,o]=Lt(t,n,s,i);if(null!==r&&(Ot(t,r),!o||e||Nt(t)||Et(It(t),It(n),s,i)),tt(n)){const{activeInputs:t}=lt(n);j(n,t)}},Ut=(t,e,n,s)=>{const[i,r]=Bt(t,n,s);null!==i&&(Ot(t,i),!r||e||Nt(t)||It(t).disconnect(Dt(n),s))},zt=(t,e)=>{const n=lt(t),s=[];for(const i of n.outputs)bt(i)?Wt(t,e,...i):Ut(t,e,...i),s.push(i[0]);return n.outputs.clear(),s},Gt=(t,e,n)=>{const s=lt(t),i=[];for(const r of s.outputs)r[1]===n&&(bt(r)?Wt(t,e,...r):Ut(t,e,...r),i.push(r[0]),s.outputs.delete(r));return i},Xt=(t,e,n,s,i)=>{const r=lt(t);return Array.from(r.outputs).filter(t=>t[0]===n&&(void 0===s||t[1]===s)&&(void 0===i||t[2]===i)).map(n=>(bt(n)?Wt(t,e,...n):Ut(t,e,...n),r.outputs.delete(n),n[0]))},Yt=(t,e,n,s,i,r,o,a,c,u,l,h,p,d,f)=>class extends u{constructor(e,s,i,r){super(i),this._context=e,this._nativeAudioNode=i;const o=l(e);h(o)&&!0!==n(Pt,()=>Pt(o))&&jt(i),_.set(this,i),b.set(this,new Set),"closed"!==e.state&&s&&P(this),t(this,r,i)}get channelCount(){return this._nativeAudioNode.channelCount}set channelCount(t){this._nativeAudioNode.channelCount=t}get channelCountMode(){return this._nativeAudioNode.channelCountMode}set channelCountMode(t){this._nativeAudioNode.channelCountMode=t}get channelInterpretation(){return this._nativeAudioNode.channelInterpretation}set channelInterpretation(t){this._nativeAudioNode.channelInterpretation=t}get context(){return this._context}get numberOfInputs(){return this._nativeAudioNode.numberOfInputs}get numberOfOutputs(){return this._nativeAudioNode.numberOfOutputs}connect(t,n=0,a=0){if(n<0||n>=this._nativeAudioNode.numberOfOutputs)throw i();const u=l(this._context),h=f(u);if(p(t)||d(t))throw r();if(yt(t)){const i=It(t);try{const e=St(this._nativeAudioNode,i,n,a),s=Rt(this);(h||s)&&this._nativeAudioNode.disconnect(...e),"closed"!==this.context.state&&!s&&Rt(t)&&P(t)}catch(g){if(12===g.code)throw r();throw g}const o=e(this,t,n,a,h);if(o){const e=c([this],t);Vt(e,s(h))}return t}const m=Dt(t);if("playbackRate"===m.name)throw o();try{this._nativeAudioNode.connect(m,n),(h||Rt(this))&&this._nativeAudioNode.disconnect(m,n)}catch(g){if(12===g.code)throw r();throw g}const _=Ft(this,t,n,h);if(_){const e=c([this],t);Vt(e,s(h))}}disconnect(t,e,n){let s;const o=l(this._context),u=f(o);if(void 0===t)s=zt(this,u);else if("number"===typeof t){if(t<0||t>=this.numberOfOutputs)throw i();s=Gt(this,u,t)}else{if(void 0!==e&&(e<0||e>=this.numberOfOutputs))throw i();if(yt(t)&&void 0!==n&&(n<0||n>=t.numberOfInputs))throw i();if(s=Xt(this,u,t,e,n),0===s.length)throw r()}for(const i of s){const t=c([this],i);Vt(t,a)}}},Ht=(t,e,n,s,i,r,o,a,c,l,h,p)=>(d,f,m,_=null,g=null)=>{const v=new u["AutomationEventList"](m.defaultValue),y=f?s(v):null,b={get defaultValue(){return m.defaultValue},get maxValue(){return null===_?m.maxValue:_},get minValue(){return null===g?m.minValue:g},get value(){return m.value},set value(t){m.value=t,b.setValueAtTime(t,d.context.currentTime)},cancelAndHoldAtTime(t){if("function"===typeof m.cancelAndHoldAtTime)null===y&&v.flush(d.context.currentTime),v.add(i(t)),m.cancelAndHoldAtTime(t);else{const e=Array.from(v).pop();null===y&&v.flush(d.context.currentTime),v.add(i(t));const n=Array.from(v).pop();m.cancelScheduledValues(t),e!==n&&void 0!==n&&("exponentialRampToValue"===n.type?m.exponentialRampToValueAtTime(n.value,n.endTime):"linearRampToValue"===n.type?m.linearRampToValueAtTime(n.value,n.endTime):"setValue"===n.type?m.setValueAtTime(n.value,n.startTime):"setValueCurve"===n.type&&m.setValueCurveAtTime(n.values,n.startTime,n.duration))}return b},cancelScheduledValues(t){return null===y&&v.flush(d.context.currentTime),v.add(r(t)),m.cancelScheduledValues(t),b},exponentialRampToValueAtTime(t,e){if(0===t)throw new RangeError;if(!Number.isFinite(e)||e<0)throw new RangeError;return null===y&&v.flush(d.context.currentTime),v.add(o(t,e)),m.exponentialRampToValueAtTime(t,e),b},linearRampToValueAtTime(t,e){return null===y&&v.flush(d.context.currentTime),v.add(a(t,e)),m.linearRampToValueAtTime(t,e),b},setTargetAtTime(t,e,n){return null===y&&v.flush(d.context.currentTime),v.add(c(t,e,n)),m.setTargetAtTime(t,e,n),b},setValueAtTime(t,e){return null===y&&v.flush(d.context.currentTime),v.add(l(t,e)),m.setValueAtTime(t,e),b},setValueCurveAtTime(t,e,n){const s=t instanceof Float32Array?t:new Float32Array(t);if(null!==p&&"webkitAudioContext"===p.name){const t=e+n,i=d.context.sampleRate,r=Math.ceil(e*i),o=Math.floor(t*i),a=o-r,c=new Float32Array(a);for(let l=0;l<a;l+=1){const t=(s.length-1)/n*((r+l)/i-e),o=Math.floor(t),a=Math.ceil(t);c[l]=o===a?s[o]:(1-(t-o))*s[o]+(1-(a-t))*s[a]}null===y&&v.flush(d.context.currentTime),v.add(h(c,e,n)),m.setValueCurveAtTime(c,e,n);const u=o/i;u<t&&b.setValueAtTime(c[c.length-1],u),b.setValueAtTime(s[s.length-1],t)}else null===y&&v.flush(d.context.currentTime),v.add(h(s,e,n)),m.setValueCurveAtTime(s,e,n);return b}};return n.set(b,m),e.set(b,d),t(b,y),b},Zt=t=>({replay(e){for(const n of t)if("exponentialRampToValue"===n.type){const{endTime:t,value:s}=n;e.exponentialRampToValueAtTime(s,t)}else if("linearRampToValue"===n.type){const{endTime:t,value:s}=n;e.linearRampToValueAtTime(s,t)}else if("setTarget"===n.type){const{startTime:t,target:s,timeConstant:i}=n;e.setTargetAtTime(s,t,i)}else if("setValue"===n.type){const{startTime:t,value:s}=n;e.setValueAtTime(s,t)}else{if("setValueCurve"!==n.type)throw new Error("Can't apply an unknown automation.");{const{duration:t,startTime:s,values:i}=n;e.setValueCurveAtTime(i,s,t)}}}});class $t{constructor(t){this._map=new Map(t)}get size(){return this._map.size}entries(){return this._map.entries()}forEach(t,e=null){return this._map.forEach((n,s)=>t.call(e,n,s,this))}get(t){return this._map.get(t)}has(t){return this._map.has(t)}keys(){return this._map.keys()}values(){return this._map.values()}}const Kt={channelCount:2,channelCountMode:"explicit",channelInterpretation:"speakers",numberOfInputs:1,numberOfOutputs:1,parameterData:{},processorOptions:{}},Qt=(t,e,n,s,i,r,o,a,c,u,l,h,p)=>class extends e{constructor(e,p,d){var f;const m=a(e),_=c(m),g=l({...Kt,...d}),v=x.get(m),y=null===v||void 0===v?void 0:v.get(p),b=_||"closed"!==m.state?m:null!==(f=o(m))&&void 0!==f?f:m,w=i(b,_?null:e.baseLatency,u,p,y,g),T=_?s(p,g,y):null;super(e,!0,w,T);const C=[];w.parameters.forEach((t,e)=>{const s=n(this,_,t);C.push([e,s])}),this._nativeAudioWorkletNode=w,this._onprocessorerror=null,this._parameters=new $t(C),_&&t(m,this);const{activeInputs:S}=r(this);h(w,S)}get onprocessorerror(){return this._onprocessorerror}set onprocessorerror(t){const e="function"===typeof t?p(this,t):null;this._nativeAudioWorkletNode.onprocessorerror=e;const n=this._nativeAudioWorkletNode.onprocessorerror;this._onprocessorerror=null!==n&&n===e?t:n}get parameters(){return null===this._parameters?this._nativeAudioWorkletNode.parameters:this._parameters}get port(){return this._nativeAudioWorkletNode.port}};function Jt(t,e,n,s,i){if("function"===typeof t.copyFromChannel)0===e[n].byteLength&&(e[n]=new Float32Array(128)),t.copyFromChannel(e[n],s,i);else{const r=t.getChannelData(s);if(0===e[n].byteLength)e[n]=r.slice(i,i+128);else{const t=new Float32Array(r.buffer,i*Float32Array.BYTES_PER_ELEMENT,128);e[n].set(t)}}}const te=(t,e,n,s,i)=>{"function"===typeof t.copyToChannel?0!==e[n].byteLength&&t.copyToChannel(e[n],s,i):0!==e[n].byteLength&&t.getChannelData(s).set(e[n],i)},ee=(t,e)=>{const n=[];for(let s=0;s<t;s+=1){const t=[],i="number"===typeof e?e:e[s];for(let e=0;e<i;e+=1)t.push(new Float32Array(128));n.push(t)}return n},ne=(t,e)=>{const n=I(T,t),s=It(e);return I(n,s)},se=async(t,e,n,s,i,r,o)=>{const a=null===e?128*Math.ceil(t.context.length/128):e.length,c=s.channelCount*s.numberOfInputs,u=i.reduce((t,e)=>t+e,0),l=0===u?null:n.createBuffer(u,a,n.sampleRate);if(void 0===r)throw new Error("Missing the processor constructor.");const h=lt(t),p=await ne(n,t),d=ee(s.numberOfInputs,s.channelCount),f=ee(s.numberOfOutputs,i),m=Array.from(t.parameters.keys()).reduce((t,e)=>({...t,[e]:new Float32Array(128)}),{});for(let g=0;g<a;g+=128){if(s.numberOfInputs>0&&null!==e)for(let t=0;t<s.numberOfInputs;t+=1)for(let n=0;n<s.channelCount;n+=1)Jt(e,d[t],n,n,g);void 0!==r.parameterDescriptors&&null!==e&&r.parameterDescriptors.forEach(({name:t},n)=>{Jt(e,m,t,c+n,g)});for(let t=0;t<s.numberOfInputs;t+=1)for(let e=0;e<i[t];e+=1)0===f[t][e].byteLength&&(f[t][e]=new Float32Array(128));try{const t=d.map((t,e)=>0===h.activeInputs[e].size?[]:t),e=o(g/n.sampleRate,n.sampleRate,()=>p.process(t,f,m));if(null!==l)for(let n=0,r=0;n<s.numberOfOutputs;n+=1){for(let t=0;t<i[n];t+=1)te(l,f[n],t,r+t,g);r+=i[n]}if(!e)break}catch(_){t.dispatchEvent(new ErrorEvent("processorerror",{colno:_.colno,filename:_.filename,lineno:_.lineno,message:_.message}));break}}return l},ie=(t,e,n,s,i,r,o,a,c,u,l,h,p,d,f,m)=>(_,g,v)=>{const y=new WeakMap;let b=null;const w=async(a,w,x)=>{let T=l(a),C=null;const S=G(T,w),A=Array.isArray(g.outputChannelCount)?g.outputChannelCount:Array.from(g.outputChannelCount);if(null===h){const t=A.reduce((t,e)=>t+e,0),n=i(w,{channelCount:Math.max(1,t),channelCountMode:"explicit",channelInterpretation:"discrete",numberOfOutputs:Math.max(1,t)}),r=[];for(let e=0;e<a.numberOfOutputs;e+=1)r.push(s(w,{channelCount:1,channelCountMode:"explicit",channelInterpretation:"speakers",numberOfInputs:A[e]}));const u=o(w,{channelCount:g.channelCount,channelCountMode:g.channelCountMode,channelInterpretation:g.channelInterpretation,gain:1});u.connect=e.bind(null,r),u.disconnect=c.bind(null,r),C=[n,r,u]}else S||(T=new h(w,_));if(y.set(w,null===C?T:C[2]),null!==C){if(null===b){if(void 0===v)throw new Error("Missing the processor constructor.");if(null===p)throw new Error("Missing the native OfflineAudioContext constructor.");const t=a.channelCount*a.numberOfInputs,e=void 0===v.parameterDescriptors?0:v.parameterDescriptors.length,n=t+e,c=async()=>{const c=new p(n,128*Math.ceil(a.context.length/128),w.sampleRate),u=[],l=[];for(let t=0;t<g.numberOfInputs;t+=1)u.push(o(c,{channelCount:g.channelCount,channelCountMode:g.channelCountMode,channelInterpretation:g.channelInterpretation,gain:1})),l.push(i(c,{channelCount:g.channelCount,channelCountMode:"explicit",channelInterpretation:"discrete",numberOfOutputs:g.channelCount}));const h=await Promise.all(Array.from(a.parameters.values()).map(async t=>{const e=r(c,{channelCount:1,channelCountMode:"explicit",channelInterpretation:"discrete",offset:t.value});return await d(c,t,e.offset,x),e})),_=s(c,{channelCount:1,channelCountMode:"explicit",channelInterpretation:"speakers",numberOfInputs:Math.max(1,t+e)});for(let t=0;t<g.numberOfInputs;t+=1){u[t].connect(l[t]);for(let e=0;e<g.channelCount;e+=1)l[t].connect(_,e,t*g.channelCount+e)}for(const[e,n]of h.entries())n.connect(_,0,t+e),n.start(0);return _.connect(c.destination),await Promise.all(u.map(t=>f(a,c,t,x))),m(c)};b=se(a,0===n?null:await c(),w,g,A,v,u)}const t=await b,e=n(w,{buffer:null,channelCount:2,channelCountMode:"max",channelInterpretation:"speakers",loop:!1,loopEnd:0,loopStart:0,playbackRate:1}),[c,l,h]=C;null!==t&&(e.buffer=t,e.start(0)),e.connect(c);for(let n=0,s=0;n<a.numberOfOutputs;n+=1){const t=l[n];for(let e=0;e<A[n];e+=1)c.connect(t,s+e,e);s+=A[n]}return h}if(S)for(const[e,n]of a.parameters.entries())await t(w,n,T.parameters.get(e),x);else for(const[t,e]of a.parameters.entries())await d(w,e,T.parameters.get(t),x);return await f(a,w,T,x),T};return{render(t,e,n){a(e,t);const s=y.get(e);return void 0!==s?Promise.resolve(s):w(t,e,n)}}},re=(t,e,n,s,i,r,o,a,c,u,l,h,p,d,f,m,_,g,v,y)=>class extends f{constructor(e,n){super(e,n),this._nativeContext=e,this._audioWorklet=void 0===t?void 0:{addModule:(e,n)=>t(this,e,n)}}get audioWorklet(){return this._audioWorklet}createAnalyser(){return new e(this)}createBiquadFilter(){return new i(this)}createBuffer(t,e,s){return new n({length:e,numberOfChannels:t,sampleRate:s})}createBufferSource(){return new s(this)}createChannelMerger(t=6){return new r(this,{numberOfInputs:t})}createChannelSplitter(t=6){return new o(this,{numberOfOutputs:t})}createConstantSource(){return new a(this)}createConvolver(){return new c(this)}createDelay(t=1){return new l(this,{maxDelayTime:t})}createDynamicsCompressor(){return new h(this)}createGain(){return new p(this)}createIIRFilter(t,e){return new d(this,{feedback:e,feedforward:t})}createOscillator(){return new m(this)}createPanner(){return new _(this)}createPeriodicWave(t,e,n={disableNormalization:!1}){return new g(this,{...n,imag:e,real:t})}createStereoPanner(){return new v(this)}createWaveShaper(){return new y(this)}decodeAudioData(t,e,n){return u(this._nativeContext,t).then(t=>("function"===typeof e&&e(t),t)).catch(t=>{throw"function"===typeof n&&n(t),t})}},oe={Q:1,channelCount:2,channelCountMode:"max",channelInterpretation:"speakers",detune:0,frequency:350,gain:0,type:"lowpass"},ae=(t,e,n,s,i,r,o,a)=>class extends t{constructor(t,s){const c=r(t),u={...oe,...s},l=i(c,u),h=o(c),p=h?n():null;super(t,!1,l,p),this._Q=e(this,h,l.Q,J,Q),this._detune=e(this,h,l.detune,1200*Math.log2(J),-1200*Math.log2(J)),this._frequency=e(this,h,l.frequency,t.sampleRate/2,0),this._gain=e(this,h,l.gain,40*Math.log10(J),Q),this._nativeBiquadFilterNode=l,a(this,1)}get detune(){return this._detune}get frequency(){return this._frequency}get gain(){return this._gain}get Q(){return this._Q}get type(){return this._nativeBiquadFilterNode.type}set type(t){this._nativeBiquadFilterNode.type=t}getFrequencyResponse(t,e,n){if(this._nativeBiquadFilterNode.getFrequencyResponse(t,e,n),t.length!==e.length||e.length!==n.length)throw s()}},ce=(t,e,n,s,i)=>()=>{const r=new WeakMap,o=async(o,a,c)=>{let u=n(o);const l=G(u,a);if(!l){const t={Q:u.Q.value,channelCount:u.channelCount,channelCountMode:u.channelCountMode,channelInterpretation:u.channelInterpretation,detune:u.detune.value,frequency:u.frequency.value,gain:u.gain.value,type:u.type};u=e(a,t)}return r.set(a,u),l?(await t(a,o.Q,u.Q,c),await t(a,o.detune,u.detune,c),await t(a,o.frequency,u.frequency,c),await t(a,o.gain,u.gain,c)):(await s(a,o.Q,u.Q,c),await s(a,o.detune,u.detune,c),await s(a,o.frequency,u.frequency,c),await s(a,o.gain,u.gain,c)),await i(o,a,u,c),u};return{render(t,e,n){const s=r.get(e);return void 0!==s?Promise.resolve(s):o(t,e,n)}}},ue=(t,e)=>(n,s)=>{const i=e.get(n);if(void 0!==i)return i;const r=t.get(n);if(void 0!==r)return r;try{const i=s();return i instanceof Promise?(t.set(n,i),i.catch(()=>!1).then(s=>(t.delete(n),e.set(n,s),s))):(e.set(n,i),i)}catch{return e.set(n,!1),!1}},le={channelCount:1,channelCountMode:"explicit",channelInterpretation:"speakers",numberOfInputs:6},he=(t,e,n,s,i)=>class extends t{constructor(t,r){const o=s(t),a={...le,...r},c=n(o,a),u=i(o)?e():null;super(t,!1,c,u)}},pe=(t,e,n)=>()=>{const s=new WeakMap,i=async(i,r,o)=>{let a=e(i);const c=G(a,r);if(!c){const e={channelCount:a.channelCount,channelCountMode:a.channelCountMode,channelInterpretation:a.channelInterpretation,numberOfInputs:a.numberOfInputs};a=t(r,e)}return s.set(r,a),await n(i,r,a,o),a};return{render(t,e,n){const r=s.get(e);return void 0!==r?Promise.resolve(r):i(t,e,n)}}},de={channelCount:6,channelCountMode:"explicit",channelInterpretation:"discrete",numberOfOutputs:6},fe=(t,e,n,s,i,r)=>class extends t{constructor(t,o){const a=s(t),c=r({...de,...o}),u=n(a,c),l=i(a)?e():null;super(t,!1,u,l)}},me=(t,e,n)=>()=>{const s=new WeakMap,i=async(i,r,o)=>{let a=e(i);const c=G(a,r);if(!c){const e={channelCount:a.channelCount,channelCountMode:a.channelCountMode,channelInterpretation:a.channelInterpretation,numberOfOutputs:a.numberOfOutputs};a=t(r,e)}return s.set(r,a),await n(i,r,a,o),a};return{render(t,e,n){const r=s.get(e);return void 0!==r?Promise.resolve(r):i(t,e,n)}}},_e=t=>(e,n,s,i)=>t(n,e,s,i),ge=t=>(e,n,s=0,i=0)=>{const r=e[s];if(void 0===r)throw t();return qt(n)?r.connect(n,0,i):r.connect(n,0)},ve=t=>(e,n)=>{const s=t(e,{buffer:null,channelCount:2,channelCountMode:"max",channelInterpretation:"speakers",loop:!1,loopEnd:0,loopStart:0,playbackRate:1}),i=e.createBuffer(1,2,44100);return s.buffer=i,s.loop=!0,s.connect(n),s.start(),()=>{s.stop(),s.disconnect(n)}},ye={channelCount:2,channelCountMode:"max",channelInterpretation:"speakers",offset:1},be=(t,e,n,s,i,r,o)=>class extends t{constructor(t,o){const a=i(t),c={...ye,...o},u=s(a,c),l=r(a),h=l?n():null;super(t,!1,u,h),this._constantSourceNodeRenderer=h,this._nativeConstantSourceNode=u,this._offset=e(this,l,u.offset,J,Q),this._onended=null}get offset(){return this._offset}get onended(){return this._onended}set onended(t){const e="function"===typeof t?o(this,t):null;this._nativeConstantSourceNode.onended=e;const n=this._nativeConstantSourceNode.onended;this._onended=null!==n&&n===e?t:n}start(t=0){if(this._nativeConstantSourceNode.start(t),null!==this._constantSourceNodeRenderer&&(this._constantSourceNodeRenderer.start=t),"closed"!==this.context.state){P(this);const t=()=>{this._nativeConstantSourceNode.removeEventListener("ended",t),tt(this)&&q(this)};this._nativeConstantSourceNode.addEventListener("ended",t)}}stop(t=0){this._nativeConstantSourceNode.stop(t),null!==this._constantSourceNodeRenderer&&(this._constantSourceNodeRenderer.stop=t)}},we=(t,e,n,s,i)=>()=>{const r=new WeakMap;let o=null,a=null;const c=async(c,u,l)=>{let h=n(c);const p=G(h,u);if(!p){const t={channelCount:h.channelCount,channelCountMode:h.channelCountMode,channelInterpretation:h.channelInterpretation,offset:h.offset.value};h=e(u,t),null!==o&&h.start(o),null!==a&&h.stop(a)}return r.set(u,h),p?await t(u,c.offset,h.offset,l):await s(u,c.offset,h.offset,l),await i(c,u,h,l),h};return{set start(t){o=t},set stop(t){a=t},render(t,e,n){const s=r.get(e);return void 0!==s?Promise.resolve(s):c(t,e,n)}}},xe=t=>e=>(t[0]=e,t[0]),Te={buffer:null,channelCount:2,channelCountMode:"clamped-max",channelInterpretation:"speakers",disableNormalization:!1},Ce=(t,e,n,s,i,r)=>class extends t{constructor(t,o){const a=s(t),c={...Te,...o},u=n(a,c),l=i(a),h=l?e():null;super(t,!1,u,h),this._isBufferNullified=!1,this._nativeConvolverNode=u,null!==c.buffer&&r(this,c.buffer.duration)}get buffer(){return this._isBufferNullified?null:this._nativeConvolverNode.buffer}set buffer(t){if(this._nativeConvolverNode.buffer=t,null===t&&null!==this._nativeConvolverNode.buffer){const t=this._nativeConvolverNode.context;this._nativeConvolverNode.buffer=t.createBuffer(1,1,44100),this._isBufferNullified=!0,r(this,0)}else this._isBufferNullified=!1,r(this,null===this._nativeConvolverNode.buffer?0:this._nativeConvolverNode.buffer.duration)}get normalize(){return this._nativeConvolverNode.normalize}set normalize(t){this._nativeConvolverNode.normalize=t}},Se=(t,e,n)=>()=>{const s=new WeakMap,i=async(i,r,o)=>{let a=e(i);const c=G(a,r);if(!c){const e={buffer:a.buffer,channelCount:a.channelCount,channelCountMode:a.channelCountMode,channelInterpretation:a.channelInterpretation,disableNormalization:!a.normalize};a=t(r,e)}return s.set(r,a),Ct(a)?await n(i,r,a.inputs[0],o):await n(i,r,a,o),a};return{render(t,e,n){const r=s.get(e);return void 0!==r?Promise.resolve(r):i(t,e,n)}}},Ae=(t,e)=>(n,s,i)=>{if(null===e)throw new Error("Missing the native OfflineAudioContext constructor.");try{return new e(n,s,i)}catch(r){if("SyntaxError"===r.name)throw t();throw r}},ke=()=>new DOMException("","DataCloneError"),Oe=t=>{const{port1:e}=new MessageChannel;e.postMessage(t,[t])},Me=(t,e,n,s,i,r,o,a,c,u,l)=>(h,p)=>{const d=o(h)?h:r(h);if(i.has(p)){const t=n();return Promise.reject(t)}try{i.add(p)}catch{}return e(c,()=>c(d))?d.decodeAudioData(p).then(n=>(e(a,()=>a(n))||l(n),t.add(n),n)):new Promise((e,n)=>{const i=()=>{try{Oe(p)}catch{}},r=t=>{n(t),i()};try{d.decodeAudioData(p,n=>{"function"!==typeof n.copyFromChannel&&(u(n),Z(n)),t.add(n),i(),e(n)},t=>{r(null===t?s():t)})}catch(o){r(o)}})},Ee=(t,e,n,s,i,r,o,a)=>(c,u)=>{const l=e.get(c);if(void 0===l)throw new Error("Missing the expected cycle count.");const h=r(c.context),p=a(h);if(l===u){if(e.delete(c),!p&&o(c)){const e=s(c),{outputs:r}=n(c);for(const n of r)if(bt(n)){const i=s(n[0]);t(e,i,n[1],n[2])}else{const t=i(n[0]);e.connect(t,n[1])}}}else e.set(c,l-u)},Ie={channelCount:2,channelCountMode:"max",channelInterpretation:"speakers",delayTime:0,maxDelayTime:1},De=(t,e,n,s,i,r,o)=>class extends t{constructor(t,a){const c=i(t),u={...Ie,...a},l=s(c,u),h=r(c),p=h?n(u.maxDelayTime):null;super(t,!1,l,p),this._delayTime=e(this,h,l.delayTime),o(this,u.maxDelayTime)}get delayTime(){return this._delayTime}},Ne=(t,e,n,s,i)=>r=>{const o=new WeakMap,a=async(a,c,u)=>{let l=n(a);const h=G(l,c);if(!h){const t={channelCount:l.channelCount,channelCountMode:l.channelCountMode,channelInterpretation:l.channelInterpretation,delayTime:l.delayTime.value,maxDelayTime:r};l=e(c,t)}return o.set(c,l),h?await t(c,a.delayTime,l.delayTime,u):await s(c,a.delayTime,l.delayTime,u),await i(a,c,l,u),l};return{render(t,e,n){const s=o.get(e);return void 0!==s?Promise.resolve(s):a(t,e,n)}}},Re=t=>(e,n,s,i)=>t(e[i],t=>t[0]===n&&t[1]===s),Pe=t=>(e,n)=>{t(e).delete(n)},Ve=t=>"delayTime"in t,qe=(t,e,n)=>function s(i,r){const o=yt(r)?r:n(t,r);if(Ve(o))return[];if(i[0]===o)return[i];if(i.includes(o))return[];const{outputs:a}=e(o);return Array.from(a).map(t=>s([...i,o],t[0])).reduce((t,e)=>t.concat(e),[])},je=(t,e,n)=>{const s=e[n];if(void 0===s)throw t();return s},Fe=t=>(e,n,s,i=0)=>void 0===n?e.forEach(t=>t.disconnect()):"number"===typeof n?je(t,e,n).disconnect():qt(n)?void 0===s?e.forEach(t=>t.disconnect(n)):void 0===i?je(t,e,s).disconnect(n,0):je(t,e,s).disconnect(n,0,i):void 0===s?e.forEach(t=>t.disconnect(n)):je(t,e,s).disconnect(n,0),Le={attack:.003,channelCount:2,channelCountMode:"clamped-max",channelInterpretation:"speakers",knee:30,ratio:12,release:.25,threshold:-24},Be=(t,e,n,s,i,r,o,a)=>class extends t{constructor(t,i){const c=r(t),u={...Le,...i},l=s(c,u),h=o(c),p=h?n():null;super(t,!1,l,p),this._attack=e(this,h,l.attack),this._knee=e(this,h,l.knee),this._nativeDynamicsCompressorNode=l,this._ratio=e(this,h,l.ratio),this._release=e(this,h,l.release),this._threshold=e(this,h,l.threshold),a(this,.006)}get attack(){return this._attack}get channelCount(){return this._nativeDynamicsCompressorNode.channelCount}set channelCount(t){const e=this._nativeDynamicsCompressorNode.channelCount;if(this._nativeDynamicsCompressorNode.channelCount=t,t>2)throw this._nativeDynamicsCompressorNode.channelCount=e,i()}get channelCountMode(){return this._nativeDynamicsCompressorNode.channelCountMode}set channelCountMode(t){const e=this._nativeDynamicsCompressorNode.channelCountMode;if(this._nativeDynamicsCompressorNode.channelCountMode=t,"max"===t)throw this._nativeDynamicsCompressorNode.channelCountMode=e,i()}get knee(){return this._knee}get ratio(){return this._ratio}get reduction(){return"number"===typeof this._nativeDynamicsCompressorNode.reduction.value?this._nativeDynamicsCompressorNode.reduction.value:this._nativeDynamicsCompressorNode.reduction}get release(){return this._release}get threshold(){return this._threshold}},We=(t,e,n,s,i)=>()=>{const r=new WeakMap,o=async(o,a,c)=>{let u=n(o);const l=G(u,a);if(!l){const t={attack:u.attack.value,channelCount:u.channelCount,channelCountMode:u.channelCountMode,channelInterpretation:u.channelInterpretation,knee:u.knee.value,ratio:u.ratio.value,release:u.release.value,threshold:u.threshold.value};u=e(a,t)}return r.set(a,u),l?(await t(a,o.attack,u.attack,c),await t(a,o.knee,u.knee,c),await t(a,o.ratio,u.ratio,c),await t(a,o.release,u.release,c),await t(a,o.threshold,u.threshold,c)):(await s(a,o.attack,u.attack,c),await s(a,o.knee,u.knee,c),await s(a,o.ratio,u.ratio,c),await s(a,o.release,u.release,c),await s(a,o.threshold,u.threshold,c)),await i(o,a,u,c),u};return{render(t,e,n){const s=r.get(e);return void 0!==s?Promise.resolve(s):o(t,e,n)}}},Ue=()=>new DOMException("","EncodingError"),ze=t=>e=>new Promise((n,s)=>{if(null===t)return void s(new SyntaxError);const i=t.document.head;if(null===i)s(new SyntaxError);else{const r=t.document.createElement("script"),o=new Blob([e],{type:"application/javascript"}),a=URL.createObjectURL(o),c=t.onerror,u=()=>{t.onerror=c,URL.revokeObjectURL(a)};t.onerror=(e,n,i,r,o)=>n===a||n===t.location.href&&1===i&&1===r?(u(),s(o),!1):null!==c?c(e,n,i,r,o):void 0,r.onerror=()=>{u(),s(new SyntaxError)},r.onload=()=>{u(),n()},r.src=a,r.type="module",i.appendChild(r)}}),Ge=t=>class{constructor(t){this._nativeEventTarget=t,this._listeners=new WeakMap}addEventListener(e,n,s){if(null!==n){let i=this._listeners.get(n);void 0===i&&(i=t(this,n),"function"===typeof n&&this._listeners.set(n,i)),this._nativeEventTarget.addEventListener(e,i,s)}}dispatchEvent(t){return this._nativeEventTarget.dispatchEvent(t)}removeEventListener(t,e,n){const s=null===e?void 0:this._listeners.get(e);this._nativeEventTarget.removeEventListener(t,void 0===s?null:s,n)}},Xe=t=>(e,n,s)=>{Object.defineProperties(t,{currentFrame:{configurable:!0,get(){return Math.round(e*n)}},currentTime:{configurable:!0,get(){return e}}});try{return s()}finally{null!==t&&(delete t.currentFrame,delete t.currentTime)}},Ye=t=>async e=>{try{const t=await fetch(e);if(t.ok)return t.text()}catch{}throw t()},He={channelCount:2,channelCountMode:"max",channelInterpretation:"speakers",gain:1},Ze=(t,e,n,s,i,r)=>class extends t{constructor(t,o){const a=i(t),c={...He,...o},u=s(a,c),l=r(a),h=l?n():null;super(t,!1,u,h),this._gain=e(this,l,u.gain,J,Q)}get gain(){return this._gain}},$e=(t,e,n,s,i)=>()=>{const r=new WeakMap,o=async(o,a,c)=>{let u=n(o);const l=G(u,a);if(!l){const t={channelCount:u.channelCount,channelCountMode:u.channelCountMode,channelInterpretation:u.channelInterpretation,gain:u.gain.value};u=e(a,t)}return r.set(a,u),l?await t(a,o.gain,u.gain,c):await s(a,o.gain,u.gain,c),await i(o,a,u,c),u};return{render(t,e,n){const s=r.get(e);return void 0!==s?Promise.resolve(s):o(t,e,n)}}},Ke=(t,e)=>n=>e(t,n),Qe=t=>e=>{const n=t(e);if(null===n.renderer)throw new Error("Missing the renderer of the given AudioNode in the audio graph.");return n.renderer},Je=t=>e=>{var n;return null!==(n=t.get(e))&&void 0!==n?n:0},tn=t=>e=>{const n=t(e);if(null===n.renderer)throw new Error("Missing the renderer of the given AudioParam in the audio graph.");return n.renderer},en=t=>e=>t.get(e),nn=()=>new DOMException("","InvalidStateError"),sn=t=>e=>{const n=t.get(e);if(void 0===n)throw nn();return n},rn=(t,e)=>n=>{let s=t.get(n);if(void 0!==s)return s;if(null===e)throw new Error("Missing the native OfflineAudioContext constructor.");return s=new e(1,1,8e3),t.set(n,s),s},on=t=>e=>{const n=t.get(e);if(void 0===n)throw new Error("The context has no set of AudioWorkletNodes.");return n},an=()=>new DOMException("","InvalidAccessError"),cn=t=>{t.getFrequencyResponse=(e=>(n,s,i)=>{if(n.length!==s.length||s.length!==i.length)throw an();return e.call(t,n,s,i)})(t.getFrequencyResponse)},un={channelCount:2,channelCountMode:"max",channelInterpretation:"speakers"},ln=(t,e,n,s,i,r)=>class extends t{constructor(t,o){const a=s(t),c=i(a),u={...un,...o},l=e(a,c?null:t.baseLatency,u),h=c?n(u.feedback,u.feedforward):null;super(t,!1,l,h),cn(l),this._nativeIIRFilterNode=l,r(this,1)}getFrequencyResponse(t,e,n){return this._nativeIIRFilterNode.getFrequencyResponse(t,e,n)}},hn=(t,e,n,s,i,r,o,a,c,u,l)=>{const h=u.length;let p=a;for(let d=0;d<h;d+=1){let a=n[0]*u[d];for(let e=1;e<i;e+=1){const s=p-e&c-1;a+=n[e]*r[s],a-=t[e]*o[s]}for(let t=i;t<s;t+=1)a+=n[t]*r[p-t&c-1];for(let n=i;n<e;n+=1)a-=t[n]*o[p-n&c-1];r[p]=u[d],o[p]=a,p=p+1&c-1,l[d]=a}return p},pn=(t,e,n,s)=>{const i=n instanceof Float64Array?n:new Float64Array(n),r=s instanceof Float64Array?s:new Float64Array(s),o=i.length,a=r.length,c=Math.min(o,a);if(1!==i[0]){for(let t=0;t<o;t+=1)r[t]/=i[0];for(let t=1;t<a;t+=1)i[t]/=i[0]}const u=32,l=new Float32Array(u),h=new Float32Array(u),p=e.createBuffer(t.numberOfChannels,t.length,t.sampleRate),d=t.numberOfChannels;for(let f=0;f<d;f+=1){const e=t.getChannelData(f),n=p.getChannelData(f);l.fill(0),h.fill(0),hn(i,o,r,a,c,l,h,0,u,e,n)}return p},dn=(t,e,n,s,i)=>(r,o)=>{const a=new WeakMap;let c=null;const u=async(u,l,h)=>{let p=null,d=e(u);const f=G(d,l);if(void 0===l.createIIRFilter?p=t(l,{buffer:null,channelCount:2,channelCountMode:"max",channelInterpretation:"speakers",loop:!1,loopEnd:0,loopStart:0,playbackRate:1}):f||(d=l.createIIRFilter(o,r)),a.set(l,null===p?d:p),null!==p){if(null===c){if(null===n)throw new Error("Missing the native OfflineAudioContext constructor.");const t=new n(u.context.destination.channelCount,u.context.length,l.sampleRate);c=(async()=>{await s(u,t,t.destination,h);const e=await i(t);return pn(e,l,r,o)})()}const t=await c;return p.buffer=t,p.start(0),p}return await s(u,l,d,h),d};return{render(t,e,n){const s=a.get(e);return void 0!==s?Promise.resolve(s):u(t,e,n)}}},fn=(t,e,n,s,i,r)=>o=>(a,c)=>{const u=t.get(a);if(void 0===u){if(!o&&r(a)){const t=s(a),{outputs:r}=n(a);for(const n of r)if(bt(n)){const i=s(n[0]);e(t,i,n[1],n[2])}else{const e=i(n[0]);t.disconnect(e,n[1])}}t.set(a,c)}else t.set(a,u+c)},mn=(t,e)=>n=>{const s=t.get(n);return e(s)||e(n)},_n=(t,e)=>n=>t.has(n)||e(n),gn=(t,e)=>n=>t.has(n)||e(n),vn=(t,e)=>n=>{const s=t.get(n);return e(s)||e(n)},yn=t=>e=>null!==t&&e instanceof t,bn=t=>e=>null!==t&&"function"===typeof t.AudioNode&&e instanceof t.AudioNode,wn=t=>e=>null!==t&&"function"===typeof t.AudioParam&&e instanceof t.AudioParam,xn=(t,e)=>n=>t(n)||e(n),Tn=t=>e=>null!==t&&e instanceof t,Cn=t=>null!==t&&t.isSecureContext,Sn=(t,e,n,s)=>class extends t{constructor(t,i){const r=n(t),o=e(r,i);if(s(r))throw TypeError();super(t,!0,o,null),this._nativeMediaElementAudioSourceNode=o}get mediaElement(){return this._nativeMediaElementAudioSourceNode.mediaElement}},An={channelCount:2,channelCountMode:"explicit",channelInterpretation:"speakers"},kn=(t,e,n,s)=>class extends t{constructor(t,i){const r=n(t);if(s(r))throw new TypeError;const o={...An,...i},a=e(r,o);super(t,!1,a,null),this._nativeMediaStreamAudioDestinationNode=a}get stream(){return this._nativeMediaStreamAudioDestinationNode.stream}},On=(t,e,n,s)=>class extends t{constructor(t,i){const r=n(t),o=e(r,i);if(s(r))throw new TypeError;super(t,!0,o,null),this._nativeMediaStreamAudioSourceNode=o}get mediaStream(){return this._nativeMediaStreamAudioSourceNode.mediaStream}},Mn=(t,e,n)=>class extends t{constructor(t,s){const i=n(t),r=e(i,s);super(t,!0,r,null)}},En=(t,e,n,s,i)=>class extends s{constructor(t={}){if(null===i)throw new Error("Missing the native AudioContext constructor.");const s=new i(t);if(null===s)throw n();if(!ft(t.latencyHint))throw new TypeError(`The provided value '${t.latencyHint}' is not a valid enum value of type AudioContextLatencyCategory.`);if(void 0!==t.sampleRate&&s.sampleRate!==t.sampleRate)throw e();super(s,2);const{latencyHint:r}=t,{sampleRate:o}=s;if(this._baseLatency="number"===typeof s.baseLatency?s.baseLatency:"balanced"===r?512/o:"interactive"===r||void 0===r?256/o:"playback"===r?1024/o:128*Math.max(2,Math.min(128,Math.round(r*o/128)))/o,this._nativeAudioContext=s,"webkitAudioContext"===i.name?(this._nativeGainNode=s.createGain(),this._nativeOscillatorNode=s.createOscillator(),this._nativeGainNode.gain.value=1e-37,this._nativeOscillatorNode.connect(this._nativeGainNode).connect(s.destination),this._nativeOscillatorNode.start()):(this._nativeGainNode=null,this._nativeOscillatorNode=null),this._state=null,"running"===s.state){this._state="suspended";const t=()=>{"suspended"===this._state&&(this._state=null),s.removeEventListener("statechange",t)};s.addEventListener("statechange",t)}}get baseLatency(){return this._baseLatency}get state(){return null!==this._state?this._state:this._nativeAudioContext.state}close(){return"closed"===this.state?this._nativeAudioContext.close().then(()=>{throw t()}):("suspended"===this._state&&(this._state=null),this._nativeAudioContext.close().then(()=>{null!==this._nativeGainNode&&null!==this._nativeOscillatorNode&&(this._nativeOscillatorNode.stop(),this._nativeGainNode.disconnect(),this._nativeOscillatorNode.disconnect()),dt(this)}))}resume(){return"suspended"===this._state?new Promise((t,e)=>{const n=()=>{this._nativeAudioContext.removeEventListener("statechange",n),"running"===this._nativeAudioContext.state?t():this.resume().then(t,e)};this._nativeAudioContext.addEventListener("statechange",n)}):this._nativeAudioContext.resume().catch(e=>{if(void 0===e||15===e.code)throw t();throw e})}suspend(){return this._nativeAudioContext.suspend().catch(e=>{if(void 0===e)throw t();throw e})}},In=(t,e,n,s,i,r)=>class extends n{constructor(n,r){super(n),this._nativeContext=n,y.set(this,n),s(n)&&i.set(n,new Set),this._destination=new t(this,r),this._listener=e(this,n),this._onstatechange=null}get currentTime(){return this._nativeContext.currentTime}get destination(){return this._destination}get listener(){return this._listener}get onstatechange(){return this._onstatechange}set onstatechange(t){const e="function"===typeof t?r(this,t):null;this._nativeContext.onstatechange=e;const n=this._nativeContext.onstatechange;this._onstatechange=null!==n&&n===e?t:n}get sampleRate(){return this._nativeContext.sampleRate}get state(){return this._nativeContext.state}},Dn=t=>{const e=new Uint32Array([1179011410,40,1163280727,544501094,16,131073,44100,176400,1048580,1635017060,4,0]);try{const n=t.decodeAudioData(e.buffer,()=>{});return void 0!==n&&(n.catch(()=>{}),!0)}catch{}return!1},Nn={numberOfChannels:1},Rn=(t,e,n,s,i)=>class extends s{constructor(e){const{length:s,numberOfChannels:i,sampleRate:r}={...Nn,...e},o=n(i,s,r);t(Dn,()=>Dn(o))||o.addEventListener("statechange",(()=>{let t=0;const e=n=>{"running"===this._state&&(t>0?(o.removeEventListener("statechange",e),n.stopImmediatePropagation(),this._waitForThePromiseToSettle(n)):t+=1)};return e})()),super(o,i),this._length=s,this._nativeOfflineAudioContext=o,this._state=null}get length(){return void 0===this._nativeOfflineAudioContext.length?this._length:this._nativeOfflineAudioContext.length}get state(){return null===this._state?this._nativeOfflineAudioContext.state:this._state}startRendering(){return"running"===this._state?Promise.reject(e()):(this._state="running",i(this.destination,this._nativeOfflineAudioContext).finally(()=>{this._state=null,dt(this)}))}_waitForThePromiseToSettle(t){null===this._state?this._nativeOfflineAudioContext.dispatchEvent(t):setTimeout(()=>this._waitForThePromiseToSettle(t))}},Pn=(t,e)=>(n,s,i)=>{const r=new Set;return n.connect=(i=>(o,a=0,c=0)=>{const u=0===r.size;if(e(o))return i.call(n,o,a,c),t(r,[o,a,c],t=>t[0]===o&&t[1]===a&&t[2]===c,!0),u&&s(),o;i.call(n,o,a),t(r,[o,a],t=>t[0]===o&&t[1]===a,!0),u&&s()})(n.connect),n.disconnect=(t=>(s,o,a)=>{const c=r.size>0;if(void 0===s)t.apply(n),r.clear();else if("number"===typeof s){t.call(n,s);for(const t of r)t[1]===s&&r.delete(t)}else{e(s)?t.call(n,s,o,a):t.call(n,s,o);for(const t of r)t[0]!==s||void 0!==o&&t[1]!==o||void 0!==a&&t[2]!==a||r.delete(t)}const u=0===r.size;c&&u&&i()})(n.disconnect),n},Vn=(t,e,n)=>{const s=e[n];void 0!==s&&s!==t[n]&&(t[n]=s)},qn=(t,e)=>{Vn(t,e,"channelCount"),Vn(t,e,"channelCountMode"),Vn(t,e,"channelInterpretation")},jn=t=>"function"===typeof t.getFloatTimeDomainData,Fn=t=>{t.getFloatTimeDomainData=e=>{const n=new Uint8Array(e.length);t.getByteTimeDomainData(n);const s=Math.max(n.length,t.fftSize);for(let t=0;t<s;t+=1)e[t]=.0078125*(n[t]-128);return e}},Ln=(t,e)=>(n,s)=>{const i=n.createAnalyser();if(qn(i,s),!(s.maxDecibels>s.minDecibels))throw e();return Vn(i,s,"fftSize"),Vn(i,s,"maxDecibels"),Vn(i,s,"minDecibels"),Vn(i,s,"smoothingTimeConstant"),t(jn,()=>jn(i))||Fn(i),i},Bn=t=>null===t?null:t.hasOwnProperty("AudioBuffer")?t.AudioBuffer:null,Wn=(t,e,n)=>{const s=e[n];void 0!==s&&s!==t[n].value&&(t[n].value=s)},Un=t=>{t.start=(e=>{let n=!1;return(s=0,i=0,r)=>{if(n)throw nn();e.call(t,s,i,r),n=!0}})(t.start)},zn=t=>{t.start=(e=>(n=0,s=0,i)=>{if("number"===typeof i&&i<0||s<0||n<0)throw new RangeError("The parameters can't be negative.");e.call(t,n,s,i)})(t.start)},Gn=t=>{t.stop=(e=>(n=0)=>{if(n<0)throw new RangeError("The parameter can't be negative.");e.call(t,n)})(t.stop)},Xn=(t,e,n,s,i,r,o,a,c,u,l)=>(h,p)=>{const d=h.createBufferSource();return qn(d,p),Wn(d,p,"playbackRate"),Vn(d,p,"buffer"),Vn(d,p,"loop"),Vn(d,p,"loopEnd"),Vn(d,p,"loopStart"),e(n,()=>n(h))||Un(d),e(s,()=>s(h))||c(d),e(i,()=>i(h))||u(d,h),e(r,()=>r(h))||zn(d),e(o,()=>o(h))||l(d,h),e(a,()=>a(h))||Gn(d),t(h,d),d},Yn=t=>null===t?null:t.hasOwnProperty("AudioContext")?t.AudioContext:t.hasOwnProperty("webkitAudioContext")?t.webkitAudioContext:null,Hn=(t,e)=>(n,s,i)=>{const r=n.destination;if(r.channelCount!==s)try{r.channelCount=s}catch{}i&&"explicit"!==r.channelCountMode&&(r.channelCountMode="explicit"),0===r.maxChannelCount&&Object.defineProperty(r,"maxChannelCount",{value:s});const o=t(n,{channelCount:s,channelCountMode:r.channelCountMode,channelInterpretation:r.channelInterpretation,gain:1});return e(o,"channelCount",t=>()=>t.call(o),t=>e=>{t.call(o,e);try{r.channelCount=e}catch(n){if(e>r.maxChannelCount)throw n}}),e(o,"channelCountMode",t=>()=>t.call(o),t=>e=>{t.call(o,e),r.channelCountMode=e}),e(o,"channelInterpretation",t=>()=>t.call(o),t=>e=>{t.call(o,e),r.channelInterpretation=e}),Object.defineProperty(o,"maxChannelCount",{get:()=>r.maxChannelCount}),o.connect(r),o},Zn=t=>null===t?null:t.hasOwnProperty("AudioWorkletNode")?t.AudioWorkletNode:null,$n=t=>{const{port1:e}=new MessageChannel;try{e.postMessage(t)}finally{e.close()}},Kn=(t,e,n,s,i)=>(r,o,a,c,u,l)=>{if(null!==a)try{const e=new a(r,c,l),s=new Map;let o=null;if(Object.defineProperties(e,{channelCount:{get:()=>l.channelCount,set:()=>{throw t()}},channelCountMode:{get:()=>"explicit",set:()=>{throw t()}},onprocessorerror:{get:()=>o,set:t=>{"function"===typeof o&&e.removeEventListener("processorerror",o),o="function"===typeof t?t:null,"function"===typeof o&&e.addEventListener("processorerror",o)}}}),e.addEventListener=(t=>(...n)=>{if("processorerror"===n[0]){const t="function"===typeof n[1]?n[1]:"object"===typeof n[1]&&null!==n[1]&&"function"===typeof n[1].handleEvent?n[1].handleEvent:null;if(null!==t){const e=s.get(n[1]);void 0!==e?n[1]=e:(n[1]=e=>{"error"===e.type?(Object.defineProperties(e,{type:{value:"processorerror"}}),t(e)):t(new ErrorEvent(n[0],{...e}))},s.set(t,n[1]))}}return t.call(e,"error",n[1],n[2]),t.call(e,...n)})(e.addEventListener),e.removeEventListener=(t=>(...n)=>{if("processorerror"===n[0]){const t=s.get(n[1]);void 0!==t&&(s.delete(n[1]),n[1]=t)}return t.call(e,"error",n[1],n[2]),t.call(e,n[0],n[1],n[2])})(e.removeEventListener),0!==l.numberOfOutputs){const t=n(r,{channelCount:1,channelCountMode:"explicit",channelInterpretation:"discrete",gain:0});e.connect(t).connect(r.destination);const s=()=>t.disconnect(),o=()=>t.connect(r.destination);return i(e,s,o)}return e}catch(h){if(11===h.code)throw s();throw h}if(void 0===u)throw s();return $n(l),e(r,o,u,l)},Qn=(t,e)=>null===t?512:Math.max(512,Math.min(16384,Math.pow(2,Math.round(Math.log2(t*e))))),Jn=t=>new Promise((e,n)=>{const{port1:s,port2:i}=new MessageChannel;s.onmessage=({data:t})=>{s.close(),i.close(),e(t)},s.onmessageerror=({data:t})=>{s.close(),i.close(),n(t)},i.postMessage(t)}),ts=async(t,e)=>{const n=await Jn(e);return new t(n)},es=(t,e,n,s)=>{let i=T.get(t);void 0===i&&(i=new WeakMap,T.set(t,i));const r=ts(n,s);return i.set(e,r),r},ns=(t,e,n,s,i,r,o,a,c,u,l,h,p)=>(d,f,m,_)=>{if(0===_.numberOfInputs&&0===_.numberOfOutputs)throw c();const g=Array.isArray(_.outputChannelCount)?_.outputChannelCount:Array.from(_.outputChannelCount);if(g.some(t=>t<1))throw c();if(g.length!==_.numberOfOutputs)throw e();if("explicit"!==_.channelCountMode)throw c();const v=_.channelCount*_.numberOfInputs,y=g.reduce((t,e)=>t+e,0),b=void 0===m.parameterDescriptors?0:m.parameterDescriptors.length;if(v+b>6||y>6)throw c();const w=new MessageChannel,x=[],T=[];for(let t=0;t<_.numberOfInputs;t+=1)x.push(o(d,{channelCount:_.channelCount,channelCountMode:_.channelCountMode,channelInterpretation:_.channelInterpretation,gain:1})),T.push(i(d,{channelCount:_.channelCount,channelCountMode:"explicit",channelInterpretation:"discrete",numberOfOutputs:_.channelCount}));const C=[];if(void 0!==m.parameterDescriptors)for(const{defaultValue:t,maxValue:e,minValue:n,name:s}of m.parameterDescriptors){const i=r(d,{channelCount:1,channelCountMode:"explicit",channelInterpretation:"discrete",offset:void 0!==_.parameterData[s]?_.parameterData[s]:void 0===t?0:t});Object.defineProperties(i.offset,{defaultValue:{get:()=>void 0===t?0:t},maxValue:{get:()=>void 0===e?J:e},minValue:{get:()=>void 0===n?Q:n}}),C.push(i)}const S=s(d,{channelCount:1,channelCountMode:"explicit",channelInterpretation:"speakers",numberOfInputs:Math.max(1,v+b)}),A=Qn(f,d.sampleRate),k=a(d,A,v+b,Math.max(1,y)),O=i(d,{channelCount:Math.max(1,y),channelCountMode:"explicit",channelInterpretation:"discrete",numberOfOutputs:Math.max(1,y)}),M=[];for(let t=0;t<_.numberOfOutputs;t+=1)M.push(s(d,{channelCount:1,channelCountMode:"explicit",channelInterpretation:"speakers",numberOfInputs:g[t]}));for(let t=0;t<_.numberOfInputs;t+=1){x[t].connect(T[t]);for(let e=0;e<_.channelCount;e+=1)T[t].connect(S,e,t*_.channelCount+e)}const E=new $t(void 0===m.parameterDescriptors?[]:m.parameterDescriptors.map(({name:t},e)=>{const n=C[e];return n.connect(S,0,v+e),n.start(0),[t,n.offset]}));S.connect(k);let I=_.channelInterpretation,D=null;const N=0===_.numberOfOutputs?[k]:M,R={get bufferSize(){return A},get channelCount(){return _.channelCount},set channelCount(t){throw n()},get channelCountMode(){return _.channelCountMode},set channelCountMode(t){throw n()},get channelInterpretation(){return I},set channelInterpretation(t){for(const e of x)e.channelInterpretation=t;I=t},get context(){return k.context},get inputs(){return x},get numberOfInputs(){return _.numberOfInputs},get numberOfOutputs(){return _.numberOfOutputs},get onprocessorerror(){return D},set onprocessorerror(t){"function"===typeof D&&R.removeEventListener("processorerror",D),D="function"===typeof t?t:null,"function"===typeof D&&R.addEventListener("processorerror",D)},get parameters(){return E},get port(){return w.port2},addEventListener(...t){return k.addEventListener(t[0],t[1],t[2])},connect:t.bind(null,N),disconnect:u.bind(null,N),dispatchEvent(...t){return k.dispatchEvent(t[0])},removeEventListener(...t){return k.removeEventListener(t[0],t[1],t[2])}},P=new Map;w.port1.addEventListener=(t=>(...e)=>{if("message"===e[0]){const t="function"===typeof e[1]?e[1]:"object"===typeof e[1]&&null!==e[1]&&"function"===typeof e[1].handleEvent?e[1].handleEvent:null;if(null!==t){const n=P.get(e[1]);void 0!==n?e[1]=n:(e[1]=e=>{l(d.currentTime,d.sampleRate,()=>t(e))},P.set(t,e[1]))}}return t.call(w.port1,e[0],e[1],e[2])})(w.port1.addEventListener),w.port1.removeEventListener=(t=>(...e)=>{if("message"===e[0]){const t=P.get(e[1]);void 0!==t&&(P.delete(e[1]),e[1]=t)}return t.call(w.port1,e[0],e[1],e[2])})(w.port1.removeEventListener);let V=null;Object.defineProperty(w.port1,"onmessage",{get:()=>V,set:t=>{"function"===typeof V&&w.port1.removeEventListener("message",V),V="function"===typeof t?t:null,"function"===typeof V&&(w.port1.addEventListener("message",V),w.port1.start())}}),m.prototype.port=w.port1;let q=null;const j=es(d,R,m,_);j.then(t=>q=t);const F=ee(_.numberOfInputs,_.channelCount),L=ee(_.numberOfOutputs,g),B=void 0===m.parameterDescriptors?[]:m.parameterDescriptors.reduce((t,{name:e})=>({...t,[e]:new Float32Array(128)}),{});let W=!0;const U=()=>{_.numberOfOutputs>0&&k.disconnect(O);for(let t=0,e=0;t<_.numberOfOutputs;t+=1){const n=M[t];for(let s=0;s<g[t];s+=1)O.disconnect(n,e+s,s);e+=g[t]}},z=new Map;k.onaudioprocess=({inputBuffer:t,outputBuffer:e})=>{if(null!==q){const s=h(R);for(let i=0;i<A;i+=128){for(let e=0;e<_.numberOfInputs;e+=1)for(let n=0;n<_.channelCount;n+=1)Jt(t,F[e],n,n,i);void 0!==m.parameterDescriptors&&m.parameterDescriptors.forEach(({name:e},n)=>{Jt(t,B,e,v+n,i)});for(let t=0;t<_.numberOfInputs;t+=1)for(let e=0;e<g[t];e+=1)0===L[t][e].byteLength&&(L[t][e]=new Float32Array(128));try{const t=F.map((t,e)=>{const n=s[e];if(n.size>0)return z.set(e,A/128),t;const i=z.get(e);return void 0===i?[]:(t.every(t=>t.every(t=>0===t))&&(1===i?z.delete(e):z.set(e,i-1)),t)}),n=l(d.currentTime+i/d.sampleRate,d.sampleRate,()=>q.process(t,L,B));W=n;for(let s=0,r=0;s<_.numberOfOutputs;s+=1){for(let t=0;t<g[s];t+=1)te(e,L[s],t,r+t,i);r+=g[s]}}catch(n){W=!1,R.dispatchEvent(new ErrorEvent("processorerror",{colno:n.colno,filename:n.filename,lineno:n.lineno,message:n.message}))}if(!W){for(let t=0;t<_.numberOfInputs;t+=1){x[t].disconnect(T[t]);for(let e=0;e<_.channelCount;e+=1)T[i].disconnect(S,e,t*_.channelCount+e)}if(void 0!==m.parameterDescriptors){const t=m.parameterDescriptors.length;for(let e=0;e<t;e+=1){const t=C[e];t.disconnect(S,0,v+e),t.stop()}}S.disconnect(k),k.onaudioprocess=null,G?U():H();break}}}};let G=!1;const X=o(d,{channelCount:1,channelCountMode:"explicit",channelInterpretation:"discrete",gain:0}),Y=()=>k.connect(X).connect(d.destination),H=()=>{k.disconnect(X),X.disconnect()},Z=()=>{if(W){H(),_.numberOfOutputs>0&&k.connect(O);for(let t=0,e=0;t<_.numberOfOutputs;t+=1){const n=M[t];for(let s=0;s<g[t];s+=1)O.connect(n,e+s,s);e+=g[t]}}G=!0},$=()=>{W&&(Y(),U()),G=!1};return Y(),p(R,Z,$)},ss=(t,e)=>{const n=t.createBiquadFilter();return qn(n,e),Wn(n,e,"Q"),Wn(n,e,"detune"),Wn(n,e,"frequency"),Wn(n,e,"gain"),Vn(n,e,"type"),n},is=(t,e)=>(n,s)=>{const i=n.createChannelMerger(s.numberOfInputs);return null!==t&&"webkitAudioContext"===t.name&&e(n,i),qn(i,s),i},rs=t=>{const e=t.numberOfOutputs;Object.defineProperty(t,"channelCount",{get:()=>e,set:t=>{if(t!==e)throw nn()}}),Object.defineProperty(t,"channelCountMode",{get:()=>"explicit",set:t=>{if("explicit"!==t)throw nn()}}),Object.defineProperty(t,"channelInterpretation",{get:()=>"discrete",set:t=>{if("discrete"!==t)throw nn()}})},os=(t,e)=>{const n=t.createChannelSplitter(e.numberOfOutputs);return qn(n,e),rs(n),n},as=(t,e,n,s,i)=>(r,o)=>{if(void 0===r.createConstantSource)return n(r,o);const a=r.createConstantSource();return qn(a,o),Wn(a,o,"offset"),e(s,()=>s(r))||zn(a),e(i,()=>i(r))||Gn(a),t(r,a),a},cs=(t,e)=>(t.connect=e.connect.bind(e),t.disconnect=e.disconnect.bind(e),t),us=(t,e,n,s)=>(i,{offset:r,...o})=>{const a=i.createBuffer(1,2,44100),c=e(i,{buffer:null,channelCount:2,channelCountMode:"max",channelInterpretation:"speakers",loop:!1,loopEnd:0,loopStart:0,playbackRate:1}),u=n(i,{...o,gain:r}),l=a.getChannelData(0);l[0]=1,l[1]=1,c.buffer=a,c.loop=!0;const h={get bufferSize(){},get channelCount(){return u.channelCount},set channelCount(t){u.channelCount=t},get channelCountMode(){return u.channelCountMode},set channelCountMode(t){u.channelCountMode=t},get channelInterpretation(){return u.channelInterpretation},set channelInterpretation(t){u.channelInterpretation=t},get context(){return u.context},get inputs(){return[]},get numberOfInputs(){return c.numberOfInputs},get numberOfOutputs(){return u.numberOfOutputs},get offset(){return u.gain},get onended(){return c.onended},set onended(t){c.onended=t},addEventListener(...t){return c.addEventListener(t[0],t[1],t[2])},dispatchEvent(...t){return c.dispatchEvent(t[0])},removeEventListener(...t){return c.removeEventListener(t[0],t[1],t[2])},start(t=0){c.start.call(c,t)},stop(t=0){c.stop.call(c,t)}},p=()=>c.connect(u),d=()=>c.disconnect(u);return t(i,c),s(cs(h,u),p,d)},ls=(t,e)=>(n,s)=>{const i=n.createConvolver();if(qn(i,s),s.disableNormalization===i.normalize&&(i.normalize=!s.disableNormalization),Vn(i,s,"buffer"),s.channelCount>2)throw t();if(e(i,"channelCount",t=>()=>t.call(i),e=>n=>{if(n>2)throw t();return e.call(i,n)}),"max"===s.channelCountMode)throw t();return e(i,"channelCountMode",t=>()=>t.call(i),e=>n=>{if("max"===n)throw t();return e.call(i,n)}),i},hs=(t,e)=>{const n=t.createDelay(e.maxDelayTime);return qn(n,e),Wn(n,e,"delayTime"),n},ps=t=>(e,n)=>{const s=e.createDynamicsCompressor();if(qn(s,n),n.channelCount>2)throw t();if("max"===n.channelCountMode)throw t();return Wn(s,n,"attack"),Wn(s,n,"knee"),Wn(s,n,"ratio"),Wn(s,n,"release"),Wn(s,n,"threshold"),s},ds=(t,e)=>{const n=t.createGain();return qn(n,e),Wn(n,e,"gain"),n},fs=t=>(e,n,s)=>{if(void 0===e.createIIRFilter)return t(e,n,s);const i=e.createIIRFilter(s.feedforward,s.feedback);return qn(i,s),i};function ms(t,e){const n=e[0]*e[0]+e[1]*e[1];return[(t[0]*e[0]+t[1]*e[1])/n,(t[1]*e[0]-t[0]*e[1])/n]}function _s(t,e){return[t[0]*e[0]-t[1]*e[1],t[0]*e[1]+t[1]*e[0]]}function gs(t,e){let n=[0,0];for(let s=t.length-1;s>=0;s-=1)n=_s(n,e),n[0]+=t[s];return n}const vs=(t,e,n,s)=>(i,r,{channelCount:o,channelCountMode:a,channelInterpretation:c,feedback:u,feedforward:l})=>{const h=Qn(r,i.sampleRate),p=u instanceof Float64Array?u:new Float64Array(u),d=l instanceof Float64Array?l:new Float64Array(l),f=p.length,m=d.length,_=Math.min(f,m);if(0===f||f>20)throw s();if(0===p[0])throw e();if(0===m||m>20)throw s();if(0===d[0])throw e();if(1!==p[0]){for(let t=0;t<m;t+=1)d[t]/=p[0];for(let t=1;t<f;t+=1)p[t]/=p[0]}const g=n(i,h,o,o);g.channelCount=o,g.channelCountMode=a,g.channelInterpretation=c;const v=32,y=[],b=[],w=[];for(let t=0;t<o;t+=1){y.push(0);const t=new Float32Array(v),e=new Float32Array(v);t.fill(0),e.fill(0),b.push(t),w.push(e)}g.onaudioprocess=t=>{const e=t.inputBuffer,n=t.outputBuffer,s=e.numberOfChannels;for(let i=0;i<s;i+=1){const t=e.getChannelData(i),s=n.getChannelData(i);y[i]=hn(p,f,d,m,_,b[i],w[i],y[i],v,t,s)}};const x=i.sampleRate/2,T={get bufferSize(){return h},get channelCount(){return g.channelCount},set channelCount(t){g.channelCount=t},get channelCountMode(){return g.channelCountMode},set channelCountMode(t){g.channelCountMode=t},get channelInterpretation(){return g.channelInterpretation},set channelInterpretation(t){g.channelInterpretation=t},get context(){return g.context},get inputs(){return[g]},get numberOfInputs(){return g.numberOfInputs},get numberOfOutputs(){return g.numberOfOutputs},addEventListener(...t){return g.addEventListener(t[0],t[1],t[2])},dispatchEvent(...t){return g.dispatchEvent(t[0])},getFrequencyResponse(e,n,s){if(e.length!==n.length||n.length!==s.length)throw t();const i=e.length;for(let t=0;t<i;t+=1){const i=-Math.PI*(e[t]/x),r=[Math.cos(i),Math.sin(i)],o=gs(d,r),a=gs(p,r),c=ms(o,a);n[t]=Math.sqrt(c[0]*c[0]+c[1]*c[1]),s[t]=Math.atan2(c[1],c[0])}},removeEventListener(...t){return g.removeEventListener(t[0],t[1],t[2])}};return cs(T,g)},ys=(t,e)=>t.createMediaElementSource(e.mediaElement),bs=(t,e)=>{const n=t.createMediaStreamDestination();return qn(n,e),1===n.numberOfOutputs&&Object.defineProperty(n,"numberOfOutputs",{get:()=>0}),n},ws=(t,{mediaStream:e})=>{const n=e.getAudioTracks();n.sort((t,e)=>t.id<e.id?-1:t.id>e.id?1:0);const s=n.slice(0,1),i=t.createMediaStreamSource(new MediaStream(s));return Object.defineProperty(i,"mediaStream",{value:e}),i},xs=(t,e)=>(n,{mediaStreamTrack:s})=>{if("function"===typeof n.createMediaStreamTrackSource)return n.createMediaStreamTrackSource(s);const i=new MediaStream([s]),r=n.createMediaStreamSource(i);if("audio"!==s.kind)throw t();if(e(n))throw new TypeError;return r},Ts=t=>null===t?null:t.hasOwnProperty("OfflineAudioContext")?t.OfflineAudioContext:t.hasOwnProperty("webkitOfflineAudioContext")?t.webkitOfflineAudioContext:null,Cs=(t,e,n,s,i,r)=>(o,a)=>{const c=o.createOscillator();return qn(c,a),Wn(c,a,"detune"),Wn(c,a,"frequency"),void 0!==a.periodicWave?c.setPeriodicWave(a.periodicWave):Vn(c,a,"type"),e(n,()=>n(o))||zn(c),e(s,()=>s(o))||r(c,o),e(i,()=>i(o))||Gn(c),t(o,c),c},Ss=t=>(e,n)=>{const s=e.createPanner();return void 0===s.orientationX?t(e,n):(qn(s,n),Wn(s,n,"orientationX"),Wn(s,n,"orientationY"),Wn(s,n,"orientationZ"),Wn(s,n,"positionX"),Wn(s,n,"positionY"),Wn(s,n,"positionZ"),Vn(s,n,"coneInnerAngle"),Vn(s,n,"coneOuterAngle"),Vn(s,n,"coneOuterGain"),Vn(s,n,"distanceModel"),Vn(s,n,"maxDistance"),Vn(s,n,"panningModel"),Vn(s,n,"refDistance"),Vn(s,n,"rolloffFactor"),s)},As=(t,e,n,s,i,r,o,a,c)=>(u,{coneInnerAngle:l,coneOuterAngle:h,coneOuterGain:p,distanceModel:d,maxDistance:f,orientationX:m,orientationY:_,orientationZ:g,panningModel:v,positionX:y,positionY:b,positionZ:w,refDistance:x,rolloffFactor:T,...C})=>{const S=u.createPanner();if(C.channelCount>2)throw o();if("max"===C.channelCountMode)throw o();qn(S,C);const A={channelCount:1,channelCountMode:"explicit",channelInterpretation:"discrete"},k=n(u,{...A,channelInterpretation:"speakers",numberOfInputs:6}),O=s(u,{...C,gain:1}),M=s(u,{...A,gain:1}),E=s(u,{...A,gain:0}),I=s(u,{...A,gain:0}),D=s(u,{...A,gain:0}),N=s(u,{...A,gain:0}),R=s(u,{...A,gain:0}),P=i(u,256,6,1),V=r(u,{...A,curve:new Float32Array([1,1]),oversample:"none"});let q=[m,_,g],j=[y,b,w];P.onaudioprocess=({inputBuffer:t})=>{const e=[t.getChannelData(0)[0],t.getChannelData(1)[0],t.getChannelData(2)[0]];e.some((t,e)=>t!==q[e])&&(S.setOrientation(...e),q=e);const n=[t.getChannelData(3)[0],t.getChannelData(4)[0],t.getChannelData(5)[0]];n.some((t,e)=>t!==j[e])&&(S.setPosition(...n),j=n)},Object.defineProperty(E.gain,"defaultValue",{get:()=>0}),Object.defineProperty(I.gain,"defaultValue",{get:()=>0}),Object.defineProperty(D.gain,"defaultValue",{get:()=>0}),Object.defineProperty(N.gain,"defaultValue",{get:()=>0}),Object.defineProperty(R.gain,"defaultValue",{get:()=>0});const F={get bufferSize(){},get channelCount(){return S.channelCount},set channelCount(t){if(t>2)throw o();O.channelCount=t,S.channelCount=t},get channelCountMode(){return S.channelCountMode},set channelCountMode(t){if("max"===t)throw o();O.channelCountMode=t,S.channelCountMode=t},get channelInterpretation(){return S.channelInterpretation},set channelInterpretation(t){O.channelInterpretation=t,S.channelInterpretation=t},get coneInnerAngle(){return S.coneInnerAngle},set coneInnerAngle(t){S.coneInnerAngle=t},get coneOuterAngle(){return S.coneOuterAngle},set coneOuterAngle(t){S.coneOuterAngle=t},get coneOuterGain(){return S.coneOuterGain},set coneOuterGain(t){if(t<0||t>1)throw e();S.coneOuterGain=t},get context(){return S.context},get distanceModel(){return S.distanceModel},set distanceModel(t){S.distanceModel=t},get inputs(){return[O]},get maxDistance(){return S.maxDistance},set maxDistance(t){if(t<0)throw new RangeError;S.maxDistance=t},get numberOfInputs(){return S.numberOfInputs},get numberOfOutputs(){return S.numberOfOutputs},get orientationX(){return M.gain},get orientationY(){return E.gain},get orientationZ(){return I.gain},get panningModel(){return S.panningModel},set panningModel(t){S.panningModel=t},get positionX(){return D.gain},get positionY(){return N.gain},get positionZ(){return R.gain},get refDistance(){return S.refDistance},set refDistance(t){if(t<0)throw new RangeError;S.refDistance=t},get rolloffFactor(){return S.rolloffFactor},set rolloffFactor(t){if(t<0)throw new RangeError;S.rolloffFactor=t},addEventListener(...t){return O.addEventListener(t[0],t[1],t[2])},dispatchEvent(...t){return O.dispatchEvent(t[0])},removeEventListener(...t){return O.removeEventListener(t[0],t[1],t[2])}};l!==F.coneInnerAngle&&(F.coneInnerAngle=l),h!==F.coneOuterAngle&&(F.coneOuterAngle=h),p!==F.coneOuterGain&&(F.coneOuterGain=p),d!==F.distanceModel&&(F.distanceModel=d),f!==F.maxDistance&&(F.maxDistance=f),m!==F.orientationX.value&&(F.orientationX.value=m),_!==F.orientationY.value&&(F.orientationY.value=_),g!==F.orientationZ.value&&(F.orientationZ.value=g),v!==F.panningModel&&(F.panningModel=v),y!==F.positionX.value&&(F.positionX.value=y),b!==F.positionY.value&&(F.positionY.value=b),w!==F.positionZ.value&&(F.positionZ.value=w),x!==F.refDistance&&(F.refDistance=x),T!==F.rolloffFactor&&(F.rolloffFactor=T),1===q[0]&&0===q[1]&&0===q[2]||S.setOrientation(...q),0===j[0]&&0===j[1]&&0===j[2]||S.setPosition(...j);const L=()=>{O.connect(S),t(O,V,0,0),V.connect(M).connect(k,0,0),V.connect(E).connect(k,0,1),V.connect(I).connect(k,0,2),V.connect(D).connect(k,0,3),V.connect(N).connect(k,0,4),V.connect(R).connect(k,0,5),k.connect(P).connect(u.destination)},B=()=>{O.disconnect(S),a(O,V,0,0),V.disconnect(M),M.disconnect(k),V.disconnect(E),E.disconnect(k),V.disconnect(I),I.disconnect(k),V.disconnect(D),D.disconnect(k),V.disconnect(N),N.disconnect(k),V.disconnect(R),R.disconnect(k),k.disconnect(P),P.disconnect(u.destination)};return c(cs(F,S),L,B)},ks=t=>(e,{disableNormalization:n,imag:s,real:i})=>{const r=s instanceof Float32Array?s:new Float32Array(s),o=i instanceof Float32Array?i:new Float32Array(i),a=e.createPeriodicWave(o,r,{disableNormalization:n});if(Array.from(s).length<2)throw t();return a},Os=(t,e,n,s)=>t.createScriptProcessor(e,n,s),Ms=(t,e)=>(n,s)=>{const i=s.channelCountMode;if("clamped-max"===i)throw e();if(void 0===n.createStereoPanner)return t(n,s);const r=n.createStereoPanner();return qn(r,s),Wn(r,s,"pan"),Object.defineProperty(r,"channelCountMode",{get:()=>i,set:t=>{if(t!==i)throw e()}}),r},Es=(t,e,n,s,i,r)=>{const o=16385,a=new Float32Array([1,1]),c=Math.PI/2,u={channelCount:1,channelCountMode:"explicit",channelInterpretation:"discrete"},l={...u,oversample:"none"},h=(t,e,i,r)=>{const h=new Float32Array(o),p=new Float32Array(o);for(let n=0;n<o;n+=1){const t=n/(o-1)*c;h[n]=Math.cos(t),p[n]=Math.sin(t)}const d=n(t,{...u,gain:0}),f=s(t,{...l,curve:h}),m=s(t,{...l,curve:a}),_=n(t,{...u,gain:0}),g=s(t,{...l,curve:p});return{connectGraph(){e.connect(d),e.connect(m.inputs[0]),e.connect(_),m.connect(i),i.connect(f.inputs[0]),i.connect(g.inputs[0]),f.connect(d.gain),g.connect(_.gain),d.connect(r,0,0),_.connect(r,0,1)},disconnectGraph(){e.disconnect(d),e.disconnect(m.inputs[0]),e.disconnect(_),m.disconnect(i),i.disconnect(f.inputs[0]),i.disconnect(g.inputs[0]),f.disconnect(d.gain),g.disconnect(_.gain),d.disconnect(r,0,0),_.disconnect(r,0,1)}}},p=(t,i,r,h)=>{const p=new Float32Array(o),d=new Float32Array(o),f=new Float32Array(o),m=new Float32Array(o),_=Math.floor(o/2);for(let e=0;e<o;e+=1)if(e>_){const t=(e-_)/(o-1-_)*c;p[e]=Math.cos(t),d[e]=Math.sin(t),f[e]=0,m[e]=1}else{const t=e/(o-1-_)*c;p[e]=1,d[e]=0,f[e]=Math.cos(t),m[e]=Math.sin(t)}const g=e(t,{channelCount:2,channelCountMode:"explicit",channelInterpretation:"discrete",numberOfOutputs:2}),v=n(t,{...u,gain:0}),y=s(t,{...l,curve:p}),b=n(t,{...u,gain:0}),w=s(t,{...l,curve:d}),x=s(t,{...l,curve:a}),T=n(t,{...u,gain:0}),C=s(t,{...l,curve:f}),S=n(t,{...u,gain:0}),A=s(t,{...l,curve:m});return{connectGraph(){i.connect(g),i.connect(x.inputs[0]),g.connect(v,0),g.connect(b,0),g.connect(T,1),g.connect(S,1),x.connect(r),r.connect(y.inputs[0]),r.connect(w.inputs[0]),r.connect(C.inputs[0]),r.connect(A.inputs[0]),y.connect(v.gain),w.connect(b.gain),C.connect(T.gain),A.connect(S.gain),v.connect(h,0,0),T.connect(h,0,0),b.connect(h,0,1),S.connect(h,0,1)},disconnectGraph(){i.disconnect(g),i.disconnect(x.inputs[0]),g.disconnect(v,0),g.disconnect(b,0),g.disconnect(T,1),g.disconnect(S,1),x.disconnect(r),r.disconnect(y.inputs[0]),r.disconnect(w.inputs[0]),r.disconnect(C.inputs[0]),r.disconnect(A.inputs[0]),y.disconnect(v.gain),w.disconnect(b.gain),C.disconnect(T.gain),A.disconnect(S.gain),v.disconnect(h,0,0),T.disconnect(h,0,0),b.disconnect(h,0,1),S.disconnect(h,0,1)}}},d=(t,e,n,s,r)=>{if(1===e)return h(t,n,s,r);if(2===e)return p(t,n,s,r);throw i()};return(e,{channelCount:s,channelCountMode:o,pan:a,...c})=>{if("max"===o)throw i();const u=t(e,{...c,channelCount:1,channelCountMode:o,numberOfInputs:2}),l=n(e,{...c,channelCount:s,channelCountMode:o,gain:1}),h=n(e,{channelCount:1,channelCountMode:"explicit",channelInterpretation:"discrete",gain:a});let{connectGraph:p,disconnectGraph:f}=d(e,s,l,h,u);Object.defineProperty(h.gain,"defaultValue",{get:()=>0}),Object.defineProperty(h.gain,"minValue",{get:()=>-1});const m={get bufferSize(){},get channelCount(){return l.channelCount},set channelCount(t){l.channelCount!==t&&(_&&f(),({connectGraph:p,disconnectGraph:f}=d(e,t,l,h,u)),_&&p()),l.channelCount=t},get channelCountMode(){return l.channelCountMode},set channelCountMode(t){if("clamped-max"===t||"max"===t)throw i();l.channelCountMode=t},get channelInterpretation(){return l.channelInterpretation},set channelInterpretation(t){l.channelInterpretation=t},get context(){return l.context},get inputs(){return[l]},get numberOfInputs(){return l.numberOfInputs},get numberOfOutputs(){return l.numberOfOutputs},get pan(){return h.gain},addEventListener(...t){return l.addEventListener(t[0],t[1],t[2])},dispatchEvent(...t){return l.dispatchEvent(t[0])},removeEventListener(...t){return l.removeEventListener(t[0],t[1],t[2])}};let _=!1;const g=()=>{p(),_=!0},v=()=>{f(),_=!1};return r(cs(m,u),g,v)}},Is=(t,e,n,s,i,r,o)=>(a,c)=>{const u=a.createWaveShaper();if(null!==r&&"webkitAudioContext"===r.name)return n(a,c);qn(u,c);const l=null===c.curve||c.curve instanceof Float32Array?c.curve:new Float32Array(c.curve);if(null!==l&&l.length<2)throw e();Vn(u,{curve:l},"curve"),Vn(u,c,"oversample");let h=null,p=!1;o(u,"curve",t=>()=>t.call(u),e=>n=>(e.call(u,n),p&&(s(n)&&null===h?h=t(a,u):s(n)||null===h||(h(),h=null)),n));const d=()=>{p=!0,s(u.curve)&&(h=t(a,u))},f=()=>{p=!1,null!==h&&(h(),h=null)};return i(u,d,f)},Ds=(t,e,n,s,i)=>(r,{curve:o,oversample:a,...c})=>{const u=r.createWaveShaper(),l=r.createWaveShaper();qn(u,c),qn(l,c);const h=n(r,{...c,gain:1}),p=n(r,{...c,gain:-1}),d=n(r,{...c,gain:1}),f=n(r,{...c,gain:-1});let m=null,_=!1,g=null;const v={get bufferSize(){},get channelCount(){return u.channelCount},set channelCount(t){h.channelCount=t,p.channelCount=t,u.channelCount=t,d.channelCount=t,l.channelCount=t,f.channelCount=t},get channelCountMode(){return u.channelCountMode},set channelCountMode(t){h.channelCountMode=t,p.channelCountMode=t,u.channelCountMode=t,d.channelCountMode=t,l.channelCountMode=t,f.channelCountMode=t},get channelInterpretation(){return u.channelInterpretation},set channelInterpretation(t){h.channelInterpretation=t,p.channelInterpretation=t,u.channelInterpretation=t,d.channelInterpretation=t,l.channelInterpretation=t,f.channelInterpretation=t},get context(){return u.context},get curve(){return g},set curve(n){if(null!==n&&n.length<2)throw e();if(null===n)u.curve=n,l.curve=n;else{const t=n.length,e=new Float32Array(t+2-t%2),s=new Float32Array(t+2-t%2);e[0]=n[0],s[0]=-n[t-1];const i=Math.ceil((t+1)/2),r=(t+1)/2-1;for(let o=1;o<i;o+=1){const a=o/i*r,c=Math.floor(a),u=Math.ceil(a);e[o]=c===u?n[c]:(1-(a-c))*n[c]+(1-(u-a))*n[u],s[o]=c===u?-n[t-1-c]:-(1-(a-c))*n[t-1-c]-(1-(u-a))*n[t-1-u]}e[i]=t%2===1?n[i-1]:(n[i-2]+n[i-1])/2,u.curve=e,l.curve=s}g=n,_&&(s(g)&&null===m?m=t(r,h):null!==m&&(m(),m=null))},get inputs(){return[h]},get numberOfInputs(){return u.numberOfInputs},get numberOfOutputs(){return u.numberOfOutputs},get oversample(){return u.oversample},set oversample(t){u.oversample=t,l.oversample=t},addEventListener(...t){return h.addEventListener(t[0],t[1],t[2])},dispatchEvent(...t){return h.dispatchEvent(t[0])},removeEventListener(...t){return h.removeEventListener(t[0],t[1],t[2])}};null!==o&&(v.curve=o instanceof Float32Array?o:new Float32Array(o)),a!==v.oversample&&(v.oversample=a);const y=()=>{h.connect(u).connect(d),h.connect(p).connect(l).connect(f).connect(d),_=!0,s(g)&&(m=t(r,h))},b=()=>{h.disconnect(u),u.disconnect(d),h.disconnect(p),p.disconnect(l),l.disconnect(f),f.disconnect(d),_=!1,null!==m&&(m(),m=null)};return i(cs(v,d),y,b)},Ns=()=>new DOMException("","NotSupportedError"),Rs={numberOfChannels:1},Ps=(t,e,n,s,i)=>class extends t{constructor(t,n,i){let r;if("number"===typeof t&&void 0!==n&&void 0!==i)r={length:n,numberOfChannels:t,sampleRate:i};else{if("object"!==typeof t)throw new Error("The given parameters are not valid.");r=t}const{length:o,numberOfChannels:a,sampleRate:c}={...Rs,...r},u=s(a,o,c);e(Dn,()=>Dn(u))||u.addEventListener("statechange",(()=>{let t=0;const e=n=>{"running"===this._state&&(t>0?(u.removeEventListener("statechange",e),n.stopImmediatePropagation(),this._waitForThePromiseToSettle(n)):t+=1)};return e})()),super(u,a),this._length=o,this._nativeOfflineAudioContext=u,this._state=null}get length(){return void 0===this._nativeOfflineAudioContext.length?this._length:this._nativeOfflineAudioContext.length}get state(){return null===this._state?this._nativeOfflineAudioContext.state:this._state}startRendering(){return"running"===this._state?Promise.reject(n()):(this._state="running",i(this.destination,this._nativeOfflineAudioContext).finally(()=>{this._state=null,dt(this)}))}_waitForThePromiseToSettle(t){null===this._state?this._nativeOfflineAudioContext.dispatchEvent(t):setTimeout(()=>this._waitForThePromiseToSettle(t))}},Vs={channelCount:2,channelCountMode:"max",channelInterpretation:"speakers",detune:0,frequency:440,periodicWave:void 0,type:"sine"},qs=(t,e,n,s,i,r,o)=>class extends t{constructor(t,o){const a=i(t),c={...Vs,...o},u=n(a,c),l=r(a),h=l?s():null,p=t.sampleRate/2;super(t,!1,u,h),this._detune=e(this,l,u.detune,153600,-153600),this._frequency=e(this,l,u.frequency,p,-p),this._nativeOscillatorNode=u,this._onended=null,this._oscillatorNodeRenderer=h,null!==this._oscillatorNodeRenderer&&void 0!==c.periodicWave&&(this._oscillatorNodeRenderer.periodicWave=c.periodicWave)}get detune(){return this._detune}get frequency(){return this._frequency}get onended(){return this._onended}set onended(t){const e="function"===typeof t?o(this,t):null;this._nativeOscillatorNode.onended=e;const n=this._nativeOscillatorNode.onended;this._onended=null!==n&&n===e?t:n}get type(){return this._nativeOscillatorNode.type}set type(t){this._nativeOscillatorNode.type=t,null!==this._oscillatorNodeRenderer&&(this._oscillatorNodeRenderer.periodicWave=null)}setPeriodicWave(t){this._nativeOscillatorNode.setPeriodicWave(t),null!==this._oscillatorNodeRenderer&&(this._oscillatorNodeRenderer.periodicWave=t)}start(t=0){if(this._nativeOscillatorNode.start(t),null!==this._oscillatorNodeRenderer&&(this._oscillatorNodeRenderer.start=t),"closed"!==this.context.state){P(this);const t=()=>{this._nativeOscillatorNode.removeEventListener("ended",t),tt(this)&&q(this)};this._nativeOscillatorNode.addEventListener("ended",t)}}stop(t=0){this._nativeOscillatorNode.stop(t),null!==this._oscillatorNodeRenderer&&(this._oscillatorNodeRenderer.stop=t)}},js=(t,e,n,s,i)=>()=>{const r=new WeakMap;let o=null,a=null,c=null;const u=async(u,l,h)=>{let p=n(u);const d=G(p,l);if(!d){const t={channelCount:p.channelCount,channelCountMode:p.channelCountMode,channelInterpretation:p.channelInterpretation,detune:p.detune.value,frequency:p.frequency.value,periodicWave:null===o?void 0:o,type:p.type};p=e(l,t),null!==a&&p.start(a),null!==c&&p.stop(c)}return r.set(l,p),d?(await t(l,u.detune,p.detune,h),await t(l,u.frequency,p.frequency,h)):(await s(l,u.detune,p.detune,h),await s(l,u.frequency,p.frequency,h)),await i(u,l,p,h),p};return{set periodicWave(t){o=t},set start(t){a=t},set stop(t){c=t},render(t,e,n){const s=r.get(e);return void 0!==s?Promise.resolve(s):u(t,e,n)}}},Fs={channelCount:2,channelCountMode:"clamped-max",channelInterpretation:"speakers",coneInnerAngle:360,coneOuterAngle:360,coneOuterGain:0,distanceModel:"inverse",maxDistance:1e4,orientationX:1,orientationY:0,orientationZ:0,panningModel:"equalpower",positionX:0,positionY:0,positionZ:0,refDistance:1,rolloffFactor:1},Ls=(t,e,n,s,i,r,o)=>class extends t{constructor(t,a){const c=i(t),u={...Fs,...a},l=n(c,u),h=r(c),p=h?s():null;super(t,!1,l,p),this._nativePannerNode=l,this._orientationX=e(this,h,l.orientationX,J,Q),this._orientationY=e(this,h,l.orientationY,J,Q),this._orientationZ=e(this,h,l.orientationZ,J,Q),this._positionX=e(this,h,l.positionX,J,Q),this._positionY=e(this,h,l.positionY,J,Q),this._positionZ=e(this,h,l.positionZ,J,Q),o(this,1)}get coneInnerAngle(){return this._nativePannerNode.coneInnerAngle}set coneInnerAngle(t){this._nativePannerNode.coneInnerAngle=t}get coneOuterAngle(){return this._nativePannerNode.coneOuterAngle}set coneOuterAngle(t){this._nativePannerNode.coneOuterAngle=t}get coneOuterGain(){return this._nativePannerNode.coneOuterGain}set coneOuterGain(t){this._nativePannerNode.coneOuterGain=t}get distanceModel(){return this._nativePannerNode.distanceModel}set distanceModel(t){this._nativePannerNode.distanceModel=t}get maxDistance(){return this._nativePannerNode.maxDistance}set maxDistance(t){this._nativePannerNode.maxDistance=t}get orientationX(){return this._orientationX}get orientationY(){return this._orientationY}get orientationZ(){return this._orientationZ}get panningModel(){return this._nativePannerNode.panningModel}set panningModel(t){this._nativePannerNode.panningModel=t}get positionX(){return this._positionX}get positionY(){return this._positionY}get positionZ(){return this._positionZ}get refDistance(){return this._nativePannerNode.refDistance}set refDistance(t){this._nativePannerNode.refDistance=t}get rolloffFactor(){return this._nativePannerNode.rolloffFactor}set rolloffFactor(t){this._nativePannerNode.rolloffFactor=t}},Bs=(t,e,n,s,i,r,o,a,c,u)=>()=>{const l=new WeakMap;let h=null;const p=async(p,d,f)=>{let m=null,_=r(p);const g={channelCount:_.channelCount,channelCountMode:_.channelCountMode,channelInterpretation:_.channelInterpretation},v={...g,coneInnerAngle:_.coneInnerAngle,coneOuterAngle:_.coneOuterAngle,coneOuterGain:_.coneOuterGain,distanceModel:_.distanceModel,maxDistance:_.maxDistance,panningModel:_.panningModel,refDistance:_.refDistance,rolloffFactor:_.rolloffFactor},y=G(_,d);if("bufferSize"in _)m=s(d,{...g,gain:1});else if(!y){const t={...v,orientationX:_.orientationX.value,orientationY:_.orientationY.value,orientationZ:_.orientationZ.value,positionX:_.positionX.value,positionY:_.positionY.value,positionZ:_.positionZ.value};_=i(d,t)}if(l.set(d,null===m?_:m),null!==m){if(null===h){if(null===o)throw new Error("Missing the native OfflineAudioContext constructor.");const t=new o(6,p.context.length,d.sampleRate),s=e(t,{channelCount:1,channelCountMode:"explicit",channelInterpretation:"speakers",numberOfInputs:6});s.connect(t.destination),h=(async()=>{const e=await Promise.all([p.orientationX,p.orientationY,p.orientationZ,p.positionX,p.positionY,p.positionZ].map(async(e,s)=>{const i=n(t,{channelCount:1,channelCountMode:"explicit",channelInterpretation:"discrete",offset:0===s?1:0});return await a(t,e,i.offset,f),i}));for(let t=0;t<6;t+=1)e[t].connect(s,0,t),e[t].start(0);return u(t)})()}const t=await h,r=s(d,{...g,gain:1});await c(p,d,r,f);const l=[];for(let e=0;e<t.numberOfChannels;e+=1)l.push(t.getChannelData(e));let _=[l[0][0],l[1][0],l[2][0]],y=[l[3][0],l[4][0],l[5][0]],b=s(d,{...g,gain:1}),w=i(d,{...v,orientationX:_[0],orientationY:_[1],orientationZ:_[2],positionX:y[0],positionY:y[1],positionZ:y[2]});r.connect(b).connect(w.inputs[0]),w.connect(m);for(let e=128;e<t.length;e+=128){const t=[l[0][e],l[1][e],l[2][e]],n=[l[3][e],l[4][e],l[5][e]];if(t.some((t,e)=>t!==_[e])||n.some((t,e)=>t!==y[e])){_=t,y=n;const o=e/d.sampleRate;b.gain.setValueAtTime(0,o),b=s(d,{...g,gain:0}),w=i(d,{...v,orientationX:_[0],orientationY:_[1],orientationZ:_[2],positionX:y[0],positionY:y[1],positionZ:y[2]}),b.gain.setValueAtTime(1,o),r.connect(b).connect(w.inputs[0]),w.connect(m)}}return m}return y?(await t(d,p.orientationX,_.orientationX,f),await t(d,p.orientationY,_.orientationY,f),await t(d,p.orientationZ,_.orientationZ,f),await t(d,p.positionX,_.positionX,f),await t(d,p.positionY,_.positionY,f),await t(d,p.positionZ,_.positionZ,f)):(await a(d,p.orientationX,_.orientationX,f),await a(d,p.orientationY,_.orientationY,f),await a(d,p.orientationZ,_.orientationZ,f),await a(d,p.positionX,_.positionX,f),await a(d,p.positionY,_.positionY,f),await a(d,p.positionZ,_.positionZ,f)),Ct(_)?await c(p,d,_.inputs[0],f):await c(p,d,_,f),_};return{render(t,e,n){const s=l.get(e);return void 0!==s?Promise.resolve(s):p(t,e,n)}}},Ws={disableNormalization:!1},Us=(t,e,n,s)=>class i{constructor(i,r){const o=e(i),a=s({...Ws,...r}),c=t(o,a);return n.add(c),c}static[Symbol.hasInstance](t){return null!==t&&"object"===typeof t&&Object.getPrototypeOf(t)===i.prototype||n.has(t)}},zs=(t,e)=>(n,s,i,r)=>{const o=t(s);return o.replay(i),e(s,n,i,r)},Gs=(t,e,n)=>async(s,i,r,o)=>{const a=t(s),c=[...o,s];await Promise.all(a.activeInputs.map((t,o)=>Array.from(t).filter(([t])=>!c.includes(t)).map(async([t,a])=>{const u=e(t),l=await u.render(t,i,c),h=s.context.destination;n(t)||s===h&&n(s)||l.connect(r,a,o)})).reduce((t,e)=>[...t,...e],[]))},Xs=(t,e,n)=>async(s,i,r,o)=>{const a=e(s);await Promise.all(Array.from(a.activeInputs).map(async([e,s])=>{const a=t(e),c=await a.render(e,i,o);n(e)||c.connect(r,s)}))},Ys=(t,e,n,s)=>i=>t(Dn,()=>Dn(i))?Promise.resolve(t(s,s)).then(t=>{if(!t){const t=n(i,512,0,1);i.oncomplete=()=>{t.onaudioprocess=null,t.disconnect()},t.onaudioprocess=()=>i.currentTime,t.connect(i.destination)}return i.startRendering()}):new Promise(t=>{const n=e(i,{channelCount:1,channelCountMode:"explicit",channelInterpretation:"discrete",gain:0});i.oncomplete=e=>{n.disconnect(),t(e.renderedBuffer)},n.connect(i.destination),i.startRendering()}),Hs=t=>(e,n)=>{t.set(e,n)},Zs=t=>(e,n)=>t.set(e,n),$s=(t,e,n,s,i,r,o,a)=>{const c=[];return(u,l)=>n(u).render(u,l,c).then(()=>Promise.all(Array.from(s(l)).map(t=>n(t).render(t,l,c)))).then(()=>i(l)).then(n=>("function"!==typeof n.copyFromChannel?(o(n),Z(n)):e(r,()=>r(n))||a(n),t.add(n),n))},Ks={channelCount:2,channelCountMode:"explicit",channelInterpretation:"speakers",pan:0},Qs=(t,e,n,s,i,r)=>class extends t{constructor(t,o){const a=i(t),c={...Ks,...o},u=n(a,c),l=r(a),h=l?s():null;super(t,!1,u,h),this._pan=e(this,l,u.pan)}get pan(){return this._pan}},Js=(t,e,n,s,i)=>()=>{const r=new WeakMap,o=async(o,a,c)=>{let u=n(o);const l=G(u,a);if(!l){const t={channelCount:u.channelCount,channelCountMode:u.channelCountMode,channelInterpretation:u.channelInterpretation,pan:u.pan.value};u=e(a,t)}return r.set(a,u),l?await t(a,o.pan,u.pan,c):await s(a,o.pan,u.pan,c),Ct(u)?await i(o,a,u.inputs[0],c):await i(o,a,u,c),u};return{render(t,e,n){const s=r.get(e);return void 0!==s?Promise.resolve(s):o(t,e,n)}}},ti=t=>()=>{if(null===t)return!1;try{new t({length:1,sampleRate:44100})}catch{return!1}return!0},ei=(t,e)=>async()=>{if(null===t)return!0;if(null===e)return!1;const n=new Blob(['class A extends AudioWorkletProcessor{process(i){this.port.postMessage(i,[i[0][0].buffer])}}registerProcessor("a",A)'],{type:"application/javascript; charset=utf-8"}),s=new e(1,128,8e3),i=URL.createObjectURL(n);let r=!1,o=!1;try{await s.audioWorklet.addModule(i);const e=new t(s,"a",{numberOfOutputs:0}),n=s.createOscillator();e.port.onmessage=()=>r=!0,e.onprocessorerror=()=>o=!0,n.connect(e),await s.startRendering()}catch{}finally{URL.revokeObjectURL(i)}return r&&!o},ni=(t,e)=>()=>{if(null===e)return Promise.resolve(!1);const n=new e(1,1,44100),s=t(n,{channelCount:1,channelCountMode:"explicit",channelInterpretation:"discrete",gain:0});return new Promise(t=>{n.oncomplete=()=>{s.disconnect(),t(0!==n.currentTime)},n.startRendering()})},si=()=>new DOMException("","UnknownError"),ii={channelCount:2,channelCountMode:"max",channelInterpretation:"speakers",curve:null,oversample:"none"},ri=(t,e,n,s,i,r,o)=>class extends t{constructor(t,e){const a=i(t),c={...ii,...e},u=n(a,c),l=r(a),h=l?s():null;super(t,!0,u,h),this._isCurveNullified=!1,this._nativeWaveShaperNode=u,o(this,1)}get curve(){return this._isCurveNullified?null:this._nativeWaveShaperNode.curve}set curve(t){if(null===t)this._isCurveNullified=!0,this._nativeWaveShaperNode.curve=new Float32Array([0,0]);else{if(t.length<2)throw e();this._isCurveNullified=!1,this._nativeWaveShaperNode.curve=t}}get oversample(){return this._nativeWaveShaperNode.oversample}set oversample(t){this._nativeWaveShaperNode.oversample=t}},oi=(t,e,n)=>()=>{const s=new WeakMap,i=async(i,r,o)=>{let a=e(i);const c=G(a,r);if(!c){const e={channelCount:a.channelCount,channelCountMode:a.channelCountMode,channelInterpretation:a.channelInterpretation,curve:a.curve,oversample:a.oversample};a=t(r,e)}return s.set(r,a),Ct(a)?await n(i,r,a.inputs[0],o):await n(i,r,a,o),a};return{render(t,e,n){const r=s.get(e);return void 0!==r?Promise.resolve(r):i(t,e,n)}}},ai=()=>"undefined"===typeof window?null:window,ci=(t,e)=>n=>{n.copyFromChannel=(s,i,r=0)=>{const o=t(r),a=t(i);if(a>=n.numberOfChannels)throw e();const c=n.length,u=n.getChannelData(a),l=s.length;for(let t=o<0?-o:0;t+o<c&&t<l;t+=1)s[t]=u[t+o]},n.copyToChannel=(s,i,r=0)=>{const o=t(r),a=t(i);if(a>=n.numberOfChannels)throw e();const c=n.length,u=n.getChannelData(a),l=s.length;for(let t=o<0?-o:0;t+o<c&&t<l;t+=1)u[t+o]=s[t]}},ui=t=>e=>{e.copyFromChannel=(n=>(s,i,r=0)=>{const o=t(r),a=t(i);if(o<e.length)return n.call(e,s,a,o)})(e.copyFromChannel),e.copyToChannel=(n=>(s,i,r=0)=>{const o=t(r),a=t(i);if(o<e.length)return n.call(e,s,a,o)})(e.copyToChannel)},li=t=>(e,n)=>{const s=n.createBuffer(1,1,44100);null===e.buffer&&(e.buffer=s),t(e,"buffer",t=>()=>{const n=t.call(e);return n===s?null:n},t=>n=>t.call(e,null===n?s:n))},hi=(t,e)=>(n,s)=>{s.channelCount=1,s.channelCountMode="explicit",Object.defineProperty(s,"channelCount",{get:()=>1,set:()=>{throw t()}}),Object.defineProperty(s,"channelCountMode",{get:()=>"explicit",set:()=>{throw t()}});const i=n.createBufferSource(),r=()=>{const t=s.numberOfInputs;for(let e=0;e<t;e+=1)i.connect(s,0,e)},o=()=>i.disconnect(s);e(s,r,o)},pi=t=>{if(null===t)return!1;const e=t.length;return e%2!==0?0!==t[Math.floor(e/2)]:t[e/2-1]+t[e/2]!==0},di=(t,e,n,s)=>{let i=Object.getPrototypeOf(t);while(!i.hasOwnProperty(e))i=Object.getPrototypeOf(i);const{get:r,set:o}=Object.getOwnPropertyDescriptor(i,e);Object.defineProperty(t,e,{get:n(r),set:s(o)})},fi=t=>({...t,outputChannelCount:void 0!==t.outputChannelCount?t.outputChannelCount:1===t.numberOfInputs&&1===t.numberOfOutputs?[t.channelCount]:Array.from({length:t.numberOfOutputs},()=>1)}),mi=t=>({...t,channelCount:t.numberOfOutputs}),_i=t=>{const{imag:e,real:n}=t;return void 0===e?void 0===n?{...t,imag:[0,0],real:[0,0]}:{...t,imag:Array.from(n,()=>0),real:n}:void 0===n?{...t,imag:e,real:Array.from(e,()=>0)}:{...t,imag:e,real:n}},gi=t=>{const e=t.createBufferSource();e.start();try{e.start()}catch{return!0}return!1},vi=t=>{const e=t.createBufferSource(),n=t.createBuffer(1,1,44100);e.buffer=n;try{e.start(0,1)}catch{return!1}return!0},yi=t=>{const e=t.createBufferSource();e.start();try{e.stop()}catch{return!1}return!0},bi=t=>{const e=t.createOscillator();try{e.start(-1)}catch(n){return n instanceof RangeError}return!1},wi=t=>{const e=t.createBuffer(1,1,44100),n=t.createBufferSource();n.buffer=e,n.start(),n.stop();try{return n.stop(),!0}catch{return!1}},xi=t=>{const e=t.createOscillator();try{e.stop(-1)}catch(n){return n instanceof RangeError}return!1},Ti=t=>{t.start=(e=>(n=0,s=0,i)=>{const r=t.buffer,o=null===r?s:Math.min(r.duration,s);null!==r&&o>r.duration-.5/t.context.sampleRate?e.call(t,n,0,0):e.call(t,n,o,i)})(t.start)},Ci=(t,e)=>{const n=e.createGain();t.connect(n);const s=(e=>()=>{e.call(t,n),t.removeEventListener("ended",s)})(t.disconnect);t.addEventListener("ended",s),cs(t,n),t.stop=(e=>{let s=!1;return(i=0)=>{if(s)try{e.call(t,i)}catch{n.gain.setValueAtTime(0,i)}else e.call(t,i),s=!0}})(t.stop)},Si=(t,e)=>n=>{const s={value:t};return Object.defineProperties(n,{currentTarget:s,target:s}),"function"===typeof e?e.call(t,n):e.handleEvent.call(t,n)},Ai=h(wt),ki=L(wt),Oi=Re(D),Mi=new WeakMap,Ei=Je(Mi),Ii=ue(new Map,new WeakMap),Di=ai(),Ni=Ln(Ii,H),Ri=Qe(lt),Pi=Gs(lt,Ri,Nt),Vi=X(Ni,It,Pi),qi=sn(y),ji=Ts(Di),Fi=Tn(ji),Li=new WeakMap,Bi=Ge(Si),Wi=Yn(Di),Ui=yn(Wi),zi=bn(Di),Gi=wn(Di),Xi=Yt(p(m),F(Ai,ki,St,Oi,Et,lt,Ei,R,It,wt,tt,Nt,Rt),Ii,fn(w,Et,lt,It,Dt,tt),H,an,Ns,Ee(St,w,lt,It,Dt,qi,tt,Fi),qe(Li,lt,I),Bi,qi,Ui,zi,Gi,Fi),Yi=z(Xi,Vi,H,Ni,qi,Fi),Hi=new WeakSet,Zi=Bn(Di),$i=xe(new Uint32Array(1)),Ki=ci($i,H),Qi=ui($i),Ji=K(Hi,Ii,Ns,Zi,ji,ti(Zi),Ki,Qi),tr=B(ds),er=Xs(Ri,ht,Nt),nr=_e(er),sr=Xn(tr,Ii,gi,vi,yi,bi,wi,xi,Ti,li(di),Ci),ir=zs(tn(ht),er),rr=st(nr,sr,It,ir,Pi),or=Ht(d(g),Li,v,Zt,u["createCancelAndHoldAutomationEvent"],u["createCancelScheduledValuesAutomationEvent"],u["createExponentialRampToValueAutomationEvent"],u["createLinearRampToValueAutomationEvent"],u["createSetTargetAutomationEvent"],u["createSetValueAutomationEvent"],u["createSetValueCurveAutomationEvent"],Wi),ar=nt(Xi,rr,or,nn,sr,qi,Fi,Si),cr=_t(Xi,gt,H,nn,Hn(ds,di),qi,Fi,Pi),ur=ce(nr,ss,It,ir,Pi),lr=Zs(Mi),hr=ae(Xi,or,ur,an,ss,qi,Fi,lr),pr=Pn(wt,zi),dr=hi(nn,pr),fr=is(Wi,dr),mr=pe(fr,It,Pi),_r=he(Xi,mr,fr,qi,Fi),gr=me(os,It,Pi),vr=fe(Xi,gr,os,qi,Fi,mi),yr=us(tr,sr,ds,pr),br=as(tr,Ii,yr,bi,xi),wr=we(nr,br,It,ir,Pi),xr=be(Xi,or,wr,br,qi,Fi,Si),Tr=ls(Ns,di),Cr=Se(Tr,It,Pi),Sr=Ce(Xi,Cr,Tr,qi,Fi,lr),Ar=Ne(nr,hs,It,ir,Pi),kr=De(Xi,or,Ar,hs,qi,Fi,lr),Or=ps(Ns),Mr=We(nr,Or,It,ir,Pi),Er=Be(Xi,or,Mr,Or,Ns,qi,Fi,lr),Ir=$e(nr,ds,It,ir,Pi),Dr=Ze(Xi,or,Ir,ds,qi,Fi),Nr=vs(an,nn,Os,Ns),Rr=Ys(Ii,ds,Os,ni(ds,ji)),Pr=dn(sr,It,ji,Pi,Rr),Vr=fs(Nr),qr=ln(Xi,Vr,Pr,qi,Fi,lr),jr=vt(or,fr,br,Os,Fi),Fr=new WeakMap,Lr=In(cr,jr,Bi,Fi,Fr,Si),Br=Cs(tr,Ii,bi,wi,xi,Ci),Wr=js(nr,Br,It,ir,Pi),Ur=qs(Xi,or,Br,Wr,qi,Fi,Si),zr=ve(sr),Gr=Ds(zr,nn,ds,pi,pr),Xr=Is(zr,nn,Gr,pi,pr,Wi,di),Yr=As(St,nn,fr,ds,Os,Xr,Ns,Et,pr),Hr=Ss(Yr),Zr=Bs(nr,fr,br,ds,Hr,It,ji,ir,Pi,Rr),$r=Ls(Xi,or,Hr,Zr,qi,Fi,lr),Kr=ks(H),Qr=Us(Kr,qi,new WeakSet,_i),Jr=Es(fr,os,ds,Xr,Ns,pr),to=Ms(Jr,Ns),eo=Js(nr,to,It,ir,Pi),no=Qs(Xi,or,to,eo,qi,Fi),so=oi(Xr,It,Pi),io=ri(Xi,nn,Xr,so,qi,Fi,lr),ro=Cn(Di),oo=Xe(Di),ao=new WeakMap,co=rn(ao,ji),uo=Zn(Di),lo=ro?E(Ii,Ns,ze(Di),oo,Ye(l),qi,co,Fi,new WeakMap,new WeakMap,ei(uo,ji),Di):void 0,ho=xn(Ui,Fi),po=Me(Hi,Ii,ke,Ue,new WeakSet,qi,ho,Y,Dn,Ki,Qi),fo=re(lo,Yi,Ji,ar,hr,_r,vr,xr,Sr,po,kr,Er,Dr,qr,Lr,Ur,$r,Qr,no,io),mo=Sn(Xi,ys,qi,Fi),_o=kn(Xi,bs,qi,Fi),go=On(Xi,ws,qi,Fi),vo=xs(nn,Fi),yo=Mn(Xi,vo,qi),bo=mt(fo,nn,Ns,si,mo,_o,go,yo,Wi),wo=on(Fr),xo=W(wo),To=ge(H),Co=Pe(wo),So=Fe(H),Ao=new WeakMap,ko=Ke(Ao,I),Oo=ns(To,H,nn,fr,os,br,ds,Os,Ns,So,oo,ko,pr),Mo=Kn(nn,Oo,ds,Ns,pr),Eo=ie(nr,To,sr,fr,os,br,ds,Co,So,oo,It,uo,ji,ir,Pi,Rr),Io=en(ao),Do=Hs(Ao),No=ro?Qt(xo,Xi,or,Eo,Mo,lt,Io,qi,Fi,uo,fi,Do,Si):void 0,Ro=(En(nn,Ns,si,Lr,Wi),Ae(Ns,ji)),Po=$s(Hi,Ii,Ri,wo,Rr,Y,Ki,Qi),Vo=(Rn(Ii,nn,Ro,Lr,Po),Ps(fo,Ii,nn,Ro,Po)),qo=mn(y,Ui),jo=_n(_,zi),Fo=gn(v,Gi),Lo=vn(y,Fi);function Bo(t,e){if(!t)throw new Error(e)}function Wo(t,e,n=1/0){if(!(e<=t&&t<=n))throw new RangeError(`Value must be within [${e}, ${n}], got: ${t}`)}function Uo(t){t.isOffline||"running"===t.state||Xo('The AudioContext is "suspended". Invoke Tone.start() from a user action to start the audio.')}let zo=console;function Go(...t){zo.log(...t)}function Xo(...t){zo.warn(...t)}function Yo(t){return"undefined"===typeof t}function Ho(t){return!Yo(t)}function Zo(t){return"function"===typeof t}function $o(t){return"number"===typeof t}function Ko(t){return"[object Object]"===Object.prototype.toString.call(t)&&t.constructor===Object}function Qo(t){return"boolean"===typeof t}function Jo(t){return Array.isArray(t)}function ta(t){return"string"===typeof t}function ea(t){return ta(t)&&/^([a-g]{1}(?:b|#|x|bb)?)(-?[0-9]+)/i.test(t)}function na(t){return new bo(t)}function sa(t,e,n){return new Vo(t,e,n)}const ia="object"===typeof self?self:null,ra=ia&&(ia.hasOwnProperty("AudioContext")||ia.hasOwnProperty("webkitAudioContext"));function oa(t,e,n){return Bo(Ho(No),"This node only works in a secure context (https or localhost)"),new No(t,e,n)}
/*! *****************************************************************************
Copyright (c) Microsoft Corporation.
Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted.
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
PERFORMANCE OF THIS SOFTWARE.
***************************************************************************** */function aa(t,e,n,s){var i,r=arguments.length,o=r<3?e:null===s?s=Object.getOwnPropertyDescriptor(e,n):s;if("object"===typeof Reflect&&"function"===typeof Reflect.decorate)o=Reflect.decorate(t,e,n,s);else for(var a=t.length-1;a>=0;a--)(i=t[a])&&(o=(r<3?i(o):r>3?i(e,n,o):i(e,n))||o);return r>3&&o&&Object.defineProperty(e,n,o),o}function ca(t,e,n,s){function i(t){return t instanceof n?t:new n((function(e){e(t)}))}return new(n||(n=Promise))((function(n,r){function o(t){try{c(s.next(t))}catch(e){r(e)}}function a(t){try{c(s["throw"](t))}catch(e){r(e)}}function c(t){t.done?n(t.value):i(t.value).then(o,a)}c((s=s.apply(t,e||[])).next())}))}Object.create;Object.create;class ua{constructor(t,e,n){this._callback=t,this._type=e,this._updateInterval=n,this._createClock()}_createWorker(){const t=new Blob([`\n\t\t\t// the initial timeout time\n\t\t\tlet timeoutTime = ${(1e3*this._updateInterval).toFixed(1)};\n\t\t\t// onmessage callback\n\t\t\tself.onmessage = function(msg){\n\t\t\t\ttimeoutTime = parseInt(msg.data);\n\t\t\t};\n\t\t\t// the tick function which posts a message\n\t\t\t// and schedules a new tick\n\t\t\tfunction tick(){\n\t\t\t\tsetTimeout(tick, timeoutTime);\n\t\t\t\tself.postMessage('tick');\n\t\t\t}\n\t\t\t// call tick initially\n\t\t\ttick();\n\t\t\t`],{type:"text/javascript"}),e=URL.createObjectURL(t),n=new Worker(e);n.onmessage=this._callback.bind(this),this._worker=n}_createTimeout(){this._timeout=setTimeout(()=>{this._createTimeout(),this._callback()},1e3*this._updateInterval)}_createClock(){if("worker"===this._type)try{this._createWorker()}catch(t){this._type="timeout",this._createClock()}else"timeout"===this._type&&this._createTimeout()}_disposeClock(){this._timeout&&(clearTimeout(this._timeout),this._timeout=0),this._worker&&(this._worker.terminate(),this._worker.onmessage=null)}get updateInterval(){return this._updateInterval}set updateInterval(t){this._updateInterval=Math.max(t,128/44100),"worker"===this._type&&this._worker.postMessage(Math.max(1e3*t,1))}get type(){return this._type}set type(t){this._disposeClock(),this._type=t,this._createClock()}dispose(){this._disposeClock()}}function la(t){return Fo(t)}function ha(t){return jo(t)}function pa(t){return Lo(t)}function da(t){return qo(t)}function fa(t){return t instanceof AudioBuffer}function ma(t,e){return"value"===t||la(e)||ha(e)||fa(e)}function _a(t,...e){if(!e.length)return t;const n=e.shift();if(Ko(t)&&Ko(n))for(const s in n)ma(s,n[s])?t[s]=n[s]:Ko(n[s])?(t[s]||Object.assign(t,{[s]:{}}),_a(t[s],n[s])):Object.assign(t,{[s]:n[s]});return _a(t,...e)}function ga(t,e){return t.length===e.length&&t.every((t,n)=>e[n]===t)}function va(t,e,n=[],s){const i={},r=Array.from(e);if(Ko(r[0])&&s&&!Reflect.has(r[0],s)){const e=Object.keys(r[0]).some(e=>Reflect.has(t,e));e||(_a(i,{[s]:r[0]}),n.splice(n.indexOf(s),1),r.shift())}if(1===r.length&&Ko(r[0]))_a(i,r[0]);else for(let o=0;o<n.length;o++)Ho(r[o])&&(i[n[o]]=r[o]);return _a(t,i)}function ya(t){return t.constructor.getDefaults()}function ba(t,e){return Yo(t)?e:t}function wa(t,e){return e.forEach(e=>{Reflect.has(t,e)&&delete t[e]}),t}
/**
* Tone.js
* @author Yotam Mann
* @license http://opensource.org/licenses/MIT MIT License
* @copyright 2014-2019 Yotam Mann
*/class xa{constructor(){this.debug=!1,this._wasDisposed=!1}static getDefaults(){return{}}log(...t){(this.debug||ia&&this.toString()===ia.TONE_DEBUG_CLASS)&&Go(this,...t)}dispose(){return this._wasDisposed=!0,this}get disposed(){return this._wasDisposed}toString(){return this.name}}xa.version=c;const Ta=1e-6;function Ca(t,e){return t>e+Ta}function Sa(t,e){return Ca(t,e)||ka(t,e)}function Aa(t,e){return t+Ta<e}function ka(t,e){return Math.abs(t-e)<Ta}function Oa(t,e,n){return Math.max(Math.min(t,n),e)}class Ma extends xa{constructor(){super(),this.name="Timeline",this._timeline=[];const t=va(Ma.getDefaults(),arguments,["memory"]);this.memory=t.memory,this.increasing=t.increasing}static getDefaults(){return{memory:1/0,increasing:!1}}get length(){return this._timeline.length}add(t){if(Bo(Reflect.has(t,"time"),"Timeline: events must have a time attribute"),t.time=t.time.valueOf(),this.increasing&&this.length){const e=this._timeline[this.length-1];Bo(Sa(t.time,e.time),"The time must be greater than or equal to the last scheduled time"),this._timeline.push(t)}else{const e=this._search(t.time);this._timeline.splice(e+1,0,t)}if(this.length>this.memory){const t=this.length-this.memory;this._timeline.splice(0,t)}return this}remove(t){const e=this._timeline.indexOf(t);return-1!==e&&this._timeline.splice(e,1),this}get(t,e="time"){const n=this._search(t,e);return-1!==n?this._timeline[n]:null}peek(){return this._timeline[0]}shift(){return this._timeline.shift()}getAfter(t,e="time"){const n=this._search(t,e);return n+1<this._timeline.length?this._timeline[n+1]:null}getBefore(t){const e=this._timeline.length;if(e>0&&this._timeline[e-1].time<t)return this._timeline[e-1];const n=this._search(t);return n-1>=0?this._timeline[n-1]:null}cancel(t){if(this._timeline.length>1){let e=this._search(t);if(e>=0)if(ka(this._timeline[e].time,t)){for(let n=e;n>=0;n--){if(!ka(this._timeline[n].time,t))break;e=n}this._timeline=this._timeline.slice(0,e)}else this._timeline=this._timeline.slice(0,e+1);else this._timeline=[]}else 1===this._timeline.length&&Sa(this._timeline[0].time,t)&&(this._timeline=[]);return this}cancelBefore(t){const e=this._search(t);return e>=0&&(this._timeline=this._timeline.slice(e+1)),this}previousEvent(t){const e=this._timeline.indexOf(t);return e>0?this._timeline[e-1]:null}_search(t,e="time"){if(0===this._timeline.length)return-1;let n=0;const s=this._timeline.length;let i=s;if(s>0&&this._timeline[s-1][e]<=t)return s-1;while(n<i){let s=Math.floor(n+(i-n)/2);const r=this._timeline[s],o=this._timeline[s+1];if(ka(r[e],t)){for(let n=s;n<this._timeline.length;n++){const i=this._timeline[n];if(!ka(i[e],t))break;s=n}return s}if(Aa(r[e],t)&&Ca(o[e],t))return s;Ca(r[e],t)?i=s:n=s+1}return-1}_iterate(t,e=0,n=this._timeline.length-1){this._timeline.slice(e,n+1).forEach(t)}forEach(t){return this._iterate(t),this}forEachBefore(t,e){const n=this._search(t);return-1!==n&&this._iterate(e,0,n),this}forEachAfter(t,e){const n=this._search(t);return this._iterate(e,n+1),this}forEachBetween(t,e,n){let s=this._search(t),i=this._search(e);return-1!==s&&-1!==i?(this._timeline[s].time!==t&&(s+=1),this._timeline[i].time===e&&(i-=1),this._iterate(n,s,i)):-1===s&&this._iterate(n,0,i),this}forEachFrom(t,e){let n=this._search(t);while(n>=0&&this._timeline[n].time>=t)n--;return this._iterate(e,n+1),this}forEachAtTime(t,e){const n=this._search(t);if(-1!==n&&ka(this._timeline[n].time,t)){let s=n;for(let e=n;e>=0;e--){if(!ka(this._timeline[e].time,t))break;s=e}this._iterate(t=>{e(t)},s,n)}return this}dispose(){return super.dispose(),this._timeline=[],this}}const Ea=[];function Ia(t){Ea.push(t)}function Da(t){Ea.forEach(e=>e(t))}const Na=[];function Ra(t){Na.push(t)}function Pa(t){Na.forEach(e=>e(t))}class Va extends xa{constructor(){super(...arguments),this.name="Emitter"}on(t,e){const n=t.split(/\W+/);return n.forEach(t=>{Yo(this._events)&&(this._events={}),this._events.hasOwnProperty(t)||(this._events[t]=[]),this._events[t].push(e)}),this}once(t,e){const n=(...s)=>{e(...s),this.off(t,n)};return this.on(t,n),this}off(t,e){const n=t.split(/\W+/);return n.forEach(n=>{if(Yo(this._events)&&(this._events={}),this._events.hasOwnProperty(t))if(Yo(e))this._events[t]=[];else{const n=this._events[t];for(let t=n.length-1;t>=0;t--)n[t]===e&&n.splice(t,1)}}),this}emit(t,...e){if(this._events&&this._events.hasOwnProperty(t)){const n=this._events[t].slice(0);for(let t=0,s=n.length;t<s;t++)n[t].apply(this,e)}return this}static mixin(t){["on","once","off","emit"].forEach(e=>{const n=Object.getOwnPropertyDescriptor(Va.prototype,e);Object.defineProperty(t.prototype,e,n)})}dispose(){return super.dispose(),this._events=void 0,this}}class qa extends Va{constructor(){super(...arguments),this.isOffline=!1}}class ja extends qa{constructor(){super(),this.name="Context",this._constants=new Map,this._timeouts=new Ma,this._timeoutIds=0,this._initialized=!1,this.isOffline=!1,this._workletModules=new Map;const t=va(ja.getDefaults(),arguments,["context"]);t.context?this._context=t.context:this._context=na({latencyHint:t.latencyHint}),this._ticker=new ua(this.emit.bind(this,"tick"),t.clockSource,t.updateInterval),this.on("tick",this._timeoutLoop.bind(this)),this._context.onstatechange=()=>{this.emit("statechange",this.state)},this._setLatencyHint(t.latencyHint),this.lookAhead=t.lookAhead}static getDefaults(){return{clockSource:"worker",latencyHint:"interactive",lookAhead:.1,updateInterval:.05}}initialize(){return this._initialized||(Da(this),this._initialized=!0),this}createAnalyser(){return this._context.createAnalyser()}createOscillator(){return this._context.createOscillator()}createBufferSource(){return this._context.createBufferSource()}createBiquadFilter(){return this._context.createBiquadFilter()}createBuffer(t,e,n){return this._context.createBuffer(t,e,n)}createChannelMerger(t){return this._context.createChannelMerger(t)}createChannelSplitter(t){return this._context.createChannelSplitter(t)}createConstantSource(){return this._context.createConstantSource()}createConvolver(){return this._context.createConvolver()}createDelay(t){return this._context.createDelay(t)}createDynamicsCompressor(){return this._context.createDynamicsCompressor()}createGain(){return this._context.createGain()}createIIRFilter(t,e){return this._context.createIIRFilter(t,e)}createPanner(){return this._context.createPanner()}createPeriodicWave(t,e,n){return this._context.createPeriodicWave(t,e,n)}createStereoPanner(){return this._context.createStereoPanner()}createWaveShaper(){return this._context.createWaveShaper()}createMediaStreamSource(t){Bo(da(this._context),"Not available if OfflineAudioContext");const e=this._context;return e.createMediaStreamSource(t)}createMediaStreamDestination(){Bo(da(this._context),"Not available if OfflineAudioContext");const t=this._context;return t.createMediaStreamDestination()}decodeAudioData(t){return this._context.decodeAudioData(t)}get currentTime(){return this._context.currentTime}get state(){return this._context.state}get sampleRate(){return this._context.sampleRate}get listener(){return this.initialize(),this._listener}set listener(t){Bo(!this._initialized,"The listener cannot be set after initialization."),this._listener=t}get transport(){return this.initialize(),this._transport}set transport(t){Bo(!this._initialized,"The transport cannot be set after initialization."),this._transport=t}get draw(){return this.initialize(),this._draw}set draw(t){Bo(!this._initialized,"Draw cannot be set after initialization."),this._draw=t}get destination(){return this.initialize(),this._destination}set destination(t){Bo(!this._initialized,"The destination cannot be set after initialization."),this._destination=t}createAudioWorkletNode(t,e){return oa(this.rawContext,t,e)}addAudioWorkletModule(t,e){return ca(this,void 0,void 0,(function*(){Bo(Ho(this.rawContext.audioWorklet),"AudioWorkletNode is only available in a secure context (https or localhost)"),this._workletModules.has(e)||this._workletModules.set(e,this.rawContext.audioWorklet.addModule(t)),yield this._workletModules.get(e)}))}workletsAreReady(){return ca(this,void 0,void 0,(function*(){const t=[];this._workletModules.forEach(e=>t.push(e)),yield Promise.all(t)}))}get updateInterval(){return this._ticker.updateInterval}set updateInterval(t){this._ticker.updateInterval=t}get clockSource(){return this._ticker.type}set clockSource(t){this._ticker.type=t}get latencyHint(){return this._latencyHint}_setLatencyHint(t){let e=0;if(this._latencyHint=t,ta(t))switch(t){case"interactive":e=.1;break;case"playback":e=.5;break;case"balanced":e=.25;break}this.lookAhead=e,this.updateInterval=e/2}get rawContext(){return this._context}now(){return this._context.currentTime+this.lookAhead}immediate(){return this._context.currentTime}resume(){return"suspended"===this._context.state&&da(this._context)?this._context.resume():Promise.resolve()}close(){return ca(this,void 0,void 0,(function*(){da(this._context)&&(yield this._context.close()),this._initialized&&Pa(this)}))}getConstant(t){if(this._constants.has(t))return this._constants.get(t);{const e=this._context.createBuffer(1,128,this._context.sampleRate),n=e.getChannelData(0);for(let i=0;i<n.length;i++)n[i]=t;const s=this._context.createBufferSource();return s.channelCount=1,s.channelCountMode="explicit",s.buffer=e,s.loop=!0,s.start(0),this._constants.set(t,s),s}}dispose(){return super.dispose(),this._ticker.dispose(),this._timeouts.dispose(),Object.keys(this._constants).map(t=>this._constants[t].disconnect()),this}_timeoutLoop(){const t=this.now();let e=this._timeouts.peek();while(this._timeouts.length&&e&&e.time<=t)e.callback(),this._timeouts.shift(),e=this._timeouts.peek()}setTimeout(t,e){this._timeoutIds++;const n=this.now();return this._timeouts.add({callback:t,id:this._timeoutIds,time:n+e}),this._timeoutIds}clearTimeout(t){return this._timeouts.forEach(e=>{e.id===t&&this._timeouts.remove(e)}),this}clearInterval(t){return this.clearTimeout(t)}setInterval(t,e){const n=++this._timeoutIds,s=()=>{const i=this.now();this._timeouts.add({callback:()=>{t(),s()},id:n,time:i+e})};return s(),n}}class Fa extends qa{constructor(){super(...arguments),this.lookAhead=0,this.latencyHint=0,this.isOffline=!1}createAnalyser(){return{}}createOscillator(){return{}}createBufferSource(){return{}}createBiquadFilter(){return{}}createBuffer(t,e,n){return{}}createChannelMerger(t){return{}}createChannelSplitter(t){return{}}createConstantSource(){return{}}createConvolver(){return{}}createDelay(t){return{}}createDynamicsCompressor(){return{}}createGain(){return{}}createIIRFilter(t,e){return{}}createPanner(){return{}}createPeriodicWave(t,e,n){return{}}createStereoPanner(){return{}}createWaveShaper(){return{}}createMediaStreamSource(t){return{}}createMediaStreamDestination(){return{}}decodeAudioData(t){return Promise.resolve({})}createAudioWorkletNode(t,e){return{}}get rawContext(){return{}}addAudioWorkletModule(t,e){return ca(this,void 0,void 0,(function*(){return Promise.resolve()}))}resume(){return Promise.resolve()}setTimeout(t,e){return 0}clearTimeout(t){return this}setInterval(t,e){return 0}clearInterval(t){return this}getConstant(t){return{}}get currentTime(){return 0}get state(){return{}}get sampleRate(){return 0}get listener(){return{}}get transport(){return{}}get draw(){return{}}set draw(t){}get destination(){return{}}set destination(t){}now(){return 0}immediate(){return 0}}function La(t,e){Jo(e)?e.forEach(e=>La(t,e)):Object.defineProperty(t,e,{enumerable:!0,writable:!1})}function Ba(t,e){Jo(e)?e.forEach(e=>Ba(t,e)):Object.defineProperty(t,e,{writable:!0})}const Wa=()=>{};class Ua extends xa{constructor(){super(),this.name="ToneAudioBuffer",this.onload=Wa;const t=va(Ua.getDefaults(),arguments,["url","onload","onerror"]);this.reverse=t.reverse,this.onload=t.onload,t.url&&fa(t.url)||t.url instanceof Ua?this.set(t.url):ta(t.url)&&this.load(t.url).catch(t.onerror)}static getDefaults(){return{onerror:Wa,onload:Wa,reverse:!1}}get sampleRate(){return this._buffer?this._buffer.sampleRate:Ya().sampleRate}set(t){return t instanceof Ua?t.loaded?this._buffer=t.get():t.onload=()=>{this.set(t),this.onload(this)}:this._buffer=t,this._reversed&&this._reverse(),this}get(){return this._buffer}load(t){return ca(this,void 0,void 0,(function*(){const e=Ua.load(t).then(t=>{this.set(t),this.onload(this)});Ua.downloads.push(e);try{yield e}finally{const t=Ua.downloads.indexOf(e);Ua.downloads.splice(t,1)}return this}))}dispose(){return super.dispose(),this._buffer=void 0,this}fromArray(t){const e=Jo(t)&&t[0].length>0,n=e?t.length:1,s=e?t[0].length:t.length,i=Ya(),r=i.createBuffer(n,s,i.sampleRate),o=e||1!==n?t:[t];for(let a=0;a<n;a++)r.copyToChannel(o[a],a);return this._buffer=r,this}toMono(t){if($o(t))this.fromArray(this.toArray(t));else{let t=new Float32Array(this.length);const e=this.numberOfChannels;for(let n=0;n<e;n++){const e=this.toArray(n);for(let n=0;n<e.length;n++)t[n]+=e[n]}t=t.map(t=>t/e),this.fromArray(t)}return this}toArray(t){if($o(t))return this.getChannelData(t);if(1===this.numberOfChannels)return this.toArray(0);{const t=[];for(let e=0;e<this.numberOfChannels;e++)t[e]=this.getChannelData(e);return t}}getChannelData(t){return this._buffer?this._buffer.getChannelData(t):new Float32Array(0)}slice(t,e=this.duration){const n=Math.floor(t*this.sampleRate),s=Math.floor(e*this.sampleRate);Bo(n<s,"The start time must be less than the end time");const i=s-n,r=Ya().createBuffer(this.numberOfChannels,i,this.sampleRate);for(let o=0;o<this.numberOfChannels;o++)r.copyToChannel(this.getChannelData(o).subarray(n,s),o);return new Ua(r)}_reverse(){if(this.loaded)for(let t=0;t<this.numberOfChannels;t++)this.getChannelData(t).reverse();return this}get loaded(){return this.length>0}get duration(){return this._buffer?this._buffer.duration:0}get length(){return this._buffer?this._buffer.length:0}get numberOfChannels(){return this._buffer?this._buffer.numberOfChannels:0}get reverse(){return this._reversed}set reverse(t){this._reversed!==t&&(this._reversed=t,this._reverse())}static fromArray(t){return(new Ua).fromArray(t)}static fromUrl(t){return ca(this,void 0,void 0,(function*(){const e=new Ua;return yield e.load(t)}))}static load(t){return ca(this,void 0,void 0,(function*(){const e=t.match(/\[(.+\|?)+\]$/);if(e){const n=e[1].split("|");let s=n[0];for(const t of n)if(Ua.supportsType(t)){s=t;break}t=t.replace(e[0],s)}const n=""===Ua.baseUrl||Ua.baseUrl.endsWith("/")?Ua.baseUrl:Ua.baseUrl+"/",s=yield fetch(n+t);if(!s.ok)throw new Error("could not load url: "+t);const i=yield s.arrayBuffer(),r=yield Ya().decodeAudioData(i);return r}))}static supportsType(t){const e=t.split("."),n=e[e.length-1],s=document.createElement("audio").canPlayType("audio/"+n);return""!==s}static loaded(){return ca(this,void 0,void 0,(function*(){yield Promise.resolve();while(Ua.downloads.length)yield Ua.downloads[0]}))}}Ua.baseUrl="",Ua.downloads=[];class za extends ja{constructor(){super({clockSource:"offline",context:pa(arguments[0])?arguments[0]:sa(arguments[0],arguments[1]*arguments[2],arguments[2]),lookAhead:0,updateInterval:pa(arguments[0])?128/arguments[0].sampleRate:128/arguments[2]}),this.name="OfflineContext",this._currentTime=0,this.isOffline=!0,this._duration=pa(arguments[0])?arguments[0].length/arguments[0].sampleRate:arguments[1]}now(){return this._currentTime}get currentTime(){return this._currentTime}_renderClock(t){return ca(this,void 0,void 0,(function*(){let e=0;while(this._duration-this._currentTime>=0){this.emit("tick"),this._currentTime+=128/this.sampleRate,e++;const n=Math.floor(this.sampleRate/128);t&&e%n===0&&(yield new Promise(t=>setTimeout(t,1)))}}))}render(t=!0){return ca(this,void 0,void 0,(function*(){yield this.workletsAreReady(),yield this._renderClock(t);const e=yield this._context.startRendering();return new Ua(e)}))}close(){return Promise.resolve()}}const Ga=new Fa;let Xa=Ga;function Ya(){return Xa===Ga&&ra&&Ha(new ja),Xa}function Ha(t){Xa=da(t)?new ja(t):pa(t)?new za(t):t}if(ia&&!ia.TONE_SILENCE_LOGGING){let t="v";"dev"===c&&(t="");const e=` * Tone.js ${t}${c} * `;console.log("%c"+e,"background: #000; color: #fff")}function Za(t){return Math.pow(10,t/20)}function $a(t){return Math.log(t)/Math.LN10*20}function Ka(t){return Math.pow(2,t/12)}let Qa=440;function Ja(){return Qa}function tc(t){Qa=t}function ec(t){return Math.round(nc(t))}function nc(t){return 69+12*Math.log2(t/Qa)}function sc(t){return Qa*Math.pow(2,(t-69)/12)}class ic extends xa{constructor(t,e,n){super(),this.defaultUnits="s",this._val=e,this._units=n,this.context=t,this._expressions=this._getExpressions()}_getExpressions(){return{hz:{method:t=>this._frequencyToUnits(parseFloat(t)),regexp:/^(\d+(?:\.\d+)?)hz$/i},i:{method:t=>this._ticksToUnits(parseInt(t,10)),regexp:/^(\d+)i$/i},m:{method:t=>this._beatsToUnits(parseInt(t,10)*this._getTimeSignature()),regexp:/^(\d+)m$/i},n:{method:(t,e)=>{const n=parseInt(t,10),s="."===e?1.5:1;return 1===n?this._beatsToUnits(this._getTimeSignature())*s:this._beatsToUnits(4/n)*s},regexp:/^(\d+)n(\.?)$/i},number:{method:t=>this._expressions[this.defaultUnits].method.call(this,t),regexp:/^(\d+(?:\.\d+)?)$/},s:{method:t=>this._secondsToUnits(parseFloat(t)),regexp:/^(\d+(?:\.\d+)?)s$/},samples:{method:t=>parseInt(t,10)/this.context.sampleRate,regexp:/^(\d+)samples$/},t:{method:t=>{const e=parseInt(t,10);return this._beatsToUnits(8/(3*Math.floor(e)))},regexp:/^(\d+)t$/i},tr:{method:(t,e,n)=>{let s=0;return t&&"0"!==t&&(s+=this._beatsToUnits(this._getTimeSignature()*parseFloat(t))),e&&"0"!==e&&(s+=this._beatsToUnits(parseFloat(e))),n&&"0"!==n&&(s+=this._beatsToUnits(parseFloat(n)/4)),s},regexp:/^(\d+(?:\.\d+)?):(\d+(?:\.\d+)?):?(\d+(?:\.\d+)?)?$/}}}valueOf(){if(this._val instanceof ic&&this.fromType(this._val),Yo(this._val))return this._noArg();if(ta(this._val)&&Yo(this._units)){for(const t in this._expressions)if(this._expressions[t].regexp.test(this._val.trim())){this._units=t;break}}else if(Ko(this._val)){let t=0;for(const e in this._val)if(Ho(this._val[e])){const n=this._val[e],s=new this.constructor(this.context,e).valueOf()*n;t+=s}return t}if(Ho(this._units)){const t=this._expressions[this._units],e=this._val.toString().trim().match(t.regexp);return e?t.method.apply(this,e.slice(1)):t.method.call(this,this._val)}return ta(this._val)?parseFloat(this._val):this._val}_frequencyToUnits(t){return 1/t}_beatsToUnits(t){return 60/this._getBpm()*t}_secondsToUnits(t){return t}_ticksToUnits(t){return t*this._beatsToUnits(1)/this._getPPQ()}_noArg(){return this._now()}_getBpm(){return this.context.transport.bpm.value}_getTimeSignature(){return this.context.transport.timeSignature}_getPPQ(){return this.context.transport.PPQ}fromType(t){switch(this._units=void 0,this.defaultUnits){case"s":this._val=t.toSeconds();break;case"i":this._val=t.toTicks();break;case"hz":this._val=t.toFrequency();break;case"midi":this._val=t.toMidi();break}return this}toFrequency(){return 1/this.toSeconds()}toSamples(){return this.toSeconds()*this.context.sampleRate}toMilliseconds(){return 1e3*this.toSeconds()}}class rc extends ic{constructor(){super(...arguments),this.name="TimeClass"}_getExpressions(){return Object.assign(super._getExpressions(),{now:{method:t=>this._now()+new this.constructor(this.context,t).valueOf(),regexp:/^\+(.+)/},quantize:{method:t=>{const e=new rc(this.context,t).valueOf();return this._secondsToUnits(this.context.transport.nextSubdivision(e))},regexp:/^@(.+)/}})}quantize(t,e=1){const n=new this.constructor(this.context,t).valueOf(),s=this.valueOf(),i=Math.round(s/n),r=i*n,o=r-s;return s+o*e}toNotation(){const t=this.toSeconds(),e=["1m"];for(let i=1;i<9;i++){const t=Math.pow(2,i);e.push(t+"n."),e.push(t+"n"),e.push(t+"t")}e.push("0");let n=e[0],s=new rc(this.context,e[0]).toSeconds();return e.forEach(e=>{const i=new rc(this.context,e).toSeconds();Math.abs(i-t)<Math.abs(s-t)&&(n=e,s=i)}),n}toBarsBeatsSixteenths(){const t=this._beatsToUnits(1);let e=this.valueOf()/t;e=parseFloat(e.toFixed(4));const n=Math.floor(e/this._getTimeSignature());let s=e%1*4;e=Math.floor(e)%this._getTimeSignature();const i=s.toString();i.length>3&&(s=parseFloat(parseFloat(i).toFixed(3)));const r=[n,e,s];return r.join(":")}toTicks(){const t=this._beatsToUnits(1),e=this.valueOf()/t;return Math.round(e*this._getPPQ())}toSeconds(){return this.valueOf()}toMidi(){return ec(this.toFrequency())}_now(){return this.context.now()}}class oc extends rc{constructor(){super(...arguments),this.name="Frequency",this.defaultUnits="hz"}static get A4(){return Ja()}static set A4(t){tc(t)}_getExpressions(){return Object.assign({},super._getExpressions(),{midi:{regexp:/^(\d+(?:\.\d+)?midi)/,method(t){return"midi"===this.defaultUnits?t:oc.mtof(t)}},note:{regexp:/^([a-g]{1}(?:b|#|x|bb)?)(-?[0-9]+)/i,method(t,e){const n=ac[t.toLowerCase()],s=n+12*(parseInt(e,10)+1);return"midi"===this.defaultUnits?s:oc.mtof(s)}},tr:{regexp:/^(\d+(?:\.\d+)?):(\d+(?:\.\d+)?):?(\d+(?:\.\d+)?)?/,method(t,e,n){let s=1;return t&&"0"!==t&&(s*=this._beatsToUnits(this._getTimeSignature()*parseFloat(t))),e&&"0"!==e&&(s*=this._beatsToUnits(parseFloat(e))),n&&"0"!==n&&(s*=this._beatsToUnits(parseFloat(n)/4)),s}}})}transpose(t){return new oc(this.context,this.valueOf()*Ka(t))}harmonize(t){return t.map(t=>this.transpose(t))}toMidi(){return ec(this.valueOf())}toNote(){const t=this.toFrequency(),e=Math.log2(t/oc.A4);let n=Math.round(12*e)+57;const s=Math.floor(n/12);s<0&&(n+=-12*s);const i=cc[n%12];return i+s.toString()}toSeconds(){return 1/super.toSeconds()}toTicks(){const t=this._beatsToUnits(1),e=this.valueOf()/t;return Math.floor(e*this._getPPQ())}_noArg(){return 0}_frequencyToUnits(t){return t}_ticksToUnits(t){return 1/(60*t/(this._getBpm()*this._getPPQ()))}_beatsToUnits(t){return 1/super._beatsToUnits(t)}_secondsToUnits(t){return 1/t}static mtof(t){return sc(t)}static ftom(t){return ec(t)}}const ac={cbb:-2,cb:-1,c:0,"c#":1,cx:2,dbb:0,db:1,d:2,"d#":3,dx:4,ebb:2,eb:3,e:4,"e#":5,ex:6,fbb:3,fb:4,f:5,"f#":6,fx:7,gbb:5,gb:6,g:7,"g#":8,gx:9,abb:7,ab:8,a:9,"a#":10,ax:11,bbb:9,bb:10,b:11,"b#":12,bx:13},cc=["C","C#","D","D#","E","F","F#","G","G#","A","A#","B"];class uc extends rc{constructor(){super(...arguments),this.name="TransportTime"}_now(){return this.context.transport.seconds}}class lc extends xa{constructor(){super();const t=va(lc.getDefaults(),arguments,["context"]);this.defaultContext?this.context=this.defaultContext:this.context=t.context}static getDefaults(){return{context:Ya()}}now(){return this.context.currentTime+this.context.lookAhead}immediate(){return this.context.currentTime}get sampleTime(){return 1/this.context.sampleRate}get blockTime(){return 128/this.context.sampleRate}toSeconds(t){return new rc(this.context,t).toSeconds()}toFrequency(t){return new oc(this.context,t).toFrequency()}toTicks(t){return new uc(this.context,t).toTicks()}_getPartialProperties(t){const e=this.get();return Object.keys(e).forEach(n=>{Yo(t[n])&&delete e[n]}),e}get(){const t=ya(this);return Object.keys(t).forEach(e=>{if(Reflect.has(this,e)){const n=this[e];Ho(n)&&Ho(n.value)&&Ho(n.setValueAtTime)?t[e]=n.value:n instanceof lc?t[e]=n._getPartialProperties(t[e]):Jo(n)||$o(n)||ta(n)||Qo(n)?t[e]=n:delete t[e]}}),t}set(t){return Object.keys(t).forEach(e=>{Reflect.has(this,e)&&Ho(this[e])&&(this[e]&&Ho(this[e].value)&&Ho(this[e].setValueAtTime)?this[e].value!==t[e]&&(this[e].value=t[e]):this[e]instanceof lc?this[e].set(t[e]):this[e]=t[e])}),this}}class hc extends Ma{constructor(t="stopped"){super(),this.name="StateTimeline",this._initial=t,this.setStateAtTime(this._initial,0)}getValueAtTime(t){const e=this.get(t);return null!==e?e.state:this._initial}setStateAtTime(t,e,n){return Wo(e,0),this.add(Object.assign({},n,{state:t,time:e})),this}getLastState(t,e){const n=this._search(e);for(let s=n;s>=0;s--){const e=this._timeline[s];if(e.state===t)return e}}getNextState(t,e){const n=this._search(e);if(-1!==n)for(let s=n;s<this._timeline.length;s++){const e=this._timeline[s];if(e.state===t)return e}}}class pc extends lc{constructor(){super(va(pc.getDefaults(),arguments,["param","units","convert"])),this.name="Param",this.overridden=!1,this._minOutput=1e-7;const t=va(pc.getDefaults(),arguments,["param","units","convert"]);Bo(Ho(t.param)&&(la(t.param)||t.param instanceof pc),"param must be an AudioParam");while(!la(t.param))t.param=t.param._param;this._swappable=!!Ho(t.swappable)&&t.swappable,this._swappable?(this.input=this.context.createGain(),this._param=t.param,this.input.connect(this._param)):this._param=this.input=t.param,this._events=new Ma(1e3),this._initialValue=this._param.defaultValue,this.units=t.units,this.convert=t.convert,this._minValue=t.minValue,this._maxValue=t.maxValue,Ho(t.value)&&t.value!==this._toType(this._initialValue)&&this.setValueAtTime(t.value,0)}static getDefaults(){return Object.assign(lc.getDefaults(),{convert:!0,units:"number"})}get value(){const t=this.now();return this.getValueAtTime(t)}set value(t){this.cancelScheduledValues(this.now()),this.setValueAtTime(t,this.now())}get minValue(){return Ho(this._minValue)?this._minValue:"time"===this.units||"frequency"===this.units||"normalRange"===this.units||"positive"===this.units||"transportTime"===this.units||"ticks"===this.units||"bpm"===this.units||"hertz"===this.units||"samples"===this.units?0:"audioRange"===this.units?-1:"decibels"===this.units?-1/0:this._param.minValue}get maxValue(){return Ho(this._maxValue)?this._maxValue:"normalRange"===this.units||"audioRange"===this.units?1:this._param.maxValue}_is(t,e){return this.units===e}_assertRange(t){return Ho(this.maxValue)&&Ho(this.minValue)&&Wo(t,this._fromType(this.minValue),this._fromType(this.maxValue)),t}_fromType(t){return this.convert&&!this.overridden?this._is(t,"time")?this.toSeconds(t):this._is(t,"decibels")?Za(t):this._is(t,"frequency")?this.toFrequency(t):t:this.overridden?0:t}_toType(t){return this.convert&&"decibels"===this.units?$a(t):t}setValueAtTime(t,e){const n=this.toSeconds(e),s=this._fromType(t);return Bo(isFinite(s)&&isFinite(n),`Invalid argument(s) to setValueAtTime: ${JSON.stringify(t)}, ${JSON.stringify(e)}`),this._assertRange(s),this.log(this.units,"setValueAtTime",t,n),this._events.add({time:n,type:"setValueAtTime",value:s}),this._param.setValueAtTime(s,n),this}getValueAtTime(t){const e=Math.max(this.toSeconds(t),0),n=this._events.getAfter(e),s=this._events.get(e);let i=this._initialValue;if(null===s)i=this._initialValue;else if("setTargetAtTime"!==s.type||null!==n&&"setValueAtTime"!==n.type)if(null===n)i=s.value;else if("linearRampToValueAtTime"===n.type||"exponentialRampToValueAtTime"===n.type){let t=s.value;if("setTargetAtTime"===s.type){const e=this._events.getBefore(s.time);t=null===e?this._initialValue:e.value}i="linearRampToValueAtTime"===n.type?this._linearInterpolate(s.time,t,n.time,n.value,e):this._exponentialInterpolate(s.time,t,n.time,n.value,e)}else i=s.value;else{const t=this._events.getBefore(s.time);let n;n=null===t?this._initialValue:t.value,"setTargetAtTime"===s.type&&(i=this._exponentialApproach(s.time,n,s.value,s.constant,e))}return this._toType(i)}setRampPoint(t){t=this.toSeconds(t);let e=this.getValueAtTime(t);return this.cancelAndHoldAtTime(t),0===this._fromType(e)&&(e=this._toType(this._minOutput)),this.setValueAtTime(e,t),this}linearRampToValueAtTime(t,e){const n=this._fromType(t),s=this.toSeconds(e);return Bo(isFinite(n)&&isFinite(s),`Invalid argument(s) to linearRampToValueAtTime: ${JSON.stringify(t)}, ${JSON.stringify(e)}`),this._assertRange(n),this._events.add({time:s,type:"linearRampToValueAtTime",value:n}),this.log(this.units,"linearRampToValueAtTime",t,s),this._param.linearRampToValueAtTime(n,s),this}exponentialRampToValueAtTime(t,e){let n=this._fromType(t);n=Math.max(this._minOutput,n),this._assertRange(n);const s=this.toSeconds(e);return Bo(isFinite(n)&&isFinite(s),`Invalid argument(s) to exponentialRampToValueAtTime: ${JSON.stringify(t)}, ${JSON.stringify(e)}`),this._events.add({time:s,type:"exponentialRampToValueAtTime",value:n}),this.log(this.units,"exponentialRampToValueAtTime",t,s),this._param.exponentialRampToValueAtTime(n,s),this}exponentialRampTo(t,e,n){return n=this.toSeconds(n),this.setRampPoint(n),this.exponentialRampToValueAtTime(t,n+this.toSeconds(e)),this}linearRampTo(t,e,n){return n=this.toSeconds(n),this.setRampPoint(n),this.linearRampToValueAtTime(t,n+this.toSeconds(e)),this}targetRampTo(t,e,n){return n=this.toSeconds(n),this.setRampPoint(n),this.exponentialApproachValueAtTime(t,n,e),this}exponentialApproachValueAtTime(t,e,n){e=this.toSeconds(e),n=this.toSeconds(n);const s=Math.log(n+1)/Math.log(200);return this.setTargetAtTime(t,e,s),this.cancelAndHoldAtTime(e+.9*n),this.linearRampToValueAtTime(t,e+n),this}setTargetAtTime(t,e,n){const s=this._fromType(t);Bo(isFinite(n)&&n>0,"timeConstant must be a number greater than 0");const i=this.toSeconds(e);return this._assertRange(s),Bo(isFinite(s)&&isFinite(i),`Invalid argument(s) to setTargetAtTime: ${JSON.stringify(t)}, ${JSON.stringify(e)}`),this._events.add({constant:n,time:i,type:"setTargetAtTime",value:s}),this.log(this.units,"setTargetAtTime",t,i,n),this._param.setTargetAtTime(s,i,n),this}setValueCurveAtTime(t,e,n,s=1){n=this.toSeconds(n),e=this.toSeconds(e);const i=this._fromType(t[0])*s;this.setValueAtTime(this._toType(i),e);const r=n/(t.length-1);for(let o=1;o<t.length;o++){const n=this._fromType(t[o])*s;this.linearRampToValueAtTime(this._toType(n),e+o*r)}return this}cancelScheduledValues(t){const e=this.toSeconds(t);return Bo(isFinite(e),"Invalid argument to cancelScheduledValues: "+JSON.stringify(t)),this._events.cancel(e),this._param.cancelScheduledValues(e),this.log(this.units,"cancelScheduledValues",e),this}cancelAndHoldAtTime(t){const e=this.toSeconds(t),n=this._fromType(this.getValueAtTime(e));Bo(isFinite(e),"Invalid argument to cancelAndHoldAtTime: "+JSON.stringify(t)),this.log(this.units,"cancelAndHoldAtTime",e,"value="+n);const s=this._events.get(e),i=this._events.getAfter(e);return s&&ka(s.time,e)?i?(this._param.cancelScheduledValues(i.time),this._events.cancel(i.time)):(this._param.cancelAndHoldAtTime(e),this._events.cancel(e+this.sampleTime)):i&&(this._param.cancelScheduledValues(i.time),this._events.cancel(i.time),"linearRampToValueAtTime"===i.type?this.linearRampToValueAtTime(this._toType(n),e):"exponentialRampToValueAtTime"===i.type&&this.exponentialRampToValueAtTime(this._toType(n),e)),this._events.add({time:e,type:"setValueAtTime",value:n}),this._param.setValueAtTime(n,e),this}rampTo(t,e=.1,n){return"frequency"===this.units||"bpm"===this.units||"decibels"===this.units?this.exponentialRampTo(t,e,n):this.linearRampTo(t,e,n),this}apply(t){const e=this.context.currentTime;t.setValueAtTime(this.getValueAtTime(e),e);const n=this._events.get(e);if(n&&"setTargetAtTime"===n.type){const s=this._events.getAfter(n.time),i=s?s.time:e+2,r=(i-e)/10;for(let n=e;n<i;n+=r)t.linearRampToValueAtTime(this.getValueAtTime(n),n)}return this._events.forEachAfter(this.context.currentTime,e=>{"cancelScheduledValues"===e.type?t.cancelScheduledValues(e.time):"setTargetAtTime"===e.type?t.setTargetAtTime(e.value,e.time,e.constant):t[e.type](e.value,e.time)}),this}setParam(t){Bo(this._swappable,"The Param must be assigned as 'swappable' in the constructor");const e=this.input;return e.disconnect(this._param),this.apply(t),this._param=t,e.connect(this._param),this}dispose(){return super.dispose(),this._events.dispose(),this}get defaultValue(){return this._toType(this._param.defaultValue)}_exponentialApproach(t,e,n,s,i){return n+(e-n)*Math.exp(-(i-t)/s)}_linearInterpolate(t,e,n,s,i){return e+(i-t)/(n-t)*(s-e)}_exponentialInterpolate(t,e,n,s,i){return e*Math.pow(s/e,(i-t)/(n-t))}}class dc extends lc{constructor(){super(...arguments),this.name="ToneAudioNode",this._internalChannels=[]}get numberOfInputs(){return Ho(this.input)?la(this.input)||this.input instanceof pc?1:this.input.numberOfInputs:0}get numberOfOutputs(){return Ho(this.output)?this.output.numberOfOutputs:0}_isAudioNode(t){return Ho(t)&&(t instanceof dc||ha(t))}_getInternalNodes(){const t=this._internalChannels.slice(0);return this._isAudioNode(this.input)&&t.push(this.input),this._isAudioNode(this.output)&&this.input!==this.output&&t.push(this.output),t}_setChannelProperties(t){const e=this._getInternalNodes();e.forEach(e=>{e.channelCount=t.channelCount,e.channelCountMode=t.channelCountMode,e.channelInterpretation=t.channelInterpretation})}_getChannelProperties(){const t=this._getInternalNodes();Bo(t.length>0,"ToneAudioNode does not have any internal nodes");const e=t[0];return{channelCount:e.channelCount,channelCountMode:e.channelCountMode,channelInterpretation:e.channelInterpretation}}get channelCount(){return this._getChannelProperties().channelCount}set channelCount(t){const e=this._getChannelProperties();this._setChannelProperties(Object.assign(e,{channelCount:t}))}get channelCountMode(){return this._getChannelProperties().channelCountMode}set channelCountMode(t){const e=this._getChannelProperties();this._setChannelProperties(Object.assign(e,{channelCountMode:t}))}get channelInterpretation(){return this._getChannelProperties().channelInterpretation}set channelInterpretation(t){const e=this._getChannelProperties();this._setChannelProperties(Object.assign(e,{channelInterpretation:t}))}connect(t,e=0,n=0){return mc(this,t,e,n),this}toDestination(){return this.connect(this.context.destination),this}toMaster(){return Xo("toMaster() has been renamed toDestination()"),this.toDestination()}disconnect(t,e=0,n=0){return _c(this,t,e,n),this}chain(...t){return fc(this,...t),this}fan(...t){return t.forEach(t=>this.connect(t)),this}dispose(){return super.dispose(),Ho(this.input)&&(this.input instanceof dc?this.input.dispose():ha(this.input)&&this.input.disconnect()),Ho(this.output)&&(this.output instanceof dc?this.output.dispose():ha(this.output)&&this.output.disconnect()),this._internalChannels=[],this}}function fc(...t){const e=t.shift();t.reduce((t,e)=>(t instanceof dc?t.connect(e):ha(t)&&mc(t,e),e),e)}function mc(t,e,n=0,s=0){Bo(Ho(t),"Cannot connect from undefined node"),Bo(Ho(e),"Cannot connect to undefined node"),(e instanceof dc||ha(e))&&Bo(e.numberOfInputs>0,"Cannot connect to node with no inputs"),Bo(t.numberOfOutputs>0,"Cannot connect from node with no outputs");while(e instanceof dc||e instanceof pc)Ho(e.input)&&(e=e.input);while(t instanceof dc)Ho(t.output)&&(t=t.output);la(e)?t.connect(e,n):t.connect(e,n,s)}function _c(t,e,n=0,s=0){if(Ho(e))while(e instanceof dc)e=e.input;while(!ha(t))Ho(t.output)&&(t=t.output);la(e)?t.disconnect(e,n):ha(e)?t.disconnect(e,n,s):t.disconnect()}class gc extends dc{constructor(){super(va(gc.getDefaults(),arguments,["gain","units"])),this.name="Gain",this._gainNode=this.context.createGain(),this.input=this._gainNode,this.output=this._gainNode;const t=va(gc.getDefaults(),arguments,["gain","units"]);this.gain=new pc({context:this.context,convert:t.convert,param:this._gainNode.gain,units:t.units,value:t.gain,minValue:t.minValue,maxValue:t.maxValue}),La(this,"gain")}static getDefaults(){return Object.assign(dc.getDefaults(),{convert:!0,gain:1,units:"gain"})}dispose(){return super.dispose(),this._gainNode.disconnect(),this.gain.dispose(),this}}class vc extends dc{constructor(t){super(t),this.onended=Wa,this._startTime=-1,this._stopTime=-1,this._timeout=-1,this.output=new gc({context:this.context,gain:0}),this._gainNode=this.output,this.getStateAtTime=function(t){const e=this.toSeconds(t);return-1!==this._startTime&&e>=this._startTime&&(-1===this._stopTime||e<=this._stopTime)?"started":"stopped"},this._fadeIn=t.fadeIn,this._fadeOut=t.fadeOut,this._curve=t.curve,this.onended=t.onended}static getDefaults(){return Object.assign(dc.getDefaults(),{curve:"linear",fadeIn:0,fadeOut:0,onended:Wa})}_startGain(t,e=1){Bo(-1===this._startTime,"Source cannot be started more than once");const n=this.toSeconds(this._fadeIn);return this._startTime=t+n,this._startTime=Math.max(this._startTime,this.context.currentTime),n>0?(this._gainNode.gain.setValueAtTime(0,t),"linear"===this._curve?this._gainNode.gain.linearRampToValueAtTime(e,t+n):this._gainNode.gain.exponentialApproachValueAtTime(e,t,n)):this._gainNode.gain.setValueAtTime(e,t),this}stop(t){return this.log("stop",t),this._stopGain(this.toSeconds(t)),this}_stopGain(t){Bo(-1!==this._startTime,"'start' must be called before 'stop'"),this.cancelStop();const e=this.toSeconds(this._fadeOut);return this._stopTime=this.toSeconds(t)+e,this._stopTime=Math.max(this._stopTime,this.context.currentTime),e>0?"linear"===this._curve?this._gainNode.gain.linearRampTo(0,e,t):this._gainNode.gain.targetRampTo(0,e,t):(this._gainNode.gain.cancelAndHoldAtTime(t),this._gainNode.gain.setValueAtTime(0,t)),this.context.clearTimeout(this._timeout),this._timeout=this.context.setTimeout(()=>{const t="exponential"===this._curve?2*e:0;this._stopSource(this.now()+t),this._onended()},this._stopTime-this.context.currentTime),this}_onended(){if(this.onended!==Wa&&(this.onended(this),this.onended=Wa,!this.context.isOffline)){const t=()=>this.dispose();"undefined"!==typeof window.requestIdleCallback?window.requestIdleCallback(t):setTimeout(t,1e3)}}get state(){return this.getStateAtTime(this.now())}cancelStop(){return this.log("cancelStop"),Bo(-1!==this._startTime,"Source is not started"),this._gainNode.gain.cancelScheduledValues(this._startTime+this.sampleTime),this.context.clearTimeout(this._timeout),this._stopTime=-1,this}dispose(){return super.dispose(),this._gainNode.disconnect(),this}}class yc extends vc{constructor(){super(va(yc.getDefaults(),arguments,["offset"])),this.name="ToneConstantSource",this._source=this.context.createConstantSource();const t=va(yc.getDefaults(),arguments,["offset"]);mc(this._source,this._gainNode),this.offset=new pc({context:this.context,convert:t.convert,param:this._source.offset,units:t.units,value:t.offset,minValue:t.minValue,maxValue:t.maxValue})}static getDefaults(){return Object.assign(vc.getDefaults(),{convert:!0,offset:1,units:"number"})}start(t){const e=this.toSeconds(t);return this.log("start",e),this._startGain(e),this._source.start(e),this}_stopSource(t){this._source.stop(t)}dispose(){return super.dispose(),"started"===this.state&&this.stop(),this._source.disconnect(),this.offset.dispose(),this}}class bc extends dc{constructor(){super(va(bc.getDefaults(),arguments,["value","units"])),this.name="Signal",this.override=!0;const t=va(bc.getDefaults(),arguments,["value","units"]);this.output=this._constantSource=new yc({context:this.context,convert:t.convert,offset:t.value,units:t.units,minValue:t.minValue,maxValue:t.maxValue}),this._constantSource.start(0),this.input=this._param=this._constantSource.offset}static getDefaults(){return Object.assign(dc.getDefaults(),{convert:!0,units:"number",value:0})}connect(t,e=0,n=0){return wc(this,t,e,n),this}dispose(){return super.dispose(),this._param.dispose(),this._constantSource.dispose(),this}setValueAtTime(t,e){return this._param.setValueAtTime(t,e),this}getValueAtTime(t){return this._param.getValueAtTime(t)}setRampPoint(t){return this._param.setRampPoint(t),this}linearRampToValueAtTime(t,e){return this._param.linearRampToValueAtTime(t,e),this}exponentialRampToValueAtTime(t,e){return this._param.exponentialRampToValueAtTime(t,e),this}exponentialRampTo(t,e,n){return this._param.exponentialRampTo(t,e,n),this}linearRampTo(t,e,n){return this._param.linearRampTo(t,e,n),this}targetRampTo(t,e,n){return this._param.targetRampTo(t,e,n),this}exponentialApproachValueAtTime(t,e,n){return this._param.exponentialApproachValueAtTime(t,e,n),this}setTargetAtTime(t,e,n){return this._param.setTargetAtTime(t,e,n),this}setValueCurveAtTime(t,e,n,s){return this._param.setValueCurveAtTime(t,e,n,s),this}cancelScheduledValues(t){return this._param.cancelScheduledValues(t),this}cancelAndHoldAtTime(t){return this._param.cancelAndHoldAtTime(t),this}rampTo(t,e,n){return this._param.rampTo(t,e,n),this}get value(){return this._param.value}set value(t){this._param.value=t}get convert(){return this._param.convert}set convert(t){this._param.convert=t}get units(){return this._param.units}get overridden(){return this._param.overridden}set overridden(t){this._param.overridden=t}get maxValue(){return this._param.maxValue}get minValue(){return this._param.minValue}apply(t){return this._param.apply(t),this}}function wc(t,e,n,s){(e instanceof pc||la(e)||e instanceof bc&&e.override)&&(e.cancelScheduledValues(0),e.setValueAtTime(0,0),e instanceof bc&&(e.overridden=!0)),mc(t,e,n,s)}class xc extends pc{constructor(){super(va(xc.getDefaults(),arguments,["value"])),this.name="TickParam",this._events=new Ma(1/0),this._multiplier=1;const t=va(xc.getDefaults(),arguments,["value"]);this._multiplier=t.multiplier,this._events.cancel(0),this._events.add({ticks:0,time:0,type:"setValueAtTime",value:this._fromType(t.value)}),this.setValueAtTime(t.value,0)}static getDefaults(){return Object.assign(pc.getDefaults(),{multiplier:1,units:"hertz",value:1})}setTargetAtTime(t,e,n){e=this.toSeconds(e),this.setRampPoint(e);const s=this._fromType(t),i=this._events.get(e),r=Math.round(Math.max(1/n,1));for(let o=0;o<=r;o++){const t=n*o+e,r=this._exponentialApproach(i.time,i.value,s,n,t);this.linearRampToValueAtTime(this._toType(r),t)}return this}setValueAtTime(t,e){const n=this.toSeconds(e);super.setValueAtTime(t,e);const s=this._events.get(n),i=this._events.previousEvent(s),r=this._getTicksUntilEvent(i,n);return s.ticks=Math.max(r,0),this}linearRampToValueAtTime(t,e){const n=this.toSeconds(e);super.linearRampToValueAtTime(t,e);const s=this._events.get(n),i=this._events.previousEvent(s),r=this._getTicksUntilEvent(i,n);return s.ticks=Math.max(r,0),this}exponentialRampToValueAtTime(t,e){e=this.toSeconds(e);const n=this._fromType(t),s=this._events.get(e),i=Math.round(Math.max(10*(e-s.time),1)),r=(e-s.time)/i;for(let o=0;o<=i;o++){const t=r*o+s.time,i=this._exponentialInterpolate(s.time,s.value,e,n,t);this.linearRampToValueAtTime(this._toType(i),t)}return this}_getTicksUntilEvent(t,e){if(null===t)t={ticks:0,time:0,type:"setValueAtTime",value:0};else if(Yo(t.ticks)){const e=this._events.previousEvent(t);t.ticks=this._getTicksUntilEvent(e,t.time)}const n=this._fromType(this.getValueAtTime(t.time));let s=this._fromType(this.getValueAtTime(e));const i=this._events.get(e);return i&&i.time===e&&"setValueAtTime"===i.type&&(s=this._fromType(this.getValueAtTime(e-this.sampleTime))),.5*(e-t.time)*(n+s)+t.ticks}getTicksAtTime(t){const e=this.toSeconds(t),n=this._events.get(e);return Math.max(this._getTicksUntilEvent(n,e),0)}getDurationOfTicks(t,e){const n=this.toSeconds(e),s=this.getTicksAtTime(e);return this.getTimeOfTick(s+t)-n}getTimeOfTick(t){const e=this._events.get(t,"ticks"),n=this._events.getAfter(t,"ticks");if(e&&e.ticks===t)return e.time;if(e&&n&&"linearRampToValueAtTime"===n.type&&e.value!==n.value){const s=this._fromType(this.getValueAtTime(e.time)),i=this._fromType(this.getValueAtTime(n.time)),r=(i-s)/(n.time-e.time),o=Math.sqrt(Math.pow(s,2)-2*r*(e.ticks-t)),a=(-s+o)/r,c=(-s-o)/r;return(a>0?a:c)+e.time}return e?0===e.value?1/0:e.time+(t-e.ticks)/e.value:t/this._initialValue}ticksToTime(t,e){return this.getDurationOfTicks(t,e)}timeToTicks(t,e){const n=this.toSeconds(e),s=this.toSeconds(t),i=this.getTicksAtTime(n),r=this.getTicksAtTime(n+s);return r-i}_fromType(t){return"bpm"===this.units&&this.multiplier?1/(60/t/this.multiplier):super._fromType(t)}_toType(t){return"bpm"===this.units&&this.multiplier?t/this.multiplier*60:super._toType(t)}get multiplier(){return this._multiplier}set multiplier(t){const e=this.value;this._multiplier=t,this.cancelScheduledValues(0),this.setValueAtTime(e,0)}}class Tc extends bc{constructor(){super(va(Tc.getDefaults(),arguments,["value"])),this.name="TickSignal";const t=va(Tc.getDefaults(),arguments,["value"]);this.input=this._param=new xc({context:this.context,convert:t.convert,multiplier:t.multiplier,param:this._constantSource.offset,units:t.units,value:t.value})}static getDefaults(){return Object.assign(bc.getDefaults(),{multiplier:1,units:"hertz",value:1})}ticksToTime(t,e){return this._param.ticksToTime(t,e)}timeToTicks(t,e){return this._param.timeToTicks(t,e)}getTimeOfTick(t){return this._param.getTimeOfTick(t)}getDurationOfTicks(t,e){return this._param.getDurationOfTicks(t,e)}getTicksAtTime(t){return this._param.getTicksAtTime(t)}get multiplier(){return this._param.multiplier}set multiplier(t){this._param.multiplier=t}dispose(){return super.dispose(),this._param.dispose(),this}}class Cc extends lc{constructor(){super(va(Cc.getDefaults(),arguments,["frequency"])),this.name="TickSource",this._state=new hc,this._tickOffset=new Ma;const t=va(Cc.getDefaults(),arguments,["frequency"]);this.frequency=new Tc({context:this.context,units:t.units,value:t.frequency}),La(this,"frequency"),this._state.setStateAtTime("stopped",0),this.setTicksAtTime(0,0)}static getDefaults(){return Object.assign({frequency:1,units:"hertz"},lc.getDefaults())}get state(){return this.getStateAtTime(this.now())}start(t,e){const n=this.toSeconds(t);return"started"!==this._state.getValueAtTime(n)&&(this._state.setStateAtTime("started",n),Ho(e)&&this.setTicksAtTime(e,n)),this}stop(t){const e=this.toSeconds(t);if("stopped"===this._state.getValueAtTime(e)){const t=this._state.get(e);t&&t.time>0&&(this._tickOffset.cancel(t.time),this._state.cancel(t.time))}return this._state.cancel(e),this._state.setStateAtTime("stopped",e),this.setTicksAtTime(0,e),this}pause(t){const e=this.toSeconds(t);return"started"===this._state.getValueAtTime(e)&&this._state.setStateAtTime("paused",e),this}cancel(t){return t=this.toSeconds(t),this._state.cancel(t),this._tickOffset.cancel(t),this}getTicksAtTime(t){const e=this.toSeconds(t),n=this._state.getLastState("stopped",e),s={state:"paused",time:e};this._state.add(s);let i=n,r=0;return this._state.forEachBetween(n.time,e+this.sampleTime,t=>{let e=i.time;const n=this._tickOffset.get(t.time);n&&n.time>=i.time&&(r=n.ticks,e=n.time),"started"===i.state&&"started"!==t.state&&(r+=this.frequency.getTicksAtTime(t.time)-this.frequency.getTicksAtTime(e)),i=t}),this._state.remove(s),r}get ticks(){return this.getTicksAtTime(this.now())}set ticks(t){this.setTicksAtTime(t,this.now())}get seconds(){return this.getSecondsAtTime(this.now())}set seconds(t){const e=this.now(),n=this.frequency.timeToTicks(t,e);this.setTicksAtTime(n,e)}getSecondsAtTime(t){t=this.toSeconds(t);const e=this._state.getLastState("stopped",t),n={state:"paused",time:t};this._state.add(n);let s=e,i=0;return this._state.forEachBetween(e.time,t+this.sampleTime,t=>{let e=s.time;const n=this._tickOffset.get(t.time);n&&n.time>=s.time&&(i=n.seconds,e=n.time),"started"===s.state&&"started"!==t.state&&(i+=t.time-e),s=t}),this._state.remove(n),i}setTicksAtTime(t,e){return e=this.toSeconds(e),this._tickOffset.cancel(e),this._tickOffset.add({seconds:this.frequency.getDurationOfTicks(t,e),ticks:t,time:e}),this}getStateAtTime(t){return t=this.toSeconds(t),this._state.getValueAtTime(t)}getTimeOfTick(t,e=this.now()){const n=this._tickOffset.get(e),s=this._state.get(e),i=Math.max(n.time,s.time),r=this.frequency.getTicksAtTime(i)+t-n.ticks;return this.frequency.getTimeOfTick(r)}forEachTickBetween(t,e,n){let s=this._state.get(t);this._state.forEachBetween(t,e,e=>{s&&"started"===s.state&&"started"!==e.state&&this.forEachTickBetween(Math.max(s.time,t),e.time-this.sampleTime,n),s=e});let i=null;if(s&&"started"===s.state){const o=Math.max(s.time,t),a=this.frequency.getTicksAtTime(o),c=this.frequency.getTicksAtTime(s.time),u=a-c;let l=Math.ceil(u)-u;l=ka(l,1)?0:l;let h=this.frequency.getTimeOfTick(a+l);while(h<e){try{n(h,Math.round(this.getTicksAtTime(h)))}catch(r){i=r;break}h+=this.frequency.getDurationOfTicks(1,h)}}if(i)throw i;return this}dispose(){return super.dispose(),this._state.dispose(),this._tickOffset.dispose(),this.frequency.dispose(),this}}class Sc extends lc{constructor(){super(va(Sc.getDefaults(),arguments,["callback","frequency"])),this.name="Clock",this.callback=Wa,this._lastUpdate=0,this._state=new hc("stopped"),this._boundLoop=this._loop.bind(this);const t=va(Sc.getDefaults(),arguments,["callback","frequency"]);this.callback=t.callback,this._tickSource=new Cc({context:this.context,frequency:t.frequency,units:t.units}),this._lastUpdate=0,this.frequency=this._tickSource.frequency,La(this,"frequency"),this._state.setStateAtTime("stopped",0),this.context.on("tick",this._boundLoop)}static getDefaults(){return Object.assign(lc.getDefaults(),{callback:Wa,frequency:1,units:"hertz"})}get state(){return this._state.getValueAtTime(this.now())}start(t,e){Uo(this.context);const n=this.toSeconds(t);return this.log("start",n),"started"!==this._state.getValueAtTime(n)&&(this._state.setStateAtTime("started",n),this._tickSource.start(n,e),n<this._lastUpdate&&this.emit("start",n,e)),this}stop(t){const e=this.toSeconds(t);return this.log("stop",e),this._state.cancel(e),this._state.setStateAtTime("stopped",e),this._tickSource.stop(e),e<this._lastUpdate&&this.emit("stop",e),this}pause(t){const e=this.toSeconds(t);return"started"===this._state.getValueAtTime(e)&&(this._state.setStateAtTime("paused",e),this._tickSource.pause(e),e<this._lastUpdate&&this.emit("pause",e)),this}get ticks(){return Math.ceil(this.getTicksAtTime(this.now()))}set ticks(t){this._tickSource.ticks=t}get seconds(){return this._tickSource.seconds}set seconds(t){this._tickSource.seconds=t}getSecondsAtTime(t){return this._tickSource.getSecondsAtTime(t)}setTicksAtTime(t,e){return this._tickSource.setTicksAtTime(t,e),this}getTimeOfTick(t,e=this.now()){return this._tickSource.getTimeOfTick(t,e)}getTicksAtTime(t){return this._tickSource.getTicksAtTime(t)}nextTickTime(t,e){const n=this.toSeconds(e),s=this.getTicksAtTime(n);return this._tickSource.getTimeOfTick(s+t,n)}_loop(){const t=this._lastUpdate,e=this.now();this._lastUpdate=e,this.log("loop",t,e),t!==e&&(this._state.forEachBetween(t,e,t=>{switch(t.state){case"started":const e=this._tickSource.getTicksAtTime(t.time);this.emit("start",t.time,e);break;case"stopped":0!==t.time&&this.emit("stop",t.time);break;case"paused":this.emit("pause",t.time);break}}),this._tickSource.forEachTickBetween(t,e,(t,e)=>{this.callback(t,e)}))}getStateAtTime(t){const e=this.toSeconds(t);return this._state.getValueAtTime(e)}dispose(){return super.dispose(),this.context.off("tick",this._boundLoop),this._tickSource.dispose(),this._state.dispose(),this}}Va.mixin(Sc);class Ac extends xa{constructor(){super(),this.name="ToneAudioBuffers",this._buffers=new Map,this._loadingCount=0;const t=va(Ac.getDefaults(),arguments,["urls","onload","baseUrl"],"urls");this.baseUrl=t.baseUrl,Object.keys(t.urls).forEach(e=>{this._loadingCount++;const n=t.urls[e];this.add(e,n,this._bufferLoaded.bind(this,t.onload),t.onerror)})}static getDefaults(){return{baseUrl:"",onerror:Wa,onload:Wa,urls:{}}}has(t){return this._buffers.has(t.toString())}get(t){return Bo(this.has(t),"ToneAudioBuffers has no buffer named: "+t),this._buffers.get(t.toString())}_bufferLoaded(t){this._loadingCount--,0===this._loadingCount&&t&&t()}get loaded(){return Array.from(this._buffers).every(([t,e])=>e.loaded)}add(t,e,n=Wa,s=Wa){return ta(e)?this._buffers.set(t.toString(),new Ua(this.baseUrl+e,n,s)):this._buffers.set(t.toString(),new Ua(e,n,s)),this}dispose(){return super.dispose(),this._buffers.forEach(t=>t.dispose()),this._buffers.clear(),this}}class kc extends uc{constructor(){super(...arguments),this.name="Ticks",this.defaultUnits="i"}_now(){return this.context.transport.ticks}_beatsToUnits(t){return this._getPPQ()*t}_secondsToUnits(t){return Math.floor(t/(60/this._getBpm())*this._getPPQ())}_ticksToUnits(t){return t}toTicks(){return this.valueOf()}toSeconds(){return this.valueOf()/this._getPPQ()*(60/this._getBpm())}}class Oc extends lc{constructor(){super(...arguments),this.name="Draw",this.expiration=.25,this.anticipation=.008,this._events=new Ma,this._boundDrawLoop=this._drawLoop.bind(this),this._animationFrame=-1}schedule(t,e){return this._events.add({callback:t,time:this.toSeconds(e)}),1===this._events.length&&(this._animationFrame=requestAnimationFrame(this._boundDrawLoop)),this}cancel(t){return this._events.cancel(this.toSeconds(t)),this}_drawLoop(){const t=this.context.currentTime;while(this._events.length&&this._events.peek().time-this.anticipation<=t){const e=this._events.shift();e&&t-e.time<=this.expiration&&e.callback()}this._events.length>0&&(this._animationFrame=requestAnimationFrame(this._boundDrawLoop))}dispose(){return super.dispose(),this._events.dispose(),cancelAnimationFrame(this._animationFrame),this}}Ia(t=>{t.draw=new Oc({context:t})}),Ra(t=>{t.draw.dispose()});class Mc extends xa{constructor(){super(...arguments),this.name="IntervalTimeline",this._root=null,this._length=0}add(t){Bo(Ho(t.time),"Events must have a time property"),Bo(Ho(t.duration),"Events must have a duration parameter"),t.time=t.time.valueOf();let e=new Ec(t.time,t.time+t.duration,t);null===this._root?this._root=e:this._root.insert(e),this._length++;while(null!==e)e.updateHeight(),e.updateMax(),this._rebalance(e),e=e.parent;return this}remove(t){if(null!==this._root){const e=[];this._root.search(t.time,e);for(const n of e)if(n.event===t){this._removeNode(n),this._length--;break}}return this}get length(){return this._length}cancel(t){return this.forEachFrom(t,t=>this.remove(t)),this}_setRoot(t){this._root=t,null!==this._root&&(this._root.parent=null)}_replaceNodeInParent(t,e){null!==t.parent?(t.isLeftChild()?t.parent.left=e:t.parent.right=e,this._rebalance(t.parent)):this._setRoot(e)}_removeNode(t){if(null===t.left&&null===t.right)this._replaceNodeInParent(t,null);else if(null===t.right)this._replaceNodeInParent(t,t.left);else if(null===t.left)this._replaceNodeInParent(t,t.right);else{const e=t.getBalance();let n,s=null;if(e>0)if(null===t.left.right)n=t.left,n.right=t.right,s=n;else{n=t.left.right;while(null!==n.right)n=n.right;n.parent&&(n.parent.right=n.left,s=n.parent,n.left=t.left,n.right=t.right)}else if(null===t.right.left)n=t.right,n.left=t.left,s=n;else{n=t.right.left;while(null!==n.left)n=n.left;n.parent&&(n.parent.left=n.right,s=n.parent,n.left=t.left,n.right=t.right)}null!==t.parent?t.isLeftChild()?t.parent.left=n:t.parent.right=n:this._setRoot(n),s&&this._rebalance(s)}t.dispose()}_rotateLeft(t){const e=t.parent,n=t.isLeftChild(),s=t.right;s&&(t.right=s.left,s.left=t),null!==e?n?e.left=s:e.right=s:this._setRoot(s)}_rotateRight(t){const e=t.parent,n=t.isLeftChild(),s=t.left;s&&(t.left=s.right,s.right=t),null!==e?n?e.left=s:e.right=s:this._setRoot(s)}_rebalance(t){const e=t.getBalance();e>1&&t.left?t.left.getBalance()<0?this._rotateLeft(t.left):this._rotateRight(t):e<-1&&t.right&&(t.right.getBalance()>0?this._rotateRight(t.right):this._rotateLeft(t))}get(t){if(null!==this._root){const e=[];if(this._root.search(t,e),e.length>0){let t=e[0];for(let n=1;n<e.length;n++)e[n].low>t.low&&(t=e[n]);return t.event}}return null}forEach(t){if(null!==this._root){const e=[];this._root.traverse(t=>e.push(t)),e.forEach(e=>{e.event&&t(e.event)})}return this}forEachAtTime(t,e){if(null!==this._root){const n=[];this._root.search(t,n),n.forEach(t=>{t.event&&e(t.event)})}return this}forEachFrom(t,e){if(null!==this._root){const n=[];this._root.searchAfter(t,n),n.forEach(t=>{t.event&&e(t.event)})}return this}dispose(){return super.dispose(),null!==this._root&&this._root.traverse(t=>t.dispose()),this._root=null,this}}class Ec{constructor(t,e,n){this._left=null,this._right=null,this.parent=null,this.height=0,this.event=n,this.low=t,this.high=e,this.max=this.high}insert(t){t.low<=this.low?null===this.left?this.left=t:this.left.insert(t):null===this.right?this.right=t:this.right.insert(t)}search(t,e){t>this.max||(null!==this.left&&this.left.search(t,e),this.low<=t&&this.high>t&&e.push(this),this.low>t||null!==this.right&&this.right.search(t,e))}searchAfter(t,e){this.low>=t&&(e.push(this),null!==this.left&&this.left.searchAfter(t,e)),null!==this.right&&this.right.searchAfter(t,e)}traverse(t){t(this),null!==this.left&&this.left.traverse(t),null!==this.right&&this.right.traverse(t)}updateHeight(){null!==this.left&&null!==this.right?this.height=Math.max(this.left.height,this.right.height)+1:null!==this.right?this.height=this.right.height+1:null!==this.left?this.height=this.left.height+1:this.height=0}updateMax(){this.max=this.high,null!==this.left&&(this.max=Math.max(this.max,this.left.max)),null!==this.right&&(this.max=Math.max(this.max,this.right.max))}getBalance(){let t=0;return null!==this.left&&null!==this.right?t=this.left.height-this.right.height:null!==this.left?t=this.left.height+1:null!==this.right&&(t=-(this.right.height+1)),t}isLeftChild(){return null!==this.parent&&this.parent.left===this}get left(){return this._left}set left(t){this._left=t,null!==t&&(t.parent=this),this.updateHeight(),this.updateMax()}get right(){return this._right}set right(t){this._right=t,null!==t&&(t.parent=this),this.updateHeight(),this.updateMax()}dispose(){this.parent=null,this._left=null,this._right=null,this.event=null}}class Ic extends dc{constructor(){super(va(Ic.getDefaults(),arguments,["volume"])),this.name="Volume";const t=va(Ic.getDefaults(),arguments,["volume"]);this.input=this.output=new gc({context:this.context,gain:t.volume,units:"decibels"}),this.volume=this.output.gain,La(this,"volume"),this._unmutedVolume=t.volume,this.mute=t.mute}static getDefaults(){return Object.assign(dc.getDefaults(),{mute:!1,volume:0})}get mute(){return this.volume.value===-1/0}set mute(t){!this.mute&&t?(this._unmutedVolume=this.volume.value,this.volume.value=-1/0):this.mute&&!t&&(this.volume.value=this._unmutedVolume)}dispose(){return super.dispose(),this.input.dispose(),this.volume.dispose(),this}}class Dc extends dc{constructor(){super(va(Dc.getDefaults(),arguments)),this.name="Destination",this.input=new Ic({context:this.context}),this.output=new gc({context:this.context}),this.volume=this.input.volume;const t=va(Dc.getDefaults(),arguments);fc(this.input,this.output,this.context.rawContext.destination),this.mute=t.mute,this._internalChannels=[this.input,this.context.rawContext.destination,this.output]}static getDefaults(){return Object.assign(dc.getDefaults(),{mute:!1,volume:0})}get mute(){return this.input.mute}set mute(t){this.input.mute=t}chain(...t){return this.input.disconnect(),t.unshift(this.input),t.push(this.output),fc(...t),this}get maxChannelCount(){return this.context.rawContext.destination.maxChannelCount}dispose(){return super.dispose(),this.volume.dispose(),this}}Ia(t=>{t.destination=new Dc({context:t})}),Ra(t=>{t.destination.dispose()});class Nc extends xa{constructor(t){super(),this.name="TimelineValue",this._timeline=new Ma({memory:10}),this._initialValue=t}set(t,e){return this._timeline.add({value:t,time:e}),this}get(t){const e=this._timeline.get(t);return e?e.value:this._initialValue}}class Rc{constructor(t,e){this.id=Rc._eventId++;const n=Object.assign(Rc.getDefaults(),e);this.transport=t,this.callback=n.callback,this._once=n.once,this.time=n.time}static getDefaults(){return{callback:Wa,once:!1,time:0}}invoke(t){this.callback&&(this.callback(t),this._once&&this.transport.clear(this.id))}dispose(){return this.callback=void 0,this}}Rc._eventId=0;class Pc extends Rc{constructor(t,e){super(t,e),this._currentId=-1,this._nextId=-1,this._nextTick=this.time,this._boundRestart=this._restart.bind(this);const n=Object.assign(Pc.getDefaults(),e);this.duration=new kc(t.context,n.duration).valueOf(),this._interval=new kc(t.context,n.interval).valueOf(),this._nextTick=n.time,this.transport.on("start",this._boundRestart),this.transport.on("loopStart",this._boundRestart),this.context=this.transport.context,this._restart()}static getDefaults(){return Object.assign({},Rc.getDefaults(),{duration:1/0,interval:1,once:!1})}invoke(t){this._createEvents(t),super.invoke(t)}_createEvents(t){const e=this.transport.getTicksAtTime(t);e>=this.time&&e>=this._nextTick&&this._nextTick+this._interval<this.time+this.duration&&(this._nextTick+=this._interval,this._currentId=this._nextId,this._nextId=this.transport.scheduleOnce(this.invoke.bind(this),new kc(this.context,this._nextTick).toSeconds()))}_restart(t){this.transport.clear(this._currentId),this.transport.clear(this._nextId),this._nextTick=this.time;const e=this.transport.getTicksAtTime(t);e>this.time&&(this._nextTick=this.time+Math.ceil((e-this.time)/this._interval)*this._interval),this._currentId=this.transport.scheduleOnce(this.invoke.bind(this),new kc(this.context,this._nextTick).toSeconds()),this._nextTick+=this._interval,this._nextId=this.transport.scheduleOnce(this.invoke.bind(this),new kc(this.context,this._nextTick).toSeconds())}dispose(){return super.dispose(),this.transport.clear(this._currentId),this.transport.clear(this._nextId),this.transport.off("start",this._boundRestart),this.transport.off("loopStart",this._boundRestart),this}}class Vc extends lc{constructor(){super(va(Vc.getDefaults(),arguments)),this.name="Transport",this._loop=new Nc(!1),this._loopStart=0,this._loopEnd=0,this._scheduledEvents={},this._timeline=new Ma,this._repeatedEvents=new Mc,this._syncedSignals=[],this._swingAmount=0;const t=va(Vc.getDefaults(),arguments);this._ppq=t.ppq,this._clock=new Sc({callback:this._processTick.bind(this),context:this.context,frequency:0,units:"bpm"}),this._bindClockEvents(),this.bpm=this._clock.frequency,this._clock.frequency.multiplier=t.ppq,this.bpm.setValueAtTime(t.bpm,0),La(this,"bpm"),this._timeSignature=t.timeSignature,this._swingTicks=t.ppq/2}static getDefaults(){return Object.assign(lc.getDefaults(),{bpm:120,loopEnd:"4m",loopStart:0,ppq:192,swing:0,swingSubdivision:"8n",timeSignature:4})}_processTick(t,e){if(this._swingAmount>0&&e%this._ppq!==0&&e%(2*this._swingTicks)!==0){const n=e%(2*this._swingTicks)/(2*this._swingTicks),s=Math.sin(n*Math.PI)*this._swingAmount;t+=new kc(this.context,2*this._swingTicks/3).toSeconds()*s}this._loop.get(t)&&e>=this._loopEnd&&(this.emit("loopEnd",t),this._clock.setTicksAtTime(this._loopStart,t),e=this._loopStart,this.emit("loopStart",t,this._clock.getSecondsAtTime(t)),this.emit("loop",t)),this._timeline.forEachAtTime(e,e=>e.invoke(t))}schedule(t,e){const n=new Rc(this,{callback:t,time:new uc(this.context,e).toTicks()});return this._addEvent(n,this._timeline)}scheduleRepeat(t,e,n,s=1/0){const i=new Pc(this,{callback:t,duration:new rc(this.context,s).toTicks(),interval:new rc(this.context,e).toTicks(),time:new uc(this.context,n).toTicks()});return this._addEvent(i,this._repeatedEvents)}scheduleOnce(t,e){const n=new Rc(this,{callback:t,once:!0,time:new uc(this.context,e).toTicks()});return this._addEvent(n,this._timeline)}clear(t){if(this._scheduledEvents.hasOwnProperty(t)){const e=this._scheduledEvents[t.toString()];e.timeline.remove(e.event),e.event.dispose(),delete this._scheduledEvents[t.toString()]}return this}_addEvent(t,e){return this._scheduledEvents[t.id.toString()]={event:t,timeline:e},e.add(t),t.id}cancel(t=0){const e=this.toTicks(t);return this._timeline.forEachFrom(e,t=>this.clear(t.id)),this._repeatedEvents.forEachFrom(e,t=>this.clear(t.id)),this}_bindClockEvents(){this._clock.on("start",(t,e)=>{e=new kc(this.context,e).toSeconds(),this.emit("start",t,e)}),this._clock.on("stop",t=>{this.emit("stop",t)}),this._clock.on("pause",t=>{this.emit("pause",t)})}get state(){return this._clock.getStateAtTime(this.now())}start(t,e){let n;return Ho(e)&&(n=this.toTicks(e)),this._clock.start(t,n),this}stop(t){return this._clock.stop(t),this}pause(t){return this._clock.pause(t),this}toggle(t){return t=this.toSeconds(t),"started"!==this._clock.getStateAtTime(t)?this.start(t):this.stop(t),this}get timeSignature(){return this._timeSignature}set timeSignature(t){Jo(t)&&(t=t[0]/t[1]*4),this._timeSignature=t}get loopStart(){return new rc(this.context,this._loopStart,"i").toSeconds()}set loopStart(t){this._loopStart=this.toTicks(t)}get loopEnd(){return new rc(this.context,this._loopEnd,"i").toSeconds()}set loopEnd(t){this._loopEnd=this.toTicks(t)}get loop(){return this._loop.get(this.now())}set loop(t){this._loop.set(t,this.now())}setLoopPoints(t,e){return this.loopStart=t,this.loopEnd=e,this}get swing(){return this._swingAmount}set swing(t){this._swingAmount=t}get swingSubdivision(){return new kc(this.context,this._swingTicks).toNotation()}set swingSubdivision(t){this._swingTicks=this.toTicks(t)}get position(){const t=this.now(),e=this._clock.getTicksAtTime(t);return new kc(this.context,e).toBarsBeatsSixteenths()}set position(t){const e=this.toTicks(t);this.ticks=e}get seconds(){return this._clock.seconds}set seconds(t){const e=this.now(),n=this._clock.frequency.timeToTicks(t,e);this.ticks=n}get progress(){if(this.loop){const t=this.now(),e=this._clock.getTicksAtTime(t);return(e-this._loopStart)/(this._loopEnd-this._loopStart)}return 0}get ticks(){return this._clock.ticks}set ticks(t){if(this._clock.ticks!==t){const e=this.now();if("started"===this.state){const n=this._clock.getTicksAtTime(e),s=this._clock.getTimeOfTick(Math.ceil(n));this.emit("stop",s),this._clock.setTicksAtTime(t,s),this.emit("start",s,this._clock.getSecondsAtTime(s))}else this._clock.setTicksAtTime(t,e)}}getTicksAtTime(t){return Math.round(this._clock.getTicksAtTime(t))}getSecondsAtTime(t){return this._clock.getSecondsAtTime(t)}get PPQ(){return this._clock.frequency.multiplier}set PPQ(t){this._clock.frequency.multiplier=t}nextSubdivision(t){if(t=this.toTicks(t),"started"!==this.state)return 0;{const e=this.now(),n=this.getTicksAtTime(e),s=t-n%t;return this._clock.nextTickTime(s,e)}}syncSignal(t,e){if(!e){const n=this.now();if(0!==t.getValueAtTime(n)){const s=this.bpm.getValueAtTime(n),i=1/(60/s/this.PPQ);e=t.getValueAtTime(n)/i}else e=0}const n=new gc(e);return this.bpm.connect(n),n.connect(t._param),this._syncedSignals.push({initial:t.value,ratio:n,signal:t}),t.value=0,this}unsyncSignal(t){for(let e=this._syncedSignals.length-1;e>=0;e--){const n=this._syncedSignals[e];n.signal===t&&(n.ratio.dispose(),n.signal.value=n.initial,this._syncedSignals.splice(e,1))}return this}dispose(){return super.dispose(),this._clock.dispose(),Ba(this,"bpm"),this._timeline.dispose(),this._repeatedEvents.dispose(),this}}Va.mixin(Vc),Ia(t=>{t.transport=new Vc({context:t})}),Ra(t=>{t.transport.dispose()});class qc extends dc{constructor(t){super(t),this.input=void 0,this._state=new hc("stopped"),this._synced=!1,this._scheduled=[],this._syncedStart=Wa,this._syncedStop=Wa,this._state.memory=100,this._state.increasing=!0,this._volume=this.output=new Ic({context:this.context,mute:t.mute,volume:t.volume}),this.volume=this._volume.volume,La(this,"volume"),this.onstop=t.onstop}static getDefaults(){return Object.assign(dc.getDefaults(),{mute:!1,onstop:Wa,volume:0})}get state(){return this._synced?"started"===this.context.transport.state?this._state.getValueAtTime(this.context.transport.seconds):"stopped":this._state.getValueAtTime(this.now())}get mute(){return this._volume.mute}set mute(t){this._volume.mute=t}_clampToCurrentTime(t){return this._synced?t:Math.max(t,this.context.currentTime)}start(t,e,n){let s=Yo(t)&&this._synced?this.context.transport.seconds:this.toSeconds(t);if(s=this._clampToCurrentTime(s),this._synced||"started"!==this._state.getValueAtTime(s))if(this.log("start",s),this._state.setStateAtTime("started",s),this._synced){const t=this._state.get(s);t&&(t.offset=this.toSeconds(ba(e,0)),t.duration=n?this.toSeconds(n):void 0);const i=this.context.transport.schedule(t=>{this._start(t,e,n)},s);this._scheduled.push(i),"started"===this.context.transport.state&&this.context.transport.getSecondsAtTime(this.immediate())>s&&this._syncedStart(this.now(),this.context.transport.seconds)}else Uo(this.context),this._start(s,e,n);else Bo(Ca(s,this._state.get(s).time),"Start time must be strictly greater than previous start time"),this._state.cancel(s),this._state.setStateAtTime("started",s),this.log("restart",s),this.restart(s,e,n);return this}stop(t){let e=Yo(t)&&this._synced?this.context.transport.seconds:this.toSeconds(t);if(e=this._clampToCurrentTime(e),"started"===this._state.getValueAtTime(e)||Ho(this._state.getNextState("started",e))){if(this.log("stop",e),this._synced){const t=this.context.transport.schedule(this._stop.bind(this),e);this._scheduled.push(t)}else this._stop(e);this._state.cancel(e),this._state.setStateAtTime("stopped",e)}return this}restart(t,e,n){return t=this.toSeconds(t),"started"===this._state.getValueAtTime(t)&&(this._state.cancel(t),this._restart(t,e,n)),this}sync(){return this._synced||(this._synced=!0,this._syncedStart=(t,e)=>{if(e>0){const n=this._state.get(e);if(n&&"started"===n.state&&n.time!==e){const s=e-this.toSeconds(n.time);let i;n.duration&&(i=this.toSeconds(n.duration)-s),this._start(t,this.toSeconds(n.offset)+s,i)}}},this._syncedStop=t=>{const e=this.context.transport.getSecondsAtTime(Math.max(t-this.sampleTime,0));"started"===this._state.getValueAtTime(e)&&this._stop(t)},this.context.transport.on("start",this._syncedStart),this.context.transport.on("loopStart",this._syncedStart),this.context.transport.on("stop",this._syncedStop),this.context.transport.on("pause",this._syncedStop),this.context.transport.on("loopEnd",this._syncedStop)),this}unsync(){return this._synced&&(this.context.transport.off("stop",this._syncedStop),this.context.transport.off("pause",this._syncedStop),this.context.transport.off("loopEnd",this._syncedStop),this.context.transport.off("start",this._syncedStart),this.context.transport.off("loopStart",this._syncedStart)),this._synced=!1,this._scheduled.forEach(t=>this.context.transport.clear(t)),this._scheduled=[],this._state.cancel(0),this._stop(0),this}dispose(){return super.dispose(),this.onstop=Wa,this.unsync(),this._volume.dispose(),this._state.dispose(),this}}class jc extends vc{constructor(){super(va(jc.getDefaults(),arguments,["url","onload"])),this.name="ToneBufferSource",this._source=this.context.createBufferSource(),this._internalChannels=[this._source],this._sourceStarted=!1,this._sourceStopped=!1;const t=va(jc.getDefaults(),arguments,["url","onload"]);mc(this._source,this._gainNode),this._source.onended=()=>this._stopSource(),this.playbackRate=new pc({context:this.context,param:this._source.playbackRate,units:"positive",value:t.playbackRate}),this.loop=t.loop,this.loopStart=t.loopStart,this.loopEnd=t.loopEnd,this._buffer=new Ua(t.url,t.onload,t.onerror),this._internalChannels.push(this._source)}static getDefaults(){return Object.assign(vc.getDefaults(),{url:new Ua,loop:!1,loopEnd:0,loopStart:0,onload:Wa,onerror:Wa,playbackRate:1})}get fadeIn(){return this._fadeIn}set fadeIn(t){this._fadeIn=t}get fadeOut(){return this._fadeOut}set fadeOut(t){this._fadeOut=t}get curve(){return this._curve}set curve(t){this._curve=t}start(t,e,n,s=1){Bo(this.buffer.loaded,"buffer is either not set or not loaded");const i=this.toSeconds(t);this._startGain(i,s),e=this.loop?ba(e,this.loopStart):ba(e,0);let r=Math.max(this.toSeconds(e),0);if(this.loop){const t=this.toSeconds(this.loopEnd)||this.buffer.duration,e=this.toSeconds(this.loopStart),n=t-e;Sa(r,t)&&(r=(r-e)%n+e),ka(r,this.buffer.duration)&&(r=0)}if(this._source.buffer=this.buffer.get(),this._source.loopEnd=this.toSeconds(this.loopEnd)||this.buffer.duration,Aa(r,this.buffer.duration)&&(this._sourceStarted=!0,this._source.start(i,r)),Ho(n)){let t=this.toSeconds(n);t=Math.max(t,0),this.stop(i+t)}return this}_stopSource(t){!this._sourceStopped&&this._sourceStarted&&(this._sourceStopped=!0,this._source.stop(this.toSeconds(t)),this._onended())}get loopStart(){return this._source.loopStart}set loopStart(t){this._source.loopStart=this.toSeconds(t)}get loopEnd(){return this._source.loopEnd}set loopEnd(t){this._source.loopEnd=this.toSeconds(t)}get buffer(){return this._buffer}set buffer(t){this._buffer.set(t)}get loop(){return this._source.loop}set loop(t){this._source.loop=t,this._sourceStarted&&this.cancelStop()}dispose(){return super.dispose(),this._source.onended=null,this._source.disconnect(),this._buffer.dispose(),this.playbackRate.dispose(),this}}function Fc(t,e){return ca(this,void 0,void 0,(function*(){const n=e/t.context.sampleRate,s=new za(1,n,t.context.sampleRate),i=new t.constructor(Object.assign(t.get(),{frequency:2/n,detune:0,context:s})).toDestination();i.start(0);const r=yield s.render();return r.getChannelData(0)}))}class Lc extends vc{constructor(){super(va(Lc.getDefaults(),arguments,["frequency","type"])),this.name="ToneOscillatorNode",this._oscillator=this.context.createOscillator(),this._internalChannels=[this._oscillator];const t=va(Lc.getDefaults(),arguments,["frequency","type"]);mc(this._oscillator,this._gainNode),this.type=t.type,this.frequency=new pc({context:this.context,param:this._oscillator.frequency,units:"frequency",value:t.frequency}),this.detune=new pc({context:this.context,param:this._oscillator.detune,units:"cents",value:t.detune}),La(this,["frequency","detune"])}static getDefaults(){return Object.assign(vc.getDefaults(),{detune:0,frequency:440,type:"sine"})}start(t){const e=this.toSeconds(t);return this.log("start",e),this._startGain(e),this._oscillator.start(e),this}_stopSource(t){this._oscillator.stop(t)}setPeriodicWave(t){return this._oscillator.setPeriodicWave(t),this}get type(){return this._oscillator.type}set type(t){this._oscillator.type=t}dispose(){return super.dispose(),"started"===this.state&&this.stop(),this._oscillator.disconnect(),this.frequency.dispose(),this.detune.dispose(),this}}class Bc extends qc{constructor(){super(va(Bc.getDefaults(),arguments,["frequency","type"])),this.name="Oscillator",this._oscillator=null;const t=va(Bc.getDefaults(),arguments,["frequency","type"]);this.frequency=new bc({context:this.context,units:"frequency",value:t.frequency}),La(this,"frequency"),this.detune=new bc({context:this.context,units:"cents",value:t.detune}),La(this,"detune"),this._partials=t.partials,this._partialCount=t.partialCount,this._type=t.type,t.partialCount&&"custom"!==t.type&&(this._type=this.baseType+t.partialCount.toString()),this.phase=t.phase}static getDefaults(){return Object.assign(qc.getDefaults(),{detune:0,frequency:440,partialCount:0,partials:[],phase:0,type:"sine"})}_start(t){const e=this.toSeconds(t),n=new Lc({context:this.context,onended:()=>this.onstop(this)});this._oscillator=n,this._wave?this._oscillator.setPeriodicWave(this._wave):this._oscillator.type=this._type,this._oscillator.connect(this.output),this.frequency.connect(this._oscillator.frequency),this.detune.connect(this._oscillator.detune),this._oscillator.start(e)}_stop(t){const e=this.toSeconds(t);this._oscillator&&this._oscillator.stop(e)}_restart(t){const e=this.toSeconds(t);return this.log("restart",e),this._oscillator&&this._oscillator.cancelStop(),this._state.cancel(e),this}syncFrequency(){return this.context.transport.syncSignal(this.frequency),this}unsyncFrequency(){return this.context.transport.unsyncSignal(this.frequency),this}_getCachedPeriodicWave(){if("custom"===this._type){const t=Bc._periodicWaveCache.find(t=>t.phase===this._phase&&ga(t.partials,this._partials));return t}{const t=Bc._periodicWaveCache.find(t=>t.type===this._type&&t.phase===this._phase);return this._partialCount=t?t.partialCount:this._partialCount,t}}get type(){return this._type}set type(t){this._type=t;const e=-1!==["sine","square","sawtooth","triangle"].indexOf(t);if(0===this._phase&&e)this._wave=void 0,this._partialCount=0,null!==this._oscillator&&(this._oscillator.type=t);else{const e=this._getCachedPeriodicWave();if(Ho(e)){const{partials:t,wave:n}=e;this._wave=n,this._partials=t,null!==this._oscillator&&this._oscillator.setPeriodicWave(this._wave)}else{const[e,n]=this._getRealImaginary(t,this._phase),s=this.context.createPeriodicWave(e,n);this._wave=s,null!==this._oscillator&&this._oscillator.setPeriodicWave(this._wave),Bc._periodicWaveCache.push({imag:n,partialCount:this._partialCount,partials:this._partials,phase:this._phase,real:e,type:this._type,wave:this._wave}),Bc._periodicWaveCache.length>100&&Bc._periodicWaveCache.shift()}}}get baseType(){return this._type.replace(this.partialCount.toString(),"")}set baseType(t){this.partialCount&&"custom"!==this._type&&"custom"!==t?this.type=t+this.partialCount:this.type=t}get partialCount(){return this._partialCount}set partialCount(t){Wo(t,0);let e=this._type;const n=/^(sine|triangle|square|sawtooth)(\d+)$/.exec(this._type);if(n&&(e=n[1]),"custom"!==this._type)this.type=0===t?e:e+t.toString();else{const e=new Float32Array(t);this._partials.forEach((t,n)=>e[n]=t),this._partials=Array.from(e),this.type=this._type}}_getRealImaginary(t,e){const n=4096;let s=n/2;const i=new Float32Array(s),r=new Float32Array(s);let o=1;if("custom"===t){if(o=this._partials.length+1,this._partialCount=this._partials.length,s=o,0===this._partials.length)return[i,r]}else{const e=/^(sine|triangle|square|sawtooth)(\d+)$/.exec(t);e?(o=parseInt(e[2],10)+1,this._partialCount=parseInt(e[2],10),t=e[1],o=Math.max(o,2),s=o):this._partialCount=0,this._partials=[]}for(let a=1;a<s;++a){const n=2/(a*Math.PI);let s;switch(t){case"sine":s=a<=o?1:0,this._partials[a-1]=s;break;case"square":s=1&a?2*n:0,this._partials[a-1]=s;break;case"sawtooth":s=n*(1&a?1:-1),this._partials[a-1]=s;break;case"triangle":s=1&a?n*n*2*(a-1>>1&1?-1:1):0,this._partials[a-1]=s;break;case"custom":s=this._partials[a-1];break;default:throw new TypeError("Oscillator: invalid type: "+t)}0!==s?(i[a]=-s*Math.sin(e*a),r[a]=s*Math.cos(e*a)):(i[a]=0,r[a]=0)}return[i,r]}_inverseFFT(t,e,n){let s=0;const i=t.length;for(let r=0;r<i;r++)s+=t[r]*Math.cos(r*n)+e[r]*Math.sin(r*n);return s}getInitialValue(){const[t,e]=this._getRealImaginary(this._type,0);let n=0;const s=2*Math.PI,i=32;for(let r=0;r<i;r++)n=Math.max(this._inverseFFT(t,e,r/i*s),n);return Oa(-this._inverseFFT(t,e,this._phase)/n,-1,1)}get partials(){return this._partials.slice(0,this.partialCount)}set partials(t){this._partials=t,this._partialCount=this._partials.length,t.length&&(this.type="custom")}get phase(){return this._phase*(180/Math.PI)}set phase(t){this._phase=t*Math.PI/180,this.type=this._type}asArray(t=1024){return ca(this,void 0,void 0,(function*(){return Fc(this,t)}))}dispose(){return super.dispose(),null!==this._oscillator&&this._oscillator.dispose(),this._wave=void 0,this.frequency.dispose(),this.detune.dispose(),this}}Bc._periodicWaveCache=[];class Wc extends dc{constructor(){super(Object.assign(va(Wc.getDefaults(),arguments,["context"])))}connect(t,e=0,n=0){return wc(this,t,e,n),this}}class Uc extends Wc{constructor(){super(Object.assign(va(Uc.getDefaults(),arguments,["mapping","length"]))),this.name="WaveShaper",this._shaper=this.context.createWaveShaper(),this.input=this._shaper,this.output=this._shaper;const t=va(Uc.getDefaults(),arguments,["mapping","length"]);Jo(t.mapping)||t.mapping instanceof Float32Array?this.curve=Float32Array.from(t.mapping):Zo(t.mapping)&&this.setMap(t.mapping,t.length)}static getDefaults(){return Object.assign(bc.getDefaults(),{length:1024})}setMap(t,e=1024){const n=new Float32Array(e);for(let s=0,i=e;s<i;s++){const e=s/(i-1)*2-1;n[s]=t(e,s)}return this.curve=n,this}get curve(){return this._shaper.curve}set curve(t){this._shaper.curve=t}get oversample(){return this._shaper.oversample}set oversample(t){const e=["none","2x","4x"].some(e=>e.includes(t));Bo(e,"oversampling must be either 'none', '2x', or '4x'"),this._shaper.oversample=t}dispose(){return super.dispose(),this._shaper.disconnect(),this}}class zc extends Wc{constructor(){super(...arguments),this.name="AudioToGain",this._norm=new Uc({context:this.context,mapping:t=>(t+1)/2}),this.input=this._norm,this.output=this._norm}dispose(){return super.dispose(),this._norm.dispose(),this}}class Gc extends bc{constructor(){super(Object.assign(va(Gc.getDefaults(),arguments,["value"]))),this.name="Multiply",this.override=!1;const t=va(Gc.getDefaults(),arguments,["value"]);this._mult=this.input=this.output=new gc({context:this.context,minValue:t.minValue,maxValue:t.maxValue}),this.factor=this._param=this._mult.gain,this.factor.setValueAtTime(t.value,0)}static getDefaults(){return Object.assign(bc.getDefaults(),{value:0})}dispose(){return super.dispose(),this._mult.dispose(),this}}class Xc extends qc{constructor(){super(va(Xc.getDefaults(),arguments,["frequency","type","modulationType"])),this.name="AMOscillator",this._modulationScale=new zc({context:this.context}),this._modulationNode=new gc({context:this.context});const t=va(Xc.getDefaults(),arguments,["frequency","type","modulationType"]);this._carrier=new Bc({context:this.context,detune:t.detune,frequency:t.frequency,onstop:()=>this.onstop(this),phase:t.phase,type:t.type}),this.frequency=this._carrier.frequency,this.detune=this._carrier.detune,this._modulator=new Bc({context:this.context,phase:t.phase,type:t.modulationType}),this.harmonicity=new Gc({context:this.context,units:"positive",value:t.harmonicity}),this.frequency.chain(this.harmonicity,this._modulator.frequency),this._modulator.chain(this._modulationScale,this._modulationNode.gain),this._carrier.chain(this._modulationNode,this.output),La(this,["frequency","detune","harmonicity"])}static getDefaults(){return Object.assign(Bc.getDefaults(),{harmonicity:1,modulationType:"square"})}_start(t){this._modulator.start(t),this._carrier.start(t)}_stop(t){this._modulator.stop(t),this._carrier.stop(t)}_restart(t){this._modulator.restart(t),this._carrier.restart(t)}get type(){return this._carrier.type}set type(t){this._carrier.type=t}get baseType(){return this._carrier.baseType}set baseType(t){this._carrier.baseType=t}get partialCount(){return this._carrier.partialCount}set partialCount(t){this._carrier.partialCount=t}get modulationType(){return this._modulator.type}set modulationType(t){this._modulator.type=t}get phase(){return this._carrier.phase}set phase(t){this._carrier.phase=t,this._modulator.phase=t}get partials(){return this._carrier.partials}set partials(t){this._carrier.partials=t}asArray(t=1024){return ca(this,void 0,void 0,(function*(){return Fc(this,t)}))}dispose(){return super.dispose(),this.frequency.dispose(),this.detune.dispose(),this.harmonicity.dispose(),this._carrier.dispose(),this._modulator.dispose(),this._modulationNode.dispose(),this._modulationScale.dispose(),this}}class Yc extends qc{constructor(){super(va(Yc.getDefaults(),arguments,["frequency","type","modulationType"])),this.name="FMOscillator",this._modulationNode=new gc({context:this.context,gain:0});const t=va(Yc.getDefaults(),arguments,["frequency","type","modulationType"]);this._carrier=new Bc({context:this.context,detune:t.detune,frequency:0,onstop:()=>this.onstop(this),phase:t.phase,type:t.type}),this.detune=this._carrier.detune,this.frequency=new bc({context:this.context,units:"frequency",value:t.frequency}),this._modulator=new Bc({context:this.context,phase:t.phase,type:t.modulationType}),this.harmonicity=new Gc({context:this.context,units:"positive",value:t.harmonicity}),this.modulationIndex=new Gc({context:this.context,units:"positive",value:t.modulationIndex}),this.frequency.connect(this._carrier.frequency),this.frequency.chain(this.harmonicity,this._modulator.frequency),this.frequency.chain(this.modulationIndex,this._modulationNode),this._modulator.connect(this._modulationNode.gain),this._modulationNode.connect(this._carrier.frequency),this._carrier.connect(this.output),this.detune.connect(this._modulator.detune),La(this,["modulationIndex","frequency","detune","harmonicity"])}static getDefaults(){return Object.assign(Bc.getDefaults(),{harmonicity:1,modulationIndex:2,modulationType:"square"})}_start(t){this._modulator.start(t),this._carrier.start(t)}_stop(t){this._modulator.stop(t),this._carrier.stop(t)}_restart(t){return this._modulator.restart(t),this._carrier.restart(t),this}get type(){return this._carrier.type}set type(t){this._carrier.type=t}get baseType(){return this._carrier.baseType}set baseType(t){this._carrier.baseType=t}get partialCount(){return this._carrier.partialCount}set partialCount(t){this._carrier.partialCount=t}get modulationType(){return this._modulator.type}set modulationType(t){this._modulator.type=t}get phase(){return this._carrier.phase}set phase(t){this._carrier.phase=t,this._modulator.phase=t}get partials(){return this._carrier.partials}set partials(t){this._carrier.partials=t}asArray(t=1024){return ca(this,void 0,void 0,(function*(){return Fc(this,t)}))}dispose(){return super.dispose(),this.frequency.dispose(),this.harmonicity.dispose(),this._carrier.dispose(),this._modulator.dispose(),this._modulationNode.dispose(),this.modulationIndex.dispose(),this}}class Hc extends qc{constructor(){super(va(Hc.getDefaults(),arguments,["frequency","width"])),this.name="PulseOscillator",this._widthGate=new gc({context:this.context,gain:0}),this._thresh=new Uc({context:this.context,mapping:t=>t<=0?-1:1});const t=va(Hc.getDefaults(),arguments,["frequency","width"]);this.width=new bc({context:this.context,units:"audioRange",value:t.width}),this._triangle=new Bc({context:this.context,detune:t.detune,frequency:t.frequency,onstop:()=>this.onstop(this),phase:t.phase,type:"triangle"}),this.frequency=this._triangle.frequency,this.detune=this._triangle.detune,this._triangle.chain(this._thresh,this.output),this.width.chain(this._widthGate,this._thresh),La(this,["width","frequency","detune"])}static getDefaults(){return Object.assign(qc.getDefaults(),{detune:0,frequency:440,phase:0,type:"pulse",width:.2})}_start(t){t=this.toSeconds(t),this._triangle.start(t),this._widthGate.gain.setValueAtTime(1,t)}_stop(t){t=this.toSeconds(t),this._triangle.stop(t),this._widthGate.gain.cancelScheduledValues(t),this._widthGate.gain.setValueAtTime(0,t)}_restart(t){this._triangle.restart(t),this._widthGate.gain.cancelScheduledValues(t),this._widthGate.gain.setValueAtTime(1,t)}get phase(){return this._triangle.phase}set phase(t){this._triangle.phase=t}get type(){return"pulse"}get baseType(){return"pulse"}get partials(){return[]}get partialCount(){return 0}set carrierType(t){this._triangle.type=t}asArray(t=1024){return ca(this,void 0,void 0,(function*(){return Fc(this,t)}))}dispose(){return super.dispose(),this._triangle.dispose(),this.width.dispose(),this._widthGate.dispose(),this._thresh.dispose(),this}}class Zc extends qc{constructor(){super(va(Zc.getDefaults(),arguments,["frequency","type","spread"])),this.name="FatOscillator",this._oscillators=[];const t=va(Zc.getDefaults(),arguments,["frequency","type","spread"]);this.frequency=new bc({context:this.context,units:"frequency",value:t.frequency}),this.detune=new bc({context:this.context,units:"cents",value:t.detune}),this._spread=t.spread,this._type=t.type,this._phase=t.phase,this._partials=t.partials,this._partialCount=t.partialCount,this.count=t.count,La(this,["frequency","detune"])}static getDefaults(){return Object.assign(Bc.getDefaults(),{count:3,spread:20,type:"sawtooth"})}_start(t){t=this.toSeconds(t),this._forEach(e=>e.start(t))}_stop(t){t=this.toSeconds(t),this._forEach(e=>e.stop(t))}_restart(t){this._forEach(e=>e.restart(t))}_forEach(t){for(let e=0;e<this._oscillators.length;e++)t(this._oscillators[e],e)}get type(){return this._type}set type(t){this._type=t,this._forEach(e=>e.type=t)}get spread(){return this._spread}set spread(t){if(this._spread=t,this._oscillators.length>1){const e=-t/2,n=t/(this._oscillators.length-1);this._forEach((t,s)=>t.detune.value=e+n*s)}}get count(){return this._oscillators.length}set count(t){if(Wo(t,1),this._oscillators.length!==t){this._forEach(t=>t.dispose()),this._oscillators=[];for(let e=0;e<t;e++){const n=new Bc({context:this.context,volume:-6-1.1*t,type:this._type,phase:this._phase+e/t*360,partialCount:this._partialCount,onstop:0===e?()=>this.onstop(this):Wa});"custom"===this.type&&(n.partials=this._partials),this.frequency.connect(n.frequency),this.detune.connect(n.detune),n.detune.overridden=!1,n.connect(this.output),this._oscillators[e]=n}this.spread=this._spread,"started"===this.state&&this._forEach(t=>t.start())}}get phase(){return this._phase}set phase(t){this._phase=t,this._forEach((t,e)=>t.phase=this._phase+e/this.count*360)}get baseType(){return this._oscillators[0].baseType}set baseType(t){this._forEach(e=>e.baseType=t),this._type=this._oscillators[0].type}get partials(){return this._oscillators[0].partials}set partials(t){this._partials=t,this._partialCount=this._partials.length,t.length&&(this._type="custom",this._forEach(e=>e.partials=t))}get partialCount(){return this._oscillators[0].partialCount}set partialCount(t){this._partialCount=t,this._forEach(e=>e.partialCount=t),this._type=this._oscillators[0].type}asArray(t=1024){return ca(this,void 0,void 0,(function*(){return Fc(this,t)}))}dispose(){return super.dispose(),this.frequency.dispose(),this.detune.dispose(),this._forEach(t=>t.dispose()),this}}class $c extends qc{constructor(){super(va($c.getDefaults(),arguments,["frequency","modulationFrequency"])),this.name="PWMOscillator",this.sourceType="pwm",this._scale=new Gc({context:this.context,value:2});const t=va($c.getDefaults(),arguments,["frequency","modulationFrequency"]);this._pulse=new Hc({context:this.context,frequency:t.modulationFrequency}),this._pulse.carrierType="sine",this.modulationFrequency=this._pulse.frequency,this._modulator=new Bc({context:this.context,detune:t.detune,frequency:t.frequency,onstop:()=>this.onstop(this),phase:t.phase}),this.frequency=this._modulator.frequency,this.detune=this._modulator.detune,this._modulator.chain(this._scale,this._pulse.width),this._pulse.connect(this.output),La(this,["modulationFrequency","frequency","detune"])}static getDefaults(){return Object.assign(qc.getDefaults(),{detune:0,frequency:440,modulationFrequency:.4,phase:0,type:"pwm"})}_start(t){t=this.toSeconds(t),this._modulator.start(t),this._pulse.start(t)}_stop(t){t=this.toSeconds(t),this._modulator.stop(t),this._pulse.stop(t)}_restart(t){this._modulator.restart(t),this._pulse.restart(t)}get type(){return"pwm"}get baseType(){return"pwm"}get partials(){return[]}get partialCount(){return 0}get phase(){return this._modulator.phase}set phase(t){this._modulator.phase=t}asArray(t=1024){return ca(this,void 0,void 0,(function*(){return Fc(this,t)}))}dispose(){return super.dispose(),this._pulse.dispose(),this._scale.dispose(),this._modulator.dispose(),this}}const Kc={am:Xc,fat:Zc,fm:Yc,oscillator:Bc,pulse:Hc,pwm:$c};class Qc extends qc{constructor(){super(va(Qc.getDefaults(),arguments,["frequency","type"])),this.name="OmniOscillator";const t=va(Qc.getDefaults(),arguments,["frequency","type"]);this.frequency=new bc({context:this.context,units:"frequency",value:t.frequency}),this.detune=new bc({context:this.context,units:"cents",value:t.detune}),La(this,["frequency","detune"]),this.set(t)}static getDefaults(){return Object.assign(Bc.getDefaults(),Yc.getDefaults(),Xc.getDefaults(),Zc.getDefaults(),Hc.getDefaults(),$c.getDefaults())}_start(t){this._oscillator.start(t)}_stop(t){this._oscillator.stop(t)}_restart(t){return this._oscillator.restart(t),this}get type(){let t="";return["am","fm","fat"].some(t=>this._sourceType===t)&&(t=this._sourceType),t+this._oscillator.type}set type(t){"fm"===t.substr(0,2)?(this._createNewOscillator("fm"),this._oscillator=this._oscillator,this._oscillator.type=t.substr(2)):"am"===t.substr(0,2)?(this._createNewOscillator("am"),this._oscillator=this._oscillator,this._oscillator.type=t.substr(2)):"fat"===t.substr(0,3)?(this._createNewOscillator("fat"),this._oscillator=this._oscillator,this._oscillator.type=t.substr(3)):"pwm"===t?(this._createNewOscillator("pwm"),this._oscillator=this._oscillator):"pulse"===t?this._createNewOscillator("pulse"):(this._createNewOscillator("oscillator"),this._oscillator=this._oscillator,this._oscillator.type=t)}get partials(){return this._oscillator.partials}set partials(t){this._getOscType(this._oscillator,"pulse")||this._getOscType(this._oscillator,"pwm")||(this._oscillator.partials=t)}get partialCount(){return this._oscillator.partialCount}set partialCount(t){this._getOscType(this._oscillator,"pulse")||this._getOscType(this._oscillator,"pwm")||(this._oscillator.partialCount=t)}set(t){return Reflect.has(t,"type")&&t.type&&(this.type=t.type),super.set(t),this}_createNewOscillator(t){if(t!==this._sourceType){this._sourceType=t;const e=Kc[t],n=this.now();if(this._oscillator){const t=this._oscillator;t.stop(n),this.context.setTimeout(()=>t.dispose(),this.blockTime)}this._oscillator=new e({context:this.context}),this.frequency.connect(this._oscillator.frequency),this.detune.connect(this._oscillator.detune),this._oscillator.connect(this.output),this._oscillator.onstop=()=>this.onstop(this),"started"===this.state&&this._oscillator.start(n)}}get phase(){return this._oscillator.phase}set phase(t){this._oscillator.phase=t}get sourceType(){return this._sourceType}set sourceType(t){let e="sine";"pwm"!==this._oscillator.type&&"pulse"!==this._oscillator.type&&(e=this._oscillator.type),"fm"===t?this.type="fm"+e:"am"===t?this.type="am"+e:"fat"===t?this.type="fat"+e:"oscillator"===t?this.type=e:"pulse"===t?this.type="pulse":"pwm"===t&&(this.type="pwm")}_getOscType(t,e){return t instanceof Kc[e]}get baseType(){return this._oscillator.baseType}set baseType(t){this._getOscType(this._oscillator,"pulse")||this._getOscType(this._oscillator,"pwm")||"pulse"===t||"pwm"===t||(this._oscillator.baseType=t)}get width(){return this._getOscType(this._oscillator,"pulse")?this._oscillator.width:void 0}get count(){return this._getOscType(this._oscillator,"fat")?this._oscillator.count:void 0}set count(t){this._getOscType(this._oscillator,"fat")&&$o(t)&&(this._oscillator.count=t)}get spread(){return this._getOscType(this._oscillator,"fat")?this._oscillator.spread:void 0}set spread(t){this._getOscType(this._oscillator,"fat")&&$o(t)&&(this._oscillator.spread=t)}get modulationType(){return this._getOscType(this._oscillator,"fm")||this._getOscType(this._oscillator,"am")?this._oscillator.modulationType:void 0}set modulationType(t){(this._getOscType(this._oscillator,"fm")||this._getOscType(this._oscillator,"am"))&&ta(t)&&(this._oscillator.modulationType=t)}get modulationIndex(){return this._getOscType(this._oscillator,"fm")?this._oscillator.modulationIndex:void 0}get harmonicity(){return this._getOscType(this._oscillator,"fm")||this._getOscType(this._oscillator,"am")?this._oscillator.harmonicity:void 0}get modulationFrequency(){return this._getOscType(this._oscillator,"pwm")?this._oscillator.modulationFrequency:void 0}asArray(t=1024){return ca(this,void 0,void 0,(function*(){return Fc(this,t)}))}dispose(){return super.dispose(),this.detune.dispose(),this.frequency.dispose(),this._oscillator.dispose(),this}}function Jc(t,e=1/0){const n=new WeakMap;return function(s,i){Reflect.defineProperty(s,i,{configurable:!0,enumerable:!0,get:function(){return n.get(this)},set:function(s){Wo(s,t,e),n.set(this,s)}})}}function tu(t,e=1/0){const n=new WeakMap;return function(s,i){Reflect.defineProperty(s,i,{configurable:!0,enumerable:!0,get:function(){return n.get(this)},set:function(s){Wo(this.toSeconds(s),t,e),n.set(this,s)}})}}class eu extends qc{constructor(){super(va(eu.getDefaults(),arguments,["url","onload"])),this.name="Player",this._activeSources=new Set;const t=va(eu.getDefaults(),arguments,["url","onload"]);this._buffer=new Ua({onload:this._onload.bind(this,t.onload),onerror:t.onerror,reverse:t.reverse,url:t.url}),this.autostart=t.autostart,this._loop=t.loop,this._loopStart=t.loopStart,this._loopEnd=t.loopEnd,this._playbackRate=t.playbackRate,this.fadeIn=t.fadeIn,this.fadeOut=t.fadeOut}static getDefaults(){return Object.assign(qc.getDefaults(),{autostart:!1,fadeIn:0,fadeOut:0,loop:!1,loopEnd:0,loopStart:0,onload:Wa,onerror:Wa,playbackRate:1,reverse:!1})}load(t){return ca(this,void 0,void 0,(function*(){return yield this._buffer.load(t),this._onload(),this}))}_onload(t=Wa){t(),this.autostart&&this.start()}_onSourceEnd(t){this.onstop(this),this._activeSources.delete(t),0!==this._activeSources.size||this._synced||"started"!==this._state.getValueAtTime(this.now())||(this._state.cancel(this.now()),this._state.setStateAtTime("stopped",this.now()))}start(t,e,n){return super.start(t,e,n),this}_start(t,e,n){e=this._loop?ba(e,this._loopStart):ba(e,0);let s=this.toSeconds(e);this._synced&&(s*=this._playbackRate);const i=n;n=ba(n,Math.max(this._buffer.duration-s,0));let r=this.toSeconds(n);r/=this._playbackRate,t=this.toSeconds(t);const o=new jc({url:this._buffer,context:this.context,fadeIn:this.fadeIn,fadeOut:this.fadeOut,loop:this._loop,loopEnd:this._loopEnd,loopStart:this._loopStart,onended:this._onSourceEnd.bind(this),playbackRate:this._playbackRate}).connect(this.output);this._loop||this._synced||(this._state.cancel(t+r),this._state.setStateAtTime("stopped",t+r,{implicitEnd:!0})),this._activeSources.add(o),this._loop&&Yo(i)?o.start(t,s):o.start(t,s,r-this.toSeconds(this.fadeOut))}_stop(t){const e=this.toSeconds(t);this._activeSources.forEach(t=>t.stop(e))}restart(t,e,n){return super.restart(t,e,n),this}_restart(t,e,n){this._stop(t),this._start(t,e,n)}seek(t,e){const n=this.toSeconds(e);if("started"===this._state.getValueAtTime(n)){const e=this.toSeconds(t);this._stop(n),this._start(n,e)}return this}setLoopPoints(t,e){return this.loopStart=t,this.loopEnd=e,this}get loopStart(){return this._loopStart}set loopStart(t){this._loopStart=t,this.buffer.loaded&&Wo(this.toSeconds(t),0,this.buffer.duration),this._activeSources.forEach(e=>{e.loopStart=t})}get loopEnd(){return this._loopEnd}set loopEnd(t){this._loopEnd=t,this.buffer.loaded&&Wo(this.toSeconds(t),0,this.buffer.duration),this._activeSources.forEach(e=>{e.loopEnd=t})}get buffer(){return this._buffer}set buffer(t){this._buffer.set(t)}get loop(){return this._loop}set loop(t){if(this._loop!==t&&(this._loop=t,this._activeSources.forEach(e=>{e.loop=t}),t)){const t=this._state.getNextState("stopped",this.now());t&&this._state.cancel(t.time)}}get playbackRate(){return this._playbackRate}set playbackRate(t){this._playbackRate=t;const e=this.now(),n=this._state.getNextState("stopped",e);n&&n.implicitEnd&&(this._state.cancel(n.time),this._activeSources.forEach(t=>t.cancelStop())),this._activeSources.forEach(n=>{n.playbackRate.setValueAtTime(t,e)})}get reverse(){return this._buffer.reverse}set reverse(t){this._buffer.reverse=t}get loaded(){return this._buffer.loaded}dispose(){return super.dispose(),this._activeSources.forEach(t=>t.dispose()),this._activeSources.clear(),this._buffer.dispose(),this}}aa([tu(0)],eu.prototype,"fadeIn",void 0),aa([tu(0)],eu.prototype,"fadeOut",void 0);class nu extends dc{constructor(){super(va(nu.getDefaults(),arguments,["attack","decay","sustain","release"])),this.name="Envelope",this._sig=new bc({context:this.context,value:0}),this.output=this._sig,this.input=void 0;const t=va(nu.getDefaults(),arguments,["attack","decay","sustain","release"]);this.attack=t.attack,this.decay=t.decay,this.sustain=t.sustain,this.release=t.release,this.attackCurve=t.attackCurve,this.releaseCurve=t.releaseCurve,this.decayCurve=t.decayCurve}static getDefaults(){return Object.assign(dc.getDefaults(),{attack:.01,attackCurve:"linear",decay:.1,decayCurve:"exponential",release:1,releaseCurve:"exponential",sustain:.5})}get value(){return this.getValueAtTime(this.now())}_getCurve(t,e){if(ta(t))return t;{let n;for(n in su)if(su[n][e]===t)return n;return t}}_setCurve(t,e,n){if(ta(n)&&Reflect.has(su,n)){const s=su[n];Ko(s)?"_decayCurve"!==t&&(this[t]=s[e]):this[t]=s}else{if(!Jo(n)||"_decayCurve"===t)throw new Error("Envelope: invalid curve: "+n);this[t]=n}}get attackCurve(){return this._getCurve(this._attackCurve,"In")}set attackCurve(t){this._setCurve("_attackCurve","In",t)}get releaseCurve(){return this._getCurve(this._releaseCurve,"Out")}set releaseCurve(t){this._setCurve("_releaseCurve","Out",t)}get decayCurve(){return this._decayCurve}set decayCurve(t){Bo(["linear","exponential"].some(e=>e===t),"Invalid envelope curve: "+t),this._decayCurve=t}triggerAttack(t,e=1){this.log("triggerAttack",t,e),t=this.toSeconds(t);const n=this.toSeconds(this.attack);let s=n;const i=this.toSeconds(this.decay),r=this.getValueAtTime(t);if(r>0){const t=1/s,e=1-r;s=e/t}if(s<this.sampleTime)this._sig.cancelScheduledValues(t),this._sig.setValueAtTime(e,t);else if("linear"===this._attackCurve)this._sig.linearRampTo(e,s,t);else if("exponential"===this._attackCurve)this._sig.targetRampTo(e,s,t);else{this._sig.cancelAndHoldAtTime(t);let n=this._attackCurve;for(let t=1;t<n.length;t++)if(n[t-1]<=r&&r<=n[t]){n=this._attackCurve.slice(t),n[0]=r;break}this._sig.setValueCurveAtTime(n,t,s,e)}if(i&&this.sustain<1){const n=e*this.sustain,r=t+s;this.log("decay",r),"linear"===this._decayCurve?this._sig.linearRampToValueAtTime(n,i+r):this._sig.exponentialApproachValueAtTime(n,r,i)}return this}triggerRelease(t){this.log("triggerRelease",t),t=this.toSeconds(t);const e=this.getValueAtTime(t);if(e>0){const n=this.toSeconds(this.release);n<this.sampleTime?this._sig.setValueAtTime(0,t):"linear"===this._releaseCurve?this._sig.linearRampTo(0,n,t):"exponential"===this._releaseCurve?this._sig.targetRampTo(0,n,t):(Bo(Jo(this._releaseCurve),"releaseCurve must be either 'linear', 'exponential' or an array"),this._sig.cancelAndHoldAtTime(t),this._sig.setValueCurveAtTime(this._releaseCurve,t,n,e))}return this}getValueAtTime(t){return this._sig.getValueAtTime(t)}triggerAttackRelease(t,e,n=1){return e=this.toSeconds(e),this.triggerAttack(e,n),this.triggerRelease(e+this.toSeconds(t)),this}cancel(t){return this._sig.cancelScheduledValues(this.toSeconds(t)),this}connect(t,e=0,n=0){return wc(this,t,e,n),this}asArray(t=1024){return ca(this,void 0,void 0,(function*(){const e=t/this.context.sampleRate,n=new za(1,e,this.context.sampleRate),s=this.toSeconds(this.attack)+this.toSeconds(this.decay),i=s+this.toSeconds(this.release),r=.1*i,o=i+r,a=new this.constructor(Object.assign(this.get(),{attack:e*this.toSeconds(this.attack)/o,decay:e*this.toSeconds(this.decay)/o,release:e*this.toSeconds(this.release)/o,context:n}));a._sig.toDestination(),a.triggerAttackRelease(e*(s+r)/o,0);const c=yield n.render();return c.getChannelData(0)}))}dispose(){return super.dispose(),this._sig.dispose(),this}}aa([tu(0)],nu.prototype,"attack",void 0),aa([tu(0)],nu.prototype,"decay",void 0),aa([Jc(0,1)],nu.prototype,"sustain",void 0),aa([tu(0)],nu.prototype,"release",void 0);const su=(()=>{const t=128;let e,n;const s=[];for(e=0;e<t;e++)s[e]=Math.sin(e/(t-1)*(Math.PI/2));const i=[],r=6.4;for(e=0;e<t-1;e++){n=e/(t-1);const s=Math.sin(n*(2*Math.PI)*r-Math.PI/2)+1;i[e]=s/10+.83*n}i[t-1]=1;const o=[],a=5;for(e=0;e<t;e++)o[e]=Math.ceil(e/(t-1)*a)/a;const c=[];for(e=0;e<t;e++)n=e/(t-1),c[e]=.5*(1-Math.cos(Math.PI*n));const u=[];for(e=0;e<t;e++){n=e/(t-1);const s=4*Math.pow(n,3)+.2,i=Math.cos(s*Math.PI*2*n);u[e]=Math.abs(i*(1-n))}function l(t){const e=new Array(t.length);for(let n=0;n<t.length;n++)e[n]=1-t[n];return e}function h(t){return t.slice(0).reverse()}return{bounce:{In:l(u),Out:u},cosine:{In:s,Out:h(s)},exponential:"exponential",linear:"linear",ripple:{In:i,Out:l(i)},sine:{In:c,Out:l(c)},step:{In:o,Out:l(o)}}})();class iu extends dc{constructor(){super(va(iu.getDefaults(),arguments)),this._scheduledEvents=[],this._synced=!1,this._original_triggerAttack=this.triggerAttack,this._original_triggerRelease=this.triggerRelease;const t=va(iu.getDefaults(),arguments);this._volume=this.output=new Ic({context:this.context,volume:t.volume}),this.volume=this._volume.volume,La(this,"volume")}static getDefaults(){return Object.assign(dc.getDefaults(),{volume:0})}sync(){return this._syncState()&&(this._syncMethod("triggerAttack",1),this._syncMethod("triggerRelease",0)),this}_syncState(){let t=!1;return this._synced||(this._synced=!0,t=!0),t}_syncMethod(t,e){const n=this["_original_"+t]=this[t];this[t]=(...t)=>{const s=t[e],i=this.context.transport.schedule(s=>{t[e]=s,n.apply(this,t)},s);this._scheduledEvents.push(i)}}unsync(){return this._scheduledEvents.forEach(t=>this.context.transport.clear(t)),this._scheduledEvents=[],this._synced&&(this._synced=!1,this.triggerAttack=this._original_triggerAttack,this.triggerRelease=this._original_triggerRelease),this}triggerAttackRelease(t,e,n,s){const i=this.toSeconds(n),r=this.toSeconds(e);return this.triggerAttack(t,i,s),this.triggerRelease(i+r),this}dispose(){return super.dispose(),this._volume.dispose(),this.unsync(),this._scheduledEvents=[],this}}class ru extends iu{constructor(){super(va(ru.getDefaults(),arguments));const t=va(ru.getDefaults(),arguments);this.portamento=t.portamento,this.onsilence=t.onsilence}static getDefaults(){return Object.assign(iu.getDefaults(),{detune:0,onsilence:Wa,portamento:0})}triggerAttack(t,e,n=1){this.log("triggerAttack",t,e,n);const s=this.toSeconds(e);return this._triggerEnvelopeAttack(s,n),this.setNote(t,s),this}triggerRelease(t){this.log("triggerRelease",t);const e=this.toSeconds(t);return this._triggerEnvelopeRelease(e),this}setNote(t,e){const n=this.toSeconds(e),s=t instanceof oc?t.toFrequency():t;if(this.portamento>0&&this.getLevelAtTime(n)>.05){const t=this.toSeconds(this.portamento);this.frequency.exponentialRampTo(s,t,n)}else this.frequency.setValueAtTime(s,n);return this}}aa([tu(0)],ru.prototype,"portamento",void 0);class ou extends nu{constructor(){super(va(ou.getDefaults(),arguments,["attack","decay","sustain","release"])),this.name="AmplitudeEnvelope",this._gainNode=new gc({context:this.context,gain:0}),this.output=this._gainNode,this.input=this._gainNode,this._sig.connect(this._gainNode.gain),this.output=this._gainNode,this.input=this._gainNode}dispose(){return super.dispose(),this._gainNode.dispose(),this}}class au extends ru{constructor(){super(va(au.getDefaults(),arguments)),this.name="Synth";const t=va(au.getDefaults(),arguments);this.oscillator=new Qc(Object.assign({context:this.context,detune:t.detune,onstop:()=>this.onsilence(this)},t.oscillator)),this.frequency=this.oscillator.frequency,this.detune=this.oscillator.detune,this.envelope=new ou(Object.assign({context:this.context},t.envelope)),this.oscillator.chain(this.envelope,this.output),La(this,["oscillator","frequency","detune","envelope"])}static getDefaults(){return Object.assign(ru.getDefaults(),{envelope:Object.assign(wa(nu.getDefaults(),Object.keys(dc.getDefaults())),{attack:.005,decay:.1,release:1,sustain:.3}),oscillator:Object.assign(wa(Qc.getDefaults(),[...Object.keys(qc.getDefaults()),"frequency","detune"]),{type:"triangle"})})}_triggerEnvelopeAttack(t,e){if(this.envelope.triggerAttack(t,e),this.oscillator.start(t),0===this.envelope.sustain){const e=this.toSeconds(this.envelope.attack),n=this.toSeconds(this.envelope.decay);this.oscillator.stop(t+e+n)}}_triggerEnvelopeRelease(t){this.envelope.triggerRelease(t),this.oscillator.stop(t+this.toSeconds(this.envelope.release))}getLevelAtTime(t){return t=this.toSeconds(t),this.envelope.getValueAtTime(t)}dispose(){return super.dispose(),this.oscillator.dispose(),this.envelope.dispose(),this}}class cu extends au{constructor(){super(va(cu.getDefaults(),arguments)),this.name="MembraneSynth",this.portamento=0;const t=va(cu.getDefaults(),arguments);this.pitchDecay=t.pitchDecay,this.octaves=t.octaves,La(this,["oscillator","envelope"])}static getDefaults(){return _a(ru.getDefaults(),au.getDefaults(),{envelope:{attack:.001,attackCurve:"exponential",decay:.4,release:1.4,sustain:.01},octaves:10,oscillator:{type:"sine"},pitchDecay:.05})}setNote(t,e){const n=this.toSeconds(e),s=this.toFrequency(t instanceof oc?t.toFrequency():t),i=s*this.octaves;return this.oscillator.frequency.setValueAtTime(i,n),this.oscillator.frequency.exponentialRampToValueAtTime(s,n+this.toSeconds(this.pitchDecay)),this}dispose(){return super.dispose(),this}}aa([Jc(0)],cu.prototype,"octaves",void 0),aa([tu(0)],cu.prototype,"pitchDecay",void 0);const uu=new Set;function lu(t){uu.add(t)}function hu(t,e){const n=`registerProcessor("${t}", ${e})`;uu.add(n)}const pu='\n\t/**\n\t * The base AudioWorkletProcessor for use in Tone.js. Works with the [[ToneAudioWorklet]]. \n\t */\n\tclass ToneAudioWorkletProcessor extends AudioWorkletProcessor {\n\n\t\tconstructor(options) {\n\t\t\t\n\t\t\tsuper(options);\n\t\t\t/**\n\t\t\t * If the processor was disposed or not. Keep alive until it\'s disposed.\n\t\t\t */\n\t\t\tthis.disposed = false;\n\t\t \t/** \n\t\t\t * The number of samples in the processing block\n\t\t\t */\n\t\t\tthis.blockSize = 128;\n\t\t\t/**\n\t\t\t * the sample rate\n\t\t\t */\n\t\t\tthis.sampleRate = sampleRate;\n\n\t\t\tthis.port.onmessage = (event) => {\n\t\t\t\t// when it receives a dispose \n\t\t\t\tif (event.data === "dispose") {\n\t\t\t\t\tthis.disposed = true;\n\t\t\t\t}\n\t\t\t};\n\t\t}\n\t}\n';lu(pu);const du="\n\t/**\n\t * Abstract class for a single input/output processor. \n\t * has a 'generate' function which processes one sample at a time\n\t */\n\tclass SingleIOProcessor extends ToneAudioWorkletProcessor {\n\n\t\tconstructor(options) {\n\t\t\tsuper(Object.assign(options, {\n\t\t\t\tnumberOfInputs: 1,\n\t\t\t\tnumberOfOutputs: 1\n\t\t\t}));\n\t\t\t/**\n\t\t\t * Holds the name of the parameter and a single value of that\n\t\t\t * parameter at the current sample\n\t\t\t * @type { [name: string]: number }\n\t\t\t */\n\t\t\tthis.params = {}\n\t\t}\n\n\t\t/**\n\t\t * Generate an output sample from the input sample and parameters\n\t\t * @abstract\n\t\t * @param input number\n\t\t * @param channel number\n\t\t * @param parameters { [name: string]: number }\n\t\t * @returns number\n\t\t */\n\t\tgenerate(){}\n\n\t\t/**\n\t\t * Update the private params object with the \n\t\t * values of the parameters at the given index\n\t\t * @param parameters { [name: string]: Float32Array },\n\t\t * @param index number\n\t\t */\n\t\tupdateParams(parameters, index) {\n\t\t\tfor (const paramName in parameters) {\n\t\t\t\tconst param = parameters[paramName];\n\t\t\t\tif (param.length > 1) {\n\t\t\t\t\tthis.params[paramName] = parameters[paramName][index];\n\t\t\t\t} else {\n\t\t\t\t\tthis.params[paramName] = parameters[paramName][0];\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * Process a single frame of the audio\n\t\t * @param inputs Float32Array[][]\n\t\t * @param outputs Float32Array[][]\n\t\t */\n\t\tprocess(inputs, outputs, parameters) {\n\t\t\tconst input = inputs[0];\n\t\t\tconst output = outputs[0];\n\t\t\t// get the parameter values\n\t\t\tconst channelCount = Math.max(input && input.length || 0, output.length);\n\t\t\tfor (let sample = 0; sample < this.blockSize; sample++) {\n\t\t\t\tthis.updateParams(parameters, sample);\n\t\t\t\tfor (let channel = 0; channel < channelCount; channel++) {\n\t\t\t\t\tconst inputSample = input && input.length ? input[channel][sample] : 0;\n\t\t\t\t\toutput[channel][sample] = this.generate(inputSample, channel, this.params);\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn !this.disposed;\n\t\t}\n\t};\n";lu(du);const fu="\n\t/**\n\t * A multichannel buffer for use within an AudioWorkletProcessor as a delay line\n\t */\n\tclass DelayLine {\n\t\t\n\t\tconstructor(size, channels) {\n\t\t\tthis.buffer = [];\n\t\t\tthis.writeHead = []\n\t\t\tthis.size = size;\n\n\t\t\t// create the empty channels\n\t\t\tfor (let i = 0; i < channels; i++) {\n\t\t\t\tthis.buffer[i] = new Float32Array(this.size);\n\t\t\t\tthis.writeHead[i] = 0;\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * Push a value onto the end\n\t\t * @param channel number\n\t\t * @param value number\n\t\t */\n\t\tpush(channel, value) {\n\t\t\tthis.writeHead[channel] += 1;\n\t\t\tif (this.writeHead[channel] > this.size) {\n\t\t\t\tthis.writeHead[channel] = 0;\n\t\t\t}\n\t\t\tthis.buffer[channel][this.writeHead[channel]] = value;\n\t\t}\n\n\t\t/**\n\t\t * Get the recorded value of the channel given the delay\n\t\t * @param channel number\n\t\t * @param delay number delay samples\n\t\t */\n\t\tget(channel, delay) {\n\t\t\tlet readHead = this.writeHead[channel] - Math.floor(delay);\n\t\t\tif (readHead < 0) {\n\t\t\t\treadHead += this.size;\n\t\t\t}\n\t\t\treturn this.buffer[channel][readHead];\n\t\t}\n\t}\n";lu(fu);const mu="feedback-comb-filter",_u='\n\tclass FeedbackCombFilterWorklet extends SingleIOProcessor {\n\n\t\tconstructor(options) {\n\t\t\tsuper(options);\n\t\t\tthis.delayLine = new DelayLine(this.sampleRate, options.channelCount || 2);\n\t\t}\n\n\t\tstatic get parameterDescriptors() {\n\t\t\treturn [{\n\t\t\t\tname: "delayTime",\n\t\t\t\tdefaultValue: 0.1,\n\t\t\t\tminValue: 0,\n\t\t\t\tmaxValue: 1,\n\t\t\t\tautomationRate: "k-rate"\n\t\t\t}, {\n\t\t\t\tname: "feedback",\n\t\t\t\tdefaultValue: 0.5,\n\t\t\t\tminValue: 0,\n\t\t\t\tmaxValue: 0.9999,\n\t\t\t\tautomationRate: "k-rate"\n\t\t\t}];\n\t\t}\n\n\t\tgenerate(input, channel, parameters) {\n\t\t\tconst delayedSample = this.delayLine.get(channel, parameters.delayTime * this.sampleRate);\n\t\t\tthis.delayLine.push(channel, input + delayedSample * parameters.feedback);\n\t\t\treturn delayedSample;\n\t\t}\n\t}\n';hu(mu,_u);class gu extends iu{constructor(){super(va(gu.getDefaults(),arguments,["urls","onload","baseUrl"],"urls")),this.name="Sampler",this._activeSources=new Map;const t=va(gu.getDefaults(),arguments,["urls","onload","baseUrl"],"urls"),e={};Object.keys(t.urls).forEach(n=>{const s=parseInt(n,10);if(Bo(ea(n)||$o(s)&&isFinite(s),"url key is neither a note or midi pitch: "+n),ea(n)){const s=new oc(this.context,n).toMidi();e[s]=t.urls[n]}else $o(s)&&isFinite(s)&&(e[s]=t.urls[s])}),this._buffers=new Ac({urls:e,onload:t.onload,baseUrl:t.baseUrl,onerror:t.onerror}),this.attack=t.attack,this.release=t.release,this.curve=t.curve,this._buffers.loaded&&Promise.resolve().then(t.onload)}static getDefaults(){return Object.assign(iu.getDefaults(),{attack:0,baseUrl:"",curve:"exponential",onload:Wa,onerror:Wa,release:.1,urls:{}})}_findClosest(t){const e=96;let n=0;while(n<e){if(this._buffers.has(t+n))return-n;if(this._buffers.has(t-n))return n;n++}throw new Error("No available buffers for note: "+t)}triggerAttack(t,e,n=1){return this.log("triggerAttack",t,e,n),Array.isArray(t)||(t=[t]),t.forEach(t=>{const s=nc(new oc(this.context,t).toFrequency()),i=Math.round(s),r=s-i,o=this._findClosest(i),a=i-o,c=this._buffers.get(a),u=Ka(o+r),l=new jc({url:c,context:this.context,curve:this.curve,fadeIn:this.attack,fadeOut:this.release,playbackRate:u}).connect(this.output);l.start(e,0,c.duration/u,n),Jo(this._activeSources.get(i))||this._activeSources.set(i,[]),this._activeSources.get(i).push(l),l.onended=()=>{if(this._activeSources&&this._activeSources.has(i)){const t=this._activeSources.get(i),e=t.indexOf(l);-1!==e&&t.splice(e,1)}}}),this}triggerRelease(t,e){return this.log("triggerRelease",t,e),Array.isArray(t)||(t=[t]),t.forEach(t=>{const n=new oc(this.context,t).toMidi();if(this._activeSources.has(n)&&this._activeSources.get(n).length){const t=this._activeSources.get(n);e=this.toSeconds(e),t.forEach(t=>{t.stop(e)}),this._activeSources.set(n,[])}}),this}releaseAll(t){const e=this.toSeconds(t);return this._activeSources.forEach(t=>{while(t.length){const n=t.shift();n.stop(e)}}),this}sync(){return this._syncState()&&(this._syncMethod("triggerAttack",1),this._syncMethod("triggerRelease",1)),this}triggerAttackRelease(t,e,n,s=1){const i=this.toSeconds(n);return this.triggerAttack(t,i,s),Jo(e)?(Bo(Jo(t),"notes must be an array when duration is array"),t.forEach((t,n)=>{const s=e[Math.min(n,e.length-1)];this.triggerRelease(t,i+this.toSeconds(s))})):this.triggerRelease(t,i+this.toSeconds(e)),this}add(t,e,n){if(Bo(ea(t)||isFinite(t),"note must be a pitch or midi: "+t),ea(t)){const s=new oc(this.context,t).toMidi();this._buffers.add(s,e,n)}else this._buffers.add(t,e,n);return this}get loaded(){return this._buffers.loaded}dispose(){return super.dispose(),this._buffers.dispose(),this._activeSources.forEach(t=>{t.forEach(t=>t.dispose())}),this._activeSources.clear(),this}}aa([tu(0)],gu.prototype,"attack",void 0),aa([tu(0)],gu.prototype,"release",void 0);class vu extends dc{constructor(){super(Object.assign(va(vu.getDefaults(),arguments,["pan"]))),this.name="Panner",this._panner=this.context.createStereoPanner(),this.input=this._panner,this.output=this._panner;const t=va(vu.getDefaults(),arguments,["pan"]);this.pan=new pc({context:this.context,param:this._panner.pan,value:t.pan,minValue:-1,maxValue:1}),this._panner.channelCount=t.channelCount,this._panner.channelCountMode="explicit",La(this,"pan")}static getDefaults(){return Object.assign(dc.getDefaults(),{pan:0,channelCount:1})}dispose(){return super.dispose(),this._panner.disconnect(),this.pan.dispose(),this}}const yu="bit-crusher",bu="\n\tclass BitCrusherWorklet extends SingleIOProcessor {\n\n\t\tstatic get parameterDescriptors() {\n\t\t\treturn [{\n\t\t\t\tname: \"bits\",\n\t\t\t\tdefaultValue: 12,\n\t\t\t\tminValue: 1,\n\t\t\t\tmaxValue: 16,\n\t\t\t\tautomationRate: 'k-rate'\n\t\t\t}];\n\t\t}\n\n\t\tgenerate(input, _channel, parameters) {\n\t\t\tconst step = Math.pow(0.5, parameters.bits - 1);\n\t\t\tconst val = step * Math.floor(input / step + 0.5);\n\t\t\treturn val;\n\t\t}\n\t}\n";hu(yu,bu);class wu extends dc{constructor(){super(va(wu.getDefaults(),arguments,["solo"])),this.name="Solo";const t=va(wu.getDefaults(),arguments,["solo"]);this.input=this.output=new gc({context:this.context}),wu._allSolos.has(this.context)||wu._allSolos.set(this.context,new Set),wu._allSolos.get(this.context).add(this),this.solo=t.solo}static getDefaults(){return Object.assign(dc.getDefaults(),{solo:!1})}get solo(){return this._isSoloed()}set solo(t){t?this._addSolo():this._removeSolo(),wu._allSolos.get(this.context).forEach(t=>t._updateSolo())}get muted(){return 0===this.input.gain.value}_addSolo(){wu._soloed.has(this.context)||wu._soloed.set(this.context,new Set),wu._soloed.get(this.context).add(this)}_removeSolo(){wu._soloed.has(this.context)&&wu._soloed.get(this.context).delete(this)}_isSoloed(){return wu._soloed.has(this.context)&&wu._soloed.get(this.context).has(this)}_noSolos(){return!wu._soloed.has(this.context)||wu._soloed.has(this.context)&&0===wu._soloed.get(this.context).size}_updateSolo(){this._isSoloed()||this._noSolos()?this.input.gain.value=1:this.input.gain.value=0}dispose(){return super.dispose(),wu._allSolos.get(this.context).delete(this),this._removeSolo(),this}}wu._allSolos=new Map,wu._soloed=new Map;class xu extends dc{constructor(){super(va(xu.getDefaults(),arguments,["pan","volume"])),this.name="PanVol";const t=va(xu.getDefaults(),arguments,["pan","volume"]);this._panner=this.input=new vu({context:this.context,pan:t.pan,channelCount:t.channelCount}),this.pan=this._panner.pan,this._volume=this.output=new Ic({context:this.context,volume:t.volume}),this.volume=this._volume.volume,this._panner.connect(this._volume),this.mute=t.mute,La(this,["pan","volume"])}static getDefaults(){return Object.assign(dc.getDefaults(),{mute:!1,pan:0,volume:0,channelCount:1})}get mute(){return this._volume.mute}set mute(t){this._volume.mute=t}dispose(){return super.dispose(),this._panner.dispose(),this.pan.dispose(),this._volume.dispose(),this.volume.dispose(),this}}class Tu extends dc{constructor(){super(va(Tu.getDefaults(),arguments,["volume","pan"])),this.name="Channel";const t=va(Tu.getDefaults(),arguments,["volume","pan"]);this._solo=this.input=new wu({solo:t.solo,context:this.context}),this._panVol=this.output=new xu({context:this.context,pan:t.pan,volume:t.volume,mute:t.mute,channelCount:t.channelCount}),this.pan=this._panVol.pan,this.volume=this._panVol.volume,this._solo.connect(this._panVol),La(this,["pan","volume"])}static getDefaults(){return Object.assign(dc.getDefaults(),{pan:0,volume:0,mute:!1,solo:!1,channelCount:1})}get solo(){return this._solo.solo}set solo(t){this._solo.solo=t}get muted(){return this._solo.muted||this.mute}get mute(){return this._panVol.mute}set mute(t){this._panVol.mute=t}_getBus(t){return Tu.buses.has(t)||Tu.buses.set(t,new gc({context:this.context})),Tu.buses.get(t)}send(t,e=0){const n=this._getBus(t),s=new gc({context:this.context,units:"decibels",gain:e});return this.connect(s),s.connect(n),s}receive(t){const e=this._getBus(t);return e.connect(this),this}dispose(){return super.dispose(),this._panVol.dispose(),this.pan.dispose(),this.volume.dispose(),this._solo.dispose(),this}}Tu.buses=new Map;class Cu extends dc{constructor(){super(...arguments),this.name="Listener",this.positionX=new pc({context:this.context,param:this.context.rawContext.listener.positionX}),this.positionY=new pc({context:this.context,param:this.context.rawContext.listener.positionY}),this.positionZ=new pc({context:this.context,param:this.context.rawContext.listener.positionZ}),this.forwardX=new pc({context:this.context,param:this.context.rawContext.listener.forwardX}),this.forwardY=new pc({context:this.context,param:this.context.rawContext.listener.forwardY}),this.forwardZ=new pc({context:this.context,param:this.context.rawContext.listener.forwardZ}),this.upX=new pc({context:this.context,param:this.context.rawContext.listener.upX}),this.upY=new pc({context:this.context,param:this.context.rawContext.listener.upY}),this.upZ=new pc({context:this.context,param:this.context.rawContext.listener.upZ})}static getDefaults(){return Object.assign(dc.getDefaults(),{positionX:0,positionY:0,positionZ:0,forwardX:0,forwardY:0,forwardZ:-1,upX:0,upY:1,upZ:0})}dispose(){return super.dispose(),this.positionX.dispose(),this.positionY.dispose(),this.positionZ.dispose(),this.forwardX.dispose(),this.forwardY.dispose(),this.forwardZ.dispose(),this.upX.dispose(),this.upY.dispose(),this.upZ.dispose(),this}}Ia(t=>{t.listener=new Cu({context:t})}),Ra(t=>{t.listener.dispose()});Ya().transport;Ya().destination,Ya().destination;Ya().listener;Ya().draw;Ya();var Su={data:function(){return{synth:null,notesIndexesByKey:{},notes:[],allNotes:["C","D","E","F","G","A","B"],whiteNoteWidthSize:0,isMousePressed:!1}},props:{allKeys:{type:Array,default:function(){return["`","1","2","3","4","5","6","7","8","9","0","-","=","q","w","e","r","t","y","u","i","o","p","[","]","\\","a","s","d","f","g","h","j","k","l",";","z","x","c","v","b","n","m",",","."]}},whiteNoteColor:{type:String,default:"#1eb7eb"},blackNoteColor:{type:String,default:"#f9bb2d"},showKeys:{type:Boolean,default:!1},showNotes:{type:Boolean,default:!1},startOctave:{type:Number,default:2},endOctave:{type:Number,default:4},sustain:{type:Boolean,default:!1}},watch:{startOctave:function(t){this.startOctave=t,this.regenerate()},endOctave:function(t){this.endOctave=t,this.regenerate()},allKeys:function(t){this.allKeys=t,this.regenerate()}},created:function(){var t=this;this.synth=(new au).toDestination(),this.generateNotes(),this.generateNotesIndexesByKey(),window.addEventListener("keydown",(function(e){var n=e.key,s=t.notesIndexesByKey[n];if(void 0!=s){var i=t.notes[s].key===n?t.notes[s]:t.notes[s].blackNote;t.playNote(i)}})),window.addEventListener("keyup",(function(e){var n=e.key,s=t.notesIndexesByKey[n];if(void 0!=s){var i=t.notes[s].key===n?t.notes[s]:t.notes[s].blackNote;t.removePressedKey(i)}})),window.onmouseup=function(){t.isMousePressed=!1}},destroyed:function(){window.removeEventListener("keydown",(function(){})),window.removeEventListener("keyup",(function(){})),window.removeEventListener("onmouseup",(function(){}))},methods:{playNote:function(t){t.pressed||(this.synth.triggerAttackRelease(t.note,this.sustain?"2n":"8n"),t.pressed=!0)},playNoteMouse:function(t){this.isMousePressed=!0,this.playNote(t)},playNoteHover:function(t){this.isMousePressed&&this.playNote(t)},removePressedKey:function(t){t.pressed=!1},removePressedKeyMouse:function(t){this.isMousePressed=!1,this.removePressedKey(t)},whiteNoteBackground:function(t){return t?this.whiteNoteColor:"linear-gradient(to bottom, #eee 0%, #fff 100%)"},blackNoteBackground:function(t){return t?this.blackNoteColor:"linear-gradient(45deg, #555, #222)"},generateNotes:function(){var t=0,e=0;this.notes.length=0;for(var n=this.startOctave;n<=this.endOctave;n++){while(e<this.allNotes.length){var s=this.allNotes[e],i={note:s+n,key:this.allKeys[t++],pressed:!1};if("B"!==s&&"E"!==s){var r={note:s+"#"+n,key:this.allKeys[t++],pressed:!1};i["blackNote"]=r}if(this.notes.push(i),n===this.endOctave&&"B"===s)break;e++}e=0}this.whiteNoteWidthSize=100/this.notes.length},generateNotesIndexesByKey:function(){this.notesIndexesByKey={};for(var t=0;t<this.notes.length;t++)this.notesIndexesByKey[this.notes[t].key]=t,void 0!=this.notes[t].blackNote&&(this.notesIndexesByKey[this.notes[t].blackNote.key]=t)},regenerate:function(){this.generateNotes(),this.generateNotesIndexesByKey()}}},Au=Su;n("73b2");function ku(t,e,n,s,i,r,o,a){var c,u="function"===typeof t?t.options:t;if(e&&(u.render=e,u.staticRenderFns=n,u._compiled=!0),s&&(u.functional=!0),r&&(u._scopeId="data-v-"+r),o?(c=function(t){t=t||this.$vnode&&this.$vnode.ssrContext||this.parent&&this.parent.$vnode&&this.parent.$vnode.ssrContext,t||"undefined"===typeof __VUE_SSR_CONTEXT__||(t=__VUE_SSR_CONTEXT__),i&&i.call(this,t),t&&t._registeredComponents&&t._registeredComponents.add(o)},u._ssrRegister=c):i&&(c=a?function(){i.call(this,(u.functional?this.parent:this).$root.$options.shadowRoot)}:i),c)if(u.functional){u._injectStyles=c;var l=u.render;u.render=function(t,e){return c.call(e),l(t,e)}}else{var h=u.beforeCreate;u.beforeCreate=h?[].concat(h,c):[c]}return{exports:t,options:u}}var Ou=ku(Au,o,a,!1,null,null,null),Mu=Ou.exports;e["default"]=Mu},fb6a:function(t,e,n){"use strict";var s=n("23e7"),i=n("861d"),r=n("e8b5"),o=n("23cb"),a=n("50c4"),c=n("fc6a"),u=n("8418"),l=n("b622"),h=n("1dde"),p=n("ae40"),d=h("slice"),f=p("slice",{ACCESSORS:!0,0:0,1:2}),m=l("species"),_=[].slice,g=Math.max;s({target:"Array",proto:!0,forced:!d||!f},{slice:function(t,e){var n,s,l,h=c(this),p=a(h.length),d=o(t,p),f=o(void 0===e?p:e,p);if(r(h)&&(n=h.constructor,"function"!=typeof n||n!==Array&&!r(n.prototype)?i(n)&&(n=n[m],null===n&&(n=void 0)):n=void 0,n===Array||void 0===n))return _.call(h,d,f);for(s=new(void 0===n?Array:n)(g(f-d,0)),l=0;d<f;d++,l++)d in h&&u(s,l,h[d]);return s.length=l,s}})},fc6a:function(t,e,n){var s=n("44ad"),i=n("1d80");t.exports=function(t){return s(i(t))}},fdbc:function(t,e){t.exports={CSSRuleList:0,CSSStyleDeclaration:0,CSSValueList:0,ClientRectList:0,DOMRectList:0,DOMStringList:0,DOMTokenList:1,DataTransferItemList:0,FileList:0,HTMLAllCollection:0,HTMLCollection:0,HTMLFormElement:0,HTMLSelectElement:0,MediaList:0,MimeTypeArray:0,NamedNodeMap:0,NodeList:1,PaintRequestList:0,Plugin:0,PluginArray:0,SVGLengthList:0,SVGNumberList:0,SVGPathSegList:0,SVGPointList:0,SVGStringList:0,SVGTransformList:0,SourceBufferList:0,StyleSheetList:0,TextTrackCueList:0,TextTrackList:0,TouchList:0}},fdbf:function(t,e,n){var s=n("4930");t.exports=s&&!Symbol.sham&&"symbol"==typeof Symbol.iterator}})["default"]}));
//# sourceMappingURL=pianoKeyboard.umd.min.js.map